From 745652e22703f122b3a61ec37d5ad9c133bef39a Mon Sep 17 00:00:00 2001 From: Army Date: Tue, 10 Oct 2023 21:05:04 +0800 Subject: [PATCH] chore: 0.63.7 --- index.es.js | 12869 ++++++++++++++++++++++---------------------- index.es.js.map | 2 +- index.js | 12873 +++++++++++++++++++++++---------------------- index.js.map | 2 +- package.json | 2 +- src/node/Text.js | 10 +- src/node/Xom.js | 12 +- 7 files changed, 12892 insertions(+), 12878 deletions(-) diff --git a/index.es.js b/index.es.js index a6c499979..f600c893d 100644 --- a/index.es.js +++ b/index.es.js @@ -1,17 +1,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function (obj) { - return typeof obj; - }; - } else { - _typeof = function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }, _typeof(obj); } function _classCallCheck(instance, Constructor) { @@ -33,6 +27,9 @@ function _defineProperties(target, props) { function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); return Constructor; } @@ -63,22 +60,24 @@ function _inherits(subClass, superClass) { configurable: true } }); + Object.defineProperty(subClass, "prototype", { + writable: false + }); if (superClass) _setPrototypeOf(subClass, superClass); } function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; - return _setPrototypeOf(o, p); } @@ -106,6 +105,8 @@ function _assertThisInitialized(self) { function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; + } else if (call !== void 0) { + throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); @@ -139,9 +140,9 @@ function _superPropBase(object, property) { return object; } -function _get(target, property, receiver) { +function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get; + _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); @@ -150,14 +151,14 @@ function _get(target, property, receiver) { var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { - return desc.get.call(receiver); + return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } - return _get(target, property, receiver || target); + return _get.apply(this, arguments); } function _slicedToArray(arr, i) { @@ -235,7 +236,7 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -var STYLE_KEY = { +var STYLE_KEY$5 = { POSITION: 0, DISPLAY: 1, TOP: 2, @@ -352,7 +353,7 @@ function style2Lower(s) { var STYLE2UPPER_MAP = {}; -function style2Upper(s) { +function style2Upper$2(s) { STYLE2UPPER_MAP[s] = STYLE2UPPER_MAP[s] || s.replace(/([a-z\d_])([A-Z])/g, function ($0, $1, $2) { return $1 + '_' + $2; }).toUpperCase(); @@ -360,13 +361,13 @@ function style2Upper(s) { } var STYLE_R_KEY = {}; -var STYLE_RV_KEY = {}; +var STYLE_RV_KEY$2 = {}; var STYLE_V_KEY = {}; -Object.keys(STYLE_KEY).forEach(function (k) { - var k2 = STYLE_KEY[k]; +Object.keys(STYLE_KEY$5).forEach(function (k) { + var k2 = STYLE_KEY$5[k]; STYLE_R_KEY[k2] = k; var l = style2Lower(k); - STYLE_RV_KEY[k2] = l; + STYLE_RV_KEY$2[k2] = l; STYLE_V_KEY[l] = k2; }); // Root的update过程使用 @@ -432,30 +433,30 @@ var STRUCT_KEY = { STRUCT_HAS_MASK: 6 }; var enums = { - STYLE_KEY: STYLE_KEY, + STYLE_KEY: STYLE_KEY$5, // 大写常量为k,数字为值 STYLE_R_KEY: STYLE_R_KEY, // 数字为k,大写常量为值 - STYLE_RV_KEY: STYLE_RV_KEY, + STYLE_RV_KEY: STYLE_RV_KEY$2, // 数字为k,小写为值 STYLE_V_KEY: STYLE_V_KEY, // 小写为k,数字为值 style2Lower: style2Lower, - style2Upper: style2Upper, + style2Upper: style2Upper$2, UPDATE_KEY: UPDATE_KEY, KEY_FRAME_KEY: KEY_FRAME_KEY, NODE_KEY: NODE_KEY, STRUCT_KEY: STRUCT_KEY }; -var _enums$STRUCT_KEY = enums.STRUCT_KEY, - STRUCT_NODE = _enums$STRUCT_KEY.STRUCT_NODE, - STRUCT_INDEX = _enums$STRUCT_KEY.STRUCT_INDEX, - STRUCT_CHILD_INDEX = _enums$STRUCT_KEY.STRUCT_CHILD_INDEX, - STRUCT_LV = _enums$STRUCT_KEY.STRUCT_LV, - _enums$NODE_KEY = enums.NODE_KEY, - NODE_IS_DESTROYED = _enums$NODE_KEY.NODE_IS_DESTROYED, - NODE_STRUCT = _enums$NODE_KEY.NODE_STRUCT; +var _enums$STRUCT_KEY$3 = enums.STRUCT_KEY, + STRUCT_NODE$2 = _enums$STRUCT_KEY$3.STRUCT_NODE, + STRUCT_INDEX$2 = _enums$STRUCT_KEY$3.STRUCT_INDEX, + STRUCT_CHILD_INDEX$1 = _enums$STRUCT_KEY$3.STRUCT_CHILD_INDEX, + STRUCT_LV$2 = _enums$STRUCT_KEY$3.STRUCT_LV, + _enums$NODE_KEY$a = enums.NODE_KEY, + NODE_IS_DESTROYED$2 = _enums$NODE_KEY$a.NODE_IS_DESTROYED, + NODE_STRUCT$4 = _enums$NODE_KEY$a.NODE_STRUCT; var Node = /*#__PURE__*/function () { function Node() { @@ -483,12 +484,12 @@ var Node = /*#__PURE__*/function () { value: function __structure(i, lv, j) { var _this$__config$NODE_S; - return this.__config[NODE_STRUCT] = (_this$__config$NODE_S = {}, _defineProperty(_this$__config$NODE_S, STRUCT_NODE, this), _defineProperty(_this$__config$NODE_S, STRUCT_INDEX, i), _defineProperty(_this$__config$NODE_S, STRUCT_CHILD_INDEX, j), _defineProperty(_this$__config$NODE_S, STRUCT_LV, lv), _this$__config$NODE_S); + return this.__config[NODE_STRUCT$4] = (_this$__config$NODE_S = {}, _defineProperty(_this$__config$NODE_S, STRUCT_NODE$2, this), _defineProperty(_this$__config$NODE_S, STRUCT_INDEX$2, i), _defineProperty(_this$__config$NODE_S, STRUCT_CHILD_INDEX$1, j), _defineProperty(_this$__config$NODE_S, STRUCT_LV$2, lv), _this$__config$NODE_S); } }, { key: "__modifyStruct", value: function __modifyStruct(root) { - var struct = this.__config[NODE_STRUCT]; + var struct = this.__config[NODE_STRUCT$4]; return [struct, 0]; } }, { @@ -516,7 +517,7 @@ var Node = /*#__PURE__*/function () { }, { key: "__destroy", value: function __destroy() { - this.__config[NODE_IS_DESTROYED] = true; + this.__config[NODE_IS_DESTROYED$2] = true; } }, { key: "x", @@ -619,7 +620,7 @@ var Node = /*#__PURE__*/function () { }, { key: "isDestroyed", get: function get() { - return this.__config[NODE_IS_DESTROYED]; + return this.__config[NODE_IS_DESTROYED$2]; } }]); @@ -632,7 +633,7 @@ var mode = { WEBGL: 2 }; -var o = { +var o$4 = { AUTO: 0, PX: 1, PERCENT: 2, @@ -655,30 +656,30 @@ var o = { var n = parseFloat(v) || 0; if (/%$/.test(v)) { - return [n, o.PERCENT]; + return [n, o$4.PERCENT]; } else if (/px$/i.test(v)) { - return [n, o.PX]; + return [n, o$4.PX]; } else if (/deg$/i.test(v)) { - return [n, o.DEG]; + return [n, o$4.DEG]; } else if (/rem$/i.test(v)) { - return [n, o.REM]; + return [n, o$4.REM]; } else if (/vw$/i.test(v)) { - return [n, o.VW]; + return [n, o$4.VW]; } else if (/vh$/i.test(v)) { - return [n, o.VH]; + return [n, o$4.VH]; } else if (/em$/i.test(v)) { - return [n, o.EM]; + return [n, o$4.EM]; } else if (/vw$/i.test(v)) { - return [n, o.VW]; + return [n, o$4.VW]; } else if (/vh$/i.test(v)) { - return [n, o.VH]; + return [n, o$4.VH]; } - return [n, o.NUMBER]; + return [n, o$4.NUMBER]; } }; -var o$1 = { +var o$3 = { info: { arial: { lhr: 1.14990234375, @@ -773,7 +774,7 @@ var o$1 = { Object.assign(this.info[name.toLowerCase()].padding, padding); } }; -o$1.info['宋体'] = o$1.info.simsun; +o$3.info['宋体'] = o$3.info.simsun; var reg = { position: /(([-+]?[\d.]+[pxremvwh%]*)|(left|top|right|bottom|center)){1,2}/ig, @@ -783,17 +784,17 @@ var reg = { }; // 生成4*4单位矩阵 -function identity() { +function identity$1() { return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; } // 矩阵a*b,固定两个matrix都是长度16 -function multiply(a, b) { - if (isE(a)) { +function multiply$2(a, b) { + if (isE$3(a)) { return b; } - if (isE(b)) { + if (isE$3(b)) { return a; } @@ -813,7 +814,7 @@ function multiply(a, b) { return c; } -function calPoint(point, m) { +function calPoint$2(point, m) { var _point = _slicedToArray(point, 4), x = _point[0], y = _point[1], @@ -824,7 +825,7 @@ function calPoint(point, m) { w = 1; } - if (m && !isE(m)) { + if (m && !isE$3(m)) { if (m.length === 16) { z = z || 0; @@ -872,7 +873,7 @@ function calPoint(point, m) { */ -function inverse(m) { +function inverse$1(m) { if (m.length === 16) { return inverse4(m); } @@ -899,7 +900,7 @@ function inverse(m) { } // 16位或者6位单位矩阵判断,空也认为是 -function isE(m) { +function isE$3(m) { if (!m) { return true; } @@ -950,7 +951,7 @@ function inverse4(s) { var det = s[0] * inv[0] + s[1] * inv[4] + s[2] * inv[8] + s[3] * inv[12]; if (det === 0) { - return identity(); + return identity$1(); } det = 1 / det; @@ -968,7 +969,7 @@ function m2m6(m) { return [m[0], m[1], m[4], m[5], m[12], m[13]]; } -function point2d(point) { +function point2d$1(point) { var w = point[3]; if (w && w !== 1) { @@ -981,12 +982,12 @@ function point2d(point) { } var mx = { - identity: identity, - multiply: multiply, - calPoint: calPoint, - point2d: point2d, - inverse: inverse, - isE: isE, + identity: identity$1, + multiply: multiply$2, + calPoint: calPoint$2, + point2d: point2d$1, + inverse: inverse$1, + isE: isE$3, m2m6: m2m6 }; @@ -996,23 +997,23 @@ function dotProduct(x1, y1, x2, y2) { } // 向量叉乘积 -function crossProduct(x1, y1, x2, y2) { +function crossProduct$1(x1, y1, x2, y2) { return x1 * y2 - x2 * y1; } var vector = { dotProduct: dotProduct, - crossProduct: crossProduct + crossProduct: crossProduct$1 }; -var H = 4 * (Math.sqrt(2) - 1) / 3; -var crossProduct$1 = vector.crossProduct; +var H$1 = 4 * (Math.sqrt(2) - 1) / 3; +var crossProduct = vector.crossProduct; var calPoint$1 = mx.calPoint, - isE$1 = mx.isE; -var _enums$STYLE_KEY = enums.STYLE_KEY, - WIDTH = _enums$STYLE_KEY.WIDTH, - HEIGHT = _enums$STYLE_KEY.HEIGHT, - TRANSFORM_ORIGIN = _enums$STYLE_KEY.TRANSFORM_ORIGIN; + isE$2 = mx.isE; +var _enums$STYLE_KEY$p = enums.STYLE_KEY, + WIDTH$8 = _enums$STYLE_KEY$p.WIDTH, + HEIGHT$8 = _enums$STYLE_KEY$p.HEIGHT, + TRANSFORM_ORIGIN$5 = _enums$STYLE_KEY$p.TRANSFORM_ORIGIN; /** * 圆弧拟合公式,根据角度求得3阶贝塞尔控制点比例长度,一般<=90,超过拆分 * @param deg @@ -1069,7 +1070,7 @@ function pointInPolygon(x, y, vertexes) { x2 = _vertexes[0], y2 = _vertexes[1]; - if (crossProduct$1(x2 - x1, y2 - y1, x - x1, y - y1) < 0) { + if (crossProduct(x2 - x1, y2 - y1, x - x1, y - y1) < 0) { return false; } } @@ -1079,7 +1080,7 @@ function pointInPolygon(x, y, vertexes) { function pointInQuadrilateral(x, y, x1, y1, x2, y2, x4, y4, x3, y3, matrix) { - if (matrix && !isE$1(matrix)) { + if (matrix && !isE$2(matrix)) { var w1, w2, w3, w4; var _calPoint = calPoint$1([x1, y1], matrix); @@ -1199,8 +1200,8 @@ function triangleIncentre(x1, y1, x2, y2, x3, y3) { function ellipsePoints(x, y, a) { var b = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : a; - var ox = a * H; - var oy = b === a ? ox : b * H; + var ox = a * H$1; + var oy = b === a ? ox : b * H$1; return [[x - a, y], [x - a, y - oy, x - ox, y - b, x, y - b], [x + ox, y - b, x + a, y - oy, x + a, y], [x + a, y + oy, x + ox, y + b, x, y + b], [x - ox, y + b, x - a, y + oy, x - a, y]]; } /** @@ -1209,7 +1210,7 @@ function ellipsePoints(x, y, a) { */ -function sectorPoints(x, y, r, begin, end) { +function sectorPoints$1(x, y, r, begin, end) { if (begin > end) { var _ref = [end, begin]; begin = _ref[0]; @@ -1225,27 +1226,27 @@ function sectorPoints(x, y, r, begin, end) { var e = Math.floor(end / 90); // 同象限直接算 if (b === e || e - b === 1 && end % 90 === 0) { - var h2 = h(d2r(Math.abs(begin - end))); + var h2 = h(d2r$2(Math.abs(begin - end))); var d = h2 * r; var c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2)); var alpha = Math.atan(d / r); if (b < 90) { // 第1个交点 - var rx = Math.sin(d2r(begin)) * r; - var ry = Math.cos(d2r(begin)) * r; + var rx = Math.sin(d2r$2(begin)) * r; + var ry = Math.cos(d2r$2(begin)) * r; var p1 = [x + rx, y - ry]; // 第1个控制点 - var deg = alpha + d2r(begin); + var deg = alpha + d2r$2(begin); rx = Math.sin(deg) * c; ry = Math.cos(deg) * c; var p2 = [x + rx, y - ry]; // 第2个交点 - rx = Math.sin(d2r(end)) * r; - ry = Math.cos(d2r(end)) * r; + rx = Math.sin(d2r$2(end)) * r; + ry = Math.cos(d2r$2(end)) * r; var p4 = [x + rx, y - ry]; // 第2个控制点 - deg = d2r(end) - alpha; + deg = d2r$2(end) - alpha; rx = Math.sin(deg) * c; ry = Math.cos(deg) * c; var p3 = [x + rx, y - ry]; @@ -1253,23 +1254,23 @@ function sectorPoints(x, y, r, begin, end) { list.push(p2.concat(p3).concat(p4)); } else if (b < 180) { // 第1个交点 - var _rx = Math.cos(d2r(begin - 90)) * r; + var _rx = Math.cos(d2r$2(begin - 90)) * r; - var _ry = Math.sin(d2r(begin - 90)) * r; + var _ry = Math.sin(d2r$2(begin - 90)) * r; var _p = [x + _rx, y + _ry]; // 第1个控制点 - var _deg = alpha + d2r(begin - 90); + var _deg = alpha + d2r$2(begin - 90); _rx = Math.cos(_deg) * c; _ry = Math.sin(_deg) * c; var _p2 = [x + _rx, y + _ry]; // 第2个交点 - _rx = Math.cos(d2r(end - 90)) * r; - _ry = Math.sin(d2r(end - 90)) * r; + _rx = Math.cos(d2r$2(end - 90)) * r; + _ry = Math.sin(d2r$2(end - 90)) * r; var _p3 = [x + _rx, y + _ry]; // 第2个控制点 - _deg = d2r(end - 90) - alpha; + _deg = d2r$2(end - 90) - alpha; _rx = Math.cos(_deg) * c; _ry = Math.sin(_deg) * c; var _p4 = [x + _rx, y + _ry]; @@ -1277,23 +1278,23 @@ function sectorPoints(x, y, r, begin, end) { list.push(_p2.concat(_p4).concat(_p3)); } else if (b < 270) { // 第1个交点 - var _rx2 = Math.sin(d2r(begin - 180)) * r; + var _rx2 = Math.sin(d2r$2(begin - 180)) * r; - var _ry2 = Math.cos(d2r(begin - 180)) * r; + var _ry2 = Math.cos(d2r$2(begin - 180)) * r; var _p5 = [x - _rx2, y + _ry2]; // 第1个控制点 - var _deg2 = alpha + d2r(begin - 180); + var _deg2 = alpha + d2r$2(begin - 180); _rx2 = Math.sin(_deg2) * c; _ry2 = Math.cos(_deg2) * c; var _p6 = [x - _rx2, y + _ry2]; // 第2个交点 - _rx2 = Math.sin(d2r(end - 180)) * r; - _ry2 = Math.cos(d2r(end - 180)) * r; + _rx2 = Math.sin(d2r$2(end - 180)) * r; + _ry2 = Math.cos(d2r$2(end - 180)) * r; var _p7 = [x - _rx2, y + _ry2]; // 第2个控制点 - _deg2 = d2r(end - 180) - alpha; + _deg2 = d2r$2(end - 180) - alpha; _rx2 = Math.sin(_deg2) * c; _ry2 = Math.cos(_deg2) * c; var _p8 = [x - _rx2, y + _ry2]; @@ -1301,23 +1302,23 @@ function sectorPoints(x, y, r, begin, end) { list.push(_p6.concat(_p8).concat(_p7)); } else { // 第1个交点 - var _rx3 = Math.cos(d2r(begin - 270)) * r; + var _rx3 = Math.cos(d2r$2(begin - 270)) * r; - var _ry3 = Math.sin(d2r(begin - 270)) * r; + var _ry3 = Math.sin(d2r$2(begin - 270)) * r; var _p9 = [x - _rx3, y + _ry3]; // 第1个控制点 - var _deg3 = alpha + d2r(begin - 270); + var _deg3 = alpha + d2r$2(begin - 270); _rx3 = Math.cos(_deg3) * c; _ry3 = Math.sin(_deg3) * c; var _p10 = [x - _rx3, y + _ry3]; // 第2个交点 - _rx3 = Math.cos(d2r(end - 270)) * r; - _ry3 = Math.sin(d2r(end - 270)) * r; + _rx3 = Math.cos(d2r$2(end - 270)) * r; + _ry3 = Math.sin(d2r$2(end - 270)) * r; var _p11 = [x - _rx3, y + _ry3]; // 第2个控制点 - _deg3 = d2r(end - 270) - alpha; + _deg3 = d2r$2(end - 270) - alpha; _rx3 = Math.cos(_deg3) * c; _ry3 = Math.sin(_deg3) * c; var _p12 = [x - _rx3, y + _ry3]; @@ -1326,44 +1327,44 @@ function sectorPoints(x, y, r, begin, end) { } } // 跨象限循环算 else { - var i = b; - var temp = []; + var i = b; + var temp = []; - for (; i <= e; i++) { - if (i === 0) { - var res = sectorPoints(x, y, r, begin, 90); - temp.push(res); - } else if (i === 1) { - // 防止90~90这种情况,但如果begin和end都是90时又要显示 - if (b === i || end > 90) { - var _res = sectorPoints(x, y, r, begin < 90 ? 90 : begin, end > 180 ? 180 : end); + for (; i <= e; i++) { + if (i === 0) { + var res = sectorPoints$1(x, y, r, begin, 90); + temp.push(res); + } else if (i === 1) { + // 防止90~90这种情况,但如果begin和end都是90时又要显示 + if (b === i || end > 90) { + var _res = sectorPoints$1(x, y, r, begin < 90 ? 90 : begin, end > 180 ? 180 : end); - temp.push(_res); - } - } else if (i === 2) { - // 防止180~180这种情况,但如果begin和end都是90时又要显示 - if (b === i || end > 180) { - var _res2 = sectorPoints(x, y, r, begin < 180 ? 180 : begin, end > 270 ? 270 : end); + temp.push(_res); + } + } else if (i === 2) { + // 防止180~180这种情况,但如果begin和end都是90时又要显示 + if (b === i || end > 180) { + var _res2 = sectorPoints$1(x, y, r, begin < 180 ? 180 : begin, end > 270 ? 270 : end); - temp.push(_res2); - } - } else if (i === 3) { - // 防止180~180这种情况,但如果begin和end都是90时又要显示 - if (b === i || end > 270) { - var _res3 = sectorPoints(x, y, r, begin < 270 ? 270 : begin, end); + temp.push(_res2); + } + } else if (i === 3) { + // 防止180~180这种情况,但如果begin和end都是90时又要显示 + if (b === i || end > 270) { + var _res3 = sectorPoints$1(x, y, r, begin < 270 ? 270 : begin, end); - temp.push(_res3); - } + temp.push(_res3); } - } // 去掉重复的首尾扇弧点 + } + } // 去掉重复的首尾扇弧点 - list = temp[0]; + list = temp[0]; - for (var _i2 = 1, len = temp.length; _i2 < len; _i2++) { - list.push(temp[_i2][1]); - } + for (var _i2 = 1, len = temp.length; _i2 < len; _i2++) { + list.push(temp[_i2][1]); } + } return list; } @@ -1451,9 +1452,9 @@ function calCoordsInNode(px, py, node) { matrix = _node$matrix === void 0 ? [1, 0, 0, 1, 0, 0] : _node$matrix, _node$computedStyle = node.computedStyle, computedStyle = _node$computedStyle === void 0 ? {} : _node$computedStyle; - var width = computedStyle[WIDTH], - height = computedStyle[HEIGHT], - _computedStyle$TRANSF = computedStyle[TRANSFORM_ORIGIN]; + var width = computedStyle[WIDTH$8], + height = computedStyle[HEIGHT$8], + _computedStyle$TRANSF = computedStyle[TRANSFORM_ORIGIN$5]; _computedStyle$TRANSF = _computedStyle$TRANSF === void 0 ? [width * 0.5, height * 0.5] : _computedStyle$TRANSF; var _computedStyle$TRANSF2 = _slicedToArray(_computedStyle$TRANSF, 2), @@ -1471,9 +1472,9 @@ function calCoordsInNode(px, py, node) { function calPercentInNode(x, y, node) { var _node$computedStyle2 = node.computedStyle, - width = _node$computedStyle2[WIDTH], - height = _node$computedStyle2[HEIGHT], - _node$computedStyle2$ = _slicedToArray(_node$computedStyle2[TRANSFORM_ORIGIN], 2), + width = _node$computedStyle2[WIDTH$8], + height = _node$computedStyle2[HEIGHT$8], + _node$computedStyle2$ = _slicedToArray(_node$computedStyle2[TRANSFORM_ORIGIN$5], 2), ox = _node$computedStyle2$[0], oy = _node$computedStyle2$[1]; // 先求无旋转时右下角相对于原点的角度ds @@ -1573,7 +1574,7 @@ function calPercentInNode(x, y, node) { return [(ox - dt * Math.cos(d2)) / width, (oy + dt * Math.sin(d2)) / height]; } -function d2r(n) { +function d2r$2(n) { return n * Math.PI / 180; } @@ -1984,29 +1985,29 @@ function sliceBezier2Both(points) { function pointOnCircle(x, y, r, deg) { if (deg >= 270) { deg -= 270; - deg = d2r(deg); + deg = d2r$2(deg); return [x - Math.cos(deg) * r, y - Math.sin(deg) * r]; } else if (deg >= 180) { deg -= 180; - deg = d2r(deg); + deg = d2r$2(deg); return [x - Math.sin(deg) * r, y + Math.cos(deg) * r]; } else if (deg >= 90) { deg -= 90; - deg = d2r(deg); + deg = d2r$2(deg); return [x + Math.cos(deg) * r, y + Math.sin(deg) * r]; } else { - deg = d2r(deg); + deg = d2r$2(deg); return [x + Math.sin(deg) * r, y - Math.cos(deg) * r]; } } -var geom = { +var geom$1 = { pointInPolygon: pointInPolygon, pointInQuadrilateral: pointInQuadrilateral, - d2r: d2r, + d2r: d2r$2, r2d: r2d, // 贝塞尔曲线模拟1/4圆弧比例 - H: H, + H: H$1, // <90任意角度贝塞尔曲线拟合圆弧的比例公式 h: h, angleBySide: angleBySide, @@ -2014,7 +2015,7 @@ var geom = { pointsDistance: pointsDistance, triangleIncentre: triangleIncentre, ellipsePoints: ellipsePoints, - sectorPoints: sectorPoints, + sectorPoints: sectorPoints$1, getRectsIntersection: getRectsIntersection, isRectsOverlap: isRectsOverlap, isRectsInside: isRectsInside, @@ -2162,11 +2163,11 @@ function getConicGradientImage(originX, originY, width, height, stop, data) { return data; } -var gradient = { +var gradient$1 = { getConicGradientImage: getConicGradientImage }; -function canvasPolygon(ctx, list) { +function canvasPolygon$7(ctx, list) { var dx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; var dy = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; @@ -2204,7 +2205,7 @@ function canvasPolygon(ctx, list) { } } -function svgPolygon(list) { +function svgPolygon$7(list) { if (!list || !list.length) { return ''; } @@ -2292,34 +2293,34 @@ function canvasFilter(filter) { } var painter = { - canvasPolygon: canvasPolygon, - svgPolygon: svgPolygon, + canvasPolygon: canvasPolygon$7, + svgPolygon: svgPolygon$7, canvasLine: canvasLine, svgLine: svgLine, canvasFilter: canvasFilter, svgFilter: canvasFilter }; -var H$1 = geom.H; -var PX = o.PX, - PERCENT = o.PERCENT, - REM = o.REM, - VW = o.VW, - VH = o.VH; -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 H = geom$1.H; +var PX$b = o$4.PX, + PERCENT$c = o$4.PERCENT, + REM$g = o$4.REM, + VW$g = o$4.VW, + VH$g = o$4.VH; +var canvasPolygon$6 = painter.canvasPolygon, + svgPolygon$6 = painter.svgPolygon; +var _enums$STYLE_KEY$o = enums.STYLE_KEY, + BORDER_LEFT_WIDTH$8 = _enums$STYLE_KEY$o.BORDER_LEFT_WIDTH, + BORDER_TOP_WIDTH$6 = _enums$STYLE_KEY$o.BORDER_TOP_WIDTH, + BORDER_BOTTOM_WIDTH$6 = _enums$STYLE_KEY$o.BORDER_BOTTOM_WIDTH, + PADDING_LEFT$7 = _enums$STYLE_KEY$o.PADDING_LEFT, + PADDING_BOTTOM$5 = _enums$STYLE_KEY$o.PADDING_BOTTOM, + PADDING_TOP$5 = _enums$STYLE_KEY$o.PADDING_TOP, + BORDER_TOP_LEFT_RADIUS$2 = _enums$STYLE_KEY$o.BORDER_TOP_LEFT_RADIUS, + BORDER_TOP_RIGHT_RADIUS$2 = _enums$STYLE_KEY$o.BORDER_TOP_RIGHT_RADIUS, + BORDER_BOTTOM_LEFT_RADIUS$2 = _enums$STYLE_KEY$o.BORDER_BOTTOM_LEFT_RADIUS, + BORDER_BOTTOM_RIGHT_RADIUS$2 = _enums$STYLE_KEY$o.BORDER_BOTTOM_RIGHT_RADIUS, + FONT_SIZE$h = _enums$STYLE_KEY$o.FONT_SIZE; /* 获取合适的虚线实体空白宽度ps/pd和数量n * 总长total,start边长bs,end边长be,内容长w, * 实体长范围[smin,smax],空白长范围[dmin,dmax] @@ -2459,68 +2460,68 @@ function calPoints(borderWidth, borderStyle, deg1, deg2, x1, x2, x3, x4, y1, y2, } } // 整个和borderRight重叠 else if (main1 >= x3) { - cross1 = y1 + (x4 - main1) * Math.tan(deg2); - cross2 = y1 + (x4 - main2) * Math.tan(deg2); + cross1 = y1 + (x4 - main1) * Math.tan(deg2); + cross2 = y1 + (x4 - main2) * Math.tan(deg2); + + if (isLast) { + points.push([[main1, y1], [x4, y1], [x4, y1], [main1, cross1]]); + } else { + points.push([[main1, y1], [main2, y1], [main2, cross2], [main1, cross1]]); + } + } // 不被整个重叠的情况再细分 + else { + // 上部分和borderLeft重叠 + if (main1 < x2) { + cross1 = y1 + (main1 - x1) * Math.tan(deg1); + points.push([[main1, y1], [x2, y1], [x2, y2], [main1, cross1]]); if (isLast) { - points.push([[main1, y1], [x4, y1], [x4, y1], [main1, cross1]]); + points.push([[x2, y1], [x3, y1], [x3, y2], [x2, y2]]); + points.push([[x3, y1], [x4, y1], [x4, y1], [x2, y2]]); } else { - points.push([[main1, y1], [main2, y1], [main2, cross2], [main1, cross1]]); + // 下部分和borderRight重叠 + if (main2 > x3) { + cross2 = y1 + (x4 - main2) * Math.tan(deg2); + points.push([[x2, y1], [x3, y1], [x3, y2], [x2, y2]]); + points.push([[x3, y1], [main2, y1], [main2, cross2], [x3, y2]]); + } // 下部独立 + else { + points.push([[x2, y1], [main2, y1], [main2, y2], [x2, y2]]); + } } - } // 不被整个重叠的情况再细分 - else { - // 上部分和borderLeft重叠 - if (main1 < x2) { - cross1 = y1 + (main1 - x1) * Math.tan(deg1); - points.push([[main1, y1], [x2, y1], [x2, y2], [main1, cross1]]); - - if (isLast) { - points.push([[x2, y1], [x3, y1], [x3, y2], [x2, y2]]); - points.push([[x3, y1], [x4, y1], [x4, y1], [x2, y2]]); - } else { - // 下部分和borderRight重叠 - if (main2 > x3) { - cross2 = y1 + (x4 - main2) * Math.tan(deg2); - points.push([[x2, y1], [x3, y1], [x3, y2], [x2, y2]]); - points.push([[x3, y1], [main2, y1], [main2, cross2], [x3, y2]]); - } // 下部独立 - else { - points.push([[x2, y1], [main2, y1], [main2, y2], [x2, y2]]); - } - } - } // 下部分和borderRight重叠 - else if (main2 > x3) { - cross1 = y1 + (x4 - main2) * Math.tan(deg2); // 上部分和borderLeft重叠 - - if (main1 < x2) { - cross2 = y1 + (main1 - x1) * Math.tan(deg1); - points.push([[main1, y1], [x2, y1], [x2, y2], [main1, cross2]]); - points.push([[x2, y1], [x3, y1], [x3, y2], [x2, y2]]); - - if (isLast) { - points.push([[x3, y1], [x4, y1], [x4, y1], [x3, y2]]); - } else { - points.push([[x3, y1], [main2, y1], [main2, cross1], [x3, y2]]); - } - } // 上部独立 - else { - points.push([[main1, y1], [x3, y1], [x3, y2], [main1, y2]]); + } // 下部分和borderRight重叠 + else if (main2 > x3) { + cross1 = y1 + (x4 - main2) * Math.tan(deg2); // 上部分和borderLeft重叠 - if (isLast) { - points.push([[x3, y1], [x4, y1], [x4, y1], [x3, y2]]); - } else { - points.push([[x3, y1], [main2, y1], [main2, cross1], [x3, y2]]); - } - } - } // 完全独立 - else { - if (isLast) { - points.push([[main1, y1], [x4, y1], [x3, y2], [main1, y2]]); - } else { - points.push([[main1, y1], [main2, y1], [main2, y2], [main1, y2]]); - } - } + if (main1 < x2) { + cross2 = y1 + (main1 - x1) * Math.tan(deg1); + points.push([[main1, y1], [x2, y1], [x2, y2], [main1, cross2]]); + points.push([[x2, y1], [x3, y1], [x3, y2], [x2, y2]]); + + if (isLast) { + points.push([[x3, y1], [x4, y1], [x4, y1], [x3, y2]]); + } else { + points.push([[x3, y1], [main2, y1], [main2, cross1], [x3, y2]]); + } + } // 上部独立 + else { + points.push([[main1, y1], [x3, y1], [x3, y2], [main1, y2]]); + + if (isLast) { + points.push([[x3, y1], [x4, y1], [x4, y1], [x3, y2]]); + } else { + points.push([[x3, y1], [main2, y1], [main2, cross1], [x3, y2]]); + } } + } // 完全独立 + else { + if (isLast) { + points.push([[main1, y1], [x4, y1], [x3, y2], [main1, y2]]); + } else { + points.push([[main1, y1], [main2, y1], [main2, y2], [main1, y2]]); + } + } + } } else if (direction === 1) { // 整个和borderTop重叠 if (main2 <= y2) { @@ -2533,68 +2534,68 @@ function calPoints(borderWidth, borderStyle, deg1, deg2, x1, x2, x3, x4, y1, y2, } } // 整个和borderBottom重叠 else if (main1 >= y3) { - cross1 = x3 + (main1 - y3) * Math.tan(deg2); - cross2 = x3 + (main2 - y3) * Math.tan(deg2); + cross1 = x3 + (main1 - y3) * Math.tan(deg2); + cross2 = x3 + (main2 - y3) * Math.tan(deg2); + + if (isLast) { + points.push([[cross1, main1], [x4, main1], [x4, y4], [x4, y4]]); + } else { + points.push([[cross1, main1], [x4, main1], [x4, main2], [cross2, main2]]); + } + } // 不被整个重叠的情况再细分 + else { + // 上部分和borderTop重叠 + if (main1 < y2) { + cross1 = x3 + (y2 - main1) * Math.tan(deg1); + points.push([[cross1, main1], [x4, main1], [x4, y2], [x3, y2]]); if (isLast) { - points.push([[cross1, main1], [x4, main1], [x4, y4], [x4, y4]]); + points.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); + points.push([[x3, y3], [x4, y3], [x4, y4], [x4, y4]]); } else { - points.push([[cross1, main1], [x4, main1], [x4, main2], [cross2, main2]]); + // 下部分和borderBottom重叠 + if (main2 > y3) { + cross2 = x3 + (main2 - y3) * Math.tan(deg2); + points.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); + points.push([[x3, y3], [x4, y3], [x4, main2], [cross2, main2]]); + } // 下部独立 + else { + points.push([[x3, y2], [x4, y2], [x4, main2], [x3, main2]]); + } } - } // 不被整个重叠的情况再细分 - else { - // 上部分和borderTop重叠 - if (main1 < y2) { - cross1 = x3 + (y2 - main1) * Math.tan(deg1); - points.push([[cross1, main1], [x4, main1], [x4, y2], [x3, y2]]); - - if (isLast) { - points.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); - points.push([[x3, y3], [x4, y3], [x4, y4], [x4, y4]]); - } else { - // 下部分和borderBottom重叠 - if (main2 > y3) { - cross2 = x3 + (main2 - y3) * Math.tan(deg2); - points.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); - points.push([[x3, y3], [x4, y3], [x4, main2], [cross2, main2]]); - } // 下部独立 - else { - points.push([[x3, y2], [x4, y2], [x4, main2], [x3, main2]]); - } - } - } // 下部分和borderBottom重叠 - else if (main2 > y3) { - cross1 = x3 + (main2 - y3) * Math.tan(deg2); // 上部分和borderTop重叠 - - if (main1 < y2) { - cross2 = x3 + (y2 - main1) * Math.tan(deg1); - points.push([[cross2, main1], [x4, main1], [x4, y2], [x3, y2]]); - points.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); - - if (isLast) { - points.push([[x3, y3], [x4, y3], [x4, x4], [x4, x4]]); - } else { - points.push([[x3, y3], [x4, y3], [x4, main2], [cross1, main2]]); - } - } // 上部独立 - else { - points.push([[x3, main1], [x4, main1], [x4, y3], [x3, y3]]); + } // 下部分和borderBottom重叠 + else if (main2 > y3) { + cross1 = x3 + (main2 - y3) * Math.tan(deg2); // 上部分和borderTop重叠 - if (isLast) { - points.push([[x3, y3], [x4, y3], [x4, y4], [x4, y4]]); - } else { - points.push([[x3, y3], [x4, y3], [x4, main2], [cross1, main2]]); - } - } - } // 完全独立 - else { - if (isLast) { - points.push([[x3, main1], [x4, main1], [x4, y4], [x3, y3]]); - } else { - points.push([[x3, main1], [x4, main1], [x4, main2], [x3, main2]]); - } - } + if (main1 < y2) { + cross2 = x3 + (y2 - main1) * Math.tan(deg1); + points.push([[cross2, main1], [x4, main1], [x4, y2], [x3, y2]]); + points.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); + + if (isLast) { + points.push([[x3, y3], [x4, y3], [x4, x4], [x4, x4]]); + } else { + points.push([[x3, y3], [x4, y3], [x4, main2], [cross1, main2]]); + } + } // 上部独立 + else { + points.push([[x3, main1], [x4, main1], [x4, y3], [x3, y3]]); + + if (isLast) { + points.push([[x3, y3], [x4, y3], [x4, y4], [x4, y4]]); + } else { + points.push([[x3, y3], [x4, y3], [x4, main2], [cross1, main2]]); + } + } + } // 完全独立 + else { + if (isLast) { + points.push([[x3, main1], [x4, main1], [x4, y4], [x3, y3]]); + } else { + points.push([[x3, main1], [x4, main1], [x4, main2], [x3, main2]]); } + } + } } else if (direction === 2) { // 整个和borderLeft重叠 if (main2 <= x2) { @@ -2607,68 +2608,68 @@ function calPoints(borderWidth, borderStyle, deg1, deg2, x1, x2, x3, x4, y1, y2, } } // 整个和borderRight重叠 else if (main1 >= x3) { - cross1 = y4 - (x4 - main1) * Math.tan(deg2); - cross2 = y4 - (x4 - main2) * Math.tan(deg2); + cross1 = y4 - (x4 - main1) * Math.tan(deg2); + cross2 = y4 - (x4 - main2) * Math.tan(deg2); + + if (isLast) { + points.push([[main1, cross1], [x4, y4], [x4, y4], [main1, y4]]); + } else { + points.push([[main1, cross1], [main2, cross2], [main2, y4], [main1, y4]]); + } + } // 不被整个重叠的情况再细分 + else { + // 上部分和borderLeft重叠 + if (main1 < x2) { + cross1 = y4 - (main1 - x1) * Math.tan(deg1); + points.push([[main1, cross1], [x2, y3], [x2, y4], [main1, y4]]); if (isLast) { - points.push([[main1, cross1], [x4, y4], [x4, y4], [main1, y4]]); + points.push([[x2, y3], [x3, y3], [x3, y4], [x2, y4]]); + points.push([[x3, y3], [x4, y4], [x4, y4], [x3, y4]]); } else { - points.push([[main1, cross1], [main2, cross2], [main2, y4], [main1, y4]]); + // 下部分和borderRight重叠 + if (main2 > x3) { + cross2 = y4 - (main2 - x3) * Math.tan(deg2); + points.push([[x2, y3], [x3, y3], [x3, y4], [x2, y4]]); + points.push([[x3, y3], [main2, cross2], [main2, y4], [x3, y4]]); + } // 下部独立 + else { + points.push([[x2, y3], [main2, y3], [main2, y4], [x2, y4]]); + } } - } // 不被整个重叠的情况再细分 - else { - // 上部分和borderLeft重叠 - if (main1 < x2) { - cross1 = y4 - (main1 - x1) * Math.tan(deg1); - points.push([[main1, cross1], [x2, y3], [x2, y4], [main1, y4]]); - - if (isLast) { - points.push([[x2, y3], [x3, y3], [x3, y4], [x2, y4]]); - points.push([[x3, y3], [x4, y4], [x4, y4], [x3, y4]]); - } else { - // 下部分和borderRight重叠 - if (main2 > x3) { - cross2 = y4 - (main2 - x3) * Math.tan(deg2); - points.push([[x2, y3], [x3, y3], [x3, y4], [x2, y4]]); - points.push([[x3, y3], [main2, cross2], [main2, y4], [x3, y4]]); - } // 下部独立 - else { - points.push([[x2, y3], [main2, y3], [main2, y4], [x2, y4]]); - } - } - } // 下部分和borderRight重叠 - else if (main2 > x3) { - cross1 = y4 - (x4 - main2) * Math.tan(deg2); // 上部分和borderLeft重叠 - - if (main1 < x2) { - cross2 = y4 - (main1 - x3) * Math.tan(deg1); - points.push([[main1, cross2], [x2, y3], [x2, y4], [main1, y4]]); - points.push([[x2, y3], [x3, y3], [x3, y4], [x2, y4]]); - - if (isLast) { - points.push([[x3, y3], [x4, y4], [x4, y4], [x3, y4]]); - } else { - points.push([[x3, y3], [main2, cross1], [main2, y4], [x3, y4]]); - } - } // 上部独立 - else { - points.push([[main1, y3], [x3, y3], [x3, y4], [main1, y4]]); + } // 下部分和borderRight重叠 + else if (main2 > x3) { + cross1 = y4 - (x4 - main2) * Math.tan(deg2); // 上部分和borderLeft重叠 - if (isLast) { - points.push([[x3, y3], [x4, y4], [x4, y4], [x3, y4]]); - } else { - points.push([[x3, y3], [main2, cross1], [main2, y4], [x3, y4]]); - } - } - } // 完全独立 - else { - if (isLast) { - points.push([[main1, y3], [x3, y3], [x4, y4], [main1, y4]]); - } else { - points.push([[main1, y3], [main2, y3], [main2, y4], [main1, y4]]); - } - } + if (main1 < x2) { + cross2 = y4 - (main1 - x3) * Math.tan(deg1); + points.push([[main1, cross2], [x2, y3], [x2, y4], [main1, y4]]); + points.push([[x2, y3], [x3, y3], [x3, y4], [x2, y4]]); + + if (isLast) { + points.push([[x3, y3], [x4, y4], [x4, y4], [x3, y4]]); + } else { + points.push([[x3, y3], [main2, cross1], [main2, y4], [x3, y4]]); + } + } // 上部独立 + else { + points.push([[main1, y3], [x3, y3], [x3, y4], [main1, y4]]); + + if (isLast) { + points.push([[x3, y3], [x4, y4], [x4, y4], [x3, y4]]); + } else { + points.push([[x3, y3], [main2, cross1], [main2, y4], [x3, y4]]); + } + } + } // 完全独立 + else { + if (isLast) { + points.push([[main1, y3], [x3, y3], [x4, y4], [main1, y4]]); + } else { + points.push([[main1, y3], [main2, y3], [main2, y4], [main1, y4]]); } + } + } } else if (direction === 3) { // 整个和borderTop重叠 if (main2 <= y2) { @@ -2681,68 +2682,68 @@ function calPoints(borderWidth, borderStyle, deg1, deg2, x1, x2, x3, x4, y1, y2, } } // 整个和borderBottom重叠 else if (main1 >= y3) { - cross1 = x1 + (y4 - main1) * Math.tan(deg2); - cross2 = x1 + (y4 - main2) * Math.tan(deg2); + cross1 = x1 + (y4 - main1) * Math.tan(deg2); + cross2 = x1 + (y4 - main2) * Math.tan(deg2); + + if (isLast) { + points.push([[x1, main1], [cross1, main1], [x1, y4], [x1, y4]]); + } else { + points.push([[x1, main1], [cross1, main1], [cross2, main2], [x1, main2]]); + } + } // 不被整个重叠的情况再细分 + else { + // 上部分和borderTop重叠 + if (main1 < y2) { + cross1 = x1 + (main1 - y1) * Math.tan(deg1); + points.push([[x1, main1], [cross1, main1], [x2, y2], [x1, y2]]); if (isLast) { - points.push([[x1, main1], [cross1, main1], [x1, y4], [x1, y4]]); + points.push([[x1, y2], [x2, y2], [x2, y3], [x1, y3]]); + points.push([[x1, y3], [x2, y3], [x1, y4], [x1, y4]]); } else { - points.push([[x1, main1], [cross1, main1], [cross2, main2], [x1, main2]]); + // 下部分和borderBottom重叠 + if (main2 > y3) { + cross2 = x1 + (y4 - main2) * Math.tan(deg2); + points.push([[x1, y2], [x2, y2], [x2, y3], [x1, y3]]); + points.push([[x1, y3], [x2, y3], [cross2, main2], [x1, main2]]); + } // 下部独立 + else { + points.push([[x1, y2], [x2, y2], [x2, main2], [x1, main2]]); + } } - } // 不被整个重叠的情况再细分 - else { - // 上部分和borderTop重叠 - if (main1 < y2) { - cross1 = x1 + (main1 - y1) * Math.tan(deg1); - points.push([[x1, main1], [cross1, main1], [x2, y2], [x1, y2]]); - - if (isLast) { - points.push([[x1, y2], [x2, y2], [x2, y3], [x1, y3]]); - points.push([[x1, y3], [x2, y3], [x1, y4], [x1, y4]]); - } else { - // 下部分和borderBottom重叠 - if (main2 > y3) { - cross2 = x1 + (y4 - main2) * Math.tan(deg2); - points.push([[x1, y2], [x2, y2], [x2, y3], [x1, y3]]); - points.push([[x1, y3], [x2, y3], [cross2, main2], [x1, main2]]); - } // 下部独立 - else { - points.push([[x1, y2], [x2, y2], [x2, main2], [x1, main2]]); - } - } - } // 下部分和borderBottom重叠 - else if (main2 > y3) { - cross1 = x1 + (y4 - main2) * Math.tan(deg2); // 上部分和borderTop重叠 - - if (main1 < y2) { - cross2 = x1 + (main1 - y1) * Math.tan(deg1); - points.push([[x1, main1], [cross2, main1], [x2, y2], [x1, y1]]); - points.push([[x1, y2], [x2, y2], [x2, y3], [x1, y3]]); - - if (isLast) { - points.push([[x1, y3], [x2, y3], [x1, y4], [x1, y4]]); - } else { - points.push([[x1, y3], [x2, y3], [cross1, main2], [x1, main2]]); - } - } // 上部独立 - else { - points.push([[x1, main1], [x2, main1], [x2, y3], [x1, y3]]); + } // 下部分和borderBottom重叠 + else if (main2 > y3) { + cross1 = x1 + (y4 - main2) * Math.tan(deg2); // 上部分和borderTop重叠 - if (isLast) { - points.push([[x1, y3], [x2, y3], [x1, y4], [x1, y4]]); - } else { - points.push([[x1, y3], [x2, y3], [cross1, main2], [x1, main2]]); - } - } - } // 完全独立 - else { - if (isLast) { - points.push([[x1, main1], [x2, main1], [x2, y3], [x1, y4]]); - } else { - points.push([[x1, main1], [x2, main1], [x2, main2], [x1, main2]]); - } - } + if (main1 < y2) { + cross2 = x1 + (main1 - y1) * Math.tan(deg1); + points.push([[x1, main1], [cross2, main1], [x2, y2], [x1, y1]]); + points.push([[x1, y2], [x2, y2], [x2, y3], [x1, y3]]); + + if (isLast) { + points.push([[x1, y3], [x2, y3], [x1, y4], [x1, y4]]); + } else { + points.push([[x1, y3], [x2, y3], [cross1, main2], [x1, main2]]); + } + } // 上部独立 + else { + points.push([[x1, main1], [x2, main1], [x2, y3], [x1, y3]]); + + if (isLast) { + points.push([[x1, y3], [x2, y3], [x1, y4], [x1, y4]]); + } else { + points.push([[x1, y3], [x2, y3], [cross1, main2], [x1, main2]]); + } + } + } // 完全独立 + else { + if (isLast) { + points.push([[x1, main1], [x2, main1], [x2, y3], [x1, y4]]); + } else { + points.push([[x1, main1], [x2, main1], [x2, main2], [x1, main2]]); } + } + } } } @@ -2841,44 +2842,44 @@ function calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, beginList.push(points); } // 全在右圆角 else if (points[0][0] > oxr) { - endList.push(points); - } // 跨越左右圆角 - else if (points[1][0] > oxr && points[0][0] < oxl) { - var ya = oxl < x2 ? y1 + Math.tan(deg1) * (oxl - x1) : y2; - var yb = oxr > x3 ? y1 + Math.tan(deg2) * (x4 - oxr) : y2; - beginList.push([points[0], [oxl, y1], [oxl, ya], points[3]]); - - if (oxl < oxr) { - if (oxl > x2 && oxr < x3) { - centerList.push([[oxl, y1], [oxr, y1], [oxr, y2], [oxl, y2]]); - } else if (oxl > x2) { - centerList.push([[oxl, y1], [x3, y1], [x3, y2], [oxl, y2]]); - centerList.push([[x3, y1], [oxr, y1], [oxr, yb], [x3, y2]]); - } else if (oxr < x3) { - centerList.push([[oxl, y1], [x2, y1], [x2, y2], [oxl, ya]]); - centerList.push([[x2, y1], [oxr, y1], [oxr, y2], [x2, y2]]); - } else { - centerList.push([[oxl, y1], [x2, y1], [x2, y2], [oxl, ya]]); - centerList.push([[x2, y1], [x3, y1], [x3, y2], [x2, y2]]); - centerList.push([[x3, y1], [oxr, y1], [oxr, yb], [x3, y2]]); - } - } + endList.push(points); + } // 跨越左右圆角 + else if (points[1][0] > oxr && points[0][0] < oxl) { + var ya = oxl < x2 ? y1 + Math.tan(deg1) * (oxl - x1) : y2; + var yb = oxr > x3 ? y1 + Math.tan(deg2) * (x4 - oxr) : y2; + beginList.push([points[0], [oxl, y1], [oxl, ya], points[3]]); + + if (oxl < oxr) { + if (oxl > x2 && oxr < x3) { + centerList.push([[oxl, y1], [oxr, y1], [oxr, y2], [oxl, y2]]); + } else if (oxl > x2) { + centerList.push([[oxl, y1], [x3, y1], [x3, y2], [oxl, y2]]); + centerList.push([[x3, y1], [oxr, y1], [oxr, yb], [x3, y2]]); + } else if (oxr < x3) { + centerList.push([[oxl, y1], [x2, y1], [x2, y2], [oxl, ya]]); + centerList.push([[x2, y1], [oxr, y1], [oxr, y2], [x2, y2]]); + } else { + centerList.push([[oxl, y1], [x2, y1], [x2, y2], [oxl, ya]]); + centerList.push([[x2, y1], [x3, y1], [x3, y2], [x2, y2]]); + centerList.push([[x3, y1], [oxr, y1], [oxr, yb], [x3, y2]]); + } + } - endList.push([[oxr, y1], points[1], points[2], [oxr, yb]]); - } // 跨越右圆角 - else if (points[1][0] > oxr) { - var y = oxr > x3 ? y1 + Math.tan(deg2) * (x4 - oxr) : y2; - centerList.push([points[0], [oxr, y1], [oxr, y], points[3]]); - endList.push([[oxr, y1], points[1], points[2], [oxr, y]]); - } // 跨越左圆角 - else if (points[0][0] < oxl) { - var _y = oxl < x2 ? y1 + Math.tan(deg1) * (oxl - x1) : y2; + endList.push([[oxr, y1], points[1], points[2], [oxr, yb]]); + } // 跨越右圆角 + else if (points[1][0] > oxr) { + var y = oxr > x3 ? y1 + Math.tan(deg2) * (x4 - oxr) : y2; + centerList.push([points[0], [oxr, y1], [oxr, y], points[3]]); + endList.push([[oxr, y1], points[1], points[2], [oxr, y]]); + } // 跨越左圆角 + else if (points[0][0] < oxl) { + var _y = oxl < x2 ? y1 + Math.tan(deg1) * (oxl - x1) : y2; - beginList.push([points[0], [oxl, y1], [oxl, _y], points[3]]); - centerList.push([[oxl, y1], points[1], points[2], [oxl, _y]]); - } else { - centerList.push(points); - } + beginList.push([points[0], [oxl, y1], [oxl, _y], points[3]]); + centerList.push([[oxl, y1], points[1], points[2], [oxl, _y]]); + } else { + centerList.push(points); + } } var beginLength = beginList.length; @@ -3091,7 +3092,7 @@ function calBezierTopLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) { } // 根据夹角求贝塞尔拟合圆弧长度 - var h = geom.h(Math.abs(deg1 - deg2)); + var h = geom$1.h(Math.abs(deg1 - deg2)); var d = h * r; // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点 // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标 @@ -3176,7 +3177,7 @@ function calBezierTopRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) { } // 根据夹角求贝塞尔拟合圆弧长度 - var h = geom.h(Math.abs(deg1 - deg2)); + var h = geom$1.h(Math.abs(deg1 - deg2)); var d = h * r; // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点 // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标 @@ -3241,44 +3242,44 @@ function calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y beginList.push(points); } // 全在下圆角 else if (points[1][1] > oyb) { - endList.push(points); - } // 跨越上下圆角 - else if (points[2][1] > oyb && points[1][1] < oyt) { - var xa = oyt < y2 ? x3 + Math.tan(deg2) * (y2 - oyt) : x3; - var xb = oyb > y3 ? x3 + Math.tan(deg1) * (oyb - y3) : x3; - beginList.push([points[0], points[1], [x4, oyt], [xa, oyt]]); - - if (oyt < oyb) { - if (oyb < y3 && oyt > y2) { - centerList.push([[x3, oyt], [x4, oyt], [x4, oyb], [x3, oyb]]); - } else if (oyt > y2) { - centerList.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); - centerList.push([[x3, y3], [x4, y3], [x4, oyb], [xb, oyb]]); - } else if (oyb < y3) { - centerList.push([[xa, oyt], [x4, oyt], [x4, y2], [x3, y2]]); - centerList.push([[x3, y2], [x4, y2], [x4, oyb], [x3, oyb]]); - } else { - centerList.push([[xa, oyt], [x4, oyt], [x4, y2], [x3, y2]]); - centerList.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); - centerList.push([[x3, y3], [x4, y3], [x4, oyb], [xb, oyb]]); - } - } + endList.push(points); + } // 跨越上下圆角 + else if (points[2][1] > oyb && points[1][1] < oyt) { + var xa = oyt < y2 ? x3 + Math.tan(deg2) * (y2 - oyt) : x3; + var xb = oyb > y3 ? x3 + Math.tan(deg1) * (oyb - y3) : x3; + beginList.push([points[0], points[1], [x4, oyt], [xa, oyt]]); + + if (oyt < oyb) { + if (oyb < y3 && oyt > y2) { + centerList.push([[x3, oyt], [x4, oyt], [x4, oyb], [x3, oyb]]); + } else if (oyt > y2) { + centerList.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); + centerList.push([[x3, y3], [x4, y3], [x4, oyb], [xb, oyb]]); + } else if (oyb < y3) { + centerList.push([[xa, oyt], [x4, oyt], [x4, y2], [x3, y2]]); + centerList.push([[x3, y2], [x4, y2], [x4, oyb], [x3, oyb]]); + } else { + centerList.push([[xa, oyt], [x4, oyt], [x4, y2], [x3, y2]]); + centerList.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); + centerList.push([[x3, y3], [x4, y3], [x4, oyb], [xb, oyb]]); + } + } - endList.push([[xb, oyb], [x4, oyb], points[2], points[3]]); - } // 跨越下圆角 - else if (points[2][1] > oyb) { - var x = oyb > y3 ? x3 + Math.tan(deg1) * (oyb - y3) : x3; - centerList.push([points[0], points[1], [x4, oyb], [x, oyb]]); - endList.push([[x, oyb], [x4, oyb], points[2], points[3]]); - } // 跨越上圆角 - else if (points[1][1] < oyt) { - var _x = oyt < y2 ? x3 + Math.tan(deg2) * (y2 - oyt) : x3; + endList.push([[xb, oyb], [x4, oyb], points[2], points[3]]); + } // 跨越下圆角 + else if (points[2][1] > oyb) { + var x = oyb > y3 ? x3 + Math.tan(deg1) * (oyb - y3) : x3; + centerList.push([points[0], points[1], [x4, oyb], [x, oyb]]); + endList.push([[x, oyb], [x4, oyb], points[2], points[3]]); + } // 跨越上圆角 + else if (points[1][1] < oyt) { + var _x = oyt < y2 ? x3 + Math.tan(deg2) * (y2 - oyt) : x3; - beginList.push([points[0], points[1], [x4, oyt], [_x, oyt]]); - centerList.push([[_x, oyt], [x4, oyt], points[2], points[3]]); - } else { - centerList.push(points); - } + beginList.push([points[0], points[1], [x4, oyt], [_x, oyt]]); + centerList.push([[_x, oyt], [x4, oyt], points[2], points[3]]); + } else { + centerList.push(points); + } } var beginLength = beginList.length; @@ -3493,7 +3494,7 @@ function calBezierRightTop(p1, p2, ox, oy, sx, r, isStart, crossDx) { } // 根据夹角求贝塞尔拟合圆弧长度 - var h = geom.h(Math.abs(deg1 - deg2)); + var h = geom$1.h(Math.abs(deg1 - deg2)); var d = h * r; // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点 // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标 @@ -3578,7 +3579,7 @@ function calBezierRightBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) { } // 根据夹角求贝塞尔拟合圆弧长度 - var h = geom.h(Math.abs(deg1 - deg2)); + var h = geom$1.h(Math.abs(deg1 - deg2)); var d = h * r; // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点 // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标 @@ -3646,44 +3647,44 @@ function calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, beginList.push(points); } // 全在右圆角 else if (points[3][0] > oxr) { - endList.push(points); - } // 跨越左右圆角 - else if (points[2][0] > oxr && points[3][0] < oxl) { - var ya = oxl < x2 ? y4 - Math.tan(deg1) * (oxl - x1) : y2; - var yb = oxr > x3 ? y4 - Math.tan(deg2) * (x4 - oxr) : y3; - beginList.push([points[0], [oxl, ya], [oxl, y4], points[3]]); - - if (oxl < oxr) { - if (oxl > x2 && oxr < x3) { - centerList.push([[oxl, y3], [oxr, y3], [oxr, y4], [oxl, y4]]); - } else if (oxl > x2) { - centerList.push([[oxl, y3], [x3, y3], [x3, y4], [oxl, y4]]); - centerList.push([[x3, y3], [oxr, yb], [oxr, y4], [x3, y4]]); - } else if (oxr < x3) { - centerList.push([[oxl, ya], [x2, y3], [x2, y4], [oxl, y4]]); - centerList.push([[x2, y3], [oxr, y3], [oxr, y4], [x2, y4]]); - } else { - centerList.push([[oxl, ya], [x2, y3], [x2, y4], [oxl, y4]]); - centerList.push([[x2, y3], [x3, y3], [x3, y4], [x2, y4]]); - centerList.push([[x3, y3], [oxr, yb], [oxr, y4], [x3, y4]]); - } - } + endList.push(points); + } // 跨越左右圆角 + else if (points[2][0] > oxr && points[3][0] < oxl) { + var ya = oxl < x2 ? y4 - Math.tan(deg1) * (oxl - x1) : y2; + var yb = oxr > x3 ? y4 - Math.tan(deg2) * (x4 - oxr) : y3; + beginList.push([points[0], [oxl, ya], [oxl, y4], points[3]]); + + if (oxl < oxr) { + if (oxl > x2 && oxr < x3) { + centerList.push([[oxl, y3], [oxr, y3], [oxr, y4], [oxl, y4]]); + } else if (oxl > x2) { + centerList.push([[oxl, y3], [x3, y3], [x3, y4], [oxl, y4]]); + centerList.push([[x3, y3], [oxr, yb], [oxr, y4], [x3, y4]]); + } else if (oxr < x3) { + centerList.push([[oxl, ya], [x2, y3], [x2, y4], [oxl, y4]]); + centerList.push([[x2, y3], [oxr, y3], [oxr, y4], [x2, y4]]); + } else { + centerList.push([[oxl, ya], [x2, y3], [x2, y4], [oxl, y4]]); + centerList.push([[x2, y3], [x3, y3], [x3, y4], [x2, y4]]); + centerList.push([[x3, y3], [oxr, yb], [oxr, y4], [x3, y4]]); + } + } - endList.push([[oxr, yb], points[1], points[2], [oxr, y4]]); - } // 跨越右圆角 - else if (points[2][0] > oxr) { - var y = oxr > x3 ? y4 - Math.tan(deg2) * (x4 - oxr) : y3; - centerList.push([points[0], [oxr, y], [oxr, y4], points[3]]); - endList.push([[oxr, y], points[1], points[2], [oxr, y4]]); - } // 跨越左圆角 - else if (points[3][0] < oxl) { - var _y2 = oxl < x2 ? y4 - Math.tan(deg1) * (oxl - x1) : y3; + endList.push([[oxr, yb], points[1], points[2], [oxr, y4]]); + } // 跨越右圆角 + else if (points[2][0] > oxr) { + var y = oxr > x3 ? y4 - Math.tan(deg2) * (x4 - oxr) : y3; + centerList.push([points[0], [oxr, y], [oxr, y4], points[3]]); + endList.push([[oxr, y], points[1], points[2], [oxr, y4]]); + } // 跨越左圆角 + else if (points[3][0] < oxl) { + var _y2 = oxl < x2 ? y4 - Math.tan(deg1) * (oxl - x1) : y3; - beginList.push([points[0], [oxl, _y2], [oxl, y4], points[3]]); - centerList.push([[oxl, _y2], points[1], points[2], [oxl, y4]]); - } else { - centerList.push(points); - } + beginList.push([points[0], [oxl, _y2], [oxl, y4], points[3]]); + centerList.push([[oxl, _y2], points[1], points[2], [oxl, y4]]); + } else { + centerList.push(points); + } } var beginLength = beginList.length; @@ -3902,7 +3903,7 @@ function calBezierBottomLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) { } // 根据夹角求贝塞尔拟合圆弧长度 - var h = geom.h(Math.abs(deg1 - deg2)); + var h = geom$1.h(Math.abs(deg1 - deg2)); var d = h * r; // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点 // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标 @@ -3987,7 +3988,7 @@ function calBezierBottomRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) { } // 根据夹角求贝塞尔拟合圆弧长度 - var h = geom.h(Math.abs(deg1 - deg2)); + var h = geom$1.h(Math.abs(deg1 - deg2)); var d = h * r; // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点 // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标 @@ -4052,44 +4053,44 @@ function calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3 beginList.push(points); } // 全在下圆角 else if (points[0][1] > oyb) { - endList.push(points); - } // 跨越上下圆角 - else if (points[3][1] > oyb && points[0][1] < oyt) { - var xa = oyt < y2 ? x2 - Math.tan(deg2) * (y2 - oyt) : x2; - var xb = oyb > y3 ? x2 - Math.tan(deg1) * (oyb - y3) : x2; - beginList.push([points[0], points[1], [xa, oyt], [x1, oyt]]); - - if (oyt < oyb) { - if (oyb < y3 && oyt > y2) { - centerList.push([[x1, oyt], [x2, oyt], [x2, oyb], [x1, oyb]]); - } else if (oyt > y2) { - centerList.push([[x1, oyt], [x2, oyt], [x2, y3], [x1, y3]]); - centerList.push([[x1, y3], [x2, y3], [xb, oyb], [x1, oyb]]); - } else if (oyb < y3) { - centerList.push([[x1, oyt], [xa, oyt], [x2, y2], [x1, y2]]); - centerList.push([[x1, y2], [x2, y2], [x2, oyb], [x1, oyb]]); - } else { - centerList.push([[x1, oyt], [xa, oyt], [x2, y2], [x1, y2]]); - centerList.push([[x1, y2], [x2, y2], [x2, y3], [x1, y3]]); - centerList.push([[x1, y3], [x2, y3], [xb, oyb], [x1, oyb]]); - } - } + endList.push(points); + } // 跨越上下圆角 + else if (points[3][1] > oyb && points[0][1] < oyt) { + var xa = oyt < y2 ? x2 - Math.tan(deg2) * (y2 - oyt) : x2; + var xb = oyb > y3 ? x2 - Math.tan(deg1) * (oyb - y3) : x2; + beginList.push([points[0], points[1], [xa, oyt], [x1, oyt]]); + + if (oyt < oyb) { + if (oyb < y3 && oyt > y2) { + centerList.push([[x1, oyt], [x2, oyt], [x2, oyb], [x1, oyb]]); + } else if (oyt > y2) { + centerList.push([[x1, oyt], [x2, oyt], [x2, y3], [x1, y3]]); + centerList.push([[x1, y3], [x2, y3], [xb, oyb], [x1, oyb]]); + } else if (oyb < y3) { + centerList.push([[x1, oyt], [xa, oyt], [x2, y2], [x1, y2]]); + centerList.push([[x1, y2], [x2, y2], [x2, oyb], [x1, oyb]]); + } else { + centerList.push([[x1, oyt], [xa, oyt], [x2, y2], [x1, y2]]); + centerList.push([[x1, y2], [x2, y2], [x2, y3], [x1, y3]]); + centerList.push([[x1, y3], [x2, y3], [xb, oyb], [x1, oyb]]); + } + } - endList.push([[x1, oyb], [xb, oyb], points[2], points[3]]); - } // 跨越下圆角 - else if (points[3][1] > oyb) { - var x = oyb > y3 ? x2 - Math.tan(deg1) * (oyb - y3) : x2; - centerList.push([points[0], points[1], [x, oyb], [x1, oyb]]); - endList.push([[x1, oyb], [x, oyb], points[2], points[3]]); - } // 跨越上圆角 - else if (points[1][1] < oyt) { - var _x2 = oyt < y2 ? x2 - Math.tan(deg2) * (y2 - oyt) : x2; + endList.push([[x1, oyb], [xb, oyb], points[2], points[3]]); + } // 跨越下圆角 + else if (points[3][1] > oyb) { + var x = oyb > y3 ? x2 - Math.tan(deg1) * (oyb - y3) : x2; + centerList.push([points[0], points[1], [x, oyb], [x1, oyb]]); + endList.push([[x1, oyb], [x, oyb], points[2], points[3]]); + } // 跨越上圆角 + else if (points[1][1] < oyt) { + var _x2 = oyt < y2 ? x2 - Math.tan(deg2) * (y2 - oyt) : x2; - beginList.push([points[0], points[1], [_x2, oyt], [x1, oyt]]); - centerList.push([[x1, oyt], [_x2, oyt], points[2], points[3]]); - } else { - centerList.push(points); - } + beginList.push([points[0], points[1], [_x2, oyt], [x1, oyt]]); + centerList.push([[x1, oyt], [_x2, oyt], points[2], points[3]]); + } else { + centerList.push(points); + } } var beginLength = beginList.length; @@ -4302,7 +4303,7 @@ function calBezierLeftTop(p1, p2, ox, oy, sx, r, isStart, crossDx) { } // 根据夹角求贝塞尔拟合圆弧长度 - var h = geom.h(Math.abs(deg1 - deg2)); + var h = geom$1.h(Math.abs(deg1 - deg2)); var d = h * r; // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点 // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标 @@ -4387,7 +4388,7 @@ function calBezierLeftBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) { } // 根据夹角求贝塞尔拟合圆弧长度 - var h = geom.h(Math.abs(deg1 - deg2)); + var h = geom$1.h(Math.abs(deg1 - deg2)); var d = h * r; // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点 // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标 @@ -4474,28 +4475,28 @@ function calRadius(x, y, w, h, btlr, btrr, bbrr, bblr) { if (btlx > 0 && btly > 0) { list.push([x, y + btly]); - list.push([x, y + btly * (1 - H$1), x + btlx * (1 - H$1), y, x + btlx, y]); + list.push([x, y + btly * (1 - H), x + btlx * (1 - H), y, x + btlx, y]); } else { list.push([x, y]); } if (btrx > 0 && btry > 0) { list.push([x + w - btrx, y]); - list.push([x + w - btrx * (1 - H$1), y, x + w, y + btry * (1 - H$1), x + w, y + btry]); + list.push([x + w - btrx * (1 - H), y, x + w, y + btry * (1 - H), x + w, y + btry]); } else { list.push([x + w, y]); } if (bbrx > 0 && bbry > 0) { list.push([x + w, y + h - bbry]); - list.push([x + w, y + h - bbry * (1 - H$1), x + w - bbrx * (1 - H$1), y + h, x + w - bbrx, y + h]); + list.push([x + w, y + h - bbry * (1 - H), x + w - bbrx * (1 - H), y + h, x + w - bbrx, y + h]); } else { list.push([x + w, y + h]); } if (bblx > 0 && bbly > 0) { list.push([x + bblx, y + h]); - list.push([x + bblx * (1 - H$1), y + h, x, y + h - bbly * (1 - H$1), x, y + h - bbly]); + list.push([x + bblx * (1 - H), y + h, x, y + h - bbly * (1 - H), x, y + h - bbly]); } else { list.push([x, y + h]); } @@ -4532,7 +4533,7 @@ function limit(points, x, y, direction) { } } -var BR_KS = [BORDER_TOP_LEFT_RADIUS, BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS]; +var BR_KS = [BORDER_TOP_LEFT_RADIUS$2, BORDER_TOP_RIGHT_RADIUS$2, BORDER_BOTTOM_RIGHT_RADIUS$2, BORDER_BOTTOM_LEFT_RADIUS$2]; function calBorderRadius(w, h, currentStyle, computedStyle, root) { var noRadius = true; @@ -4544,15 +4545,15 @@ function calBorderRadius(w, h, currentStyle, computedStyle, root) { return 0; } - if (item[1] === PX) { + if (item[1] === PX$b) { return Math.max(0, item[0]); - } else if (item[1] === PERCENT) { + } else if (item[1] === PERCENT$c) { 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]); - } else if (item[1] === VW) { + } else if (item[1] === REM$g) { + return Math.max(0, item[0] * root.computedStyle[FONT_SIZE$h]); + } else if (item[1] === VW$g) { return Math.max(0, item[0] * root.width * 0.01); - } else if (item[1] === VH) { + } else if (item[1] === VH$g) { return Math.max(0, item[0] * root.height * 0.01); } @@ -4578,10 +4579,10 @@ function calBorderRadius(w, h, currentStyle, computedStyle, root) { prev[j] = next[j] = half; } // 仅1个超过中点,因相交用总长减去另一方即可 else if (prev[j] > half) { - prev[j] = target - next[j]; - } else if (next[j] > half) { - next[j] = target - prev[j]; - } + prev[j] = target - next[j]; + } else if (next[j] > half) { + next[j] = target - prev[j]; + } } }); } @@ -4597,13 +4598,13 @@ function calBorderRadiusInline(contentBoxList, currentStyle, computedStyle) { var w = first ? first.outerWidth : 0, h = first ? first.outerHeight : 0; - w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT]; - h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH] + computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM]; - [BORDER_TOP_LEFT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS].forEach(function (k) { + w += computedStyle[BORDER_LEFT_WIDTH$8] + computedStyle[PADDING_LEFT$7]; + h += computedStyle[BORDER_TOP_WIDTH$6] + computedStyle[BORDER_BOTTOM_WIDTH$6] + computedStyle[PADDING_TOP$5] + computedStyle[PADDING_BOTTOM$5]; + [BORDER_TOP_LEFT_RADIUS$2, BORDER_BOTTOM_LEFT_RADIUS$2].forEach(function (k) { computedStyle[k] = currentStyle[k].map(function (item, i) { var v; - if (item[1] === PX) { + if (item[1] === PX$b) { v = Math.max(0, item[0]); v = Math.min(i ? h : w, v); } else { @@ -4617,11 +4618,11 @@ function calBorderRadiusInline(contentBoxList, currentStyle, computedStyle) { w = last ? last.outerWidth : 0; h = last ? last.outerHeight : 0; - [BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS].forEach(function (k) { + [BORDER_TOP_RIGHT_RADIUS$2, BORDER_BOTTOM_RIGHT_RADIUS$2].forEach(function (k) { computedStyle[k] = currentStyle[k].map(function (item, i) { var v; - if (item[1] === PX) { + if (item[1] === PX$b) { v = Math.max(0, item[0]); v = Math.min(i ? h : w, v); } else { @@ -4643,14 +4644,14 @@ function renderBorder(xom, renderMode, ctx, points, color, dx, dy) { } points.forEach(function (point) { - canvasPolygon$1(ctx, point, dx, dy); + canvasPolygon$6(ctx, point, dx, dy); }); ctx.fill(); ctx.closePath(); } else if (renderMode === mode.SVG) { var s = ''; points.forEach(function (point) { - s += svgPolygon$1(point); + s += svgPolygon$6(point); }); xom.virtualDom.bb.push({ type: 'item', @@ -4669,19 +4670,19 @@ var border = { }; // 类型为引用防止json仿造 -var TYPE_VD = { +var TYPE_VD$4 = { _: 1 }; -var TYPE_GM = { +var TYPE_GM$4 = { _: 2 }; -var TYPE_CP = { +var TYPE_CP$4 = { _: 3 }; var $$type = { - TYPE_VD: TYPE_VD, - TYPE_GM: TYPE_GM, - TYPE_CP: TYPE_CP + TYPE_VD: TYPE_VD$4, + TYPE_GM: TYPE_GM$4, + TYPE_CP: TYPE_CP$4 }; var toString = {}.toString; @@ -4692,17 +4693,17 @@ function isType(type) { }; } -var isObject = isType('Object'); -var isString = isType('String'); -var isFunction = isType('Function'); -var isNumber = isType('Number'); +var isObject$2 = isType('Object'); +var isString$1 = isType('String'); +var isFunction$8 = isType('Function'); +var isNumber$1 = isType('Number'); var isBoolean = isType('Boolean'); var isDate = isType('Date'); var hasOwn = {}.hasOwnProperty; var fnToString = hasOwn.toString; var ObjectFunctionString = fnToString.call(Object); -function isNil(v) { +function isNil$f(v) { return v === undefined || v === null; } @@ -4723,7 +4724,7 @@ function _joinSourceArray(arr) { } function stringify(s) { - if (isNil(s)) { + if (isNil$f(s)) { return ''; } @@ -4742,11 +4743,11 @@ function encodeHtml(s, prop) { function joinVirtualDom(vd) { var s = ''; vd.defs.forEach(function (item) { - s += joinDef(item); + s += joinDef$1(item); }); s += ''; vd.bb.forEach(function (item) { - s += joinVd(item); + s += joinVd$1(item); }); s += '' + _s + ''; } else if (vd.type === 'dom' || vd.type === 'geom') { var _s2 = ''; vd.bb.forEach(function (item) { - _s2 += joinVd(item); + _s2 += joinVd$1(item); }); _s2 += ' -1) { - v[1] = PX$1; + if ([NUMBER$5, DEG$2].indexOf(v[1]) > -1) { + v[1] = PX$a; } return v; @@ -6500,7 +6501,7 @@ function getRadialPosition(data) { center: 50, right: 100, bottom: 100 - }[data] || 50, PERCENT$1]; + }[data] || 50, PERCENT$b]; } } // 获取color-stop区间范围,去除无用值 @@ -6515,13 +6516,13 @@ function getColorStop(v, length, root) { if (item.length > 1) { var p = item[1]; - if (p[1] === PERCENT$1) { + if (p[1] === PERCENT$b) { 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]); - } else if (p[1] === VW$1) { + } else if (p[1] === REM$f) { + list.push([item[0], p[0] * root.computedStyle[FONT_SIZE$g] / length]); + } else if (p[1] === VW$f) { list.push([item[0], p[0] * root.width / length]); - } else if (p[1] === VH$1) { + } else if (p[1] === VH$f) { list.push([item[0], p[0] * root.height / length]); } else { list.push([item[0], p[0] / length]); @@ -6701,25 +6702,25 @@ function calCircleCentre(position, x1, y1, iw, ih, root) { var positionX = position[0], positionY = position[1]; - if (positionX[1] === PERCENT$1) { + if (positionX[1] === PERCENT$b) { cx = x1 + positionX[0] * iw * 0.01; - } else if (positionX[1] === REM$1) { - cx = x1 + positionX[0] * root.computedStyle[FONT_SIZE$1]; - } else if (positionX[1] === VW$1) { + } else if (positionX[1] === REM$f) { + cx = x1 + positionX[0] * root.computedStyle[FONT_SIZE$g]; + } else if (positionX[1] === VW$f) { cx = x1 + positionX[0] * root.width * 0.01; - } else if (positionX[1] === VH$1) { + } else if (positionX[1] === VH$f) { cx = x1 + positionX[0] * root.height * 0.01; } else { cx = x1 + positionX[0]; } - if (positionY[1] === PERCENT$1) { + if (positionY[1] === PERCENT$b) { cy = y1 + positionY[0] * ih * 0.01; - } else if (positionY[1] === REM$1) { - cy = y1 + positionY[0] * root.computedStyle[FONT_SIZE$1]; - } else if (positionY[1] === VW$1) { + } else if (positionY[1] === REM$f) { + cy = y1 + positionY[0] * root.computedStyle[FONT_SIZE$g]; + } else if (positionY[1] === VW$f) { cy = y1 + positionY[0] * root.width * 0.01; - } else if (positionY[1] === VH$1) { + } else if (positionY[1] === VH$f) { cy = y1 + positionY[0] * root.height * 0.01; } else { cy = y1 + positionY[0]; @@ -6874,14 +6875,14 @@ function parseGradient(s) { o.d = getLinearDeg(deg[0].toLowerCase()); } // 扩展支持从a点到b点相对坐标,而不是css角度,sketch等ui软件中用此格式 else { - var points = /([-+]?[\d.]+)\s+([-+]?[\d.]+)\s+([-+]?[\d.]+)\s+([-+]?[\d.]+)/.exec(gradient[2]); + var points = /([-+]?[\d.]+)\s+([-+]?[\d.]+)\s+([-+]?[\d.]+)\s+([-+]?[\d.]+)/.exec(gradient[2]); - if (points) { - o.d = [parseFloat(points[1]), parseFloat(points[2]), parseFloat(points[3]), parseFloat(points[4])]; - } else { - o.d = 180; - } + if (points) { + o.d = [parseFloat(points[1]), parseFloat(points[2]), parseFloat(points[3]), parseFloat(points[4])]; + } else { + o.d = 180; } + } } else if (o.k === 'radial') { o.s = gradient[2].indexOf('circle') > -1 ? 'circle' : 'ellipse'; var size = /(closest|farthest)-(side|corner)/i.exec(gradient[2]); @@ -6890,20 +6891,20 @@ function parseGradient(s) { o.z = size[0].toLowerCase(); } // 扩展支持从a点到b点相对坐标,而不是size,sketch等ui软件中用此格式 else { - var _points = /([-+]?[\d.]+)\s+([-+]?[\d.]+)\s+([-+]?[\d.]+)\s+([-+]?[\d.]+)(?:\s+([\d.]+))?/.exec(gradient[2]); + var _points = /([-+]?[\d.]+)\s+([-+]?[\d.]+)\s+([-+]?[\d.]+)\s+([-+]?[\d.]+)(?:\s+([\d.]+))?/.exec(gradient[2]); - if (_points) { - o.z = [parseFloat(_points[1]), parseFloat(_points[2]), parseFloat(_points[3]), parseFloat(_points[4])]; + if (_points) { + o.z = [parseFloat(_points[1]), parseFloat(_points[2]), parseFloat(_points[3]), parseFloat(_points[4])]; - if (!isNil$1(_points[5])) { - o.z.push(parseFloat(_points[5])); - } else { - o.z.push(1); - } + if (!isNil$e(_points[5])) { + o.z.push(parseFloat(_points[5])); } else { - o.z = 'farthest-corner'; + o.z.push(1); } + } else { + o.z = 'farthest-corner'; } + } var position = /at\s+((?:[-+]?[\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\s+((?:[-+]?[\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]); @@ -6912,7 +6913,7 @@ function parseGradient(s) { var y = position[2] ? getRadialPosition(position[2]) : x; o.p = [x, y]; } else { - o.p = [[50, PERCENT$1], [50, PERCENT$1]]; + o.p = [[50, PERCENT$b], [50, PERCENT$b]]; } } else if (o.k === 'conic') { var _deg = /([-+]?[\d.]+deg)/i.exec(gradient[2]); @@ -6932,21 +6933,21 @@ function parseGradient(s) { o.p = [_x, _y]; } else { - o.p = [[50, PERCENT$1], [50, PERCENT$1]]; + o.p = [[50, PERCENT$b], [50, PERCENT$b]]; } } var v = gradient[2].match(/([-+]?[\d.]+[pxremvwh%]+)?\s*((#[0-9a-f]{3,8})|(rgba?\s*\(.+?\)))\s*([-+]?[\d.]+[pxremvwh%]+)?/ig) || []; o.v = v.map(function (item) { var color = /((?:#[0-9a-f]{3,8})|(?:rgba?\s*\(.+?\)))/i.exec(item); - var arr = [rgba2int$1(color[1])]; + var arr = [rgba2int$2(color[1])]; var percent = /[-+]?[\d.]+[pxremvwh%]+/.exec(item); if (percent) { - var _v = calUnit(percent[0]); + var _v = calUnit$2(percent[0]); - if ([NUMBER, DEG].indexOf(_v[1]) > -1) { - _v[1] = PX$1; + if ([NUMBER$5, DEG$2].indexOf(_v[1]) > -1) { + _v[1] = PX$a; } arr[1] = _v; @@ -7129,11 +7130,11 @@ function renderConic(xom, renderMode, ctx, res, x, y, w, h, btlr, btrr, bbrr, bb if (renderMode === mode.CANVAS || renderMode === mode.WEBGL) { var offscreen = inject.getCacheCanvas(w, h, '__$$CONIC_GRADIENT$$__'); var imgData = offscreen.ctx.getImageData(0, 0, w, h); - gradient.getConicGradientImage(res.cx - x, res.cy - y, res.w, res.h, res.stop, imgData.data); + gradient$1.getConicGradientImage(res.cx - x, res.cy - y, res.w, res.h, res.stop, imgData.data); offscreen.ctx.putImageData(imgData, 0, 0); ctx.save(); ctx.beginPath(); - canvasPolygon$2(ctx, list); + canvasPolygon$5(ctx, list); ctx.clip(); ctx.closePath(); ctx.drawImage(offscreen.canvas, x, y); @@ -7147,13 +7148,13 @@ function renderConic(xom, renderMode, ctx, res, x, y, w, h, btlr, btrr, bbrr, bb children: [] }; - xom.__config[NODE_DEFS_CACHE].push(v); + xom.__config[NODE_DEFS_CACHE$6].push(v); res.forEach(function (item) { v.children.push({ type: 'item', tagName: 'path', - props: [['d', svgPolygon$2(item[0])], ['fill', item[1]]] + props: [['d', svgPolygon$5(item[0])], ['fill', item[1]]] }); }); return ctx.add(v); @@ -7162,25 +7163,25 @@ function renderConic(xom, renderMode, ctx, res, x, y, w, h, btlr, btrr, bbrr, bb tagName: 'clipPath', children: [{ tagName: 'path', - props: [['d', svgPolygon$2(list)]] + props: [['d', svgPolygon$5(list)]] }] }; - xom.__config[NODE_DEFS_CACHE].push(_v2); + xom.__config[NODE_DEFS_CACHE$6].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 + ')']] + props: [['d', svgPolygon$5(item[0])], ['fill', item[1]], ['clip-path', 'url(#' + clip + ')']] }); }); } } } -var gradient$1 = { +var gradient = { parseGradient: parseGradient, getLinear: getLinear, getRadial: getRadial, @@ -7277,7 +7278,7 @@ var DOM = { textStrokeColor: 'inherit', textStrokeOver: 'inherit' }; -var GEOM = { +var GEOM$4 = { fill: 'transparent', stroke: '#000', strokeWidth: 1, @@ -7298,16 +7299,16 @@ Object.keys(DOM).forEach(function (k) { }); }); var GEOM_ENTRY_SET = []; -var GEOM_KEY_SET = []; -Object.keys(GEOM).forEach(function (k) { - GEOM_KEY_SET.push(k); - var v = GEOM[k]; +var GEOM_KEY_SET$2 = []; +Object.keys(GEOM$4).forEach(function (k) { + GEOM_KEY_SET$2.push(k); + var v = GEOM$4[k]; GEOM_ENTRY_SET.push({ k: k, v: v }); }); -var INHERIT = { +var INHERIT$5 = { fontFamily: 'arial', fontSize: 16, fontWeight: 400, @@ -7321,35 +7322,35 @@ var INHERIT = { textStrokeOver: 'none' }; var INHERIT_KEY_SET = []; -Object.keys(INHERIT).forEach(function (k) { +Object.keys(INHERIT$5).forEach(function (k) { INHERIT_KEY_SET.push(k); }); var reset = { DOM: DOM, - GEOM: GEOM, + GEOM: GEOM$4, isValid: function isValid(i) { - return DOM.hasOwnProperty(i) || GEOM.hasOwnProperty(i); + return DOM.hasOwnProperty(i) || GEOM$4.hasOwnProperty(i); }, DOM_KEY_SET: DOM_KEY_SET, - GEOM_KEY_SET: GEOM_KEY_SET, + GEOM_KEY_SET: GEOM_KEY_SET$2, DOM_ENTRY_SET: DOM_ENTRY_SET, GEOM_ENTRY_SET: GEOM_ENTRY_SET, - INHERIT: INHERIT, + INHERIT: INHERIT$5, INHERIT_KEY_SET: INHERIT_KEY_SET }; -var isNil$2 = util.isNil; +var isNil$d = util.isNil; function parseFlex(style, grow, shrink, basis) { - if (isNil$2(style.flexGrow)) { + if (isNil$d(style.flexGrow)) { style.flexGrow = grow || 0; } - if (isNil$2(style.flexShrink)) { + if (isNil$d(style.flexShrink)) { style.flexShrink = shrink || 0; } - if (isNil$2(style.flexBasis)) { + if (isNil$d(style.flexBasis)) { style.flexBasis = basis || 0; } } @@ -7357,7 +7358,7 @@ function parseFlex(style, grow, shrink, basis) { function parseMarginPadding(style, key, list) { var temp = style[key]; - if (!isNil$2(temp)) { + if (!isNil$d(temp)) { var match = temp.toString().match(/([-+]?[\d.]+[pxremvwh%]*)|(auto)/ig); if (match) { @@ -7371,7 +7372,7 @@ function parseMarginPadding(style, key, list) { } list.forEach(function (k, i) { - if (isNil$2(style[k])) { + if (isNil$d(style[k])) { style[k] = match[i]; } }); @@ -7382,22 +7383,22 @@ function parseMarginPadding(style, key, list) { function parseOneBorder(style, k) { var v = style[k]; - if (isNil$2(v)) { + if (isNil$d(v)) { return; } // 后面会统一格式化处理 - if (isNil$2(style[k + 'Width'])) { + if (isNil$d(style[k + 'Width'])) { var w = /\b[\d.]+[pxremvwh%]*\b/i.exec(v); style[k + 'Width'] = w ? w[0] : 0; } - if (isNil$2(style[k + 'Style'])) { + if (isNil$d(style[k + 'Style'])) { var s = /\b(solid|dashed|dotted)\b/i.exec(v); style[k + 'Style'] = s ? s[1] : 'solid'; } - if (isNil$2(style[k + 'Color'])) { + if (isNil$d(style[k + 'Color'])) { var c = /#[0-9a-f]{3,8}/i.exec(v); if (c && [4, 7, 9].indexOf(c[0].length) > -1) { @@ -7411,7 +7412,7 @@ function parseOneBorder(style, k) { } } -var abbr = { +var abbr$1 = { margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'], padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'], border: ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'], @@ -7443,7 +7444,7 @@ var abbr = { if (Array.isArray(v)) { var length = v.length; - if (isNil$2(style.backgroundColor)) { + if (isNil$d(style.backgroundColor)) { var bgc = /^\s*((transparent)|(#[0-9a-f]{3,8})|(rgba?\s*\(.+?\)))/i.exec(v[length - 1]); if (bgc) { @@ -7456,7 +7457,7 @@ var abbr = { var bgr = []; var bgp = []; v.forEach(function (item) { - if (isNil$2(style.backgroundImage)) { + if (isNil$d(style.backgroundImage)) { var gd = reg.gradient.exec(item); if (gd) { @@ -7472,7 +7473,7 @@ var abbr = { } } - if (isNil$2(style.backgroundRepeat)) { + if (isNil$d(style.backgroundRepeat)) { var repeat = /(no-?)?repeat(-?[xy])?/i.exec(item); if (repeat) { @@ -7480,7 +7481,7 @@ var abbr = { } } - if (isNil$2(style.backgroundPosition)) { + if (isNil$d(style.backgroundPosition)) { var position = item.match(reg.position); if (position) { @@ -7502,7 +7503,7 @@ var abbr = { this.toFull(style, 'backgroundPosition'); } } else { - if (isNil$2(style.backgroundImage)) { + if (isNil$d(style.backgroundImage)) { var gd = reg.gradient.exec(v); if (gd) { @@ -7518,7 +7519,7 @@ var abbr = { } } - if (isNil$2(style.backgroundRepeat)) { + if (isNil$d(style.backgroundRepeat)) { var repeat = /(no-?)?repeat(-?[xy])?/i.exec(v); if (repeat) { @@ -7526,7 +7527,7 @@ var abbr = { } } - if (isNil$2(style.backgroundColor)) { + if (isNil$d(style.backgroundColor)) { var _bgc = /^(transparent)|(#[0-9a-f]{3,8})|(rgba?\s*\(.+?\))/i.exec(v); if (_bgc) { @@ -7535,7 +7536,7 @@ var abbr = { } } - if (isNil$2(style.backgroundPosition)) { + if (isNil$d(style.backgroundPosition)) { var position = v.match(reg.position); if (position) { @@ -7575,7 +7576,7 @@ var abbr = { v = v.toString().split(/\s+/); if (v.length) { - if (isNil$2(style.flexDirection)) ; + if (isNil$d(style.flexDirection)) ; style.flexDirection = v[0]; @@ -7608,7 +7609,7 @@ var abbr = { } this[k].forEach(function (k, i) { - if (isNil$2(style[k])) { + if (isNil$d(style[k])) { style[k] = v[0][i] + ' ' + v[1][i]; } }); @@ -7618,7 +7619,7 @@ var abbr = { } var isEmpty = this[k].map(function (k2) { - return isNil$2(style[k2]); + return isNil$d(style[k2]); }); v.forEach(function (v2) { v2 = v2.toString().split(/\s+/); @@ -7642,7 +7643,7 @@ var abbr = { } this[k].forEach(function (k, i) { - if (isNil$2(style[k])) { + if (isNil$d(style[k])) { style[k] = _arr4[i]; } }); @@ -7656,7 +7657,7 @@ var abbr = { } this[k].forEach(function (k, i) { - if (isNil$2(style[k])) { + if (isNil$d(style[k])) { style[k] = _arr5[i]; } }); @@ -7684,7 +7685,7 @@ var abbr = { } } else if (this[k]) { this[k].forEach(function (k) { - if (isNil$2(style[k])) { + if (isNil$d(style[k])) { style[k] = v; } }); @@ -7694,36 +7695,36 @@ var abbr = { } }; -var STYLE_KEY$1 = enums.STYLE_KEY; -var KEY_COLOR = [[STYLE_KEY$1.BACKGROUND_COLOR], [STYLE_KEY$1.BORDER_BOTTOM_COLOR], [STYLE_KEY$1.BORDER_LEFT_COLOR], [STYLE_KEY$1.BORDER_RIGHT_COLOR], [STYLE_KEY$1.BORDER_TOP_COLOR], [STYLE_KEY$1.COLOR], [STYLE_KEY$1.TEXT_STROKE_COLOR]]; -var KEY_LENGTH = [[STYLE_KEY$1.FONT_SIZE], [STYLE_KEY$1.BORDER_BOTTOM_WIDTH], [STYLE_KEY$1.BORDER_LEFT_WIDTH], [STYLE_KEY$1.BORDER_RIGHT_WIDTH], [STYLE_KEY$1.BORDER_TOP_WIDTH], [STYLE_KEY$1.LEFT], [STYLE_KEY$1.TOP], [STYLE_KEY$1.RIGHT], [STYLE_KEY$1.BOTTOM], [STYLE_KEY$1.FLEX_BASIS], [STYLE_KEY$1.WIDTH], [STYLE_KEY$1.HEIGHT], [STYLE_KEY$1.LINE_HEIGHT], [STYLE_KEY$1.MARGIN_BOTTOM], [STYLE_KEY$1.MARGIN_LEFT], [STYLE_KEY$1.MARGIN_TOP], [STYLE_KEY$1.MARGIN_RIGHT], [STYLE_KEY$1.PADDING_TOP], [STYLE_KEY$1.PADDING_RIGHT], [STYLE_KEY$1.PADDING_BOTTOM], [STYLE_KEY$1.PADDING_LEFT], [STYLE_KEY$1.STROKE_WIDTH], [STYLE_KEY$1.STROKE_MITERLIMIT], [STYLE_KEY$1.LETTER_SPACING], [STYLE_KEY$1.PERSPECTIVE], [STYLE_KEY$1.TEXT_STROKE_WIDTH]]; -var KEY_GRADIENT = [[STYLE_KEY$1.BACKGROUND_IMAGE], [STYLE_KEY$1.FILL], [STYLE_KEY$1.STROKE]]; -var KEY_RADIUS = [[STYLE_KEY$1.BORDER_TOP_LEFT_RADIUS], [STYLE_KEY$1.BORDER_TOP_RIGHT_RADIUS], [STYLE_KEY$1.BORDER_BOTTOM_RIGHT_RADIUS], [STYLE_KEY$1.BORDER_BOTTOM_LEFT_RADIUS]]; -var COLOR_HASH = {}; +var STYLE_KEY$4 = enums.STYLE_KEY; +var KEY_COLOR = [[STYLE_KEY$4.BACKGROUND_COLOR], [STYLE_KEY$4.BORDER_BOTTOM_COLOR], [STYLE_KEY$4.BORDER_LEFT_COLOR], [STYLE_KEY$4.BORDER_RIGHT_COLOR], [STYLE_KEY$4.BORDER_TOP_COLOR], [STYLE_KEY$4.COLOR], [STYLE_KEY$4.TEXT_STROKE_COLOR]]; +var KEY_LENGTH = [[STYLE_KEY$4.FONT_SIZE], [STYLE_KEY$4.BORDER_BOTTOM_WIDTH], [STYLE_KEY$4.BORDER_LEFT_WIDTH], [STYLE_KEY$4.BORDER_RIGHT_WIDTH], [STYLE_KEY$4.BORDER_TOP_WIDTH], [STYLE_KEY$4.LEFT], [STYLE_KEY$4.TOP], [STYLE_KEY$4.RIGHT], [STYLE_KEY$4.BOTTOM], [STYLE_KEY$4.FLEX_BASIS], [STYLE_KEY$4.WIDTH], [STYLE_KEY$4.HEIGHT], [STYLE_KEY$4.LINE_HEIGHT], [STYLE_KEY$4.MARGIN_BOTTOM], [STYLE_KEY$4.MARGIN_LEFT], [STYLE_KEY$4.MARGIN_TOP], [STYLE_KEY$4.MARGIN_RIGHT], [STYLE_KEY$4.PADDING_TOP], [STYLE_KEY$4.PADDING_RIGHT], [STYLE_KEY$4.PADDING_BOTTOM], [STYLE_KEY$4.PADDING_LEFT], [STYLE_KEY$4.STROKE_WIDTH], [STYLE_KEY$4.STROKE_MITERLIMIT], [STYLE_KEY$4.LETTER_SPACING], [STYLE_KEY$4.PERSPECTIVE], [STYLE_KEY$4.TEXT_STROKE_WIDTH]]; +var KEY_GRADIENT = [[STYLE_KEY$4.BACKGROUND_IMAGE], [STYLE_KEY$4.FILL], [STYLE_KEY$4.STROKE]]; +var KEY_RADIUS = [[STYLE_KEY$4.BORDER_TOP_LEFT_RADIUS], [STYLE_KEY$4.BORDER_TOP_RIGHT_RADIUS], [STYLE_KEY$4.BORDER_BOTTOM_RIGHT_RADIUS], [STYLE_KEY$4.BORDER_BOTTOM_LEFT_RADIUS]]; +var COLOR_HASH$2 = {}; KEY_COLOR.forEach(function (k) { - COLOR_HASH[k] = true; + COLOR_HASH$2[k] = true; }); -var LENGTH_HASH = {}; +var LENGTH_HASH$2 = {}; KEY_LENGTH.forEach(function (k) { - LENGTH_HASH[k] = true; + LENGTH_HASH$2[k] = true; }); -var RADIUS_HASH = {}; +var RADIUS_HASH$2 = {}; KEY_RADIUS.forEach(function (k) { - RADIUS_HASH[k] = true; + RADIUS_HASH$2[k] = true; }); -var GRADIENT_HASH = {}; +var GRADIENT_HASH$2 = {}; KEY_GRADIENT.forEach(function (k) { - GRADIENT_HASH[k] = true; + GRADIENT_HASH$2[k] = true; }); -var GRADIENT_TYPE = { +var GRADIENT_TYPE$2 = { linear: true, radial: true, conic: true }; -var KEY_EXPAND = [[STYLE_KEY$1.TRANSLATE_X], [STYLE_KEY$1.TRANSLATE_Y], [STYLE_KEY$1.TRANSLATE_Z], [STYLE_KEY$1.SKEW_X], [STYLE_KEY$1.SKEW_Y], [STYLE_KEY$1.SCALE_X], [STYLE_KEY$1.SCALE_Y], [STYLE_KEY$1.SCALE_Z], [STYLE_KEY$1.ROTATE_X], [STYLE_KEY$1.ROTATE_Y], [STYLE_KEY$1.ROTATE_Z]]; -var EXPAND_HASH = {}; +var KEY_EXPAND = [[STYLE_KEY$4.TRANSLATE_X], [STYLE_KEY$4.TRANSLATE_Y], [STYLE_KEY$4.TRANSLATE_Z], [STYLE_KEY$4.SKEW_X], [STYLE_KEY$4.SKEW_Y], [STYLE_KEY$4.SCALE_X], [STYLE_KEY$4.SCALE_Y], [STYLE_KEY$4.SCALE_Z], [STYLE_KEY$4.ROTATE_X], [STYLE_KEY$4.ROTATE_Y], [STYLE_KEY$4.ROTATE_Z]]; +var EXPAND_HASH$2 = {}; KEY_EXPAND.forEach(function (k) { - EXPAND_HASH[k] = true; + EXPAND_HASH$2[k] = true; }); var key = { KEY_COLOR: KEY_COLOR, @@ -7731,31 +7732,31 @@ var key = { KEY_GRADIENT: KEY_GRADIENT, KEY_LENGTH: KEY_LENGTH, KEY_RADIUS: KEY_RADIUS, - COLOR_HASH: COLOR_HASH, - EXPAND_HASH: EXPAND_HASH, - GRADIENT_HASH: GRADIENT_HASH, - LENGTH_HASH: LENGTH_HASH, - RADIUS_HASH: RADIUS_HASH, - GRADIENT_TYPE: GRADIENT_TYPE + COLOR_HASH: COLOR_HASH$2, + EXPAND_HASH: EXPAND_HASH$2, + GRADIENT_HASH: GRADIENT_HASH$2, + LENGTH_HASH: LENGTH_HASH$2, + RADIUS_HASH: RADIUS_HASH$2, + GRADIENT_TYPE: GRADIENT_TYPE$2 }; var _REPAINT, _MEASURE; 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 INHERIT$4 = o$4.INHERIT; +var STYLE_KEY$3 = enums.STYLE_KEY; +var GEOM$3 = {}; var GEOM_KEY_SET$1 = []; -var IGNORE = _defineProperty({}, STYLE_KEY$2.POINTER_EVENTS, true); +var IGNORE = _defineProperty({}, STYLE_KEY$3.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 REPAINT$3 = (_REPAINT = {}, _defineProperty(_REPAINT, STYLE_KEY$3.TRANSFORM, true), _defineProperty(_REPAINT, STYLE_KEY$3.TRANSLATE_X, true), _defineProperty(_REPAINT, STYLE_KEY$3.TRANSLATE_Y, true), _defineProperty(_REPAINT, STYLE_KEY$3.SKEW_X, true), _defineProperty(_REPAINT, STYLE_KEY$3.SKEW_Y, true), _defineProperty(_REPAINT, STYLE_KEY$3.SCALE_X, true), _defineProperty(_REPAINT, STYLE_KEY$3.SCALE_Y, true), _defineProperty(_REPAINT, STYLE_KEY$3.ROTATE_Z, true), _defineProperty(_REPAINT, STYLE_KEY$3.COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$3.FONT_STYLE, true), _defineProperty(_REPAINT, STYLE_KEY$3.STROKE_WIDTH, true), _defineProperty(_REPAINT, STYLE_KEY$3.FILL, true), _defineProperty(_REPAINT, STYLE_KEY$3.STROKE_DASHARRAY, true), _defineProperty(_REPAINT, STYLE_KEY$3.STROKE_LINECAP, true), _defineProperty(_REPAINT, STYLE_KEY$3.STROKE_LINEJOIN, true), _defineProperty(_REPAINT, STYLE_KEY$3.STROKE_MITERLIMIT, true), _defineProperty(_REPAINT, STYLE_KEY$3.BACKGROUND_COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$3.BACKGROUND_IMAGE, true), _defineProperty(_REPAINT, STYLE_KEY$3.BACKGROUND_POSITION_X, true), _defineProperty(_REPAINT, STYLE_KEY$3.BACKGROUND_POSITION_Y, true), _defineProperty(_REPAINT, STYLE_KEY$3.BACKGROUND_REPEAT, true), _defineProperty(_REPAINT, STYLE_KEY$3.BACKGROUND_SIZE, true), _defineProperty(_REPAINT, STYLE_KEY$3.STROKE, true), _defineProperty(_REPAINT, STYLE_KEY$3.BORDER_BOTTOM_COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$3.BORDER_LEFT_COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$3.BORDER_RIGHT_COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$3.BORDER_TOP_COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$3.BORDER_TOP_LEFT_RADIUS, true), _defineProperty(_REPAINT, STYLE_KEY$3.BORDER_TOP_RIGHT_RADIUS, true), _defineProperty(_REPAINT, STYLE_KEY$3.BORDER_BOTTOM_RIGHT_RADIUS, true), _defineProperty(_REPAINT, STYLE_KEY$3.BORDER_BOTTOM_LEFT_RADIUS, true), _defineProperty(_REPAINT, STYLE_KEY$3.VISIBILITY, true), _defineProperty(_REPAINT, STYLE_KEY$3.OPACITY, true), _defineProperty(_REPAINT, STYLE_KEY$3.Z_INDEX, true), _defineProperty(_REPAINT, STYLE_KEY$3.FILTER, true), _defineProperty(_REPAINT, STYLE_KEY$3.BOX_SHADOW, true), _defineProperty(_REPAINT, STYLE_KEY$3.OVERFLOW, true), _defineProperty(_REPAINT, STYLE_KEY$3.BACKGROUND_CLIP, true), _defineProperty(_REPAINT, STYLE_KEY$3.TEXT_STROKE_WIDTH, true), _defineProperty(_REPAINT, STYLE_KEY$3.TEXT_STROKE_COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$3.TEXT_STROKE_OVER, true), _REPAINT); +var MEASURE = (_MEASURE = {}, _defineProperty(_MEASURE, STYLE_KEY$3.FONT_SIZE, true), _defineProperty(_MEASURE, STYLE_KEY$3.FONT_WEIGHT, true), _defineProperty(_MEASURE, STYLE_KEY$3.FONT_FAMILY, true), _MEASURE); var o$2 = { - GEOM: GEOM$1, + GEOM: GEOM$3, GEOM_KEY_SET: GEOM_KEY_SET$1, IGNORE: IGNORE, - REPAINT: REPAINT, + REPAINT: REPAINT$3, MEASURE: MEASURE, addGeom: function addGeom(tagName, ks, cb) { if (Array.isArray(ks)) { @@ -7763,11 +7764,11 @@ var o$2 = { o$2.addGeom(tagName, k, cb); }); } else if (ks) { - if (!GEOM$1.hasOwnProperty(ks)) { + if (!GEOM$3.hasOwnProperty(ks)) { GEOM_KEY_SET$1.push(ks); } - var hash = GEOM$1[ks] = GEOM$1[ks] || {}; + var hash = GEOM$3[ks] = GEOM$3[ks] || {}; hash[tagName] = cb || true; } } @@ -7777,14 +7778,14 @@ o$2.isIgnore = function (k) { return IGNORE.hasOwnProperty(k); }; -function isGeom(tagName, k) { - return GEOM$1.hasOwnProperty(k) && GEOM$1[k].hasOwnProperty(tagName); +function isGeom$3(tagName, k) { + return GEOM$3.hasOwnProperty(k) && GEOM$3[k].hasOwnProperty(tagName); } -o$2.isGeom = isGeom; +o$2.isGeom = isGeom$3; o$2.isRepaint = function (k) { - return REPAINT.hasOwnProperty(k) || isGeom(k); + return REPAINT$3.hasOwnProperty(k) || isGeom$3(k); }; o$2.isMeasure = function (k) { @@ -7805,8 +7806,8 @@ o$2.isValid = function (tagName, k) { return true; } - if (GEOM$1.hasOwnProperty(k)) { - return GEOM$1[k].hasOwnProperty(tagName); + if (GEOM$3.hasOwnProperty(k)) { + return GEOM$3[k].hasOwnProperty(tagName); } if (k === 'translatePath') { @@ -7816,17 +7817,17 @@ o$2.isValid = function (tagName, k) { return false; }; -var MEASURE_KEY_SET = o$2.MEASURE_KEY_SET = Object.keys(MEASURE).map(function (i) { +var MEASURE_KEY_SET$1 = o$2.MEASURE_KEY_SET = Object.keys(MEASURE).map(function (i) { return parseInt(i); }); -var len = MEASURE_KEY_SET.length; +var len = MEASURE_KEY_SET$1.length; o$2.isMeasureInherit = function (target) { if (target) { for (var i = 0; i < len; i++) { - var k = MEASURE_KEY_SET[i]; + var k = MEASURE_KEY_SET$1[i]; - if (target.hasOwnProperty(k) && target[k][1] === INHERIT$1) { + if (target.hasOwnProperty(k) && target[k][1] === INHERIT$4) { return true; } } @@ -7839,9 +7840,9 @@ o$2.measureInheritList = function (target) { var list = []; for (var i = 0; i < len; i++) { - var k = MEASURE_KEY_SET[i]; + var k = MEASURE_KEY_SET$1[i]; - if (target.hasOwnProperty(k) && target[k][1] === INHERIT$1) { + if (target.hasOwnProperty(k) && target[k][1] === INHERIT$4) { list.push(k); } } @@ -7858,95 +7859,95 @@ o$2.addGeom('$polyline', ['points', 'controls', 'start', 'end']); o$2.addGeom('$polygon', ['points', 'controls', 'start', 'end']); var _VALUE, _ARRAY_, _ARRAY_0_; -var STYLE_KEY$3 = enums.STYLE_KEY, +var STYLE_KEY$2 = 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; -var AUTO = o.AUTO, - PX$2 = o.PX, - PERCENT$2 = o.PERCENT, - NUMBER$1 = o.NUMBER, - INHERIT$2 = o.INHERIT, - DEG$1 = o.DEG, - RGBA = o.RGBA, - STRING = o.STRING, - REM$2 = o.REM, - VW$2 = o.VW, - VH$2 = o.VH, - calUnit$1 = o.calUnit; -var isNil$3 = util.isNil, - rgba2int$2 = util.rgba2int, + _enums$STYLE_KEY$n = enums.STYLE_KEY, + POSITION$5 = _enums$STYLE_KEY$n.POSITION, + WIDTH$7 = _enums$STYLE_KEY$n.WIDTH, + HEIGHT$7 = _enums$STYLE_KEY$n.HEIGHT, + TRANSLATE_X$4 = _enums$STYLE_KEY$n.TRANSLATE_X, + TRANSLATE_Y$4 = _enums$STYLE_KEY$n.TRANSLATE_Y, + TRANSLATE_Z$4 = _enums$STYLE_KEY$n.TRANSLATE_Z, + SCALE_X$3 = _enums$STYLE_KEY$n.SCALE_X, + SCALE_Y$3 = _enums$STYLE_KEY$n.SCALE_Y, + SCALE_Z$2 = _enums$STYLE_KEY$n.SCALE_Z, + SKEW_X$2 = _enums$STYLE_KEY$n.SKEW_X, + SKEW_Y$2 = _enums$STYLE_KEY$n.SKEW_Y, + ROTATE_X$2 = _enums$STYLE_KEY$n.ROTATE_X, + ROTATE_Y$2 = _enums$STYLE_KEY$n.ROTATE_Y, + ROTATE_Z$2 = _enums$STYLE_KEY$n.ROTATE_Z, + ROTATE_3D$3 = _enums$STYLE_KEY$n.ROTATE_3D, + PERSPECTIVE$5 = _enums$STYLE_KEY$n.PERSPECTIVE, + PERSPECTIVE_ORIGIN$4 = _enums$STYLE_KEY$n.PERSPECTIVE_ORIGIN, + TRANSFORM$4 = _enums$STYLE_KEY$n.TRANSFORM, + TRANSFORM_ORIGIN$4 = _enums$STYLE_KEY$n.TRANSFORM_ORIGIN, + BACKGROUND_IMAGE$2 = _enums$STYLE_KEY$n.BACKGROUND_IMAGE, + BACKGROUND_COLOR$2 = _enums$STYLE_KEY$n.BACKGROUND_COLOR, + BACKGROUND_POSITION_X$3 = _enums$STYLE_KEY$n.BACKGROUND_POSITION_X, + BACKGROUND_POSITION_Y$3 = _enums$STYLE_KEY$n.BACKGROUND_POSITION_Y, + BACKGROUND_SIZE$2 = _enums$STYLE_KEY$n.BACKGROUND_SIZE, + OPACITY$5 = _enums$STYLE_KEY$n.OPACITY, + Z_INDEX$4 = _enums$STYLE_KEY$n.Z_INDEX, + COLOR$5 = _enums$STYLE_KEY$n.COLOR, + FONT_SIZE$f = _enums$STYLE_KEY$n.FONT_SIZE, + FONT_FAMILY$4 = _enums$STYLE_KEY$n.FONT_FAMILY, + FONT_WEIGHT$4 = _enums$STYLE_KEY$n.FONT_WEIGHT, + FONT_STYLE$4 = _enums$STYLE_KEY$n.FONT_STYLE, + LINE_HEIGHT$4 = _enums$STYLE_KEY$n.LINE_HEIGHT, + TEXT_ALIGN$2 = _enums$STYLE_KEY$n.TEXT_ALIGN, + FILTER$6 = _enums$STYLE_KEY$n.FILTER, + VISIBILITY$7 = _enums$STYLE_KEY$n.VISIBILITY, + BOX_SHADOW$9 = _enums$STYLE_KEY$n.BOX_SHADOW, + POINTER_EVENTS$2 = _enums$STYLE_KEY$n.POINTER_EVENTS, + FILL$2 = _enums$STYLE_KEY$n.FILL, + STROKE$1 = _enums$STYLE_KEY$n.STROKE, + STROKE_WIDTH$7 = _enums$STYLE_KEY$n.STROKE_WIDTH, + STROKE_DASHARRAY$1 = _enums$STYLE_KEY$n.STROKE_DASHARRAY, + BORDER_TOP_WIDTH$5 = _enums$STYLE_KEY$n.BORDER_TOP_WIDTH, + BORDER_RIGHT_WIDTH$6 = _enums$STYLE_KEY$n.BORDER_RIGHT_WIDTH, + BORDER_BOTTOM_WIDTH$5 = _enums$STYLE_KEY$n.BORDER_BOTTOM_WIDTH, + BORDER_LEFT_WIDTH$7 = _enums$STYLE_KEY$n.BORDER_LEFT_WIDTH, + DISPLAY$a = _enums$STYLE_KEY$n.DISPLAY, + FLEX_DIRECTION$2 = _enums$STYLE_KEY$n.FLEX_DIRECTION, + FLEX_GROW$1 = _enums$STYLE_KEY$n.FLEX_GROW, + FLEX_SHRINK$1 = _enums$STYLE_KEY$n.FLEX_SHRINK, + FLEX_BASIS$4 = _enums$STYLE_KEY$n.FLEX_BASIS, + JUSTIFY_CONTENT$1 = _enums$STYLE_KEY$n.JUSTIFY_CONTENT, + ALIGN_SELF$1 = _enums$STYLE_KEY$n.ALIGN_SELF, + ALIGN_ITEMS$1 = _enums$STYLE_KEY$n.ALIGN_ITEMS, + MATRIX$3 = _enums$STYLE_KEY$n.MATRIX, + LETTER_SPACING$2 = _enums$STYLE_KEY$n.LETTER_SPACING, + BACKGROUND_CLIP$2 = _enums$STYLE_KEY$n.BACKGROUND_CLIP, + WHITE_SPACE$2 = _enums$STYLE_KEY$n.WHITE_SPACE, + TEXT_OVERFLOW$2 = _enums$STYLE_KEY$n.TEXT_OVERFLOW, + LINE_CLAMP$1 = _enums$STYLE_KEY$n.LINE_CLAMP, + ORDER$1 = _enums$STYLE_KEY$n.ORDER, + FLEX_WRAP$1 = _enums$STYLE_KEY$n.FLEX_WRAP, + ALIGN_CONTENT$1 = _enums$STYLE_KEY$n.ALIGN_CONTENT, + TRANSLATE_PATH$1 = _enums$STYLE_KEY$n.TRANSLATE_PATH, + TEXT_STROKE_COLOR$4 = _enums$STYLE_KEY$n.TEXT_STROKE_COLOR, + TEXT_STROKE_WIDTH$3 = _enums$STYLE_KEY$n.TEXT_STROKE_WIDTH, + TEXT_STROKE_OVER$3 = _enums$STYLE_KEY$n.TEXT_STROKE_OVER; +var AUTO$8 = o$4.AUTO, + PX$9 = o$4.PX, + PERCENT$a = o$4.PERCENT, + NUMBER$4 = o$4.NUMBER, + INHERIT$3 = o$4.INHERIT, + DEG$1 = o$4.DEG, + RGBA$2 = o$4.RGBA, + STRING$2 = o$4.STRING, + REM$e = o$4.REM, + VW$e = o$4.VW, + VH$e = o$4.VH, + calUnit$1 = o$4.calUnit; +var isNil$c = util.isNil, + rgba2int$1 = util.rgba2int, equalArr$1 = util.equalArr; -var MEASURE_KEY_SET$1 = o$2.MEASURE_KEY_SET, - isGeom$1 = o$2.isGeom, +var MEASURE_KEY_SET = o$2.MEASURE_KEY_SET, + isGeom$2 = o$2.isGeom, GEOM$2 = o$2.GEOM, - GEOM_KEY_SET$2 = o$2.GEOM_KEY_SET; + GEOM_KEY_SET = o$2.GEOM_KEY_SET; var COLOR_HASH$1 = key.COLOR_HASH, LENGTH_HASH$1 = key.LENGTH_HASH, RADIUS_HASH$1 = key.RADIUS_HASH, @@ -7954,33 +7955,33 @@ var COLOR_HASH$1 = key.COLOR_HASH, EXPAND_HASH$1 = key.EXPAND_HASH, GRADIENT_TYPE$1 = key.GRADIENT_TYPE; var TRANSFORM_HASH = { - translateX: TRANSLATE_X, - translateY: TRANSLATE_Y, - translateZ: TRANSLATE_Z, - scaleX: SCALE_X, - scaleY: SCALE_Y, - scaleZ: SCALE_Z, - skewX: SKEW_X, - skewY: SKEW_Y, - rotateX: ROTATE_X, - rotateY: ROTATE_Y, - rotateZ: ROTATE_Z, - rotate: ROTATE_Z + translateX: TRANSLATE_X$4, + translateY: TRANSLATE_Y$4, + translateZ: TRANSLATE_Z$4, + scaleX: SCALE_X$3, + scaleY: SCALE_Y$3, + scaleZ: SCALE_Z$2, + skewX: SKEW_X$2, + skewY: SKEW_Y$2, + rotateX: ROTATE_X$2, + rotateY: ROTATE_Y$2, + rotateZ: ROTATE_Z$2, + rotate: ROTATE_Z$2 }; function compatibleTransform(k, arr) { - if (k === SCALE_X || k === SCALE_Y || k === SCALE_Z) { - arr[1] = NUMBER$1; - } else if (k === TRANSLATE_X || k === TRANSLATE_Y || k === TRANSLATE_Z) { - if (arr[1] === NUMBER$1) { - arr[1] = PX$2; + if (k === SCALE_X$3 || k === SCALE_Y$3 || k === SCALE_Z$2) { + arr[1] = NUMBER$4; + } else if (k === TRANSLATE_X$4 || k === TRANSLATE_Y$4 || k === TRANSLATE_Z$4) { + if (arr[1] === NUMBER$4) { + arr[1] = PX$9; } - } else if (k === PERSPECTIVE) { - if ([NUMBER$1, PERCENT$2, DEG$1].indexOf(arr[1]) > -1) { - arr[1] = PX$2; + } else if (k === PERSPECTIVE$5) { + if ([NUMBER$4, PERCENT$a, DEG$1].indexOf(arr[1]) > -1) { + arr[1] = PX$9; } } else { - if (arr[1] === NUMBER$1) { + if (arr[1] === NUMBER$4) { arr[1] = DEG$1; } } @@ -7993,7 +7994,7 @@ function compatibleTransform(k, arr) { */ -function normalize(style) { +function normalize$1(style) { var reset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; if (!util.isObject(style)) { @@ -8007,94 +8008,94 @@ function normalize(style) { var temp = style.border; if (temp) { - abbr.toFull(style, 'border'); + abbr$1.toFull(style, 'border'); } ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'].forEach(function (k) { - abbr.toFull(style, k); + abbr$1.toFull(style, k); }); temp = style.borderWidth; if (temp) { - abbr.toFull(style, 'borderWidth'); + abbr$1.toFull(style, 'borderWidth'); } temp = style.borderColor; if (temp) { - abbr.toFull(style, 'borderColor'); + abbr$1.toFull(style, 'borderColor'); } temp = style.borderStyle; if (temp) { - abbr.toFull(style, 'borderStyle'); + abbr$1.toFull(style, 'borderStyle'); } temp = style.borderRadius; if (temp) { - abbr.toFull(style, 'borderRadius'); + abbr$1.toFull(style, 'borderRadius'); } temp = style.background; // 处理渐变背景缩写 if (temp) { - abbr.toFull(style, 'background'); + abbr$1.toFull(style, 'background'); } // 背景位置 temp = style.backgroundPosition; - if (!isNil$3(temp)) { - abbr.toFull(style, 'backgroundPosition'); + if (!isNil$c(temp)) { + abbr$1.toFull(style, 'backgroundPosition'); } // flex temp = style.flex; if (temp) { - abbr.toFull(style, 'flex'); + abbr$1.toFull(style, 'flex'); } // flex-flow temp = style.flexFlow; if (temp) { - abbr.toFull(style, 'flexFlow'); + abbr$1.toFull(style, 'flexFlow'); } temp = style.margin; - if (!isNil$3(temp)) { - abbr.toFull(style, 'margin'); + if (!isNil$c(temp)) { + abbr$1.toFull(style, 'margin'); } temp = style.padding; - if (!isNil$3(temp)) { - abbr.toFull(style, 'padding'); + if (!isNil$c(temp)) { + abbr$1.toFull(style, 'padding'); } temp = style.textStroke; if (temp) { - abbr.toFull(style, 'textStroke'); + abbr$1.toFull(style, 'textStroke'); } // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform ['translate', 'scale', 'skew', 'translate3d', 'scale3d', 'rotate'].forEach(function (k) { temp = style[k]; - if (!isNil$3(temp)) { - abbr.toFull(style, k); + if (!isNil$c(temp)) { + abbr$1.toFull(style, k); } }); // 扩展的不能和transform混用,给出警告 ['translateX', 'translateY', 'translateZ', 'scaleX', 'scaleY', 'scaleZ', 'skewX', 'skewY', 'rotateX', 'rotateY', 'rotateZ', 'rotate3d'].forEach(function (k) { var v = style[k]; - if (!isNil$3(v) && style.transform) { + if (!isNil$c(v) && style.transform) { inject.warn("Can not use expand style \"".concat(k, "\" with transform")); } }); // 默认reset,根据传入不同,当style为空时覆盖 @@ -8103,7 +8104,7 @@ function normalize(style) { var k = item.k, v = item.v; - if (isNil$3(style[k])) { + if (isNil$c(style[k])) { style[k] = v; } }); // 背景图 @@ -8112,15 +8113,15 @@ function normalize(style) { if (temp !== undefined) { if (!temp) { - res[BACKGROUND_IMAGE] = [null]; + res[BACKGROUND_IMAGE$2] = [null]; } else if (Array.isArray(temp)) { - res[BACKGROUND_IMAGE] = temp.map(function (item) { + res[BACKGROUND_IMAGE$2] = temp.map(function (item) { if (!item) { return null; } if (reg.gradient.test(item)) { - return gradient$1.parseGradient(item); + return gradient.parseGradient(item); } if (reg.img.test(item)) { @@ -8131,12 +8132,12 @@ function normalize(style) { }); } // 区分是渐变色还是图 else if (reg.gradient.test(temp)) { - res[BACKGROUND_IMAGE] = [gradient$1.parseGradient(temp)]; - } else if (reg.img.test(temp)) { - res[BACKGROUND_IMAGE] = [reg.img.exec(temp)[2]]; - } else { - res[BACKGROUND_IMAGE] = [null]; - } + res[BACKGROUND_IMAGE$2] = [gradient.parseGradient(temp)]; + } else if (reg.img.test(temp)) { + res[BACKGROUND_IMAGE$2] = [reg.img.exec(temp)[2]]; + } else { + res[BACKGROUND_IMAGE$2] = [null]; + } } temp = style.backgroundColor; @@ -8146,18 +8147,18 @@ function normalize(style) { var bgc = /^#[0-9a-f]{3,8}/i.exec(temp); if (bgc && [4, 7, 9].indexOf(bgc[0].length) > -1) { - res[BACKGROUND_COLOR] = [rgba2int$2(bgc[0]), RGBA]; + res[BACKGROUND_COLOR$2] = [rgba2int$1(bgc[0]), RGBA$2]; } else { bgc = /rgba?\s*\(.+\)/i.exec(temp); - res[BACKGROUND_COLOR] = [rgba2int$2(bgc ? bgc[0] : [0, 0, 0, 0]), RGBA]; + res[BACKGROUND_COLOR$2] = [rgba2int$1(bgc ? bgc[0] : [0, 0, 0, 0]), RGBA$2]; } } ['backgroundPositionX', 'backgroundPositionY'].forEach(function (k, i) { temp = style[k]; - if (!isNil$3(temp)) { - k = i ? BACKGROUND_POSITION_Y : BACKGROUND_POSITION_X; + if (!isNil$c(temp)) { + k = i ? BACKGROUND_POSITION_Y$3 : BACKGROUND_POSITION_X$3; if (!Array.isArray(temp)) { temp = [temp]; @@ -8167,8 +8168,8 @@ function normalize(style) { if (/^[-+]?[\d.]/.test(item)) { var v = calUnit$1(item); - if ([NUMBER$1, DEG$1].indexOf(v[1]) > -1) { - v[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(v[1]) > -1) { + v[1] = PX$9; } return v; @@ -8179,7 +8180,7 @@ function normalize(style) { center: 50, right: 100, bottom: 100 - }[item] || 0, PERCENT$2]; + }[item] || 0, PERCENT$a]; } }); } @@ -8192,9 +8193,9 @@ function normalize(style) { temp = [temp]; } - res[BACKGROUND_SIZE] = temp.map(function (item) { + res[BACKGROUND_SIZE$2] = temp.map(function (item) { if (!item) { - return [[0, AUTO], [0, AUTO]]; + return [[0, AUTO$8], [0, AUTO$8]]; } var match = item.toString().match(/\b(?:([-+]?[\d.]+[pxremvwh%]*)|(contain|cover|auto))/ig); @@ -8216,21 +8217,21 @@ function normalize(style) { if (/^[-+]?[\d.]/.test(_item)) { var n = calUnit$1(_item); - if ([NUMBER$1, DEG$1].indexOf(n[1]) > -1) { - n[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(n[1]) > -1) { + n[1] = PX$9; } v.push(n); } else if (_item === 'contain' || _item === 'cover') { - v.push([_item, STRING]); + v.push([_item, STRING$2]); } else { - v.push([0, AUTO]); + v.push([0, AUTO$8]); } } return v; } else { - return [[0, AUTO], [0, AUTO]]; + return [[0, AUTO$8], [0, AUTO$8]]; } }); } // border-color @@ -8240,8 +8241,8 @@ function normalize(style) { k = 'border' + k + 'Color'; var v = style[k]; - if (!isNil$3(v)) { - res[STYLE_KEY$3[style2Upper$1(k)]] = [rgba2int$2(v), RGBA]; + if (!isNil$c(v)) { + res[STYLE_KEY$2[style2Upper$1(k)]] = [rgba2int$1(v), RGBA$2]; } }); // border-radius @@ -8249,7 +8250,7 @@ function normalize(style) { k = 'border' + k + 'Radius'; var v = style[k]; - if (!isNil$3(v)) { + if (!isNil$c(v)) { var arr = v.toString().split(/\s+/); if (arr.length === 1) { @@ -8262,8 +8263,8 @@ function normalize(style) { if (/^[-+]?[\d.]/.test(item)) { var n = calUnit$1(item); - if ([NUMBER$1, DEG$1].indexOf(n[1]) > -1) { - n[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(n[1]) > -1) { + n[1] = PX$9; } if (n[0] < 0) { @@ -8272,17 +8273,17 @@ function normalize(style) { arr[i] = n; } else { - arr[i] = [0, PX$2]; + arr[i] = [0, PX$9]; } } - res[STYLE_KEY$3[style2Upper$1(k)]] = arr; + res[STYLE_KEY$2[style2Upper$1(k)]] = arr; } }); temp = style.transform; if (temp) { - var transform = res[TRANSFORM] = []; + var transform = res[TRANSFORM$4] = []; var match = (temp || '').toString().match(/\w+\(.+?\)/g); if (match) { @@ -8302,7 +8303,7 @@ function normalize(style) { } if (arr.length === 6) { - transform.push([MATRIX, [arr[0], arr[1], 0, 0, arr[2], arr[3], 0, 0, 0, 0, 1, 0, arr[4], arr[5], 0, 1]]); + transform.push([MATRIX$3, [arr[0], arr[1], 0, 0, arr[2], arr[3], 0, 0, 0, 0, 1, 0, arr[4], arr[5], 0, 1]]); } } else if (k === 'matrix3d') { var _arr = v.toString().split(/\s*,\s*/); @@ -8316,7 +8317,7 @@ function normalize(style) { } if (_arr.length === 16) { - transform.push([MATRIX, _arr]); + transform.push([MATRIX$3, _arr]); } } else if (k === 'perspective') { var _arr2 = calUnit$1(v); @@ -8325,19 +8326,19 @@ function normalize(style) { _arr2[0] = 0; } - compatibleTransform(PERSPECTIVE, _arr2); - transform.push([PERSPECTIVE, _arr2]); + compatibleTransform(PERSPECTIVE$5, _arr2); + transform.push([PERSPECTIVE$5, _arr2]); } else if (k === 'rotate3d') { var _arr3 = v.toString().split(/\s*,\s*/); if (_arr3.length === 4) { var deg = calUnit$1(_arr3[3]); - compatibleTransform(ROTATE_3D, deg); + compatibleTransform(ROTATE_3D$3, deg); _arr3[0] = parseFloat(_arr3[0]); _arr3[1] = parseFloat(_arr3[1]); _arr3[2] = parseFloat(_arr3[2]); _arr3[3] = deg; - transform.push([ROTATE_3D, _arr3]); + transform.push([ROTATE_3D$3, _arr3]); } } else if (TRANSFORM_HASH.hasOwnProperty(k)) { var k2 = TRANSFORM_HASH[k]; @@ -8358,8 +8359,8 @@ function normalize(style) { } if (_arr5.length === 2) { - var k1 = STYLE_KEY$3[style2Upper$1(k + 'X')]; - var _k = STYLE_KEY$3[style2Upper$1(k + 'Y')]; + var k1 = STYLE_KEY$2[style2Upper$1(k + 'X')]; + var _k = STYLE_KEY$2[style2Upper$1(k + 'Y')]; var arr1 = calUnit$1(_arr5[0]); var arr2 = calUnit$1(_arr5[1]); compatibleTransform(k1, arr1); @@ -8381,9 +8382,9 @@ function normalize(style) { } if (_arr6.length === 3) { - var _k2 = STYLE_KEY$3[style2Upper$1(k + 'X')]; - var _k3 = STYLE_KEY$3[style2Upper$1(k + 'Y')]; - var k3 = STYLE_KEY$3[style2Upper$1(k + 'Z')]; + var _k2 = STYLE_KEY$2[style2Upper$1(k + 'X')]; + var _k3 = STYLE_KEY$2[style2Upper$1(k + 'Y')]; + var k3 = STYLE_KEY$2[style2Upper$1(k + 'Z')]; var _arr7 = calUnit$1(_arr6[0]); @@ -8404,22 +8405,22 @@ function normalize(style) { temp = style.perspective; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { var arr = calUnit$1(temp); if (arr[0] < 0) { arr[0] = 0; } - compatibleTransform(PERSPECTIVE, arr); - res[PERSPECTIVE] = arr; + compatibleTransform(PERSPECTIVE$5, arr); + res[PERSPECTIVE$5] = arr; } ['perspectiveOrigin', 'transformOrigin'].forEach(function (k) { temp = style[k]; - if (!isNil$3(temp)) { - var _arr9 = res[STYLE_KEY$3[style2Upper$1(k)]] = []; + if (!isNil$c(temp)) { + var _arr9 = res[STYLE_KEY$2[style2Upper$1(k)]] = []; var _match = temp.toString().match(reg.position); @@ -8434,8 +8435,8 @@ function normalize(style) { if (/^[-+]?[\d.]/.test(item)) { var n = calUnit$1(item); - if ([NUMBER$1, DEG$1].indexOf(n[1]) > -1) { - n[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(n[1]) > -1) { + n[1] = PX$9; } _arr9.push(n); @@ -8446,25 +8447,25 @@ function normalize(style) { center: 50, right: 100, bottom: 100 - }[item], PERCENT$2]); // 不规范的写法变默认值50% + }[item], PERCENT$a]); // 不规范的写法变默认值50% - if (isNil$3(_arr9[i][0])) { + if (isNil$c(_arr9[i][0])) { _arr9[i][0] = 50; } } } } else { - _arr9.push([50, PERCENT$2]); + _arr9.push([50, PERCENT$a]); - _arr9.push([50, PERCENT$2]); + _arr9.push([50, PERCENT$a]); } } }); ['translateX', 'translateY', 'translateZ', 'scaleX', 'scaleY', 'scaleZ', 'skewX', 'skewY', 'rotateX', 'rotateY', 'rotateZ', 'rotate'].forEach(function (k) { var v = style[k]; - if (isNil$3(v)) { + if (isNil$c(v)) { return; } @@ -8481,54 +8482,54 @@ function normalize(style) { if (_arr10.length === 4) { var deg = calUnit$1(_arr10[3]); - compatibleTransform(ROTATE_3D, deg); + compatibleTransform(ROTATE_3D$3, deg); _arr10[0] = parseFloat(_arr10[0]); _arr10[1] = parseFloat(_arr10[1]); _arr10[2] = parseFloat(_arr10[2]); _arr10[3] = deg; - res[ROTATE_3D] = _arr10; + res[ROTATE_3D$3] = _arr10; } } temp = style.opacity; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { temp = parseFloat(temp); if (!isNaN(temp)) { temp = Math.max(temp, 0); temp = Math.min(temp, 1); - res[OPACITY] = temp; + res[OPACITY$5] = temp; } else { - res[OPACITY] = 1; + res[OPACITY$5] = 1; } } temp = style.zIndex; - if (!isNil$3(temp)) { - res[Z_INDEX] = parseInt(temp) || 0; + if (!isNil$c(temp)) { + res[Z_INDEX$4] = parseInt(temp) || 0; } // 转化不同单位值为对象标准化,不写单位的变成number单位转化为px ['marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth', 'top', 'right', 'bottom', 'left', 'width', 'height'].forEach(function (k) { var v = style[k]; - if (isNil$3(v)) { + if (isNil$c(v)) { return; } if (v === 'auto') { - v = [0, AUTO]; + v = [0, AUTO$8]; } else { v = calUnit$1(v); // 无单位视为px - if ([NUMBER$1, DEG$1].indexOf(v[1]) > -1) { - v[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(v[1]) > -1) { + v[1] = PX$9; } } - var k2 = STYLE_KEY$3[style2Upper$1(k)]; + var k2 = STYLE_KEY$2[style2Upper$1(k)]; res[k2] = v; // 限制padding/border为正数 if ({ @@ -8548,44 +8549,44 @@ function normalize(style) { }); temp = style.flexBasis; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { if (temp === 'content') { - res[FLEX_BASIS] = [temp, STRING]; + res[FLEX_BASIS$4] = [temp, STRING$2]; } else if (/^[\d.]/.test(temp)) { - var v = res[FLEX_BASIS] = calUnit$1(temp); + var v = res[FLEX_BASIS$4] = calUnit$1(temp); v[0] = Math.max(v[0], 0); // 无单位视为px - if ([NUMBER$1, DEG$1].indexOf(v[1]) > -1) { - v[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(v[1]) > -1) { + v[1] = PX$9; } } else { - res[FLEX_BASIS] = [0, AUTO]; + res[FLEX_BASIS$4] = [0, AUTO$8]; } } temp = style.order; - if (!isNil$3(temp)) { - res[ORDER] = parseInt(temp) || 0; + if (!isNil$c(temp)) { + res[ORDER$1] = parseInt(temp) || 0; } temp = style.color; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { if (temp === 'inherit') { - res[COLOR] = [[], INHERIT$2]; + res[COLOR$5] = [[], INHERIT$3]; } else { - res[COLOR] = [rgba2int$2(temp), RGBA]; + res[COLOR$5] = [rgba2int$1(temp), RGBA$2]; } } temp = style.textStrokeColor; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { if (temp === 'inherit') { - res[TEXT_STROKE_COLOR] = [[], INHERIT$2]; + res[TEXT_STROKE_COLOR$4] = [[], INHERIT$3]; } else { - res[TEXT_STROKE_COLOR] = [rgba2int$2(temp), RGBA]; + res[TEXT_STROKE_COLOR$4] = [rgba2int$1(temp), RGBA$2]; } } @@ -8593,49 +8594,49 @@ function normalize(style) { if (temp || temp === 0) { if (temp === 'inherit') { - res[FONT_SIZE$2] = [0, INHERIT$2]; + res[FONT_SIZE$f] = [0, INHERIT$3]; } else { var _v = calUnit$1(temp); // fontSize不能为负数,否则为继承 if (_v < 0) { - res[FONT_SIZE$2] = [0, INHERIT$2]; + res[FONT_SIZE$f] = [0, INHERIT$3]; } else { - if ([NUMBER$1, DEG$1].indexOf(_v[1]) > -1) { - _v[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(_v[1]) > -1) { + _v[1] = PX$9; } - res[FONT_SIZE$2] = _v; + res[FONT_SIZE$f] = _v; } } } temp = style.textStrokeWidth; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { if (temp === 'inherit') { - res[TEXT_STROKE_WIDTH] = [0, INHERIT$2]; + res[TEXT_STROKE_WIDTH$3] = [0, INHERIT$3]; } else { var _v2 = calUnit$1(temp); // textStrokeWidth不能为负数,否则为继承 if (_v2 < 0) { - res[TEXT_STROKE_WIDTH] = [0, INHERIT$2]; + res[TEXT_STROKE_WIDTH$3] = [0, INHERIT$3]; } else { - if ([NUMBER$1, DEG$1, PERCENT$2].indexOf(_v2[1]) > -1) { - _v2[1] = PX$2; + if ([NUMBER$4, DEG$1, PERCENT$a].indexOf(_v2[1]) > -1) { + _v2[1] = PX$9; } - res[TEXT_STROKE_WIDTH] = _v2; + res[TEXT_STROKE_WIDTH$3] = _v2; } } } temp = style.textStrokeOver; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { if (temp === 'inherit') { - res[TEXT_STROKE_OVER] = [0, INHERIT$2]; + res[TEXT_STROKE_OVER$3] = [0, INHERIT$3]; } else { var _v3 = temp.toString(); @@ -8643,23 +8644,23 @@ function normalize(style) { _v3 = 'none'; } - res[TEXT_STROKE_OVER] = [_v3, STRING]; + res[TEXT_STROKE_OVER$3] = [_v3, STRING$2]; } } temp = style.fontWeight; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { if (temp === 'bold') { - res[FONT_WEIGHT] = [700, NUMBER$1]; + res[FONT_WEIGHT$4] = [700, NUMBER$4]; } else if (temp === 'normal') { - res[FONT_WEIGHT] = [400, NUMBER$1]; + res[FONT_WEIGHT$4] = [400, NUMBER$4]; } else if (temp === 'lighter') { - res[FONT_WEIGHT] = [200, NUMBER$1]; + res[FONT_WEIGHT$4] = [200, NUMBER$4]; } else if (temp === 'inherit') { - res[FONT_WEIGHT] = [0, INHERIT$2]; + res[FONT_WEIGHT$4] = [0, INHERIT$3]; } else { - res[FONT_WEIGHT] = [Math.max(0, parseInt(temp)) || 400, NUMBER$1]; + res[FONT_WEIGHT$4] = [Math.max(0, parseInt(temp)) || 400, NUMBER$4]; } } @@ -8667,9 +8668,9 @@ function normalize(style) { if (temp) { if (temp === 'inherit') { - res[FONT_STYLE] = [0, INHERIT$2]; + res[FONT_STYLE$4] = [0, INHERIT$3]; } else { - res[FONT_STYLE] = [temp, STRING]; + res[FONT_STYLE$4] = [temp, STRING$2]; } } @@ -8677,10 +8678,10 @@ function normalize(style) { if (temp) { if (temp === 'inherit') { - res[FONT_FAMILY] = [0, INHERIT$2]; + res[FONT_FAMILY$4] = [0, INHERIT$3]; } else { // 统一文字声明格式 - res[FONT_FAMILY] = [temp.toString().toLowerCase().replace(/['"]/, '').replace(/\s*,\s*/g, ','), STRING]; + res[FONT_FAMILY$4] = [temp.toString().toLowerCase().replace(/['"]/, '').replace(/\s*,\s*/g, ','), STRING$2]; } } @@ -8688,9 +8689,9 @@ function normalize(style) { if (temp) { if (temp === 'inherit') { - res[TEXT_ALIGN] = [0, INHERIT$2]; + res[TEXT_ALIGN$2] = [0, INHERIT$3]; } else { - res[TEXT_ALIGN] = [temp, STRING]; + res[TEXT_ALIGN$2] = [temp, STRING$2]; } } @@ -8698,46 +8699,46 @@ function normalize(style) { if (temp !== undefined) { if (temp === 'inherit') { - res[LINE_HEIGHT] = [0, INHERIT$2]; + res[LINE_HEIGHT$4] = [0, INHERIT$3]; } else if (temp === 'normal') { - res[LINE_HEIGHT] = [0, AUTO]; + res[LINE_HEIGHT$4] = [0, AUTO$8]; } // lineHeight默认数字,想要px必须强制带单位 else if (/^[\d.]+/i.test(temp)) { - var _v4 = calUnit$1(temp); + var _v4 = calUnit$1(temp); - if ([DEG$1].indexOf(_v4[1]) > -1) { - _v4[1] = NUMBER$1; - } + if ([DEG$1].indexOf(_v4[1]) > -1) { + _v4[1] = NUMBER$4; + } - res[LINE_HEIGHT] = _v4; - } else { - var n = Math.max(0, parseFloat(temp)) || 'normal'; // 非法数字 + res[LINE_HEIGHT$4] = _v4; + } else { + var n = Math.max(0, parseFloat(temp)) || 'normal'; // 非法数字 - if (n === 'normal') { - res[LINE_HEIGHT] = [null, AUTO]; - } else { - res[LINE_HEIGHT] = [n, NUMBER$1]; - } + if (n === 'normal') { + res[LINE_HEIGHT$4] = [null, AUTO$8]; + } else { + res[LINE_HEIGHT$4] = [n, NUMBER$4]; } + } } temp = style.letterSpacing; if (temp !== undefined) { if (temp === 'inherit') { - res[LETTER_SPACING] = [0, INHERIT$2]; + res[LETTER_SPACING$2] = [0, INHERIT$3]; } else if (temp === 'normal') { - res[LETTER_SPACING] = [0, PX$2]; + res[LETTER_SPACING$2] = [0, PX$9]; } else if (/^[-+]?[\d.]/.test(temp)) { var _v5 = calUnit$1(temp); - if ([NUMBER$1, DEG$1].indexOf(_v5[1]) > -1) { - _v5[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(_v5[1]) > -1) { + _v5[1] = PX$9; } - res[LETTER_SPACING] = _v5; + res[LETTER_SPACING$2] = _v5; } else { - res[LETTER_SPACING] = [parseFloat(temp) || 0, PX$2]; + res[LETTER_SPACING$2] = [parseFloat(temp) || 0, PX$9]; } } @@ -8745,9 +8746,9 @@ function normalize(style) { if (temp) { if (temp === 'inherit') { - res[WHITE_SPACE] = [0, INHERIT$2]; + res[WHITE_SPACE$2] = [0, INHERIT$3]; } else { - res[WHITE_SPACE] = [temp, STRING]; + res[WHITE_SPACE$2] = [temp, STRING$2]; } } @@ -8755,7 +8756,7 @@ function normalize(style) { if (temp !== undefined) { temp = parseInt(temp) || 0; - res[LINE_CLAMP] = Math.max(0, temp); + res[LINE_CLAMP$1] = Math.max(0, temp); } // fill和stroke为渐变时特殊处理,fillRule无需处理字符串 @@ -8763,25 +8764,25 @@ function normalize(style) { if (temp !== undefined) { if (!temp) { - res[FILL] = ['none']; + res[FILL$2] = ['none']; } else if (Array.isArray(temp)) { if (temp.length) { - res[FILL] = temp.map(function (item) { + res[FILL$2] = temp.map(function (item) { if (!item) { return 'none'; } else if (reg.gradient.test(item)) { - return gradient$1.parseGradient(item); + return gradient.parseGradient(item); } else { - return rgba2int$2(item); + return rgba2int$1(item); } }); } else { - res[FILL] = ['none']; + res[FILL$2] = ['none']; } } else if (reg.gradient.test(temp)) { - res[FILL] = [gradient$1.parseGradient(temp)]; + res[FILL$2] = [gradient.parseGradient(temp)]; } else { - res[FILL] = [rgba2int$2(temp)]; + res[FILL$2] = [rgba2int$1(temp)]; } } @@ -8789,40 +8790,40 @@ function normalize(style) { if (temp !== undefined) { if (!temp) { - res[STROKE] = ['none']; + res[STROKE$1] = ['none']; } else if (Array.isArray(temp)) { if (temp.length) { - res[STROKE] = temp.map(function (item) { + res[STROKE$1] = temp.map(function (item) { if (!item) { return 'none'; } else if (reg.gradient.test(item)) { - return gradient$1.parseGradient(item); + return gradient.parseGradient(item); } else { - return rgba2int$2(item); + return rgba2int$1(item); } }); } else { - res[STROKE] = ['none']; + res[STROKE$1] = ['none']; } } else if (reg.gradient.test(temp)) { - res[STROKE] = [gradient$1.parseGradient(temp)]; + res[STROKE$1] = [gradient.parseGradient(temp)]; } else { - res[STROKE] = [rgba2int$2(temp)]; + res[STROKE$1] = [rgba2int$1(temp)]; } } temp = style.strokeWidth; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { if (!Array.isArray(temp)) { temp = [temp]; } - res[STROKE_WIDTH] = temp.map(function (item) { + res[STROKE_WIDTH$7] = temp.map(function (item) { var v = calUnit$1(item); - if ([NUMBER$1, DEG$1].indexOf(v[1]) > -1) { - v[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(v[1]) > -1) { + v[1] = PX$9; } v[0] = Math.max(v[0], 0); @@ -8832,9 +8833,9 @@ function normalize(style) { temp = style.strokeDasharray; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { if (Array.isArray(temp)) { - res[STROKE_DASHARRAY] = temp.map(function (item) { + res[STROKE_DASHARRAY$1] = temp.map(function (item) { var match = item.toString().match(/[\d.]+/g); if (match) { @@ -8863,9 +8864,9 @@ function normalize(style) { _match2.push(_match2[_match2.length - 1]); } - res[STROKE_DASHARRAY] = [_match2]; + res[STROKE_DASHARRAY$1] = [_match2]; } else { - res[STROKE_DASHARRAY] = [[]]; + res[STROKE_DASHARRAY$1] = [[]]; } } } @@ -8888,45 +8889,45 @@ function normalize(style) { _v6 = calUnit$1(m2[2]); if (k === 'blur') { - if (_v6[0] <= 0 || [DEG$1, PERCENT$2].indexOf(_v6[1]) > -1) { + if (_v6[0] <= 0 || [DEG$1, PERCENT$a].indexOf(_v6[1]) > -1) { return; } - if (_v6[1] === NUMBER$1) { - _v6[1] = PX$2; + if (_v6[1] === NUMBER$4) { + _v6[1] = PX$9; } f.push([k, _v6]); } else if (k === 'hue-rotate') { - if ([NUMBER$1, DEG$1].indexOf(_v6[1]) === -1) { + if ([NUMBER$4, DEG$1].indexOf(_v6[1]) === -1) { return; } _v6[1] = DEG$1; f.push([k, _v6]); } else if (k === 'saturate' || k === 'brightness' || k === 'grayscale' || k === 'contrast') { - if ([NUMBER$1, PERCENT$2].indexOf(_v6[1]) === -1) { + if ([NUMBER$4, PERCENT$a].indexOf(_v6[1]) === -1) { return; } _v6[0] = Math.max(_v6[0], 0); - _v6[1] = PERCENT$2; + _v6[1] = PERCENT$a; f.push([k, _v6]); } } }); } - res[FILTER] = f; + res[FILTER$6] = f; } temp = style.visibility; if (temp) { if (temp === 'inherit') { - res[VISIBILITY] = [0, INHERIT$2]; + res[VISIBILITY$7] = [0, INHERIT$3]; } else { - res[VISIBILITY] = [temp, STRING]; + res[VISIBILITY$7] = [temp, STRING$2]; } } @@ -8934,9 +8935,9 @@ function normalize(style) { if (temp) { if (temp === 'inherit') { - res[POINTER_EVENTS] = [0, INHERIT$2]; + res[POINTER_EVENTS$2] = [0, INHERIT$3]; } else { - res[POINTER_EVENTS] = [temp, STRING]; + res[POINTER_EVENTS$2] = [temp, STRING$2]; } } @@ -8958,8 +8959,8 @@ function normalize(style) { for (var i = 0; i < 4; i++) { var _v7 = calUnit$1(boxShadow[i + 1]); - if ([NUMBER$1, DEG$1].indexOf(_v7[1]) > -1) { - _v7[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(_v7[1]) > -1) { + _v7[1] = PX$9; } // x/y可以负,blur和spread不行 @@ -8970,7 +8971,7 @@ function normalize(style) { _res.push(_v7); } - _res.push(rgba2int$2(boxShadow[5])); + _res.push(rgba2int$1(boxShadow[5])); _res.push(boxShadow[6] || 'outset'); @@ -8979,35 +8980,35 @@ function normalize(style) { }); } - res[BOX_SHADOW] = bs; + res[BOX_SHADOW$9] = bs; } // 直接赋值的string类型 ['position', 'display', 'flexDirection', 'flexWrap', 'justifyContent', 'alignItems', 'alignSelf', 'alignContent', 'overflow', 'mixBlendMode', 'borderTopStyle', 'borderRightStyle', 'borderBottomStyle', 'borderLeftStyle', 'backgroundClip', 'textOverflow'].forEach(function (k) { if (style.hasOwnProperty(k)) { - res[STYLE_KEY$3[style2Upper$1(k)]] = style[k]; + res[STYLE_KEY$2[style2Upper$1(k)]] = style[k]; } }); // 直接赋值的number类型 ['flexGrow', 'flexShrink'].forEach(function (k) { if (style.hasOwnProperty(k)) { - res[STYLE_KEY$3[style2Upper$1(k)]] = Math.max(parseFloat(style[k]) || 0, 0); + res[STYLE_KEY$2[style2Upper$1(k)]] = Math.max(parseFloat(style[k]) || 0, 0); } }); temp = style.zIndex; - if (!isNil$3(temp)) { - res[Z_INDEX] = parseFloat(temp) || 0; + if (!isNil$c(temp)) { + res[Z_INDEX$4] = parseFloat(temp) || 0; } // 这些支持多个的用数组表示 ['backgroundRepeat', 'strokeLinecap', 'strokeLinejoin', 'strokeMiterlimit', 'fillRule'].forEach(function (k) { if (style.hasOwnProperty(k)) { var _v8 = style[k]; - res[STYLE_KEY$3[style2Upper$1(k)]] = Array.isArray(_v8) ? _v8 : [_v8]; + res[STYLE_KEY$2[style2Upper$1(k)]] = Array.isArray(_v8) ? _v8 : [_v8]; } }); - GEOM_KEY_SET$2.forEach(function (k) { + GEOM_KEY_SET.forEach(function (k) { if (style.hasOwnProperty(k)) { res[k] = style[k]; } @@ -9028,29 +9029,29 @@ function computeMeasure(node, isRoot) { computedStyle = node.computedStyle, domParent = node.domParent; var parentComputedStyle = !isRoot && domParent.computedStyle; - MEASURE_KEY_SET$1.forEach(function (k) { + MEASURE_KEY_SET.forEach(function (k) { var v = currentStyle[k]; // ff特殊处理 - if (k === FONT_FAMILY) { - if (v[1] === INHERIT$2) { + if (k === FONT_FAMILY$4) { + if (v[1] === INHERIT$3) { 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$3) { 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]; - } 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) { - computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : node.root.height * 0.01 * v[0]; - } else { - computedStyle[k] = v[0]; - } + else if (v[1] === PERCENT$a) { + computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : parentComputedStyle[k] * v[0] * 0.01; + } else if (v[1] === REM$e) { + computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : node.root.computedStyle[FONT_SIZE$f] * v[0]; + } else if (v[1] === VW$e) { + computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : node.root.width * 0.01 * v[0]; + } else if (v[1] === VH$e) { + computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : node.root.height * 0.01 * v[0]; + } else { + computedStyle[k] = v[0]; + } }); } /** @@ -9065,50 +9066,50 @@ function computeReflow(node, isHost) { computedStyle = node.computedStyle, parent = node.domParent, root = node.root; - var rem = root.computedStyle[FONT_SIZE$2]; + var rem = root.computedStyle[FONT_SIZE$f]; 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_TOP_WIDTH$5, BORDER_RIGHT_WIDTH$6, BORDER_BOTTOM_WIDTH$5, BORDER_LEFT_WIDTH$7].forEach(function (k) { // border-width不支持百分比 var item = currentStyle[k]; - if (item[1] === PX$2) { + if (item[1] === PX$9) { computedStyle[k] = item[0]; - } else if (item[1] === REM$2) { + } else if (item[1] === REM$e) { computedStyle[k] = item[0] * rem; - } else if (item[1] === VW$2) { + } else if (item[1] === VW$e) { computedStyle[k] = item[0] * root.width * 0.01; - } else if (item[1] === VH$2) { + } else if (item[1] === VH$e) { computedStyle[k] = item[0] * root.height * 0.01; } else { 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$5, DISPLAY$a, FLEX_DIRECTION$2, JUSTIFY_CONTENT$1, ALIGN_ITEMS$1, ALIGN_SELF$1, FLEX_GROW$1, FLEX_SHRINK$1, LINE_CLAMP$1, ORDER$1, FLEX_WRAP$1, ALIGN_CONTENT$1].forEach(function (k) { computedStyle[k] = currentStyle[k]; }); - var textAlign = currentStyle[TEXT_ALIGN]; + var textAlign = currentStyle[TEXT_ALIGN$2]; - if (textAlign[1] === INHERIT$2) { - computedStyle[TEXT_ALIGN] = isRoot ? 'left' : parentComputedStyle[TEXT_ALIGN]; + if (textAlign[1] === INHERIT$3) { + computedStyle[TEXT_ALIGN$2] = isRoot ? 'left' : parentComputedStyle[TEXT_ALIGN$2]; } else { - computedStyle[TEXT_ALIGN] = textAlign[0]; + computedStyle[TEXT_ALIGN$2] = textAlign[0]; } - var fontSize = computedStyle[FONT_SIZE$2]; - var lineHeight = currentStyle[LINE_HEIGHT]; // lineHeight继承很特殊,数字和normal不同于普通单位 + var fontSize = computedStyle[FONT_SIZE$f]; + var lineHeight = currentStyle[LINE_HEIGHT$4]; // lineHeight继承很特殊,数字和normal不同于普通单位 - if (lineHeight[1] === INHERIT$2) { + if (lineHeight[1] === INHERIT$3) { if (isRoot) { - computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle); + computedStyle[LINE_HEIGHT$4] = calNormalLineHeight(computedStyle); } else { var p = parent; var ph; while (p) { - ph = p.currentStyle[LINE_HEIGHT]; + ph = p.currentStyle[LINE_HEIGHT$4]; - if (ph[1] !== INHERIT$2) { + if (ph[1] !== INHERIT$3) { break; } @@ -9116,63 +9117,63 @@ function computeReflow(node, isHost) { } // 到root还是inherit或normal,或者中途遇到了normal,使用normal - if ([AUTO, INHERIT$2].indexOf(ph[1]) > -1) { - computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle); + if ([AUTO$8, INHERIT$3].indexOf(ph[1]) > -1) { + computedStyle[LINE_HEIGHT$4] = calNormalLineHeight(computedStyle); } // 数字继承 - else if (ph[1] === NUMBER$1) { - computedStyle[LINE_HEIGHT] = Math.max(ph[0], 0) * fontSize; - } // 单位继承 - else { - computedStyle[LINE_HEIGHT] = parentComputedStyle[LINE_HEIGHT]; - } + else if (ph[1] === NUMBER$4) { + computedStyle[LINE_HEIGHT$4] = Math.max(ph[0], 0) * fontSize; + } // 单位继承 + else { + computedStyle[LINE_HEIGHT$4] = parentComputedStyle[LINE_HEIGHT$4]; + } } } // 防止为0 - else if (lineHeight[1] === PX$2) { - computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) || calNormalLineHeight(computedStyle); - } else if (lineHeight[1] === PERCENT$2) { - computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * fontSize * 0.01, 0) || calNormalLineHeight(computedStyle); - } else if (lineHeight[1] === REM$2) { - computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * rem, 0) || calNormalLineHeight(computedStyle); - } else if (lineHeight[1] === VW$2) { - computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.width * 0.01, 0) || calNormalLineHeight(computedStyle); - } else if (lineHeight[1] === VH$2) { - computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.height * 0.01, 0) || calNormalLineHeight(computedStyle); - } else if (lineHeight[1] === NUMBER$1) { - computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) * fontSize || calNormalLineHeight(computedStyle); - } // normal或auto - else { - computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle); - } + else if (lineHeight[1] === PX$9) { + computedStyle[LINE_HEIGHT$4] = Math.max(lineHeight[0], 0) || calNormalLineHeight(computedStyle); + } else if (lineHeight[1] === PERCENT$a) { + computedStyle[LINE_HEIGHT$4] = Math.max(lineHeight[0] * fontSize * 0.01, 0) || calNormalLineHeight(computedStyle); + } else if (lineHeight[1] === REM$e) { + computedStyle[LINE_HEIGHT$4] = Math.max(lineHeight[0] * rem, 0) || calNormalLineHeight(computedStyle); + } else if (lineHeight[1] === VW$e) { + computedStyle[LINE_HEIGHT$4] = Math.max(lineHeight[0] * root.width * 0.01, 0) || calNormalLineHeight(computedStyle); + } else if (lineHeight[1] === VH$e) { + computedStyle[LINE_HEIGHT$4] = Math.max(lineHeight[0] * root.height * 0.01, 0) || calNormalLineHeight(computedStyle); + } else if (lineHeight[1] === NUMBER$4) { + computedStyle[LINE_HEIGHT$4] = Math.max(lineHeight[0], 0) * fontSize || calNormalLineHeight(computedStyle); + } // normal或auto + else { + computedStyle[LINE_HEIGHT$4] = calNormalLineHeight(computedStyle); + } - var letterSpacing = currentStyle[LETTER_SPACING]; + var letterSpacing = currentStyle[LETTER_SPACING$2]; - if (letterSpacing[1] === INHERIT$2) { - computedStyle[LETTER_SPACING] = isRoot ? 0 : parentComputedStyle[LETTER_SPACING]; - } else if (letterSpacing[1] === PERCENT$2) { - computedStyle[LETTER_SPACING] = fontSize * 0.01 * letterSpacing[0]; - } else if (letterSpacing[1] === REM$2) { - computedStyle[LETTER_SPACING] = rem * letterSpacing[0]; - } else if (letterSpacing[1] === VW$2) { - computedStyle[LETTER_SPACING] = root.width * 0.01 * letterSpacing[0]; - } else if (letterSpacing[1] === VH$2) { - computedStyle[LETTER_SPACING] = root.height * 0.01 * letterSpacing[0]; + if (letterSpacing[1] === INHERIT$3) { + computedStyle[LETTER_SPACING$2] = isRoot ? 0 : parentComputedStyle[LETTER_SPACING$2]; + } else if (letterSpacing[1] === PERCENT$a) { + computedStyle[LETTER_SPACING$2] = fontSize * 0.01 * letterSpacing[0]; + } else if (letterSpacing[1] === REM$e) { + computedStyle[LETTER_SPACING$2] = rem * letterSpacing[0]; + } else if (letterSpacing[1] === VW$e) { + computedStyle[LETTER_SPACING$2] = root.width * 0.01 * letterSpacing[0]; + } else if (letterSpacing[1] === VH$e) { + computedStyle[LETTER_SPACING$2] = root.height * 0.01 * letterSpacing[0]; } else { - computedStyle[LETTER_SPACING] = letterSpacing[0]; + computedStyle[LETTER_SPACING$2] = letterSpacing[0]; } //whiteSpace - var whiteSpace = currentStyle[WHITE_SPACE]; + var whiteSpace = currentStyle[WHITE_SPACE$2]; - if (whiteSpace[1] === INHERIT$2) { - computedStyle[WHITE_SPACE] = isRoot ? 'normal' : parentComputedStyle[WHITE_SPACE]; + if (whiteSpace[1] === INHERIT$3) { + computedStyle[WHITE_SPACE$2] = isRoot ? 'normal' : parentComputedStyle[WHITE_SPACE$2]; } else { - computedStyle[WHITE_SPACE] = whiteSpace[0]; + computedStyle[WHITE_SPACE$2] = whiteSpace[0]; } } function setFontStyle(style) { - var fontSize = style[FONT_SIZE$2]; - return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' ' + fontSize + 'px/' + fontSize + 'px ' + (style[FONT_FAMILY] || 'arial'); + var fontSize = style[FONT_SIZE$f]; + return (style[FONT_STYLE$4] || 'normal') + ' ' + (style[FONT_WEIGHT$4] || '400') + ' ' + fontSize + 'px/' + fontSize + 'px ' + (style[FONT_FAMILY$4] || 'arial'); } function getFontFamily(str) { @@ -9180,7 +9181,7 @@ function getFontFamily(str) { var f = 'arial'; for (var i = 0, len = ff.length; i < len; i++) { - if (o$1.support(ff[i])) { + if (o$3.support(ff[i])) { f = ff[i]; break; } @@ -9190,15 +9191,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$f]; + var ff = getFontFamily(style[FONT_FAMILY$4]); + var normal = fontSize * (o$3.info[ff] || o$3.info.arial).lhr; + return (style[LINE_HEIGHT$4] - normal) * 0.5 + fontSize * (o$3.info[ff] || o$3.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$4]); + return style[FONT_SIZE$f] * (o$3.info[ff] || o$3.info.arial).lhr; } function calRelativePercent(n, parent, k) { @@ -9207,22 +9208,22 @@ function calRelativePercent(n, parent, k) { while (parent) { var style = parent.currentStyle[k]; - if (style[1] === AUTO) { - if (k === WIDTH$1) { + if (style[1] === AUTO$8) { + if (k === WIDTH$7) { parent = parent.domParent; } else { break; } - } else if (style[1] === PX$2) { + } else if (style[1] === PX$9) { return n * style[0]; - } else if (style[1] === PERCENT$2) { + } else if (style[1] === PERCENT$a) { n *= style[0] * 0.01; parent = parent.domParent; - } else if (style[1] === REM$2) { - return n * style[0] * parent.root.computedStyle[FONT_SIZE$2]; - } else if (style[1] === VW$2) { + } else if (style[1] === REM$e) { + return n * style[0] * parent.root.computedStyle[FONT_SIZE$f]; + } else if (style[1] === VW$e) { return n * style[0] * parent.root.width * 0.01; - } else if (style[1] === VH$2) { + } else if (style[1] === VH$e) { return n * style[0] * parent.root.height * 0.01; } } @@ -9230,52 +9231,52 @@ function calRelativePercent(n, parent, k) { return n; } -function calRelative(currentStyle, k, v, parent, isWidth) { - if (v[1] === AUTO) { +function calRelative$1(currentStyle, k, v, parent, isWidth) { + if (v[1] === AUTO$8) { v = 0; - } else if ([PX$2, NUMBER$1].indexOf(v[1]) > -1) { + } else if ([PX$9, NUMBER$4].indexOf(v[1]) > -1) { v = v[0]; - } else if (v[1] === PERCENT$2) { + } else if (v[1] === PERCENT$a) { if (isWidth) { - v = calRelativePercent(v[0], parent, WIDTH$1); + v = calRelativePercent(v[0], parent, WIDTH$7); } else { - v = calRelativePercent(v[0], parent, HEIGHT$1); + v = calRelativePercent(v[0], parent, HEIGHT$7); } - } else if (v[1] === REM$2) { - v = v[0] * parent.root.computedStyle[FONT_SIZE$2]; - } else if (v[1] === VW$2) { + } else if (v[1] === REM$e) { + v = v[0] * parent.root.computedStyle[FONT_SIZE$f]; + } else if (v[1] === VW$e) { v = v[0] * parent.root.width * 0.01; - } else if (v[1] === VH$2) { + } else if (v[1] === VH$e) { v = v[0] * parent.root.height * 0.01; } return v; } -function calAbsolute(currentStyle, k, v, size, root) { - if (v[1] === AUTO) { +function calAbsolute$1(currentStyle, k, v, size, root) { + if (v[1] === AUTO$8) { v = 0; - } else if ([PX$2, NUMBER$1, DEG$1, RGBA, STRING].indexOf(v[1]) > -1) { + } else if ([PX$9, NUMBER$4, DEG$1, RGBA$2, STRING$2].indexOf(v[1]) > -1) { v = v[0]; - } else if (v[1] === PERCENT$2) { + } else if (v[1] === PERCENT$a) { v = v[0] * size * 0.01; - } else if (v[1] === REM$2) { - v = v[0] * root.computedStyle[FONT_SIZE$2]; - } else if (v[1] === VW$2) { + } else if (v[1] === REM$e) { + v = v[0] * root.computedStyle[FONT_SIZE$f]; + } else if (v[1] === VW$e) { v = v[0] * root.width * 0.01; - } else if (v[1] === VH$2) { + } else if (v[1] === VH$e) { v = v[0] * root.height * 0.01; } return v; } -function equalStyle(k, a, b, target) { +function equalStyle$1(k, a, b, target) { if (!a || !b) { return a === b; } - if (k === TRANSFORM) { + if (k === TRANSFORM$4) { if (a.length !== b.length) { return false; } @@ -9297,7 +9298,7 @@ function equalStyle(k, a, b, target) { return true; } - if (k === FILTER) { + if (k === FILTER$6) { if (a.length !== b.length) { return false; } @@ -9309,7 +9310,7 @@ function equalStyle(k, a, b, target) { } } - if (k === BACKGROUND_SIZE) { + if (k === BACKGROUND_SIZE$2) { if (a.length !== b.length) { return false; } @@ -9326,15 +9327,15 @@ function equalStyle(k, a, b, target) { return true; } - if (k === TRANSFORM_ORIGIN$1 || RADIUS_HASH$1.hasOwnProperty(k)) { + if (k === TRANSFORM_ORIGIN$4 || RADIUS_HASH$1.hasOwnProperty(k)) { return a[0][0] === b[0][0] && a[0][1] === b[0][1] && a[1][0] === b[1][0] && a[1][1] === b[1][1]; } - if (k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y || LENGTH_HASH$1.hasOwnProperty(k) || EXPAND_HASH$1.hasOwnProperty(k)) { + if (k === BACKGROUND_POSITION_X$3 || k === BACKGROUND_POSITION_Y$3 || LENGTH_HASH$1.hasOwnProperty(k) || EXPAND_HASH$1.hasOwnProperty(k)) { return a[0] === b[0] && a[1] === b[1]; } - if (k === BOX_SHADOW) { + if (k === BOX_SHADOW$9) { return equalArr$1(a, b); } @@ -9375,25 +9376,25 @@ function equalStyle(k, a, b, target) { } // multi都是纯值数组,equalArr本身即递归,非multi根据类型判断 - if (isGeom$1(target.tagName, k) && (target.isMulti || Array.isArray(a) && Array.isArray(b))) { + if (isGeom$2(target.tagName, k) && (target.isMulti || Array.isArray(a) && Array.isArray(b))) { return equalArr$1(a, b); } return a === b; } -function isRelativeOrAbsolute(node) { - var position = node.currentStyle[POSITION]; +function isRelativeOrAbsolute$2(node) { + var position = node.currentStyle[POSITION$5]; return position === 'relative' || position === 'absolute'; } -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 VALUE = (_VALUE = {}, _defineProperty(_VALUE, POSITION$5, true), _defineProperty(_VALUE, DISPLAY$a, true), _defineProperty(_VALUE, STYLE_KEY$2.BACKGROUND_REPEAT, true), _defineProperty(_VALUE, FLEX_DIRECTION$2, true), _defineProperty(_VALUE, FLEX_GROW$1, true), _defineProperty(_VALUE, FLEX_SHRINK$1, true), _defineProperty(_VALUE, FLEX_WRAP$1, true), _defineProperty(_VALUE, JUSTIFY_CONTENT$1, true), _defineProperty(_VALUE, ALIGN_ITEMS$1, true), _defineProperty(_VALUE, ALIGN_SELF$1, true), _defineProperty(_VALUE, STYLE_KEY$2.OVERFLOW, true), _defineProperty(_VALUE, STYLE_KEY$2.MIX_BLEND_MODE, true), _defineProperty(_VALUE, STYLE_KEY$2.STROKE_LINECAP, true), _defineProperty(_VALUE, STYLE_KEY$2.STROKE_LINEJOIN, true), _defineProperty(_VALUE, STYLE_KEY$2.STROKE_MITERLIMIT, true), _defineProperty(_VALUE, STYLE_KEY$2.FILL_RULE, true), _defineProperty(_VALUE, OPACITY$5, true), _defineProperty(_VALUE, Z_INDEX$4, true), _defineProperty(_VALUE, BACKGROUND_CLIP$2, true), _defineProperty(_VALUE, TEXT_OVERFLOW$2, true), _defineProperty(_VALUE, LINE_CLAMP$1, 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$5, true), _defineProperty(_ARRAY_, TEXT_STROKE_COLOR$4, true), _defineProperty(_ARRAY_, BACKGROUND_COLOR$2, true), _defineProperty(_ARRAY_, STYLE_KEY$2.BORDER_TOP_COLOR, true), _defineProperty(_ARRAY_, STYLE_KEY$2.BORDER_RIGHT_COLOR, true), _defineProperty(_ARRAY_, STYLE_KEY$2.BORDER_BOTTOM_COLOR, true), _defineProperty(_ARRAY_, STYLE_KEY$2.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_); +var ARRAY_0_1 = (_ARRAY_0_ = {}, _defineProperty(_ARRAY_0_, STYLE_KEY$2.BORDER_TOP_LEFT_RADIUS, true), _defineProperty(_ARRAY_0_, STYLE_KEY$2.BORDER_TOP_RIGHT_RADIUS, true), _defineProperty(_ARRAY_0_, STYLE_KEY$2.BORDER_BOTTOM_RIGHT_RADIUS, true), _defineProperty(_ARRAY_0_, STYLE_KEY$2.BORDER_BOTTOM_LEFT_RADIUS, true), _defineProperty(_ARRAY_0_, TRANSFORM_ORIGIN$4, true), _defineProperty(_ARRAY_0_, PERSPECTIVE_ORIGIN$4, true), _ARRAY_0_); -function cloneStyle(style, keys) { +function cloneStyle$1(style, keys) { if (!keys) { keys = Object.keys(style).map(function (i) { if (!GEOM$2.hasOwnProperty(i)) { @@ -9410,7 +9411,7 @@ function cloneStyle(style, keys) { var k = keys[i]; var v = style[k]; // 渐变特殊处理 - if (k === BACKGROUND_IMAGE) { + if (k === BACKGROUND_IMAGE$2) { res[k] = v.map(function (item) { // 可能为null if (item && item.k) { @@ -9419,7 +9420,7 @@ function cloneStyle(style, keys) { return item; } }); - } else if (k === FILL || k === STROKE) { + } else if (k === FILL$2 || k === STROKE$1) { res[k] = v.map(function (item) { // 渐变 // 可能非法为空 @@ -9427,10 +9428,10 @@ function cloneStyle(style, keys) { return util.clone(item); } // 颜色 else { - return item.slice(0); - } + return item.slice(0); + } }); - } else if (k === TRANSFORM || k === FILTER) { + } else if (k === TRANSFORM$4 || k === FILTER$6) { if (v) { var n = v.slice(0); @@ -9441,7 +9442,7 @@ function cloneStyle(style, keys) { res[k] = n; } - } else if (k === BOX_SHADOW) { + } else if (k === BOX_SHADOW$9) { if (v) { v = v.map(function (item) { var n = item.slice(0); @@ -9450,7 +9451,7 @@ function cloneStyle(style, keys) { }); res[k] = v; } - } else if (k === TRANSLATE_PATH) { + } else if (k === TRANSLATE_PATH$1) { if (v) { res[k] = v.map(function (item) { return item.slice(0); @@ -9458,67 +9459,67 @@ function cloneStyle(style, keys) { } } // position等直接值类型赋值 else if (VALUE.hasOwnProperty(k)) { - res[k] = v; - } // geom自定义属性 - else if (GEOM$2.hasOwnProperty(k)) { - res[k] = util.clone(v); - } // 其余皆是数组或空,默认是一维数组只需slice即可 - else if (v) { - var _n = res[k] = v.slice(0); // 特殊引用里数组某项再次clone + res[k] = v; + } // geom自定义属性 + else if (GEOM$2.hasOwnProperty(k)) { + res[k] = util.clone(v); + } // 其余皆是数组或空,默认是一维数组只需slice即可 + else if (v) { + var _n = res[k] = v.slice(0); // 特殊引用里数组某项再次clone - if (k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) { - for (var _i5 = 0, _len5 = _n.length; _i5 < _len5; _i5++) { - _n[_i5] = _n[_i5].slice(0); - } - } else if (k === BACKGROUND_SIZE) { - for (var _i6 = 0, _len6 = _n.length; _i6 < _len6; _i6++) { - _n[_i6] = _n[_i6].slice(0); - _n[_i6][0] = _n[_i6][0].slice(0); - _n[_i6][1] = _n[_i6][1].slice(0); - } - } else if (ARRAY_0.hasOwnProperty(k)) { - _n[0] = _n[0].slice(0); - } else if (ARRAY_0_1.hasOwnProperty(k)) { - _n[0] = _n[0].slice(0); - _n[1] = _n[1].slice(0); - } else if (k === TRANSFORM) { - for (var _i7 = 0, _len7 = _n.length; _i7 < _len7; _i7++) { - _n[_i7] = _n[_i7].slice(0); - } - } else if (k === ROTATE_3D) { - _n[3] = _n[3].slice(0); - } - } + if (k === BACKGROUND_POSITION_X$3 || k === BACKGROUND_POSITION_Y$3) { + for (var _i5 = 0, _len5 = _n.length; _i5 < _len5; _i5++) { + _n[_i5] = _n[_i5].slice(0); + } + } else if (k === BACKGROUND_SIZE$2) { + for (var _i6 = 0, _len6 = _n.length; _i6 < _len6; _i6++) { + _n[_i6] = _n[_i6].slice(0); + _n[_i6][0] = _n[_i6][0].slice(0); + _n[_i6][1] = _n[_i6][1].slice(0); + } + } else if (ARRAY_0.hasOwnProperty(k)) { + _n[0] = _n[0].slice(0); + } else if (ARRAY_0_1.hasOwnProperty(k)) { + _n[0] = _n[0].slice(0); + _n[1] = _n[1].slice(0); + } else if (k === TRANSFORM$4) { + for (var _i7 = 0, _len7 = _n.length; _i7 < _len7; _i7++) { + _n[_i7] = _n[_i7].slice(0); + } + } else if (k === ROTATE_3D$3) { + _n[3] = _n[3].slice(0); + } + } } return res; } var css = { - normalize: normalize, + normalize: normalize$1, computeMeasure: computeMeasure, computeReflow: computeReflow, setFontStyle: setFontStyle, getFontFamily: getFontFamily, getBaseLine: getBaseLine, - calRelative: calRelative, - calAbsolute: calAbsolute, - equalStyle: equalStyle, - isRelativeOrAbsolute: isRelativeOrAbsolute, - cloneStyle: cloneStyle + calRelative: calRelative$1, + calAbsolute: calAbsolute$1, + equalStyle: equalStyle$1, + isRelativeOrAbsolute: isRelativeOrAbsolute$2, + cloneStyle: cloneStyle$1 }; -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$m = enums.STYLE_KEY, + COLOR$4 = _enums$STYLE_KEY$m.COLOR, + FONT_WEIGHT$3 = _enums$STYLE_KEY$m.FONT_WEIGHT, + FONT_FAMILY$3 = _enums$STYLE_KEY$m.FONT_FAMILY, + FONT_SIZE$e = _enums$STYLE_KEY$m.FONT_SIZE, + FONT_STYLE$3 = _enums$STYLE_KEY$m.FONT_STYLE, + LETTER_SPACING$1 = _enums$STYLE_KEY$m.LETTER_SPACING, + TEXT_STROKE_COLOR$3 = _enums$STYLE_KEY$m.TEXT_STROKE_COLOR, + TEXT_STROKE_WIDTH$2 = _enums$STYLE_KEY$m.TEXT_STROKE_WIDTH, + TEXT_STROKE_OVER$2 = _enums$STYLE_KEY$m.TEXT_STROKE_OVER; /** * 表示一行文本的类,保存它的位置、内容、从属信息,在布局阶段生成,并在渲染阶段被Text调用render() * 关系上直属于Text类,一个Text类可能因为换行原因导致有多个TextBox,一行内容中也可能有不同Text从而不同TextBox @@ -9568,13 +9569,13 @@ var TextBox = /*#__PURE__*/function () { 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]; + textStrokeWidth = computedStyle[TEXT_STROKE_WIDTH$2], + textStrokeColor = computedStyle[TEXT_STROKE_COLOR$3]; var i = 0, length = content.length; if (renderMode === mode.CANVAS || renderMode === mode.WEBGL) { - var overFill = computedStyle[TEXT_STROKE_OVER$1] === 'fill'; + var overFill = computedStyle[TEXT_STROKE_OVER$2] === 'fill'; if (letterSpacing) { for (; i < length; i++) { @@ -9606,11 +9607,11 @@ 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$4]], ['font-family', computedStyle[FONT_FAMILY$3]], ['font-weight', computedStyle[FONT_WEIGHT$3]], ['font-style', computedStyle[FONT_STYLE$3]], ['font-size', computedStyle[FONT_SIZE$e] + 'px']]; // svg无法定义stroke的over if (textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) { - props.push(['stroke', cacheStyle[TEXT_STROKE_COLOR$1]]); - props.push(['stroke-width', computedStyle[TEXT_STROKE_WIDTH$1]]); + props.push(['stroke', cacheStyle[TEXT_STROKE_COLOR$3]]); + props.push(['stroke-width', computedStyle[TEXT_STROKE_WIDTH$2]]); } if (letterSpacing) { @@ -9711,10 +9712,10 @@ var TextBox = /*#__PURE__*/function () { }(); var SIZE = [8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192]; -var NUMBER$2 = [128, 64, 32, 16, 8, 4, 2, 1, 1, 1, 1]; +var NUMBER$3 = [128, 64, 32, 16, 8, 4, 2, 1, 1, 1, 1]; var MAX = SIZE[SIZE.length - 1]; var HASH_CANVAS = {}; -var uuid = 0; +var uuid$2 = 0; var Page = /*#__PURE__*/function () { function Page(size, number) { @@ -9739,7 +9740,7 @@ var Page = /*#__PURE__*/function () { this.__grid.push(1); } - this.__uuid = uuid++; // webgl贴图缓存使用,一旦更新则标识记录,绑定某号纹理单元查看变化才更新贴图 + this.__uuid = uuid$2++; // webgl贴图缓存使用,一旦更新则标识记录,绑定某号纹理单元查看变化才更新贴图 this.__update = false; this.time = 0; @@ -9854,11 +9855,11 @@ var Page = /*#__PURE__*/function () { } var s = SIZE[0]; - var n = NUMBER$2[0]; // 使用刚好满足的尺寸 + var n = NUMBER$3[0]; // 使用刚好满足的尺寸 for (var i = 0, len = SIZE.length; i < len; i++) { s = SIZE[i]; - n = NUMBER$2[i]; + n = NUMBER$3[i]; if (SIZE[i] >= size) { break; @@ -9900,7 +9901,7 @@ var Page = /*#__PURE__*/function () { get: function get() { return { SIZE: SIZE, - NUMBER: NUMBER$2 + NUMBER: NUMBER$3 }; }, set: function set(v) { @@ -9909,7 +9910,7 @@ var Page = /*#__PURE__*/function () { } SIZE = v.SIZE; - NUMBER$2 = v.NUMBER; + NUMBER$3 = v.NUMBER; MAX = SIZE[SIZE.length - 1]; } }, { @@ -9920,7 +9921,7 @@ var Page = /*#__PURE__*/function () { }, { key: "genUuid", value: function genUuid() { - return uuid++; + return uuid$2++; } }]); @@ -10147,8 +10148,8 @@ function transform(source, target) { } // 第2步,以第1条边AB为基准,缩放x轴ab至目标相同长度,可与4步合并 - var ls = geom.pointsDistance(sx1, sy1, sx2, sy2); - var lt = geom.pointsDistance(tx1, ty1, tx2, ty2); // if(ls !== lt) { + var ls = geom$1.pointsDistance(sx1, sy1, sx2, sy2); + var lt = geom$1.pointsDistance(tx1, ty1, tx2, ty2); // if(ls !== lt) { // let scale = lt / ls; // t = matrix.identity(); // t[0] = scale; @@ -10211,14 +10212,14 @@ function transform(source, target) { ax3 = _matrix$calPoint6[0], ay3 = _matrix$calPoint6[1]; - var ab = geom.pointsDistance(ax1, ay1, ax2, ay2); - var ac = geom.pointsDistance(ax1, ay1, ax3, ay3); - var bc = geom.pointsDistance(ax3, ay3, ax2, ay2); - var AB = geom.pointsDistance(tx1, ty1, tx2, ty2); - var AC = geom.pointsDistance(tx1, ty1, tx3, ty3); - var BC = geom.pointsDistance(tx3, ty3, tx2, ty2); - var a = geom.angleBySide(bc, ab, ac); - var A = geom.angleBySide(BC, AB, AC); // 先至90°,再旋转至目标角,可以合并成tan相加,不知道为什么不能直接tan倾斜差值角度 + var ab = geom$1.pointsDistance(ax1, ay1, ax2, ay2); + var ac = geom$1.pointsDistance(ax1, ay1, ax3, ay3); + var bc = geom$1.pointsDistance(ax3, ay3, ax2, ay2); + var AB = geom$1.pointsDistance(tx1, ty1, tx2, ty2); + var AC = geom$1.pointsDistance(tx1, ty1, tx3, ty3); + var BC = geom$1.pointsDistance(tx3, ty3, tx2, ty2); + var a = geom$1.angleBySide(bc, ab, ac); + var A = geom$1.angleBySide(BC, AB, AC); // 先至90°,再旋转至目标角,可以合并成tan相加,不知道为什么不能直接tan倾斜差值角度 if (a !== A) { t = mx.identity(); @@ -10256,65 +10257,65 @@ var tar = { var math = { matrix: mx, tar: tar, - geom: geom + geom: geom$1 }; -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 PX$3 = o.PX, - PERCENT$3 = o.PERCENT, - REM$3 = o.REM, - VW$3 = o.VW, - VH$3 = o.VH; +var _enums$STYLE_KEY$l = enums.STYLE_KEY, + TRANSLATE_X$3 = _enums$STYLE_KEY$l.TRANSLATE_X, + TRANSLATE_Y$3 = _enums$STYLE_KEY$l.TRANSLATE_Y, + TRANSLATE_Z$3 = _enums$STYLE_KEY$l.TRANSLATE_Z, + SCALE_X$2 = _enums$STYLE_KEY$l.SCALE_X, + SCALE_Y$2 = _enums$STYLE_KEY$l.SCALE_Y, + SCALE_Z$1 = _enums$STYLE_KEY$l.SCALE_Z, + SKEW_X$1 = _enums$STYLE_KEY$l.SKEW_X, + SKEW_Y$1 = _enums$STYLE_KEY$l.SKEW_Y, + ROTATE_X$1 = _enums$STYLE_KEY$l.ROTATE_X, + ROTATE_Y$1 = _enums$STYLE_KEY$l.ROTATE_Y, + ROTATE_Z$1 = _enums$STYLE_KEY$l.ROTATE_Z, + ROTATE_3D$2 = _enums$STYLE_KEY$l.ROTATE_3D, + PERSPECTIVE$4 = _enums$STYLE_KEY$l.PERSPECTIVE, + MATRIX$2 = _enums$STYLE_KEY$l.MATRIX, + FONT_SIZE$d = _enums$STYLE_KEY$l.FONT_SIZE; +var PX$8 = o$4.PX, + PERCENT$9 = o$4.PERCENT, + REM$d = o$4.REM, + VW$d = o$4.VW, + VH$d = o$4.VH; var matrix = math.matrix, - geom$1 = math.geom; -var identity$1 = matrix.identity, + geom = math.geom; +var identity = matrix.identity, multiply$1 = matrix.multiply, - isE$2 = matrix.isE; -var d2r$2 = geom$1.d2r; + isE$1 = matrix.isE; +var d2r = geom.d2r; function calSingle(t, k, v) { - if (k === TRANSLATE_X$1) { + if (k === TRANSLATE_X$3) { t[12] = v; - } else if (k === TRANSLATE_Y$1) { + } else if (k === TRANSLATE_Y$3) { t[13] = v; - } else if (k === TRANSLATE_Z$1) { + } else if (k === TRANSLATE_Z$3) { t[14] = v; - } else if (k === SCALE_X$1) { + } else if (k === SCALE_X$2) { t[0] = v; - } else if (k === SCALE_Y$1) { + } else if (k === SCALE_Y$2) { t[5] = v; } else if (k === SCALE_Z$1) { t[10] = v; } else if (k === SKEW_X$1) { - v = d2r$2(v); + v = d2r(v); t[4] = Math.tan(v); } else if (k === SKEW_Y$1) { - v = d2r$2(v); + v = d2r(v); t[1] = Math.tan(v); } else if (k === ROTATE_X$1) { - v = d2r$2(v); + v = d2r(v); var sin = Math.sin(v); var cos = Math.cos(v); t[5] = t[10] = cos; t[6] = sin; t[9] = -sin; } else if (k === ROTATE_Y$1) { - v = d2r$2(v); + v = d2r(v); var _sin = Math.sin(v); @@ -10324,7 +10325,7 @@ function calSingle(t, k, v) { t[8] = _sin; t[2] = -_sin; } else if (k === ROTATE_Z$1) { - v = d2r$2(v); + v = d2r(v); var _sin2 = Math.sin(v); @@ -10333,7 +10334,7 @@ function calSingle(t, k, v) { t[0] = t[5] = _cos2; t[1] = _sin2; t[4] = -_sin2; - } else if (k === ROTATE_3D$1) { + } else if (k === ROTATE_3D$2) { var _v = v, _v2 = _slicedToArray(_v, 4), x = _v2[0], @@ -10341,7 +10342,7 @@ function calSingle(t, k, v) { z = _v2[2], r = _v2[3]; - r = d2r$2(r[0]); + r = d2r(r[0]); var s = Math.sin(r); var c = Math.cos(r); @@ -10406,23 +10407,23 @@ function calSingle(t, k, v) { t[14] = 0; t[15] = 1; } - } else if (k === PERSPECTIVE$1 && v > 0) { + } else if (k === PERSPECTIVE$4 && v > 0) { v = Math.max(v, 1); t[11] = -1 / v; - } else if (k === MATRIX$1) { + } else if (k === MATRIX$2) { util.assignMatrix(t, v); } } function calMatrix(transform, ow, oh, root) { - var list = normalize$1(transform, ow, oh, root); - var m = identity$1(); + var list = normalize(transform, ow, oh, root); + var m = identity(); list.forEach(function (item) { var _item = _slicedToArray(item, 2), k = _item[0], v = _item[1]; - var t = identity$1(); + var t = identity(); calSingle(t, k, v); m = multiply$1(m, t); }); @@ -10437,7 +10438,7 @@ function calMatrixByOrigin(m, transformOrigin) { var res = m.slice(0); - if (ox === 0 && oy === 0 || isE$2(m)) { + if (ox === 0 && oy === 0 || isE$1(m)) { return res; } @@ -10453,36 +10454,36 @@ function calMatrixWithOrigin(transform, transformOrigin, ow, oh) { } function normalizeSingle(k, v, ow, oh, root) { - if (k === TRANSLATE_X$1 || k === TRANSLATE_Z$1) { - if (v[1] === PERCENT$3) { + if (k === TRANSLATE_X$3 || k === TRANSLATE_Z$3) { + if (v[1] === PERCENT$9) { return v[0] * ow * 0.01; - } else if (v[1] === REM$3) { - return v[0] * root.computedStyle[FONT_SIZE$4]; - } else if (v[1] === VW$3) { + } else if (v[1] === REM$d) { + return v[0] * root.computedStyle[FONT_SIZE$d]; + } else if (v[1] === VW$d) { return v[0] * root.width * 0.01; - } else if (v[1] === VH$3) { + } else if (v[1] === VH$d) { return v[0] * root.height * 0.01; } - } else if (k === TRANSLATE_Y$1) { - if (v[1] === PERCENT$3) { + } else if (k === TRANSLATE_Y$3) { + if (v[1] === PERCENT$9) { return v[0] * oh * 0.01; - } else if (v[1] === REM$3) { - return v[0] * root.computedStyle[FONT_SIZE$4]; - } else if (v[1] === VW$3) { + } else if (v[1] === REM$d) { + return v[0] * root.computedStyle[FONT_SIZE$d]; + } else if (v[1] === VW$d) { return v[0] * root.width * 0.01; - } else if (v[1] === VH$3) { + } else if (v[1] === VH$d) { return v[0] * root.height * 0.01; } - } else if (k === MATRIX$1) { + } else if (k === MATRIX$2) { return v; - } else if (k === ROTATE_3D$1) { + } else if (k === ROTATE_3D$2) { return v; } return v[0]; } -function normalize$1(transform, ow, oh, root) { +function normalize(transform, ow, oh, root) { var res = []; transform.forEach(function (item) { var _item2 = _slicedToArray(item, 2), @@ -10497,15 +10498,15 @@ function normalize$1(transform, ow, oh, root) { function calOrigin(transformOrigin, w, h, root) { var tfo = []; transformOrigin.forEach(function (item, i) { - if (item[1] === PX$3) { + if (item[1] === PX$8) { tfo.push(item[0]); - } else if (item[1] === PERCENT$3) { + } else if (item[1] === PERCENT$9) { tfo.push(item[0] * (i ? h : w) * 0.01); - } else if (item[1] === REM$3) { - tfo.push(item[0] * root.computedStyle[FONT_SIZE$4]); - } else if (item[1] === VW$3) { + } else if (item[1] === REM$d) { + tfo.push(item[0] * root.computedStyle[FONT_SIZE$d]); + } else if (item[1] === VW$d) { tfo.push(item[0] * root.width * 0.01); - } else if (item[1] === VH$3) { + } else if (item[1] === VH$d) { tfo.push(item[0] * root.height * 0.01); } }); @@ -10513,7 +10514,7 @@ function calOrigin(transformOrigin, w, h, root) { } function calMatrixByPerspective(m, pm) { - if (!isE$2(pm)) { + if (!isE$1(pm)) { m = multiply$1(pm, m); } @@ -10522,7 +10523,7 @@ function calMatrixByPerspective(m, pm) { function calPerspectiveMatrix(ppt, po) { if (ppt && ppt > 0) { - var res = identity$1(); + var res = identity(); ppt = Math.max(ppt, 1); res[11] = -1 / ppt; @@ -10638,18 +10639,18 @@ 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, - DISPLAY$1 = _enums$STYLE_KEY$5.DISPLAY, - VISIBILITY$1 = _enums$STYLE_KEY$5.VISIBILITY, - _enums$NODE_KEY$1 = enums.NODE_KEY, - NODE_OPACITY = _enums$NODE_KEY$1.NODE_OPACITY, - NODE_CACHE = _enums$NODE_KEY$1.NODE_CACHE, - NODE_CACHE_FILTER = _enums$NODE_KEY$1.NODE_CACHE_FILTER, - NODE_CACHE_OVERFLOW = _enums$NODE_KEY$1.NODE_CACHE_OVERFLOW, - NODE_HAS_CONTENT = _enums$NODE_KEY$1.NODE_HAS_CONTENT, - NODE_COMPUTED_STYLE = _enums$NODE_KEY$1.NODE_COMPUTED_STYLE; // 根据一个共享cache的信息,生成一个独立的离屏canvas,一般是filter,mask用 +var _enums$STYLE_KEY$k = enums.STYLE_KEY, + TRANSFORM_ORIGIN$3 = _enums$STYLE_KEY$k.TRANSFORM_ORIGIN, + TRANSFORM$3 = _enums$STYLE_KEY$k.TRANSFORM, + DISPLAY$9 = _enums$STYLE_KEY$k.DISPLAY, + VISIBILITY$6 = _enums$STYLE_KEY$k.VISIBILITY, + _enums$NODE_KEY$9 = enums.NODE_KEY, + NODE_OPACITY$3 = _enums$NODE_KEY$9.NODE_OPACITY, + NODE_CACHE$5 = _enums$NODE_KEY$9.NODE_CACHE, + NODE_CACHE_FILTER$3 = _enums$NODE_KEY$9.NODE_CACHE_FILTER, + NODE_CACHE_OVERFLOW$3 = _enums$NODE_KEY$9.NODE_CACHE_OVERFLOW, + NODE_HAS_CONTENT$1 = _enums$NODE_KEY$9.NODE_HAS_CONTENT, + NODE_COMPUTED_STYLE$5 = _enums$NODE_KEY$9.NODE_COMPUTED_STYLE; // 根据一个共享cache的信息,生成一个独立的离屏canvas,一般是filter,mask用 function genSingle(cache, message) { var size = cache.size, @@ -10933,9 +10934,9 @@ var Cache = /*#__PURE__*/function () { list.forEach(function (item) { var __config = item.__config; - var cacheOverflow = __config[NODE_CACHE_OVERFLOW], - cacheFilter = __config[NODE_CACHE_FILTER], - cache = __config[NODE_CACHE]; + var cacheOverflow = __config[NODE_CACHE_OVERFLOW$3], + cacheFilter = __config[NODE_CACHE_FILTER$3], + cache = __config[NODE_CACHE$5]; var source = cacheOverflow && cacheOverflow.available && cacheOverflow; if (!source) { @@ -10947,12 +10948,12 @@ var Cache = /*#__PURE__*/function () { } if (source) { - ctx.globalAlpha = __config[NODE_OPACITY]; - Cache.drawCache(source, cacheMask, __config[NODE_COMPUTED_STYLE][TRANSFORM$1], mx.identity(), __config[NODE_COMPUTED_STYLE][TRANSFORM_ORIGIN$2].slice(0), inverse); + ctx.globalAlpha = __config[NODE_OPACITY$3]; + Cache.drawCache(source, cacheMask, __config[NODE_COMPUTED_STYLE$5][TRANSFORM$3], mx.identity(), __config[NODE_COMPUTED_STYLE$5][TRANSFORM_ORIGIN$3].slice(0), inverse); } // 没有内容或者img没加载成功导致没有内容,有内容且可见则是超限,不可能进这里 - else if (__config[NODE_HAS_CONTENT] && __config[NODE_COMPUTED_STYLE][DISPLAY$1] !== 'none' && __config[NODE_COMPUTED_STYLE][VISIBILITY$1] !== 'hidden') { - inject.error('CacheMask is oversize'); - } + else if (__config[NODE_HAS_CONTENT$1] && __config[NODE_COMPUTED_STYLE$5][DISPLAY$9] !== 'none' && __config[NODE_COMPUTED_STYLE$5][VISIBILITY$6] !== 'hidden') { + inject.error('CacheMask is oversize'); + } }); ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.globalAlpha = 1; @@ -11098,15 +11099,15 @@ var Cache = /*#__PURE__*/function () { }(); 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; +var STYLE_KEY$1 = enums.STYLE_KEY, + _enums$STYLE_KEY$j = enums.STYLE_KEY, + TRANSLATE_X$2 = _enums$STYLE_KEY$j.TRANSLATE_X, + TRANSLATE_Y$2 = _enums$STYLE_KEY$j.TRANSLATE_Y, + TRANSLATE_Z$2 = _enums$STYLE_KEY$j.TRANSLATE_Z, + OPACITY$4 = _enums$STYLE_KEY$j.OPACITY, + FILTER$5 = _enums$STYLE_KEY$j.FILTER, + PERSPECTIVE$3 = _enums$STYLE_KEY$j.PERSPECTIVE, + PERSPECTIVE_ORIGIN$3 = _enums$STYLE_KEY$j.PERSPECTIVE_ORIGIN; var ENUM = { // 低位表示 0; }, @@ -11162,11 +11163,11 @@ var o$3 = Object.assign({ return ENUM.TRANSLATE_Z; } else if (TRANSFORMS.hasOwnProperty(k)) { return ENUM.TRANSFORM; - } else if (k === OPACITY$1) { + } else if (k === OPACITY$4) { return ENUM.OPACITY; - } else if (k === FILTER$1) { + } else if (k === FILTER$5) { return ENUM.FILTER; - } else if (k === PERSPECTIVE$2 || k === PERSPECTIVE_ORIGIN$1) { + } else if (k === PERSPECTIVE$3 || k === PERSPECTIVE_ORIGIN$3) { return ENUM.PERSPECTIVE; } else if (o$2.isRepaint(k)) { return ENUM.REPAINT; @@ -11184,41 +11185,41 @@ var o$3 = Object.assign({ return lv >= ENUM.REBUILD; } }, ENUM); -o$3.TRANSFORMS = TRANSFORMS; +o$1.TRANSFORMS = TRANSFORMS; -var _enums$STYLE_KEY$7 = enums.STYLE_KEY, - DISPLAY$2 = _enums$STYLE_KEY$7.DISPLAY, - LINE_HEIGHT$1 = _enums$STYLE_KEY$7.LINE_HEIGHT, - FONT_SIZE$5 = _enums$STYLE_KEY$7.FONT_SIZE, - FONT_FAMILY$2 = _enums$STYLE_KEY$7.FONT_FAMILY, - FONT_STYLE$2 = _enums$STYLE_KEY$7.FONT_STYLE, - FONT_WEIGHT$2 = _enums$STYLE_KEY$7.FONT_WEIGHT, - COLOR$2 = _enums$STYLE_KEY$7.COLOR, - VISIBILITY$2 = _enums$STYLE_KEY$7.VISIBILITY, - LETTER_SPACING$2 = _enums$STYLE_KEY$7.LETTER_SPACING, - OVERFLOW = _enums$STYLE_KEY$7.OVERFLOW, - WHITE_SPACE$1 = _enums$STYLE_KEY$7.WHITE_SPACE, - TEXT_OVERFLOW$1 = _enums$STYLE_KEY$7.TEXT_OVERFLOW, - WIDTH$2 = _enums$STYLE_KEY$7.WIDTH, - TEXT_STROKE_COLOR$2 = _enums$STYLE_KEY$7.TEXT_STROKE_COLOR, - TEXT_STROKE_WIDTH$2 = _enums$STYLE_KEY$7.TEXT_STROKE_WIDTH, - _enums$NODE_KEY$2 = enums.NODE_KEY, - NODE_CACHE$1 = _enums$NODE_KEY$2.NODE_CACHE, - NODE_LIMIT_CACHE = _enums$NODE_KEY$2.NODE_LIMIT_CACHE, - NODE_DOM_PARENT = _enums$NODE_KEY$2.NODE_DOM_PARENT, - NODE_MATRIX_EVENT = _enums$NODE_KEY$2.NODE_MATRIX_EVENT, - NODE_OPACITY$1 = _enums$NODE_KEY$2.NODE_OPACITY, - NODE_VIRTUAL_DOM = _enums$NODE_KEY$2.NODE_VIRTUAL_DOM, - _enums$UPDATE_KEY = enums.UPDATE_KEY, - UPDATE_NODE = _enums$UPDATE_KEY.UPDATE_NODE, - UPDATE_MEASURE = _enums$UPDATE_KEY.UPDATE_MEASURE, - UPDATE_FOCUS = _enums$UPDATE_KEY.UPDATE_FOCUS, - UPDATE_CONFIG = _enums$UPDATE_KEY.UPDATE_CONFIG; +var _enums$STYLE_KEY$i = enums.STYLE_KEY, + DISPLAY$8 = _enums$STYLE_KEY$i.DISPLAY, + LINE_HEIGHT$3 = _enums$STYLE_KEY$i.LINE_HEIGHT, + FONT_SIZE$c = _enums$STYLE_KEY$i.FONT_SIZE, + FONT_FAMILY$2 = _enums$STYLE_KEY$i.FONT_FAMILY, + FONT_STYLE$2 = _enums$STYLE_KEY$i.FONT_STYLE, + FONT_WEIGHT$2 = _enums$STYLE_KEY$i.FONT_WEIGHT, + COLOR$3 = _enums$STYLE_KEY$i.COLOR, + VISIBILITY$5 = _enums$STYLE_KEY$i.VISIBILITY, + LETTER_SPACING = _enums$STYLE_KEY$i.LETTER_SPACING, + OVERFLOW$3 = _enums$STYLE_KEY$i.OVERFLOW, + WHITE_SPACE$1 = _enums$STYLE_KEY$i.WHITE_SPACE, + TEXT_OVERFLOW$1 = _enums$STYLE_KEY$i.TEXT_OVERFLOW, + WIDTH$6 = _enums$STYLE_KEY$i.WIDTH, + TEXT_STROKE_COLOR$2 = _enums$STYLE_KEY$i.TEXT_STROKE_COLOR, + TEXT_STROKE_WIDTH$1 = _enums$STYLE_KEY$i.TEXT_STROKE_WIDTH, + _enums$NODE_KEY$8 = enums.NODE_KEY, + NODE_CACHE$4 = _enums$NODE_KEY$8.NODE_CACHE, + NODE_LIMIT_CACHE$2 = _enums$NODE_KEY$8.NODE_LIMIT_CACHE, + NODE_DOM_PARENT$6 = _enums$NODE_KEY$8.NODE_DOM_PARENT, + NODE_MATRIX_EVENT$4 = _enums$NODE_KEY$8.NODE_MATRIX_EVENT, + NODE_OPACITY$2 = _enums$NODE_KEY$8.NODE_OPACITY, + NODE_VIRTUAL_DOM$2 = _enums$NODE_KEY$8.NODE_VIRTUAL_DOM, + _enums$UPDATE_KEY$5 = enums.UPDATE_KEY, + UPDATE_NODE$5 = _enums$UPDATE_KEY$5.UPDATE_NODE, + UPDATE_MEASURE$2 = _enums$UPDATE_KEY$5.UPDATE_MEASURE, + UPDATE_FOCUS$4 = _enums$UPDATE_KEY$5.UPDATE_FOCUS, + UPDATE_CONFIG$5 = _enums$UPDATE_KEY$5.UPDATE_CONFIG; var ELLIPSIS = textCache.ELLIPSIS; -var AUTO$1 = o.AUTO, - REM$4 = o.REM, - VW$4 = o.VW, - VH$4 = o.VH; +var AUTO$7 = o$4.AUTO, + REM$c = o$4.REM, + VW$c = o$4.VW, + VH$c = o$4.VH; var Text = /*#__PURE__*/function (_Node) { _inherits(Text, _Node); @@ -11265,9 +11266,9 @@ var Text = /*#__PURE__*/function (_Node) { } this.__ff = ff; - var fs = computedStyle[FONT_SIZE$5]; + var fs = computedStyle[FONT_SIZE$c]; var fw = computedStyle[FONT_WEIGHT$2]; - var key = this.__key = computedStyle[FONT_SIZE$5] + ',' + ff + ',' + fw; + var key = this.__key = computedStyle[FONT_SIZE$c] + ',' + ff + ',' + fw; var wait = textCache.data[key] = textCache.data[key] || { ff: ff, fs: fs, @@ -11281,7 +11282,7 @@ var Text = /*#__PURE__*/function (_Node) { var bp = this.domParent; - while (bp.currentStyle[DISPLAY$2] === 'inline') { + while (bp.currentStyle[DISPLAY$8] === 'inline') { bp = bp.domParent; } @@ -11296,7 +11297,7 @@ var Text = /*#__PURE__*/function (_Node) { } } - var pfs = parentComputedStyle[FONT_SIZE$5]; + var pfs = parentComputedStyle[FONT_SIZE$c]; var pfw = parentComputedStyle[FONT_WEIGHT$2]; var pKey = this.__pKey = pfs + ',' + pff + ',' + pfw; var parentCache = textCache.charWidth[pKey] = textCache.charWidth[pKey] || {}; @@ -11395,7 +11396,7 @@ var Text = /*#__PURE__*/function (_Node) { }, { key: "__layout", value: function __layout(data) { - var __cache = this.__config[NODE_CACHE$1]; + var __cache = this.__config[NODE_CACHE$4]; if (__cache) { __cache.release(); @@ -11426,9 +11427,9 @@ var Text = /*#__PURE__*/function (_Node) { __key = this.__key; textBoxes.splice(0); var __config = this.__config; - __config[NODE_LIMIT_CACHE] = false; // 空内容w/h都为0可以提前跳出 + __config[NODE_LIMIT_CACHE$2] = false; // 空内容w/h都为0可以提前跳出 - if (isDestroyed || currentStyle[DISPLAY$2] === 'none' || !content) { + if (isDestroyed || currentStyle[DISPLAY$8] === 'none' || !content) { return lineClampCount; } @@ -11441,13 +11442,13 @@ var Text = /*#__PURE__*/function (_Node) { var count = beginSpace; var length = content.length; var maxW = 0; - var lineHeight = computedStyle[LINE_HEIGHT$1], - letterSpacing = computedStyle[LETTER_SPACING$2], + var lineHeight = computedStyle[LINE_HEIGHT$3], + letterSpacing = computedStyle[LETTER_SPACING], whiteSpace = computedStyle[WHITE_SPACE$1], - fontSize = computedStyle[FONT_SIZE$5], + fontSize = computedStyle[FONT_SIZE$c], fontWeight = computedStyle[FONT_WEIGHT$2]; // 特殊字体中特殊字符连续时需减少一定的padding量 - var padding = o$1.info[__ff].padding; + var padding = o$3.info[__ff].padding; var needReduce = !!padding; var lastChar; var ew = textCache.charWidth[this.__pKey][ELLIPSIS]; @@ -11458,9 +11459,9 @@ var Text = /*#__PURE__*/function (_Node) { var bp = this.__bp; var _bp$currentStyle = bp.currentStyle, - display = _bp$currentStyle[DISPLAY$2], - overflow = _bp$currentStyle[OVERFLOW], - width = _bp$currentStyle[WIDTH$2], + display = _bp$currentStyle[DISPLAY$8], + overflow = _bp$currentStyle[OVERFLOW$3], + width = _bp$currentStyle[WIDTH$6], textOverflow = _bp$currentStyle[TEXT_OVERFLOW$1]; // 只要是overflow隐藏,不管textOverflow如何(默认是clip等同于overflow:hidden的功能)都截取 if (overflow === 'hidden') { @@ -11471,7 +11472,7 @@ var Text = /*#__PURE__*/function (_Node) { // block/flex无需宽度,inline-block需要设置宽度才生效 if (display === 'block' || display === 'flex') { isTextOverflow = true; - } else if (width[1] !== AUTO$1) { + } else if (width[1] !== AUTO$7) { isTextOverflow = true; } @@ -11496,213 +11497,213 @@ var Text = /*#__PURE__*/function (_Node) { maxW = _this$__lineBack2[1]; } // 默认clip跟随overflow:hidden,无需感知 else { - var textBox = new TextBox(this, textBoxes.length, x, y, count - beginSpace, lineHeight, content, charWidthList); - textBoxes.push(textBox); - lineBoxManager.addItem(textBox); - maxW = count - beginSpace; - y += lineHeight; - } + var textBox = new TextBox(this, textBoxes.length, x, y, count - beginSpace, lineHeight, content, charWidthList); + textBoxes.push(textBox); + lineBoxManager.addItem(textBox); + maxW = count - beginSpace; + y += lineHeight; + } } // 普通换行,注意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中 + while (i < length) { + var cw = charWidthList[i] + letterSpacing; + count += cw; // 连续字符减少padding,除了连续还需判断char是否在padding的hash中 - if (needReduce) { - var _char2 = content[i]; + if (needReduce) { + var _char2 = content[i]; - if (_char2 === lastChar && padding.hasOwnProperty(_char2) && padding[_char2]) { - var hasCache = void 0, - p = textCache.padding[__key] = textCache.padding[__key] || {}; + if (_char2 === lastChar && padding.hasOwnProperty(_char2) && padding[_char2]) { + var hasCache = void 0, + p = textCache.padding[__key] = textCache.padding[__key] || {}; - if (textCache.padding.hasOwnProperty(__key)) { - if (p.hasOwnProperty(_char2)) { - hasCache = true; - count -= p[_char2]; - } + 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]; - } - - count -= n; - p[_char2] = n; + 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]; } + + count -= n; + p[_char2] = n; } + } - lastChar = _char2; - } // 忽略零宽字符 + lastChar = _char2; + } // 忽略零宽字符 - if (cw === 0) { - i++; - continue; - } // 换行都要判断i不是0的时候,第1个字符强制不换行 + if (cw === 0) { + i++; + continue; + } // 换行都要判断i不是0的时候,第1个字符强制不换行 - if (count === w) { - // 多行文本截断,这里肯定需要回退 - if (lineClamp && lineCount + lineClampCount >= lineClamp - 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); + if (count === w) { + // 多行文本截断,这里肯定需要回退 + if (lineClamp && lineCount + lineClampCount >= lineClamp - 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); - var _this$__lineBack4 = _slicedToArray(_this$__lineBack3, 2); + var _this$__lineBack4 = _slicedToArray(_this$__lineBack3, 2); - y = _this$__lineBack4[0]; - maxW = _this$__lineBack4[1]; - lineCount++; - break; - } + y = _this$__lineBack4[0]; + maxW = _this$__lineBack4[1]; + lineCount++; + break; + } - var _textBox = void 0; // 特殊情况,恰好最后一行最后一个排满,此时查看末尾mpb,要防止i为0的情况首个字符特殊不回退,无需看开头mpb + var _textBox = void 0; // 特殊情况,恰好最后一行最后一个排满,此时查看末尾mpb,要防止i为0的情况首个字符特殊不回退,无需看开头mpb - if (i === length - 1 && count > w - endSpace && i) { - count -= charWidthList[i--]; - } + if (i === length - 1 && count > w - endSpace && i) { + count -= charWidthList[i--]; + } - i++; + i++; - 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 (!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行影响 - textBoxes.push(_textBox); - lineBoxManager.addItem(_textBox, true); - y += Math.max(lineHeight, lineBoxManager.lineHeight); - begin = i; - count = 0; + 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); + + var _this$__lineBack6 = _slicedToArray(_this$__lineBack5, 2); + + y = _this$__lineBack6[0]; + maxW = _this$__lineBack6[1]; 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); - - var _this$__lineBack6 = _slicedToArray(_this$__lineBack5, 2); - - y = _this$__lineBack6[0]; - maxW = _this$__lineBack6[1]; - lineCount++; - break; - } // 普通非多行文本阶段逻辑 + break; + } // 普通非多行文本阶段逻辑 - var _width = void 0; // 宽度不足时无法跳出循环,至少也要塞个字符形成一行,无需判断第1行,因为是否放得下逻辑在dom中做过了, - // 如果第1行放不下,一定会另起一行,此时作为开头再放不下才会进这里,这个if只有0或1个字符的情况 + var _width = void 0; // 宽度不足时无法跳出循环,至少也要塞个字符形成一行,无需判断第1行,因为是否放得下逻辑在dom中做过了, + // 如果第1行放不下,一定会另起一行,此时作为开头再放不下才会进这里,这个if只有0或1个字符的情况 - if (i <= begin) { - _width = count; - } // 超过2个字符回退1个 - else { - _width = count - charWidthList[i--]; - } + if (i <= begin) { + _width = count; + } // 超过2个字符回退1个 + else { + _width = count - charWidthList[i--]; + } - i++; // 根据是否第一行分开处理行首空白 + i++; // 根据是否第一行分开处理行首空白 - var _textBox2 = void 0; + var _textBox2 = void 0; - 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,同上 - - - 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 (!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,同上 - if (lineCount) { - this.__x = this.__sx1 = lx; - } // 最后一行,只有一行未满时也进这里,需查看末尾mpb,排不下回退一个字符 - // 声明了lineClamp时特殊考虑,这里一定是最后一行,要对比行数不能超过,超过忽略掉这些文本 + 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 (begin < length && (!lineClamp || lineCount + lineClampCount < lineClamp)) { - var _textBox3; + if (lineCount) { + this.__x = this.__sx1 = lx; + } // 最后一行,只有一行未满时也进这里,需查看末尾mpb,排不下回退一个字符 + // 声明了lineClamp时特殊考虑,这里一定是最后一行,要对比行数不能超过,超过忽略掉这些文本 - if (!lineCount) { - var needBack; // 防止开头第一个begin=0时回退,这在inline有padding且是第一个child时会发生 - if (begin && count > w - endSpace) { - needBack = true; - count -= charWidthList[length - 1]; - } + if (begin < length && (!lineClamp || lineCount + lineClampCount < lineClamp)) { + var _textBox3; - 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)); + if (!lineCount) { + var needBack; // 防止开头第一个begin=0时回退,这在inline有padding且是第一个child时会发生 + + if (begin && count > w - endSpace) { + needBack = true; + count -= charWidthList[length - 1]; + } + + 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 += Math.max(lineHeight, lineBoxManager.lineHeight); + y += lineHeight; + lineCount++; + } + } else { + var _needBack; // 防止begin在结尾时回退,必须要有个字符,这在最后一行1个字符排不下时会出现 - 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++; - } - } else { - var _needBack; // 防止begin在结尾时回退,必须要有个字符,这在最后一行1个字符排不下时会出现 + if (count > w - endSpace && begin < length - 1) { + _needBack = true; + count -= charWidthList[length - 1]; + } - if (count > w - endSpace && begin < length - 1) { - _needBack = true; - count -= charWidthList[length - 1]; - } + _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); - _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); + 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 += 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++; - } + y += lineHeight; + lineCount++; } } } + } this.__width = maxW; this.__height = y - data.y; @@ -11746,40 +11747,40 @@ var Text = /*#__PURE__*/function (_Node) { } // 向前查找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 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(); } - - list.pop(); - tb.parent.textBoxes.pop(); + } + } // 不够则看前一个tb并且删掉这个 + else { + count -= width; } + + list.pop(); + tb.parent.textBoxes.pop(); } + } } return [y, maxW]; @@ -11869,13 +11870,13 @@ var Text = /*#__PURE__*/function (_Node) { __config = this.__config; if (renderMode === mode.SVG) { - __config[NODE_VIRTUAL_DOM] = this.__virtualDom = { + __config[NODE_VIRTUAL_DOM$2] = this.__virtualDom = { type: 'text', children: [] }; } - if (isDestroyed || computedStyle[DISPLAY$2] === 'none' || computedStyle[VISIBILITY$2] === 'hidden' || !textBoxes.length) { + if (isDestroyed || computedStyle[DISPLAY$8] === 'none' || computedStyle[VISIBILITY$5] === 'hidden' || !textBoxes.length) { return; } @@ -11886,7 +11887,7 @@ var Text = /*#__PURE__*/function (_Node) { var sx = this.sx, sy = this.sy, bbox = this.bbox; - var __cache = __config[NODE_CACHE$1]; + var __cache = __config[NODE_CACHE$4]; if (__cache) { __cache.reset(bbox, sx, sy); @@ -11895,23 +11896,23 @@ var Text = /*#__PURE__*/function (_Node) { } if (__cache && __cache.enabled) { - __config[NODE_CACHE$1] = __cache; + __config[NODE_CACHE$4] = __cache; __cache.__available = true; ctx = __cache.ctx; dx += __cache.dx; dy += __cache.dy; - __config[NODE_LIMIT_CACHE] = false; + __config[NODE_LIMIT_CACHE$2] = false; } else { - __config[NODE_LIMIT_CACHE] = true; + __config[NODE_LIMIT_CACHE$2] = true; return; } } else { var _root = this.root; var c = inject.getCacheCanvas(_root.width, _root.height, '__$$OVERSIZE$$__'); ctx = c.ctx; - var _config$NODE_DOM_PAR = __config[NODE_DOM_PARENT].__config, - m = _config$NODE_DOM_PAR[NODE_MATRIX_EVENT], - opacity = _config$NODE_DOM_PAR[NODE_OPACITY$1]; + var _config$NODE_DOM_PAR = __config[NODE_DOM_PARENT$6].__config, + m = _config$NODE_DOM_PAR[NODE_MATRIX_EVENT$4], + opacity = _config$NODE_DOM_PAR[NODE_OPACITY$2]; ctx.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]); ctx.globalAlpha = opacity; } @@ -11923,13 +11924,13 @@ var Text = /*#__PURE__*/function (_Node) { ctx.font = _font; } - var color = cacheStyle[COLOR$2]; + var color = cacheStyle[COLOR$3]; if (ctx.fillStyle !== color) { ctx.fillStyle = color; } - var strokeWidth = computedStyle[TEXT_STROKE_WIDTH$2]; + var strokeWidth = computedStyle[TEXT_STROKE_WIDTH$1]; if (ctx.lineWidth !== strokeWidth) { ctx.lineWidth = strokeWidth; @@ -11967,7 +11968,7 @@ var Text = /*#__PURE__*/function (_Node) { ctx.font = _font2; } - var _color = __bp.__cacheStyle[COLOR$2]; + var _color = __bp.__cacheStyle[COLOR$3]; if (ctx.fillStyle !== _color) { ctx.fillStyle = _color; @@ -11975,7 +11976,7 @@ var Text = /*#__PURE__*/function (_Node) { 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']]; + var props = [['x', endX], ['y', endY], ['fill', __bp.__cacheStyle[COLOR$3]], ['font-family', _computedStyle[FONT_FAMILY$2]], ['font-weight', _computedStyle[FONT_WEIGHT$2]], ['font-style', _computedStyle[FONT_STYLE$2]], ['font-size', _computedStyle[FONT_SIZE$c] + 'px']]; this.virtualDom.children.push({ type: 'item', tagName: 'text', @@ -11999,7 +12000,7 @@ var Text = /*#__PURE__*/function (_Node) { _get(_getPrototypeOf(Text.prototype), "__destroy", this).call(this); - var __cache = this.__config[NODE_CACHE$1]; + var __cache = this.__config[NODE_CACHE$4]; if (__cache) { __cache.release(); @@ -12029,10 +12030,10 @@ var Text = /*#__PURE__*/function (_Node) { self.__content = s; 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; + res[UPDATE_NODE$5] = vd; + res[UPDATE_MEASURE$2] = true; + res[UPDATE_FOCUS$4] = o$1.REFLOW; + res[UPDATE_CONFIG$5] = vd.__config; var root = vd.root; root.__addUpdate(vd, vd.__config, root, root.__config, res); @@ -12085,12 +12086,12 @@ var Text = /*#__PURE__*/function (_Node) { }, { key: "root", get: function get() { - return this.domParent.root; + return (this.domParent || {}).root; } }, { key: "currentStyle", get: function get() { - return this.domParent.currentStyle; + return (this.domParent || {}).currentStyle; } }, { key: "style", @@ -12100,12 +12101,12 @@ var Text = /*#__PURE__*/function (_Node) { }, { key: "computedStyle", get: function get() { - return this.domParent.computedStyle; + return (this.domParent || {}).computedStyle; } }, { key: "cacheStyle", get: function get() { - return this.domParent.__cacheStyle; + return (this.domParent || {}).__cacheStyle; } }, { key: "bbox", @@ -12115,14 +12116,17 @@ var Text = /*#__PURE__*/function (_Node) { width = this.width, height = this.height, root = this.root, - textStrokeWidth = this.currentStyle[TEXT_STROKE_WIDTH$2]; + _this$currentStyle = this.currentStyle; + _this$currentStyle = _this$currentStyle === void 0 ? {} : _this$currentStyle; + var _this$currentStyle$TE = _this$currentStyle[TEXT_STROKE_WIDTH$1], + textStrokeWidth = _this$currentStyle$TE === void 0 ? [0] : _this$currentStyle$TE; var half = 0; - if (textStrokeWidth[1] === REM$4) { - half = Math.max(textStrokeWidth[0] * root.computedStyle[FONT_SIZE$5] * 0.5, half); - } else if (textStrokeWidth[1] === VW$4) { + if (textStrokeWidth[1] === REM$c) { + half = Math.max(textStrokeWidth[0] * root.computedStyle[FONT_SIZE$c] * 0.5, half); + } else if (textStrokeWidth[1] === VW$c) { half = Math.max(textStrokeWidth[0] * root.width * 0.01 * 0.5, half); - } else if (textStrokeWidth[1] === VH$4) { + } else if (textStrokeWidth[1] === VH$c) { half = Math.max(textStrokeWidth[0] * root.height * 0.01 * 0.5, half); } else { half = Math.max(textStrokeWidth[0] * 0.5, half); @@ -12153,9 +12157,9 @@ var Text = /*#__PURE__*/function (_Node) { Text.prototype.__renderByMask = Text.prototype.render; -var TYPE_VD$1 = $$type.TYPE_VD, - TYPE_GM$1 = $$type.TYPE_GM, - TYPE_CP$1 = $$type.TYPE_CP; +var TYPE_VD$3 = $$type.TYPE_VD, + TYPE_GM$3 = $$type.TYPE_GM, + TYPE_CP$3 = $$type.TYPE_CP; /** * 2. 打平children中的数组,变成一维 * 3. 合并相连的Text节点,即string内容 @@ -12166,7 +12170,7 @@ function flattenJson(parent) { return parent.map(function (item) { return flattenJson(item); }); - } else if (!parent || [TYPE_VD$1, TYPE_GM$1, TYPE_CP$1].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) { + } else if (!parent || [TYPE_VD$3, TYPE_GM$3, TYPE_CP$3].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) { return parent; } @@ -12183,42 +12187,42 @@ function traverseJson(list, children, options) { children.forEach(function (item) { traverseJson(list, item, options); }); - } else if (children && (children.$$type === TYPE_VD$1 || children.$$type === TYPE_GM$1)) { + } else if (children && (children.$$type === TYPE_VD$3 || children.$$type === TYPE_GM$3)) { if (['canvas', 'svg', 'webgl'].indexOf(children.tagName) > -1) { throw new Error('Can not nest canvas/svg/webgl'); } - if (children.$$type === TYPE_VD$1) { + if (children.$$type === TYPE_VD$3) { flattenJson(children); } list.push(children); options.lastText = null; - } else if (children && children.$$type === TYPE_CP$1) { + } else if (children && children.$$type === TYPE_CP$3) { list.push(children); // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做 options.lastText = null; } // 排除掉空的文本,连续的text合并 else if (!util.isNil(children) && children !== '') { - if (options.lastText !== null) { - list[list.length - 1] = options.lastText += children; - } else { - list.push(children); - } + if (options.lastText !== null) { + list[list.length - 1] = options.lastText += children; + } else { + list.push(children); } + } } -var _enums$NODE_KEY$3 = enums.NODE_KEY, - NODE_DOM_PARENT$1 = _enums$NODE_KEY$3.NODE_DOM_PARENT, - NODE_STYLE = _enums$NODE_KEY$3.NODE_STYLE, - NODE_CURRENT_STYLE = _enums$NODE_KEY$3.NODE_CURRENT_STYLE, - NODE_COMPUTED_STYLE$1 = _enums$NODE_KEY$3.NODE_COMPUTED_STYLE, - NODE_MATRIX = _enums$NODE_KEY$3.NODE_MATRIX, - NODE_MATRIX_EVENT$1 = _enums$NODE_KEY$3.NODE_MATRIX_EVENT; +var _enums$NODE_KEY$7 = enums.NODE_KEY, + NODE_DOM_PARENT$5 = _enums$NODE_KEY$7.NODE_DOM_PARENT, + NODE_STYLE$5 = _enums$NODE_KEY$7.NODE_STYLE, + NODE_CURRENT_STYLE$6 = _enums$NODE_KEY$7.NODE_CURRENT_STYLE, + NODE_COMPUTED_STYLE$4 = _enums$NODE_KEY$7.NODE_COMPUTED_STYLE, + NODE_MATRIX$3 = _enums$NODE_KEY$7.NODE_MATRIX, + NODE_MATRIX_EVENT$3 = _enums$NODE_KEY$7.NODE_MATRIX_EVENT; var TYPE_VD$2 = $$type.TYPE_VD, TYPE_GM$2 = $$type.TYPE_GM, TYPE_CP$2 = $$type.TYPE_CP; -var Xom, Dom, Img, Geom, Component; +var Xom$1, Dom$1, Img$1, Geom$1, Component$1; function initRoot(cd, root) { var c = flattenJson({ @@ -12244,8 +12248,8 @@ function initCp(json, root, host) { return build(json, root, host); } // text的relation会由上层如Root设置 else { - return new Text(json); - } + return new Text(json); + } } function initCp2(json, root, host, parent) { @@ -12293,13 +12297,13 @@ function build(json, root, host, hasP) { if (_$$type === TYPE_VD$2) { if (tagName === 'img') { - vd = new Img(tagName, props); + vd = new Img$1(tagName, props); if (Array.isArray(children) && children.length) { throw new Error('Img can not contain children'); } } else { - vd = new Dom(tagName, props); + vd = new Dom$1(tagName, props); } // 检查p不能包含div @@ -12317,7 +12321,7 @@ function build(json, root, host, hasP) { vd.__children = children; } else if (_$$type === TYPE_GM$2) { - var _klass = Geom.getRegister(tagName); + var _klass = Geom$1.getRegister(tagName); vd = new _klass(tagName, props); } else if (_$$type === TYPE_CP$2) { @@ -12383,18 +12387,18 @@ function relation(parent, children) { children.forEach(function (item) { relation(parent, item, options); }); - } else if (children instanceof Xom || children instanceof Component || children instanceof Text) { + } else if (children instanceof Xom$1 || children instanceof Component$1 || children instanceof Text) { children.__parent = parent; children.__domParent = parent; // 极为恶心,为了v8的性能优化,text复用parent的__config部分,但domParent重设 if (children instanceof Text) { - [NODE_STYLE, NODE_CURRENT_STYLE, NODE_COMPUTED_STYLE$1, NODE_MATRIX, NODE_MATRIX_EVENT$1].forEach(function (k) { + [NODE_STYLE$5, NODE_CURRENT_STYLE$6, NODE_COMPUTED_STYLE$4, NODE_MATRIX$3, NODE_MATRIX_EVENT$3].forEach(function (k) { children.__config[k] = parent.__config[k]; }); } if (children.__config) { - children.__config[NODE_DOM_PARENT$1] = parent; + children.__config[NODE_DOM_PARENT$5] = parent; } if (options.prev) { @@ -12404,12 +12408,12 @@ function relation(parent, children) { options.prev = children; // 文字视作为父节点的直接文字子节点 - if (children instanceof Component) { + if (children instanceof Component$1) { var sr = children.shadowRoot; if (sr instanceof Text) { sr.__parent = parent; - [NODE_STYLE, NODE_CURRENT_STYLE, NODE_COMPUTED_STYLE$1, NODE_MATRIX, NODE_MATRIX_EVENT$1].forEach(function (k) { + [NODE_STYLE$5, NODE_CURRENT_STYLE$6, NODE_COMPUTED_STYLE$4, NODE_MATRIX$3, NODE_MATRIX_EVENT$3].forEach(function (k) { children.__config[k] = parent.__config[k]; }); } @@ -12417,7 +12421,7 @@ function relation(parent, children) { sr.__domParent = parent; if (sr.__config) { - sr.__config[NODE_DOM_PARENT$1] = parent; + sr.__config[NODE_DOM_PARENT$5] = parent; } } } @@ -12427,11 +12431,11 @@ function relation(parent, children) { var builder = { ref: function ref(o) { - Xom = o.Xom; - Dom = o.Dom; - Img = o.Img; - Geom = o.Geom; - Component = o.Component; + Xom$1 = o.Xom; + Dom$1 = o.Dom; + Img$1 = o.Img; + Geom$1 = o.Geom; + Component$1 = o.Component; }, initRoot: initRoot, initDom: initDom, @@ -12440,7 +12444,7 @@ var builder = { relation: relation }; -var isFunction$1 = util.isFunction; +var isFunction$7 = util.isFunction; var Event = /*#__PURE__*/function () { function Event() { @@ -12452,7 +12456,7 @@ var Event = /*#__PURE__*/function () { _createClass(Event, [{ key: "on", value: function on(id, handle) { - if (!isFunction$1(handle)) { + if (!isFunction$7(handle)) { return; } @@ -12482,7 +12486,7 @@ var Event = /*#__PURE__*/function () { }, { key: "once", value: function once(id, handle) { - if (!isFunction$1(handle)) { + if (!isFunction$7(handle)) { return; } @@ -12529,8 +12533,8 @@ var Event = /*#__PURE__*/function () { } } // 未定义为全部清除 else { - delete self.__eHash[id]; - } + delete self.__eHash[id]; + } } return this; @@ -12558,7 +12562,7 @@ var Event = /*#__PURE__*/function () { for (var _i3 = 0, _len5 = list.length; _i3 < _len5; _i3++) { var cb = list[_i3]; - if (isFunction$1(cb)) { + if (isFunction$7(cb)) { cb.apply(self, data); } } @@ -12604,11 +12608,11 @@ _defineProperty(Event, "BEGIN", 'begin'); _defineProperty(Event, "END", 'end'); -var isNil$4 = util.isNil, - isFunction$2 = util.isFunction, - clone$1 = util.clone, +var isNil$b = util.isNil, + isFunction$6 = util.isFunction, + clone$3 = util.clone, extend$1 = util.extend; -var REGISTER = {}; +var REGISTER$1 = {}; /** * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归 * 在check时树递归会用到,判断是否需要查找cp更新 @@ -12629,7 +12633,7 @@ function setUpdateFlag(cp) { } } -var Component$1 = /*#__PURE__*/function (_Event) { +var Component = /*#__PURE__*/function (_Event) { _inherits(Component, _Event); var _super = _createSuper(Component); @@ -12666,20 +12670,20 @@ var Component$1 = /*#__PURE__*/function (_Event) { var self = this; - if (isNil$4(n)) { + if (isNil$b(n)) { n = {}; - } else if (isFunction$2(n)) { + } else if (isFunction$6(n)) { return; } else { if (Object.keys(n).length === 0) { - if (isFunction$2(cb)) { + if (isFunction$6(cb)) { cb.call(self); } return; } - var state = clone$1(self.state); + var state = clone$3(self.state); n = extend$1(state, n); } @@ -12705,7 +12709,7 @@ var Component$1 = /*#__PURE__*/function (_Event) { __after: function __after() { // self.__nextState = null; 由updater.js每次refresh前同步执行清空,这里不能异步清除,否则frame动画会乱序 list.forEach(function (cb) { - if (isFunction$2(cb)) { + if (isFunction$6(cb)) { cb.call(self); } }); @@ -12714,10 +12718,10 @@ var Component$1 = /*#__PURE__*/function (_Event) { root.addRefreshCp(t); } } // 构造函数中调用还未render, - else if (isFunction$2(cb)) { - self.state = n; - cb.call(self); - } + else if (isFunction$6(cb)) { + self.state = n; + cb.call(self); + } } /** * build中调用初始化,json有值时是update过程才有,且处理过flatten @@ -12782,7 +12786,7 @@ var Component$1 = /*#__PURE__*/function (_Event) { if (!this.__isMounted) { this.__isMounted = true; - if (isFunction$2(this.componentDidMount)) { + if (isFunction$6(this.componentDidMount)) { root.once(Event.REFRESH, function () { _this3.componentDidMount(); }); @@ -12804,7 +12808,7 @@ var Component$1 = /*#__PURE__*/function (_Event) { this.__isDestroyed = true; this.__isMounted = false; - if (isFunction$2(this.componentWillUnmount)) { + if (isFunction$6(this.componentWillUnmount)) { this.componentWillUnmount(); } @@ -12903,7 +12907,7 @@ var Component$1 = /*#__PURE__*/function (_Event) { }], [{ key: "REGISTER", get: function get() { - return REGISTER; + return REGISTER$1; } }, { key: "getRegister", @@ -12912,11 +12916,11 @@ var Component$1 = /*#__PURE__*/function (_Event) { throw new Error('Invalid param'); } - if (!REGISTER.hasOwnProperty(name)) { + if (!REGISTER$1.hasOwnProperty(name)) { throw new Error("Component has not register: ".concat(name)); } - return REGISTER[name]; + return REGISTER$1[name]; } }, { key: "register", @@ -12929,18 +12933,18 @@ var Component$1 = /*#__PURE__*/function (_Event) { throw new Error("Component has already register: ".concat(name)); } - REGISTER[name] = obj; + REGISTER$1[name] = obj; } }, { key: "hasRegister", value: function hasRegister(name) { - return name && REGISTER.hasOwnProperty(name); + return name && REGISTER$1.hasOwnProperty(name); } }, { key: "delRegister", value: function delRegister(name) { if (Component.hasRegister(name)) { - delete REGISTER[name]; + delete REGISTER$1[name]; } } }]); @@ -12961,7 +12965,7 @@ Object.keys(o$2.GEOM).concat(['x', 'y', 'ox', 'oy', 'sx', 'sy', // '__sx1', // '__sy5', // '__sy6', 'width', 'height', 'outerWidth', 'outerHeight', 'clientWidth', 'clientHeight', 'offsetWidth', 'offsetHeight', 'style', 'animationList', 'animateStyle', 'currentStyle', 'computedStyle', 'currentProps', 'baseLine', 'virtualDom', 'mask', 'maskId', 'textWidth', 'content', 'lineBoxes', 'charWidthList', 'charWidth', '__layoutData', 'availableAnimating', 'effectiveAnimating', 'displayAnimating', 'visibilityAnimating', 'bbox', '__config', 'contentBoxList', 'listener', 'matrix', 'matrixEvent']).forEach(function (fn) { - Object.defineProperty(Component$1.prototype, fn, { + Object.defineProperty(Component.prototype, fn, { get: function get() { var sr = this.shadowRoot; @@ -12972,28 +12976,28 @@ Object.keys(o$2.GEOM).concat(['x', 'y', 'ox', 'oy', 'sx', 'sy', // '__sx1', }); }); ['__layout', '__layoutAbs', '__layoutNone', '__tryLayInline', '__offsetX', '__offsetY', '__calAutoBasis', '__calMp', '__calAbs', '__renderAsMask', '__renderByMask', '__mp', 'animate', 'removeAnimate', 'clearAnimate', 'updateStyle', 'getBoundingClientRect', 'getComputedStyle', '__deepScan', 'clearCache', '__structure', '__modifyStruct', '__updateStruct', 'flowChildren', 'absChildren', '__isRealInline', '__calBasis', '__calMinMax', '__computeMeasure', 'appendChild', 'prependChild', 'insertBefore', 'insertAfter', 'removeChild', 'remove'].forEach(function (fn) { - Component$1.prototype[fn] = function () { + Component.prototype[fn] = function () { var sr = this.shadowRoot; - if (sr && isFunction$2(sr[fn])) { + if (sr && isFunction$6(sr[fn])) { return sr[fn].apply(sr, arguments); } }; }); -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 PERCENT$4 = o.PERCENT, - NUMBER$3 = o.NUMBER; +var _enums$STYLE_KEY$h = enums.STYLE_KEY, + SCALE_X$1 = _enums$STYLE_KEY$h.SCALE_X, + SCALE_Y$1 = _enums$STYLE_KEY$h.SCALE_Y; +var PERCENT$8 = o$4.PERCENT, + NUMBER$2 = o$4.NUMBER; function matrixResize(imgWidth, imgHeight, targetWidth, targetHeight, x, y, w, h) { if (imgWidth === targetWidth && imgHeight === targetHeight) { return; } - var list = [[SCALE_X$2, [targetWidth / imgWidth, NUMBER$3]], [SCALE_Y$2, [targetHeight / imgHeight, NUMBER$3]]]; - var tfo = tf.calOrigin([[0, PERCENT$4], [0, PERCENT$4]], w, h); + var list = [[SCALE_X$1, [targetWidth / imgWidth, NUMBER$2]], [SCALE_Y$1, [targetHeight / imgHeight, NUMBER$2]]]; + var tfo = tf.calOrigin([[0, PERCENT$8], [0, PERCENT$8]], w, h); tfo[0] += x; tfo[1] += y; return tf.calMatrixWithOrigin(list, tfo, w, h); @@ -13003,22 +13007,22 @@ 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, - NODE_DEFS_CACHE$1 = enums.NODE_KEY.NODE_DEFS_CACHE; +var _enums$STYLE_KEY$g = enums.STYLE_KEY, + BACKGROUND_POSITION_X$2 = _enums$STYLE_KEY$g.BACKGROUND_POSITION_X, + BACKGROUND_POSITION_Y$2 = _enums$STYLE_KEY$g.BACKGROUND_POSITION_Y, + FONT_SIZE$b = _enums$STYLE_KEY$g.FONT_SIZE, + NODE_DEFS_CACHE$5 = enums.NODE_KEY.NODE_DEFS_CACHE; var clone$2 = util.clone, - joinArr$1 = util.joinArr; -var canvasPolygon$3 = painter.canvasPolygon, - svgPolygon$3 = painter.svgPolygon; -var AUTO$2 = o.AUTO, - PX$4 = o.PX, - PERCENT$5 = o.PERCENT, - STRING$1 = o.STRING, - REM$5 = o.REM, - VW$5 = o.VW, - VH$5 = o.VH; + joinArr$2 = util.joinArr; +var canvasPolygon$4 = painter.canvasPolygon, + svgPolygon$4 = painter.svgPolygon; +var AUTO$6 = o$4.AUTO, + PX$7 = o$4.PX, + PERCENT$7 = o$4.PERCENT, + STRING$1 = o$4.STRING, + REM$b = o$4.REM, + VW$b = o$4.VW, + VH$b = o$4.VH; function renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bbrr, bblr) { var method = arguments.length > 13 && arguments[13] !== undefined ? arguments[13] : 'fill'; @@ -13076,7 +13080,7 @@ function renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bb ctx.fillStyle = color; } - canvasPolygon$3(ctx, list); + canvasPolygon$4(ctx, list); ctx[method](); ctx.closePath(); @@ -13084,7 +13088,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$4(list); if (isInline) { var v = { @@ -13097,7 +13101,7 @@ function renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bb }] }; - xom.__config[NODE_DEFS_CACHE$1].push(v); + xom.__config[NODE_DEFS_CACHE$5].push(v); return ctx.add(v); } else { @@ -13109,7 +13113,7 @@ function renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bb if (matrix) { var bb = xom.virtualDom.bb; - bb[bb.length - 1].props.push(['transform', "matrix(".concat(joinArr$1(mx.m2m6(matrix), ','), ")")]); + bb[bb.length - 1].props.push(['transform', "matrix(".concat(joinArr$2(mx.m2m6(matrix), ','), ")")]); } } } @@ -13118,17 +13122,17 @@ function renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bb function calBackgroundSize(value, w, h, root) { var res = []; value.forEach(function (item, i) { - if (item[1] === PX$4) { + if (item[1] === PX$7) { res.push(item[0]); - } else if (item[1] === PERCENT$5) { + } else if (item[1] === PERCENT$7) { res.push(item[0] * (i ? h : w) * 0.01); - } else if (item[1] === REM$5) { - res.push(item[0] * root.computedStyle[FONT_SIZE$6]); - } else if (item[1] === VW$5) { + } else if (item[1] === REM$b) { + res.push(item[0] * root.computedStyle[FONT_SIZE$b]); + } else if (item[1] === VW$b) { res.push(item[0] * root.width * 0.01); - } else if (item[1] === VH$5) { + } else if (item[1] === VH$b) { res.push(item[0] * root.height * 0.01); - } else if (item[1] === AUTO$2) { + } else if (item[1] === AUTO$6) { res.push(-1); } else if (item[1] === STRING$1) { res.push(item[0] === 'contain' ? -2 : -3); @@ -13139,15 +13143,15 @@ function calBackgroundSize(value, w, h, root) { function calBackgroundPosition(position, container, size, root) { if (Array.isArray(position)) { - if (position[1] === PX$4) { + if (position[1] === PX$7) { return position[0]; - } else if (position[1] === PERCENT$5) { + } else if (position[1] === PERCENT$7) { return (container - size) * position[0] * 0.01; - } else if (position[1] === REM$5) { - return position[0] * root.computedStyle[FONT_SIZE$6]; - } else if (position[1] === VW$5) { + } else if (position[1] === REM$b) { + return position[0] * root.computedStyle[FONT_SIZE$b]; + } else if (position[1] === VW$b) { return position[0] * root.width * 0.01; - } else if (position[1] === VH$5) { + } else if (position[1] === VH$b) { return position[0] * root.height * 0.01; } } @@ -13231,8 +13235,8 @@ function renderImage(xom, renderMode, ctx, loadBgi, bx1, by1, bx2, by2, btlr, bt h = w * height / width; } - var bgX = bx1 + calBackgroundPosition(currentStyle[BACKGROUND_POSITION_X$1][i], bgW, w, xom.root); - var bgY = by1 + calBackgroundPosition(currentStyle[BACKGROUND_POSITION_Y$1][i], bgH, h, xom.root); // 超出尺寸模拟mask截取 + var bgX = bx1 + calBackgroundPosition(currentStyle[BACKGROUND_POSITION_X$2][i], bgW, w, xom.root); + var bgY = by1 + calBackgroundPosition(currentStyle[BACKGROUND_POSITION_Y$2][i], bgH, h, xom.root); // 超出尺寸模拟mask截取 var needMask = bgX < bx1 || bgY < by1 || bgX + w > bx1 + bgW || bgY + h > by1 + bgH; // 计算因为repeat,需要向4个方向扩展渲染几个数量图片 @@ -13375,7 +13379,7 @@ function renderImage(xom, renderMode, ctx, loadBgi, bx1, by1, bx2, by2, btlr, bt if (matrix && !mx.isE(matrix)) { needResize = true; - props.push(['transform', 'matrix(' + joinArr$1(mx.m2m6(matrix), ',') + ')']); + props.push(['transform', 'matrix(' + joinArr$2(mx.m2m6(matrix), ',') + ')']); } if (needMask) { @@ -13397,7 +13401,7 @@ function renderImage(xom, renderMode, ctx, loadBgi, bx1, by1, bx2, by2, btlr, bt }; var id = ctx.add(v); - __config[NODE_DEFS_CACHE$1].push(v); + __config[NODE_DEFS_CACHE$5].push(v); props.push(['clip-path', 'url(#' + id + ')']); } @@ -13413,7 +13417,7 @@ function renderImage(xom, renderMode, ctx, loadBgi, bx1, by1, bx2, by2, btlr, bt }] }; - xom.__config[NODE_DEFS_CACHE$1].push(_v); + xom.__config[NODE_DEFS_CACHE$5].push(_v); repeat.forEach(function (item) { var copy = clone$2(props); @@ -13422,7 +13426,7 @@ function renderImage(xom, renderMode, ctx, loadBgi, bx1, by1, bx2, by2, btlr, bt var _matrix = image.matrixResize(width, height, w, h, item[0], item[1], bgW, bgH); if (_matrix && !mx.isE(_matrix)) { - copy[5][1] = 'matrix(' + joinArr$1(mx.m2m6(_matrix), ',') + ')'; + copy[5][1] = 'matrix(' + joinArr$2(mx.m2m6(_matrix), ',') + ')'; } } @@ -13451,7 +13455,7 @@ function renderImage(xom, renderMode, ctx, loadBgi, bx1, by1, bx2, by2, btlr, bt var _matrix2 = image.matrixResize(width, height, w, h, item[0], item[1], bgW, bgH); if (_matrix2 && !mx.isE(_matrix2)) { - copy[5][1] = 'matrix(' + joinArr$1(mx.m2m6(_matrix2), ',') + ')'; + copy[5][1] = 'matrix(' + joinArr$2(mx.m2m6(_matrix2), ',') + ')'; } } @@ -13474,7 +13478,7 @@ var bg = { calBackgroundSize: calBackgroundSize }; -var isFunction$3 = util.isFunction; +var isFunction$5 = util.isFunction; function traversal(list, length, diff, after) { if (after) { @@ -13577,7 +13581,7 @@ var Frame = /*#__PURE__*/function () { this.__init(); } - if (isFunction$3(handle)) { + if (isFunction$5(handle)) { handle = { __after: handle, __karasFramecb: handle @@ -13619,7 +13623,7 @@ var Frame = /*#__PURE__*/function () { } // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比 - var cb = isFunction$3(handle) ? { + var cb = isFunction$5(handle) ? { __after: function __after(diff) { handle(diff); @@ -13834,80 +13838,80 @@ 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, - _enums$UPDATE_KEY$1 = enums.UPDATE_KEY, - UPDATE_NODE$1 = _enums$UPDATE_KEY$1.UPDATE_NODE, - UPDATE_STYLE = _enums$UPDATE_KEY$1.UPDATE_STYLE, - UPDATE_KEYS = _enums$UPDATE_KEY$1.UPDATE_KEYS, - UPDATE_CONFIG$1 = _enums$UPDATE_KEY$1.UPDATE_CONFIG, +var _enums$STYLE_KEY$f = enums.STYLE_KEY, + FILTER$4 = _enums$STYLE_KEY$f.FILTER, + TRANSFORM_ORIGIN$2 = _enums$STYLE_KEY$f.TRANSFORM_ORIGIN, + PERSPECTIVE_ORIGIN$2 = _enums$STYLE_KEY$f.PERSPECTIVE_ORIGIN, + BACKGROUND_CLIP$1 = _enums$STYLE_KEY$f.BACKGROUND_CLIP, + BACKGROUND_POSITION_X$1 = _enums$STYLE_KEY$f.BACKGROUND_POSITION_X, + BACKGROUND_POSITION_Y$1 = _enums$STYLE_KEY$f.BACKGROUND_POSITION_Y, + BOX_SHADOW$8 = _enums$STYLE_KEY$f.BOX_SHADOW, + TRANSLATE_X$1 = _enums$STYLE_KEY$f.TRANSLATE_X, + TRANSLATE_Y$1 = _enums$STYLE_KEY$f.TRANSLATE_Y, + TRANSLATE_Z$1 = _enums$STYLE_KEY$f.TRANSLATE_Z, + BACKGROUND_SIZE$1 = _enums$STYLE_KEY$f.BACKGROUND_SIZE, + FONT_SIZE$a = _enums$STYLE_KEY$f.FONT_SIZE, + FLEX_BASIS$3 = _enums$STYLE_KEY$f.FLEX_BASIS, + FLEX_DIRECTION$1 = _enums$STYLE_KEY$f.FLEX_DIRECTION, + WIDTH$5 = _enums$STYLE_KEY$f.WIDTH, + HEIGHT$6 = _enums$STYLE_KEY$f.HEIGHT, + TOP$4 = _enums$STYLE_KEY$f.TOP, + BOTTOM$4 = _enums$STYLE_KEY$f.BOTTOM, + LINE_HEIGHT$2 = _enums$STYLE_KEY$f.LINE_HEIGHT, + OPACITY$3 = _enums$STYLE_KEY$f.OPACITY, + Z_INDEX$3 = _enums$STYLE_KEY$f.Z_INDEX, + TRANSFORM$2 = _enums$STYLE_KEY$f.TRANSFORM, + COLOR$2 = _enums$STYLE_KEY$f.COLOR, + FONT_WEIGHT$1 = _enums$STYLE_KEY$f.FONT_WEIGHT, + FONT_STYLE$1 = _enums$STYLE_KEY$f.FONT_STYLE, + FONT_FAMILY$1 = _enums$STYLE_KEY$f.FONT_FAMILY, + TEXT_ALIGN$1 = _enums$STYLE_KEY$f.TEXT_ALIGN, + MATRIX$1 = _enums$STYLE_KEY$f.MATRIX, + ROTATE_3D$1 = _enums$STYLE_KEY$f.ROTATE_3D, + TRANSLATE_PATH = _enums$STYLE_KEY$f.TRANSLATE_PATH, + TEXT_STROKE_COLOR$1 = _enums$STYLE_KEY$f.TEXT_STROKE_COLOR, + TEXT_STROKE_OVER$1 = _enums$STYLE_KEY$f.TEXT_STROKE_OVER, + _enums$UPDATE_KEY$4 = enums.UPDATE_KEY, + UPDATE_NODE$4 = _enums$UPDATE_KEY$4.UPDATE_NODE, + UPDATE_STYLE$2 = _enums$UPDATE_KEY$4.UPDATE_STYLE, + UPDATE_KEYS$2 = _enums$UPDATE_KEY$4.UPDATE_KEYS, + UPDATE_CONFIG$4 = _enums$UPDATE_KEY$4.UPDATE_CONFIG, _enums$KEY_FRAME_KEY = enums.KEY_FRAME_KEY, FRAME_STYLE = _enums$KEY_FRAME_KEY.FRAME_STYLE, FRAME_TIME = _enums$KEY_FRAME_KEY.FRAME_TIME, FRAME_EASING = _enums$KEY_FRAME_KEY.FRAME_EASING, FRAME_TRANSITION = _enums$KEY_FRAME_KEY.FRAME_TRANSITION; -var AUTO$3 = o.AUTO, - PX$5 = o.PX, - PERCENT$6 = o.PERCENT, - INHERIT$3 = o.INHERIT, - RGBA$1 = o.RGBA, - STRING$2 = o.STRING, - NUMBER$4 = o.NUMBER, - REM$6 = o.REM, - VW$6 = o.VW, - VH$6 = o.VH, - calUnit$2 = o.calUnit; -var isNil$5 = util.isNil, +var AUTO$5 = o$4.AUTO, + PX$6 = o$4.PX, + PERCENT$6 = o$4.PERCENT, + INHERIT$2 = o$4.INHERIT, + RGBA$1 = o$4.RGBA, + STRING = o$4.STRING, + NUMBER$1 = o$4.NUMBER, + REM$a = o$4.REM, + VW$a = o$4.VW, + VH$a = o$4.VH, + calUnit = o$4.calUnit; +var isNil$a = util.isNil, isFunction$4 = util.isFunction, - isNumber$1 = util.isNumber, + isNumber = util.isNumber, isObject$1 = util.isObject, - isString$1 = util.isString, - clone$3 = util.clone, - equalArr$2 = util.equalArr; + isString = util.isString, + clone$1 = util.clone, + equalArr = util.equalArr; var linear = easing.linear; -var cloneStyle$1 = css.cloneStyle; -var isGeom$2 = o$2.isGeom, - GEOM$3 = o$2.GEOM; -var COLOR_HASH$2 = key.COLOR_HASH, - LENGTH_HASH$2 = key.LENGTH_HASH, - RADIUS_HASH$2 = key.RADIUS_HASH, - GRADIENT_HASH$2 = key.GRADIENT_HASH, - EXPAND_HASH$2 = key.EXPAND_HASH, - GRADIENT_TYPE$2 = key.GRADIENT_TYPE; +var cloneStyle = css.cloneStyle; +var isGeom$1 = o$2.isGeom, + GEOM$1 = o$2.GEOM; +var COLOR_HASH = key.COLOR_HASH, + LENGTH_HASH = key.LENGTH_HASH, + RADIUS_HASH = key.RADIUS_HASH, + GRADIENT_HASH = key.GRADIENT_HASH, + EXPAND_HASH = key.EXPAND_HASH, + GRADIENT_TYPE = key.GRADIENT_TYPE; var NUM_CAL_HASH = {}; -Object.assign(NUM_CAL_HASH, LENGTH_HASH$2); -Object.assign(NUM_CAL_HASH, EXPAND_HASH$2); +Object.assign(NUM_CAL_HASH, LENGTH_HASH); +Object.assign(NUM_CAL_HASH, EXPAND_HASH); function unify(frames, target) { var hash = {}; @@ -13921,21 +13925,21 @@ function unify(frames, target) { if (v !== undefined && !hash.hasOwnProperty(k)) { hash[k] = true; // geom为属性字符串,style都为枚举int - if (!GEOM$3.hasOwnProperty(k)) { + if (!GEOM$1.hasOwnProperty(k)) { k = parseInt(k); } // path动画要转为translateXY,所以手动添加,使2帧之间存在过渡,有可能之前已存在这个动画,可忽视 - if (k === TRANSLATE_PATH$1) { - if (!hash.hasOwnProperty(TRANSLATE_X$3)) { - keys.push(TRANSLATE_X$3); + if (k === TRANSLATE_PATH) { + if (!hash.hasOwnProperty(TRANSLATE_X$1)) { + keys.push(TRANSLATE_X$1); } - if (!hash.hasOwnProperty(TRANSLATE_Y$3)) { - keys.push(TRANSLATE_Y$3); + if (!hash.hasOwnProperty(TRANSLATE_Y$1)) { + keys.push(TRANSLATE_Y$1); } - hash[TRANSLATE_X$3] = hash[TRANSLATE_Y$3] = true; + hash[TRANSLATE_X$1] = hash[TRANSLATE_Y$1] = true; } keys.push(k); @@ -13946,8 +13950,8 @@ function unify(frames, target) { frames.forEach(function (item) { var style = item[FRAME_STYLE]; keys.forEach(function (k) { - if (!style.hasOwnProperty(k) || isNil$5(style[k])) { - if (GEOM$3.hasOwnProperty(k)) { + if (!style.hasOwnProperty(k) || isNil$a(style[k])) { + if (GEOM$1.hasOwnProperty(k)) { style[k] = target.getProps(k); } else { style[k] = target.currentStyle[k]; @@ -13966,7 +13970,7 @@ function inherit(frames, keys, target) { keys.forEach(function (k) { var v = style[k]; // geom的属性可能在帧中没有 - if (isNil$5(v)) { + if (isNil$a(v)) { return; } @@ -13974,16 +13978,16 @@ function inherit(frames, keys, target) { var ow = target.outerWidth; var oh = target.outerHeight; var m = tf.calMatrix(v, ow, oh); - style[k] = [[MATRIX$2, m]]; - } else if (v[1] === INHERIT$3) { - if (k === COLOR$3 || k === TEXT_STROKE_COLOR$3) { + style[k] = [[MATRIX$1, m]]; + } else if (v[1] === INHERIT$2) { + if (k === COLOR$2 || k === TEXT_STROKE_COLOR$1) { 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) { - 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) { - style[k] = [computedStyle[k], STRING$2]; + } else if (LENGTH_HASH.hasOwnProperty(k)) { + style[k] = [computedStyle[k], PX$6]; + } else if (k === FONT_WEIGHT$1) { + style[k] = [computedStyle[k], NUMBER$1]; + } else if (k === FONT_STYLE$1 || k === FONT_FAMILY$1 || k === TEXT_ALIGN$1 || k === TEXT_STROKE_OVER$1) { + style[k] = [computedStyle[k], STRING]; } } }); @@ -14003,10 +14007,10 @@ function inherit(frames, keys, target) { function genBeforeRefresh(style, keys, __config, root, node) { var res = {}; - res[UPDATE_NODE$1] = node; - res[UPDATE_STYLE] = style; - res[UPDATE_KEYS] = keys; - res[UPDATE_CONFIG$1] = __config[I_NODE_CONFIG]; + res[UPDATE_NODE$4] = node; + res[UPDATE_STYLE$2] = style; + res[UPDATE_KEYS$2] = keys; + res[UPDATE_CONFIG$4] = __config[I_NODE_CONFIG]; root.__addUpdate(node, __config[I_NODE_CONFIG], root, __config[I_ROOT_CONFIG], res); @@ -14037,8 +14041,8 @@ function framing(style, duration, es) { style = css.normalize(style); if (Array.isArray(translatePath) && [6, 8].indexOf(translatePath.length) > -1) { - style[TRANSLATE_PATH$1] = translatePath.map(function (item) { - return calUnit$2(item); + style[TRANSLATE_PATH] = translatePath.map(function (item) { + return calUnit(item); }); } @@ -14051,52 +14055,52 @@ function framing(style, duration, es) { } function calByUnit(p, n, container, root) { - if (p[1] === PX$5) { + if (p[1] === PX$6) { 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]; - } else if (n[1] === VW$6) { + } else if (n[1] === REM$a) { + return n[0] * root.computedStyle[FONT_SIZE$a] - p[0]; + } else if (n[1] === VW$a) { return n[0] * root.width * 0.01 - p[0]; - } else if (n[1] === VH$6) { + } else if (n[1] === VH$a) { return n[0] * root.height * 0.01 - p[0]; } } else if (p[1] === PERCENT$6) { - if (n[1] === PX$5) { + if (n[1] === PX$6) { 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]; - } else if (n[1] === VW$6) { + } else if (n[1] === REM$a) { + return n[0] * root.computedStyle[FONT_SIZE$a] * 100 / container - p[0]; + } else if (n[1] === VW$a) { return n[0] * root.width / container - p[0]; - } else if (n[1] === VH$6) { + } else if (n[1] === VH$a) { return n[0] * root.height / container - p[0]; } - } else if (p[1] === REM$6) { - if (n[1] === PX$5) { - return n[0] / root.computedStyle[FONT_SIZE$7] - p[0]; + } else if (p[1] === REM$a) { + if (n[1] === PX$6) { + return n[0] / root.computedStyle[FONT_SIZE$a] - p[0]; } else if (n[1] === PERCENT$6) { - return n[0] * 0.01 * container / root.computedStyle[FONT_SIZE$7] - p[0]; - } else if (n[1] === VW$6) { - return n[0] * root.width * 0.01 / root.computedStyle[FONT_SIZE$7] - p[0]; - } else if (n[1] === VH$6) { - return n[0] * root.height * 0.01 / root.computedStyle[FONT_SIZE$7] - p[0]; - } - } else if (p[1] === VW$6) { - if (n[1] === PX$5) { + return n[0] * 0.01 * container / root.computedStyle[FONT_SIZE$a] - p[0]; + } else if (n[1] === VW$a) { + return n[0] * root.width * 0.01 / root.computedStyle[FONT_SIZE$a] - p[0]; + } else if (n[1] === VH$a) { + return n[0] * root.height * 0.01 / root.computedStyle[FONT_SIZE$a] - p[0]; + } + } else if (p[1] === VW$a) { + if (n[1] === PX$6) { 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]; + } else if (n[1] === REM$a) { + return n[0] * 100 * root.computedStyle[FONT_SIZE$a] / root.width - p[0]; } else if (n[1] === PERCENT$6) { return n[0] * container / root.width - p[0]; - } else if (n[1] === VH$6) { + } else if (n[1] === VH$a) { return n[0] * root.height / root.width - p[0]; } - } else if (p[1] === VH$6) { - if (n[1] === PX$5) { + } else if (p[1] === VH$a) { + if (n[1] === PX$6) { 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]; - } else if (n[1] === VW$6) { + } else if (n[1] === REM$a) { + return n[0] * 100 * root.computedStyle[FONT_SIZE$a] / root.height - p[0]; + } else if (n[1] === VW$a) { return n[0] * root.width / root.height - p[0]; } else if (n[1] === PERCENT$6) { return n[0] * container / root.height - p[0]; @@ -14142,19 +14146,19 @@ function calDiff(prev, next, k, target, tagName) { } // transform特殊被初始化转成matrix矩阵,直接计算差值 - if (equalArr$2(pm, nm)) { + if (equalArr(pm, nm)) { return; } res[1] = [nm[0] - pm[0], nm[1] - pm[1], nm[2] - pm[2], nm[3] - pm[3], nm[4] - pm[4], nm[5] - pm[5], nm[6] - pm[6], nm[7] - pm[7], nm[8] - pm[8], nm[9] - pm[9], nm[10] - pm[10], nm[11] - pm[11], nm[12] - pm[12], nm[13] - pm[13], nm[14] - pm[14], nm[15] - pm[15]]; return res; - } else if (k === ROTATE_3D$2) { - if (equalArr$2(p, n)) { + } else if (k === ROTATE_3D$1) { + if (equalArr(p, n)) { return; } res[1] = [n[0] - n[0], n[1] - p[1], n[2] - p[2], [n[3][0] - p[3][0], n[3][1]]]; - } else if (k === FILTER$2) { + } else if (k === FILTER$4) { // filter很特殊,里面有多个滤镜,忽视顺序按hash计算,为空视为默认值,如blur默认0,brightness默认1 var pHash = {}, nHash = {}, @@ -14191,26 +14195,26 @@ function calDiff(prev, next, k, target, tagName) { hasChange = true; } } else if (k === 'hue-rotate') { - var nv = isNil$5(nHash[k]) ? 0 : nHash[k][0]; - var pv = isNil$5(pHash[k]) ? 0 : pHash[k][0]; + var nv = isNil$a(nHash[k]) ? 0 : nHash[k][0]; + var pv = isNil$a(pHash[k]) ? 0 : pHash[k][0]; if (pv !== nv) { v[k] = [nv - pv, PERCENT$6]; hasChange = true; } } else if (k === 'saturate' || k === 'brightness' || k === 'contrast') { - var _nv = isNil$5(nHash[k]) ? 100 : nHash[k][0]; + var _nv = isNil$a(nHash[k]) ? 100 : nHash[k][0]; - var _pv = isNil$5(pHash[k]) ? 100 : pHash[k][0]; + var _pv = isNil$a(pHash[k]) ? 100 : pHash[k][0]; if (_pv !== _nv) { v[k] = [_nv - _pv, PERCENT$6]; hasChange = true; } } else if (k === 'grayscale') { - var _nv2 = isNil$5(nHash[k]) ? 0 : nHash[k][0]; + var _nv2 = isNil$a(nHash[k]) ? 0 : nHash[k][0]; - var _pv2 = isNil$5(pHash[k]) ? 0 : pHash[k][0]; + var _pv2 = isNil$a(pHash[k]) ? 0 : pHash[k][0]; if (_pv2 !== _nv2) { v[k] = [_nv2 - _pv2, PERCENT$6]; @@ -14224,7 +14228,7 @@ function calDiff(prev, next, k, target, tagName) { } res[1] = v; - } else if (k === TRANSFORM_ORIGIN$3 || k === PERSPECTIVE_ORIGIN$2) { + } else if (k === TRANSFORM_ORIGIN$2 || k === PERSPECTIVE_ORIGIN$2) { res[1] = []; for (var i = 0; i < 2; i++) { @@ -14240,10 +14244,10 @@ function calDiff(prev, next, k, target, tagName) { } } - if (equalArr$2(res[1], [0, 0])) { + if (equalArr(res[1], [0, 0])) { return; } - } else if (k === BACKGROUND_POSITION_X$2 || k === BACKGROUND_POSITION_Y$2) { + } else if (k === BACKGROUND_POSITION_X$1 || k === BACKGROUND_POSITION_Y$1) { res[1] = []; var length = Math.min(p.length, n.length); @@ -14266,12 +14270,12 @@ function calDiff(prev, next, k, target, tagName) { res[1].push(_v2); } else { - var k2 = k === BACKGROUND_POSITION_X$2 ? 'offsetWidth' : 'offsetHeight'; + var k2 = k === BACKGROUND_POSITION_X$1 ? 'offsetWidth' : 'offsetHeight'; if (['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP$1]) > -1) { - k2 = k === BACKGROUND_POSITION_X$2 ? 'clientWidth' : 'clientHeight'; + k2 = k === BACKGROUND_POSITION_X$1 ? 'clientWidth' : 'clientHeight'; } else if (['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP$1]) > -1) { - k2 = k === BACKGROUND_POSITION_X$2 ? 'width' : 'height'; + k2 = k === BACKGROUND_POSITION_X$1 ? 'width' : 'height'; } var _v3 = calByUnit(_pi, _ni, target[k2], target.root); @@ -14284,7 +14288,7 @@ function calDiff(prev, next, k, target, tagName) { res[1].push(_v3); } } - } else if (k === BOX_SHADOW$1) { + } else if (k === BOX_SHADOW$8) { res[1] = []; for (var _i2 = 0, len = Math.min(p.length, n.length); _i2 < len; _i2++) { @@ -14307,7 +14311,7 @@ function calDiff(prev, next, k, target, tagName) { res[1].push(_v4); } - } else if (EXPAND_HASH$2.hasOwnProperty(k)) { + } else if (EXPAND_HASH.hasOwnProperty(k)) { if (p[1] === n[1]) { var _v5 = n[0] - p[0]; @@ -14317,7 +14321,7 @@ function calDiff(prev, next, k, target, tagName) { res[1] = _v5; } else { - var _v6 = calByUnit(p, n, target[k === TRANSLATE_X$3 || k === TRANSLATE_Z$3 ? 'outerWidth' : 'outerHeight'], target.root); + var _v6 = calByUnit(p, n, target[k === TRANSLATE_X$1 || k === TRANSLATE_Z$1 ? 'outerWidth' : 'outerHeight'], target.root); if (!_v6) { return; @@ -14364,7 +14368,7 @@ function calDiff(prev, next, k, target, tagName) { } } - if (equalArr$2(temp, [0, 0])) { + if (equalArr(temp, [0, 0])) { res[1].push(null); } else { res[1].push(temp); @@ -14375,7 +14379,7 @@ function calDiff(prev, next, k, target, tagName) { if (!has) { return; } - } else if (GRADIENT_HASH$2.hasOwnProperty(k)) { + } else if (GRADIENT_HASH.hasOwnProperty(k)) { // backgroundImage发生了渐变色和图片的变化,fill发生渐变色和纯色的变化等 res[1] = []; @@ -14385,7 +14389,7 @@ function calDiff(prev, next, k, target, tagName) { var _pi3 = p[_i4], _ni3 = n[_i4]; - if (!_pi3 || !_ni3 || isString$1(_pi3) || isString$1(_ni3)) { + if (!_pi3 || !_ni3 || isString(_pi3) || isString(_ni3)) { res[1].push(null); continue; } @@ -14402,7 +14406,7 @@ function calDiff(prev, next, k, target, tagName) { var nv = _ni3.v; _temp[0] = []; var clientWidth = target.clientWidth; - var eq = equalArr$2(pv, nv); + var eq = equalArr(pv, nv); for (var _i5 = 0, _len = Math.min(pv.length, nv.length); _i5 < _len; _i5++) { var _a = pv[_i5]; @@ -14436,7 +14440,7 @@ function calDiff(prev, next, k, target, tagName) { if (isArrP) { var _v9 = [_ni3.d[0] - _pi3.d[0], _ni3.d[1] - _pi3.d[1], _ni3.d[2] - _pi3.d[2], _ni3.d[3] - _pi3.d[3]]; - if (eq && equalArr$2(_v9, [0, 0, 0, 0])) { + if (eq && equalArr(_v9, [0, 0, 0, 0])) { res[1].push(null); continue; } @@ -14454,100 +14458,100 @@ function calDiff(prev, next, k, target, tagName) { } } // 径向渐变的位置 else if (_pi3.k === 'radial') { - var _isArrP = Array.isArray(_pi3.z); - - var _isArrN = Array.isArray(_ni3.z); - - if (_isArrN !== _isArrP) { - res[1].push(null); - continue; - } + var _isArrP = Array.isArray(_pi3.z); - if (_isArrP) { - _temp[2] = []; + var _isArrN = Array.isArray(_ni3.z); - for (var _i6 = 0; _i6 < 5; _i6++) { - var pz = _pi3.z[_i6]; // 半径比例省略为1 - - if (pz === undefined) { - pz = 1; - } - - var nz = _ni3.z[_i6]; + if (_isArrN !== _isArrP) { + res[1].push(null); + continue; + } - if (nz === undefined) { - nz = 1; - } + if (_isArrP) { + _temp[2] = []; - _temp[2].push(nz - pz); - } + for (var _i6 = 0; _i6 < 5; _i6++) { + var pz = _pi3.z[_i6]; // 半径比例省略为1 - if (eq && equalArr$2(res[4], [0, 0, 0, 0, 0])) { - res[1].push(null); + if (pz === undefined) { + pz = 1; } - } else { - _temp[2] = []; - for (var _i7 = 0; _i7 < 2; _i7++) { - var _pp = _pi3.p[_i7]; - var np = _ni3.p[_i7]; - - if (_pp[1] === np[1]) { - _temp[2].push(np[0] - _pp[0]); - } else { - var _v11 = calByUnit(_pp, np, target[_i7 ? 'clientWidth' : 'clientHeight'], target.root); + var nz = _ni3.z[_i6]; - _temp[2].push(_v11 || 0); - } + if (nz === undefined) { + nz = 1; } - if (eq && equalArr$2(res[3], [0, 0])) { - res[1].push(null); - } + _temp[2].push(nz - pz); } - } else if (_pi3.k === 'conic') { - _temp[1].push(n.d - p.d); + if (eq && equalArr(res[4], [0, 0, 0, 0, 0])) { + res[1].push(null); + } + } else { _temp[2] = []; - for (var _i8 = 0; _i8 < 2; _i8++) { - var _pp2 = p.p[_i8]; - var _np = n.p[_i8]; + for (var _i7 = 0; _i7 < 2; _i7++) { + var _pp = _pi3.p[_i7]; + var np = _ni3.p[_i7]; - if (_pp2[1] === _np[1]) { - _temp[2].push(_np[0] - _pp2[0]); + if (_pp[1] === np[1]) { + _temp[2].push(np[0] - _pp[0]); } else { - var _v12 = calByUnit(_pp2, _np, target[_i8 ? 'clientWidth' : 'clientHeight'], target.root); + var _v11 = calByUnit(_pp, np, target[_i7 ? 'clientWidth' : 'clientHeight'], target.root); - _temp[2].push(_v12 || 0); + _temp[2].push(_v11 || 0); } } - if (eq && res[2] !== 0 && equalArr$2(res[3], [0, 0])) { + if (eq && equalArr(res[3], [0, 0])) { res[1].push(null); } } - } // 纯色 - else { - if (equalArr$2(n, _pi3)) { - res[1].push(null); + } else if (_pi3.k === 'conic') { + _temp[1].push(n.d - p.d); + + _temp[2] = []; + + for (var _i8 = 0; _i8 < 2; _i8++) { + var _pp2 = p.p[_i8]; + var _np = n.p[_i8]; + + if (_pp2[1] === _np[1]) { + _temp[2].push(_np[0] - _pp2[0]); + } else { + var _v12 = calByUnit(_pp2, _np, target[_i8 ? 'clientWidth' : 'clientHeight'], target.root); + + _temp[2].push(_v12 || 0); + } } - _temp[0] = [_ni3[0] - _pi3[0], _ni3[1] - _pi3[1], _ni3[2] - _pi3[2], _ni3[3] - _pi3[3]]; + if (eq && res[2] !== 0 && equalArr(res[3], [0, 0])) { + res[1].push(null); + } + } + } // 纯色 + else { + if (equalArr(n, _pi3)) { + res[1].push(null); } + _temp[0] = [_ni3[0] - _pi3[0], _ni3[1] - _pi3[1], _ni3[2] - _pi3[2], _ni3[3] - _pi3[3]]; + } + res[1].push(_temp); } - } else if (COLOR_HASH$2.hasOwnProperty(k)) { + } else if (COLOR_HASH.hasOwnProperty(k)) { n = n[0]; p = p[0]; - if (equalArr$2(n, p) || n[3] === 0 && p[3] === 0) { + if (equalArr(n, p) || n[3] === 0 && p[3] === 0) { return; } res[1] = [n[0] - p[0], n[1] - p[1], n[2] - p[2], n[3] - p[3]]; - } else if (RADIUS_HASH$2.hasOwnProperty(k)) { + } else if (RADIUS_HASH.hasOwnProperty(k)) { // x/y都相等无需 if (n[0][0] === p[0][0] && n[0][1] === p[0][1] && n[1][0] === p[1][0] && n[1][1] === p[1][1]) { return; @@ -14564,9 +14568,9 @@ function calDiff(prev, next, k, target, tagName) { res[1].push(_v13 || 0); } } - } else if (LENGTH_HASH$2.hasOwnProperty(k)) { + } else if (LENGTH_HASH.hasOwnProperty(k)) { // auto不做动画 - if (p[1] === AUTO$3 || n[1] === AUTO$3) { + if (p[1] === AUTO$5 || n[1] === AUTO$5) { return; } @@ -14578,21 +14582,21 @@ 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); - } // fontSize的%相对于parent的 - else if (k === FONT_SIZE$7) { - diff = calByUnit(p, n, parentComputedStyle[FONT_SIZE$7], 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) { - diff = calByUnit(p, n, parentComputedStyle[HEIGHT$2], target.root); - } - } // 其余都是相对于父width的 - else { - if (p[1] !== AUTO$3 && n[1] !== AUTO$3) { - diff = calByUnit(p, n, parentComputedStyle[WIDTH$3], target.root); - } - } // 兜底NaN非法 + diff = calByUnit(p, n, computedStyle[FONT_SIZE$a], target.root); + } // fontSize的%相对于parent的 + else if (k === FONT_SIZE$a) { + diff = calByUnit(p, n, parentComputedStyle[FONT_SIZE$a], target.root); + } // 相对于父height的特殊属性 + else if (k === FLEX_BASIS$3 && ['column', 'column-reverse', 'columnReverse'].indexOf(computedStyle[FLEX_DIRECTION$1]) > -1 || [HEIGHT$6, TOP$4, BOTTOM$4].indexOf(k) > -1) { + if (p[1] !== AUTO$5 && n[1] !== AUTO$5) { + diff = calByUnit(p, n, parentComputedStyle[HEIGHT$6], target.root); + } + } // 其余都是相对于父width的 + else { + if (p[1] !== AUTO$5 && n[1] !== AUTO$5) { + diff = calByUnit(p, n, parentComputedStyle[WIDTH$5], target.root); + } + } // 兜底NaN非法 if (diff === 0 || isNaN(diff)) { @@ -14600,11 +14604,11 @@ function calDiff(prev, next, k, target, tagName) { } res[1] = diff; - } else if (GEOM$3.hasOwnProperty(k)) { - if (isNil$5(p)) { + } else if (GEOM$1.hasOwnProperty(k)) { + if (isNil$a(p)) { return; - } else if (GEOM$3[k][tagName] && isFunction$4(GEOM$3[k][tagName].calDiff)) { - var fn = GEOM$3[k][tagName].calDiff; + } else if (GEOM$1[k][tagName] && isFunction$4(GEOM$1[k][tagName].calDiff)) { + var fn = GEOM$1[k][tagName].calDiff; if (target.isMulti) { var arr = []; @@ -14619,175 +14623,175 @@ function calDiff(prev, next, k, target, tagName) { } } // 特殊处理multi else if (target.isMulti) { - if (k === 'points' || k === 'controls') { - if (isNil$5(n) || !n.length || isNil$5(p) || !p.length || equalArr$2(p, n)) { - return; - } + if (k === 'points' || k === 'controls') { + if (isNil$a(n) || !n.length || isNil$a(p) || !p.length || equalArr(p, n)) { + return; + } - res[1] = []; + res[1] = []; - for (var _i11 = 0, _len3 = Math.min(p.length, n.length); _i11 < _len3; _i11++) { - var _pv3 = p[_i11]; - var _nv3 = n[_i11]; + for (var _i11 = 0, _len3 = Math.min(p.length, n.length); _i11 < _len3; _i11++) { + var _pv3 = p[_i11]; + var _nv3 = n[_i11]; - if (isNil$5(_pv3) || !_pv3.length || isNil$5(_nv3) || !_nv3.length) { - res[1].push(null); - } else { - var v2 = []; + if (isNil$a(_pv3) || !_pv3.length || isNil$a(_nv3) || !_nv3.length) { + res[1].push(null); + } else { + var v2 = []; - for (var _j3 = 0, len2 = Math.min(_pv3.length, _nv3.length); _j3 < len2; _j3++) { - var pv2 = _pv3[_j3]; - var nv2 = _nv3[_j3]; + for (var _j3 = 0, len2 = Math.min(_pv3.length, _nv3.length); _j3 < len2; _j3++) { + var pv2 = _pv3[_j3]; + var nv2 = _nv3[_j3]; - if (isNil$5(pv2) || isNil$5(nv2)) { - v2.push(null); - } else { - var v3 = []; + if (isNil$a(pv2) || isNil$a(nv2)) { + v2.push(null); + } else { + var v3 = []; - for (var _k2 = 0, len3 = Math.max(pv2.length, nv2.length); _k2 < len3; _k2++) { - var pv3 = pv2[_k2]; - var nv3 = nv2[_k2]; // control由4点变2点 + for (var _k2 = 0, len3 = Math.max(pv2.length, nv2.length); _k2 < len3; _k2++) { + var pv3 = pv2[_k2]; + var nv3 = nv2[_k2]; // control由4点变2点 - if (isNil$5(pv3) || isNil$5(nv3)) { - v3.push(0); - } else { - v3.push(nv3 - pv3); - } + if (isNil$a(pv3) || isNil$a(nv3)) { + v3.push(0); + } else { + v3.push(nv3 - pv3); } - - v2.push(v3); } - } - res[1].push(v2); + v2.push(v3); + } } + + res[1].push(v2); } - } else if (k === 'controlA' || k === 'controlB') { - if (isNil$5(n) || !n.length || isNil$5(p) || !p.length || equalArr$2(p, n)) { - return; - } + } + } else if (k === 'controlA' || k === 'controlB') { + if (isNil$a(n) || !n.length || isNil$a(p) || !p.length || equalArr(p, n)) { + return; + } - res[1] = []; + res[1] = []; - for (var _i12 = 0, _len4 = Math.min(p.length, n.length); _i12 < _len4; _i12++) { - var _pv4 = p[_i12]; - var _nv4 = n[_i12]; + for (var _i12 = 0, _len4 = Math.min(p.length, n.length); _i12 < _len4; _i12++) { + var _pv4 = p[_i12]; + var _nv4 = n[_i12]; - if (isNil$5(_pv4) || !_pv4.length || isNil$5(_nv4) || !_nv4.length) { - res[1].push(null); - } else { - res[1].push([_nv4[0] - _pv4[0], _nv4[1] - _pv4[1]]); - } - } - } else { - if (n === p || equalArr$2(n, p) || k === 'edge' || k === 'closure') { - return; + if (isNil$a(_pv4) || !_pv4.length || isNil$a(_nv4) || !_nv4.length) { + res[1].push(null); + } else { + res[1].push([_nv4[0] - _pv4[0], _nv4[1] - _pv4[1]]); } + } + } else { + if (n === p || equalArr(n, p) || k === 'edge' || k === 'closure') { + return; + } - var _v14 = []; - - for (var _i13 = 0, _len5 = Math.min(p.length, n.length); _i13 < _len5; _i13++) { - var _pv5 = p[_i13]; - var _nv5 = n[_i13]; + var _v14 = []; - if (isNil$5(_pv5) || isNil$5(_nv5)) { - _v14.push(0); - } + for (var _i13 = 0, _len5 = Math.min(p.length, n.length); _i13 < _len5; _i13++) { + var _pv5 = p[_i13]; + var _nv5 = n[_i13]; - _v14.push(_nv5 - _pv5); + if (isNil$a(_pv5) || isNil$a(_nv5)) { + _v14.push(0); } - res[1] = _v14; + _v14.push(_nv5 - _pv5); } - } // 非multi特殊处理这几类数组类型数据 - else if (k === 'points' || k === 'controls') { - if (isNil$5(n) || !n.length || isNil$5(p) || !p.length || equalArr$2(p, n)) { - return; - } - - res[1] = []; - for (var _i14 = 0, _len6 = Math.min(p.length, n.length); _i14 < _len6; _i14++) { - var _pv6 = p[_i14]; - var _nv6 = n[_i14]; + res[1] = _v14; + } + } // 非multi特殊处理这几类数组类型数据 + else if (k === 'points' || k === 'controls') { + if (isNil$a(n) || !n.length || isNil$a(p) || !p.length || equalArr(p, n)) { + return; + } - if (isNil$5(_pv6) || !_pv6.length || isNil$5(_nv6) || !_nv6.length) { - res[1].push(null); - } else { - var _v15 = []; + res[1] = []; - for (var _j4 = 0, _len7 = Math.max(_pv6.length, _nv6.length); _j4 < _len7; _j4++) { - var _pv7 = _pv6[_j4]; - var _nv7 = _nv6[_j4]; // control由4点变2点 + for (var _i14 = 0, _len6 = Math.min(p.length, n.length); _i14 < _len6; _i14++) { + var _pv6 = p[_i14]; + var _nv6 = n[_i14]; - if (isNil$5(_pv7) || isNil$5(_nv7)) { - _v15.push(0); - } else { - _v15.push(_nv7 - _pv7); - } - } + if (isNil$a(_pv6) || !_pv6.length || isNil$a(_nv6) || !_nv6.length) { + res[1].push(null); + } else { + var _v15 = []; - res[1].push(_v15); - } - } - } else if (k === 'controlA' || k === 'controlB') { - if (isNil$5(n) || !n.length || isNil$5(p) || !p.length || equalArr$2(p, n)) { - return; - } + for (var _j4 = 0, _len7 = Math.max(_pv6.length, _nv6.length); _j4 < _len7; _j4++) { + var _pv7 = _pv6[_j4]; + var _nv7 = _nv6[_j4]; // control由4点变2点 - res[1] = [n[0] - p[0], n[1] - p[1]]; - } // 其它简单数据,除了edge/closure没有增量 - else { - if (n === p || k === 'edge' || k === 'closure') { - return; + if (isNil$a(_pv7) || isNil$a(_nv7)) { + _v15.push(0); } else { - res[1] = n - p; + _v15.push(_nv7 - _pv7); } } - } else if (k === OPACITY$2 || k === Z_INDEX$1) { + + res[1].push(_v15); + } + } + } else if (k === 'controlA' || k === 'controlB') { + if (isNil$a(n) || !n.length || isNil$a(p) || !p.length || equalArr(p, n)) { + return; + } + + res[1] = [n[0] - p[0], n[1] - p[1]]; + } // 其它简单数据,除了edge/closure没有增量 + else { + if (n === p || k === 'edge' || k === 'closure') { + return; + } else { + res[1] = n - p; + } + } + } else if (k === OPACITY$3 || k === Z_INDEX$3) { if (n === p) { return; } res[1] = n - p; } // 特殊的path,不存在style中但在动画某帧中,不会统一化所以可能反向计算frameR时后一帧没有 - else if (k === TRANSLATE_PATH$1 && p) { - var k1 = 'offsetWidth', - _k3 = 'offsetHeight'; - - if (['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP$1]) > -1) { - k1 = 'clientWidth'; - _k3 = 'clientHeight'; - } else if (['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP$1]) > -1) { - k1 = 'width'; - _k3 = 'height'; - } - - res[1] = p.map(function (item, i) { - var _item = _slicedToArray(item, 2), - v = _item[0], - u = _item[1]; - - if (u === PERCENT$6) { - if (i % 2 === 0) { - return [(parseFloat(v) || 0) * 0.01 * target[k1], PX$5]; - } else { - 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]; - } else if (u === VW$6) { - return [(parseFloat(v) || 0) * 0.01 * root.width, PX$5]; - } else if (u === VH$6) { - return [(parseFloat(v) || 0) * 0.01 * root.height, PX$5]; + else if (k === TRANSLATE_PATH && p) { + var k1 = 'offsetWidth', + _k3 = 'offsetHeight'; + + if (['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP$1]) > -1) { + k1 = 'clientWidth'; + _k3 = 'clientHeight'; + } else if (['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP$1]) > -1) { + k1 = 'width'; + _k3 = 'height'; + } + + res[1] = p.map(function (item, i) { + var _item = _slicedToArray(item, 2), + v = _item[0], + u = _item[1]; + + if (u === PERCENT$6) { + if (i % 2 === 0) { + return [(parseFloat(v) || 0) * 0.01 * target[k1], PX$6]; } else { - return [parseFloat(v) || 0, PX$5]; - } - }); - } // display等不能有增量过程的 - else { - return; + return [(parseFloat(v) || 0) * 0.01 * target[_k3], PX$6]; + } + } else if (u === REM$a) { + return [(parseFloat(v) || 0) * root.computedStyle[FONT_SIZE$a] * 100, PX$6]; + } else if (u === VW$a) { + return [(parseFloat(v) || 0) * 0.01 * root.width, PX$6]; + } else if (u === VH$a) { + return [(parseFloat(v) || 0) * 0.01 * root.height, PX$6]; + } else { + return [parseFloat(v) || 0, PX$6]; } + }); + } // display等不能有增量过程的 + else { + return; + } return res; } // 计算两帧之间不相同的变化,存入transition,相同的忽略 @@ -14864,7 +14868,7 @@ function getEasing(ea) { function calIntermediateStyle(frame, keys, percent, target) { - var style = cloneStyle$1(frame[FRAME_STYLE], keys); + var style = cloneStyle(frame[FRAME_STYLE], keys); var timingFunction = getEasing(frame[FRAME_EASING]); if (timingFunction && timingFunction !== linear) { @@ -14882,264 +14886,264 @@ function calIntermediateStyle(frame, keys, percent, target) { if (k === TRANSFORM$2) { if (!st) { - st = style[k] = [[MATRIX$2, mx.identity()]]; + st = style[k] = [[MATRIX$1, mx.identity()]]; } for (var _i15 = 0; _i15 < 16; _i15++) { st[0][1][_i15] += v[_i15] * percent; } } // 特殊的曲线运动计算,转换为translateXY,出现在最后一定会覆盖原本的translate防重 - else if (k === TRANSLATE_PATH$1) { - var t = 1 - percent; - - if (v.length === 8) { - style[TRANSLATE_X$3] = [v[0][0] * t * t * t + 3 * v[2][0] * percent * t * t + 3 * v[4][0] * percent * percent * t + v[6][0] * percent * percent * percent, PX$5]; - style[TRANSLATE_Y$3] = [v[1][0] * t * t * t + 3 * v[3][0] * percent * t * t + 3 * v[5][0] * percent * percent * t + v[7][0] * percent * percent * percent, PX$5]; - } else if (v.length === 6) { - style[TRANSLATE_X$3] = [v[0][0] * t * t + 2 * v[2][0] * percent * t + v[4][0] * percent * percent, PX$5]; - style[TRANSLATE_Y$3] = [v[1][0] * t * t + 3 * v[3][0] * percent * t + v[5][0] * percent * percent, PX$5]; - } - } else if (k === ROTATE_3D$2) { - st[0] += v[0] * percent; - st[1] += v[1] * percent; - st[2] += v[2] * percent; - st[3][0] += v[3][0] * percent; - } else if (NUM_CAL_HASH.hasOwnProperty(k)) { - if (v) { - st[0] += v * percent; - } - } else if (k === FILTER$2) { - // 只有1个样式声明了filter另外一个为空,会造成无样式,需初始化数组并在下面计算出样式存入 - if (!st) { - st = style[k] = []; - } // 将已有的样式按key存入引用来操作 + else if (k === TRANSLATE_PATH) { + var t = 1 - percent; + + if (v.length === 8) { + style[TRANSLATE_X$1] = [v[0][0] * t * t * t + 3 * v[2][0] * percent * t * t + 3 * v[4][0] * percent * percent * t + v[6][0] * percent * percent * percent, PX$6]; + style[TRANSLATE_Y$1] = [v[1][0] * t * t * t + 3 * v[3][0] * percent * t * t + 3 * v[5][0] * percent * percent * t + v[7][0] * percent * percent * percent, PX$6]; + } else if (v.length === 6) { + style[TRANSLATE_X$1] = [v[0][0] * t * t + 2 * v[2][0] * percent * t + v[4][0] * percent * percent, PX$6]; + style[TRANSLATE_Y$1] = [v[1][0] * t * t + 3 * v[3][0] * percent * t + v[5][0] * percent * percent, PX$6]; + } + } else if (k === ROTATE_3D$1) { + st[0] += v[0] * percent; + st[1] += v[1] * percent; + st[2] += v[2] * percent; + st[3][0] += v[3][0] * percent; + } else if (NUM_CAL_HASH.hasOwnProperty(k)) { + if (v) { + st[0] += v * percent; + } + } else if (k === FILTER$4) { + // 只有1个样式声明了filter另外一个为空,会造成无样式,需初始化数组并在下面计算出样式存入 + if (!st) { + st = style[k] = []; + } // 将已有的样式按key存入引用来操作 - var hash = {}; - st.forEach(function (item) { - hash[item[0]] = item[1]; - }); - Object.keys(v).forEach(function (k) { - if (hash.hasOwnProperty(k)) { - hash[k][0] += v[k][0] * percent; - } else { - // 2个关键帧中有1个未声明,需新建样式存入 - if (k === 'blur' || k === 'hue-rotate' || k === 'grayscale') { - var n = v[k].slice(0); - n[0] *= percent; - st.push([k, n]); - } // 默认值是1而非0 - else if (k === 'saturate' || k === 'brightness' || k === 'contrast') { - var _n = v[k].slice(0); - - _n[0] = 100 + _n[0] * percent; - st.push([k, _n]); - } + var hash = {}; + st.forEach(function (item) { + hash[item[0]] = item[1]; + }); + Object.keys(v).forEach(function (k) { + if (hash.hasOwnProperty(k)) { + hash[k][0] += v[k][0] * percent; + } else { + // 2个关键帧中有1个未声明,需新建样式存入 + if (k === 'blur' || k === 'hue-rotate' || k === 'grayscale') { + var n = v[k].slice(0); + n[0] *= percent; + st.push([k, n]); + } // 默认值是1而非0 + else if (k === 'saturate' || k === 'brightness' || k === 'contrast') { + var _n = v[k].slice(0); + + _n[0] = 100 + _n[0] * percent; + st.push([k, _n]); } - }); - } else if (RADIUS_HASH$2.hasOwnProperty(k)) { - for (var _i16 = 0; _i16 < 2; _i16++) { - st[_i16][0] += v[_i16] * percent; - } - } else if (k === TRANSFORM_ORIGIN$3 || k === PERSPECTIVE_ORIGIN$2) { - if (v[0] !== 0) { - st[0][0] += v[0] * percent; } + }); + } else if (RADIUS_HASH.hasOwnProperty(k)) { + for (var _i16 = 0; _i16 < 2; _i16++) { + st[_i16][0] += v[_i16] * percent; + } + } else if (k === TRANSFORM_ORIGIN$2 || k === PERSPECTIVE_ORIGIN$2) { + if (v[0] !== 0) { + st[0][0] += v[0] * percent; + } - if (v[1] !== 0) { - st[1][0] += v[1] * percent; - } - } else if (k === BOX_SHADOW$1) { - for (var _i17 = 0, _len8 = Math.min(st.length, v.length); _i17 < _len8; _i17++) { - // x/y/blur/spread - for (var j = 0; j < 4; j++) { - st[_i17][j] += v[_i17][j] * percent; - } // rgba + if (v[1] !== 0) { + st[1][0] += v[1] * percent; + } + } else if (k === BOX_SHADOW$8) { + for (var _i17 = 0, _len8 = Math.min(st.length, v.length); _i17 < _len8; _i17++) { + // x/y/blur/spread + for (var j = 0; j < 4; j++) { + st[_i17][j] += v[_i17][j] * percent; + } // rgba - for (var _j5 = 0; _j5 < 4; _j5++) { - st[_i17][4][_j5] += v[_i17][4][_j5] * percent; - } + for (var _j5 = 0; _j5 < 4; _j5++) { + st[_i17][4][_j5] += v[_i17][4][_j5] * percent; } - } else if (k === BACKGROUND_SIZE$1) { - st.forEach(function (item, i) { - if (v[i]) { - item[0][0] += v[i][0] * percent; - item[1][0] += v[i][1] * percent; - } - }); - } else if (k === BACKGROUND_POSITION_X$2 || k === BACKGROUND_POSITION_Y$2) { - st.forEach(function (item, i) { - if (v[i]) { - item[0] += v[i] * percent; - } - }); - } else if (GRADIENT_HASH$2.hasOwnProperty(k)) { - st.forEach(function (st2, i) { - var v2 = v[i]; + } + } else if (k === BACKGROUND_SIZE$1) { + st.forEach(function (item, i) { + if (v[i]) { + item[0][0] += v[i][0] * percent; + item[1][0] += v[i][1] * percent; + } + }); + } else if (k === BACKGROUND_POSITION_X$1 || k === BACKGROUND_POSITION_Y$1) { + st.forEach(function (item, i) { + if (v[i]) { + item[0] += v[i] * percent; + } + }); + } else if (GRADIENT_HASH.hasOwnProperty(k)) { + st.forEach(function (st2, i) { + var v2 = v[i]; - if (!v2) { - return; - } + if (!v2) { + return; + } - var _v16 = _slicedToArray(v2, 4), - c = _v16[0], - d = _v16[1], - p = _v16[2], - z = _v16[3]; + var _v16 = _slicedToArray(v2, 4), + c = _v16[0], + d = _v16[1], + p = _v16[2], + z = _v16[3]; - if (GRADIENT_TYPE$2.hasOwnProperty(st2.k)) { - for (var _i18 = 0, _len9 = Math.min(st2.v.length, c.length); _i18 < _len9; _i18++) { - var a = st2.v[_i18]; - var b = c[_i18]; - a[0][0] += b[0][0] * percent; - a[0][1] += b[0][1] * percent; - a[0][2] += b[0][2] * percent; - a[0][3] += b[0][3] * percent; + if (GRADIENT_TYPE.hasOwnProperty(st2.k)) { + for (var _i18 = 0, _len9 = Math.min(st2.v.length, c.length); _i18 < _len9; _i18++) { + var a = st2.v[_i18]; + var b = c[_i18]; + a[0][0] += b[0][0] * percent; + a[0][1] += b[0][1] * percent; + a[0][2] += b[0][2] * percent; + a[0][3] += b[0][3] * percent; - if (a[1] && b[1]) { - a[1][0] += b[1] * percent; - } + if (a[1] && b[1]) { + a[1][0] += b[1] * percent; } + } - if (st2.k === 'linear' && st2.d !== undefined && d !== undefined) { - if (Array.isArray(d)) { - st2.d[0] += d[0] * percent; - st2.d[1] += d[1] * percent; - st2.d[2] += d[2] * percent; - st2.d[3] += d[3] * percent; - } else { - st2.d += d * percent; - } + if (st2.k === 'linear' && st2.d !== undefined && d !== undefined) { + if (Array.isArray(d)) { + st2.d[0] += d[0] * percent; + st2.d[1] += d[1] * percent; + st2.d[2] += d[2] * percent; + st2.d[3] += d[3] * percent; + } else { + st2.d += d * percent; } + } - if (st2.k === 'radial') { - if (st2.z !== undefined && z !== undefined) { - st2.z[0] += z[0] * percent; - st2.z[1] += z[1] * percent; - st2.z[2] += z[2] * percent; - st2.z[3] += z[3] * percent; - st2.z[4] += z[4] * percent; - } else if (st2.p !== undefined && p !== undefined) { - st2.p[0][0] += p[0] * percent; - st2.p[1][0] += p[1] * percent; - } - } else if (st2.k === 'conic' && st2.d !== undefined && d !== undefined) { - st2.d += d * percent; + if (st2.k === 'radial') { + if (st2.z !== undefined && z !== undefined) { + st2.z[0] += z[0] * percent; + st2.z[1] += z[1] * percent; + st2.z[2] += z[2] * percent; + st2.z[3] += z[3] * percent; + st2.z[4] += z[4] * percent; + } else if (st2.p !== undefined && p !== undefined) { st2.p[0][0] += p[0] * percent; st2.p[1][0] += p[1] * percent; } - } // fill纯色 - else { - st2[0] += c[0] * percent; - st2[1] += c[1] * percent; - st2[2] += c[2] * percent; - st2[3] += c[3] * percent; - } - }); - } // color可能超限[0,255],但浏览器已经做了限制,无需关心 - else if (COLOR_HASH$2.hasOwnProperty(k)) { - st = st[0]; - st[0] += v[0] * percent; - st[1] += v[1] * percent; - st[2] += v[2] * percent; - st[3] += v[3] * percent; - } else if (GEOM$3.hasOwnProperty(k)) { - var _st = style[k]; - var tagName = target.tagName; - - if (GEOM$3[k][tagName] && isFunction$4(GEOM$3[k][tagName].calIncrease)) { - var fn = GEOM$3[k][tagName].calIncrease; - - if (target.isMulti) { - style[k] = _st.map(function (item, i) { - return fn(item, v[i], percent); - }); - } else { - style[k] = fn(_st, v, percent); - } - } else if (target.isMulti) { - if (k === 'points' || k === 'controls') { - for (var _i19 = 0, _len10 = Math.min(_st.length, v.length); _i19 < _len10; _i19++) { - var o = _st[_i19]; - var n = v[_i19]; - - if (!isNil$5(o) && !isNil$5(n)) { - for (var _j6 = 0, len2 = Math.min(o.length, n.length); _j6 < len2; _j6++) { - var o2 = o[_j6]; - var n2 = n[_j6]; - - if (!isNil$5(o2) && !isNil$5(n2)) { - for (var _k4 = 0, len3 = Math.min(o2.length, n2.length); _k4 < len3; _k4++) { - if (!isNil$5(o2[_k4]) && !isNil$5(n2[_k4])) { - o2[_k4] += n2[_k4] * percent; - } - } + } else if (st2.k === 'conic' && st2.d !== undefined && d !== undefined) { + st2.d += d * percent; + st2.p[0][0] += p[0] * percent; + st2.p[1][0] += p[1] * percent; + } + } // fill纯色 + else { + st2[0] += c[0] * percent; + st2[1] += c[1] * percent; + st2[2] += c[2] * percent; + st2[3] += c[3] * percent; + } + }); + } // color可能超限[0,255],但浏览器已经做了限制,无需关心 + else if (COLOR_HASH.hasOwnProperty(k)) { + st = st[0]; + st[0] += v[0] * percent; + st[1] += v[1] * percent; + st[2] += v[2] * percent; + st[3] += v[3] * percent; + } else if (GEOM$1.hasOwnProperty(k)) { + var _st = style[k]; + var tagName = target.tagName; + + if (GEOM$1[k][tagName] && isFunction$4(GEOM$1[k][tagName].calIncrease)) { + var fn = GEOM$1[k][tagName].calIncrease; + + if (target.isMulti) { + style[k] = _st.map(function (item, i) { + return fn(item, v[i], percent); + }); + } else { + style[k] = fn(_st, v, percent); + } + } else if (target.isMulti) { + if (k === 'points' || k === 'controls') { + for (var _i19 = 0, _len10 = Math.min(_st.length, v.length); _i19 < _len10; _i19++) { + var o = _st[_i19]; + var n = v[_i19]; + + if (!isNil$a(o) && !isNil$a(n)) { + for (var _j6 = 0, len2 = Math.min(o.length, n.length); _j6 < len2; _j6++) { + var o2 = o[_j6]; + var n2 = n[_j6]; + + if (!isNil$a(o2) && !isNil$a(n2)) { + for (var _k4 = 0, len3 = Math.min(o2.length, n2.length); _k4 < len3; _k4++) { + if (!isNil$a(o2[_k4]) && !isNil$a(n2[_k4])) { + o2[_k4] += n2[_k4] * percent; } } } } - } else if (k === 'controlA' || k === 'controlB') { - v.forEach(function (item, i) { - var st2 = _st[i]; + } + } + } else if (k === 'controlA' || k === 'controlB') { + v.forEach(function (item, i) { + var st2 = _st[i]; - if (!isNil$5(item) && !isNil$5(st2)) { - for (var _i20 = 0, _len11 = Math.min(st2.length, item.length); _i20 < _len11; _i20++) { - var _o = st2[_i20]; - var _n2 = item[_i20]; + if (!isNil$a(item) && !isNil$a(st2)) { + for (var _i20 = 0, _len11 = Math.min(st2.length, item.length); _i20 < _len11; _i20++) { + var _o = st2[_i20]; + var _n2 = item[_i20]; - if (!isNil$5(_o) && !isNil$5(_n2)) { - st2[_i20] += _n2 * percent; - } - } - } - }); - } else { - v.forEach(function (item, i) { - if (!isNil$5(item) && !isNil$5(_st[i])) { - _st[i] += item * percent; + if (!isNil$a(_o) && !isNil$a(_n2)) { + st2[_i20] += _n2 * percent; } - }); + } } - } else { - if (k === 'points' || k === 'controls') { - for (var _i21 = 0, _len12 = Math.min(_st.length, v.length); _i21 < _len12; _i21++) { - var _o2 = _st[_i21]; - var _n3 = v[_i21]; - - if (!isNil$5(_o2) && !isNil$5(_n3)) { - for (var _j7 = 0, _len13 = Math.min(_o2.length, _n3.length); _j7 < _len13; _j7++) { - if (!isNil$5(_o2[_j7]) && !isNil$5(_n3[_j7])) { - _o2[_j7] += _n3[_j7] * percent; - } - } + }); + } else { + v.forEach(function (item, i) { + if (!isNil$a(item) && !isNil$a(_st[i])) { + _st[i] += item * percent; + } + }); + } + } else { + if (k === 'points' || k === 'controls') { + for (var _i21 = 0, _len12 = Math.min(_st.length, v.length); _i21 < _len12; _i21++) { + var _o2 = _st[_i21]; + var _n3 = v[_i21]; + + if (!isNil$a(_o2) && !isNil$a(_n3)) { + for (var _j7 = 0, _len13 = Math.min(_o2.length, _n3.length); _j7 < _len13; _j7++) { + if (!isNil$a(_o2[_j7]) && !isNil$a(_n3[_j7])) { + _o2[_j7] += _n3[_j7] * percent; } } - } else if (k === 'controlA' || k === 'controlB') { - if (!isNil$5(_st[0]) && !isNil$5(v[0])) { - _st[0] += v[0] * percent; - } - - if (!isNil$5(_st[1]) && !isNil$5(v[1])) { - _st[1] += v[1] * percent; - } - } else { - if (!isNil$5(_st) && !isNil$5(v)) { - style[k] += v * percent; - } } } - } else if (k === OPACITY$2 || k === Z_INDEX$1) { - style[k] += v * percent; // 精度问题可能会超过[0,1]区间 + } else if (k === 'controlA' || k === 'controlB') { + if (!isNil$a(_st[0]) && !isNil$a(v[0])) { + _st[0] += v[0] * percent; + } - if (k === OPACITY$2) { - if (style[k] < 0) { - style[k] = 0; - } else if (style[k] > 1) { - style[k] = 1; - } + if (!isNil$a(_st[1]) && !isNil$a(v[1])) { + _st[1] += v[1] * percent; + } + } else { + if (!isNil$a(_st) && !isNil$a(v)) { + style[k] += v * percent; } } + } + } else if (k === OPACITY$3 || k === Z_INDEX$3) { + style[k] += v * percent; // 精度问题可能会超过[0,1]区间 + + if (k === OPACITY$3) { + if (style[k] < 0) { + style[k] = 0; + } else if (style[k] > 1) { + style[k] = 1; + } + } + } }; for (var i = 0, len = transition.length; i < len; i++) { @@ -15219,7 +15223,7 @@ var Animation = /*#__PURE__*/function (_Event) { _this = _super.call(this); _this.__id = uuid$1++; - list = clone$3(list || []); + list = clone$1(list || []); if (Array.isArray(list)) { list = list.filter(function (item) { @@ -15227,25 +15231,25 @@ var Animation = /*#__PURE__*/function (_Event) { }); } // 动画过程另外一种形式,object描述k-v形式 else if (list && isObject$1(list)) { - var nl = []; - Object.keys(list).forEach(function (k) { - var v = list[k]; - - if (Array.isArray(v)) { - for (var i = 0, len = v.length; i < len; i++) { - var o = nl[i] = nl[i] || { - offset: i / (len - 1) - }; - o[k] = v[i]; - } + var nl = []; + Object.keys(list).forEach(function (k) { + var v = list[k]; + + if (Array.isArray(v)) { + for (var i = 0, len = v.length; i < len; i++) { + var o = nl[i] = nl[i] || { + offset: i / (len - 1) + }; + o[k] = v[i]; } - }); - list = nl; - } else { - list = []; - } + } + }); + list = nl; + } else { + list = []; + } - if (isNumber$1(options)) { + if (isNumber(options)) { _this.__options = { duration: options }; @@ -15371,19 +15375,19 @@ var Animation = /*#__PURE__*/function (_Event) { return "continue"; } // <=前面的 else if (current.offset <= offset) { - list.splice(_i22, 1); - _i22--; - _len14--; - i = _i22; - len = _len14; - return "continue"; - } + list.splice(_i22, 1); + _i22--; + _len14--; + i = _i22; + len = _len14; + return "continue"; + } } // 缩写处理 Object.keys(current).forEach(function (k) { - if (abbr.hasOwnProperty(k)) { - abbr.toFull(current, k); + if (abbr$1.hasOwnProperty(k)) { + abbr$1.toFull(current, k); } }); // 检查key合法性 @@ -15404,23 +15408,23 @@ var Animation = /*#__PURE__*/function (_Event) { if (list.length === 1) { - list[0] = clone$3(list[0]); + list[0] = clone$1(list[0]); if (list[0].offset === 1) { list.unshift({ offset: 0 }); } else { - var copy = clone$3(list[0]); + var copy = clone$1(list[0]); copy.offset = 1; list.push(copy); } } // 强制clone防止同引用 else { - list.forEach(function (item, i) { - list[i] = clone$3(item); - }); - } // 首尾时间偏移强制为[0, 1],不是的话前后加空帧 + list.forEach(function (item, i) { + list[i] = clone$1(item); + }); + } // 首尾时间偏移强制为[0, 1],不是的话前后加空帧 var first = list[0]; @@ -15482,13 +15486,13 @@ var Animation = /*#__PURE__*/function (_Event) { var keys = unify(frames, target); inherit(frames, keys, target); - var framesR = clone$3(frames).reverse(); // 存储原本样式以便恢复用 + var framesR = clone$1(frames).reverse(); // 存储原本样式以便恢复用 var style = target.style, props = target.props; var originStyle = {}; keys.forEach(function (k) { - if (isGeom$2(tagName, k)) { + if (isGeom$1(tagName, k)) { originStyle[k] = props[k]; } @@ -15558,7 +15562,7 @@ var Animation = /*#__PURE__*/function (_Event) { if (restore) { keys.forEach(function (k) { - if (GEOM$3.hasOwnProperty(k)) { + if (GEOM$1.hasOwnProperty(k)) { if (target.__currentProps[k] === style[k]) { target.__currentProps[k] = target.props[k]; } @@ -15770,11 +15774,11 @@ var Animation = /*#__PURE__*/function (_Event) { if (isLastFrame) ; // 否则根据目前到下一帧的时间差,计算百分比,再反馈到变化数值上 else if (is2) { - percent = currentTime / duration; - } else { - var total = currentFrames[i + 1][FRAME_TIME] - frameTime; - percent = (currentTime - frameTime) / total; - } + percent = currentTime / duration; + } else { + var total = currentFrames[i + 1][FRAME_TIME] - frameTime; + percent = (currentTime - frameTime) / total; + } var inEndDelay, currentFrame = currentFrames[i], @@ -15797,11 +15801,11 @@ var Animation = /*#__PURE__*/function (_Event) { inEndDelay = currentTime < duration + endDelay; // 停留对比最后一帧,endDelay可能会多次进入这里,第二次进入样式相等不再重绘 if (stayEnd) { - current = cloneStyle$1(currentFrame[FRAME_STYLE], __config[I_KEYS]); + current = cloneStyle(currentFrame[FRAME_STYLE], __config[I_KEYS]); } // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里 else { - current = cloneStyle$1(__config[I_ORIGIN_STYLE], __config[I_KEYS]); - } // 进入endDelay或结束阶段触发end事件,注意只触发一次,防重在触发的地方做 + current = cloneStyle(__config[I_ORIGIN_STYLE], __config[I_KEYS]); + } // 进入endDelay或结束阶段触发end事件,注意只触发一次,防重在触发的地方做 __config[I_NEXT_END] = true; @@ -16077,13 +16081,13 @@ var Animation = /*#__PURE__*/function (_Event) { if (style.hasOwnProperty(i)) { var v = style[i]; // geom的属性变化 - if (GEOM$3.hasOwnProperty(i)) { + if (GEOM$1.hasOwnProperty(i)) { target.currentProps[i] = v; } // 样式 else { - // 将动画样式直接赋给currentStyle - target.currentStyle[i] = v; - } + // 将动画样式直接赋给currentStyle + target.currentStyle[i] = v; + } } }); } @@ -16555,10 +16559,10 @@ var Animation = /*#__PURE__*/function (_Event) { return Animation; }(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; +var NODE_DEFS_CACHE$4 = enums.NODE_KEY.NODE_DEFS_CACHE; +var int2rgba$2 = util.int2rgba; +var canvasPolygon$3 = painter.canvasPolygon, + svgPolygon$3 = painter.svgPolygon; function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) { var _data = _slicedToArray(data, 6), @@ -16569,7 +16573,7 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) { color = _data[4], inset = _data[5]; - var c = int2rgba$1(color); + var c = int2rgba$2(color); var n = Math.abs(sigma) * 2 + Math.abs(spread) * 2 + Math.abs(x) * 2 + Math.abs(y) * 2; // box本身坐标顺时针 var box = [[x1, y1], [x2, y1], [x2, y2], [x1, y2], [x1, y1]]; // 算上各种偏移/扩散的最外层坐标,且逆时针 @@ -16588,7 +16592,7 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) { var yb = y2 + y - spread; var spreadBox = [[xa, ya], [xb, ya], [xb, yb], [xa, yb]]; // 是否相交判断需要绘制 - var cross = geom.getRectsIntersection([box[0][0], box[0][1], box[2][0], box[2][1]], [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]); + var cross = geom$1.getRectsIntersection([box[0][0], box[0][1], box[2][0], box[2][1]], [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]); if (!cross) { return; @@ -16597,8 +16601,8 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) { cross = [[cross[0], cross[1]], [cross[2], cross[1]], [cross[2], cross[3]], [cross[0], cross[3]], [cross[0], cross[1]]]; // 扩散区域类似边框填充 if (spread) { - canvasPolygon$4(ctx, cross); - canvasPolygon$4(ctx, box.slice(0).reverse()); + canvasPolygon$3(ctx, cross); + canvasPolygon$3(ctx, box.slice(0).reverse()); ctx.clip(); ctx.closePath(); ctx.beginPath(); @@ -16607,13 +16611,13 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) { ctx.fillStyle = c; } - canvasPolygon$4(ctx, box); + canvasPolygon$3(ctx, box); ctx.fill(); ctx.closePath(); ctx.restore(); ctx.save(); ctx.beginPath(); - canvasPolygon$4(ctx, cross); + canvasPolygon$3(ctx, cross); ctx.clip(); ctx.closePath(); ctx.beginPath(); @@ -16625,9 +16629,9 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) { ctx.shadowColor = c; ctx.shadowBlur = sigma; // 画在外围的空心矩形,宽度要比blur大,n考虑了这一情况取了最大值 - canvasPolygon$4(ctx, [[xa, ya], [xb, ya], [xb, yb], [x1 - n, yb], [x1 - n, y2 + n], [x2 + n, y2 + n], [x2 + n, y1 - n], [x1 - n, y1 - n], [x1 - n, yb], [xa, yb], [xa, ya]]); + canvasPolygon$3(ctx, [[xa, ya], [xb, ya], [xb, yb], [x1 - n, yb], [x1 - n, y2 + n], [x2 + n, y2 + n], [x2 + n, y1 - n], [x1 - n, y1 - n], [x1 - n, yb], [xa, yb], [xa, ya]]); } else { - canvasPolygon$4(ctx, box); + canvasPolygon$3(ctx, box); ctx.clip(); ctx.closePath(); ctx.beginPath(); @@ -16640,78 +16644,78 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) { ctx.shadowOffsetY = y; ctx.shadowColor = c; ctx.shadowBlur = sigma; - canvasPolygon$4(ctx, [[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]]); + canvasPolygon$3(ctx, [[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]]); } } // outset需裁减掉box本身的内容,clip()非零环绕显示box外的阴影内容,fill()绘制在内无效 else { - var _xa = x1 + x - spread; - - var _ya = y1 + y - spread; + var _xa = x1 + x - spread; - var _xb = x2 + x + spread; + var _ya = y1 + y - spread; - var _yb = y2 + y + spread; + var _xb = x2 + x + spread; - var blurBox = [[_xa, _ya], [_xb, _ya], [_xb, _yb], [_xa, _yb]]; + var _yb = y2 + y + spread; - var _cross = geom.getRectsIntersection([box[0][0], box[0][1], box[2][0], box[2][1]], [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]); // 分为是否有spread,因模糊成本spread区域将没有模糊 + var blurBox = [[_xa, _ya], [_xb, _ya], [_xb, _yb], [_xa, _yb]]; + var _cross = geom$1.getRectsIntersection([box[0][0], box[0][1], box[2][0], box[2][1]], [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]); // 分为是否有spread,因模糊成本spread区域将没有模糊 - if (spread) { - // 扩散区域类似边框填充 - canvasPolygon$4(ctx, box); - canvasPolygon$4(ctx, blurBox.slice(0).reverse()); - ctx.clip(); - ctx.closePath(); - ctx.beginPath(); - if (ctx.fillStyle !== c) { - ctx.fillStyle = c; - } + if (spread) { + // 扩散区域类似边框填充 + canvasPolygon$3(ctx, box); + canvasPolygon$3(ctx, blurBox.slice(0).reverse()); + ctx.clip(); + ctx.closePath(); + ctx.beginPath(); - canvasPolygon$4(ctx, blurBox); - ctx.fill(); - ctx.closePath(); - ctx.restore(); - ctx.save(); - ctx.beginPath(); // 阴影部分看相交情况裁剪,有相交时逆时针绘制相交区域即可排除之 + if (ctx.fillStyle !== c) { + ctx.fillStyle = c; + } - if (_cross) { - canvasPolygon$4(ctx, [[_cross[0], _cross[1]], [_cross[2], _cross[1]], [_cross[2], _cross[3]], [_cross[0], _cross[3]], [_cross[0], _cross[1]]].reverse()); - } + canvasPolygon$3(ctx, blurBox); + ctx.fill(); + ctx.closePath(); + ctx.restore(); + ctx.save(); + ctx.beginPath(); // 阴影部分看相交情况裁剪,有相交时逆时针绘制相交区域即可排除之 - canvasPolygon$4(ctx, box); - canvasPolygon$4(ctx, blurBox); - canvasPolygon$4(ctx, outer); - ctx.clip(); - ctx.closePath(); - ctx.beginPath(); + if (_cross) { + canvasPolygon$3(ctx, [[_cross[0], _cross[1]], [_cross[2], _cross[1]], [_cross[2], _cross[3]], [_cross[0], _cross[3]], [_cross[0], _cross[1]]].reverse()); + } - if (ctx.fillStyle !== '#FFF') { - ctx.fillStyle = '#FFF'; - } + canvasPolygon$3(ctx, box); + canvasPolygon$3(ctx, blurBox); + canvasPolygon$3(ctx, outer); + ctx.clip(); + ctx.closePath(); + ctx.beginPath(); - ctx.shadowColor = c; - ctx.shadowBlur = sigma; - canvasPolygon$4(ctx, blurBox); - } else { - canvasPolygon$4(ctx, box); - canvasPolygon$4(ctx, outer); - ctx.clip(); - ctx.closePath(); - ctx.beginPath(); + if (ctx.fillStyle !== '#FFF') { + ctx.fillStyle = '#FFF'; + } - if (ctx.fillStyle !== '#FFF') { - ctx.fillStyle = '#FFF'; - } + ctx.shadowColor = c; + ctx.shadowBlur = sigma; + canvasPolygon$3(ctx, blurBox); + } else { + canvasPolygon$3(ctx, box); + canvasPolygon$3(ctx, outer); + ctx.clip(); + ctx.closePath(); + ctx.beginPath(); - ctx.shadowOffsetX = x; - ctx.shadowOffsetY = y; - ctx.shadowColor = c; - ctx.shadowBlur = sigma; - canvasPolygon$4(ctx, box); + if (ctx.fillStyle !== '#FFF') { + ctx.fillStyle = '#FFF'; } + + ctx.shadowOffsetX = x; + ctx.shadowOffsetY = y; + ctx.shadowColor = c; + ctx.shadowBlur = sigma; + canvasPolygon$3(ctx, box); } + } ctx.fill(); ctx.closePath(); @@ -16730,7 +16734,7 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) { var _spreadBox = [[_xa2, _ya2], [_xb2, _ya2], [_xb2, _yb2], [_xa2, _yb2]]; - var _cross2 = geom.getRectsIntersection([box[0][0], box[0][1], box[2][0], box[2][1]], [_spreadBox[0][0], _spreadBox[0][1], _spreadBox[2][0], _spreadBox[2][1]]); + var _cross2 = geom$1.getRectsIntersection([box[0][0], box[0][1], box[2][0], box[2][1]], [_spreadBox[0][0], _spreadBox[0][1], _spreadBox[2][0], _spreadBox[2][1]]); if (!_cross2) { return; @@ -16748,40 +16752,40 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) { }] }; - xom.__config[NODE_DEFS_CACHE$2].push(v); + xom.__config[NODE_DEFS_CACHE$4].push(v); var filter = ctx.add(v); var v2 = { 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); - xom.__config[NODE_DEFS_CACHE$2].push(v2); + xom.__config[NODE_DEFS_CACHE$4].push(v2); 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); - xom.__config[NODE_DEFS_CACHE$2].push(v); + xom.__config[NODE_DEFS_CACHE$4].push(v); 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 = { @@ -16795,24 +16799,24 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) { var _filter = ctx.add(_v); - xom.__config[NODE_DEFS_CACHE$2].push(_v); + xom.__config[NODE_DEFS_CACHE$4].push(_v); _v = { tagName: 'clipPath', children: [{ tagName: 'path', - props: [['d', svgPolygon$4(box)], ['fill', '#FFF']] + props: [['d', svgPolygon$3(box)], ['fill', '#FFF']] }] }; var _clip = ctx.add(_v); - xom.__config[NODE_DEFS_CACHE$2].push(_v); + xom.__config[NODE_DEFS_CACHE$4].push(_v); 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 { @@ -16826,7 +16830,7 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) { var _blurBox = [[_xa3, _ya3], [_xb3, _ya3], [_xb3, _yb3], [_xa3, _yb3]]; - var _cross3 = geom.getRectsIntersection([box[0][0], box[0][1], box[2][0], box[2][1]], [_blurBox[0][0], _blurBox[0][1], _blurBox[2][0], _blurBox[2][1]]); + var _cross3 = geom$1.getRectsIntersection([box[0][0], box[0][1], box[2][0], box[2][1]], [_blurBox[0][0], _blurBox[0][1], _blurBox[2][0], _blurBox[2][1]]); if (spread) { var _v2 = { @@ -16840,40 +16844,40 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) { var _filter2 = ctx.add(_v2); - xom.__config[NODE_DEFS_CACHE$2].push(_v2); + xom.__config[NODE_DEFS_CACHE$4].push(_v2); _v2 = { 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']] }] }; var _clip2 = ctx.add(_v2); - xom.__config[NODE_DEFS_CACHE$2].push(_v2); + xom.__config[NODE_DEFS_CACHE$4].push(_v2); 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); - xom.__config[NODE_DEFS_CACHE$2].push(_v2); + xom.__config[NODE_DEFS_CACHE$4].push(_v2); 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 = { @@ -16887,24 +16891,24 @@ function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) { var _filter3 = ctx.add(_v3); - xom.__config[NODE_DEFS_CACHE$2].push(_v3); + xom.__config[NODE_DEFS_CACHE$4].push(_v3); _v3 = { 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']] }] }; var _clip3 = ctx.add(_v3); - xom.__config[NODE_DEFS_CACHE$2].push(_v3); + xom.__config[NODE_DEFS_CACHE$4].push(_v3); 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 + ')']] }); } } @@ -16934,7 +16938,7 @@ var MBM_HASH = { luminosity: true }; -function mbmName(v) { +function mbmName$2(v) { if (v) { return v.replace(/[A-Z]/, function ($0) { return '-' + $0.toLowerCase(); @@ -16942,22 +16946,22 @@ function mbmName(v) { } } -function isValidMbm(v) { - return MBM_HASH.hasOwnProperty(mbmName(v)); +function isValidMbm$2(v) { + return MBM_HASH.hasOwnProperty(mbmName$2(v)); } var mbm = { - mbmName: mbmName, - isValidMbm: isValidMbm + mbmName: mbmName$2, + isValidMbm: isValidMbm$2 }; -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; +var _enums$STYLE_KEY$e = enums.STYLE_KEY, + MARGIN_LEFT$6 = _enums$STYLE_KEY$e.MARGIN_LEFT, + MARGIN_RIGHT$5 = _enums$STYLE_KEY$e.MARGIN_RIGHT, + PADDING_LEFT$6 = _enums$STYLE_KEY$e.PADDING_LEFT, + PADDING_RIGHT$5 = _enums$STYLE_KEY$e.PADDING_RIGHT, + BORDER_LEFT_WIDTH$6 = _enums$STYLE_KEY$e.BORDER_LEFT_WIDTH, + BORDER_RIGHT_WIDTH$5 = _enums$STYLE_KEY$e.BORDER_RIGHT_WIDTH; /** * 获取inline的每一行内容的矩形坐标4个点,同时附带上border的矩形,比前面4个点尺寸大或相等(有无border/padding) * @param xom @@ -17009,9 +17013,9 @@ function getInlineBox(xom, contentBoxList, start, end, lineBox, baseLine, lineHe 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]; + marginLeft = _dom$computedStyle[MARGIN_LEFT$6], + _paddingLeft = _dom$computedStyle[PADDING_LEFT$6], + _borderLeftWidth = _dom$computedStyle[BORDER_LEFT_WIDTH$6]; x1 -= marginLeft + _paddingLeft + _borderLeftWidth; } @@ -17041,9 +17045,9 @@ function getInlineBox(xom, contentBoxList, start, end, lineBox, baseLine, lineHe 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]; + marginRight = _dom$computedStyle2[MARGIN_RIGHT$5], + _paddingRight = _dom$computedStyle2[PADDING_RIGHT$5], + _borderRightWidth = _dom$computedStyle2[BORDER_RIGHT_WIDTH$5]; x2 += marginRight + _paddingRight + _borderRightWidth; } @@ -17098,17 +17102,17 @@ function getInlineWidth(xom, 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]; + marginLeft = _dom$computedStyle3[MARGIN_LEFT$6], + paddingLeft = _dom$computedStyle3[PADDING_LEFT$6], + borderLeftWidth = _dom$computedStyle3[BORDER_LEFT_WIDTH$6]; 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]; + marginRight = _dom$computedStyle4[MARGIN_RIGHT$5], + paddingRight = _dom$computedStyle4[PADDING_RIGHT$5], + borderRightWidth = _dom$computedStyle4[BORDER_RIGHT_WIDTH$5]; sum += marginRight + paddingRight + borderRightWidth; } @@ -17124,151 +17128,151 @@ var inline = { getInlineWidth: getInlineWidth }; -var svgPolygon$5 = painter.svgPolygon; -var CANVAS$1 = mode.CANVAS, +var svgPolygon$2 = painter.svgPolygon; +var CANVAS = mode.CANVAS, SVG = mode.SVG, - WEBGL$1 = mode.WEBGL; -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$3 = _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$3 = _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$UPDATE_KEY$2 = enums.UPDATE_KEY, - UPDATE_NODE$2 = _enums$UPDATE_KEY$2.UPDATE_NODE, - UPDATE_FOCUS$1 = _enums$UPDATE_KEY$2.UPDATE_FOCUS, - UPDATE_STYLE$1 = _enums$UPDATE_KEY$2.UPDATE_STYLE, - UPDATE_OVERWRITE = _enums$UPDATE_KEY$2.UPDATE_OVERWRITE, - UPDATE_KEYS$1 = _enums$UPDATE_KEY$2.UPDATE_KEYS, - UPDATE_CONFIG$2 = _enums$UPDATE_KEY$2.UPDATE_CONFIG, - UPDATE_REMOVE_DOM = _enums$UPDATE_KEY$2.UPDATE_REMOVE_DOM, - STRUCT_HAS_MASK = enums.STRUCT_KEY.STRUCT_HAS_MASK, - _enums$NODE_KEY$4 = enums.NODE_KEY, - NODE_TAG_NAME = _enums$NODE_KEY$4.NODE_TAG_NAME, - NODE_CACHE_STYLE = _enums$NODE_KEY$4.NODE_CACHE_STYLE, - NODE_CURRENT_STYLE$1 = _enums$NODE_KEY$4.NODE_CURRENT_STYLE, - NODE_COMPUTED_STYLE$2 = _enums$NODE_KEY$4.NODE_COMPUTED_STYLE, - NODE_STYLE$1 = _enums$NODE_KEY$4.NODE_STYLE, - NODE_STRUCT$1 = _enums$NODE_KEY$4.NODE_STRUCT, - NODE_OPACITY$2 = _enums$NODE_KEY$4.NODE_OPACITY, - NODE_MATRIX_EVENT$2 = _enums$NODE_KEY$4.NODE_MATRIX_EVENT, - NODE_MATRIX$1 = _enums$NODE_KEY$4.NODE_MATRIX, - NODE_LIMIT_CACHE$1 = _enums$NODE_KEY$4.NODE_LIMIT_CACHE, - NODE_HAS_CONTENT$1 = _enums$NODE_KEY$4.NODE_HAS_CONTENT, - NODE_REFRESH_LV = _enums$NODE_KEY$4.NODE_REFRESH_LV, - NODE_CACHE$2 = _enums$NODE_KEY$4.NODE_CACHE, - NODE_CACHE_TOTAL = _enums$NODE_KEY$4.NODE_CACHE_TOTAL, - NODE_CACHE_FILTER$1 = _enums$NODE_KEY$4.NODE_CACHE_FILTER, - NODE_CACHE_MASK = _enums$NODE_KEY$4.NODE_CACHE_MASK, - NODE_CACHE_OVERFLOW$1 = _enums$NODE_KEY$4.NODE_CACHE_OVERFLOW, - NODE_IS_DESTROYED$1 = _enums$NODE_KEY$4.NODE_IS_DESTROYED, - NODE_DEFS_CACHE$3 = _enums$NODE_KEY$4.NODE_DEFS_CACHE, - NODE_DOM_PARENT$2 = _enums$NODE_KEY$4.NODE_DOM_PARENT, - NODE_IS_INLINE = _enums$NODE_KEY$4.NODE_IS_INLINE, - NODE_PERSPECTIVE_MATRIX = _enums$NODE_KEY$4.NODE_PERSPECTIVE_MATRIX, - NODE_IS_MASK = _enums$NODE_KEY$4.NODE_IS_MASK, - NODE_VIRTUAL_DOM$1 = _enums$NODE_KEY$4.NODE_VIRTUAL_DOM; -var AUTO$4 = o.AUTO, - PX$6 = o.PX, - PERCENT$7 = o.PERCENT, - INHERIT$4 = o.INHERIT, - NUMBER$5 = o.NUMBER, - REM$7 = o.REM, - VW$7 = o.VW, - VH$7 = o.VH, - DEG$2 = o.DEG; -var int2rgba$2 = util.int2rgba, - rgba2int$3 = util.rgba2int, - joinArr$2 = util.joinArr, - isNil$6 = util.isNil; -var calRelative$1 = css.calRelative; -var GEOM$4 = o$2.GEOM; + WEBGL = mode.WEBGL; +var STYLE_KEY = enums.STYLE_KEY, + STYLE_RV_KEY = enums.STYLE_RV_KEY, + style2Upper = enums.style2Upper, + _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$5 = _enums$STYLE_KEY$d.PADDING_LEFT, + PADDING_RIGHT$4 = _enums$STYLE_KEY$d.PADDING_RIGHT, + PADDING_TOP$4 = _enums$STYLE_KEY$d.PADDING_TOP, + PADDING_BOTTOM$4 = _enums$STYLE_KEY$d.PADDING_BOTTOM, + MARGIN_LEFT$5 = _enums$STYLE_KEY$d.MARGIN_LEFT, + MARGIN_TOP$4 = _enums$STYLE_KEY$d.MARGIN_TOP, + MARGIN_BOTTOM$4 = _enums$STYLE_KEY$d.MARGIN_BOTTOM, + MARGIN_RIGHT$4 = _enums$STYLE_KEY$d.MARGIN_RIGHT, + BORDER_LEFT_WIDTH$5 = _enums$STYLE_KEY$d.BORDER_LEFT_WIDTH, + BORDER_TOP_WIDTH$4 = _enums$STYLE_KEY$d.BORDER_TOP_WIDTH, + BORDER_BOTTOM_WIDTH$4 = _enums$STYLE_KEY$d.BORDER_BOTTOM_WIDTH, + BORDER_RIGHT_WIDTH$4 = _enums$STYLE_KEY$d.BORDER_RIGHT_WIDTH, + TOP$3 = _enums$STYLE_KEY$d.TOP, + RIGHT$2 = _enums$STYLE_KEY$d.RIGHT, + BOTTOM$3 = _enums$STYLE_KEY$d.BOTTOM, + LEFT$2 = _enums$STYLE_KEY$d.LEFT, + POSITION$4 = _enums$STYLE_KEY$d.POSITION, + DISPLAY$7 = _enums$STYLE_KEY$d.DISPLAY, + WIDTH$4 = _enums$STYLE_KEY$d.WIDTH, + HEIGHT$5 = _enums$STYLE_KEY$d.HEIGHT, + MATRIX = _enums$STYLE_KEY$d.MATRIX, + TRANSLATE_X = _enums$STYLE_KEY$d.TRANSLATE_X, + TRANSLATE_Y = _enums$STYLE_KEY$d.TRANSLATE_Y, + TRANSLATE_Z = _enums$STYLE_KEY$d.TRANSLATE_Z, + TRANSFORM$1 = _enums$STYLE_KEY$d.TRANSFORM, + SCALE_X = _enums$STYLE_KEY$d.SCALE_X, + SCALE_Y = _enums$STYLE_KEY$d.SCALE_Y, + SCALE_Z = _enums$STYLE_KEY$d.SCALE_Z, + ROTATE_X = _enums$STYLE_KEY$d.ROTATE_X, + ROTATE_Y = _enums$STYLE_KEY$d.ROTATE_Y, + ROTATE_Z = _enums$STYLE_KEY$d.ROTATE_Z, + SKEW_X = _enums$STYLE_KEY$d.SKEW_X, + SKEW_Y = _enums$STYLE_KEY$d.SKEW_Y, + PERSPECTIVE$2 = _enums$STYLE_KEY$d.PERSPECTIVE, + PERSPECTIVE_ORIGIN$1 = _enums$STYLE_KEY$d.PERSPECTIVE_ORIGIN, + ROTATE_3D = _enums$STYLE_KEY$d.ROTATE_3D, + TRANSFORM_ORIGIN$1 = _enums$STYLE_KEY$d.TRANSFORM_ORIGIN, + BACKGROUND_POSITION_X = _enums$STYLE_KEY$d.BACKGROUND_POSITION_X, + BACKGROUND_POSITION_Y = _enums$STYLE_KEY$d.BACKGROUND_POSITION_Y, + BACKGROUND_SIZE = _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$7 = _enums$STYLE_KEY$d.BOX_SHADOW, + OPACITY$2 = _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$3 = _enums$STYLE_KEY$d.MIX_BLEND_MODE, + TEXT_OVERFLOW = _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 = _enums$STYLE_KEY$d.FONT_STYLE, + COLOR$1 = _enums$STYLE_KEY$d.COLOR, + VISIBILITY$4 = _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 = _enums$STYLE_KEY$d.BACKGROUND_CLIP, + FONT_SIZE$9 = _enums$STYLE_KEY$d.FONT_SIZE, + FONT_FAMILY = _enums$STYLE_KEY$d.FONT_FAMILY, + LINE_HEIGHT$1 = _enums$STYLE_KEY$d.LINE_HEIGHT, + TEXT_STROKE_COLOR = _enums$STYLE_KEY$d.TEXT_STROKE_COLOR, + TEXT_STROKE_WIDTH = _enums$STYLE_KEY$d.TEXT_STROKE_WIDTH, + TEXT_STROKE_OVER = _enums$STYLE_KEY$d.TEXT_STROKE_OVER, + _enums$UPDATE_KEY$3 = enums.UPDATE_KEY, + UPDATE_NODE$3 = _enums$UPDATE_KEY$3.UPDATE_NODE, + UPDATE_FOCUS$3 = _enums$UPDATE_KEY$3.UPDATE_FOCUS, + UPDATE_STYLE$1 = _enums$UPDATE_KEY$3.UPDATE_STYLE, + UPDATE_OVERWRITE$1 = _enums$UPDATE_KEY$3.UPDATE_OVERWRITE, + UPDATE_KEYS$1 = _enums$UPDATE_KEY$3.UPDATE_KEYS, + UPDATE_CONFIG$3 = _enums$UPDATE_KEY$3.UPDATE_CONFIG, + UPDATE_REMOVE_DOM$1 = _enums$UPDATE_KEY$3.UPDATE_REMOVE_DOM, + STRUCT_HAS_MASK$1 = enums.STRUCT_KEY.STRUCT_HAS_MASK, + _enums$NODE_KEY$6 = enums.NODE_KEY, + NODE_TAG_NAME$1 = _enums$NODE_KEY$6.NODE_TAG_NAME, + NODE_CACHE_STYLE$2 = _enums$NODE_KEY$6.NODE_CACHE_STYLE, + NODE_CURRENT_STYLE$5 = _enums$NODE_KEY$6.NODE_CURRENT_STYLE, + NODE_COMPUTED_STYLE$3 = _enums$NODE_KEY$6.NODE_COMPUTED_STYLE, + NODE_STYLE$4 = _enums$NODE_KEY$6.NODE_STYLE, + NODE_STRUCT$3 = _enums$NODE_KEY$6.NODE_STRUCT, + NODE_OPACITY$1 = _enums$NODE_KEY$6.NODE_OPACITY, + NODE_MATRIX_EVENT$2 = _enums$NODE_KEY$6.NODE_MATRIX_EVENT, + NODE_MATRIX$2 = _enums$NODE_KEY$6.NODE_MATRIX, + NODE_LIMIT_CACHE$1 = _enums$NODE_KEY$6.NODE_LIMIT_CACHE, + NODE_HAS_CONTENT = _enums$NODE_KEY$6.NODE_HAS_CONTENT, + NODE_REFRESH_LV$2 = _enums$NODE_KEY$6.NODE_REFRESH_LV, + NODE_CACHE$3 = _enums$NODE_KEY$6.NODE_CACHE, + NODE_CACHE_TOTAL$2 = _enums$NODE_KEY$6.NODE_CACHE_TOTAL, + NODE_CACHE_FILTER$2 = _enums$NODE_KEY$6.NODE_CACHE_FILTER, + NODE_CACHE_MASK$2 = _enums$NODE_KEY$6.NODE_CACHE_MASK, + NODE_CACHE_OVERFLOW$2 = _enums$NODE_KEY$6.NODE_CACHE_OVERFLOW, + NODE_IS_DESTROYED$1 = _enums$NODE_KEY$6.NODE_IS_DESTROYED, + NODE_DEFS_CACHE$3 = _enums$NODE_KEY$6.NODE_DEFS_CACHE, + NODE_DOM_PARENT$4 = _enums$NODE_KEY$6.NODE_DOM_PARENT, + NODE_IS_INLINE$1 = _enums$NODE_KEY$6.NODE_IS_INLINE, + NODE_PERSPECTIVE_MATRIX$1 = _enums$NODE_KEY$6.NODE_PERSPECTIVE_MATRIX, + NODE_IS_MASK$3 = _enums$NODE_KEY$6.NODE_IS_MASK, + NODE_VIRTUAL_DOM$1 = _enums$NODE_KEY$6.NODE_VIRTUAL_DOM; +var AUTO$4 = o$4.AUTO, + PX$5 = o$4.PX, + PERCENT$5 = o$4.PERCENT, + INHERIT$1 = o$4.INHERIT, + NUMBER = o$4.NUMBER, + REM$9 = o$4.REM, + VW$9 = o$4.VW, + VH$9 = o$4.VH, + DEG = o$4.DEG; +var int2rgba$1 = util.int2rgba, + rgba2int = util.rgba2int, + joinArr$1 = util.joinArr, + isNil$9 = util.isNil; +var calRelative = css.calRelative; +var GEOM = o$2.GEOM; var mbmName$1 = mbm.mbmName, isValidMbm$1 = mbm.isValidMbm; -var point2d$1 = mx.point2d; -var contain = o$3.contain, - NONE = o$3.NONE, - TF = o$3.TRANSFORM, - REFLOW = o$3.REFLOW, - REPAINT$1 = o$3.REPAINT, - TX = o$3.TRANSLATE_X, - TY = o$3.TRANSLATE_Y, - TZ = o$3.TRANSLATE_Z; +var point2d = mx.point2d; +var contain$3 = o$1.contain, + NONE$3 = o$1.NONE, + TF = o$1.TRANSFORM, + REFLOW$2 = o$1.REFLOW, + REPAINT$2 = o$1.REPAINT, + TX = o$1.TRANSLATE_X, + TY = o$1.TRANSLATE_Y, + TZ = o$1.TRANSLATE_Z; function getFirstEmptyInlineWidth(xom) { var n = 0; @@ -17278,11 +17282,11 @@ function getFirstEmptyInlineWidth(xom) { for (var i = 0; i < length; i++) { var child = flowChildren[i]; - if (child instanceof Xom$1 || child instanceof Component$1 && child.shadowRoot instanceof Xom$1) { + if (child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) { if (child.flowChildren.length) { n += getFirstEmptyInlineWidth(child); break; - } else if (child.__config[NODE_IS_INLINE]) { + } else if (child.__config[NODE_IS_INLINE$1]) { n += child.outerWidth; } } else { @@ -17301,7 +17305,7 @@ function getLastEmptyInlineWidth(xom) { for (var i = length - 1; i >= 0; i--) { var child = flowChildren[i]; - if (child instanceof Xom$1 || child instanceof Component$1 && child.shadowRoot instanceof Xom$1) { + if (child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) { if (child.flowChildren.length) { n += getLastEmptyInlineWidth(child); break; @@ -17316,7 +17320,7 @@ function getLastEmptyInlineWidth(xom) { return n; } -var Xom$1 = /*#__PURE__*/function (_Node) { +var Xom = /*#__PURE__*/function (_Node) { _inherits(Xom, _Node); var _super = _createSuper(Xom); @@ -17364,16 +17368,16 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var isClip = _this.__isClip = !!_this.props.clip; var isMask = _this.__isMask = isClip || !!_this.props.mask; var config = _this.__config; - config[NODE_TAG_NAME] = tagName; - config[NODE_CACHE_STYLE] = _this.__cacheStyle; - config[NODE_CURRENT_STYLE$1] = _this.__currentStyle; - config[NODE_COMPUTED_STYLE$2] = _this.__computedStyle; - config[NODE_REFRESH_LV] = REFLOW; - config[NODE_STYLE$1] = _this.__style; - config[NODE_MATRIX$1] = []; + config[NODE_TAG_NAME$1] = tagName; + config[NODE_CACHE_STYLE$2] = _this.__cacheStyle; + config[NODE_CURRENT_STYLE$5] = _this.__currentStyle; + config[NODE_COMPUTED_STYLE$3] = _this.__computedStyle; + config[NODE_REFRESH_LV$2] = REFLOW$2; + config[NODE_STYLE$4] = _this.__style; + config[NODE_MATRIX$2] = []; config[NODE_MATRIX_EVENT$2] = []; config[NODE_DEFS_CACHE$3] = _this.__cacheDefs; - config[NODE_IS_MASK] = isMask; + config[NODE_IS_MASK$3] = isMask; _this.__frameAnimateList = []; _this.__contentBoxList = []; // inline存储内容用 // this.__json domApi需要获取生成时的json引用,builder过程添加,如appendChild时json也需要跟着变更 @@ -17387,10 +17391,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var res = _get(_getPrototypeOf(Xom.prototype), "__structure", this).call(this, i, lv, j); if (this.__hasMask) { - res[STRUCT_HAS_MASK] = this.__hasMask; + res[STRUCT_HAS_MASK$1] = this.__hasMask; } - this.__config[NODE_STRUCT$1] = res; + this.__config[NODE_STRUCT$3] = res; return res; } // 设置margin/padding的实际值,layout时执行,inline的垂直方向仍然计算值,但在布局时被忽略 @@ -17400,8 +17404,8 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var _this2 = this; ['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)]; + var a = STYLE_KEY[style2Upper('margin' + k)]; + var b = STYLE_KEY[style2Upper('padding' + k)]; computedStyle[a] = _this2.__mpWidth(currentStyle[a], w); computedStyle[b] = _this2.__mpWidth(currentStyle[b], w); }); @@ -17409,15 +17413,15 @@ var Xom$1 = /*#__PURE__*/function (_Node) { }, { key: "__mpWidth", value: function __mpWidth(mp, w) { - if (mp[1] === PX$6) { + if (mp[1] === PX$5) { return mp[0]; - } else if (mp[1] === PERCENT$7) { + } else if (mp[1] === PERCENT$5) { return mp[0] * w * 0.01; - } else if (mp[1] === REM$7) { - return mp[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (mp[1] === VW$7) { + } else if (mp[1] === REM$9) { + return mp[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (mp[1] === VW$9) { return mp[0] * this.root.width * 0.01; - } else if (mp[1] === VH$7) { + } else if (mp[1] === VH$9) { return mp[0] * this.root.height * 0.01; } @@ -17428,12 +17432,12 @@ var Xom$1 = /*#__PURE__*/function (_Node) { key: "__ioSize", value: function __ioSize(w, h) { var computedStyle = this.computedStyle; - this.__clientWidth = w += computedStyle[PADDING_LEFT$2] + computedStyle[PADDING_RIGHT$1]; - this.__clientHeight = h += computedStyle[PADDING_TOP$1] + computedStyle[PADDING_BOTTOM$1]; - this.__offsetWidth = w += computedStyle[BORDER_LEFT_WIDTH$3] + computedStyle[BORDER_RIGHT_WIDTH$2]; - this.__offsetHeight = h += computedStyle[BORDER_TOP_WIDTH$2] + computedStyle[BORDER_BOTTOM_WIDTH$2]; - this.__outerWidth = w + computedStyle[MARGIN_LEFT$1] + computedStyle[MARGIN_RIGHT$1]; - this.__outerHeight = h + computedStyle[MARGIN_TOP] + computedStyle[MARGIN_BOTTOM]; + this.__clientWidth = w += computedStyle[PADDING_LEFT$5] + computedStyle[PADDING_RIGHT$4]; + this.__clientHeight = h += computedStyle[PADDING_TOP$4] + computedStyle[PADDING_BOTTOM$4]; + this.__offsetWidth = w += computedStyle[BORDER_LEFT_WIDTH$5] + computedStyle[BORDER_RIGHT_WIDTH$4]; + this.__offsetHeight = h += computedStyle[BORDER_TOP_WIDTH$4] + computedStyle[BORDER_BOTTOM_WIDTH$4]; + this.__outerWidth = w + computedStyle[MARGIN_LEFT$5] + computedStyle[MARGIN_RIGHT$4]; + this.__outerHeight = h + computedStyle[MARGIN_TOP$4] + computedStyle[MARGIN_BOTTOM$4]; } // 换算margin/padding为px单位,onlyFixedValue只考虑绝对值,不考虑百分比等 }, { @@ -17441,17 +17445,17 @@ var Xom$1 = /*#__PURE__*/function (_Node) { value: function __calMp(v, w, onlyFixedValue) { var n = 0; - if (v[1] === PX$6) { + if (v[1] === PX$5) { n += v[0]; - } else if (v[1] === PERCENT$7 && !onlyFixedValue) { + } else if (v[1] === PERCENT$5 && !onlyFixedValue) { v[0] *= w * 0.01; - v[1] = PX$6; + v[1] = PX$5; n += v[0]; - } else if (v[1] === REM$7) { - n += v[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (v[1] === VW$7) { + } else if (v[1] === REM$9) { + n += v[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (v[1] === VW$9) { n += v[0] * this.root.width * 0.01; - } else if (v[1] === VH$7) { + } else if (v[1] === VH$9) { n += v[0] * this.root.height * 0.01; } @@ -17461,39 +17465,39 @@ var Xom$1 = /*#__PURE__*/function (_Node) { }, { key: "__addMp", value: function __addMp(isDirectionRow, w, currentStyle, res, isDirectItem) { - var marginLeft = currentStyle[MARGIN_LEFT$1], - marginTop = currentStyle[MARGIN_TOP], - marginRight = currentStyle[MARGIN_RIGHT$1], - marginBottom = currentStyle[MARGIN_BOTTOM], - paddingLeft = currentStyle[PADDING_LEFT$2], - paddingTop = currentStyle[PADDING_TOP$1], - paddingRight = currentStyle[PADDING_RIGHT$1], - paddingBottom = currentStyle[PADDING_BOTTOM$1], - borderTopWidth = currentStyle[BORDER_TOP_WIDTH$2], - borderRightWidth = currentStyle[BORDER_RIGHT_WIDTH$2], - borderBottomWidth = currentStyle[BORDER_BOTTOM_WIDTH$2], - borderLeftWidth = currentStyle[BORDER_LEFT_WIDTH$3]; - - if (isDirectionRow) { + var marginLeft = currentStyle[MARGIN_LEFT$5], + marginTop = currentStyle[MARGIN_TOP$4], + marginRight = currentStyle[MARGIN_RIGHT$4], + marginBottom = currentStyle[MARGIN_BOTTOM$4], + paddingLeft = currentStyle[PADDING_LEFT$5], + paddingTop = currentStyle[PADDING_TOP$4], + paddingRight = currentStyle[PADDING_RIGHT$4], + paddingBottom = currentStyle[PADDING_BOTTOM$4], + borderTopWidth = currentStyle[BORDER_TOP_WIDTH$4], + borderRightWidth = currentStyle[BORDER_RIGHT_WIDTH$4], + borderBottomWidth = currentStyle[BORDER_BOTTOM_WIDTH$4], + borderLeftWidth = currentStyle[BORDER_LEFT_WIDTH$5]; + + if (isDirectionRow) { var mp = this.__calMp(marginLeft, w, !isDirectItem) + this.__calMp(marginRight, w, !isDirectItem) + this.__calMp(paddingLeft, w, !isDirectItem) + this.__calMp(paddingRight, w, !isDirectItem); - if (borderLeftWidth[1] === PX$6) { + if (borderLeftWidth[1] === PX$5) { mp += borderLeftWidth[0]; - } else if (borderLeftWidth[1] === REM$7) { - mp += borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (borderLeftWidth[1] === VW$7) { + } else if (borderLeftWidth[1] === REM$9) { + mp += borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (borderLeftWidth[1] === VW$9) { mp += borderLeftWidth[0] * this.root.width * 0.01; - } else if (borderLeftWidth[1] === VH$7) { + } else if (borderLeftWidth[1] === VH$9) { mp += borderLeftWidth[0] * this.root.height * 0.01; } - if (borderRightWidth[1] === PX$6) { + if (borderRightWidth[1] === PX$5) { mp += borderRightWidth[0]; - } else if (borderRightWidth[1] === REM$7) { - mp += borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (borderRightWidth[1] === VW$7) { + } else if (borderRightWidth[1] === REM$9) { + mp += borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (borderRightWidth[1] === VW$9) { mp += borderRightWidth[0] * this.root.width * 0.01; - } else if (borderRightWidth[1] === VH$7) { + } else if (borderRightWidth[1] === VH$9) { mp += borderRightWidth[0] * this.root.height * 0.01; } @@ -17503,23 +17507,23 @@ var Xom$1 = /*#__PURE__*/function (_Node) { } else { var _mp = this.__calMp(marginTop, w, !isDirectItem) + this.__calMp(marginBottom, w, !isDirectItem) + this.__calMp(paddingTop, w, !isDirectItem) + this.__calMp(paddingBottom, w, !isDirectItem); - if (borderTopWidth[1] === PX$6) { + if (borderTopWidth[1] === PX$5) { _mp += borderTopWidth[0]; - } else if (borderTopWidth[1] === REM$7) { - _mp += borderTopWidth[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (borderTopWidth[1] === VW$7) { + } else if (borderTopWidth[1] === REM$9) { + _mp += borderTopWidth[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (borderTopWidth[1] === VW$9) { _mp += borderTopWidth[0] * this.root.width * 0.01; - } else if (borderTopWidth[1] === VH$7) { + } else if (borderTopWidth[1] === VH$9) { _mp += borderTopWidth[0] * this.root.height * 0.01; } - if (borderBottomWidth[1] === PX$6) { + if (borderBottomWidth[1] === PX$5) { _mp += borderBottomWidth[0]; - } else if (borderBottomWidth[1] === REM$7) { - _mp += borderBottomWidth[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (borderBottomWidth[1] === VW$7) { + } else if (borderBottomWidth[1] === REM$9) { + _mp += borderBottomWidth[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (borderBottomWidth[1] === VW$9) { _mp += borderBottomWidth[0] * this.root.width * 0.01; - } else if (borderBottomWidth[1] === VH$7) { + } else if (borderBottomWidth[1] === VH$9) { _mp += borderBottomWidth[0] * this.root.height * 0.01; } @@ -17541,9 +17545,9 @@ var Xom$1 = /*#__PURE__*/function (_Node) { currentStyle = this.currentStyle, computedStyle = this.computedStyle, __config = this.__config; - var display = computedStyle[DISPLAY$3]; + var display = computedStyle[DISPLAY$7]; var width = currentStyle[WIDTH$4], - position = currentStyle[POSITION$1]; + position = currentStyle[POSITION$4]; this.clearCache(); this.__layoutData = { x: data.x, @@ -17552,9 +17556,9 @@ var Xom$1 = /*#__PURE__*/function (_Node) { h: data.h, lx: data.lx }; - __config[NODE_REFRESH_LV] = REFLOW; + __config[NODE_REFRESH_LV$2] = REFLOW$2; __config[NODE_LIMIT_CACHE$1] = false; - __config[NODE_IS_INLINE] = false; // 防止display:none不统计mask,isVirtual忽略,abs布局后续会真正来走一遍 + __config[NODE_IS_INLINE$1] = false; // 防止display:none不统计mask,isVirtual忽略,abs布局后续会真正来走一遍 if (!isVirtual) { var next = this.next; // mask关系只有布局才会变更,普通渲染关系不会改变,clip也是mask的一种 @@ -17579,7 +17583,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { this.__ox = this.__oy = 0; if (isDestroyed || display === 'none') { - this.__width = this.__height = this.__clientWidth = this.__clientHeight = this.__offsetWidth = this.__offsetHeight = this.__outerWidth = this.__outerHeight = computedStyle[WIDTH$4] = computedStyle[HEIGHT$3] = 0; + this.__width = this.__height = this.__clientWidth = this.__clientHeight = this.__offsetWidth = this.__offsetHeight = this.__outerWidth = this.__outerHeight = computedStyle[WIDTH$4] = computedStyle[HEIGHT$5] = 0; this.__x = data.x; this.__y = data.y; @@ -17595,28 +17599,28 @@ var Xom$1 = /*#__PURE__*/function (_Node) { if (width[1] !== AUTO$4) { - if (this.__isRealInline() && currentStyle[DISPLAY$3] === 'inline') { + if (this.__isRealInline() && currentStyle[DISPLAY$7] === 'inline') { width[0] = 0; width[1] = AUTO$4; } else { switch (width[1]) { - case PX$6: + case PX$5: w = width[0]; break; - case PERCENT$7: + case PERCENT$5: w *= width[0] * 0.01; break; - case REM$7: - w = width[0] * this.root.computedStyle[FONT_SIZE$8]; + case REM$9: + w = width[0] * this.root.computedStyle[FONT_SIZE$9]; break; - case VW$7: + case VW$9: w = width[0] * this.root.width * 0.01; break; - case VH$7: + case VH$9: w = width[0] * this.root.height * 0.01; break; } @@ -17637,72 +17641,72 @@ var Xom$1 = /*#__PURE__*/function (_Node) { if (position === 'relative') { - var top = currentStyle[TOP$1], - right = currentStyle[RIGHT], - bottom = currentStyle[BOTTOM$1], - left = currentStyle[LEFT]; + var top = currentStyle[TOP$3], + right = currentStyle[RIGHT$2], + bottom = currentStyle[BOTTOM$3], + left = currentStyle[LEFT$2]; var parent = this.parent; if (top[1] !== AUTO$4) { - var n = calRelative$1(currentStyle, TOP$1, top, parent); + var n = calRelative(currentStyle, TOP$3, top, parent); this.__offsetY(n); - computedStyle[TOP$1] = n; - computedStyle[BOTTOM$1] = 'auto'; + computedStyle[TOP$3] = n; + computedStyle[BOTTOM$3] = 'auto'; } else if (bottom[1] !== AUTO$4) { - var _n = calRelative$1(currentStyle, BOTTOM$1, bottom, parent); + var _n = calRelative(currentStyle, BOTTOM$3, bottom, parent); this.__offsetY(-_n); - computedStyle[BOTTOM$1] = _n; - computedStyle[TOP$1] = 'auto'; + computedStyle[BOTTOM$3] = _n; + computedStyle[TOP$3] = 'auto'; } else { - computedStyle[TOP$1] = computedStyle[BOTTOM$1] = 'auto'; + computedStyle[TOP$3] = computedStyle[BOTTOM$3] = 'auto'; } if (left[1] !== AUTO$4) { - var _n2 = calRelative$1(currentStyle, LEFT, left, parent, true); + var _n2 = calRelative(currentStyle, LEFT$2, left, parent, true); this.__offsetX(_n2); - computedStyle[LEFT] = _n2; - computedStyle[RIGHT] = 'auto'; + computedStyle[LEFT$2] = _n2; + computedStyle[RIGHT$2] = 'auto'; } else if (right[1] !== AUTO$4) { - var _n3 = calRelative$1(currentStyle, RIGHT, right, parent, true); + var _n3 = calRelative(currentStyle, RIGHT$2, right, parent, true); this.__offsetX(-_n3); - computedStyle[RIGHT] = _n3; - computedStyle[LEFT] = 'auto'; + computedStyle[RIGHT$2] = _n3; + computedStyle[LEFT$2] = 'auto'; } else { - computedStyle[LEFT] = computedStyle[RIGHT] = 'auto'; + computedStyle[LEFT$2] = computedStyle[RIGHT$2] = 'auto'; } } else if (position !== 'absolute') { - computedStyle[TOP$1] = computedStyle[BOTTOM$1] = computedStyle[LEFT] = computedStyle[RIGHT] = 'auto'; + computedStyle[TOP$3] = computedStyle[BOTTOM$3] = computedStyle[LEFT$2] = computedStyle[RIGHT$2] = 'auto'; } // 计算结果存入computedStyle和6个坐标,inline在其inlineSize特殊处理 var x = this.__sx = this.x + this.ox; 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]; + if (!__config[NODE_IS_INLINE$1]) { + x = this.__sx1 = x + computedStyle[MARGIN_LEFT$5]; + x = this.__sx2 = x + computedStyle[BORDER_LEFT_WIDTH$5]; + x = this.__sx3 = x + computedStyle[PADDING_LEFT$5]; x = this.__sx4 = x + this.width; - x = this.__sx5 = x + computedStyle[PADDING_RIGHT$1]; - this.__sx6 = x + computedStyle[BORDER_RIGHT_WIDTH$2]; - y = this.__sy1 = y + computedStyle[MARGIN_TOP]; - y = this.__sy2 = y + computedStyle[BORDER_TOP_WIDTH$2]; - y = this.__sy3 = y + computedStyle[PADDING_TOP$1]; + x = this.__sx5 = x + computedStyle[PADDING_RIGHT$4]; + this.__sx6 = x + computedStyle[BORDER_RIGHT_WIDTH$4]; + y = this.__sy1 = y + computedStyle[MARGIN_TOP$4]; + y = this.__sy2 = y + computedStyle[BORDER_TOP_WIDTH$4]; + y = this.__sy3 = y + computedStyle[PADDING_TOP$4]; y = this.__sy4 = y + this.height; - y = this.__sy5 = y + computedStyle[PADDING_BOTTOM$1]; - this.__sy6 = y + computedStyle[BORDER_BOTTOM_WIDTH$2]; + y = this.__sy5 = y + computedStyle[PADDING_BOTTOM$4]; + this.__sy6 = y + computedStyle[BORDER_BOTTOM_WIDTH$4]; } computedStyle[WIDTH$4] = this.width; - computedStyle[HEIGHT$3] = this.height; // abs布局的不执行,在__layoutAbs末尾做,防止未布局没有尺寸从而动画计算错误 + computedStyle[HEIGHT$5] = this.height; // abs布局的不执行,在__layoutAbs末尾做,防止未布局没有尺寸从而动画计算错误 if (!fromAbs) { this.__execAr(); @@ -17740,8 +17744,8 @@ var Xom$1 = /*#__PURE__*/function (_Node) { key: "__layoutNone", value: function __layoutNone() { var computedStyle = this.computedStyle; - computedStyle[DISPLAY$3] = 'none'; - computedStyle[MARGIN_TOP] = computedStyle[MARGIN_RIGHT$1] = computedStyle[MARGIN_BOTTOM] = computedStyle[MARGIN_LEFT$1] = computedStyle[PADDING_TOP$1] = computedStyle[PADDING_RIGHT$1] = computedStyle[PADDING_BOTTOM$1] = computedStyle[PADDING_LEFT$2] = 0; + computedStyle[DISPLAY$7] = 'none'; + computedStyle[MARGIN_TOP$4] = computedStyle[MARGIN_RIGHT$4] = computedStyle[MARGIN_BOTTOM$4] = computedStyle[MARGIN_LEFT$5] = computedStyle[PADDING_TOP$4] = computedStyle[PADDING_RIGHT$4] = computedStyle[PADDING_BOTTOM$4] = computedStyle[PADDING_LEFT$5] = 0; } // 预先计算是否是固定宽高,布局点位和尺寸考虑margin/border/padding }, { @@ -17765,19 +17769,19 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var currentStyle = this.currentStyle, computedStyle = this.computedStyle; var width = currentStyle[WIDTH$4], - height = currentStyle[HEIGHT$3]; - var borderTopWidth = computedStyle[BORDER_TOP_WIDTH$2], - borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$2], - borderBottomWidth = computedStyle[BORDER_BOTTOM_WIDTH$2], - borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$3], - marginTop = computedStyle[MARGIN_TOP], - marginRight = computedStyle[MARGIN_RIGHT$1], - marginBottom = computedStyle[MARGIN_BOTTOM], - marginLeft = computedStyle[MARGIN_LEFT$1], - paddingTop = computedStyle[PADDING_TOP$1], - paddingRight = computedStyle[PADDING_RIGHT$1], - paddingBottom = computedStyle[PADDING_BOTTOM$1], - paddingLeft = computedStyle[PADDING_LEFT$2]; // 除了auto外都是固定宽高度 + height = currentStyle[HEIGHT$5]; + var borderTopWidth = computedStyle[BORDER_TOP_WIDTH$4], + borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$4], + borderBottomWidth = computedStyle[BORDER_BOTTOM_WIDTH$4], + borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$5], + marginTop = computedStyle[MARGIN_TOP$4], + marginRight = computedStyle[MARGIN_RIGHT$4], + marginBottom = computedStyle[MARGIN_BOTTOM$4], + marginLeft = computedStyle[MARGIN_LEFT$5], + paddingTop = computedStyle[PADDING_TOP$4], + paddingRight = computedStyle[PADDING_RIGHT$4], + paddingBottom = computedStyle[PADDING_BOTTOM$4], + paddingLeft = computedStyle[PADDING_LEFT$5]; // 除了auto外都是固定宽高度 var fixedWidth; var fixedHeight; // 绝对定位是left+right这种其实等于定义了width,但不能修改原始style,存入特殊变量标识 @@ -17787,33 +17791,33 @@ var Xom$1 = /*#__PURE__*/function (_Node) { w = w2; } // flex时也会用到,子级得出目标主尺寸后按这个来 else if (w3 !== undefined) { - fixedWidth = true; - w = w3; - } else if (width[1] !== AUTO$4) { - fixedWidth = true; + fixedWidth = true; + w = w3; + } else if (width[1] !== AUTO$4) { + fixedWidth = true; - switch (width[1]) { - case PX$6: - w = width[0]; - break; + switch (width[1]) { + case PX$5: + w = width[0]; + break; - case PERCENT$7: - w *= width[0] * 0.01; - break; + case PERCENT$5: + w *= width[0] * 0.01; + break; - case REM$7: - w = width[0] * this.root.computedStyle[FONT_SIZE$8]; - break; + case REM$9: + w = width[0] * this.root.computedStyle[FONT_SIZE$9]; + break; - case VW$7: - w = width[0] * this.root.width * 0.01; - break; + case VW$9: + w = width[0] * this.root.width * 0.01; + break; - case VH$7: - w = width[0] * this.root.height * 0.01; - break; - } + case VH$9: + w = width[0] * this.root.height * 0.01; + break; } + } if (h2 !== undefined) { fixedHeight = true; @@ -17825,23 +17829,23 @@ var Xom$1 = /*#__PURE__*/function (_Node) { fixedHeight = true; switch (height[1]) { - case PX$6: + case PX$5: h = height[0]; break; - case PERCENT$7: + case PERCENT$5: h *= height[0] * 0.01; break; - case REM$7: - h = height[0] * this.root.computedStyle[FONT_SIZE$8]; + case REM$9: + h = height[0] * this.root.computedStyle[FONT_SIZE$9]; break; - case VW$7: + case VW$9: h = height[0] * this.root.width * 0.01; break; - case VH$7: + case VH$9: h = height[0] * this.root.height * 0.01; break; } @@ -17893,10 +17897,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { }, { key: "__marginAuto", value: function __marginAuto(style, data) { - var position = style[POSITION$1], - display = style[DISPLAY$3], - marginLeft = style[MARGIN_LEFT$1], - marginRight = style[MARGIN_RIGHT$1], + var position = style[POSITION$4], + display = style[DISPLAY$7], + marginLeft = style[MARGIN_LEFT$5], + marginRight = style[MARGIN_RIGHT$4], width = style[WIDTH$4]; if (position !== 'absolute' && (display === 'block' || display === 'flex') && (width[1] !== AUTO$4 || this.tagName === 'img') && marginLeft[1] === AUTO$4 && marginRight[1] === AUTO$4) { @@ -17912,186 +17916,186 @@ var Xom$1 = /*#__PURE__*/function (_Node) { value: function __calMatrix(lv, __cacheStyle, currentStyle, computedStyle, __config, sx1, sy1, offsetWidth, offsetHeight) { var _this3 = this; - if (__config[NODE_IS_INLINE]) { - computedStyle[TRANSFORM_ORIGIN$4] = [sx1, sy1]; - return __cacheStyle[MATRIX$3] = mx.identity(); + if (__config[NODE_IS_INLINE$1]) { + computedStyle[TRANSFORM_ORIGIN$1] = [sx1, sy1]; + return __cacheStyle[MATRIX] = mx.identity(); } - var matrixCache = __cacheStyle[MATRIX$3]; // tx/ty变化特殊优化 + var matrixCache = __cacheStyle[MATRIX]; // tx/ty变化特殊优化 - if (matrixCache && lv < REFLOW && !contain(lv, TF)) { + if (matrixCache && lv < REFLOW$2 && !contain$3(lv, TF)) { var x = 0, y = 0, z = 0; - if (contain(lv, TX)) { - var v = currentStyle[TRANSLATE_X$4]; + if (contain$3(lv, TX)) { + var v = currentStyle[TRANSLATE_X]; - if (isNil$6(v)) { + if (isNil$9(v)) { v = 0; - } else if (v[1] === PERCENT$7) { + } else if (v[1] === PERCENT$5) { v = v[0] * this.offsetWidth * 0.01; - } else if (v[1] === REM$7) { - v = v[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (v[1] === VW$7) { + } else if (v[1] === REM$9) { + v = v[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (v[1] === VW$9) { v = v[0] * this.root.width * 0.01; - } else if (v[1] === VH$7) { + } else if (v[1] === VH$9) { v = v[0] * this.root.height * 0.01; } else { v = v[0]; } - x = v - (computedStyle[TRANSLATE_X$4] || 0); - computedStyle[TRANSLATE_X$4] = v; - computedStyle[TRANSFORM$3][12] += x; + x = v - (computedStyle[TRANSLATE_X] || 0); + computedStyle[TRANSLATE_X] = v; + computedStyle[TRANSFORM$1][12] += x; matrixCache[12] += x; } - if (contain(lv, TY)) { - var _v = currentStyle[TRANSLATE_Y$4]; + if (contain$3(lv, TY)) { + var _v = currentStyle[TRANSLATE_Y]; - if (isNil$6(_v)) { + if (isNil$9(_v)) { _v = 0; - } else if (_v[1] === PERCENT$7) { + } else if (_v[1] === PERCENT$5) { _v = _v[0] * this.offsetHeight * 0.01; - } else if (_v[1] === REM$7) { - _v = _v[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (_v[1] === VW$7) { + } else if (_v[1] === REM$9) { + _v = _v[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (_v[1] === VW$9) { _v = _v[0] * this.root.width * 0.01; - } else if (_v[1] === VH$7) { + } else if (_v[1] === VH$9) { _v = _v[0] * this.root.height * 0.01; } else { _v = _v[0]; } - y = _v - (computedStyle[TRANSLATE_Y$4] || 0); - computedStyle[TRANSLATE_Y$4] = _v; - computedStyle[TRANSFORM$3][13] += y; + y = _v - (computedStyle[TRANSLATE_Y] || 0); + computedStyle[TRANSLATE_Y] = _v; + computedStyle[TRANSFORM$1][13] += y; matrixCache[13] += y; } - if (contain(lv, TZ)) { - var _v2 = currentStyle[TRANSLATE_Z$4]; + if (contain$3(lv, TZ)) { + var _v2 = currentStyle[TRANSLATE_Z]; - if (isNil$6(_v2)) { + if (isNil$9(_v2)) { _v2 = 0; - } else if (_v2[1] === PERCENT$7) { + } else if (_v2[1] === PERCENT$5) { _v2 = _v2[0] * this.offsetWidth * 0.01; - } else if (_v2[1] === REM$7) { - _v2 = _v2[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (_v2[1] === VW$7) { + } else if (_v2[1] === REM$9) { + _v2 = _v2[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (_v2[1] === VW$9) { _v2 = _v2[0] * this.root.width * 0.01; - } else if (_v2[1] === VH$7) { + } else if (_v2[1] === VH$9) { _v2 = _v2[0] * this.root.height * 0.01; } else { _v2 = _v2[0]; } - z = _v2 - (computedStyle[TRANSLATE_Z$4] || 0); - computedStyle[TRANSLATE_Z$4] = _v2; - computedStyle[TRANSFORM$3][14] += z; + z = _v2 - (computedStyle[TRANSLATE_Z] || 0); + computedStyle[TRANSLATE_Z] = _v2; + computedStyle[TRANSFORM$1][14] += z; matrixCache[14] += z; } - __cacheStyle[MATRIX$3] = matrixCache; + __cacheStyle[MATRIX] = matrixCache; } // 先根据cache计算需要重新计算的computedStyle else { - if (sx1 === undefined) { - sx1 = this.__sx1; - sy1 = this.__sy1; - offsetWidth = this.offsetWidth; - offsetHeight = this.offsetHeight; - } - - if (__cacheStyle[TRANSFORM_ORIGIN$4] === undefined) { - __cacheStyle[TRANSFORM_ORIGIN$4] = true; - matrixCache = null; - computedStyle[TRANSFORM_ORIGIN$4] = tf.calOrigin(currentStyle[TRANSFORM_ORIGIN$4], offsetWidth, offsetHeight, this.root); - } - - if (__cacheStyle[TRANSFORM$3] === undefined || __cacheStyle[TRANSLATE_X$4] === undefined || __cacheStyle[TRANSLATE_Y$4] === undefined || __cacheStyle[TRANSLATE_Z$4] === undefined || __cacheStyle[ROTATE_X$2] === undefined || __cacheStyle[ROTATE_Y$2] === undefined || __cacheStyle[ROTATE_Z$2] === undefined || __cacheStyle[ROTATE_3D$3] === undefined || __cacheStyle[SCALE_X$3] === undefined || __cacheStyle[SCALE_Y$3] === undefined || __cacheStyle[SCALE_Z$2] === undefined || __cacheStyle[SKEW_X$2] === undefined || __cacheStyle[SKEW_Y$2] === undefined) { - __cacheStyle[TRANSFORM$3] = __cacheStyle[TRANSLATE_X$4] = __cacheStyle[TRANSLATE_Y$4] = __cacheStyle[TRANSLATE_Z$4] = __cacheStyle[ROTATE_X$2] = __cacheStyle[ROTATE_Y$2] = __cacheStyle[ROTATE_Z$2] = __cacheStyle[SCALE_X$3] = __cacheStyle[SCALE_Y$3] = __cacheStyle[SCALE_Z$2] = __cacheStyle[SKEW_X$2] = __cacheStyle[SKEW_Y$2] = true; - matrixCache = null; - var matrix; // transform相对于自身 + if (sx1 === undefined) { + sx1 = this.__sx1; + sy1 = this.__sy1; + offsetWidth = this.offsetWidth; + offsetHeight = this.offsetHeight; + } - if (currentStyle[TRANSFORM$3]) { - matrix = tf.calMatrix(currentStyle[TRANSFORM$3], offsetWidth, offsetHeight, this.root); - } // 没有transform则看是否有扩展的css独立变换属性 - else { - var temp = []; - [TRANSLATE_X$4, TRANSLATE_Y$4, TRANSLATE_Z$4, ROTATE_X$2, ROTATE_Y$2, ROTATE_Z$2, ROTATE_3D$3, SKEW_X$2, SKEW_Y$2, SCALE_X$3, SCALE_Y$3, SCALE_Z$2].forEach(function (k) { - // 删除之前遗留的 - delete computedStyle[k]; - var v = currentStyle[k]; + if (__cacheStyle[TRANSFORM_ORIGIN$1] === undefined) { + __cacheStyle[TRANSFORM_ORIGIN$1] = true; + matrixCache = null; + computedStyle[TRANSFORM_ORIGIN$1] = tf.calOrigin(currentStyle[TRANSFORM_ORIGIN$1], offsetWidth, offsetHeight, this.root); + } - if (isNil$6(v)) { - return; - } + if (__cacheStyle[TRANSFORM$1] === undefined || __cacheStyle[TRANSLATE_X] === undefined || __cacheStyle[TRANSLATE_Y] === undefined || __cacheStyle[TRANSLATE_Z] === undefined || __cacheStyle[ROTATE_X] === undefined || __cacheStyle[ROTATE_Y] === undefined || __cacheStyle[ROTATE_Z] === undefined || __cacheStyle[ROTATE_3D] === undefined || __cacheStyle[SCALE_X] === undefined || __cacheStyle[SCALE_Y] === undefined || __cacheStyle[SCALE_Z] === undefined || __cacheStyle[SKEW_X] === undefined || __cacheStyle[SKEW_Y] === undefined) { + __cacheStyle[TRANSFORM$1] = __cacheStyle[TRANSLATE_X] = __cacheStyle[TRANSLATE_Y] = __cacheStyle[TRANSLATE_Z] = __cacheStyle[ROTATE_X] = __cacheStyle[ROTATE_Y] = __cacheStyle[ROTATE_Z] = __cacheStyle[SCALE_X] = __cacheStyle[SCALE_Y] = __cacheStyle[SCALE_Z] = __cacheStyle[SKEW_X] = __cacheStyle[SKEW_Y] = true; + matrixCache = null; + var matrix; // transform相对于自身 - if (k === ROTATE_3D$3) { - computedStyle[k] = [v[0], v[1], v[2], v[3][0]]; + if (currentStyle[TRANSFORM$1]) { + matrix = tf.calMatrix(currentStyle[TRANSFORM$1], offsetWidth, offsetHeight, this.root); + } // 没有transform则看是否有扩展的css独立变换属性 + else { + var temp = []; + [TRANSLATE_X, TRANSLATE_Y, TRANSLATE_Z, ROTATE_X, ROTATE_Y, ROTATE_Z, ROTATE_3D, SKEW_X, SKEW_Y, SCALE_X, SCALE_Y, SCALE_Z].forEach(function (k) { + // 删除之前遗留的 + delete computedStyle[k]; + var v = currentStyle[k]; - if (v[3][0] === 0) { - return; - } + if (isNil$9(v)) { + return; + } - temp.push([k, v]); - return; - } + if (k === ROTATE_3D) { + computedStyle[k] = [v[0], v[1], v[2], v[3][0]]; - computedStyle[k] = v[0]; // scale为1和其它为0避免计算浪费 + if (v[3][0] === 0) { + return; + } - var isScale = k === SCALE_X$3 || k === SCALE_Y$3 || k === SCALE_Z$2; + temp.push([k, v]); + return; + } - if (v[0] === 1 && isScale || !isScale && v[0] === 0) { - return; - } + computedStyle[k] = v[0]; // scale为1和其它为0避免计算浪费 - if (v[1] === PERCENT$7) { - if (k === TRANSLATE_X$4 || k === TRANSLATE_Z$4) { - computedStyle[k] = v[0] * offsetWidth * 0.01; - } else if (k === TRANSLATE_Y$4) { - computedStyle[k] = v[0] * offsetHeight * 0.01; - } - } 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]; - } else if (k === TRANSLATE_Y$4) { - computedStyle[k] = v[0] * _this3.root.computedStyle[FONT_SIZE$8]; - } - } else if (v[1] === VW$7) { - if (k === TRANSLATE_X$4 || k === TRANSLATE_Z$4) { - computedStyle[k] = v[0] * _this3.root.width * 0.01; - } else if (k === TRANSLATE_Y$4) { - computedStyle[k] = v[0] * _this3.root.width * 0.01; - } - } else if (v[1] === VH$7) { - if (k === TRANSLATE_X$4 || k === TRANSLATE_Z$4) { - computedStyle[k] = v[0] * _this3.root.height * 0.01; - } else if (k === TRANSLATE_Y$4) { - computedStyle[k] = v[0] * _this3.root.height * 0.01; - } - } + var isScale = k === SCALE_X || k === SCALE_Y || k === SCALE_Z; - temp.push([k, v]); - }); + if (v[0] === 1 && isScale || !isScale && v[0] === 0) { + return; + } - if (temp.length) { - matrix = tf.calMatrix(temp, offsetWidth, offsetHeight, this.root); + if (v[1] === PERCENT$5) { + if (k === TRANSLATE_X || k === TRANSLATE_Z) { + computedStyle[k] = v[0] * offsetWidth * 0.01; + } else if (k === TRANSLATE_Y) { + computedStyle[k] = v[0] * offsetHeight * 0.01; + } + } else if (v[1] === REM$9) { + if (k === TRANSLATE_X || k === TRANSLATE_Z) { + computedStyle[k] = v[0] * _this3.root.computedStyle[FONT_SIZE$9]; + } else if (k === TRANSLATE_Y) { + computedStyle[k] = v[0] * _this3.root.computedStyle[FONT_SIZE$9]; + } + } else if (v[1] === VW$9) { + if (k === TRANSLATE_X || k === TRANSLATE_Z) { + computedStyle[k] = v[0] * _this3.root.width * 0.01; + } else if (k === TRANSLATE_Y) { + computedStyle[k] = v[0] * _this3.root.width * 0.01; + } + } else if (v[1] === VH$9) { + if (k === TRANSLATE_X || k === TRANSLATE_Z) { + computedStyle[k] = v[0] * _this3.root.height * 0.01; + } else if (k === TRANSLATE_Y) { + computedStyle[k] = v[0] * _this3.root.height * 0.01; } } - computedStyle[TRANSFORM$3] = matrix || mx.identity(); - } + temp.push([k, v]); + }); - if (!matrixCache) { - var m = computedStyle[TRANSFORM$3]; - var tfo = computedStyle[TRANSFORM_ORIGIN$4].slice(0); - tfo[0] += sx1 || 0; - tfo[1] += sy1 || 0; - matrixCache = __cacheStyle[MATRIX$3] = tf.calMatrixByOrigin(m, tfo); + if (temp.length) { + matrix = tf.calMatrix(temp, offsetWidth, offsetHeight, this.root); + } } + + computedStyle[TRANSFORM$1] = matrix || mx.identity(); + } + + if (!matrixCache) { + var m = computedStyle[TRANSFORM$1]; + var tfo = computedStyle[TRANSFORM_ORIGIN$1].slice(0); + tfo[0] += sx1 || 0; + tfo[1] += sy1 || 0; + matrixCache = __cacheStyle[MATRIX] = tf.calMatrixByOrigin(m, tfo); } + } return matrixCache; } @@ -18140,7 +18144,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { by1 = y1, bx2 = x6, by2 = y6; - var backgroundClip = computedStyle[BACKGROUND_CLIP$2] = currentStyle[BACKGROUND_CLIP$2]; // 默认border-box + var backgroundClip = computedStyle[BACKGROUND_CLIP] = currentStyle[BACKGROUND_CLIP]; // 默认border-box if (backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') { bx1 = x2; @@ -18154,83 +18158,83 @@ var Xom$1 = /*#__PURE__*/function (_Node) { by2 = y4; } - var isInline = this.__config[NODE_IS_INLINE]; + var isInline = this.__config[NODE_IS_INLINE$1]; if (isInline && !this.contentBoxList.length) { isInline = false; } // 这些直接赋值的不需要再算缓存 - [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$2, Z_INDEX$2, BORDER_TOP_STYLE, BORDER_RIGHT_STYLE, BORDER_BOTTOM_STYLE, BORDER_LEFT_STYLE, BACKGROUND_REPEAT, OVERFLOW$2, MIX_BLEND_MODE$3, TEXT_OVERFLOW, BACKGROUND_CLIP].forEach(function (k) { computedStyle[k] = currentStyle[k]; }); - if (isNil$6(__cacheStyle[FILTER$3])) { + if (isNil$9(__cacheStyle[FILTER$3])) { __cacheStyle[FILTER$3] = true; this.__calFilter(currentStyle, computedStyle); } - if (isNil$6(__cacheStyle[BACKGROUND_POSITION_X$3])) { - __cacheStyle[BACKGROUND_POSITION_X$3] = true; - var bgX = currentStyle[BACKGROUND_POSITION_X$3]; - computedStyle[BACKGROUND_POSITION_X$3] = (bgX || []).map(function (item) { - if (item[1] === PX$6) { + if (isNil$9(__cacheStyle[BACKGROUND_POSITION_X])) { + __cacheStyle[BACKGROUND_POSITION_X] = true; + var bgX = currentStyle[BACKGROUND_POSITION_X]; + computedStyle[BACKGROUND_POSITION_X] = (bgX || []).map(function (item) { + if (item[1] === PX$5) { return item[0]; } - if (item[1] === REM$7) { - return item[0] * _this4.root.computedStyle[FONT_SIZE$8]; + if (item[1] === REM$9) { + return item[0] * _this4.root.computedStyle[FONT_SIZE$9]; } - if (item[1] === VW$7) { + if (item[1] === VW$9) { return item[0] * _this4.root.width * 0.01; } - if (item[1] === VH$7) { + if (item[1] === VH$9) { return item[0] * _this4.root.height * 0.01; } - if (item[1] === PERCENT$7) { + if (item[1] === PERCENT$5) { return item[0] + '%'; } }); } - if (isNil$6(__cacheStyle[BACKGROUND_POSITION_Y$3])) { - __cacheStyle[BACKGROUND_POSITION_Y$3] = true; - var bgY = currentStyle[BACKGROUND_POSITION_Y$3]; - computedStyle[BACKGROUND_POSITION_Y$3] = (bgY || []).map(function (item) { - if (item[1] === PX$6) { + if (isNil$9(__cacheStyle[BACKGROUND_POSITION_Y])) { + __cacheStyle[BACKGROUND_POSITION_Y] = true; + var bgY = currentStyle[BACKGROUND_POSITION_Y]; + computedStyle[BACKGROUND_POSITION_Y] = (bgY || []).map(function (item) { + if (item[1] === PX$5) { return item[0]; } - if (item[1] === REM$7) { - return item[0] * _this4.root.computedStyle[FONT_SIZE$8]; + if (item[1] === REM$9) { + return item[0] * _this4.root.computedStyle[FONT_SIZE$9]; } - if (item[1] === VW$7) { + if (item[1] === VW$9) { return item[0] * _this4.root.width * 0.01; } - if (item[1] === VH$7) { + if (item[1] === VH$9) { return item[0] * _this4.root.height * 0.01; } - if (item[1] === PERCENT$7) { + if (item[1] === PERCENT$5) { return item[0] + '%'; } }); } - if (isNil$6(__cacheStyle[BACKGROUND_SIZE$2])) { - __cacheStyle[BACKGROUND_SIZE$2] = true; - computedStyle[BACKGROUND_SIZE$2] = (currentStyle[BACKGROUND_SIZE$2] || []).map(function (item) { + if (isNil$9(__cacheStyle[BACKGROUND_SIZE])) { + __cacheStyle[BACKGROUND_SIZE] = true; + computedStyle[BACKGROUND_SIZE] = (currentStyle[BACKGROUND_SIZE] || []).map(function (item) { return bg.calBackgroundSize(item, bx2 - bx1, by2 - by1, _this4.root); }); } - if (isNil$6(__cacheStyle[BACKGROUND_IMAGE$1])) { + if (isNil$9(__cacheStyle[BACKGROUND_IMAGE$1])) { var bgI = computedStyle[BACKGROUND_IMAGE$1] = currentStyle[BACKGROUND_IMAGE$1].slice(0); __cacheStyle[BACKGROUND_IMAGE$1] = bgI.map(function (bgi, i) { if (!bgi) { @@ -18264,9 +18268,9 @@ var Xom$1 = /*#__PURE__*/function (_Node) { __before: function __before() { __cacheStyle[BACKGROUND_IMAGE$1] = undefined; var res = {}; - res[UPDATE_NODE$2] = node; - res[UPDATE_FOCUS$1] = REPAINT$1; - res[UPDATE_CONFIG$2] = node.__config; + res[UPDATE_NODE$3] = node; + res[UPDATE_FOCUS$3] = REPAINT$2; + res[UPDATE_CONFIG$3] = node.__config; root.__addUpdate(node, node.__config, root, root.__config, res); } @@ -18288,9 +18292,9 @@ var Xom$1 = /*#__PURE__*/function (_Node) { }); } - if (isNil$6(__cacheStyle[BOX_SHADOW$2])) { - __cacheStyle[BOX_SHADOW$2] = true; - computedStyle[BOX_SHADOW$2] = (currentStyle[BOX_SHADOW$2] || []).map(function (item) { + if (isNil$9(__cacheStyle[BOX_SHADOW$7])) { + __cacheStyle[BOX_SHADOW$7] = true; + computedStyle[BOX_SHADOW$7] = (currentStyle[BOX_SHADOW$7] || []).map(function (item) { return item.map(function (item2, i) { if (i > 3) { return item2; @@ -18298,17 +18302,17 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var v = item2[0]; - if (item2[1] === PERCENT$7) { + if (item2[1] === PERCENT$5) { if (i % 2 === 0) { v *= 0.01 * (bx2 - bx1); } else { v *= 0.01 * (by2 - by1); } - } else if (item2[1] === REM$7) { - v = v * _this4.root.computedStyle[FONT_SIZE$8]; - } else if (item2[1] === VW$7) { + } else if (item2[1] === REM$9) { + v = v * _this4.root.computedStyle[FONT_SIZE$9]; + } else if (item2[1] === VW$9) { v = v * _this4.root.width * 0.01; - } else if (item2[1] === VH$7) { + } else if (item2[1] === VH$9) { v = v * _this4.root.height * 0.01; } @@ -18318,20 +18322,20 @@ var Xom$1 = /*#__PURE__*/function (_Node) { } [BACKGROUND_COLOR$1, BORDER_TOP_COLOR, BORDER_RIGHT_COLOR, BORDER_BOTTOM_COLOR, BORDER_LEFT_COLOR].forEach(function (k) { - if (isNil$6(__cacheStyle[k])) { - __cacheStyle[k] = int2rgba$2(computedStyle[k] = currentStyle[k][0]); + if (isNil$9(__cacheStyle[k])) { + __cacheStyle[k] = int2rgba$1(computedStyle[k] = currentStyle[k][0]); } }); // 圆角边计算 - if (isNil$6(__cacheStyle[BORDER_TOP_LEFT_RADIUS$1]) || isNil$6(__cacheStyle[BORDER_TOP_RIGHT_RADIUS$1]) || isNil$6(__cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS$1]) || isNil$6(__cacheStyle[BORDER_BOTTOM_LEFT_RADIUS$1])) { + if (isNil$9(__cacheStyle[BORDER_TOP_LEFT_RADIUS$1]) || isNil$9(__cacheStyle[BORDER_TOP_RIGHT_RADIUS$1]) || isNil$9(__cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS$1]) || isNil$9(__cacheStyle[BORDER_BOTTOM_LEFT_RADIUS$1])) { __cacheStyle[BORDER_TOP_LEFT_RADIUS$1] = __cacheStyle[BORDER_TOP_RIGHT_RADIUS$1] = __cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS$1] = __cacheStyle[BORDER_BOTTOM_LEFT_RADIUS$1] = true; // 非替代的inline计算看contentBox首尾 if (isInline) { border.calBorderRadiusInline(this.contentBoxList, currentStyle, computedStyle, this.root); } // 普通block整体计算 else { - border.calBorderRadius(offsetWidth, offsetHeight, currentStyle, computedStyle, this.root); - } + border.calBorderRadius(offsetWidth, offsetHeight, currentStyle, computedStyle, this.root); + } } // width/style/radius影响border,color不影响渲染缓存 @@ -18341,21 +18345,21 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var bblr = computedStyle[BORDER_BOTTOM_LEFT_RADIUS$1]; ['Top', 'Right', 'Bottom', 'Left'].forEach(function (k) { k = 'border' + k; - var k2 = STYLE_KEY$5[style2Upper$2(k)]; - var kw = STYLE_KEY$5[style2Upper$2(k + 'Width')]; - var ks = STYLE_KEY$5[style2Upper$2(k + 'Style')]; // width/style变更影响border重新计算 + var k2 = STYLE_KEY[style2Upper(k)]; + var kw = STYLE_KEY[style2Upper(k + 'Width')]; + var ks = STYLE_KEY[style2Upper(k + 'Style')]; // width/style变更影响border重新计算 - if (isNil$6(__cacheStyle[kw])) { + if (isNil$9(__cacheStyle[kw])) { __cacheStyle[kw] = true; __cacheStyle[k2] = undefined; } - if (isNil$6(__cacheStyle[ks])) { + if (isNil$9(__cacheStyle[ks])) { __cacheStyle[ks] = true; __cacheStyle[k2] = undefined; } - if (isNil$6(__cacheStyle[k2])) { + if (isNil$9(__cacheStyle[k2])) { if (k2 === BORDER_TOP) { if (borderTopWidth > 0) { if (!isInline) { @@ -18408,67 +18412,67 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var parentComputedStyle = parent && parent.computedStyle; - if (currentStyle[FONT_STYLE$4][1] === INHERIT$4) { - 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]; + if (currentStyle[FONT_STYLE][1] === INHERIT$1) { + computedStyle[FONT_STYLE] = parent ? parentComputedStyle[FONT_STYLE] : 'normal'; + } else if (isNil$9(__cacheStyle[FONT_STYLE])) { + computedStyle[FONT_STYLE] = currentStyle[FONT_STYLE][0]; } - __cacheStyle[FONT_STYLE$4] = computedStyle[FONT_STYLE$4]; + __cacheStyle[FONT_STYLE] = computedStyle[FONT_STYLE]; - 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$1][1] === INHERIT$1) { + computedStyle[COLOR$1] = parent ? parentComputedStyle[COLOR$1] : [0, 0, 0, 1]; + __cacheStyle[COLOR$1] = int2rgba$1(computedStyle[COLOR$1]); + } else if (isNil$9(__cacheStyle[COLOR$1])) { + computedStyle[COLOR$1] = rgba2int(currentStyle[COLOR$1][0]); + __cacheStyle[COLOR$1] = int2rgba$1(computedStyle[COLOR$1]); } - if (currentStyle[TEXT_STROKE_COLOR$4][1] === INHERIT$4) { - 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])) { - computedStyle[TEXT_STROKE_COLOR$4] = rgba2int$3(currentStyle[TEXT_STROKE_COLOR$4][0]); - __cacheStyle[TEXT_STROKE_COLOR$4] = int2rgba$2(computedStyle[TEXT_STROKE_COLOR$4]); + if (currentStyle[TEXT_STROKE_COLOR][1] === INHERIT$1) { + computedStyle[TEXT_STROKE_COLOR] = parent ? parentComputedStyle[TEXT_STROKE_COLOR] : [0, 0, 0, 1]; + __cacheStyle[TEXT_STROKE_COLOR] = int2rgba$1(computedStyle[TEXT_STROKE_COLOR]); + } else if (isNil$9(__cacheStyle[TEXT_STROKE_COLOR])) { + computedStyle[TEXT_STROKE_COLOR] = rgba2int(currentStyle[TEXT_STROKE_COLOR][0]); + __cacheStyle[TEXT_STROKE_COLOR] = int2rgba$1(computedStyle[TEXT_STROKE_COLOR]); } - if (currentStyle[TEXT_STROKE_WIDTH$3][1] === INHERIT$4) { - 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 (currentStyle[TEXT_STROKE_WIDTH][1] === INHERIT$1) { + computedStyle[TEXT_STROKE_WIDTH] = parent ? parentComputedStyle[TEXT_STROKE_WIDTH] : 0; + __cacheStyle[TEXT_STROKE_WIDTH] = true; + } else if (isNil$9(__cacheStyle[TEXT_STROKE_WIDTH])) { + var v = currentStyle[TEXT_STROKE_WIDTH]; - if (v[1] === REM$7) { - v = v[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (v[1] === VW$7) { + if (v[1] === REM$9) { + v = v[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (v[1] === VW$9) { v = v[0] * this.root.width * 0.01; - } else if (v[1] === VH$7) { + } else if (v[1] === VH$9) { v = v[0] * this.root.height * 0.01; } else { v = v[0]; } - computedStyle[TEXT_STROKE_WIDTH$3] = v; - __cacheStyle[TEXT_STROKE_WIDTH$3] = true; + computedStyle[TEXT_STROKE_WIDTH] = v; + __cacheStyle[TEXT_STROKE_WIDTH] = true; } - if (currentStyle[TEXT_STROKE_OVER$3][1] === INHERIT$4) { - __cacheStyle[TEXT_STROKE_OVER$3] = computedStyle[TEXT_STROKE_OVER$3] = parent ? parentComputedStyle[TEXT_STROKE_OVER$3] : 'none'; + if (currentStyle[TEXT_STROKE_OVER][1] === INHERIT$1) { + __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = parent ? parentComputedStyle[TEXT_STROKE_OVER] : 'none'; } else { - __cacheStyle[TEXT_STROKE_OVER$3] = computedStyle[TEXT_STROKE_OVER$3] = currentStyle[TEXT_STROKE_OVER$3][0]; + __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = currentStyle[TEXT_STROKE_OVER][0]; } - if (currentStyle[VISIBILITY$3][1] === INHERIT$4) { - computedStyle[VISIBILITY$3] = parent ? parentComputedStyle[VISIBILITY$3] : 'visible'; - } else if (isNil$6(__cacheStyle[VISIBILITY$3])) { - computedStyle[VISIBILITY$3] = currentStyle[VISIBILITY$3][0]; + if (currentStyle[VISIBILITY$4][1] === INHERIT$1) { + computedStyle[VISIBILITY$4] = parent ? parentComputedStyle[VISIBILITY$4] : 'visible'; + } else if (isNil$9(__cacheStyle[VISIBILITY$4])) { + computedStyle[VISIBILITY$4] = currentStyle[VISIBILITY$4][0]; } - __cacheStyle[VISIBILITY$3] = computedStyle[VISIBILITY$3]; + __cacheStyle[VISIBILITY$4] = computedStyle[VISIBILITY$4]; - if (currentStyle[POINTER_EVENTS$1][1] === INHERIT$4) { + if (currentStyle[POINTER_EVENTS$1][1] === INHERIT$1) { computedStyle[POINTER_EVENTS$1] = parent ? parentComputedStyle[POINTER_EVENTS$1] : 'auto'; - } else if (isNil$6(__cacheStyle[POINTER_EVENTS$1])) { + } else if (isNil$9(__cacheStyle[POINTER_EVENTS$1])) { computedStyle[POINTER_EVENTS$1] = currentStyle[POINTER_EVENTS$1][0]; } @@ -18480,29 +18484,29 @@ var Xom$1 = /*#__PURE__*/function (_Node) { value: function __calPerspective(__cacheStyle, currentStyle, computedStyle, __config, sx1, sy1) { var rebuild; - if (isNil$6(__cacheStyle[PERSPECTIVE$3])) { - __cacheStyle[PERSPECTIVE$3] = true; + if (isNil$9(__cacheStyle[PERSPECTIVE$2])) { + __cacheStyle[PERSPECTIVE$2] = true; rebuild = true; - var v = currentStyle[PERSPECTIVE$3]; + var v = currentStyle[PERSPECTIVE$2]; var ppt = 0; - if (v[1] === REM$7) { - ppt = v[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (v[1] === VW$7) { + if (v[1] === REM$9) { + ppt = v[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (v[1] === VW$9) { ppt = v[0] * this.root.width * 0.01; - } else if (v[1] === VH$7) { + } else if (v[1] === VH$9) { ppt = v[0] * this.root.height * 0.01; } else { ppt = v[0]; } - computedStyle[PERSPECTIVE$3] = ppt; + computedStyle[PERSPECTIVE$2] = ppt; } - if (isNil$6(__cacheStyle[PERSPECTIVE_ORIGIN$3])) { - __cacheStyle[PERSPECTIVE_ORIGIN$3] = true; + if (isNil$9(__cacheStyle[PERSPECTIVE_ORIGIN$1])) { + __cacheStyle[PERSPECTIVE_ORIGIN$1] = true; rebuild = true; - computedStyle[PERSPECTIVE_ORIGIN$3] = tf.calOrigin(currentStyle[PERSPECTIVE_ORIGIN$3], this.offsetWidth, this.offsetHeight, this.root); + computedStyle[PERSPECTIVE_ORIGIN$1] = tf.calOrigin(currentStyle[PERSPECTIVE_ORIGIN$1], this.offsetWidth, this.offsetHeight, this.root); } if (rebuild) { @@ -18511,10 +18515,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { sy1 = this.__sy1; } - var po = computedStyle[PERSPECTIVE_ORIGIN$3].slice(0); + var po = computedStyle[PERSPECTIVE_ORIGIN$1].slice(0); po[0] += sx1 || 0; po[1] += sy1 || 0; - __config[NODE_PERSPECTIVE_MATRIX] = tf.calPerspectiveMatrix(computedStyle[PERSPECTIVE$3], po); + __config[NODE_PERSPECTIVE_MATRIX$1] = tf.calPerspectiveMatrix(computedStyle[PERSPECTIVE$2], po); } } }, { @@ -18528,13 +18532,13 @@ var Xom$1 = /*#__PURE__*/function (_Node) { v = _item[1]; // 部分%单位的滤镜强制使用数字 - if (v[1] === PX$6 || v[1] === DEG$2 || v[1] === PERCENT$7 || v[1] === NUMBER$5) { + if (v[1] === PX$5 || v[1] === DEG || v[1] === PERCENT$5 || v[1] === NUMBER) { v = v[0]; - } else if (v[1] === REM$7) { - v = v[0] * _this5.root.computedStyle[FONT_SIZE$8]; - } else if (v[1] === VW$7) { + } else if (v[1] === REM$9) { + v = v[0] * _this5.root.computedStyle[FONT_SIZE$9]; + } else if (v[1] === VW$9) { v = v[0] * _this5.root.width * 0.01; - } else if (v[1] === VH$7) { + } else if (v[1] === VH$9) { v = v[0] * _this5.root.height * 0.01; } @@ -18544,12 +18548,12 @@ var Xom$1 = /*#__PURE__*/function (_Node) { }, { key: "__calContent", value: function __calContent(renderMode, lv, currentStyle, computedStyle) { - if (renderMode === CANVAS$1 || renderMode === WEBGL$1) { - if (lv < REPAINT$1) { + if (renderMode === CANVAS || renderMode === WEBGL) { + if (lv < REPAINT$2) { return this.__hasContent; } - var visibility = currentStyle[VISIBILITY$3]; + var visibility = currentStyle[VISIBILITY$4]; if (visibility !== 'hidden') { var bgI = currentStyle[BACKGROUND_IMAGE$1]; @@ -18564,11 +18568,11 @@ var Xom$1 = /*#__PURE__*/function (_Node) { if (currentStyle[BACKGROUND_COLOR$1][0][3] > 0) { var width = computedStyle[WIDTH$4], - height = computedStyle[HEIGHT$3], - paddingTop = computedStyle[PADDING_TOP$1], - paddingRight = computedStyle[PADDING_RIGHT$1], - paddingBottom = computedStyle[PADDING_BOTTOM$1], - paddingLeft = computedStyle[PADDING_LEFT$2]; + height = computedStyle[HEIGHT$5], + paddingTop = computedStyle[PADDING_TOP$4], + paddingRight = computedStyle[PADDING_RIGHT$4], + paddingBottom = computedStyle[PADDING_BOTTOM$4], + paddingLeft = computedStyle[PADDING_LEFT$5]; if (width && height || paddingTop || paddingRight || paddingBottom || paddingLeft) { return true; @@ -18578,12 +18582,12 @@ var Xom$1 = /*#__PURE__*/function (_Node) { for (var list = ['Top', 'Right', 'Bottom', 'Left'], _i = 0, _len = list.length; _i < _len; _i++) { var k = list[_i]; - if (computedStyle[STYLE_KEY$5[style2Upper$2('border' + k + 'Width')]] > 0 && currentStyle[STYLE_KEY$5[style2Upper$2('border' + k + 'Color')]][0][3] > 0) { + if (computedStyle[STYLE_KEY[style2Upper('border' + k + 'Width')]] > 0 && currentStyle[STYLE_KEY[style2Upper('border' + k + 'Color')]][0][3] > 0) { return true; } } - var _bs = currentStyle[BOX_SHADOW$2]; + var _bs = currentStyle[BOX_SHADOW$7]; if (Array.isArray(_bs)) { for (var _i2 = 0, _len2 = _bs.length; _i2 < _len2; _i2++) { @@ -18623,12 +18627,12 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var isDestroyed = this.isDestroyed, root = this.root, __config = this.__config; - var __cache = __config[NODE_CACHE$2]; - var __cacheStyle = __config[NODE_CACHE_STYLE]; - var currentStyle = __config[NODE_CURRENT_STYLE$1]; - var computedStyle = __config[NODE_COMPUTED_STYLE$2]; // 渲染完认为完全无变更,等布局/动画/更新重置 + var __cache = __config[NODE_CACHE$3]; + var __cacheStyle = __config[NODE_CACHE_STYLE$2]; + var currentStyle = __config[NODE_CURRENT_STYLE$5]; + var computedStyle = __config[NODE_COMPUTED_STYLE$3]; // 渲染完认为完全无变更,等布局/动画/更新重置 - __config[NODE_REFRESH_LV] = NONE; // >=REPAINT才会进入这里,清空bbox + __config[NODE_REFRESH_LV$2] = NONE$3; // >=REPAINT才会进入这里,清空bbox this.__bbox = null; @@ -18648,20 +18652,20 @@ var Xom$1 = /*#__PURE__*/function (_Node) { visibility: 'visible' }; // svg mock,每次都生成,每个节点都是局部根,更新时自底向上清除 - if (!__config[NODE_CACHE_TOTAL]) { - __config[NODE_CACHE_TOTAL] = { + if (!__config[NODE_CACHE_TOTAL$2]) { + __config[NODE_CACHE_TOTAL$2] = { available: true, release: function release() { this.available = false; delete virtualDom.cache; } }; - } else if (!__config[NODE_CACHE_TOTAL].available) { - __config[NODE_CACHE_TOTAL].available = true; + } else if (!__config[NODE_CACHE_TOTAL$2].available) { + __config[NODE_CACHE_TOTAL$2].available = true; } } - var display = computedStyle[DISPLAY$3]; // canvas返回信息,svg已经初始化好了vd + var display = computedStyle[DISPLAY$7]; // canvas返回信息,svg已经初始化好了vd if (display === 'none') { return { @@ -18675,15 +18679,15 @@ var Xom$1 = /*#__PURE__*/function (_Node) { offsetWidth = this.offsetWidth, offsetHeight = this.offsetHeight, __hasMask = this.__hasMask; - var paddingTop = computedStyle[PADDING_TOP$1], - paddingRight = computedStyle[PADDING_RIGHT$1], - paddingBottom = computedStyle[PADDING_BOTTOM$1], - paddingLeft = computedStyle[PADDING_LEFT$2], - borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$3], - borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$2], - borderTopWidth = computedStyle[BORDER_TOP_WIDTH$2], - borderBottomWidth = computedStyle[BORDER_BOTTOM_WIDTH$2]; - var isRealInline = __config[NODE_IS_INLINE]; // 考虑mpb的6个坐标,inline比较特殊单独计算 + var paddingTop = computedStyle[PADDING_TOP$4], + paddingRight = computedStyle[PADDING_RIGHT$4], + paddingBottom = computedStyle[PADDING_BOTTOM$4], + paddingLeft = computedStyle[PADDING_LEFT$5], + borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$5], + borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$4], + borderTopWidth = computedStyle[BORDER_TOP_WIDTH$4], + borderBottomWidth = computedStyle[BORDER_BOTTOM_WIDTH$4]; + var isRealInline = __config[NODE_IS_INLINE$1]; // 考虑mpb的6个坐标,inline比较特殊单独计算 var x1 = this.__sx1; var x2 = this.__sx2; @@ -18725,9 +18729,9 @@ var Xom$1 = /*#__PURE__*/function (_Node) { sy6: y6 }; // 防止cp直接返回cp嵌套,拿到真实dom的parent - var p = __config[NODE_DOM_PARENT$2]; + var p = __config[NODE_DOM_PARENT$4]; - var hasContent = this.__hasContent = __config[NODE_HAS_CONTENT$1] = this.__calContent(renderMode, lv, currentStyle, computedStyle); + var hasContent = this.__hasContent = __config[NODE_HAS_CONTENT] = this.__calContent(renderMode, lv, currentStyle, computedStyle); this.__calPerspective(__cacheStyle, currentStyle, computedStyle, __config); @@ -18737,60 +18741,60 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var dx = 0, dy = 0; - if (cache && (renderMode === CANVAS$1 || renderMode === WEBGL$1)) { + if (cache && (renderMode === CANVAS || renderMode === WEBGL)) { // 无内容可释放并提前跳出,geom覆盖特殊判断,因为后面子类会绘制矢量,img也覆盖特殊判断,加载完肯定有内容 if (!hasContent && this.__releaseWhenEmpty(__cache)) { res["break"] = true; __config[NODE_LIMIT_CACHE$1] = false; } // 新生成根据最大尺寸,排除margin从border开始还要考虑阴影滤镜等,geom单独在dom里做 else if (!__config[NODE_LIMIT_CACHE$1]) { - var bbox = this.bbox; - - if (__cache) { - __cache.reset(bbox, x1, y1); - } else { - __cache = Cache.getInstance(bbox, x1, y1); - } // cache成功设置坐标偏移,否则为超过最大尺寸限制不使用缓存 - - - if (__cache && __cache.enabled) { - __cache.__bbox = bbox; - ctx = __cache.ctx; - dx = __cache.dx; - dy = __cache.dy; // 重置ctx为cache的,以及绘制坐标为cache的区域 - - if (dx) { - res.x1 = x1 += dx; - res.x2 = x2 += dx; - res.x3 = x3 += dx; - res.x4 = x4 += dx; - res.x5 = x5 += dx; - res.x6 = x6 += dx; - } + var bbox = this.bbox; - if (dy) { - res.y1 = y1 += dy; - res.y2 = y2 += dy; - res.y3 = y3 += dy; - res.y4 = y4 += dy; - res.y5 = y5 += dy; - res.y6 = y6 += dy; - } + if (__cache) { + __cache.reset(bbox, x1, y1); + } else { + __cache = Cache.getInstance(bbox, x1, y1); + } // cache成功设置坐标偏移,否则为超过最大尺寸限制不使用缓存 + + + if (__cache && __cache.enabled) { + __cache.__bbox = bbox; + ctx = __cache.ctx; + dx = __cache.dx; + dy = __cache.dy; // 重置ctx为cache的,以及绘制坐标为cache的区域 + + if (dx) { + res.x1 = x1 += dx; + res.x2 = x2 += dx; + res.x3 = x3 += dx; + res.x4 = x4 += dx; + res.x5 = x5 += dx; + res.x6 = x6 += dx; + } - res.ctx = ctx; - } else { - __config[NODE_LIMIT_CACHE$1] = true; - __cache = null; - res.limitCache = res["break"] = true; + if (dy) { + res.y1 = y1 += dy; + res.y2 = y2 += dy; + res.y3 = y3 += dy; + res.y4 = y4 += dy; + res.y5 = y5 += dy; + res.y6 = y6 += dy; } - __config[NODE_CACHE$2] = __cache; + res.ctx = ctx; + } else { + __config[NODE_LIMIT_CACHE$1] = true; + __cache = null; + res.limitCache = res["break"] = true; } - } // 降级的webgl绘制 - else if (renderMode === WEBGL$1) { - var c = inject.getCacheCanvas(root.width, root.height, '__$$OVERSIZE$$__'); - res.ctx = ctx = c.ctx; + + __config[NODE_CACHE$3] = __cache; } + } // 降级的webgl绘制 + else if (renderMode === WEBGL) { + var c = inject.getCacheCanvas(root.width, root.height, '__$$OVERSIZE$$__'); + res.ctx = ctx = c.ctx; + } res.dx = dx; res.dy = dy; // 计算好cacheStyle的内容,以及位图缓存指数 @@ -18815,23 +18819,23 @@ var Xom$1 = /*#__PURE__*/function (_Node) { borderTopRightRadius = computedStyle[BORDER_TOP_RIGHT_RADIUS$1], borderBottomRightRadius = computedStyle[BORDER_BOTTOM_RIGHT_RADIUS$1], borderBottomLeftRadius = computedStyle[BORDER_BOTTOM_LEFT_RADIUS$1], - visibility = computedStyle[VISIBILITY$3], + visibility = computedStyle[VISIBILITY$4], backgroundRepeat = computedStyle[BACKGROUND_REPEAT], backgroundImage = computedStyle[BACKGROUND_IMAGE$1], - opacity = computedStyle[OPACITY$3], + opacity = computedStyle[OPACITY$2], filter = computedStyle[FILTER$3], - backgroundSize = computedStyle[BACKGROUND_SIZE$2], - boxShadow = computedStyle[BOX_SHADOW$2], - overflow = computedStyle[OVERFLOW$1], - mixBlendMode = computedStyle[MIX_BLEND_MODE], - backgroundClip = computedStyle[BACKGROUND_CLIP$2]; // 先设置透明度,canvas可以向上累积 + backgroundSize = computedStyle[BACKGROUND_SIZE], + boxShadow = computedStyle[BOX_SHADOW$7], + overflow = computedStyle[OVERFLOW$2], + mixBlendMode = computedStyle[MIX_BLEND_MODE$3], + backgroundClip = computedStyle[BACKGROUND_CLIP]; // 先设置透明度,canvas可以向上累积 - if (renderMode === CANVAS$1 || renderMode === WEBGL$1) { + if (renderMode === CANVAS || renderMode === WEBGL) { if (p) { - opacity *= p.__config[NODE_OPACITY$2]; + opacity *= p.__config[NODE_OPACITY$1]; } - __config[NODE_OPACITY$2] = opacity; + __config[NODE_OPACITY$1] = opacity; } else if (renderMode === SVG) { if (opacity === 1) { delete virtualDom.opacity; @@ -18843,7 +18847,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { if (renderMode === SVG) { if (!mx.isE(matrix)) { - virtualDom.transform = 'matrix(' + joinArr$2(mx.m2m6(matrix), ',') + ')'; + virtualDom.transform = 'matrix(' + joinArr$1(mx.m2m6(matrix), ',') + ')'; } else { delete virtualDom.transform; } @@ -18851,7 +18855,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { virtualDom.visibility = visibility; } - var m = __config[NODE_MATRIX$1]; + var m = __config[NODE_MATRIX$2]; util.assignMatrix(m, matrix); // 变换和canvas要以父元素matrixEvent为基础,svg使用自身即css规则,webgl在struct渲染时另算 if (p) { @@ -18876,42 +18880,40 @@ var Xom$1 = /*#__PURE__*/function (_Node) { if (mixBlendMode !== 'normal' && isValidMbm$1(mixBlendMode)) { mixBlendMode = mbmName$1(mixBlendMode); - if (renderMode === CANVAS$1 && !cache) { + if (renderMode === CANVAS && !cache) { var width = root.width, height = root.height; - - var _c = inject.getCacheCanvas(width, height, null, 'blend'); - + var c = inject.getCacheCanvas(width, height, null, 'blend'); offscreenBlend = { ctx: ctx, - target: _c, + target: c, mixBlendMode: mixBlendMode, matrix: matrix }; - ctx = _c.ctx; + ctx = c.ctx; } else if (renderMode === SVG) { virtualDom.mixBlendMode = mixBlendMode; } } // svg特殊没有mbm删除 else if (renderMode === SVG) { - delete virtualDom.mixBlendMode; - } + delete virtualDom.mixBlendMode; + } var offscreenMask; if (__hasMask) { - if (renderMode === CANVAS$1 && !cache) { + if (renderMode === CANVAS && !cache) { var _width = root.width, _height = root.height; - var _c2 = inject.getCacheCanvas(_width, _height, null, 'mask1'); + var _c = inject.getCacheCanvas(_width, _height, null, 'mask1'); offscreenMask = { ctx: ctx, - target: _c2, + target: _c, matrix: matrix }; - ctx = _c2.ctx; + ctx = _c.ctx; } } // 无cache时canvas的blur需绘制到离屏上应用后反向绘制回来,有cache在Dom里另生成一个filter的cache @@ -18920,19 +18922,19 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var offscreenFilter; if (hasFilter) { - if (renderMode === CANVAS$1 && !cache) { + if (renderMode === CANVAS && !cache) { var _width2 = root.width, _height2 = root.height; - var _c3 = inject.getCacheCanvas(_width2, _height2, null, 'filter1'); + var _c2 = inject.getCacheCanvas(_width2, _height2, null, 'filter1'); offscreenFilter = { ctx: ctx, filter: filter, - target: _c3, + target: _c2, matrix: matrix }; - ctx = _c3.ctx; + ctx = _c2.ctx; } else if (renderMode === SVG) { virtualDom.filter = painter.svgFilter(filter); } @@ -18972,25 +18974,25 @@ var Xom$1 = /*#__PURE__*/function (_Node) { if (overflow === 'hidden' && display !== 'inline') { borderList = border.calRadius(bx1, by1, bx2 - bx1, by2 - by1, btlr, btrr, bbrr, bblr); - if (renderMode === CANVAS$1 && !cache) { + if (renderMode === CANVAS && !cache) { var _width3 = root.width, _height3 = root.height; - var _c4 = inject.getCacheCanvas(_width3, _height3, null, 'overflow'); + var _c3 = inject.getCacheCanvas(_width3, _height3, null, 'overflow'); offscreenOverflow = { ctx: ctx, - target: _c4, + target: _c3, matrix: matrix }; - ctx = _c4.ctx; + ctx = _c3.ctx; offscreenOverflow.x = x1; offscreenOverflow.y = y1; offscreenOverflow.offsetWidth = offsetWidth; offscreenOverflow.offsetHeight = offsetHeight; offscreenOverflow.list = borderList; } else if (renderMode === SVG) { - var d = svgPolygon$5(borderList) || "M".concat(x1, ",").concat(y1, "L").concat(x1 + offsetWidth, ",").concat(y1, "L").concat(x1 + offsetWidth, ",").concat(y1 + offsetHeight, "L").concat(x1, ",").concat(y1 + offsetHeight, ",L").concat(x1, ",").concat(y1); + var d = svgPolygon$2(borderList) || "M".concat(x1, ",").concat(y1, "L").concat(x1 + offsetWidth, ",").concat(y1, "L").concat(x1 + offsetWidth, ",").concat(y1 + offsetHeight, "L").concat(x1, ",").concat(y1 + offsetHeight, ",L").concat(x1, ",").concat(y1); var v = { tagName: 'clipPath', props: [], @@ -19010,7 +19012,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { } // 无法使用缓存时主画布直接绘制需设置 - if (renderMode === CANVAS$1 && !cache) { + if (renderMode === CANVAS && !cache) { res.offscreenBlend = offscreenBlend; res.offscreenMask = offscreenMask; res.offscreenFilter = offscreenFilter; @@ -19021,7 +19023,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { } // 隐藏不渲染 - if ((visibility === 'hidden' || res["break"]) && (renderMode === CANVAS$1 || renderMode === WEBGL$1)) { + if ((visibility === 'hidden' || res["break"]) && (renderMode === CANVAS || renderMode === WEBGL)) { res["break"] = true; return res; } @@ -19049,9 +19051,9 @@ var Xom$1 = /*#__PURE__*/function (_Node) { if (length) { var _ret = function () { - var fontSize = computedStyle[FONT_SIZE$8], - fontFamily = computedStyle[FONT_FAMILY$4], - lineHeight = computedStyle[LINE_HEIGHT$3]; + var fontSize = computedStyle[FONT_SIZE$9], + fontFamily = computedStyle[FONT_FAMILY], + lineHeight = computedStyle[LINE_HEIGHT$1]; var iw = 0, ih = 0; var offscreen, @@ -19069,7 +19071,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { ih += paddingTop + paddingBottom + borderTopWidth + borderBottomWidth; } - if (renderMode === CANVAS$1 || renderMode === WEBGL$1) { + if (renderMode === CANVAS || renderMode === WEBGL) { offscreen = inject.getCacheCanvas(iw, ih, '__$$INLINE_BGI$$__'); } @@ -19096,7 +19098,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { if (gd) { if (gd.k === 'conic') { - var _uuid = gradient$1.renderConic(_this6, renderMode, offscreen && offscreen.ctx || ctx, gd.v, 0, 0, iw, lineHeight, btlr, btrr, bbrr, bblr, true); + var _uuid = gradient.renderConic(_this6, renderMode, offscreen && offscreen.ctx || ctx, gd.v, 0, 0, iw, lineHeight, btlr, btrr, bbrr, bblr, true); if (renderMode === SVG && _uuid) { svgBgSymbol.push(_uuid); @@ -19117,7 +19119,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var ff = css.getFontFamily(fontFamily); var baseLine = css.getBaseLine(computedStyle); // lineGap,一般为0,某些字体如arial有,渲染高度需减去它,最终是lineHeight - diffL - var diffL = fontSize * (o$1.info[ff].lgr || 0); // 注意只有1个的时候特殊情况,圆角只在首尾行出现 + var diffL = fontSize * (o$3.info[ff].lgr || 0); // 注意只有1个的时候特殊情况,圆角只在首尾行出现 var isFirst = true; var lastContentBox = contentBoxList[0], @@ -19155,32 +19157,32 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var w = ix2 - ix1; // canvas的bg位图裁剪 - if ((renderMode === CANVAS$1 || renderMode === WEBGL$1) && offscreen) { + if ((renderMode === CANVAS || renderMode === WEBGL) && offscreen) { ctx.drawImage(offscreen.canvas, countW, 0, w, ih, ix1 + dx, iy1 + dy, w, ih); } //svg则特殊判断 else if (renderMode === SVG && svgBgSymbol.length) { - svgBgSymbol.forEach(function (symbol) { - if (symbol) { - var _v3 = { - tagName: 'clipPath', - props: [], - children: [{ - tagName: 'path', - props: [['d', "M".concat(countW, ",", 0, "L").concat(w + countW, ",", 0, "L").concat(w + countW, ",").concat(ih, "L").concat(countW, ",").concat(ih, ",L").concat(countW, ",", 0)]] - }] - }; - var clip = ctx.add(_v3); - - __config[NODE_DEFS_CACHE$3].push(_v3); - - virtualDom.bb.push({ - type: 'item', - tagName: 'use', - props: [['xlink:href', '#' + symbol], ['x', ix1 - countW], ['y', iy1], ['clip-path', 'url(#' + clip + ')']] - }); - } - }); - } + svgBgSymbol.forEach(function (symbol) { + if (symbol) { + var _v3 = { + tagName: 'clipPath', + props: [], + children: [{ + tagName: 'path', + props: [['d', "M".concat(countW, ",", 0, "L").concat(w + countW, ",", 0, "L").concat(w + countW, ",").concat(ih, "L").concat(countW, ",").concat(ih, ",L").concat(countW, ",", 0)]] + }] + }; + var clip = ctx.add(_v3); + + __config[NODE_DEFS_CACHE$3].push(_v3); + + virtualDom.bb.push({ + type: 'item', + tagName: 'use', + props: [['xlink:href', '#' + symbol], ['x', ix1 - countW], ['y', iy1], ['clip-path', 'url(#' + clip + ')']] + }); + } + }); + } countW += w; @@ -19256,32 +19258,32 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var w = ix2 - ix1; // canvas的bg位图裁剪 - if ((renderMode === CANVAS$1 || renderMode === WEBGL$1) && offscreen) { + if ((renderMode === CANVAS || renderMode === WEBGL) && offscreen) { ctx.drawImage(offscreen.canvas, countW, 0, w, ih, ix1 + dx, iy1 + dy, w, ih); } //svg则特殊判断 else if (renderMode === SVG && svgBgSymbol.length) { - svgBgSymbol.forEach(function (symbol) { - if (symbol) { - var _v4 = { - tagName: 'clipPath', - props: [], - children: [{ - tagName: 'path', - props: [['d', "M".concat(countW, ",", 0, "L").concat(w + countW, ",", 0, "L").concat(w + countW, ",").concat(ih, "L").concat(countW, ",").concat(ih, ",L").concat(countW, ",", 0)]] - }] - }; - var clip = ctx.add(_v4); - - __config[NODE_DEFS_CACHE$3].push(_v4); - - virtualDom.bb.push({ - type: 'item', - tagName: 'use', - props: [['xlink:href', '#' + symbol], ['x', ix1 - countW], ['y', iy1], ['clip-path', 'url(#' + clip + ')']] - }); - } - }); - } + svgBgSymbol.forEach(function (symbol) { + if (symbol) { + var _v4 = { + tagName: 'clipPath', + props: [], + children: [{ + tagName: 'path', + props: [['d', "M".concat(countW, ",", 0, "L").concat(w + countW, ",", 0, "L").concat(w + countW, ",").concat(ih, "L").concat(countW, ",").concat(ih, ",L").concat(countW, ",", 0)]] + }] + }; + var clip = ctx.add(_v4); + + __config[NODE_DEFS_CACHE$3].push(_v4); + + virtualDom.bb.push({ + type: 'item', + tagName: 'use', + props: [['xlink:href', '#' + symbol], ['x', ix1 - countW], ['y', iy1], ['clip-path', 'url(#' + clip + ')']] + }); + } + }); + } if (boxShadow) { boxShadow.forEach(function (item) { @@ -19341,8 +19343,8 @@ var Xom$1 = /*#__PURE__*/function (_Node) { if (_typeof(_ret) === "object") return _ret.v; } // 无内容且无尺寸的无需渲染 else if (bx1 === bx2 || by1 === by2) { - return res; - } + return res; + } } // block渲染,bgc垫底 @@ -19371,7 +19373,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { if (gd) { if (gd.k === 'conic') { - gradient$1.renderConic(_this6, renderMode, ctx, gd.v, bx1, by1, bx2 - bx1, by2 - by1, btlr, btrr, bbrr, bblr); + gradient.renderConic(_this6, renderMode, ctx, gd.v, bx1, by1, bx2 - bx1, by2 - by1, btlr, btrr, bbrr, bblr); } else { bg.renderBgc(_this6, renderMode, ctx, gd.v, borderList, bx1, by1, bx2 - bx1, by2 - by1, btlr, btrr, bbrr, bblr); } @@ -19432,7 +19434,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { computedStyle = this.computedStyle, isMask = this.isMask; - if (isDestroyed || computedStyle[DISPLAY$3] === 'none' || e.__stopPropagation || isMask) { + if (isDestroyed || computedStyle[DISPLAY$7] === 'none' || e.__stopPropagation || isMask) { return; } @@ -19499,7 +19501,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { return; } - var inThis = geom.pointInQuadrilateral(x, y, __sx1, __sy1, __sx1 + offsetWidth, __sy1, __sx1 + offsetWidth, __sy1 + offsetHeight, __sx1, __sy1 + offsetHeight, matrixEvent); + var inThis = geom$1.pointInQuadrilateral(x, y, __sx1, __sy1, __sx1 + offsetWidth, __sy1, __sx1 + offsetWidth, __sy1 + offsetHeight, __sx1, __sy1 + offsetHeight, matrixEvent); if (inThis) { if (!e.target && !ignore) { @@ -19536,10 +19538,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { }; if (k === 'linear') { - var gd = gradient$1.getLinear(v, d, bx1, by1, cx, cy, iw, ih, this.root); + var gd = gradient.getLinear(v, d, bx1, by1, cx, cy, iw, ih, this.root); res.v = this.__getLg(renderMode, ctx, gd); } else if (k === 'radial') { - var _gd = gradient$1.getRadial(v, s, z, p, bx1, by1, bx2, by2, this.root); + var _gd = gradient.getRadial(v, s, z, p, bx1, by1, bx2, by2, this.root); if (_gd) { res.v = this.__getRg(renderMode, ctx, _gd); @@ -19553,7 +19555,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var m1 = Math.max(Math.abs(bbox[2] - bbox[0]), Math.abs(bbox[3] - bbox[1])); var m2 = Math.max(Math.abs(iw), Math.abs(ih)); - var _gd2 = gradient$1.getConic(v, d, p, bx1, by1, bx2, by2, m1 / m2, this.root); + var _gd2 = gradient.getConic(v, d, p, bx1, by1, bx2, by2, m1 / m2, this.root); res.v = this.__getCg(renderMode, ctx, _gd2); } @@ -19563,10 +19565,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { }, { key: "__getLg", value: function __getLg(renderMode, ctx, gd) { - if (renderMode === CANVAS$1 || renderMode === WEBGL$1) { + if (renderMode === CANVAS || renderMode === WEBGL) { var lg = ctx.createLinearGradient(gd.x1, gd.y1, gd.x2, gd.y2); gd.stop.forEach(function (item) { - lg.addColorStop(item[1], int2rgba$2(item[0])); + lg.addColorStop(item[1], int2rgba$1(item[0])); }); return lg; } else if (renderMode === SVG) { @@ -19576,7 +19578,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { children: gd.stop.map(function (item) { return { tagName: 'stop', - props: [['stop-color', int2rgba$2(item[0])], ['offset', item[1] * 100 + '%']] + props: [['stop-color', int2rgba$1(item[0])], ['offset', item[1] * 100 + '%']] }; }) }; @@ -19590,10 +19592,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { }, { key: "__getRg", value: function __getRg(renderMode, ctx, gd) { - if (renderMode === CANVAS$1 || renderMode === WEBGL$1) { + if (renderMode === CANVAS || renderMode === WEBGL) { var rg = ctx.createRadialGradient(gd.cx, gd.cy, 0, gd.cx, gd.cy, gd.r); gd.stop.forEach(function (item) { - rg.addColorStop(item[1], int2rgba$2(item[0])); + rg.addColorStop(item[1], int2rgba$1(item[0])); }); return rg; } else if (renderMode === SVG) { @@ -19603,7 +19605,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { children: gd.stop.map(function (item) { return { tagName: 'stop', - props: [['stop-color', int2rgba$2(item[0])], ['offset', item[1] * 100 + '%']] + props: [['stop-color', int2rgba$1(item[0])], ['offset', item[1] * 100 + '%']] }; }) }; @@ -19635,7 +19637,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var res = []; - if (renderMode === CANVAS$1 || renderMode === WEBGL$1) { + if (renderMode === CANVAS || renderMode === WEBGL) { return gd; } else if (renderMode === SVG) { var offset = 0.5; @@ -19658,12 +19660,12 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var pc = [dc[0] / n, dc[1] / n, dc[2] / n, dc[3] / n]; for (var j = 0; j < n; j++) { - var _geom$pointOnCircle = geom.pointOnCircle(cx, cy, r, begin + per * j + deg - offset), + var _geom$pointOnCircle = geom$1.pointOnCircle(cx, cy, r, begin + per * j + deg - offset), _geom$pointOnCircle2 = _slicedToArray(_geom$pointOnCircle, 2), x1 = _geom$pointOnCircle2[0], y1 = _geom$pointOnCircle2[1]; - var _geom$pointOnCircle3 = geom.pointOnCircle(cx, cy, r, begin + per * j + deg + offset), + var _geom$pointOnCircle3 = geom$1.pointOnCircle(cx, cy, r, begin + per * j + deg + offset), _geom$pointOnCircle4 = _slicedToArray(_geom$pointOnCircle3, 2), _x = _geom$pointOnCircle4[0], _y = _geom$pointOnCircle4[1]; @@ -19675,7 +19677,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var end = list[0].slice(0); - var _geom$pointOnCircle5 = geom.pointOnCircle(cx, cy, r, deg), + var _geom$pointOnCircle5 = geom$1.pointOnCircle(cx, cy, r, deg), _geom$pointOnCircle6 = _slicedToArray(_geom$pointOnCircle5, 2), x2 = _geom$pointOnCircle6[0], y2 = _geom$pointOnCircle6[1]; @@ -19698,10 +19700,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { props: [['x1', prev[0]], ['y1', prev[1]], ['x2', cur[2]], ['y2', cur[3]]], children: [{ tagName: 'stop', - props: [['stop-color', int2rgba$2([prev[4], prev[5], prev[6], prev[7]])], ['offset', '0%']] + props: [['stop-color', int2rgba$1([prev[4], prev[5], prev[6], prev[7]])], ['offset', '0%']] }, { tagName: 'stop', - props: [['stop-color', int2rgba$2([cur[4], cur[5], cur[6], cur[7]])], ['offset', '100%']] + props: [['stop-color', int2rgba$1([cur[4], cur[5], cur[6], cur[7]])], ['offset', '100%']] }] }; var uuid = ctx.add(v); @@ -19722,14 +19724,14 @@ var Xom$1 = /*#__PURE__*/function (_Node) { key: "clearCache", value: function clearCache(onlyTotal) { var __config = this.__config; - var __cacheTotal = __config[NODE_CACHE_TOTAL]; - var __cacheFilter = __config[NODE_CACHE_FILTER$1]; - var __cacheMask = __config[NODE_CACHE_MASK]; - var __cacheOverflow = __config[NODE_CACHE_OVERFLOW$1]; + var __cacheTotal = __config[NODE_CACHE_TOTAL$2]; + var __cacheFilter = __config[NODE_CACHE_FILTER$2]; + var __cacheMask = __config[NODE_CACHE_MASK$2]; + var __cacheOverflow = __config[NODE_CACHE_OVERFLOW$2]; if (!onlyTotal) { - __config[NODE_CACHE_STYLE] = this.__cacheStyle = {}; - var __cache = __config[NODE_CACHE$2]; + __config[NODE_CACHE_STYLE$2] = this.__cacheStyle = {}; + var __cache = __config[NODE_CACHE$3]; if (__cache) { __cache.release(); @@ -19771,18 +19773,18 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var res = {}; - res[UPDATE_NODE$2] = node; + res[UPDATE_NODE$3] = node; res[UPDATE_STYLE$1] = formatStyle; - res[UPDATE_OVERWRITE] = style; // 标识盖原有style样式不仅仅是修改currentStyle,不同于animate + res[UPDATE_OVERWRITE$1] = style; // 标识盖原有style样式不仅仅是修改currentStyle,不同于animate res[UPDATE_KEYS$1] = Object.keys(formatStyle).map(function (i) { - if (!GEOM$4.hasOwnProperty(i)) { + if (!GEOM.hasOwnProperty(i)) { i = parseInt(i); } return i; }); - res[UPDATE_CONFIG$2] = __config; + res[UPDATE_CONFIG$3] = __config; root.__addUpdate(node, __config, root, root.__config, res); }, @@ -19794,12 +19796,12 @@ var Xom$1 = /*#__PURE__*/function (_Node) { }); } // 没有是在如parse()还未添加的时候,可以直接同步覆盖 else { - Object.assign(this.currentStyle, formatStyle); + Object.assign(this.currentStyle, formatStyle); - if (util.isFunction(cb)) { - cb.call(node, -1); - } + if (util.isFunction(cb)) { + cb.call(node, -1); } + } } // 传入格式化好key/value的样式 }, { @@ -19820,16 +19822,16 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var res = {}; - res[UPDATE_NODE$2] = node; + res[UPDATE_NODE$3] = node; res[UPDATE_STYLE$1] = style; res[UPDATE_KEYS$1] = Object.keys(style).map(function (i) { - if (!GEOM$4.hasOwnProperty(i)) { + if (!GEOM.hasOwnProperty(i)) { i = parseInt(i); } return i; }); - res[UPDATE_CONFIG$2] = __config; + res[UPDATE_CONFIG$3] = __config; root.__addUpdate(node, __config, root, root.__config, res); }, @@ -19841,12 +19843,12 @@ var Xom$1 = /*#__PURE__*/function (_Node) { }); } // 没有是在如parse()还未添加的时候,可以直接同步覆盖 else { - Object.assign(this.currentStyle, style); + Object.assign(this.currentStyle, style); - if (util.isFunction(cb)) { - cb.call(node, -1); - } + if (util.isFunction(cb)) { + cb.call(node, -1); } + } } }, { key: "animate", @@ -19959,7 +19961,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { } if (lv !== undefined) { - this.__config[NODE_REFRESH_LV] |= lv; + this.__config[NODE_REFRESH_LV$2] |= lv; } this.__sx1 += diff; @@ -19980,7 +19982,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { } if (lv !== undefined) { - this.__config[NODE_REFRESH_LV] |= lv; + this.__config[NODE_REFRESH_LV$2] |= lv; } this.__sy1 += diff; @@ -20007,7 +20009,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { } if (lv !== undefined) { - this.__config[NODE_REFRESH_LV] |= lv; + this.__config[NODE_REFRESH_LV$2] |= lv; } this.clearCache(); @@ -20029,7 +20031,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { } if (lv !== undefined) { - this.__config[NODE_REFRESH_LV] |= lv; + this.__config[NODE_REFRESH_LV$2] |= lv; } this.clearCache(); @@ -20084,17 +20086,17 @@ var Xom$1 = /*#__PURE__*/function (_Node) { } keys = keys.map(function (s) { - return STYLE_KEY$5[style2Upper$2(s)]; + return STYLE_KEY[style2Upper(s)]; }); } else { keys = Object.keys(computedStyle); } keys.forEach(function (k) { - if (GEOM$4.hasOwnProperty(k)) { + if (GEOM.hasOwnProperty(k)) { res[k] = computedStyle[k]; } else { - res[STYLE_RV_KEY$2[k]] = computedStyle[k]; + res[STYLE_RV_KEY[k]] = computedStyle[k]; } }); return res; @@ -20107,10 +20109,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { offsetWidth = this.offsetWidth, offsetHeight = this.offsetHeight, matrixEvent = this.matrixEvent; - var p1 = point2d$1(mx.calPoint([__sx1, __sy1], matrixEvent)); - var p2 = point2d$1(mx.calPoint([__sx1 + offsetWidth, __sy1], matrixEvent)); - var p3 = point2d$1(mx.calPoint([__sx1 + offsetWidth, __sy1 + offsetHeight], matrixEvent)); - var p4 = point2d$1(mx.calPoint([__sx1, __sy1 + offsetHeight], matrixEvent)); + var p1 = point2d(mx.calPoint([__sx1, __sy1], matrixEvent)); + var p2 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1], matrixEvent)); + var p3 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1 + offsetHeight], matrixEvent)); + var p4 = point2d(mx.calPoint([__sx1, __sy1 + offsetHeight], matrixEvent)); return { left: Math.min(p1[0], Math.min(p2[0], Math.min(p3[0], p4[0]))), top: Math.min(p1[1], Math.min(p2[1], Math.min(p3[1], p4[1]))), @@ -20176,10 +20178,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { var res = {}; - res[UPDATE_NODE$2] = self; - res[UPDATE_FOCUS$1] = o$3.REFLOW; - res[UPDATE_REMOVE_DOM] = true; - res[UPDATE_CONFIG$2] = self.__config; + res[UPDATE_NODE$3] = self; + res[UPDATE_FOCUS$3] = o$1.REFLOW; + res[UPDATE_REMOVE_DOM$1] = true; + res[UPDATE_CONFIG$3] = self.__config; root.__addUpdate(self, self.__config, root, root.__config, res); }, @@ -20246,12 +20248,18 @@ var Xom$1 = /*#__PURE__*/function (_Node) { __sy1 = this.__sy1, clientWidth = this.clientWidth, clientHeight = this.clientHeight, - _this$currentStyle = this.currentStyle, - borderTopWidth = _this$currentStyle[BORDER_TOP_WIDTH$2], - borderRightWidth = _this$currentStyle[BORDER_RIGHT_WIDTH$2], - borderBottomWidth = _this$currentStyle[BORDER_BOTTOM_WIDTH$2], - borderLeftWidth = _this$currentStyle[BORDER_LEFT_WIDTH$3], - boxShadow = _this$currentStyle[BOX_SHADOW$2]; + _this$currentStyle = this.currentStyle; + _this$currentStyle = _this$currentStyle === void 0 ? {} : _this$currentStyle; + var _this$currentStyle$BO = _this$currentStyle[BORDER_TOP_WIDTH$4], + borderTopWidth = _this$currentStyle$BO === void 0 ? [0] : _this$currentStyle$BO, + _this$currentStyle$BO2 = _this$currentStyle[BORDER_RIGHT_WIDTH$4], + borderRightWidth = _this$currentStyle$BO2 === void 0 ? [0] : _this$currentStyle$BO2, + _this$currentStyle$BO3 = _this$currentStyle[BORDER_BOTTOM_WIDTH$4], + borderBottomWidth = _this$currentStyle$BO3 === void 0 ? [0] : _this$currentStyle$BO3, + _this$currentStyle$BO4 = _this$currentStyle[BORDER_LEFT_WIDTH$5], + borderLeftWidth = _this$currentStyle$BO4 === void 0 ? [0] : _this$currentStyle$BO4, + _this$currentStyle$BO5 = _this$currentStyle[BOX_SHADOW$7], + boxShadow = _this$currentStyle$BO5 === void 0 ? [] : _this$currentStyle$BO5; var _this$__spreadBbox = this.__spreadBbox(boxShadow), _this$__spreadBbox2 = _slicedToArray(_this$__spreadBbox, 2), @@ -20274,7 +20282,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { }, { key: "matrix", get: function get() { - return this.__config[NODE_MATRIX$1]; + return this.__config[NODE_MATRIX$2]; } }, { key: "matrixEvent", @@ -20284,7 +20292,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { }, { key: "perspectiveMatrix", get: function get() { - return this.__config[NODE_PERSPECTIVE_MATRIX]; + return this.__config[NODE_PERSPECTIVE_MATRIX$1]; } }, { key: "style", @@ -20341,14 +20349,14 @@ var Xom$1 = /*#__PURE__*/function (_Node) { return Xom; }(Node); -var _enums$STYLE_KEY$d = enums.STYLE_KEY, - DISPLAY$4 = _enums$STYLE_KEY$d.DISPLAY, - MARGIN_LEFT$2 = _enums$STYLE_KEY$d.MARGIN_LEFT, - BORDER_LEFT_WIDTH$4 = _enums$STYLE_KEY$d.BORDER_LEFT_WIDTH, - PADDING_LEFT$3 = _enums$STYLE_KEY$d.PADDING_LEFT, - PADDING_RIGHT$2 = _enums$STYLE_KEY$d.PADDING_RIGHT, - BORDER_RIGHT_WIDTH$3 = _enums$STYLE_KEY$d.BORDER_RIGHT_WIDTH, - MARGIN_RIGHT$2 = _enums$STYLE_KEY$d.MARGIN_RIGHT; +var _enums$STYLE_KEY$c = enums.STYLE_KEY, + DISPLAY$6 = _enums$STYLE_KEY$c.DISPLAY, + MARGIN_LEFT$4 = _enums$STYLE_KEY$c.MARGIN_LEFT, + BORDER_LEFT_WIDTH$4 = _enums$STYLE_KEY$c.BORDER_LEFT_WIDTH, + PADDING_LEFT$4 = _enums$STYLE_KEY$c.PADDING_LEFT, + PADDING_RIGHT$3 = _enums$STYLE_KEY$c.PADDING_RIGHT, + BORDER_RIGHT_WIDTH$3 = _enums$STYLE_KEY$c.BORDER_RIGHT_WIDTH, + MARGIN_RIGHT$3 = _enums$STYLE_KEY$c.MARGIN_RIGHT; /** * css中常见的概念,一行内容,里面可能有若干不同的内容,仅在布局阶段出现,不参与渲染逻辑 * 本类是个抽象逻辑概念,会包含Text的内容TextBox和inlineBlock等节点,而内容TextBox则属于Text @@ -20457,10 +20465,10 @@ var LineBox = /*#__PURE__*/function () { while (true) { var _list = dom.contentBoxList; var _dom$computedStyle = dom.computedStyle, - display = _dom$computedStyle[DISPLAY$4], - marginLeft = _dom$computedStyle[MARGIN_LEFT$2], + display = _dom$computedStyle[DISPLAY$6], + marginLeft = _dom$computedStyle[MARGIN_LEFT$4], borderLeftWidth = _dom$computedStyle[BORDER_LEFT_WIDTH$4], - paddingLeft = _dom$computedStyle[PADDING_LEFT$3]; + paddingLeft = _dom$computedStyle[PADDING_LEFT$4]; if (display !== 'inline') { break; @@ -20479,10 +20487,10 @@ var LineBox = /*#__PURE__*/function () { while (true) { var _list2 = dom.contentBoxList; var _dom$computedStyle2 = dom.computedStyle, - _display = _dom$computedStyle2[DISPLAY$4], - marginRight = _dom$computedStyle2[MARGIN_RIGHT$2], + _display = _dom$computedStyle2[DISPLAY$6], + marginRight = _dom$computedStyle2[MARGIN_RIGHT$3], borderRightWidth = _dom$computedStyle2[BORDER_RIGHT_WIDTH$3], - paddingRight = _dom$computedStyle2[PADDING_RIGHT$2]; + paddingRight = _dom$computedStyle2[PADDING_RIGHT$3]; if (_display !== 'inline') { break; @@ -20891,16 +20899,16 @@ var tag = { BOLD: BOLD }; -var _enums$STYLE_KEY$e = enums.STYLE_KEY, - DISPLAY$5 = _enums$STYLE_KEY$e.DISPLAY, - TOP$2 = _enums$STYLE_KEY$e.TOP, - BOTTOM$2 = _enums$STYLE_KEY$e.BOTTOM, - POSITION$2 = _enums$STYLE_KEY$e.POSITION, - HEIGHT$4 = _enums$STYLE_KEY$e.HEIGHT; -var AUTO$5 = o.AUTO, - PX$7 = o.PX, - PERCENT$8 = o.PERCENT; -var REFLOW$1 = o$3.REFLOW; +var _enums$STYLE_KEY$b = enums.STYLE_KEY, + DISPLAY$5 = _enums$STYLE_KEY$b.DISPLAY, + TOP$2 = _enums$STYLE_KEY$b.TOP, + BOTTOM$2 = _enums$STYLE_KEY$b.BOTTOM, + POSITION$3 = _enums$STYLE_KEY$b.POSITION, + HEIGHT$4 = _enums$STYLE_KEY$b.HEIGHT; +var AUTO$3 = o$4.AUTO, + PX$4 = o$4.PX, + PERCENT$4 = o$4.PERCENT; +var REFLOW$1 = o$1.REFLOW; function offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) { if (dy) { @@ -20918,7 +20926,7 @@ function offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) { if (parent) { var cs = parent.computedStyle; - var ps = cs[POSITION$2]; + var ps = cs[POSITION$3]; isContainer = parent === root || parent.isShadowRoot || ps === 'relative' || ps === 'absolute'; } // 先偏移next,忽略有定位的absolute,本身非container也忽略 @@ -20928,25 +20936,25 @@ function offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) { while (next) { if (next.currentStyle[DISPLAY$5] !== 'none') { - if (next.currentStyle[POSITION$2] === 'absolute') { + if (next.currentStyle[POSITION$3] === 'absolute') { var _next$currentStyle = next.currentStyle, top = _next$currentStyle[TOP$2], bottom = _next$currentStyle[BOTTOM$2], height = _next$currentStyle[HEIGHT$4]; - if (top[1] === AUTO$5) { - if (bottom[1] === AUTO$5 || bottom[1] === PX$7) { + if (top[1] === AUTO$3) { + if (bottom[1] === AUTO$3 || bottom[1] === PX$4) { next.__offsetY(dy, true, REFLOW$1); next.clearCache(); - } else if (bottom[1] === PERCENT$8) { + } else if (bottom[1] === PERCENT$4) { var v = (1 - bottom[0] * 0.01) * dy; next.__offsetY(v, true, REFLOW$1); next.clearCache(); } - } else if (top[1] === PERCENT$8) { + } else if (top[1] === PERCENT$4) { var _v = top[0] * 0.01 * dy; next.__offsetY(_v, true, REFLOW$1); @@ -20955,7 +20963,7 @@ function offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) { } // 高度百分比需发生变化的重新布局,需要在容器内 - if (height[1] === PERCENT$8) { + if (height[1] === PERCENT$4) { if (isContainer) { parent.__layoutAbs(parent, null, next); } else { @@ -20969,7 +20977,7 @@ function offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) { var _cs = container.currentStyle; - if (_cs[POSITION$2] === 'absolute' || _cs[POSITION$2] === 'relative') { + if (_cs[POSITION$3] === 'absolute' || _cs[POSITION$3] === 'relative') { break; } @@ -20999,17 +21007,17 @@ function offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) { var _node = node, currentStyle = _node.currentStyle; - var isAbs = currentStyle[POSITION$2] === 'absolute'; + var isAbs = currentStyle[POSITION$3] === 'absolute'; var need = void 0; if (isAbs) { - if (currentStyle[HEIGHT$4][1] === AUTO$5 && (currentStyle[TOP$2][1] === AUTO$5 || currentStyle[BOTTOM$2][1] === AUTO$5)) { + if (currentStyle[HEIGHT$4][1] === AUTO$3 && (currentStyle[TOP$2][1] === AUTO$3 || currentStyle[BOTTOM$2][1] === AUTO$3)) { need = true; } } // height不定则需要 - else if (currentStyle[HEIGHT$4][1] === AUTO$5) { - need = true; - } + else if (currentStyle[HEIGHT$4][1] === AUTO$3) { + need = true; + } if (need) { node.__resizeY(dy, REFLOW$1); @@ -21017,8 +21025,8 @@ function offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) { node.clearCache(); } // abs或者高度不需要继续向上调整提前跳出 else { - break; - } + break; + } if (node === root) { break; @@ -21076,70 +21084,70 @@ var reflow = { getMergeMarginTB: getMergeMarginTB }; -var _enums$STYLE_KEY$f = enums.STYLE_KEY, - POSITION$3 = _enums$STYLE_KEY$f.POSITION, - DISPLAY$6 = _enums$STYLE_KEY$f.DISPLAY, - FONT_WEIGHT$4 = _enums$STYLE_KEY$f.FONT_WEIGHT, - MARGIN_LEFT$3 = _enums$STYLE_KEY$f.MARGIN_LEFT, - MARGIN_TOP$1 = _enums$STYLE_KEY$f.MARGIN_TOP, - MARGIN_RIGHT$3 = _enums$STYLE_KEY$f.MARGIN_RIGHT, - MARGIN_BOTTOM$1 = _enums$STYLE_KEY$f.MARGIN_BOTTOM, - PADDING_LEFT$4 = _enums$STYLE_KEY$f.PADDING_LEFT, - PADDING_BOTTOM$2 = _enums$STYLE_KEY$f.PADDING_BOTTOM, - PADDING_RIGHT$3 = _enums$STYLE_KEY$f.PADDING_RIGHT, - PADDING_TOP$2 = _enums$STYLE_KEY$f.PADDING_TOP, - BORDER_TOP_WIDTH$3 = _enums$STYLE_KEY$f.BORDER_TOP_WIDTH, - BORDER_BOTTOM_WIDTH$3 = _enums$STYLE_KEY$f.BORDER_BOTTOM_WIDTH, - BORDER_RIGHT_WIDTH$4 = _enums$STYLE_KEY$f.BORDER_RIGHT_WIDTH, - BORDER_LEFT_WIDTH$5 = _enums$STYLE_KEY$f.BORDER_LEFT_WIDTH, - TOP$3 = _enums$STYLE_KEY$f.TOP, - RIGHT$1 = _enums$STYLE_KEY$f.RIGHT, - BOTTOM$3 = _enums$STYLE_KEY$f.BOTTOM, - LEFT$1 = _enums$STYLE_KEY$f.LEFT, - WIDTH$5 = _enums$STYLE_KEY$f.WIDTH, - HEIGHT$5 = _enums$STYLE_KEY$f.HEIGHT, - TEXT_ALIGN$2 = _enums$STYLE_KEY$f.TEXT_ALIGN, - FLEX_DIRECTION$2 = _enums$STYLE_KEY$f.FLEX_DIRECTION, - FLEX_BASIS$2 = _enums$STYLE_KEY$f.FLEX_BASIS, - FLEX_SHRINK$1 = _enums$STYLE_KEY$f.FLEX_SHRINK, - FLEX_GROW$1 = _enums$STYLE_KEY$f.FLEX_GROW, - ALIGN_SELF$1 = _enums$STYLE_KEY$f.ALIGN_SELF, - ALIGN_ITEMS$1 = _enums$STYLE_KEY$f.ALIGN_ITEMS, - JUSTIFY_CONTENT$1 = _enums$STYLE_KEY$f.JUSTIFY_CONTENT, - Z_INDEX$3 = _enums$STYLE_KEY$f.Z_INDEX, - WHITE_SPACE$2 = _enums$STYLE_KEY$f.WHITE_SPACE, - LINE_HEIGHT$4 = _enums$STYLE_KEY$f.LINE_HEIGHT, - LINE_CLAMP$1 = _enums$STYLE_KEY$f.LINE_CLAMP, - ORDER$1 = _enums$STYLE_KEY$f.ORDER, - FLEX_WRAP$1 = _enums$STYLE_KEY$f.FLEX_WRAP, - ALIGN_CONTENT$1 = _enums$STYLE_KEY$f.ALIGN_CONTENT, - OVERFLOW$2 = _enums$STYLE_KEY$f.OVERFLOW, - FONT_SIZE$9 = _enums$STYLE_KEY$f.FONT_SIZE, +var _enums$STYLE_KEY$a = enums.STYLE_KEY, + POSITION$2 = _enums$STYLE_KEY$a.POSITION, + DISPLAY$4 = _enums$STYLE_KEY$a.DISPLAY, + FONT_WEIGHT = _enums$STYLE_KEY$a.FONT_WEIGHT, + MARGIN_LEFT$3 = _enums$STYLE_KEY$a.MARGIN_LEFT, + MARGIN_TOP$3 = _enums$STYLE_KEY$a.MARGIN_TOP, + MARGIN_RIGHT$2 = _enums$STYLE_KEY$a.MARGIN_RIGHT, + MARGIN_BOTTOM$3 = _enums$STYLE_KEY$a.MARGIN_BOTTOM, + PADDING_LEFT$3 = _enums$STYLE_KEY$a.PADDING_LEFT, + PADDING_BOTTOM$3 = _enums$STYLE_KEY$a.PADDING_BOTTOM, + PADDING_RIGHT$2 = _enums$STYLE_KEY$a.PADDING_RIGHT, + PADDING_TOP$3 = _enums$STYLE_KEY$a.PADDING_TOP, + BORDER_TOP_WIDTH$3 = _enums$STYLE_KEY$a.BORDER_TOP_WIDTH, + BORDER_BOTTOM_WIDTH$3 = _enums$STYLE_KEY$a.BORDER_BOTTOM_WIDTH, + BORDER_RIGHT_WIDTH$2 = _enums$STYLE_KEY$a.BORDER_RIGHT_WIDTH, + BORDER_LEFT_WIDTH$3 = _enums$STYLE_KEY$a.BORDER_LEFT_WIDTH, + TOP$1 = _enums$STYLE_KEY$a.TOP, + RIGHT$1 = _enums$STYLE_KEY$a.RIGHT, + BOTTOM$1 = _enums$STYLE_KEY$a.BOTTOM, + LEFT$1 = _enums$STYLE_KEY$a.LEFT, + WIDTH$3 = _enums$STYLE_KEY$a.WIDTH, + HEIGHT$3 = _enums$STYLE_KEY$a.HEIGHT, + TEXT_ALIGN = _enums$STYLE_KEY$a.TEXT_ALIGN, + FLEX_DIRECTION = _enums$STYLE_KEY$a.FLEX_DIRECTION, + FLEX_BASIS$2 = _enums$STYLE_KEY$a.FLEX_BASIS, + FLEX_SHRINK = _enums$STYLE_KEY$a.FLEX_SHRINK, + FLEX_GROW = _enums$STYLE_KEY$a.FLEX_GROW, + ALIGN_SELF = _enums$STYLE_KEY$a.ALIGN_SELF, + ALIGN_ITEMS = _enums$STYLE_KEY$a.ALIGN_ITEMS, + JUSTIFY_CONTENT = _enums$STYLE_KEY$a.JUSTIFY_CONTENT, + Z_INDEX$1 = _enums$STYLE_KEY$a.Z_INDEX, + WHITE_SPACE = _enums$STYLE_KEY$a.WHITE_SPACE, + LINE_HEIGHT = _enums$STYLE_KEY$a.LINE_HEIGHT, + LINE_CLAMP = _enums$STYLE_KEY$a.LINE_CLAMP, + ORDER = _enums$STYLE_KEY$a.ORDER, + FLEX_WRAP = _enums$STYLE_KEY$a.FLEX_WRAP, + ALIGN_CONTENT = _enums$STYLE_KEY$a.ALIGN_CONTENT, + OVERFLOW$1 = _enums$STYLE_KEY$a.OVERFLOW, + FONT_SIZE$8 = _enums$STYLE_KEY$a.FONT_SIZE, _enums$NODE_KEY$5 = enums.NODE_KEY, - NODE_CURRENT_STYLE$2 = _enums$NODE_KEY$5.NODE_CURRENT_STYLE, - NODE_STYLE$2 = _enums$NODE_KEY$5.NODE_STYLE, + NODE_CURRENT_STYLE$4 = _enums$NODE_KEY$5.NODE_CURRENT_STYLE, + NODE_STYLE$3 = _enums$NODE_KEY$5.NODE_STYLE, NODE_STRUCT$2 = _enums$NODE_KEY$5.NODE_STRUCT, NODE_DOM_PARENT$3 = _enums$NODE_KEY$5.NODE_DOM_PARENT, - NODE_IS_INLINE$1 = _enums$NODE_KEY$5.NODE_IS_INLINE, - _enums$UPDATE_KEY$3 = enums.UPDATE_KEY, - UPDATE_NODE$3 = _enums$UPDATE_KEY$3.UPDATE_NODE, - UPDATE_FOCUS$2 = _enums$UPDATE_KEY$3.UPDATE_FOCUS, - UPDATE_ADD_DOM = _enums$UPDATE_KEY$3.UPDATE_ADD_DOM, - UPDATE_CONFIG$3 = _enums$UPDATE_KEY$3.UPDATE_CONFIG, - UPDATE_MEASURE$1 = _enums$UPDATE_KEY$3.UPDATE_MEASURE, - _enums$STRUCT_KEY$1 = enums.STRUCT_KEY, - STRUCT_NUM = _enums$STRUCT_KEY$1.STRUCT_NUM, - STRUCT_LV$1 = _enums$STRUCT_KEY$1.STRUCT_LV, - STRUCT_TOTAL = _enums$STRUCT_KEY$1.STRUCT_TOTAL, - STRUCT_CHILD_INDEX$1 = _enums$STRUCT_KEY$1.STRUCT_CHILD_INDEX, - STRUCT_INDEX$1 = _enums$STRUCT_KEY$1.STRUCT_INDEX; -var AUTO$6 = o.AUTO, - PX$8 = o.PX, - PERCENT$9 = o.PERCENT, - REM$8 = o.REM, - VW$8 = o.VW, - VH$8 = o.VH; -var calAbsolute$1 = css.calAbsolute, + NODE_IS_INLINE = _enums$NODE_KEY$5.NODE_IS_INLINE, + _enums$UPDATE_KEY$2 = enums.UPDATE_KEY, + UPDATE_NODE$2 = _enums$UPDATE_KEY$2.UPDATE_NODE, + UPDATE_FOCUS$2 = _enums$UPDATE_KEY$2.UPDATE_FOCUS, + UPDATE_ADD_DOM$1 = _enums$UPDATE_KEY$2.UPDATE_ADD_DOM, + UPDATE_CONFIG$2 = _enums$UPDATE_KEY$2.UPDATE_CONFIG, + UPDATE_MEASURE$1 = _enums$UPDATE_KEY$2.UPDATE_MEASURE, + _enums$STRUCT_KEY$2 = enums.STRUCT_KEY, + STRUCT_NUM = _enums$STRUCT_KEY$2.STRUCT_NUM, + STRUCT_LV$1 = _enums$STRUCT_KEY$2.STRUCT_LV, + STRUCT_TOTAL$2 = _enums$STRUCT_KEY$2.STRUCT_TOTAL, + STRUCT_CHILD_INDEX = _enums$STRUCT_KEY$2.STRUCT_CHILD_INDEX, + STRUCT_INDEX$1 = _enums$STRUCT_KEY$2.STRUCT_INDEX; +var AUTO$2 = o$4.AUTO, + PX$3 = o$4.PX, + PERCENT$3 = o$4.PERCENT, + REM$8 = o$4.REM, + VW$8 = o$4.VW, + VH$8 = o$4.VH; +var calAbsolute = css.calAbsolute, isRelativeOrAbsolute$1 = css.isRelativeOrAbsolute; function genZIndexChildren(dom) { @@ -21151,12 +21159,12 @@ function genZIndexChildren(dom) { children.forEach(function (item, i) { var child = item; - if (item instanceof Component$1) { + if (item instanceof Component) { item = item.shadowRoot; } // 遮罩单独保存后特殊排序 - if (item instanceof Xom$1 && item.isMask) { + if (item instanceof Xom && item.isMask) { // 开头的mc忽略,后续的连续mc以第一次出现为准 if (lastMaskIndex !== undefined) { mcHash[lastMaskIndex].push(item); @@ -21169,8 +21177,8 @@ function genZIndexChildren(dom) { } else { lastMaskIndex = undefined; - if (item instanceof Xom$1) { - child.__zIndex = item.currentStyle[Z_INDEX$3]; + if (item instanceof Xom) { + child.__zIndex = item.currentStyle[Z_INDEX$1]; if (isRelativeOrAbsolute$1(item)) { // 临时变量为排序使用 @@ -21224,12 +21232,12 @@ function genOrderChildren(flowChildren) { flowChildren.forEach(function (item, i) { var child = item; - if (item instanceof Component$1) { + if (item instanceof Component) { item = item.shadowRoot; } - if (item instanceof Xom$1) { - child.__order = item.currentStyle[ORDER$1]; + if (item instanceof Xom) { + child.__order = item.currentStyle[ORDER]; } else { child.__order = 0; } @@ -21248,7 +21256,7 @@ function genOrderChildren(flowChildren) { return normal; } -var Dom$1 = /*#__PURE__*/function (_Xom) { +var Dom = /*#__PURE__*/function (_Xom) { _inherits(Dom, _Xom); var _super = _createSuper(Dom); @@ -21278,7 +21286,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { } } - if (!style[FONT_WEIGHT$4] && tag.BOLD.hasOwnProperty(tagName)) { + if (!style[FONT_WEIGHT] && tag.BOLD.hasOwnProperty(tagName)) { style.fontWeight = 700; } @@ -21289,8 +21297,8 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { _this.__flexLine = []; // flex布局多行模式时存储行 var config = _this.__config; - config[NODE_CURRENT_STYLE$2] = _this.__currentStyle; - config[NODE_STYLE$2] = _this.__style; + config[NODE_CURRENT_STYLE$4] = _this.__currentStyle; + config[NODE_STYLE$3] = _this.__style; return _this; } @@ -21314,7 +21322,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { }); var total = arr.length - 1; res[STRUCT_NUM] = zIndexChildren.length; - res[STRUCT_TOTAL] = total; + res[STRUCT_TOTAL$2] = total; return arr; } }, { @@ -21325,9 +21333,9 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var __config = this.__config; var struct = __config[NODE_STRUCT$2]; - var total = struct[STRUCT_TOTAL] || 0; // 新生成了struct,引用也变了 + var total = struct[STRUCT_TOTAL$2] || 0; // 新生成了struct,引用也变了 - var nss = this.__structure(struct[STRUCT_INDEX$1], struct[STRUCT_LV$1], struct[STRUCT_CHILD_INDEX$1]); + var nss = this.__structure(struct[STRUCT_INDEX$1], struct[STRUCT_LV$1], struct[STRUCT_CHILD_INDEX]); (_root$__structs = root.__structs).splice.apply(_root$__structs, [struct[STRUCT_INDEX$1] + offset, total + 1].concat(_toConsumableArray(nss))); @@ -21335,10 +21343,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { if (this !== root) { struct = __config[NODE_STRUCT$2]; - d = (struct[STRUCT_TOTAL] || 0) - total; + d = (struct[STRUCT_TOTAL$2] || 0) - total; var ps = __config[NODE_DOM_PARENT$3].__config[NODE_STRUCT$2]; - ps[STRUCT_TOTAL] = ps[STRUCT_TOTAL] || 0; - ps[STRUCT_TOTAL] += d; + ps[STRUCT_TOTAL$2] = ps[STRUCT_TOTAL$2] || 0; + ps[STRUCT_TOTAL$2] += d; } return [struct, d]; @@ -21355,7 +21363,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { value: function __updateStruct(structs) { var _this$__config$NODE_S = this.__config[NODE_STRUCT$2], index = _this$__config$NODE_S[STRUCT_INDEX$1], - _this$__config$NODE_S2 = _this$__config$NODE_S[STRUCT_TOTAL], + _this$__config$NODE_S2 = _this$__config$NODE_S[STRUCT_TOTAL$2], total = _this$__config$NODE_S2 === void 0 ? 0 : _this$__config$NODE_S2; var zIndexChildren = this.__zIndexChildren = genZIndexChildren(this); var length = zIndexChildren.length; @@ -21365,7 +21373,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { } zIndexChildren.forEach(function (child, i) { - child.__config[NODE_STRUCT$2][STRUCT_CHILD_INDEX$1] = i; + child.__config[NODE_STRUCT$2][STRUCT_CHILD_INDEX] = i; }); // 按直接子节点划分为相同数量的若干段进行排序 var arr = []; @@ -21375,15 +21383,15 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { var child = structs[i]; var o = { child: child, - list: structs.slice(child[STRUCT_INDEX$1], child[STRUCT_INDEX$1] + child[STRUCT_TOTAL] + 1) + list: structs.slice(child[STRUCT_INDEX$1], child[STRUCT_INDEX$1] + child[STRUCT_TOTAL$2] + 1) }; arr.push(o); source.push(o); - i += child[STRUCT_TOTAL] || 0; + i += child[STRUCT_TOTAL$2] || 0; } arr.sort(function (a, b) { - return a.child[STRUCT_CHILD_INDEX$1] - b.child[STRUCT_CHILD_INDEX$1]; + return a.child[STRUCT_CHILD_INDEX] - b.child[STRUCT_CHILD_INDEX]; }); // 是否有变更,有才进行重新计算 var needSort; @@ -21421,24 +21429,24 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { value: function __tryLayInline(w, total) { var flowChildren = this.flowChildren, _this$currentStyle = this.currentStyle, - display = _this$currentStyle[DISPLAY$6], - width = _this$currentStyle[WIDTH$5], + display = _this$currentStyle[DISPLAY$4], + width = _this$currentStyle[WIDTH$3], 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,并且尝试孩子第一个能放下即可,如果是文字就是第一个字符 + marginRight = _this$currentStyle[MARGIN_RIGHT$2], + paddingLeft = _this$currentStyle[PADDING_LEFT$3], + paddingRight = _this$currentStyle[PADDING_RIGHT$2], + borderLeftWidth = _this$currentStyle[BORDER_LEFT_WIDTH$3], + borderRightWidth = _this$currentStyle[BORDER_RIGHT_WIDTH$2]; // inline没w/h,并且尝试孩子第一个能放下即可,如果是文字就是第一个字符 if (display === 'inline') { if (flowChildren.length) { var first = flowChildren[0]; - if (first instanceof Component$1) { + if (first instanceof Component) { first = first.shadowRoot; } - if (first instanceof Xom$1) { + if (first instanceof Xom) { w = first.__tryLayInline(w, total); } else { w -= first.firstCharWidth; @@ -21446,103 +21454,103 @@ 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 { - for (var i = 0; i < flowChildren.length; i++) { - // 当放不下时直接返回,无需继续多余的尝试计算 - if (w < 0) { - return w; - } + if (width[1] === PX$3) { + w -= width[0]; + } else if (width[1] === PERCENT$3) { + w -= total * width[0] * 0.01; + } else if (width[1] === REM$8) { + w -= width[0] * this.root.computedStyle[FONT_SIZE$8]; + } 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 { + for (var i = 0; i < flowChildren.length; i++) { + // 当放不下时直接返回,无需继续多余的尝试计算 + if (w < 0) { + return w; + } - var item = flowChildren[i]; + var item = flowChildren[i]; - if (item instanceof Component$1) { - item = item.shadowRoot; - } + if (item instanceof Component) { + item = item.shadowRoot; + } - if (item instanceof Xom$1) { - w = item.__tryLayInline(w, total); - } // text强制一行,否则非头就是放不下,需从头开始 - else { - w -= item.textWidth; - } + if (item instanceof Xom) { + w = item.__tryLayInline(w, total); + } // text强制一行,否则非头就是放不下,需从头开始 + else { + w -= item.textWidth; } - } // 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; - } - - 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; - } - - 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; - } - } // 还要减去开头的mpb - - - if (marginLeft[1] === PX$8) { + } + } // ib要减去末尾mpb + + + if (marginRight[1] === PX$3) { + w -= marginRight[0]; + } else if (marginRight[1] === PERCENT$3) { + w -= marginRight[0] * total * 0.01; + } else if (marginRight[1] === REM$8) { + w -= marginRight[0] * this.root.computedStyle[FONT_SIZE$8]; + } 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; + } + + if (paddingRight[1] === PX$3) { + w -= paddingRight[0]; + } else if (paddingRight[1] === PERCENT$3) { + w -= paddingRight[0] * total * 0.01; + } else if (paddingRight[1] === REM$8) { + w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE$8]; + } 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; + } + + if (borderRightWidth[1] === PX$3) { + w -= borderRightWidth[0]; + } else if (borderRightWidth[1] === REM$8) { + w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$8]; + } 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; + } + } // 还要减去开头的mpb + + + if (marginLeft[1] === PX$3) { w -= marginLeft[0]; - } else if (marginLeft[1] === PERCENT$9) { + } else if (marginLeft[1] === PERCENT$3) { w -= marginLeft[0] * total * 0.01; } else if (marginLeft[1] === REM$8) { - w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE$9]; + w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE$8]; } 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; } - if (paddingLeft[1] === PX$8) { + if (paddingLeft[1] === PX$3) { w -= paddingLeft[0]; - } else if (paddingLeft[1] === PERCENT$9) { + } else if (paddingLeft[1] === PERCENT$3) { w -= paddingLeft[0] * total * 0.01; } else if (paddingLeft[1] === REM$8) { - w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE$9]; + w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE$8]; } 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; } - if (borderLeftWidth[1] === PX$8) { + if (borderLeftWidth[1] === PX$3) { w -= borderLeftWidth[0]; } else if (borderLeftWidth[1] === REM$8) { - w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$9]; + w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$8]; } else if (borderLeftWidth[1] === VW$8) { w -= borderLeftWidth[0] * this.root.width * 0.01; } else if (borderLeftWidth[1] === VH$8) { @@ -21558,7 +21566,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { _get(_getPrototypeOf(Dom.prototype), "__offsetX", this).call(this, diff, isLayout, lv); // 记得偏移LineBox - if (isLayout && !this.__config[NODE_IS_INLINE$1] && this.lineBoxManager) { + if (isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) { this.lineBoxManager.__offsetX(diff); } @@ -21573,7 +21581,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { value: function __offsetY(diff, isLayout, lv) { _get(_getPrototypeOf(Dom.prototype), "__offsetY", this).call(this, diff, isLayout, lv); - if (isLayout && !this.__config[NODE_IS_INLINE$1] && this.lineBoxManager) { + if (isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) { this.lineBoxManager.__offsetY(diff); } @@ -21599,17 +21607,17 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { h = data.h, lineBoxManager = data.lineBoxManager; // 计算需考虑style的属性 - var display = currentStyle[DISPLAY$6], - flexDirection = currentStyle[FLEX_DIRECTION$2], - width = currentStyle[WIDTH$5], - height = currentStyle[HEIGHT$5]; - var lineHeight = computedStyle[LINE_HEIGHT$4]; + var display = currentStyle[DISPLAY$4], + flexDirection = currentStyle[FLEX_DIRECTION], + width = currentStyle[WIDTH$3], + height = currentStyle[HEIGHT$3]; + var lineHeight = computedStyle[LINE_HEIGHT]; var main = isDirectionRow ? width : height; // 只绝对值生效,%不生效,依旧要判断 - if (main[1] === PX$8) { + if (main[1] === PX$3) { min = max = main[0]; } else if (main[1] === REM$8) { - min = max = main[0] * this.root.computedStyle[FONT_SIZE$9]; + min = max = main[0] * this.root.computedStyle[FONT_SIZE$8]; } else if (main[1] === VW$8) { min = max = main[0] * this.root.width * 0.01; } else if (main[1] === VH$8) { @@ -21619,12 +21627,12 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { var isRow = flexDirection !== 'column'; flowChildren = genOrderChildren(flowChildren); flowChildren.forEach(function (item) { - if (item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1) { + if (item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) { var _currentStyle = item.currentStyle, _computedStyle = item.computedStyle; // flex的child如果是inline,变为block,在计算autoBasis前就要 - if (_currentStyle[DISPLAY$6] !== 'block' && _currentStyle[DISPLAY$6] !== 'flex') { - _currentStyle[DISPLAY$6] = _computedStyle[DISPLAY$6] = 'block'; + if (_currentStyle[DISPLAY$4] !== 'block' && _currentStyle[DISPLAY$4] !== 'flex') { + _currentStyle[DISPLAY$4] = _computedStyle[DISPLAY$4] = 'block'; } var _item$__calMinMax = item.__calMinMax(isDirectionRow, { @@ -21691,7 +21699,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { var length = flowChildren.length; flowChildren.forEach(function (item, i) { - if (item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1) { + if (item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) { var _item$__calMinMax3 = item.__calMinMax(isDirectionRow, { x: x, y: y, @@ -21773,7 +21781,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { } flowChildren.forEach(function (item) { - if (item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1) { + if (item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) { var _item$__calMinMax5 = item.__calMinMax(isDirectionRow, { x: x, y: y, @@ -21846,60 +21854,60 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { w = data.w, h = data.h; // 计算需考虑style的属性 - var display = currentStyle[DISPLAY$6], - flexDirection = currentStyle[FLEX_DIRECTION$2], - width = currentStyle[WIDTH$5], - height = currentStyle[HEIGHT$5], + var display = currentStyle[DISPLAY$4], + flexDirection = currentStyle[FLEX_DIRECTION], + width = currentStyle[WIDTH$3], + height = currentStyle[HEIGHT$3], flexBasis = currentStyle[FLEX_BASIS$2]; - var lineHeight = computedStyle[LINE_HEIGHT$4]; + var lineHeight = computedStyle[LINE_HEIGHT]; var main = isDirectionRow ? width : height; // basis3种情况:auto、固定、content - var isAuto = flexBasis[1] === AUTO$6; - var isFixed = [PX$8, PERCENT$9, REM$8, VW$8, VH$8].indexOf(flexBasis[1]) > -1; + var isAuto = flexBasis[1] === AUTO$2; + var isFixed = [PX$3, PERCENT$3, REM$8, VW$8, VH$8].indexOf(flexBasis[1]) > -1; var isContent = !isAuto && !isFixed; var fixedSize; // flex的item固定basis计算 if (isFixed) { - if (flexBasis[1] === PX$8) { + if (flexBasis[1] === PX$3) { b = fixedSize = flexBasis[0]; - } else if (flexBasis[1] === PERCENT$9) { + } else if (flexBasis[1] === PERCENT$3) { 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]; + b = fixedSize = flexBasis[0] * this.root.computedStyle[FONT_SIZE$8]; } 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; } } // 已声明主轴尺寸的,当basis是auto时为值 - else if ([PX$8, PERCENT$9, REM$8, VW$8, VH$8].indexOf(main[1]) > -1 && isAuto) { - 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; - } - } // 非固定尺寸的basis为auto时降级为content - else if (isAuto) { - isContent = true; - } // flex的item还是flex时 + else if ([PX$3, PERCENT$3, REM$8, VW$8, VH$8].indexOf(main[1]) > -1 && isAuto) { + if (main[1] === PX$3) { + b = fixedSize = main[0]; + } else if (main[1] === PERCENT$3) { + b = fixedSize = main[0] * 0.01 * (isDirectionRow ? w : h); + } else if (main[1] === REM$8) { + b = fixedSize = main[0] * this.root.computedStyle[FONT_SIZE$8]; + } 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; + } + } // 非固定尺寸的basis为auto时降级为content + else if (isAuto) { + isContent = true; + } // flex的item还是flex时 if (display === 'flex') { var isRow = flexDirection !== 'column'; flowChildren = genOrderChildren(flowChildren); flowChildren.forEach(function (item) { - if (item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1) { + if (item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) { var _currentStyle2 = item.currentStyle, _computedStyle2 = item.computedStyle; // flex的child如果是inline,变为block,在计算autoBasis前就要 - if (_currentStyle2[DISPLAY$6] !== 'block' && _currentStyle2[DISPLAY$6] !== 'flex') { - _currentStyle2[DISPLAY$6] = _computedStyle2[DISPLAY$6] = 'block'; + if (_currentStyle2[DISPLAY$4] !== 'block' && _currentStyle2[DISPLAY$4] !== 'flex') { + _currentStyle2[DISPLAY$4] = _computedStyle2[DISPLAY$4] = 'block'; } var _item$__calMinMax7 = item.__calMinMax(isDirectionRow, { @@ -21960,87 +21968,87 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { }); } // flex的item是block/inline时,inline也会变成block统一对待 else { - var countMin = 0, - countMax = 0; - var lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle)); - var length = flowChildren.length; - flowChildren.forEach(function (item, i) { - if (item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1) { - var _item$__calMinMax9 = item.__calMinMax(isDirectionRow, { - x: x, - y: y, - w: w, - h: h, - lineBoxManager: lineBoxManager - }), - _item$__calMinMax10 = _slicedToArray(_item$__calMinMax9, 2), - _display2 = _item$__calMinMax10[0], - _item$__calMinMax10$ = _slicedToArray(_item$__calMinMax10[1], 2), - min2 = _item$__calMinMax10$[0], - max2 = _item$__calMinMax10$[1]; // 块级查看之前是否有行内元素,设置换行 + var countMin = 0, + countMax = 0; + var lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle)); + var length = flowChildren.length; + flowChildren.forEach(function (item, i) { + if (item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) { + var _item$__calMinMax9 = item.__calMinMax(isDirectionRow, { + x: x, + y: y, + w: w, + h: h, + lineBoxManager: lineBoxManager + }), + _item$__calMinMax10 = _slicedToArray(_item$__calMinMax9, 2), + _display2 = _item$__calMinMax10[0], + _item$__calMinMax10$ = _slicedToArray(_item$__calMinMax10[1], 2), + min2 = _item$__calMinMax10$[0], + max2 = _item$__calMinMax10$[1]; // 块级查看之前是否有行内元素,设置换行 - if ((_display2 === 'block' || _display2 === 'flex') && lineBoxManager.isEnd) { - lineBoxManager.setNotEnd(); - lineBoxManager.setNewLine(); + if ((_display2 === 'block' || _display2 === 'flex') && lineBoxManager.isEnd) { + lineBoxManager.setNotEnd(); + lineBoxManager.setNewLine(); + } + + if (isDirectionRow) { + if (_display2 === 'block' || _display2 === 'flex') { + min = Math.max(min, min2); + max = Math.max(max, max2); + countMin = countMax = 0; + } else { + countMin += min2; + countMax += max2; + min = Math.max(min, countMin); + max = Math.max(max, countMax); } + } else { + if (_display2 === 'block' || _display2 === 'flex') { + // 之前行积累的极值,并清空 + min += countMin; + max += countMax; + countMin = countMax = 0; // 本身的 - if (isDirectionRow) { - if (_display2 === 'block' || _display2 === 'flex') { - min = Math.max(min, min2); - max = Math.max(max, max2); - countMin = countMax = 0; - } else { - countMin += min2; - countMax += max2; - min = Math.max(min, countMin); - max = Math.max(max, countMax); - } + min += min2; + max += max2; } else { - if (_display2 === 'block' || _display2 === 'flex') { - // 之前行积累的极值,并清空 + // 行内取极值,最后一个记得应用 + countMin = Math.max(countMin, min2); + countMax = Math.max(countMax, max2); + + if (i === length - 1) { min += countMin; max += countMax; - countMin = countMax = 0; // 本身的 - - min += min2; - max += max2; - } else { - // 行内取极值,最后一个记得应用 - countMin = Math.max(countMin, min2); - countMax = Math.max(countMax, max2); - - if (i === length - 1) { - min += countMin; - max += countMax; - } } } - } else if (isDirectionRow) { - countMin += item.charWidth; - countMax += item.textWidth; - min = Math.max(min, countMin); - max = Math.max(max, countMax); - } else { - item.__layout({ - x: x, - y: y, - w: w, - h: h, - lineBoxManager: lineBoxManager - }); // 行内取极值,最后一个记得应用 + } + } else if (isDirectionRow) { + countMin += item.charWidth; + countMax += item.textWidth; + min = Math.max(min, countMin); + max = Math.max(max, countMax); + } else { + item.__layout({ + x: x, + y: y, + w: w, + h: h, + lineBoxManager: lineBoxManager + }); // 行内取极值,最后一个记得应用 - countMin = Math.max(countMin, item.height); - countMax = Math.max(countMax, item.height); + countMin = Math.max(countMin, item.height); + countMax = Math.max(countMax, item.height); - if (i === length - 1) { - min += countMin; - max += countMax; - } + if (i === length - 1) { + min += countMin; + max += countMax; } - }); - } + } + }); + } if (fixedSize) { max = Math.max(fixedSize, max); @@ -22060,7 +22068,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { var children = this.children; children.forEach(function (item) { - if (item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1) { + if (item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) { item.__layoutNone(); } }); @@ -22099,10 +22107,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { return; } - var textAlign = computedStyle[TEXT_ALIGN$2], - whiteSpace = computedStyle[WHITE_SPACE$2], - lineClamp = computedStyle[LINE_CLAMP$1], - lineHeight = computedStyle[LINE_HEIGHT$4]; // 只有>=1的正整数才有效 + var textAlign = computedStyle[TEXT_ALIGN], + whiteSpace = computedStyle[WHITE_SPACE], + lineClamp = computedStyle[LINE_CLAMP], + lineHeight = computedStyle[LINE_HEIGHT]; // 只有>=1的正整数才有效 lineClamp = lineClamp || 0; var lineClampCount = 0; // 虚线管理一个block内部的LineBox列表,使得inline的元素可以中途衔接处理折行 @@ -22117,9 +22125,9 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { mergeMarginTopList = []; var length = flowChildren.length; 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$6] === 'inline'; - var isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY$6]) > -1; + var isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom; + var isInline = isXom && item.currentStyle[DISPLAY$4] === 'inline'; + var isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY$4]) > -1; var isImg = item.tagName === 'img'; // 每次循环开始前,这次不是block的话,看之前遗留待合并margin,并重置 if (!isXom || isInline || isInlineBlock) { @@ -22161,10 +22169,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { lineBoxManager.setNotEnd(); } // inline和不折行的ib,其中ib需要手动存入当前lb中 else { - (isInlineBlock || isImg) && lineBoxManager.addItem(item); - x = lineBoxManager.lastX; - y = lineBoxManager.lastY; - } // abs统计宽度 + (isInlineBlock || isImg) && lineBoxManager.addItem(item); + x = lineBoxManager.lastX; + y = lineBoxManager.lastY; + } // abs统计宽度 if (isVirtual) { @@ -22195,37 +22203,37 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { y = lineBoxManager.lastY; } // 放不下处理之前的lineBox,并重新开头 else { - lineClampCount++; + lineClampCount++; + x = data.x; + y = lineBoxManager.endY; + lineBoxManager.setNewLine(); + lineClampCount = item.__layout({ + x: x, + y: y, + w: w, + h: h, + lx: data.x, + lineBoxManager: lineBoxManager, + lineClamp: lineClamp, + lineClampCount: lineClampCount + }, isVirtual); // 重新开头的ib和上面开头处一样逻辑 + + if (item.__isIbFull) { x = data.x; - y = lineBoxManager.endY; - lineBoxManager.setNewLine(); - lineClampCount = item.__layout({ - x: x, - y: y, - w: w, - h: h, - lx: data.x, - lineBoxManager: lineBoxManager, - lineClamp: lineClamp, - lineClampCount: lineClampCount - }, isVirtual); // 重新开头的ib和上面开头处一样逻辑 - - if (item.__isIbFull) { - x = data.x; - y += item.outerHeight; - lineBoxManager.setNotEnd(); - } // inline和不折行的ib,其中ib需要手动存入当前lb中 - else { - (isInlineBlock || isImg) && lineBoxManager.addItem(item); - x = lineBoxManager.lastX; - y = lineBoxManager.lastY; - } + y += item.outerHeight; + lineBoxManager.setNotEnd(); + } // inline和不折行的ib,其中ib需要手动存入当前lb中 + else { + (isInlineBlock || isImg) && lineBoxManager.addItem(item); + x = lineBoxManager.lastX; + y = lineBoxManager.lastY; + } - if (isVirtual) { - maxW = Math.max(maxW, cw); - cw = 0; - } + if (isVirtual) { + maxW = Math.max(maxW, cw); + cw = 0; } + } if (isVirtual) { cw += item.outerWidth; @@ -22234,95 +22242,137 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { } } // block/flex先处理之前可能遗留的最后一行LineBox,然后递归时不传lineBoxManager,其内部生成新的 else { - // 非开头,说明之前的text未换行,需要增加行数 - if (x !== data.x && flowChildren[i - 1] instanceof Text) { - lineClampCount++; - } - - x = data.x; - - if (lineBoxManager.isEnd) { - y = lineBoxManager.endY; - lineBoxManager.setNotEnd(); - lineBoxManager.setNewLine(); - } - - item.__layout({ - x: x, - y: y, - w: w, - h: h - }, isVirtual); - - var isNone = item.currentStyle[DISPLAY$6] === 'none'; // 自身无内容 + // 非开头,说明之前的text未换行,需要增加行数 + if (x !== data.x && flowChildren[i - 1] instanceof Text) { + lineClampCount++; + } - var isEmptyBlock; + x = data.x; - if (!isNone && item.flowChildren && item.flowChildren.length === 0) { - var _item$computedStyle = item.computedStyle, - marginTop = _item$computedStyle[MARGIN_TOP$1], - marginBottom = _item$computedStyle[MARGIN_BOTTOM$1], - paddingTop = _item$computedStyle[PADDING_TOP$2], - paddingBottom = _item$computedStyle[PADDING_BOTTOM$2], - height = _item$computedStyle[HEIGHT$5], - borderTopWidth = _item$computedStyle[BORDER_TOP_WIDTH$3], - borderBottomWidth = _item$computedStyle[BORDER_BOTTOM_WIDTH$3]; // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理 + if (lineBoxManager.isEnd) { + y = lineBoxManager.endY; + lineBoxManager.setNotEnd(); + lineBoxManager.setNewLine(); + } - if (paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) { - mergeMarginBottomList.push(marginBottom); - mergeMarginTopList.push(marginTop); - isEmptyBlock = true; - } + item.__layout({ + x: x, + y: y, + w: w, + h: h + }, isVirtual); + + var isNone = item.currentStyle[DISPLAY$4] === 'none'; // 自身无内容 + + var isEmptyBlock; + + if (!isNone && item.flowChildren && item.flowChildren.length === 0) { + var _item$computedStyle = item.computedStyle, + marginTop = _item$computedStyle[MARGIN_TOP$3], + marginBottom = _item$computedStyle[MARGIN_BOTTOM$3], + paddingTop = _item$computedStyle[PADDING_TOP$3], + paddingBottom = _item$computedStyle[PADDING_BOTTOM$3], + height = _item$computedStyle[HEIGHT$3], + borderTopWidth = _item$computedStyle[BORDER_TOP_WIDTH$3], + borderBottomWidth = _item$computedStyle[BORDER_BOTTOM_WIDTH$3]; // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理 + + if (paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) { + mergeMarginBottomList.push(marginBottom); + mergeMarginTopList.push(marginTop); + isEmptyBlock = true; } + } - y += item.outerHeight; - lineBoxManager.__lastY = y; // absolute/flex前置虚拟计算 + y += item.outerHeight; + lineBoxManager.__lastY = y; // absolute/flex前置虚拟计算 - if (isVirtual) { - maxW = Math.max(maxW, item.outerWidth); - cw = 0; - } // 空block要留下轮循环看,除非是最后一个,此处非空本轮处理掉看是否要合并 + if (isVirtual) { + maxW = Math.max(maxW, item.outerWidth); + cw = 0; + } // 空block要留下轮循环看,除非是最后一个,此处非空本轮处理掉看是否要合并 - if (!isNone && !isEmptyBlock) { - var _item$computedStyle2 = item.computedStyle, - _marginTop = _item$computedStyle2[MARGIN_TOP$1], - _marginBottom = _item$computedStyle2[MARGIN_BOTTOM$1]; // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top - // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并 + if (!isNone && !isEmptyBlock) { + var _item$computedStyle2 = item.computedStyle, + _marginTop = _item$computedStyle2[MARGIN_TOP$3], + _marginBottom = _item$computedStyle2[MARGIN_BOTTOM$3]; // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top + // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并 - if (mergeMarginBottomList.length) { - mergeMarginTopList.push(_marginTop); + if (mergeMarginBottomList.length) { + mergeMarginTopList.push(_marginTop); - var _diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); + var _diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); - if (_diff) { - item.__offsetY(_diff, true); + if (_diff) { + item.__offsetY(_diff, true); - y += _diff; - } - } // 同时自己保存bottom,为后续block准备 + y += _diff; + } + } // 同时自己保存bottom,为后续block准备 - mergeMarginTopList = []; - mergeMarginBottomList = [_marginBottom]; - } // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0 - else if (i === length - 1) { - var _diff2 = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); + mergeMarginTopList = []; + mergeMarginBottomList = [_marginBottom]; + } // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0 + else if (i === length - 1) { + var _diff2 = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); - if (_diff2) { - y += _diff2; - } - } + if (_diff2) { + y += _diff2; + } } + } } // 文字和inline类似 else { - // lineClamp作用域为block下的inline(同LineBox上下文) - if (lineClamp && lineClampCount >= lineClamp) { - return; - } // x开头,不用考虑是否放得下直接放 + // lineClamp作用域为block下的inline(同LineBox上下文) + if (lineClamp && lineClampCount >= lineClamp) { + return; + } // x开头,不用考虑是否放得下直接放 - if (x === data.x || whiteSpace === 'nowrap') { + if (x === data.x || whiteSpace === 'nowrap') { + lineClampCount = item.__layout({ + x: x, + y: y, + w: w, + h: h, + lx: data.x, + lineBoxManager: lineBoxManager, + lineClamp: lineClamp, + lineClampCount: lineClampCount + }, isVirtual); + x = lineBoxManager.lastX; + y = lineBoxManager.lastY; + + if (isVirtual) { + maxW = Math.max(maxW, cw); + cw = item.width; + maxW = Math.max(maxW, cw); + } + } else { + // 非开头先尝试是否放得下 + var _fw = item.__tryLayInline(w - x + data.x); // 放得下继续 + + + if (_fw >= -1e-10) { + lineClampCount = item.__layout({ + x: x, + y: y, + w: w, + h: h, + lx: data.x, + lineBoxManager: lineBoxManager, + lineClamp: lineClamp, + lineClampCount: lineClampCount + }, isVirtual); + x = lineBoxManager.lastX; + y = lineBoxManager.lastY; + } // 放不下处理之前的lineBox,并重新开头 + else { + lineClampCount++; + x = data.x; + y = lineBoxManager.endY; + lineBoxManager.setNewLine(); lineClampCount = item.__layout({ x: x, y: y, @@ -22337,59 +22387,17 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { y = lineBoxManager.lastY; if (isVirtual) { - maxW = Math.max(maxW, cw); - cw = item.width; - maxW = Math.max(maxW, cw); + maxW = Math.max(maxW, item.width); + cw = 0; } - } else { - // 非开头先尝试是否放得下 - var _fw = item.__tryLayInline(w - x + data.x); // 放得下继续 - - - if (_fw >= -1e-10) { - lineClampCount = item.__layout({ - x: x, - y: y, - w: w, - h: h, - lx: data.x, - lineBoxManager: lineBoxManager, - lineClamp: lineClamp, - lineClampCount: lineClampCount - }, isVirtual); - x = lineBoxManager.lastX; - y = lineBoxManager.lastY; - } // 放不下处理之前的lineBox,并重新开头 - else { - lineClampCount++; - x = data.x; - y = lineBoxManager.endY; - lineBoxManager.setNewLine(); - lineClampCount = item.__layout({ - x: x, - y: y, - w: w, - h: h, - lx: data.x, - lineBoxManager: lineBoxManager, - lineClamp: lineClamp, - lineClampCount: lineClampCount - }, isVirtual); - x = lineBoxManager.lastX; - y = lineBoxManager.lastY; - - if (isVirtual) { - maxW = Math.max(maxW, item.width); - cw = 0; - } - } + } - if (isVirtual) { - cw += item.width; - maxW = Math.max(maxW, cw); - } + if (isVirtual) { + cw += item.width; + maxW = Math.max(maxW, cw); } } + } }); // 结束后如果是以LineBox结尾,则需要设置y到这里,否则流布局中block会设置 // 当以block换行时,新行是true,否则是false即结尾 @@ -22410,7 +22418,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { lineBoxManager.horizonAlign(tw, textAlign); // 直接text需计算size flowChildren.forEach(function (item) { - if (item instanceof Component$1) { + if (item instanceof Component) { item = item.shadowRoot; } @@ -22458,14 +22466,14 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { __flexLine.splice(0); - var flexDirection = computedStyle[FLEX_DIRECTION$2], - justifyContent = computedStyle[JUSTIFY_CONTENT$1], - alignItems = computedStyle[ALIGN_ITEMS$1], - lineClamp = computedStyle[LINE_CLAMP$1], - flexWrap = computedStyle[FLEX_WRAP$1], - alignContent = computedStyle[ALIGN_CONTENT$1], - lineHeight = computedStyle[LINE_HEIGHT$4], - textAlign = computedStyle[TEXT_ALIGN$2]; // 只有>=1的正整数才有效 + var flexDirection = computedStyle[FLEX_DIRECTION], + justifyContent = computedStyle[JUSTIFY_CONTENT], + alignItems = computedStyle[ALIGN_ITEMS], + lineClamp = computedStyle[LINE_CLAMP], + flexWrap = computedStyle[FLEX_WRAP], + alignContent = computedStyle[ALIGN_CONTENT], + lineHeight = computedStyle[LINE_HEIGHT], + textAlign = computedStyle[TEXT_ALIGN]; // 只有>=1的正整数才有效 lineClamp = lineClamp || 0; var lineClampCount = 0; @@ -22479,12 +22487,12 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { var minList = []; var orderChildren = genOrderChildren(flowChildren); orderChildren.forEach(function (item) { - if (item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1) { + if (item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) { var _currentStyle3 = item.currentStyle, _computedStyle3 = item.computedStyle; // flex的child如果是inline,变为block,在计算autoBasis前就要 - if (_currentStyle3[DISPLAY$6] !== 'block' && _currentStyle3[DISPLAY$6] !== 'flex') { - _currentStyle3[DISPLAY$6] = _computedStyle3[DISPLAY$6] = 'block'; + if (_currentStyle3[DISPLAY$4] !== 'block' && _currentStyle3[DISPLAY$4] !== 'flex') { + _currentStyle3[DISPLAY$4] = _computedStyle3[DISPLAY$4] = 'block'; } // abs虚拟布局计算时纵向也是看横向宽度 @@ -22509,8 +22517,8 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { return; } - var flexGrow = _currentStyle3[FLEX_GROW$1], - flexShrink = _currentStyle3[FLEX_SHRINK$1]; + var flexGrow = _currentStyle3[FLEX_GROW], + flexShrink = _currentStyle3[FLEX_SHRINK]; _computedStyle3[FLEX_BASIS$2] = b; growList.push(flexGrow); shrinkList.push(flexShrink); // 根据basis不同,计算方式不同 @@ -22520,43 +22528,43 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { minList.push(min); } // 文本 else { - if (isVirtual) { - if (isDirectionRow) { - maxX += item.textWidth; - } else { - maxX = Math.max(maxX, item.textWidth); - } - - return; + if (isVirtual) { + if (isDirectionRow) { + maxX += item.textWidth; + } else { + maxX = Math.max(maxX, item.textWidth); } - growList.push(0); - shrinkList.push(1); + return; + } - if (isDirectionRow) { - var cw = item.charWidth; - var _tw = item.textWidth; - basisList.push(_tw); - maxList.push(_tw); - minList.push(cw); - } else { - var lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle)); + growList.push(0); + shrinkList.push(1); - item.__layout({ - x: x, - y: y, - w: w, - h: _h, - lineBoxManager: lineBoxManager, - lineClamp: lineClamp, - lineClampCount: lineClampCount - }); + if (isDirectionRow) { + var cw = item.charWidth; + var _tw = item.textWidth; + basisList.push(_tw); + maxList.push(_tw); + minList.push(cw); + } else { + var lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle)); - var _h = item.height; - basisList.push(_h); - minList.push(_h); - } + item.__layout({ + x: x, + y: y, + w: w, + h: _h, + lineBoxManager: lineBoxManager, + lineClamp: lineClamp, + lineClampCount: lineClampCount + }); + + var _h = item.height; + basisList.push(_h); + minList.push(_h); } + } }); // abs时,只需关注宽度即可,无需真正布局 if (isVirtual) { @@ -22775,20 +22783,20 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { }); } // 默认stretch else { - per = diff / length; // 除了第1行其它进行偏移 + per = diff / length; // 除了第1行其它进行偏移 - __flexLine.forEach(function (item, i) { - if (i) { - item.forEach(function (item) { - if (isDirectionRow) { - item.__offsetY(per * i, true); - } else { - item.__offsetX(per * i, true); - } - }); - } - }); - } + __flexLine.forEach(function (item, i) { + if (i) { + item.forEach(function (item) { + if (isDirectionRow) { + item.__offsetY(per * i, true); + } else { + item.__offsetX(per * i, true); + } + }); + } + }); + } } } // 每行再进行cross对齐,在alignContent为stretch时计算每行的高度 @@ -22916,9 +22924,9 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸 } // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算 else { - targetMainList[i] = n; - factorSum2 += item; - } + targetMainList[i] = n; + factorSum2 += item; + } } }); @@ -22960,9 +22968,9 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸 } // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算 else { - targetMainList[i] = n; - factorSum2 += item; - } + targetMainList[i] = n; + factorSum2 += item; + } } }); @@ -22980,7 +22988,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { orderChildren.forEach(function (item, i) { var main = targetMainList[i]; - if (item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1) { + if (item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) { if (isDirectionRow) { item.__layout({ x: x, @@ -23082,7 +23090,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { baseLine = Math.max(baseLine, item.firstBaseLine); }); line.forEach(function (item) { - var alignSelf = item.currentStyle[ALIGN_SELF$1]; + var alignSelf = item.currentStyle[ALIGN_SELF]; if (isDirectionRow) { if (alignSelf === 'flexStart' || alignSelf === 'flex-start') ; else if (alignSelf === 'flexEnd' || alignSelf === 'flex-end') { @@ -23099,17 +23107,17 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { } } else if (alignSelf === 'stretch') { var computedStyle = item.computedStyle, - height = item.currentStyle[HEIGHT$5]; + height = item.currentStyle[HEIGHT$3]; var borderTopWidth = computedStyle[BORDER_TOP_WIDTH$3], borderBottomWidth = computedStyle[BORDER_BOTTOM_WIDTH$3], - marginTop = computedStyle[MARGIN_TOP$1], - marginBottom = computedStyle[MARGIN_BOTTOM$1], - paddingTop = computedStyle[PADDING_TOP$2], - paddingBottom = computedStyle[PADDING_BOTTOM$2]; + marginTop = computedStyle[MARGIN_TOP$3], + marginBottom = computedStyle[MARGIN_BOTTOM$3], + paddingTop = computedStyle[PADDING_TOP$3], + paddingBottom = computedStyle[PADDING_BOTTOM$3]; - if (height[1] === AUTO$6) { + if (height[1] === AUTO$2) { var old = item.height; - var v = item.__height = computedStyle[HEIGHT$5] = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth; + var v = item.__height = computedStyle[HEIGHT$3] = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth; var d = v - old; item.__sy4 += d; item.__sy5 += d; @@ -23127,156 +23135,156 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { } } // 默认auto,取alignItems else { - if (alignItems === 'flexStart' || alignSelf === 'flex-start') ; else if (alignItems === 'center') { - var _diff5 = maxCross - item.outerHeight; + if (alignItems === 'flexStart' || alignSelf === 'flex-start') ; else if (alignItems === 'center') { + var _diff5 = maxCross - item.outerHeight; - if (_diff5 !== 0) { - item.__offsetY(_diff5 * 0.5, true); - } - } else if (alignItems === 'flexEnd' || alignItems === 'flex-end') { - var _diff6 = maxCross - item.outerHeight; + if (_diff5 !== 0) { + item.__offsetY(_diff5 * 0.5, true); + } + } else if (alignItems === 'flexEnd' || alignItems === 'flex-end') { + var _diff6 = maxCross - item.outerHeight; - if (_diff6 !== 0) { - item.__offsetY(_diff6, true); - } - } else if (alignItems === 'baseline') { - var _diff7 = baseLine - item.firstBaseLine; + if (_diff6 !== 0) { + item.__offsetY(_diff6, true); + } + } else if (alignItems === 'baseline') { + var _diff7 = baseLine - item.firstBaseLine; - if (_diff7 !== 0) { - item.__offsetY(_diff7, true); - } - } // 默认stretch - else { - var _computedStyle4 = item.computedStyle, - _item$currentStyle = item.currentStyle, - display = _item$currentStyle[DISPLAY$6], - flexDirection = _item$currentStyle[FLEX_DIRECTION$2], - _height = _item$currentStyle[HEIGHT$5]; // row的孩子还是flex且column且不定高时,如果高度<侧轴拉伸高度则重新布局 - - if (isDirectionRow && display === 'flex' && flexDirection === 'column' && _height[1] === AUTO$6 && item.outerHeight < maxCross) { - item.__layout(Object.assign(item.__layoutData, { - h3: maxCross - })); - } + if (_diff7 !== 0) { + item.__offsetY(_diff7, true); + } + } // 默认stretch + else { + var _computedStyle4 = item.computedStyle, + _item$currentStyle = item.currentStyle, + display = _item$currentStyle[DISPLAY$4], + flexDirection = _item$currentStyle[FLEX_DIRECTION], + _height = _item$currentStyle[HEIGHT$3]; // row的孩子还是flex且column且不定高时,如果高度<侧轴拉伸高度则重新布局 + + if (isDirectionRow && display === 'flex' && flexDirection === 'column' && _height[1] === AUTO$2 && item.outerHeight < maxCross) { + item.__layout(Object.assign(item.__layoutData, { + h3: maxCross + })); + } - var _borderTopWidth = _computedStyle4[BORDER_TOP_WIDTH$3], - _borderBottomWidth = _computedStyle4[BORDER_BOTTOM_WIDTH$3], - _marginTop2 = _computedStyle4[MARGIN_TOP$1], - _marginBottom2 = _computedStyle4[MARGIN_BOTTOM$1], - _paddingTop = _computedStyle4[PADDING_TOP$2], - _paddingBottom = _computedStyle4[PADDING_BOTTOM$2]; + var _borderTopWidth = _computedStyle4[BORDER_TOP_WIDTH$3], + _borderBottomWidth = _computedStyle4[BORDER_BOTTOM_WIDTH$3], + _marginTop2 = _computedStyle4[MARGIN_TOP$3], + _marginBottom2 = _computedStyle4[MARGIN_BOTTOM$3], + _paddingTop = _computedStyle4[PADDING_TOP$3], + _paddingBottom = _computedStyle4[PADDING_BOTTOM$3]; - if (_height[1] === AUTO$6) { - var _old = item.height; + if (_height[1] === AUTO$2) { + var _old = item.height; - var _v = maxCross - _marginTop2 - _marginBottom2 - _paddingTop - _paddingBottom - _borderTopWidth - _borderBottomWidth; + var _v = maxCross - _marginTop2 - _marginBottom2 - _paddingTop - _paddingBottom - _borderTopWidth - _borderBottomWidth; - var _d = _v - _old; + var _d = _v - _old; - item.__sy4 += _d; - item.__sy5 += _d; - item.__sy6 += _d; - item.__height += _d; - item.__clientHeight += _d; - item.__offsetHeight += _d; - item.__outerHeight += _d; - } - } + item.__sy4 += _d; + item.__sy5 += _d; + item.__sy6 += _d; + item.__height += _d; + item.__clientHeight += _d; + item.__offsetHeight += _d; + item.__outerHeight += _d; + } } + } } // column else { - if (alignSelf === 'flexStart' || alignSelf === 'flex-start') ; else if (alignSelf === 'flexEnd' || alignSelf === 'flex-end') { - var _diff8 = maxCross - item.outerWidth; + if (alignSelf === 'flexStart' || alignSelf === 'flex-start') ; else if (alignSelf === 'flexEnd' || alignSelf === 'flex-end') { + var _diff8 = maxCross - item.outerWidth; - if (_diff8 !== 0) { - item.__offsetX(_diff8, true); - } - } else if (alignSelf === 'center') { - var _diff9 = maxCross - item.outerWidth; + if (_diff8 !== 0) { + item.__offsetX(_diff8, true); + } + } else if (alignSelf === 'center') { + var _diff9 = maxCross - item.outerWidth; + + if (_diff9 !== 0) { + item.__offsetX(_diff9 * 0.5, true); + } + } else if (alignSelf === 'stretch') { + var _computedStyle5 = item.computedStyle, + width = item.currentStyle[WIDTH$3]; + var borderRightWidth = _computedStyle5[BORDER_RIGHT_WIDTH$2], + borderLeftWidth = _computedStyle5[BORDER_LEFT_WIDTH$3], + marginRight = _computedStyle5[MARGIN_RIGHT$2], + marginLeft = _computedStyle5[MARGIN_LEFT$3], + paddingRight = _computedStyle5[PADDING_RIGHT$2], + paddingLeft = _computedStyle5[PADDING_LEFT$3]; + + if (width[1] === AUTO$2) { + var _old2 = item.width; + + var _v2 = item.__width = _computedStyle5[WIDTH$3] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth; + + var _d2 = _v2 - _old2; + + item.__sx4 += _d2; + item.__sx5 += _d2; + item.__sx6 += _d2; + item.__width += _d2; + item.__clientWidth += _d2; + item.__offsetWidth += _d2; + item.__outerWidth += _d2; + } + } else if (alignItems === 'baseline') { + var _diff10 = baseLine - item.firstBaseLine; - if (_diff9 !== 0) { - item.__offsetX(_diff9 * 0.5, true); + if (_diff10 !== 0) { + item.__offsetX(_diff10, true); + } + } // 默认auto,取alignItems + else { + if (alignItems === 'flexStart' || alignSelf === 'flex-start') ; else if (alignItems === 'center') { + var _diff11 = maxCross - item.outerWidth; + + if (_diff11 !== 0) { + item.__offsetX(_diff11 * 0.5, true); } - } else if (alignSelf === 'stretch') { - var _computedStyle5 = item.computedStyle, - width = item.currentStyle[WIDTH$5]; - var borderRightWidth = _computedStyle5[BORDER_RIGHT_WIDTH$4], - borderLeftWidth = _computedStyle5[BORDER_LEFT_WIDTH$5], - marginRight = _computedStyle5[MARGIN_RIGHT$3], - marginLeft = _computedStyle5[MARGIN_LEFT$3], - paddingRight = _computedStyle5[PADDING_RIGHT$3], - paddingLeft = _computedStyle5[PADDING_LEFT$4]; - - if (width[1] === AUTO$6) { - var _old2 = item.width; - - var _v2 = item.__width = _computedStyle5[WIDTH$5] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth; - - var _d2 = _v2 - _old2; - - item.__sx4 += _d2; - item.__sx5 += _d2; - item.__sx6 += _d2; - item.__width += _d2; - item.__clientWidth += _d2; - item.__offsetWidth += _d2; - item.__outerWidth += _d2; + } else if (alignItems === 'flexEnd' || alignItems === 'flex-end') { + var _diff12 = maxCross - item.outerWidth; + + if (_diff12 !== 0) { + item.__offsetX(_diff12, true); } } else if (alignItems === 'baseline') { - var _diff10 = baseLine - item.firstBaseLine; + var _diff13 = baseLine - item.firstBaseLine; - if (_diff10 !== 0) { - item.__offsetX(_diff10, true); + if (_diff13 !== 0) { + item.__offsetX(_diff13, true); } - } // 默认auto,取alignItems + } // 默认stretch else { - if (alignItems === 'flexStart' || alignSelf === 'flex-start') ; else if (alignItems === 'center') { - var _diff11 = maxCross - item.outerWidth; - - if (_diff11 !== 0) { - item.__offsetX(_diff11 * 0.5, true); - } - } else if (alignItems === 'flexEnd' || alignItems === 'flex-end') { - var _diff12 = maxCross - item.outerWidth; - - if (_diff12 !== 0) { - item.__offsetX(_diff12, true); - } - } else if (alignItems === 'baseline') { - var _diff13 = baseLine - item.firstBaseLine; - - if (_diff13 !== 0) { - item.__offsetX(_diff13, true); - } - } // 默认stretch - else { - var _computedStyle6 = item.computedStyle, - _width = item.currentStyle[WIDTH$5]; - var _borderRightWidth = _computedStyle6[BORDER_RIGHT_WIDTH$4], - _borderLeftWidth = _computedStyle6[BORDER_LEFT_WIDTH$5], - _marginRight = _computedStyle6[MARGIN_RIGHT$3], - _marginLeft = _computedStyle6[MARGIN_LEFT$3], - _paddingRight = _computedStyle6[PADDING_RIGHT$3], - _paddingLeft = _computedStyle6[PADDING_LEFT$4]; - - if (_width[1] === AUTO$6) { - var _old3 = item.width; - - var _v3 = item.__width = _computedStyle6[WIDTH$5] = maxCross - _marginLeft - _marginRight - _paddingLeft - _paddingRight - _borderRightWidth - _borderLeftWidth; - - var _d3 = _v3 - _old3; - - item.__sx4 += _d3; - item.__sx5 += _d3; - item.__sx6 += _d3; - item.__width += _d3; - item.__clientWidth += _d3; - item.__offsetWidth += _d3; - item.__outerWidth += _d3; - } - } + var _computedStyle6 = item.computedStyle, + _width = item.currentStyle[WIDTH$3]; + var _borderRightWidth = _computedStyle6[BORDER_RIGHT_WIDTH$2], + _borderLeftWidth = _computedStyle6[BORDER_LEFT_WIDTH$3], + _marginRight = _computedStyle6[MARGIN_RIGHT$2], + _marginLeft = _computedStyle6[MARGIN_LEFT$3], + _paddingRight = _computedStyle6[PADDING_RIGHT$2], + _paddingLeft = _computedStyle6[PADDING_LEFT$3]; + + if (_width[1] === AUTO$2) { + var _old3 = item.width; + + var _v3 = item.__width = _computedStyle6[WIDTH$3] = maxCross - _marginLeft - _marginRight - _paddingLeft - _paddingRight - _borderRightWidth - _borderLeftWidth; + + var _d3 = _v3 - _old3; + + item.__sx4 += _d3; + item.__sx5 += _d3; + item.__sx6 += _d3; + item.__width += _d3; + item.__clientWidth += _d3; + item.__offsetWidth += _d3; + item.__outerWidth += _d3; } + } } + } }); } /** @@ -23322,17 +23330,17 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { return; } - var width = currentStyle[WIDTH$5]; - var textAlign = computedStyle[TEXT_ALIGN$2], - whiteSpace = computedStyle[WHITE_SPACE$2], - lineClamp = computedStyle[LINE_CLAMP$1], - lineHeight = computedStyle[LINE_HEIGHT$4], + var width = currentStyle[WIDTH$3]; + var textAlign = computedStyle[TEXT_ALIGN], + whiteSpace = computedStyle[WHITE_SPACE], + lineClamp = computedStyle[LINE_CLAMP], + lineHeight = computedStyle[LINE_HEIGHT], 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]; + marginRight = computedStyle[MARGIN_RIGHT$2], + borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$3], + borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$2], + paddingLeft = computedStyle[PADDING_LEFT$3], + paddingRight = computedStyle[PADDING_RIGHT$2]; var lineClampCount = data.lineClampCount || 0; if (isInline && !this.__isRealInline()) { @@ -23342,7 +23350,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { if (isInline) { - this.__config[NODE_IS_INLINE$1] = true; + this.__config[NODE_IS_INLINE] = true; this.__lineBoxManager = lineBoxManager; var baseLine = css.getBaseLine(computedStyle); // 特殊inline调用,有内容的话(如左右mbp),默认生成一个lineBox,即便是空,也要形成占位,只有开头时需要 @@ -23363,11 +23371,8 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { endSpace = selfEndSpace = lineClampCount = 0; } // 存LineBox里的内容列表专用,布局过程中由lineBoxManager存入,递归情况每个inline节点都保存contentBox - - var contentBoxList; - if (isInline) { - contentBoxList = this.__contentBoxList = []; + this.__contentBoxList = []; lineBoxManager.pushContentBoxList(this); } @@ -23375,9 +23380,9 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { var length = flowChildren.length; flowChildren.forEach(function (item, i) { - var isXom = item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1; - var isInline2 = isXom && item.currentStyle[DISPLAY$6] === 'inline'; - var isInlineBlock2 = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY$6]) > -1; + var isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom; + var isInline2 = isXom && item.currentStyle[DISPLAY$4] === 'inline'; + var isInlineBlock2 = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY$4]) > -1; var isRealInline = isXom && item.__isRealInline(); // 最后一个元素会产生最后一行,叠加父元素的尾部mpb @@ -23390,7 +23395,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { if (isXom) { if (!isInline2 && !isInlineBlock2) { - item.currentStyle[DISPLAY$6] = item.computedStyle[DISPLAY$6] = 'inlineBlock'; + item.currentStyle[DISPLAY$4] = item.computedStyle[DISPLAY$4] = 'inlineBlock'; isInlineBlock2 = true; inject.warn('Inline can not contain block/flex'); } // x开头,不用考虑是否放得下直接放,i为0强制不换行 @@ -23409,76 +23414,129 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { lineClampCount: lineClampCount }, isVirtual); // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样 - if (item.__isIbFull) { - isInlineBlock2 && w[1] === AUTO$6 && (isIbFull = true); - lineBoxManager.addItem(item); - x = lx; - y += item.outerHeight; - lineBoxManager.setNotEnd(); - } // inline和不折行的ib,其中ib需要手动存入当前lb中,以计算宽度 - else { - (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item); - x = lineBoxManager.lastX; - y = lineBoxManager.lastY; - } + if (item.__isIbFull) { + isInlineBlock2 && w[1] === AUTO$2 && (isIbFull = true); + lineBoxManager.addItem(item); + x = lx; + y += item.outerHeight; + lineBoxManager.setNotEnd(); + } // inline和不折行的ib,其中ib需要手动存入当前lb中,以计算宽度 + else { + (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item); + x = lineBoxManager.lastX; + y = lineBoxManager.lastY; + } + } else { + // 不换行继续排,换行非开头先尝试是否放得下,结尾要考虑mpb因此减去endSpace + var fw = whiteSpace === 'nowrap' ? 0 : item.__tryLayInline(w - x + lx, w - (isEnd ? endSpace : 0)); // 放得下继续 + + if (fw >= -1e-10) { + lineClampCount = item.__layout({ + x: x, + y: y, + w: w, + h: h, + lx: lx, + nowrap: whiteSpace === 'nowrap', + lineBoxManager: lineBoxManager, + endSpace: endSpace, + lineClamp: lineClamp, + lineClampCount: lineClampCount + }, isVirtual); // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb + + (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item); + x = lineBoxManager.lastX; + y = lineBoxManager.lastY; + } // 放不下处理之前的lineBox,并重新开头 + else { + isInline2 && lineClampCount++; + x = lx; + y = lineBoxManager.endY; + lineBoxManager.setNewLine(); + lineClampCount = item.__layout({ + x: x, + y: y, + w: w, + h: h, + lx: lx, + lineBoxManager: lineBoxManager, + endSpace: endSpace, + lineClamp: lineClamp, + lineClampCount: lineClampCount + }, isVirtual); // 重新开头的ib和上面开头处一样逻辑 + + if (item.__isIbFull) { + lineBoxManager.addItem(item); + x = lx; + y += item.outerHeight; + lineBoxManager.setNotEnd(); + } // inline和不折行的ib,其中ib需要手动存入当前lb中 + else { + (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item); + x = lineBoxManager.lastX; + y = lineBoxManager.lastY; + } + } + } + } // inline里的其它只有文本,可能开始紧跟着之前的x,也可能换行后从lx行头开始 + // 紧跟着x可能出现在前面有节点换行后第2行,此时不一定放得下,因此不能作为判断依据,开头仅有lx + else { + var n = lineBoxManager.size; // i为0时强制不换行 + + if (x === lx || !i || whiteSpace === 'nowrap') { + lineClampCount = item.__layout({ + x: x, + y: y, + w: w, + h: h, + lx: lx, + lineBoxManager: lineBoxManager, + endSpace: endSpace, + lineClamp: lineClamp, + lineClampCount: lineClampCount + }, isVirtual); + x = lineBoxManager.lastX; + y = lineBoxManager.lastY; // ib情况发生折行,且非定宽 + + if (!isInline && lineBoxManager.size - n > 1 && width[1] === AUTO$2) { + isIbFull = true; + } } else { - // 不换行继续排,换行非开头先尝试是否放得下,结尾要考虑mpb因此减去endSpace - var fw = whiteSpace === 'nowrap' ? 0 : item.__tryLayInline(w - x + lx, w - (isEnd ? endSpace : 0)); // 放得下继续 + // 非开头先尝试是否放得下,如果放得下再看是否end,加end且只有1个字时放不下要换行,否则可以放,换行由text内部做 + // 第一个Text且父元素声明了nowrap也强制不换行,非第一个则看本身whiteSpace声明 + var focusNoWrap = !i && nowrap || whiteSpace === 'nowrap'; - if (fw >= -1e-10) { + 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; + } + } // 放得下继续 + + + if (_fw2 >= -1e-10) { lineClampCount = item.__layout({ x: x, y: y, w: w, h: h, lx: lx, - nowrap: whiteSpace === 'nowrap', lineBoxManager: lineBoxManager, endSpace: endSpace, lineClamp: lineClamp, lineClampCount: lineClampCount - }, isVirtual); // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb - - (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item); + }, isVirtual); x = lineBoxManager.lastX; - y = lineBoxManager.lastY; + y = lineBoxManager.lastY; // 这里ib放得下一定是要么没换行要么固定宽度,所以无需判断isIbFull } // 放不下处理之前的lineBox,并重新开头 else { - isInline2 && lineClampCount++; - x = lx; - y = lineBoxManager.endY; - lineBoxManager.setNewLine(); - lineClampCount = item.__layout({ - x: x, - y: y, - w: w, - h: h, - lx: lx, - lineBoxManager: lineBoxManager, - endSpace: endSpace, - lineClamp: lineClamp, - lineClampCount: lineClampCount - }, isVirtual); // 重新开头的ib和上面开头处一样逻辑 - - if (item.__isIbFull) { - lineBoxManager.addItem(item); - x = lx; - y += item.outerHeight; - lineBoxManager.setNotEnd(); - } // inline和不折行的ib,其中ib需要手动存入当前lb中 - else { - (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item); - x = lineBoxManager.lastX; - y = lineBoxManager.lastY; - } - } - } - } // inline里的其它只有文本,可能开始紧跟着之前的x,也可能换行后从lx行头开始 - // 紧跟着x可能出现在前面有节点换行后第2行,此时不一定放得下,因此不能作为判断依据,开头仅有lx - else { - var n = lineBoxManager.size; // i为0时强制不换行 - - if (x === lx || !i || whiteSpace === 'nowrap') { + lineClampCount++; + x = lx; + y = lineBoxManager.endY; + lineBoxManager.setNewLine(); lineClampCount = item.__layout({ x: x, y: y, @@ -23491,67 +23549,14 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { lineClampCount: lineClampCount }, isVirtual); x = lineBoxManager.lastX; - y = lineBoxManager.lastY; // ib情况发生折行,且非定宽 + y = lineBoxManager.lastY; // ib情况发生折行 - if (!isInline && lineBoxManager.size - n > 1 && width[1] === AUTO$6) { + if (!isInline && lineBoxManager.size - n > 1 && width[1] === AUTO$2) { isIbFull = 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; - } - } // 放得下继续 - - - if (_fw2 >= -1e-10) { - lineClampCount = item.__layout({ - x: x, - y: y, - w: w, - h: h, - lx: lx, - lineBoxManager: lineBoxManager, - endSpace: endSpace, - lineClamp: lineClamp, - lineClampCount: lineClampCount - }, isVirtual); - x = lineBoxManager.lastX; - y = lineBoxManager.lastY; // 这里ib放得下一定是要么没换行要么固定宽度,所以无需判断isIbFull - } // 放不下处理之前的lineBox,并重新开头 - else { - lineClampCount++; - x = lx; - y = lineBoxManager.endY; - lineBoxManager.setNewLine(); - lineClampCount = item.__layout({ - x: x, - y: y, - w: w, - h: h, - lx: lx, - lineBoxManager: lineBoxManager, - endSpace: endSpace, - lineClamp: lineClamp, - lineClampCount: lineClampCount - }, isVirtual); - x = lineBoxManager.lastX; - y = lineBoxManager.lastY; // ib情况发生折行 - - if (!isInline && lineBoxManager.size - n > 1 && width[1] === AUTO$6) { - isIbFull = true; - } - } } } + } }); // 同block结尾,不过这里一定是lineBox结束,无需判断 y = lineBoxManager.endY; // 标识ib情况同block一样占满行 @@ -23569,8 +23574,8 @@ 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]; + _paddingLeft2 = computedStyle[PADDING_LEFT$3], + _borderLeftWidth2 = computedStyle[BORDER_LEFT_WIDTH$3]; lineBoxManager.addX(_marginLeft2 + _paddingLeft2 + _borderLeftWidth2); } // 结束出栈contentBox,递归情况结束子inline获取contentBox,父inline继续 @@ -23597,7 +23602,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { lineBoxManager.horizonAlign(tw, textAlign); // 直接text需计算size flowChildren.forEach(function (item) { - if (item instanceof Component$1) { + if (item instanceof Component) { item = item.shadowRoot; } @@ -23634,19 +23639,19 @@ 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], - marginBottom = computedStyle[MARGIN_BOTTOM$1], + var marginTop = computedStyle[MARGIN_TOP$3], + marginRight = computedStyle[MARGIN_RIGHT$2], + marginBottom = computedStyle[MARGIN_BOTTOM$3], marginLeft = computedStyle[MARGIN_LEFT$3], - paddingTop = computedStyle[PADDING_TOP$2], - paddingRight = computedStyle[PADDING_RIGHT$3], - paddingBottom = computedStyle[PADDING_BOTTOM$2], - paddingLeft = computedStyle[PADDING_LEFT$4], + paddingTop = computedStyle[PADDING_TOP$3], + paddingRight = computedStyle[PADDING_RIGHT$2], + paddingBottom = computedStyle[PADDING_BOTTOM$3], + paddingLeft = computedStyle[PADDING_LEFT$3], borderTopWidth = computedStyle[BORDER_TOP_WIDTH$3], - borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$4], + borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$2], 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$3], + lineHeight = computedStyle[LINE_HEIGHT]; // 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; @@ -23675,32 +23680,32 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { } } // 第一个初始化 else { - minX = item.x; - minY = item.y; - minCX = minX - paddingLeft; - minCY = minY - paddingTop; - minFX = minCX - borderLeftWidth; - minFY = minCY - borderTopWidth; - minOX = minFX - marginLeft; - minOY = minFY - marginTop; - maxX = maxCX = maxFX = maxOX = item.x + item.outerWidth; - maxY = maxCY = maxFY = maxOY = item.y + item.outerHeight; + minX = item.x; + minY = item.y; + minCX = minX - paddingLeft; + minCY = minY - paddingTop; + minFX = minCX - borderLeftWidth; + minFY = minCY - borderTopWidth; + minOX = minFX - marginLeft; + minOY = minFY - marginTop; + maxX = maxCX = maxFX = maxOX = item.x + item.outerWidth; + maxY = maxCY = maxFY = maxOY = item.y + item.outerHeight; - if (i === length - 1) { - maxCX += paddingRight; - maxCY += paddingBottom; - maxFX += paddingRight + borderRightWidth; - maxFY += paddingBottom + borderBottomWidth; - maxOX += borderRightWidth + paddingRight + marginRight; - maxOY += borderBottomWidth + paddingBottom + marginBottom; - } + if (i === length - 1) { + maxCX += paddingRight; + maxCY += paddingBottom; + maxFX += paddingRight + borderRightWidth; + maxFY += paddingBottom + borderBottomWidth; + maxOX += borderRightWidth + paddingRight + marginRight; + maxOY += borderBottomWidth + paddingBottom + marginBottom; } + } }); this.__x = minOX; this.__y = minOY; - this.__width = computedStyle[WIDTH$5] = maxX - minX; // 防止比自己最小高度lineHeight还小,比如内容是个小字体 + this.__width = computedStyle[WIDTH$3] = maxX - minX; // 防止比自己最小高度lineHeight还小,比如内容是个小字体 - this.__height = computedStyle[HEIGHT$5] = Math.max(lineHeight, maxY - minY); + this.__height = computedStyle[HEIGHT$3] = Math.max(lineHeight, maxY - minY); this.__clientWidth = maxCX - minCX; this.__clientHeight = maxCY - minCY; this.__offsetWidth = maxFX - minFX; @@ -23731,41 +23736,41 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { } } // 如果没有内容,宽度为0高度为lineHeight,对齐也特殊处理,lineBoxManager不会处理 else { - if (['center', 'right'].indexOf(textAlign) > -1) { - var diff = tw; + if (['center', 'right'].indexOf(textAlign) > -1) { + var diff = tw; - if (textAlign === 'center') { - diff *= 0.5; - } + if (textAlign === 'center') { + diff *= 0.5; + } - if (diff) { - this.__offsetX(diff, true); - } + if (diff) { + this.__offsetX(diff, true); } + } - this.__width = computedStyle[WIDTH$5] = 0; - var th = this.__height = computedStyle[HEIGHT$5] = lineHeight; + this.__width = computedStyle[WIDTH$3] = 0; + var th = this.__height = computedStyle[HEIGHT$3] = lineHeight; - this.__ioSize(0, th); + this.__ioSize(0, th); - this.__sy -= marginTop + paddingTop + borderTopWidth; - this.__sx1 = this.sx + marginLeft; - this.__sy1 = this.sy + marginTop; - this.__sx2 = this.__sx1 + borderLeftWidth; - this.__sy2 = this.__sy1 + borderTopWidth; - this.__sx4 = this.__sx3 = this.__sx2 + paddingLeft; - this.__sy4 = this.__sy3 = this.__sy2 + paddingTop; - this.__sx5 = this.__sx4 + paddingRight; - this.__sy5 = this.__sy4 + th + paddingBottom; - this.__sx6 = this.__sx5 + borderRightWidth; - this.__sy6 = this.__sy5 + borderBottomWidth; - this.__clientWidth = this.__sx5 - this.__sx2; - this.__clientHeight = this.__sy5 - this.__sy2; - this.__offsetWidth = this.__sx6 - this.__sx1; - this.__offsetHeight = this.__sy6 - this.__sy1; - this.__outerWidth = this.__offsetWidth + marginLeft + marginRight; - this.__outerHeight = this.__offsetHeight + marginTop + marginBottom; - } + this.__sy -= marginTop + paddingTop + borderTopWidth; + this.__sx1 = this.sx + marginLeft; + this.__sy1 = this.sy + marginTop; + this.__sx2 = this.__sx1 + borderLeftWidth; + this.__sy2 = this.__sy1 + borderTopWidth; + this.__sx4 = this.__sx3 = this.__sx2 + paddingLeft; + this.__sy4 = this.__sy3 = this.__sy2 + paddingTop; + this.__sx5 = this.__sx4 + paddingRight; + this.__sy5 = this.__sy4 + th + paddingBottom; + this.__sx6 = this.__sx5 + borderRightWidth; + this.__sy6 = this.__sy5 + borderBottomWidth; + this.__clientWidth = this.__sx5 - this.__sx2; + this.__clientHeight = this.__sy5 - this.__sy2; + this.__offsetWidth = this.__sx6 - this.__sx1; + this.__offsetHeight = this.__sy6 - this.__sy1; + this.__outerWidth = this.__offsetWidth + marginLeft + marginRight; + this.__outerHeight = this.__offsetHeight + marginTop + marginBottom; + } } /** * 只针对绝对定位children布局 @@ -23788,13 +23793,13 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { var isDestroyed = this.isDestroyed, children = this.children, absChildren = this.absChildren; - var display = computedStyle[DISPLAY$6], + var display = computedStyle[DISPLAY$4], borderTopWidth = computedStyle[BORDER_TOP_WIDTH$3], - borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$5], - marginTop = computedStyle[MARGIN_TOP$1], + borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$3], + marginTop = computedStyle[MARGIN_TOP$3], marginLeft = computedStyle[MARGIN_LEFT$3], - paddingLeft = computedStyle[PADDING_LEFT$4], - paddingTop = computedStyle[PADDING_TOP$2]; + paddingLeft = computedStyle[PADDING_LEFT$3], + paddingTop = computedStyle[PADDING_TOP$3]; if (isDestroyed || display === 'none') { this.__layoutNone(); @@ -23810,7 +23815,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr var node = item; - if (node instanceof Component$1) { + if (node instanceof Component) { node = item.shadowRoot; } // 所以得2个都对比 @@ -23823,7 +23828,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { var currentStyle = item.currentStyle, computedStyle = item.computedStyle; - if (currentStyle[DISPLAY$6] === 'none') { + if (currentStyle[DISPLAY$4] === 'none') { item.__layoutNone(); return; @@ -23832,18 +23837,18 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { item.__mp(currentStyle, computedStyle, clientWidth); - if (currentStyle[DISPLAY$6] !== 'block' && currentStyle[DISPLAY$6] !== 'flex') { - currentStyle[DISPLAY$6] = computedStyle[DISPLAY$6] = 'block'; + if (currentStyle[DISPLAY$4] !== 'block' && currentStyle[DISPLAY$4] !== 'flex') { + currentStyle[DISPLAY$4] = computedStyle[DISPLAY$4] = 'block'; } var left = currentStyle[LEFT$1], - top = currentStyle[TOP$3], + top = currentStyle[TOP$1], right = currentStyle[RIGHT$1], - bottom = currentStyle[BOTTOM$3], - width = currentStyle[WIDTH$5], - height = currentStyle[HEIGHT$5], - display = currentStyle[DISPLAY$6], - flexDirection = currentStyle[FLEX_DIRECTION$2]; + bottom = currentStyle[BOTTOM$1], + width = currentStyle[WIDTH$3], + height = currentStyle[HEIGHT$3], + display = currentStyle[DISPLAY$4], + flexDirection = currentStyle[FLEX_DIRECTION]; var x2, y2, w2, h2; var onlyRight; var onlyBottom; @@ -23852,32 +23857,32 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { var fixedBottom; var fixedLeft; // 判断何种方式的定位,比如左+宽度,左+右之类 - if (left[1] !== AUTO$6) { + if (left[1] !== AUTO$2) { fixedLeft = true; - computedStyle[LEFT$1] = calAbsolute$1(currentStyle, 'left', left, clientWidth, _this4.root); + computedStyle[LEFT$1] = calAbsolute(currentStyle, 'left', left, clientWidth, _this4.root); } else { computedStyle[LEFT$1] = 'auto'; } - if (right[1] !== AUTO$6) { + if (right[1] !== AUTO$2) { fixedRight = true; - computedStyle[RIGHT$1] = calAbsolute$1(currentStyle, 'right', right, clientWidth, _this4.root); + computedStyle[RIGHT$1] = calAbsolute(currentStyle, 'right', right, clientWidth, _this4.root); } else { computedStyle[RIGHT$1] = 'auto'; } - if (top[1] !== AUTO$6) { + if (top[1] !== AUTO$2) { fixedTop = true; - computedStyle[TOP$3] = calAbsolute$1(currentStyle, 'top', top, clientHeight, _this4.root); + computedStyle[TOP$1] = calAbsolute(currentStyle, 'top', top, clientHeight, _this4.root); } else { - computedStyle[TOP$3] = 'auto'; + computedStyle[TOP$1] = 'auto'; } - if (bottom[1] !== AUTO$6) { + if (bottom[1] !== AUTO$2) { fixedBottom = true; - computedStyle[BOTTOM$3] = calAbsolute$1(currentStyle, 'bottom', bottom, clientHeight, _this4.root); + computedStyle[BOTTOM$1] = calAbsolute(currentStyle, 'bottom', bottom, clientHeight, _this4.root); } else { - computedStyle[BOTTOM$3] = 'auto'; + computedStyle[BOTTOM$1] = 'auto'; } // 优先级最高left+right,其次left+width,再次right+width,再次仅申明单个,最次全部auto @@ -23887,11 +23892,11 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { } else if (fixedLeft) { x2 = x + computedStyle[LEFT$1]; - if (width[1] !== AUTO$6) { - if (width[1] === PERCENT$9) { + if (width[1] !== AUTO$2) { + if (width[1] === PERCENT$3) { w2 = width[0] * clientWidth * 0.01; } else if (width[1] === REM$8) { - w2 = width[0] * _this4.root.computedStyle[FONT_SIZE$9]; + w2 = width[0] * _this4.root.computedStyle[FONT_SIZE$8]; } else if (width[1] === VW$8) { w2 = width[0] * _this4.root.width * 0.01; } else if (width[1] === VH$8) { @@ -23901,11 +23906,11 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { } } } else if (fixedRight) { - if (width[1] !== AUTO$6) { - if (width[1] === PERCENT$9) { + if (width[1] !== AUTO$2) { + if (width[1] === PERCENT$3) { w2 = width[0] * clientWidth * 0.01; } else if (width[1] === REM$8) { - w2 = width[0] * _this4.root.computedStyle[FONT_SIZE$9]; + w2 = width[0] * _this4.root.computedStyle[FONT_SIZE$8]; } else if (width[1] === VW$8) { w2 = width[0] * _this4.root.width * 0.01; } else if (width[1] === VH$8) { @@ -23920,19 +23925,19 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { 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 -= currentStyle[BORDER_LEFT_WIDTH$5][0]; - x2 -= currentStyle[BORDER_RIGHT_WIDTH$4][0]; + x2 -= computedStyle[MARGIN_RIGHT$2]; + x2 -= computedStyle[PADDING_LEFT$3]; + x2 -= computedStyle[PADDING_RIGHT$2]; + x2 -= currentStyle[BORDER_LEFT_WIDTH$3][0]; + x2 -= currentStyle[BORDER_RIGHT_WIDTH$2][0]; } else { x2 = x + paddingLeft; - if (width[1] !== AUTO$6) { - if (width[1] === PERCENT$9) { + if (width[1] !== AUTO$2) { + if (width[1] === PERCENT$3) { w2 = width[0] * clientWidth * 0.01; } else if (width[1] === REM$8) { - w2 = width[0] * _this4.root.computedStyle[FONT_SIZE$9]; + w2 = width[0] * _this4.root.computedStyle[FONT_SIZE$8]; } else if (width[1] === VW$8) { w2 = width[0] * _this4.root.width * 0.01; } else if (width[1] === VH$8) { @@ -23945,16 +23950,16 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { if (fixedTop && fixedBottom) { - y2 = y + computedStyle[TOP$3]; - h2 = y + clientHeight - computedStyle[BOTTOM$3] - y2; + y2 = y + computedStyle[TOP$1]; + h2 = y + clientHeight - computedStyle[BOTTOM$1] - y2; } else if (fixedTop) { - y2 = y + computedStyle[TOP$3]; + y2 = y + computedStyle[TOP$1]; - if (height[1] !== AUTO$6) { - if (height[1] === PERCENT$9) { + if (height[1] !== AUTO$2) { + if (height[1] === PERCENT$3) { h2 = height[0] * clientHeight * 0.01; } else if (height[1] === REM$8) { - h2 = height[0] * _this4.root.computedStyle[FONT_SIZE$9]; + h2 = height[0] * _this4.root.computedStyle[FONT_SIZE$8]; } else if (height[1] === VW$8) { h2 = height[0] * _this4.root.width * 0.01; } else if (height[1] === VH$8) { @@ -23964,11 +23969,11 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { } } } else if (fixedBottom) { - if (height[1] !== AUTO$6) { - if (height[1] === PERCENT$9) { + if (height[1] !== AUTO$2) { + if (height[1] === PERCENT$3) { h2 = height[0] * clientHeight * 0.01; } else if (height[1] === REM$8) { - h2 = height[0] * _this4.root.computedStyle[FONT_SIZE$9]; + h2 = height[0] * _this4.root.computedStyle[FONT_SIZE$8]; } else if (height[1] === VW$8) { h2 = height[0] * _this4.root.width * 0.01; } else if (height[1] === VH$8) { @@ -23980,41 +23985,41 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { onlyBottom = true; } - y2 = y + clientHeight - computedStyle[BOTTOM$3] - (h2 || 0); // 底对齐有尺寸时y值还需减去margin/border/padding的 + y2 = y + clientHeight - computedStyle[BOTTOM$1] - (h2 || 0); // 底对齐有尺寸时y值还需减去margin/border/padding的 - y2 -= computedStyle[MARGIN_TOP$1]; - y2 -= computedStyle[MARGIN_BOTTOM$1]; - y2 -= computedStyle[PADDING_TOP$2]; - y2 -= computedStyle[PADDING_BOTTOM$2]; + y2 -= computedStyle[MARGIN_TOP$3]; + y2 -= computedStyle[MARGIN_BOTTOM$3]; + y2 -= computedStyle[PADDING_TOP$3]; + y2 -= computedStyle[PADDING_BOTTOM$3]; y2 -= currentStyle[BORDER_TOP_WIDTH$3][0]; y2 -= currentStyle[BORDER_BOTTOM_WIDTH$3][0]; } // 未声明y的找到之前的流布局child,紧随其下 else { - y2 = y + paddingTop; - var prev = item.prev; + y2 = y + paddingTop; + var prev = item.prev; - while (prev) { - // 目前不考虑margin合并,直接以前面的flow的最近的prev末尾为准 - if (prev instanceof Text || prev.computedStyle[POSITION$3] !== 'absolute') { - y2 = prev.y + prev.outerHeight; - break; - } - - prev = prev.prev; + while (prev) { + // 目前不考虑margin合并,直接以前面的flow的最近的prev末尾为准 + if (prev instanceof Text || prev.computedStyle[POSITION$2] !== 'absolute') { + y2 = prev.y + prev.outerHeight; + break; } - if (height[1] === PERCENT$9) { - h2 = height[0] * clientHeight * 0.01; - } else if (height[1] === REM$8) { - h2 = height[0] * _this4.root.computedStyle[FONT_SIZE$9]; - } else if (height[1] === VW$8) { - h2 = height[0] * _this4.root.width * 0.01; - } else if (height[1] === VH$8) { - h2 = height[0] * _this4.root.height * 0.01; - } else if (height[1] === PX$8) { - h2 = height[0]; - } - } // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局 + prev = prev.prev; + } + + if (height[1] === PERCENT$3) { + h2 = height[0] * clientHeight * 0.01; + } else if (height[1] === REM$8) { + h2 = height[0] * _this4.root.computedStyle[FONT_SIZE$8]; + } else if (height[1] === VW$8) { + h2 = height[0] * _this4.root.width * 0.01; + } else if (height[1] === VH$8) { + h2 = height[0] * _this4.root.height * 0.01; + } else if (height[1] === PX$3) { + h2 = height[0]; + } + } // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局 var needCalWidth; @@ -24070,7 +24075,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr var node = item; - if (node instanceof Component$1) { + if (node instanceof Component) { node = item.shadowRoot; } // 所以得2个都对比 @@ -24082,7 +24087,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { if (item instanceof Dom) { item.__layoutAbs(isRelativeOrAbsolute$1(item) ? item : container, data); - } else if (item instanceof Component$1) { + } else if (item instanceof Component) { var sr = item.shadowRoot; if (sr instanceof Dom) { @@ -24150,7 +24155,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { computedStyle = this.computedStyle, isMask = this.isMask; - if (isDestroyed || computedStyle[DISPLAY$6] === 'none' || e.__stopPropagation || isMask) { + if (isDestroyed || computedStyle[DISPLAY$4] === 'none' || e.__stopPropagation || isMask) { return; } // 检查perspective嵌套状态,自身有perspective则设置10位,自身有transform的p矩阵则设置01位 // if(computedStyle[PERSPECTIVE]) { @@ -24162,7 +24167,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { // overflow:hidden时还需要判断是否超出范围外,如果是则无效 - if (computedStyle[OVERFLOW$2] === 'hidden' && !this.willResponseEvent(e, true)) { + if (computedStyle[OVERFLOW$1] === 'hidden' && !this.willResponseEvent(e, true)) { return; } // 找到对应的callback @@ -24180,7 +24185,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { for (var i = zIndexChildren.length - 1; i >= 0; i--) { var child = zIndexChildren[i]; - if (child instanceof Xom$1 || child instanceof Component$1 && child.shadowRoot instanceof Xom$1) { + if (child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) { if (child.__emitEvent(e)) { // 孩子阻止冒泡 if (e.__stopPropagation) { @@ -24252,11 +24257,11 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { self.__zIndexChildren = null; // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题 var res = {}; - res[UPDATE_NODE$3] = vd; - res[UPDATE_FOCUS$2] = o$3.REFLOW; - res[UPDATE_ADD_DOM] = true; + res[UPDATE_NODE$2] = vd; + res[UPDATE_FOCUS$2] = o$1.REFLOW; + res[UPDATE_ADD_DOM$1] = true; res[UPDATE_MEASURE$1] = true; - res[UPDATE_CONFIG$3] = vd.__config; + res[UPDATE_CONFIG$2] = vd.__config; root.__addUpdate(vd, vd.__config, root, root.__config, res); }, @@ -24312,11 +24317,11 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { self.__zIndexChildren = null; // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题 var res = {}; - res[UPDATE_NODE$3] = vd; - res[UPDATE_FOCUS$2] = o$3.REFLOW; - res[UPDATE_ADD_DOM] = true; + res[UPDATE_NODE$2] = vd; + res[UPDATE_FOCUS$2] = o$1.REFLOW; + res[UPDATE_ADD_DOM$1] = true; res[UPDATE_MEASURE$1] = true; - res[UPDATE_CONFIG$3] = vd.__config; + res[UPDATE_CONFIG$2] = vd.__config; root.__addUpdate(vd, vd.__config, root, root.__config, res); }, @@ -24397,11 +24402,11 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { domParent.__zIndexChildren = null; // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题 var res = {}; - res[UPDATE_NODE$3] = vd; - res[UPDATE_FOCUS$2] = o$3.REFLOW; - res[UPDATE_ADD_DOM] = true; + res[UPDATE_NODE$2] = vd; + res[UPDATE_FOCUS$2] = o$1.REFLOW; + res[UPDATE_ADD_DOM$1] = true; res[UPDATE_MEASURE$1] = true; - res[UPDATE_CONFIG$3] = vd.__config; + res[UPDATE_CONFIG$2] = vd.__config; root.__addUpdate(vd, vd.__config, root, root.__config, res); }, @@ -24482,11 +24487,11 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { domParent.__zIndexChildren = null; // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题 var res = {}; - res[UPDATE_NODE$3] = vd; - res[UPDATE_FOCUS$2] = o$3.REFLOW; - res[UPDATE_ADD_DOM] = true; + res[UPDATE_NODE$2] = vd; + res[UPDATE_FOCUS$2] = o$1.REFLOW; + res[UPDATE_ADD_DOM$1] = true; res[UPDATE_MEASURE$1] = true; - res[UPDATE_CONFIG$3] = vd.__config; + res[UPDATE_CONFIG$2] = vd.__config; root.__addUpdate(vd, vd.__config, root, root.__config, res); }, @@ -24504,7 +24509,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { }, { key: "removeChild", value: function removeChild(target, cb) { - if (target.parent === this && (target instanceof Xom$1 || target instanceof Component$1)) { + if (target.parent === this && (target instanceof Xom || target instanceof Component)) { if (this.isDestroyed) { inject.warn('Remove parent is destroyed.'); @@ -24529,22 +24534,22 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { key: "flowChildren", get: function get() { return this.children.filter(function (item) { - if (item instanceof Component$1) { + if (item instanceof Component) { item = item.shadowRoot; } - return item instanceof Text || item.currentStyle[POSITION$3] !== 'absolute'; + return item instanceof Text || item.currentStyle[POSITION$2] !== 'absolute'; }); } }, { key: "absChildren", get: function get() { return this.children.filter(function (item) { - if (item instanceof Component$1) { + if (item instanceof Component) { item = item.shadowRoot; } - return item instanceof Xom$1 && item.currentStyle[POSITION$3] === 'absolute'; + return item instanceof Xom && item.currentStyle[POSITION$2] === 'absolute'; }); } }, { @@ -24565,9 +24570,9 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { } var _this$computedStyle = this.computedStyle, - marginTop = _this$computedStyle[MARGIN_TOP$1], + marginTop = _this$computedStyle[MARGIN_TOP$3], borderTopWidth = _this$computedStyle[BORDER_TOP_WIDTH$3], - paddingTop = _this$computedStyle[PADDING_TOP$2]; + paddingTop = _this$computedStyle[PADDING_TOP$3]; return marginTop + borderTopWidth + paddingTop + this.lineBoxManager.baseLine; } }, { @@ -24578,9 +24583,9 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { } var _this$computedStyle2 = this.computedStyle, - marginTop = _this$computedStyle2[MARGIN_TOP$1], + marginTop = _this$computedStyle2[MARGIN_TOP$3], borderTopWidth = _this$computedStyle2[BORDER_TOP_WIDTH$3], - paddingTop = _this$computedStyle2[PADDING_TOP$2]; + paddingTop = _this$computedStyle2[PADDING_TOP$3]; return marginTop + borderTopWidth + paddingTop + this.lineBoxManager.firstBaseLine; } }, { @@ -24591,55 +24596,55 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { }]); return Dom; -}(Xom$1); +}(Xom); -var _enums$STYLE_KEY$g = enums.STYLE_KEY, - WIDTH$6 = _enums$STYLE_KEY$g.WIDTH, - HEIGHT$6 = _enums$STYLE_KEY$g.HEIGHT, - DISPLAY$7 = _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$4 = _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_TOP$2 = _enums$STYLE_KEY$g.MARGIN_TOP, - MARGIN_RIGHT$4 = _enums$STYLE_KEY$g.MARGIN_RIGHT, - MARGIN_BOTTOM$2 = _enums$STYLE_KEY$g.MARGIN_BOTTOM, - MARGIN_LEFT$4 = _enums$STYLE_KEY$g.MARGIN_LEFT, - PADDING_TOP$3 = _enums$STYLE_KEY$g.PADDING_TOP, - PADDING_RIGHT$4 = _enums$STYLE_KEY$g.PADDING_RIGHT, - PADDING_BOTTOM$3 = _enums$STYLE_KEY$g.PADDING_BOTTOM, - 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, - _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, - UPDATE_CONFIG$4 = _enums$UPDATE_KEY$4.UPDATE_CONFIG, - _enums$NODE_KEY$6 = enums.NODE_KEY, - NODE_CACHE$3 = _enums$NODE_KEY$6.NODE_CACHE, - NODE_DEFS_CACHE$4 = _enums$NODE_KEY$6.NODE_DEFS_CACHE, - NODE_IS_MASK$1 = _enums$NODE_KEY$6.NODE_IS_MASK; -var AUTO$7 = o.AUTO, - PX$9 = o.PX, - PERCENT$a = o.PERCENT, - REM$9 = o.REM, - VW$9 = o.VW, - VH$9 = o.VH, - RGBA$2 = o.RGBA; -var canvasPolygon$5 = painter.canvasPolygon, - svgPolygon$6 = painter.svgPolygon; -var isFunction$5 = util.isFunction; +var _enums$STYLE_KEY$9 = enums.STYLE_KEY, + WIDTH$2 = _enums$STYLE_KEY$9.WIDTH, + HEIGHT$2 = _enums$STYLE_KEY$9.HEIGHT, + DISPLAY$3 = _enums$STYLE_KEY$9.DISPLAY, + BORDER_TOP_WIDTH$2 = _enums$STYLE_KEY$9.BORDER_TOP_WIDTH, + BORDER_RIGHT_WIDTH$1 = _enums$STYLE_KEY$9.BORDER_RIGHT_WIDTH, + BORDER_LEFT_WIDTH$2 = _enums$STYLE_KEY$9.BORDER_LEFT_WIDTH, + BORDER_BOTTOM_WIDTH$2 = _enums$STYLE_KEY$9.BORDER_BOTTOM_WIDTH, + BORDER_TOP_LEFT_RADIUS = _enums$STYLE_KEY$9.BORDER_TOP_LEFT_RADIUS, + BORDER_TOP_RIGHT_RADIUS = _enums$STYLE_KEY$9.BORDER_TOP_RIGHT_RADIUS, + BORDER_BOTTOM_RIGHT_RADIUS = _enums$STYLE_KEY$9.BORDER_BOTTOM_RIGHT_RADIUS, + BORDER_BOTTOM_LEFT_RADIUS = _enums$STYLE_KEY$9.BORDER_BOTTOM_LEFT_RADIUS, + VISIBILITY$3 = _enums$STYLE_KEY$9.VISIBILITY, + BACKGROUND_IMAGE = _enums$STYLE_KEY$9.BACKGROUND_IMAGE, + BACKGROUND_COLOR = _enums$STYLE_KEY$9.BACKGROUND_COLOR, + BOX_SHADOW$6 = _enums$STYLE_KEY$9.BOX_SHADOW, + MIX_BLEND_MODE$2 = _enums$STYLE_KEY$9.MIX_BLEND_MODE, + MARGIN_TOP$2 = _enums$STYLE_KEY$9.MARGIN_TOP, + MARGIN_RIGHT$1 = _enums$STYLE_KEY$9.MARGIN_RIGHT, + MARGIN_BOTTOM$2 = _enums$STYLE_KEY$9.MARGIN_BOTTOM, + MARGIN_LEFT$2 = _enums$STYLE_KEY$9.MARGIN_LEFT, + PADDING_TOP$2 = _enums$STYLE_KEY$9.PADDING_TOP, + PADDING_RIGHT$1 = _enums$STYLE_KEY$9.PADDING_RIGHT, + PADDING_BOTTOM$2 = _enums$STYLE_KEY$9.PADDING_BOTTOM, + PADDING_LEFT$2 = _enums$STYLE_KEY$9.PADDING_LEFT, + FONT_SIZE$7 = _enums$STYLE_KEY$9.FONT_SIZE, + FLEX_BASIS$1 = _enums$STYLE_KEY$9.FLEX_BASIS, + _enums$UPDATE_KEY$1 = enums.UPDATE_KEY, + UPDATE_NODE$1 = _enums$UPDATE_KEY$1.UPDATE_NODE, + UPDATE_FOCUS$1 = _enums$UPDATE_KEY$1.UPDATE_FOCUS, + UPDATE_CONFIG$1 = _enums$UPDATE_KEY$1.UPDATE_CONFIG, + _enums$NODE_KEY$4 = enums.NODE_KEY, + NODE_CACHE$2 = _enums$NODE_KEY$4.NODE_CACHE, + NODE_DEFS_CACHE$2 = _enums$NODE_KEY$4.NODE_DEFS_CACHE, + NODE_IS_MASK$2 = _enums$NODE_KEY$4.NODE_IS_MASK; +var AUTO$1 = o$4.AUTO, + PX$2 = o$4.PX, + PERCENT$2 = o$4.PERCENT, + REM$7 = o$4.REM, + VW$7 = o$4.VW, + VH$7 = o$4.VH, + RGBA = o$4.RGBA; +var canvasPolygon$2 = painter.canvasPolygon, + svgPolygon$1 = painter.svgPolygon; +var isFunction$3 = util.isFunction; -var Img$1 = /*#__PURE__*/function (_Dom) { +var Img = /*#__PURE__*/function (_Dom) { _inherits(Img, _Dom); var _super = _createSuper(Img); @@ -24661,19 +24666,19 @@ var Img$1 = /*#__PURE__*/function (_Dom) { var config = _this.__config; - if (config[NODE_IS_MASK$1]) { + if (config[NODE_IS_MASK$2]) { var _assertThisInitialize = _assertThisInitialized(_this), style = _assertThisInitialize.style, currentStyle = _assertThisInitialize.currentStyle; - 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_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'; + style[BACKGROUND_IMAGE] = currentStyle[BACKGROUND_IMAGE] = [null]; + style[BACKGROUND_COLOR] = currentStyle[BACKGROUND_COLOR] = [[0, 0, 0, 0], RGBA]; + style[BORDER_TOP_WIDTH$2] = currentStyle[BORDER_TOP_WIDTH$2] = [0, PX$2]; + style[BORDER_RIGHT_WIDTH$1] = currentStyle[BORDER_RIGHT_WIDTH$1] = [0, PX$2]; + style[BORDER_LEFT_WIDTH$2] = currentStyle[BORDER_LEFT_WIDTH$2] = [0, PX$2]; + style[BORDER_BOTTOM_WIDTH$2] = currentStyle[BORDER_BOTTOM_WIDTH$2] = [0, PX$2]; + style[BOX_SHADOW$6] = currentStyle[BOX_SHADOW$6] = null; + style[MIX_BLEND_MODE$2] = currentStyle[MIX_BLEND_MODE$2] = 'normal'; } return _this; @@ -24767,7 +24772,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) { if (!res) { var loadImg = this.__loadImg; - if (computedStyle[VISIBILITY$4] !== 'hidden' && (computedStyle[WIDTH$6] || computedStyle[HEIGHT$6]) && loadImg.source) { + if (computedStyle[VISIBILITY$3] !== 'hidden' && (computedStyle[WIDTH$2] || computedStyle[HEIGHT$2]) && loadImg.source) { res = true; } } @@ -24789,12 +24794,12 @@ var Img$1 = /*#__PURE__*/function (_Dom) { placeholder = this.props.placeholder, computedStyle = this.computedStyle, _this$computedStyle = this.computedStyle, - display = _this$computedStyle[DISPLAY$7], - borderTopLeftRadius = _this$computedStyle[BORDER_TOP_LEFT_RADIUS$2], - borderTopRightRadius = _this$computedStyle[BORDER_TOP_RIGHT_RADIUS$2], - borderBottomRightRadius = _this$computedStyle[BORDER_BOTTOM_RIGHT_RADIUS$2], - borderBottomLeftRadius = _this$computedStyle[BORDER_BOTTOM_LEFT_RADIUS$2], - visibility = _this$computedStyle[VISIBILITY$4], + display = _this$computedStyle[DISPLAY$3], + borderTopLeftRadius = _this$computedStyle[BORDER_TOP_LEFT_RADIUS], + borderTopRightRadius = _this$computedStyle[BORDER_TOP_RIGHT_RADIUS], + borderBottomRightRadius = _this$computedStyle[BORDER_BOTTOM_RIGHT_RADIUS], + borderBottomLeftRadius = _this$computedStyle[BORDER_BOTTOM_LEFT_RADIUS], + visibility = _this$computedStyle[VISIBILITY$3], virtualDom = this.virtualDom, __config = this.__config, loadImg = this.__loadImg, @@ -24825,7 +24830,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) { return res; } - var __cache = __config[NODE_CACHE$3]; + var __cache = __config[NODE_CACHE$2]; if (cache && __cache && __cache.enabled) { ctx = __cache.ctx; @@ -24901,7 +24906,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) { if (list) { ctx.save(); ctx.beginPath(); - canvasPolygon$5(ctx, list); + canvasPolygon$2(ctx, list); ctx.clip(); ctx.closePath(); ctx.drawImage(source, originX, originY, width, height); @@ -24916,7 +24921,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$1(list); var v = { tagName: 'clipPath', props: [], @@ -24928,7 +24933,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) { }; var id = ctx.add(v); - __config[NODE_DEFS_CACHE$4].push(v); + __config[NODE_DEFS_CACHE$2].push(v); virtualDom.conClip = 'url(#' + id + ')'; } @@ -24946,7 +24951,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$1(list); var _v = { tagName: 'clipPath', @@ -24960,7 +24965,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) { var _id = ctx.add(_v); - __config[NODE_DEFS_CACHE$4].push(_v); + __config[NODE_DEFS_CACHE$2].push(_v); virtualDom.conClip = 'url(#' + _id + ')'; delete virtualDom.cache; @@ -25000,38 +25005,38 @@ var Img$1 = /*#__PURE__*/function (_Dom) { key: "__tryLayInline", value: function __tryLayInline(w, total) { 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]; - - if (width[1] === PX$9) { + width = _this$currentStyle[WIDTH$2], + height = _this$currentStyle[HEIGHT$2], + marginLeft = _this$currentStyle[MARGIN_LEFT$2], + marginRight = _this$currentStyle[MARGIN_RIGHT$1], + paddingLeft = _this$currentStyle[PADDING_LEFT$2], + paddingRight = _this$currentStyle[PADDING_RIGHT$1], + borderLeftWidth = _this$currentStyle[BORDER_LEFT_WIDTH$2], + borderRightWidth = _this$currentStyle[BORDER_RIGHT_WIDTH$1]; + + if (width[1] === PX$2) { w -= width[0]; - } else if (width[1] === PERCENT$a) { + } else if (width[1] === PERCENT$2) { w -= total * width[0] * 0.01; - } else if (width[1] === REM$9) { - w -= width[0] * this.root.computedStyle[FONT_SIZE$a]; - } else if (width[1] === VW$9) { + } else if (width[1] === REM$7) { + w -= width[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (width[1] === VW$7) { w -= width[0] * this.root.width * 0.01; - } else if (width[1] === VH$9) { + } else if (width[1] === VH$7) { w -= width[0] * this.root.height * 0.01; } else { var loadImg = this.__loadImg; // 加载成功计算缩放后的宽度 if (loadImg.source) { - if (height[1] === PX$9) { + if (height[1] === PX$2) { w -= loadImg.width * height[0] / loadImg.height; - } else if (height[1] === PERCENT$a) { + } else if (height[1] === PERCENT$2) { 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; - } else if (height[1] === VW$9) { + } else if (height[1] === REM$7) { + w -= loadImg.width * height[0] * this.root.computedStyle[FONT_SIZE$7] / loadImg.height; + } else if (height[1] === VW$7) { w -= loadImg.width * height[0] * this.root.width * 0.01 / loadImg.height; - } else if (height[1] === VH$9) { + } else if (height[1] === VH$7) { w -= loadImg.width * height[0] * this.root.height * 0.01 / loadImg.height; } else { w -= loadImg.width; @@ -25040,71 +25045,71 @@ var Img$1 = /*#__PURE__*/function (_Dom) { } // 减去水平mbp - if (marginLeft[1] === PX$9) { + if (marginLeft[1] === PX$2) { w -= marginLeft[0]; - } else if (marginLeft[1] === PERCENT$a) { + } else if (marginLeft[1] === PERCENT$2) { w -= marginLeft[0] * total * 0.01; - } else if (marginLeft[1] === REM$9) { - w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE$a]; - } else if (marginLeft[1] === VW$9) { + } else if (marginLeft[1] === REM$7) { + w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (marginLeft[1] === VW$7) { w -= marginLeft[0] * this.root.width * 0.01; - } else if (marginLeft[1] === VH$9) { + } else if (marginLeft[1] === VH$7) { w -= marginLeft[0] * this.root.height * 0.01; } - if (paddingLeft[1] === PX$9) { + if (paddingLeft[1] === PX$2) { w -= paddingLeft[0]; - } else if (paddingLeft[1] === PERCENT$a) { + } else if (paddingLeft[1] === PERCENT$2) { w -= paddingLeft[0] * total * 0.01; - } else if (paddingLeft[1] === REM$9) { - w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE$a]; - } else if (paddingLeft[1] === VW$9) { + } else if (paddingLeft[1] === REM$7) { + w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (paddingLeft[1] === VW$7) { w -= paddingLeft[0] * this.root.width * 0.01; - } else if (paddingLeft[1] === VH$9) { + } else if (paddingLeft[1] === VH$7) { w -= paddingLeft[0] * this.root.height * 0.01; } - if (borderLeftWidth[1] === PX$9) { + if (borderLeftWidth[1] === PX$2) { w -= borderLeftWidth[0]; - } else if (borderLeftWidth[1] === REM$9) { - w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$a]; - } else if (borderLeftWidth[1] === VW$9) { + } else if (borderLeftWidth[1] === REM$7) { + w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (borderLeftWidth[1] === VW$7) { w -= borderLeftWidth[0] * this.root.width * 0.01; - } else if (borderLeftWidth[1] === VH$9) { + } else if (borderLeftWidth[1] === VH$7) { w -= borderLeftWidth[0] * this.root.height * 0.01; } - if (marginRight[1] === PX$9) { + if (marginRight[1] === PX$2) { w -= marginRight[0]; - } else if (marginRight[1] === PERCENT$a) { + } else if (marginRight[1] === PERCENT$2) { w -= marginRight[0] * total * 0.01; - } else if (marginRight[1] === REM$9) { - w -= marginRight[0] * this.root.computedStyle[FONT_SIZE$a]; - } else if (marginRight[1] === VW$9) { + } else if (marginRight[1] === REM$7) { + w -= marginRight[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (marginRight[1] === VW$7) { w -= marginRight[0] * this.root.width * 0.01; - } else if (marginRight[1] === VH$9) { + } else if (marginRight[1] === VH$7) { w -= marginRight[0] * this.root.height * 0.01; } - if (paddingRight[1] === PX$9) { + if (paddingRight[1] === PX$2) { w -= paddingRight[0]; - } else if (paddingRight[1] === PERCENT$a) { + } else if (paddingRight[1] === PERCENT$2) { w -= paddingRight[0] * total * 0.01; - } else if (paddingRight[1] === REM$9) { - w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE$a]; - } else if (paddingRight[1] === VW$9) { + } else if (paddingRight[1] === REM$7) { + w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (paddingRight[1] === VW$7) { w -= paddingRight[0] * this.root.width * 0.01; - } else if (paddingRight[1] === VH$9) { + } else if (paddingRight[1] === VH$7) { w -= paddingRight[0] * this.root.height * 0.01; } - if (borderRightWidth[1] === PX$9) { + if (borderRightWidth[1] === PX$2) { w -= borderRightWidth[0]; - } else if (borderRightWidth[1] === REM$9) { - w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$a]; - } else if (borderRightWidth[1] === VW$9) { + } else if (borderRightWidth[1] === REM$7) { + w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (borderRightWidth[1] === VW$7) { w -= borderRightWidth[0] * this.root.width * 0.01; - } else if (borderRightWidth[1] === VH$9) { + } else if (borderRightWidth[1] === VH$7) { w -= borderRightWidth[0] * this.root.height * 0.01; } @@ -25121,71 +25126,71 @@ var Img$1 = /*#__PURE__*/function (_Dom) { var w = data.w, h = data.h; // 计算需考虑style的属性 - var flexBasis = currentStyle[FLEX_BASIS$3], - width = currentStyle[WIDTH$6], - height = currentStyle[HEIGHT$6], - marginLeft = currentStyle[MARGIN_LEFT$4], + var flexBasis = currentStyle[FLEX_BASIS$1], + width = currentStyle[WIDTH$2], + height = currentStyle[HEIGHT$2], + marginLeft = currentStyle[MARGIN_LEFT$2], marginTop = currentStyle[MARGIN_TOP$2], - marginRight = currentStyle[MARGIN_RIGHT$4], + marginRight = currentStyle[MARGIN_RIGHT$1], marginBottom = currentStyle[MARGIN_BOTTOM$2], - paddingLeft = currentStyle[PADDING_LEFT$5], - paddingTop = currentStyle[PADDING_TOP$3], - paddingRight = currentStyle[PADDING_RIGHT$4], - paddingBottom = currentStyle[PADDING_BOTTOM$3], - borderTopWidth = currentStyle[BORDER_TOP_WIDTH$4], - borderRightWidth = currentStyle[BORDER_RIGHT_WIDTH$5], - borderBottomWidth = currentStyle[BORDER_BOTTOM_WIDTH$4], - borderLeftWidth = currentStyle[BORDER_LEFT_WIDTH$6]; + paddingLeft = currentStyle[PADDING_LEFT$2], + paddingTop = currentStyle[PADDING_TOP$2], + paddingRight = currentStyle[PADDING_RIGHT$1], + paddingBottom = currentStyle[PADDING_BOTTOM$2], + borderTopWidth = currentStyle[BORDER_TOP_WIDTH$2], + borderRightWidth = currentStyle[BORDER_RIGHT_WIDTH$1], + borderBottomWidth = currentStyle[BORDER_BOTTOM_WIDTH$2], + borderLeftWidth = currentStyle[BORDER_LEFT_WIDTH$2]; var main = isDirectionRow ? width : height; var cross = isDirectionRow ? height : width; // basis3种情况:auto、固定、content,只区分固定和其它 - var isFixed = [PX$9, PERCENT$a, REM$9, VW$9, VH$9].indexOf(flexBasis[1]) > -1; + var isFixed = [PX$2, PERCENT$2, REM$7, VW$7, VH$7].indexOf(flexBasis[1]) > -1; if (isFixed) { - if (flexBasis[1] === PX$9) { + if (flexBasis[1] === PX$2) { b = max = min = flexBasis[0]; - } else if (flexBasis[1] === PERCENT$a) { + } else if (flexBasis[1] === PERCENT$2) { 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]; - } else if (flexBasis[1] === VW$9) { + } else if (flexBasis[1] === REM$7) { + b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (flexBasis[1] === VW$7) { b = max = min = flexBasis[0] * this.root.width * 0.01; - } else if (flexBasis[1] === VH$9) { + } else if (flexBasis[1] === VH$7) { b = max = min = flexBasis[0] * this.root.height * 0.01; } - } else if ([PX$9, PERCENT$a, REM$9, VW$9, VH$9].indexOf(main[1]) > -1) { - if (main[1] === PX$9) { + } else if ([PX$2, PERCENT$2, REM$7, VW$7, VH$7].indexOf(main[1]) > -1) { + if (main[1] === PX$2) { b = max = min = main[0]; - } else if (main[1] === PERCENT$a) { + } else if (main[1] === PERCENT$2) { 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]; - } else if (main[1] === VW$9) { + } else if (main[1] === REM$7) { + b = max = min = main[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (main[1] === VW$7) { b = max = min = main[0] * this.root.width * 0.01; - } else if (main[1] === VH$9) { + } else if (main[1] === VH$7) { b = max = min = main[0] * this.root.height * 0.01; } } // auto和content固定尺寸比例计算 else if (__loadImg.source || __loadImg.error) { - if (cross[1] !== AUTO$7) { - if (cross[1] === PX$9) { - cross = cross[0]; - } 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]; - } else if (cross[1] === VW$9) { - cross = cross[0] * this.root.width * 0.01; - } else if (cross[1] === VH$9) { - cross = cross[0] * this.root.height * 0.01; - } - - var ratio = __loadImg.width / __loadImg.height; - b = max = min = isDirectionRow ? cross * ratio : cross / ratio; - } else { - b = max = min = isDirectionRow ? __loadImg.width : __loadImg.height; - } - } // border也得计算在内 + if (cross[1] !== AUTO$1) { + if (cross[1] === PX$2) { + cross = cross[0]; + } else if (cross[1] === PERCENT$2) { + cross = cross[0] * 0.01 * (isDirectionRow ? h : w); + } else if (cross[1] === REM$7) { + cross = cross[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (cross[1] === VW$7) { + cross = cross[0] * this.root.width * 0.01; + } else if (cross[1] === VH$7) { + cross = cross[0] * this.root.height * 0.01; + } + + var ratio = __loadImg.width / __loadImg.height; + b = max = min = isDirectionRow ? cross * ratio : cross / ratio; + } else { + b = max = min = isDirectionRow ? __loadImg.width : __loadImg.height; + } + } // border也得计算在内 if (isDirectionRow) { @@ -25223,10 +25228,10 @@ var Img$1 = /*#__PURE__*/function (_Dom) { var res = {}; - res[UPDATE_NODE$4] = self; - res[UPDATE_FOCUS$3] = o$3.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行 + res[UPDATE_NODE$1] = self; + res[UPDATE_FOCUS$1] = o$1.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行 - res[UPDATE_CONFIG$4] = self.__config; + res[UPDATE_CONFIG$1] = self.__config; root.__addUpdate(self, self.__config, root, root.__config, res); } @@ -25241,11 +25246,11 @@ var Img$1 = /*#__PURE__*/function (_Dom) { if (data.url === loadImg.src && !self.isDestroyed) { var reload = function reload() { var _self$currentStyle = self.currentStyle, - width = _self$currentStyle[WIDTH$6], - height = _self$currentStyle[HEIGHT$6]; + width = _self$currentStyle[WIDTH$2], + height = _self$currentStyle[HEIGHT$2]; root.delRefreshTask(self.__task); - if (width[1] !== AUTO$7 && height[1] !== AUTO$7) { + if (width[1] !== AUTO$1 && height[1] !== AUTO$1) { root.addRefreshTask(self.__task = { __before: function __before() { self.__task = null; @@ -25256,14 +25261,14 @@ var Img$1 = /*#__PURE__*/function (_Dom) { var res = {}; - res[UPDATE_NODE$4] = self; - res[UPDATE_FOCUS$3] = o$3.REPAINT; - res[UPDATE_CONFIG$4] = self.__config; + res[UPDATE_NODE$1] = self; + res[UPDATE_FOCUS$1] = o$1.REPAINT; + res[UPDATE_CONFIG$1] = self.__config; root.__addUpdate(self, self.__config, root, root.__config, res); }, __after: function __after() { - if (isFunction$5(cb)) { + if (isFunction$3(cb)) { cb.call(self); } } @@ -25279,15 +25284,15 @@ var Img$1 = /*#__PURE__*/function (_Dom) { var res = {}; - res[UPDATE_NODE$4] = self; - res[UPDATE_FOCUS$3] = o$3.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行 + res[UPDATE_NODE$1] = self; + res[UPDATE_FOCUS$1] = o$1.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行 - res[UPDATE_CONFIG$4] = self.__config; + res[UPDATE_CONFIG$1] = self.__config; root.__addUpdate(self, self.__config, root, root.__config, res); }, __after: function __after() { - if (isFunction$5(cb)) { + if (isFunction$3(cb)) { cb.call(self); } } @@ -25323,7 +25328,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) { } // 可见状态进行刷新操作,visibility某些情况需要刷新,可能宽高未定义要重新布局 - if (computedStyle[DISPLAY$7] !== 'none') { + if (computedStyle[DISPLAY$3] !== 'none') { reload(); } } @@ -25342,7 +25347,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) { var root = this.root; // 相等或空且当前error直接返回 if (v === loadImg.src || !v && loadImg.error) { - if (isFunction$5(cb)) { + if (isFunction$3(cb)) { cb(-1); } } else if (v) { @@ -25363,14 +25368,14 @@ var Img$1 = /*#__PURE__*/function (_Dom) { } var res = {}; - res[UPDATE_NODE$4] = self; - res[UPDATE_FOCUS$3] = o$3.REFLOW; - res[UPDATE_CONFIG$4] = self.__config; + res[UPDATE_NODE$1] = self; + res[UPDATE_FOCUS$1] = o$1.REFLOW; + res[UPDATE_CONFIG$1] = self.__config; root.__addUpdate(self, self.__config, root, self.__config, res); }, __after: function __after(diff) { - if (isFunction$5(cb)) { + if (isFunction$3(cb)) { cb(diff); } } @@ -25390,9 +25395,9 @@ var Img$1 = /*#__PURE__*/function (_Dom) { }]); return Img; -}(Dom$1); +}(Dom); -_defineProperty(Img$1, "showError", true); +_defineProperty(Img, "showError", true); var Defs = /*#__PURE__*/function () { function Defs(uuid) { @@ -25464,53 +25469,53 @@ var Defs = /*#__PURE__*/function () { return Defs; }(); -var _enums$STYLE_KEY$h = enums.STYLE_KEY, - DISPLAY$8 = _enums$STYLE_KEY$h.DISPLAY, - MARGIN_TOP$3 = _enums$STYLE_KEY$h.MARGIN_TOP, - MARGIN_RIGHT$5 = _enums$STYLE_KEY$h.MARGIN_RIGHT, - MARGIN_BOTTOM$3 = _enums$STYLE_KEY$h.MARGIN_BOTTOM, - MARGIN_LEFT$5 = _enums$STYLE_KEY$h.MARGIN_LEFT, - PADDING_TOP$4 = _enums$STYLE_KEY$h.PADDING_TOP, - PADDING_RIGHT$5 = _enums$STYLE_KEY$h.PADDING_RIGHT, - PADDING_BOTTOM$4 = _enums$STYLE_KEY$h.PADDING_BOTTOM, - PADDING_LEFT$6 = _enums$STYLE_KEY$h.PADDING_LEFT, - WIDTH$7 = _enums$STYLE_KEY$h.WIDTH, - HEIGHT$7 = _enums$STYLE_KEY$h.HEIGHT, - BORDER_TOP_WIDTH$5 = _enums$STYLE_KEY$h.BORDER_TOP_WIDTH, - BORDER_RIGHT_WIDTH$6 = _enums$STYLE_KEY$h.BORDER_RIGHT_WIDTH, - BORDER_BOTTOM_WIDTH$5 = _enums$STYLE_KEY$h.BORDER_BOTTOM_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$5 = _enums$STYLE_KEY$h.VISIBILITY, - FONT_SIZE$b = _enums$STYLE_KEY$h.FONT_SIZE, - FLEX_BASIS$4 = _enums$STYLE_KEY$h.FLEX_BASIS, - _enums$NODE_KEY$7 = enums.NODE_KEY, - NODE_CACHE_PROPS = _enums$NODE_KEY$7.NODE_CACHE_PROPS, - NODE_CURRENT_PROPS = _enums$NODE_KEY$7.NODE_CURRENT_PROPS, - NODE_CURRENT_STYLE$3 = _enums$NODE_KEY$7.NODE_CURRENT_STYLE, - NODE_STYLE$3 = _enums$NODE_KEY$7.NODE_STYLE, - NODE_DEFS_CACHE$5 = _enums$NODE_KEY$7.NODE_DEFS_CACHE; -var PX$a = o.PX, - PERCENT$b = o.PERCENT, - REM$a = o.REM, - VW$a = o.VW, - VH$a = o.VH; -var int2rgba$3 = util.int2rgba, - isNil$7 = util.isNil, - joinArr$3 = util.joinArr; -var canvasPolygon$6 = painter.canvasPolygon, - svgPolygon$7 = painter.svgPolygon; -var REGISTER$1 = {}; +var _enums$STYLE_KEY$8 = enums.STYLE_KEY, + DISPLAY$2 = _enums$STYLE_KEY$8.DISPLAY, + MARGIN_TOP$1 = _enums$STYLE_KEY$8.MARGIN_TOP, + MARGIN_RIGHT = _enums$STYLE_KEY$8.MARGIN_RIGHT, + MARGIN_BOTTOM$1 = _enums$STYLE_KEY$8.MARGIN_BOTTOM, + MARGIN_LEFT$1 = _enums$STYLE_KEY$8.MARGIN_LEFT, + PADDING_TOP$1 = _enums$STYLE_KEY$8.PADDING_TOP, + PADDING_RIGHT = _enums$STYLE_KEY$8.PADDING_RIGHT, + PADDING_BOTTOM$1 = _enums$STYLE_KEY$8.PADDING_BOTTOM, + PADDING_LEFT$1 = _enums$STYLE_KEY$8.PADDING_LEFT, + WIDTH$1 = _enums$STYLE_KEY$8.WIDTH, + HEIGHT$1 = _enums$STYLE_KEY$8.HEIGHT, + BORDER_TOP_WIDTH$1 = _enums$STYLE_KEY$8.BORDER_TOP_WIDTH, + BORDER_RIGHT_WIDTH = _enums$STYLE_KEY$8.BORDER_RIGHT_WIDTH, + BORDER_BOTTOM_WIDTH$1 = _enums$STYLE_KEY$8.BORDER_BOTTOM_WIDTH, + BORDER_LEFT_WIDTH$1 = _enums$STYLE_KEY$8.BORDER_LEFT_WIDTH, + FILL$1 = _enums$STYLE_KEY$8.FILL, + STROKE = _enums$STYLE_KEY$8.STROKE, + STROKE_MITERLIMIT = _enums$STYLE_KEY$8.STROKE_MITERLIMIT, + STROKE_WIDTH$6 = _enums$STYLE_KEY$8.STROKE_WIDTH, + STROKE_LINECAP = _enums$STYLE_KEY$8.STROKE_LINECAP, + STROKE_LINEJOIN = _enums$STYLE_KEY$8.STROKE_LINEJOIN, + STROKE_DASHARRAY = _enums$STYLE_KEY$8.STROKE_DASHARRAY, + STROKE_DASHARRAY_STR = _enums$STYLE_KEY$8.STROKE_DASHARRAY_STR, + FILL_RULE = _enums$STYLE_KEY$8.FILL_RULE, + VISIBILITY$2 = _enums$STYLE_KEY$8.VISIBILITY, + FONT_SIZE$6 = _enums$STYLE_KEY$8.FONT_SIZE, + FLEX_BASIS = _enums$STYLE_KEY$8.FLEX_BASIS, + _enums$NODE_KEY$3 = enums.NODE_KEY, + NODE_CACHE_PROPS$1 = _enums$NODE_KEY$3.NODE_CACHE_PROPS, + NODE_CURRENT_PROPS$1 = _enums$NODE_KEY$3.NODE_CURRENT_PROPS, + NODE_CURRENT_STYLE$3 = _enums$NODE_KEY$3.NODE_CURRENT_STYLE, + NODE_STYLE$2 = _enums$NODE_KEY$3.NODE_STYLE, + NODE_DEFS_CACHE$1 = _enums$NODE_KEY$3.NODE_DEFS_CACHE; +var PX$1 = o$4.PX, + PERCENT$1 = o$4.PERCENT, + REM$6 = o$4.REM, + VW$6 = o$4.VW, + VH$6 = o$4.VH; +var int2rgba = util.int2rgba, + isNil$8 = util.isNil, + joinArr = util.joinArr; +var canvasPolygon$1 = painter.canvasPolygon, + svgPolygon = painter.svgPolygon; +var REGISTER = {}; -var Geom$1 = /*#__PURE__*/function (_Xom) { +var Geom = /*#__PURE__*/function (_Xom) { _inherits(Geom, _Xom); var _super = _createSuper(Geom); @@ -25526,10 +25531,10 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { _this.__currentStyle = util.extend({}, _this.__style); _this.__currentProps = util.clone(_this.props); var config = _this.__config; - config[NODE_CACHE_PROPS] = _this.__cacheProps = {}; - config[NODE_CURRENT_PROPS] = _this.__currentProps; + config[NODE_CACHE_PROPS$1] = _this.__cacheProps = {}; + config[NODE_CURRENT_PROPS$1] = _this.__currentProps; config[NODE_CURRENT_STYLE$3] = _this.__currentStyle; - config[NODE_STYLE$3] = _this.__style; + config[NODE_STYLE$2] = _this.__style; return _this; } @@ -25538,92 +25543,92 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { value: function __tryLayInline(w, total) { // 无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]; - - if (width[1] === PX$a) { + width = _this$currentStyle[WIDTH$1], + marginLeft = _this$currentStyle[MARGIN_LEFT$1], + marginRight = _this$currentStyle[MARGIN_RIGHT], + paddingLeft = _this$currentStyle[PADDING_LEFT$1], + paddingRight = _this$currentStyle[PADDING_RIGHT], + borderLeftWidth = _this$currentStyle[BORDER_LEFT_WIDTH$1], + borderRightWidth = _this$currentStyle[BORDER_RIGHT_WIDTH]; + + if (width[1] === PX$1) { w -= width[0]; - } else if (width[1] === PERCENT$b) { + } else if (width[1] === PERCENT$1) { w -= total * width[0] * 0.01; - } else if (width[1] === REM$a) { - w -= width[0] * this.root.computedStyle[FONT_SIZE$b]; - } else if (width[1] === VW$a) { + } else if (width[1] === REM$6) { + w -= width[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (width[1] === VW$6) { w -= width[0] * this.root.width * 0.01; - } else if (width[1] === VH$a) { + } else if (width[1] === VH$6) { w -= width[0] * this.root.height * 0.01; } // 减去水平mbp - if (marginLeft[1] === PX$a) { + if (marginLeft[1] === PX$1) { w -= marginLeft[0]; - } else if (marginLeft[1] === PERCENT$b) { + } else if (marginLeft[1] === PERCENT$1) { w -= marginLeft[0] * total * 0.01; - } else if (marginLeft[1] === REM$a) { - w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE$b]; - } else if (marginLeft[1] === VW$a) { + } else if (marginLeft[1] === REM$6) { + w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (marginLeft[1] === VW$6) { w -= marginLeft[0] * this.root.width * 0.01; - } else if (marginLeft[1] === VH$a) { + } else if (marginLeft[1] === VH$6) { w -= marginLeft[0] * this.root.height * 0.01; } - if (paddingLeft[1] === PX$a) { + if (paddingLeft[1] === PX$1) { w -= paddingLeft[0]; - } else if (paddingLeft[1] === PERCENT$b) { + } else if (paddingLeft[1] === PERCENT$1) { w -= paddingLeft[0] * total * 0.01; - } else if (paddingLeft[1] === REM$a) { - w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE$b]; - } else if (paddingLeft[1] === VW$a) { + } else if (paddingLeft[1] === REM$6) { + w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (paddingLeft[1] === VW$6) { w -= paddingLeft[0] * this.root.width * 0.01; - } else if (paddingLeft[1] === VH$a) { + } else if (paddingLeft[1] === VH$6) { w -= paddingLeft[0] * this.root.height * 0.01; } - if (borderLeftWidth[1] === PX$a) { + if (borderLeftWidth[1] === PX$1) { w -= borderLeftWidth[0]; - } else if (borderLeftWidth[1] === REM$a) { - w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$b]; - } else if (borderLeftWidth[1] === VW$a) { + } else if (borderLeftWidth[1] === REM$6) { + w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (borderLeftWidth[1] === VW$6) { w -= borderLeftWidth[0] * this.root.width * 0.01; - } else if (borderLeftWidth[1] === VH$a) { + } else if (borderLeftWidth[1] === VH$6) { w -= borderLeftWidth[0] * this.root.height * 0.01; } - if (marginRight[1] === PX$a) { + if (marginRight[1] === PX$1) { w -= marginRight[0]; - } else if (marginRight[1] === PERCENT$b) { + } else if (marginRight[1] === PERCENT$1) { w -= marginRight[0] * total * 0.01; - } else if (marginRight[1] === REM$a) { - w -= marginRight[0] * this.root.computedStyle[FONT_SIZE$b]; - } else if (marginRight[1] === VW$a) { + } else if (marginRight[1] === REM$6) { + w -= marginRight[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (marginRight[1] === VW$6) { w -= marginRight[0] * this.root.width * 0.01; - } else if (marginRight[1] === VH$a) { + } else if (marginRight[1] === VH$6) { w -= marginRight[0] * this.root.height * 0.01; } - if (paddingRight[1] === PX$a) { + if (paddingRight[1] === PX$1) { w -= paddingRight[0]; - } else if (paddingRight[1] === PERCENT$b) { + } else if (paddingRight[1] === PERCENT$1) { w -= paddingRight[0] * total * 0.01; - } else if (paddingRight[1] === REM$a) { - w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE$b]; - } else if (paddingRight[1] === VW$a) { + } else if (paddingRight[1] === REM$6) { + w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (paddingRight[1] === VW$6) { w -= paddingRight[0] * this.root.width * 0.01; - } else if (paddingRight[1] === VH$a) { + } else if (paddingRight[1] === VH$6) { w -= paddingRight[0] * this.root.height * 0.01; } - if (borderRightWidth[1] === PX$a) { + if (borderRightWidth[1] === PX$1) { w -= borderRightWidth[0]; - } else if (borderRightWidth[1] === REM$a) { - w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$b]; - } else if (borderRightWidth[1] === VW$a) { + } else if (borderRightWidth[1] === REM$6) { + w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (borderRightWidth[1] === VW$6) { w -= borderRightWidth[0] * this.root.width * 0.01; - } else if (borderRightWidth[1] === VH$a) { + } else if (borderRightWidth[1] === VH$6) { w -= borderRightWidth[0] * this.root.height * 0.01; } @@ -25637,18 +25642,18 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { var max = 0; var currentStyle = this.currentStyle; // 计算需考虑style的属性 - var width = currentStyle[WIDTH$7], - height = currentStyle[HEIGHT$7], - display = currentStyle[DISPLAY$8]; + var width = currentStyle[WIDTH$1], + height = currentStyle[HEIGHT$1], + display = currentStyle[DISPLAY$2]; var main = isDirectionRow ? width : height; // 只绝对值生效,%不生效,依旧要判断 - if (main[1] === PX$a) { + if (main[1] === PX$1) { min = max = main[0]; - } else if (main[1] === REM$a) { - min = max = main[0] * this.root.computedStyle[FONT_SIZE$b]; - } else if (main[1] === VW$a) { + } else if (main[1] === REM$6) { + min = max = main[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (main[1] === VW$6) { min = max = main[0] * this.root.width * 0.01; - } else if (main[1] === VH$a) { + } else if (main[1] === VH$6) { min = max = main[0] * this.root.height * 0.01; } @@ -25664,47 +25669,47 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { var w = data.w, h = data.h; // 计算需考虑style的属性 - var flexBasis = currentStyle[FLEX_BASIS$4], - width = currentStyle[WIDTH$7], - height = currentStyle[HEIGHT$7], - marginLeft = currentStyle[MARGIN_LEFT$5], - marginTop = currentStyle[MARGIN_TOP$3], - marginRight = currentStyle[MARGIN_RIGHT$5], - marginBottom = currentStyle[MARGIN_BOTTOM$3], - paddingLeft = currentStyle[PADDING_LEFT$6], - paddingTop = currentStyle[PADDING_TOP$4], - paddingRight = currentStyle[PADDING_RIGHT$5], - paddingBottom = currentStyle[PADDING_BOTTOM$4], - borderTopWidth = currentStyle[BORDER_TOP_WIDTH$5], - borderRightWidth = currentStyle[BORDER_RIGHT_WIDTH$6], - borderBottomWidth = currentStyle[BORDER_BOTTOM_WIDTH$5], - borderLeftWidth = currentStyle[BORDER_LEFT_WIDTH$7]; + var flexBasis = currentStyle[FLEX_BASIS], + width = currentStyle[WIDTH$1], + height = currentStyle[HEIGHT$1], + marginLeft = currentStyle[MARGIN_LEFT$1], + marginTop = currentStyle[MARGIN_TOP$1], + marginRight = currentStyle[MARGIN_RIGHT], + marginBottom = currentStyle[MARGIN_BOTTOM$1], + paddingLeft = currentStyle[PADDING_LEFT$1], + paddingTop = currentStyle[PADDING_TOP$1], + paddingRight = currentStyle[PADDING_RIGHT], + paddingBottom = currentStyle[PADDING_BOTTOM$1], + borderTopWidth = currentStyle[BORDER_TOP_WIDTH$1], + borderRightWidth = currentStyle[BORDER_RIGHT_WIDTH], + borderBottomWidth = currentStyle[BORDER_BOTTOM_WIDTH$1], + borderLeftWidth = currentStyle[BORDER_LEFT_WIDTH$1]; var main = isDirectionRow ? width : height; // basis3种情况:auto、固定、content,只区分固定和其它 - var isFixed = [PX$a, PERCENT$b, REM$a, VW$a, VH$a].indexOf(flexBasis[1]) > -1; + var isFixed = [PX$1, PERCENT$1, REM$6, VW$6, VH$6].indexOf(flexBasis[1]) > -1; if (isFixed) { - if (flexBasis[1] === PX$a) { + if (flexBasis[1] === PX$1) { b = max = min = flexBasis[0]; - } else if (flexBasis[1] === PERCENT$b) { + } else if (flexBasis[1] === PERCENT$1) { 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]; - } else if (flexBasis[1] === VW$a) { + } else if (flexBasis[1] === REM$6) { + b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (flexBasis[1] === VW$6) { b = max = min = flexBasis[0] * this.root.width * 0.01; - } else if (flexBasis[1] === VH$a) { + } else if (flexBasis[1] === VH$6) { b = max = min = flexBasis[0] * this.root.height * 0.01; } - } else if ([PX$a, PERCENT$b, REM$a, VW$a, VH$a].indexOf(main[1]) > -1) { - if (main[1] === PX$a) { + } else if ([PX$1, PERCENT$1, REM$6, VW$6, VH$6].indexOf(main[1]) > -1) { + if (main[1] === PX$1) { b = max = min = main[0]; - } else if (main[1] === PERCENT$b) { + } else if (main[1] === PERCENT$1) { 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]; - } else if (main[1] === VW$a) { + } else if (main[1] === REM$6) { + b = max = min = main[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (main[1] === VW$6) { b = max = min = main[0] * this.root.width * 0.01; - } else if (main[1] === VH$a) { + } else if (main[1] === VH$6) { b = max = min = main[0] * this.root.height * 0.01; } } // border也得计算在内 @@ -25750,7 +25755,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { this.__marginAuto(this.currentStyle, data); - this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {}; + this.__config[NODE_CACHE_PROPS$1] = this.__cacheProps = {}; } }, { key: "__layoutFlex", @@ -25775,7 +25780,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { this.__ioSize(tw, th); - this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {}; + this.__config[NODE_CACHE_PROPS$1] = this.__cacheProps = {}; } }, { key: "__calCache", @@ -25784,20 +25789,20 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { var res = _get(_getPrototypeOf(Geom.prototype), "__calCache", this).call(this, renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle, clientWidth, clientHeight, offsetWidth, offsetHeight, borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth, paddingTop, paddingRight, paddingBottom, paddingLeft, x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6); - if (isNil$7(__cacheStyle[STROKE_WIDTH$1])) { - __cacheStyle[STROKE_WIDTH$1] = true; - var strokeWidth = currentStyle[STROKE_WIDTH$1] || []; + if (isNil$8(__cacheStyle[STROKE_WIDTH$6])) { + __cacheStyle[STROKE_WIDTH$6] = true; + var strokeWidth = currentStyle[STROKE_WIDTH$6] || []; var w = this.width; - computedStyle[STROKE_WIDTH$1] = strokeWidth.map(function (item) { - if (item[1] === PX$a) { + computedStyle[STROKE_WIDTH$6] = strokeWidth.map(function (item) { + if (item[1] === PX$1) { return item[0]; - } else if (item[1] === PERCENT$b) { + } else if (item[1] === PERCENT$1) { return item[0] * w * 0.01; - } else if (item[1] === REM$a) { - return item[0] * _this2.root.computedStyle[FONT_SIZE$b]; - } else if (item[1] === VW$a) { + } else if (item[1] === REM$6) { + return item[0] * _this2.root.computedStyle[FONT_SIZE$6]; + } else if (item[1] === VW$6) { return item[0] * _this2.root.width * 0.01; - } else if (item[1] === VH$a) { + } else if (item[1] === VH$6) { return item[0] * _this2.root.height * 0.01; } else { return 0; @@ -25805,11 +25810,11 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { }); } - if (isNil$7(__cacheStyle[STROKE_DASHARRAY$1])) { - __cacheStyle[STROKE_DASHARRAY$1] = true; - computedStyle[STROKE_DASHARRAY$1] = currentStyle[STROKE_DASHARRAY$1] || []; - __cacheStyle[STROKE_DASHARRAY_STR] = computedStyle[STROKE_DASHARRAY$1].map(function (item) { - return joinArr$3(item, ','); + if (isNil$8(__cacheStyle[STROKE_DASHARRAY])) { + __cacheStyle[STROKE_DASHARRAY] = true; + computedStyle[STROKE_DASHARRAY] = currentStyle[STROKE_DASHARRAY] || []; + __cacheStyle[STROKE_DASHARRAY_STR] = computedStyle[STROKE_DASHARRAY].map(function (item) { + return joinArr(item, ','); }); } // 直接赋值的 @@ -25818,8 +25823,8 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { computedStyle[k] = currentStyle[k]; }); // stroke/fll移至render里处理,因为cache涉及渐变坐标偏移 - [STROKE$1, FILL$1].forEach(function (k) { - if (isNil$7(__cacheStyle[k])) { + [STROKE, FILL$1].forEach(function (k) { + if (isNil$8(__cacheStyle[k])) { var v = currentStyle[k]; computedStyle[k] = v; var _res = []; @@ -25829,7 +25834,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { if (item && (item.k === 'linear' || item.k === 'radial' || item.k === 'conic')) { _res.push(_this2.__gradient(renderMode, ctx, x3, y3, x4, y4, item)); } else if (item[3] > 0) { - _res.push(int2rgba$3(item)); + _res.push(int2rgba(item)); } else { _res.push('none'); } @@ -25845,7 +25850,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { key: "__calContent", value: function __calContent(renderMode, lv, currentStyle, computedStyle) { // Geom强制有内容 - return computedStyle[VISIBILITY$5] !== 'hidden'; + return computedStyle[VISIBILITY$2] !== 'hidden'; } }, { key: "__preSet", @@ -25857,13 +25862,13 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { var cx = res.sx3 + width * 0.5; var cy = res.sy3 + height * 0.5; var fill = __cacheStyle[FILL$1], - stroke = __cacheStyle[STROKE$1], + stroke = __cacheStyle[STROKE], strokeDasharrayStr = __cacheStyle[STROKE_DASHARRAY_STR]; - var strokeWidth = computedStyle[STROKE_WIDTH$1], + var strokeWidth = computedStyle[STROKE_WIDTH$6], strokeLinecap = computedStyle[STROKE_LINECAP], strokeLinejoin = computedStyle[STROKE_LINEJOIN], strokeMiterlimit = computedStyle[STROKE_MITERLIMIT], - strokeDasharray = computedStyle[STROKE_DASHARRAY$1], + strokeDasharray = computedStyle[STROKE_DASHARRAY], fillRule = computedStyle[FILL_RULE]; return { cx: cx, @@ -25993,43 +25998,43 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { this.__renderOnePolygon(renderMode, ctx, isMulti, list, o); } // 多个需要fill在下面,stroke在上面,依次循环 else { - for (var i = 0, len = fills.length; i < len; i++) { - var fill = fills[i]; - - if (fill) { - var _o = { - fill: fill, - fillRule: fillRules[i], - dx: dx, - dy: dy, - bbox: bbox - }; + for (var i = 0, len = fills.length; i < len; i++) { + var fill = fills[i]; + + if (fill) { + var _o = { + fill: fill, + fillRule: fillRules[i], + dx: dx, + dy: dy, + bbox: bbox + }; - this.__renderOnePolygon(renderMode, ctx, isMulti, list, _o); - } + this.__renderOnePolygon(renderMode, ctx, isMulti, list, _o); } + } - for (var _i = 0, _len = strokes.length; _i < _len; _i++) { - var stroke = strokes[_i]; - - if (stroke) { - var _o2 = { - stroke: stroke, - strokeWidth: strokeWidths[_i], - strokeDasharray: strokeDasharrays[_i], - strokeDasharrayStr: strokeDasharrayStrs[_i], - strokeLinecap: strokeLinecaps[_i], - strokeLinejoin: strokeLinejoins[_i], - strokeMiterlimit: strokeMiterlimits[_i], - dx: dx, - dy: dy, - bbox: bbox - }; + for (var _i = 0, _len = strokes.length; _i < _len; _i++) { + var stroke = strokes[_i]; - this.__renderOnePolygon(renderMode, ctx, isMulti, list, _o2); - } + if (stroke) { + var _o2 = { + stroke: stroke, + strokeWidth: strokeWidths[_i], + strokeDasharray: strokeDasharrays[_i], + strokeDasharrayStr: strokeDasharrayStrs[_i], + strokeLinecap: strokeLinecaps[_i], + strokeLinejoin: strokeLinejoins[_i], + strokeMiterlimit: strokeMiterlimits[_i], + dx: dx, + dy: dy, + bbox: bbox + }; + + this.__renderOnePolygon(renderMode, ctx, isMulti, list, _o2); } } + } } }, { key: "__renderOnePolygon", @@ -26096,10 +26101,10 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { if (isMulti) { list.forEach(function (item) { - return canvasPolygon$6(ctx, item, dx, dy); + return canvasPolygon$1(ctx, item, dx, dy); }); } else { - canvasPolygon$6(ctx, list, dx, dy); + canvasPolygon$1(ctx, list, dx, dy); } if (isFill && fill && fill !== 'none') { @@ -26116,10 +26121,10 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { if (isMulti) { list.forEach(function (item) { - return d += svgPolygon$7(item); + return d += svgPolygon(item); }); } else { - d = svgPolygon$7(list); + d = svgPolygon(list); } var props = [['d', d]]; // 2个都没有常出现在多fill/stroke时,也有可能特殊单个故意这样写的 @@ -26235,7 +26240,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { return painter.canvasPolygon(ctx, item, dx, dy); }); } else { - canvasPolygon$6(ctx, list, dx, dy); + canvasPolygon$1(ctx, list, dx, dy); } ctx[method](); @@ -26249,10 +26254,10 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { if (isMulti) { list.forEach(function (item) { - return d += svgPolygon$7(item); + return d += svgPolygon(item); }); } else { - d = svgPolygon$7(list); + d = svgPolygon(list); } var props = [['d', d]]; @@ -26268,7 +26273,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit); } - props.push(['transform', "matrix(".concat(joinArr$3(mx.m2m6(matrix), ','), ")")]); + props.push(['transform', "matrix(".concat(joinArr(mx.m2m6(matrix), ','), ")")]); this.addGeom('path', props); } } @@ -26296,14 +26301,14 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { h = y2 - y1; var offscreen = inject.getCacheCanvas(w, h, '__$$CONIC_GRADIENT$$__'); var imgData = offscreen.ctx.getImageData(0, 0, w, h); - gradient.getConicGradientImage(w * 0.5, h * 0.5, w, h, fill.v.stop, imgData.data); + gradient$1.getConicGradientImage(w * 0.5, h * 0.5, w, h, fill.v.stop, imgData.data); offscreen.ctx.putImageData(imgData, 0, 0); if (isMulti) { list.forEach(function (item) { ctx.save(); ctx.beginPath(); - canvasPolygon$6(ctx, item, dx, dy); + canvasPolygon$1(ctx, item, dx, dy); ctx.clip(); ctx.closePath(); ctx.drawImage(offscreen.canvas, x1 + dx, y1 + dy); @@ -26312,7 +26317,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { } else { ctx.save(); ctx.beginPath(); - canvasPolygon$6(ctx, list, dx, dy); + canvasPolygon$1(ctx, list, dx, dy); ctx.clip(); ctx.closePath(); ctx.drawImage(offscreen.canvas, x1 + dx, y1 + dy); @@ -26327,18 +26332,18 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { tagName: 'clipPath', children: [{ tagName: 'path', - props: [['d', svgPolygon$7(item)]] + props: [['d', svgPolygon(item)]] }] }; var clip = ctx.add(v); - _this3.__config[NODE_DEFS_CACHE$5].push(v); + _this3.__config[NODE_DEFS_CACHE$1].push(v); color.forEach(function (item) { _this3.virtualDom.bb.push({ type: 'item', tagName: 'path', - props: [['d', svgPolygon$7(item[0])], ['fill', item[1]], ['clip-path', 'url(#' + clip + ')']] + props: [['d', svgPolygon(item[0])], ['fill', item[1]], ['clip-path', 'url(#' + clip + ')']] }); }); }); @@ -26347,18 +26352,18 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { tagName: 'clipPath', children: [{ tagName: 'path', - props: [['d', svgPolygon$7(list)]] + props: [['d', svgPolygon(list)]] }] }; var clip = ctx.add(v); - this.__config[NODE_DEFS_CACHE$5].push(v); + this.__config[NODE_DEFS_CACHE$1].push(v); color.forEach(function (item) { _this3.virtualDom.bb.push({ type: 'item', tagName: 'path', - props: [['d', svgPolygon$7(item[0])], ['fill', item[1]], ['clip-path', 'url(#' + clip + ')']] + props: [['d', svgPolygon(item[0])], ['fill', item[1]], ['clip-path', 'url(#' + clip + ')']] }); }); } @@ -26393,28 +26398,28 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { value: function __offsetX(diff, isLayout, lv) { _get(_getPrototypeOf(Geom.prototype), "__offsetX", this).call(this, diff, isLayout, lv); - this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {}; + this.__config[NODE_CACHE_PROPS$1] = this.__cacheProps = {}; } }, { key: "__offsetY", value: function __offsetY(diff, isLayout, lv) { _get(_getPrototypeOf(Geom.prototype), "__offsetY", this).call(this, diff, isLayout, lv); - this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {}; + this.__config[NODE_CACHE_PROPS$1] = this.__cacheProps = {}; } }, { key: "__resizeX", value: function __resizeX(diff, lv) { _get(_getPrototypeOf(Geom.prototype), "__resizeX", this).call(this, diff, lv); - this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {}; + this.__config[NODE_CACHE_PROPS$1] = this.__cacheProps = {}; } }, { key: "__resizeY", value: function __resizeY(diff, lv) { _get(_getPrototypeOf(Geom.prototype), "__resizeY", this).call(this, diff, lv); - this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {}; + this.__config[NODE_CACHE_PROPS$1] = this.__cacheProps = {}; } }, { key: "addGeom", @@ -26431,7 +26436,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { value: function getProps(k) { var v = this.currentProps[k]; - if (!isNil$7(v)) { + if (!isNil$8(v)) { return v; } @@ -26455,7 +26460,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { }], [{ key: "REGISTER", get: function get() { - return REGISTER$1; + return REGISTER; } }, { key: "getRegister", @@ -26464,11 +26469,11 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { throw new Error('Invalid param'); } - if (!REGISTER$1.hasOwnProperty(name)) { + if (!REGISTER.hasOwnProperty(name)) { throw new Error("Geom has not register: ".concat(name)); } - return REGISTER$1[name]; + return REGISTER[name]; } }, { key: "register", @@ -26481,36 +26486,36 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { throw new Error("Geom has already register: ".concat(name)); } - REGISTER$1[name] = obj; + REGISTER[name] = obj; } }, { key: "hasRegister", value: function hasRegister(name) { - return name && REGISTER$1.hasOwnProperty(name); + return name && REGISTER.hasOwnProperty(name); } }, { key: "delRegister", value: function delRegister(name) { if (Geom.hasRegister(name)) { - delete REGISTER$1[name]; + delete REGISTER[name]; } } }]); return Geom; -}(Xom$1); - -var _enums$NODE_KEY$8 = enums.NODE_KEY, - NODE_STYLE$4 = _enums$NODE_KEY$8.NODE_STYLE, - NODE_CURRENT_STYLE$4 = _enums$NODE_KEY$8.NODE_CURRENT_STYLE, - NODE_COMPUTED_STYLE$3 = _enums$NODE_KEY$8.NODE_COMPUTED_STYLE, - NODE_DOM_PARENT$4 = _enums$NODE_KEY$8.NODE_DOM_PARENT, - NODE_MATRIX$2 = _enums$NODE_KEY$8.NODE_MATRIX, - NODE_MATRIX_EVENT$3 = _enums$NODE_KEY$8.NODE_MATRIX_EVENT, - NODE_STRUCT$3 = _enums$NODE_KEY$8.NODE_STRUCT; -var TYPE_VD$3 = $$type.TYPE_VD, - TYPE_GM$3 = $$type.TYPE_GM, - TYPE_CP$3 = $$type.TYPE_CP; +}(Xom); + +var _enums$NODE_KEY$2 = enums.NODE_KEY, + NODE_STYLE$1 = _enums$NODE_KEY$2.NODE_STYLE, + NODE_CURRENT_STYLE$2 = _enums$NODE_KEY$2.NODE_CURRENT_STYLE, + NODE_COMPUTED_STYLE$2 = _enums$NODE_KEY$2.NODE_COMPUTED_STYLE, + NODE_DOM_PARENT$2 = _enums$NODE_KEY$2.NODE_DOM_PARENT, + NODE_MATRIX$1 = _enums$NODE_KEY$2.NODE_MATRIX, + NODE_MATRIX_EVENT$1 = _enums$NODE_KEY$2.NODE_MATRIX_EVENT, + NODE_STRUCT$1 = _enums$NODE_KEY$2.NODE_STRUCT; +var TYPE_VD$1 = $$type.TYPE_VD, + TYPE_GM$1 = $$type.TYPE_GM, + TYPE_CP$1 = $$type.TYPE_CP; var updateList = []; var removeList = []; var KEY_FLAG = {}; @@ -26519,21 +26524,21 @@ var KEY_FLAG = {}; */ function check(vd) { - if (vd instanceof Dom$1) { + if (vd instanceof Dom) { vd.children.forEach(function (child) { - if (child instanceof Dom$1) { + if (child instanceof Dom) { check(child); } // 当组件有setState更新时,从叶子到根链路会标识__hasUpdate,以便节约遍历成本忽略那些没变化的链路 - else if (child instanceof Component$1 && child.__hasUpdate) { - child.__hasUpdate = false; - checkCp(child, child.props); - } + else if (child instanceof Component && child.__hasUpdate) { + child.__hasUpdate = false; + checkCp(child, child.props); + } }); } // 高阶组件会进入此分支,被父组件调用 - else if (vd instanceof Component$1 && vd.__hasUpdate) { - vd.__hasUpdate = false; - checkCp(vd, vd.props); - } + else if (vd instanceof Component && vd.__hasUpdate) { + vd.__hasUpdate = false; + checkCp(vd, vd.props); + } } /** * 检查cp是否有state变更,注意递归检查时需要看shadow不能看shadowRoot, @@ -26559,10 +26564,10 @@ function checkCp(cp, nextProps, forceCheckUpdate) { updateCp(cp, nextProps, cp.__nextState || cp.state); } // 不更新则递归检查子tree的cp else { - cp.props = nextProps; - cp.state = cp.__nextState || cp.state; - check(cp.shadow); - } + cp.props = nextProps; + cp.state = cp.__nextState || cp.state; + check(cp.shadow); + } } else { check(cp.shadow); } @@ -26592,14 +26597,14 @@ function updateCp(cp, props, state) { var sr = cp.shadowRoot; - if (sr instanceof Xom$1) { + if (sr instanceof Xom) { ['__outerWidth', '__outerHeight', '__sx', '__sy', '__sx2', '__sx3', '__sx4', '__sx5', '__sx6', '__sy2', '__sy3', '__sy4', '__sy5', '__sy6'].forEach(function (k) { sr[k] = oldSr[k]; }); - sr.__computedStyle = sr.__config[NODE_COMPUTED_STYLE$3] = oldSr.computedStyle; + sr.__computedStyle = sr.__config[NODE_COMPUTED_STYLE$2] = oldSr.computedStyle; } else { var domParent = cp.domParent; - [NODE_STYLE$4, NODE_CURRENT_STYLE$4, NODE_COMPUTED_STYLE$3, NODE_MATRIX$2, NODE_MATRIX_EVENT$3].forEach(function (k) { + [NODE_STYLE$1, NODE_CURRENT_STYLE$2, NODE_COMPUTED_STYLE$2, NODE_MATRIX$1, NODE_MATRIX_EVENT$1].forEach(function (k) { sr.__config[k] = domParent.__config[k]; }); } @@ -26608,8 +26613,8 @@ function updateCp(cp, props, state) { '__sy1', '__layoutData', '__parent', '__domParent'].forEach(function (k) { sr[k] = oldSr[k]; }); - sr.__config[NODE_DOM_PARENT$4] = oldSr.domParent; - sr.__config[NODE_STRUCT$3] = oldSr.__config[NODE_STRUCT$3]; + sr.__config[NODE_DOM_PARENT$2] = oldSr.domParent; + sr.__config[NODE_STRUCT$1] = oldSr.__config[NODE_STRUCT$1]; updateList.push(cp); // 老的需回收,diff会生成新的dom,唯一列外是cp直接返回一个没变化的cp if (!util.isObject(json) || !json.__placeholder) { @@ -26679,7 +26684,7 @@ function diffSr(vd, oj, nj) { var nj = n.json; var vd = o.vd; // 相同class的组件进行对比替换 - if (oj.$$type === TYPE_CP$3 && nj.$$type === TYPE_CP$3) { + if (oj.$$type === TYPE_CP$1 && nj.$$type === TYPE_CP$1) { if (oj.klass === nj.klass) { // 对比props和children看是否全等,是则直接替换新json类型为占位符,引用老vd,否则强制更新 diffCp(oj, nj, vd); // 标识对比过了 @@ -26690,28 +26695,28 @@ function diffSr(vd, oj, nj) { } } // 相同类型的vd进行对比继承动画 else if (oj.$$type === nj.$$type && oj.tagName === nj.tagName) { - // 需判断矢量标签mutil是否相等 - if (nj.$$type !== TYPE_GM$3 || oj.props.multi === nj.props.multi) { - nj.__inheritAnimate = vd; - } + // 需判断矢量标签mutil是否相等 + if (nj.$$type !== TYPE_GM$1 || oj.props.multi === nj.props.multi) { + nj.__inheritAnimate = vd; + } - oj.key = nj.key = KEY_FLAG; // key相同的dom暂存下来 + oj.key = nj.key = KEY_FLAG; // key相同的dom暂存下来 - if (nj.$$type === TYPE_VD$3) { - keyList.push({ - vd: vd, - oj: oj, - nj: nj - }); - } + if (nj.$$type === TYPE_VD$1) { + keyList.push({ + vd: vd, + oj: oj, + nj: nj + }); } + } }); // key相同的dom对比children,下面非key逻辑就不做了 keyList.forEach(function (item) { diffChildren(item.vd, item.oj, item.nj); }); // 整体tree进行对比 - diffChild(vd, oj, nj); // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的 + diffChild$1(vd, oj, nj); // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的 cpList.forEach(function (vd) { removeCpFromOldTree(vd); @@ -26725,9 +26730,9 @@ function diffSr(vd, oj, nj) { */ -function diffChild(vd, oj, nj) { +function diffChild$1(vd, oj, nj) { if (util.isObject(nj)) { - if (nj.$$type === TYPE_CP$3) { + if (nj.$$type === TYPE_CP$1) { // key对比过了忽略 if (nj.key === KEY_FLAG) { return; @@ -26739,19 +26744,19 @@ function diffChild(vd, oj, nj) { removeCpFromOldTree(vd); } - } else if (nj.$$type === TYPE_GM$3 && oj && oj.$$type === TYPE_GM$3) { + } else if (nj.$$type === TYPE_GM$1 && oj && oj.$$type === TYPE_GM$1) { // $geom的multi必须一致 if (oj.tagName === nj.tagName && oj.props.multi === nj.props.multi) { nj.__inheritAnimate = vd; } } // dom类型递归children - else if (nj.$$type === TYPE_VD$3 && oj && oj.$$type === TYPE_VD$3) { - if (oj.tagName === nj.tagName) { - nj.__inheritAnimate = vd; - } - - diffChildren(vd, oj, nj); + else if (nj.$$type === TYPE_VD$1 && oj && oj.$$type === TYPE_VD$1) { + if (oj.tagName === nj.tagName) { + nj.__inheritAnimate = vd; } + + diffChildren(vd, oj, nj); + } } } /** @@ -26775,18 +26780,18 @@ function diffChildren(vd, oj, nj) { if (o.key === KEY_FLAG && n.key === KEY_FLAG) ; // 其中一个是key对比过了调整索引和长度 else if (o.key === KEY_FLAG) { - of++; - i--; - ol--; - len = Math.min(ol, nl); - } else if (n.key === KEY_FLAG) { - nf++; - i--; - nl--; - len = Math.min(ol, nl); - } else { - diffChild(children[i + of], o, n); - } + of++; + i--; + ol--; + len = Math.min(ol, nl); + } else if (n.key === KEY_FLAG) { + nf++; + i--; + nl--; + len = Math.min(ol, nl); + } else { + diffChild$1(children[i + of], o, n); + } } // 长度不同增减的无需关注,新json创建cp有didMount,老vd会调用cp的destroy } @@ -26878,9 +26883,9 @@ function getKeyHash(json, hash, vd) { return getKeyHash(item, hash, vd && vd[i]); }); } else if (util.isObject(json)) { - if (json.$$type === TYPE_VD$3 || json.$$type === TYPE_GM$3 || json.$$type === TYPE_CP$3) { + if (json.$$type === TYPE_VD$1 || json.$$type === TYPE_GM$1 || json.$$type === TYPE_CP$1) { // 深度优先 - if (json.$$type === TYPE_VD$3) { + if (json.$$type === TYPE_VD$1) { getKeyHash(json.children, hash, vd && vd.children); } @@ -26949,14 +26954,14 @@ var updater = { did: did }; -var joinVd$1 = util.joinVd, - joinDef$1 = util.joinDef; -var contain$1 = o$3.contain, - NONE$1 = o$3.NONE, - TRANSFORM_ALL = o$3.TRANSFORM_ALL, - OPACITY$4 = o$3.OPACITY, - FILTER$4 = o$3.FILTER, - MIX_BLEND_MODE$2 = o$3.MIX_BLEND_MODE; +var joinVd = util.joinVd, + joinDef = util.joinDef; +var contain$2 = o$1.contain, + NONE$2 = o$1.NONE, + TRANSFORM_ALL$1 = o$1.TRANSFORM_ALL, + OPACITY$1 = o$1.OPACITY, + FILTER$2 = o$1.FILTER, + MIX_BLEND_MODE$1 = o$1.MIX_BLEND_MODE; function diff(elem, ovd, nvd) { var cns = elem.childNodes; @@ -26985,14 +26990,14 @@ function diffDefs(elem, od, nd) { } } else if (i < nl) { for (; i < nl; i++) { - insertAt(elem, cns, i, joinDef$1(nd[i])); + insertAt(elem, cns, i, joinDef(nd[i])); } } } function diffDef(elem, od, nd) { if (od.tagName !== nd.tagName) { - insertAdjacentHTML(elem, 'beforebegin', joinDef$1(nd)); // elem.insertAdjacentHTML('beforebegin', joinDef(nd)); + insertAdjacentHTML(elem, 'beforebegin', joinDef(nd)); // elem.insertAdjacentHTML('beforebegin', joinDef(nd)); elem.parentNode.removeChild(elem); } else { @@ -27050,13 +27055,13 @@ function diffDef(elem, od, nd) { } } else if (i < nl) { for (; i < nl; i++) { - insertAt(elem, cns, i, joinVd$1(nd.children[i])); + insertAt(elem, cns, i, joinVd(nd.children[i])); } } } } -function diffChild$1(elem, ovd, nvd) { +function diffChild(elem, ovd, nvd) { if (ovd.type === 'dom') { if (nvd.type === 'dom') { diffD2D(elem, ovd, nvd); @@ -27174,11 +27179,11 @@ function diffByLessLv(elem, ovd, nvd, lv) { elem.removeAttribute('mask'); } - if (lv === NONE$1) { + if (lv === NONE$2) { return; } - if (contain$1(lv, TRANSFORM_ALL)) { + if (contain$2(lv, TRANSFORM_ALL$1)) { if (transform) { elem.setAttribute('transform', transform); } else { @@ -27186,7 +27191,7 @@ function diffByLessLv(elem, ovd, nvd, lv) { } } - if (contain$1(lv, OPACITY$4)) { + if (contain$2(lv, OPACITY$1)) { if (opacity !== 1 && opacity !== undefined) { elem.setAttribute('opacity', opacity); } else { @@ -27194,7 +27199,7 @@ function diffByLessLv(elem, ovd, nvd, lv) { } } - if (contain$1(lv, FILTER$4) || contain$1(lv, MIX_BLEND_MODE$2)) { + if (contain$2(lv, FILTER$2) || contain$2(lv, MIX_BLEND_MODE$1)) { var s = (filter ? "filter:".concat(filter, ";") : '') + (mixBlendMode ? "mix-blend-mode:".concat(mixBlendMode, ";") : ''); if (s) { @@ -27230,7 +27235,7 @@ function diffD2D(elem, ovd, nvd, root) { var cns = lastChild.childNodes; for (; i < Math.min(ol, nl); i++) { - diffChild$1(cns[i], ovd.children[i], nvd.children[i]); + diffChild(cns[i], ovd.children[i], nvd.children[i]); } if (i < ol) { @@ -27239,7 +27244,7 @@ function diffD2D(elem, ovd, nvd, root) { } } else if (i < nl) { for (; i < nl; i++) { - insertAt(lastChild, cns, i, joinVd$1(nvd.children[i])); + insertAt(lastChild, cns, i, joinVd(nvd.children[i])); } } } @@ -27263,7 +27268,7 @@ function diffD2G(elem, ovd, nvd) { } } else if (i < nl) { for (; i < nl; i++) { - insertAt(lastChild, cns, i, joinVd$1(nvd.children[i])); + insertAt(lastChild, cns, i, joinVd(nvd.children[i])); } } } @@ -27289,7 +27294,7 @@ function diffT2T(elem, ovd, nvd) { } } else if (i < nl) { for (; i < nl; i++) { - insertAt(elem, cns, i, joinVd$1(nvd.children[i])); + insertAt(elem, cns, i, joinVd(nvd.children[i])); } } } @@ -27326,7 +27331,7 @@ function diffG2G(elem, ovd, nvd) { } } else if (i < nl) { for (; i < nl; i++) { - insertAt(lastChild, cns, i, joinVd$1(nvd.children[i])); + insertAt(lastChild, cns, i, joinVd(nvd.children[i])); } } } @@ -27349,7 +27354,7 @@ function diffBb(elem, obb, nbb) { } } else if (i < nl) { for (; i < nl; i++) { - insertAt(elem, cns, i, joinVd$1(nbb[i])); + insertAt(elem, cns, i, joinVd(nbb[i])); } } } @@ -27416,10 +27421,10 @@ function replaceWith(elem, vd) { if (Array.isArray(vd)) { res = ''; vd.forEach(function (item) { - res += joinVd$1(item); + res += joinVd(item); }); } else { - res = joinVd$1(vd); + res = joinVd(vd); } insertAdjacentHTML(elem, 'beforebegin', res); // elem.insertAdjacentHTML('beforebegin', res); @@ -27461,7 +27466,7 @@ function insertAdjacentHTML(elem, where, content) { } } -var isFunction$6 = util.isFunction; +var isFunction$2 = util.isFunction; var Controller = /*#__PURE__*/function () { function Controller() { @@ -27586,7 +27591,7 @@ var Controller = /*#__PURE__*/function () { if (once) { once = false; - if (isFunction$6(cb)) { + if (isFunction$2(cb)) { cb(diff); } } @@ -27606,7 +27611,7 @@ var Controller = /*#__PURE__*/function () { if (once) { once = false; - if (isFunction$6(cb)) { + if (isFunction$2(cb)) { cb(diff); } } @@ -27635,7 +27640,7 @@ var Controller = /*#__PURE__*/function () { if (once) { once = false; - if (isFunction$6(cb)) { + if (isFunction$2(cb)) { cb(diff); } } @@ -27653,7 +27658,7 @@ var Controller = /*#__PURE__*/function () { if (once) { once = false; - if (isFunction$6(cb)) { + if (isFunction$2(cb)) { cb(diff); } } @@ -27671,7 +27676,7 @@ var Controller = /*#__PURE__*/function () { if (once) { once = false; - if (isFunction$6(cb)) { + if (isFunction$2(cb)) { cb(diff); } } @@ -27689,7 +27694,7 @@ var Controller = /*#__PURE__*/function () { if (once) { once = false; - if (isFunction$6(cb)) { + if (isFunction$2(cb)) { cb(diff); } } @@ -27698,7 +27703,7 @@ var Controller = /*#__PURE__*/function () { }, { key: "on", value: function on(id, handle) { - if (!isFunction$6(handle)) { + if (!isFunction$2(handle)) { return; } @@ -27818,7 +27823,7 @@ var Controller = /*#__PURE__*/function () { return Controller; }(); -var MockPage = function MockPage(texture, width, height) { +var MockPage = /*#__PURE__*/_createClass(function MockPage(texture, width, height) { _classCallCheck(this, MockPage); this.uuid = Page.genUuid(); @@ -27826,7 +27831,7 @@ var MockPage = function MockPage(texture, width, height) { this.texture = texture; this.width = width; this.height = height; -}; +}); /** * 一个fbo离屏纹理,mock成cache,当webgl需要局部根节点汇总时生成,即cacheTotal, @@ -27905,57 +27910,57 @@ var fragmentColor = "#version 100\n#ifdef GL_ES\nprecision mediump float;\n#defi var fragmentLuminosity = "#version 100\n#ifdef GL_ES\nprecision mediump float;\n#define GLSLIFY 1\n#endif\nvarying vec2 v_texCoords;uniform sampler2D u_texture1;uniform sampler2D u_texture2;float getLuminosity(vec3 color){return 0.3*color[0]+0.59*color[1]+0.11*color[2];}float clipLowest(float channel,float lowestChannel,float luminosity){return luminosity+((channel-luminosity)*luminosity)/(luminosity-lowestChannel);}float clipHighest(float channel,float highestChannel,float luminosity){return luminosity+((channel-luminosity)*(1.0-luminosity))/(highestChannel-luminosity);}vec3 clipColor(vec3 rgb){float luminosity=getLuminosity(rgb);float lowestChannel=min(rgb[0],min(rgb[1],rgb[2]));float highestChannel=max(rgb[0],max(rgb[1],rgb[2]));float r=rgb[0],g=rgb[1],b=rgb[2];if(lowestChannel<0.0){r=clipLowest(r,lowestChannel,luminosity);g=clipLowest(g,lowestChannel,luminosity);b=clipLowest(b,lowestChannel,luminosity);}if(highestChannel>1.0){r=clipHighest(r,highestChannel,luminosity);g=clipHighest(g,highestChannel,luminosity);b=clipHighest(b,highestChannel,luminosity);}return vec3(r,g,b);}vec3 setLuminosity(vec3 rgb,float luminosity){float delta=luminosity-getLuminosity(rgb);float r=rgb[0],g=rgb[1],b=rgb[2];return clipColor(vec3(r+delta,g+delta,b+delta));}float getSaturation(vec3 rgb){return max(rgb[0],max(rgb[1],rgb[2]))-min(rgb[0],min(rgb[1],rgb[2]));}vec3 setSaturation(vec3 rgb,float saturation){float r=rgb[0],g=rgb[1],b=rgb[2];float maxC=0.0,minC=0.0,midC=0.0;int maxI=0,minI=0,midI=0;if(r>=g&&r>=b){maxI=0;maxC=r;if(g>=b){minI=2;midI=1;minC=b;midC=g;}else{minI=1;midI=2;minC=g;midC=b;}}else if(g>=r&&g>=b){maxI=1;maxC=g;if(r>=b){minI=2;midI=0;minC=b;midC=r;}else{minI=0;midI=2;minC=r;midC=b;}}else if(b>=r&&b>=g){maxI=2;maxC=b;if(r>=g){minI=1;midI=0;minC=g;midC=r;}else{minI=0;midI=1;minC=r;midC=g;}}vec3 result=vec3(r,g,b);if(maxC>minC){midC=(midC-minC)*saturation/(maxC-minC);maxC=saturation;}else{maxC=midC=0.0;}minC=0.0;if(maxI==0){result[0]=maxC;}else if(maxI==1){result[1]=maxC;}else if(maxI==2){result[2]=maxC;}if(minI==0){result[0]=minC;}else if(minI==1){result[1]=minC;}else if(minI==2){result[2]=minC;}if(midI==0){result[0]=midC;}else if(midI==1){result[1]=midC;}else if(midI==2){result[2]=midC;}return result;}vec3 op(vec3 a,vec3 b){float l=getLuminosity(b);return setLuminosity(a,l);}vec3 premultipliedAlpha(vec4 color){float a=color.a;if(a==0.0){return vec3(0.0,0.0,0.0);}return vec3(color.r/a,color.g/a,color.b/a);}float alphaCompose(float a1,float a2,float a3,float c1,float c2,float c3){return(1.0-a2/a3)*c1+a2/a3*((1.0-a1)*c2+a1*c3);}void main(){vec4 color1=texture2D(u_texture1,v_texCoords);vec4 color2=texture2D(u_texture2,v_texCoords);if(color1.a==0.0){gl_FragColor=color2;}else if(color2.a==0.0){gl_FragColor=color1;}else{vec3 bottom=premultipliedAlpha(color1);vec3 top=premultipliedAlpha(color2);vec3 res=op(bottom,top);float a=color1.a+color2.a-color1.a*color2.a;gl_FragColor=vec4(alphaCompose(color1.a,color2.a,a,bottom.r,top.r,res.r)*a,alphaCompose(color1.a,color2.a,a,bottom.g,top.g,res.g)*a,alphaCompose(color1.a,color2.a,a,bottom.b,top.b,res.b)*a,a);}}"; // eslint-disable-line -var canvasPolygon$7 = painter.canvasPolygon; -var _enums$STYLE_KEY$i = enums.STYLE_KEY, - POSITION$4 = _enums$STYLE_KEY$i.POSITION, - DISPLAY$9 = _enums$STYLE_KEY$i.DISPLAY, - OPACITY$5 = _enums$STYLE_KEY$i.OPACITY, - VISIBILITY$6 = _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, - _enums$NODE_KEY$9 = enums.NODE_KEY, - NODE_CACHE$4 = _enums$NODE_KEY$9.NODE_CACHE, - NODE_CACHE_TOTAL$1 = _enums$NODE_KEY$9.NODE_CACHE_TOTAL, - NODE_CACHE_OVERFLOW$2 = _enums$NODE_KEY$9.NODE_CACHE_OVERFLOW, - NODE_CACHE_MASK$1 = _enums$NODE_KEY$9.NODE_CACHE_MASK, - NODE_CACHE_FILTER$2 = _enums$NODE_KEY$9.NODE_CACHE_FILTER, - NODE_MATRIX$3 = _enums$NODE_KEY$9.NODE_MATRIX, - NODE_MATRIX_EVENT$4 = _enums$NODE_KEY$9.NODE_MATRIX_EVENT, - NODE_OPACITY$3 = _enums$NODE_KEY$9.NODE_OPACITY, - NODE_COMPUTED_STYLE$4 = _enums$NODE_KEY$9.NODE_COMPUTED_STYLE, - NODE_CURRENT_STYLE$5 = _enums$NODE_KEY$9.NODE_CURRENT_STYLE, - NODE_LIMIT_CACHE$2 = _enums$NODE_KEY$9.NODE_LIMIT_CACHE, - NODE_REFRESH_LV$1 = _enums$NODE_KEY$9.NODE_REFRESH_LV, - NODE_CACHE_STYLE$1 = _enums$NODE_KEY$9.NODE_CACHE_STYLE, - NODE_DEFS_CACHE$6 = _enums$NODE_KEY$9.NODE_DEFS_CACHE, - NODE_IS_MASK$2 = _enums$NODE_KEY$9.NODE_IS_MASK, - NODE_DOM_PARENT$5 = _enums$NODE_KEY$9.NODE_DOM_PARENT, - NODE_PERSPECTIVE_MATRIX$1 = _enums$NODE_KEY$9.NODE_PERSPECTIVE_MATRIX, - NODE_VIRTUAL_DOM$2 = _enums$NODE_KEY$9.NODE_VIRTUAL_DOM, - _enums$STRUCT_KEY$2 = enums.STRUCT_KEY, - STRUCT_NODE$1 = _enums$STRUCT_KEY$2.STRUCT_NODE, - STRUCT_TOTAL$1 = _enums$STRUCT_KEY$2.STRUCT_TOTAL, - STRUCT_HAS_MASK$1 = _enums$STRUCT_KEY$2.STRUCT_HAS_MASK, - STRUCT_LV$2 = _enums$STRUCT_KEY$2.STRUCT_LV; -var NONE$2 = o$3.NONE, - TRANSFORM_ALL$1 = o$3.TRANSFORM_ALL, - OP = o$3.OPACITY, - FT = o$3.FILTER, - REPAINT$2 = o$3.REPAINT, - contain$2 = o$3.contain, - MBM = o$3.MIX_BLEND_MODE, - PPT = o$3.PERSPECTIVE; -var isE$3 = mx.isE, - inverse$1 = mx.inverse, - multiply$2 = mx.multiply; -var mbmName$2 = mbm.mbmName, - isValidMbm$2 = mbm.isValidMbm; // 无cache时应用离屏时的优先级,从小到大,OFFSCREEN_MASK2是个特殊的 +var canvasPolygon = painter.canvasPolygon; +var _enums$STYLE_KEY$7 = enums.STYLE_KEY, + POSITION$1 = _enums$STYLE_KEY$7.POSITION, + DISPLAY$1 = _enums$STYLE_KEY$7.DISPLAY, + OPACITY = _enums$STYLE_KEY$7.OPACITY, + VISIBILITY$1 = _enums$STYLE_KEY$7.VISIBILITY, + FILTER$1 = _enums$STYLE_KEY$7.FILTER, + OVERFLOW = _enums$STYLE_KEY$7.OVERFLOW, + MIX_BLEND_MODE = _enums$STYLE_KEY$7.MIX_BLEND_MODE, + FILL = _enums$STYLE_KEY$7.FILL, + TRANSFORM = _enums$STYLE_KEY$7.TRANSFORM, + TRANSFORM_ORIGIN = _enums$STYLE_KEY$7.TRANSFORM_ORIGIN, + PERSPECTIVE$1 = _enums$STYLE_KEY$7.PERSPECTIVE, + PERSPECTIVE_ORIGIN = _enums$STYLE_KEY$7.PERSPECTIVE_ORIGIN, + _enums$NODE_KEY$1 = enums.NODE_KEY, + NODE_CACHE$1 = _enums$NODE_KEY$1.NODE_CACHE, + NODE_CACHE_TOTAL$1 = _enums$NODE_KEY$1.NODE_CACHE_TOTAL, + NODE_CACHE_OVERFLOW$1 = _enums$NODE_KEY$1.NODE_CACHE_OVERFLOW, + NODE_CACHE_MASK$1 = _enums$NODE_KEY$1.NODE_CACHE_MASK, + NODE_CACHE_FILTER$1 = _enums$NODE_KEY$1.NODE_CACHE_FILTER, + NODE_MATRIX = _enums$NODE_KEY$1.NODE_MATRIX, + NODE_MATRIX_EVENT = _enums$NODE_KEY$1.NODE_MATRIX_EVENT, + NODE_OPACITY = _enums$NODE_KEY$1.NODE_OPACITY, + NODE_COMPUTED_STYLE$1 = _enums$NODE_KEY$1.NODE_COMPUTED_STYLE, + NODE_CURRENT_STYLE$1 = _enums$NODE_KEY$1.NODE_CURRENT_STYLE, + NODE_LIMIT_CACHE = _enums$NODE_KEY$1.NODE_LIMIT_CACHE, + NODE_REFRESH_LV$1 = _enums$NODE_KEY$1.NODE_REFRESH_LV, + NODE_CACHE_STYLE$1 = _enums$NODE_KEY$1.NODE_CACHE_STYLE, + NODE_DEFS_CACHE = _enums$NODE_KEY$1.NODE_DEFS_CACHE, + NODE_IS_MASK$1 = _enums$NODE_KEY$1.NODE_IS_MASK, + NODE_DOM_PARENT$1 = _enums$NODE_KEY$1.NODE_DOM_PARENT, + NODE_PERSPECTIVE_MATRIX = _enums$NODE_KEY$1.NODE_PERSPECTIVE_MATRIX, + NODE_VIRTUAL_DOM = _enums$NODE_KEY$1.NODE_VIRTUAL_DOM, + _enums$STRUCT_KEY$1 = enums.STRUCT_KEY, + STRUCT_NODE$1 = _enums$STRUCT_KEY$1.STRUCT_NODE, + STRUCT_TOTAL$1 = _enums$STRUCT_KEY$1.STRUCT_TOTAL, + STRUCT_HAS_MASK = _enums$STRUCT_KEY$1.STRUCT_HAS_MASK, + STRUCT_LV = _enums$STRUCT_KEY$1.STRUCT_LV; +var NONE$1 = o$1.NONE, + TRANSFORM_ALL = o$1.TRANSFORM_ALL, + OP = o$1.OPACITY, + FT = o$1.FILTER, + REPAINT$1 = o$1.REPAINT, + contain$1 = o$1.contain, + MBM = o$1.MIX_BLEND_MODE, + PPT = o$1.PERSPECTIVE; +var isE = mx.isE, + inverse = mx.inverse, + multiply = mx.multiply; +var mbmName = mbm.mbmName, + isValidMbm = mbm.isValidMbm; // 无cache时应用离屏时的优先级,从小到大,OFFSCREEN_MASK2是个特殊的 var OFFSCREEN_OVERFLOW = 0; var OFFSCREEN_FILTER = 1; @@ -27991,11 +27996,11 @@ function genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHas var sx1 = node.__sx1, sy1 = node.__sy1, __config = node.__config; - var cache = __config[NODE_CACHE$4], - _config$NODE_COMPUTE = __config[NODE_COMPUTED_STYLE$4], - filter = _config$NODE_COMPUTE[FILTER$5], - perspective = _config$NODE_COMPUTE[PERSPECTIVE$4], - perspectiveOrigin = _config$NODE_COMPUTE[PERSPECTIVE_ORIGIN$4]; // 先将局部根节点的bbox算好,可能没内容是空 + var cache = __config[NODE_CACHE$1], + _config$NODE_COMPUTE = __config[NODE_COMPUTED_STYLE$1], + filter = _config$NODE_COMPUTE[FILTER$1], + perspective = _config$NODE_COMPUTE[PERSPECTIVE$1], + perspectiveOrigin = _config$NODE_COMPUTE[PERSPECTIVE_ORIGIN]; // 先将局部根节点的bbox算好,可能没内容是空 var bboxTotal; @@ -28048,18 +28053,18 @@ function genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHas var __sx1 = node2.__sx1, __sy1 = node2.__sy1, _node2$__config = node2.__config, - limitCache = _node2$__config[NODE_LIMIT_CACHE$2], - __cache = _node2$__config[NODE_CACHE$4], + limitCache = _node2$__config[NODE_LIMIT_CACHE], + __cache = _node2$__config[NODE_CACHE$1], __cacheTotal = _node2$__config[NODE_CACHE_TOTAL$1], - __cacheFilter = _node2$__config[NODE_CACHE_FILTER$2], + __cacheFilter = _node2$__config[NODE_CACHE_FILTER$1], __cacheMask = _node2$__config[NODE_CACHE_MASK$1], - __cacheOverflow = _node2$__config[NODE_CACHE_OVERFLOW$2], - _node2$__config$NODE_ = _node2$__config[NODE_COMPUTED_STYLE$4], - display = _node2$__config$NODE_[DISPLAY$9], - visibility = _node2$__config$NODE_[VISIBILITY$6], - transform = _node2$__config$NODE_[TRANSFORM$4], - transformOrigin = _node2$__config$NODE_[TRANSFORM_ORIGIN$5], - opacity = _node2$__config$NODE_[OPACITY$5]; // webgl不能跳过超限 + __cacheOverflow = _node2$__config[NODE_CACHE_OVERFLOW$1], + _node2$__config$NODE_ = _node2$__config[NODE_COMPUTED_STYLE$1], + display = _node2$__config$NODE_[DISPLAY$1], + visibility = _node2$__config$NODE_[VISIBILITY$1], + transform = _node2$__config$NODE_[TRANSFORM], + transformOrigin = _node2$__config$NODE_[TRANSFORM_ORIGIN], + opacity = _node2$__config$NODE_[OPACITY]; // webgl不能跳过超限 if (limitCache && !includeLimitCache) { return; @@ -28110,7 +28115,7 @@ function genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHas bbox[3] -= sy1; var matrix = matrixHash[parentIndex]; // 父级matrix初始化E为null,自身不为E时才运算,可以加速 - if (transform && !isE$3(transform)) { + if (transform && !isE(transform)) { var tfo = transformOrigin.slice(0); // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标 tfo[0] += __sx1 - sx1 + dx; @@ -28118,7 +28123,7 @@ function genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHas var m = tf.calMatrixByOrigin(transform, tfo); if (matrix) { - matrix = multiply$2(matrix, m); + matrix = multiply(matrix, m); } else { matrix = m; } @@ -28129,7 +28134,7 @@ function genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHas } if (pm) { - matrix = multiply$2(pm, matrix); + matrix = multiply(pm, matrix); } bbox = util.transformBbox(bbox, matrix, d, d); // 有孩子才继续存入下层级广度运算 @@ -28176,7 +28181,7 @@ function genTotal(renderMode, node, __config, index, total, __structs, cacheTop, var parentIndexHash = {}; var opacityHash = {}; - var _genBboxTotal = genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHash), + var _genBboxTotal = genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHash, Cache.MAX), _genBboxTotal2 = _slicedToArray(_genBboxTotal, 1), bboxTotal = _genBboxTotal2[0]; @@ -28219,7 +28224,7 @@ function genTotal(renderMode, node, __config, index, total, __structs, cacheTop, var _structs$i = __structs[i], _node = _structs$i[STRUCT_NODE$1], _total3 = _structs$i[STRUCT_TOTAL$1], - hasMask = _structs$i[STRUCT_HAS_MASK$1]; + hasMask = _structs$i[STRUCT_HAS_MASK]; var _config = _node.__config; var parentIndex = parentIndexHash[i]; var matrix = matrixHash[parentIndex]; // 父节点的在每个节点计算后保存,第一个为top的默认为E(空) @@ -28232,91 +28237,91 @@ function genTotal(renderMode, node, __config, index, total, __structs, cacheTop, var m = matrix || mx.identity(); ctx.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]); - _node.render(renderMode, 0, ctx, true, tx - sx1 + dbx, ty - sy1 + dby); - } // 再看total缓存/cache,都没有的是无内容的Xom节点 - else { - var __cache = _config[NODE_CACHE$4], - __cacheTotal = _config[NODE_CACHE_TOTAL$1], - __cacheFilter = _config[NODE_CACHE_FILTER$2], - __cacheMask = _config[NODE_CACHE_MASK$1], - __cacheOverflow = _config[NODE_CACHE_OVERFLOW$2], - isMask = _config[NODE_IS_MASK$2], - _config$NODE_COMPUTED = _config[NODE_COMPUTED_STYLE$4], - display = _config$NODE_COMPUTED[DISPLAY$9], - visibility = _config$NODE_COMPUTED[VISIBILITY$6], - transform = _config$NODE_COMPUTED[TRANSFORM$4], - transformOrigin = _config$NODE_COMPUTED[TRANSFORM_ORIGIN$5], - mixBlendMode = _config$NODE_COMPUTED[MIX_BLEND_MODE$3]; - - if (display === 'none') { - i += _total3 || 0; - - if (hasMask) { - i += hasMask; - } - - continue; - } // mask和不可见不能被汇总到top上 + _node.render(renderMode, 0, ctx, true, tx - sx1 + dbx, ty - sy1 + dby); + } // 再看total缓存/cache,都没有的是无内容的Xom节点 + else { + var __cache = _config[NODE_CACHE$1], + __cacheTotal = _config[NODE_CACHE_TOTAL$1], + __cacheFilter = _config[NODE_CACHE_FILTER$1], + __cacheMask = _config[NODE_CACHE_MASK$1], + __cacheOverflow = _config[NODE_CACHE_OVERFLOW$1], + isMask = _config[NODE_IS_MASK$1], + _config$NODE_COMPUTED = _config[NODE_COMPUTED_STYLE$1], + display = _config$NODE_COMPUTED[DISPLAY$1], + visibility = _config$NODE_COMPUTED[VISIBILITY$1], + transform = _config$NODE_COMPUTED[TRANSFORM], + transformOrigin = _config$NODE_COMPUTED[TRANSFORM_ORIGIN], + mixBlendMode = _config$NODE_COMPUTED[MIX_BLEND_MODE]; + if (display === 'none') { + i += _total3 || 0; - if (visibility === 'hidden' || isMask) { - continue; + if (hasMask) { + i += hasMask; } - if (transform && !isE$3(transform)) { - var tfo = transformOrigin.slice(0); // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标 + continue; + } // mask和不可见不能被汇总到top上 - if (__cache && __cache.available) { - tfo[0] += __cache.sx1; - tfo[1] += __cache.sy1; - } else { - tfo[0] += _node.__sx1; - tfo[1] += _node.__sy1; - } - var dx = -sx1 + dbx + tx; - var dy = -sy1 + dby + ty; - tfo[0] += dx; - tfo[1] += dy; + if (visibility === 'hidden' || isMask) { + continue; + } - var _m = tf.calMatrixByOrigin(transform, tfo); + if (transform && !isE(transform)) { + var tfo = transformOrigin.slice(0); // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标 - if (matrix) { - matrix = multiply$2(matrix, _m); - } else { - matrix = _m; - } + if (__cache && __cache.available) { + tfo[0] += __cache.sx1; + tfo[1] += __cache.sy1; + } else { + tfo[0] += _node.__sx1; + tfo[1] += _node.__sy1; } + var dx = -sx1 + dbx + tx; + var dy = -sy1 + dby + ty; + tfo[0] += dx; + tfo[1] += dy; + + var _m = tf.calMatrixByOrigin(transform, tfo); + if (matrix) { - matrixHash[i] = matrix; + matrix = multiply(matrix, _m); + } else { + matrix = _m; } + } - var target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]); + if (matrix) { + matrixHash[i] = matrix; + } - if (target) { - if (isValidMbm$2(mixBlendMode)) { - ctx.globalCompositeOperation = mbmName$2(mixBlendMode); - } else { - ctx.globalCompositeOperation = 'source-over'; - } + var target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]); - ctx.globalAlpha = opacity; + if (target) { + if (isValidMbm(mixBlendMode)) { + ctx.globalCompositeOperation = mbmName(mixBlendMode); + } else { + ctx.globalCompositeOperation = 'source-over'; + } - if (matrix) { - ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]); - } else { - ctx.setTransform(1, 0, 0, 1, 0, 0); - } + ctx.globalAlpha = opacity; - Cache.drawCache(target, cacheTop); + if (matrix) { + ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]); + } else { + ctx.setTransform(1, 0, 0, 1, 0, 0); + } - if (target !== __cache) { - i += _total3 || 0; - i += hasMask || 0; - } + Cache.drawCache(target, cacheTop); + + if (target !== __cache) { + i += _total3 || 0; + i += hasMask || 0; } } + } } return cacheTop; @@ -28328,8 +28333,8 @@ function genFilter(node, cache, v) { function genMask(node, cache) { var _node$computedStyle = node.computedStyle, - transform = _node$computedStyle[TRANSFORM$4], - transformOrigin = _node$computedStyle[TRANSFORM_ORIGIN$5]; + transform = _node$computedStyle[TRANSFORM], + transformOrigin = _node$computedStyle[TRANSFORM_ORIGIN]; var isClip = node.next.isClip; return Cache.genMask(cache, node.next, isClip, transform, transformOrigin); } @@ -28427,24 +28432,24 @@ function genTotalWebgl(gl, texCache, node, __config, index, total, __structs, ca texCache.addTexAndDrawWhenLimit(gl, cache, 1, null, cx, cy, dx, dy); } // limitCache无cache需先绘制到统一的离屏画布上 else if (limitCache) { - var c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__'); - node.render(mode.WEBGL, 0, gl); - var j = texCache.lockOneChannel(); + var c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__'); + node.render(mode.WEBGL, 0, gl); + var j = texCache.lockOneChannel(); - var _texture = webgl.createTexture(gl, c.canvas, j); + var _texture = webgl.createTexture(gl, c.canvas, j); - var _mockCache = new MockCache(gl, _texture, 0, 0, width, height, [0, 0, width, height]); + var _mockCache = new MockCache(gl, _texture, 0, 0, width, height, [0, 0, width, height]); - texCache.addTexAndDrawWhenLimit(gl, _mockCache, 1, null, cx, cy, 0, 0); - texCache.refresh(gl, cx, cy); - c.ctx.setTransform(1, 0, 0, 1, 0, 0); - c.ctx.globalAlpha = 1; - c.ctx.clearRect(0, 0, width, height); + texCache.addTexAndDrawWhenLimit(gl, _mockCache, 1, null, cx, cy, 0, 0); + texCache.refresh(gl, cx, cy); + c.ctx.setTransform(1, 0, 0, 1, 0, 0); + c.ctx.globalAlpha = 1; + c.ctx.clearRect(0, 0, width, height); - _mockCache.release(); + _mockCache.release(); - texCache.releaseLockChannel(j); - } // 因为cacheTotal不总是以左上角原点为开始,所以必须每个节点重算matrix,合并box时计算的无法用到 + texCache.releaseLockChannel(j); + } // 因为cacheTotal不总是以左上角原点为开始,所以必须每个节点重算matrix,合并box时计算的无法用到 var matrixHash = {}; // 先序遍历汇总到total @@ -28453,7 +28458,7 @@ function genTotalWebgl(gl, texCache, node, __config, index, total, __structs, ca var _structs$i2 = __structs[i], _node2 = _structs$i2[STRUCT_NODE$1], _total4 = _structs$i2[STRUCT_TOTAL$1], - hasMask = _structs$i2[STRUCT_HAS_MASK$1]; + hasMask = _structs$i2[STRUCT_HAS_MASK]; var _config2 = _node2.__config; var parentIndex = parentIndexHash[i]; var matrix = matrixHash[parentIndex]; // 父节点的在每个节点计算后保存,第一个为top的默认为E(空) @@ -28463,108 +28468,108 @@ function genTotalWebgl(gl, texCache, node, __config, index, total, __structs, ca if (_node2 instanceof Text) { if (parentPm) { - matrix = multiply$2(parentPm, matrix); + matrix = multiply(parentPm, matrix); } - texCache.addTexAndDrawWhenLimit(gl, _config2[NODE_CACHE$4], opacity, matrix, cx, cy, dx, dy); + texCache.addTexAndDrawWhenLimit(gl, _config2[NODE_CACHE$1], opacity, matrix, cx, cy, dx, dy); } // 再看total缓存/cache,都没有的是无内容的Xom节点 else { - var __cache = _config2[NODE_CACHE$4], - __cacheTotal = _config2[NODE_CACHE_TOTAL$1], - __cacheFilter = _config2[NODE_CACHE_FILTER$2], - __cacheMask = _config2[NODE_CACHE_MASK$1], - __cacheOverflow = _config2[NODE_CACHE_OVERFLOW$2], - isMask = _config2[NODE_IS_MASK$2], - _config2$NODE_COMPUTE = _config2[NODE_COMPUTED_STYLE$4], - display = _config2$NODE_COMPUTE[DISPLAY$9], - visibility = _config2$NODE_COMPUTE[VISIBILITY$6], - transform = _config2$NODE_COMPUTE[TRANSFORM$4], - transformOrigin = _config2$NODE_COMPUTE[TRANSFORM_ORIGIN$5], - mixBlendMode = _config2$NODE_COMPUTE[MIX_BLEND_MODE$3]; - - if (display === 'none') { - i += _total4 || 0; + var __cache = _config2[NODE_CACHE$1], + __cacheTotal = _config2[NODE_CACHE_TOTAL$1], + __cacheFilter = _config2[NODE_CACHE_FILTER$1], + __cacheMask = _config2[NODE_CACHE_MASK$1], + __cacheOverflow = _config2[NODE_CACHE_OVERFLOW$1], + isMask = _config2[NODE_IS_MASK$1], + _config2$NODE_COMPUTE = _config2[NODE_COMPUTED_STYLE$1], + display = _config2$NODE_COMPUTE[DISPLAY$1], + visibility = _config2$NODE_COMPUTE[VISIBILITY$1], + transform = _config2$NODE_COMPUTE[TRANSFORM], + transformOrigin = _config2$NODE_COMPUTE[TRANSFORM_ORIGIN], + mixBlendMode = _config2$NODE_COMPUTE[MIX_BLEND_MODE]; - if (hasMask) { - i += hasMask; - } + if (display === 'none') { + i += _total4 || 0; - continue; - } // mask和不可见不能被汇总到top上 + if (hasMask) { + i += hasMask; + } + continue; + } // mask和不可见不能被汇总到top上 - if (visibility === 'hidden' || isMask) { - continue; - } - if (transform && !isE$3(transform)) { - var tfo = transformOrigin.slice(0); // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标 + if (visibility === 'hidden' || isMask) { + continue; + } - if (__cache && __cache.available) { - tfo[0] += __cache.sx1; - tfo[1] += __cache.sy1; - } else { - tfo[0] += _node2.__sx1; - tfo[1] += _node2.__sy1; - } + if (transform && !isE(transform)) { + var tfo = transformOrigin.slice(0); // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标 - var _dx = -sx1 + dbx; + if (__cache && __cache.available) { + tfo[0] += __cache.sx1; + tfo[1] += __cache.sy1; + } else { + tfo[0] += _node2.__sx1; + tfo[1] += _node2.__sy1; + } - var _dy = -sy1 + dby; + var _dx = -sx1 + dbx; - tfo[0] += _dx; - tfo[1] += _dy; - var m = tf.calMatrixByOrigin(transform, tfo); + var _dy = -sy1 + dby; - if (matrix) { - matrix = multiply$2(matrix, m); - } else { - matrix = m; - } - } + tfo[0] += _dx; + tfo[1] += _dy; + var m = tf.calMatrixByOrigin(transform, tfo); if (matrix) { - matrixHash[i] = matrix; + matrix = multiply(matrix, m); + } else { + matrix = m; } + } - if (parentPm) { - matrix = multiply$2(parentPm, matrix); - } + if (matrix) { + matrixHash[i] = matrix; + } - var target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]); + if (parentPm) { + matrix = multiply(parentPm, matrix); + } - if (target) { - // 局部的mbm和主画布一样,先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成 - if (isValidMbm$2(mixBlendMode)) { - texCache.refresh(gl, cx, cy); + var target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]); - var _genFrameBufferWithTe3 = genFrameBufferWithTexture(gl, texCache, width, height), - _genFrameBufferWithTe4 = _slicedToArray(_genFrameBufferWithTe3, 3), - n2 = _genFrameBufferWithTe4[0], - frameBuffer2 = _genFrameBufferWithTe4[1], - texture2 = _genFrameBufferWithTe4[2]; + if (target) { + // 局部的mbm和主画布一样,先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成 + if (isValidMbm(mixBlendMode)) { + texCache.refresh(gl, cx, cy); - texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy); - texCache.refresh(gl, cx, cy); // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前fbo作为绘制对象 + var _genFrameBufferWithTe3 = genFrameBufferWithTexture(gl, texCache, width, height), + _genFrameBufferWithTe4 = _slicedToArray(_genFrameBufferWithTe3, 3), + n2 = _genFrameBufferWithTe4[0], + frameBuffer2 = _genFrameBufferWithTe4[1], + texture2 = _genFrameBufferWithTe4[2]; - var _genMbmWebgl = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName$2(mixBlendMode), width, height); + texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy); + texCache.refresh(gl, cx, cy); // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前fbo作为绘制对象 - var _genMbmWebgl2 = _slicedToArray(_genMbmWebgl, 3); + var _genMbmWebgl = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height); - n = _genMbmWebgl2[0]; - frameBuffer = _genMbmWebgl2[1]; - texture = _genMbmWebgl2[2]; - gl.deleteFramebuffer(frameBuffer2); - gl.deleteTexture(texture2); - } else { - texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy); - } + var _genMbmWebgl2 = _slicedToArray(_genMbmWebgl, 3); - if (target !== __cache) { - i += (_total4 || 0) + (hasMask || 0); - } + n = _genMbmWebgl2[0]; + frameBuffer = _genMbmWebgl2[1]; + texture = _genMbmWebgl2[2]; + gl.deleteFramebuffer(frameBuffer2); + gl.deleteTexture(texture2); + } else { + texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy); + } + + if (target !== __cache) { + i += (_total4 || 0) + (hasMask || 0); } } + } } // 绘制到fbo的纹理对象上并删除fbo恢复 @@ -28602,7 +28607,7 @@ function genFilterWebgl(gl, texCache, node, cache, filter, W, H) { bbox = _res[3]; } } else if (k === 'hue-rotate') { - var rotation = geom.d2r(v % 360); + var rotation = geom$1.d2r(v % 360); var cosR = Math.cos(rotation); var sinR = Math.sin(rotation); @@ -28860,12 +28865,12 @@ function genMaskWebgl(gl, texCache, node, __config, cache, W, H) { var dx = -bbox[0], dy = -bbox[1]; // 先求得被遮罩的matrix,用作inverse给mask计算 - var _config$NODE_COMPUTE2 = __config[NODE_COMPUTED_STYLE$4], - transform = _config$NODE_COMPUTE2[TRANSFORM$4], - transformOrigin = _config$NODE_COMPUTE2[TRANSFORM_ORIGIN$5]; + var _config$NODE_COMPUTE2 = __config[NODE_COMPUTED_STYLE$1], + transform = _config$NODE_COMPUTE2[TRANSFORM], + transformOrigin = _config$NODE_COMPUTE2[TRANSFORM_ORIGIN]; var inverse; - if (isE$3(transform)) { + if (isE(transform)) { inverse = mx.identity(); } else { var tfo = transformOrigin.slice(0); @@ -28886,15 +28891,15 @@ function genMaskWebgl(gl, texCache, node, __config, cache, W, H) { while (next && next.isMask) { var _config3 = next.__config; - var __cache = _config3[NODE_CACHE$4], - __cacheFilter = _config3[NODE_CACHE_FILTER$2], - __cacheOverflow = _config3[NODE_CACHE_OVERFLOW$2], - _config3$NODE_COMPUTE = _config3[NODE_COMPUTED_STYLE$4], - display = _config3$NODE_COMPUTE[DISPLAY$9], - visibility = _config3$NODE_COMPUTE[VISIBILITY$6], - opacity = _config3$NODE_COMPUTE[OPACITY$5], - _transform = _config3$NODE_COMPUTE[TRANSFORM$4], - _transformOrigin = _config3$NODE_COMPUTE[TRANSFORM_ORIGIN$5]; + var __cache = _config3[NODE_CACHE$1], + __cacheFilter = _config3[NODE_CACHE_FILTER$1], + __cacheOverflow = _config3[NODE_CACHE_OVERFLOW$1], + _config3$NODE_COMPUTE = _config3[NODE_COMPUTED_STYLE$1], + display = _config3$NODE_COMPUTE[DISPLAY$1], + visibility = _config3$NODE_COMPUTE[VISIBILITY$1], + opacity = _config3$NODE_COMPUTE[OPACITY], + _transform = _config3$NODE_COMPUTE[TRANSFORM], + _transformOrigin = _config3$NODE_COMPUTE[TRANSFORM_ORIGIN]; if (display === 'none' || visibility === 'hidden') { continue; @@ -28906,23 +28911,23 @@ function genMaskWebgl(gl, texCache, node, __config, cache, W, H) { if (target) { var m = void 0; - if (isE$3(_transform)) { + if (isE(_transform)) { m = mx.identity(); } else { - var _tfo = _transformOrigin.slice(0); + var tfo = _transformOrigin.slice(0); - _tfo[0] += target.bbox[0] + dx; - _tfo[1] += target.bbox[1] + dy; - m = tf.calMatrixByOrigin(_transform, _tfo); + tfo[0] += target.bbox[0] + dx; + tfo[1] += target.bbox[1] + dy; + m = tf.calMatrixByOrigin(_transform, tfo); } m = mx.multiply(inverse, m); // m = mx.m2Mat4(m, cx, cy); texCache.addTexAndDrawWhenLimit(gl, target, opacity, m, cx, cy, dx, dy); } // 异常情况超限 - else if (_config3[NODE_LIMIT_CACHE$2]) { - return; - } + else if (_config3[NODE_LIMIT_CACHE]) { + return; + } next = next.next; } @@ -28989,7 +28994,7 @@ function genMaskWebgl(gl, texCache, node, __config, cache, W, H) { function genMbmWebgl(gl, texCache, i, j, fbo, tex, mbm, W, H) { var frag; - mbm = mbmName$2(mbm); + mbm = mbmName(mbm); if (mbm === 'multiply') { frag = fragmentMultiply; @@ -29078,7 +29083,7 @@ function applyOffscreen(ctx, list, width, height) { ctx.beginPath(); if (_list) { - canvasPolygon$7(ctx, _list); + canvasPolygon(ctx, _list); } else { ctx.rect(x, y, offsetWidth, offsetHeight); } @@ -29218,8 +29223,8 @@ function applyOffscreen(ctx, list, width, height) { inject.releaseCacheCanvas(_target3.canvas); } // 特殊的mask节点汇总结束,还原ctx else if (type === OFFSCREEN_MASK2) { - ctx = offscreen.ctx; - } + ctx = offscreen.ctx; + } }); return ctx; } @@ -29247,9 +29252,9 @@ function renderCacheCanvas(renderMode, ctx, root) { for (var i = 0, len = __structs.length; i < len; i++) { var _structs$i3 = __structs[i], node = _structs$i3[STRUCT_NODE$1], - lv = _structs$i3[STRUCT_LV$2], + lv = _structs$i3[STRUCT_LV], total = _structs$i3[STRUCT_TOTAL$1], - hasMask = _structs$i3[STRUCT_HAS_MASK$1]; // 排除Text,要么根节点直接绘制,要么被局部根节点汇总,自身并不缓存(fillText比位图更快) + hasMask = _structs$i3[STRUCT_HAS_MASK]; // 排除Text,要么根节点直接绘制,要么被局部根节点汇总,自身并不缓存(fillText比位图更快) if (node instanceof Text) { continue; @@ -29258,31 +29263,32 @@ function renderCacheCanvas(renderMode, ctx, root) { var __config = node.__config; // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,Root节点是第一个特殊处理 if (i === 0) ; else if (lv > lastLv) { - parentMatrix = lastConfig[NODE_MATRIX_EVENT$4]; + parentMatrix = lastConfig[NODE_MATRIX_EVENT]; - if (isE$3(parentMatrix)) { + if (isE(parentMatrix)) { parentMatrix = null; } matrixList.push(parentMatrix); - parentOpacity = lastConfig[NODE_OPACITY$3]; + parentOpacity = lastConfig[NODE_OPACITY]; opacityList.push(parentOpacity); } // 变小出栈索引需注意,可能不止一层,多层计算diff层级 else if (lv < lastLv) { - var diff = lastLv - lv; - matrixList.splice(-diff); - parentMatrix = matrixList[lv - 1]; - opacityList.splice(-diff); - parentOpacity = opacityList[lv - 1]; - } + var diff = lastLv - lv; + matrixList.splice(-diff); + parentMatrix = matrixList[lv - 1]; + opacityList.splice(-diff); + parentOpacity = opacityList[lv - 1]; + } // 不变是同级兄弟,无需特殊处理 + else ; lastConfig = __config; lastLv = lv; var refreshLevel = __config[NODE_REFRESH_LV$1], __cacheTotal = __config[NODE_CACHE_TOTAL$1], - computedStyle = __config[NODE_COMPUTED_STYLE$4]; // 跳过display:none元素和它的所有子节点 + computedStyle = __config[NODE_COMPUTED_STYLE$1]; // 跳过display:none元素和它的所有子节点 - if (computedStyle[DISPLAY$9] === 'none') { + if (computedStyle[DISPLAY$1] === 'none') { i += total || 0; // 只跳过自身不能跳过后面的mask,mask要渲染自身并进行缓存cache,以备对象切换display用 continue; @@ -29297,8 +29303,8 @@ function renderCacheCanvas(renderMode, ctx, root) { * 如果没有或无效,直接添加,无视节点本身变化,后面防重即可 */ - if (refreshLevel < REPAINT$2) { - __config[NODE_REFRESH_LV$1] = NONE$2; + if (refreshLevel < REPAINT$1) { + __config[NODE_REFRESH_LV$1] = NONE$1; if (hasMask) { var cacheMask = __config[NODE_CACHE_MASK$1]; @@ -29309,43 +29315,43 @@ function renderCacheCanvas(renderMode, ctx, root) { } } - var currentStyle = __config[NODE_CURRENT_STYLE$5], + var currentStyle = __config[NODE_CURRENT_STYLE$1], __cacheStyle = __config[NODE_CACHE_STYLE$1], - matrixEvent = __config[NODE_MATRIX_EVENT$4]; + matrixEvent = __config[NODE_MATRIX_EVENT]; var matrix = void 0; - if (contain$2(refreshLevel, TRANSFORM_ALL$1)) { + if (contain$1(refreshLevel, TRANSFORM_ALL)) { matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config); // 恶心的v8性能优化 - var m = __config[NODE_MATRIX$3]; + var m = __config[NODE_MATRIX]; util.assignMatrix(m, matrix); } else { - matrix = __config[NODE_MATRIX$3]; + matrix = __config[NODE_MATRIX]; } // 父不为E时要点乘继承父的 if (parentMatrix) { - matrix = multiply$2(parentMatrix, matrix); + matrix = multiply(parentMatrix, matrix); } // 恶心的v8性能优化 util.assignMatrix(matrixEvent, matrix); var opacity = void 0; - if (contain$2(refreshLevel, OP)) { - opacity = computedStyle[OPACITY$5] = currentStyle[OPACITY$5]; + if (contain$1(refreshLevel, OP)) { + opacity = computedStyle[OPACITY] = currentStyle[OPACITY]; } else { - opacity = computedStyle[OPACITY$5]; + opacity = computedStyle[OPACITY]; } - __config[NODE_OPACITY$3] = parentOpacity * opacity; // filter会改变bbox范围 + __config[NODE_OPACITY] = parentOpacity * opacity; // filter会改变bbox范围 - if (contain$2(refreshLevel, FT)) { + if (contain$1(refreshLevel, FT)) { node.__bbox = null; var _filter = node.__calFilter(currentStyle, computedStyle); - var __cacheFilter = __config[NODE_CACHE_FILTER$2]; + var __cacheFilter = __config[NODE_CACHE_FILTER$1]; if (__cacheFilter) { __cacheFilter.release(); @@ -29361,8 +29367,8 @@ function renderCacheCanvas(renderMode, ctx, root) { } } - if (contain$2(refreshLevel, MBM)) { - computedStyle[MIX_BLEND_MODE$3] = currentStyle[MIX_BLEND_MODE$3]; + if (contain$1(refreshLevel, MBM)) { + computedStyle[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE]; } // total可以跳过所有孩子节点省略循环,filter/mask等的强制前提是有total @@ -29376,17 +29382,17 @@ function renderCacheCanvas(renderMode, ctx, root) { * Geom没有子节点无需汇总局部根,Dom中Img也是,它们的局部根等于自身的cache,其它符合条件的Dom需要生成 */ else { - node.render(renderMode, refreshLevel, ctx, true); - } // 每个元素检查cacheTotal生成,已有的上面会continue跳过 + node.render(renderMode, refreshLevel, ctx, true); + } // 每个元素检查cacheTotal生成,已有的上面会continue跳过 - var limitCache = __config[NODE_LIMIT_CACHE$2]; - var position = computedStyle[POSITION$4], - overflow = computedStyle[OVERFLOW$3], - filter = computedStyle[FILTER$5], - mixBlendMode = computedStyle[MIX_BLEND_MODE$3]; + var limitCache = __config[NODE_LIMIT_CACHE]; + var position = computedStyle[POSITION$1], + overflow = computedStyle[OVERFLOW], + filter = computedStyle[FILTER$1], + mixBlendMode = computedStyle[MIX_BLEND_MODE]; - if (!limitCache && (hasMask || position === 'absolute' || filter.length || overflow === 'hidden' && total || isValidMbm$2(mixBlendMode))) { + if (!limitCache && (hasMask || position === 'absolute' || filter.length || overflow === 'hidden' && total || isValidMbm(mixBlendMode))) { if (hasRecordAsMask) { hasRecordAsMask[6] = filter; hasRecordAsMask[7] = overflow; @@ -29416,11 +29422,11 @@ function renderCacheCanvas(renderMode, ctx, root) { filter = _item4[6], overflow = _item4[7]; - var __cache = __config[NODE_CACHE$4], + var __cache = __config[NODE_CACHE$1], __cacheTotal = __config[NODE_CACHE_TOTAL$1], - __cacheFilter = __config[NODE_CACHE_FILTER$2], + __cacheFilter = __config[NODE_CACHE_FILTER$1], __cacheMask = __config[NODE_CACHE_MASK$1], - __cacheOverflow = __config[NODE_CACHE_OVERFLOW$2]; + __cacheOverflow = __config[NODE_CACHE_OVERFLOW$1]; var needGen; // 可能没变化,比如被遮罩节点、filter变更等 if (!__cacheTotal || !__cacheTotal.available) { @@ -29439,20 +29445,20 @@ function renderCacheCanvas(renderMode, ctx, root) { if (overflow === 'hidden') { if (!__cacheOverflow || !__cacheOverflow.available || needGen) { - __config[NODE_CACHE_OVERFLOW$2] = genOverflow(node, target); + __config[NODE_CACHE_OVERFLOW$1] = genOverflow(node, target); needGen = true; } - target = __config[NODE_CACHE_OVERFLOW$2] || target; + target = __config[NODE_CACHE_OVERFLOW$1] || target; } if (filter && filter.length) { if (!__cacheFilter || !__cacheFilter.available || needGen) { - __config[NODE_CACHE_FILTER$2] = genFilter(node, target, filter); + __config[NODE_CACHE_FILTER$1] = genFilter(node, target, filter); needGen = true; } - target = __config[NODE_CACHE_FILTER$2] || target; + target = __config[NODE_CACHE_FILTER$1] || target; } if (hasMask && (!__cacheMask || !__cacheMask.available || needGen)) { @@ -29473,15 +29479,15 @@ function renderCacheCanvas(renderMode, ctx, root) { for (var _i4 = 0, _len2 = __structs.length; _i4 < _len2; _i4++) { var _structs$_i2 = __structs[_i4], _node3 = _structs$_i2[STRUCT_NODE$1], - _lv = _structs$_i2[STRUCT_LV$2], + _lv = _structs$_i2[STRUCT_LV], _total5 = _structs$_i2[STRUCT_TOTAL$1], - _hasMask = _structs$_i2[STRUCT_HAS_MASK$1]; + _hasMask = _structs$_i2[STRUCT_HAS_MASK]; var _config4 = _node3.__config; // text如果display不可见,parent会直接跳过,不会走到这里,这里一定是直接绘制到root的,visibility在其内部判断 if (_node3 instanceof Text) { - var _config4$NODE_DOM_PAR = _config4[NODE_DOM_PARENT$5].__config, - _opacity = _config4$NODE_DOM_PAR[NODE_OPACITY$3], - _matrixEvent = _config4$NODE_DOM_PAR[NODE_MATRIX_EVENT$4]; + var _config4$NODE_DOM_PAR = _config4[NODE_DOM_PARENT$1].__config, + _opacity = _config4$NODE_DOM_PAR[NODE_OPACITY], + _matrixEvent = _config4$NODE_DOM_PAR[NODE_MATRIX_EVENT]; ctx.globalAlpha = _opacity; ctx.setTransform(_matrixEvent[0], _matrixEvent[1], _matrixEvent[4], _matrixEvent[5], _matrixEvent[12], _matrixEvent[13]); @@ -29491,21 +29497,21 @@ function renderCacheCanvas(renderMode, ctx, root) { ctx = applyOffscreen(ctx, offscreenHash[_i4], width, height); } } else { - var _opacity2 = _config4[NODE_OPACITY$3], - _matrixEvent2 = _config4[NODE_MATRIX_EVENT$4], - _limitCache = _config4[NODE_LIMIT_CACHE$2], - __cache = _config4[NODE_CACHE$4], + var _opacity2 = _config4[NODE_OPACITY], + _matrixEvent2 = _config4[NODE_MATRIX_EVENT], + _limitCache = _config4[NODE_LIMIT_CACHE], + __cache = _config4[NODE_CACHE$1], _cacheTotal = _config4[NODE_CACHE_TOTAL$1], - _cacheFilter = _config4[NODE_CACHE_FILTER$2], + _cacheFilter = _config4[NODE_CACHE_FILTER$1], __cacheMask = _config4[NODE_CACHE_MASK$1], - __cacheOverflow = _config4[NODE_CACHE_OVERFLOW$2], + __cacheOverflow = _config4[NODE_CACHE_OVERFLOW$1], _refreshLevel = _config4[NODE_REFRESH_LV$1], - _config4$NODE_COMPUTE = _config4[NODE_COMPUTED_STYLE$4], - display = _config4$NODE_COMPUTE[DISPLAY$9], - visibility = _config4$NODE_COMPUTE[VISIBILITY$6], - _overflow = _config4$NODE_COMPUTE[OVERFLOW$3], - _filter2 = _config4$NODE_COMPUTE[FILTER$5], - _mixBlendMode = _config4$NODE_COMPUTE[MIX_BLEND_MODE$3]; // 有total的可以直接绘制并跳过子节点索引 + _config4$NODE_COMPUTE = _config4[NODE_COMPUTED_STYLE$1], + display = _config4$NODE_COMPUTE[DISPLAY$1], + visibility = _config4$NODE_COMPUTE[VISIBILITY$1], + _overflow = _config4$NODE_COMPUTE[OVERFLOW], + _filter2 = _config4$NODE_COMPUTE[FILTER$1], + _mixBlendMode = _config4$NODE_COMPUTE[MIX_BLEND_MODE]; // 有total的可以直接绘制并跳过子节点索引 var target = getCache([__cacheMask, _cacheFilter, __cacheOverflow, _cacheTotal]); // total的尝试 @@ -29516,8 +29522,8 @@ function renderCacheCanvas(renderMode, ctx, root) { continue; } - if (isValidMbm$2(_mixBlendMode)) { - ctx.globalCompositeOperation = mbmName$2(_mixBlendMode); + if (isValidMbm(_mixBlendMode)) { + ctx.globalCompositeOperation = mbmName(_mixBlendMode); } else { ctx.globalCompositeOperation = 'source-over'; } @@ -29531,163 +29537,163 @@ function renderCacheCanvas(renderMode, ctx, root) { } } // 自身cache尝试 else { - if (maskStartHash.hasOwnProperty(_i4)) { - var _maskStartHash$_i = _slicedToArray(maskStartHash[_i4], 3), - idx = _maskStartHash$_i[0], - n = _maskStartHash$_i[1], - _offscreenMask = _maskStartHash$_i[2]; + if (maskStartHash.hasOwnProperty(_i4)) { + var _maskStartHash$_i = _slicedToArray(maskStartHash[_i4], 3), + idx = _maskStartHash$_i[0], + n = _maskStartHash$_i[1], + _offscreenMask = _maskStartHash$_i[2]; - var _target4 = inject.getCacheCanvas(width, height, null, 'mask2'); + var _target4 = inject.getCacheCanvas(width, height, null, 'mask2'); - _offscreenMask.mask = _target4; // 应用mask用到 + _offscreenMask.mask = _target4; // 应用mask用到 - _offscreenMask.isClip = _node3.isClip; // 定位到最后一个mask元素上的末尾 + _offscreenMask.isClip = _node3.isClip; // 定位到最后一个mask元素上的末尾 - var j = _i4 + (_total5 || 0) + 1; + var j = _i4 + (_total5 || 0) + 1; - while (--n) { - var _total6 = __structs[j][STRUCT_TOTAL$1]; - j += (_total6 || 0) + 1; - } + while (--n) { + var _total6 = __structs[j][STRUCT_TOTAL$1]; + j += (_total6 || 0) + 1; + } - j--; - var list = offscreenHash[j] = offscreenHash[j] || []; - list.push([idx, _lv, OFFSCREEN_MASK, _offscreenMask]); - list.push([j, _lv, OFFSCREEN_MASK2, { - ctx: ctx, - // 保存等待OFFSCREEN_MASK2时还原 - target: _target4 - }]); - ctx = _target4.ctx; - } - - var offscreenBlend = void 0, - offscreenMask = void 0, - offscreenFilter = void 0, - offscreenOverflow = void 0; // 这里比较特殊,可能会有__cache但超限没被汇聚到total上,需mock出离屏对象数据,还有可能本身就超限 - - if (__cache && __cache.available || _limitCache) { - if (__cache && __cache.available) { - // 有cache但没生成total的都在这 - if (isValidMbm$2(_mixBlendMode)) { - var c = inject.getCacheCanvas(width, height, null, 'blend'); - offscreenBlend = { - ctx: ctx, - target: c, - mixBlendMode: mbmName$2(_mixBlendMode), - matrix: _matrixEvent2 - }; - ctx = c.ctx; - } + j--; + var list = offscreenHash[j] = offscreenHash[j] || []; + list.push([idx, _lv, OFFSCREEN_MASK, _offscreenMask]); + list.push([j, _lv, OFFSCREEN_MASK2, { + ctx: ctx, + // 保存等待OFFSCREEN_MASK2时还原 + target: _target4 + }]); + ctx = _target4.ctx; + } - if (_hasMask) { - var _c2 = inject.getCacheCanvas(width, height, null, 'mask1'); + var offscreenBlend = void 0, + offscreenMask = void 0, + offscreenFilter = void 0, + offscreenOverflow = void 0; // 这里比较特殊,可能会有__cache但超限没被汇聚到total上,需mock出离屏对象数据,还有可能本身就超限 - offscreenMask = { - ctx: ctx, - target: _c2, - matrix: _matrixEvent2 - }; - ctx = _c2.ctx; - } + if (__cache && __cache.available || _limitCache) { + if (__cache && __cache.available) { + // 有cache但没生成total的都在这 + if (isValidMbm(_mixBlendMode)) { + var c = inject.getCacheCanvas(width, height, null, 'blend'); + offscreenBlend = { + ctx: ctx, + target: c, + mixBlendMode: mbmName(_mixBlendMode), + matrix: _matrixEvent2 + }; + ctx = c.ctx; + } - if (_filter2 && _filter2.length) { - var _c3 = inject.getCacheCanvas(width, height, null, 'filter1'); + if (_hasMask) { + var _c2 = inject.getCacheCanvas(width, height, null, 'mask1'); - offscreenFilter = { - ctx: ctx, - filter: _filter2, - target: _c3, - matrix: _matrixEvent2 - }; - ctx = _c3.ctx; - } + offscreenMask = { + ctx: ctx, + target: _c2, + matrix: _matrixEvent2 + }; + ctx = _c2.ctx; + } - if (_overflow === 'hidden' && display !== 'inline') { - var _c4 = inject.getCacheCanvas(width, height, null, 'overflow'); - - offscreenOverflow = { - ctx: ctx, - target: _c4, - matrix: _matrixEvent2, - x: __cache.sx1, - y: __cache.sy1, - offsetWidth: _node3.offsetWidth, - offsetHeight: _node3.offsetHeight - }; - ctx = _c4.ctx; - } + if (_filter2 && _filter2.length) { + var _c3 = inject.getCacheCanvas(width, height, null, 'filter1'); - if (visibility !== 'hidden') { - Cache.draw(ctx, _opacity2, _matrixEvent2, __cache); - } - } else { - // 连cache都没生成的超限 - var res = _node3.render(renderMode, _refreshLevel, ctx) || {}; - offscreenBlend = res.offscreenBlend; - offscreenMask = res.offscreenMask; - offscreenFilter = res.offscreenFilter; - offscreenOverflow = res.offscreenOverflow; - } // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反 + offscreenFilter = { + ctx: ctx, + filter: _filter2, + target: _c3, + matrix: _matrixEvent2 + }; + ctx = _c3.ctx; + } + if (_overflow === 'hidden' && display !== 'inline') { + var _c4 = inject.getCacheCanvas(width, height, null, 'overflow'); - if (offscreenBlend) { - var _j = _i4 + (_total5 || 0) + (_hasMask || 0); + offscreenOverflow = { + ctx: ctx, + target: _c4, + matrix: _matrixEvent2, + x: __cache.sx1, + y: __cache.sy1, + offsetWidth: _node3.offsetWidth, + offsetHeight: _node3.offsetHeight + }; + ctx = _c4.ctx; + } - var _list2 = offscreenHash[_j] = offscreenHash[_j] || []; + if (visibility !== 'hidden') { + Cache.draw(ctx, _opacity2, _matrixEvent2, __cache); + } + } else { + // 连cache都没生成的超限 + var res = _node3.render(renderMode, _refreshLevel, ctx) || {}; + offscreenBlend = res.offscreenBlend; + offscreenMask = res.offscreenMask; + offscreenFilter = res.offscreenFilter; + offscreenOverflow = res.offscreenOverflow; + } // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反 - _list2.push([_i4, _lv, OFFSCREEN_BLEND, offscreenBlend]); - ctx = offscreenBlend.target.ctx; - } // 被遮罩的节点要为第一个遮罩和最后一个遮罩的索引打标,被遮罩的本身在一个离屏canvas,遮罩的元素在另外一个 + if (offscreenBlend) { + var _j = _i4 + (_total5 || 0) + (_hasMask || 0); + var _list2 = offscreenHash[_j] = offscreenHash[_j] || []; - if (offscreenMask) { - var _j2 = _i4 + (_total5 || 0); + _list2.push([_i4, _lv, OFFSCREEN_BLEND, offscreenBlend]); - maskStartHash[_j2 + 1] = [_i4, _hasMask, offscreenMask]; - ctx = offscreenMask.target.ctx; - } // filter造成的离屏,需要将后续一段孩子节点区域的ctx替换,并在结束后应用结果,再替换回来 + ctx = offscreenBlend.target.ctx; + } // 被遮罩的节点要为第一个遮罩和最后一个遮罩的索引打标,被遮罩的本身在一个离屏canvas,遮罩的元素在另外一个 - if (offscreenFilter) { - var _j3 = _i4 + (_total5 || 0) + (_hasMask || 0); + if (offscreenMask) { + var _j2 = _i4 + (_total5 || 0); - var _list3 = offscreenHash[_j3] = offscreenHash[_j3] || []; + maskStartHash[_j2 + 1] = [_i4, _hasMask, offscreenMask]; + ctx = offscreenMask.target.ctx; + } // filter造成的离屏,需要将后续一段孩子节点区域的ctx替换,并在结束后应用结果,再替换回来 - _list3.push([_i4, _lv, OFFSCREEN_FILTER, offscreenFilter]); - ctx = offscreenFilter.target.ctx; - } // overflow:hidden的离屏,最后孩子进行截取 + if (offscreenFilter) { + var _j3 = _i4 + (_total5 || 0) + (_hasMask || 0); + var _list3 = offscreenHash[_j3] = offscreenHash[_j3] || []; - if (offscreenOverflow) { - var _j4 = _i4 + (_total5 || 0) + (_hasMask || 0); + _list3.push([_i4, _lv, OFFSCREEN_FILTER, offscreenFilter]); - var _list4 = offscreenHash[_j4] = offscreenHash[_j4] || []; + ctx = offscreenFilter.target.ctx; + } // overflow:hidden的离屏,最后孩子进行截取 - _list4.push([_i4, _lv, OFFSCREEN_OVERFLOW, offscreenOverflow]); - ctx = offscreenOverflow.target.ctx; - } + if (offscreenOverflow) { + var _j4 = _i4 + (_total5 || 0) + (_hasMask || 0); - if (_limitCache && _node3 instanceof Geom$1) { - _node3.render(renderMode, _refreshLevel, ctx); - } - } // 没内容的遮罩跳过,比如未加载的img,否则会将遮罩绘制出来 - else if (_hasMask) { - _i4 += (_total5 || 0) + _hasMask; - } // 同无cache一样的离屏应用 + var _list4 = offscreenHash[_j4] = offscreenHash[_j4] || []; + _list4.push([_i4, _lv, OFFSCREEN_OVERFLOW, offscreenOverflow]); - if (offscreenHash.hasOwnProperty(_i4)) { - ctx = applyOffscreen(ctx, offscreenHash[_i4], width, height); + ctx = offscreenOverflow.target.ctx; } - if (display === 'none') { - _i4 += (_total5 || 0) + (_hasMask || 0); + if (_limitCache && _node3 instanceof Geom) { + _node3.render(renderMode, _refreshLevel, ctx); } + } // 没内容的遮罩跳过,比如未加载的img,否则会将遮罩绘制出来 + else if (_hasMask) { + _i4 += (_total5 || 0) + _hasMask; + } // 同无cache一样的离屏应用 + + + if (offscreenHash.hasOwnProperty(_i4)) { + ctx = applyOffscreen(ctx, offscreenHash[_i4], width, height); } + + if (display === 'none') { + _i4 += (_total5 || 0) + (_hasMask || 0); + } + } } } } @@ -29718,11 +29724,11 @@ function renderCanvas(renderMode, ctx, root) { for (var i = 0, len = __structs.length; i < len; i++) { var _structs$i4 = __structs[i], node = _structs$i4[STRUCT_NODE$1], - lv = _structs$i4[STRUCT_LV$2], + lv = _structs$i4[STRUCT_LV], total = _structs$i4[STRUCT_TOTAL$1], - hasMask = _structs$i4[STRUCT_HAS_MASK$1]; + hasMask = _structs$i4[STRUCT_HAS_MASK]; var _node$__config = node.__config, - computedStyle = _node$__config[NODE_COMPUTED_STYLE$4], + computedStyle = _node$__config[NODE_COMPUTED_STYLE$1], refreshLevel = _node$__config[NODE_REFRESH_LV$1]; // 遮罩对象申请了个离屏,其第一个mask申请另外一个离屏mask2,开始聚集所有mask元素的绘制, // 这是一个十分特殊的逻辑,保存的index是最后一个节点的索引,OFFSCREEN_MASK2是最低优先级, // 这样当mask本身有filter时优先自身,然后才是OFFSCREEN_MASK2 @@ -29813,7 +29819,7 @@ function renderCanvas(renderMode, ctx, root) { } // render后判断可见状态,此时computedStyle才有值,以及svg的virtualDom也要生成 - if (computedStyle[DISPLAY$9] === 'none') { + if (computedStyle[DISPLAY$1] === 'none') { i += (total || 0) + (hasMask || 0); } } @@ -29832,12 +29838,12 @@ function renderSvg(renderMode, ctx, root, isFirst) { var _structs$i5 = __structs[i], node = _structs$i5[STRUCT_NODE$1], total = _structs$i5[STRUCT_TOTAL$1], - hasMask = _structs$i5[STRUCT_HAS_MASK$1]; + hasMask = _structs$i5[STRUCT_HAS_MASK]; var _node$__config2 = node.__config, refreshLevel = _node$__config2[NODE_REFRESH_LV$1], - defsCache = _node$__config2[NODE_DEFS_CACHE$6]; // 只要涉及到matrix和opacity就影响mask + defsCache = _node$__config2[NODE_DEFS_CACHE]; // 只要涉及到matrix和opacity就影响mask - var hasEffectMask = hasMask && (refreshLevel >= REPAINT$2 || contain$2(refreshLevel, TRANSFORM_ALL$1 | OP)); + var hasEffectMask = hasMask && (refreshLevel >= REPAINT$1 || contain$1(refreshLevel, TRANSFORM_ALL | OP)); if (hasEffectMask) { var start = i + (total || 0) + 1; @@ -29847,22 +29853,22 @@ function renderSvg(renderMode, ctx, root, isFirst) { } // >=REPAINT重绘生成走render()跳过这里 - if (refreshLevel < REPAINT$2) { + if (refreshLevel < REPAINT$1) { // 特殊的mask判断,遮罩对象影响这个mask了,除去filter、遮罩对象无TRANSFORM变化外都可缓存 if (maskEffectHash.hasOwnProperty(i)) { var v = maskEffectHash[i]; - if (!contain$2(refreshLevel, TRANSFORM_ALL$1) && v < REPAINT$2 && !contain$2(v, TRANSFORM_ALL$1)) { + if (!contain$1(refreshLevel, TRANSFORM_ALL) && v < REPAINT$1 && !contain$1(v, TRANSFORM_ALL)) { defsCache.forEach(function (item) { ctx.addCache(item); }); } } // 去除特殊的filter,普通节点或不影响的mask在 lastLv) { - matrixList.push(lastConfig[NODE_MATRIX$3]); - var vd = lastConfig[NODE_VIRTUAL_DOM$2]; + matrixList.push(lastConfig[NODE_MATRIX]); + var vd = lastConfig[NODE_VIRTUAL_DOM]; vdList.push(vd); parentVd = vd; } @@ -29921,18 +29927,18 @@ function renderSvg(renderMode, ctx, root, isFirst) { lastConfig = __config; var virtualDom = void 0; // svg小刷新等级时直接修改vd,这样Geom不再感知 - if (_refreshLevel2 < REPAINT$2 && !(_node4 instanceof Text)) { - __config[NODE_REFRESH_LV$1] = NONE$2; - virtualDom = __config[NODE_VIRTUAL_DOM$2]; // total可以跳过所有孩子节点省略循环 + if (_refreshLevel2 < REPAINT$1 && !(_node4 instanceof Text)) { + __config[NODE_REFRESH_LV$1] = NONE$1; + virtualDom = __config[NODE_VIRTUAL_DOM]; // total可以跳过所有孩子节点省略循环 if (__cacheTotal && __cacheTotal.available) { _i5 += _total8 || 0; virtualDom.cache = true; } else { __cacheTotal && (__cacheTotal.available = true); - virtualDom = __config[NODE_VIRTUAL_DOM$2] = _node4.__virtualDom = util.extend({}, virtualDom); // dom要清除children缓存,geom和img无需 + virtualDom = __config[NODE_VIRTUAL_DOM] = _node4.__virtualDom = util.extend({}, virtualDom); // dom要清除children缓存,geom和img无需 - if (_node4 instanceof Dom$1 && !(_node4 instanceof Img$1)) { + if (_node4 instanceof Dom && !(_node4 instanceof Img)) { virtualDom.children = []; } // 还得判断,和img加载混在一起时,触发刷新如果display:none,则还有cacheTotal @@ -29948,34 +29954,34 @@ function renderSvg(renderMode, ctx, root, isFirst) { } } - var currentStyle = __config[NODE_CURRENT_STYLE$5], - _computedStyle = __config[NODE_COMPUTED_STYLE$4], + var currentStyle = __config[NODE_CURRENT_STYLE$1], + _computedStyle = __config[NODE_COMPUTED_STYLE$1], __cacheStyle = __config[NODE_CACHE_STYLE$1]; - if (contain$2(_refreshLevel2, TRANSFORM_ALL$1)) { + if (contain$1(_refreshLevel2, TRANSFORM_ALL)) { var matrix = _node4.__calMatrix(_refreshLevel2, __cacheStyle, currentStyle, _computedStyle, __config); // 恶心的v8性能优化 - var m = __config[NODE_MATRIX$3]; + var m = __config[NODE_MATRIX]; util.assignMatrix(m, matrix); - if (!matrix || isE$3(matrix)) { + if (!matrix || isE(matrix)) { delete virtualDom.transform; } else { virtualDom.transform = 'matrix(' + util.joinArr(mx.m2m6(matrix), ',') + ')'; } if (parentMatrix && matrix) { - matrix = multiply$2(parentMatrix, matrix); + matrix = multiply(parentMatrix, matrix); } // 恶心的v8性能优化 - m = __config[NODE_MATRIX_EVENT$4]; + m = __config[NODE_MATRIX_EVENT]; util.assignMatrix(m, matrix); } - if (contain$2(_refreshLevel2, OP)) { - var opacity = _computedStyle[OPACITY$5] = currentStyle[OPACITY$5]; + if (contain$1(_refreshLevel2, OP)) { + var opacity = _computedStyle[OPACITY] = currentStyle[OPACITY]; if (opacity === 1) { delete virtualDom.opacity; @@ -29984,7 +29990,7 @@ function renderSvg(renderMode, ctx, root, isFirst) { } } - if (contain$2(_refreshLevel2, FT)) { + if (contain$1(_refreshLevel2, FT)) { var filter = _node4.__calFilter(currentStyle, _computedStyle); var s = painter.svgFilter(filter); @@ -29996,11 +30002,11 @@ function renderSvg(renderMode, ctx, root, isFirst) { } } - if (contain$2(_refreshLevel2, MBM)) { - var mixBlendMode = _computedStyle[MIX_BLEND_MODE$3] = currentStyle[MIX_BLEND_MODE$3]; + if (contain$1(_refreshLevel2, MBM)) { + var mixBlendMode = _computedStyle[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE]; - if (isValidMbm$2(mixBlendMode)) { - virtualDom.mixBlendMode = mbmName$2(mixBlendMode); + if (isValidMbm(mixBlendMode)) { + virtualDom.mixBlendMode = mbmName(mixBlendMode); } else { delete virtualDom.mixBlendMode; } @@ -30009,13 +30015,13 @@ function renderSvg(renderMode, ctx, root, isFirst) { virtualDom.lv = _refreshLevel2; } else { // >=REPAINT会调用render,重新生成defsCache,text没有这个东西 - __config[NODE_DEFS_CACHE$6] && __config[NODE_DEFS_CACHE$6].splice(0); + __config[NODE_DEFS_CACHE] && __config[NODE_DEFS_CACHE].splice(0); _node4.render(renderMode, _refreshLevel2, ctx); - virtualDom = __config[NODE_VIRTUAL_DOM$2]; // 渲染后更新取值 + virtualDom = __config[NODE_VIRTUAL_DOM]; // 渲染后更新取值 - display = computedStyle[DISPLAY$9]; + display = computedStyle[DISPLAY$1]; if (display === 'none') { _i5 += _total8 || 0; @@ -30032,7 +30038,7 @@ function renderSvg(renderMode, ctx, root, isFirst) { */ - if (maskHash.hasOwnProperty(_i5) && (maskEffectHash.hasOwnProperty(_i5) || _refreshLevel2 >= REPAINT$2 || contain$2(_refreshLevel2, TRANSFORM_ALL$1 | OP))) { + if (maskHash.hasOwnProperty(_i5) && (maskEffectHash.hasOwnProperty(_i5) || _refreshLevel2 >= REPAINT$1 || contain$1(_refreshLevel2, TRANSFORM_ALL | OP))) { var _maskHash$_i = maskHash[_i5], index = _maskHash$_i.index, _start2 = _maskHash$_i.start, @@ -30053,9 +30059,9 @@ function renderSvg(renderMode, ctx, root, isFirst) { for (var j = _start2; j < _end2; j++) { var _node5 = __structs[j][STRUCT_NODE$1]; var _node5$computedStyle = _node5.computedStyle, - _display = _node5$computedStyle[DISPLAY$9], - visibility = _node5$computedStyle[VISIBILITY$6], - fill = _node5$computedStyle[FILL$2], + _display = _node5$computedStyle[DISPLAY$1], + visibility = _node5$computedStyle[VISIBILITY$1], + fill = _node5$computedStyle[FILL], _node5$virtualDom = _node5.virtualDom, children = _node5$virtualDom.children, _opacity3 = _node5$virtualDom.opacity; @@ -30082,8 +30088,8 @@ function renderSvg(renderMode, ctx, root, isFirst) { } var _matrix = _node5.matrix; - var ivs = inverse$1(dom.matrix); - _matrix = multiply$2(ivs, _matrix); // path没有transform属性,在vd上,需要弥补 + var ivs = inverse(dom.matrix); + _matrix = multiply(ivs, _matrix); // path没有transform属性,在vd上,需要弥补 props.push(['transform', "matrix(".concat(util.joinArr(mx.m2m6(_matrix), ','), ")")]); // path没有opacity属性,在vd上,需要弥补 @@ -30092,32 +30098,32 @@ function renderSvg(renderMode, ctx, root, isFirst) { } } // img可能有matrix属性,需判断 else if (tagName === 'image') { - var hasTransform = -1; + var hasTransform = -1; - for (var _m2 = 0, _len6 = props.length; _m2 < _len6; _m2++) { - if (props[_m2][0] === 'transform') { - hasTransform = _m2; - break; - } + for (var _m2 = 0, _len6 = props.length; _m2 < _len6; _m2++) { + if (props[_m2][0] === 'transform') { + hasTransform = _m2; + break; } + } - if (hasTransform === -1) { - var _ivs = inverse$1(dom.matrix); + if (hasTransform === -1) { + var _ivs = inverse(dom.matrix); - if (!isE$3(_ivs)) { - props.push(['transform', "matrix(".concat(util.joinArr(mx.m2m6(_ivs), ','), ")")]); - } - } else { - var _matrix2 = props[hasTransform][1].match(/[\d.]+/g).map(function (i) { - return parseFloat(i); - }); + if (!isE(_ivs)) { + props.push(['transform', "matrix(".concat(util.joinArr(mx.m2m6(_ivs), ','), ")")]); + } + } else { + var _matrix2 = props[hasTransform][1].match(/[\d.]+/g).map(function (i) { + return parseFloat(i); + }); - var _ivs2 = inverse$1(dom.matrix); + var _ivs2 = inverse(dom.matrix); - _matrix2 = multiply$2(_ivs2, _matrix2); - props[hasTransform][1] = "matrix(".concat(util.joinArr(mx.m2m6(_matrix2), ','), ")"); - } + _matrix2 = multiply(_ivs2, _matrix2); + props[hasTransform][1] = "matrix(".concat(util.joinArr(mx.m2m6(_matrix2), ','), ")"); } + } } } } // 清掉上次的 @@ -30150,7 +30156,7 @@ function renderSvg(renderMode, ctx, root, isFirst) { } if (_i5 === 0) { - parentMatrix = __config[NODE_MATRIX$3]; + parentMatrix = __config[NODE_MATRIX]; parentVd = virtualDom; } @@ -30189,12 +30195,12 @@ function renderWebgl(renderMode, gl, root) { for (var i = 0, len = __structs.length; i < len; i++) { var _structs$i6 = __structs[i], node = _structs$i6[STRUCT_NODE$1], - lv = _structs$i6[STRUCT_LV$2], + lv = _structs$i6[STRUCT_LV], total = _structs$i6[STRUCT_TOTAL$1], - hasMask = _structs$i6[STRUCT_HAS_MASK$1]; // Text特殊处理,webgl中先渲染为bitmap,再作为贴图绘制,缓存交由text内部判断,直接调用渲染纹理方法 + hasMask = _structs$i6[STRUCT_HAS_MASK]; // Text特殊处理,webgl中先渲染为bitmap,再作为贴图绘制,缓存交由text内部判断,直接调用渲染纹理方法 if (node instanceof Text) { - if (lastRefreshLevel >= REPAINT$2) { + if (lastRefreshLevel >= REPAINT$1) { node.render(renderMode, 0, gl, true); } @@ -30205,40 +30211,41 @@ function renderWebgl(renderMode, gl, root) { var refreshLevel = __config[NODE_REFRESH_LV$1]; // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,Root节点是第一个特殊处理 if (i === 0) ; else if (lv > lastLv) { - parentMatrix = lastConfig[NODE_MATRIX_EVENT$4]; + parentMatrix = lastConfig[NODE_MATRIX_EVENT]; - if (isE$3(parentMatrix)) { + if (isE(parentMatrix)) { parentMatrix = null; } matrixList.push(parentMatrix); - parentOpacity = lastConfig[NODE_OPACITY$3]; + parentOpacity = lastConfig[NODE_OPACITY]; opacityList.push(parentOpacity); - parentPm = lastConfig[NODE_PERSPECTIVE_MATRIX$1]; + parentPm = lastConfig[NODE_PERSPECTIVE_MATRIX]; - if (isE$3(parentPm)) { + if (isE(parentPm)) { parentPm = null; } pmList.push(parentPm); } // 变小出栈索引需注意,可能不止一层,多层计算diff层级 else if (lv < lastLv) { - var diff = lastLv - lv; - matrixList.splice(-diff); - parentMatrix = matrixList[lv - 1]; - opacityList.splice(-diff); - parentOpacity = opacityList[lv - 1]; - pmList.splice(-diff); - parentPm = pmList[lv - 1]; - } + var diff = lastLv - lv; + matrixList.splice(-diff); + parentMatrix = matrixList[lv - 1]; + opacityList.splice(-diff); + parentOpacity = opacityList[lv - 1]; + pmList.splice(-diff); + parentPm = pmList[lv - 1]; + } // 不变是同级兄弟,无需特殊处理 + else ; lastRefreshLevel = refreshLevel; lastConfig = __config; lastLv = lv; var __cacheTotal = __config[NODE_CACHE_TOTAL$1], - computedStyle = __config[NODE_COMPUTED_STYLE$4]; // 跳过display:none元素和它的所有子节点 + computedStyle = __config[NODE_COMPUTED_STYLE$1]; // 跳过display:none元素和它的所有子节点 - if (computedStyle[DISPLAY$9] === 'none') { + if (computedStyle[DISPLAY$1] === 'none') { i += total || 0; // 只跳过自身不能跳过后面的mask,mask要渲染自身并进行缓存cache,以备对象切换display用 continue; @@ -30253,8 +30260,8 @@ function renderWebgl(renderMode, gl, root) { * 如果没有或无效,直接添加,无视节点本身变化,后面防重即可 */ - if (refreshLevel < REPAINT$2) { - __config[NODE_REFRESH_LV$1] = NONE$2; + if (refreshLevel < REPAINT$1) { + __config[NODE_REFRESH_LV$1] = NONE$1; if (hasMask) { var cacheMask = __config[NODE_CACHE_MASK$1]; @@ -30265,24 +30272,24 @@ function renderWebgl(renderMode, gl, root) { } } - var currentStyle = __config[NODE_CURRENT_STYLE$5], + var currentStyle = __config[NODE_CURRENT_STYLE$1], __cacheStyle = __config[NODE_CACHE_STYLE$1], - matrixEvent = __config[NODE_MATRIX_EVENT$4]; + matrixEvent = __config[NODE_MATRIX_EVENT]; - if (contain$2(refreshLevel, PPT)) { + if (contain$1(refreshLevel, PPT)) { node.__calPerspective(__cacheStyle, currentStyle, computedStyle, __config); } // transform变化,父元素的perspective变化也会在Root特殊处理重新计算 var matrix = void 0; - if (contain$2(refreshLevel, TRANSFORM_ALL$1)) { + if (contain$1(refreshLevel, TRANSFORM_ALL)) { matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config); // 恶心的v8性能优化 - var m = __config[NODE_MATRIX$3]; + var m = __config[NODE_MATRIX]; util.assignMatrix(m, matrix); } else { - matrix = __config[NODE_MATRIX$3]; + matrix = __config[NODE_MATRIX]; } // node本身有或者父有perspective都认为需要生成3d渲染上下文 @@ -30296,31 +30303,31 @@ function renderWebgl(renderMode, gl, root) { if (parentPm) { - matrix = multiply$2(parentPm, matrix); + matrix = multiply(parentPm, matrix); } if (parentMatrix) { - matrix = multiply$2(parentMatrix, matrix); + matrix = multiply(parentMatrix, matrix); } // 恶心的v8性能优化 util.assignMatrix(matrixEvent, matrix); var opacity = void 0; - if (contain$2(refreshLevel, OP)) { - opacity = computedStyle[OPACITY$5] = currentStyle[OPACITY$5]; + if (contain$1(refreshLevel, OP)) { + opacity = computedStyle[OPACITY] = currentStyle[OPACITY]; } else { - opacity = computedStyle[OPACITY$5]; + opacity = computedStyle[OPACITY]; } - __config[NODE_OPACITY$3] = parentOpacity * opacity; // filter会改变bbox范围 + __config[NODE_OPACITY] = parentOpacity * opacity; // filter会改变bbox范围 - if (contain$2(refreshLevel, FT)) { + if (contain$1(refreshLevel, FT)) { node.__bbox = null; var _filter3 = node.__calFilter(currentStyle, computedStyle); - var __cacheFilter = __config[NODE_CACHE_FILTER$2]; + var __cacheFilter = __config[NODE_CACHE_FILTER$1]; if (__cacheFilter) { __cacheFilter.release(); @@ -30336,8 +30343,8 @@ function renderWebgl(renderMode, gl, root) { } } - if (contain$2(refreshLevel, MBM)) { - computedStyle[MIX_BLEND_MODE$3] = currentStyle[MIX_BLEND_MODE$3]; + if (contain$1(refreshLevel, MBM)) { + computedStyle[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE]; } // total可以跳过所有孩子节点省略循环,filter/mask等的强制前提是有total @@ -30351,27 +30358,27 @@ function renderWebgl(renderMode, gl, root) { * Geom没有子节点无需汇总局部根,Dom中Img也是,它们的局部根等于自身的cache,其它符合条件的Dom需要生成 */ else { - var res = node.render(renderMode, refreshLevel, gl, true); // geom可返回texture纹理,替代原有xom的__cache纹理 + var res = node.render(renderMode, refreshLevel, gl, true); // geom可返回texture纹理,替代原有xom的__cache纹理 - if (res && inject.isWebGLTexture(res.texture)) { - var sx1 = node.__sx1, - sy1 = node.__sy1, - w = node.offsetWidth, - h = node.offsetHeight, - bbox = node.bbox; - __config[NODE_CACHE$4] = new MockCache(gl, res.texture, sx1, sy1, w, h, bbox); - gl.viewport(0, 0, width, height); - gl.useProgram(gl.program); - } - } // 每个元素检查cacheTotal生成,已有的上面会continue跳过 + if (res && inject.isWebGLTexture(res.texture)) { + var sx1 = node.__sx1, + sy1 = node.__sy1, + w = node.offsetWidth, + h = node.offsetHeight, + bbox = node.bbox; + __config[NODE_CACHE$1] = new MockCache(gl, res.texture, sx1, sy1, w, h, bbox); + gl.viewport(0, 0, width, height); + gl.useProgram(gl.program); + } + } // 每个元素检查cacheTotal生成,已有的上面会continue跳过 - var limitCache = __config[NODE_LIMIT_CACHE$2]; - var overflow = computedStyle[OVERFLOW$3], - filter = computedStyle[FILTER$5], - mixBlendMode = computedStyle[MIX_BLEND_MODE$3], - transform = computedStyle[TRANSFORM$4]; - var validMbm = isValidMbm$2(mixBlendMode); // 3d渲染上下文 + var limitCache = __config[NODE_LIMIT_CACHE]; + var overflow = computedStyle[OVERFLOW], + filter = computedStyle[FILTER$1], + mixBlendMode = computedStyle[MIX_BLEND_MODE], + transform = computedStyle[TRANSFORM]; + var validMbm = isValidMbm(mixBlendMode); // 3d渲染上下文 var isPerspective = tf.isPerspectiveMatrix(transform) || parentPm; @@ -30413,11 +30420,11 @@ function renderWebgl(renderMode, gl, root) { filter = _item6[7], overflow = _item6[8]; - var __cache = __config[NODE_CACHE$4], + var __cache = __config[NODE_CACHE$1], __cacheTotal = __config[NODE_CACHE_TOTAL$1], - __cacheFilter = __config[NODE_CACHE_FILTER$2], + __cacheFilter = __config[NODE_CACHE_FILTER$1], __cacheMask = __config[NODE_CACHE_MASK$1], - __cacheOverflow = __config[NODE_CACHE_OVERFLOW$2]; + __cacheOverflow = __config[NODE_CACHE_OVERFLOW$1]; var needGen; // 可能没变化,比如被遮罩节点、filter变更等 if (!__cacheTotal || !__cacheTotal.available) { @@ -30444,7 +30451,7 @@ function renderWebgl(renderMode, gl, root) { needGen = true; if (!limitCache) { - __config[NODE_CACHE_FILTER$2] = target; + __config[NODE_CACHE_FILTER$1] = target; } } } @@ -30458,7 +30465,7 @@ function renderWebgl(renderMode, gl, root) { needGen = true; if (!limitCache) { - __config[NODE_CACHE_FILTER$2] = target; + __config[NODE_CACHE_FILTER$1] = target; } } } @@ -30502,52 +30509,52 @@ function renderWebgl(renderMode, gl, root) { var _structs$_i4 = __structs[_i7], _node6 = _structs$_i4[STRUCT_NODE$1], _total9 = _structs$_i4[STRUCT_TOTAL$1], - _hasMask3 = _structs$_i4[STRUCT_HAS_MASK$1]; + _hasMask3 = _structs$_i4[STRUCT_HAS_MASK]; var _config5 = _node6.__config; // text如果display不可见,parent会直接跳过,不会走到这里,这里一定是直接绘制到root的,visibility在其内部判断 if (_node6 instanceof Text) { // text特殊之处,__config部分是复用parent的 - var __cache = _config5[NODE_CACHE$4], - _limitCache2 = _config5[NODE_LIMIT_CACHE$2], - _config5$NODE_DOM_PAR = _config5[NODE_DOM_PARENT$5].__config, - _matrixEvent3 = _config5$NODE_DOM_PAR[NODE_MATRIX_EVENT$4], - _opacity4 = _config5$NODE_DOM_PAR[NODE_OPACITY$3]; + var __cache = _config5[NODE_CACHE$1], + _limitCache2 = _config5[NODE_LIMIT_CACHE], + _config5$NODE_DOM_PAR = _config5[NODE_DOM_PARENT$1].__config, + _matrixEvent3 = _config5$NODE_DOM_PAR[NODE_MATRIX_EVENT], + _opacity4 = _config5$NODE_DOM_PAR[NODE_OPACITY]; if (__cache && __cache.available) { texCache.addTexAndDrawWhenLimit(gl, __cache, _opacity4, _matrixEvent3, cx, cy, 0, 0, true); } // 超限特殊处理,先生成画布尺寸大小的纹理然后原始位置绘制 else if (_limitCache2) { - var c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__'); + var c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__'); - _node6.render(renderMode, 0, gl); + _node6.render(renderMode, 0, gl); - var j = texCache.lockOneChannel(); + var j = texCache.lockOneChannel(); - var _texture2 = webgl.createTexture(gl, c.canvas, j); + var _texture2 = webgl.createTexture(gl, c.canvas, j); - var mockCache = new MockCache(gl, _texture2, 0, 0, width, height, [0, 0, width, height]); - texCache.addTexAndDrawWhenLimit(gl, mockCache, _opacity4, _matrixEvent3, cx, cy, 0, 0, true); - texCache.refresh(gl, cx, cy, true); - c.ctx.setTransform(1, 0, 0, 1, 0, 0); - c.ctx.globalAlpha = 1; - c.ctx.clearRect(0, 0, width, height); - mockCache.release(); - texCache.releaseLockChannel(j); - } + var mockCache = new MockCache(gl, _texture2, 0, 0, width, height, [0, 0, width, height]); + texCache.addTexAndDrawWhenLimit(gl, mockCache, _opacity4, _matrixEvent3, cx, cy, 0, 0, true); + texCache.refresh(gl, cx, cy, true); + c.ctx.setTransform(1, 0, 0, 1, 0, 0); + c.ctx.globalAlpha = 1; + c.ctx.clearRect(0, 0, width, height); + mockCache.release(); + texCache.releaseLockChannel(j); + } } else { - var _opacity5 = _config5[NODE_OPACITY$3], - _matrixEvent4 = _config5[NODE_MATRIX_EVENT$4], - _limitCache3 = _config5[NODE_LIMIT_CACHE$2], - _cache = _config5[NODE_CACHE$4], + var _opacity5 = _config5[NODE_OPACITY], + _matrixEvent4 = _config5[NODE_MATRIX_EVENT], + _limitCache3 = _config5[NODE_LIMIT_CACHE], + _cache = _config5[NODE_CACHE$1], _cacheTotal2 = _config5[NODE_CACHE_TOTAL$1], - _cacheFilter2 = _config5[NODE_CACHE_FILTER$2], + _cacheFilter2 = _config5[NODE_CACHE_FILTER$1], __cacheMask = _config5[NODE_CACHE_MASK$1], - __cacheOverflow = _config5[NODE_CACHE_OVERFLOW$2], + __cacheOverflow = _config5[NODE_CACHE_OVERFLOW$1], _refreshLevel3 = _config5[NODE_REFRESH_LV$1], - _config5$NODE_COMPUTE = _config5[NODE_COMPUTED_STYLE$4], - display = _config5$NODE_COMPUTE[DISPLAY$9], - visibility = _config5$NODE_COMPUTE[VISIBILITY$6], - _mixBlendMode2 = _config5$NODE_COMPUTE[MIX_BLEND_MODE$3]; + _config5$NODE_COMPUTE = _config5[NODE_COMPUTED_STYLE$1], + display = _config5$NODE_COMPUTE[DISPLAY$1], + visibility = _config5$NODE_COMPUTE[VISIBILITY$1], + _mixBlendMode2 = _config5$NODE_COMPUTE[MIX_BLEND_MODE]; if (display === 'none') { _i7 += (_total9 || 0) + (_hasMask3 || 0); @@ -30562,7 +30569,7 @@ function renderWebgl(renderMode, gl, root) { if (target) { // 有mbm先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成 - if (hasMbm && isValidMbm$2(_mixBlendMode2)) { + if (hasMbm && isValidMbm(_mixBlendMode2)) { texCache.refresh(gl, cx, cy, true); var _genFrameBufferWithTe19 = genFrameBufferWithTexture(gl, texCache, width, height), @@ -30574,7 +30581,7 @@ function renderWebgl(renderMode, gl, root) { texCache.addTexAndDrawWhenLimit(gl, target, _opacity5, _matrixEvent4, cx, cy, 0, 0, true); texCache.refresh(gl, cx, cy, true); // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前画布作为绘制对象 - var _genMbmWebgl3 = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName$2(_mixBlendMode2), width, height); + var _genMbmWebgl3 = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(_mixBlendMode2), width, height); var _genMbmWebgl4 = _slicedToArray(_genMbmWebgl3, 3); @@ -30593,7 +30600,7 @@ function renderWebgl(renderMode, gl, root) { } else if (limitHash.hasOwnProperty(_i7)) { var _target5 = limitHash[_i7]; - if (hasMbm && isValidMbm$2(_mixBlendMode2)) { + if (hasMbm && isValidMbm(_mixBlendMode2)) { texCache.refresh(gl, cx, cy, true); var _genFrameBufferWithTe21 = genFrameBufferWithTexture(gl, texCache, width, height), @@ -30605,7 +30612,7 @@ function renderWebgl(renderMode, gl, root) { texCache.addTexAndDrawWhenLimit(gl, _target5, _opacity5, _matrixEvent4, cx, cy, 0, 0, true); texCache.refresh(gl, cx, cy, true); // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前画布作为绘制对象 - var _genMbmWebgl5 = genMbmWebgl(gl, texCache, n, _n, frameBuffer, texture, mbmName$2(_mixBlendMode2), width, height); + var _genMbmWebgl5 = genMbmWebgl(gl, texCache, n, _n, frameBuffer, texture, mbmName(_mixBlendMode2), width, height); var _genMbmWebgl6 = _slicedToArray(_genMbmWebgl5, 3); @@ -30622,30 +30629,30 @@ function renderWebgl(renderMode, gl, root) { } // 超限的情况,这里是普通单节点超限,没有合成total后再合成特殊cache如filter/mask/mbm之类的, // 直接按原始位置绘制到离屏canvas,再作为纹理绘制即可,特殊的在total那做过降级了 else if (_limitCache3 && display !== 'none' && visibility !== 'hidden') { - // let m = mx.m2Mat4(matrixEvent, cx, cy); - var _c5 = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__'); + // let m = mx.m2Mat4(matrixEvent, cx, cy); + var _c5 = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__'); - _node6.render(renderMode, _refreshLevel3, gl); + _node6.render(renderMode, _refreshLevel3, gl); - var _j10 = texCache.lockOneChannel(); + var _j10 = texCache.lockOneChannel(); - var _texture4 = webgl.createTexture(gl, _c5.canvas, _j10); + var _texture4 = webgl.createTexture(gl, _c5.canvas, _j10); - var _mockCache2 = new MockCache(gl, _texture4, 0, 0, width, height, [0, 0, width, height]); + var _mockCache2 = new MockCache(gl, _texture4, 0, 0, width, height, [0, 0, width, height]); - texCache.addTexAndDrawWhenLimit(gl, _mockCache2, _opacity5, _matrixEvent4, cx, cy, 0, 0, true); - texCache.refresh(gl, cx, cy, true); + texCache.addTexAndDrawWhenLimit(gl, _mockCache2, _opacity5, _matrixEvent4, cx, cy, 0, 0, true); + texCache.refresh(gl, cx, cy, true); - _c5.ctx.setTransform(1, 0, 0, 1, 0, 0); + _c5.ctx.setTransform(1, 0, 0, 1, 0, 0); - _c5.ctx.globalAlpha = 1; + _c5.ctx.globalAlpha = 1; - _c5.ctx.clearRect(0, 0, width, height); + _c5.ctx.clearRect(0, 0, width, height); - _mockCache2.release(); + _mockCache2.release(); - texCache.releaseLockChannel(_j10); - } + texCache.releaseLockChannel(_j10); + } } } @@ -30766,16 +30773,16 @@ var TexCache = /*#__PURE__*/function () { list.push([cache, opacity, matrix, dx, dy]); } // 找不到说明是新的纹理贴图,此时看是否超过纹理单元限制,超过则刷新绘制并清空,然后/否则 存入纹理列表 else { - i = pages.length; - - if (i >= this.__units - this.__lockUnits) { - // 绘制且清空,队列索引重新为0 - this.refresh(gl, cx, cy, revertY); - } + i = pages.length; - pages.push(page); - list.push([cache, opacity, matrix, dx, dy]); + if (i >= this.__units - this.__lockUnits) { + // 绘制且清空,队列索引重新为0 + this.refresh(gl, cx, cy, revertY); } + + pages.push(page); + list.push([cache, opacity, matrix, dx, dy]); + } } /** * 刷新 @@ -31029,85 +31036,85 @@ 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$5 = _enums$STYLE_KEY$j.POSITION, - DISPLAY$a = _enums$STYLE_KEY$j.DISPLAY, - VISIBILITY$7 = _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$4 = _enums$STYLE_KEY$j.MARGIN_TOP, - MARGIN_LEFT$6 = _enums$STYLE_KEY$j.MARGIN_LEFT, - MARGIN_BOTTOM$4 = _enums$STYLE_KEY$j.MARGIN_BOTTOM, - PADDING_TOP$5 = _enums$STYLE_KEY$j.PADDING_TOP, - PADDING_LEFT$7 = _enums$STYLE_KEY$j.PADDING_LEFT, - PADDING_BOTTOM$5 = _enums$STYLE_KEY$j.PADDING_BOTTOM, - BORDER_TOP_WIDTH$6 = _enums$STYLE_KEY$j.BORDER_TOP_WIDTH, - BORDER_LEFT_WIDTH$8 = _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, - _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, - UPDATE_ADD_DOM$1 = _enums$UPDATE_KEY$5.UPDATE_ADD_DOM, - UPDATE_REMOVE_DOM$1 = _enums$UPDATE_KEY$5.UPDATE_REMOVE_DOM, - _enums$NODE_KEY$a = enums.NODE_KEY, - NODE_TAG_NAME$1 = _enums$NODE_KEY$a.NODE_TAG_NAME, - NODE_CACHE_STYLE$2 = _enums$NODE_KEY$a.NODE_CACHE_STYLE, - NODE_CACHE_PROPS$1 = _enums$NODE_KEY$a.NODE_CACHE_PROPS, - NODE_CURRENT_STYLE$6 = _enums$NODE_KEY$a.NODE_CURRENT_STYLE, - NODE_COMPUTED_STYLE$5 = _enums$NODE_KEY$a.NODE_COMPUTED_STYLE, - NODE_CURRENT_PROPS$1 = _enums$NODE_KEY$a.NODE_CURRENT_PROPS, - NODE_DOM_PARENT$6 = _enums$NODE_KEY$a.NODE_DOM_PARENT, - NODE_IS_MASK$3 = _enums$NODE_KEY$a.NODE_IS_MASK, - NODE_REFRESH_LV$2 = _enums$NODE_KEY$a.NODE_REFRESH_LV, - NODE_IS_DESTROYED$2 = _enums$NODE_KEY$a.NODE_IS_DESTROYED, - NODE_STYLE$5 = _enums$NODE_KEY$a.NODE_STYLE, - NODE_UPDATE_HASH = _enums$NODE_KEY$a.NODE_UPDATE_HASH, - NODE_UNIQUE_UPDATE_ID = _enums$NODE_KEY$a.NODE_UNIQUE_UPDATE_ID, - NODE_CACHE$5 = _enums$NODE_KEY$a.NODE_CACHE, - NODE_CACHE_TOTAL$2 = _enums$NODE_KEY$a.NODE_CACHE_TOTAL, - NODE_CACHE_FILTER$3 = _enums$NODE_KEY$a.NODE_CACHE_FILTER, - NODE_CACHE_OVERFLOW$3 = _enums$NODE_KEY$a.NODE_CACHE_OVERFLOW, - NODE_CACHE_MASK$2 = _enums$NODE_KEY$a.NODE_CACHE_MASK, - NODE_STRUCT$4 = _enums$NODE_KEY$a.NODE_STRUCT, - _enums$STRUCT_KEY$3 = enums.STRUCT_KEY, - STRUCT_INDEX$2 = _enums$STRUCT_KEY$3.STRUCT_INDEX, - STRUCT_TOTAL$2 = _enums$STRUCT_KEY$3.STRUCT_TOTAL, - STRUCT_NODE$2 = _enums$STRUCT_KEY$3.STRUCT_NODE; -var DIRECTION_HASH = (_DIRECTION_HASH = {}, _defineProperty(_DIRECTION_HASH, TOP$4, true), _defineProperty(_DIRECTION_HASH, RIGHT$2, true), _defineProperty(_DIRECTION_HASH, BOTTOM$4, true), _defineProperty(_DIRECTION_HASH, LEFT$2, true), _DIRECTION_HASH); -var isNil$8 = util.isNil, - isObject$2 = util.isObject, - isFunction$7 = util.isFunction; -var AUTO$8 = o.AUTO, - PX$b = o.PX, - PERCENT$c = o.PERCENT, - INHERIT$5 = o.INHERIT; -var isRelativeOrAbsolute$2 = css.isRelativeOrAbsolute, - equalStyle$1 = css.equalStyle; -var contain$3 = o$3.contain, - getLevel = o$3.getLevel, - isRepaint = o$3.isRepaint, - NONE$3 = o$3.NONE, - FILTER$6 = o$3.FILTER, - PERSPECTIVE$5 = o$3.PERSPECTIVE, - REPAINT$3 = o$3.REPAINT, - REFLOW$2 = o$3.REFLOW, - REBUILD = o$3.REBUILD; +var _enums$STYLE_KEY$6 = enums.STYLE_KEY, + TOP = _enums$STYLE_KEY$6.TOP, + RIGHT = _enums$STYLE_KEY$6.RIGHT, + BOTTOM = _enums$STYLE_KEY$6.BOTTOM, + LEFT = _enums$STYLE_KEY$6.LEFT, + POSITION = _enums$STYLE_KEY$6.POSITION, + DISPLAY = _enums$STYLE_KEY$6.DISPLAY, + VISIBILITY = _enums$STYLE_KEY$6.VISIBILITY, + COLOR = _enums$STYLE_KEY$6.COLOR, + WIDTH = _enums$STYLE_KEY$6.WIDTH, + HEIGHT = _enums$STYLE_KEY$6.HEIGHT, + Z_INDEX = _enums$STYLE_KEY$6.Z_INDEX, + MARGIN_TOP = _enums$STYLE_KEY$6.MARGIN_TOP, + MARGIN_LEFT = _enums$STYLE_KEY$6.MARGIN_LEFT, + MARGIN_BOTTOM = _enums$STYLE_KEY$6.MARGIN_BOTTOM, + PADDING_TOP = _enums$STYLE_KEY$6.PADDING_TOP, + PADDING_LEFT = _enums$STYLE_KEY$6.PADDING_LEFT, + PADDING_BOTTOM = _enums$STYLE_KEY$6.PADDING_BOTTOM, + BORDER_TOP_WIDTH = _enums$STYLE_KEY$6.BORDER_TOP_WIDTH, + BORDER_LEFT_WIDTH = _enums$STYLE_KEY$6.BORDER_LEFT_WIDTH, + BORDER_BOTTOM_WIDTH = _enums$STYLE_KEY$6.BORDER_BOTTOM_WIDTH, + POINTER_EVENTS = _enums$STYLE_KEY$6.POINTER_EVENTS, + _enums$UPDATE_KEY = enums.UPDATE_KEY, + UPDATE_NODE = _enums$UPDATE_KEY.UPDATE_NODE, + UPDATE_STYLE = _enums$UPDATE_KEY.UPDATE_STYLE, + UPDATE_KEYS = _enums$UPDATE_KEY.UPDATE_KEYS, + UPDATE_COMPONENT = _enums$UPDATE_KEY.UPDATE_COMPONENT, + UPDATE_FOCUS = _enums$UPDATE_KEY.UPDATE_FOCUS, + UPDATE_MEASURE = _enums$UPDATE_KEY.UPDATE_MEASURE, + UPDATE_OVERWRITE = _enums$UPDATE_KEY.UPDATE_OVERWRITE, + UPDATE_LIST = _enums$UPDATE_KEY.UPDATE_LIST, + UPDATE_CONFIG = _enums$UPDATE_KEY.UPDATE_CONFIG, + UPDATE_ADD_DOM = _enums$UPDATE_KEY.UPDATE_ADD_DOM, + UPDATE_REMOVE_DOM = _enums$UPDATE_KEY.UPDATE_REMOVE_DOM, + _enums$NODE_KEY = enums.NODE_KEY, + NODE_TAG_NAME = _enums$NODE_KEY.NODE_TAG_NAME, + NODE_CACHE_STYLE = _enums$NODE_KEY.NODE_CACHE_STYLE, + NODE_CACHE_PROPS = _enums$NODE_KEY.NODE_CACHE_PROPS, + NODE_CURRENT_STYLE = _enums$NODE_KEY.NODE_CURRENT_STYLE, + NODE_COMPUTED_STYLE = _enums$NODE_KEY.NODE_COMPUTED_STYLE, + NODE_CURRENT_PROPS = _enums$NODE_KEY.NODE_CURRENT_PROPS, + NODE_DOM_PARENT = _enums$NODE_KEY.NODE_DOM_PARENT, + NODE_IS_MASK = _enums$NODE_KEY.NODE_IS_MASK, + NODE_REFRESH_LV = _enums$NODE_KEY.NODE_REFRESH_LV, + NODE_IS_DESTROYED = _enums$NODE_KEY.NODE_IS_DESTROYED, + NODE_STYLE = _enums$NODE_KEY.NODE_STYLE, + NODE_UPDATE_HASH = _enums$NODE_KEY.NODE_UPDATE_HASH, + NODE_UNIQUE_UPDATE_ID = _enums$NODE_KEY.NODE_UNIQUE_UPDATE_ID, + NODE_CACHE = _enums$NODE_KEY.NODE_CACHE, + NODE_CACHE_TOTAL = _enums$NODE_KEY.NODE_CACHE_TOTAL, + NODE_CACHE_FILTER = _enums$NODE_KEY.NODE_CACHE_FILTER, + NODE_CACHE_OVERFLOW = _enums$NODE_KEY.NODE_CACHE_OVERFLOW, + NODE_CACHE_MASK = _enums$NODE_KEY.NODE_CACHE_MASK, + NODE_STRUCT = _enums$NODE_KEY.NODE_STRUCT, + _enums$STRUCT_KEY = enums.STRUCT_KEY, + STRUCT_INDEX = _enums$STRUCT_KEY.STRUCT_INDEX, + STRUCT_TOTAL = _enums$STRUCT_KEY.STRUCT_TOTAL, + STRUCT_NODE = _enums$STRUCT_KEY.STRUCT_NODE; +var DIRECTION_HASH = (_DIRECTION_HASH = {}, _defineProperty(_DIRECTION_HASH, TOP, true), _defineProperty(_DIRECTION_HASH, RIGHT, true), _defineProperty(_DIRECTION_HASH, BOTTOM, true), _defineProperty(_DIRECTION_HASH, LEFT, true), _DIRECTION_HASH); +var isNil$7 = util.isNil, + isObject = util.isObject, + isFunction$1 = util.isFunction; +var AUTO = o$4.AUTO, + PX = o$4.PX, + PERCENT = o$4.PERCENT, + INHERIT = o$4.INHERIT; +var isRelativeOrAbsolute = css.isRelativeOrAbsolute, + equalStyle = css.equalStyle; +var contain = o$1.contain, + getLevel = o$1.getLevel, + isRepaint = o$1.isRepaint, + NONE = o$1.NONE, + FILTER = o$1.FILTER, + PERSPECTIVE = o$1.PERSPECTIVE, + REPAINT = o$1.REPAINT, + REFLOW = o$1.REFLOW, + REBUILD = o$1.REBUILD; var isIgnore = o$2.isIgnore, - isGeom$3 = o$2.isGeom, + isGeom = o$2.isGeom, isMeasure = o$2.isMeasure; var ROOT_DOM_NAME = { canvas: 'canvas', @@ -31187,18 +31194,18 @@ function removeEvent(dom, list) { function isFixedWidthOrHeight(node, k) { var c = node.currentStyle[k]; - return c[1] !== AUTO$8; + return c[1] !== AUTO; } // 除了固定尺寸,父级也不能是flex或变化flex function isFixedSize(node, includeParentFlex) { - var res = isFixedWidthOrHeight(node, WIDTH$8) && isFixedWidthOrHeight(node, HEIGHT$8); + var res = isFixedWidthOrHeight(node, WIDTH) && isFixedWidthOrHeight(node, HEIGHT); if (res && includeParentFlex) { var parent = node.domParent; if (parent) { - if (parent.currentStyle[DISPLAY$a] === 'flex' || parent.computedStyle[DISPLAY$a] === 'flex') { + if (parent.currentStyle[DISPLAY] === 'flex' || parent.computedStyle[DISPLAY] === 'flex') { return false; } } @@ -31241,13 +31248,13 @@ function setLAYOUT(node, hash, component, addDom) { function checkInfluence(root, reflowHash, node, component, addDom) { // add情况abs节点特殊对待不影响其它节点,不能判断display,因为inline会强制block - if (addDom && node.currentStyle[POSITION$5] === 'absolute') { + if (addDom && node.currentStyle[POSITION] === 'absolute') { return; } var target = node; // inline新老都影响,节点变为最近的父非inline - if (['inline', 'inlineBlock', 'inline-block'].indexOf(target.currentStyle[DISPLAY$a]) > -1 || ['inline', 'inlineBlock', 'inline-block'].indexOf(target.computedStyle[DISPLAY$a]) > -1) { + if (['inline', 'inlineBlock', 'inline-block'].indexOf(target.currentStyle[DISPLAY]) > -1 || ['inline', 'inlineBlock', 'inline-block'].indexOf(target.computedStyle[DISPLAY]) > -1) { do { target = target.domParent; // 父到root提前跳出 @@ -31261,11 +31268,11 @@ function checkInfluence(root, reflowHash, node, component, addDom) { } // 遇到absolute跳出,设置其布局;如果absolute不变化普通处理,如果absolute发生变化,一定会存在于列表中,不用考虑 - if (target.currentStyle[POSITION$5] === 'absolute' || target.computedStyle[POSITION$5] === 'absolute') { + if (target.currentStyle[POSITION] === 'absolute' || target.computedStyle[POSITION] === 'absolute') { setLAYOUT(target, reflowHash, component, addDom); return; } - } while (target && (['inline', 'inlineBlock', 'inline-block'].indexOf(target.currentStyle[DISPLAY$a]) > -1 || ['inline', 'inlineBlock', 'inline-block'].indexOf(target.computedStyle[DISPLAY$a]) > -1)); // target已不是inline,父固定宽高跳出直接父进行LAYOUT即可,不影响上下文,但不能是flex孩子,此时固定尺寸无用 + } while (target && (['inline', 'inlineBlock', 'inline-block'].indexOf(target.currentStyle[DISPLAY]) > -1 || ['inline', 'inlineBlock', 'inline-block'].indexOf(target.computedStyle[DISPLAY]) > -1)); // target已不是inline,父固定宽高跳出直接父进行LAYOUT即可,不影响上下文,但不能是flex孩子,此时固定尺寸无用 if (isFixedSize(target, true)) { @@ -31291,12 +31298,12 @@ function checkInfluence(root, reflowHash, node, component, addDom) { } // flex相关,包含变化或不变化 - if (parent.computedStyle[DISPLAY$a] === 'flex' || parent.currentStyle[DISPLAY$a] === 'flex') { + if (parent.computedStyle[DISPLAY] === 'flex' || parent.currentStyle[DISPLAY] === 'flex') { topFlex = parent; } // 遇到absolute跳出,如果absolute不变化普通处理,如果absolute发生变化,一定会存在于列表中,不用考虑 - if (parent.currentStyle[POSITION$5] === 'absolute' || parent.computedStyle[POSITION$5] === 'absolute') { + if (parent.currentStyle[POSITION] === 'absolute' || parent.computedStyle[POSITION] === 'absolute') { break; } // 父固定宽高跳出 @@ -31321,7 +31328,7 @@ function checkInfluence(root, reflowHash, node, component, addDom) { while (parent) { // 无论新老absolute,不变化则设置,变化一定会出现在列表中 - if (parent.currentStyle[POSITION$5] === 'absolute' || parent.computedStyle[POSITION$5] === 'absolute') { + if (parent.currentStyle[POSITION] === 'absolute' || parent.computedStyle[POSITION] === 'absolute') { if (parent === root) { break; } // 固定尺寸的不用设置,需要跳出循环 @@ -31347,9 +31354,9 @@ function checkInfluence(root, reflowHash, node, component, addDom) { var prev = node.prev, next = node.next; - if (prev && ['inline', 'inline-block', 'inlineBlock'].indexOf(prev.currentStyle[DISPLAY$a]) > -1) { + if (prev && ['inline', 'inline-block', 'inlineBlock'].indexOf(prev.currentStyle[DISPLAY]) > -1) { isSiblingBlock = false; - } else if (next && ['inline', 'inline-block', 'inlineBlock'].indexOf(next.currentStyle[DISPLAY$a]) > -1) { + } else if (next && ['inline', 'inline-block', 'inlineBlock'].indexOf(next.currentStyle[DISPLAY]) > -1) { isSiblingBlock = false; } @@ -31368,25 +31375,25 @@ function checkInfluence(root, reflowHash, node, component, addDom) { var uniqueUpdateId = 0; function parseUpdate(renderMode, root, target, reflowList, measureList, 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], + var node = target[UPDATE_NODE], + style = target[UPDATE_STYLE], + overwrite = target[UPDATE_OVERWRITE], + focus = target[UPDATE_FOCUS], component = target[UPDATE_COMPONENT], - measure = target[UPDATE_MEASURE$2], + measure = target[UPDATE_MEASURE], list = target[UPDATE_LIST], - keys = target[UPDATE_KEYS$2], - __config = target[UPDATE_CONFIG$5], - addDom = target[UPDATE_ADD_DOM$1], - removeDom = target[UPDATE_REMOVE_DOM$1]; + keys = target[UPDATE_KEYS], + __config = target[UPDATE_CONFIG], + addDom = target[UPDATE_ADD_DOM], + removeDom = target[UPDATE_REMOVE_DOM]; - if (__config[NODE_IS_DESTROYED$2]) { + if (__config[NODE_IS_DESTROYED]) { return; } // updateStyle()这样的调用需要覆盖原有样式,因为是按顺序遍历,后面的优先级自动更高不怕重复 if (overwrite) { - Object.assign(__config[NODE_STYLE$5], overwrite); + Object.assign(__config[NODE_STYLE], overwrite); } // 多次调用更新才会有list,一般没有,优化;component无需,因为多次都是它自己 @@ -31398,9 +31405,9 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas hash[k] = true; }); list.forEach(function (item) { - var style2 = item[UPDATE_STYLE$2], - overwrite = item[UPDATE_OVERWRITE$1], - keys2 = item[UPDATE_KEYS$2]; + var style2 = item[UPDATE_STYLE], + overwrite = item[UPDATE_OVERWRITE], + keys2 = item[UPDATE_KEYS]; (keys2 || []).forEach(function (k2) { if (!hash.hasOwnProperty(k2)) { hash[k2] = true; @@ -31409,7 +31416,7 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas }); if (overwrite) { - Object.assign(__config[NODE_STYLE$5], overwrite); + Object.assign(__config[NODE_STYLE], overwrite); } if (style2) { @@ -31423,15 +31430,15 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas } // 按节点合并完style后判断改变等级 - var tagName = __config[NODE_TAG_NAME$1], - __cacheStyle = __config[NODE_CACHE_STYLE$2], - __cacheProps = __config[NODE_CACHE_PROPS$1], - currentStyle = __config[NODE_CURRENT_STYLE$6], - computedStyle = __config[NODE_COMPUTED_STYLE$5], - currentProps = __config[NODE_CURRENT_PROPS$1], - domParent = __config[NODE_DOM_PARENT$6], - isMask = __config[NODE_IS_MASK$3]; - var lv = focus || NONE$3; + var tagName = __config[NODE_TAG_NAME], + __cacheStyle = __config[NODE_CACHE_STYLE], + __cacheProps = __config[NODE_CACHE_PROPS], + currentStyle = __config[NODE_CURRENT_STYLE], + computedStyle = __config[NODE_COMPUTED_STYLE], + currentProps = __config[NODE_CURRENT_PROPS], + domParent = __config[NODE_DOM_PARENT], + isMask = __config[NODE_IS_MASK]; + var lv = focus || NONE; var hasMeasure = measure; var hasZ, hasVisibility, hasColor, hasDisplay; // component无需遍历直接赋值,img重新加载等情况没有样式更新 @@ -31440,15 +31447,15 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas var k = keys[i]; var v = style[k]; // 只有geom的props和style2种可能 - if (node instanceof Geom$1 && isGeom$3(tagName, k)) { - if (!equalStyle$1(k, v, currentProps[k], node)) { - lv |= REPAINT$3; + if (node instanceof Geom && isGeom(tagName, k)) { + if (!equalStyle(k, v, currentProps[k], node)) { + lv |= REPAINT; __cacheProps[k] = undefined; currentProps[k] = v; } } else { // 需和现在不等,且不是pointerEvents这种无关的 - if (!equalStyle$1(k, v, currentStyle[k], node)) { + if (!equalStyle(k, v, currentStyle[k], node)) { // pointerEvents这种无关的只需更新 if (isIgnore(k)) { __cacheStyle[k] = undefined; @@ -31456,13 +31463,13 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas } else { // TRBL变化只对relative/absolute起作用,其它忽视 if (DIRECTION_HASH.hasOwnProperty(k)) { - var position = currentStyle[POSITION$5]; + var position = currentStyle[POSITION]; if (position !== 'relative' && position !== 'absolute') { delete style[k]; continue; } - } else if (k === DISPLAY$a) { + } else if (k === DISPLAY) { hasDisplay = true; } // repaint细化等级,reflow在checkReflow() @@ -31477,15 +31484,15 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas __cacheStyle[k] = undefined; currentStyle[k] = v; - if (k === Z_INDEX$4 && node !== root) { + if (k === Z_INDEX && node !== root) { hasZ = true; } - if (k === VISIBILITY$7) { + if (k === VISIBILITY) { hasVisibility = true; } - if (k === COLOR$5) { + if (k === COLOR) { hasColor = true; } } @@ -31496,13 +31503,13 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas // 但是perspective需考虑进来,虽然不影响自己但影响别人,要返回true表明有变更 - if (lv === NONE$3 && !component) { + if (lv === NONE && !component) { delete __config[NODE_UNIQUE_UPDATE_ID]; return; } // 由于父节点中有display:none,或本身节点也为none,执行普通动画是无效的,此时没有display变化 - if (computedStyle[DISPLAY$a] === 'none' && !hasDisplay) { + if (computedStyle[DISPLAY] === 'none' && !hasDisplay) { return; } // 记录下来清除parent的zIndexChildren缓存 @@ -31513,28 +31520,28 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas if (hasVisibility || hasColor) { - for (var __structs = root.__structs, __struct = node.__config[NODE_STRUCT$4], _i = __struct[STRUCT_INDEX$2] + 1, _len = _i + __struct[STRUCT_TOTAL$2]; _i < _len; _i++) { + for (var __structs = root.__structs, __struct = node.__config[NODE_STRUCT], _i = __struct[STRUCT_INDEX] + 1, _len = _i + __struct[STRUCT_TOTAL]; _i < _len; _i++) { var _structs$_i = __structs[_i], - _node = _structs$_i[STRUCT_NODE$2], - total = _structs$_i[STRUCT_TOTAL$2]; + _node = _structs$_i[STRUCT_NODE], + total = _structs$_i[STRUCT_TOTAL]; var _config = _node.__config; - var _currentStyle = _config[NODE_CURRENT_STYLE$6]; + var _currentStyle = _config[NODE_CURRENT_STYLE]; var _need = void 0; // text的style指向parent,因此text一定变更 - if (hasVisibility && (_node instanceof Text || _currentStyle[VISIBILITY$7][1] === INHERIT$5)) { + if (hasVisibility && (_node instanceof Text || _currentStyle[VISIBILITY][1] === INHERIT)) { _need = true; } - if (hasColor && (_node instanceof Text || _currentStyle[COLOR$5][1] === INHERIT$5)) { + if (hasColor && (_node instanceof Text || _currentStyle[COLOR][1] === INHERIT)) { _need = true; } if (_need) { - _config[NODE_REFRESH_LV$2] |= REPAINT$3; + _config[NODE_REFRESH_LV] |= REPAINT; - if (_node instanceof Xom$1) { + if (_node instanceof Xom) { _node.clearCache(); } } else { @@ -31551,8 +31558,8 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas prev = prev.prev; } - if (prev && prev.__config[NODE_CACHE_MASK$2]) { - prev.__config[NODE_CACHE_MASK$2].release(); + if (prev && prev.__config[NODE_CACHE_MASK]) { + prev.__config[NODE_CACHE_MASK].release(); } } // 特殊情况,父节点display:none,子节点进行任意变更,应视为无效 // 如果父节点由none变block,这里也return false,因为父节点会重新layout+render @@ -31564,8 +31571,8 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas if (hasDisplay && parent) { var _config2 = parent.__config; - if (_config2[NODE_CURRENT_STYLE$6][DISPLAY$a] === 'none' || _config2[NODE_COMPUTED_STYLE$5][DISPLAY$a] === 'none') { - computedStyle[DISPLAY$a] = 'none'; + if (_config2[NODE_CURRENT_STYLE][DISPLAY] === 'none' || _config2[NODE_COMPUTED_STYLE][DISPLAY] === 'none') { + computedStyle[DISPLAY] = 'none'; return; } } // reflow/repaint/measure相关的记录下来 @@ -31576,7 +31583,7 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas if (isRp) { // zIndex变化需清空svg缓存 if (hasZ && renderMode === mode.SVG) { - lv |= REPAINT$3; + lv |= REPAINT; domParent && cleanSvgCache(domParent); } // z改变影响struct局部重排,它的数量不会变因此不影响外围,此处先收集,最后统一对局部根节点进行更新 @@ -31590,21 +31597,21 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas } } // reflow在root的refresh中做 else { - reflowList.push({ - node: node, - style: style, - component: component, - addDom: addDom, - removeDom: removeDom - }); // measure需要提前先处理 + reflowList.push({ + node: node, + style: style, + component: component, + addDom: addDom, + removeDom: removeDom + }); // measure需要提前先处理 - if (hasMeasure) { - measureList.push(node); - } - } // 这里也需|运算,每次刷新会置0,但是如果父元素进行继承变更,会在此元素分析前更改,比如visibility,此时不能直接赋值 + if (hasMeasure) { + measureList.push(node); + } + } // 这里也需|运算,每次刷新会置0,但是如果父元素进行继承变更,会在此元素分析前更改,比如visibility,此时不能直接赋值 - __config[NODE_REFRESH_LV$2] |= lv; + __config[NODE_REFRESH_LV] |= lv; if (component || addDom || removeDom) { root.__rlv = REBUILD; @@ -31613,32 +31620,32 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas } // dom在>=REPAINT时total失效,svg的Geom比较特殊 - var need = lv >= REPAINT$3 || renderMode === mode.SVG && node instanceof Geom$1; + var need = lv >= REPAINT || renderMode === mode.SVG && node instanceof Geom; if (need) { - if (__config[NODE_CACHE$5]) { - __config[NODE_CACHE$5].release(); + if (__config[NODE_CACHE]) { + __config[NODE_CACHE].release(); } } // perspective也特殊只清空total的cache,和>=REPAINT清空total共用 - if (need || contain$3(lv, PERSPECTIVE$5)) { - if (__config[NODE_CACHE_TOTAL$2]) { - __config[NODE_CACHE_TOTAL$2].release(); + if (need || contain(lv, PERSPECTIVE)) { + if (__config[NODE_CACHE_TOTAL]) { + __config[NODE_CACHE_TOTAL].release(); } - if (__config[NODE_CACHE_MASK$2]) { - __config[NODE_CACHE_MASK$2].release(); + if (__config[NODE_CACHE_MASK]) { + __config[NODE_CACHE_MASK].release(); } - if (__config[NODE_CACHE_OVERFLOW$3]) { - __config[NODE_CACHE_OVERFLOW$3].release(); + if (__config[NODE_CACHE_OVERFLOW]) { + __config[NODE_CACHE_OVERFLOW].release(); } } // 特殊的filter清除cache - if ((need || contain$3(lv, FILTER$6)) && __config[NODE_CACHE_FILTER$3]) { - __config[NODE_CACHE_FILTER$3].release(); + if ((need || contain(lv, FILTER)) && __config[NODE_CACHE_FILTER]) { + __config[NODE_CACHE_FILTER].release(); } // 向上清除等级>=REPAINT的汇总缓存信息,过程中可能会出现重复,因此节点上记录一个临时标防止重复递归 @@ -31655,37 +31662,37 @@ function parseUpdate(renderMode, root, target, reflowList, measureList, cacheHas cacheHash[id] = true; } // 没有的需要设置一个标识 else { - cacheHash[uniqueUpdateId] = true; - _config3[NODE_UNIQUE_UPDATE_ID] = uniqueUpdateId++; - cacheList.push(_config3); - } + cacheHash[uniqueUpdateId] = true; + _config3[NODE_UNIQUE_UPDATE_ID] = uniqueUpdateId++; + cacheList.push(_config3); + } - var _lv = _config3[NODE_REFRESH_LV$2]; + var _lv = _config3[NODE_REFRESH_LV]; - var _need2 = _lv >= REPAINT$3; + var _need2 = _lv >= REPAINT; - if (_need2 && _config3[NODE_CACHE$5]) { - _config3[NODE_CACHE$5].release(); + if (_need2 && _config3[NODE_CACHE]) { + _config3[NODE_CACHE].release(); } // 前面已经过滤了无改变NONE的,只要孩子有任何改变父亲就要清除 - if (_config3[NODE_CACHE_TOTAL$2]) { - _config3[NODE_CACHE_TOTAL$2].release(); + if (_config3[NODE_CACHE_TOTAL]) { + _config3[NODE_CACHE_TOTAL].release(); } - if (_config3[NODE_CACHE_FILTER$3]) { - _config3[NODE_CACHE_FILTER$3].release(); + if (_config3[NODE_CACHE_FILTER]) { + _config3[NODE_CACHE_FILTER].release(); } - if (_config3[NODE_CACHE_MASK$2]) { - _config3[NODE_CACHE_MASK$2].release(); + if (_config3[NODE_CACHE_MASK]) { + _config3[NODE_CACHE_MASK].release(); } - if (_config3[NODE_CACHE_OVERFLOW$3]) { - _config3[NODE_CACHE_OVERFLOW$3].release(); + if (_config3[NODE_CACHE_OVERFLOW]) { + _config3[NODE_CACHE_OVERFLOW].release(); } - parent = _config3[NODE_DOM_PARENT$6]; + parent = _config3[NODE_DOM_PARENT]; } return true; @@ -31695,14 +31702,14 @@ function cleanSvgCache(node, child) { var __config = node.__config; if (child) { - __config[NODE_REFRESH_LV$2] |= REPAINT$3; + __config[NODE_REFRESH_LV] |= REPAINT; } else { - __config[NODE_CACHE_TOTAL$2].release(); + __config[NODE_CACHE_TOTAL].release(); } if (Array.isArray(node.children)) { node.children.forEach(function (child) { - if (child instanceof Component$1) { + if (child instanceof Component) { child = child.shadowRoot; } @@ -31713,7 +31720,7 @@ function cleanSvgCache(node, child) { } } -var uuid$2 = 0; +var uuid = 0; var Root = /*#__PURE__*/function (_Dom) { _inherits(Root, _Dom); @@ -31745,7 +31752,7 @@ var Root = /*#__PURE__*/function (_Dom) { _this.__animateController = new Controller(); Event.mix(_assertThisInitialized(_this)); _this.__config[NODE_UPDATE_HASH] = _this.__updateHash = {}; - _this.__uuid = uuid$2++; + _this.__uuid = uuid++; _this.__rlv = REBUILD; // 每次刷新最大lv return _this; @@ -31756,7 +31763,7 @@ var Root = /*#__PURE__*/function (_Dom) { value: function __initProps() { var w = this.props.width; - if (!isNil$8(w)) { + if (!isNil$7(w)) { var value = parseFloat(w) || 0; if (value > 0) { @@ -31766,7 +31773,7 @@ var Root = /*#__PURE__*/function (_Dom) { var h = this.props.height; - if (!isNil$8(h)) { + if (!isNil$7(h)) { var _value = parseFloat(h) || 0; if (_value > 0) { @@ -31819,13 +31826,13 @@ var Root = /*#__PURE__*/function (_Dom) { x = clientX - x; y = clientY - y; // 外边的scale影响元素事件响应,根据倍数计算真实的坐标,优先手动指定,否则自动计算 - if (!isNil$8(__scx)) { + if (!isNil$7(__scx)) { x /= __scx; } else { x *= this.width / width; } - if (!isNil$8(__scy)) { + if (!isNil$7(__scy)) { y /= __scy; } else { y *= this.height / height; @@ -31889,24 +31896,24 @@ var Root = /*#__PURE__*/function (_Dom) { this.__height = dom.height; } // 已有root节点 else if (dom.nodeName.toLowerCase() === domName) { - this.__dom = dom; + this.__dom = dom; - if (this.width) { - dom.setAttribute('width', this.width); - } + if (this.width) { + dom.setAttribute('width', this.width); + } - if (this.height) { - dom.setAttribute('height', this.height); - } - } // 没有canvas/svg节点则生成一个新的 - else { - this.__dom = dom.querySelector(domName); + if (this.height) { + dom.setAttribute('height', this.height); + } + } // 没有canvas/svg节点则生成一个新的 + else { + this.__dom = dom.querySelector(domName); - if (!this.__dom) { - dom.innerHTML = this.__genHtml(domName); - this.__dom = dom.querySelector(domName); - } - } + if (!this.__dom) { + dom.innerHTML = this.__genHtml(domName); + this.__dom = dom.querySelector(domName); + } + } this.__defs = this.dom.__defs || Defs.getInstance(this.__uuid); // 没有设置width/height则采用css计算形式 @@ -31977,8 +31984,8 @@ var Root = /*#__PURE__*/function (_Dom) { this.__computeMeasure(renderMode, ctx); } // 非首次刷新如果没有更新则无需继续 else if (!this.__checkUpdate(renderMode, ctx, width, height)) { - return; - } // 获取所有字体和大小测量,仅svg需要,canvas直接做 + return; + } // 获取所有字体和大小测量,仅svg需要,canvas直接做 inject.measureText(); @@ -31996,33 +32003,33 @@ var Root = /*#__PURE__*/function (_Dom) { } } // svg的特殊diff需要 else if (renderMode === mode.SVG && !this.props.noRender) { - struct.renderSvg(renderMode, defs, this, isFirst); - var nvd = this.virtualDom; - nvd.defs = defs.value; - - if (this.dom.__vd) { - // console.log(this.dom.__vd); - // console.log(nvd); - diff(this.dom, this.dom.__vd, nvd); - } else { - this.dom.innerHTML = util.joinVirtualDom(nvd); - } + struct.renderSvg(renderMode, defs, this, isFirst); + var nvd = this.virtualDom; + nvd.defs = defs.value; + + if (this.dom.__vd) { + // console.log(this.dom.__vd); + // console.log(nvd); + diff(this.dom, this.dom.__vd, nvd); + } else { + this.dom.innerHTML = util.joinVirtualDom(nvd); + } - this.dom.__vd = nvd; - this.dom.__defs = defs; - } else if (renderMode === mode.WEBGL && !this.props.noRender) { - this.__clear(ctx, renderMode); + this.dom.__vd = nvd; + this.dom.__defs = defs; + } else if (renderMode === mode.WEBGL && !this.props.noRender) { + this.__clear(ctx, renderMode); - struct.renderWebgl(renderMode, ctx, this); - } // 特殊cb,供小程序绘制完回调使用 + struct.renderWebgl(renderMode, ctx, this); + } // 特殊cb,供小程序绘制完回调使用 - if (isFunction$7(cb)) { + if (isFunction$1(cb)) { cb(); } this.emit(Event.REFRESH, this.__rlv); - this.__rlv = NONE$3; + this.__rlv = NONE; } }, { key: "destroy", @@ -32082,7 +32089,7 @@ var Root = /*#__PURE__*/function (_Dom) { width: w, height: h }, cb); - } else if (isFunction$7(cb)) { + } else if (isFunction$1(cb)) { cb(-1); } } @@ -32111,7 +32118,7 @@ var Root = /*#__PURE__*/function (_Dom) { if (clone.length) { clone.forEach(function (item, i) { - if (isObject$2(item) && isFunction$7(item.__before)) { + if (isObject(item) && isFunction$1(item.__before)) { item.__before(diff); } }); @@ -32123,9 +32130,9 @@ var Root = /*#__PURE__*/function (_Dom) { } clone.forEach(function (item) { - if (isObject$2(item) && isFunction$7(item.__after)) { + if (isObject(item) && isFunction$1(item.__after)) { item.__after(diff); - } else if (isFunction$7(item)) { + } else if (isFunction$1(item)) { item(diff); } }); @@ -32206,12 +32213,12 @@ var Root = /*#__PURE__*/function (_Dom) { } var res = {}; - res[UPDATE_NODE$5] = sr; - res[UPDATE_STYLE$2] = sr.currentStyle; - res[UPDATE_FOCUS$4] = REFLOW$2; - res[UPDATE_MEASURE$2] = true; + res[UPDATE_NODE] = sr; + res[UPDATE_STYLE] = sr.currentStyle; + res[UPDATE_FOCUS] = REFLOW; + res[UPDATE_MEASURE] = true; res[UPDATE_COMPONENT] = cp; - res[UPDATE_CONFIG$5] = sr.__config; + res[UPDATE_CONFIG] = sr.__config; _this4.__addUpdate(sr, sr.__config, _this4, _this4.__config, res); }); @@ -32250,8 +32257,8 @@ var Root = /*#__PURE__*/function (_Dom) { children = vd.children, zIndexChildren = vd.zIndexChildren, _vd$computedStyle = vd.computedStyle, - display = _vd$computedStyle[DISPLAY$a], - pointerEvents = _vd$computedStyle[POINTER_EVENTS$2]; + display = _vd$computedStyle[DISPLAY], + pointerEvents = _vd$computedStyle[POINTER_EVENTS]; if (!includeIgnore && display === 'none') { return; @@ -32285,7 +32292,7 @@ var Root = /*#__PURE__*/function (_Dom) { return; } - var inThis = geom.pointInQuadrilateral(x, y, __sx1, __sy1, __sx1 + offsetWidth, __sy1, __sx1 + offsetWidth, __sy1 + offsetHeight, __sx1, __sy1 + offsetHeight, matrixEvent); + var inThis = geom$1.pointInQuadrilateral(x, y, __sx1, __sy1, __sx1 + offsetWidth, __sy1, __sx1 + offsetWidth, __sy1 + offsetHeight, __sx1, __sy1 + offsetHeight, matrixEvent); if (inThis) { return { @@ -32313,20 +32320,20 @@ var Root = /*#__PURE__*/function (_Dom) { currentStyle = this.currentStyle, computedStyle = this.computedStyle; // canvas/svg作为根节点一定是block或flex,不会是inline - if (['flex', 'block'].indexOf(currentStyle[DISPLAY$a]) === -1) { - computedStyle[DISPLAY$a] = currentStyle[DISPLAY$a] = 'block'; + if (['flex', 'block'].indexOf(currentStyle[DISPLAY]) === -1) { + computedStyle[DISPLAY] = currentStyle[DISPLAY] = 'block'; } // 同理position不能为absolute - if (currentStyle[POSITION$5] === 'absolute') { - computedStyle[POSITION$5] = currentStyle[POSITION$5] = 'static'; + if (currentStyle[POSITION] === 'absolute') { + computedStyle[POSITION] = currentStyle[POSITION] = 'static'; } // 根节点满宽高 - currentStyle[WIDTH$8] = [width, PX$b]; - currentStyle[HEIGHT$8] = [height, PX$b]; - computedStyle[WIDTH$8] = width; - computedStyle[HEIGHT$8] = height; // 可能调用resize()导致变更,要重设,canvas无论离屏与否都可使用直接赋值,svg则按dom属性api + currentStyle[WIDTH] = [width, PX]; + currentStyle[HEIGHT] = [height, PX]; + computedStyle[WIDTH] = width; + computedStyle[HEIGHT] = height; // 可能调用resize()导致变更,要重设,canvas无论离屏与否都可使用直接赋值,svg则按dom属性api if (renderMode === mode.CANVAS || renderMode === mode.WEBGL) { if (dom.width !== width) { @@ -32355,20 +32362,20 @@ var Root = /*#__PURE__*/function (_Dom) { updateHash = root.__updateRoot; if (updateHash) { - if (o[UPDATE_FOCUS$4]) { - updateHash[UPDATE_FOCUS$4] |= o[UPDATE_FOCUS$4]; + if (o[UPDATE_FOCUS]) { + updateHash[UPDATE_FOCUS] |= o[UPDATE_FOCUS]; } - if (o[UPDATE_MEASURE$2]) { - updateHash[UPDATE_MEASURE$2] = true; + if (o[UPDATE_MEASURE]) { + updateHash[UPDATE_MEASURE] = true; } // 后续存在新建list上,需增加遍历逻辑 - if (o[UPDATE_STYLE$2]) { + if (o[UPDATE_STYLE]) { var _list$push; var list = updateHash[UPDATE_LIST] = updateHash[UPDATE_LIST] || []; - list.push((_list$push = {}, _defineProperty(_list$push, UPDATE_STYLE$2, o[UPDATE_STYLE$2]), _defineProperty(_list$push, UPDATE_OVERWRITE$1, o[UPDATE_OVERWRITE$1]), _defineProperty(_list$push, UPDATE_KEYS$2, o[UPDATE_KEYS$2]), _list$push)); + list.push((_list$push = {}, _defineProperty(_list$push, UPDATE_STYLE, o[UPDATE_STYLE]), _defineProperty(_list$push, UPDATE_OVERWRITE, o[UPDATE_OVERWRITE]), _defineProperty(_list$push, UPDATE_KEYS, o[UPDATE_KEYS]), _list$push)); } } else { root.__updateRoot = o; @@ -32380,21 +32387,21 @@ var Root = /*#__PURE__*/function (_Dom) { } else if (updateHash.hasOwnProperty(nodeConfig[NODE_UNIQUE_UPDATE_ID])) { var target = updateHash[nodeConfig[NODE_UNIQUE_UPDATE_ID]]; - if (o[UPDATE_FOCUS$4]) { - target[UPDATE_FOCUS$4] |= o[UPDATE_FOCUS$4]; + if (o[UPDATE_FOCUS]) { + target[UPDATE_FOCUS] |= o[UPDATE_FOCUS]; } - if (o[UPDATE_MEASURE$2]) { - target[UPDATE_MEASURE$2] = true; + if (o[UPDATE_MEASURE]) { + target[UPDATE_MEASURE] = true; } // 后续存在新建list上,需增加遍历逻辑 - if (o[UPDATE_STYLE$2]) { + if (o[UPDATE_STYLE]) { var _list$push2; var _list = target[UPDATE_LIST] = target[UPDATE_LIST] || []; - _list.push((_list$push2 = {}, _defineProperty(_list$push2, UPDATE_STYLE$2, o[UPDATE_STYLE$2]), _defineProperty(_list$push2, UPDATE_OVERWRITE$1, o[UPDATE_OVERWRITE$1]), _defineProperty(_list$push2, UPDATE_KEYS$2, o[UPDATE_KEYS$2]), _list$push2)); + _list.push((_list$push2 = {}, _defineProperty(_list$push2, UPDATE_STYLE, o[UPDATE_STYLE]), _defineProperty(_list$push2, UPDATE_OVERWRITE, o[UPDATE_OVERWRITE]), _defineProperty(_list$push2, UPDATE_KEYS, o[UPDATE_KEYS]), _list$push2)); } } else { inject.error('Update process miss uniqueUpdateId'); @@ -32460,7 +32467,7 @@ var Root = /*#__PURE__*/function (_Dom) { 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 + parent = _node$__config[NODE_DOM_PARENT]; // 在root下的component变更时root会进入,但其没有__uniqueUpdateId if (node !== root) { if (measureHash.hasOwnProperty(__uniqueUpdateId)) { @@ -32473,7 +32480,7 @@ var Root = /*#__PURE__*/function (_Dom) { 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,需要向上查找,从顶部向下递归计算继承信息 + var isInherit = node !== root && (updateHash[__uniqueUpdateId][UPDATE_ADD_DOM] || o$2.isMeasureInherit(updateHash[__uniqueUpdateId][UPDATE_STYLE])); // 是inherit,需要向上查找,从顶部向下递归计算继承信息 if (isInherit) { while (parent && parent !== root) { @@ -32484,7 +32491,7 @@ var Root = /*#__PURE__*/function (_Dom) { var _isInherit = void 0; if (parent.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) { - var style = updateHash[_uniqueUpdateId][UPDATE_STYLE$2]; + var style = updateHash[_uniqueUpdateId][UPDATE_STYLE]; measureHash[_uniqueUpdateId] = true; var temp = o$2.measureInheritList(style); _isInherit = !!temp.length; @@ -32513,7 +32520,7 @@ var Root = /*#__PURE__*/function (_Dom) { }); // 做完清空留待下次刷新重来 for (var _i3 = 0, _len2 = keys.length; _i3 < _len2; _i3++) { - delete updateHash[keys[_i3]][UPDATE_CONFIG$5][NODE_UNIQUE_UPDATE_ID]; + delete updateHash[keys[_i3]][UPDATE_CONFIG][NODE_UNIQUE_UPDATE_ID]; } return hasUpdate; @@ -32568,7 +32575,7 @@ var Root = /*#__PURE__*/function (_Dom) { } // 添加时如果是cp则node取sr来布局 - if (addDom && node instanceof Component$1) { + if (addDom && node instanceof Component) { node = node.shadowRoot; } // 每个节点生成唯一的布局识别id存入hash防止重复 @@ -32589,8 +32596,8 @@ var Root = /*#__PURE__*/function (_Dom) { break; } // remove的要特殊对待,因为提前删除了父子兄弟关系,下面deepScan不会出现 else if (removeDom) { - uniqueList.push(item); - } + uniqueList.push(item); + } } __uniqueReflowId = 0; @@ -32623,97 +32630,181 @@ var Root = /*#__PURE__*/function (_Dom) { * OFFSET节点作为局部根,其递归子节点先执行任何操作,后续根节点再偏移一次 */ else { - this.__deepScan(function (node, options) { - if (node.hasOwnProperty('__uniqueReflowId')) { - var o = reflowHash[node.__uniqueReflowId]; - options.uniqueList.push(o); // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行 + this.__deepScan(function (node, options) { + if (node.hasOwnProperty('__uniqueReflowId')) { + var o = reflowHash[node.__uniqueReflowId]; + options.uniqueList.push(o); // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行 - return true; - } // reflowHash没有记录则无返回继续递归执行 + return true; + } // reflowHash没有记录则无返回继续递归执行 - }, { - uniqueList: uniqueList - }); - /** - * 按顺序执行列表即可,上层LAYOUT先执行且停止递归子节点,上层OFFSET后执行等子节点先LAYOUT/OFFSET - * 同级按先后顺序排列,过程中记录diff在结束后进行structs更新 - * 这里要注意margin合并的逻辑,因为最终都是block(flex等同),需要进行合并 - * 在处理一个block时,先判断是否是空block,同时看后面紧邻的有没有在uniqueList的下一个 - * 单独空block处理、2个相邻的非block处理直接可以进行判断 - * 中间的空block(即非空block的下一个是空block,且下一个不是最后一个),先记录下来list,合并后一并offset - * 合并margin和Dom的逻辑一样,抽离共有方法 - **/ - - - var diffList = []; - var diffI = 0; - var mergeOffsetList = []; - var __uniqueMergeOffsetId = 0; - uniqueList.forEach(function (item) { - var node = item.node, - component = item.component, - addDom = item.addDom, - removeDom = item.removeDom; // 重新layout的w/h数据使用之前parent暂存的,x使用parent,y使用prev或者parent的 - - var cps = node.computedStyle, - cts = node.currentStyle; - var zIndex = cps[Z_INDEX$4], - position = cps[POSITION$5], - display = cps[DISPLAY$a]; - var isLastAbs = position === 'absolute'; - var isNowAbs = cts[POSITION$5] === 'absolute'; - var isLastNone = display === 'none'; - var isNowNone = cts[DISPLAY$a] === 'none'; // none不可见布局无效可以无视 - - if (isLastNone && isNowNone) { - return; + }, { + uniqueList: uniqueList + }); + /** + * 按顺序执行列表即可,上层LAYOUT先执行且停止递归子节点,上层OFFSET后执行等子节点先LAYOUT/OFFSET + * 同级按先后顺序排列,过程中记录diff在结束后进行structs更新 + * 这里要注意margin合并的逻辑,因为最终都是block(flex等同),需要进行合并 + * 在处理一个block时,先判断是否是空block,同时看后面紧邻的有没有在uniqueList的下一个 + * 单独空block处理、2个相邻的非block处理直接可以进行判断 + * 中间的空block(即非空block的下一个是空block,且下一个不是最后一个),先记录下来list,合并后一并offset + * 合并margin和Dom的逻辑一样,抽离共有方法 + **/ + + + var diffList = []; + var diffI = 0; + var mergeOffsetList = []; + var __uniqueMergeOffsetId = 0; + uniqueList.forEach(function (item) { + var node = item.node, + component = item.component, + addDom = item.addDom, + removeDom = item.removeDom; // 重新layout的w/h数据使用之前parent暂存的,x使用parent,y使用prev或者parent的 + + var cps = node.computedStyle, + cts = node.currentStyle; + var zIndex = cps[Z_INDEX], + position = cps[POSITION], + display = cps[DISPLAY]; + var isLastAbs = position === 'absolute'; + var isNowAbs = cts[POSITION] === 'absolute'; + var isLastNone = display === 'none'; + var isNowNone = cts[DISPLAY] === 'none'; // none不可见布局无效可以无视 + + if (isLastNone && isNowNone) { + return; + } + + var parent = node.domParent; + var _parent$__layoutData = parent.__layoutData, + x = _parent$__layoutData.x, + y = _parent$__layoutData.y, + h = _parent$__layoutData.h, + width = parent.width, + computedStyle = parent.computedStyle; + var current = node; // cp的shadowRoot要向上到cp本身,考虑高阶组件在内到真正的顶层cp + + if (current.isShadowRoot) { + current = current.hostRoot; + } // y使用prev或者parent的,首个节点无prev,prev要忽略absolute的和display:none的 + + + var ref = current.prev; + var hasFlowPrev; + + while (ref) { + if (ref instanceof Text || ref.computedStyle[POSITION] !== 'absolute' && ref.computedStyle[DISPLAY] !== 'none') { + y = ref.y + ref.outerHeight; + hasFlowPrev = true; + break; } - var parent = node.domParent; - var _parent$__layoutData = parent.__layoutData, - x = _parent$__layoutData.x, - y = _parent$__layoutData.y, - h = _parent$__layoutData.h, - width = parent.width, - computedStyle = parent.computedStyle; - var current = node; // cp的shadowRoot要向上到cp本身,考虑高阶组件在内到真正的顶层cp + ref = ref.prev; + } // 找不到prev以parent为基准,找到则增加自身,排除remove - if (current.isShadowRoot) { - current = current.hostRoot; - } // y使用prev或者parent的,首个节点无prev,prev要忽略absolute的和display:none的 + if (!removeDom) { + if (!hasFlowPrev) { + y += computedStyle[MARGIN_TOP] + computedStyle[BORDER_TOP_WIDTH] + computedStyle[PADDING_TOP]; + } - var ref = current.prev; - var hasFlowPrev; + x += computedStyle[MARGIN_LEFT] + computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT]; + } // 找到最上层容器,如果是组件的子节点,以sr为container,sr本身往上找 - while (ref) { - if (ref instanceof Text || ref.computedStyle[POSITION$5] !== 'absolute' && ref.computedStyle[DISPLAY$a] !== 'none') { - y = ref.y + ref.outerHeight; - hasFlowPrev = true; - break; - } - ref = ref.prev; - } // 找不到prev以parent为基准,找到则增加自身,排除remove + var container = node; // remove的节点本身无需再次布局 + + if (!removeDom) { + if (isNowAbs) { + container = container.domParent; + + while (container && container !== root) { + if (isRelativeOrAbsolute(container)) { + break; + } // 不能用domParent,必须在组件环境内 - if (!removeDom) { - if (!hasFlowPrev) { - y += computedStyle[MARGIN_TOP$4] + computedStyle[BORDER_TOP_WIDTH$6] + computedStyle[PADDING_TOP$5]; + if (container.parent) { + container = container.parent; + } else if (container.host) { + break; + } } - x += computedStyle[MARGIN_LEFT$6] + computedStyle[BORDER_LEFT_WIDTH$8] + computedStyle[PADDING_LEFT$7]; - } // 找到最上层容器,如果是组件的子节点,以sr为container,sr本身往上找 + if (!container) { + container = root; + } // 由setState引发的要检查是cp自身还是更上层,如果cp被abs包含,那么node是cp的父亲,否则node是cp的sr + // 而这种情况下传cp或node都一样,所以最终统一传node + + + parent.__layoutAbs(container, null, node); // 优先判断dom变更 + + + if (addDom) { + var arr = parent.__modifyStruct(root, diffI); + + diffI += arr[1]; + diffList.push(arr); + + parent.__updateStruct(root.__structs); + + if (_this5.renderMode === mode.SVG) { + cleanSvgCache(parent); + } + + return; + } // 前后都是abs无需偏移后面兄弟和parent调整,component变化节点需更新struct + else if (isLastAbs) { + if (component) { + var _arr = node.__modifyStruct(root, diffI); + + diffI += _arr[1]; + diffList.push(_arr); + + if (position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static') || zIndex !== cts[Z_INDEX]) { + parent.__updateStruct(root.__structs); + + if (_this5.renderMode === mode.SVG) { + cleanSvgCache(parent); + } + } + } else if (isLastNone || isNowNone) { + node.__zIndexChildren = null; + + var _arr2 = node.__modifyStruct(root, diffI); + diffI += _arr2[1]; + diffList.push(_arr2); + } + + return; + } // 标识flow变abs,可能引发zIndex变更,重设struct和svg + + + parent.__updateStruct(root.__structs); + + if (_this5.renderMode === mode.SVG) { + cleanSvgCache(parent); + } + } // 现在是普通流,不管之前是啥直接布局,排除remove删除的 + else { + node.__layout({ + x: x, + y: y, + w: width, + h: h + }); - var container = node; // remove的节点本身无需再次布局 + y += node.outerHeight; - if (!removeDom) { - if (isNowAbs) { + if (component) { + container = node; + } else { container = container.domParent; while (container && container !== root) { - if (isRelativeOrAbsolute$2(container)) { + if (isRelativeOrAbsolute(container)) { break; } // 不能用domParent,必须在组件环境内 @@ -32724,533 +32815,449 @@ var Root = /*#__PURE__*/function (_Dom) { break; } } + } - if (!container) { - container = root; - } // 由setState引发的要检查是cp自身还是更上层,如果cp被abs包含,那么node是cp的父亲,否则node是cp的sr - // 而这种情况下传cp或node都一样,所以最终统一传node - - - parent.__layoutAbs(container, null, node); // 优先判断dom变更 - + if (!container) { + container = root; + } // 防止geom - if (addDom) { - var arr = parent.__modifyStruct(root, diffI); - diffI += arr[1]; - diffList.push(arr); + if (node instanceof Dom) { + node.__layoutAbs(container, { + x: x, + y: y, + w: width, + h: h + }); + } + } + } // 向上查找最近的parent是relative,需再次累加ox/oy,无需继续向上递归,因为parent已经递归包含了 + // 这样node重新布局后再次设置其使用parent的偏移 - parent.__updateStruct(root.__structs); - if (_this5.renderMode === mode.SVG) { - cleanSvgCache(parent); - } + var p = node; - return; - } // 前后都是abs无需偏移后面兄弟和parent调整,component变化节点需更新struct - else if (isLastAbs) { - if (component) { - var _arr = node.__modifyStruct(root, diffI); + while (p && p !== root) { + p = p.domParent; + computedStyle = p.computedStyle; - diffI += _arr[1]; - diffList.push(_arr); + if (computedStyle[POSITION] === 'relative') { + var _p = p, + ox = _p.ox, + oy = _p.oy; + ox && node.__offsetX(ox); + oy && node.__offsetY(oy); + break; + } + } // 向下调整next的flow位置,遇到重复LAYOUT的跳出等待其调用并处理其next,忽视掉abs,margin和abs在merge中做 - 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) { - cleanSvgCache(parent); - } - } - } else if (isLastNone || isNowNone) { - node.__zIndexChildren = null; + if (node.isShadowRoot) { + node = node.hostRoot; + } - var _arr2 = node.__modifyStruct(root, diffI); + var next = node.next; - diffI += _arr2[1]; - diffList.push(_arr2); - } + while (next && !next.hasOwnProperty('__uniqueReflowId')) { + if (next.computedStyle[POSITION] === 'absolute') { + next = next.next; + continue; + } - return; - } // 标识flow变abs,可能引发zIndex变更,重设struct和svg + var _next = next, + _oy = _next.y; + var _diff = y - _oy; - parent.__updateStruct(root.__structs); + if (_diff) { + while (next && !next.hasOwnProperty('__uniqueReflowId')) { + var target = next; - if (_this5.renderMode === mode.SVG) { - cleanSvgCache(parent); + if (target instanceof Component) { + target = target.shadowRoot; } - } // 现在是普通流,不管之前是啥直接布局,排除remove删除的 - else { - node.__layout({ - x: x, - y: y, - w: width, - h: h - }); - - y += node.outerHeight; - - if (component) { - container = node; - } else { - container = container.domParent; - - while (container && container !== root) { - if (isRelativeOrAbsolute$2(container)) { - break; - } // 不能用domParent,必须在组件环境内 - - if (container.parent) { - container = container.parent; - } else if (container.host) { - break; - } - } - } + var cs = target.computedStyle; - if (!container) { - container = root; - } // 防止geom - - - if (node instanceof Dom$1) { - node.__layoutAbs(container, { - x: x, - y: y, - w: width, - h: h - }); - } + if (cs[POSITION] !== 'absolute' && cs[DISPLAY] !== 'none') { + target.__offsetY(_diff, true, REPAINT); } - } // 向上查找最近的parent是relative,需再次累加ox/oy,无需继续向上递归,因为parent已经递归包含了 - // 这样node重新布局后再次设置其使用parent的偏移 - - var p = node; - - while (p && p !== root) { - p = p.domParent; - computedStyle = p.computedStyle; - - if (computedStyle[POSITION$5] === 'relative') { - var _p = p, - ox = _p.ox, - oy = _p.oy; - ox && node.__offsetX(ox); - oy && node.__offsetY(oy); - break; + next = next.next; } - } // 向下调整next的flow位置,遇到重复LAYOUT的跳出等待其调用并处理其next,忽视掉abs,margin和abs在merge中做 - - - if (node.isShadowRoot) { - node = node.hostRoot; } - var next = node.next; - - while (next && !next.hasOwnProperty('__uniqueReflowId')) { - if (next.computedStyle[POSITION$5] === 'absolute') { - next = next.next; - continue; - } + break; + } // 去重防止abs并记录parent,整个结束后按先序顺序进行margin合并以及偏移,注意忽略有display:none变block同时为absolute的 - var _next = next, - _oy = _next.y; - var _diff = y - _oy; + if (!parent.hasOwnProperty('__uniqueMergeOffsetId') && !(isNowAbs && isLastNone)) { + parent.__uniqueMergeOffsetId = __uniqueMergeOffsetId++; + mergeOffsetList.push(parent); + } // add和remove都需父节点重新生成struct,zIndexChildren已在对应api操作的before()侦听做了 - if (_diff) { - while (next && !next.hasOwnProperty('__uniqueReflowId')) { - var target = next; - if (target instanceof Component$1) { - target = target.shadowRoot; - } + if (addDom || removeDom) { + var _arr3 = parent.__modifyStruct(root, diffI); - var cs = target.computedStyle; + diffI += _arr3[1]; + diffList.push(_arr3); - if (cs[POSITION$5] !== 'absolute' && cs[DISPLAY$a] !== 'none') { - target.__offsetY(_diff, true, REPAINT$3); - } + if (_this5.renderMode === mode.SVG) { + cleanSvgCache(parent); + } + } // component未知dom变化,所以强制重新struct,text则为其父节点,同时防止zIndex变更影响父节点 + else if (component) { + var _arr4 = node.__modifyStruct(root, diffI); - next = next.next; - } - } + diffI += _arr4[1]; + diffList.push(_arr4); - break; - } // 去重防止abs并记录parent,整个结束后按先序顺序进行margin合并以及偏移,注意忽略有display:none变block同时为absolute的 + if (position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static') || zIndex !== cts[Z_INDEX]) { + node.domParent.__updateStruct(root.__structs); + if (_this5.renderMode === mode.SVG) { + cleanSvgCache(node.domParent); + } + } + } // display有none变化,重置struct和zIndexChildren + else if (isLastNone || isNowNone) { + node.__zIndexChildren = null; - if (!parent.hasOwnProperty('__uniqueMergeOffsetId') && !(isNowAbs && isLastNone)) { - parent.__uniqueMergeOffsetId = __uniqueMergeOffsetId++; - mergeOffsetList.push(parent); - } // add和remove都需父节点重新生成struct,zIndexChildren已在对应api操作的before()侦听做了 + var _arr5 = node.__modifyStruct(root, diffI); + diffI += _arr5[1]; + diffList.push(_arr5); + } + }); + /** + * mergeMargin后续调整,记录的是变更节点的父节点,因此每个节点内部直接遍历孩子进行 + * 由于保持先根遍历的顺序,因此会从最上最里的节点开始,先进行margin合并 + * 由于之前忽略掉abs节点,因此再检查直接abs是否要调整 + * 完成后对此父节点的后续兄弟节点进行调整,多次不会干扰影响 + * 然后继续往上循环,直到root结束 + */ - if (addDom || removeDom) { - var _arr3 = parent.__modifyStruct(root, diffI); + var inDirectAbsList = []; + mergeOffsetList.forEach(function (parent) { + delete parent.__uniqueMergeOffsetId; + var flowChildren = parent.flowChildren, + absChildren = parent.absChildren; + var mergeMarginBottomList = [], + mergeMarginTopList = []; + var length = flowChildren.length, + lastChild; + var isStart, startIndex; // 遍历flow孩子,从开始变化的节点开始,看变化造成的影响,对其后面节点进行偏移,并统计总偏移量 + + for (var _i4 = 0; _i4 < length; _i4++) { + var _item = flowChildren[_i4]; + + if (_item instanceof Component) { + _item = _item.shadowRoot; + } - diffI += _arr3[1]; - diffList.push(_arr3); + var isXom = _item instanceof Xom; // 忽略掉前面没有变更的节点,不能合并 - if (_this5.renderMode === mode.SVG) { - cleanSvgCache(parent); + if (!isStart && isXom) { + if (_item.hasOwnProperty('__uniqueReflowId')) { + isStart = true; + startIndex = _i4; } - } // component未知dom变化,所以强制重新struct,text则为其父节点,同时防止zIndex变更影响父节点 - else if (component) { - var _arr4 = node.__modifyStruct(root, diffI); + } // 开始变更的节点,至少不是第0个 - diffI += _arr4[1]; - diffList.push(_arr4); - if (position !== cts[POSITION$5] && (position === 'static' || cts[POSITION$5] === 'static') || zIndex !== cts[Z_INDEX$4]) { - node.domParent.__updateStruct(root.__structs); + var _cs = isXom && _item.currentStyle; - if (_this5.renderMode === mode.SVG) { - cleanSvgCache(node.domParent); - } - } - } // display有none变化,重置struct和zIndexChildren - else if (isLastNone || isNowNone) { - node.__zIndexChildren = null; + var isInline = isXom && _cs[DISPLAY] === 'inline'; + var isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(_cs[DISPLAY]) > -1; + lastChild = _item; // 每次循环开始前,这次不是block的话,看之前遗留的,可能是以空block结束,需要特殊处理,单独一个空block也包含 - var _arr5 = node.__modifyStruct(root, diffI); + if (!isXom || isInline || isInlineBlock) { + if (mergeMarginBottomList.length && mergeMarginTopList.length && isStart) { + var _diff2 = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); - diffI += _arr5[1]; - diffList.push(_arr5); + if (_diff2) { + for (var j = Math.max(startIndex, _i4 - mergeMarginBottomList.length + 1); j < length; j++) { + flowChildren[j].__offsetY(_diff2, true, REPAINT); + } } - }); - /** - * mergeMargin后续调整,记录的是变更节点的父节点,因此每个节点内部直接遍历孩子进行 - * 由于保持先根遍历的顺序,因此会从最上最里的节点开始,先进行margin合并 - * 由于之前忽略掉abs节点,因此再检查直接abs是否要调整 - * 完成后对此父节点的后续兄弟节点进行调整,多次不会干扰影响 - * 然后继续往上循环,直到root结束 - */ - - var inDirectAbsList = []; - mergeOffsetList.forEach(function (parent) { - delete parent.__uniqueMergeOffsetId; - var flowChildren = parent.flowChildren, - absChildren = parent.absChildren; - var mergeMarginBottomList = [], - mergeMarginTopList = []; - var length = flowChildren.length, - lastChild; - var isStart, startIndex; // 遍历flow孩子,从开始变化的节点开始,看变化造成的影响,对其后面节点进行偏移,并统计总偏移量 - - for (var _i4 = 0; _i4 < length; _i4++) { - var _item = flowChildren[_i4]; - - if (_item instanceof Component$1) { - _item = _item.shadowRoot; } - var isXom = _item instanceof Xom$1; // 忽略掉前面没有变更的节点,不能合并 - - if (!isStart && isXom) { - if (_item.hasOwnProperty('__uniqueReflowId')) { - isStart = true; - startIndex = _i4; - } - } // 开始变更的节点,至少不是第0个 + mergeMarginTopList = []; + mergeMarginBottomList = []; + } // 和普通布局类似,只是不用重新布局只需处理合并margin再根据差值偏移 - var _cs = isXom && _item.currentStyle; + if (isXom && !isInline) { + var isNone = isXom && _cs[DISPLAY] === 'none'; + var isEmptyBlock = void 0; - var isInline = isXom && _cs[DISPLAY$a] === 'inline'; - var isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(_cs[DISPLAY$a]) > -1; - lastChild = _item; // 每次循环开始前,这次不是block的话,看之前遗留的,可能是以空block结束,需要特殊处理,单独一个空block也包含 + if (!isNone && _item.flowChildren && _item.flowChildren.length === 0) { + var _item$computedStyle = _item.computedStyle, + marginTop = _item$computedStyle[MARGIN_TOP], + marginBottom = _item$computedStyle[MARGIN_BOTTOM], + paddingTop = _item$computedStyle[PADDING_TOP], + paddingBottom = _item$computedStyle[PADDING_BOTTOM], + _height = _item$computedStyle[HEIGHT], + borderTopWidth = _item$computedStyle[BORDER_TOP_WIDTH], + borderBottomWidth = _item$computedStyle[BORDER_BOTTOM_WIDTH]; // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理 - if (!isXom || isInline || isInlineBlock) { - if (mergeMarginBottomList.length && mergeMarginTopList.length && isStart) { - var _diff2 = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); - - if (_diff2) { - for (var j = Math.max(startIndex, _i4 - mergeMarginBottomList.length + 1); j < length; j++) { - flowChildren[j].__offsetY(_diff2, true, REPAINT$3); - } - } + if (paddingTop <= 0 && paddingBottom <= 0 && _height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) { + mergeMarginBottomList.push(marginBottom); + mergeMarginTopList.push(marginTop); + isEmptyBlock = true; } + } // 空block要留下轮循环看,除非是最后一个,非空本轮处理掉看是否要合并 - mergeMarginTopList = []; - mergeMarginBottomList = []; - } // 和普通布局类似,只是不用重新布局只需处理合并margin再根据差值偏移 - - - if (isXom && !isInline) { - var isNone = isXom && _cs[DISPLAY$a] === 'none'; - var isEmptyBlock = void 0; - - if (!isNone && _item.flowChildren && _item.flowChildren.length === 0) { - var _item$computedStyle = _item.computedStyle, - marginTop = _item$computedStyle[MARGIN_TOP$4], - marginBottom = _item$computedStyle[MARGIN_BOTTOM$4], - paddingTop = _item$computedStyle[PADDING_TOP$5], - paddingBottom = _item$computedStyle[PADDING_BOTTOM$5], - _height = _item$computedStyle[HEIGHT$8], - borderTopWidth = _item$computedStyle[BORDER_TOP_WIDTH$6], - borderBottomWidth = _item$computedStyle[BORDER_BOTTOM_WIDTH$6]; // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理 - - if (paddingTop <= 0 && paddingBottom <= 0 && _height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) { - mergeMarginBottomList.push(marginBottom); - mergeMarginTopList.push(marginTop); - isEmptyBlock = true; - } - } // 空block要留下轮循环看,除非是最后一个,非空本轮处理掉看是否要合并 + if (!isNone && !isEmptyBlock) { + var _item$computedStyle2 = _item.computedStyle, + _marginTop = _item$computedStyle2[MARGIN_TOP], + _marginBottom = _item$computedStyle2[MARGIN_BOTTOM]; // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top + // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并 - if (!isNone && !isEmptyBlock) { - var _item$computedStyle2 = _item.computedStyle, - _marginTop = _item$computedStyle2[MARGIN_TOP$4], - _marginBottom = _item$computedStyle2[MARGIN_BOTTOM$4]; // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top - // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并 - - if (mergeMarginBottomList.length) { - mergeMarginTopList.push(_marginTop); + if (mergeMarginBottomList.length) { + mergeMarginTopList.push(_marginTop); - if (isStart) { - var _diff3 = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); // 需要合并的情况,根据记录数和索引向上向下遍历节点设置偏移,同时设置总偏移量供父级使用 + if (isStart) { + var _diff3 = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); // 需要合并的情况,根据记录数和索引向上向下遍历节点设置偏移,同时设置总偏移量供父级使用 - if (_diff3) { - for (var _j = Math.max(startIndex, _i4 - mergeMarginBottomList.length + 1); _j < length; _j++) { - flowChildren[_j].__offsetY(_diff3, true, REPAINT$3); - } + if (_diff3) { + for (var _j = Math.max(startIndex, _i4 - mergeMarginBottomList.length + 1); _j < length; _j++) { + flowChildren[_j].__offsetY(_diff3, true, REPAINT); } } - } // 同时自己保存bottom,为后续block准备 + } + } // 同时自己保存bottom,为后续block准备 - mergeMarginTopList = []; - mergeMarginBottomList = [_marginBottom]; - } // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0,最后一个一定有不必判断isStart - else if (_i4 === length - 1) { - var _diff4 = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); + mergeMarginTopList = []; + mergeMarginBottomList = [_marginBottom]; + } // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0,最后一个一定有不必判断isStart + else if (_i4 === length - 1) { + var _diff4 = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); - if (_diff4) { - for (var _j2 = Math.max(startIndex, _i4 - mergeMarginBottomList.length + 1); _j2 < length; _j2++) { - flowChildren[_j2].__offsetY(_diff4, true, REPAINT$3); - } - } + if (_diff4) { + for (var _j2 = Math.max(startIndex, _i4 - mergeMarginBottomList.length + 1); _j2 < length; _j2++) { + flowChildren[_j2].__offsetY(_diff4, true, REPAINT); } + } } - } // 先检查parent的尺寸是否发生了变化,从而决定是否调整next以及向上递归调整 - + } + } // 先检查parent的尺寸是否发生了变化,从而决定是否调整next以及向上递归调整 - var cs = parent.currentStyle; - var height = cs[HEIGHT$8]; - 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$5]; - var nowH = lastChild.y + lastChild.outerHeight - parent.y; + var cs = parent.currentStyle; + var height = cs[HEIGHT]; + var isContainer = parent === root || parent.isShadowRoot || cs[POSITION] === 'absolute' || cs[POSITION] === 'relative'; - var _diff5 = nowH - oldH; // 调整next以及非固定PX的abs,再递归向上 + if (height[1] === AUTO && lastChild) { + var oldH = parent.height + parent.computedStyle[PADDING_TOP]; + var nowH = lastChild.y + lastChild.outerHeight - parent.y; + var _diff5 = nowH - oldH; // 调整next以及非固定PX的abs,再递归向上 - if (_diff5) { - parent.__resizeY(_diff5, REPAINT$3); - var container; + if (_diff5) { + parent.__resizeY(_diff5, REPAINT); - for (var _i5 = 0, _len3 = absChildren.length; _i5 < _len3; _i5++) { - var _item2 = absChildren[_i5]; - var _item2$currentStyle = _item2.currentStyle, - top = _item2$currentStyle[TOP$4], - bottom = _item2$currentStyle[BOTTOM$4], - _height2 = _item2$currentStyle[HEIGHT$8]; // 是容器,所有的都调整,不是容器,其偏移是上级parent的某一个,根据情况具体不同 + var container; - if (top[1] === AUTO$8) { - if (bottom[1] === AUTO$8) { - var prev = _item2.prev; + for (var _i5 = 0, _len3 = absChildren.length; _i5 < _len3; _i5++) { + var _item2 = absChildren[_i5]; + var _item2$currentStyle = _item2.currentStyle, + top = _item2$currentStyle[TOP], + bottom = _item2$currentStyle[BOTTOM], + _height2 = _item2$currentStyle[HEIGHT]; // 是容器,所有的都调整,不是容器,其偏移是上级parent的某一个,根据情况具体不同 - while (prev) { - var target = prev; + if (top[1] === AUTO) { + if (bottom[1] === AUTO) { + var prev = _item2.prev; - if (target instanceof Component$1) { - target = target.shadowRoot; - } + while (prev) { + var target = prev; - var _isXom = target instanceof Xom$1; + if (target instanceof Component) { + target = target.shadowRoot; + } - var _cs2 = _isXom && target.currentStyle; + var _isXom = target instanceof Xom; - var isAbs = _isXom && _cs2[POSITION$5] === 'absolute'; + var _cs2 = _isXom && target.currentStyle; - if (!isAbs) { - var y = target.y + target.outerHeight; - var d = y - _item2.y; + var isAbs = _isXom && _cs2[POSITION] === 'absolute'; - if (d) { - _item2.__offsetY(d, true, REPAINT$3); - } + if (!isAbs) { + var y = target.y + target.outerHeight; + var d = y - _item2.y; - break; + if (d) { + _item2.__offsetY(d, true, REPAINT); } - prev = prev.prev; + break; } - } else if (bottom[1] === PX$b) { - _item2.__offsetY(_diff5, true, REPAINT$3); - } else if (bottom[1] === PERCENT$c) { - var v = (1 - bottom[0] * 0.01) * _diff5; - _item2.__offsetY(v, true, REPAINT$3); + prev = prev.prev; } - } else if (top[1] === PERCENT$c) { - if (isContainer) { - var _v = top[0] * 0.01 * _diff5; - - _item2.__offsetY(_v, true, REPAINT$3); - } // 非容器的特殊处理 - else { - if (!container) { - container = parent.domParent; - - while (container) { - if (container === root || container.isShadowRoot) { - break; - } + } else if (bottom[1] === PX) { + _item2.__offsetY(_diff5, true, REPAINT); + } else if (bottom[1] === PERCENT) { + var v = (1 - bottom[0] * 0.01) * _diff5; - var _cs3 = container.currentStyle; + _item2.__offsetY(v, true, REPAINT); + } + } else if (top[1] === PERCENT) { + if (isContainer) { + var _v = top[0] * 0.01 * _diff5; - if (_cs3[POSITION$5] === 'absolute' || _cs3[POSITION$5] === 'relative') { - break; - } + _item2.__offsetY(_v, true, REPAINT); + } // 非容器的特殊处理 + else { + if (!container) { + container = parent.domParent; - container = container.domParent; - } + while (container) { + if (container === root || container.isShadowRoot) { + break; } - if (container.currentStyle[HEIGHT$8][1] !== PX$b) { - var _v2 = top[0] * 0.01 * _diff5; + var _cs3 = container.currentStyle; - _item2.__offsetY(_v2, true, REPAINT$3); + if (_cs3[POSITION] === 'absolute' || _cs3[POSITION] === 'relative') { + break; } + + container = container.domParent; } - } // 高度百分比需发生变化的重新布局,需要在容器内 + } + if (container.currentStyle[HEIGHT][1] !== PX) { + var _v2 = top[0] * 0.01 * _diff5; + + _item2.__offsetY(_v2, true, REPAINT); + } + } + } // 高度百分比需发生变化的重新布局,需要在容器内 - if (_height2[1] === PERCENT$c) { - if (isContainer) { - parent.__layoutAbs(parent, null, _item2); - } // 不在容器内说明在上级,存入等结束后统一重新布局 - else { - if (!container) { - container = parent.domParent; - while (container) { - if (container === root || container.isShadowRoot) { - break; - } + if (_height2[1] === PERCENT) { + if (isContainer) { + parent.__layoutAbs(parent, null, _item2); + } // 不在容器内说明在上级,存入等结束后统一重新布局 + else { + if (!container) { + container = parent.domParent; - var _cs4 = container.currentStyle; + while (container) { + if (container === root || container.isShadowRoot) { + break; + } - if (_cs4[POSITION$5] === 'absolute' || _cs4[POSITION$5] === 'relative') { - break; - } + var _cs4 = container.currentStyle; - container = container.domParent; - } + if (_cs4[POSITION] === 'absolute' || _cs4[POSITION] === 'relative') { + break; } - inDirectAbsList.push([parent, container, _item2]); + container = container.domParent; } + } + + inDirectAbsList.push([parent, container, _item2]); } } - - reflow.offsetAndResizeByNodeOnY(parent, root, reflowHash, _diff5, inDirectAbsList); - return; } - } // 没有diff变化或者固定尺寸,可能内部发生变化,调整AUTO的abs,不递归向上 + reflow.offsetAndResizeByNodeOnY(parent, root, reflowHash, _diff5, inDirectAbsList); + return; + } + } // 没有diff变化或者固定尺寸,可能内部发生变化,调整AUTO的abs,不递归向上 - for (var _i6 = 0, _len4 = absChildren.length; _i6 < _len4; _i6++) { - var _item3 = absChildren[_i6]; - var _item3$currentStyle = _item3.currentStyle, - _top = _item3$currentStyle[TOP$4], - _bottom = _item3$currentStyle[BOTTOM$4]; - if (_top[1] === AUTO$8 && _bottom[1] === AUTO$8) { - var _prev = _item3.prev; + for (var _i6 = 0, _len4 = absChildren.length; _i6 < _len4; _i6++) { + var _item3 = absChildren[_i6]; + var _item3$currentStyle = _item3.currentStyle, + _top = _item3$currentStyle[TOP], + _bottom = _item3$currentStyle[BOTTOM]; - while (_prev) { - var _target = _prev; + if (_top[1] === AUTO && _bottom[1] === AUTO) { + var _prev = _item3.prev; - if (_target instanceof Component$1) { - _target = _target.shadowRoot; - } + while (_prev) { + var _target = _prev; - var _isXom2 = _target instanceof Xom$1; + if (_target instanceof Component) { + _target = _target.shadowRoot; + } - var _cs5 = _isXom2 && _target.currentStyle; + var _isXom2 = _target instanceof Xom; - var _isAbs = _isXom2 && _cs5[POSITION$5] === 'absolute'; + var _cs5 = _isXom2 && _target.currentStyle; - if (!_isAbs) { - var _y = _target.y + _target.outerHeight; + var _isAbs = _isXom2 && _cs5[POSITION] === 'absolute'; - var _d = _y - _item3.y; + if (!_isAbs) { + var _y = _target.y + _target.outerHeight; - if (_d) { - _item3.__offsetY(_d, true, REPAINT$3); - } + var _d = _y - _item3.y; - break; + if (_d) { + _item3.__offsetY(_d, true, REPAINT); } - _prev = _prev.prev; + break; } + + _prev = _prev.prev; } } - }); // merge过程中需要重新布局的abs - - inDirectAbsList.forEach(function (arr) { - arr[0].__layoutAbs(arr[1], null, arr[2]); - }); // 调整因reflow造成的原struct数据索引数量偏差,纯zIndex的已经在repaint里面重新生成过了 - // 这里因为和update保持一致的顺序,因此一定是先根顺序且互不包含 - - var diff = 0, - lastIndex = 0, - isFirst = true, - structs = root.__structs; - diffList.forEach(function (item) { - var _item4 = _slicedToArray(item, 2), - ns = _item4[0], - d = _item4[1]; // 第一个有变化的,及后面无论有无变化都需更新 - // 第1个变化区域无需更改前面一段 - - - if (isFirst) { - isFirst = false; - lastIndex = ns[STRUCT_INDEX$2] + (ns[STRUCT_TOTAL$2] || 0) + 1; - diff += d; - } // 第2+个变化区域看是否和前面一个相连,有不变的段则先偏移它,然后再偏移自己 - else { - var j = ns[STRUCT_INDEX$2] + (ns[STRUCT_TOTAL$2] || 0) + 1 + diff; + } + }); // merge过程中需要重新布局的abs + + inDirectAbsList.forEach(function (arr) { + arr[0].__layoutAbs(arr[1], null, arr[2]); + }); // 调整因reflow造成的原struct数据索引数量偏差,纯zIndex的已经在repaint里面重新生成过了 + // 这里因为和update保持一致的顺序,因此一定是先根顺序且互不包含 + + var diff = 0, + lastIndex = 0, + isFirst = true, + structs = root.__structs; + diffList.forEach(function (item) { + var _item4 = _slicedToArray(item, 2), + ns = _item4[0], + d = _item4[1]; // 第一个有变化的,及后面无论有无变化都需更新 + // 第1个变化区域无需更改前面一段 + + + if (isFirst) { + isFirst = false; + lastIndex = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1; + diff += d; + } // 第2+个变化区域看是否和前面一个相连,有不变的段则先偏移它,然后再偏移自己 + else { + var j = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1 + diff; - for (var _i7 = lastIndex; _i7 < j; _i7++) { - structs[_i7][STRUCT_INDEX$2] += diff; - } + for (var _i7 = lastIndex; _i7 < j; _i7++) { + structs[_i7][STRUCT_INDEX] += diff; + } - lastIndex = j; - diff += d; - } - }); // 后面的要根据偏移量校正索引 + lastIndex = j; + diff += d; + } + }); // 后面的要根据偏移量校正索引 - if (diff) { - for (var _i8 = lastIndex, _len5 = structs.length; _i8 < _len5; _i8++) { - structs[_i8][STRUCT_INDEX$2] += diff; - } - } // 清除id + if (diff) { + for (var _i8 = lastIndex, _len5 = structs.length; _i8 < _len5; _i8++) { + structs[_i8][STRUCT_INDEX] += diff; + } + } // 清除id - reflow.clearUniqueReflowId(reflowHash); - } + reflow.clearUniqueReflowId(reflowHash); + } } // 特殊覆盖方法,不需要super()计算自己,因为放在每次checkRoot()做过了 }, { @@ -33344,16 +33351,16 @@ var Root = /*#__PURE__*/function (_Dom) { }]); return Root; -}(Dom$1); +}(Dom); -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; -var isNil$9 = util.isNil; -var REM$b = o.REM, - VW$b = o.VW, - VH$b = o.VH; +var _enums$STYLE_KEY$5 = enums.STYLE_KEY, + STROKE_WIDTH$5 = _enums$STYLE_KEY$5.STROKE_WIDTH, + BOX_SHADOW$5 = _enums$STYLE_KEY$5.BOX_SHADOW, + FONT_SIZE$5 = _enums$STYLE_KEY$5.FONT_SIZE; +var isNil$6 = util.isNil; +var REM$5 = o$4.REM, + VW$5 = o$4.VW, + VH$5 = o$4.VH; function reBuild(target, origin, base, isMulti) { if (isMulti) { @@ -33395,7 +33402,7 @@ function curveNum(controlA, controlB) { return num; } -function limitStartEnd(v) { +function limitStartEnd$1(v) { if (v < 0) { v = 0; } else if (v > 1) { @@ -33411,7 +33418,7 @@ function getNewPoint(x1, y1, x2, y2, controlA, controlB, num) { if (start > 0 || end < 1) { if (num === 3) { - var _geom$sliceBezier2Bot = geom.sliceBezier2Both([[x1, y1], controlA, controlB, [x2, y2]], start, end); + var _geom$sliceBezier2Bot = geom$1.sliceBezier2Both([[x1, y1], controlA, controlB, [x2, y2]], start, end); var _geom$sliceBezier2Bot2 = _slicedToArray(_geom$sliceBezier2Bot, 4); @@ -33427,7 +33434,7 @@ function getNewPoint(x1, y1, x2, y2, controlA, controlB, num) { x2 = _geom$sliceBezier2Bot4[0]; y2 = _geom$sliceBezier2Bot4[1]; } else if (num === 2) { - var _geom$sliceBezier2Bot5 = geom.sliceBezier2Both([[x1, y1], controlB, [x2, y2]], start, end); + var _geom$sliceBezier2Bot5 = geom$1.sliceBezier2Both([[x1, y1], controlB, [x2, y2]], start, end); var _geom$sliceBezier2Bot6 = _slicedToArray(_geom$sliceBezier2Bot5, 3); @@ -33442,7 +33449,7 @@ function getNewPoint(x1, y1, x2, y2, controlA, controlB, num) { x2 = _geom$sliceBezier2Bot8[0]; y2 = _geom$sliceBezier2Bot8[1]; } else if (num === 1) { - var _geom$sliceBezier2Bot9 = geom.sliceBezier2Both([[x1, y1], controlA, [x2, y2]], start, end); + var _geom$sliceBezier2Bot9 = geom$1.sliceBezier2Both([[x1, y1], controlA, [x2, y2]], start, end); var _geom$sliceBezier2Bot10 = _slicedToArray(_geom$sliceBezier2Bot9, 3); @@ -33495,7 +33502,7 @@ var Line = /*#__PURE__*/function (_Geom) { _this.__x1 = props.x1.map(function (i) { return parseFloat(i) || 0; }); - } else if (!isNil$9(props.x1)) { + } else if (!isNil$6(props.x1)) { _this.__x1 = [parseFloat(props.x1) || 0]; } @@ -33503,7 +33510,7 @@ var Line = /*#__PURE__*/function (_Geom) { _this.__y1 = props.y1.map(function (i) { return parseFloat(i) || 0; }); - } else if (!isNil$9(props.y1)) { + } else if (!isNil$6(props.y1)) { _this.__y1 = [parseFloat(props.y1) || 0]; } @@ -33511,7 +33518,7 @@ var Line = /*#__PURE__*/function (_Geom) { _this.__x2 = props.x2.map(function (i) { return parseFloat(i) || 0; }); - } else if (!isNil$9(props.x2)) { + } else if (!isNil$6(props.x2)) { _this.__x2 = [parseFloat(props.x2) || 0]; } @@ -33519,7 +33526,7 @@ var Line = /*#__PURE__*/function (_Geom) { _this.__y2 = props.y2.map(function (i) { return parseFloat(i) || 0; }); - } else if (!isNil$9(props.y2)) { + } else if (!isNil$6(props.y2)) { _this.__y2 = [parseFloat(props.y2) || 0]; } @@ -33545,14 +33552,14 @@ var Line = /*#__PURE__*/function (_Geom) { if (Array.isArray(props.start)) { _this.__start = props.start.map(function (i) { - return limitStartEnd(parseFloat(i) || 0); + return limitStartEnd$1(parseFloat(i) || 0); }); for (var i = _this.__start.length; i < _this.__x1.length; i++) { _this.__start.push(0); } - } else if (!isNil$9(props.start)) { - var v = limitStartEnd(parseFloat(props.start) || 0); + } else if (!isNil$6(props.start)) { + var v = limitStartEnd$1(parseFloat(props.start) || 0); _this.__start = _this.__x1.map(function () { return v; }); @@ -33566,20 +33573,20 @@ var Line = /*#__PURE__*/function (_Geom) { v = 1; } - return limitStartEnd(v); + return limitStartEnd$1(v); }); for (var _i = _this.__end.length; _i < _this.__x1.length; _i++) { _this.__end.push(1); } - } else if (!isNil$9(props.end)) { + } else if (!isNil$6(props.end)) { var _v = parseFloat(props.end); if (isNaN(_v)) { _v = 1; } - _v = limitStartEnd(_v); + _v = limitStartEnd$1(_v); _this.__end = _this.__x1.map(function () { return _v; }); @@ -33590,34 +33597,34 @@ var Line = /*#__PURE__*/function (_Geom) { _this.__controlA = []; _this.__controlB = []; - if (!isNil$9(props.x1)) { + if (!isNil$6(props.x1)) { _this.__x1 = parseFloat(props.x1) || 0; } - if (!isNil$9(props.y1)) { + if (!isNil$6(props.y1)) { _this.__y1 = parseFloat(props.y1) || 0; } - if (!isNil$9(props.x2)) { + if (!isNil$6(props.x2)) { _this.__x2 = parseFloat(props.x2) || 0; } - if (!isNil$9(props.y2)) { + if (!isNil$6(props.y2)) { _this.__y2 = parseFloat(props.y2) || 0; } - if (!isNil$9(props.start)) { - _this.__start = limitStartEnd(parseFloat(props.start) || 0); + if (!isNil$6(props.start)) { + _this.__start = limitStartEnd$1(parseFloat(props.start) || 0); } - if (!isNil$9(props.end)) { + if (!isNil$6(props.end)) { var _v2 = parseFloat(props.end); if (isNaN(_v2)) { _v2 = 1; } - _this.__end = limitStartEnd(_v2); + _this.__end = limitStartEnd$1(_v2); } if (Array.isArray(props.controlA)) { @@ -33643,25 +33650,25 @@ var Line = /*#__PURE__*/function (_Geom) { isMulti = this.isMulti; var rebuild; ['x1', 'x2'].forEach(function (k) { - if (isNil$9(__cacheProps[k]) || focus) { + if (isNil$6(__cacheProps[k]) || focus) { rebuild = true; __cacheProps[k] = reBuild(_this2[k], originX, width, isMulti); } }); ['y1', 'y2'].forEach(function (k) { - if (isNil$9(__cacheProps[k]) || focus) { + if (isNil$6(__cacheProps[k]) || focus) { rebuild = true; __cacheProps[k] = reBuild(_this2[k], originY, height, isMulti); } }); ['controlA', 'controlB'].forEach(function (k) { - if (isNil$9(__cacheProps[k]) || focus) { + if (isNil$6(__cacheProps[k]) || focus) { rebuild = true; __cacheProps[k] = reBuildC(_this2[k], originX, originY, width, height, isMulti); } }); ['start', 'end'].forEach(function (k) { - if (isNil$9(__cacheProps[k]) || focus) { + if (isNil$6(__cacheProps[k]) || focus) { rebuild = true; __cacheProps[k] = _this2[k]; } @@ -33896,8 +33903,8 @@ var Line = /*#__PURE__*/function (_Geom) { originX = this.__sx3, originY = this.__sy3, _this$currentStyle = this.currentStyle, - strokeWidth = _this$currentStyle[STROKE_WIDTH$2], - boxShadow = _this$currentStyle[BOX_SHADOW$4]; + strokeWidth = _this$currentStyle[STROKE_WIDTH$5], + boxShadow = _this$currentStyle[BOX_SHADOW$5]; this.buildCache(originX, originY); var x1 = __cacheProps.x1, y1 = __cacheProps.y1, @@ -33910,11 +33917,11 @@ 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] * 0.5, half); - } else if (item[1] === VW$b) { + if (item[1] === REM$5) { + half = Math.max(item[0] * root.computedStyle[FONT_SIZE$5] * 0.5, half); + } else if (item[1] === VW$5) { half = Math.max(item[0] * root.width * 0.01 * 0.5, half); - } else if (item[1] === VH$b) { + } else if (item[1] === VH$5) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); @@ -33946,7 +33953,7 @@ var Line = /*#__PURE__*/function (_Geom) { var ca = controlA[i]; var cb = controlB[i]; - if ((isNil$9(ca) || ca.length < 2) && (isNil$9(cb) || cb.length < 2)) { + if ((isNil$6(ca) || ca.length < 2) && (isNil$6(cb) || cb.length < 2)) { bbox[0] = Math.min(bbox[0], xa - ox); bbox[0] = Math.min(bbox[0], xb - ox); bbox[1] = Math.min(bbox[1], ya - oy); @@ -33955,8 +33962,8 @@ var Line = /*#__PURE__*/function (_Geom) { bbox[2] = Math.max(bbox[2], xb + ox); bbox[3] = Math.max(bbox[3], ya + oy); bbox[3] = Math.max(bbox[3], yb + oy); - } else if (isNil$9(ca) || ca.length < 2) { - var bezierBox = geom.bboxBezier(xa, ya, cb[0], cb[1], xb, yb); + } else if (isNil$6(ca) || ca.length < 2) { + var bezierBox = geom$1.bboxBezier(xa, ya, cb[0], cb[1], xb, yb); bbox[0] = Math.min(bbox[0], bezierBox[0] - ox); bbox[0] = Math.min(bbox[0], bezierBox[2] - ox); bbox[1] = Math.min(bbox[1], bezierBox[1] - oy); @@ -33965,8 +33972,8 @@ var Line = /*#__PURE__*/function (_Geom) { bbox[2] = Math.max(bbox[2], bezierBox[2] + ox); bbox[3] = Math.max(bbox[3], bezierBox[1] + oy); bbox[3] = Math.max(bbox[3], bezierBox[3] + oy); - } else if (isNil$9(cb) || cb.length < 2) { - var _bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], xb, yb); + } else if (isNil$6(cb) || cb.length < 2) { + var _bezierBox = geom$1.bboxBezier(xa, ya, ca[0], ca[1], xb, yb); bbox[0] = Math.min(bbox[0], _bezierBox[0] - ox); bbox[0] = Math.min(bbox[0], _bezierBox[2] - ox); @@ -33977,7 +33984,7 @@ var Line = /*#__PURE__*/function (_Geom) { bbox[3] = Math.max(bbox[3], _bezierBox[1] + oy); bbox[3] = Math.max(bbox[3], _bezierBox[3] + oy); } else { - var _bezierBox2 = geom.bboxBezier(xa, ya, ca[0], ca[1], cb[0], cb[1], xb, yb); + var _bezierBox2 = geom$1.bboxBezier(xa, ya, ca[0], ca[1], cb[0], cb[1], xb, yb); bbox[0] = Math.min(bbox[0], _bezierBox2[0] - ox); bbox[0] = Math.min(bbox[0], _bezierBox2[2] - ox); @@ -33994,16 +34001,16 @@ var Line = /*#__PURE__*/function (_Geom) { }]); return Line; -}(Geom$1); +}(Geom); -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; -var isNil$a = util.isNil; -var REM$c = o.REM, - VW$c = o.VW, - VH$c = o.VH; +var _enums$STYLE_KEY$4 = enums.STYLE_KEY, + STROKE_WIDTH$4 = _enums$STYLE_KEY$4.STROKE_WIDTH, + BOX_SHADOW$4 = _enums$STYLE_KEY$4.BOX_SHADOW, + FONT_SIZE$4 = _enums$STYLE_KEY$4.FONT_SIZE; +var isNil$5 = util.isNil; +var REM$4 = o$4.REM, + VW$4 = o$4.VW, + VH$4 = o$4.VH; function concatPointAndControl(point, control) { if (Array.isArray(control) && (control.length === 2 || control.length === 4) && Array.isArray(point) && point.length === 2) { @@ -34013,7 +34020,7 @@ function concatPointAndControl(point, control) { return point; } -function limitStartEnd$1(v) { +function limitStartEnd(v) { if (v < 0) { v = 0; } else if (v > 1) { @@ -34068,14 +34075,14 @@ function getLength(list, isMulti) { increase.push(total); prev = _item; } else if (_item.length === 4) { - var _c = geom.bezierLength([prev, [_item[0], _item[1]], [_item[2], _item[3]]], 2); + var _c = geom$1.bezierLength([prev, [_item[0], _item[1]], [_item[2], _item[3]]], 2); res.push(_c); total += _c; increase.push(total); prev = [_item[2], _item[3]]; } else if (_item.length === 6) { - var _c2 = geom.bezierLength([prev, [_item[0], _item[1]], [_item[2], _item[3]], [_item[4], _item[5]]], 3); + var _c2 = geom$1.bezierLength([prev, [_item[0], _item[1]], [_item[2], _item[3]], [_item[4], _item[5]]], 3); res.push(_c2); total += _c2; @@ -34162,10 +34169,10 @@ function getNewList(list, len) { list[j + 1] = [current[1] - (1 - t) * a, current[1] - (1 - t) * b]; } else if (current.length === 4) { - var res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t); + var res = geom$1.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t); list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]]; } else if (current.length === 6) { - var _res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t); + var _res = geom$1.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t); list[j + 1] = [_res[1][0], _res[1][1], _res[2][0], _res[2][1], _res[3][0], _res[3][1]]; } @@ -34202,12 +34209,12 @@ function getNewList(list, len) { list[i] = [_prev[0] + _t * _a, _prev[1] + _t * _b]; } else if (_current.length === 4) { - var _res2 = geom.sliceBezier([[_current[2], _current[3]], [_current[0], _current[1]], _prev], 1 - _t).reverse(); + var _res2 = geom$1.sliceBezier([[_current[2], _current[3]], [_current[0], _current[1]], _prev], 1 - _t).reverse(); list[i] = _res2[0]; list[i + 1] = [_res2[1][0], _res2[1][1], _res2[2][0], _res2[2][1]]; } else if (_current.length === 6) { - var _res3 = geom.sliceBezier([[_current[4], _current[5]], [_current[2], _current[3]], [_current[0], _current[1]], _prev], 1 - _t).reverse(); + var _res3 = geom$1.sliceBezier([[_current[4], _current[5]], [_current[2], _current[3]], [_current[0], _current[1]], _prev], 1 - _t).reverse(); list[i] = _res3[0]; list[i + 1] = [_res3[1][0], _res3[1][1], _res3[2][0], _res3[2][1], _current[4], _current[5]]; @@ -34245,14 +34252,14 @@ var Polyline = /*#__PURE__*/function (_Geom) { if (Array.isArray(props.start)) { _this.__start = props.start.map(function (i) { - return limitStartEnd$1(parseFloat(i) || 0); + return limitStartEnd(parseFloat(i) || 0); }); for (var i = _this.__start.length; i < _this.__points.length; i++) { _this.__start.push(0); } - } else if (!isNil$a(props.start)) { - var v = limitStartEnd$1(parseFloat(props.start) || 0); + } else if (!isNil$5(props.start)) { + var v = limitStartEnd(parseFloat(props.start) || 0); _this.__start = _this.__points.map(function () { return v; }); @@ -34266,20 +34273,20 @@ var Polyline = /*#__PURE__*/function (_Geom) { v = 1; } - return limitStartEnd$1(v); + return limitStartEnd(v); }); for (var _i2 = _this.__end.length; _i2 < _this.__points.length; _i2++) { _this.__end.push(1); } - } else if (!isNil$a(props.end)) { + } else if (!isNil$5(props.end)) { var _v = parseFloat(props.end); if (isNaN(_v)) { _v = 1; } - _v = limitStartEnd$1(_v); + _v = limitStartEnd(_v); _this.__end = _this.__points.map(function () { return _v; }); @@ -34291,18 +34298,18 @@ var Polyline = /*#__PURE__*/function (_Geom) { _this.__start = 0; _this.__end = 1; - if (!isNil$a(props.start)) { - _this.__start = limitStartEnd$1(parseFloat(props.start) || 0); + if (!isNil$5(props.start)) { + _this.__start = limitStartEnd(parseFloat(props.start) || 0); } - if (!isNil$a(props.end)) { + if (!isNil$5(props.end)) { var _v2 = parseFloat(props.end); if (isNaN(_v2)) { _v2 = 1; } - _this.__end = limitStartEnd$1(_v2); + _this.__end = limitStartEnd(_v2); } } @@ -34365,7 +34372,7 @@ var Polyline = /*#__PURE__*/function (_Geom) { isMulti = this.isMulti; var rebuild, rebuildSE; - if (isNil$a(__cacheProps.points)) { + if (isNil$5(__cacheProps.points)) { rebuild = true; if (isMulti) { @@ -34379,7 +34386,7 @@ var Polyline = /*#__PURE__*/function (_Geom) { } } - if (isNil$a(__cacheProps.controls)) { + if (isNil$5(__cacheProps.controls)) { rebuild = true; if (isMulti) { @@ -34395,12 +34402,12 @@ var Polyline = /*#__PURE__*/function (_Geom) { } } - if (isNil$a(__cacheProps.start)) { + if (isNil$5(__cacheProps.start)) { rebuildSE = true; __cacheProps.start = start; } - if (isNil$a(__cacheProps.end)) { + if (isNil$5(__cacheProps.end)) { rebuildSE = true; __cacheProps.end = end; } // points/controls有变化就需要重建顶点 @@ -34506,19 +34513,19 @@ var Polyline = /*#__PURE__*/function (_Geom) { originX = this.__sx3, originY = this.__sy3, _this$currentStyle = this.currentStyle, - strokeWidth = _this$currentStyle[STROKE_WIDTH$3], - boxShadow = _this$currentStyle[BOX_SHADOW$5]; + strokeWidth = _this$currentStyle[STROKE_WIDTH$4], + boxShadow = _this$currentStyle[BOX_SHADOW$4]; this.buildCache(originX, originY); var bbox = _get(_getPrototypeOf(Polyline.prototype), "bbox", this); var half = 0; strokeWidth.forEach(function (item) { - if (item[1] === REM$c) { - half = Math.max(item[0] * root.computedStyle[FONT_SIZE$d] * 0.5, half); - } else if (item[1] === VW$c) { + if (item[1] === REM$4) { + half = Math.max(item[0] * root.computedStyle[FONT_SIZE$4] * 0.5, half); + } else if (item[1] === VW$4) { half = Math.max(item[0] * root.width * 0.01 * 0.5, half); - } else if (item[1] === VH$c) { + } else if (item[1] === VH$4) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); @@ -34560,13 +34567,13 @@ var Polyline = /*#__PURE__*/function (_Geom) { var c = controlList[_i4 - 1]; if (c && c.length === 4) { - var bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], c[2], c[3], xb, yb); + var bezierBox = geom$1.bboxBezier(xa, ya, c[0], c[1], c[2], c[3], xb, yb); bbox[0] = Math.min(bbox[0], bezierBox[0] - ox); bbox[1] = Math.min(bbox[1], bezierBox[1] - oy); bbox[2] = Math.max(bbox[2], bezierBox[2] + ox); bbox[3] = Math.max(bbox[3], bezierBox[3] + oy); } else if (c && c.length === 2) { - var _bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], xb, yb); + var _bezierBox = geom$1.bboxBezier(xa, ya, c[0], c[1], xb, yb); bbox[0] = Math.min(bbox[0], _bezierBox[0] - ox); bbox[1] = Math.min(bbox[1], _bezierBox[1] - oy); @@ -34591,7 +34598,7 @@ var Polyline = /*#__PURE__*/function (_Geom) { }]); return Polyline; -}(Geom$1); +}(Geom); var Polygon = /*#__PURE__*/function (_Polyline) { _inherits(Polygon, _Polyline); @@ -34620,17 +34627,17 @@ 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; -var isNil$b = util.isNil; -var sectorPoints$1 = geom.sectorPoints; -var REM$d = o.REM, - VW$d = o.VW, - VH$d = o.VH; - -function getR(v, dft) { +var _enums$STYLE_KEY$3 = enums.STYLE_KEY, + STROKE_WIDTH$3 = _enums$STYLE_KEY$3.STROKE_WIDTH, + BOX_SHADOW$3 = _enums$STYLE_KEY$3.BOX_SHADOW, + FONT_SIZE$3 = _enums$STYLE_KEY$3.FONT_SIZE; +var isNil$4 = util.isNil; +var sectorPoints = geom$1.sectorPoints; +var REM$3 = o$4.REM, + VW$3 = o$4.VW, + VH$3 = o$4.VH; + +function getR$3(v, dft) { v = parseFloat(v); if (isNaN(v)) { @@ -34659,19 +34666,19 @@ var Sector = /*#__PURE__*/function (_Geom) { if (Array.isArray(props.begin)) { _this.__begin = props.begin.map(function (i) { - return getR(i, 0); + return getR$3(i, 0); }); } if (Array.isArray(props.end)) { _this.__end = props.end.map(function (i) { - return getR(i, 0); + return getR$3(i, 0); }); } if (Array.isArray(props.r)) { _this.__r = props.r.map(function (i) { - return getR(i, 1); + return getR$3(i, 1); }); } @@ -34695,23 +34702,23 @@ var Sector = /*#__PURE__*/function (_Geom) { _this.__closure = false; - if (!isNil$b(props.begin)) { - _this.__begin = getR(props.begin, 0); + if (!isNil$4(props.begin)) { + _this.__begin = getR$3(props.begin, 0); } - if (!isNil$b(props.end)) { - _this.__end = getR(props.end, 0); + if (!isNil$4(props.end)) { + _this.__end = getR$3(props.end, 0); } - if (!isNil$b(props.r)) { - _this.__r = getR(props.r, 1); + if (!isNil$4(props.r)) { + _this.__r = getR$3(props.r, 1); } - if (!isNil$b(props.edge)) { + if (!isNil$4(props.edge)) { _this.__edge = !!props.edge; } - if (!isNil$b(props.closure)) { + if (!isNil$4(props.closure)) { _this.__closure = !!props.closure; } } @@ -34732,17 +34739,17 @@ var Sector = /*#__PURE__*/function (_Geom) { isMulti = this.isMulti; var rebuild; - if (isNil$b(__cacheProps.begin) || focus) { + if (isNil$4(__cacheProps.begin) || focus) { rebuild = true; __cacheProps.begin = (begin || 0) % 360; } - if (isNil$b(__cacheProps.end) || focus) { + if (isNil$4(__cacheProps.end) || focus) { rebuild = true; __cacheProps.end = (end || 0) % 360; } - if (isNil$b(__cacheProps.r) || focus) { + if (isNil$4(__cacheProps.r) || focus) { rebuild = true; if (isMulti) { @@ -34756,12 +34763,12 @@ var Sector = /*#__PURE__*/function (_Geom) { r = __cacheProps.r; - if (isNil$b(__cacheProps.edge) || focus) { + if (isNil$4(__cacheProps.edge) || focus) { rebuild = true; __cacheProps.edge = edge; } - if (isNil$b(__cacheProps.closure) || focus) { + if (isNil$4(__cacheProps.closure) || focus) { rebuild = true; __cacheProps.closure = closure; } @@ -34771,8 +34778,8 @@ var Sector = /*#__PURE__*/function (_Geom) { __cacheProps.list = []; __cacheProps.sList = []; begin.forEach(function (begin, i) { - var r2 = isNil$b(r[i]) ? width * 0.5 : r[i]; - var list = sectorPoints$1(cx, cy, r2, parseFloat(begin || 0) % 360, parseFloat(end[i] || 0) % 360); + var r2 = isNil$4(r[i]) ? width * 0.5 : r[i]; + var list = sectorPoints(cx, cy, r2, parseFloat(begin || 0) % 360, parseFloat(end[i] || 0) % 360); var sList = list.slice(0); if (closure[i]) { @@ -34796,7 +34803,7 @@ var Sector = /*#__PURE__*/function (_Geom) { __cacheProps.sList.push(sList); }); } else { - var list = sectorPoints$1(cx, cy, r, parseFloat(begin || 0), parseFloat(end || 0)); + var list = sectorPoints(cx, cy, r, parseFloat(begin || 0), parseFloat(end || 0)); var sList = list.slice(0); if (closure) { @@ -34867,41 +34874,41 @@ var Sector = /*#__PURE__*/function (_Geom) { this.__renderOneSector(renderMode, ctx, isMulti, list, sList, o); } // 多个需要fill在下面,stroke在上面,依次循环 else { - for (var i = 0, len = fills.length; i < len; i++) { - var fill = fills[i]; - - if (fill) { - var _o = { - fill: fill, - fillRule: fillRules[i], - dx: dx, - dy: dy - }; + for (var i = 0, len = fills.length; i < len; i++) { + var fill = fills[i]; + + if (fill) { + var _o = { + fill: fill, + fillRule: fillRules[i], + dx: dx, + dy: dy + }; - this.__renderOneSector(renderMode, ctx, isMulti, list, sList, _o); - } + this.__renderOneSector(renderMode, ctx, isMulti, list, sList, _o); } + } - for (var _i = 0, _len = strokes.length; _i < _len; _i++) { - var stroke = strokes[_i]; - - if (stroke) { - var _o2 = { - stroke: stroke, - strokeWidth: strokeWidths[_i], - strokeDasharray: strokeDasharrays[_i], - strokeDasharrayStr: strokeDasharrayStrs[_i], - strokeLinecap: strokeLinecaps[_i], - strokeLinejoin: strokeLinejoins[_i], - strokeMiterlimit: strokeMiterlimits[_i], - dx: dx, - dy: dy - }; + for (var _i = 0, _len = strokes.length; _i < _len; _i++) { + var stroke = strokes[_i]; - this.__renderOnePolygon(renderMode, ctx, isMulti, list, sList, _o2); - } + if (stroke) { + var _o2 = { + stroke: stroke, + strokeWidth: strokeWidths[_i], + strokeDasharray: strokeDasharrays[_i], + strokeDasharrayStr: strokeDasharrayStrs[_i], + strokeLinecap: strokeLinecaps[_i], + strokeLinejoin: strokeLinejoins[_i], + strokeMiterlimit: strokeMiterlimits[_i], + dx: dx, + dy: dy + }; + + this.__renderOnePolygon(renderMode, ctx, isMulti, list, sList, _o2); } } + } return res; } @@ -35013,8 +35020,8 @@ var Sector = /*#__PURE__*/function (_Geom) { width = this.width, height = this.height, _this$currentStyle = this.currentStyle, - strokeWidth = _this$currentStyle[STROKE_WIDTH$4], - boxShadow = _this$currentStyle[BOX_SHADOW$6]; + strokeWidth = _this$currentStyle[STROKE_WIDTH$3], + boxShadow = _this$currentStyle[BOX_SHADOW$3]; var cx = originX + width * 0.5; var cy = originY + height * 0.5; this.buildCache(cx, cy); @@ -35036,11 +35043,11 @@ 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] * 0.5, half); - } else if (item[1] === VW$d) { + if (item[1] === REM$3) { + half = Math.max(item[0] * root.computedStyle[FONT_SIZE$3] * 0.5, half); + } else if (item[1] === VW$3) { half = Math.max(item[0] * root.width * 0.01 * 0.5, half); - } else if (item[1] === VH$d) { + } else if (item[1] === VH$3) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); @@ -35071,16 +35078,16 @@ var Sector = /*#__PURE__*/function (_Geom) { }]); return Sector; -}(Geom$1); +}(Geom); -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; -var isNil$c = util.isNil; -var REM$e = o.REM, - VW$e = o.VW, - VH$e = o.VH; +var _enums$STYLE_KEY$2 = enums.STYLE_KEY, + STROKE_WIDTH$2 = _enums$STYLE_KEY$2.STROKE_WIDTH, + BOX_SHADOW$2 = _enums$STYLE_KEY$2.BOX_SHADOW, + FONT_SIZE$2 = _enums$STYLE_KEY$2.FONT_SIZE; +var isNil$3 = util.isNil; +var REM$2 = o$4.REM, + VW$2 = o$4.VW, + VH$2 = o$4.VH; function genVertex(x, y, width, height) { var rx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; @@ -35090,12 +35097,12 @@ function genVertex(x, y, width, height) { return [[x, y], [x + width, y], [x + width, y + height], [x, y + height], [x, y]]; } - var ox = rx * geom.H; - var oy = ry * geom.H; + var ox = rx * geom$1.H; + var oy = ry * geom$1.H; return [[x + rx, y], [x + width - rx, y], [x + width + ox - rx, y, x + width, y + ry - oy, x + width, y + ry], [x + width, y + height - ry], [x + width, y + height + oy - ry, x + width + ox - rx, y + height, x + width - rx, y + height], [x + rx, y + height], [x + rx - ox, y + height, x, y + height + oy - ry, x, y + height - ry], [x, y + ry], [x, y + ry - oy, x + rx - ox, y, x + rx, y]]; } -function getR$1(v) { +function getR$2(v) { v = parseFloat(v); if (isNaN(v)) { @@ -35123,24 +35130,24 @@ var Rect = /*#__PURE__*/function (_Geom) { if (Array.isArray(props.rx)) { _this.__rx = props.rx.map(function (i) { - return getR$1(i); + return getR$2(i); }); } if (Array.isArray(props.ry)) { _this.__ry = props.ry.map(function (i) { - return getR$1(i); + return getR$2(i); }); } } else { _this.__rx = _this.__ry = 0; - if (!isNil$c(props.rx)) { - _this.__rx = getR$1(props.rx); + if (!isNil$3(props.rx)) { + _this.__rx = getR$2(props.rx); } - if (!isNil$c(props.ry)) { - _this.__ry = getR$1(props.ry); + if (!isNil$3(props.ry)) { + _this.__ry = getR$2(props.ry); } } @@ -35158,7 +35165,7 @@ var Rect = /*#__PURE__*/function (_Geom) { isMulti = this.isMulti; var rebuild; - if (isNil$c(__cacheProps.rx) || focus) { + if (isNil$3(__cacheProps.rx) || focus) { rebuild = true; if (isMulti) { @@ -35170,7 +35177,7 @@ var Rect = /*#__PURE__*/function (_Geom) { } } - if (isNil$c(__cacheProps.ry) || focus) { + if (isNil$3(__cacheProps.ry) || focus) { rebuild = true; if (isMulti) { @@ -35233,19 +35240,19 @@ var Rect = /*#__PURE__*/function (_Geom) { width = this.width, height = this.height, _this$currentStyle = this.currentStyle, - strokeWidth = _this$currentStyle[STROKE_WIDTH$5], - boxShadow = _this$currentStyle[BOX_SHADOW$7]; + strokeWidth = _this$currentStyle[STROKE_WIDTH$2], + boxShadow = _this$currentStyle[BOX_SHADOW$2]; this.buildCache(originX, originY); var bbox = _get(_getPrototypeOf(Rect.prototype), "bbox", this); var half = 0; strokeWidth.forEach(function (item) { - if (item[1] === REM$e) { - half = Math.max(item[0] * root.computedStyle[FONT_SIZE$f] * 0.5, half); - } else if (item[1] === VW$e) { + if (item[1] === REM$2) { + half = Math.max(item[0] * root.computedStyle[FONT_SIZE$2] * 0.5, half); + } else if (item[1] === VW$2) { half = Math.max(item[0] * root.width * 0.01 * 0.5, half); - } else if (item[1] === VH$e) { + } else if (item[1] === VH$2) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); @@ -35272,18 +35279,18 @@ var Rect = /*#__PURE__*/function (_Geom) { }]); return Rect; -}(Geom$1); +}(Geom); -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; -var isNil$d = util.isNil; -var REM$f = o.REM, - VW$f = o.VW, - VH$f = o.VH; +var _enums$STYLE_KEY$1 = enums.STYLE_KEY, + STROKE_WIDTH$1 = _enums$STYLE_KEY$1.STROKE_WIDTH, + BOX_SHADOW$1 = _enums$STYLE_KEY$1.BOX_SHADOW, + FONT_SIZE$1 = _enums$STYLE_KEY$1.FONT_SIZE; +var isNil$2 = util.isNil; +var REM$1 = o$4.REM, + VW$1 = o$4.VW, + VH$1 = o$4.VH; -function getR$2(v) { +function getR$1(v) { v = parseFloat(v); if (isNaN(v)) { @@ -35310,16 +35317,16 @@ var Circle = /*#__PURE__*/function (_Geom) { if (Array.isArray(props.r)) { _this.__r = props.r.map(function (i) { - return getR$2(i); + return getR$1(i); }); - } else if (!isNil$d(props.r)) { - _this.__r = getR$2(props.r); + } else if (!isNil$2(props.r)) { + _this.__r = getR$1(props.r); } } else { _this.__r = 1; - if (!isNil$d(props.r)) { - _this.__r = getR$2(props.r); + if (!isNil$2(props.r)) { + _this.__r = getR$1(props.r); } } @@ -35334,17 +35341,17 @@ var Circle = /*#__PURE__*/function (_Geom) { __cacheProps = this.__cacheProps, isMulti = this.isMulti; - if (isNil$d(__cacheProps.r) || focus) { + if (isNil$2(__cacheProps.r) || focus) { if (isMulti) { __cacheProps.r = r.map(function (i) { return i * width * 0.5; }); __cacheProps.list = __cacheProps.r.map(function (r) { - return geom.ellipsePoints(cx, cy, r); + return geom$1.ellipsePoints(cx, cy, r); }); } else { __cacheProps.r = r * width * 0.5; - __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r); + __cacheProps.list = geom$1.ellipsePoints(cx, cy, __cacheProps.r); } } } @@ -35381,8 +35388,8 @@ var Circle = /*#__PURE__*/function (_Geom) { width = this.width, height = this.height, _this$currentStyle = this.currentStyle, - strokeWidth = _this$currentStyle[STROKE_WIDTH$6], - boxShadow = _this$currentStyle[BOX_SHADOW$8]; + strokeWidth = _this$currentStyle[STROKE_WIDTH$1], + boxShadow = _this$currentStyle[BOX_SHADOW$1]; var cx = originX + width * 0.5; var cy = originY + height * 0.5; this.buildCache(cx, cy); @@ -35404,11 +35411,11 @@ 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] * 0.5, half); - } else if (item[1] === VW$f) { + if (item[1] === REM$1) { + half = Math.max(item[0] * root.computedStyle[FONT_SIZE$1] * 0.5, half); + } else if (item[1] === VW$1) { half = Math.max(item[0] * root.width * 0.01 * 0.5, half); - } else if (item[1] === VH$f) { + } else if (item[1] === VH$1) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); @@ -35439,18 +35446,18 @@ var Circle = /*#__PURE__*/function (_Geom) { }]); return Circle; -}(Geom$1); +}(Geom); -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; -var isNil$e = util.isNil; -var REM$g = o.REM, - VW$g = o.VW, - VH$g = o.VH; - -function getR$3(v) { +var _enums$STYLE_KEY = enums.STYLE_KEY, + STROKE_WIDTH = _enums$STYLE_KEY.STROKE_WIDTH, + BOX_SHADOW = _enums$STYLE_KEY.BOX_SHADOW, + FONT_SIZE = _enums$STYLE_KEY.FONT_SIZE; +var isNil$1 = util.isNil; +var REM = o$4.REM, + VW = o$4.VW, + VH = o$4.VH; + +function getR(v) { v = parseFloat(v); if (isNaN(v)) { @@ -35478,30 +35485,30 @@ var Ellipse = /*#__PURE__*/function (_Geom) { if (Array.isArray(props.rx)) { _this.__rx = props.rx.map(function (i) { - return getR$3(i); + return getR(i); }); - } else if (!isNil$e(props.rx)) { - _this.__rx = [getR$3(props.rx)]; + } else if (!isNil$1(props.rx)) { + _this.__rx = [getR(props.rx)]; } if (Array.isArray(props.ry)) { _this.__ry = props.ry.map(function (i) { - return getR$3(i); + return getR(i); }); - } else if (!isNil$e(props.ry)) { - _this.__ry = [getR$3(props.ry)]; + } else if (!isNil$1(props.ry)) { + _this.__ry = [getR(props.ry)]; } } else { _this.__rx = 1; - if (!isNil$e(props.rx)) { - _this.__rx = getR$3(props.rx); + if (!isNil$1(props.rx)) { + _this.__rx = getR(props.rx); } _this.__ry = 1; - if (!isNil$e(props.ry)) { - _this.__ry = getR$3(props.ry); + if (!isNil$1(props.ry)) { + _this.__ry = getR(props.ry); } } @@ -35519,7 +35526,7 @@ var Ellipse = /*#__PURE__*/function (_Geom) { isMulti = this.isMulti; var rebuild; - if (isNil$e(__cacheProps.rx) || focus) { + if (isNil$1(__cacheProps.rx) || focus) { rebuild = true; if (isMulti) { @@ -35531,7 +35538,7 @@ var Ellipse = /*#__PURE__*/function (_Geom) { } } - if (isNil$e(__cacheProps.ry) || focus) { + if (isNil$1(__cacheProps.ry) || focus) { rebuild = true; if (isMulti) { @@ -35549,10 +35556,10 @@ var Ellipse = /*#__PURE__*/function (_Geom) { if (isMulti) { __cacheProps.list = _rx.map(function (rx, i) { - return geom.ellipsePoints(cx, cy, rx, _ry[i]); + return geom$1.ellipsePoints(cx, cy, rx, _ry[i]); }); } else { - __cacheProps.list = geom.ellipsePoints(cx, cy, _rx, _ry); + __cacheProps.list = geom$1.ellipsePoints(cx, cy, _rx, _ry); } } @@ -35596,8 +35603,8 @@ var Ellipse = /*#__PURE__*/function (_Geom) { width = this.width, height = this.height, _this$currentStyle = this.currentStyle, - strokeWidth = _this$currentStyle[STROKE_WIDTH$7], - boxShadow = _this$currentStyle[BOX_SHADOW$9]; + strokeWidth = _this$currentStyle[STROKE_WIDTH], + boxShadow = _this$currentStyle[BOX_SHADOW]; var cx = originX + width * 0.5; var cy = originY + height * 0.5; this.buildCache(cx, cy); @@ -35624,11 +35631,11 @@ 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] * 0.5, half); - } else if (item[1] === VW$g) { + if (item[1] === REM) { + half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half); + } else if (item[1] === VW) { half = Math.max(item[0] * root.width * 0.01 * 0.5, half); - } else if (item[1] === VH$g) { + } else if (item[1] === VH) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); @@ -35659,7 +35666,7 @@ var Ellipse = /*#__PURE__*/function (_Geom) { }]); return Ellipse; -}(Geom$1); +}(Geom); var fullCssProperty = { skewX: 'kx', @@ -35677,7 +35684,7 @@ var fullCssProperty = { perspective: 'ppt', rotate3d: 'r3' }; -var abbrCssProperty = { +var abbrCssProperty$1 = { os: 'offset', // 非css属性不会被下面反向遍历插入,手动 e: 'easing' @@ -35686,7 +35693,7 @@ var fullAnimate = { value: 'v', options: 'o' }; -var abbrAnimate = {}; +var abbrAnimate$1 = {}; var fullAnimateOption = { duration: 'dt', delay: 'd', @@ -35698,43 +35705,43 @@ var fullAnimateOption = { playbackRate: 'p', spfLimit: 'sl' }; -var abbrAnimateOption = {}; +var abbrAnimateOption$1 = {}; reset.DOM_KEY_SET.concat(reset.GEOM_KEY_SET).forEach(function (k) { if (fullCssProperty.hasOwnProperty(k)) { - abbrCssProperty[fullCssProperty[k]] = k; + abbrCssProperty$1[fullCssProperty[k]] = k; return; } var v = k.charAt(0) + k.replace(/[a-z]/g, '').toLowerCase(); fullCssProperty[k] = v; - abbrCssProperty[v] = k; + abbrCssProperty$1[v] = k; }); Object.keys(fullAnimate).forEach(function (k) { - abbrAnimate[fullAnimate[k]] = k; + abbrAnimate$1[fullAnimate[k]] = k; }); Object.keys(fullAnimateOption).forEach(function (k) { - abbrAnimateOption[fullAnimateOption[k]] = k; + abbrAnimateOption$1[fullAnimateOption[k]] = k; }); -var abbr$1 = { +var abbr = { fullCssProperty: fullCssProperty, - abbrCssProperty: abbrCssProperty, + abbrCssProperty: abbrCssProperty$1, fullAnimate: fullAnimate, - abbrAnimate: abbrAnimate, + abbrAnimate: abbrAnimate$1, fullAnimateOption: fullAnimateOption, - abbrAnimateOption: abbrAnimateOption + abbrAnimateOption: abbrAnimateOption$1 }; -var TYPE_VD$4 = $$type.TYPE_VD, - TYPE_GM$4 = $$type.TYPE_GM, - TYPE_CP$4 = $$type.TYPE_CP; -var isNil$f = util.isNil, - isFunction$8 = util.isFunction, +var TYPE_VD = $$type.TYPE_VD, + TYPE_GM = $$type.TYPE_GM, + TYPE_CP = $$type.TYPE_CP; +var isNil = util.isNil, + isFunction = util.isFunction, isPrimitive = util.isPrimitive, - clone$4 = util.clone, - extend$2 = util.extend; -var abbrCssProperty$1 = abbr$1.abbrCssProperty, - abbrAnimateOption$1 = abbr$1.abbrAnimateOption, - abbrAnimate$1 = abbr$1.abbrAnimate; + clone = util.clone, + extend = util.extend; +var abbrCssProperty = abbr.abbrCssProperty, + abbrAnimateOption = abbr.abbrAnimateOption, + abbrAnimate = abbr.abbrAnimate; /** * 还原缩写到全称,涉及样式和动画属性 * @param target 还原的对象 @@ -35755,11 +35762,11 @@ function abbr2full(target, hash) { } } // 普通样式缩写还原 else if (hash.hasOwnProperty(k)) { - var _fk = hash[k]; - target[_fk] = target[k]; // 删除以免二次解析 + var _fk = hash[k]; + target[_fk] = target[k]; // 删除以免二次解析 - delete target[k]; - } + delete target[k]; + } }); } } @@ -35800,7 +35807,7 @@ function replaceVars(json, vars) { } // 支持函数模式和值模式 - if (isFunction$8(v)) { + if (isFunction(v)) { v = v(target(k)); } @@ -35855,7 +35862,7 @@ function replaceVars(json, vars) { } // 支持函数模式和值模式 - if (isFunction$8(value)) { + if (isFunction(value)) { value = value(v); } @@ -35899,7 +35906,7 @@ function replaceLibraryVars(json, hash, vars) { if (i === len - 1) { var v = vars[id]; // 支持函数模式和值模式 - if (isFunction$8(v)) { + if (isFunction(v)) { v = v(target(k)); } @@ -35912,8 +35919,8 @@ function replaceLibraryVars(json, hash, vars) { }, v); } // 替换library中子对象的一个属性直接赋值 else { - target[k] = v; - } + target[k] = v; + } } else { target = target[k]; } @@ -35928,38 +35935,38 @@ function replaceLibraryVars(json, hash, vars) { } } // 兼容老版var- else { - Object.keys(json).forEach(function (k) { - if (k.indexOf('var-library.') === 0) { - var v = json[k]; // 直接移除library插槽,防止下面调用replaceVars(json, vars)时报错 + Object.keys(json).forEach(function (k) { + if (k.indexOf('var-library.') === 0) { + var v = json[k]; // 直接移除library插槽,防止下面调用replaceVars(json, vars)时报错 - delete json[k]; + delete json[k]; - if (!v) { - return; - } + if (!v) { + return; + } - var k2 = k.slice(12); // 有id且变量里面传入了替换的值 + var k2 = k.slice(12); // 有id且变量里面传入了替换的值 - if (k2 && v.id && vars.hasOwnProperty(v.id)) { - var value = vars[v.id]; + if (k2 && v.id && vars.hasOwnProperty(v.id)) { + var value = vars[v.id]; - if (isFunction$8(value)) { - value = value(v); - } // 替换图层的值必须是一个有tagName的对象 + if (isFunction(value)) { + value = value(v); + } // 替换图层的值必须是一个有tagName的对象 - if (!value || !value.tagName) { - return; - } // library对象也要加上id,与正常的library保持一致 + if (!value || !value.tagName) { + return; + } // library对象也要加上id,与正常的library保持一致 - hash[k2] = Object.assign({ - id: k2 - }, value); - } + hash[k2] = Object.assign({ + id: k2 + }, value); } - }); - } + } + }); + } } } /** @@ -35975,7 +35982,7 @@ function replaceLibraryVars(json, hash, vars) { function linkLibrary(item, hash) { var id = item.id; // library中一定有id,因为是一级,二级+特殊需求才会出现放开 - if (isNil$f(id)) { + if (isNil(id)) { throw new Error('Library item miss id: ' + JSON.stringify(item)); } else { hash[id] = item; @@ -35994,7 +36001,7 @@ function linkLibrary(item, hash) { function linkChild(child, libraryItem) { // 规定图层child只有init和动画,属性和子图层来自库 child.tagName = libraryItem.tagName; - child.props = clone$4(libraryItem.props); + child.props = clone(libraryItem.props); child.children = libraryItem.children; child.library = libraryItem.library; // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况 @@ -36011,10 +36018,10 @@ function linkChild(child, libraryItem) { if (init) { var props = child.props = child.props || {}; var style = props.style; - extend$2(props, init); // style特殊处理,防止被上面覆盖丢失原始值 + extend(props, init); // style特殊处理,防止被上面覆盖丢失原始值 if (style) { - extend$2(style, init.style); + extend(style, init.style); props.style = style; } // 删除以免二次解析 @@ -36026,7 +36033,7 @@ function linkChild(child, libraryItem) { function parse(karas, json, animateRecords, opt) { var hash = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; - if (isPrimitive(json) || json instanceof Node || json instanceof Component$1) { + if (isPrimitive(json) || json instanceof Node || json instanceof Component) { return json; } @@ -36039,7 +36046,7 @@ function parse(karas, json, animateRecords, opt) { var libraryId = json.libraryId; - if (!isNil$f(libraryId)) { + if (!isNil(libraryId)) { var libraryItem = hash[libraryId]; // 规定图层child只有init和动画,tagName和属性和子图层来自库 if (libraryItem) { @@ -36077,7 +36084,7 @@ function parse(karas, json, animateRecords, opt) { } var style = props.style; - opt.abbr !== false && abbr2full(style, abbrCssProperty$1); // 先替换style的 + opt.abbr !== false && abbr2full(style, abbrCssProperty); // 先替换style的 replaceVars(style, opt.vars); // 再替换静态属性,style也作为属性的一种,目前尚未被设计为被替换 @@ -36089,9 +36096,9 @@ function parse(karas, json, animateRecords, opt) { if (tagName.charAt(0) === '$') { vd = karas.createGm(tagName, props); } else if (/^[A-Z]/.test(tagName)) { - var cp = Component$1.getRegister(tagName); + var cp = Component.getRegister(tagName); vd = karas.createCp(cp, props, children.map(function (item) { - if (item && [TYPE_VD$4, TYPE_GM$4, TYPE_CP$4].indexOf(item.$$type) > -1) { + if (item && [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(item.$$type) > -1) { return item; } @@ -36099,7 +36106,7 @@ function parse(karas, json, animateRecords, opt) { })); } else { vd = karas.createVd(tagName, props, children.map(function (item) { - if (item && [TYPE_VD$4, TYPE_GM$4, TYPE_CP$4].indexOf(item.$$type) > -1) { + if (item && [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(item.$$type) > -1) { return item; } @@ -36113,20 +36120,20 @@ function parse(karas, json, animateRecords, opt) { if (Array.isArray(animate)) { var has; animate.forEach(function (item) { - opt.abbr !== false && abbr2full(item, abbrAnimate$1); + opt.abbr !== false && abbr2full(item, abbrAnimate); var value = item.value, options = item.options; // 忽略空动画 if (Array.isArray(value) && value.length) { has = true; value.forEach(function (item) { - opt.abbr !== false && abbr2full(item, abbrCssProperty$1); + opt.abbr !== false && abbr2full(item, abbrCssProperty); replaceVars(item, opt.vars); }); } if (options) { - opt.abbr !== false && abbr2full(options, abbrAnimateOption$1); + opt.abbr !== false && abbr2full(options, abbrAnimateOption); replaceVars(options, opt.vars); } }); @@ -36138,13 +36145,13 @@ function parse(karas, json, animateRecords, opt) { }; } } else { - opt.abbr !== false && abbr2full(animate, abbrAnimate$1); + opt.abbr !== false && abbr2full(animate, abbrAnimate); var value = animate.value, options = animate.options; if (Array.isArray(value) && value.length) { value.forEach(function (item) { - opt.abbr !== false && abbr2full(item, abbrCssProperty$1); + opt.abbr !== false && abbr2full(item, abbrCssProperty); replaceVars(item, opt.vars); }); animationRecord = { @@ -36154,7 +36161,7 @@ function parse(karas, json, animateRecords, opt) { } if (options) { - opt.abbr !== false && abbr2full(options, abbrAnimateOption$1); + opt.abbr !== false && abbr2full(options, abbrAnimateOption); replaceVars(options, opt.vars); } } @@ -36168,7 +36175,7 @@ function parse(karas, json, animateRecords, opt) { return vd; } -var o$4 = { +var o = { parse: function parse$1(karas, json, dom) { var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; json = util.clone(json); // 根节点的fonts字段定义字体信息 @@ -36185,7 +36192,7 @@ var o$4 = { data = item.data; if (fontFamily && data) { - o$1.register(fontFamily, data); + o$3.register(fontFamily, data); } }); } // json中定义无abbr @@ -36234,19 +36241,19 @@ var o$4 = { ac.__playAuto(); } // 不自动播放进入记录列表,初始化并等待手动调用 else { - ac.__records2 = ac.__records2.concat(animateRecords); - ac.init(ac.__records2, ac.list2); - } + ac.__records2 = ac.__records2.concat(animateRecords); + ac.init(ac.__records2, ac.list2); + } } // 递归的parse,如果有动画,此时还没root,先暂存下来,等上面的root的render第一次布局时收集 else { - if (animateRecords.length) { - vd.__animateRecords = { - options: options, - list: animateRecords, - controller: options.controller instanceof Controller ? options.controller : null - }; - } + if (animateRecords.length) { + vd.__animateRecords = { + options: options, + list: animateRecords, + controller: options.controller instanceof Controller ? options.controller : null + }; } + } return vd; }, @@ -36316,7 +36323,7 @@ var o$4 = { var cb = function cb() { if (count === a + b + c) { - var res = o$4.parse(karas, json, dom, options); + var res = o.parse(karas, json, dom, options); if (options && util.isFunction(options.callback)) { options.callback(res); @@ -36347,7 +36354,7 @@ var o$4 = { cb(); }); } else { - var res = o$4.parse(karas, json, dom, options); + var res = o.parse(karas, json, dom, options); if (options && util.isFunction(options.callback)) { options.callback(res); @@ -36356,15 +36363,15 @@ var o$4 = { return res; } }, - abbr: abbr$1 + abbr: abbr }; var style = { css: css, reset: reset, - unit: o, - font: o$1, - abbr: abbr + unit: o$4, + font: o$3, + abbr: abbr$1 }; var animate = { @@ -36375,21 +36382,21 @@ var animate = { }; var refresh = { - level: o$3, + level: o$1, change: o$2, Page: Page, Cache: Cache }; -var version = "0.63.6"; +var version = "0.63.7"; -Geom$1.register('$line', Line); -Geom$1.register('$polyline', Polyline); -Geom$1.register('$polygon', Polygon); -Geom$1.register('$sector', Sector); -Geom$1.register('$rect', Rect); -Geom$1.register('$circle', Circle); -Geom$1.register('$ellipse', Ellipse); +Geom.register('$line', Line); +Geom.register('$polyline', Polyline); +Geom.register('$polygon', Polygon); +Geom.register('$sector', Sector); +Geom.register('$rect', Rect); +Geom.register('$circle', Circle); +Geom.register('$ellipse', Ellipse); var karas$1 = { version: version, render: function render(root, dom) { @@ -36456,25 +36463,25 @@ var karas$1 = { }; }, parse: function parse(json, dom, options) { - return o$4.parse(this, json, dom, options); + return o.parse(this, json, dom, options); }, loadAndParse: function loadAndParse(json, dom, options) { - return o$4.loadAndParse(this, json, dom, options); + return o.loadAndParse(this, json, dom, options); }, mode: mode, - Component: Component$1, + Component: Component, Node: Node, Text: Text, - Geom: Geom$1, - Xom: Xom$1, - Dom: Dom$1, - Img: Img$1, + Geom: Geom, + Xom: Xom, + Dom: Dom, + Img: Img, Root: Root, Event: Event, util: util, inject: inject, style: style, - parser: o$4, + parser: o, animate: animate, math: math, builder: builder, @@ -36488,11 +36495,11 @@ var karas$1 = { }; builder.ref({ - Xom: Xom$1, - Dom: Dom$1, - Img: Img$1, - Geom: Geom$1, - Component: Component$1 + Xom: Xom, + Dom: Dom, + Img: Img, + Geom: Geom, + Component: Component }); if (typeof window !== 'undefined') { @@ -36501,5 +36508,5 @@ if (typeof window !== 'undefined') { self.karas = karas$1; } -export default karas$1; +export { karas$1 as default }; //# sourceMappingURL=index.es.js.map diff --git a/index.es.js.map b/index.es.js.map index 4f5318ae0..f9c33b45f 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/node/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/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/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};\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\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};\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.__width = 0;\n this.__height = 0;\n this.__baseLine = 0;\n this.__config = {};\n // 默认undefined\n // this.__prev = undefined;\n // this.__next = undefined;\n // this.__parent = undefined;\n // this.__domParent = undefined;\n // this.__root = undefined;\n // this.__host = undefined;\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\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 /**\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 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 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 = 67, 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;\n\nexport default o;\n","export default {\n position: /(([-+]?[\\d.]+[pxremvwh%]*)|(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];\n let a1 = a[i + 4];\n let a2 = a[i + 8];\n let a3 = a[i + 12];\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) {\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 = 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 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 = 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 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') {\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 '../node/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 } = 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(['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 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 = { _: 1 };\nconst TYPE_GM = { _: 2 };\nconst TYPE_CP = { _: 3 };\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 s += joinDef(item);\n });\n s += '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\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 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 += '';\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 += '>';\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(/`;\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(location.hostname !== host[1]) {\n img.crossOrigin = 'anonymous';\n }\n }\n }\n img.src = url;\n if(debug.flag) {\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') {\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(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.loadFont(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 font invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\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 let f = new FontFace(url, `url(${url})`);\n f.load().then(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 }).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 '../node/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, 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 {\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 {\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 {\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, d = 0;\n // 扩展的from to ratio格式,圆心、长轴坐标、短轴缩放比\n if(Array.isArray(size)) {\n cx = x1 + size[0] * iw;\n cy = y1 + size[1] * ih;\n if(size[4] <= 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[4];\n r = Math.max(xl, yl);\n // 看旋转\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 else {\n // 默认椭圆a是水平轴,b是垂直轴\n [cx, cy] = calCircleCentre(position, x1, y1, iw, ih, root);\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, 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.]+))?/.exec(gradient[2]);\n if(points) {\n o.z = [parseFloat(points[1]), parseFloat(points[2]), parseFloat(points[3]), parseFloat(points[4])];\n if(!isNil(points[5])) {\n o.z.push(parseFloat(points[5]));\n }\n else {\n o.z.push(1);\n }\n }\n else {\n o.z = 'farthest-corner';\n }\n }\n let position = /at\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?: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.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?: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.]+[pxremvwh%]+)?\\s*((#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))\\s*([-+]?[\\d.]+[pxremvwh%]+)?/ig) || [];\n o.v = v.map(item => {\n let color = /((?:#[0-9a-f]{3,8})|(?:rgba?\\s*\\(.+?\\)))/i.exec(item);\n let arr = [rgba2int(color[1])];\n let percent = /[-+]?[\\d.]+[pxremvwh%]+/.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) {\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, 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 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: '#000',\n borderRightColor: '#000',\n borderBottomColor: '#000',\n borderLeftColor: '#000',\n borderTopStyle: 'solid',\n borderRightStyle: 'solid',\n borderBottomStyle: 'solid',\n borderLeftStyle: 'solid',\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.]+[pxremvwh%]*)|(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.]+[pxremvwh%]*\\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)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]);\n }\n else if(/^[\\d.]+\\s+[\\d.]+\\s+[\\d.]+[pxremvwh%]*/.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.]+[pxremvwh%]+/.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.]+[pxremvwh%]+/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.]+[pxremvwh%]*)/.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};\n\no.isIgnore = function(k) {\n return IGNORE.hasOwnProperty(k);\n};\nfunction isGeom(tagName, k) {\n return GEOM.hasOwnProperty(k) && GEOM[k].hasOwnProperty(tagName);\n}\no.isGeom = isGeom;\no.isRepaint = function(k) {\n return REPAINT.hasOwnProperty(k) || isGeom(k);\n};\no.isMeasure = function(k) {\n return MEASURE.hasOwnProperty(k);\n};\no.isValid = function(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\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']);\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, 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 // 扩展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(!isNil(v) && 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) {\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(!isNil(temp)) {\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) {\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.]+[pxremvwh%]*)|(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(!isNil(v)) {\n res[STYLE_KEY[style2Upper(k)]] = [rgba2int(v), 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(!isNil(v)) {\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) {\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]);\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(!isNil(temp)) {\n let arr = calUnit(temp);\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(!isNil(temp)) {\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(isNil(v)) {\n return;\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) {\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]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n res[ROTATE_3D] = arr;\n }\n }\n temp = style.opacity;\n if(!isNil(temp)) {\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(!isNil(temp)) {\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(isNil(v)) {\n return;\n }\n if(v === 'auto') {\n v = [0, AUTO];\n }\n else {\n v = calUnit(v);\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(!isNil(temp)) {\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(!isNil(temp)) {\n res[ORDER] = parseInt(temp) || 0;\n }\n temp = style.color;\n if(!isNil(temp)) {\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(!isNil(temp)) {\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 || temp === 0) {\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(!isNil(temp)) {\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(!isNil(temp)) {\n if(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(!isNil(temp)) {\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) {\n if(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) {\n if(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) {\n if(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 === '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) {\n if(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(!isNil(temp)) {\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(!isNil(temp)) {\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') {\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) {\n if(temp === 'inherit') {\n res[VISIBILITY] = [0, INHERIT];\n }\n else {\n res[VISIBILITY] = [temp, STRING];\n }\n }\n temp = style.pointerEvents;\n if(temp) {\n if(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.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*\\s*)?([-+]?[\\d.]+[pxremvwh%]*\\s*)?(((transparent)|(#[0-9a-f]{3,8})|(rgba?\\(.+?\\)))\\s*)?(inset|outset)?\\s*,?/ig);\n if(match) {\n match.forEach(item => {\n let boxShadow = /([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*\\s*)?([-+]?[\\d.]+[pxremvwh%]*\\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(!isNil(temp)) {\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 {\n computedStyle[k] = v[0];\n }\n });\n}\n\n/**\n * 每次布局前需要计算的reflow相关的computedStyle\n * @param node 对象节点\n * @param isHost 是否是根节点或组件节点这种局部根节点,无继承需使用默认值\n */\nfunction computeReflow(node, isHost) {\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 {\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 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] === 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 {\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];\n return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' '\n + fontSize + 'px/' + fontSize + 'px ' + (style[FONT_FAMILY] || 'arial');\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 }\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 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 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\nexport default {\n normalize,\n computeMeasure,\n computeReflow,\n setFontStyle,\n getFontFamily,\n getBaseLine,\n calRelative,\n calAbsolute,\n equalStyle,\n isRelativeOrAbsolute,\n cloneStyle,\n};\n","import mode from './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\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","import matrix from './matrix';\nimport tar from './tar';\nimport geom from './geom';\n\nexport default {\n matrix,\n tar,\n geom,\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 } = 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 }\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 }\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 });\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 DISPLAY,\n VISIBILITY,\n },\n NODE_KEY: {\n NODE_OPACITY,\n NODE_CACHE,\n NODE_CACHE_FILTER,\n NODE_CACHE_OVERFLOW,\n NODE_HAS_CONTENT,\n NODE_COMPUTED_STYLE,\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 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 }\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 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, 'filter1');\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, next, isClip, transform, tfo) {\n let cacheMask = genSingle(target, 'mask1');\n let list = [];\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;\n tfo[1] += y + dby;\n let inverse = tf.calMatrixByOrigin(transform, tfo);\n // 先将mask本身绘制到cache上,再设置模式绘制dom本身,因为都是img所以1个就够了\n list.forEach(item => {\n let __config = item.__config;\n let cacheOverflow = __config[NODE_CACHE_OVERFLOW], cacheFilter = __config[NODE_CACHE_FILTER], cache = __config[NODE_CACHE];\n let source = cacheOverflow && cacheOverflow.available && cacheOverflow;\n if(!source) {\n source = cacheFilter && cacheFilter.available && cacheFilter;\n }\n if(!source) {\n source = cache && cache.available && cache;\n }\n if(source) {\n ctx.globalAlpha = __config[NODE_OPACITY];\n Cache.drawCache(\n source, cacheMask,\n __config[NODE_COMPUTED_STYLE][TRANSFORM],\n mx.identity(),\n __config[NODE_COMPUTED_STYLE][TRANSFORM_ORIGIN].slice(0),\n inverse\n );\n }\n // 没有内容或者img没加载成功导致没有内容,有内容且可见则是超限,不可能进这里\n else if(__config[NODE_HAS_CONTENT]\n && __config[NODE_COMPUTED_STYLE][DISPLAY] !== 'none'\n && __config[NODE_COMPUTED_STYLE][VISIBILITY] !== 'hidden') {\n inject.error('CacheMask is oversize');\n }\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, 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(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\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 './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 } = 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 }\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 // text-overflow:ellipse需要,即便没有也要先测量,其基于最近非inline父节点的字体\n let bp = this.domParent;\n while(bp.currentStyle[DISPLAY] === 'inline') {\n bp = bp.domParent;\n }\n this.__bp = bp;\n let parentComputedStyle = bp.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.__sx1 = x;\n this.__y = this.__sy1 = y;\n let { isDestroyed, content, currentStyle, 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 || currentStyle[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 let lineCount = 0;\n // 不换行特殊对待,同时考虑overflow和textOverflow\n if(whiteSpace === 'nowrap') {\n let isTextOverflow;\n // block的overflow:hidden和textOverflow:clip/ellipsis才生效,inline要看最近非inline父元素\n let bp = this.__bp;\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) {\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.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.__width = maxX - minX;\n }\n\n __calMaxAndMinWidth() {\n let n = 0;\n this.charWidthList.forEach(item => {\n n = Math.max(n, item);\n });\n return { max: this.textWidth, min: n };\n }\n\n __calAbsWidth(x, y, w) {\n this.__layout({\n x,\n y,\n w,\n }, true);\n return this.width;\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 { sx, 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] * 0.5, half);\n }\n else if(textStrokeWidth[1] === VW) {\n half = Math.max(textStrokeWidth[0] * root.width * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VH) {\n half = Math.max(textStrokeWidth[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(textStrokeWidth[0] * 0.5, half);\n }\n half += 1;\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 let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\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.__hasUpdate) {\n return;\n }\n cp.__hasUpdate = 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 '../node/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 } = unit;\n\nfunction renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bbrr, bblr, method = 'fill', isInline) {\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);\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] === 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 }\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 let source = loadBgi.source;\n // 无source不绘制,可能错误或加载中\n if(source) {\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} = enums;\nconst { AUTO, PX, PERCENT, INHERIT, RGBA, STRING, NUMBER, REM, VW, VH, 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 }\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 }\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 }\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 }\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 }\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,其余都是特殊固定单位\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') {\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') {\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没有增量\n else {\n if(n === p || k === 'edge' || k === 'closure') {\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 {\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') {\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\nlet uuid = 0;\n\nconst I_ASSIGNING = 0;\nconst I_IN_FPS = 1;\nconst I_IS_DELAY = 2;\nconst I_BEGIN = 3;\nconst I_END = 4;\nconst I_FINISHED = 5;\nconst I_NEXT_END = 6;\nconst I_FIRST_PLAY = 7;\nconst I_FRAME_CB = 8;\nconst I_PLAY_CB = 9;\nconst I_TARGET = 10;\nconst I_ROOT = 11;\nconst I_FRAMES = 12;\nconst I_FRAMES_R = 13;\nconst I_CURRENT_TIME = 14;\nconst I_NEXT_TIME = 15;\nconst I_STYLE = 16;\nconst I_DURATION = 17;\nconst I_ITERATIONS = 18;\nconst I_FILL = 19;\nconst I_PLAYBACK_RATE = 20;\nconst I_PLAY_COUNT = 21;\nconst I_PLAY_STATE = 22;\nconst I_DESTROYED = 23;\nconst I_START_TIME = 24;\nconst I_FPS_TIME = 25;\nconst I_EASING = 26;\nconst I_ENTER_FRAME = 27;\nconst I_DELAY = 28;\nconst I_END_DELAY = 29;\nconst I_KEYS = 30;\nconst I_ORIGIN_STYLE = 31;\nconst I_CURRENT_FRAMES = 32;\nconst I_CURRENT_FRAME = 33;\nconst I_SPF_LIMIT = 34;\nconst I_FPS = 35;\nconst I_DIRECTION = 36;\nconst I_CAL_DIFF_TIME = 37;\nconst I_FIRST_ENTER = 38;\nconst I_STAY_BEGIN = 39;\nconst I_STAY_END = 40;\nconst I_IS2 = 41;\nconst I_END_TIME = 42;\nconst I_NODE_CONFIG = 43;\nconst I_ROOT_CONFIG = 44;\nconst I_OUT_BEGIN_DELAY = 45;\nconst I_TIME_STAMP = 46;\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 this.__frameCb,\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 this.__calDiffTime,\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 __config[I_CURRENT_TIME] = __config[I_DELAY] + __config[I_DURATION] + __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 __frameCb(__config, diff, isDelay) {\n this.emit(Event.FRAME, diff, isDelay);\n if(__config[I_FIRST_PLAY]) {\n __config[I_FIRST_PLAY] = false;\n this.emit(Event.PLAY);\n }\n if(isFunction(__config[I_PLAY_CB])) {\n __config[I_PLAY_CB].call(this, diff, isDelay);\n __config[I_PLAY_CB] = null;\n }\n }\n\n __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\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 = __config[I_PLAY_COUNT];\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] = __config[I_CAL_DIFF_TIME](__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(playCount === 0 && 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 if(playCount === 0) {\n currentTime -= delay;\n }\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 __config[I_NEXT_TIME] -= duration;\n playCount = ++__config[I_PLAY_COUNT];\n __config[I_BEGIN] = true;\n round = true;\n }\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 this.__clean(true);\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 __config[I_FRAME_CB].call(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 __config[I_FRAME_CB].call(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 __config[I_FRAME_CB].call(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 __goto(v, isFrame, excludeDelay) {\n let __config = this.__config;\n let duration = __config[I_DURATION];\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\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 // 超过一轮去掉delay\n if(v > duration + __config[I_DELAY]) {\n v -= __config[I_DELAY];\n }\n // 超过时间长度需要累加次数\n __config[I_PLAY_COUNT] = 0;\n while(v > duration && __config[I_PLAY_COUNT] < __config[I_ITERATIONS] - 1) {\n __config[I_PLAY_COUNT]++;\n v -= duration;\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n __config[I_NEXT_TIME] = v;\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 = __config[I_PLAY_COUNT] % 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 '../node/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) {\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 mode from './mode';\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 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;\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 }\n} = enums;\nconst { AUTO, PX, PERCENT, INHERIT, NUMBER, REM, VW, VH, DEG } = unit;\nconst { int2rgba, rgba2int, joinArr, isNil } = 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 }\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.__mpWidth(currentStyle[a], w);\n computedStyle[b] = this.__mpWidth(currentStyle[b], w);\n });\n }\n\n __mpWidth(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 return 0;\n }\n\n // dom常用的几种尺寸赋值\n __ioSize(w, h) {\n let computedStyle = this.computedStyle;\n this.__clientWidth = w += computedStyle[PADDING_LEFT] + computedStyle[PADDING_RIGHT];\n this.__clientHeight = h += computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM];\n this.__offsetWidth = w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[BORDER_RIGHT_WIDTH];\n this.__offsetHeight = h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH];\n this.__outerWidth = w + computedStyle[MARGIN_LEFT] + computedStyle[MARGIN_RIGHT];\n this.__outerHeight = h + computedStyle[MARGIN_TOP] + computedStyle[MARGIN_BOTTOM];\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 return n;\n }\n\n // 为basis的b/min/max添加mpb,只有当b未显示指定等于w/content时才加,同时返回mpb值\n __addMp(isDirectionRow, w, currentStyle, 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 [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w, !isDirectItem)\n + this.__calMp(marginRight, w, !isDirectItem)\n + this.__calMp(paddingLeft, w, !isDirectItem)\n + this.__calMp(paddingRight, w, !isDirectItem);\n if(borderLeftWidth[1] === PX) {\n mp += borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n mp += borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n mp += borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n mp += borderLeftWidth[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n mp += borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n mp += borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n mp += borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n mp += borderRightWidth[0] * this.root.height * 0.01;\n }\n res = res.map(item => item + mp);\n }\n else {\n let mp = this.__calMp(marginTop, w, !isDirectItem)\n + this.__calMp(marginBottom, w, !isDirectItem)\n + this.__calMp(paddingTop, w, !isDirectItem)\n + this.__calMp(paddingBottom, w, !isDirectItem);\n if(borderTopWidth[1] === PX) {\n mp += borderTopWidth[0];\n }\n else if(borderTopWidth[1] === REM) {\n mp += borderTopWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderTopWidth[1] === VW) {\n mp += borderTopWidth[0] * this.root.width * 0.01;\n }\n else if(borderTopWidth[1] === VH) {\n mp += borderTopWidth[0] * this.root.height * 0.01;\n }\n if(borderBottomWidth[1] === PX) {\n mp += borderBottomWidth[0];\n }\n else if(borderBottomWidth[1] === REM) {\n mp += borderBottomWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderBottomWidth[1] === VW) {\n mp += borderBottomWidth[0] * this.root.width * 0.01;\n }\n else if(borderBottomWidth[1] === VH) {\n mp += borderBottomWidth[0] * this.root.height * 0.01;\n }\n res = res.map(item => item + mp);\n }\n return res;\n }\n\n // absolute且无尺寸时,isVirtual标明先假布局一次计算尺寸,还有flex列计算时\n // fromAbs为absolute节点特有省略计算标识,本节点是abs时真正布局传入\n __layout(data, isVirtual, fromAbs) {\n css.computeReflow(this, this.isShadowRoot);\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.clearCache();\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 __config[NODE_REFRESH_LV] = REFLOW;\n __config[NODE_LIMIT_CACHE] = false;\n __config[NODE_IS_INLINE] = false;\n // 防止display:none不统计mask,isVirtual忽略,abs布局后续会真正来走一遍\n if(!isVirtual) {\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 return;\n }\n // margin/padding在abs前已经计算过了,无需二次计算\n if(!fromAbs) {\n this.__mp(currentStyle, computedStyle, w);\n }\n // inline的width/height无效,其它有效\n if(width[1] !== AUTO) {\n if(this.__isRealInline() && currentStyle[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 }\n }\n }\n let lineClampCount = 0;\n // 4种布局,默认block,inlineBlock基本可以复用inline逻辑,除了尺寸\n if(display === 'flex') {\n this.__layoutFlex(data, isVirtual);\n }\n else if(display === 'inlineBlock' || display === 'inline-block') {\n lineClampCount = this.__layoutInline(data, isVirtual);\n }\n else if(display === 'inline') {\n lineClampCount = this.__layoutInline(data, isVirtual, true);\n }\n else {\n this.__layoutBlock(data, isVirtual);\n }\n // relative渲染时做偏移,百分比基于父元素,若父元素没有定高则为0\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布局的不执行,在__layoutAbs末尾做,防止未布局没有尺寸从而动画计算错误\n if(!fromAbs) {\n this.__execAr();\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[PADDING_TOP]\n = computedStyle[PADDING_RIGHT]\n = computedStyle[PADDING_BOTTOM]\n = computedStyle[PADDING_LEFT]\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 }\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 }\n }\n // margin/padding/border影响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已知目标主尺寸,需减去mpb,其一定是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.tagName === 'img') && 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 {\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 {\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 {\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 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] === 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] === 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 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 {\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 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 {\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 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 * @param lv\n * @param ctx canvas/svg/webgl共用\n * @param cache 是否开启缓存\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 * offscreenMask 无cache时的离屏canvas,仅canvas\n * offscreenOverflow 无cache时的离屏canvas,仅canvas\n */\n render(renderMode, lv, ctx, cache) {\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 this.__bbox = null;\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);\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);\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 + dx, iy1 + dy, ix2 - ix1, iy2 - iy1, btlr, [0, 0], [0, 0], bblr);\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);\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 + dx, iy1 + dy, ix2 - ix1, iy2 - iy1, isFirst ? btlr : [0, 0], btrr, bbrr, isFirst ? bblr : [0, 0]);\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);\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);\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);\n }\n }\n else if(bgi.k) {\n let gd = this.__gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi);\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);\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);\n });\n }\n // 边框需考虑尖角,两条相交边平分45°夹角\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_TOP], __cacheStyle[BORDER_TOP_COLOR]);\n }\n if(borderRightWidth > 0 && borderRightColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_RIGHT], __cacheStyle[BORDER_RIGHT_COLOR]);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_BOTTOM], __cacheStyle[BORDER_BOTTOM_COLOR]);\n }\n if(borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_LEFT], __cacheStyle[BORDER_LEFT_COLOR]);\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.delRefreshTask(this.__loadBgi.cb);\n 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' && util.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(util.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) {\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);\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);\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);\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.cx, gd.cy, 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.cx],\n ['cy', gd.cy],\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 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(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, formatStyle);\n if(util.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(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, style);\n if(util.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(util.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(util.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.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) {\n let ox = 0, oy = 0;\n if(Array.isArray(boxShadow)) {\n boxShadow.forEach(item => {\n let [x, y, sigma, spread, , inset] = item;\n if(inset !== 'inset') {\n let d = blur.outerSize(sigma);\n d += spread;\n ox = Math.max(ox, x + d);\n oy = Math.max(oy, y + d);\n }\n });\n }\n return [ox, oy];\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() {\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent } = this;\n let p1 = point2d(mx.calPoint([__sx1, __sy1], matrixEvent));\n let p2 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1], matrixEvent));\n let p3 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1 + offsetHeight], matrixEvent));\n let p4 = point2d(mx.calPoint([__sx1, __sy1 + offsetHeight], 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(util.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(util.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] = level.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(util.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, clientWidth, clientHeight,\n currentStyle: {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BOX_SHADOW]: boxShadow,\n },\n } = this;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n clientWidth += borderLeftWidth[0] + borderRightWidth[0];\n clientHeight += borderTopWidth[0] + borderBottomWidth[0];\n let half = 1;\n this.__bbox = [__sx1 - ox - half, __sy1 - oy - half, __sx1 + clientWidth + ox + half, __sy1 + clientHeight + oy + half];\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\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 n = this.baseLine;\n // 只有1个也需要对齐,因为可能内嵌了空inline使得baseLine发生变化\n if(this.list.length) {\n this.list.forEach(item => {\n let m = item.baseLine;\n if(m !== n) {\n item.__offsetY(n - m);\n }\n });\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\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 = 0;\n this.list.forEach(item => {\n baseLine = Math.max(baseLine, item.baseLine);\n });\n return Math.max(this.__baseLine, baseLine);\n }\n\n get lineHeight() {\n let lineHeight = 0;\n // 只有TextBox和InlineBlock\n this.list.forEach(item => {\n lineHeight = Math.max(lineHeight, item.outerHeight);\n });\n return Math.max(this.__lineHeight, 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 }\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 verticalAlign() {\n this.list.forEach(lineBox => {\n lineBox.verticalAlign();\n });\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\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.currentStyle[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, null, 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 mode from './mode';\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 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 // PERSPECTIVE,\n // TRANSFORM,\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 } = unit;\nconst { calAbsolute, isRelativeOrAbsolute } = css;\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 = util.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 {\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 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 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 }\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 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 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 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 // item的递归子节点求min/max,只考虑固定值单位,忽略百分比,同时按方向和display\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this, this.isShadowRoot);\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h, lineBoxManager } = data;\n // 计算需考虑style的属性\n let {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n else {\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\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 = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\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 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 });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n else if(display === 'block') {\n let countMin = 0, countMax = 0;\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\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 if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n else {\n if(display === 'inlineBlock' || display === 'inline-block') {\n lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n }\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n if(isDirectionRow) {\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 min += item.charWidth;\n max += item.textWidth;\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n });\n }\n }\n return [display, this.__addMp(isDirectionRow, w, currentStyle, [min, max])];\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时isVirtual状态参与计算,文本抵达边界才进行换行\n * @param isDirectionRow\n * @param data\n * @param isVirtual abs非固定尺寸时先进行虚拟布局标识\n * @private\n */\n __calBasis(isDirectionRow, data, isVirtual) {\n css.computeReflow(this, this.isShadowRoot);\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 [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n [FLEX_BASIS]: flexBasis,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\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].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 }\n // 已声明主轴尺寸的,当basis是auto时为值\n else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1) && isAuto) {\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 }\n // 非固定尺寸的basis为auto时降级为content\n else if(isAuto) {\n isContent = true;\n }\n // flex的item还是flex时\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\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 = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\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 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 });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n // flex的item是block/inline时,inline也会变成block统一对待\n else {\n let countMin = 0, countMax = 0;\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\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 if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n if(fixedSize) {\n max = Math.max(fixedSize, max);\n }\n if(isContent) {\n b = max;\n }\n // 直接item的mpb影响basis\n return this.__addMp(isDirectionRow, w, currentStyle, [b, min, max], true);\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 isVirtual abs无尺寸时提前虚拟布局计算尺寸\n * @private\n */\n __layoutBlock(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\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 isImg = item.tagName === 'img';\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 }, isVirtual);\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 || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // abs统计宽度\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.outerWidth;\n maxW = Math.max(maxW, cw);\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 }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock || isImg) && 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 }, isVirtual);\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 || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n if(isVirtual) {\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 }, isVirtual);\n let isNone = item.currentStyle[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(isVirtual) {\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 }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.width;\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 }, isVirtual);\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 }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, item.width);\n cw = 0;\n }\n }\n if(isVirtual) {\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 || !isVirtual) ? w : maxW;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // 非abs提前的虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐\n if(!isVirtual) {\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 // 所有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, isVirtual) {\n let { flowChildren, currentStyle, computedStyle, __flexLine } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\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 maxX = 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 // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n // abs虚拟布局计算时纵向也是看横向宽度\n let [b, min, max] = item.__calBasis(isVirtual ? true : isDirectionRow, { x, y, w, h }, isVirtual);\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += max;\n }\n else {\n maxX = Math.max(maxX, max);\n }\n return;\n }\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 if(isVirtual) {\n if(isDirectionRow) {\n maxX += item.textWidth;\n }\n else {\n maxX = Math.max(maxX, item.textWidth);\n }\n return;\n }\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 });\n let h = item.height;\n basisList.push(h);\n minList.push(h);\n }\n }\n });\n // abs时,只需关注宽度即可,无需真正布局\n if(isVirtual) {\n let tw = this.__width = Math.min(maxX, w);\n this.__ioSize(tw, this.height);\n return;\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, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, 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 let tw = this.__width = w;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\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(!isVirtual && 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(!isVirtual) {\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 }\n this.__marginAuto(currentStyle, data);\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, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, 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 });\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h: main,\n h3: main, // 同w2\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 });\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(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(['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 isVirtual\n * @param isInline\n * @private\n */\n __layoutInline(data, isVirtual, 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(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\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 }, isVirtual);\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 }, isVirtual);\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 }, isVirtual);\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 }, isVirtual);\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 }, isVirtual);\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 }, isVirtual);\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(isVirtual) {\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(!isVirtual && !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(currentStyle[DISPLAY] === 'none') {\n item.__layoutNone();\n return;\n }\n // 先根据容器宽度计算margin/padding\n item.__mp(currentStyle, computedStyle, clientWidth);\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let { [LEFT]: left, [TOP]: top, [RIGHT]: right,\n [BOTTOM]: bottom, [WIDTH]: width, [HEIGHT]: height, [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection } = 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 = x + clientWidth - computedStyle[RIGHT] - x2;\n }\n else if(fixedLeft) {\n x2 = x + computedStyle[LEFT];\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n }\n else if(fixedRight) {\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\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 -= currentStyle[BORDER_LEFT_WIDTH][0];\n x2 -= currentStyle[BORDER_RIGHT_WIDTH][0];\n }\n else {\n x2 = x + paddingLeft;\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n }\n // top/bottom/height优先级同上\n if(fixedTop && fixedBottom) {\n y2 = y + computedStyle[TOP];\n h2 = y + clientHeight - computedStyle[BOTTOM] - y2;\n }\n else if(fixedTop) {\n y2 = y + computedStyle[TOP];\n if(height[1] !== AUTO) {\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else {\n h2 = height[0];\n }\n }\n }\n else if(fixedBottom) {\n if(height[1] !== AUTO) {\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else {\n h2 = height[0];\n }\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 -= currentStyle[BORDER_TOP_WIDTH][0];\n y2 -= currentStyle[BORDER_BOTTOM_WIDTH][0];\n }\n // 未声明y的找到之前的流布局child,紧随其下\n else {\n y2 = y + paddingTop;\n let prev = item.prev;\n while(prev) {\n // 目前不考虑margin合并,直接以前面的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] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else if(height[1] === PX) {\n h2 = height[0];\n }\n }\n // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局\n let needCalWidth;\n if((display === 'block' || ['inlineBlock', 'inline-block'].indexOf(display) > -1) && w2 === undefined) {\n needCalWidth = true;\n }\n else if(display === 'flex') {\n if(w2 === undefined) {\n needCalWidth = true;\n }\n else if(flexDirection === 'column' && h2 === undefined) {\n needCalWidth = true;\n }\n }\n // onlyRight时做的布局其实是以那个点位为left/top布局然后offset,limit要特殊计算,从本点向左侧为边界\n let wl = onlyRight ? x2 - x : clientWidth + x - x2;\n // onlyBottom相同,正常情况是左上到右下的尺寸限制\n let hl = onlyBottom ? y2 - y : clientHeight + y - y2;\n // 未直接或间接定义尺寸,取孩子宽度最大值\n if(needCalWidth) {\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n }, true, true);\n wl = item.outerWidth;\n }\n // needCalWidth传入,因为自适应尺寸上面已经计算过一次margin/padding了\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n w2, // left+right这种等于有宽度,但不能修改style,继续传入到__preLayout中特殊对待\n h2,\n }, false, true);\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 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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(util.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(!util.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(util.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(!util.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(util.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(!util.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(util.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(!util.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(util.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(util.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 './mode';\nimport painter from '../util/painter';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport unit from '../style/unit';\nimport image from '../style/image';\nimport border from '../style/border';\nimport enums from '../util/enums';\nimport level from '../refresh/level';\nimport mx from '../math/matrix';\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_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\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, RGBA } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { isFunction } = util;\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 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的方法,在__layout3个分支中会首先被调用\n * 当样式中固定宽高时,图片按样式尺寸,加载后重新绘制即可\n * 只固定宽高一个时,加载完要计算缩放比,重新布局绘制\n * 都没有固定,按照图片尺寸,重新布局绘制\n * 这里计算非固定的情况,将其改为固定供布局渲染使用,未加载完成为0\n * @param data\n * @returns {{fixedWidth: boolean, w: *, x: *, h: *, y: *, fixedHeight: boolean}}\n * @private\n */\n __preLayout(data) {\n let res = super.__preLayout(data);\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) {\n let res = super.render(renderMode, lv, ctx, cache);\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;\n originY = res.y3;\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 ctx.arc(cx, cy, r, 0, 2 * Math.PI);\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);\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 {\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 {\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 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 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 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 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 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 return w;\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle, __loadImg } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\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 [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\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].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 }\n else if(([PX, PERCENT, REM, VW, VH].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 }\n // auto和content固定尺寸比例计算\n else if(__loadImg.source || __loadImg.error) {\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 let ratio = __loadImg.width / __loadImg.height;\n b = max = min = isDirectionRow ? cross * ratio : cross / ratio;\n }\n else {\n b = max = min = isDirectionRow ? __loadImg.width : __loadImg.height;\n }\n }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\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 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 '../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 DISPLAY,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n WIDTH,\n HEIGHT,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_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 }\n} = enums;\nconst { PX, PERCENT, REM, VW, VH } = unit;\nconst { int2rgba, isNil, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\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 // 减去水平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 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 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 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 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 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 return w;\n }\n\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this, this.isShadowRoot);\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n // 计算需考虑style的属性\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n [DISPLAY]: display,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n return [display, this.__addMp(isDirectionRow, data.w, currentStyle, [min, max])];\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\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 [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH].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 }\n else if(([PX, PERCENT, REM, VW, VH].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 }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\n }\n\n __layoutBlock(data, isVirtual) {\n let { fixedWidth, fixedHeight, w, h } = this.__preLayout(data);\n this.__height = fixedHeight ? h : 0;\n if(isVirtual) {\n this.__width = fixedWidth ? w : 0;\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) {\n // 无children所以等同于block\n this.__layoutBlock(data);\n }\n\n __layoutInline(data) {\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\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 {\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 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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() {}\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更新时,从叶子到根链路会标识__hasUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasUpdate) {\n child.__hasUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n // 高阶组件会进入此分支,被父组件调用\n else if(vd instanceof Component && vd.__hasUpdate) {\n vd.__hasUpdate = 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}\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 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 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 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 Geom from '../node/geom/Geom';\nimport Text from '../node/Text';\nimport Dom from '../node/Dom';\nimport Img from '../node/Img';\nimport mx from '../math/matrix';\nimport geom from '../math/geom';\nimport level from './level';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport painter from '../util/painter';\nimport Cache from './Cache';\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';\nimport mode from '../node/mode';\n\nconst { canvasPolygon } = painter;\n\nconst {\n STYLE_KEY: {\n POSITION,\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 },\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 },\n STRUCT_KEY: {\n STRUCT_NODE,\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;\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\n// 依次从list获取首个available可用的cache\nfunction 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/**\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;\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;\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 = util.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 * @param renderMode\n * @param node\n * @param __config\n * @param index\n * @param total\n * @param __structs\n * @param cacheTop\n * @param cache\n * @returns {{enabled}|Cache|*}\n */\nfunction genTotal(renderMode, node, __config, index, total, __structs, cacheTop, cache) {\n if(total === 0) {\n return cache;\n }\n // 存每层父亲的matrix和opacity和index,bbox计算过程中生成,缓存给下面渲染过程用\n let parentIndexHash = {};\n let opacityHash = {};\n let [bboxTotal] = genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHash, Cache.MAX);\n if(!bboxTotal) {\n return;\n }\n let { __sx1: sx1, __sy1: sy1 } = node;\n if(cacheTop) {\n cacheTop.reset(bboxTotal, sx1, sy1);\n }\n else {\n cacheTop = Cache.getInstance(bboxTotal, sx1, sy1);\n }\n // 创建失败,再次降级\n if(!cacheTop || !cacheTop.enabled) {\n return;\n }\n cacheTop.__available = true;\n let { x: tx, y: ty, ctx, dbx, dby } = cacheTop;\n // 先绘制自己的cache,起点所以matrix视作E为空,opacity固定1\n if(cache && cache.available) {\n ctx.globalAlpha = 1;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n Cache.drawCache(cache, cacheTop);\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 ctx.globalAlpha = opacity;\n let m = matrix || mx.identity();\n ctx.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]);\n node.render(renderMode, 0, ctx, true, tx - sx1 + dbx, ty - sy1 + dby);\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);\n if(hasMask) {\n i += hasMask;\n }\n continue;\n }\n // mask和不可见不能被汇总到top上\n if(visibility === 'hidden' || isMask) {\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 + tx;\n let dy = -sy1 + dby + ty;\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 let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n if(target) {\n if(isValidMbm(mixBlendMode)) {\n ctx.globalCompositeOperation = mbmName(mixBlendMode);\n }\n else {\n ctx.globalCompositeOperation = 'source-over';\n }\n ctx.globalAlpha = opacity;\n if(matrix) {\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n }\n else {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n }\n Cache.drawCache(target, cacheTop);\n if(target !== __cache) {\n i += total || 0;\n i += hasMask || 0;\n }\n }\n }\n }\n return cacheTop;\n}\n\nfunction genFilter(node, cache, v) {\n return Cache.genFilter(cache, v);\n}\n\nfunction genMask(node, cache) {\n let { [TRANSFORM]: transform, [TRANSFORM_ORIGIN]: transformOrigin } = node.computedStyle;\n let isClip = node.next.isClip;\n return Cache.genMask(cache, node.next, isClip, transform, transformOrigin);\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\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 W\n * @param H\n * @returns {*}\n */\nfunction genTotalWebgl(gl, texCache, node, __config, index, total, __structs, cache, limitCache, 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);\n }\n // limitCache无cache需先绘制到统一的离屏画布上\n else if(limitCache) {\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(mode.WEBGL, 0, gl);\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);\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);\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);\n if(hasMask) {\n i += hasMask;\n }\n continue;\n }\n // mask和不可见不能被汇总到top上\n if(visibility === 'hidden' || isMask) {\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);\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);\n }\n if(target !== __cache) {\n i += (total || 0) + (hasMask || 0);\n }\n }\n }\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 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;\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 += `\\nv_texCoordsBlur[${i}] = a_texCoords + vec2(-${c}, -${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i}]) * ${weights[i]};`;\n }\n vert += `\\nv_texCoordsBlur[${r}] = a_texCoords;`;\n frag += `\\ngl_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 += `\\nv_texCoordsBlur[${i + r + 1}] = a_texCoords + vec2(${c}, ${c}) * u_direction;`;\n frag += `\\ngl_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) {\n let { sx1, sy1, width, height, bbox } = cache;\n // cache一定是mockCache,可能是total/filter/overflow一种\n let cx = width * 0.5, cy = height * 0.5;\n let dx = -bbox[0], dy = -bbox[1];\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 while(next && next.isMask) {\n let __config = next.__config;\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [OPACITY]: opacity,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n },\n } = __config;\n if(display === 'none' || visibility === 'hidden') {\n continue;\n }\n // total无用,都是单节点\n let target = getCache([__cacheFilter, __cacheOverflow, __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 // m = mx.m2Mat4(m, cx, cy);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, m, cx, cy, dx, dy);\n }\n // 异常情况超限\n else if(__config[NODE_LIMIT_CACHE]) {\n return;\n }\n next = next.next;\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 isClip = node.next.isClip;\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 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 ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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, 'filter2');\n apply.ctx.filter = painter.canvasFilter(filter);\n apply.ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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 target.ctx.drawImage(apply.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(offscreen.target.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(mask.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(mask.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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\nfunction renderCacheCanvas(renderMode, ctx, root) {\n let { __structs, width, height } = root;\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 = 0;\n let mergeList = [];\n /**\n * 先一遍先序遍历每个节点绘制到自己__cache上,排除Text和已有的缓存以及局部根缓存,\n * 根据refreshLevel进行等级区分,可能是=REPAINT,REFLOW布局已前置处理完。\n * 首次绘制没有catchTotal等,后续则可能会有,在 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 // 不变是同级兄弟,无需特殊处理\n else {}\n lastConfig = __config;\n lastLv = lv;\n let {\n [NODE_REFRESH_LV]: refreshLevel,\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, 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 let matrix;\n if(contain(refreshLevel, TRANSFORM_ALL)) {\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n util.assignMatrix(m, matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n // 父不为E时要点乘继承父的\n if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n util.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 let __cacheFilter = __config[NODE_CACHE_FILTER];\n if(__cacheFilter) {\n __cacheFilter.release();\n }\n // 防重\n if(hasRecordAsMask) {\n hasRecordAsMask[6] = filter;\n }\n else {\n // 强制存hasMask,因为filter改变影响mask\n hasRecordAsMask = [i, lv, total, node, __config, 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重新渲染,并根据结果判断是否离屏限制limitCache\n * Geom没有子节点无需汇总局部根,Dom中Img也是,它们的局部根等于自身的cache,其它符合条件的Dom需要生成\n */\n else {\n node.render(renderMode, refreshLevel, ctx, true);\n }\n // 每个元素检查cacheTotal生成,已有的上面会continue跳过\n let {\n [NODE_LIMIT_CACHE]: limitCache,\n } = __config;\n let {\n [POSITION]: position,\n [OVERFLOW]: overflow,\n [FILTER]: filter,\n [MIX_BLEND_MODE]: mixBlendMode,\n } = computedStyle;\n if(!limitCache && (hasMask || position === 'absolute'\n || filter.length || (overflow === 'hidden' && total) || isValidMbm(mixBlendMode))) {\n if(hasRecordAsMask) {\n hasRecordAsMask[6] = filter;\n hasRecordAsMask[7] = overflow;\n }\n else {\n mergeList.push([i, lv, total, node, __config, hasMask, filter, overflow]);\n }\n }\n }\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 mergeList.forEach(item => {\n let [i, , total, node, __config, hasMask, filter, overflow] = item;\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 __cacheTotal = genTotal(renderMode, node, __config, i, total || 0, __structs, __cacheTotal, __cache);\n if(__cacheTotal && __cacheTotal !== __cache) {\n __config[NODE_CACHE_TOTAL] = __cacheTotal;\n }\n needGen = true;\n }\n // 防止失败超限,必须有total结果\n if(__cacheTotal && __cacheTotal.available) {\n let target = __cacheTotal;\n if(overflow === 'hidden') {\n if(!__cacheOverflow || !__cacheOverflow.available || needGen) {\n __config[NODE_CACHE_OVERFLOW] = genOverflow(node, target);\n needGen = true;\n }\n target = __config[NODE_CACHE_OVERFLOW] || target;\n }\n if(filter && filter.length) {\n if(!__cacheFilter || !__cacheFilter.available || needGen) {\n __config[NODE_CACHE_FILTER] = genFilter(node, target, filter);\n needGen = true;\n }\n target = __config[NODE_CACHE_FILTER] || target;\n }\n if(hasMask && (!__cacheMask || !__cacheMask.available || needGen)) {\n __config[NODE_CACHE_MASK] = genMask(node, target);\n }\n }\n });\n }\n /**\n * 最后先序遍历一次应用__cacheTotal即可,没有的用__cache,以及剩下的超尺寸的和Text\n * 超尺寸的依旧要走无cache逻辑render,这部分和无cache渲染很像\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 let __config = node.__config;\n // text如果display不可见,parent会直接跳过,不会走到这里,这里一定是直接绘制到root的,visibility在其内部判断\n if(node instanceof Text) {\n let {\n [NODE_OPACITY]: opacity,\n [NODE_MATRIX_EVENT]: matrixEvent,\n } = __config[NODE_DOM_PARENT].__config;\n ctx.globalAlpha = opacity;\n ctx.setTransform(matrixEvent[0], matrixEvent[1], matrixEvent[4], matrixEvent[5], matrixEvent[12], matrixEvent[13]);\n node.render(renderMode, 0, ctx);\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\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 [OVERFLOW]: overflow,\n [FILTER]: filter,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n // 有total的可以直接绘制并跳过子节点索引\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n // total的尝试\n if(target) {\n i += (total || 0) + (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.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 }\n // 自身cache尝试\n else {\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 let offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow;\n // 这里比较特殊,可能会有__cache但超限没被汇聚到total上,需mock出离屏对象数据,还有可能本身就超限\n if(__cache && __cache.available || limitCache) {\n if(__cache && __cache.available) {\n // 有cache但没生成total的都在这\n if(isValidMbm(mixBlendMode)) {\n let c = inject.getCacheCanvas(width, height, null, 'blend');\n offscreenBlend = {\n ctx,\n target: c,\n mixBlendMode: mbmName(mixBlendMode),\n matrix: matrixEvent,\n };\n ctx = c.ctx;\n }\n if(hasMask) {\n let c = inject.getCacheCanvas(width, height, null, 'mask1');\n offscreenMask = {\n ctx,\n target: c,\n matrix: matrixEvent,\n };\n ctx = c.ctx;\n }\n if(filter && filter.length) {\n let c = inject.getCacheCanvas(width, height, null, 'filter1');\n offscreenFilter = {\n ctx,\n filter,\n target: c,\n matrix: matrixEvent,\n };\n ctx = c.ctx;\n }\n if(overflow === 'hidden' && display !== 'inline') {\n let c = inject.getCacheCanvas(width, height, null, 'overflow');\n offscreenOverflow = {\n ctx,\n target: c,\n matrix: matrixEvent,\n x: __cache.sx1,\n y: __cache.sy1,\n offsetWidth: node.offsetWidth,\n offsetHeight: node.offsetHeight,\n };\n ctx = c.ctx;\n }\n if(visibility !== 'hidden') {\n Cache.draw(ctx, opacity, matrixEvent, __cache);\n }\n }\n else {\n // 连cache都没生成的超限\n let res = node.render(renderMode, refreshLevel, ctx) || {};\n offscreenBlend = res.offscreenBlend;\n offscreenMask = res.offscreenMask;\n offscreenFilter = res.offscreenFilter;\n offscreenOverflow = res.offscreenOverflow;\n }\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + (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 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) + (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) + (hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_OVERFLOW, offscreenOverflow]);\n ctx = offscreenOverflow.target.ctx;\n }\n if(limitCache && node instanceof Geom) {\n node.render(renderMode, refreshLevel, ctx);\n }\n }\n // 没内容的遮罩跳过,比如未加载的img,否则会将遮罩绘制出来\n else if(hasMask) {\n i += (total || 0) + hasMask;\n }\n // 同无cache一样的离屏应用\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n if(display === 'none') {\n i += (total || 0) + (hasMask || 0);\n }\n }\n }\n }\n}\n\n/**\n * 无缓存模式canvas渲染,O(n)一次循环完成\n * @param renderMode\n * @param ctx\n * @param root\n */\nfunction renderCanvas(renderMode, ctx, root) {\n let { __structs, width, height } = root;\n /**\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 */\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 let {\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_REFRESH_LV]: refreshLevel,\n } = node.__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 let res = node.render(renderMode, refreshLevel, ctx);\n let { offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow } = res || {};\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + (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) + (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) + (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才有值,以及svg的virtualDom也要生成\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + (hasMask || 0);\n }\n }\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 util.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 util.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);\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, 0, gl, true);\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 // 不变是同级兄弟,无需特殊处理\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 // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n util.assignMatrix(m, 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 util.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 let __cacheFilter = __config[NODE_CACHE_FILTER];\n if(__cacheFilter) {\n __cacheFilter.release();\n }\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, true);\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 } = __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(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 }\n else {\n mergeList.push([i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective]);\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 mergeList.forEach(item => {\n let [i, , total, node, __config, limitCache, hasMask, filter, overflow] = item;\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, 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 target = genOverflowWebgl(gl, texCache, node, target, width, height);\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\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);\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);\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) + (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的尝试\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) + (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) + (hasMask || 0);\n }\n // 超限的情况,这里是普通单节点超限,没有合成total后再合成特殊cache如filter/mask/mbm之类的,\n // 直接按原始位置绘制到离屏canvas,再作为纹理绘制即可,特殊的在total那做过降级了\n else if(limitCache && display !== 'none' && visibility !== 'hidden') {\n // let m = mx.m2Mat4(matrixEvent, cx, cy);\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(renderMode, refreshLevel, gl);\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 }\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\nexport default {\n renderCacheCanvas,\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[0] !== page || page.update) {\n // page可能为一个已有纹理,或者贴图\n if(page instanceof MockPage) {\n webgl.bindTexture(gl, page.texture, i);\n channels[i] = page;\n }\n else {\n // 可能老的先删除\n if(last) {\n gl.deleteTexture(last.texture);\n }\n page.texture = webgl.createTexture(gl, page.canvas, i);\n channels[i] = page;\n }\n hash[page.uuid] = i;\n }\n else {\n hash[page.uuid] = i;\n }\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\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 mode from './mode';\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 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 += `>`;\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 this.cache = !!this.props.cache;\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 css = window.getComputedStyle(dom, null);\n if(!this.width) {\n this.__width = parseFloat(css.getPropertyValue('width')) || 0;\n dom.setAttribute('width', this.width);\n }\n if(!this.height) {\n this.__height = parseFloat(css.getPropertyValue('height')) || 0;\n dom.setAttribute('height', this.height);\n }\n }\n // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d');\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', ca);\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 // 利用list循环代替tree递归快速渲染\n if(this.cache) {\n struct.renderCacheCanvas(renderMode, ctx, this);\n }\n else {\n struct.renderCanvas(renderMode, ctx, this);\n }\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 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 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, this, this.__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 let hasUpdate;\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 });\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, null, 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 });\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, null, 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], null, 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()计算自己,因为放在每次checkRoot()做过了\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 '../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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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.length >= 2) {\n num++;\n }\n if(controlB.length >= 2) {\n num += 2;\n }\n return num;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getNewPoint(x1, y1, x2, y2, controlA, controlB, num, start = 0, end = 1) {\n if(start > 0 || end < 1) {\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 = Math.abs(x1 - x2);\n let b = Math.abs(y1 - y2);\n x1 += a * start;\n y1 += b * start;\n x2 -= a * (1 - end);\n y2 -= b * (1 - end);\n }\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 => limitStartEnd(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 = limitStartEnd(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 limitStartEnd(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 = limitStartEnd(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 = limitStartEnd(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 = limitStartEnd(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) {\n let res = super.render(renderMode, lv, ctx, cache);\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 },\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += 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 - ox);\n bbox[0] = Math.min(bbox[0], xb - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[1] = Math.min(bbox[1], yb - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[2] = Math.max(bbox[2], xb + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n bbox[3] = Math.max(bbox[3], yb + oy);\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] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\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] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\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] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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 limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\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 let i = 0, j = list.length - 1;\n if(start > 0) {\n i = getIndex(len.increase, start * len.total, i, j);\n }\n if(end < 1) {\n j = getIndex(len.increase, end * len.total, i, j);\n }\n list = util.clone(list);\n end *= len.total;\n let prePercent = 1;\n if(end > 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 = end - len.increase[j];\n let t = diff / l;\n prePercent = t;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[j + 1] = [current[1] - (1 - t) * a, current[1] - (1 - t) * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], res[3][0], res[3][1]];\n }\n }\n start *= len.total;\n if(start > len.increase[i]) {\n let prev = list[i].slice(list[i].length - 2);\n let current = list[i + 1];\n let l = len.list[i];\n // 同一条线段时如果有end裁剪,会影响start长度\n if(i === j && prePercent !== 1) {\n l *= prePercent;\n }\n let diff = start - len.increase[i];\n let t = diff / l;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[i] = [prev[0] + t * a, prev[1] + t * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([[current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([[current[4], current[5]], [current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], current[4], current[5]];\n }\n }\n if(j < list.length - 2) {\n list = list.slice(0, j + 2);\n }\n if(i > 0) {\n list = list.slice(i);\n }\n return list;\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 => limitStartEnd(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 = limitStartEnd(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 limitStartEnd(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 v = limitStartEnd(v);\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 = limitStartEnd(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 = limitStartEnd(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 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 // points/controls有变化就需要重建顶点\n if(rebuild) {\n let { points, controls } = __cacheProps;\n if(isMulti) {\n __cacheProps.list2 = points.filter(item => Array.isArray(item)).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.filter(item => Array.isArray(item)).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 }\n return rebuild || rebuildSE;\n }\n\n render(renderMode, lv, ctx, cache) {\n let res = super.render(renderMode, lv, ctx, cache);\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 },\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += 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].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] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\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] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\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';\n\nclass Polygon extends Polyline {\n constructor(tagName, props) {\n super(tagName, props);\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\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} } = enums;\nconst { isNil } = util;\nconst { sectorPoints } = geom;\nconst { REM, VW, VH } = 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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 }\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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 }\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n bbox[0] = Math.min(bbox[0], originX - ox);\n bbox[1] = Math.min(bbox[1], originY - oy);\n bbox[2] = Math.max(bbox[2], originX + width + ox);\n bbox[3] = Math.max(bbox[3], originY + height + oy);\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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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));\n }\n else {\n __cacheProps.r = r * width * 0.5;\n __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache) {\n let res = super.render(renderMode, lv, ctx, cache);\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 }\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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 }\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - rx - ox;\n let xb = cx + rx + ox;\n let ya = cy - ry - oy;\n let yb = cy + ry + oy;\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 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 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 let animationRecord;\n if(animate) {\n if(Array.isArray(animate)) {\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 }\n });\n if(has) {\n animationRecord = {\n animate,\n target: vd,\n };\n }\n }\n else {\n (opt.abbr !== false) && abbr2full(animate, abbrAnimate);\n let { value, options } = animate;\n if(Array.isArray(value) && value.length) {\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n animationRecord = {\n animate,\n target: vd,\n };\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n }\n }\n // 产生实际动画运行才存入列表供root调用执行\n if(animationRecord) {\n animateRecords.push(animationRecord);\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 json = util.clone(json);\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(url);\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';\n\nexport default {\n css,\n reset,\n unit,\n font,\n abbr,\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 './node/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 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","STRUCT_KEY","STRUCT_NODE","STRUCT_INDEX","STRUCT_CHILD_INDEX","STRUCT_LV","STRUCT_NUM","STRUCT_TOTAL","STRUCT_HAS_MASK","enums","Node","__x","__y","__ox","__oy","__width","__height","__baseLine","__config","i","lv","j","root","struct","diff","isLayout","__sx","__sy","x","ox","y","oy","__prev","__next","__parent","__domParent","__root","__host","__hostRoot","__virtualDom","CANVAS","SVG","WEBGL","o","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","REM","EM","VW","VH","calUnit","v","n","parseFloat","test","info","arial","lhr","blr","lgr","padding","f","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","_","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","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","getLinear","coords","l1","l2","l3","l4","r1","getRadial","scx","scy","getConic","calConicRadius","renderConic","isInline","border","offscreen","imgData","putImageData","save","clip","drawImage","restore","add","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","isHost","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","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","tar","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","__enabled","setTransform","globalAlpha","update","__available","clear","del","ceil","getInstance","blur","isClip","cacheMask","tf","cacheOverflow","cacheFilter","drawCache","globalCompositeOperation","xe","ye","rect","old","newCache","nx","ny","dbx2","dby2","ENUM","NONE","TRANSFORM_ALL","REFLOW","REBUILD","TRANSFORMS","contain","value","getLevel","isReflow","isRebuild","Text","__textBoxes","__charWidthList","__charWidth","__textWidth","charWidthList","ffs","__ff","__key","wait","needMeasure","bp","__bp","pff","pffs","pfs","pfw","pKey","__pKey","parentCache","mw","__cache","lx","lineBoxManager","endSpace","lineClampCount","__sx1","__sy1","isDestroyed","textBoxes","beginSpace","maxW","needReduce","lastChar","ew","lineCount","isTextOverflow","__lineBack","textBox","addItem","cw","hasCache","needBack","setNewLine","__ellipsis","lineBox","tb","__offsetX","__offsetY","textWidth","__layout","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","event","fns","fn","REGISTER","setUpdateFlag","cp","__hasUpdate","__ref","__isMounted","__taskList","__nextState","addRefreshCp","builder","__cd","listener","__shadow","shadow","__shadowRoot","componentDidMount","REFRESH","__isDestroyed","componentWillUnmount","__destroy","force","__emitEvent","__state","hasRegister","defineProperty","get","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","copy","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","B","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","I_NODE_CONFIG","I_ROOT_CONFIG","I_STYLE","I_ASSIGNING","__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","u","calFrame","ts","binarySearch","frame","middle","ea","steps","stepsD","calIntermediateStyle","transition","st2","calIncrease","o2","n2","gotoOverload","I_IN_FPS","I_IS_DELAY","I_BEGIN","I_END","I_FINISHED","I_NEXT_END","I_FIRST_PLAY","I_FRAME_CB","I_PLAY_CB","I_TARGET","I_ROOT","I_FRAMES","I_FRAMES_R","I_CURRENT_TIME","I_NEXT_TIME","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_CAL_DIFF_TIME","I_FIRST_ENTER","I_STAY_BEGIN","I_STAY_END","I_IS2","I_END_TIME","I_OUT_BEGIN_DELAY","I_TIME_STAMP","Animation","__id","nl","__options","op","config","__frameCb","__calDiffTime","iterations","framesR","originStyle","fps","spfLimit","delay","endDelay","playbackRate","current","isFinish","__cancelTask","__currentProps","__currentStyle","isDelay","FRAME","PLAY","playState","__hasFin","__hasCancel","playCount","currentFrames","stayBegin","stayEnd","is2","endTime","currentTime","currentFrame","round","isAlternate","alternate","isEven","isLastCount","frameTime","isLastFrame","inEndDelay","needClean","__clean","BEGIN","END","FINISH","silence","pending","PAUSE","play","CANCEL","__goto","isFrame","excludeDelay","finish","currentProps","spf","animateController","remove","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","mbm","TF","TX","TY","TZ","getFirstEmptyInlineWidth","flowChildren","child","getLastEmptyInlineWidth","__computedStyle","__listener","__loadBgi","__cacheDefs","__isClip","__isMask","__contentBoxList","__hasMask","__mpWidth","mp","__clientWidth","__clientHeight","__offsetWidth","__offsetHeight","__outerWidth","__outerHeight","onlyFixedValue","isDirectionRow","isDirectItem","__calMp","isVirtual","fromAbs","isShadowRoot","clearCache","__layoutData","__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","offsetWidth","offsetHeight","matrixCache","isScale","clientHeight","x5","x6","y5","y6","__calFilter","bg","bgI","item2","kw","rebuild","__hasContent","isRealInline","sx4","sx5","sx6","sy4","sy5","sy6","hasContent","__calContent","__calPerspective","__calMatrix","__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","hostRoot","pJson","zChildren","zIndexChildren","__spreadBbox","LineBox","__list","__lineHeight","LineBoxManager","__lastX","__lastY","__maxX","__domList","__domStack","__isNewLine","__isEnd","__setLB","nextNewLine","genLineBox","verticalAlign","isNewLine","TAG_NAME","INLINE","BOLD","offsetAndResizeByNodeOnY","reflowHash","inDirectAbsList","isContainer","cs","__layoutAbs","isAbs","__resizeY","clearUniqueReflowId","__uniqueReflowId","getMergeMarginTB","topList","bottomList","genZIndexChildren","hasMc","mcHash","lastMaskIndex","__iIndex","__zIndex","__aIndex","sort","genOrderChildren","__order","block","inlineBlock","none","tag","__flexLine","__zIndexChildren","__structure","nss","__structs","structs","needSort","__tryLayInline","firstCharWidth","main","isRow","__calMinMax","min2","max2","countMin","countMax","setNotEnd","__addMp","isFixed","isContent","fixedSize","__lineBoxManager","__preLayout","__ioSize","mergeMarginBottomList","mergeMarginTopList","isXom","isInlineBlock","isImg","reflow","__isIbFull","lastX","lastY","isNone","isEmptyBlock","tw","th","horizonAlign","__inlineSize","domList","__marginAuto","growList","shrinkList","basisList","maxList","minList","orderChildren","__calBasis","containerSize","isMultiLine","line","hypotheticalList","hypothetical","maxCrossList","__layoutFlexLine","maxCross","crossSum","crossSumList","between","around","__crossAlign","flexLine","hypotheticalSum","targetMainList","factorSum","factorList","needReset","factorSum2","lbmList","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","needCalWidth","wl","hl","__computeMeasure","__deepScan","loadImg","__loadImg","placeholder","loading","__loadAndRefresh","showError","pts","arc","__addGeom","reload","Defs","cacheHash","__isMulti","multi","__cacheProps","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","MockPage","genUuid","MockCache","OP","FT","MBM","PPT","OFFSCREEN_OVERFLOW","OFFSCREEN_FILTER","OFFSCREEN_MASK","OFFSCREEN_BLEND","OFFSCREEN_MASK2","getCache","genBboxTotal","parentIndexHash","opacityHash","includeLimitCache","bboxTotal","matrixHash","parentIndex","node2","hasTotal","mergeBbox","genTotal","cacheTop","hasMask","genFilter","genMask","genOverflow","sbox","genFrameBufferWithTexture","lockOneChannel","webgl","createFramebuffer","bindFramebuffer","checkFramebufferStatus","FRAMEBUFFER_COMPLETE","viewport","clearColor","COLOR_BUFFER_BIT","genTotalWebgl","getParameter","MAX_TEXTURE_SIZE","parentPm","totalLimitCache","addTexAndDrawWhenLimit","mockCache","refresh","releaseLockChannel","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","applyOffscreen","origin","renderCacheCanvas","matrixList","parentMatrix","opacityList","parentOpacity","lastConfig","lastLv","mergeList","refreshLevel","hasRecordAsMask","needGen","maskStartHash","offscreenHash","renderCanvas","renderSvg","maskEffectHash","defsCache","hasEffectMask","addCache","maskHash","vdList","parentVd","mChildren","ivs","hasTransform","renderWebgl","pmList","lastRefreshLevel","hasMbm","validMbm","isPerspective","limitHash","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","getPropertyValue","__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","__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","limitStartEnd","getNewPoint","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","__start","__end","buildCache","curve","bezierBox","concatPointAndControl","control","getLength","increase","getIndex","getNewList","prePercent","Polyline","__points","__controls","controls","isControl","rebuildSE","__getPoints","__renderPolygon","pointList","controlList","Polygon","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","replaceLibraryVars","linkLibrary","JSON","linkChild","libraryItem","library","libraryId","parse","animateRecords","opt","createGm","createCp","createVd","animationRecord","fonts","loadAndParse","components","imgs","list1","list3","callback","version","appendTo","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;AAyEVn4B,EAAAA,KAAK,EAALA,KAzEU;AA0EVjuB,EAAAA,IAAI,EAAJA,IA1EU;AA2EV0L,EAAAA,MAAM,EAANA,MA3EU;AA4EV3X,EAAAA,KAAK,EAALA,KA5EU;AA6EV8/D,EAAAA,MAAM,EAANA,GA7EU;AA8EVxX,EAAAA,OAAO,EAAPA,OA9EU;AA+EVj5B,EAAAA,IAAI,EAAJA,IA/EU;AAgFVkM,EAAAA,OAAO,EAAPA,OAhFU;AAiFVq8B,EAAAA,OAAO,EAAPA,OAjFU;AAkFVhM,EAAAA,OAAO,EAAPA,OAlFU;AAmFV9gE,EAAAA,KAAK,EAALA,KAnFU;;AAoFV,MAAI0rB,KAAJ,CAAU1oB,CAAV,EAAa;AACX0oB,IAAAA,KAAK,CAACrI,IAAN,GAAa,CAAC,CAACrgB,CAAf;AACD;;AAtFS,CAAZ;AAyFAytC,OAAO,CAACvB,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,OAAO/f,MAAP,KAAkB,WAArB,EAAkC;AAChCA,EAAAA,MAAM,CAACo/C,KAAP,GAAeA,OAAf;AACD,CAFD,MAGK,IAAG,OAAO38C,IAAP,KAAgB,WAAnB,EAAgC;AACnCA,EAAAA,IAAI,CAAC28C,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/node/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/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/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};\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\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};\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.__width = 0;\n this.__height = 0;\n this.__baseLine = 0;\n this.__config = {};\n // 默认undefined\n // this.__prev = undefined;\n // this.__next = undefined;\n // this.__parent = undefined;\n // this.__domParent = undefined;\n // this.__root = undefined;\n // this.__host = undefined;\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\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 /**\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 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 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 = 67, 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;\n\nexport default o;\n","export default {\n position: /(([-+]?[\\d.]+[pxremvwh%]*)|(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];\n let a1 = a[i + 4];\n let a2 = a[i + 8];\n let a3 = a[i + 12];\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) {\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 = 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 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 = 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 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') {\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 '../node/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 } = 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(['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 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 = { _: 1 };\nconst TYPE_GM = { _: 2 };\nconst TYPE_CP = { _: 3 };\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 s += joinDef(item);\n });\n s += '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\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 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 += '';\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 += '>';\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(/`;\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(location.hostname !== host[1]) {\n img.crossOrigin = 'anonymous';\n }\n }\n }\n img.src = url;\n if(debug.flag) {\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') {\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(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.loadFont(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 font invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\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 let f = new FontFace(url, `url(${url})`);\n f.load().then(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 }).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 '../node/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, 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 {\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 {\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 {\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, d = 0;\n // 扩展的from to ratio格式,圆心、长轴坐标、短轴缩放比\n if(Array.isArray(size)) {\n cx = x1 + size[0] * iw;\n cy = y1 + size[1] * ih;\n if(size[4] <= 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[4];\n r = Math.max(xl, yl);\n // 看旋转\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 else {\n // 默认椭圆a是水平轴,b是垂直轴\n [cx, cy] = calCircleCentre(position, x1, y1, iw, ih, root);\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, 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.]+))?/.exec(gradient[2]);\n if(points) {\n o.z = [parseFloat(points[1]), parseFloat(points[2]), parseFloat(points[3]), parseFloat(points[4])];\n if(!isNil(points[5])) {\n o.z.push(parseFloat(points[5]));\n }\n else {\n o.z.push(1);\n }\n }\n else {\n o.z = 'farthest-corner';\n }\n }\n let position = /at\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?: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.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?: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.]+[pxremvwh%]+)?\\s*((#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))\\s*([-+]?[\\d.]+[pxremvwh%]+)?/ig) || [];\n o.v = v.map(item => {\n let color = /((?:#[0-9a-f]{3,8})|(?:rgba?\\s*\\(.+?\\)))/i.exec(item);\n let arr = [rgba2int(color[1])];\n let percent = /[-+]?[\\d.]+[pxremvwh%]+/.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) {\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, 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 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: '#000',\n borderRightColor: '#000',\n borderBottomColor: '#000',\n borderLeftColor: '#000',\n borderTopStyle: 'solid',\n borderRightStyle: 'solid',\n borderBottomStyle: 'solid',\n borderLeftStyle: 'solid',\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.]+[pxremvwh%]*)|(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.]+[pxremvwh%]*\\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)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]);\n }\n else if(/^[\\d.]+\\s+[\\d.]+\\s+[\\d.]+[pxremvwh%]*/.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.]+[pxremvwh%]+/.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.]+[pxremvwh%]+/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.]+[pxremvwh%]*)/.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};\n\no.isIgnore = function(k) {\n return IGNORE.hasOwnProperty(k);\n};\nfunction isGeom(tagName, k) {\n return GEOM.hasOwnProperty(k) && GEOM[k].hasOwnProperty(tagName);\n}\no.isGeom = isGeom;\no.isRepaint = function(k) {\n return REPAINT.hasOwnProperty(k) || isGeom(k);\n};\no.isMeasure = function(k) {\n return MEASURE.hasOwnProperty(k);\n};\no.isValid = function(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\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']);\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, 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 // 扩展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(!isNil(v) && 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) {\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(!isNil(temp)) {\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) {\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.]+[pxremvwh%]*)|(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(!isNil(v)) {\n res[STYLE_KEY[style2Upper(k)]] = [rgba2int(v), 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(!isNil(v)) {\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) {\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]);\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(!isNil(temp)) {\n let arr = calUnit(temp);\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(!isNil(temp)) {\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(isNil(v)) {\n return;\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) {\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]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n res[ROTATE_3D] = arr;\n }\n }\n temp = style.opacity;\n if(!isNil(temp)) {\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(!isNil(temp)) {\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(isNil(v)) {\n return;\n }\n if(v === 'auto') {\n v = [0, AUTO];\n }\n else {\n v = calUnit(v);\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(!isNil(temp)) {\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(!isNil(temp)) {\n res[ORDER] = parseInt(temp) || 0;\n }\n temp = style.color;\n if(!isNil(temp)) {\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(!isNil(temp)) {\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 || temp === 0) {\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(!isNil(temp)) {\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(!isNil(temp)) {\n if(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(!isNil(temp)) {\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) {\n if(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) {\n if(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) {\n if(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 === '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) {\n if(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(!isNil(temp)) {\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(!isNil(temp)) {\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') {\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) {\n if(temp === 'inherit') {\n res[VISIBILITY] = [0, INHERIT];\n }\n else {\n res[VISIBILITY] = [temp, STRING];\n }\n }\n temp = style.pointerEvents;\n if(temp) {\n if(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.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*\\s*)?([-+]?[\\d.]+[pxremvwh%]*\\s*)?(((transparent)|(#[0-9a-f]{3,8})|(rgba?\\(.+?\\)))\\s*)?(inset|outset)?\\s*,?/ig);\n if(match) {\n match.forEach(item => {\n let boxShadow = /([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*\\s*)?([-+]?[\\d.]+[pxremvwh%]*\\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(!isNil(temp)) {\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 {\n computedStyle[k] = v[0];\n }\n });\n}\n\n/**\n * 每次布局前需要计算的reflow相关的computedStyle\n * @param node 对象节点\n * @param isHost 是否是根节点或组件节点这种局部根节点,无继承需使用默认值\n */\nfunction computeReflow(node, isHost) {\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 {\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 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] === 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 {\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];\n return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' '\n + fontSize + 'px/' + fontSize + 'px ' + (style[FONT_FAMILY] || 'arial');\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 }\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 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 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\nexport default {\n normalize,\n computeMeasure,\n computeReflow,\n setFontStyle,\n getFontFamily,\n getBaseLine,\n calRelative,\n calAbsolute,\n equalStyle,\n isRelativeOrAbsolute,\n cloneStyle,\n};\n","import mode from './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\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","import matrix from './matrix';\nimport tar from './tar';\nimport geom from './geom';\n\nexport default {\n matrix,\n tar,\n geom,\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 } = 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 }\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 }\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 });\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 DISPLAY,\n VISIBILITY,\n },\n NODE_KEY: {\n NODE_OPACITY,\n NODE_CACHE,\n NODE_CACHE_FILTER,\n NODE_CACHE_OVERFLOW,\n NODE_HAS_CONTENT,\n NODE_COMPUTED_STYLE,\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 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 }\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 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, 'filter1');\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, next, isClip, transform, tfo) {\n let cacheMask = genSingle(target, 'mask1');\n let list = [];\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;\n tfo[1] += y + dby;\n let inverse = tf.calMatrixByOrigin(transform, tfo);\n // 先将mask本身绘制到cache上,再设置模式绘制dom本身,因为都是img所以1个就够了\n list.forEach(item => {\n let __config = item.__config;\n let cacheOverflow = __config[NODE_CACHE_OVERFLOW], cacheFilter = __config[NODE_CACHE_FILTER], cache = __config[NODE_CACHE];\n let source = cacheOverflow && cacheOverflow.available && cacheOverflow;\n if(!source) {\n source = cacheFilter && cacheFilter.available && cacheFilter;\n }\n if(!source) {\n source = cache && cache.available && cache;\n }\n if(source) {\n ctx.globalAlpha = __config[NODE_OPACITY];\n Cache.drawCache(\n source, cacheMask,\n __config[NODE_COMPUTED_STYLE][TRANSFORM],\n mx.identity(),\n __config[NODE_COMPUTED_STYLE][TRANSFORM_ORIGIN].slice(0),\n inverse\n );\n }\n // 没有内容或者img没加载成功导致没有内容,有内容且可见则是超限,不可能进这里\n else if(__config[NODE_HAS_CONTENT]\n && __config[NODE_COMPUTED_STYLE][DISPLAY] !== 'none'\n && __config[NODE_COMPUTED_STYLE][VISIBILITY] !== 'hidden') {\n inject.error('CacheMask is oversize');\n }\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, 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(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\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 './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 } = 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 }\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 // text-overflow:ellipse需要,即便没有也要先测量,其基于最近非inline父节点的字体\n let bp = this.domParent;\n while(bp.currentStyle[DISPLAY] === 'inline') {\n bp = bp.domParent;\n }\n this.__bp = bp;\n let parentComputedStyle = bp.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.__sx1 = x;\n this.__y = this.__sy1 = y;\n let { isDestroyed, content, currentStyle, 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 || currentStyle[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 let lineCount = 0;\n // 不换行特殊对待,同时考虑overflow和textOverflow\n if(whiteSpace === 'nowrap') {\n let isTextOverflow;\n // block的overflow:hidden和textOverflow:clip/ellipsis才生效,inline要看最近非inline父元素\n let bp = this.__bp;\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) {\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.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.__width = maxX - minX;\n }\n\n __calMaxAndMinWidth() {\n let n = 0;\n this.charWidthList.forEach(item => {\n n = Math.max(n, item);\n });\n return { max: this.textWidth, min: n };\n }\n\n __calAbsWidth(x, y, w) {\n this.__layout({\n x,\n y,\n w,\n }, true);\n return this.width;\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 { sx, sy, width, height, root, currentStyle: { [TEXT_STROKE_WIDTH]: textStrokeWidth = [0] } = {} } = this;\n let half = 0;\n if(textStrokeWidth[1] === REM) {\n half = Math.max(textStrokeWidth[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(textStrokeWidth[1] === VW) {\n half = Math.max(textStrokeWidth[0] * root.width * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VH) {\n half = Math.max(textStrokeWidth[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(textStrokeWidth[0] * 0.5, half);\n }\n half += 1;\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 let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\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.__hasUpdate) {\n return;\n }\n cp.__hasUpdate = 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 '../node/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 } = unit;\n\nfunction renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bbrr, bblr, method = 'fill', isInline) {\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);\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] === 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 }\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 let source = loadBgi.source;\n // 无source不绘制,可能错误或加载中\n if(source) {\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} = enums;\nconst { AUTO, PX, PERCENT, INHERIT, RGBA, STRING, NUMBER, REM, VW, VH, 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 }\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 }\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 }\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 }\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 }\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,其余都是特殊固定单位\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') {\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') {\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没有增量\n else {\n if(n === p || k === 'edge' || k === 'closure') {\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 {\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') {\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\nlet uuid = 0;\n\nconst I_ASSIGNING = 0;\nconst I_IN_FPS = 1;\nconst I_IS_DELAY = 2;\nconst I_BEGIN = 3;\nconst I_END = 4;\nconst I_FINISHED = 5;\nconst I_NEXT_END = 6;\nconst I_FIRST_PLAY = 7;\nconst I_FRAME_CB = 8;\nconst I_PLAY_CB = 9;\nconst I_TARGET = 10;\nconst I_ROOT = 11;\nconst I_FRAMES = 12;\nconst I_FRAMES_R = 13;\nconst I_CURRENT_TIME = 14;\nconst I_NEXT_TIME = 15;\nconst I_STYLE = 16;\nconst I_DURATION = 17;\nconst I_ITERATIONS = 18;\nconst I_FILL = 19;\nconst I_PLAYBACK_RATE = 20;\nconst I_PLAY_COUNT = 21;\nconst I_PLAY_STATE = 22;\nconst I_DESTROYED = 23;\nconst I_START_TIME = 24;\nconst I_FPS_TIME = 25;\nconst I_EASING = 26;\nconst I_ENTER_FRAME = 27;\nconst I_DELAY = 28;\nconst I_END_DELAY = 29;\nconst I_KEYS = 30;\nconst I_ORIGIN_STYLE = 31;\nconst I_CURRENT_FRAMES = 32;\nconst I_CURRENT_FRAME = 33;\nconst I_SPF_LIMIT = 34;\nconst I_FPS = 35;\nconst I_DIRECTION = 36;\nconst I_CAL_DIFF_TIME = 37;\nconst I_FIRST_ENTER = 38;\nconst I_STAY_BEGIN = 39;\nconst I_STAY_END = 40;\nconst I_IS2 = 41;\nconst I_END_TIME = 42;\nconst I_NODE_CONFIG = 43;\nconst I_ROOT_CONFIG = 44;\nconst I_OUT_BEGIN_DELAY = 45;\nconst I_TIME_STAMP = 46;\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 this.__frameCb,\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 this.__calDiffTime,\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 __config[I_CURRENT_TIME] = __config[I_DELAY] + __config[I_DURATION] + __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 __frameCb(__config, diff, isDelay) {\n this.emit(Event.FRAME, diff, isDelay);\n if(__config[I_FIRST_PLAY]) {\n __config[I_FIRST_PLAY] = false;\n this.emit(Event.PLAY);\n }\n if(isFunction(__config[I_PLAY_CB])) {\n __config[I_PLAY_CB].call(this, diff, isDelay);\n __config[I_PLAY_CB] = null;\n }\n }\n\n __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\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 = __config[I_PLAY_COUNT];\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] = __config[I_CAL_DIFF_TIME](__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(playCount === 0 && 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 if(playCount === 0) {\n currentTime -= delay;\n }\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 __config[I_NEXT_TIME] -= duration;\n playCount = ++__config[I_PLAY_COUNT];\n __config[I_BEGIN] = true;\n round = true;\n }\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 this.__clean(true);\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 __config[I_FRAME_CB].call(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 __config[I_FRAME_CB].call(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 __config[I_FRAME_CB].call(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 __goto(v, isFrame, excludeDelay) {\n let __config = this.__config;\n let duration = __config[I_DURATION];\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\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 // 超过一轮去掉delay\n if(v > duration + __config[I_DELAY]) {\n v -= __config[I_DELAY];\n }\n // 超过时间长度需要累加次数\n __config[I_PLAY_COUNT] = 0;\n while(v > duration && __config[I_PLAY_COUNT] < __config[I_ITERATIONS] - 1) {\n __config[I_PLAY_COUNT]++;\n v -= duration;\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n __config[I_NEXT_TIME] = v;\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 = __config[I_PLAY_COUNT] % 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 '../node/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) {\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 mode from './mode';\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 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;\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 }\n} = enums;\nconst { AUTO, PX, PERCENT, INHERIT, NUMBER, REM, VW, VH, DEG } = unit;\nconst { int2rgba, rgba2int, joinArr, isNil } = 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 }\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.__mpWidth(currentStyle[a], w);\n computedStyle[b] = this.__mpWidth(currentStyle[b], w);\n });\n }\n\n __mpWidth(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 return 0;\n }\n\n // dom常用的几种尺寸赋值\n __ioSize(w, h) {\n let computedStyle = this.computedStyle;\n this.__clientWidth = w += computedStyle[PADDING_LEFT] + computedStyle[PADDING_RIGHT];\n this.__clientHeight = h += computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM];\n this.__offsetWidth = w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[BORDER_RIGHT_WIDTH];\n this.__offsetHeight = h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH];\n this.__outerWidth = w + computedStyle[MARGIN_LEFT] + computedStyle[MARGIN_RIGHT];\n this.__outerHeight = h + computedStyle[MARGIN_TOP] + computedStyle[MARGIN_BOTTOM];\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 return n;\n }\n\n // 为basis的b/min/max添加mpb,只有当b未显示指定等于w/content时才加,同时返回mpb值\n __addMp(isDirectionRow, w, currentStyle, 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 [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w, !isDirectItem)\n + this.__calMp(marginRight, w, !isDirectItem)\n + this.__calMp(paddingLeft, w, !isDirectItem)\n + this.__calMp(paddingRight, w, !isDirectItem);\n if(borderLeftWidth[1] === PX) {\n mp += borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n mp += borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n mp += borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n mp += borderLeftWidth[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n mp += borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n mp += borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n mp += borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n mp += borderRightWidth[0] * this.root.height * 0.01;\n }\n res = res.map(item => item + mp);\n }\n else {\n let mp = this.__calMp(marginTop, w, !isDirectItem)\n + this.__calMp(marginBottom, w, !isDirectItem)\n + this.__calMp(paddingTop, w, !isDirectItem)\n + this.__calMp(paddingBottom, w, !isDirectItem);\n if(borderTopWidth[1] === PX) {\n mp += borderTopWidth[0];\n }\n else if(borderTopWidth[1] === REM) {\n mp += borderTopWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderTopWidth[1] === VW) {\n mp += borderTopWidth[0] * this.root.width * 0.01;\n }\n else if(borderTopWidth[1] === VH) {\n mp += borderTopWidth[0] * this.root.height * 0.01;\n }\n if(borderBottomWidth[1] === PX) {\n mp += borderBottomWidth[0];\n }\n else if(borderBottomWidth[1] === REM) {\n mp += borderBottomWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderBottomWidth[1] === VW) {\n mp += borderBottomWidth[0] * this.root.width * 0.01;\n }\n else if(borderBottomWidth[1] === VH) {\n mp += borderBottomWidth[0] * this.root.height * 0.01;\n }\n res = res.map(item => item + mp);\n }\n return res;\n }\n\n // absolute且无尺寸时,isVirtual标明先假布局一次计算尺寸,还有flex列计算时\n // fromAbs为absolute节点特有省略计算标识,本节点是abs时真正布局传入\n __layout(data, isVirtual, fromAbs) {\n css.computeReflow(this, this.isShadowRoot);\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.clearCache();\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 __config[NODE_REFRESH_LV] = REFLOW;\n __config[NODE_LIMIT_CACHE] = false;\n __config[NODE_IS_INLINE] = false;\n // 防止display:none不统计mask,isVirtual忽略,abs布局后续会真正来走一遍\n if(!isVirtual) {\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 return;\n }\n // margin/padding在abs前已经计算过了,无需二次计算\n if(!fromAbs) {\n this.__mp(currentStyle, computedStyle, w);\n }\n // inline的width/height无效,其它有效\n if(width[1] !== AUTO) {\n if(this.__isRealInline() && currentStyle[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 }\n }\n }\n let lineClampCount = 0;\n // 4种布局,默认block,inlineBlock基本可以复用inline逻辑,除了尺寸\n if(display === 'flex') {\n this.__layoutFlex(data, isVirtual);\n }\n else if(display === 'inlineBlock' || display === 'inline-block') {\n lineClampCount = this.__layoutInline(data, isVirtual);\n }\n else if(display === 'inline') {\n lineClampCount = this.__layoutInline(data, isVirtual, true);\n }\n else {\n this.__layoutBlock(data, isVirtual);\n }\n // relative渲染时做偏移,百分比基于父元素,若父元素没有定高则为0\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布局的不执行,在__layoutAbs末尾做,防止未布局没有尺寸从而动画计算错误\n if(!fromAbs) {\n this.__execAr();\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[PADDING_TOP]\n = computedStyle[PADDING_RIGHT]\n = computedStyle[PADDING_BOTTOM]\n = computedStyle[PADDING_LEFT]\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 }\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 }\n }\n // margin/padding/border影响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已知目标主尺寸,需减去mpb,其一定是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.tagName === 'img') && 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 {\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 {\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 {\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 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] === 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] === 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 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 {\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 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 {\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 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 * @param lv\n * @param ctx canvas/svg/webgl共用\n * @param cache 是否开启缓存\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 * offscreenMask 无cache时的离屏canvas,仅canvas\n * offscreenOverflow 无cache时的离屏canvas,仅canvas\n */\n render(renderMode, lv, ctx, cache) {\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 this.__bbox = null;\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);\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);\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 + dx, iy1 + dy, ix2 - ix1, iy2 - iy1, btlr, [0, 0], [0, 0], bblr);\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);\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 + dx, iy1 + dy, ix2 - ix1, iy2 - iy1, isFirst ? btlr : [0, 0], btrr, bbrr, isFirst ? bblr : [0, 0]);\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);\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);\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);\n }\n }\n else if(bgi.k) {\n let gd = this.__gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi);\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);\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);\n });\n }\n // 边框需考虑尖角,两条相交边平分45°夹角\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_TOP], __cacheStyle[BORDER_TOP_COLOR]);\n }\n if(borderRightWidth > 0 && borderRightColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_RIGHT], __cacheStyle[BORDER_RIGHT_COLOR]);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_BOTTOM], __cacheStyle[BORDER_BOTTOM_COLOR]);\n }\n if(borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_LEFT], __cacheStyle[BORDER_LEFT_COLOR]);\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.delRefreshTask(this.__loadBgi.cb);\n 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' && util.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(util.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) {\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);\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);\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);\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.cx, gd.cy, 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.cx],\n ['cy', gd.cy],\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 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(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, formatStyle);\n if(util.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(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, style);\n if(util.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(util.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(util.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.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) {\n let ox = 0, oy = 0;\n if(Array.isArray(boxShadow)) {\n boxShadow.forEach(item => {\n let [x, y, sigma, spread, , inset] = item;\n if(inset !== 'inset') {\n let d = blur.outerSize(sigma);\n d += spread;\n ox = Math.max(ox, x + d);\n oy = Math.max(oy, y + d);\n }\n });\n }\n return [ox, oy];\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() {\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent } = this;\n let p1 = point2d(mx.calPoint([__sx1, __sy1], matrixEvent));\n let p2 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1], matrixEvent));\n let p3 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1 + offsetHeight], matrixEvent));\n let p4 = point2d(mx.calPoint([__sx1, __sy1 + offsetHeight], 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(util.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(util.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] = level.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(util.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, clientWidth, clientHeight,\n currentStyle: {\n [BORDER_TOP_WIDTH]: borderTopWidth = [0],\n [BORDER_RIGHT_WIDTH]: borderRightWidth = [0],\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth = [0],\n [BORDER_LEFT_WIDTH]: borderLeftWidth = [0],\n [BOX_SHADOW]: boxShadow = [],\n } = {},\n } = this;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n clientWidth += borderLeftWidth[0] + borderRightWidth[0];\n clientHeight += borderTopWidth[0] + borderBottomWidth[0];\n let half = 1;\n this.__bbox = [__sx1 - ox - half, __sy1 - oy - half, __sx1 + clientWidth + ox + half, __sy1 + clientHeight + oy + half];\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\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 n = this.baseLine;\n // 只有1个也需要对齐,因为可能内嵌了空inline使得baseLine发生变化\n if(this.list.length) {\n this.list.forEach(item => {\n let m = item.baseLine;\n if(m !== n) {\n item.__offsetY(n - m);\n }\n });\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\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 = 0;\n this.list.forEach(item => {\n baseLine = Math.max(baseLine, item.baseLine);\n });\n return Math.max(this.__baseLine, baseLine);\n }\n\n get lineHeight() {\n let lineHeight = 0;\n // 只有TextBox和InlineBlock\n this.list.forEach(item => {\n lineHeight = Math.max(lineHeight, item.outerHeight);\n });\n return Math.max(this.__lineHeight, 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 }\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 verticalAlign() {\n this.list.forEach(lineBox => {\n lineBox.verticalAlign();\n });\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\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.currentStyle[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, null, 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 mode from './mode';\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 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 // PERSPECTIVE,\n // TRANSFORM,\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 } = unit;\nconst { calAbsolute, isRelativeOrAbsolute } = css;\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 = util.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 {\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 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 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 }\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 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 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 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 // item的递归子节点求min/max,只考虑固定值单位,忽略百分比,同时按方向和display\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this, this.isShadowRoot);\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h, lineBoxManager } = data;\n // 计算需考虑style的属性\n let {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n else {\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\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 = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\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 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 });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n else if(display === 'block') {\n let countMin = 0, countMax = 0;\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\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 if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n else {\n if(display === 'inlineBlock' || display === 'inline-block') {\n lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n }\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n if(isDirectionRow) {\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 min += item.charWidth;\n max += item.textWidth;\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n });\n }\n }\n return [display, this.__addMp(isDirectionRow, w, currentStyle, [min, max])];\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时isVirtual状态参与计算,文本抵达边界才进行换行\n * @param isDirectionRow\n * @param data\n * @param isVirtual abs非固定尺寸时先进行虚拟布局标识\n * @private\n */\n __calBasis(isDirectionRow, data, isVirtual) {\n css.computeReflow(this, this.isShadowRoot);\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 [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n [FLEX_BASIS]: flexBasis,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\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].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 }\n // 已声明主轴尺寸的,当basis是auto时为值\n else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1) && isAuto) {\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 }\n // 非固定尺寸的basis为auto时降级为content\n else if(isAuto) {\n isContent = true;\n }\n // flex的item还是flex时\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\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 = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\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 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 });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n // flex的item是block/inline时,inline也会变成block统一对待\n else {\n let countMin = 0, countMax = 0;\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\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 if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n if(fixedSize) {\n max = Math.max(fixedSize, max);\n }\n if(isContent) {\n b = max;\n }\n // 直接item的mpb影响basis\n return this.__addMp(isDirectionRow, w, currentStyle, [b, min, max], true);\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 isVirtual abs无尺寸时提前虚拟布局计算尺寸\n * @private\n */\n __layoutBlock(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\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 isImg = item.tagName === 'img';\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 }, isVirtual);\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 || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // abs统计宽度\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.outerWidth;\n maxW = Math.max(maxW, cw);\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 }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock || isImg) && 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 }, isVirtual);\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 || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n if(isVirtual) {\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 }, isVirtual);\n let isNone = item.currentStyle[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(isVirtual) {\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 }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.width;\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 }, isVirtual);\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 }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, item.width);\n cw = 0;\n }\n }\n if(isVirtual) {\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 || !isVirtual) ? w : maxW;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // 非abs提前的虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐\n if(!isVirtual) {\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 // 所有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, isVirtual) {\n let { flowChildren, currentStyle, computedStyle, __flexLine } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\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 maxX = 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 // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n // abs虚拟布局计算时纵向也是看横向宽度\n let [b, min, max] = item.__calBasis(isVirtual ? true : isDirectionRow, { x, y, w, h }, isVirtual);\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += max;\n }\n else {\n maxX = Math.max(maxX, max);\n }\n return;\n }\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 if(isVirtual) {\n if(isDirectionRow) {\n maxX += item.textWidth;\n }\n else {\n maxX = Math.max(maxX, item.textWidth);\n }\n return;\n }\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 });\n let h = item.height;\n basisList.push(h);\n minList.push(h);\n }\n }\n });\n // abs时,只需关注宽度即可,无需真正布局\n if(isVirtual) {\n let tw = this.__width = Math.min(maxX, w);\n this.__ioSize(tw, this.height);\n return;\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, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, 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 let tw = this.__width = w;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\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(!isVirtual && 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(!isVirtual) {\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 }\n this.__marginAuto(currentStyle, data);\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, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, 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 });\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h: main,\n h3: main, // 同w2\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 });\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(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(['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 isVirtual\n * @param isInline\n * @private\n */\n __layoutInline(data, isVirtual, 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(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\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 }, isVirtual);\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 }, isVirtual);\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 }, isVirtual);\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 }, isVirtual);\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 }, isVirtual);\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 }, isVirtual);\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(isVirtual) {\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(!isVirtual && !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(currentStyle[DISPLAY] === 'none') {\n item.__layoutNone();\n return;\n }\n // 先根据容器宽度计算margin/padding\n item.__mp(currentStyle, computedStyle, clientWidth);\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let { [LEFT]: left, [TOP]: top, [RIGHT]: right,\n [BOTTOM]: bottom, [WIDTH]: width, [HEIGHT]: height, [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection } = 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 = x + clientWidth - computedStyle[RIGHT] - x2;\n }\n else if(fixedLeft) {\n x2 = x + computedStyle[LEFT];\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n }\n else if(fixedRight) {\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\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 -= currentStyle[BORDER_LEFT_WIDTH][0];\n x2 -= currentStyle[BORDER_RIGHT_WIDTH][0];\n }\n else {\n x2 = x + paddingLeft;\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n }\n // top/bottom/height优先级同上\n if(fixedTop && fixedBottom) {\n y2 = y + computedStyle[TOP];\n h2 = y + clientHeight - computedStyle[BOTTOM] - y2;\n }\n else if(fixedTop) {\n y2 = y + computedStyle[TOP];\n if(height[1] !== AUTO) {\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else {\n h2 = height[0];\n }\n }\n }\n else if(fixedBottom) {\n if(height[1] !== AUTO) {\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else {\n h2 = height[0];\n }\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 -= currentStyle[BORDER_TOP_WIDTH][0];\n y2 -= currentStyle[BORDER_BOTTOM_WIDTH][0];\n }\n // 未声明y的找到之前的流布局child,紧随其下\n else {\n y2 = y + paddingTop;\n let prev = item.prev;\n while(prev) {\n // 目前不考虑margin合并,直接以前面的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] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else if(height[1] === PX) {\n h2 = height[0];\n }\n }\n // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局\n let needCalWidth;\n if((display === 'block' || ['inlineBlock', 'inline-block'].indexOf(display) > -1) && w2 === undefined) {\n needCalWidth = true;\n }\n else if(display === 'flex') {\n if(w2 === undefined) {\n needCalWidth = true;\n }\n else if(flexDirection === 'column' && h2 === undefined) {\n needCalWidth = true;\n }\n }\n // onlyRight时做的布局其实是以那个点位为left/top布局然后offset,limit要特殊计算,从本点向左侧为边界\n let wl = onlyRight ? x2 - x : clientWidth + x - x2;\n // onlyBottom相同,正常情况是左上到右下的尺寸限制\n let hl = onlyBottom ? y2 - y : clientHeight + y - y2;\n // 未直接或间接定义尺寸,取孩子宽度最大值\n if(needCalWidth) {\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n }, true, true);\n wl = item.outerWidth;\n }\n // needCalWidth传入,因为自适应尺寸上面已经计算过一次margin/padding了\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n w2, // left+right这种等于有宽度,但不能修改style,继续传入到__preLayout中特殊对待\n h2,\n }, false, true);\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 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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(util.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(!util.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(util.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(!util.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(util.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(!util.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(util.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(!util.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(util.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(util.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 './mode';\nimport painter from '../util/painter';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport unit from '../style/unit';\nimport image from '../style/image';\nimport border from '../style/border';\nimport enums from '../util/enums';\nimport level from '../refresh/level';\nimport mx from '../math/matrix';\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_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\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, RGBA } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { isFunction } = util;\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 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的方法,在__layout3个分支中会首先被调用\n * 当样式中固定宽高时,图片按样式尺寸,加载后重新绘制即可\n * 只固定宽高一个时,加载完要计算缩放比,重新布局绘制\n * 都没有固定,按照图片尺寸,重新布局绘制\n * 这里计算非固定的情况,将其改为固定供布局渲染使用,未加载完成为0\n * @param data\n * @returns {{fixedWidth: boolean, w: *, x: *, h: *, y: *, fixedHeight: boolean}}\n * @private\n */\n __preLayout(data) {\n let res = super.__preLayout(data);\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) {\n let res = super.render(renderMode, lv, ctx, cache);\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;\n originY = res.y3;\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 ctx.arc(cx, cy, r, 0, 2 * Math.PI);\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);\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 {\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 {\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 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 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 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 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 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 return w;\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle, __loadImg } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\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 [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\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].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 }\n else if(([PX, PERCENT, REM, VW, VH].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 }\n // auto和content固定尺寸比例计算\n else if(__loadImg.source || __loadImg.error) {\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 let ratio = __loadImg.width / __loadImg.height;\n b = max = min = isDirectionRow ? cross * ratio : cross / ratio;\n }\n else {\n b = max = min = isDirectionRow ? __loadImg.width : __loadImg.height;\n }\n }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\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 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 '../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 DISPLAY,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n WIDTH,\n HEIGHT,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_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 }\n} = enums;\nconst { PX, PERCENT, REM, VW, VH } = unit;\nconst { int2rgba, isNil, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\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 // 减去水平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 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 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 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 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 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 return w;\n }\n\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this, this.isShadowRoot);\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n // 计算需考虑style的属性\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n [DISPLAY]: display,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n return [display, this.__addMp(isDirectionRow, data.w, currentStyle, [min, max])];\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\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 [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH].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 }\n else if(([PX, PERCENT, REM, VW, VH].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 }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\n }\n\n __layoutBlock(data, isVirtual) {\n let { fixedWidth, fixedHeight, w, h } = this.__preLayout(data);\n this.__height = fixedHeight ? h : 0;\n if(isVirtual) {\n this.__width = fixedWidth ? w : 0;\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) {\n // 无children所以等同于block\n this.__layoutBlock(data);\n }\n\n __layoutInline(data) {\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\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 {\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 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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() {}\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更新时,从叶子到根链路会标识__hasUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasUpdate) {\n child.__hasUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n // 高阶组件会进入此分支,被父组件调用\n else if(vd instanceof Component && vd.__hasUpdate) {\n vd.__hasUpdate = 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}\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 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 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 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 Geom from '../node/geom/Geom';\nimport Text from '../node/Text';\nimport Dom from '../node/Dom';\nimport Img from '../node/Img';\nimport mx from '../math/matrix';\nimport geom from '../math/geom';\nimport level from './level';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport painter from '../util/painter';\nimport Cache from './Cache';\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';\nimport mode from '../node/mode';\n\nconst { canvasPolygon } = painter;\n\nconst {\n STYLE_KEY: {\n POSITION,\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 },\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 },\n STRUCT_KEY: {\n STRUCT_NODE,\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;\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\n// 依次从list获取首个available可用的cache\nfunction 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/**\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;\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;\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 = util.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 * @param renderMode\n * @param node\n * @param __config\n * @param index\n * @param total\n * @param __structs\n * @param cacheTop\n * @param cache\n * @returns {{enabled}|Cache|*}\n */\nfunction genTotal(renderMode, node, __config, index, total, __structs, cacheTop, cache) {\n if(total === 0) {\n return cache;\n }\n // 存每层父亲的matrix和opacity和index,bbox计算过程中生成,缓存给下面渲染过程用\n let parentIndexHash = {};\n let opacityHash = {};\n let [bboxTotal] = genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHash, Cache.MAX);\n if(!bboxTotal) {\n return;\n }\n let { __sx1: sx1, __sy1: sy1 } = node;\n if(cacheTop) {\n cacheTop.reset(bboxTotal, sx1, sy1);\n }\n else {\n cacheTop = Cache.getInstance(bboxTotal, sx1, sy1);\n }\n // 创建失败,再次降级\n if(!cacheTop || !cacheTop.enabled) {\n return;\n }\n cacheTop.__available = true;\n let { x: tx, y: ty, ctx, dbx, dby } = cacheTop;\n // 先绘制自己的cache,起点所以matrix视作E为空,opacity固定1\n if(cache && cache.available) {\n ctx.globalAlpha = 1;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n Cache.drawCache(cache, cacheTop);\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 ctx.globalAlpha = opacity;\n let m = matrix || mx.identity();\n ctx.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]);\n node.render(renderMode, 0, ctx, true, tx - sx1 + dbx, ty - sy1 + dby);\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);\n if(hasMask) {\n i += hasMask;\n }\n continue;\n }\n // mask和不可见不能被汇总到top上\n if(visibility === 'hidden' || isMask) {\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 + tx;\n let dy = -sy1 + dby + ty;\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 let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n if(target) {\n if(isValidMbm(mixBlendMode)) {\n ctx.globalCompositeOperation = mbmName(mixBlendMode);\n }\n else {\n ctx.globalCompositeOperation = 'source-over';\n }\n ctx.globalAlpha = opacity;\n if(matrix) {\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n }\n else {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n }\n Cache.drawCache(target, cacheTop);\n if(target !== __cache) {\n i += total || 0;\n i += hasMask || 0;\n }\n }\n }\n }\n return cacheTop;\n}\n\nfunction genFilter(node, cache, v) {\n return Cache.genFilter(cache, v);\n}\n\nfunction genMask(node, cache) {\n let { [TRANSFORM]: transform, [TRANSFORM_ORIGIN]: transformOrigin } = node.computedStyle;\n let isClip = node.next.isClip;\n return Cache.genMask(cache, node.next, isClip, transform, transformOrigin);\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\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 W\n * @param H\n * @returns {*}\n */\nfunction genTotalWebgl(gl, texCache, node, __config, index, total, __structs, cache, limitCache, 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);\n }\n // limitCache无cache需先绘制到统一的离屏画布上\n else if(limitCache) {\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(mode.WEBGL, 0, gl);\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);\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);\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);\n if(hasMask) {\n i += hasMask;\n }\n continue;\n }\n // mask和不可见不能被汇总到top上\n if(visibility === 'hidden' || isMask) {\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);\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);\n }\n if(target !== __cache) {\n i += (total || 0) + (hasMask || 0);\n }\n }\n }\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 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;\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 += `\\nv_texCoordsBlur[${i}] = a_texCoords + vec2(-${c}, -${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i}]) * ${weights[i]};`;\n }\n vert += `\\nv_texCoordsBlur[${r}] = a_texCoords;`;\n frag += `\\ngl_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 += `\\nv_texCoordsBlur[${i + r + 1}] = a_texCoords + vec2(${c}, ${c}) * u_direction;`;\n frag += `\\ngl_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) {\n let { sx1, sy1, width, height, bbox } = cache;\n // cache一定是mockCache,可能是total/filter/overflow一种\n let cx = width * 0.5, cy = height * 0.5;\n let dx = -bbox[0], dy = -bbox[1];\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 while(next && next.isMask) {\n let __config = next.__config;\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [OPACITY]: opacity,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n },\n } = __config;\n if(display === 'none' || visibility === 'hidden') {\n continue;\n }\n // total无用,都是单节点\n let target = getCache([__cacheFilter, __cacheOverflow, __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 // m = mx.m2Mat4(m, cx, cy);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, m, cx, cy, dx, dy);\n }\n // 异常情况超限\n else if(__config[NODE_LIMIT_CACHE]) {\n return;\n }\n next = next.next;\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 isClip = node.next.isClip;\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 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 ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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, 'filter2');\n apply.ctx.filter = painter.canvasFilter(filter);\n apply.ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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 target.ctx.drawImage(apply.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(offscreen.target.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(mask.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(mask.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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\nfunction renderCacheCanvas(renderMode, ctx, root) {\n let { __structs, width, height } = root;\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 = 0;\n let mergeList = [];\n /**\n * 先一遍先序遍历每个节点绘制到自己__cache上,排除Text和已有的缓存以及局部根缓存,\n * 根据refreshLevel进行等级区分,可能是=REPAINT,REFLOW布局已前置处理完。\n * 首次绘制没有catchTotal等,后续则可能会有,在 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 // 不变是同级兄弟,无需特殊处理\n else {}\n lastConfig = __config;\n lastLv = lv;\n let {\n [NODE_REFRESH_LV]: refreshLevel,\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, 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 let matrix;\n if(contain(refreshLevel, TRANSFORM_ALL)) {\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n util.assignMatrix(m, matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n // 父不为E时要点乘继承父的\n if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n util.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 let __cacheFilter = __config[NODE_CACHE_FILTER];\n if(__cacheFilter) {\n __cacheFilter.release();\n }\n // 防重\n if(hasRecordAsMask) {\n hasRecordAsMask[6] = filter;\n }\n else {\n // 强制存hasMask,因为filter改变影响mask\n hasRecordAsMask = [i, lv, total, node, __config, 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重新渲染,并根据结果判断是否离屏限制limitCache\n * Geom没有子节点无需汇总局部根,Dom中Img也是,它们的局部根等于自身的cache,其它符合条件的Dom需要生成\n */\n else {\n node.render(renderMode, refreshLevel, ctx, true);\n }\n // 每个元素检查cacheTotal生成,已有的上面会continue跳过\n let {\n [NODE_LIMIT_CACHE]: limitCache,\n } = __config;\n let {\n [POSITION]: position,\n [OVERFLOW]: overflow,\n [FILTER]: filter,\n [MIX_BLEND_MODE]: mixBlendMode,\n } = computedStyle;\n if(!limitCache && (hasMask || position === 'absolute'\n || filter.length || (overflow === 'hidden' && total) || isValidMbm(mixBlendMode))) {\n if(hasRecordAsMask) {\n hasRecordAsMask[6] = filter;\n hasRecordAsMask[7] = overflow;\n }\n else {\n mergeList.push([i, lv, total, node, __config, hasMask, filter, overflow]);\n }\n }\n }\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 mergeList.forEach(item => {\n let [i, , total, node, __config, hasMask, filter, overflow] = item;\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 __cacheTotal = genTotal(renderMode, node, __config, i, total || 0, __structs, __cacheTotal, __cache);\n if(__cacheTotal && __cacheTotal !== __cache) {\n __config[NODE_CACHE_TOTAL] = __cacheTotal;\n }\n needGen = true;\n }\n // 防止失败超限,必须有total结果\n if(__cacheTotal && __cacheTotal.available) {\n let target = __cacheTotal;\n if(overflow === 'hidden') {\n if(!__cacheOverflow || !__cacheOverflow.available || needGen) {\n __config[NODE_CACHE_OVERFLOW] = genOverflow(node, target);\n needGen = true;\n }\n target = __config[NODE_CACHE_OVERFLOW] || target;\n }\n if(filter && filter.length) {\n if(!__cacheFilter || !__cacheFilter.available || needGen) {\n __config[NODE_CACHE_FILTER] = genFilter(node, target, filter);\n needGen = true;\n }\n target = __config[NODE_CACHE_FILTER] || target;\n }\n if(hasMask && (!__cacheMask || !__cacheMask.available || needGen)) {\n __config[NODE_CACHE_MASK] = genMask(node, target);\n }\n }\n });\n }\n /**\n * 最后先序遍历一次应用__cacheTotal即可,没有的用__cache,以及剩下的超尺寸的和Text\n * 超尺寸的依旧要走无cache逻辑render,这部分和无cache渲染很像\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 let __config = node.__config;\n // text如果display不可见,parent会直接跳过,不会走到这里,这里一定是直接绘制到root的,visibility在其内部判断\n if(node instanceof Text) {\n let {\n [NODE_OPACITY]: opacity,\n [NODE_MATRIX_EVENT]: matrixEvent,\n } = __config[NODE_DOM_PARENT].__config;\n ctx.globalAlpha = opacity;\n ctx.setTransform(matrixEvent[0], matrixEvent[1], matrixEvent[4], matrixEvent[5], matrixEvent[12], matrixEvent[13]);\n node.render(renderMode, 0, ctx);\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\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 [OVERFLOW]: overflow,\n [FILTER]: filter,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n // 有total的可以直接绘制并跳过子节点索引\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n // total的尝试\n if(target) {\n i += (total || 0) + (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.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 }\n // 自身cache尝试\n else {\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 let offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow;\n // 这里比较特殊,可能会有__cache但超限没被汇聚到total上,需mock出离屏对象数据,还有可能本身就超限\n if(__cache && __cache.available || limitCache) {\n if(__cache && __cache.available) {\n // 有cache但没生成total的都在这\n if(isValidMbm(mixBlendMode)) {\n let c = inject.getCacheCanvas(width, height, null, 'blend');\n offscreenBlend = {\n ctx,\n target: c,\n mixBlendMode: mbmName(mixBlendMode),\n matrix: matrixEvent,\n };\n ctx = c.ctx;\n }\n if(hasMask) {\n let c = inject.getCacheCanvas(width, height, null, 'mask1');\n offscreenMask = {\n ctx,\n target: c,\n matrix: matrixEvent,\n };\n ctx = c.ctx;\n }\n if(filter && filter.length) {\n let c = inject.getCacheCanvas(width, height, null, 'filter1');\n offscreenFilter = {\n ctx,\n filter,\n target: c,\n matrix: matrixEvent,\n };\n ctx = c.ctx;\n }\n if(overflow === 'hidden' && display !== 'inline') {\n let c = inject.getCacheCanvas(width, height, null, 'overflow');\n offscreenOverflow = {\n ctx,\n target: c,\n matrix: matrixEvent,\n x: __cache.sx1,\n y: __cache.sy1,\n offsetWidth: node.offsetWidth,\n offsetHeight: node.offsetHeight,\n };\n ctx = c.ctx;\n }\n if(visibility !== 'hidden') {\n Cache.draw(ctx, opacity, matrixEvent, __cache);\n }\n }\n else {\n // 连cache都没生成的超限\n let res = node.render(renderMode, refreshLevel, ctx) || {};\n offscreenBlend = res.offscreenBlend;\n offscreenMask = res.offscreenMask;\n offscreenFilter = res.offscreenFilter;\n offscreenOverflow = res.offscreenOverflow;\n }\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + (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 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) + (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) + (hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_OVERFLOW, offscreenOverflow]);\n ctx = offscreenOverflow.target.ctx;\n }\n if(limitCache && node instanceof Geom) {\n node.render(renderMode, refreshLevel, ctx);\n }\n }\n // 没内容的遮罩跳过,比如未加载的img,否则会将遮罩绘制出来\n else if(hasMask) {\n i += (total || 0) + hasMask;\n }\n // 同无cache一样的离屏应用\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n if(display === 'none') {\n i += (total || 0) + (hasMask || 0);\n }\n }\n }\n }\n}\n\n/**\n * 无缓存模式canvas渲染,O(n)一次循环完成\n * @param renderMode\n * @param ctx\n * @param root\n */\nfunction renderCanvas(renderMode, ctx, root) {\n let { __structs, width, height } = root;\n /**\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 */\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 let {\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_REFRESH_LV]: refreshLevel,\n } = node.__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 let res = node.render(renderMode, refreshLevel, ctx);\n let { offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow } = res || {};\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + (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) + (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) + (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才有值,以及svg的virtualDom也要生成\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + (hasMask || 0);\n }\n }\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 util.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 util.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);\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, 0, gl, true);\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 // 不变是同级兄弟,无需特殊处理\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 // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n util.assignMatrix(m, 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 util.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 let __cacheFilter = __config[NODE_CACHE_FILTER];\n if(__cacheFilter) {\n __cacheFilter.release();\n }\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, true);\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 } = __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(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 }\n else {\n mergeList.push([i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective]);\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 mergeList.forEach(item => {\n let [i, , total, node, __config, limitCache, hasMask, filter, overflow] = item;\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, 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 target = genOverflowWebgl(gl, texCache, node, target, width, height);\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\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);\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);\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) + (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的尝试\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) + (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) + (hasMask || 0);\n }\n // 超限的情况,这里是普通单节点超限,没有合成total后再合成特殊cache如filter/mask/mbm之类的,\n // 直接按原始位置绘制到离屏canvas,再作为纹理绘制即可,特殊的在total那做过降级了\n else if(limitCache && display !== 'none' && visibility !== 'hidden') {\n // let m = mx.m2Mat4(matrixEvent, cx, cy);\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(renderMode, refreshLevel, gl);\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 }\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\nexport default {\n renderCacheCanvas,\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[0] !== page || page.update) {\n // page可能为一个已有纹理,或者贴图\n if(page instanceof MockPage) {\n webgl.bindTexture(gl, page.texture, i);\n channels[i] = page;\n }\n else {\n // 可能老的先删除\n if(last) {\n gl.deleteTexture(last.texture);\n }\n page.texture = webgl.createTexture(gl, page.canvas, i);\n channels[i] = page;\n }\n hash[page.uuid] = i;\n }\n else {\n hash[page.uuid] = i;\n }\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\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 mode from './mode';\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 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 += `>`;\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 this.cache = !!this.props.cache;\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 css = window.getComputedStyle(dom, null);\n if(!this.width) {\n this.__width = parseFloat(css.getPropertyValue('width')) || 0;\n dom.setAttribute('width', this.width);\n }\n if(!this.height) {\n this.__height = parseFloat(css.getPropertyValue('height')) || 0;\n dom.setAttribute('height', this.height);\n }\n }\n // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d');\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', ca);\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 // 利用list循环代替tree递归快速渲染\n if(this.cache) {\n struct.renderCacheCanvas(renderMode, ctx, this);\n }\n else {\n struct.renderCanvas(renderMode, ctx, this);\n }\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 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 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, this, this.__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 let hasUpdate;\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 });\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, null, 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 });\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, null, 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], null, 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()计算自己,因为放在每次checkRoot()做过了\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 '../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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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.length >= 2) {\n num++;\n }\n if(controlB.length >= 2) {\n num += 2;\n }\n return num;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getNewPoint(x1, y1, x2, y2, controlA, controlB, num, start = 0, end = 1) {\n if(start > 0 || end < 1) {\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 = Math.abs(x1 - x2);\n let b = Math.abs(y1 - y2);\n x1 += a * start;\n y1 += b * start;\n x2 -= a * (1 - end);\n y2 -= b * (1 - end);\n }\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 => limitStartEnd(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 = limitStartEnd(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 limitStartEnd(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 = limitStartEnd(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 = limitStartEnd(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 = limitStartEnd(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) {\n let res = super.render(renderMode, lv, ctx, cache);\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 },\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += 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 - ox);\n bbox[0] = Math.min(bbox[0], xb - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[1] = Math.min(bbox[1], yb - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[2] = Math.max(bbox[2], xb + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n bbox[3] = Math.max(bbox[3], yb + oy);\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] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\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] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\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] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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 limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\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 let i = 0, j = list.length - 1;\n if(start > 0) {\n i = getIndex(len.increase, start * len.total, i, j);\n }\n if(end < 1) {\n j = getIndex(len.increase, end * len.total, i, j);\n }\n list = util.clone(list);\n end *= len.total;\n let prePercent = 1;\n if(end > 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 = end - len.increase[j];\n let t = diff / l;\n prePercent = t;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[j + 1] = [current[1] - (1 - t) * a, current[1] - (1 - t) * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], res[3][0], res[3][1]];\n }\n }\n start *= len.total;\n if(start > len.increase[i]) {\n let prev = list[i].slice(list[i].length - 2);\n let current = list[i + 1];\n let l = len.list[i];\n // 同一条线段时如果有end裁剪,会影响start长度\n if(i === j && prePercent !== 1) {\n l *= prePercent;\n }\n let diff = start - len.increase[i];\n let t = diff / l;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[i] = [prev[0] + t * a, prev[1] + t * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([[current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([[current[4], current[5]], [current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], current[4], current[5]];\n }\n }\n if(j < list.length - 2) {\n list = list.slice(0, j + 2);\n }\n if(i > 0) {\n list = list.slice(i);\n }\n return list;\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 => limitStartEnd(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 = limitStartEnd(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 limitStartEnd(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 v = limitStartEnd(v);\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 = limitStartEnd(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 = limitStartEnd(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 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 // points/controls有变化就需要重建顶点\n if(rebuild) {\n let { points, controls } = __cacheProps;\n if(isMulti) {\n __cacheProps.list2 = points.filter(item => Array.isArray(item)).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.filter(item => Array.isArray(item)).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 }\n return rebuild || rebuildSE;\n }\n\n render(renderMode, lv, ctx, cache) {\n let res = super.render(renderMode, lv, ctx, cache);\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 },\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += 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].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] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\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] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\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';\n\nclass Polygon extends Polyline {\n constructor(tagName, props) {\n super(tagName, props);\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\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} } = enums;\nconst { isNil } = util;\nconst { sectorPoints } = geom;\nconst { REM, VW, VH } = 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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 }\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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 }\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n bbox[0] = Math.min(bbox[0], originX - ox);\n bbox[1] = Math.min(bbox[1], originY - oy);\n bbox[2] = Math.max(bbox[2], originX + width + ox);\n bbox[3] = Math.max(bbox[3], originY + height + oy);\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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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));\n }\n else {\n __cacheProps.r = r * width * 0.5;\n __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache) {\n let res = super.render(renderMode, lv, ctx, cache);\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 }\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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 }\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - rx - ox;\n let xb = cx + rx + ox;\n let ya = cy - ry - oy;\n let yb = cy + ry + oy;\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 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 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 let animationRecord;\n if(animate) {\n if(Array.isArray(animate)) {\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 }\n });\n if(has) {\n animationRecord = {\n animate,\n target: vd,\n };\n }\n }\n else {\n (opt.abbr !== false) && abbr2full(animate, abbrAnimate);\n let { value, options } = animate;\n if(Array.isArray(value) && value.length) {\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n animationRecord = {\n animate,\n target: vd,\n };\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n }\n }\n // 产生实际动画运行才存入列表供root调用执行\n if(animationRecord) {\n animateRecords.push(animationRecord);\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 json = util.clone(json);\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(url);\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';\n\nexport default {\n css,\n reset,\n unit,\n font,\n abbr,\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 './node/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 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","STRUCT_KEY","STRUCT_NODE","STRUCT_INDEX","STRUCT_CHILD_INDEX","STRUCT_LV","STRUCT_NUM","STRUCT_TOTAL","STRUCT_HAS_MASK","enums","Node","__x","__y","__ox","__oy","__width","__height","__baseLine","__config","i","lv","j","root","struct","diff","isLayout","__sx","__sy","x","ox","y","oy","__prev","__next","__parent","__domParent","__root","__host","__hostRoot","__virtualDom","CANVAS","SVG","WEBGL","o","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","REM","EM","VW","VH","calUnit","v","n","parseFloat","test","info","arial","lhr","blr","lgr","padding","f","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","_","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","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","getLinear","coords","l1","l2","l3","l4","r1","getRadial","scx","scy","getConic","calConicRadius","renderConic","isInline","border","offscreen","imgData","putImageData","save","clip","drawImage","restore","add","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","isHost","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","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","tar","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","_enums$NODE_KEY","genSingle","dbx","dby","Cache","__init","__bbox","__page","__pos","getCoords","__appendData","__enabled","setTransform","globalAlpha","update","__available","clear","del","ceil","getInstance","blur","isClip","cacheMask","tf","cacheOverflow","cacheFilter","drawCache","globalCompositeOperation","xe","ye","rect","old","newCache","nx","ny","dbx2","dby2","ENUM","NONE","TRANSFORM_ALL","REFLOW","REBUILD","TRANSFORMS","contain","value","getLevel","isReflow","isRebuild","Text","__textBoxes","__charWidthList","__charWidth","__textWidth","charWidthList","ffs","__ff","__key","wait","needMeasure","bp","__bp","pff","pffs","pfs","pfw","pKey","__pKey","parentCache","mw","__cache","lx","lineBoxManager","endSpace","lineClampCount","__sx1","__sy1","isDestroyed","textBoxes","beginSpace","maxW","needReduce","lastChar","ew","lineCount","isTextOverflow","__lineBack","textBox","addItem","cw","hasCache","needBack","setNewLine","__ellipsis","lineBox","tb","__offsetX","__offsetY","textWidth","__layout","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","event","fns","fn","REGISTER","setUpdateFlag","cp","__hasUpdate","__ref","__isMounted","__taskList","__nextState","addRefreshCp","builder","__cd","listener","__shadow","shadow","__shadowRoot","componentDidMount","REFRESH","__isDestroyed","componentWillUnmount","__destroy","force","__emitEvent","__state","hasRegister","defineProperty","get","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","copy","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","B","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","I_NODE_CONFIG","I_ROOT_CONFIG","I_STYLE","I_ASSIGNING","__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","u","calFrame","ts","binarySearch","frame","middle","ea","steps","stepsD","calIntermediateStyle","transition","st2","calIncrease","o2","n2","gotoOverload","I_IN_FPS","I_IS_DELAY","I_BEGIN","I_END","I_FINISHED","I_NEXT_END","I_FIRST_PLAY","I_FRAME_CB","I_PLAY_CB","I_TARGET","I_ROOT","I_FRAMES","I_FRAMES_R","I_CURRENT_TIME","I_NEXT_TIME","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_CAL_DIFF_TIME","I_FIRST_ENTER","I_STAY_BEGIN","I_STAY_END","I_IS2","I_END_TIME","I_OUT_BEGIN_DELAY","I_TIME_STAMP","Animation","__id","nl","__options","op","config","__frameCb","__calDiffTime","iterations","framesR","originStyle","fps","spfLimit","delay","endDelay","playbackRate","current","isFinish","__cancelTask","__currentProps","__currentStyle","isDelay","FRAME","PLAY","playState","__hasFin","__hasCancel","playCount","currentFrames","stayBegin","stayEnd","is2","endTime","currentTime","currentFrame","round","isAlternate","alternate","isEven","isLastCount","frameTime","isLastFrame","inEndDelay","needClean","__clean","BEGIN","END","FINISH","silence","pending","PAUSE","play","CANCEL","__goto","isFrame","excludeDelay","finish","currentProps","spf","animateController","remove","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","mbm","TF","TX","TY","TZ","getFirstEmptyInlineWidth","flowChildren","child","getLastEmptyInlineWidth","__computedStyle","__listener","__loadBgi","__cacheDefs","__isClip","__isMask","__contentBoxList","__hasMask","__mpWidth","mp","__clientWidth","__clientHeight","__offsetWidth","__offsetHeight","__outerWidth","__outerHeight","onlyFixedValue","isDirectionRow","isDirectItem","__calMp","isVirtual","fromAbs","isShadowRoot","clearCache","__layoutData","__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","offsetWidth","offsetHeight","matrixCache","isScale","clientHeight","x5","x6","y5","y6","__calFilter","bg","bgI","item2","kw","rebuild","__hasContent","isRealInline","sx4","sx5","sx6","sy4","sy5","sy6","hasContent","__calContent","__calPerspective","__calMatrix","__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","hostRoot","pJson","zChildren","zIndexChildren","__spreadBbox","LineBox","__list","__lineHeight","LineBoxManager","__lastX","__lastY","__maxX","__domList","__domStack","__isNewLine","__isEnd","__setLB","nextNewLine","genLineBox","verticalAlign","isNewLine","TAG_NAME","INLINE","BOLD","offsetAndResizeByNodeOnY","reflowHash","inDirectAbsList","isContainer","cs","__layoutAbs","isAbs","__resizeY","clearUniqueReflowId","__uniqueReflowId","getMergeMarginTB","topList","bottomList","genZIndexChildren","hasMc","mcHash","lastMaskIndex","__iIndex","__zIndex","__aIndex","sort","genOrderChildren","__order","block","inlineBlock","none","tag","__flexLine","__zIndexChildren","__structure","nss","__structs","structs","needSort","__tryLayInline","firstCharWidth","main","isRow","__calMinMax","min2","max2","countMin","countMax","setNotEnd","__addMp","isFixed","isContent","fixedSize","__lineBoxManager","__preLayout","__ioSize","mergeMarginBottomList","mergeMarginTopList","isXom","isInlineBlock","isImg","reflow","__isIbFull","lastX","lastY","isNone","isEmptyBlock","tw","th","horizonAlign","__inlineSize","domList","__marginAuto","growList","shrinkList","basisList","maxList","minList","orderChildren","__calBasis","containerSize","isMultiLine","line","hypotheticalList","hypothetical","maxCrossList","__layoutFlexLine","maxCross","crossSum","crossSumList","between","around","__crossAlign","flexLine","hypotheticalSum","targetMainList","factorSum","factorList","needReset","factorSum2","lbmList","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","needCalWidth","wl","hl","__computeMeasure","__deepScan","loadImg","__loadImg","placeholder","loading","__loadAndRefresh","showError","pts","arc","__addGeom","reload","Defs","cacheHash","__isMulti","multi","__cacheProps","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","MockPage","genUuid","MockCache","OP","FT","MBM","PPT","OFFSCREEN_OVERFLOW","OFFSCREEN_FILTER","OFFSCREEN_MASK","OFFSCREEN_BLEND","OFFSCREEN_MASK2","getCache","genBboxTotal","parentIndexHash","opacityHash","includeLimitCache","bboxTotal","matrixHash","parentIndex","node2","hasTotal","mergeBbox","genTotal","cacheTop","hasMask","genFilter","genMask","genOverflow","sbox","genFrameBufferWithTexture","lockOneChannel","webgl","createFramebuffer","bindFramebuffer","checkFramebufferStatus","FRAMEBUFFER_COMPLETE","viewport","clearColor","COLOR_BUFFER_BIT","genTotalWebgl","getParameter","MAX_TEXTURE_SIZE","parentPm","totalLimitCache","addTexAndDrawWhenLimit","mockCache","refresh","releaseLockChannel","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","applyOffscreen","origin","renderCacheCanvas","matrixList","parentMatrix","opacityList","parentOpacity","lastConfig","lastLv","mergeList","refreshLevel","hasRecordAsMask","needGen","maskStartHash","offscreenHash","renderCanvas","renderSvg","maskEffectHash","defsCache","hasEffectMask","addCache","maskHash","vdList","parentVd","mChildren","ivs","hasTransform","renderWebgl","pmList","lastRefreshLevel","hasMbm","validMbm","isPerspective","limitHash","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","getPropertyValue","__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","__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","oldH","nowH","lastIndex","ns","reBuild","base","reBuildC","curveNum","limitStartEnd","getNewPoint","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","__start","__end","buildCache","curve","bezierBox","concatPointAndControl","control","getLength","increase","getIndex","getNewList","prePercent","Polyline","__points","__controls","controls","isControl","rebuildSE","__getPoints","__renderPolygon","pointList","controlList","Polygon","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","replaceLibraryVars","linkLibrary","JSON","linkChild","libraryItem","library","libraryId","parse","animateRecords","opt","createGm","createCp","createVd","animationRecord","fonts","loadAndParse","components","imgs","list1","list3","callback","version","appendTo","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,WAAS,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,EAAAA,eAAe,EAAE,EAvBD;AAwBhBC,EAAAA,iBAAiB,EAAE,EAxBH;AAyBhBC,EAAAA,qBAAqB,E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IAAI,EAAJA,IAJU;AAKVC,EAAAA,SAAS,EAATA,SAAAA;AALU,CAAZ,CAAA,CAAA;;AAQA,IAAG,OAAOhgB,MAAP,KAAkB,WAArB,EAAkC;EAChCA,MAAM,CAACq/C,KAAP,GAAeA,OAAf,CAAA;AACD,CAFD,MAGK,IAAG,OAAO58C,IAAP,KAAgB,WAAnB,EAAgC;EACnCA,IAAI,CAAC48C,KAAL,GAAaA,OAAb,CAAA;AACD;;;;"} \ No newline at end of file diff --git a/index.js b/index.js index 958e00c63..98eb85d32 100644 --- a/index.js +++ b/index.js @@ -1,23 +1,17 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : - (global = global || self, global.karas = factory()); -}(this, (function () { 'use strict'; + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.karas = factory()); +})(this, (function () { 'use strict'; function _typeof(obj) { "@babel/helpers - typeof"; - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function (obj) { - return typeof obj; - }; - } else { - _typeof = function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }, _typeof(obj); } function _classCallCheck(instance, Constructor) { @@ -39,6 +33,9 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); return Constructor; } @@ -69,22 +66,24 @@ configurable: true } }); + Object.defineProperty(subClass, "prototype", { + writable: false + }); if (superClass) _setPrototypeOf(subClass, superClass); } function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; - return _setPrototypeOf(o, p); } @@ -112,6 +111,8 @@ function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; + } else if (call !== void 0) { + throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); @@ -145,9 +146,9 @@ return object; } - function _get(target, property, receiver) { + function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get; + _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); @@ -156,14 +157,14 @@ var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { - return desc.get.call(receiver); + return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } - return _get(target, property, receiver || target); + return _get.apply(this, arguments); } function _slicedToArray(arr, i) { @@ -241,7 +242,7 @@ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } - var STYLE_KEY = { + var STYLE_KEY$5 = { POSITION: 0, DISPLAY: 1, TOP: 2, @@ -358,7 +359,7 @@ var STYLE2UPPER_MAP = {}; - function style2Upper(s) { + function style2Upper$2(s) { STYLE2UPPER_MAP[s] = STYLE2UPPER_MAP[s] || s.replace(/([a-z\d_])([A-Z])/g, function ($0, $1, $2) { return $1 + '_' + $2; }).toUpperCase(); @@ -366,13 +367,13 @@ } var STYLE_R_KEY = {}; - var STYLE_RV_KEY = {}; + var STYLE_RV_KEY$2 = {}; var STYLE_V_KEY = {}; - Object.keys(STYLE_KEY).forEach(function (k) { - var k2 = STYLE_KEY[k]; + Object.keys(STYLE_KEY$5).forEach(function (k) { + var k2 = STYLE_KEY$5[k]; STYLE_R_KEY[k2] = k; var l = style2Lower(k); - STYLE_RV_KEY[k2] = l; + STYLE_RV_KEY$2[k2] = l; STYLE_V_KEY[l] = k2; }); // Root的update过程使用 @@ -438,30 +439,30 @@ STRUCT_HAS_MASK: 6 }; var enums = { - STYLE_KEY: STYLE_KEY, + STYLE_KEY: STYLE_KEY$5, // 大写常量为k,数字为值 STYLE_R_KEY: STYLE_R_KEY, // 数字为k,大写常量为值 - STYLE_RV_KEY: STYLE_RV_KEY, + STYLE_RV_KEY: STYLE_RV_KEY$2, // 数字为k,小写为值 STYLE_V_KEY: STYLE_V_KEY, // 小写为k,数字为值 style2Lower: style2Lower, - style2Upper: style2Upper, + style2Upper: style2Upper$2, UPDATE_KEY: UPDATE_KEY, KEY_FRAME_KEY: KEY_FRAME_KEY, NODE_KEY: NODE_KEY, STRUCT_KEY: STRUCT_KEY }; - var _enums$STRUCT_KEY = enums.STRUCT_KEY, - STRUCT_NODE = _enums$STRUCT_KEY.STRUCT_NODE, - STRUCT_INDEX = _enums$STRUCT_KEY.STRUCT_INDEX, - STRUCT_CHILD_INDEX = _enums$STRUCT_KEY.STRUCT_CHILD_INDEX, - STRUCT_LV = _enums$STRUCT_KEY.STRUCT_LV, - _enums$NODE_KEY = enums.NODE_KEY, - NODE_IS_DESTROYED = _enums$NODE_KEY.NODE_IS_DESTROYED, - NODE_STRUCT = _enums$NODE_KEY.NODE_STRUCT; + var _enums$STRUCT_KEY$3 = enums.STRUCT_KEY, + STRUCT_NODE$2 = _enums$STRUCT_KEY$3.STRUCT_NODE, + STRUCT_INDEX$2 = _enums$STRUCT_KEY$3.STRUCT_INDEX, + STRUCT_CHILD_INDEX$1 = _enums$STRUCT_KEY$3.STRUCT_CHILD_INDEX, + STRUCT_LV$2 = _enums$STRUCT_KEY$3.STRUCT_LV, + _enums$NODE_KEY$a = enums.NODE_KEY, + NODE_IS_DESTROYED$2 = _enums$NODE_KEY$a.NODE_IS_DESTROYED, + NODE_STRUCT$4 = _enums$NODE_KEY$a.NODE_STRUCT; var Node = /*#__PURE__*/function () { function Node() { @@ -489,12 +490,12 @@ value: function __structure(i, lv, j) { var _this$__config$NODE_S; - return this.__config[NODE_STRUCT] = (_this$__config$NODE_S = {}, _defineProperty(_this$__config$NODE_S, STRUCT_NODE, this), _defineProperty(_this$__config$NODE_S, STRUCT_INDEX, i), _defineProperty(_this$__config$NODE_S, STRUCT_CHILD_INDEX, j), _defineProperty(_this$__config$NODE_S, STRUCT_LV, lv), _this$__config$NODE_S); + return this.__config[NODE_STRUCT$4] = (_this$__config$NODE_S = {}, _defineProperty(_this$__config$NODE_S, STRUCT_NODE$2, this), _defineProperty(_this$__config$NODE_S, STRUCT_INDEX$2, i), _defineProperty(_this$__config$NODE_S, STRUCT_CHILD_INDEX$1, j), _defineProperty(_this$__config$NODE_S, STRUCT_LV$2, lv), _this$__config$NODE_S); } }, { key: "__modifyStruct", value: function __modifyStruct(root) { - var struct = this.__config[NODE_STRUCT]; + var struct = this.__config[NODE_STRUCT$4]; return [struct, 0]; } }, { @@ -522,7 +523,7 @@ }, { key: "__destroy", value: function __destroy() { - this.__config[NODE_IS_DESTROYED] = true; + this.__config[NODE_IS_DESTROYED$2] = true; } }, { key: "x", @@ -625,7 +626,7 @@ }, { key: "isDestroyed", get: function get() { - return this.__config[NODE_IS_DESTROYED]; + return this.__config[NODE_IS_DESTROYED$2]; } }]); @@ -638,7 +639,7 @@ WEBGL: 2 }; - var o = { + var o$4 = { AUTO: 0, PX: 1, PERCENT: 2, @@ -661,30 +662,30 @@ var n = parseFloat(v) || 0; if (/%$/.test(v)) { - return [n, o.PERCENT]; + return [n, o$4.PERCENT]; } else if (/px$/i.test(v)) { - return [n, o.PX]; + return [n, o$4.PX]; } else if (/deg$/i.test(v)) { - return [n, o.DEG]; + return [n, o$4.DEG]; } else if (/rem$/i.test(v)) { - return [n, o.REM]; + return [n, o$4.REM]; } else if (/vw$/i.test(v)) { - return [n, o.VW]; + return [n, o$4.VW]; } else if (/vh$/i.test(v)) { - return [n, o.VH]; + return [n, o$4.VH]; } else if (/em$/i.test(v)) { - return [n, o.EM]; + return [n, o$4.EM]; } else if (/vw$/i.test(v)) { - return [n, o.VW]; + return [n, o$4.VW]; } else if (/vh$/i.test(v)) { - return [n, o.VH]; + return [n, o$4.VH]; } - return [n, o.NUMBER]; + return [n, o$4.NUMBER]; } }; - var o$1 = { + var o$3 = { info: { arial: { lhr: 1.14990234375, @@ -779,7 +780,7 @@ Object.assign(this.info[name.toLowerCase()].padding, padding); } }; - o$1.info['宋体'] = o$1.info.simsun; + o$3.info['宋体'] = o$3.info.simsun; var reg = { position: /(([-+]?[\d.]+[pxremvwh%]*)|(left|top|right|bottom|center)){1,2}/ig, @@ -789,17 +790,17 @@ }; // 生成4*4单位矩阵 - function identity() { + function identity$1() { return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; } // 矩阵a*b,固定两个matrix都是长度16 - function multiply(a, b) { - if (isE(a)) { + function multiply$2(a, b) { + if (isE$3(a)) { return b; } - if (isE(b)) { + if (isE$3(b)) { return a; } @@ -819,7 +820,7 @@ return c; } - function calPoint(point, m) { + function calPoint$2(point, m) { var _point = _slicedToArray(point, 4), x = _point[0], y = _point[1], @@ -830,7 +831,7 @@ w = 1; } - if (m && !isE(m)) { + if (m && !isE$3(m)) { if (m.length === 16) { z = z || 0; @@ -878,7 +879,7 @@ */ - function inverse(m) { + function inverse$1(m) { if (m.length === 16) { return inverse4(m); } @@ -905,7 +906,7 @@ } // 16位或者6位单位矩阵判断,空也认为是 - function isE(m) { + function isE$3(m) { if (!m) { return true; } @@ -956,7 +957,7 @@ var det = s[0] * inv[0] + s[1] * inv[4] + s[2] * inv[8] + s[3] * inv[12]; if (det === 0) { - return identity(); + return identity$1(); } det = 1 / det; @@ -974,7 +975,7 @@ return [m[0], m[1], m[4], m[5], m[12], m[13]]; } - function point2d(point) { + function point2d$1(point) { var w = point[3]; if (w && w !== 1) { @@ -987,12 +988,12 @@ } var mx = { - identity: identity, - multiply: multiply, - calPoint: calPoint, - point2d: point2d, - inverse: inverse, - isE: isE, + identity: identity$1, + multiply: multiply$2, + calPoint: calPoint$2, + point2d: point2d$1, + inverse: inverse$1, + isE: isE$3, m2m6: m2m6 }; @@ -1002,23 +1003,23 @@ } // 向量叉乘积 - function crossProduct(x1, y1, x2, y2) { + function crossProduct$1(x1, y1, x2, y2) { return x1 * y2 - x2 * y1; } var vector = { dotProduct: dotProduct, - crossProduct: crossProduct + crossProduct: crossProduct$1 }; - var H = 4 * (Math.sqrt(2) - 1) / 3; - var crossProduct$1 = vector.crossProduct; + var H$1 = 4 * (Math.sqrt(2) - 1) / 3; + var crossProduct = vector.crossProduct; var calPoint$1 = mx.calPoint, - isE$1 = mx.isE; - var _enums$STYLE_KEY = enums.STYLE_KEY, - WIDTH = _enums$STYLE_KEY.WIDTH, - HEIGHT = _enums$STYLE_KEY.HEIGHT, - TRANSFORM_ORIGIN = _enums$STYLE_KEY.TRANSFORM_ORIGIN; + isE$2 = mx.isE; + var _enums$STYLE_KEY$p = enums.STYLE_KEY, + WIDTH$8 = _enums$STYLE_KEY$p.WIDTH, + HEIGHT$8 = _enums$STYLE_KEY$p.HEIGHT, + TRANSFORM_ORIGIN$5 = _enums$STYLE_KEY$p.TRANSFORM_ORIGIN; /** * 圆弧拟合公式,根据角度求得3阶贝塞尔控制点比例长度,一般<=90,超过拆分 * @param deg @@ -1075,7 +1076,7 @@ x2 = _vertexes[0], y2 = _vertexes[1]; - if (crossProduct$1(x2 - x1, y2 - y1, x - x1, y - y1) < 0) { + if (crossProduct(x2 - x1, y2 - y1, x - x1, y - y1) < 0) { return false; } } @@ -1085,7 +1086,7 @@ function pointInQuadrilateral(x, y, x1, y1, x2, y2, x4, y4, x3, y3, matrix) { - if (matrix && !isE$1(matrix)) { + if (matrix && !isE$2(matrix)) { var w1, w2, w3, w4; var _calPoint = calPoint$1([x1, y1], matrix); @@ -1205,8 +1206,8 @@ function ellipsePoints(x, y, a) { var b = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : a; - var ox = a * H; - var oy = b === a ? ox : b * H; + var ox = a * H$1; + var oy = b === a ? ox : b * H$1; return [[x - a, y], [x - a, y - oy, x - ox, y - b, x, y - b], [x + ox, y - b, x + a, y - oy, x + a, y], [x + a, y + oy, x + ox, y + b, x, y + b], [x - ox, y + b, x - a, y + oy, x - a, y]]; } /** @@ -1215,7 +1216,7 @@ */ - function sectorPoints(x, y, r, begin, end) { + function sectorPoints$1(x, y, r, begin, end) { if (begin > end) { var _ref = [end, begin]; begin = _ref[0]; @@ -1231,27 +1232,27 @@ var e = Math.floor(end / 90); // 同象限直接算 if (b === e || e - b === 1 && end % 90 === 0) { - var h2 = h(d2r(Math.abs(begin - end))); + var h2 = h(d2r$2(Math.abs(begin - end))); var d = h2 * r; var c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2)); var alpha = Math.atan(d / r); if (b < 90) { // 第1个交点 - var rx = Math.sin(d2r(begin)) * r; - var ry = Math.cos(d2r(begin)) * r; + var rx = Math.sin(d2r$2(begin)) * r; + var ry = Math.cos(d2r$2(begin)) * r; var p1 = [x + rx, y - ry]; // 第1个控制点 - var deg = alpha + d2r(begin); + var deg = alpha + d2r$2(begin); rx = Math.sin(deg) * c; ry = Math.cos(deg) * c; var p2 = [x + rx, y - ry]; // 第2个交点 - rx = Math.sin(d2r(end)) * r; - ry = Math.cos(d2r(end)) * r; + rx = Math.sin(d2r$2(end)) * r; + ry = Math.cos(d2r$2(end)) * r; var p4 = [x + rx, y - ry]; // 第2个控制点 - deg = d2r(end) - alpha; + deg = d2r$2(end) - alpha; rx = Math.sin(deg) * c; ry = Math.cos(deg) * c; var p3 = [x + rx, y - ry]; @@ -1259,23 +1260,23 @@ list.push(p2.concat(p3).concat(p4)); } else if (b < 180) { // 第1个交点 - var _rx = Math.cos(d2r(begin - 90)) * r; + var _rx = Math.cos(d2r$2(begin - 90)) * r; - var _ry = Math.sin(d2r(begin - 90)) * r; + var _ry = Math.sin(d2r$2(begin - 90)) * r; var _p = [x + _rx, y + _ry]; // 第1个控制点 - var _deg = alpha + d2r(begin - 90); + var _deg = alpha + d2r$2(begin - 90); _rx = Math.cos(_deg) * c; _ry = Math.sin(_deg) * c; var _p2 = [x + _rx, y + _ry]; // 第2个交点 - _rx = Math.cos(d2r(end - 90)) * r; - _ry = Math.sin(d2r(end - 90)) * r; + _rx = Math.cos(d2r$2(end - 90)) * r; + _ry = Math.sin(d2r$2(end - 90)) * r; var _p3 = [x + _rx, y + _ry]; // 第2个控制点 - _deg = d2r(end - 90) - alpha; + _deg = d2r$2(end - 90) - alpha; _rx = Math.cos(_deg) * c; _ry = Math.sin(_deg) * c; var _p4 = [x + _rx, y + _ry]; @@ -1283,23 +1284,23 @@ list.push(_p2.concat(_p4).concat(_p3)); } else if (b < 270) { // 第1个交点 - var _rx2 = Math.sin(d2r(begin - 180)) * r; + var _rx2 = Math.sin(d2r$2(begin - 180)) * r; - var _ry2 = Math.cos(d2r(begin - 180)) * r; + var _ry2 = Math.cos(d2r$2(begin - 180)) * r; var _p5 = [x - _rx2, y + _ry2]; // 第1个控制点 - var _deg2 = alpha + d2r(begin - 180); + var _deg2 = alpha + d2r$2(begin - 180); _rx2 = Math.sin(_deg2) * c; _ry2 = Math.cos(_deg2) * c; var _p6 = [x - _rx2, y + _ry2]; // 第2个交点 - _rx2 = Math.sin(d2r(end - 180)) * r; - _ry2 = Math.cos(d2r(end - 180)) * r; + _rx2 = Math.sin(d2r$2(end - 180)) * r; + _ry2 = Math.cos(d2r$2(end - 180)) * r; var _p7 = [x - _rx2, y + _ry2]; // 第2个控制点 - _deg2 = d2r(end - 180) - alpha; + _deg2 = d2r$2(end - 180) - alpha; _rx2 = Math.sin(_deg2) * c; _ry2 = Math.cos(_deg2) * c; var _p8 = [x - _rx2, y + _ry2]; @@ -1307,23 +1308,23 @@ list.push(_p6.concat(_p8).concat(_p7)); } else { // 第1个交点 - var _rx3 = Math.cos(d2r(begin - 270)) * r; + var _rx3 = Math.cos(d2r$2(begin - 270)) * r; - var _ry3 = Math.sin(d2r(begin - 270)) * r; + var _ry3 = Math.sin(d2r$2(begin - 270)) * r; var _p9 = [x - _rx3, y + _ry3]; // 第1个控制点 - var _deg3 = alpha + d2r(begin - 270); + var _deg3 = alpha + d2r$2(begin - 270); _rx3 = Math.cos(_deg3) * c; _ry3 = Math.sin(_deg3) * c; var _p10 = [x - _rx3, y + _ry3]; // 第2个交点 - _rx3 = Math.cos(d2r(end - 270)) * r; - _ry3 = Math.sin(d2r(end - 270)) * r; + _rx3 = Math.cos(d2r$2(end - 270)) * r; + _ry3 = Math.sin(d2r$2(end - 270)) * r; var _p11 = [x - _rx3, y + _ry3]; // 第2个控制点 - _deg3 = d2r(end - 270) - alpha; + _deg3 = d2r$2(end - 270) - alpha; _rx3 = Math.cos(_deg3) * c; _ry3 = Math.sin(_deg3) * c; var _p12 = [x - _rx3, y + _ry3]; @@ -1332,44 +1333,44 @@ } } // 跨象限循环算 else { - var i = b; - var temp = []; + var i = b; + var temp = []; - for (; i <= e; i++) { - if (i === 0) { - var res = sectorPoints(x, y, r, begin, 90); - temp.push(res); - } else if (i === 1) { - // 防止90~90这种情况,但如果begin和end都是90时又要显示 - if (b === i || end > 90) { - var _res = sectorPoints(x, y, r, begin < 90 ? 90 : begin, end > 180 ? 180 : end); + for (; i <= e; i++) { + if (i === 0) { + var res = sectorPoints$1(x, y, r, begin, 90); + temp.push(res); + } else if (i === 1) { + // 防止90~90这种情况,但如果begin和end都是90时又要显示 + if (b === i || end > 90) { + var _res = sectorPoints$1(x, y, r, begin < 90 ? 90 : begin, end > 180 ? 180 : end); - temp.push(_res); - } - } else if (i === 2) { - // 防止180~180这种情况,但如果begin和end都是90时又要显示 - if (b === i || end > 180) { - var _res2 = sectorPoints(x, y, r, begin < 180 ? 180 : begin, end > 270 ? 270 : end); + temp.push(_res); + } + } else if (i === 2) { + // 防止180~180这种情况,但如果begin和end都是90时又要显示 + if (b === i || end > 180) { + var _res2 = sectorPoints$1(x, y, r, begin < 180 ? 180 : begin, end > 270 ? 270 : end); - temp.push(_res2); - } - } else if (i === 3) { - // 防止180~180这种情况,但如果begin和end都是90时又要显示 - if (b === i || end > 270) { - var _res3 = sectorPoints(x, y, r, begin < 270 ? 270 : begin, end); + temp.push(_res2); + } + } else if (i === 3) { + // 防止180~180这种情况,但如果begin和end都是90时又要显示 + if (b === i || end > 270) { + var _res3 = sectorPoints$1(x, y, r, begin < 270 ? 270 : begin, end); - temp.push(_res3); - } + temp.push(_res3); } - } // 去掉重复的首尾扇弧点 + } + } // 去掉重复的首尾扇弧点 - list = temp[0]; + list = temp[0]; - for (var _i2 = 1, len = temp.length; _i2 < len; _i2++) { - list.push(temp[_i2][1]); - } + for (var _i2 = 1, len = temp.length; _i2 < len; _i2++) { + list.push(temp[_i2][1]); } + } return list; } @@ -1457,9 +1458,9 @@ matrix = _node$matrix === void 0 ? [1, 0, 0, 1, 0, 0] : _node$matrix, _node$computedStyle = node.computedStyle, computedStyle = _node$computedStyle === void 0 ? {} : _node$computedStyle; - var width = computedStyle[WIDTH], - height = computedStyle[HEIGHT], - _computedStyle$TRANSF = computedStyle[TRANSFORM_ORIGIN]; + var width = computedStyle[WIDTH$8], + height = computedStyle[HEIGHT$8], + _computedStyle$TRANSF = computedStyle[TRANSFORM_ORIGIN$5]; _computedStyle$TRANSF = _computedStyle$TRANSF === void 0 ? [width * 0.5, height * 0.5] : _computedStyle$TRANSF; var _computedStyle$TRANSF2 = _slicedToArray(_computedStyle$TRANSF, 2), @@ -1477,9 +1478,9 @@ function calPercentInNode(x, y, node) { var _node$computedStyle2 = node.computedStyle, - width = _node$computedStyle2[WIDTH], - height = _node$computedStyle2[HEIGHT], - _node$computedStyle2$ = _slicedToArray(_node$computedStyle2[TRANSFORM_ORIGIN], 2), + width = _node$computedStyle2[WIDTH$8], + height = _node$computedStyle2[HEIGHT$8], + _node$computedStyle2$ = _slicedToArray(_node$computedStyle2[TRANSFORM_ORIGIN$5], 2), ox = _node$computedStyle2$[0], oy = _node$computedStyle2$[1]; // 先求无旋转时右下角相对于原点的角度ds @@ -1579,7 +1580,7 @@ return [(ox - dt * Math.cos(d2)) / width, (oy + dt * Math.sin(d2)) / height]; } - function d2r(n) { + function d2r$2(n) { return n * Math.PI / 180; } @@ -1990,29 +1991,29 @@ function pointOnCircle(x, y, r, deg) { if (deg >= 270) { deg -= 270; - deg = d2r(deg); + deg = d2r$2(deg); return [x - Math.cos(deg) * r, y - Math.sin(deg) * r]; } else if (deg >= 180) { deg -= 180; - deg = d2r(deg); + deg = d2r$2(deg); return [x - Math.sin(deg) * r, y + Math.cos(deg) * r]; } else if (deg >= 90) { deg -= 90; - deg = d2r(deg); + deg = d2r$2(deg); return [x + Math.cos(deg) * r, y + Math.sin(deg) * r]; } else { - deg = d2r(deg); + deg = d2r$2(deg); return [x + Math.sin(deg) * r, y - Math.cos(deg) * r]; } } - var geom = { + var geom$1 = { pointInPolygon: pointInPolygon, pointInQuadrilateral: pointInQuadrilateral, - d2r: d2r, + d2r: d2r$2, r2d: r2d, // 贝塞尔曲线模拟1/4圆弧比例 - H: H, + H: H$1, // <90任意角度贝塞尔曲线拟合圆弧的比例公式 h: h, angleBySide: angleBySide, @@ -2020,7 +2021,7 @@ pointsDistance: pointsDistance, triangleIncentre: triangleIncentre, ellipsePoints: ellipsePoints, - sectorPoints: sectorPoints, + sectorPoints: sectorPoints$1, getRectsIntersection: getRectsIntersection, isRectsOverlap: isRectsOverlap, isRectsInside: isRectsInside, @@ -2168,11 +2169,11 @@ return data; } - var gradient = { + var gradient$1 = { getConicGradientImage: getConicGradientImage }; - function canvasPolygon(ctx, list) { + function canvasPolygon$7(ctx, list) { var dx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; var dy = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; @@ -2210,7 +2211,7 @@ } } - function svgPolygon(list) { + function svgPolygon$7(list) { if (!list || !list.length) { return ''; } @@ -2298,34 +2299,34 @@ } var painter = { - canvasPolygon: canvasPolygon, - svgPolygon: svgPolygon, + canvasPolygon: canvasPolygon$7, + svgPolygon: svgPolygon$7, canvasLine: canvasLine, svgLine: svgLine, canvasFilter: canvasFilter, svgFilter: canvasFilter }; - var H$1 = geom.H; - var PX = o.PX, - PERCENT = o.PERCENT, - REM = o.REM, - VW = o.VW, - VH = o.VH; - 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 H = geom$1.H; + var PX$b = o$4.PX, + PERCENT$c = o$4.PERCENT, + REM$g = o$4.REM, + VW$g = o$4.VW, + VH$g = o$4.VH; + var canvasPolygon$6 = painter.canvasPolygon, + svgPolygon$6 = painter.svgPolygon; + var _enums$STYLE_KEY$o = enums.STYLE_KEY, + BORDER_LEFT_WIDTH$8 = _enums$STYLE_KEY$o.BORDER_LEFT_WIDTH, + BORDER_TOP_WIDTH$6 = _enums$STYLE_KEY$o.BORDER_TOP_WIDTH, + BORDER_BOTTOM_WIDTH$6 = _enums$STYLE_KEY$o.BORDER_BOTTOM_WIDTH, + PADDING_LEFT$7 = _enums$STYLE_KEY$o.PADDING_LEFT, + PADDING_BOTTOM$5 = _enums$STYLE_KEY$o.PADDING_BOTTOM, + PADDING_TOP$5 = _enums$STYLE_KEY$o.PADDING_TOP, + BORDER_TOP_LEFT_RADIUS$2 = _enums$STYLE_KEY$o.BORDER_TOP_LEFT_RADIUS, + BORDER_TOP_RIGHT_RADIUS$2 = _enums$STYLE_KEY$o.BORDER_TOP_RIGHT_RADIUS, + BORDER_BOTTOM_LEFT_RADIUS$2 = _enums$STYLE_KEY$o.BORDER_BOTTOM_LEFT_RADIUS, + BORDER_BOTTOM_RIGHT_RADIUS$2 = _enums$STYLE_KEY$o.BORDER_BOTTOM_RIGHT_RADIUS, + FONT_SIZE$h = _enums$STYLE_KEY$o.FONT_SIZE; /* 获取合适的虚线实体空白宽度ps/pd和数量n * 总长total,start边长bs,end边长be,内容长w, * 实体长范围[smin,smax],空白长范围[dmin,dmax] @@ -2465,68 +2466,68 @@ } } // 整个和borderRight重叠 else if (main1 >= x3) { - cross1 = y1 + (x4 - main1) * Math.tan(deg2); - cross2 = y1 + (x4 - main2) * Math.tan(deg2); + cross1 = y1 + (x4 - main1) * Math.tan(deg2); + cross2 = y1 + (x4 - main2) * Math.tan(deg2); + + if (isLast) { + points.push([[main1, y1], [x4, y1], [x4, y1], [main1, cross1]]); + } else { + points.push([[main1, y1], [main2, y1], [main2, cross2], [main1, cross1]]); + } + } // 不被整个重叠的情况再细分 + else { + // 上部分和borderLeft重叠 + if (main1 < x2) { + cross1 = y1 + (main1 - x1) * Math.tan(deg1); + points.push([[main1, y1], [x2, y1], [x2, y2], [main1, cross1]]); if (isLast) { - points.push([[main1, y1], [x4, y1], [x4, y1], [main1, cross1]]); + points.push([[x2, y1], [x3, y1], [x3, y2], [x2, y2]]); + points.push([[x3, y1], [x4, y1], [x4, y1], [x2, y2]]); } else { - points.push([[main1, y1], [main2, y1], [main2, cross2], [main1, cross1]]); + // 下部分和borderRight重叠 + if (main2 > x3) { + cross2 = y1 + (x4 - main2) * Math.tan(deg2); + points.push([[x2, y1], [x3, y1], [x3, y2], [x2, y2]]); + points.push([[x3, y1], [main2, y1], [main2, cross2], [x3, y2]]); + } // 下部独立 + else { + points.push([[x2, y1], [main2, y1], [main2, y2], [x2, y2]]); + } } - } // 不被整个重叠的情况再细分 - else { - // 上部分和borderLeft重叠 - if (main1 < x2) { - cross1 = y1 + (main1 - x1) * Math.tan(deg1); - points.push([[main1, y1], [x2, y1], [x2, y2], [main1, cross1]]); - - if (isLast) { - points.push([[x2, y1], [x3, y1], [x3, y2], [x2, y2]]); - points.push([[x3, y1], [x4, y1], [x4, y1], [x2, y2]]); - } else { - // 下部分和borderRight重叠 - if (main2 > x3) { - cross2 = y1 + (x4 - main2) * Math.tan(deg2); - points.push([[x2, y1], [x3, y1], [x3, y2], [x2, y2]]); - points.push([[x3, y1], [main2, y1], [main2, cross2], [x3, y2]]); - } // 下部独立 - else { - points.push([[x2, y1], [main2, y1], [main2, y2], [x2, y2]]); - } - } - } // 下部分和borderRight重叠 - else if (main2 > x3) { - cross1 = y1 + (x4 - main2) * Math.tan(deg2); // 上部分和borderLeft重叠 - - if (main1 < x2) { - cross2 = y1 + (main1 - x1) * Math.tan(deg1); - points.push([[main1, y1], [x2, y1], [x2, y2], [main1, cross2]]); - points.push([[x2, y1], [x3, y1], [x3, y2], [x2, y2]]); - - if (isLast) { - points.push([[x3, y1], [x4, y1], [x4, y1], [x3, y2]]); - } else { - points.push([[x3, y1], [main2, y1], [main2, cross1], [x3, y2]]); - } - } // 上部独立 - else { - points.push([[main1, y1], [x3, y1], [x3, y2], [main1, y2]]); + } // 下部分和borderRight重叠 + else if (main2 > x3) { + cross1 = y1 + (x4 - main2) * Math.tan(deg2); // 上部分和borderLeft重叠 - if (isLast) { - points.push([[x3, y1], [x4, y1], [x4, y1], [x3, y2]]); - } else { - points.push([[x3, y1], [main2, y1], [main2, cross1], [x3, y2]]); - } - } - } // 完全独立 - else { - if (isLast) { - points.push([[main1, y1], [x4, y1], [x3, y2], [main1, y2]]); - } else { - points.push([[main1, y1], [main2, y1], [main2, y2], [main1, y2]]); - } - } + if (main1 < x2) { + cross2 = y1 + (main1 - x1) * Math.tan(deg1); + points.push([[main1, y1], [x2, y1], [x2, y2], [main1, cross2]]); + points.push([[x2, y1], [x3, y1], [x3, y2], [x2, y2]]); + + if (isLast) { + points.push([[x3, y1], [x4, y1], [x4, y1], [x3, y2]]); + } else { + points.push([[x3, y1], [main2, y1], [main2, cross1], [x3, y2]]); + } + } // 上部独立 + else { + points.push([[main1, y1], [x3, y1], [x3, y2], [main1, y2]]); + + if (isLast) { + points.push([[x3, y1], [x4, y1], [x4, y1], [x3, y2]]); + } else { + points.push([[x3, y1], [main2, y1], [main2, cross1], [x3, y2]]); + } } + } // 完全独立 + else { + if (isLast) { + points.push([[main1, y1], [x4, y1], [x3, y2], [main1, y2]]); + } else { + points.push([[main1, y1], [main2, y1], [main2, y2], [main1, y2]]); + } + } + } } else if (direction === 1) { // 整个和borderTop重叠 if (main2 <= y2) { @@ -2539,68 +2540,68 @@ } } // 整个和borderBottom重叠 else if (main1 >= y3) { - cross1 = x3 + (main1 - y3) * Math.tan(deg2); - cross2 = x3 + (main2 - y3) * Math.tan(deg2); + cross1 = x3 + (main1 - y3) * Math.tan(deg2); + cross2 = x3 + (main2 - y3) * Math.tan(deg2); + + if (isLast) { + points.push([[cross1, main1], [x4, main1], [x4, y4], [x4, y4]]); + } else { + points.push([[cross1, main1], [x4, main1], [x4, main2], [cross2, main2]]); + } + } // 不被整个重叠的情况再细分 + else { + // 上部分和borderTop重叠 + if (main1 < y2) { + cross1 = x3 + (y2 - main1) * Math.tan(deg1); + points.push([[cross1, main1], [x4, main1], [x4, y2], [x3, y2]]); if (isLast) { - points.push([[cross1, main1], [x4, main1], [x4, y4], [x4, y4]]); + points.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); + points.push([[x3, y3], [x4, y3], [x4, y4], [x4, y4]]); } else { - points.push([[cross1, main1], [x4, main1], [x4, main2], [cross2, main2]]); + // 下部分和borderBottom重叠 + if (main2 > y3) { + cross2 = x3 + (main2 - y3) * Math.tan(deg2); + points.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); + points.push([[x3, y3], [x4, y3], [x4, main2], [cross2, main2]]); + } // 下部独立 + else { + points.push([[x3, y2], [x4, y2], [x4, main2], [x3, main2]]); + } } - } // 不被整个重叠的情况再细分 - else { - // 上部分和borderTop重叠 - if (main1 < y2) { - cross1 = x3 + (y2 - main1) * Math.tan(deg1); - points.push([[cross1, main1], [x4, main1], [x4, y2], [x3, y2]]); - - if (isLast) { - points.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); - points.push([[x3, y3], [x4, y3], [x4, y4], [x4, y4]]); - } else { - // 下部分和borderBottom重叠 - if (main2 > y3) { - cross2 = x3 + (main2 - y3) * Math.tan(deg2); - points.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); - points.push([[x3, y3], [x4, y3], [x4, main2], [cross2, main2]]); - } // 下部独立 - else { - points.push([[x3, y2], [x4, y2], [x4, main2], [x3, main2]]); - } - } - } // 下部分和borderBottom重叠 - else if (main2 > y3) { - cross1 = x3 + (main2 - y3) * Math.tan(deg2); // 上部分和borderTop重叠 - - if (main1 < y2) { - cross2 = x3 + (y2 - main1) * Math.tan(deg1); - points.push([[cross2, main1], [x4, main1], [x4, y2], [x3, y2]]); - points.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); - - if (isLast) { - points.push([[x3, y3], [x4, y3], [x4, x4], [x4, x4]]); - } else { - points.push([[x3, y3], [x4, y3], [x4, main2], [cross1, main2]]); - } - } // 上部独立 - else { - points.push([[x3, main1], [x4, main1], [x4, y3], [x3, y3]]); + } // 下部分和borderBottom重叠 + else if (main2 > y3) { + cross1 = x3 + (main2 - y3) * Math.tan(deg2); // 上部分和borderTop重叠 - if (isLast) { - points.push([[x3, y3], [x4, y3], [x4, y4], [x4, y4]]); - } else { - points.push([[x3, y3], [x4, y3], [x4, main2], [cross1, main2]]); - } - } - } // 完全独立 - else { - if (isLast) { - points.push([[x3, main1], [x4, main1], [x4, y4], [x3, y3]]); - } else { - points.push([[x3, main1], [x4, main1], [x4, main2], [x3, main2]]); - } - } + if (main1 < y2) { + cross2 = x3 + (y2 - main1) * Math.tan(deg1); + points.push([[cross2, main1], [x4, main1], [x4, y2], [x3, y2]]); + points.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); + + if (isLast) { + points.push([[x3, y3], [x4, y3], [x4, x4], [x4, x4]]); + } else { + points.push([[x3, y3], [x4, y3], [x4, main2], [cross1, main2]]); + } + } // 上部独立 + else { + points.push([[x3, main1], [x4, main1], [x4, y3], [x3, y3]]); + + if (isLast) { + points.push([[x3, y3], [x4, y3], [x4, y4], [x4, y4]]); + } else { + points.push([[x3, y3], [x4, y3], [x4, main2], [cross1, main2]]); + } + } + } // 完全独立 + else { + if (isLast) { + points.push([[x3, main1], [x4, main1], [x4, y4], [x3, y3]]); + } else { + points.push([[x3, main1], [x4, main1], [x4, main2], [x3, main2]]); } + } + } } else if (direction === 2) { // 整个和borderLeft重叠 if (main2 <= x2) { @@ -2613,68 +2614,68 @@ } } // 整个和borderRight重叠 else if (main1 >= x3) { - cross1 = y4 - (x4 - main1) * Math.tan(deg2); - cross2 = y4 - (x4 - main2) * Math.tan(deg2); + cross1 = y4 - (x4 - main1) * Math.tan(deg2); + cross2 = y4 - (x4 - main2) * Math.tan(deg2); + + if (isLast) { + points.push([[main1, cross1], [x4, y4], [x4, y4], [main1, y4]]); + } else { + points.push([[main1, cross1], [main2, cross2], [main2, y4], [main1, y4]]); + } + } // 不被整个重叠的情况再细分 + else { + // 上部分和borderLeft重叠 + if (main1 < x2) { + cross1 = y4 - (main1 - x1) * Math.tan(deg1); + points.push([[main1, cross1], [x2, y3], [x2, y4], [main1, y4]]); if (isLast) { - points.push([[main1, cross1], [x4, y4], [x4, y4], [main1, y4]]); + points.push([[x2, y3], [x3, y3], [x3, y4], [x2, y4]]); + points.push([[x3, y3], [x4, y4], [x4, y4], [x3, y4]]); } else { - points.push([[main1, cross1], [main2, cross2], [main2, y4], [main1, y4]]); + // 下部分和borderRight重叠 + if (main2 > x3) { + cross2 = y4 - (main2 - x3) * Math.tan(deg2); + points.push([[x2, y3], [x3, y3], [x3, y4], [x2, y4]]); + points.push([[x3, y3], [main2, cross2], [main2, y4], [x3, y4]]); + } // 下部独立 + else { + points.push([[x2, y3], [main2, y3], [main2, y4], [x2, y4]]); + } } - } // 不被整个重叠的情况再细分 - else { - // 上部分和borderLeft重叠 - if (main1 < x2) { - cross1 = y4 - (main1 - x1) * Math.tan(deg1); - points.push([[main1, cross1], [x2, y3], [x2, y4], [main1, y4]]); - - if (isLast) { - points.push([[x2, y3], [x3, y3], [x3, y4], [x2, y4]]); - points.push([[x3, y3], [x4, y4], [x4, y4], [x3, y4]]); - } else { - // 下部分和borderRight重叠 - if (main2 > x3) { - cross2 = y4 - (main2 - x3) * Math.tan(deg2); - points.push([[x2, y3], [x3, y3], [x3, y4], [x2, y4]]); - points.push([[x3, y3], [main2, cross2], [main2, y4], [x3, y4]]); - } // 下部独立 - else { - points.push([[x2, y3], [main2, y3], [main2, y4], [x2, y4]]); - } - } - } // 下部分和borderRight重叠 - else if (main2 > x3) { - cross1 = y4 - (x4 - main2) * Math.tan(deg2); // 上部分和borderLeft重叠 - - if (main1 < x2) { - cross2 = y4 - (main1 - x3) * Math.tan(deg1); - points.push([[main1, cross2], [x2, y3], [x2, y4], [main1, y4]]); - points.push([[x2, y3], [x3, y3], [x3, y4], [x2, y4]]); - - if (isLast) { - points.push([[x3, y3], [x4, y4], [x4, y4], [x3, y4]]); - } else { - points.push([[x3, y3], [main2, cross1], [main2, y4], [x3, y4]]); - } - } // 上部独立 - else { - points.push([[main1, y3], [x3, y3], [x3, y4], [main1, y4]]); + } // 下部分和borderRight重叠 + else if (main2 > x3) { + cross1 = y4 - (x4 - main2) * Math.tan(deg2); // 上部分和borderLeft重叠 - if (isLast) { - points.push([[x3, y3], [x4, y4], [x4, y4], [x3, y4]]); - } else { - points.push([[x3, y3], [main2, cross1], [main2, y4], [x3, y4]]); - } - } - } // 完全独立 - else { - if (isLast) { - points.push([[main1, y3], [x3, y3], [x4, y4], [main1, y4]]); - } else { - points.push([[main1, y3], [main2, y3], [main2, y4], [main1, y4]]); - } - } + if (main1 < x2) { + cross2 = y4 - (main1 - x3) * Math.tan(deg1); + points.push([[main1, cross2], [x2, y3], [x2, y4], [main1, y4]]); + points.push([[x2, y3], [x3, y3], [x3, y4], [x2, y4]]); + + if (isLast) { + points.push([[x3, y3], [x4, y4], [x4, y4], [x3, y4]]); + } else { + points.push([[x3, y3], [main2, cross1], [main2, y4], [x3, y4]]); + } + } // 上部独立 + else { + points.push([[main1, y3], [x3, y3], [x3, y4], [main1, y4]]); + + if (isLast) { + points.push([[x3, y3], [x4, y4], [x4, y4], [x3, y4]]); + } else { + points.push([[x3, y3], [main2, cross1], [main2, y4], [x3, y4]]); + } + } + } // 完全独立 + else { + if (isLast) { + points.push([[main1, y3], [x3, y3], [x4, y4], [main1, y4]]); + } else { + points.push([[main1, y3], [main2, y3], [main2, y4], [main1, y4]]); } + } + } } else if (direction === 3) { // 整个和borderTop重叠 if (main2 <= y2) { @@ -2687,68 +2688,68 @@ } } // 整个和borderBottom重叠 else if (main1 >= y3) { - cross1 = x1 + (y4 - main1) * Math.tan(deg2); - cross2 = x1 + (y4 - main2) * Math.tan(deg2); + cross1 = x1 + (y4 - main1) * Math.tan(deg2); + cross2 = x1 + (y4 - main2) * Math.tan(deg2); + + if (isLast) { + points.push([[x1, main1], [cross1, main1], [x1, y4], [x1, y4]]); + } else { + points.push([[x1, main1], [cross1, main1], [cross2, main2], [x1, main2]]); + } + } // 不被整个重叠的情况再细分 + else { + // 上部分和borderTop重叠 + if (main1 < y2) { + cross1 = x1 + (main1 - y1) * Math.tan(deg1); + points.push([[x1, main1], [cross1, main1], [x2, y2], [x1, y2]]); if (isLast) { - points.push([[x1, main1], [cross1, main1], [x1, y4], [x1, y4]]); + points.push([[x1, y2], [x2, y2], [x2, y3], [x1, y3]]); + points.push([[x1, y3], [x2, y3], [x1, y4], [x1, y4]]); } else { - points.push([[x1, main1], [cross1, main1], [cross2, main2], [x1, main2]]); + // 下部分和borderBottom重叠 + if (main2 > y3) { + cross2 = x1 + (y4 - main2) * Math.tan(deg2); + points.push([[x1, y2], [x2, y2], [x2, y3], [x1, y3]]); + points.push([[x1, y3], [x2, y3], [cross2, main2], [x1, main2]]); + } // 下部独立 + else { + points.push([[x1, y2], [x2, y2], [x2, main2], [x1, main2]]); + } } - } // 不被整个重叠的情况再细分 - else { - // 上部分和borderTop重叠 - if (main1 < y2) { - cross1 = x1 + (main1 - y1) * Math.tan(deg1); - points.push([[x1, main1], [cross1, main1], [x2, y2], [x1, y2]]); - - if (isLast) { - points.push([[x1, y2], [x2, y2], [x2, y3], [x1, y3]]); - points.push([[x1, y3], [x2, y3], [x1, y4], [x1, y4]]); - } else { - // 下部分和borderBottom重叠 - if (main2 > y3) { - cross2 = x1 + (y4 - main2) * Math.tan(deg2); - points.push([[x1, y2], [x2, y2], [x2, y3], [x1, y3]]); - points.push([[x1, y3], [x2, y3], [cross2, main2], [x1, main2]]); - } // 下部独立 - else { - points.push([[x1, y2], [x2, y2], [x2, main2], [x1, main2]]); - } - } - } // 下部分和borderBottom重叠 - else if (main2 > y3) { - cross1 = x1 + (y4 - main2) * Math.tan(deg2); // 上部分和borderTop重叠 - - if (main1 < y2) { - cross2 = x1 + (main1 - y1) * Math.tan(deg1); - points.push([[x1, main1], [cross2, main1], [x2, y2], [x1, y1]]); - points.push([[x1, y2], [x2, y2], [x2, y3], [x1, y3]]); - - if (isLast) { - points.push([[x1, y3], [x2, y3], [x1, y4], [x1, y4]]); - } else { - points.push([[x1, y3], [x2, y3], [cross1, main2], [x1, main2]]); - } - } // 上部独立 - else { - points.push([[x1, main1], [x2, main1], [x2, y3], [x1, y3]]); + } // 下部分和borderBottom重叠 + else if (main2 > y3) { + cross1 = x1 + (y4 - main2) * Math.tan(deg2); // 上部分和borderTop重叠 - if (isLast) { - points.push([[x1, y3], [x2, y3], [x1, y4], [x1, y4]]); - } else { - points.push([[x1, y3], [x2, y3], [cross1, main2], [x1, main2]]); - } - } - } // 完全独立 - else { - if (isLast) { - points.push([[x1, main1], [x2, main1], [x2, y3], [x1, y4]]); - } else { - points.push([[x1, main1], [x2, main1], [x2, main2], [x1, main2]]); - } - } + if (main1 < y2) { + cross2 = x1 + (main1 - y1) * Math.tan(deg1); + points.push([[x1, main1], [cross2, main1], [x2, y2], [x1, y1]]); + points.push([[x1, y2], [x2, y2], [x2, y3], [x1, y3]]); + + if (isLast) { + points.push([[x1, y3], [x2, y3], [x1, y4], [x1, y4]]); + } else { + points.push([[x1, y3], [x2, y3], [cross1, main2], [x1, main2]]); + } + } // 上部独立 + else { + points.push([[x1, main1], [x2, main1], [x2, y3], [x1, y3]]); + + if (isLast) { + points.push([[x1, y3], [x2, y3], [x1, y4], [x1, y4]]); + } else { + points.push([[x1, y3], [x2, y3], [cross1, main2], [x1, main2]]); + } + } + } // 完全独立 + else { + if (isLast) { + points.push([[x1, main1], [x2, main1], [x2, y3], [x1, y4]]); + } else { + points.push([[x1, main1], [x2, main1], [x2, main2], [x1, main2]]); } + } + } } } @@ -2847,44 +2848,44 @@ beginList.push(points); } // 全在右圆角 else if (points[0][0] > oxr) { - endList.push(points); - } // 跨越左右圆角 - else if (points[1][0] > oxr && points[0][0] < oxl) { - var ya = oxl < x2 ? y1 + Math.tan(deg1) * (oxl - x1) : y2; - var yb = oxr > x3 ? y1 + Math.tan(deg2) * (x4 - oxr) : y2; - beginList.push([points[0], [oxl, y1], [oxl, ya], points[3]]); - - if (oxl < oxr) { - if (oxl > x2 && oxr < x3) { - centerList.push([[oxl, y1], [oxr, y1], [oxr, y2], [oxl, y2]]); - } else if (oxl > x2) { - centerList.push([[oxl, y1], [x3, y1], [x3, y2], [oxl, y2]]); - centerList.push([[x3, y1], [oxr, y1], [oxr, yb], [x3, y2]]); - } else if (oxr < x3) { - centerList.push([[oxl, y1], [x2, y1], [x2, y2], [oxl, ya]]); - centerList.push([[x2, y1], [oxr, y1], [oxr, y2], [x2, y2]]); - } else { - centerList.push([[oxl, y1], [x2, y1], [x2, y2], [oxl, ya]]); - centerList.push([[x2, y1], [x3, y1], [x3, y2], [x2, y2]]); - centerList.push([[x3, y1], [oxr, y1], [oxr, yb], [x3, y2]]); - } - } + endList.push(points); + } // 跨越左右圆角 + else if (points[1][0] > oxr && points[0][0] < oxl) { + var ya = oxl < x2 ? y1 + Math.tan(deg1) * (oxl - x1) : y2; + var yb = oxr > x3 ? y1 + Math.tan(deg2) * (x4 - oxr) : y2; + beginList.push([points[0], [oxl, y1], [oxl, ya], points[3]]); + + if (oxl < oxr) { + if (oxl > x2 && oxr < x3) { + centerList.push([[oxl, y1], [oxr, y1], [oxr, y2], [oxl, y2]]); + } else if (oxl > x2) { + centerList.push([[oxl, y1], [x3, y1], [x3, y2], [oxl, y2]]); + centerList.push([[x3, y1], [oxr, y1], [oxr, yb], [x3, y2]]); + } else if (oxr < x3) { + centerList.push([[oxl, y1], [x2, y1], [x2, y2], [oxl, ya]]); + centerList.push([[x2, y1], [oxr, y1], [oxr, y2], [x2, y2]]); + } else { + centerList.push([[oxl, y1], [x2, y1], [x2, y2], [oxl, ya]]); + centerList.push([[x2, y1], [x3, y1], [x3, y2], [x2, y2]]); + centerList.push([[x3, y1], [oxr, y1], [oxr, yb], [x3, y2]]); + } + } - endList.push([[oxr, y1], points[1], points[2], [oxr, yb]]); - } // 跨越右圆角 - else if (points[1][0] > oxr) { - var y = oxr > x3 ? y1 + Math.tan(deg2) * (x4 - oxr) : y2; - centerList.push([points[0], [oxr, y1], [oxr, y], points[3]]); - endList.push([[oxr, y1], points[1], points[2], [oxr, y]]); - } // 跨越左圆角 - else if (points[0][0] < oxl) { - var _y = oxl < x2 ? y1 + Math.tan(deg1) * (oxl - x1) : y2; + endList.push([[oxr, y1], points[1], points[2], [oxr, yb]]); + } // 跨越右圆角 + else if (points[1][0] > oxr) { + var y = oxr > x3 ? y1 + Math.tan(deg2) * (x4 - oxr) : y2; + centerList.push([points[0], [oxr, y1], [oxr, y], points[3]]); + endList.push([[oxr, y1], points[1], points[2], [oxr, y]]); + } // 跨越左圆角 + else if (points[0][0] < oxl) { + var _y = oxl < x2 ? y1 + Math.tan(deg1) * (oxl - x1) : y2; - beginList.push([points[0], [oxl, y1], [oxl, _y], points[3]]); - centerList.push([[oxl, y1], points[1], points[2], [oxl, _y]]); - } else { - centerList.push(points); - } + beginList.push([points[0], [oxl, y1], [oxl, _y], points[3]]); + centerList.push([[oxl, y1], points[1], points[2], [oxl, _y]]); + } else { + centerList.push(points); + } } var beginLength = beginList.length; @@ -3097,7 +3098,7 @@ } // 根据夹角求贝塞尔拟合圆弧长度 - var h = geom.h(Math.abs(deg1 - deg2)); + var h = geom$1.h(Math.abs(deg1 - deg2)); var d = h * r; // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点 // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标 @@ -3182,7 +3183,7 @@ } // 根据夹角求贝塞尔拟合圆弧长度 - var h = geom.h(Math.abs(deg1 - deg2)); + var h = geom$1.h(Math.abs(deg1 - deg2)); var d = h * r; // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点 // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标 @@ -3247,44 +3248,44 @@ beginList.push(points); } // 全在下圆角 else if (points[1][1] > oyb) { - endList.push(points); - } // 跨越上下圆角 - else if (points[2][1] > oyb && points[1][1] < oyt) { - var xa = oyt < y2 ? x3 + Math.tan(deg2) * (y2 - oyt) : x3; - var xb = oyb > y3 ? x3 + Math.tan(deg1) * (oyb - y3) : x3; - beginList.push([points[0], points[1], [x4, oyt], [xa, oyt]]); - - if (oyt < oyb) { - if (oyb < y3 && oyt > y2) { - centerList.push([[x3, oyt], [x4, oyt], [x4, oyb], [x3, oyb]]); - } else if (oyt > y2) { - centerList.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); - centerList.push([[x3, y3], [x4, y3], [x4, oyb], [xb, oyb]]); - } else if (oyb < y3) { - centerList.push([[xa, oyt], [x4, oyt], [x4, y2], [x3, y2]]); - centerList.push([[x3, y2], [x4, y2], [x4, oyb], [x3, oyb]]); - } else { - centerList.push([[xa, oyt], [x4, oyt], [x4, y2], [x3, y2]]); - centerList.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); - centerList.push([[x3, y3], [x4, y3], [x4, oyb], [xb, oyb]]); - } - } + endList.push(points); + } // 跨越上下圆角 + else if (points[2][1] > oyb && points[1][1] < oyt) { + var xa = oyt < y2 ? x3 + Math.tan(deg2) * (y2 - oyt) : x3; + var xb = oyb > y3 ? x3 + Math.tan(deg1) * (oyb - y3) : x3; + beginList.push([points[0], points[1], [x4, oyt], [xa, oyt]]); + + if (oyt < oyb) { + if (oyb < y3 && oyt > y2) { + centerList.push([[x3, oyt], [x4, oyt], [x4, oyb], [x3, oyb]]); + } else if (oyt > y2) { + centerList.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); + centerList.push([[x3, y3], [x4, y3], [x4, oyb], [xb, oyb]]); + } else if (oyb < y3) { + centerList.push([[xa, oyt], [x4, oyt], [x4, y2], [x3, y2]]); + centerList.push([[x3, y2], [x4, y2], [x4, oyb], [x3, oyb]]); + } else { + centerList.push([[xa, oyt], [x4, oyt], [x4, y2], [x3, y2]]); + centerList.push([[x3, y2], [x4, y2], [x4, y3], [x3, y3]]); + centerList.push([[x3, y3], [x4, y3], [x4, oyb], [xb, oyb]]); + } + } - endList.push([[xb, oyb], [x4, oyb], points[2], points[3]]); - } // 跨越下圆角 - else if (points[2][1] > oyb) { - var x = oyb > y3 ? x3 + Math.tan(deg1) * (oyb - y3) : x3; - centerList.push([points[0], points[1], [x4, oyb], [x, oyb]]); - endList.push([[x, oyb], [x4, oyb], points[2], points[3]]); - } // 跨越上圆角 - else if (points[1][1] < oyt) { - var _x = oyt < y2 ? x3 + Math.tan(deg2) * (y2 - oyt) : x3; + endList.push([[xb, oyb], [x4, oyb], points[2], points[3]]); + } // 跨越下圆角 + else if (points[2][1] > oyb) { + var x = oyb > y3 ? x3 + Math.tan(deg1) * (oyb - y3) : x3; + centerList.push([points[0], points[1], [x4, oyb], [x, oyb]]); + endList.push([[x, oyb], [x4, oyb], points[2], points[3]]); + } // 跨越上圆角 + else if (points[1][1] < oyt) { + var _x = oyt < y2 ? x3 + Math.tan(deg2) * (y2 - oyt) : x3; - beginList.push([points[0], points[1], [x4, oyt], [_x, oyt]]); - centerList.push([[_x, oyt], [x4, oyt], points[2], points[3]]); - } else { - centerList.push(points); - } + beginList.push([points[0], points[1], [x4, oyt], [_x, oyt]]); + centerList.push([[_x, oyt], [x4, oyt], points[2], points[3]]); + } else { + centerList.push(points); + } } var beginLength = beginList.length; @@ -3499,7 +3500,7 @@ } // 根据夹角求贝塞尔拟合圆弧长度 - var h = geom.h(Math.abs(deg1 - deg2)); + var h = geom$1.h(Math.abs(deg1 - deg2)); var d = h * r; // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点 // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标 @@ -3584,7 +3585,7 @@ } // 根据夹角求贝塞尔拟合圆弧长度 - var h = geom.h(Math.abs(deg1 - deg2)); + var h = geom$1.h(Math.abs(deg1 - deg2)); var d = h * r; // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点 // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标 @@ -3652,44 +3653,44 @@ beginList.push(points); } // 全在右圆角 else if (points[3][0] > oxr) { - endList.push(points); - } // 跨越左右圆角 - else if (points[2][0] > oxr && points[3][0] < oxl) { - var ya = oxl < x2 ? y4 - Math.tan(deg1) * (oxl - x1) : y2; - var yb = oxr > x3 ? y4 - Math.tan(deg2) * (x4 - oxr) : y3; - beginList.push([points[0], [oxl, ya], [oxl, y4], points[3]]); - - if (oxl < oxr) { - if (oxl > x2 && oxr < x3) { - centerList.push([[oxl, y3], [oxr, y3], [oxr, y4], [oxl, y4]]); - } else if (oxl > x2) { - centerList.push([[oxl, y3], [x3, y3], [x3, y4], [oxl, y4]]); - centerList.push([[x3, y3], [oxr, yb], [oxr, y4], [x3, y4]]); - } else if (oxr < x3) { - centerList.push([[oxl, ya], [x2, y3], [x2, y4], [oxl, y4]]); - centerList.push([[x2, y3], [oxr, y3], [oxr, y4], [x2, y4]]); - } else { - centerList.push([[oxl, ya], [x2, y3], [x2, y4], [oxl, y4]]); - centerList.push([[x2, y3], [x3, y3], [x3, y4], [x2, y4]]); - centerList.push([[x3, y3], [oxr, yb], [oxr, y4], [x3, y4]]); - } - } + endList.push(points); + } // 跨越左右圆角 + else if (points[2][0] > oxr && points[3][0] < oxl) { + var ya = oxl < x2 ? y4 - Math.tan(deg1) * (oxl - x1) : y2; + var yb = oxr > x3 ? y4 - Math.tan(deg2) * (x4 - oxr) : y3; + beginList.push([points[0], [oxl, ya], [oxl, y4], points[3]]); + + if (oxl < oxr) { + if (oxl > x2 && oxr < x3) { + centerList.push([[oxl, y3], [oxr, y3], [oxr, y4], [oxl, y4]]); + } else if (oxl > x2) { + centerList.push([[oxl, y3], [x3, y3], [x3, y4], [oxl, y4]]); + centerList.push([[x3, y3], [oxr, yb], [oxr, y4], [x3, y4]]); + } else if (oxr < x3) { + centerList.push([[oxl, ya], [x2, y3], [x2, y4], [oxl, y4]]); + centerList.push([[x2, y3], [oxr, y3], [oxr, y4], [x2, y4]]); + } else { + centerList.push([[oxl, ya], [x2, y3], [x2, y4], [oxl, y4]]); + centerList.push([[x2, y3], [x3, y3], [x3, y4], [x2, y4]]); + centerList.push([[x3, y3], [oxr, yb], [oxr, y4], [x3, y4]]); + } + } - endList.push([[oxr, yb], points[1], points[2], [oxr, y4]]); - } // 跨越右圆角 - else if (points[2][0] > oxr) { - var y = oxr > x3 ? y4 - Math.tan(deg2) * (x4 - oxr) : y3; - centerList.push([points[0], [oxr, y], [oxr, y4], points[3]]); - endList.push([[oxr, y], points[1], points[2], [oxr, y4]]); - } // 跨越左圆角 - else if (points[3][0] < oxl) { - var _y2 = oxl < x2 ? y4 - Math.tan(deg1) * (oxl - x1) : y3; + endList.push([[oxr, yb], points[1], points[2], [oxr, y4]]); + } // 跨越右圆角 + else if (points[2][0] > oxr) { + var y = oxr > x3 ? y4 - Math.tan(deg2) * (x4 - oxr) : y3; + centerList.push([points[0], [oxr, y], [oxr, y4], points[3]]); + endList.push([[oxr, y], points[1], points[2], [oxr, y4]]); + } // 跨越左圆角 + else if (points[3][0] < oxl) { + var _y2 = oxl < x2 ? y4 - Math.tan(deg1) * (oxl - x1) : y3; - beginList.push([points[0], [oxl, _y2], [oxl, y4], points[3]]); - centerList.push([[oxl, _y2], points[1], points[2], [oxl, y4]]); - } else { - centerList.push(points); - } + beginList.push([points[0], [oxl, _y2], [oxl, y4], points[3]]); + centerList.push([[oxl, _y2], points[1], points[2], [oxl, y4]]); + } else { + centerList.push(points); + } } var beginLength = beginList.length; @@ -3908,7 +3909,7 @@ } // 根据夹角求贝塞尔拟合圆弧长度 - var h = geom.h(Math.abs(deg1 - deg2)); + var h = geom$1.h(Math.abs(deg1 - deg2)); var d = h * r; // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点 // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标 @@ -3993,7 +3994,7 @@ } // 根据夹角求贝塞尔拟合圆弧长度 - var h = geom.h(Math.abs(deg1 - deg2)); + var h = geom$1.h(Math.abs(deg1 - deg2)); var d = h * r; // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点 // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标 @@ -4058,44 +4059,44 @@ beginList.push(points); } // 全在下圆角 else if (points[0][1] > oyb) { - endList.push(points); - } // 跨越上下圆角 - else if (points[3][1] > oyb && points[0][1] < oyt) { - var xa = oyt < y2 ? x2 - Math.tan(deg2) * (y2 - oyt) : x2; - var xb = oyb > y3 ? x2 - Math.tan(deg1) * (oyb - y3) : x2; - beginList.push([points[0], points[1], [xa, oyt], [x1, oyt]]); - - if (oyt < oyb) { - if (oyb < y3 && oyt > y2) { - centerList.push([[x1, oyt], [x2, oyt], [x2, oyb], [x1, oyb]]); - } else if (oyt > y2) { - centerList.push([[x1, oyt], [x2, oyt], [x2, y3], [x1, y3]]); - centerList.push([[x1, y3], [x2, y3], [xb, oyb], [x1, oyb]]); - } else if (oyb < y3) { - centerList.push([[x1, oyt], [xa, oyt], [x2, y2], [x1, y2]]); - centerList.push([[x1, y2], [x2, y2], [x2, oyb], [x1, oyb]]); - } else { - centerList.push([[x1, oyt], [xa, oyt], [x2, y2], [x1, y2]]); - centerList.push([[x1, y2], [x2, y2], [x2, y3], [x1, y3]]); - centerList.push([[x1, y3], [x2, y3], [xb, oyb], [x1, oyb]]); - } - } + endList.push(points); + } // 跨越上下圆角 + else if (points[3][1] > oyb && points[0][1] < oyt) { + var xa = oyt < y2 ? x2 - Math.tan(deg2) * (y2 - oyt) : x2; + var xb = oyb > y3 ? x2 - Math.tan(deg1) * (oyb - y3) : x2; + beginList.push([points[0], points[1], [xa, oyt], [x1, oyt]]); + + if (oyt < oyb) { + if (oyb < y3 && oyt > y2) { + centerList.push([[x1, oyt], [x2, oyt], [x2, oyb], [x1, oyb]]); + } else if (oyt > y2) { + centerList.push([[x1, oyt], [x2, oyt], [x2, y3], [x1, y3]]); + centerList.push([[x1, y3], [x2, y3], [xb, oyb], [x1, oyb]]); + } else if (oyb < y3) { + centerList.push([[x1, oyt], [xa, oyt], [x2, y2], [x1, y2]]); + centerList.push([[x1, y2], [x2, y2], [x2, oyb], [x1, oyb]]); + } else { + centerList.push([[x1, oyt], [xa, oyt], [x2, y2], [x1, y2]]); + centerList.push([[x1, y2], [x2, y2], [x2, y3], [x1, y3]]); + centerList.push([[x1, y3], [x2, y3], [xb, oyb], [x1, oyb]]); + } + } - endList.push([[x1, oyb], [xb, oyb], points[2], points[3]]); - } // 跨越下圆角 - else if (points[3][1] > oyb) { - var x = oyb > y3 ? x2 - Math.tan(deg1) * (oyb - y3) : x2; - centerList.push([points[0], points[1], [x, oyb], [x1, oyb]]); - endList.push([[x1, oyb], [x, oyb], points[2], points[3]]); - } // 跨越上圆角 - else if (points[1][1] < oyt) { - var _x2 = oyt < y2 ? x2 - Math.tan(deg2) * (y2 - oyt) : x2; + endList.push([[x1, oyb], [xb, oyb], points[2], points[3]]); + } // 跨越下圆角 + else if (points[3][1] > oyb) { + var x = oyb > y3 ? x2 - Math.tan(deg1) * (oyb - y3) : x2; + centerList.push([points[0], points[1], [x, oyb], [x1, oyb]]); + endList.push([[x1, oyb], [x, oyb], points[2], points[3]]); + } // 跨越上圆角 + else if (points[1][1] < oyt) { + var _x2 = oyt < y2 ? x2 - Math.tan(deg2) * (y2 - oyt) : x2; - beginList.push([points[0], points[1], [_x2, oyt], [x1, oyt]]); - centerList.push([[x1, oyt], [_x2, oyt], points[2], points[3]]); - } else { - centerList.push(points); - } + beginList.push([points[0], points[1], [_x2, oyt], [x1, oyt]]); + centerList.push([[x1, oyt], [_x2, oyt], points[2], points[3]]); + } else { + centerList.push(points); + } } var beginLength = beginList.length; @@ -4308,7 +4309,7 @@ } // 根据夹角求贝塞尔拟合圆弧长度 - var h = geom.h(Math.abs(deg1 - deg2)); + var h = geom$1.h(Math.abs(deg1 - deg2)); var d = h * r; // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点 // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标 @@ -4393,7 +4394,7 @@ } // 根据夹角求贝塞尔拟合圆弧长度 - var h = geom.h(Math.abs(deg1 - deg2)); + var h = geom$1.h(Math.abs(deg1 - deg2)); var d = h * r; // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点 // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标 @@ -4480,28 +4481,28 @@ if (btlx > 0 && btly > 0) { list.push([x, y + btly]); - list.push([x, y + btly * (1 - H$1), x + btlx * (1 - H$1), y, x + btlx, y]); + list.push([x, y + btly * (1 - H), x + btlx * (1 - H), y, x + btlx, y]); } else { list.push([x, y]); } if (btrx > 0 && btry > 0) { list.push([x + w - btrx, y]); - list.push([x + w - btrx * (1 - H$1), y, x + w, y + btry * (1 - H$1), x + w, y + btry]); + list.push([x + w - btrx * (1 - H), y, x + w, y + btry * (1 - H), x + w, y + btry]); } else { list.push([x + w, y]); } if (bbrx > 0 && bbry > 0) { list.push([x + w, y + h - bbry]); - list.push([x + w, y + h - bbry * (1 - H$1), x + w - bbrx * (1 - H$1), y + h, x + w - bbrx, y + h]); + list.push([x + w, y + h - bbry * (1 - H), x + w - bbrx * (1 - H), y + h, x + w - bbrx, y + h]); } else { list.push([x + w, y + h]); } if (bblx > 0 && bbly > 0) { list.push([x + bblx, y + h]); - list.push([x + bblx * (1 - H$1), y + h, x, y + h - bbly * (1 - H$1), x, y + h - bbly]); + list.push([x + bblx * (1 - H), y + h, x, y + h - bbly * (1 - H), x, y + h - bbly]); } else { list.push([x, y + h]); } @@ -4538,7 +4539,7 @@ } } - var BR_KS = [BORDER_TOP_LEFT_RADIUS, BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS]; + var BR_KS = [BORDER_TOP_LEFT_RADIUS$2, BORDER_TOP_RIGHT_RADIUS$2, BORDER_BOTTOM_RIGHT_RADIUS$2, BORDER_BOTTOM_LEFT_RADIUS$2]; function calBorderRadius(w, h, currentStyle, computedStyle, root) { var noRadius = true; @@ -4550,15 +4551,15 @@ return 0; } - if (item[1] === PX) { + if (item[1] === PX$b) { return Math.max(0, item[0]); - } else if (item[1] === PERCENT) { + } else if (item[1] === PERCENT$c) { 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]); - } else if (item[1] === VW) { + } else if (item[1] === REM$g) { + return Math.max(0, item[0] * root.computedStyle[FONT_SIZE$h]); + } else if (item[1] === VW$g) { return Math.max(0, item[0] * root.width * 0.01); - } else if (item[1] === VH) { + } else if (item[1] === VH$g) { return Math.max(0, item[0] * root.height * 0.01); } @@ -4584,10 +4585,10 @@ prev[j] = next[j] = half; } // 仅1个超过中点,因相交用总长减去另一方即可 else if (prev[j] > half) { - prev[j] = target - next[j]; - } else if (next[j] > half) { - next[j] = target - prev[j]; - } + prev[j] = target - next[j]; + } else if (next[j] > half) { + next[j] = target - prev[j]; + } } }); } @@ -4603,13 +4604,13 @@ var w = first ? first.outerWidth : 0, h = first ? first.outerHeight : 0; - w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT]; - h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH] + computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM]; - [BORDER_TOP_LEFT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS].forEach(function (k) { + w += computedStyle[BORDER_LEFT_WIDTH$8] + computedStyle[PADDING_LEFT$7]; + h += computedStyle[BORDER_TOP_WIDTH$6] + computedStyle[BORDER_BOTTOM_WIDTH$6] + computedStyle[PADDING_TOP$5] + computedStyle[PADDING_BOTTOM$5]; + [BORDER_TOP_LEFT_RADIUS$2, BORDER_BOTTOM_LEFT_RADIUS$2].forEach(function (k) { computedStyle[k] = currentStyle[k].map(function (item, i) { var v; - if (item[1] === PX) { + if (item[1] === PX$b) { v = Math.max(0, item[0]); v = Math.min(i ? h : w, v); } else { @@ -4623,11 +4624,11 @@ w = last ? last.outerWidth : 0; h = last ? last.outerHeight : 0; - [BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS].forEach(function (k) { + [BORDER_TOP_RIGHT_RADIUS$2, BORDER_BOTTOM_RIGHT_RADIUS$2].forEach(function (k) { computedStyle[k] = currentStyle[k].map(function (item, i) { var v; - if (item[1] === PX) { + if (item[1] === PX$b) { v = Math.max(0, item[0]); v = Math.min(i ? h : w, v); } else { @@ -4649,14 +4650,14 @@ } points.forEach(function (point) { - canvasPolygon$1(ctx, point, dx, dy); + canvasPolygon$6(ctx, point, dx, dy); }); ctx.fill(); ctx.closePath(); } else if (renderMode === mode.SVG) { var s = ''; points.forEach(function (point) { - s += svgPolygon$1(point); + s += svgPolygon$6(point); }); xom.virtualDom.bb.push({ type: 'item', @@ -4675,19 +4676,19 @@ }; // 类型为引用防止json仿造 - var TYPE_VD = { + var TYPE_VD$4 = { _: 1 }; - var TYPE_GM = { + var TYPE_GM$4 = { _: 2 }; - var TYPE_CP = { + var TYPE_CP$4 = { _: 3 }; var $$type = { - TYPE_VD: TYPE_VD, - TYPE_GM: TYPE_GM, - TYPE_CP: TYPE_CP + TYPE_VD: TYPE_VD$4, + TYPE_GM: TYPE_GM$4, + TYPE_CP: TYPE_CP$4 }; var toString = {}.toString; @@ -4698,17 +4699,17 @@ }; } - var isObject = isType('Object'); - var isString = isType('String'); - var isFunction = isType('Function'); - var isNumber = isType('Number'); + var isObject$2 = isType('Object'); + var isString$1 = isType('String'); + var isFunction$8 = isType('Function'); + var isNumber$1 = isType('Number'); var isBoolean = isType('Boolean'); var isDate = isType('Date'); var hasOwn = {}.hasOwnProperty; var fnToString = hasOwn.toString; var ObjectFunctionString = fnToString.call(Object); - function isNil(v) { + function isNil$f(v) { return v === undefined || v === null; } @@ -4729,7 +4730,7 @@ } function stringify(s) { - if (isNil(s)) { + if (isNil$f(s)) { return ''; } @@ -4748,11 +4749,11 @@ function joinVirtualDom(vd) { var s = ''; vd.defs.forEach(function (item) { - s += joinDef(item); + s += joinDef$1(item); }); s += ''; vd.bb.forEach(function (item) { - s += joinVd(item); + s += joinVd$1(item); }); s += '' + _s + ''; } else if (vd.type === 'dom' || vd.type === 'geom') { var _s2 = ''; vd.bb.forEach(function (item) { - _s2 += joinVd(item); + _s2 += joinVd$1(item); }); _s2 += ' -1) { - v[1] = PX$1; + if ([NUMBER$5, DEG$2].indexOf(v[1]) > -1) { + v[1] = PX$a; } return v; @@ -6506,7 +6507,7 @@ center: 50, right: 100, bottom: 100 - }[data] || 50, PERCENT$1]; + }[data] || 50, PERCENT$b]; } } // 获取color-stop区间范围,去除无用值 @@ -6521,13 +6522,13 @@ if (item.length > 1) { var p = item[1]; - if (p[1] === PERCENT$1) { + if (p[1] === PERCENT$b) { 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]); - } else if (p[1] === VW$1) { + } else if (p[1] === REM$f) { + list.push([item[0], p[0] * root.computedStyle[FONT_SIZE$g] / length]); + } else if (p[1] === VW$f) { list.push([item[0], p[0] * root.width / length]); - } else if (p[1] === VH$1) { + } else if (p[1] === VH$f) { list.push([item[0], p[0] * root.height / length]); } else { list.push([item[0], p[0] / length]); @@ -6707,25 +6708,25 @@ var positionX = position[0], positionY = position[1]; - if (positionX[1] === PERCENT$1) { + if (positionX[1] === PERCENT$b) { cx = x1 + positionX[0] * iw * 0.01; - } else if (positionX[1] === REM$1) { - cx = x1 + positionX[0] * root.computedStyle[FONT_SIZE$1]; - } else if (positionX[1] === VW$1) { + } else if (positionX[1] === REM$f) { + cx = x1 + positionX[0] * root.computedStyle[FONT_SIZE$g]; + } else if (positionX[1] === VW$f) { cx = x1 + positionX[0] * root.width * 0.01; - } else if (positionX[1] === VH$1) { + } else if (positionX[1] === VH$f) { cx = x1 + positionX[0] * root.height * 0.01; } else { cx = x1 + positionX[0]; } - if (positionY[1] === PERCENT$1) { + if (positionY[1] === PERCENT$b) { cy = y1 + positionY[0] * ih * 0.01; - } else if (positionY[1] === REM$1) { - cy = y1 + positionY[0] * root.computedStyle[FONT_SIZE$1]; - } else if (positionY[1] === VW$1) { + } else if (positionY[1] === REM$f) { + cy = y1 + positionY[0] * root.computedStyle[FONT_SIZE$g]; + } else if (positionY[1] === VW$f) { cy = y1 + positionY[0] * root.width * 0.01; - } else if (positionY[1] === VH$1) { + } else if (positionY[1] === VH$f) { cy = y1 + positionY[0] * root.height * 0.01; } else { cy = y1 + positionY[0]; @@ -6880,14 +6881,14 @@ o.d = getLinearDeg(deg[0].toLowerCase()); } // 扩展支持从a点到b点相对坐标,而不是css角度,sketch等ui软件中用此格式 else { - var points = /([-+]?[\d.]+)\s+([-+]?[\d.]+)\s+([-+]?[\d.]+)\s+([-+]?[\d.]+)/.exec(gradient[2]); + var points = /([-+]?[\d.]+)\s+([-+]?[\d.]+)\s+([-+]?[\d.]+)\s+([-+]?[\d.]+)/.exec(gradient[2]); - if (points) { - o.d = [parseFloat(points[1]), parseFloat(points[2]), parseFloat(points[3]), parseFloat(points[4])]; - } else { - o.d = 180; - } + if (points) { + o.d = [parseFloat(points[1]), parseFloat(points[2]), parseFloat(points[3]), parseFloat(points[4])]; + } else { + o.d = 180; } + } } else if (o.k === 'radial') { o.s = gradient[2].indexOf('circle') > -1 ? 'circle' : 'ellipse'; var size = /(closest|farthest)-(side|corner)/i.exec(gradient[2]); @@ -6896,20 +6897,20 @@ o.z = size[0].toLowerCase(); } // 扩展支持从a点到b点相对坐标,而不是size,sketch等ui软件中用此格式 else { - var _points = /([-+]?[\d.]+)\s+([-+]?[\d.]+)\s+([-+]?[\d.]+)\s+([-+]?[\d.]+)(?:\s+([\d.]+))?/.exec(gradient[2]); + var _points = /([-+]?[\d.]+)\s+([-+]?[\d.]+)\s+([-+]?[\d.]+)\s+([-+]?[\d.]+)(?:\s+([\d.]+))?/.exec(gradient[2]); - if (_points) { - o.z = [parseFloat(_points[1]), parseFloat(_points[2]), parseFloat(_points[3]), parseFloat(_points[4])]; + if (_points) { + o.z = [parseFloat(_points[1]), parseFloat(_points[2]), parseFloat(_points[3]), parseFloat(_points[4])]; - if (!isNil$1(_points[5])) { - o.z.push(parseFloat(_points[5])); - } else { - o.z.push(1); - } + if (!isNil$e(_points[5])) { + o.z.push(parseFloat(_points[5])); } else { - o.z = 'farthest-corner'; + o.z.push(1); } + } else { + o.z = 'farthest-corner'; } + } var position = /at\s+((?:[-+]?[\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\s+((?:[-+]?[\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]); @@ -6918,7 +6919,7 @@ var y = position[2] ? getRadialPosition(position[2]) : x; o.p = [x, y]; } else { - o.p = [[50, PERCENT$1], [50, PERCENT$1]]; + o.p = [[50, PERCENT$b], [50, PERCENT$b]]; } } else if (o.k === 'conic') { var _deg = /([-+]?[\d.]+deg)/i.exec(gradient[2]); @@ -6938,21 +6939,21 @@ o.p = [_x, _y]; } else { - o.p = [[50, PERCENT$1], [50, PERCENT$1]]; + o.p = [[50, PERCENT$b], [50, PERCENT$b]]; } } var v = gradient[2].match(/([-+]?[\d.]+[pxremvwh%]+)?\s*((#[0-9a-f]{3,8})|(rgba?\s*\(.+?\)))\s*([-+]?[\d.]+[pxremvwh%]+)?/ig) || []; o.v = v.map(function (item) { var color = /((?:#[0-9a-f]{3,8})|(?:rgba?\s*\(.+?\)))/i.exec(item); - var arr = [rgba2int$1(color[1])]; + var arr = [rgba2int$2(color[1])]; var percent = /[-+]?[\d.]+[pxremvwh%]+/.exec(item); if (percent) { - var _v = calUnit(percent[0]); + var _v = calUnit$2(percent[0]); - if ([NUMBER, DEG].indexOf(_v[1]) > -1) { - _v[1] = PX$1; + if ([NUMBER$5, DEG$2].indexOf(_v[1]) > -1) { + _v[1] = PX$a; } arr[1] = _v; @@ -7135,11 +7136,11 @@ if (renderMode === mode.CANVAS || renderMode === mode.WEBGL) { var offscreen = inject.getCacheCanvas(w, h, '__$$CONIC_GRADIENT$$__'); var imgData = offscreen.ctx.getImageData(0, 0, w, h); - gradient.getConicGradientImage(res.cx - x, res.cy - y, res.w, res.h, res.stop, imgData.data); + gradient$1.getConicGradientImage(res.cx - x, res.cy - y, res.w, res.h, res.stop, imgData.data); offscreen.ctx.putImageData(imgData, 0, 0); ctx.save(); ctx.beginPath(); - canvasPolygon$2(ctx, list); + canvasPolygon$5(ctx, list); ctx.clip(); ctx.closePath(); ctx.drawImage(offscreen.canvas, x, y); @@ -7153,13 +7154,13 @@ children: [] }; - xom.__config[NODE_DEFS_CACHE].push(v); + xom.__config[NODE_DEFS_CACHE$6].push(v); res.forEach(function (item) { v.children.push({ type: 'item', tagName: 'path', - props: [['d', svgPolygon$2(item[0])], ['fill', item[1]]] + props: [['d', svgPolygon$5(item[0])], ['fill', item[1]]] }); }); return ctx.add(v); @@ -7168,25 +7169,25 @@ tagName: 'clipPath', children: [{ tagName: 'path', - props: [['d', svgPolygon$2(list)]] + props: [['d', svgPolygon$5(list)]] }] }; - xom.__config[NODE_DEFS_CACHE].push(_v2); + xom.__config[NODE_DEFS_CACHE$6].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 + ')']] + props: [['d', svgPolygon$5(item[0])], ['fill', item[1]], ['clip-path', 'url(#' + clip + ')']] }); }); } } } - var gradient$1 = { + var gradient = { parseGradient: parseGradient, getLinear: getLinear, getRadial: getRadial, @@ -7283,7 +7284,7 @@ textStrokeColor: 'inherit', textStrokeOver: 'inherit' }; - var GEOM = { + var GEOM$4 = { fill: 'transparent', stroke: '#000', strokeWidth: 1, @@ -7304,16 +7305,16 @@ }); }); var GEOM_ENTRY_SET = []; - var GEOM_KEY_SET = []; - Object.keys(GEOM).forEach(function (k) { - GEOM_KEY_SET.push(k); - var v = GEOM[k]; + var GEOM_KEY_SET$2 = []; + Object.keys(GEOM$4).forEach(function (k) { + GEOM_KEY_SET$2.push(k); + var v = GEOM$4[k]; GEOM_ENTRY_SET.push({ k: k, v: v }); }); - var INHERIT = { + var INHERIT$5 = { fontFamily: 'arial', fontSize: 16, fontWeight: 400, @@ -7327,35 +7328,35 @@ textStrokeOver: 'none' }; var INHERIT_KEY_SET = []; - Object.keys(INHERIT).forEach(function (k) { + Object.keys(INHERIT$5).forEach(function (k) { INHERIT_KEY_SET.push(k); }); var reset = { DOM: DOM, - GEOM: GEOM, + GEOM: GEOM$4, isValid: function isValid(i) { - return DOM.hasOwnProperty(i) || GEOM.hasOwnProperty(i); + return DOM.hasOwnProperty(i) || GEOM$4.hasOwnProperty(i); }, DOM_KEY_SET: DOM_KEY_SET, - GEOM_KEY_SET: GEOM_KEY_SET, + GEOM_KEY_SET: GEOM_KEY_SET$2, DOM_ENTRY_SET: DOM_ENTRY_SET, GEOM_ENTRY_SET: GEOM_ENTRY_SET, - INHERIT: INHERIT, + INHERIT: INHERIT$5, INHERIT_KEY_SET: INHERIT_KEY_SET }; - var isNil$2 = util.isNil; + var isNil$d = util.isNil; function parseFlex(style, grow, shrink, basis) { - if (isNil$2(style.flexGrow)) { + if (isNil$d(style.flexGrow)) { style.flexGrow = grow || 0; } - if (isNil$2(style.flexShrink)) { + if (isNil$d(style.flexShrink)) { style.flexShrink = shrink || 0; } - if (isNil$2(style.flexBasis)) { + if (isNil$d(style.flexBasis)) { style.flexBasis = basis || 0; } } @@ -7363,7 +7364,7 @@ function parseMarginPadding(style, key, list) { var temp = style[key]; - if (!isNil$2(temp)) { + if (!isNil$d(temp)) { var match = temp.toString().match(/([-+]?[\d.]+[pxremvwh%]*)|(auto)/ig); if (match) { @@ -7377,7 +7378,7 @@ } list.forEach(function (k, i) { - if (isNil$2(style[k])) { + if (isNil$d(style[k])) { style[k] = match[i]; } }); @@ -7388,22 +7389,22 @@ function parseOneBorder(style, k) { var v = style[k]; - if (isNil$2(v)) { + if (isNil$d(v)) { return; } // 后面会统一格式化处理 - if (isNil$2(style[k + 'Width'])) { + if (isNil$d(style[k + 'Width'])) { var w = /\b[\d.]+[pxremvwh%]*\b/i.exec(v); style[k + 'Width'] = w ? w[0] : 0; } - if (isNil$2(style[k + 'Style'])) { + if (isNil$d(style[k + 'Style'])) { var s = /\b(solid|dashed|dotted)\b/i.exec(v); style[k + 'Style'] = s ? s[1] : 'solid'; } - if (isNil$2(style[k + 'Color'])) { + if (isNil$d(style[k + 'Color'])) { var c = /#[0-9a-f]{3,8}/i.exec(v); if (c && [4, 7, 9].indexOf(c[0].length) > -1) { @@ -7417,7 +7418,7 @@ } } - var abbr = { + var abbr$1 = { margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'], padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'], border: ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'], @@ -7449,7 +7450,7 @@ if (Array.isArray(v)) { var length = v.length; - if (isNil$2(style.backgroundColor)) { + if (isNil$d(style.backgroundColor)) { var bgc = /^\s*((transparent)|(#[0-9a-f]{3,8})|(rgba?\s*\(.+?\)))/i.exec(v[length - 1]); if (bgc) { @@ -7462,7 +7463,7 @@ var bgr = []; var bgp = []; v.forEach(function (item) { - if (isNil$2(style.backgroundImage)) { + if (isNil$d(style.backgroundImage)) { var gd = reg.gradient.exec(item); if (gd) { @@ -7478,7 +7479,7 @@ } } - if (isNil$2(style.backgroundRepeat)) { + if (isNil$d(style.backgroundRepeat)) { var repeat = /(no-?)?repeat(-?[xy])?/i.exec(item); if (repeat) { @@ -7486,7 +7487,7 @@ } } - if (isNil$2(style.backgroundPosition)) { + if (isNil$d(style.backgroundPosition)) { var position = item.match(reg.position); if (position) { @@ -7508,7 +7509,7 @@ this.toFull(style, 'backgroundPosition'); } } else { - if (isNil$2(style.backgroundImage)) { + if (isNil$d(style.backgroundImage)) { var gd = reg.gradient.exec(v); if (gd) { @@ -7524,7 +7525,7 @@ } } - if (isNil$2(style.backgroundRepeat)) { + if (isNil$d(style.backgroundRepeat)) { var repeat = /(no-?)?repeat(-?[xy])?/i.exec(v); if (repeat) { @@ -7532,7 +7533,7 @@ } } - if (isNil$2(style.backgroundColor)) { + if (isNil$d(style.backgroundColor)) { var _bgc = /^(transparent)|(#[0-9a-f]{3,8})|(rgba?\s*\(.+?\))/i.exec(v); if (_bgc) { @@ -7541,7 +7542,7 @@ } } - if (isNil$2(style.backgroundPosition)) { + if (isNil$d(style.backgroundPosition)) { var position = v.match(reg.position); if (position) { @@ -7581,7 +7582,7 @@ v = v.toString().split(/\s+/); if (v.length) { - if (isNil$2(style.flexDirection)) ; + if (isNil$d(style.flexDirection)) ; style.flexDirection = v[0]; @@ -7614,7 +7615,7 @@ } this[k].forEach(function (k, i) { - if (isNil$2(style[k])) { + if (isNil$d(style[k])) { style[k] = v[0][i] + ' ' + v[1][i]; } }); @@ -7624,7 +7625,7 @@ } var isEmpty = this[k].map(function (k2) { - return isNil$2(style[k2]); + return isNil$d(style[k2]); }); v.forEach(function (v2) { v2 = v2.toString().split(/\s+/); @@ -7648,7 +7649,7 @@ } this[k].forEach(function (k, i) { - if (isNil$2(style[k])) { + if (isNil$d(style[k])) { style[k] = _arr4[i]; } }); @@ -7662,7 +7663,7 @@ } this[k].forEach(function (k, i) { - if (isNil$2(style[k])) { + if (isNil$d(style[k])) { style[k] = _arr5[i]; } }); @@ -7690,7 +7691,7 @@ } } else if (this[k]) { this[k].forEach(function (k) { - if (isNil$2(style[k])) { + if (isNil$d(style[k])) { style[k] = v; } }); @@ -7700,36 +7701,36 @@ } }; - var STYLE_KEY$1 = enums.STYLE_KEY; - var KEY_COLOR = [[STYLE_KEY$1.BACKGROUND_COLOR], [STYLE_KEY$1.BORDER_BOTTOM_COLOR], [STYLE_KEY$1.BORDER_LEFT_COLOR], [STYLE_KEY$1.BORDER_RIGHT_COLOR], [STYLE_KEY$1.BORDER_TOP_COLOR], [STYLE_KEY$1.COLOR], [STYLE_KEY$1.TEXT_STROKE_COLOR]]; - var KEY_LENGTH = [[STYLE_KEY$1.FONT_SIZE], [STYLE_KEY$1.BORDER_BOTTOM_WIDTH], [STYLE_KEY$1.BORDER_LEFT_WIDTH], [STYLE_KEY$1.BORDER_RIGHT_WIDTH], [STYLE_KEY$1.BORDER_TOP_WIDTH], [STYLE_KEY$1.LEFT], [STYLE_KEY$1.TOP], [STYLE_KEY$1.RIGHT], [STYLE_KEY$1.BOTTOM], [STYLE_KEY$1.FLEX_BASIS], [STYLE_KEY$1.WIDTH], [STYLE_KEY$1.HEIGHT], [STYLE_KEY$1.LINE_HEIGHT], [STYLE_KEY$1.MARGIN_BOTTOM], [STYLE_KEY$1.MARGIN_LEFT], [STYLE_KEY$1.MARGIN_TOP], [STYLE_KEY$1.MARGIN_RIGHT], [STYLE_KEY$1.PADDING_TOP], [STYLE_KEY$1.PADDING_RIGHT], [STYLE_KEY$1.PADDING_BOTTOM], [STYLE_KEY$1.PADDING_LEFT], [STYLE_KEY$1.STROKE_WIDTH], [STYLE_KEY$1.STROKE_MITERLIMIT], [STYLE_KEY$1.LETTER_SPACING], [STYLE_KEY$1.PERSPECTIVE], [STYLE_KEY$1.TEXT_STROKE_WIDTH]]; - var KEY_GRADIENT = [[STYLE_KEY$1.BACKGROUND_IMAGE], [STYLE_KEY$1.FILL], [STYLE_KEY$1.STROKE]]; - var KEY_RADIUS = [[STYLE_KEY$1.BORDER_TOP_LEFT_RADIUS], [STYLE_KEY$1.BORDER_TOP_RIGHT_RADIUS], [STYLE_KEY$1.BORDER_BOTTOM_RIGHT_RADIUS], [STYLE_KEY$1.BORDER_BOTTOM_LEFT_RADIUS]]; - var COLOR_HASH = {}; + var STYLE_KEY$4 = enums.STYLE_KEY; + var KEY_COLOR = [[STYLE_KEY$4.BACKGROUND_COLOR], [STYLE_KEY$4.BORDER_BOTTOM_COLOR], [STYLE_KEY$4.BORDER_LEFT_COLOR], [STYLE_KEY$4.BORDER_RIGHT_COLOR], [STYLE_KEY$4.BORDER_TOP_COLOR], [STYLE_KEY$4.COLOR], [STYLE_KEY$4.TEXT_STROKE_COLOR]]; + var KEY_LENGTH = [[STYLE_KEY$4.FONT_SIZE], [STYLE_KEY$4.BORDER_BOTTOM_WIDTH], [STYLE_KEY$4.BORDER_LEFT_WIDTH], [STYLE_KEY$4.BORDER_RIGHT_WIDTH], [STYLE_KEY$4.BORDER_TOP_WIDTH], [STYLE_KEY$4.LEFT], [STYLE_KEY$4.TOP], [STYLE_KEY$4.RIGHT], [STYLE_KEY$4.BOTTOM], [STYLE_KEY$4.FLEX_BASIS], [STYLE_KEY$4.WIDTH], [STYLE_KEY$4.HEIGHT], [STYLE_KEY$4.LINE_HEIGHT], [STYLE_KEY$4.MARGIN_BOTTOM], [STYLE_KEY$4.MARGIN_LEFT], [STYLE_KEY$4.MARGIN_TOP], [STYLE_KEY$4.MARGIN_RIGHT], [STYLE_KEY$4.PADDING_TOP], [STYLE_KEY$4.PADDING_RIGHT], [STYLE_KEY$4.PADDING_BOTTOM], [STYLE_KEY$4.PADDING_LEFT], [STYLE_KEY$4.STROKE_WIDTH], [STYLE_KEY$4.STROKE_MITERLIMIT], [STYLE_KEY$4.LETTER_SPACING], [STYLE_KEY$4.PERSPECTIVE], [STYLE_KEY$4.TEXT_STROKE_WIDTH]]; + var KEY_GRADIENT = [[STYLE_KEY$4.BACKGROUND_IMAGE], [STYLE_KEY$4.FILL], [STYLE_KEY$4.STROKE]]; + var KEY_RADIUS = [[STYLE_KEY$4.BORDER_TOP_LEFT_RADIUS], [STYLE_KEY$4.BORDER_TOP_RIGHT_RADIUS], [STYLE_KEY$4.BORDER_BOTTOM_RIGHT_RADIUS], [STYLE_KEY$4.BORDER_BOTTOM_LEFT_RADIUS]]; + var COLOR_HASH$2 = {}; KEY_COLOR.forEach(function (k) { - COLOR_HASH[k] = true; + COLOR_HASH$2[k] = true; }); - var LENGTH_HASH = {}; + var LENGTH_HASH$2 = {}; KEY_LENGTH.forEach(function (k) { - LENGTH_HASH[k] = true; + LENGTH_HASH$2[k] = true; }); - var RADIUS_HASH = {}; + var RADIUS_HASH$2 = {}; KEY_RADIUS.forEach(function (k) { - RADIUS_HASH[k] = true; + RADIUS_HASH$2[k] = true; }); - var GRADIENT_HASH = {}; + var GRADIENT_HASH$2 = {}; KEY_GRADIENT.forEach(function (k) { - GRADIENT_HASH[k] = true; + GRADIENT_HASH$2[k] = true; }); - var GRADIENT_TYPE = { + var GRADIENT_TYPE$2 = { linear: true, radial: true, conic: true }; - var KEY_EXPAND = [[STYLE_KEY$1.TRANSLATE_X], [STYLE_KEY$1.TRANSLATE_Y], [STYLE_KEY$1.TRANSLATE_Z], [STYLE_KEY$1.SKEW_X], [STYLE_KEY$1.SKEW_Y], [STYLE_KEY$1.SCALE_X], [STYLE_KEY$1.SCALE_Y], [STYLE_KEY$1.SCALE_Z], [STYLE_KEY$1.ROTATE_X], [STYLE_KEY$1.ROTATE_Y], [STYLE_KEY$1.ROTATE_Z]]; - var EXPAND_HASH = {}; + var KEY_EXPAND = [[STYLE_KEY$4.TRANSLATE_X], [STYLE_KEY$4.TRANSLATE_Y], [STYLE_KEY$4.TRANSLATE_Z], [STYLE_KEY$4.SKEW_X], [STYLE_KEY$4.SKEW_Y], [STYLE_KEY$4.SCALE_X], [STYLE_KEY$4.SCALE_Y], [STYLE_KEY$4.SCALE_Z], [STYLE_KEY$4.ROTATE_X], [STYLE_KEY$4.ROTATE_Y], [STYLE_KEY$4.ROTATE_Z]]; + var EXPAND_HASH$2 = {}; KEY_EXPAND.forEach(function (k) { - EXPAND_HASH[k] = true; + EXPAND_HASH$2[k] = true; }); var key = { KEY_COLOR: KEY_COLOR, @@ -7737,31 +7738,31 @@ KEY_GRADIENT: KEY_GRADIENT, KEY_LENGTH: KEY_LENGTH, KEY_RADIUS: KEY_RADIUS, - COLOR_HASH: COLOR_HASH, - EXPAND_HASH: EXPAND_HASH, - GRADIENT_HASH: GRADIENT_HASH, - LENGTH_HASH: LENGTH_HASH, - RADIUS_HASH: RADIUS_HASH, - GRADIENT_TYPE: GRADIENT_TYPE + COLOR_HASH: COLOR_HASH$2, + EXPAND_HASH: EXPAND_HASH$2, + GRADIENT_HASH: GRADIENT_HASH$2, + LENGTH_HASH: LENGTH_HASH$2, + RADIUS_HASH: RADIUS_HASH$2, + GRADIENT_TYPE: GRADIENT_TYPE$2 }; var _REPAINT, _MEASURE; 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 INHERIT$4 = o$4.INHERIT; + var STYLE_KEY$3 = enums.STYLE_KEY; + var GEOM$3 = {}; var GEOM_KEY_SET$1 = []; - var IGNORE = _defineProperty({}, STYLE_KEY$2.POINTER_EVENTS, true); + var IGNORE = _defineProperty({}, STYLE_KEY$3.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 REPAINT$3 = (_REPAINT = {}, _defineProperty(_REPAINT, STYLE_KEY$3.TRANSFORM, true), _defineProperty(_REPAINT, STYLE_KEY$3.TRANSLATE_X, true), _defineProperty(_REPAINT, STYLE_KEY$3.TRANSLATE_Y, true), _defineProperty(_REPAINT, STYLE_KEY$3.SKEW_X, true), _defineProperty(_REPAINT, STYLE_KEY$3.SKEW_Y, true), _defineProperty(_REPAINT, STYLE_KEY$3.SCALE_X, true), _defineProperty(_REPAINT, STYLE_KEY$3.SCALE_Y, true), _defineProperty(_REPAINT, STYLE_KEY$3.ROTATE_Z, true), _defineProperty(_REPAINT, STYLE_KEY$3.COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$3.FONT_STYLE, true), _defineProperty(_REPAINT, STYLE_KEY$3.STROKE_WIDTH, true), _defineProperty(_REPAINT, STYLE_KEY$3.FILL, true), _defineProperty(_REPAINT, STYLE_KEY$3.STROKE_DASHARRAY, true), _defineProperty(_REPAINT, STYLE_KEY$3.STROKE_LINECAP, true), _defineProperty(_REPAINT, STYLE_KEY$3.STROKE_LINEJOIN, true), _defineProperty(_REPAINT, STYLE_KEY$3.STROKE_MITERLIMIT, true), _defineProperty(_REPAINT, STYLE_KEY$3.BACKGROUND_COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$3.BACKGROUND_IMAGE, true), _defineProperty(_REPAINT, STYLE_KEY$3.BACKGROUND_POSITION_X, true), _defineProperty(_REPAINT, STYLE_KEY$3.BACKGROUND_POSITION_Y, true), _defineProperty(_REPAINT, STYLE_KEY$3.BACKGROUND_REPEAT, true), _defineProperty(_REPAINT, STYLE_KEY$3.BACKGROUND_SIZE, true), _defineProperty(_REPAINT, STYLE_KEY$3.STROKE, true), _defineProperty(_REPAINT, STYLE_KEY$3.BORDER_BOTTOM_COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$3.BORDER_LEFT_COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$3.BORDER_RIGHT_COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$3.BORDER_TOP_COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$3.BORDER_TOP_LEFT_RADIUS, true), _defineProperty(_REPAINT, STYLE_KEY$3.BORDER_TOP_RIGHT_RADIUS, true), _defineProperty(_REPAINT, STYLE_KEY$3.BORDER_BOTTOM_RIGHT_RADIUS, true), _defineProperty(_REPAINT, STYLE_KEY$3.BORDER_BOTTOM_LEFT_RADIUS, true), _defineProperty(_REPAINT, STYLE_KEY$3.VISIBILITY, true), _defineProperty(_REPAINT, STYLE_KEY$3.OPACITY, true), _defineProperty(_REPAINT, STYLE_KEY$3.Z_INDEX, true), _defineProperty(_REPAINT, STYLE_KEY$3.FILTER, true), _defineProperty(_REPAINT, STYLE_KEY$3.BOX_SHADOW, true), _defineProperty(_REPAINT, STYLE_KEY$3.OVERFLOW, true), _defineProperty(_REPAINT, STYLE_KEY$3.BACKGROUND_CLIP, true), _defineProperty(_REPAINT, STYLE_KEY$3.TEXT_STROKE_WIDTH, true), _defineProperty(_REPAINT, STYLE_KEY$3.TEXT_STROKE_COLOR, true), _defineProperty(_REPAINT, STYLE_KEY$3.TEXT_STROKE_OVER, true), _REPAINT); + var MEASURE = (_MEASURE = {}, _defineProperty(_MEASURE, STYLE_KEY$3.FONT_SIZE, true), _defineProperty(_MEASURE, STYLE_KEY$3.FONT_WEIGHT, true), _defineProperty(_MEASURE, STYLE_KEY$3.FONT_FAMILY, true), _MEASURE); var o$2 = { - GEOM: GEOM$1, + GEOM: GEOM$3, GEOM_KEY_SET: GEOM_KEY_SET$1, IGNORE: IGNORE, - REPAINT: REPAINT, + REPAINT: REPAINT$3, MEASURE: MEASURE, addGeom: function addGeom(tagName, ks, cb) { if (Array.isArray(ks)) { @@ -7769,11 +7770,11 @@ o$2.addGeom(tagName, k, cb); }); } else if (ks) { - if (!GEOM$1.hasOwnProperty(ks)) { + if (!GEOM$3.hasOwnProperty(ks)) { GEOM_KEY_SET$1.push(ks); } - var hash = GEOM$1[ks] = GEOM$1[ks] || {}; + var hash = GEOM$3[ks] = GEOM$3[ks] || {}; hash[tagName] = cb || true; } } @@ -7783,14 +7784,14 @@ return IGNORE.hasOwnProperty(k); }; - function isGeom(tagName, k) { - return GEOM$1.hasOwnProperty(k) && GEOM$1[k].hasOwnProperty(tagName); + function isGeom$3(tagName, k) { + return GEOM$3.hasOwnProperty(k) && GEOM$3[k].hasOwnProperty(tagName); } - o$2.isGeom = isGeom; + o$2.isGeom = isGeom$3; o$2.isRepaint = function (k) { - return REPAINT.hasOwnProperty(k) || isGeom(k); + return REPAINT$3.hasOwnProperty(k) || isGeom$3(k); }; o$2.isMeasure = function (k) { @@ -7811,8 +7812,8 @@ return true; } - if (GEOM$1.hasOwnProperty(k)) { - return GEOM$1[k].hasOwnProperty(tagName); + if (GEOM$3.hasOwnProperty(k)) { + return GEOM$3[k].hasOwnProperty(tagName); } if (k === 'translatePath') { @@ -7822,17 +7823,17 @@ return false; }; - var MEASURE_KEY_SET = o$2.MEASURE_KEY_SET = Object.keys(MEASURE).map(function (i) { + var MEASURE_KEY_SET$1 = o$2.MEASURE_KEY_SET = Object.keys(MEASURE).map(function (i) { return parseInt(i); }); - var len = MEASURE_KEY_SET.length; + var len = MEASURE_KEY_SET$1.length; o$2.isMeasureInherit = function (target) { if (target) { for (var i = 0; i < len; i++) { - var k = MEASURE_KEY_SET[i]; + var k = MEASURE_KEY_SET$1[i]; - if (target.hasOwnProperty(k) && target[k][1] === INHERIT$1) { + if (target.hasOwnProperty(k) && target[k][1] === INHERIT$4) { return true; } } @@ -7845,9 +7846,9 @@ var list = []; for (var i = 0; i < len; i++) { - var k = MEASURE_KEY_SET[i]; + var k = MEASURE_KEY_SET$1[i]; - if (target.hasOwnProperty(k) && target[k][1] === INHERIT$1) { + if (target.hasOwnProperty(k) && target[k][1] === INHERIT$4) { list.push(k); } } @@ -7864,95 +7865,95 @@ o$2.addGeom('$polygon', ['points', 'controls', 'start', 'end']); var _VALUE, _ARRAY_, _ARRAY_0_; - var STYLE_KEY$3 = enums.STYLE_KEY, + var STYLE_KEY$2 = 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; - var AUTO = o.AUTO, - PX$2 = o.PX, - PERCENT$2 = o.PERCENT, - NUMBER$1 = o.NUMBER, - INHERIT$2 = o.INHERIT, - DEG$1 = o.DEG, - RGBA = o.RGBA, - STRING = o.STRING, - REM$2 = o.REM, - VW$2 = o.VW, - VH$2 = o.VH, - calUnit$1 = o.calUnit; - var isNil$3 = util.isNil, - rgba2int$2 = util.rgba2int, + _enums$STYLE_KEY$n = enums.STYLE_KEY, + POSITION$5 = _enums$STYLE_KEY$n.POSITION, + WIDTH$7 = _enums$STYLE_KEY$n.WIDTH, + HEIGHT$7 = _enums$STYLE_KEY$n.HEIGHT, + TRANSLATE_X$4 = _enums$STYLE_KEY$n.TRANSLATE_X, + TRANSLATE_Y$4 = _enums$STYLE_KEY$n.TRANSLATE_Y, + TRANSLATE_Z$4 = _enums$STYLE_KEY$n.TRANSLATE_Z, + SCALE_X$3 = _enums$STYLE_KEY$n.SCALE_X, + SCALE_Y$3 = _enums$STYLE_KEY$n.SCALE_Y, + SCALE_Z$2 = _enums$STYLE_KEY$n.SCALE_Z, + SKEW_X$2 = _enums$STYLE_KEY$n.SKEW_X, + SKEW_Y$2 = _enums$STYLE_KEY$n.SKEW_Y, + ROTATE_X$2 = _enums$STYLE_KEY$n.ROTATE_X, + ROTATE_Y$2 = _enums$STYLE_KEY$n.ROTATE_Y, + ROTATE_Z$2 = _enums$STYLE_KEY$n.ROTATE_Z, + ROTATE_3D$3 = _enums$STYLE_KEY$n.ROTATE_3D, + PERSPECTIVE$5 = _enums$STYLE_KEY$n.PERSPECTIVE, + PERSPECTIVE_ORIGIN$4 = _enums$STYLE_KEY$n.PERSPECTIVE_ORIGIN, + TRANSFORM$4 = _enums$STYLE_KEY$n.TRANSFORM, + TRANSFORM_ORIGIN$4 = _enums$STYLE_KEY$n.TRANSFORM_ORIGIN, + BACKGROUND_IMAGE$2 = _enums$STYLE_KEY$n.BACKGROUND_IMAGE, + BACKGROUND_COLOR$2 = _enums$STYLE_KEY$n.BACKGROUND_COLOR, + BACKGROUND_POSITION_X$3 = _enums$STYLE_KEY$n.BACKGROUND_POSITION_X, + BACKGROUND_POSITION_Y$3 = _enums$STYLE_KEY$n.BACKGROUND_POSITION_Y, + BACKGROUND_SIZE$2 = _enums$STYLE_KEY$n.BACKGROUND_SIZE, + OPACITY$5 = _enums$STYLE_KEY$n.OPACITY, + Z_INDEX$4 = _enums$STYLE_KEY$n.Z_INDEX, + COLOR$5 = _enums$STYLE_KEY$n.COLOR, + FONT_SIZE$f = _enums$STYLE_KEY$n.FONT_SIZE, + FONT_FAMILY$4 = _enums$STYLE_KEY$n.FONT_FAMILY, + FONT_WEIGHT$4 = _enums$STYLE_KEY$n.FONT_WEIGHT, + FONT_STYLE$4 = _enums$STYLE_KEY$n.FONT_STYLE, + LINE_HEIGHT$4 = _enums$STYLE_KEY$n.LINE_HEIGHT, + TEXT_ALIGN$2 = _enums$STYLE_KEY$n.TEXT_ALIGN, + FILTER$6 = _enums$STYLE_KEY$n.FILTER, + VISIBILITY$7 = _enums$STYLE_KEY$n.VISIBILITY, + BOX_SHADOW$9 = _enums$STYLE_KEY$n.BOX_SHADOW, + POINTER_EVENTS$2 = _enums$STYLE_KEY$n.POINTER_EVENTS, + FILL$2 = _enums$STYLE_KEY$n.FILL, + STROKE$1 = _enums$STYLE_KEY$n.STROKE, + STROKE_WIDTH$7 = _enums$STYLE_KEY$n.STROKE_WIDTH, + STROKE_DASHARRAY$1 = _enums$STYLE_KEY$n.STROKE_DASHARRAY, + BORDER_TOP_WIDTH$5 = _enums$STYLE_KEY$n.BORDER_TOP_WIDTH, + BORDER_RIGHT_WIDTH$6 = _enums$STYLE_KEY$n.BORDER_RIGHT_WIDTH, + BORDER_BOTTOM_WIDTH$5 = _enums$STYLE_KEY$n.BORDER_BOTTOM_WIDTH, + BORDER_LEFT_WIDTH$7 = _enums$STYLE_KEY$n.BORDER_LEFT_WIDTH, + DISPLAY$a = _enums$STYLE_KEY$n.DISPLAY, + FLEX_DIRECTION$2 = _enums$STYLE_KEY$n.FLEX_DIRECTION, + FLEX_GROW$1 = _enums$STYLE_KEY$n.FLEX_GROW, + FLEX_SHRINK$1 = _enums$STYLE_KEY$n.FLEX_SHRINK, + FLEX_BASIS$4 = _enums$STYLE_KEY$n.FLEX_BASIS, + JUSTIFY_CONTENT$1 = _enums$STYLE_KEY$n.JUSTIFY_CONTENT, + ALIGN_SELF$1 = _enums$STYLE_KEY$n.ALIGN_SELF, + ALIGN_ITEMS$1 = _enums$STYLE_KEY$n.ALIGN_ITEMS, + MATRIX$3 = _enums$STYLE_KEY$n.MATRIX, + LETTER_SPACING$2 = _enums$STYLE_KEY$n.LETTER_SPACING, + BACKGROUND_CLIP$2 = _enums$STYLE_KEY$n.BACKGROUND_CLIP, + WHITE_SPACE$2 = _enums$STYLE_KEY$n.WHITE_SPACE, + TEXT_OVERFLOW$2 = _enums$STYLE_KEY$n.TEXT_OVERFLOW, + LINE_CLAMP$1 = _enums$STYLE_KEY$n.LINE_CLAMP, + ORDER$1 = _enums$STYLE_KEY$n.ORDER, + FLEX_WRAP$1 = _enums$STYLE_KEY$n.FLEX_WRAP, + ALIGN_CONTENT$1 = _enums$STYLE_KEY$n.ALIGN_CONTENT, + TRANSLATE_PATH$1 = _enums$STYLE_KEY$n.TRANSLATE_PATH, + TEXT_STROKE_COLOR$4 = _enums$STYLE_KEY$n.TEXT_STROKE_COLOR, + TEXT_STROKE_WIDTH$3 = _enums$STYLE_KEY$n.TEXT_STROKE_WIDTH, + TEXT_STROKE_OVER$3 = _enums$STYLE_KEY$n.TEXT_STROKE_OVER; + var AUTO$8 = o$4.AUTO, + PX$9 = o$4.PX, + PERCENT$a = o$4.PERCENT, + NUMBER$4 = o$4.NUMBER, + INHERIT$3 = o$4.INHERIT, + DEG$1 = o$4.DEG, + RGBA$2 = o$4.RGBA, + STRING$2 = o$4.STRING, + REM$e = o$4.REM, + VW$e = o$4.VW, + VH$e = o$4.VH, + calUnit$1 = o$4.calUnit; + var isNil$c = util.isNil, + rgba2int$1 = util.rgba2int, equalArr$1 = util.equalArr; - var MEASURE_KEY_SET$1 = o$2.MEASURE_KEY_SET, - isGeom$1 = o$2.isGeom, + var MEASURE_KEY_SET = o$2.MEASURE_KEY_SET, + isGeom$2 = o$2.isGeom, GEOM$2 = o$2.GEOM, - GEOM_KEY_SET$2 = o$2.GEOM_KEY_SET; + GEOM_KEY_SET = o$2.GEOM_KEY_SET; var COLOR_HASH$1 = key.COLOR_HASH, LENGTH_HASH$1 = key.LENGTH_HASH, RADIUS_HASH$1 = key.RADIUS_HASH, @@ -7960,33 +7961,33 @@ EXPAND_HASH$1 = key.EXPAND_HASH, GRADIENT_TYPE$1 = key.GRADIENT_TYPE; var TRANSFORM_HASH = { - translateX: TRANSLATE_X, - translateY: TRANSLATE_Y, - translateZ: TRANSLATE_Z, - scaleX: SCALE_X, - scaleY: SCALE_Y, - scaleZ: SCALE_Z, - skewX: SKEW_X, - skewY: SKEW_Y, - rotateX: ROTATE_X, - rotateY: ROTATE_Y, - rotateZ: ROTATE_Z, - rotate: ROTATE_Z + translateX: TRANSLATE_X$4, + translateY: TRANSLATE_Y$4, + translateZ: TRANSLATE_Z$4, + scaleX: SCALE_X$3, + scaleY: SCALE_Y$3, + scaleZ: SCALE_Z$2, + skewX: SKEW_X$2, + skewY: SKEW_Y$2, + rotateX: ROTATE_X$2, + rotateY: ROTATE_Y$2, + rotateZ: ROTATE_Z$2, + rotate: ROTATE_Z$2 }; function compatibleTransform(k, arr) { - if (k === SCALE_X || k === SCALE_Y || k === SCALE_Z) { - arr[1] = NUMBER$1; - } else if (k === TRANSLATE_X || k === TRANSLATE_Y || k === TRANSLATE_Z) { - if (arr[1] === NUMBER$1) { - arr[1] = PX$2; + if (k === SCALE_X$3 || k === SCALE_Y$3 || k === SCALE_Z$2) { + arr[1] = NUMBER$4; + } else if (k === TRANSLATE_X$4 || k === TRANSLATE_Y$4 || k === TRANSLATE_Z$4) { + if (arr[1] === NUMBER$4) { + arr[1] = PX$9; } - } else if (k === PERSPECTIVE) { - if ([NUMBER$1, PERCENT$2, DEG$1].indexOf(arr[1]) > -1) { - arr[1] = PX$2; + } else if (k === PERSPECTIVE$5) { + if ([NUMBER$4, PERCENT$a, DEG$1].indexOf(arr[1]) > -1) { + arr[1] = PX$9; } } else { - if (arr[1] === NUMBER$1) { + if (arr[1] === NUMBER$4) { arr[1] = DEG$1; } } @@ -7999,7 +8000,7 @@ */ - function normalize(style) { + function normalize$1(style) { var reset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; if (!util.isObject(style)) { @@ -8013,94 +8014,94 @@ var temp = style.border; if (temp) { - abbr.toFull(style, 'border'); + abbr$1.toFull(style, 'border'); } ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'].forEach(function (k) { - abbr.toFull(style, k); + abbr$1.toFull(style, k); }); temp = style.borderWidth; if (temp) { - abbr.toFull(style, 'borderWidth'); + abbr$1.toFull(style, 'borderWidth'); } temp = style.borderColor; if (temp) { - abbr.toFull(style, 'borderColor'); + abbr$1.toFull(style, 'borderColor'); } temp = style.borderStyle; if (temp) { - abbr.toFull(style, 'borderStyle'); + abbr$1.toFull(style, 'borderStyle'); } temp = style.borderRadius; if (temp) { - abbr.toFull(style, 'borderRadius'); + abbr$1.toFull(style, 'borderRadius'); } temp = style.background; // 处理渐变背景缩写 if (temp) { - abbr.toFull(style, 'background'); + abbr$1.toFull(style, 'background'); } // 背景位置 temp = style.backgroundPosition; - if (!isNil$3(temp)) { - abbr.toFull(style, 'backgroundPosition'); + if (!isNil$c(temp)) { + abbr$1.toFull(style, 'backgroundPosition'); } // flex temp = style.flex; if (temp) { - abbr.toFull(style, 'flex'); + abbr$1.toFull(style, 'flex'); } // flex-flow temp = style.flexFlow; if (temp) { - abbr.toFull(style, 'flexFlow'); + abbr$1.toFull(style, 'flexFlow'); } temp = style.margin; - if (!isNil$3(temp)) { - abbr.toFull(style, 'margin'); + if (!isNil$c(temp)) { + abbr$1.toFull(style, 'margin'); } temp = style.padding; - if (!isNil$3(temp)) { - abbr.toFull(style, 'padding'); + if (!isNil$c(temp)) { + abbr$1.toFull(style, 'padding'); } temp = style.textStroke; if (temp) { - abbr.toFull(style, 'textStroke'); + abbr$1.toFull(style, 'textStroke'); } // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform ['translate', 'scale', 'skew', 'translate3d', 'scale3d', 'rotate'].forEach(function (k) { temp = style[k]; - if (!isNil$3(temp)) { - abbr.toFull(style, k); + if (!isNil$c(temp)) { + abbr$1.toFull(style, k); } }); // 扩展的不能和transform混用,给出警告 ['translateX', 'translateY', 'translateZ', 'scaleX', 'scaleY', 'scaleZ', 'skewX', 'skewY', 'rotateX', 'rotateY', 'rotateZ', 'rotate3d'].forEach(function (k) { var v = style[k]; - if (!isNil$3(v) && style.transform) { + if (!isNil$c(v) && style.transform) { inject.warn("Can not use expand style \"".concat(k, "\" with transform")); } }); // 默认reset,根据传入不同,当style为空时覆盖 @@ -8109,7 +8110,7 @@ var k = item.k, v = item.v; - if (isNil$3(style[k])) { + if (isNil$c(style[k])) { style[k] = v; } }); // 背景图 @@ -8118,15 +8119,15 @@ if (temp !== undefined) { if (!temp) { - res[BACKGROUND_IMAGE] = [null]; + res[BACKGROUND_IMAGE$2] = [null]; } else if (Array.isArray(temp)) { - res[BACKGROUND_IMAGE] = temp.map(function (item) { + res[BACKGROUND_IMAGE$2] = temp.map(function (item) { if (!item) { return null; } if (reg.gradient.test(item)) { - return gradient$1.parseGradient(item); + return gradient.parseGradient(item); } if (reg.img.test(item)) { @@ -8137,12 +8138,12 @@ }); } // 区分是渐变色还是图 else if (reg.gradient.test(temp)) { - res[BACKGROUND_IMAGE] = [gradient$1.parseGradient(temp)]; - } else if (reg.img.test(temp)) { - res[BACKGROUND_IMAGE] = [reg.img.exec(temp)[2]]; - } else { - res[BACKGROUND_IMAGE] = [null]; - } + res[BACKGROUND_IMAGE$2] = [gradient.parseGradient(temp)]; + } else if (reg.img.test(temp)) { + res[BACKGROUND_IMAGE$2] = [reg.img.exec(temp)[2]]; + } else { + res[BACKGROUND_IMAGE$2] = [null]; + } } temp = style.backgroundColor; @@ -8152,18 +8153,18 @@ var bgc = /^#[0-9a-f]{3,8}/i.exec(temp); if (bgc && [4, 7, 9].indexOf(bgc[0].length) > -1) { - res[BACKGROUND_COLOR] = [rgba2int$2(bgc[0]), RGBA]; + res[BACKGROUND_COLOR$2] = [rgba2int$1(bgc[0]), RGBA$2]; } else { bgc = /rgba?\s*\(.+\)/i.exec(temp); - res[BACKGROUND_COLOR] = [rgba2int$2(bgc ? bgc[0] : [0, 0, 0, 0]), RGBA]; + res[BACKGROUND_COLOR$2] = [rgba2int$1(bgc ? bgc[0] : [0, 0, 0, 0]), RGBA$2]; } } ['backgroundPositionX', 'backgroundPositionY'].forEach(function (k, i) { temp = style[k]; - if (!isNil$3(temp)) { - k = i ? BACKGROUND_POSITION_Y : BACKGROUND_POSITION_X; + if (!isNil$c(temp)) { + k = i ? BACKGROUND_POSITION_Y$3 : BACKGROUND_POSITION_X$3; if (!Array.isArray(temp)) { temp = [temp]; @@ -8173,8 +8174,8 @@ if (/^[-+]?[\d.]/.test(item)) { var v = calUnit$1(item); - if ([NUMBER$1, DEG$1].indexOf(v[1]) > -1) { - v[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(v[1]) > -1) { + v[1] = PX$9; } return v; @@ -8185,7 +8186,7 @@ center: 50, right: 100, bottom: 100 - }[item] || 0, PERCENT$2]; + }[item] || 0, PERCENT$a]; } }); } @@ -8198,9 +8199,9 @@ temp = [temp]; } - res[BACKGROUND_SIZE] = temp.map(function (item) { + res[BACKGROUND_SIZE$2] = temp.map(function (item) { if (!item) { - return [[0, AUTO], [0, AUTO]]; + return [[0, AUTO$8], [0, AUTO$8]]; } var match = item.toString().match(/\b(?:([-+]?[\d.]+[pxremvwh%]*)|(contain|cover|auto))/ig); @@ -8222,21 +8223,21 @@ if (/^[-+]?[\d.]/.test(_item)) { var n = calUnit$1(_item); - if ([NUMBER$1, DEG$1].indexOf(n[1]) > -1) { - n[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(n[1]) > -1) { + n[1] = PX$9; } v.push(n); } else if (_item === 'contain' || _item === 'cover') { - v.push([_item, STRING]); + v.push([_item, STRING$2]); } else { - v.push([0, AUTO]); + v.push([0, AUTO$8]); } } return v; } else { - return [[0, AUTO], [0, AUTO]]; + return [[0, AUTO$8], [0, AUTO$8]]; } }); } // border-color @@ -8246,8 +8247,8 @@ k = 'border' + k + 'Color'; var v = style[k]; - if (!isNil$3(v)) { - res[STYLE_KEY$3[style2Upper$1(k)]] = [rgba2int$2(v), RGBA]; + if (!isNil$c(v)) { + res[STYLE_KEY$2[style2Upper$1(k)]] = [rgba2int$1(v), RGBA$2]; } }); // border-radius @@ -8255,7 +8256,7 @@ k = 'border' + k + 'Radius'; var v = style[k]; - if (!isNil$3(v)) { + if (!isNil$c(v)) { var arr = v.toString().split(/\s+/); if (arr.length === 1) { @@ -8268,8 +8269,8 @@ if (/^[-+]?[\d.]/.test(item)) { var n = calUnit$1(item); - if ([NUMBER$1, DEG$1].indexOf(n[1]) > -1) { - n[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(n[1]) > -1) { + n[1] = PX$9; } if (n[0] < 0) { @@ -8278,17 +8279,17 @@ arr[i] = n; } else { - arr[i] = [0, PX$2]; + arr[i] = [0, PX$9]; } } - res[STYLE_KEY$3[style2Upper$1(k)]] = arr; + res[STYLE_KEY$2[style2Upper$1(k)]] = arr; } }); temp = style.transform; if (temp) { - var transform = res[TRANSFORM] = []; + var transform = res[TRANSFORM$4] = []; var match = (temp || '').toString().match(/\w+\(.+?\)/g); if (match) { @@ -8308,7 +8309,7 @@ } if (arr.length === 6) { - transform.push([MATRIX, [arr[0], arr[1], 0, 0, arr[2], arr[3], 0, 0, 0, 0, 1, 0, arr[4], arr[5], 0, 1]]); + transform.push([MATRIX$3, [arr[0], arr[1], 0, 0, arr[2], arr[3], 0, 0, 0, 0, 1, 0, arr[4], arr[5], 0, 1]]); } } else if (k === 'matrix3d') { var _arr = v.toString().split(/\s*,\s*/); @@ -8322,7 +8323,7 @@ } if (_arr.length === 16) { - transform.push([MATRIX, _arr]); + transform.push([MATRIX$3, _arr]); } } else if (k === 'perspective') { var _arr2 = calUnit$1(v); @@ -8331,19 +8332,19 @@ _arr2[0] = 0; } - compatibleTransform(PERSPECTIVE, _arr2); - transform.push([PERSPECTIVE, _arr2]); + compatibleTransform(PERSPECTIVE$5, _arr2); + transform.push([PERSPECTIVE$5, _arr2]); } else if (k === 'rotate3d') { var _arr3 = v.toString().split(/\s*,\s*/); if (_arr3.length === 4) { var deg = calUnit$1(_arr3[3]); - compatibleTransform(ROTATE_3D, deg); + compatibleTransform(ROTATE_3D$3, deg); _arr3[0] = parseFloat(_arr3[0]); _arr3[1] = parseFloat(_arr3[1]); _arr3[2] = parseFloat(_arr3[2]); _arr3[3] = deg; - transform.push([ROTATE_3D, _arr3]); + transform.push([ROTATE_3D$3, _arr3]); } } else if (TRANSFORM_HASH.hasOwnProperty(k)) { var k2 = TRANSFORM_HASH[k]; @@ -8364,8 +8365,8 @@ } if (_arr5.length === 2) { - var k1 = STYLE_KEY$3[style2Upper$1(k + 'X')]; - var _k = STYLE_KEY$3[style2Upper$1(k + 'Y')]; + var k1 = STYLE_KEY$2[style2Upper$1(k + 'X')]; + var _k = STYLE_KEY$2[style2Upper$1(k + 'Y')]; var arr1 = calUnit$1(_arr5[0]); var arr2 = calUnit$1(_arr5[1]); compatibleTransform(k1, arr1); @@ -8387,9 +8388,9 @@ } if (_arr6.length === 3) { - var _k2 = STYLE_KEY$3[style2Upper$1(k + 'X')]; - var _k3 = STYLE_KEY$3[style2Upper$1(k + 'Y')]; - var k3 = STYLE_KEY$3[style2Upper$1(k + 'Z')]; + var _k2 = STYLE_KEY$2[style2Upper$1(k + 'X')]; + var _k3 = STYLE_KEY$2[style2Upper$1(k + 'Y')]; + var k3 = STYLE_KEY$2[style2Upper$1(k + 'Z')]; var _arr7 = calUnit$1(_arr6[0]); @@ -8410,22 +8411,22 @@ temp = style.perspective; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { var arr = calUnit$1(temp); if (arr[0] < 0) { arr[0] = 0; } - compatibleTransform(PERSPECTIVE, arr); - res[PERSPECTIVE] = arr; + compatibleTransform(PERSPECTIVE$5, arr); + res[PERSPECTIVE$5] = arr; } ['perspectiveOrigin', 'transformOrigin'].forEach(function (k) { temp = style[k]; - if (!isNil$3(temp)) { - var _arr9 = res[STYLE_KEY$3[style2Upper$1(k)]] = []; + if (!isNil$c(temp)) { + var _arr9 = res[STYLE_KEY$2[style2Upper$1(k)]] = []; var _match = temp.toString().match(reg.position); @@ -8440,8 +8441,8 @@ if (/^[-+]?[\d.]/.test(item)) { var n = calUnit$1(item); - if ([NUMBER$1, DEG$1].indexOf(n[1]) > -1) { - n[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(n[1]) > -1) { + n[1] = PX$9; } _arr9.push(n); @@ -8452,25 +8453,25 @@ center: 50, right: 100, bottom: 100 - }[item], PERCENT$2]); // 不规范的写法变默认值50% + }[item], PERCENT$a]); // 不规范的写法变默认值50% - if (isNil$3(_arr9[i][0])) { + if (isNil$c(_arr9[i][0])) { _arr9[i][0] = 50; } } } } else { - _arr9.push([50, PERCENT$2]); + _arr9.push([50, PERCENT$a]); - _arr9.push([50, PERCENT$2]); + _arr9.push([50, PERCENT$a]); } } }); ['translateX', 'translateY', 'translateZ', 'scaleX', 'scaleY', 'scaleZ', 'skewX', 'skewY', 'rotateX', 'rotateY', 'rotateZ', 'rotate'].forEach(function (k) { var v = style[k]; - if (isNil$3(v)) { + if (isNil$c(v)) { return; } @@ -8487,54 +8488,54 @@ if (_arr10.length === 4) { var deg = calUnit$1(_arr10[3]); - compatibleTransform(ROTATE_3D, deg); + compatibleTransform(ROTATE_3D$3, deg); _arr10[0] = parseFloat(_arr10[0]); _arr10[1] = parseFloat(_arr10[1]); _arr10[2] = parseFloat(_arr10[2]); _arr10[3] = deg; - res[ROTATE_3D] = _arr10; + res[ROTATE_3D$3] = _arr10; } } temp = style.opacity; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { temp = parseFloat(temp); if (!isNaN(temp)) { temp = Math.max(temp, 0); temp = Math.min(temp, 1); - res[OPACITY] = temp; + res[OPACITY$5] = temp; } else { - res[OPACITY] = 1; + res[OPACITY$5] = 1; } } temp = style.zIndex; - if (!isNil$3(temp)) { - res[Z_INDEX] = parseInt(temp) || 0; + if (!isNil$c(temp)) { + res[Z_INDEX$4] = parseInt(temp) || 0; } // 转化不同单位值为对象标准化,不写单位的变成number单位转化为px ['marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth', 'top', 'right', 'bottom', 'left', 'width', 'height'].forEach(function (k) { var v = style[k]; - if (isNil$3(v)) { + if (isNil$c(v)) { return; } if (v === 'auto') { - v = [0, AUTO]; + v = [0, AUTO$8]; } else { v = calUnit$1(v); // 无单位视为px - if ([NUMBER$1, DEG$1].indexOf(v[1]) > -1) { - v[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(v[1]) > -1) { + v[1] = PX$9; } } - var k2 = STYLE_KEY$3[style2Upper$1(k)]; + var k2 = STYLE_KEY$2[style2Upper$1(k)]; res[k2] = v; // 限制padding/border为正数 if ({ @@ -8554,44 +8555,44 @@ }); temp = style.flexBasis; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { if (temp === 'content') { - res[FLEX_BASIS] = [temp, STRING]; + res[FLEX_BASIS$4] = [temp, STRING$2]; } else if (/^[\d.]/.test(temp)) { - var v = res[FLEX_BASIS] = calUnit$1(temp); + var v = res[FLEX_BASIS$4] = calUnit$1(temp); v[0] = Math.max(v[0], 0); // 无单位视为px - if ([NUMBER$1, DEG$1].indexOf(v[1]) > -1) { - v[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(v[1]) > -1) { + v[1] = PX$9; } } else { - res[FLEX_BASIS] = [0, AUTO]; + res[FLEX_BASIS$4] = [0, AUTO$8]; } } temp = style.order; - if (!isNil$3(temp)) { - res[ORDER] = parseInt(temp) || 0; + if (!isNil$c(temp)) { + res[ORDER$1] = parseInt(temp) || 0; } temp = style.color; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { if (temp === 'inherit') { - res[COLOR] = [[], INHERIT$2]; + res[COLOR$5] = [[], INHERIT$3]; } else { - res[COLOR] = [rgba2int$2(temp), RGBA]; + res[COLOR$5] = [rgba2int$1(temp), RGBA$2]; } } temp = style.textStrokeColor; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { if (temp === 'inherit') { - res[TEXT_STROKE_COLOR] = [[], INHERIT$2]; + res[TEXT_STROKE_COLOR$4] = [[], INHERIT$3]; } else { - res[TEXT_STROKE_COLOR] = [rgba2int$2(temp), RGBA]; + res[TEXT_STROKE_COLOR$4] = [rgba2int$1(temp), RGBA$2]; } } @@ -8599,49 +8600,49 @@ if (temp || temp === 0) { if (temp === 'inherit') { - res[FONT_SIZE$2] = [0, INHERIT$2]; + res[FONT_SIZE$f] = [0, INHERIT$3]; } else { var _v = calUnit$1(temp); // fontSize不能为负数,否则为继承 if (_v < 0) { - res[FONT_SIZE$2] = [0, INHERIT$2]; + res[FONT_SIZE$f] = [0, INHERIT$3]; } else { - if ([NUMBER$1, DEG$1].indexOf(_v[1]) > -1) { - _v[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(_v[1]) > -1) { + _v[1] = PX$9; } - res[FONT_SIZE$2] = _v; + res[FONT_SIZE$f] = _v; } } } temp = style.textStrokeWidth; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { if (temp === 'inherit') { - res[TEXT_STROKE_WIDTH] = [0, INHERIT$2]; + res[TEXT_STROKE_WIDTH$3] = [0, INHERIT$3]; } else { var _v2 = calUnit$1(temp); // textStrokeWidth不能为负数,否则为继承 if (_v2 < 0) { - res[TEXT_STROKE_WIDTH] = [0, INHERIT$2]; + res[TEXT_STROKE_WIDTH$3] = [0, INHERIT$3]; } else { - if ([NUMBER$1, DEG$1, PERCENT$2].indexOf(_v2[1]) > -1) { - _v2[1] = PX$2; + if ([NUMBER$4, DEG$1, PERCENT$a].indexOf(_v2[1]) > -1) { + _v2[1] = PX$9; } - res[TEXT_STROKE_WIDTH] = _v2; + res[TEXT_STROKE_WIDTH$3] = _v2; } } } temp = style.textStrokeOver; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { if (temp === 'inherit') { - res[TEXT_STROKE_OVER] = [0, INHERIT$2]; + res[TEXT_STROKE_OVER$3] = [0, INHERIT$3]; } else { var _v3 = temp.toString(); @@ -8649,23 +8650,23 @@ _v3 = 'none'; } - res[TEXT_STROKE_OVER] = [_v3, STRING]; + res[TEXT_STROKE_OVER$3] = [_v3, STRING$2]; } } temp = style.fontWeight; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { if (temp === 'bold') { - res[FONT_WEIGHT] = [700, NUMBER$1]; + res[FONT_WEIGHT$4] = [700, NUMBER$4]; } else if (temp === 'normal') { - res[FONT_WEIGHT] = [400, NUMBER$1]; + res[FONT_WEIGHT$4] = [400, NUMBER$4]; } else if (temp === 'lighter') { - res[FONT_WEIGHT] = [200, NUMBER$1]; + res[FONT_WEIGHT$4] = [200, NUMBER$4]; } else if (temp === 'inherit') { - res[FONT_WEIGHT] = [0, INHERIT$2]; + res[FONT_WEIGHT$4] = [0, INHERIT$3]; } else { - res[FONT_WEIGHT] = [Math.max(0, parseInt(temp)) || 400, NUMBER$1]; + res[FONT_WEIGHT$4] = [Math.max(0, parseInt(temp)) || 400, NUMBER$4]; } } @@ -8673,9 +8674,9 @@ if (temp) { if (temp === 'inherit') { - res[FONT_STYLE] = [0, INHERIT$2]; + res[FONT_STYLE$4] = [0, INHERIT$3]; } else { - res[FONT_STYLE] = [temp, STRING]; + res[FONT_STYLE$4] = [temp, STRING$2]; } } @@ -8683,10 +8684,10 @@ if (temp) { if (temp === 'inherit') { - res[FONT_FAMILY] = [0, INHERIT$2]; + res[FONT_FAMILY$4] = [0, INHERIT$3]; } else { // 统一文字声明格式 - res[FONT_FAMILY] = [temp.toString().toLowerCase().replace(/['"]/, '').replace(/\s*,\s*/g, ','), STRING]; + res[FONT_FAMILY$4] = [temp.toString().toLowerCase().replace(/['"]/, '').replace(/\s*,\s*/g, ','), STRING$2]; } } @@ -8694,9 +8695,9 @@ if (temp) { if (temp === 'inherit') { - res[TEXT_ALIGN] = [0, INHERIT$2]; + res[TEXT_ALIGN$2] = [0, INHERIT$3]; } else { - res[TEXT_ALIGN] = [temp, STRING]; + res[TEXT_ALIGN$2] = [temp, STRING$2]; } } @@ -8704,46 +8705,46 @@ if (temp !== undefined) { if (temp === 'inherit') { - res[LINE_HEIGHT] = [0, INHERIT$2]; + res[LINE_HEIGHT$4] = [0, INHERIT$3]; } else if (temp === 'normal') { - res[LINE_HEIGHT] = [0, AUTO]; + res[LINE_HEIGHT$4] = [0, AUTO$8]; } // lineHeight默认数字,想要px必须强制带单位 else if (/^[\d.]+/i.test(temp)) { - var _v4 = calUnit$1(temp); + var _v4 = calUnit$1(temp); - if ([DEG$1].indexOf(_v4[1]) > -1) { - _v4[1] = NUMBER$1; - } + if ([DEG$1].indexOf(_v4[1]) > -1) { + _v4[1] = NUMBER$4; + } - res[LINE_HEIGHT] = _v4; - } else { - var n = Math.max(0, parseFloat(temp)) || 'normal'; // 非法数字 + res[LINE_HEIGHT$4] = _v4; + } else { + var n = Math.max(0, parseFloat(temp)) || 'normal'; // 非法数字 - if (n === 'normal') { - res[LINE_HEIGHT] = [null, AUTO]; - } else { - res[LINE_HEIGHT] = [n, NUMBER$1]; - } + if (n === 'normal') { + res[LINE_HEIGHT$4] = [null, AUTO$8]; + } else { + res[LINE_HEIGHT$4] = [n, NUMBER$4]; } + } } temp = style.letterSpacing; if (temp !== undefined) { if (temp === 'inherit') { - res[LETTER_SPACING] = [0, INHERIT$2]; + res[LETTER_SPACING$2] = [0, INHERIT$3]; } else if (temp === 'normal') { - res[LETTER_SPACING] = [0, PX$2]; + res[LETTER_SPACING$2] = [0, PX$9]; } else if (/^[-+]?[\d.]/.test(temp)) { var _v5 = calUnit$1(temp); - if ([NUMBER$1, DEG$1].indexOf(_v5[1]) > -1) { - _v5[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(_v5[1]) > -1) { + _v5[1] = PX$9; } - res[LETTER_SPACING] = _v5; + res[LETTER_SPACING$2] = _v5; } else { - res[LETTER_SPACING] = [parseFloat(temp) || 0, PX$2]; + res[LETTER_SPACING$2] = [parseFloat(temp) || 0, PX$9]; } } @@ -8751,9 +8752,9 @@ if (temp) { if (temp === 'inherit') { - res[WHITE_SPACE] = [0, INHERIT$2]; + res[WHITE_SPACE$2] = [0, INHERIT$3]; } else { - res[WHITE_SPACE] = [temp, STRING]; + res[WHITE_SPACE$2] = [temp, STRING$2]; } } @@ -8761,7 +8762,7 @@ if (temp !== undefined) { temp = parseInt(temp) || 0; - res[LINE_CLAMP] = Math.max(0, temp); + res[LINE_CLAMP$1] = Math.max(0, temp); } // fill和stroke为渐变时特殊处理,fillRule无需处理字符串 @@ -8769,25 +8770,25 @@ if (temp !== undefined) { if (!temp) { - res[FILL] = ['none']; + res[FILL$2] = ['none']; } else if (Array.isArray(temp)) { if (temp.length) { - res[FILL] = temp.map(function (item) { + res[FILL$2] = temp.map(function (item) { if (!item) { return 'none'; } else if (reg.gradient.test(item)) { - return gradient$1.parseGradient(item); + return gradient.parseGradient(item); } else { - return rgba2int$2(item); + return rgba2int$1(item); } }); } else { - res[FILL] = ['none']; + res[FILL$2] = ['none']; } } else if (reg.gradient.test(temp)) { - res[FILL] = [gradient$1.parseGradient(temp)]; + res[FILL$2] = [gradient.parseGradient(temp)]; } else { - res[FILL] = [rgba2int$2(temp)]; + res[FILL$2] = [rgba2int$1(temp)]; } } @@ -8795,40 +8796,40 @@ if (temp !== undefined) { if (!temp) { - res[STROKE] = ['none']; + res[STROKE$1] = ['none']; } else if (Array.isArray(temp)) { if (temp.length) { - res[STROKE] = temp.map(function (item) { + res[STROKE$1] = temp.map(function (item) { if (!item) { return 'none'; } else if (reg.gradient.test(item)) { - return gradient$1.parseGradient(item); + return gradient.parseGradient(item); } else { - return rgba2int$2(item); + return rgba2int$1(item); } }); } else { - res[STROKE] = ['none']; + res[STROKE$1] = ['none']; } } else if (reg.gradient.test(temp)) { - res[STROKE] = [gradient$1.parseGradient(temp)]; + res[STROKE$1] = [gradient.parseGradient(temp)]; } else { - res[STROKE] = [rgba2int$2(temp)]; + res[STROKE$1] = [rgba2int$1(temp)]; } } temp = style.strokeWidth; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { if (!Array.isArray(temp)) { temp = [temp]; } - res[STROKE_WIDTH] = temp.map(function (item) { + res[STROKE_WIDTH$7] = temp.map(function (item) { var v = calUnit$1(item); - if ([NUMBER$1, DEG$1].indexOf(v[1]) > -1) { - v[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(v[1]) > -1) { + v[1] = PX$9; } v[0] = Math.max(v[0], 0); @@ -8838,9 +8839,9 @@ temp = style.strokeDasharray; - if (!isNil$3(temp)) { + if (!isNil$c(temp)) { if (Array.isArray(temp)) { - res[STROKE_DASHARRAY] = temp.map(function (item) { + res[STROKE_DASHARRAY$1] = temp.map(function (item) { var match = item.toString().match(/[\d.]+/g); if (match) { @@ -8869,9 +8870,9 @@ _match2.push(_match2[_match2.length - 1]); } - res[STROKE_DASHARRAY] = [_match2]; + res[STROKE_DASHARRAY$1] = [_match2]; } else { - res[STROKE_DASHARRAY] = [[]]; + res[STROKE_DASHARRAY$1] = [[]]; } } } @@ -8894,45 +8895,45 @@ _v6 = calUnit$1(m2[2]); if (k === 'blur') { - if (_v6[0] <= 0 || [DEG$1, PERCENT$2].indexOf(_v6[1]) > -1) { + if (_v6[0] <= 0 || [DEG$1, PERCENT$a].indexOf(_v6[1]) > -1) { return; } - if (_v6[1] === NUMBER$1) { - _v6[1] = PX$2; + if (_v6[1] === NUMBER$4) { + _v6[1] = PX$9; } f.push([k, _v6]); } else if (k === 'hue-rotate') { - if ([NUMBER$1, DEG$1].indexOf(_v6[1]) === -1) { + if ([NUMBER$4, DEG$1].indexOf(_v6[1]) === -1) { return; } _v6[1] = DEG$1; f.push([k, _v6]); } else if (k === 'saturate' || k === 'brightness' || k === 'grayscale' || k === 'contrast') { - if ([NUMBER$1, PERCENT$2].indexOf(_v6[1]) === -1) { + if ([NUMBER$4, PERCENT$a].indexOf(_v6[1]) === -1) { return; } _v6[0] = Math.max(_v6[0], 0); - _v6[1] = PERCENT$2; + _v6[1] = PERCENT$a; f.push([k, _v6]); } } }); } - res[FILTER] = f; + res[FILTER$6] = f; } temp = style.visibility; if (temp) { if (temp === 'inherit') { - res[VISIBILITY] = [0, INHERIT$2]; + res[VISIBILITY$7] = [0, INHERIT$3]; } else { - res[VISIBILITY] = [temp, STRING]; + res[VISIBILITY$7] = [temp, STRING$2]; } } @@ -8940,9 +8941,9 @@ if (temp) { if (temp === 'inherit') { - res[POINTER_EVENTS] = [0, INHERIT$2]; + res[POINTER_EVENTS$2] = [0, INHERIT$3]; } else { - res[POINTER_EVENTS] = [temp, STRING]; + res[POINTER_EVENTS$2] = [temp, STRING$2]; } } @@ -8964,8 +8965,8 @@ for (var i = 0; i < 4; i++) { var _v7 = calUnit$1(boxShadow[i + 1]); - if ([NUMBER$1, DEG$1].indexOf(_v7[1]) > -1) { - _v7[1] = PX$2; + if ([NUMBER$4, DEG$1].indexOf(_v7[1]) > -1) { + _v7[1] = PX$9; } // x/y可以负,blur和spread不行 @@ -8976,7 +8977,7 @@ _res.push(_v7); } - _res.push(rgba2int$2(boxShadow[5])); + _res.push(rgba2int$1(boxShadow[5])); _res.push(boxShadow[6] || 'outset'); @@ -8985,35 +8986,35 @@ }); } - res[BOX_SHADOW] = bs; + res[BOX_SHADOW$9] = bs; } // 直接赋值的string类型 ['position', 'display', 'flexDirection', 'flexWrap', 'justifyContent', 'alignItems', 'alignSelf', 'alignContent', 'overflow', 'mixBlendMode', 'borderTopStyle', 'borderRightStyle', 'borderBottomStyle', 'borderLeftStyle', 'backgroundClip', 'textOverflow'].forEach(function (k) { if (style.hasOwnProperty(k)) { - res[STYLE_KEY$3[style2Upper$1(k)]] = style[k]; + res[STYLE_KEY$2[style2Upper$1(k)]] = style[k]; } }); // 直接赋值的number类型 ['flexGrow', 'flexShrink'].forEach(function (k) { if (style.hasOwnProperty(k)) { - res[STYLE_KEY$3[style2Upper$1(k)]] = Math.max(parseFloat(style[k]) || 0, 0); + res[STYLE_KEY$2[style2Upper$1(k)]] = Math.max(parseFloat(style[k]) || 0, 0); } }); temp = style.zIndex; - if (!isNil$3(temp)) { - res[Z_INDEX] = parseFloat(temp) || 0; + if (!isNil$c(temp)) { + res[Z_INDEX$4] = parseFloat(temp) || 0; } // 这些支持多个的用数组表示 ['backgroundRepeat', 'strokeLinecap', 'strokeLinejoin', 'strokeMiterlimit', 'fillRule'].forEach(function (k) { if (style.hasOwnProperty(k)) { var _v8 = style[k]; - res[STYLE_KEY$3[style2Upper$1(k)]] = Array.isArray(_v8) ? _v8 : [_v8]; + res[STYLE_KEY$2[style2Upper$1(k)]] = Array.isArray(_v8) ? _v8 : [_v8]; } }); - GEOM_KEY_SET$2.forEach(function (k) { + GEOM_KEY_SET.forEach(function (k) { if (style.hasOwnProperty(k)) { res[k] = style[k]; } @@ -9034,29 +9035,29 @@ computedStyle = node.computedStyle, domParent = node.domParent; var parentComputedStyle = !isRoot && domParent.computedStyle; - MEASURE_KEY_SET$1.forEach(function (k) { + MEASURE_KEY_SET.forEach(function (k) { var v = currentStyle[k]; // ff特殊处理 - if (k === FONT_FAMILY) { - if (v[1] === INHERIT$2) { + if (k === FONT_FAMILY$4) { + if (v[1] === INHERIT$3) { 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$3) { 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]; - } 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) { - computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : node.root.height * 0.01 * v[0]; - } else { - computedStyle[k] = v[0]; - } + else if (v[1] === PERCENT$a) { + computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : parentComputedStyle[k] * v[0] * 0.01; + } else if (v[1] === REM$e) { + computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : node.root.computedStyle[FONT_SIZE$f] * v[0]; + } else if (v[1] === VW$e) { + computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : node.root.width * 0.01 * v[0]; + } else if (v[1] === VH$e) { + computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : node.root.height * 0.01 * v[0]; + } else { + computedStyle[k] = v[0]; + } }); } /** @@ -9071,50 +9072,50 @@ computedStyle = node.computedStyle, parent = node.domParent, root = node.root; - var rem = root.computedStyle[FONT_SIZE$2]; + var rem = root.computedStyle[FONT_SIZE$f]; 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_TOP_WIDTH$5, BORDER_RIGHT_WIDTH$6, BORDER_BOTTOM_WIDTH$5, BORDER_LEFT_WIDTH$7].forEach(function (k) { // border-width不支持百分比 var item = currentStyle[k]; - if (item[1] === PX$2) { + if (item[1] === PX$9) { computedStyle[k] = item[0]; - } else if (item[1] === REM$2) { + } else if (item[1] === REM$e) { computedStyle[k] = item[0] * rem; - } else if (item[1] === VW$2) { + } else if (item[1] === VW$e) { computedStyle[k] = item[0] * root.width * 0.01; - } else if (item[1] === VH$2) { + } else if (item[1] === VH$e) { computedStyle[k] = item[0] * root.height * 0.01; } else { 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$5, DISPLAY$a, FLEX_DIRECTION$2, JUSTIFY_CONTENT$1, ALIGN_ITEMS$1, ALIGN_SELF$1, FLEX_GROW$1, FLEX_SHRINK$1, LINE_CLAMP$1, ORDER$1, FLEX_WRAP$1, ALIGN_CONTENT$1].forEach(function (k) { computedStyle[k] = currentStyle[k]; }); - var textAlign = currentStyle[TEXT_ALIGN]; + var textAlign = currentStyle[TEXT_ALIGN$2]; - if (textAlign[1] === INHERIT$2) { - computedStyle[TEXT_ALIGN] = isRoot ? 'left' : parentComputedStyle[TEXT_ALIGN]; + if (textAlign[1] === INHERIT$3) { + computedStyle[TEXT_ALIGN$2] = isRoot ? 'left' : parentComputedStyle[TEXT_ALIGN$2]; } else { - computedStyle[TEXT_ALIGN] = textAlign[0]; + computedStyle[TEXT_ALIGN$2] = textAlign[0]; } - var fontSize = computedStyle[FONT_SIZE$2]; - var lineHeight = currentStyle[LINE_HEIGHT]; // lineHeight继承很特殊,数字和normal不同于普通单位 + var fontSize = computedStyle[FONT_SIZE$f]; + var lineHeight = currentStyle[LINE_HEIGHT$4]; // lineHeight继承很特殊,数字和normal不同于普通单位 - if (lineHeight[1] === INHERIT$2) { + if (lineHeight[1] === INHERIT$3) { if (isRoot) { - computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle); + computedStyle[LINE_HEIGHT$4] = calNormalLineHeight(computedStyle); } else { var p = parent; var ph; while (p) { - ph = p.currentStyle[LINE_HEIGHT]; + ph = p.currentStyle[LINE_HEIGHT$4]; - if (ph[1] !== INHERIT$2) { + if (ph[1] !== INHERIT$3) { break; } @@ -9122,63 +9123,63 @@ } // 到root还是inherit或normal,或者中途遇到了normal,使用normal - if ([AUTO, INHERIT$2].indexOf(ph[1]) > -1) { - computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle); + if ([AUTO$8, INHERIT$3].indexOf(ph[1]) > -1) { + computedStyle[LINE_HEIGHT$4] = calNormalLineHeight(computedStyle); } // 数字继承 - else if (ph[1] === NUMBER$1) { - computedStyle[LINE_HEIGHT] = Math.max(ph[0], 0) * fontSize; - } // 单位继承 - else { - computedStyle[LINE_HEIGHT] = parentComputedStyle[LINE_HEIGHT]; - } + else if (ph[1] === NUMBER$4) { + computedStyle[LINE_HEIGHT$4] = Math.max(ph[0], 0) * fontSize; + } // 单位继承 + else { + computedStyle[LINE_HEIGHT$4] = parentComputedStyle[LINE_HEIGHT$4]; + } } } // 防止为0 - else if (lineHeight[1] === PX$2) { - computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) || calNormalLineHeight(computedStyle); - } else if (lineHeight[1] === PERCENT$2) { - computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * fontSize * 0.01, 0) || calNormalLineHeight(computedStyle); - } else if (lineHeight[1] === REM$2) { - computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * rem, 0) || calNormalLineHeight(computedStyle); - } else if (lineHeight[1] === VW$2) { - computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.width * 0.01, 0) || calNormalLineHeight(computedStyle); - } else if (lineHeight[1] === VH$2) { - computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.height * 0.01, 0) || calNormalLineHeight(computedStyle); - } else if (lineHeight[1] === NUMBER$1) { - computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) * fontSize || calNormalLineHeight(computedStyle); - } // normal或auto - else { - computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle); - } + else if (lineHeight[1] === PX$9) { + computedStyle[LINE_HEIGHT$4] = Math.max(lineHeight[0], 0) || calNormalLineHeight(computedStyle); + } else if (lineHeight[1] === PERCENT$a) { + computedStyle[LINE_HEIGHT$4] = Math.max(lineHeight[0] * fontSize * 0.01, 0) || calNormalLineHeight(computedStyle); + } else if (lineHeight[1] === REM$e) { + computedStyle[LINE_HEIGHT$4] = Math.max(lineHeight[0] * rem, 0) || calNormalLineHeight(computedStyle); + } else if (lineHeight[1] === VW$e) { + computedStyle[LINE_HEIGHT$4] = Math.max(lineHeight[0] * root.width * 0.01, 0) || calNormalLineHeight(computedStyle); + } else if (lineHeight[1] === VH$e) { + computedStyle[LINE_HEIGHT$4] = Math.max(lineHeight[0] * root.height * 0.01, 0) || calNormalLineHeight(computedStyle); + } else if (lineHeight[1] === NUMBER$4) { + computedStyle[LINE_HEIGHT$4] = Math.max(lineHeight[0], 0) * fontSize || calNormalLineHeight(computedStyle); + } // normal或auto + else { + computedStyle[LINE_HEIGHT$4] = calNormalLineHeight(computedStyle); + } - var letterSpacing = currentStyle[LETTER_SPACING]; + var letterSpacing = currentStyle[LETTER_SPACING$2]; - if (letterSpacing[1] === INHERIT$2) { - computedStyle[LETTER_SPACING] = isRoot ? 0 : parentComputedStyle[LETTER_SPACING]; - } else if (letterSpacing[1] === PERCENT$2) { - computedStyle[LETTER_SPACING] = fontSize * 0.01 * letterSpacing[0]; - } else if (letterSpacing[1] === REM$2) { - computedStyle[LETTER_SPACING] = rem * letterSpacing[0]; - } else if (letterSpacing[1] === VW$2) { - computedStyle[LETTER_SPACING] = root.width * 0.01 * letterSpacing[0]; - } else if (letterSpacing[1] === VH$2) { - computedStyle[LETTER_SPACING] = root.height * 0.01 * letterSpacing[0]; + if (letterSpacing[1] === INHERIT$3) { + computedStyle[LETTER_SPACING$2] = isRoot ? 0 : parentComputedStyle[LETTER_SPACING$2]; + } else if (letterSpacing[1] === PERCENT$a) { + computedStyle[LETTER_SPACING$2] = fontSize * 0.01 * letterSpacing[0]; + } else if (letterSpacing[1] === REM$e) { + computedStyle[LETTER_SPACING$2] = rem * letterSpacing[0]; + } else if (letterSpacing[1] === VW$e) { + computedStyle[LETTER_SPACING$2] = root.width * 0.01 * letterSpacing[0]; + } else if (letterSpacing[1] === VH$e) { + computedStyle[LETTER_SPACING$2] = root.height * 0.01 * letterSpacing[0]; } else { - computedStyle[LETTER_SPACING] = letterSpacing[0]; + computedStyle[LETTER_SPACING$2] = letterSpacing[0]; } //whiteSpace - var whiteSpace = currentStyle[WHITE_SPACE]; + var whiteSpace = currentStyle[WHITE_SPACE$2]; - if (whiteSpace[1] === INHERIT$2) { - computedStyle[WHITE_SPACE] = isRoot ? 'normal' : parentComputedStyle[WHITE_SPACE]; + if (whiteSpace[1] === INHERIT$3) { + computedStyle[WHITE_SPACE$2] = isRoot ? 'normal' : parentComputedStyle[WHITE_SPACE$2]; } else { - computedStyle[WHITE_SPACE] = whiteSpace[0]; + computedStyle[WHITE_SPACE$2] = whiteSpace[0]; } } function setFontStyle(style) { - var fontSize = style[FONT_SIZE$2]; - return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' ' + fontSize + 'px/' + fontSize + 'px ' + (style[FONT_FAMILY] || 'arial'); + var fontSize = style[FONT_SIZE$f]; + return (style[FONT_STYLE$4] || 'normal') + ' ' + (style[FONT_WEIGHT$4] || '400') + ' ' + fontSize + 'px/' + fontSize + 'px ' + (style[FONT_FAMILY$4] || 'arial'); } function getFontFamily(str) { @@ -9186,7 +9187,7 @@ var f = 'arial'; for (var i = 0, len = ff.length; i < len; i++) { - if (o$1.support(ff[i])) { + if (o$3.support(ff[i])) { f = ff[i]; break; } @@ -9196,15 +9197,15 @@ } 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$f]; + var ff = getFontFamily(style[FONT_FAMILY$4]); + var normal = fontSize * (o$3.info[ff] || o$3.info.arial).lhr; + return (style[LINE_HEIGHT$4] - normal) * 0.5 + fontSize * (o$3.info[ff] || o$3.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$4]); + return style[FONT_SIZE$f] * (o$3.info[ff] || o$3.info.arial).lhr; } function calRelativePercent(n, parent, k) { @@ -9213,22 +9214,22 @@ while (parent) { var style = parent.currentStyle[k]; - if (style[1] === AUTO) { - if (k === WIDTH$1) { + if (style[1] === AUTO$8) { + if (k === WIDTH$7) { parent = parent.domParent; } else { break; } - } else if (style[1] === PX$2) { + } else if (style[1] === PX$9) { return n * style[0]; - } else if (style[1] === PERCENT$2) { + } else if (style[1] === PERCENT$a) { n *= style[0] * 0.01; parent = parent.domParent; - } else if (style[1] === REM$2) { - return n * style[0] * parent.root.computedStyle[FONT_SIZE$2]; - } else if (style[1] === VW$2) { + } else if (style[1] === REM$e) { + return n * style[0] * parent.root.computedStyle[FONT_SIZE$f]; + } else if (style[1] === VW$e) { return n * style[0] * parent.root.width * 0.01; - } else if (style[1] === VH$2) { + } else if (style[1] === VH$e) { return n * style[0] * parent.root.height * 0.01; } } @@ -9236,52 +9237,52 @@ return n; } - function calRelative(currentStyle, k, v, parent, isWidth) { - if (v[1] === AUTO) { + function calRelative$1(currentStyle, k, v, parent, isWidth) { + if (v[1] === AUTO$8) { v = 0; - } else if ([PX$2, NUMBER$1].indexOf(v[1]) > -1) { + } else if ([PX$9, NUMBER$4].indexOf(v[1]) > -1) { v = v[0]; - } else if (v[1] === PERCENT$2) { + } else if (v[1] === PERCENT$a) { if (isWidth) { - v = calRelativePercent(v[0], parent, WIDTH$1); + v = calRelativePercent(v[0], parent, WIDTH$7); } else { - v = calRelativePercent(v[0], parent, HEIGHT$1); + v = calRelativePercent(v[0], parent, HEIGHT$7); } - } else if (v[1] === REM$2) { - v = v[0] * parent.root.computedStyle[FONT_SIZE$2]; - } else if (v[1] === VW$2) { + } else if (v[1] === REM$e) { + v = v[0] * parent.root.computedStyle[FONT_SIZE$f]; + } else if (v[1] === VW$e) { v = v[0] * parent.root.width * 0.01; - } else if (v[1] === VH$2) { + } else if (v[1] === VH$e) { v = v[0] * parent.root.height * 0.01; } return v; } - function calAbsolute(currentStyle, k, v, size, root) { - if (v[1] === AUTO) { + function calAbsolute$1(currentStyle, k, v, size, root) { + if (v[1] === AUTO$8) { v = 0; - } else if ([PX$2, NUMBER$1, DEG$1, RGBA, STRING].indexOf(v[1]) > -1) { + } else if ([PX$9, NUMBER$4, DEG$1, RGBA$2, STRING$2].indexOf(v[1]) > -1) { v = v[0]; - } else if (v[1] === PERCENT$2) { + } else if (v[1] === PERCENT$a) { v = v[0] * size * 0.01; - } else if (v[1] === REM$2) { - v = v[0] * root.computedStyle[FONT_SIZE$2]; - } else if (v[1] === VW$2) { + } else if (v[1] === REM$e) { + v = v[0] * root.computedStyle[FONT_SIZE$f]; + } else if (v[1] === VW$e) { v = v[0] * root.width * 0.01; - } else if (v[1] === VH$2) { + } else if (v[1] === VH$e) { v = v[0] * root.height * 0.01; } return v; } - function equalStyle(k, a, b, target) { + function equalStyle$1(k, a, b, target) { if (!a || !b) { return a === b; } - if (k === TRANSFORM) { + if (k === TRANSFORM$4) { if (a.length !== b.length) { return false; } @@ -9303,7 +9304,7 @@ return true; } - if (k === FILTER) { + if (k === FILTER$6) { if (a.length !== b.length) { return false; } @@ -9315,7 +9316,7 @@ } } - if (k === BACKGROUND_SIZE) { + if (k === BACKGROUND_SIZE$2) { if (a.length !== b.length) { return false; } @@ -9332,15 +9333,15 @@ return true; } - if (k === TRANSFORM_ORIGIN$1 || RADIUS_HASH$1.hasOwnProperty(k)) { + if (k === TRANSFORM_ORIGIN$4 || RADIUS_HASH$1.hasOwnProperty(k)) { return a[0][0] === b[0][0] && a[0][1] === b[0][1] && a[1][0] === b[1][0] && a[1][1] === b[1][1]; } - if (k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y || LENGTH_HASH$1.hasOwnProperty(k) || EXPAND_HASH$1.hasOwnProperty(k)) { + if (k === BACKGROUND_POSITION_X$3 || k === BACKGROUND_POSITION_Y$3 || LENGTH_HASH$1.hasOwnProperty(k) || EXPAND_HASH$1.hasOwnProperty(k)) { return a[0] === b[0] && a[1] === b[1]; } - if (k === BOX_SHADOW) { + if (k === BOX_SHADOW$9) { return equalArr$1(a, b); } @@ -9381,25 +9382,25 @@ } // multi都是纯值数组,equalArr本身即递归,非multi根据类型判断 - if (isGeom$1(target.tagName, k) && (target.isMulti || Array.isArray(a) && Array.isArray(b))) { + if (isGeom$2(target.tagName, k) && (target.isMulti || Array.isArray(a) && Array.isArray(b))) { return equalArr$1(a, b); } return a === b; } - function isRelativeOrAbsolute(node) { - var position = node.currentStyle[POSITION]; + function isRelativeOrAbsolute$2(node) { + var position = node.currentStyle[POSITION$5]; return position === 'relative' || position === 'absolute'; } - 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 VALUE = (_VALUE = {}, _defineProperty(_VALUE, POSITION$5, true), _defineProperty(_VALUE, DISPLAY$a, true), _defineProperty(_VALUE, STYLE_KEY$2.BACKGROUND_REPEAT, true), _defineProperty(_VALUE, FLEX_DIRECTION$2, true), _defineProperty(_VALUE, FLEX_GROW$1, true), _defineProperty(_VALUE, FLEX_SHRINK$1, true), _defineProperty(_VALUE, FLEX_WRAP$1, true), _defineProperty(_VALUE, JUSTIFY_CONTENT$1, true), _defineProperty(_VALUE, ALIGN_ITEMS$1, true), _defineProperty(_VALUE, ALIGN_SELF$1, true), _defineProperty(_VALUE, STYLE_KEY$2.OVERFLOW, true), _defineProperty(_VALUE, STYLE_KEY$2.MIX_BLEND_MODE, true), _defineProperty(_VALUE, STYLE_KEY$2.STROKE_LINECAP, true), _defineProperty(_VALUE, STYLE_KEY$2.STROKE_LINEJOIN, true), _defineProperty(_VALUE, STYLE_KEY$2.STROKE_MITERLIMIT, true), _defineProperty(_VALUE, STYLE_KEY$2.FILL_RULE, true), _defineProperty(_VALUE, OPACITY$5, true), _defineProperty(_VALUE, Z_INDEX$4, true), _defineProperty(_VALUE, BACKGROUND_CLIP$2, true), _defineProperty(_VALUE, TEXT_OVERFLOW$2, true), _defineProperty(_VALUE, LINE_CLAMP$1, 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$5, true), _defineProperty(_ARRAY_, TEXT_STROKE_COLOR$4, true), _defineProperty(_ARRAY_, BACKGROUND_COLOR$2, true), _defineProperty(_ARRAY_, STYLE_KEY$2.BORDER_TOP_COLOR, true), _defineProperty(_ARRAY_, STYLE_KEY$2.BORDER_RIGHT_COLOR, true), _defineProperty(_ARRAY_, STYLE_KEY$2.BORDER_BOTTOM_COLOR, true), _defineProperty(_ARRAY_, STYLE_KEY$2.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_); + var ARRAY_0_1 = (_ARRAY_0_ = {}, _defineProperty(_ARRAY_0_, STYLE_KEY$2.BORDER_TOP_LEFT_RADIUS, true), _defineProperty(_ARRAY_0_, STYLE_KEY$2.BORDER_TOP_RIGHT_RADIUS, true), _defineProperty(_ARRAY_0_, STYLE_KEY$2.BORDER_BOTTOM_RIGHT_RADIUS, true), _defineProperty(_ARRAY_0_, STYLE_KEY$2.BORDER_BOTTOM_LEFT_RADIUS, true), _defineProperty(_ARRAY_0_, TRANSFORM_ORIGIN$4, true), _defineProperty(_ARRAY_0_, PERSPECTIVE_ORIGIN$4, true), _ARRAY_0_); - function cloneStyle(style, keys) { + function cloneStyle$1(style, keys) { if (!keys) { keys = Object.keys(style).map(function (i) { if (!GEOM$2.hasOwnProperty(i)) { @@ -9416,7 +9417,7 @@ var k = keys[i]; var v = style[k]; // 渐变特殊处理 - if (k === BACKGROUND_IMAGE) { + if (k === BACKGROUND_IMAGE$2) { res[k] = v.map(function (item) { // 可能为null if (item && item.k) { @@ -9425,7 +9426,7 @@ return item; } }); - } else if (k === FILL || k === STROKE) { + } else if (k === FILL$2 || k === STROKE$1) { res[k] = v.map(function (item) { // 渐变 // 可能非法为空 @@ -9433,10 +9434,10 @@ return util.clone(item); } // 颜色 else { - return item.slice(0); - } + return item.slice(0); + } }); - } else if (k === TRANSFORM || k === FILTER) { + } else if (k === TRANSFORM$4 || k === FILTER$6) { if (v) { var n = v.slice(0); @@ -9447,7 +9448,7 @@ res[k] = n; } - } else if (k === BOX_SHADOW) { + } else if (k === BOX_SHADOW$9) { if (v) { v = v.map(function (item) { var n = item.slice(0); @@ -9456,7 +9457,7 @@ }); res[k] = v; } - } else if (k === TRANSLATE_PATH) { + } else if (k === TRANSLATE_PATH$1) { if (v) { res[k] = v.map(function (item) { return item.slice(0); @@ -9464,67 +9465,67 @@ } } // position等直接值类型赋值 else if (VALUE.hasOwnProperty(k)) { - res[k] = v; - } // geom自定义属性 - else if (GEOM$2.hasOwnProperty(k)) { - res[k] = util.clone(v); - } // 其余皆是数组或空,默认是一维数组只需slice即可 - else if (v) { - var _n = res[k] = v.slice(0); // 特殊引用里数组某项再次clone + res[k] = v; + } // geom自定义属性 + else if (GEOM$2.hasOwnProperty(k)) { + res[k] = util.clone(v); + } // 其余皆是数组或空,默认是一维数组只需slice即可 + else if (v) { + var _n = res[k] = v.slice(0); // 特殊引用里数组某项再次clone - if (k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) { - for (var _i5 = 0, _len5 = _n.length; _i5 < _len5; _i5++) { - _n[_i5] = _n[_i5].slice(0); - } - } else if (k === BACKGROUND_SIZE) { - for (var _i6 = 0, _len6 = _n.length; _i6 < _len6; _i6++) { - _n[_i6] = _n[_i6].slice(0); - _n[_i6][0] = _n[_i6][0].slice(0); - _n[_i6][1] = _n[_i6][1].slice(0); - } - } else if (ARRAY_0.hasOwnProperty(k)) { - _n[0] = _n[0].slice(0); - } else if (ARRAY_0_1.hasOwnProperty(k)) { - _n[0] = _n[0].slice(0); - _n[1] = _n[1].slice(0); - } else if (k === TRANSFORM) { - for (var _i7 = 0, _len7 = _n.length; _i7 < _len7; _i7++) { - _n[_i7] = _n[_i7].slice(0); - } - } else if (k === ROTATE_3D) { - _n[3] = _n[3].slice(0); - } - } + if (k === BACKGROUND_POSITION_X$3 || k === BACKGROUND_POSITION_Y$3) { + for (var _i5 = 0, _len5 = _n.length; _i5 < _len5; _i5++) { + _n[_i5] = _n[_i5].slice(0); + } + } else if (k === BACKGROUND_SIZE$2) { + for (var _i6 = 0, _len6 = _n.length; _i6 < _len6; _i6++) { + _n[_i6] = _n[_i6].slice(0); + _n[_i6][0] = _n[_i6][0].slice(0); + _n[_i6][1] = _n[_i6][1].slice(0); + } + } else if (ARRAY_0.hasOwnProperty(k)) { + _n[0] = _n[0].slice(0); + } else if (ARRAY_0_1.hasOwnProperty(k)) { + _n[0] = _n[0].slice(0); + _n[1] = _n[1].slice(0); + } else if (k === TRANSFORM$4) { + for (var _i7 = 0, _len7 = _n.length; _i7 < _len7; _i7++) { + _n[_i7] = _n[_i7].slice(0); + } + } else if (k === ROTATE_3D$3) { + _n[3] = _n[3].slice(0); + } + } } return res; } var css = { - normalize: normalize, + normalize: normalize$1, computeMeasure: computeMeasure, computeReflow: computeReflow, setFontStyle: setFontStyle, getFontFamily: getFontFamily, getBaseLine: getBaseLine, - calRelative: calRelative, - calAbsolute: calAbsolute, - equalStyle: equalStyle, - isRelativeOrAbsolute: isRelativeOrAbsolute, - cloneStyle: cloneStyle + calRelative: calRelative$1, + calAbsolute: calAbsolute$1, + equalStyle: equalStyle$1, + isRelativeOrAbsolute: isRelativeOrAbsolute$2, + cloneStyle: cloneStyle$1 }; - 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$m = enums.STYLE_KEY, + COLOR$4 = _enums$STYLE_KEY$m.COLOR, + FONT_WEIGHT$3 = _enums$STYLE_KEY$m.FONT_WEIGHT, + FONT_FAMILY$3 = _enums$STYLE_KEY$m.FONT_FAMILY, + FONT_SIZE$e = _enums$STYLE_KEY$m.FONT_SIZE, + FONT_STYLE$3 = _enums$STYLE_KEY$m.FONT_STYLE, + LETTER_SPACING$1 = _enums$STYLE_KEY$m.LETTER_SPACING, + TEXT_STROKE_COLOR$3 = _enums$STYLE_KEY$m.TEXT_STROKE_COLOR, + TEXT_STROKE_WIDTH$2 = _enums$STYLE_KEY$m.TEXT_STROKE_WIDTH, + TEXT_STROKE_OVER$2 = _enums$STYLE_KEY$m.TEXT_STROKE_OVER; /** * 表示一行文本的类,保存它的位置、内容、从属信息,在布局阶段生成,并在渲染阶段被Text调用render() * 关系上直属于Text类,一个Text类可能因为换行原因导致有多个TextBox,一行内容中也可能有不同Text从而不同TextBox @@ -9574,13 +9575,13 @@ 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]; + textStrokeWidth = computedStyle[TEXT_STROKE_WIDTH$2], + textStrokeColor = computedStyle[TEXT_STROKE_COLOR$3]; var i = 0, length = content.length; if (renderMode === mode.CANVAS || renderMode === mode.WEBGL) { - var overFill = computedStyle[TEXT_STROKE_OVER$1] === 'fill'; + var overFill = computedStyle[TEXT_STROKE_OVER$2] === 'fill'; if (letterSpacing) { for (; i < length; i++) { @@ -9612,11 +9613,11 @@ } } } 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$4]], ['font-family', computedStyle[FONT_FAMILY$3]], ['font-weight', computedStyle[FONT_WEIGHT$3]], ['font-style', computedStyle[FONT_STYLE$3]], ['font-size', computedStyle[FONT_SIZE$e] + 'px']]; // svg无法定义stroke的over if (textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) { - props.push(['stroke', cacheStyle[TEXT_STROKE_COLOR$1]]); - props.push(['stroke-width', computedStyle[TEXT_STROKE_WIDTH$1]]); + props.push(['stroke', cacheStyle[TEXT_STROKE_COLOR$3]]); + props.push(['stroke-width', computedStyle[TEXT_STROKE_WIDTH$2]]); } if (letterSpacing) { @@ -9717,10 +9718,10 @@ }(); var SIZE = [8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192]; - var NUMBER$2 = [128, 64, 32, 16, 8, 4, 2, 1, 1, 1, 1]; + var NUMBER$3 = [128, 64, 32, 16, 8, 4, 2, 1, 1, 1, 1]; var MAX = SIZE[SIZE.length - 1]; var HASH_CANVAS = {}; - var uuid = 0; + var uuid$2 = 0; var Page = /*#__PURE__*/function () { function Page(size, number) { @@ -9745,7 +9746,7 @@ this.__grid.push(1); } - this.__uuid = uuid++; // webgl贴图缓存使用,一旦更新则标识记录,绑定某号纹理单元查看变化才更新贴图 + this.__uuid = uuid$2++; // webgl贴图缓存使用,一旦更新则标识记录,绑定某号纹理单元查看变化才更新贴图 this.__update = false; this.time = 0; @@ -9860,11 +9861,11 @@ } var s = SIZE[0]; - var n = NUMBER$2[0]; // 使用刚好满足的尺寸 + var n = NUMBER$3[0]; // 使用刚好满足的尺寸 for (var i = 0, len = SIZE.length; i < len; i++) { s = SIZE[i]; - n = NUMBER$2[i]; + n = NUMBER$3[i]; if (SIZE[i] >= size) { break; @@ -9906,7 +9907,7 @@ get: function get() { return { SIZE: SIZE, - NUMBER: NUMBER$2 + NUMBER: NUMBER$3 }; }, set: function set(v) { @@ -9915,7 +9916,7 @@ } SIZE = v.SIZE; - NUMBER$2 = v.NUMBER; + NUMBER$3 = v.NUMBER; MAX = SIZE[SIZE.length - 1]; } }, { @@ -9926,7 +9927,7 @@ }, { key: "genUuid", value: function genUuid() { - return uuid++; + return uuid$2++; } }]); @@ -10153,8 +10154,8 @@ } // 第2步,以第1条边AB为基准,缩放x轴ab至目标相同长度,可与4步合并 - var ls = geom.pointsDistance(sx1, sy1, sx2, sy2); - var lt = geom.pointsDistance(tx1, ty1, tx2, ty2); // if(ls !== lt) { + var ls = geom$1.pointsDistance(sx1, sy1, sx2, sy2); + var lt = geom$1.pointsDistance(tx1, ty1, tx2, ty2); // if(ls !== lt) { // let scale = lt / ls; // t = matrix.identity(); // t[0] = scale; @@ -10217,14 +10218,14 @@ ax3 = _matrix$calPoint6[0], ay3 = _matrix$calPoint6[1]; - var ab = geom.pointsDistance(ax1, ay1, ax2, ay2); - var ac = geom.pointsDistance(ax1, ay1, ax3, ay3); - var bc = geom.pointsDistance(ax3, ay3, ax2, ay2); - var AB = geom.pointsDistance(tx1, ty1, tx2, ty2); - var AC = geom.pointsDistance(tx1, ty1, tx3, ty3); - var BC = geom.pointsDistance(tx3, ty3, tx2, ty2); - var a = geom.angleBySide(bc, ab, ac); - var A = geom.angleBySide(BC, AB, AC); // 先至90°,再旋转至目标角,可以合并成tan相加,不知道为什么不能直接tan倾斜差值角度 + var ab = geom$1.pointsDistance(ax1, ay1, ax2, ay2); + var ac = geom$1.pointsDistance(ax1, ay1, ax3, ay3); + var bc = geom$1.pointsDistance(ax3, ay3, ax2, ay2); + var AB = geom$1.pointsDistance(tx1, ty1, tx2, ty2); + var AC = geom$1.pointsDistance(tx1, ty1, tx3, ty3); + var BC = geom$1.pointsDistance(tx3, ty3, tx2, ty2); + var a = geom$1.angleBySide(bc, ab, ac); + var A = geom$1.angleBySide(BC, AB, AC); // 先至90°,再旋转至目标角,可以合并成tan相加,不知道为什么不能直接tan倾斜差值角度 if (a !== A) { t = mx.identity(); @@ -10262,65 +10263,65 @@ var math = { matrix: mx, tar: tar, - geom: geom + geom: geom$1 }; - 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 PX$3 = o.PX, - PERCENT$3 = o.PERCENT, - REM$3 = o.REM, - VW$3 = o.VW, - VH$3 = o.VH; + var _enums$STYLE_KEY$l = enums.STYLE_KEY, + TRANSLATE_X$3 = _enums$STYLE_KEY$l.TRANSLATE_X, + TRANSLATE_Y$3 = _enums$STYLE_KEY$l.TRANSLATE_Y, + TRANSLATE_Z$3 = _enums$STYLE_KEY$l.TRANSLATE_Z, + SCALE_X$2 = _enums$STYLE_KEY$l.SCALE_X, + SCALE_Y$2 = _enums$STYLE_KEY$l.SCALE_Y, + SCALE_Z$1 = _enums$STYLE_KEY$l.SCALE_Z, + SKEW_X$1 = _enums$STYLE_KEY$l.SKEW_X, + SKEW_Y$1 = _enums$STYLE_KEY$l.SKEW_Y, + ROTATE_X$1 = _enums$STYLE_KEY$l.ROTATE_X, + ROTATE_Y$1 = _enums$STYLE_KEY$l.ROTATE_Y, + ROTATE_Z$1 = _enums$STYLE_KEY$l.ROTATE_Z, + ROTATE_3D$2 = _enums$STYLE_KEY$l.ROTATE_3D, + PERSPECTIVE$4 = _enums$STYLE_KEY$l.PERSPECTIVE, + MATRIX$2 = _enums$STYLE_KEY$l.MATRIX, + FONT_SIZE$d = _enums$STYLE_KEY$l.FONT_SIZE; + var PX$8 = o$4.PX, + PERCENT$9 = o$4.PERCENT, + REM$d = o$4.REM, + VW$d = o$4.VW, + VH$d = o$4.VH; var matrix = math.matrix, - geom$1 = math.geom; - var identity$1 = matrix.identity, + geom = math.geom; + var identity = matrix.identity, multiply$1 = matrix.multiply, - isE$2 = matrix.isE; - var d2r$2 = geom$1.d2r; + isE$1 = matrix.isE; + var d2r = geom.d2r; function calSingle(t, k, v) { - if (k === TRANSLATE_X$1) { + if (k === TRANSLATE_X$3) { t[12] = v; - } else if (k === TRANSLATE_Y$1) { + } else if (k === TRANSLATE_Y$3) { t[13] = v; - } else if (k === TRANSLATE_Z$1) { + } else if (k === TRANSLATE_Z$3) { t[14] = v; - } else if (k === SCALE_X$1) { + } else if (k === SCALE_X$2) { t[0] = v; - } else if (k === SCALE_Y$1) { + } else if (k === SCALE_Y$2) { t[5] = v; } else if (k === SCALE_Z$1) { t[10] = v; } else if (k === SKEW_X$1) { - v = d2r$2(v); + v = d2r(v); t[4] = Math.tan(v); } else if (k === SKEW_Y$1) { - v = d2r$2(v); + v = d2r(v); t[1] = Math.tan(v); } else if (k === ROTATE_X$1) { - v = d2r$2(v); + v = d2r(v); var sin = Math.sin(v); var cos = Math.cos(v); t[5] = t[10] = cos; t[6] = sin; t[9] = -sin; } else if (k === ROTATE_Y$1) { - v = d2r$2(v); + v = d2r(v); var _sin = Math.sin(v); @@ -10330,7 +10331,7 @@ t[8] = _sin; t[2] = -_sin; } else if (k === ROTATE_Z$1) { - v = d2r$2(v); + v = d2r(v); var _sin2 = Math.sin(v); @@ -10339,7 +10340,7 @@ t[0] = t[5] = _cos2; t[1] = _sin2; t[4] = -_sin2; - } else if (k === ROTATE_3D$1) { + } else if (k === ROTATE_3D$2) { var _v = v, _v2 = _slicedToArray(_v, 4), x = _v2[0], @@ -10347,7 +10348,7 @@ z = _v2[2], r = _v2[3]; - r = d2r$2(r[0]); + r = d2r(r[0]); var s = Math.sin(r); var c = Math.cos(r); @@ -10412,23 +10413,23 @@ t[14] = 0; t[15] = 1; } - } else if (k === PERSPECTIVE$1 && v > 0) { + } else if (k === PERSPECTIVE$4 && v > 0) { v = Math.max(v, 1); t[11] = -1 / v; - } else if (k === MATRIX$1) { + } else if (k === MATRIX$2) { util.assignMatrix(t, v); } } function calMatrix(transform, ow, oh, root) { - var list = normalize$1(transform, ow, oh, root); - var m = identity$1(); + var list = normalize(transform, ow, oh, root); + var m = identity(); list.forEach(function (item) { var _item = _slicedToArray(item, 2), k = _item[0], v = _item[1]; - var t = identity$1(); + var t = identity(); calSingle(t, k, v); m = multiply$1(m, t); }); @@ -10443,7 +10444,7 @@ var res = m.slice(0); - if (ox === 0 && oy === 0 || isE$2(m)) { + if (ox === 0 && oy === 0 || isE$1(m)) { return res; } @@ -10459,36 +10460,36 @@ } function normalizeSingle(k, v, ow, oh, root) { - if (k === TRANSLATE_X$1 || k === TRANSLATE_Z$1) { - if (v[1] === PERCENT$3) { + if (k === TRANSLATE_X$3 || k === TRANSLATE_Z$3) { + if (v[1] === PERCENT$9) { return v[0] * ow * 0.01; - } else if (v[1] === REM$3) { - return v[0] * root.computedStyle[FONT_SIZE$4]; - } else if (v[1] === VW$3) { + } else if (v[1] === REM$d) { + return v[0] * root.computedStyle[FONT_SIZE$d]; + } else if (v[1] === VW$d) { return v[0] * root.width * 0.01; - } else if (v[1] === VH$3) { + } else if (v[1] === VH$d) { return v[0] * root.height * 0.01; } - } else if (k === TRANSLATE_Y$1) { - if (v[1] === PERCENT$3) { + } else if (k === TRANSLATE_Y$3) { + if (v[1] === PERCENT$9) { return v[0] * oh * 0.01; - } else if (v[1] === REM$3) { - return v[0] * root.computedStyle[FONT_SIZE$4]; - } else if (v[1] === VW$3) { + } else if (v[1] === REM$d) { + return v[0] * root.computedStyle[FONT_SIZE$d]; + } else if (v[1] === VW$d) { return v[0] * root.width * 0.01; - } else if (v[1] === VH$3) { + } else if (v[1] === VH$d) { return v[0] * root.height * 0.01; } - } else if (k === MATRIX$1) { + } else if (k === MATRIX$2) { return v; - } else if (k === ROTATE_3D$1) { + } else if (k === ROTATE_3D$2) { return v; } return v[0]; } - function normalize$1(transform, ow, oh, root) { + function normalize(transform, ow, oh, root) { var res = []; transform.forEach(function (item) { var _item2 = _slicedToArray(item, 2), @@ -10503,15 +10504,15 @@ function calOrigin(transformOrigin, w, h, root) { var tfo = []; transformOrigin.forEach(function (item, i) { - if (item[1] === PX$3) { + if (item[1] === PX$8) { tfo.push(item[0]); - } else if (item[1] === PERCENT$3) { + } else if (item[1] === PERCENT$9) { tfo.push(item[0] * (i ? h : w) * 0.01); - } else if (item[1] === REM$3) { - tfo.push(item[0] * root.computedStyle[FONT_SIZE$4]); - } else if (item[1] === VW$3) { + } else if (item[1] === REM$d) { + tfo.push(item[0] * root.computedStyle[FONT_SIZE$d]); + } else if (item[1] === VW$d) { tfo.push(item[0] * root.width * 0.01); - } else if (item[1] === VH$3) { + } else if (item[1] === VH$d) { tfo.push(item[0] * root.height * 0.01); } }); @@ -10519,7 +10520,7 @@ } function calMatrixByPerspective(m, pm) { - if (!isE$2(pm)) { + if (!isE$1(pm)) { m = multiply$1(pm, m); } @@ -10528,7 +10529,7 @@ function calPerspectiveMatrix(ppt, po) { if (ppt && ppt > 0) { - var res = identity$1(); + var res = identity(); ppt = Math.max(ppt, 1); res[11] = -1 / ppt; @@ -10644,18 +10645,18 @@ 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, - DISPLAY$1 = _enums$STYLE_KEY$5.DISPLAY, - VISIBILITY$1 = _enums$STYLE_KEY$5.VISIBILITY, - _enums$NODE_KEY$1 = enums.NODE_KEY, - NODE_OPACITY = _enums$NODE_KEY$1.NODE_OPACITY, - NODE_CACHE = _enums$NODE_KEY$1.NODE_CACHE, - NODE_CACHE_FILTER = _enums$NODE_KEY$1.NODE_CACHE_FILTER, - NODE_CACHE_OVERFLOW = _enums$NODE_KEY$1.NODE_CACHE_OVERFLOW, - NODE_HAS_CONTENT = _enums$NODE_KEY$1.NODE_HAS_CONTENT, - NODE_COMPUTED_STYLE = _enums$NODE_KEY$1.NODE_COMPUTED_STYLE; // 根据一个共享cache的信息,生成一个独立的离屏canvas,一般是filter,mask用 + var _enums$STYLE_KEY$k = enums.STYLE_KEY, + TRANSFORM_ORIGIN$3 = _enums$STYLE_KEY$k.TRANSFORM_ORIGIN, + TRANSFORM$3 = _enums$STYLE_KEY$k.TRANSFORM, + DISPLAY$9 = _enums$STYLE_KEY$k.DISPLAY, + VISIBILITY$6 = _enums$STYLE_KEY$k.VISIBILITY, + _enums$NODE_KEY$9 = enums.NODE_KEY, + NODE_OPACITY$3 = _enums$NODE_KEY$9.NODE_OPACITY, + NODE_CACHE$5 = _enums$NODE_KEY$9.NODE_CACHE, + NODE_CACHE_FILTER$3 = _enums$NODE_KEY$9.NODE_CACHE_FILTER, + NODE_CACHE_OVERFLOW$3 = _enums$NODE_KEY$9.NODE_CACHE_OVERFLOW, + NODE_HAS_CONTENT$1 = _enums$NODE_KEY$9.NODE_HAS_CONTENT, + NODE_COMPUTED_STYLE$5 = _enums$NODE_KEY$9.NODE_COMPUTED_STYLE; // 根据一个共享cache的信息,生成一个独立的离屏canvas,一般是filter,mask用 function genSingle(cache, message) { var size = cache.size, @@ -10939,9 +10940,9 @@ list.forEach(function (item) { var __config = item.__config; - var cacheOverflow = __config[NODE_CACHE_OVERFLOW], - cacheFilter = __config[NODE_CACHE_FILTER], - cache = __config[NODE_CACHE]; + var cacheOverflow = __config[NODE_CACHE_OVERFLOW$3], + cacheFilter = __config[NODE_CACHE_FILTER$3], + cache = __config[NODE_CACHE$5]; var source = cacheOverflow && cacheOverflow.available && cacheOverflow; if (!source) { @@ -10953,12 +10954,12 @@ } if (source) { - ctx.globalAlpha = __config[NODE_OPACITY]; - Cache.drawCache(source, cacheMask, __config[NODE_COMPUTED_STYLE][TRANSFORM$1], mx.identity(), __config[NODE_COMPUTED_STYLE][TRANSFORM_ORIGIN$2].slice(0), inverse); + ctx.globalAlpha = __config[NODE_OPACITY$3]; + Cache.drawCache(source, cacheMask, __config[NODE_COMPUTED_STYLE$5][TRANSFORM$3], mx.identity(), __config[NODE_COMPUTED_STYLE$5][TRANSFORM_ORIGIN$3].slice(0), inverse); } // 没有内容或者img没加载成功导致没有内容,有内容且可见则是超限,不可能进这里 - else if (__config[NODE_HAS_CONTENT] && __config[NODE_COMPUTED_STYLE][DISPLAY$1] !== 'none' && __config[NODE_COMPUTED_STYLE][VISIBILITY$1] !== 'hidden') { - inject.error('CacheMask is oversize'); - } + else if (__config[NODE_HAS_CONTENT$1] && __config[NODE_COMPUTED_STYLE$5][DISPLAY$9] !== 'none' && __config[NODE_COMPUTED_STYLE$5][VISIBILITY$6] !== 'hidden') { + inject.error('CacheMask is oversize'); + } }); ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.globalAlpha = 1; @@ -11104,15 +11105,15 @@ }(); 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; + var STYLE_KEY$1 = enums.STYLE_KEY, + _enums$STYLE_KEY$j = enums.STYLE_KEY, + TRANSLATE_X$2 = _enums$STYLE_KEY$j.TRANSLATE_X, + TRANSLATE_Y$2 = _enums$STYLE_KEY$j.TRANSLATE_Y, + TRANSLATE_Z$2 = _enums$STYLE_KEY$j.TRANSLATE_Z, + OPACITY$4 = _enums$STYLE_KEY$j.OPACITY, + FILTER$5 = _enums$STYLE_KEY$j.FILTER, + PERSPECTIVE$3 = _enums$STYLE_KEY$j.PERSPECTIVE, + PERSPECTIVE_ORIGIN$3 = _enums$STYLE_KEY$j.PERSPECTIVE_ORIGIN; var ENUM = { // 低位表示 0; }, @@ -11168,11 +11169,11 @@ return ENUM.TRANSLATE_Z; } else if (TRANSFORMS.hasOwnProperty(k)) { return ENUM.TRANSFORM; - } else if (k === OPACITY$1) { + } else if (k === OPACITY$4) { return ENUM.OPACITY; - } else if (k === FILTER$1) { + } else if (k === FILTER$5) { return ENUM.FILTER; - } else if (k === PERSPECTIVE$2 || k === PERSPECTIVE_ORIGIN$1) { + } else if (k === PERSPECTIVE$3 || k === PERSPECTIVE_ORIGIN$3) { return ENUM.PERSPECTIVE; } else if (o$2.isRepaint(k)) { return ENUM.REPAINT; @@ -11190,41 +11191,41 @@ return lv >= ENUM.REBUILD; } }, ENUM); - o$3.TRANSFORMS = TRANSFORMS; + o$1.TRANSFORMS = TRANSFORMS; - var _enums$STYLE_KEY$7 = enums.STYLE_KEY, - DISPLAY$2 = _enums$STYLE_KEY$7.DISPLAY, - LINE_HEIGHT$1 = _enums$STYLE_KEY$7.LINE_HEIGHT, - FONT_SIZE$5 = _enums$STYLE_KEY$7.FONT_SIZE, - FONT_FAMILY$2 = _enums$STYLE_KEY$7.FONT_FAMILY, - FONT_STYLE$2 = _enums$STYLE_KEY$7.FONT_STYLE, - FONT_WEIGHT$2 = _enums$STYLE_KEY$7.FONT_WEIGHT, - COLOR$2 = _enums$STYLE_KEY$7.COLOR, - VISIBILITY$2 = _enums$STYLE_KEY$7.VISIBILITY, - LETTER_SPACING$2 = _enums$STYLE_KEY$7.LETTER_SPACING, - OVERFLOW = _enums$STYLE_KEY$7.OVERFLOW, - WHITE_SPACE$1 = _enums$STYLE_KEY$7.WHITE_SPACE, - TEXT_OVERFLOW$1 = _enums$STYLE_KEY$7.TEXT_OVERFLOW, - WIDTH$2 = _enums$STYLE_KEY$7.WIDTH, - TEXT_STROKE_COLOR$2 = _enums$STYLE_KEY$7.TEXT_STROKE_COLOR, - TEXT_STROKE_WIDTH$2 = _enums$STYLE_KEY$7.TEXT_STROKE_WIDTH, - _enums$NODE_KEY$2 = enums.NODE_KEY, - NODE_CACHE$1 = _enums$NODE_KEY$2.NODE_CACHE, - NODE_LIMIT_CACHE = _enums$NODE_KEY$2.NODE_LIMIT_CACHE, - NODE_DOM_PARENT = _enums$NODE_KEY$2.NODE_DOM_PARENT, - NODE_MATRIX_EVENT = _enums$NODE_KEY$2.NODE_MATRIX_EVENT, - NODE_OPACITY$1 = _enums$NODE_KEY$2.NODE_OPACITY, - NODE_VIRTUAL_DOM = _enums$NODE_KEY$2.NODE_VIRTUAL_DOM, - _enums$UPDATE_KEY = enums.UPDATE_KEY, - UPDATE_NODE = _enums$UPDATE_KEY.UPDATE_NODE, - UPDATE_MEASURE = _enums$UPDATE_KEY.UPDATE_MEASURE, - UPDATE_FOCUS = _enums$UPDATE_KEY.UPDATE_FOCUS, - UPDATE_CONFIG = _enums$UPDATE_KEY.UPDATE_CONFIG; + var _enums$STYLE_KEY$i = enums.STYLE_KEY, + DISPLAY$8 = _enums$STYLE_KEY$i.DISPLAY, + LINE_HEIGHT$3 = _enums$STYLE_KEY$i.LINE_HEIGHT, + FONT_SIZE$c = _enums$STYLE_KEY$i.FONT_SIZE, + FONT_FAMILY$2 = _enums$STYLE_KEY$i.FONT_FAMILY, + FONT_STYLE$2 = _enums$STYLE_KEY$i.FONT_STYLE, + FONT_WEIGHT$2 = _enums$STYLE_KEY$i.FONT_WEIGHT, + COLOR$3 = _enums$STYLE_KEY$i.COLOR, + VISIBILITY$5 = _enums$STYLE_KEY$i.VISIBILITY, + LETTER_SPACING = _enums$STYLE_KEY$i.LETTER_SPACING, + OVERFLOW$3 = _enums$STYLE_KEY$i.OVERFLOW, + WHITE_SPACE$1 = _enums$STYLE_KEY$i.WHITE_SPACE, + TEXT_OVERFLOW$1 = _enums$STYLE_KEY$i.TEXT_OVERFLOW, + WIDTH$6 = _enums$STYLE_KEY$i.WIDTH, + TEXT_STROKE_COLOR$2 = _enums$STYLE_KEY$i.TEXT_STROKE_COLOR, + TEXT_STROKE_WIDTH$1 = _enums$STYLE_KEY$i.TEXT_STROKE_WIDTH, + _enums$NODE_KEY$8 = enums.NODE_KEY, + NODE_CACHE$4 = _enums$NODE_KEY$8.NODE_CACHE, + NODE_LIMIT_CACHE$2 = _enums$NODE_KEY$8.NODE_LIMIT_CACHE, + NODE_DOM_PARENT$6 = _enums$NODE_KEY$8.NODE_DOM_PARENT, + NODE_MATRIX_EVENT$4 = _enums$NODE_KEY$8.NODE_MATRIX_EVENT, + NODE_OPACITY$2 = _enums$NODE_KEY$8.NODE_OPACITY, + NODE_VIRTUAL_DOM$2 = _enums$NODE_KEY$8.NODE_VIRTUAL_DOM, + _enums$UPDATE_KEY$5 = enums.UPDATE_KEY, + UPDATE_NODE$5 = _enums$UPDATE_KEY$5.UPDATE_NODE, + UPDATE_MEASURE$2 = _enums$UPDATE_KEY$5.UPDATE_MEASURE, + UPDATE_FOCUS$4 = _enums$UPDATE_KEY$5.UPDATE_FOCUS, + UPDATE_CONFIG$5 = _enums$UPDATE_KEY$5.UPDATE_CONFIG; var ELLIPSIS = textCache.ELLIPSIS; - var AUTO$1 = o.AUTO, - REM$4 = o.REM, - VW$4 = o.VW, - VH$4 = o.VH; + var AUTO$7 = o$4.AUTO, + REM$c = o$4.REM, + VW$c = o$4.VW, + VH$c = o$4.VH; var Text = /*#__PURE__*/function (_Node) { _inherits(Text, _Node); @@ -11271,9 +11272,9 @@ } this.__ff = ff; - var fs = computedStyle[FONT_SIZE$5]; + var fs = computedStyle[FONT_SIZE$c]; var fw = computedStyle[FONT_WEIGHT$2]; - var key = this.__key = computedStyle[FONT_SIZE$5] + ',' + ff + ',' + fw; + var key = this.__key = computedStyle[FONT_SIZE$c] + ',' + ff + ',' + fw; var wait = textCache.data[key] = textCache.data[key] || { ff: ff, fs: fs, @@ -11287,7 +11288,7 @@ var bp = this.domParent; - while (bp.currentStyle[DISPLAY$2] === 'inline') { + while (bp.currentStyle[DISPLAY$8] === 'inline') { bp = bp.domParent; } @@ -11302,7 +11303,7 @@ } } - var pfs = parentComputedStyle[FONT_SIZE$5]; + var pfs = parentComputedStyle[FONT_SIZE$c]; var pfw = parentComputedStyle[FONT_WEIGHT$2]; var pKey = this.__pKey = pfs + ',' + pff + ',' + pfw; var parentCache = textCache.charWidth[pKey] = textCache.charWidth[pKey] || {}; @@ -11401,7 +11402,7 @@ }, { key: "__layout", value: function __layout(data) { - var __cache = this.__config[NODE_CACHE$1]; + var __cache = this.__config[NODE_CACHE$4]; if (__cache) { __cache.release(); @@ -11432,9 +11433,9 @@ __key = this.__key; textBoxes.splice(0); var __config = this.__config; - __config[NODE_LIMIT_CACHE] = false; // 空内容w/h都为0可以提前跳出 + __config[NODE_LIMIT_CACHE$2] = false; // 空内容w/h都为0可以提前跳出 - if (isDestroyed || currentStyle[DISPLAY$2] === 'none' || !content) { + if (isDestroyed || currentStyle[DISPLAY$8] === 'none' || !content) { return lineClampCount; } @@ -11447,13 +11448,13 @@ var count = beginSpace; var length = content.length; var maxW = 0; - var lineHeight = computedStyle[LINE_HEIGHT$1], - letterSpacing = computedStyle[LETTER_SPACING$2], + var lineHeight = computedStyle[LINE_HEIGHT$3], + letterSpacing = computedStyle[LETTER_SPACING], whiteSpace = computedStyle[WHITE_SPACE$1], - fontSize = computedStyle[FONT_SIZE$5], + fontSize = computedStyle[FONT_SIZE$c], fontWeight = computedStyle[FONT_WEIGHT$2]; // 特殊字体中特殊字符连续时需减少一定的padding量 - var padding = o$1.info[__ff].padding; + var padding = o$3.info[__ff].padding; var needReduce = !!padding; var lastChar; var ew = textCache.charWidth[this.__pKey][ELLIPSIS]; @@ -11464,9 +11465,9 @@ var bp = this.__bp; var _bp$currentStyle = bp.currentStyle, - display = _bp$currentStyle[DISPLAY$2], - overflow = _bp$currentStyle[OVERFLOW], - width = _bp$currentStyle[WIDTH$2], + display = _bp$currentStyle[DISPLAY$8], + overflow = _bp$currentStyle[OVERFLOW$3], + width = _bp$currentStyle[WIDTH$6], textOverflow = _bp$currentStyle[TEXT_OVERFLOW$1]; // 只要是overflow隐藏,不管textOverflow如何(默认是clip等同于overflow:hidden的功能)都截取 if (overflow === 'hidden') { @@ -11477,7 +11478,7 @@ // block/flex无需宽度,inline-block需要设置宽度才生效 if (display === 'block' || display === 'flex') { isTextOverflow = true; - } else if (width[1] !== AUTO$1) { + } else if (width[1] !== AUTO$7) { isTextOverflow = true; } @@ -11502,213 +11503,213 @@ maxW = _this$__lineBack2[1]; } // 默认clip跟随overflow:hidden,无需感知 else { - var textBox = new TextBox(this, textBoxes.length, x, y, count - beginSpace, lineHeight, content, charWidthList); - textBoxes.push(textBox); - lineBoxManager.addItem(textBox); - maxW = count - beginSpace; - y += lineHeight; - } + var textBox = new TextBox(this, textBoxes.length, x, y, count - beginSpace, lineHeight, content, charWidthList); + textBoxes.push(textBox); + lineBoxManager.addItem(textBox); + maxW = count - beginSpace; + y += lineHeight; + } } // 普通换行,注意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中 + while (i < length) { + var cw = charWidthList[i] + letterSpacing; + count += cw; // 连续字符减少padding,除了连续还需判断char是否在padding的hash中 - if (needReduce) { - var _char2 = content[i]; + if (needReduce) { + var _char2 = content[i]; - if (_char2 === lastChar && padding.hasOwnProperty(_char2) && padding[_char2]) { - var hasCache = void 0, - p = textCache.padding[__key] = textCache.padding[__key] || {}; + if (_char2 === lastChar && padding.hasOwnProperty(_char2) && padding[_char2]) { + var hasCache = void 0, + p = textCache.padding[__key] = textCache.padding[__key] || {}; - if (textCache.padding.hasOwnProperty(__key)) { - if (p.hasOwnProperty(_char2)) { - hasCache = true; - count -= p[_char2]; - } + 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]; - } - - count -= n; - p[_char2] = n; + 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]; } + + count -= n; + p[_char2] = n; } + } - lastChar = _char2; - } // 忽略零宽字符 + lastChar = _char2; + } // 忽略零宽字符 - if (cw === 0) { - i++; - continue; - } // 换行都要判断i不是0的时候,第1个字符强制不换行 + if (cw === 0) { + i++; + continue; + } // 换行都要判断i不是0的时候,第1个字符强制不换行 - if (count === w) { - // 多行文本截断,这里肯定需要回退 - if (lineClamp && lineCount + lineClampCount >= lineClamp - 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); + if (count === w) { + // 多行文本截断,这里肯定需要回退 + if (lineClamp && lineCount + lineClampCount >= lineClamp - 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); - var _this$__lineBack4 = _slicedToArray(_this$__lineBack3, 2); + var _this$__lineBack4 = _slicedToArray(_this$__lineBack3, 2); - y = _this$__lineBack4[0]; - maxW = _this$__lineBack4[1]; - lineCount++; - break; - } + y = _this$__lineBack4[0]; + maxW = _this$__lineBack4[1]; + lineCount++; + break; + } - var _textBox = void 0; // 特殊情况,恰好最后一行最后一个排满,此时查看末尾mpb,要防止i为0的情况首个字符特殊不回退,无需看开头mpb + var _textBox = void 0; // 特殊情况,恰好最后一行最后一个排满,此时查看末尾mpb,要防止i为0的情况首个字符特殊不回退,无需看开头mpb - if (i === length - 1 && count > w - endSpace && i) { - count -= charWidthList[i--]; - } + if (i === length - 1 && count > w - endSpace && i) { + count -= charWidthList[i--]; + } - i++; + i++; - 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 (!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行影响 - textBoxes.push(_textBox); - lineBoxManager.addItem(_textBox, true); - y += Math.max(lineHeight, lineBoxManager.lineHeight); - begin = i; - count = 0; + 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); + + var _this$__lineBack6 = _slicedToArray(_this$__lineBack5, 2); + + y = _this$__lineBack6[0]; + maxW = _this$__lineBack6[1]; 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); - - var _this$__lineBack6 = _slicedToArray(_this$__lineBack5, 2); - - y = _this$__lineBack6[0]; - maxW = _this$__lineBack6[1]; - lineCount++; - break; - } // 普通非多行文本阶段逻辑 + break; + } // 普通非多行文本阶段逻辑 - var _width = void 0; // 宽度不足时无法跳出循环,至少也要塞个字符形成一行,无需判断第1行,因为是否放得下逻辑在dom中做过了, - // 如果第1行放不下,一定会另起一行,此时作为开头再放不下才会进这里,这个if只有0或1个字符的情况 + var _width = void 0; // 宽度不足时无法跳出循环,至少也要塞个字符形成一行,无需判断第1行,因为是否放得下逻辑在dom中做过了, + // 如果第1行放不下,一定会另起一行,此时作为开头再放不下才会进这里,这个if只有0或1个字符的情况 - if (i <= begin) { - _width = count; - } // 超过2个字符回退1个 - else { - _width = count - charWidthList[i--]; - } + if (i <= begin) { + _width = count; + } // 超过2个字符回退1个 + else { + _width = count - charWidthList[i--]; + } - i++; // 根据是否第一行分开处理行首空白 + i++; // 根据是否第一行分开处理行首空白 - var _textBox2 = void 0; + var _textBox2 = void 0; - 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,同上 - - - 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 (!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,同上 - if (lineCount) { - this.__x = this.__sx1 = lx; - } // 最后一行,只有一行未满时也进这里,需查看末尾mpb,排不下回退一个字符 - // 声明了lineClamp时特殊考虑,这里一定是最后一行,要对比行数不能超过,超过忽略掉这些文本 + 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 (begin < length && (!lineClamp || lineCount + lineClampCount < lineClamp)) { - var _textBox3; + if (lineCount) { + this.__x = this.__sx1 = lx; + } // 最后一行,只有一行未满时也进这里,需查看末尾mpb,排不下回退一个字符 + // 声明了lineClamp时特殊考虑,这里一定是最后一行,要对比行数不能超过,超过忽略掉这些文本 - if (!lineCount) { - var needBack; // 防止开头第一个begin=0时回退,这在inline有padding且是第一个child时会发生 - if (begin && count > w - endSpace) { - needBack = true; - count -= charWidthList[length - 1]; - } + if (begin < length && (!lineClamp || lineCount + lineClampCount < lineClamp)) { + var _textBox3; - 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)); + if (!lineCount) { + var needBack; // 防止开头第一个begin=0时回退,这在inline有padding且是第一个child时会发生 + + if (begin && count > w - endSpace) { + needBack = true; + count -= charWidthList[length - 1]; + } + + 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 += Math.max(lineHeight, lineBoxManager.lineHeight); + y += lineHeight; + lineCount++; + } + } else { + var _needBack; // 防止begin在结尾时回退,必须要有个字符,这在最后一行1个字符排不下时会出现 - 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++; - } - } else { - var _needBack; // 防止begin在结尾时回退,必须要有个字符,这在最后一行1个字符排不下时会出现 + if (count > w - endSpace && begin < length - 1) { + _needBack = true; + count -= charWidthList[length - 1]; + } - if (count > w - endSpace && begin < length - 1) { - _needBack = true; - count -= charWidthList[length - 1]; - } + _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); - _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); + 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 += 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++; - } + y += lineHeight; + lineCount++; } } } + } this.__width = maxW; this.__height = y - data.y; @@ -11752,40 +11753,40 @@ } // 向前查找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 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(); } - - list.pop(); - tb.parent.textBoxes.pop(); + } + } // 不够则看前一个tb并且删掉这个 + else { + count -= width; } + + list.pop(); + tb.parent.textBoxes.pop(); } + } } return [y, maxW]; @@ -11875,13 +11876,13 @@ __config = this.__config; if (renderMode === mode.SVG) { - __config[NODE_VIRTUAL_DOM] = this.__virtualDom = { + __config[NODE_VIRTUAL_DOM$2] = this.__virtualDom = { type: 'text', children: [] }; } - if (isDestroyed || computedStyle[DISPLAY$2] === 'none' || computedStyle[VISIBILITY$2] === 'hidden' || !textBoxes.length) { + if (isDestroyed || computedStyle[DISPLAY$8] === 'none' || computedStyle[VISIBILITY$5] === 'hidden' || !textBoxes.length) { return; } @@ -11892,7 +11893,7 @@ var sx = this.sx, sy = this.sy, bbox = this.bbox; - var __cache = __config[NODE_CACHE$1]; + var __cache = __config[NODE_CACHE$4]; if (__cache) { __cache.reset(bbox, sx, sy); @@ -11901,23 +11902,23 @@ } if (__cache && __cache.enabled) { - __config[NODE_CACHE$1] = __cache; + __config[NODE_CACHE$4] = __cache; __cache.__available = true; ctx = __cache.ctx; dx += __cache.dx; dy += __cache.dy; - __config[NODE_LIMIT_CACHE] = false; + __config[NODE_LIMIT_CACHE$2] = false; } else { - __config[NODE_LIMIT_CACHE] = true; + __config[NODE_LIMIT_CACHE$2] = true; return; } } else { var _root = this.root; var c = inject.getCacheCanvas(_root.width, _root.height, '__$$OVERSIZE$$__'); ctx = c.ctx; - var _config$NODE_DOM_PAR = __config[NODE_DOM_PARENT].__config, - m = _config$NODE_DOM_PAR[NODE_MATRIX_EVENT], - opacity = _config$NODE_DOM_PAR[NODE_OPACITY$1]; + var _config$NODE_DOM_PAR = __config[NODE_DOM_PARENT$6].__config, + m = _config$NODE_DOM_PAR[NODE_MATRIX_EVENT$4], + opacity = _config$NODE_DOM_PAR[NODE_OPACITY$2]; ctx.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]); ctx.globalAlpha = opacity; } @@ -11929,13 +11930,13 @@ ctx.font = _font; } - var color = cacheStyle[COLOR$2]; + var color = cacheStyle[COLOR$3]; if (ctx.fillStyle !== color) { ctx.fillStyle = color; } - var strokeWidth = computedStyle[TEXT_STROKE_WIDTH$2]; + var strokeWidth = computedStyle[TEXT_STROKE_WIDTH$1]; if (ctx.lineWidth !== strokeWidth) { ctx.lineWidth = strokeWidth; @@ -11973,7 +11974,7 @@ ctx.font = _font2; } - var _color = __bp.__cacheStyle[COLOR$2]; + var _color = __bp.__cacheStyle[COLOR$3]; if (ctx.fillStyle !== _color) { ctx.fillStyle = _color; @@ -11981,7 +11982,7 @@ 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']]; + var props = [['x', endX], ['y', endY], ['fill', __bp.__cacheStyle[COLOR$3]], ['font-family', _computedStyle[FONT_FAMILY$2]], ['font-weight', _computedStyle[FONT_WEIGHT$2]], ['font-style', _computedStyle[FONT_STYLE$2]], ['font-size', _computedStyle[FONT_SIZE$c] + 'px']]; this.virtualDom.children.push({ type: 'item', tagName: 'text', @@ -12005,7 +12006,7 @@ _get(_getPrototypeOf(Text.prototype), "__destroy", this).call(this); - var __cache = this.__config[NODE_CACHE$1]; + var __cache = this.__config[NODE_CACHE$4]; if (__cache) { __cache.release(); @@ -12035,10 +12036,10 @@ self.__content = s; 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; + res[UPDATE_NODE$5] = vd; + res[UPDATE_MEASURE$2] = true; + res[UPDATE_FOCUS$4] = o$1.REFLOW; + res[UPDATE_CONFIG$5] = vd.__config; var root = vd.root; root.__addUpdate(vd, vd.__config, root, root.__config, res); @@ -12091,12 +12092,12 @@ }, { key: "root", get: function get() { - return this.domParent.root; + return (this.domParent || {}).root; } }, { key: "currentStyle", get: function get() { - return this.domParent.currentStyle; + return (this.domParent || {}).currentStyle; } }, { key: "style", @@ -12106,12 +12107,12 @@ }, { key: "computedStyle", get: function get() { - return this.domParent.computedStyle; + return (this.domParent || {}).computedStyle; } }, { key: "cacheStyle", get: function get() { - return this.domParent.__cacheStyle; + return (this.domParent || {}).__cacheStyle; } }, { key: "bbox", @@ -12121,14 +12122,17 @@ width = this.width, height = this.height, root = this.root, - textStrokeWidth = this.currentStyle[TEXT_STROKE_WIDTH$2]; + _this$currentStyle = this.currentStyle; + _this$currentStyle = _this$currentStyle === void 0 ? {} : _this$currentStyle; + var _this$currentStyle$TE = _this$currentStyle[TEXT_STROKE_WIDTH$1], + textStrokeWidth = _this$currentStyle$TE === void 0 ? [0] : _this$currentStyle$TE; var half = 0; - if (textStrokeWidth[1] === REM$4) { - half = Math.max(textStrokeWidth[0] * root.computedStyle[FONT_SIZE$5] * 0.5, half); - } else if (textStrokeWidth[1] === VW$4) { + if (textStrokeWidth[1] === REM$c) { + half = Math.max(textStrokeWidth[0] * root.computedStyle[FONT_SIZE$c] * 0.5, half); + } else if (textStrokeWidth[1] === VW$c) { half = Math.max(textStrokeWidth[0] * root.width * 0.01 * 0.5, half); - } else if (textStrokeWidth[1] === VH$4) { + } else if (textStrokeWidth[1] === VH$c) { half = Math.max(textStrokeWidth[0] * root.height * 0.01 * 0.5, half); } else { half = Math.max(textStrokeWidth[0] * 0.5, half); @@ -12159,9 +12163,9 @@ Text.prototype.__renderByMask = Text.prototype.render; - var TYPE_VD$1 = $$type.TYPE_VD, - TYPE_GM$1 = $$type.TYPE_GM, - TYPE_CP$1 = $$type.TYPE_CP; + var TYPE_VD$3 = $$type.TYPE_VD, + TYPE_GM$3 = $$type.TYPE_GM, + TYPE_CP$3 = $$type.TYPE_CP; /** * 2. 打平children中的数组,变成一维 * 3. 合并相连的Text节点,即string内容 @@ -12172,7 +12176,7 @@ return parent.map(function (item) { return flattenJson(item); }); - } else if (!parent || [TYPE_VD$1, TYPE_GM$1, TYPE_CP$1].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) { + } else if (!parent || [TYPE_VD$3, TYPE_GM$3, TYPE_CP$3].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) { return parent; } @@ -12189,42 +12193,42 @@ children.forEach(function (item) { traverseJson(list, item, options); }); - } else if (children && (children.$$type === TYPE_VD$1 || children.$$type === TYPE_GM$1)) { + } else if (children && (children.$$type === TYPE_VD$3 || children.$$type === TYPE_GM$3)) { if (['canvas', 'svg', 'webgl'].indexOf(children.tagName) > -1) { throw new Error('Can not nest canvas/svg/webgl'); } - if (children.$$type === TYPE_VD$1) { + if (children.$$type === TYPE_VD$3) { flattenJson(children); } list.push(children); options.lastText = null; - } else if (children && children.$$type === TYPE_CP$1) { + } else if (children && children.$$type === TYPE_CP$3) { list.push(children); // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做 options.lastText = null; } // 排除掉空的文本,连续的text合并 else if (!util.isNil(children) && children !== '') { - if (options.lastText !== null) { - list[list.length - 1] = options.lastText += children; - } else { - list.push(children); - } + if (options.lastText !== null) { + list[list.length - 1] = options.lastText += children; + } else { + list.push(children); } + } } - var _enums$NODE_KEY$3 = enums.NODE_KEY, - NODE_DOM_PARENT$1 = _enums$NODE_KEY$3.NODE_DOM_PARENT, - NODE_STYLE = _enums$NODE_KEY$3.NODE_STYLE, - NODE_CURRENT_STYLE = _enums$NODE_KEY$3.NODE_CURRENT_STYLE, - NODE_COMPUTED_STYLE$1 = _enums$NODE_KEY$3.NODE_COMPUTED_STYLE, - NODE_MATRIX = _enums$NODE_KEY$3.NODE_MATRIX, - NODE_MATRIX_EVENT$1 = _enums$NODE_KEY$3.NODE_MATRIX_EVENT; + var _enums$NODE_KEY$7 = enums.NODE_KEY, + NODE_DOM_PARENT$5 = _enums$NODE_KEY$7.NODE_DOM_PARENT, + NODE_STYLE$5 = _enums$NODE_KEY$7.NODE_STYLE, + NODE_CURRENT_STYLE$6 = _enums$NODE_KEY$7.NODE_CURRENT_STYLE, + NODE_COMPUTED_STYLE$4 = _enums$NODE_KEY$7.NODE_COMPUTED_STYLE, + NODE_MATRIX$3 = _enums$NODE_KEY$7.NODE_MATRIX, + NODE_MATRIX_EVENT$3 = _enums$NODE_KEY$7.NODE_MATRIX_EVENT; var TYPE_VD$2 = $$type.TYPE_VD, TYPE_GM$2 = $$type.TYPE_GM, TYPE_CP$2 = $$type.TYPE_CP; - var Xom, Dom, Img, Geom, Component; + var Xom$1, Dom$1, Img$1, Geom$1, Component$1; function initRoot(cd, root) { var c = flattenJson({ @@ -12250,8 +12254,8 @@ return build(json, root, host); } // text的relation会由上层如Root设置 else { - return new Text(json); - } + return new Text(json); + } } function initCp2(json, root, host, parent) { @@ -12299,13 +12303,13 @@ if (_$$type === TYPE_VD$2) { if (tagName === 'img') { - vd = new Img(tagName, props); + vd = new Img$1(tagName, props); if (Array.isArray(children) && children.length) { throw new Error('Img can not contain children'); } } else { - vd = new Dom(tagName, props); + vd = new Dom$1(tagName, props); } // 检查p不能包含div @@ -12323,7 +12327,7 @@ vd.__children = children; } else if (_$$type === TYPE_GM$2) { - var _klass = Geom.getRegister(tagName); + var _klass = Geom$1.getRegister(tagName); vd = new _klass(tagName, props); } else if (_$$type === TYPE_CP$2) { @@ -12389,18 +12393,18 @@ children.forEach(function (item) { relation(parent, item, options); }); - } else if (children instanceof Xom || children instanceof Component || children instanceof Text) { + } else if (children instanceof Xom$1 || children instanceof Component$1 || children instanceof Text) { children.__parent = parent; children.__domParent = parent; // 极为恶心,为了v8的性能优化,text复用parent的__config部分,但domParent重设 if (children instanceof Text) { - [NODE_STYLE, NODE_CURRENT_STYLE, NODE_COMPUTED_STYLE$1, NODE_MATRIX, NODE_MATRIX_EVENT$1].forEach(function (k) { + [NODE_STYLE$5, NODE_CURRENT_STYLE$6, NODE_COMPUTED_STYLE$4, NODE_MATRIX$3, NODE_MATRIX_EVENT$3].forEach(function (k) { children.__config[k] = parent.__config[k]; }); } if (children.__config) { - children.__config[NODE_DOM_PARENT$1] = parent; + children.__config[NODE_DOM_PARENT$5] = parent; } if (options.prev) { @@ -12410,12 +12414,12 @@ options.prev = children; // 文字视作为父节点的直接文字子节点 - if (children instanceof Component) { + if (children instanceof Component$1) { var sr = children.shadowRoot; if (sr instanceof Text) { sr.__parent = parent; - [NODE_STYLE, NODE_CURRENT_STYLE, NODE_COMPUTED_STYLE$1, NODE_MATRIX, NODE_MATRIX_EVENT$1].forEach(function (k) { + [NODE_STYLE$5, NODE_CURRENT_STYLE$6, NODE_COMPUTED_STYLE$4, NODE_MATRIX$3, NODE_MATRIX_EVENT$3].forEach(function (k) { children.__config[k] = parent.__config[k]; }); } @@ -12423,7 +12427,7 @@ sr.__domParent = parent; if (sr.__config) { - sr.__config[NODE_DOM_PARENT$1] = parent; + sr.__config[NODE_DOM_PARENT$5] = parent; } } } @@ -12433,11 +12437,11 @@ var builder = { ref: function ref(o) { - Xom = o.Xom; - Dom = o.Dom; - Img = o.Img; - Geom = o.Geom; - Component = o.Component; + Xom$1 = o.Xom; + Dom$1 = o.Dom; + Img$1 = o.Img; + Geom$1 = o.Geom; + Component$1 = o.Component; }, initRoot: initRoot, initDom: initDom, @@ -12446,7 +12450,7 @@ relation: relation }; - var isFunction$1 = util.isFunction; + var isFunction$7 = util.isFunction; var Event = /*#__PURE__*/function () { function Event() { @@ -12458,7 +12462,7 @@ _createClass(Event, [{ key: "on", value: function on(id, handle) { - if (!isFunction$1(handle)) { + if (!isFunction$7(handle)) { return; } @@ -12488,7 +12492,7 @@ }, { key: "once", value: function once(id, handle) { - if (!isFunction$1(handle)) { + if (!isFunction$7(handle)) { return; } @@ -12535,8 +12539,8 @@ } } // 未定义为全部清除 else { - delete self.__eHash[id]; - } + delete self.__eHash[id]; + } } return this; @@ -12564,7 +12568,7 @@ for (var _i3 = 0, _len5 = list.length; _i3 < _len5; _i3++) { var cb = list[_i3]; - if (isFunction$1(cb)) { + if (isFunction$7(cb)) { cb.apply(self, data); } } @@ -12610,11 +12614,11 @@ _defineProperty(Event, "END", 'end'); - var isNil$4 = util.isNil, - isFunction$2 = util.isFunction, - clone$1 = util.clone, + var isNil$b = util.isNil, + isFunction$6 = util.isFunction, + clone$3 = util.clone, extend$1 = util.extend; - var REGISTER = {}; + var REGISTER$1 = {}; /** * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归 * 在check时树递归会用到,判断是否需要查找cp更新 @@ -12635,7 +12639,7 @@ } } - var Component$1 = /*#__PURE__*/function (_Event) { + var Component = /*#__PURE__*/function (_Event) { _inherits(Component, _Event); var _super = _createSuper(Component); @@ -12672,20 +12676,20 @@ var self = this; - if (isNil$4(n)) { + if (isNil$b(n)) { n = {}; - } else if (isFunction$2(n)) { + } else if (isFunction$6(n)) { return; } else { if (Object.keys(n).length === 0) { - if (isFunction$2(cb)) { + if (isFunction$6(cb)) { cb.call(self); } return; } - var state = clone$1(self.state); + var state = clone$3(self.state); n = extend$1(state, n); } @@ -12711,7 +12715,7 @@ __after: function __after() { // self.__nextState = null; 由updater.js每次refresh前同步执行清空,这里不能异步清除,否则frame动画会乱序 list.forEach(function (cb) { - if (isFunction$2(cb)) { + if (isFunction$6(cb)) { cb.call(self); } }); @@ -12720,10 +12724,10 @@ root.addRefreshCp(t); } } // 构造函数中调用还未render, - else if (isFunction$2(cb)) { - self.state = n; - cb.call(self); - } + else if (isFunction$6(cb)) { + self.state = n; + cb.call(self); + } } /** * build中调用初始化,json有值时是update过程才有,且处理过flatten @@ -12788,7 +12792,7 @@ if (!this.__isMounted) { this.__isMounted = true; - if (isFunction$2(this.componentDidMount)) { + if (isFunction$6(this.componentDidMount)) { root.once(Event.REFRESH, function () { _this3.componentDidMount(); }); @@ -12810,7 +12814,7 @@ this.__isDestroyed = true; this.__isMounted = false; - if (isFunction$2(this.componentWillUnmount)) { + if (isFunction$6(this.componentWillUnmount)) { this.componentWillUnmount(); } @@ -12909,7 +12913,7 @@ }], [{ key: "REGISTER", get: function get() { - return REGISTER; + return REGISTER$1; } }, { key: "getRegister", @@ -12918,11 +12922,11 @@ throw new Error('Invalid param'); } - if (!REGISTER.hasOwnProperty(name)) { + if (!REGISTER$1.hasOwnProperty(name)) { throw new Error("Component has not register: ".concat(name)); } - return REGISTER[name]; + return REGISTER$1[name]; } }, { key: "register", @@ -12935,18 +12939,18 @@ throw new Error("Component has already register: ".concat(name)); } - REGISTER[name] = obj; + REGISTER$1[name] = obj; } }, { key: "hasRegister", value: function hasRegister(name) { - return name && REGISTER.hasOwnProperty(name); + return name && REGISTER$1.hasOwnProperty(name); } }, { key: "delRegister", value: function delRegister(name) { if (Component.hasRegister(name)) { - delete REGISTER[name]; + delete REGISTER$1[name]; } } }]); @@ -12967,7 +12971,7 @@ // '__sy5', // '__sy6', 'width', 'height', 'outerWidth', 'outerHeight', 'clientWidth', 'clientHeight', 'offsetWidth', 'offsetHeight', 'style', 'animationList', 'animateStyle', 'currentStyle', 'computedStyle', 'currentProps', 'baseLine', 'virtualDom', 'mask', 'maskId', 'textWidth', 'content', 'lineBoxes', 'charWidthList', 'charWidth', '__layoutData', 'availableAnimating', 'effectiveAnimating', 'displayAnimating', 'visibilityAnimating', 'bbox', '__config', 'contentBoxList', 'listener', 'matrix', 'matrixEvent']).forEach(function (fn) { - Object.defineProperty(Component$1.prototype, fn, { + Object.defineProperty(Component.prototype, fn, { get: function get() { var sr = this.shadowRoot; @@ -12978,28 +12982,28 @@ }); }); ['__layout', '__layoutAbs', '__layoutNone', '__tryLayInline', '__offsetX', '__offsetY', '__calAutoBasis', '__calMp', '__calAbs', '__renderAsMask', '__renderByMask', '__mp', 'animate', 'removeAnimate', 'clearAnimate', 'updateStyle', 'getBoundingClientRect', 'getComputedStyle', '__deepScan', 'clearCache', '__structure', '__modifyStruct', '__updateStruct', 'flowChildren', 'absChildren', '__isRealInline', '__calBasis', '__calMinMax', '__computeMeasure', 'appendChild', 'prependChild', 'insertBefore', 'insertAfter', 'removeChild', 'remove'].forEach(function (fn) { - Component$1.prototype[fn] = function () { + Component.prototype[fn] = function () { var sr = this.shadowRoot; - if (sr && isFunction$2(sr[fn])) { + if (sr && isFunction$6(sr[fn])) { return sr[fn].apply(sr, arguments); } }; }); - 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 PERCENT$4 = o.PERCENT, - NUMBER$3 = o.NUMBER; + var _enums$STYLE_KEY$h = enums.STYLE_KEY, + SCALE_X$1 = _enums$STYLE_KEY$h.SCALE_X, + SCALE_Y$1 = _enums$STYLE_KEY$h.SCALE_Y; + var PERCENT$8 = o$4.PERCENT, + NUMBER$2 = o$4.NUMBER; function matrixResize(imgWidth, imgHeight, targetWidth, targetHeight, x, y, w, h) { if (imgWidth === targetWidth && imgHeight === targetHeight) { return; } - var list = [[SCALE_X$2, [targetWidth / imgWidth, NUMBER$3]], [SCALE_Y$2, [targetHeight / imgHeight, NUMBER$3]]]; - var tfo = tf.calOrigin([[0, PERCENT$4], [0, PERCENT$4]], w, h); + var list = [[SCALE_X$1, [targetWidth / imgWidth, NUMBER$2]], [SCALE_Y$1, [targetHeight / imgHeight, NUMBER$2]]]; + var tfo = tf.calOrigin([[0, PERCENT$8], [0, PERCENT$8]], w, h); tfo[0] += x; tfo[1] += y; return tf.calMatrixWithOrigin(list, tfo, w, h); @@ -13009,22 +13013,22 @@ 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, - NODE_DEFS_CACHE$1 = enums.NODE_KEY.NODE_DEFS_CACHE; + var _enums$STYLE_KEY$g = enums.STYLE_KEY, + BACKGROUND_POSITION_X$2 = _enums$STYLE_KEY$g.BACKGROUND_POSITION_X, + BACKGROUND_POSITION_Y$2 = _enums$STYLE_KEY$g.BACKGROUND_POSITION_Y, + FONT_SIZE$b = _enums$STYLE_KEY$g.FONT_SIZE, + NODE_DEFS_CACHE$5 = enums.NODE_KEY.NODE_DEFS_CACHE; var clone$2 = util.clone, - joinArr$1 = util.joinArr; - var canvasPolygon$3 = painter.canvasPolygon, - svgPolygon$3 = painter.svgPolygon; - var AUTO$2 = o.AUTO, - PX$4 = o.PX, - PERCENT$5 = o.PERCENT, - STRING$1 = o.STRING, - REM$5 = o.REM, - VW$5 = o.VW, - VH$5 = o.VH; + joinArr$2 = util.joinArr; + var canvasPolygon$4 = painter.canvasPolygon, + svgPolygon$4 = painter.svgPolygon; + var AUTO$6 = o$4.AUTO, + PX$7 = o$4.PX, + PERCENT$7 = o$4.PERCENT, + STRING$1 = o$4.STRING, + REM$b = o$4.REM, + VW$b = o$4.VW, + VH$b = o$4.VH; function renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bbrr, bblr) { var method = arguments.length > 13 && arguments[13] !== undefined ? arguments[13] : 'fill'; @@ -13082,7 +13086,7 @@ ctx.fillStyle = color; } - canvasPolygon$3(ctx, list); + canvasPolygon$4(ctx, list); ctx[method](); ctx.closePath(); @@ -13090,7 +13094,7 @@ ctx.restore(); } } else if (renderMode === mode.SVG) { - var d = svgPolygon$3(list); + var d = svgPolygon$4(list); if (isInline) { var v = { @@ -13103,7 +13107,7 @@ }] }; - xom.__config[NODE_DEFS_CACHE$1].push(v); + xom.__config[NODE_DEFS_CACHE$5].push(v); return ctx.add(v); } else { @@ -13115,7 +13119,7 @@ if (matrix) { var bb = xom.virtualDom.bb; - bb[bb.length - 1].props.push(['transform', "matrix(".concat(joinArr$1(mx.m2m6(matrix), ','), ")")]); + bb[bb.length - 1].props.push(['transform', "matrix(".concat(joinArr$2(mx.m2m6(matrix), ','), ")")]); } } } @@ -13124,17 +13128,17 @@ function calBackgroundSize(value, w, h, root) { var res = []; value.forEach(function (item, i) { - if (item[1] === PX$4) { + if (item[1] === PX$7) { res.push(item[0]); - } else if (item[1] === PERCENT$5) { + } else if (item[1] === PERCENT$7) { res.push(item[0] * (i ? h : w) * 0.01); - } else if (item[1] === REM$5) { - res.push(item[0] * root.computedStyle[FONT_SIZE$6]); - } else if (item[1] === VW$5) { + } else if (item[1] === REM$b) { + res.push(item[0] * root.computedStyle[FONT_SIZE$b]); + } else if (item[1] === VW$b) { res.push(item[0] * root.width * 0.01); - } else if (item[1] === VH$5) { + } else if (item[1] === VH$b) { res.push(item[0] * root.height * 0.01); - } else if (item[1] === AUTO$2) { + } else if (item[1] === AUTO$6) { res.push(-1); } else if (item[1] === STRING$1) { res.push(item[0] === 'contain' ? -2 : -3); @@ -13145,15 +13149,15 @@ function calBackgroundPosition(position, container, size, root) { if (Array.isArray(position)) { - if (position[1] === PX$4) { + if (position[1] === PX$7) { return position[0]; - } else if (position[1] === PERCENT$5) { + } else if (position[1] === PERCENT$7) { return (container - size) * position[0] * 0.01; - } else if (position[1] === REM$5) { - return position[0] * root.computedStyle[FONT_SIZE$6]; - } else if (position[1] === VW$5) { + } else if (position[1] === REM$b) { + return position[0] * root.computedStyle[FONT_SIZE$b]; + } else if (position[1] === VW$b) { return position[0] * root.width * 0.01; - } else if (position[1] === VH$5) { + } else if (position[1] === VH$b) { return position[0] * root.height * 0.01; } } @@ -13237,8 +13241,8 @@ h = w * height / width; } - var bgX = bx1 + calBackgroundPosition(currentStyle[BACKGROUND_POSITION_X$1][i], bgW, w, xom.root); - var bgY = by1 + calBackgroundPosition(currentStyle[BACKGROUND_POSITION_Y$1][i], bgH, h, xom.root); // 超出尺寸模拟mask截取 + var bgX = bx1 + calBackgroundPosition(currentStyle[BACKGROUND_POSITION_X$2][i], bgW, w, xom.root); + var bgY = by1 + calBackgroundPosition(currentStyle[BACKGROUND_POSITION_Y$2][i], bgH, h, xom.root); // 超出尺寸模拟mask截取 var needMask = bgX < bx1 || bgY < by1 || bgX + w > bx1 + bgW || bgY + h > by1 + bgH; // 计算因为repeat,需要向4个方向扩展渲染几个数量图片 @@ -13381,7 +13385,7 @@ if (matrix && !mx.isE(matrix)) { needResize = true; - props.push(['transform', 'matrix(' + joinArr$1(mx.m2m6(matrix), ',') + ')']); + props.push(['transform', 'matrix(' + joinArr$2(mx.m2m6(matrix), ',') + ')']); } if (needMask) { @@ -13403,7 +13407,7 @@ }; var id = ctx.add(v); - __config[NODE_DEFS_CACHE$1].push(v); + __config[NODE_DEFS_CACHE$5].push(v); props.push(['clip-path', 'url(#' + id + ')']); } @@ -13419,7 +13423,7 @@ }] }; - xom.__config[NODE_DEFS_CACHE$1].push(_v); + xom.__config[NODE_DEFS_CACHE$5].push(_v); repeat.forEach(function (item) { var copy = clone$2(props); @@ -13428,7 +13432,7 @@ var _matrix = image.matrixResize(width, height, w, h, item[0], item[1], bgW, bgH); if (_matrix && !mx.isE(_matrix)) { - copy[5][1] = 'matrix(' + joinArr$1(mx.m2m6(_matrix), ',') + ')'; + copy[5][1] = 'matrix(' + joinArr$2(mx.m2m6(_matrix), ',') + ')'; } } @@ -13457,7 +13461,7 @@ var _matrix2 = image.matrixResize(width, height, w, h, item[0], item[1], bgW, bgH); if (_matrix2 && !mx.isE(_matrix2)) { - copy[5][1] = 'matrix(' + joinArr$1(mx.m2m6(_matrix2), ',') + ')'; + copy[5][1] = 'matrix(' + joinArr$2(mx.m2m6(_matrix2), ',') + ')'; } } @@ -13480,7 +13484,7 @@ calBackgroundSize: calBackgroundSize }; - var isFunction$3 = util.isFunction; + var isFunction$5 = util.isFunction; function traversal(list, length, diff, after) { if (after) { @@ -13583,7 +13587,7 @@ this.__init(); } - if (isFunction$3(handle)) { + if (isFunction$5(handle)) { handle = { __after: handle, __karasFramecb: handle @@ -13625,7 +13629,7 @@ } // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比 - var cb = isFunction$3(handle) ? { + var cb = isFunction$5(handle) ? { __after: function __after(diff) { handle(diff); @@ -13840,80 +13844,80 @@ 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, - _enums$UPDATE_KEY$1 = enums.UPDATE_KEY, - UPDATE_NODE$1 = _enums$UPDATE_KEY$1.UPDATE_NODE, - UPDATE_STYLE = _enums$UPDATE_KEY$1.UPDATE_STYLE, - UPDATE_KEYS = _enums$UPDATE_KEY$1.UPDATE_KEYS, - UPDATE_CONFIG$1 = _enums$UPDATE_KEY$1.UPDATE_CONFIG, + var _enums$STYLE_KEY$f = enums.STYLE_KEY, + FILTER$4 = _enums$STYLE_KEY$f.FILTER, + TRANSFORM_ORIGIN$2 = _enums$STYLE_KEY$f.TRANSFORM_ORIGIN, + PERSPECTIVE_ORIGIN$2 = _enums$STYLE_KEY$f.PERSPECTIVE_ORIGIN, + BACKGROUND_CLIP$1 = _enums$STYLE_KEY$f.BACKGROUND_CLIP, + BACKGROUND_POSITION_X$1 = _enums$STYLE_KEY$f.BACKGROUND_POSITION_X, + BACKGROUND_POSITION_Y$1 = _enums$STYLE_KEY$f.BACKGROUND_POSITION_Y, + BOX_SHADOW$8 = _enums$STYLE_KEY$f.BOX_SHADOW, + TRANSLATE_X$1 = _enums$STYLE_KEY$f.TRANSLATE_X, + TRANSLATE_Y$1 = _enums$STYLE_KEY$f.TRANSLATE_Y, + TRANSLATE_Z$1 = _enums$STYLE_KEY$f.TRANSLATE_Z, + BACKGROUND_SIZE$1 = _enums$STYLE_KEY$f.BACKGROUND_SIZE, + FONT_SIZE$a = _enums$STYLE_KEY$f.FONT_SIZE, + FLEX_BASIS$3 = _enums$STYLE_KEY$f.FLEX_BASIS, + FLEX_DIRECTION$1 = _enums$STYLE_KEY$f.FLEX_DIRECTION, + WIDTH$5 = _enums$STYLE_KEY$f.WIDTH, + HEIGHT$6 = _enums$STYLE_KEY$f.HEIGHT, + TOP$4 = _enums$STYLE_KEY$f.TOP, + BOTTOM$4 = _enums$STYLE_KEY$f.BOTTOM, + LINE_HEIGHT$2 = _enums$STYLE_KEY$f.LINE_HEIGHT, + OPACITY$3 = _enums$STYLE_KEY$f.OPACITY, + Z_INDEX$3 = _enums$STYLE_KEY$f.Z_INDEX, + TRANSFORM$2 = _enums$STYLE_KEY$f.TRANSFORM, + COLOR$2 = _enums$STYLE_KEY$f.COLOR, + FONT_WEIGHT$1 = _enums$STYLE_KEY$f.FONT_WEIGHT, + FONT_STYLE$1 = _enums$STYLE_KEY$f.FONT_STYLE, + FONT_FAMILY$1 = _enums$STYLE_KEY$f.FONT_FAMILY, + TEXT_ALIGN$1 = _enums$STYLE_KEY$f.TEXT_ALIGN, + MATRIX$1 = _enums$STYLE_KEY$f.MATRIX, + ROTATE_3D$1 = _enums$STYLE_KEY$f.ROTATE_3D, + TRANSLATE_PATH = _enums$STYLE_KEY$f.TRANSLATE_PATH, + TEXT_STROKE_COLOR$1 = _enums$STYLE_KEY$f.TEXT_STROKE_COLOR, + TEXT_STROKE_OVER$1 = _enums$STYLE_KEY$f.TEXT_STROKE_OVER, + _enums$UPDATE_KEY$4 = enums.UPDATE_KEY, + UPDATE_NODE$4 = _enums$UPDATE_KEY$4.UPDATE_NODE, + UPDATE_STYLE$2 = _enums$UPDATE_KEY$4.UPDATE_STYLE, + UPDATE_KEYS$2 = _enums$UPDATE_KEY$4.UPDATE_KEYS, + UPDATE_CONFIG$4 = _enums$UPDATE_KEY$4.UPDATE_CONFIG, _enums$KEY_FRAME_KEY = enums.KEY_FRAME_KEY, FRAME_STYLE = _enums$KEY_FRAME_KEY.FRAME_STYLE, FRAME_TIME = _enums$KEY_FRAME_KEY.FRAME_TIME, FRAME_EASING = _enums$KEY_FRAME_KEY.FRAME_EASING, FRAME_TRANSITION = _enums$KEY_FRAME_KEY.FRAME_TRANSITION; - var AUTO$3 = o.AUTO, - PX$5 = o.PX, - PERCENT$6 = o.PERCENT, - INHERIT$3 = o.INHERIT, - RGBA$1 = o.RGBA, - STRING$2 = o.STRING, - NUMBER$4 = o.NUMBER, - REM$6 = o.REM, - VW$6 = o.VW, - VH$6 = o.VH, - calUnit$2 = o.calUnit; - var isNil$5 = util.isNil, + var AUTO$5 = o$4.AUTO, + PX$6 = o$4.PX, + PERCENT$6 = o$4.PERCENT, + INHERIT$2 = o$4.INHERIT, + RGBA$1 = o$4.RGBA, + STRING = o$4.STRING, + NUMBER$1 = o$4.NUMBER, + REM$a = o$4.REM, + VW$a = o$4.VW, + VH$a = o$4.VH, + calUnit = o$4.calUnit; + var isNil$a = util.isNil, isFunction$4 = util.isFunction, - isNumber$1 = util.isNumber, + isNumber = util.isNumber, isObject$1 = util.isObject, - isString$1 = util.isString, - clone$3 = util.clone, - equalArr$2 = util.equalArr; + isString = util.isString, + clone$1 = util.clone, + equalArr = util.equalArr; var linear = easing.linear; - var cloneStyle$1 = css.cloneStyle; - var isGeom$2 = o$2.isGeom, - GEOM$3 = o$2.GEOM; - var COLOR_HASH$2 = key.COLOR_HASH, - LENGTH_HASH$2 = key.LENGTH_HASH, - RADIUS_HASH$2 = key.RADIUS_HASH, - GRADIENT_HASH$2 = key.GRADIENT_HASH, - EXPAND_HASH$2 = key.EXPAND_HASH, - GRADIENT_TYPE$2 = key.GRADIENT_TYPE; + var cloneStyle = css.cloneStyle; + var isGeom$1 = o$2.isGeom, + GEOM$1 = o$2.GEOM; + var COLOR_HASH = key.COLOR_HASH, + LENGTH_HASH = key.LENGTH_HASH, + RADIUS_HASH = key.RADIUS_HASH, + GRADIENT_HASH = key.GRADIENT_HASH, + EXPAND_HASH = key.EXPAND_HASH, + GRADIENT_TYPE = key.GRADIENT_TYPE; var NUM_CAL_HASH = {}; - Object.assign(NUM_CAL_HASH, LENGTH_HASH$2); - Object.assign(NUM_CAL_HASH, EXPAND_HASH$2); + Object.assign(NUM_CAL_HASH, LENGTH_HASH); + Object.assign(NUM_CAL_HASH, EXPAND_HASH); function unify(frames, target) { var hash = {}; @@ -13927,21 +13931,21 @@ if (v !== undefined && !hash.hasOwnProperty(k)) { hash[k] = true; // geom为属性字符串,style都为枚举int - if (!GEOM$3.hasOwnProperty(k)) { + if (!GEOM$1.hasOwnProperty(k)) { k = parseInt(k); } // path动画要转为translateXY,所以手动添加,使2帧之间存在过渡,有可能之前已存在这个动画,可忽视 - if (k === TRANSLATE_PATH$1) { - if (!hash.hasOwnProperty(TRANSLATE_X$3)) { - keys.push(TRANSLATE_X$3); + if (k === TRANSLATE_PATH) { + if (!hash.hasOwnProperty(TRANSLATE_X$1)) { + keys.push(TRANSLATE_X$1); } - if (!hash.hasOwnProperty(TRANSLATE_Y$3)) { - keys.push(TRANSLATE_Y$3); + if (!hash.hasOwnProperty(TRANSLATE_Y$1)) { + keys.push(TRANSLATE_Y$1); } - hash[TRANSLATE_X$3] = hash[TRANSLATE_Y$3] = true; + hash[TRANSLATE_X$1] = hash[TRANSLATE_Y$1] = true; } keys.push(k); @@ -13952,8 +13956,8 @@ frames.forEach(function (item) { var style = item[FRAME_STYLE]; keys.forEach(function (k) { - if (!style.hasOwnProperty(k) || isNil$5(style[k])) { - if (GEOM$3.hasOwnProperty(k)) { + if (!style.hasOwnProperty(k) || isNil$a(style[k])) { + if (GEOM$1.hasOwnProperty(k)) { style[k] = target.getProps(k); } else { style[k] = target.currentStyle[k]; @@ -13972,7 +13976,7 @@ keys.forEach(function (k) { var v = style[k]; // geom的属性可能在帧中没有 - if (isNil$5(v)) { + if (isNil$a(v)) { return; } @@ -13980,16 +13984,16 @@ var ow = target.outerWidth; var oh = target.outerHeight; var m = tf.calMatrix(v, ow, oh); - style[k] = [[MATRIX$2, m]]; - } else if (v[1] === INHERIT$3) { - if (k === COLOR$3 || k === TEXT_STROKE_COLOR$3) { + style[k] = [[MATRIX$1, m]]; + } else if (v[1] === INHERIT$2) { + if (k === COLOR$2 || k === TEXT_STROKE_COLOR$1) { 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) { - 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) { - style[k] = [computedStyle[k], STRING$2]; + } else if (LENGTH_HASH.hasOwnProperty(k)) { + style[k] = [computedStyle[k], PX$6]; + } else if (k === FONT_WEIGHT$1) { + style[k] = [computedStyle[k], NUMBER$1]; + } else if (k === FONT_STYLE$1 || k === FONT_FAMILY$1 || k === TEXT_ALIGN$1 || k === TEXT_STROKE_OVER$1) { + style[k] = [computedStyle[k], STRING]; } } }); @@ -14009,10 +14013,10 @@ function genBeforeRefresh(style, keys, __config, root, node) { var res = {}; - res[UPDATE_NODE$1] = node; - res[UPDATE_STYLE] = style; - res[UPDATE_KEYS] = keys; - res[UPDATE_CONFIG$1] = __config[I_NODE_CONFIG]; + res[UPDATE_NODE$4] = node; + res[UPDATE_STYLE$2] = style; + res[UPDATE_KEYS$2] = keys; + res[UPDATE_CONFIG$4] = __config[I_NODE_CONFIG]; root.__addUpdate(node, __config[I_NODE_CONFIG], root, __config[I_ROOT_CONFIG], res); @@ -14043,8 +14047,8 @@ style = css.normalize(style); if (Array.isArray(translatePath) && [6, 8].indexOf(translatePath.length) > -1) { - style[TRANSLATE_PATH$1] = translatePath.map(function (item) { - return calUnit$2(item); + style[TRANSLATE_PATH] = translatePath.map(function (item) { + return calUnit(item); }); } @@ -14057,52 +14061,52 @@ } function calByUnit(p, n, container, root) { - if (p[1] === PX$5) { + if (p[1] === PX$6) { 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]; - } else if (n[1] === VW$6) { + } else if (n[1] === REM$a) { + return n[0] * root.computedStyle[FONT_SIZE$a] - p[0]; + } else if (n[1] === VW$a) { return n[0] * root.width * 0.01 - p[0]; - } else if (n[1] === VH$6) { + } else if (n[1] === VH$a) { return n[0] * root.height * 0.01 - p[0]; } } else if (p[1] === PERCENT$6) { - if (n[1] === PX$5) { + if (n[1] === PX$6) { 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]; - } else if (n[1] === VW$6) { + } else if (n[1] === REM$a) { + return n[0] * root.computedStyle[FONT_SIZE$a] * 100 / container - p[0]; + } else if (n[1] === VW$a) { return n[0] * root.width / container - p[0]; - } else if (n[1] === VH$6) { + } else if (n[1] === VH$a) { return n[0] * root.height / container - p[0]; } - } else if (p[1] === REM$6) { - if (n[1] === PX$5) { - return n[0] / root.computedStyle[FONT_SIZE$7] - p[0]; + } else if (p[1] === REM$a) { + if (n[1] === PX$6) { + return n[0] / root.computedStyle[FONT_SIZE$a] - p[0]; } else if (n[1] === PERCENT$6) { - return n[0] * 0.01 * container / root.computedStyle[FONT_SIZE$7] - p[0]; - } else if (n[1] === VW$6) { - return n[0] * root.width * 0.01 / root.computedStyle[FONT_SIZE$7] - p[0]; - } else if (n[1] === VH$6) { - return n[0] * root.height * 0.01 / root.computedStyle[FONT_SIZE$7] - p[0]; - } - } else if (p[1] === VW$6) { - if (n[1] === PX$5) { + return n[0] * 0.01 * container / root.computedStyle[FONT_SIZE$a] - p[0]; + } else if (n[1] === VW$a) { + return n[0] * root.width * 0.01 / root.computedStyle[FONT_SIZE$a] - p[0]; + } else if (n[1] === VH$a) { + return n[0] * root.height * 0.01 / root.computedStyle[FONT_SIZE$a] - p[0]; + } + } else if (p[1] === VW$a) { + if (n[1] === PX$6) { 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]; + } else if (n[1] === REM$a) { + return n[0] * 100 * root.computedStyle[FONT_SIZE$a] / root.width - p[0]; } else if (n[1] === PERCENT$6) { return n[0] * container / root.width - p[0]; - } else if (n[1] === VH$6) { + } else if (n[1] === VH$a) { return n[0] * root.height / root.width - p[0]; } - } else if (p[1] === VH$6) { - if (n[1] === PX$5) { + } else if (p[1] === VH$a) { + if (n[1] === PX$6) { 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]; - } else if (n[1] === VW$6) { + } else if (n[1] === REM$a) { + return n[0] * 100 * root.computedStyle[FONT_SIZE$a] / root.height - p[0]; + } else if (n[1] === VW$a) { return n[0] * root.width / root.height - p[0]; } else if (n[1] === PERCENT$6) { return n[0] * container / root.height - p[0]; @@ -14148,19 +14152,19 @@ } // transform特殊被初始化转成matrix矩阵,直接计算差值 - if (equalArr$2(pm, nm)) { + if (equalArr(pm, nm)) { return; } res[1] = [nm[0] - pm[0], nm[1] - pm[1], nm[2] - pm[2], nm[3] - pm[3], nm[4] - pm[4], nm[5] - pm[5], nm[6] - pm[6], nm[7] - pm[7], nm[8] - pm[8], nm[9] - pm[9], nm[10] - pm[10], nm[11] - pm[11], nm[12] - pm[12], nm[13] - pm[13], nm[14] - pm[14], nm[15] - pm[15]]; return res; - } else if (k === ROTATE_3D$2) { - if (equalArr$2(p, n)) { + } else if (k === ROTATE_3D$1) { + if (equalArr(p, n)) { return; } res[1] = [n[0] - n[0], n[1] - p[1], n[2] - p[2], [n[3][0] - p[3][0], n[3][1]]]; - } else if (k === FILTER$2) { + } else if (k === FILTER$4) { // filter很特殊,里面有多个滤镜,忽视顺序按hash计算,为空视为默认值,如blur默认0,brightness默认1 var pHash = {}, nHash = {}, @@ -14197,26 +14201,26 @@ hasChange = true; } } else if (k === 'hue-rotate') { - var nv = isNil$5(nHash[k]) ? 0 : nHash[k][0]; - var pv = isNil$5(pHash[k]) ? 0 : pHash[k][0]; + var nv = isNil$a(nHash[k]) ? 0 : nHash[k][0]; + var pv = isNil$a(pHash[k]) ? 0 : pHash[k][0]; if (pv !== nv) { v[k] = [nv - pv, PERCENT$6]; hasChange = true; } } else if (k === 'saturate' || k === 'brightness' || k === 'contrast') { - var _nv = isNil$5(nHash[k]) ? 100 : nHash[k][0]; + var _nv = isNil$a(nHash[k]) ? 100 : nHash[k][0]; - var _pv = isNil$5(pHash[k]) ? 100 : pHash[k][0]; + var _pv = isNil$a(pHash[k]) ? 100 : pHash[k][0]; if (_pv !== _nv) { v[k] = [_nv - _pv, PERCENT$6]; hasChange = true; } } else if (k === 'grayscale') { - var _nv2 = isNil$5(nHash[k]) ? 0 : nHash[k][0]; + var _nv2 = isNil$a(nHash[k]) ? 0 : nHash[k][0]; - var _pv2 = isNil$5(pHash[k]) ? 0 : pHash[k][0]; + var _pv2 = isNil$a(pHash[k]) ? 0 : pHash[k][0]; if (_pv2 !== _nv2) { v[k] = [_nv2 - _pv2, PERCENT$6]; @@ -14230,7 +14234,7 @@ } res[1] = v; - } else if (k === TRANSFORM_ORIGIN$3 || k === PERSPECTIVE_ORIGIN$2) { + } else if (k === TRANSFORM_ORIGIN$2 || k === PERSPECTIVE_ORIGIN$2) { res[1] = []; for (var i = 0; i < 2; i++) { @@ -14246,10 +14250,10 @@ } } - if (equalArr$2(res[1], [0, 0])) { + if (equalArr(res[1], [0, 0])) { return; } - } else if (k === BACKGROUND_POSITION_X$2 || k === BACKGROUND_POSITION_Y$2) { + } else if (k === BACKGROUND_POSITION_X$1 || k === BACKGROUND_POSITION_Y$1) { res[1] = []; var length = Math.min(p.length, n.length); @@ -14272,12 +14276,12 @@ res[1].push(_v2); } else { - var k2 = k === BACKGROUND_POSITION_X$2 ? 'offsetWidth' : 'offsetHeight'; + var k2 = k === BACKGROUND_POSITION_X$1 ? 'offsetWidth' : 'offsetHeight'; if (['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP$1]) > -1) { - k2 = k === BACKGROUND_POSITION_X$2 ? 'clientWidth' : 'clientHeight'; + k2 = k === BACKGROUND_POSITION_X$1 ? 'clientWidth' : 'clientHeight'; } else if (['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP$1]) > -1) { - k2 = k === BACKGROUND_POSITION_X$2 ? 'width' : 'height'; + k2 = k === BACKGROUND_POSITION_X$1 ? 'width' : 'height'; } var _v3 = calByUnit(_pi, _ni, target[k2], target.root); @@ -14290,7 +14294,7 @@ res[1].push(_v3); } } - } else if (k === BOX_SHADOW$1) { + } else if (k === BOX_SHADOW$8) { res[1] = []; for (var _i2 = 0, len = Math.min(p.length, n.length); _i2 < len; _i2++) { @@ -14313,7 +14317,7 @@ res[1].push(_v4); } - } else if (EXPAND_HASH$2.hasOwnProperty(k)) { + } else if (EXPAND_HASH.hasOwnProperty(k)) { if (p[1] === n[1]) { var _v5 = n[0] - p[0]; @@ -14323,7 +14327,7 @@ res[1] = _v5; } else { - var _v6 = calByUnit(p, n, target[k === TRANSLATE_X$3 || k === TRANSLATE_Z$3 ? 'outerWidth' : 'outerHeight'], target.root); + var _v6 = calByUnit(p, n, target[k === TRANSLATE_X$1 || k === TRANSLATE_Z$1 ? 'outerWidth' : 'outerHeight'], target.root); if (!_v6) { return; @@ -14370,7 +14374,7 @@ } } - if (equalArr$2(temp, [0, 0])) { + if (equalArr(temp, [0, 0])) { res[1].push(null); } else { res[1].push(temp); @@ -14381,7 +14385,7 @@ if (!has) { return; } - } else if (GRADIENT_HASH$2.hasOwnProperty(k)) { + } else if (GRADIENT_HASH.hasOwnProperty(k)) { // backgroundImage发生了渐变色和图片的变化,fill发生渐变色和纯色的变化等 res[1] = []; @@ -14391,7 +14395,7 @@ var _pi3 = p[_i4], _ni3 = n[_i4]; - if (!_pi3 || !_ni3 || isString$1(_pi3) || isString$1(_ni3)) { + if (!_pi3 || !_ni3 || isString(_pi3) || isString(_ni3)) { res[1].push(null); continue; } @@ -14408,7 +14412,7 @@ var nv = _ni3.v; _temp[0] = []; var clientWidth = target.clientWidth; - var eq = equalArr$2(pv, nv); + var eq = equalArr(pv, nv); for (var _i5 = 0, _len = Math.min(pv.length, nv.length); _i5 < _len; _i5++) { var _a = pv[_i5]; @@ -14442,7 +14446,7 @@ if (isArrP) { var _v9 = [_ni3.d[0] - _pi3.d[0], _ni3.d[1] - _pi3.d[1], _ni3.d[2] - _pi3.d[2], _ni3.d[3] - _pi3.d[3]]; - if (eq && equalArr$2(_v9, [0, 0, 0, 0])) { + if (eq && equalArr(_v9, [0, 0, 0, 0])) { res[1].push(null); continue; } @@ -14460,100 +14464,100 @@ } } // 径向渐变的位置 else if (_pi3.k === 'radial') { - var _isArrP = Array.isArray(_pi3.z); - - var _isArrN = Array.isArray(_ni3.z); - - if (_isArrN !== _isArrP) { - res[1].push(null); - continue; - } + var _isArrP = Array.isArray(_pi3.z); - if (_isArrP) { - _temp[2] = []; + var _isArrN = Array.isArray(_ni3.z); - for (var _i6 = 0; _i6 < 5; _i6++) { - var pz = _pi3.z[_i6]; // 半径比例省略为1 - - if (pz === undefined) { - pz = 1; - } - - var nz = _ni3.z[_i6]; + if (_isArrN !== _isArrP) { + res[1].push(null); + continue; + } - if (nz === undefined) { - nz = 1; - } + if (_isArrP) { + _temp[2] = []; - _temp[2].push(nz - pz); - } + for (var _i6 = 0; _i6 < 5; _i6++) { + var pz = _pi3.z[_i6]; // 半径比例省略为1 - if (eq && equalArr$2(res[4], [0, 0, 0, 0, 0])) { - res[1].push(null); + if (pz === undefined) { + pz = 1; } - } else { - _temp[2] = []; - for (var _i7 = 0; _i7 < 2; _i7++) { - var _pp = _pi3.p[_i7]; - var np = _ni3.p[_i7]; - - if (_pp[1] === np[1]) { - _temp[2].push(np[0] - _pp[0]); - } else { - var _v11 = calByUnit(_pp, np, target[_i7 ? 'clientWidth' : 'clientHeight'], target.root); + var nz = _ni3.z[_i6]; - _temp[2].push(_v11 || 0); - } + if (nz === undefined) { + nz = 1; } - if (eq && equalArr$2(res[3], [0, 0])) { - res[1].push(null); - } + _temp[2].push(nz - pz); } - } else if (_pi3.k === 'conic') { - _temp[1].push(n.d - p.d); + if (eq && equalArr(res[4], [0, 0, 0, 0, 0])) { + res[1].push(null); + } + } else { _temp[2] = []; - for (var _i8 = 0; _i8 < 2; _i8++) { - var _pp2 = p.p[_i8]; - var _np = n.p[_i8]; + for (var _i7 = 0; _i7 < 2; _i7++) { + var _pp = _pi3.p[_i7]; + var np = _ni3.p[_i7]; - if (_pp2[1] === _np[1]) { - _temp[2].push(_np[0] - _pp2[0]); + if (_pp[1] === np[1]) { + _temp[2].push(np[0] - _pp[0]); } else { - var _v12 = calByUnit(_pp2, _np, target[_i8 ? 'clientWidth' : 'clientHeight'], target.root); + var _v11 = calByUnit(_pp, np, target[_i7 ? 'clientWidth' : 'clientHeight'], target.root); - _temp[2].push(_v12 || 0); + _temp[2].push(_v11 || 0); } } - if (eq && res[2] !== 0 && equalArr$2(res[3], [0, 0])) { + if (eq && equalArr(res[3], [0, 0])) { res[1].push(null); } } - } // 纯色 - else { - if (equalArr$2(n, _pi3)) { - res[1].push(null); + } else if (_pi3.k === 'conic') { + _temp[1].push(n.d - p.d); + + _temp[2] = []; + + for (var _i8 = 0; _i8 < 2; _i8++) { + var _pp2 = p.p[_i8]; + var _np = n.p[_i8]; + + if (_pp2[1] === _np[1]) { + _temp[2].push(_np[0] - _pp2[0]); + } else { + var _v12 = calByUnit(_pp2, _np, target[_i8 ? 'clientWidth' : 'clientHeight'], target.root); + + _temp[2].push(_v12 || 0); + } } - _temp[0] = [_ni3[0] - _pi3[0], _ni3[1] - _pi3[1], _ni3[2] - _pi3[2], _ni3[3] - _pi3[3]]; + if (eq && res[2] !== 0 && equalArr(res[3], [0, 0])) { + res[1].push(null); + } + } + } // 纯色 + else { + if (equalArr(n, _pi3)) { + res[1].push(null); } + _temp[0] = [_ni3[0] - _pi3[0], _ni3[1] - _pi3[1], _ni3[2] - _pi3[2], _ni3[3] - _pi3[3]]; + } + res[1].push(_temp); } - } else if (COLOR_HASH$2.hasOwnProperty(k)) { + } else if (COLOR_HASH.hasOwnProperty(k)) { n = n[0]; p = p[0]; - if (equalArr$2(n, p) || n[3] === 0 && p[3] === 0) { + if (equalArr(n, p) || n[3] === 0 && p[3] === 0) { return; } res[1] = [n[0] - p[0], n[1] - p[1], n[2] - p[2], n[3] - p[3]]; - } else if (RADIUS_HASH$2.hasOwnProperty(k)) { + } else if (RADIUS_HASH.hasOwnProperty(k)) { // x/y都相等无需 if (n[0][0] === p[0][0] && n[0][1] === p[0][1] && n[1][0] === p[1][0] && n[1][1] === p[1][1]) { return; @@ -14570,9 +14574,9 @@ res[1].push(_v13 || 0); } } - } else if (LENGTH_HASH$2.hasOwnProperty(k)) { + } else if (LENGTH_HASH.hasOwnProperty(k)) { // auto不做动画 - if (p[1] === AUTO$3 || n[1] === AUTO$3) { + if (p[1] === AUTO$5 || n[1] === AUTO$5) { return; } @@ -14584,21 +14588,21 @@ diff = n[0] - p[0]; } // lineHeight奇怪的单位变化,%相对于fontSize else if (k === LINE_HEIGHT$2) { - diff = calByUnit(p, n, computedStyle[FONT_SIZE$7], target.root); - } // fontSize的%相对于parent的 - else if (k === FONT_SIZE$7) { - diff = calByUnit(p, n, parentComputedStyle[FONT_SIZE$7], 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) { - diff = calByUnit(p, n, parentComputedStyle[HEIGHT$2], target.root); - } - } // 其余都是相对于父width的 - else { - if (p[1] !== AUTO$3 && n[1] !== AUTO$3) { - diff = calByUnit(p, n, parentComputedStyle[WIDTH$3], target.root); - } - } // 兜底NaN非法 + diff = calByUnit(p, n, computedStyle[FONT_SIZE$a], target.root); + } // fontSize的%相对于parent的 + else if (k === FONT_SIZE$a) { + diff = calByUnit(p, n, parentComputedStyle[FONT_SIZE$a], target.root); + } // 相对于父height的特殊属性 + else if (k === FLEX_BASIS$3 && ['column', 'column-reverse', 'columnReverse'].indexOf(computedStyle[FLEX_DIRECTION$1]) > -1 || [HEIGHT$6, TOP$4, BOTTOM$4].indexOf(k) > -1) { + if (p[1] !== AUTO$5 && n[1] !== AUTO$5) { + diff = calByUnit(p, n, parentComputedStyle[HEIGHT$6], target.root); + } + } // 其余都是相对于父width的 + else { + if (p[1] !== AUTO$5 && n[1] !== AUTO$5) { + diff = calByUnit(p, n, parentComputedStyle[WIDTH$5], target.root); + } + } // 兜底NaN非法 if (diff === 0 || isNaN(diff)) { @@ -14606,11 +14610,11 @@ } res[1] = diff; - } else if (GEOM$3.hasOwnProperty(k)) { - if (isNil$5(p)) { + } else if (GEOM$1.hasOwnProperty(k)) { + if (isNil$a(p)) { return; - } else if (GEOM$3[k][tagName] && isFunction$4(GEOM$3[k][tagName].calDiff)) { - var fn = GEOM$3[k][tagName].calDiff; + } else if (GEOM$1[k][tagName] && isFunction$4(GEOM$1[k][tagName].calDiff)) { + var fn = GEOM$1[k][tagName].calDiff; if (target.isMulti) { var arr = []; @@ -14625,175 +14629,175 @@ } } // 特殊处理multi else if (target.isMulti) { - if (k === 'points' || k === 'controls') { - if (isNil$5(n) || !n.length || isNil$5(p) || !p.length || equalArr$2(p, n)) { - return; - } + if (k === 'points' || k === 'controls') { + if (isNil$a(n) || !n.length || isNil$a(p) || !p.length || equalArr(p, n)) { + return; + } - res[1] = []; + res[1] = []; - for (var _i11 = 0, _len3 = Math.min(p.length, n.length); _i11 < _len3; _i11++) { - var _pv3 = p[_i11]; - var _nv3 = n[_i11]; + for (var _i11 = 0, _len3 = Math.min(p.length, n.length); _i11 < _len3; _i11++) { + var _pv3 = p[_i11]; + var _nv3 = n[_i11]; - if (isNil$5(_pv3) || !_pv3.length || isNil$5(_nv3) || !_nv3.length) { - res[1].push(null); - } else { - var v2 = []; + if (isNil$a(_pv3) || !_pv3.length || isNil$a(_nv3) || !_nv3.length) { + res[1].push(null); + } else { + var v2 = []; - for (var _j3 = 0, len2 = Math.min(_pv3.length, _nv3.length); _j3 < len2; _j3++) { - var pv2 = _pv3[_j3]; - var nv2 = _nv3[_j3]; + for (var _j3 = 0, len2 = Math.min(_pv3.length, _nv3.length); _j3 < len2; _j3++) { + var pv2 = _pv3[_j3]; + var nv2 = _nv3[_j3]; - if (isNil$5(pv2) || isNil$5(nv2)) { - v2.push(null); - } else { - var v3 = []; + if (isNil$a(pv2) || isNil$a(nv2)) { + v2.push(null); + } else { + var v3 = []; - for (var _k2 = 0, len3 = Math.max(pv2.length, nv2.length); _k2 < len3; _k2++) { - var pv3 = pv2[_k2]; - var nv3 = nv2[_k2]; // control由4点变2点 + for (var _k2 = 0, len3 = Math.max(pv2.length, nv2.length); _k2 < len3; _k2++) { + var pv3 = pv2[_k2]; + var nv3 = nv2[_k2]; // control由4点变2点 - if (isNil$5(pv3) || isNil$5(nv3)) { - v3.push(0); - } else { - v3.push(nv3 - pv3); - } + if (isNil$a(pv3) || isNil$a(nv3)) { + v3.push(0); + } else { + v3.push(nv3 - pv3); } - - v2.push(v3); } - } - res[1].push(v2); + v2.push(v3); + } } + + res[1].push(v2); } - } else if (k === 'controlA' || k === 'controlB') { - if (isNil$5(n) || !n.length || isNil$5(p) || !p.length || equalArr$2(p, n)) { - return; - } + } + } else if (k === 'controlA' || k === 'controlB') { + if (isNil$a(n) || !n.length || isNil$a(p) || !p.length || equalArr(p, n)) { + return; + } - res[1] = []; + res[1] = []; - for (var _i12 = 0, _len4 = Math.min(p.length, n.length); _i12 < _len4; _i12++) { - var _pv4 = p[_i12]; - var _nv4 = n[_i12]; + for (var _i12 = 0, _len4 = Math.min(p.length, n.length); _i12 < _len4; _i12++) { + var _pv4 = p[_i12]; + var _nv4 = n[_i12]; - if (isNil$5(_pv4) || !_pv4.length || isNil$5(_nv4) || !_nv4.length) { - res[1].push(null); - } else { - res[1].push([_nv4[0] - _pv4[0], _nv4[1] - _pv4[1]]); - } - } - } else { - if (n === p || equalArr$2(n, p) || k === 'edge' || k === 'closure') { - return; + if (isNil$a(_pv4) || !_pv4.length || isNil$a(_nv4) || !_nv4.length) { + res[1].push(null); + } else { + res[1].push([_nv4[0] - _pv4[0], _nv4[1] - _pv4[1]]); } + } + } else { + if (n === p || equalArr(n, p) || k === 'edge' || k === 'closure') { + return; + } - var _v14 = []; - - for (var _i13 = 0, _len5 = Math.min(p.length, n.length); _i13 < _len5; _i13++) { - var _pv5 = p[_i13]; - var _nv5 = n[_i13]; + var _v14 = []; - if (isNil$5(_pv5) || isNil$5(_nv5)) { - _v14.push(0); - } + for (var _i13 = 0, _len5 = Math.min(p.length, n.length); _i13 < _len5; _i13++) { + var _pv5 = p[_i13]; + var _nv5 = n[_i13]; - _v14.push(_nv5 - _pv5); + if (isNil$a(_pv5) || isNil$a(_nv5)) { + _v14.push(0); } - res[1] = _v14; + _v14.push(_nv5 - _pv5); } - } // 非multi特殊处理这几类数组类型数据 - else if (k === 'points' || k === 'controls') { - if (isNil$5(n) || !n.length || isNil$5(p) || !p.length || equalArr$2(p, n)) { - return; - } - - res[1] = []; - for (var _i14 = 0, _len6 = Math.min(p.length, n.length); _i14 < _len6; _i14++) { - var _pv6 = p[_i14]; - var _nv6 = n[_i14]; + res[1] = _v14; + } + } // 非multi特殊处理这几类数组类型数据 + else if (k === 'points' || k === 'controls') { + if (isNil$a(n) || !n.length || isNil$a(p) || !p.length || equalArr(p, n)) { + return; + } - if (isNil$5(_pv6) || !_pv6.length || isNil$5(_nv6) || !_nv6.length) { - res[1].push(null); - } else { - var _v15 = []; + res[1] = []; - for (var _j4 = 0, _len7 = Math.max(_pv6.length, _nv6.length); _j4 < _len7; _j4++) { - var _pv7 = _pv6[_j4]; - var _nv7 = _nv6[_j4]; // control由4点变2点 + for (var _i14 = 0, _len6 = Math.min(p.length, n.length); _i14 < _len6; _i14++) { + var _pv6 = p[_i14]; + var _nv6 = n[_i14]; - if (isNil$5(_pv7) || isNil$5(_nv7)) { - _v15.push(0); - } else { - _v15.push(_nv7 - _pv7); - } - } + if (isNil$a(_pv6) || !_pv6.length || isNil$a(_nv6) || !_nv6.length) { + res[1].push(null); + } else { + var _v15 = []; - res[1].push(_v15); - } - } - } else if (k === 'controlA' || k === 'controlB') { - if (isNil$5(n) || !n.length || isNil$5(p) || !p.length || equalArr$2(p, n)) { - return; - } + for (var _j4 = 0, _len7 = Math.max(_pv6.length, _nv6.length); _j4 < _len7; _j4++) { + var _pv7 = _pv6[_j4]; + var _nv7 = _nv6[_j4]; // control由4点变2点 - res[1] = [n[0] - p[0], n[1] - p[1]]; - } // 其它简单数据,除了edge/closure没有增量 - else { - if (n === p || k === 'edge' || k === 'closure') { - return; + if (isNil$a(_pv7) || isNil$a(_nv7)) { + _v15.push(0); } else { - res[1] = n - p; + _v15.push(_nv7 - _pv7); } } - } else if (k === OPACITY$2 || k === Z_INDEX$1) { + + res[1].push(_v15); + } + } + } else if (k === 'controlA' || k === 'controlB') { + if (isNil$a(n) || !n.length || isNil$a(p) || !p.length || equalArr(p, n)) { + return; + } + + res[1] = [n[0] - p[0], n[1] - p[1]]; + } // 其它简单数据,除了edge/closure没有增量 + else { + if (n === p || k === 'edge' || k === 'closure') { + return; + } else { + res[1] = n - p; + } + } + } else if (k === OPACITY$3 || k === Z_INDEX$3) { if (n === p) { return; } res[1] = n - p; } // 特殊的path,不存在style中但在动画某帧中,不会统一化所以可能反向计算frameR时后一帧没有 - else if (k === TRANSLATE_PATH$1 && p) { - var k1 = 'offsetWidth', - _k3 = 'offsetHeight'; - - if (['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP$1]) > -1) { - k1 = 'clientWidth'; - _k3 = 'clientHeight'; - } else if (['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP$1]) > -1) { - k1 = 'width'; - _k3 = 'height'; - } - - res[1] = p.map(function (item, i) { - var _item = _slicedToArray(item, 2), - v = _item[0], - u = _item[1]; - - if (u === PERCENT$6) { - if (i % 2 === 0) { - return [(parseFloat(v) || 0) * 0.01 * target[k1], PX$5]; - } else { - 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]; - } else if (u === VW$6) { - return [(parseFloat(v) || 0) * 0.01 * root.width, PX$5]; - } else if (u === VH$6) { - return [(parseFloat(v) || 0) * 0.01 * root.height, PX$5]; + else if (k === TRANSLATE_PATH && p) { + var k1 = 'offsetWidth', + _k3 = 'offsetHeight'; + + if (['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP$1]) > -1) { + k1 = 'clientWidth'; + _k3 = 'clientHeight'; + } else if (['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP$1]) > -1) { + k1 = 'width'; + _k3 = 'height'; + } + + res[1] = p.map(function (item, i) { + var _item = _slicedToArray(item, 2), + v = _item[0], + u = _item[1]; + + if (u === PERCENT$6) { + if (i % 2 === 0) { + return [(parseFloat(v) || 0) * 0.01 * target[k1], PX$6]; } else { - return [parseFloat(v) || 0, PX$5]; - } - }); - } // display等不能有增量过程的 - else { - return; + return [(parseFloat(v) || 0) * 0.01 * target[_k3], PX$6]; + } + } else if (u === REM$a) { + return [(parseFloat(v) || 0) * root.computedStyle[FONT_SIZE$a] * 100, PX$6]; + } else if (u === VW$a) { + return [(parseFloat(v) || 0) * 0.01 * root.width, PX$6]; + } else if (u === VH$a) { + return [(parseFloat(v) || 0) * 0.01 * root.height, PX$6]; + } else { + return [parseFloat(v) || 0, PX$6]; } + }); + } // display等不能有增量过程的 + else { + return; + } return res; } // 计算两帧之间不相同的变化,存入transition,相同的忽略 @@ -14870,7 +14874,7 @@ function calIntermediateStyle(frame, keys, percent, target) { - var style = cloneStyle$1(frame[FRAME_STYLE], keys); + var style = cloneStyle(frame[FRAME_STYLE], keys); var timingFunction = getEasing(frame[FRAME_EASING]); if (timingFunction && timingFunction !== linear) { @@ -14888,264 +14892,264 @@ if (k === TRANSFORM$2) { if (!st) { - st = style[k] = [[MATRIX$2, mx.identity()]]; + st = style[k] = [[MATRIX$1, mx.identity()]]; } for (var _i15 = 0; _i15 < 16; _i15++) { st[0][1][_i15] += v[_i15] * percent; } } // 特殊的曲线运动计算,转换为translateXY,出现在最后一定会覆盖原本的translate防重 - else if (k === TRANSLATE_PATH$1) { - var t = 1 - percent; - - if (v.length === 8) { - style[TRANSLATE_X$3] = [v[0][0] * t * t * t + 3 * v[2][0] * percent * t * t + 3 * v[4][0] * percent * percent * t + v[6][0] * percent * percent * percent, PX$5]; - style[TRANSLATE_Y$3] = [v[1][0] * t * t * t + 3 * v[3][0] * percent * t * t + 3 * v[5][0] * percent * percent * t + v[7][0] * percent * percent * percent, PX$5]; - } else if (v.length === 6) { - style[TRANSLATE_X$3] = [v[0][0] * t * t + 2 * v[2][0] * percent * t + v[4][0] * percent * percent, PX$5]; - style[TRANSLATE_Y$3] = [v[1][0] * t * t + 3 * v[3][0] * percent * t + v[5][0] * percent * percent, PX$5]; - } - } else if (k === ROTATE_3D$2) { - st[0] += v[0] * percent; - st[1] += v[1] * percent; - st[2] += v[2] * percent; - st[3][0] += v[3][0] * percent; - } else if (NUM_CAL_HASH.hasOwnProperty(k)) { - if (v) { - st[0] += v * percent; - } - } else if (k === FILTER$2) { - // 只有1个样式声明了filter另外一个为空,会造成无样式,需初始化数组并在下面计算出样式存入 - if (!st) { - st = style[k] = []; - } // 将已有的样式按key存入引用来操作 + else if (k === TRANSLATE_PATH) { + var t = 1 - percent; + + if (v.length === 8) { + style[TRANSLATE_X$1] = [v[0][0] * t * t * t + 3 * v[2][0] * percent * t * t + 3 * v[4][0] * percent * percent * t + v[6][0] * percent * percent * percent, PX$6]; + style[TRANSLATE_Y$1] = [v[1][0] * t * t * t + 3 * v[3][0] * percent * t * t + 3 * v[5][0] * percent * percent * t + v[7][0] * percent * percent * percent, PX$6]; + } else if (v.length === 6) { + style[TRANSLATE_X$1] = [v[0][0] * t * t + 2 * v[2][0] * percent * t + v[4][0] * percent * percent, PX$6]; + style[TRANSLATE_Y$1] = [v[1][0] * t * t + 3 * v[3][0] * percent * t + v[5][0] * percent * percent, PX$6]; + } + } else if (k === ROTATE_3D$1) { + st[0] += v[0] * percent; + st[1] += v[1] * percent; + st[2] += v[2] * percent; + st[3][0] += v[3][0] * percent; + } else if (NUM_CAL_HASH.hasOwnProperty(k)) { + if (v) { + st[0] += v * percent; + } + } else if (k === FILTER$4) { + // 只有1个样式声明了filter另外一个为空,会造成无样式,需初始化数组并在下面计算出样式存入 + if (!st) { + st = style[k] = []; + } // 将已有的样式按key存入引用来操作 - var hash = {}; - st.forEach(function (item) { - hash[item[0]] = item[1]; - }); - Object.keys(v).forEach(function (k) { - if (hash.hasOwnProperty(k)) { - hash[k][0] += v[k][0] * percent; - } else { - // 2个关键帧中有1个未声明,需新建样式存入 - if (k === 'blur' || k === 'hue-rotate' || k === 'grayscale') { - var n = v[k].slice(0); - n[0] *= percent; - st.push([k, n]); - } // 默认值是1而非0 - else if (k === 'saturate' || k === 'brightness' || k === 'contrast') { - var _n = v[k].slice(0); - - _n[0] = 100 + _n[0] * percent; - st.push([k, _n]); - } + var hash = {}; + st.forEach(function (item) { + hash[item[0]] = item[1]; + }); + Object.keys(v).forEach(function (k) { + if (hash.hasOwnProperty(k)) { + hash[k][0] += v[k][0] * percent; + } else { + // 2个关键帧中有1个未声明,需新建样式存入 + if (k === 'blur' || k === 'hue-rotate' || k === 'grayscale') { + var n = v[k].slice(0); + n[0] *= percent; + st.push([k, n]); + } // 默认值是1而非0 + else if (k === 'saturate' || k === 'brightness' || k === 'contrast') { + var _n = v[k].slice(0); + + _n[0] = 100 + _n[0] * percent; + st.push([k, _n]); } - }); - } else if (RADIUS_HASH$2.hasOwnProperty(k)) { - for (var _i16 = 0; _i16 < 2; _i16++) { - st[_i16][0] += v[_i16] * percent; - } - } else if (k === TRANSFORM_ORIGIN$3 || k === PERSPECTIVE_ORIGIN$2) { - if (v[0] !== 0) { - st[0][0] += v[0] * percent; } + }); + } else if (RADIUS_HASH.hasOwnProperty(k)) { + for (var _i16 = 0; _i16 < 2; _i16++) { + st[_i16][0] += v[_i16] * percent; + } + } else if (k === TRANSFORM_ORIGIN$2 || k === PERSPECTIVE_ORIGIN$2) { + if (v[0] !== 0) { + st[0][0] += v[0] * percent; + } - if (v[1] !== 0) { - st[1][0] += v[1] * percent; - } - } else if (k === BOX_SHADOW$1) { - for (var _i17 = 0, _len8 = Math.min(st.length, v.length); _i17 < _len8; _i17++) { - // x/y/blur/spread - for (var j = 0; j < 4; j++) { - st[_i17][j] += v[_i17][j] * percent; - } // rgba + if (v[1] !== 0) { + st[1][0] += v[1] * percent; + } + } else if (k === BOX_SHADOW$8) { + for (var _i17 = 0, _len8 = Math.min(st.length, v.length); _i17 < _len8; _i17++) { + // x/y/blur/spread + for (var j = 0; j < 4; j++) { + st[_i17][j] += v[_i17][j] * percent; + } // rgba - for (var _j5 = 0; _j5 < 4; _j5++) { - st[_i17][4][_j5] += v[_i17][4][_j5] * percent; - } + for (var _j5 = 0; _j5 < 4; _j5++) { + st[_i17][4][_j5] += v[_i17][4][_j5] * percent; } - } else if (k === BACKGROUND_SIZE$1) { - st.forEach(function (item, i) { - if (v[i]) { - item[0][0] += v[i][0] * percent; - item[1][0] += v[i][1] * percent; - } - }); - } else if (k === BACKGROUND_POSITION_X$2 || k === BACKGROUND_POSITION_Y$2) { - st.forEach(function (item, i) { - if (v[i]) { - item[0] += v[i] * percent; - } - }); - } else if (GRADIENT_HASH$2.hasOwnProperty(k)) { - st.forEach(function (st2, i) { - var v2 = v[i]; + } + } else if (k === BACKGROUND_SIZE$1) { + st.forEach(function (item, i) { + if (v[i]) { + item[0][0] += v[i][0] * percent; + item[1][0] += v[i][1] * percent; + } + }); + } else if (k === BACKGROUND_POSITION_X$1 || k === BACKGROUND_POSITION_Y$1) { + st.forEach(function (item, i) { + if (v[i]) { + item[0] += v[i] * percent; + } + }); + } else if (GRADIENT_HASH.hasOwnProperty(k)) { + st.forEach(function (st2, i) { + var v2 = v[i]; - if (!v2) { - return; - } + if (!v2) { + return; + } - var _v16 = _slicedToArray(v2, 4), - c = _v16[0], - d = _v16[1], - p = _v16[2], - z = _v16[3]; + var _v16 = _slicedToArray(v2, 4), + c = _v16[0], + d = _v16[1], + p = _v16[2], + z = _v16[3]; - if (GRADIENT_TYPE$2.hasOwnProperty(st2.k)) { - for (var _i18 = 0, _len9 = Math.min(st2.v.length, c.length); _i18 < _len9; _i18++) { - var a = st2.v[_i18]; - var b = c[_i18]; - a[0][0] += b[0][0] * percent; - a[0][1] += b[0][1] * percent; - a[0][2] += b[0][2] * percent; - a[0][3] += b[0][3] * percent; + if (GRADIENT_TYPE.hasOwnProperty(st2.k)) { + for (var _i18 = 0, _len9 = Math.min(st2.v.length, c.length); _i18 < _len9; _i18++) { + var a = st2.v[_i18]; + var b = c[_i18]; + a[0][0] += b[0][0] * percent; + a[0][1] += b[0][1] * percent; + a[0][2] += b[0][2] * percent; + a[0][3] += b[0][3] * percent; - if (a[1] && b[1]) { - a[1][0] += b[1] * percent; - } + if (a[1] && b[1]) { + a[1][0] += b[1] * percent; } + } - if (st2.k === 'linear' && st2.d !== undefined && d !== undefined) { - if (Array.isArray(d)) { - st2.d[0] += d[0] * percent; - st2.d[1] += d[1] * percent; - st2.d[2] += d[2] * percent; - st2.d[3] += d[3] * percent; - } else { - st2.d += d * percent; - } + if (st2.k === 'linear' && st2.d !== undefined && d !== undefined) { + if (Array.isArray(d)) { + st2.d[0] += d[0] * percent; + st2.d[1] += d[1] * percent; + st2.d[2] += d[2] * percent; + st2.d[3] += d[3] * percent; + } else { + st2.d += d * percent; } + } - if (st2.k === 'radial') { - if (st2.z !== undefined && z !== undefined) { - st2.z[0] += z[0] * percent; - st2.z[1] += z[1] * percent; - st2.z[2] += z[2] * percent; - st2.z[3] += z[3] * percent; - st2.z[4] += z[4] * percent; - } else if (st2.p !== undefined && p !== undefined) { - st2.p[0][0] += p[0] * percent; - st2.p[1][0] += p[1] * percent; - } - } else if (st2.k === 'conic' && st2.d !== undefined && d !== undefined) { - st2.d += d * percent; + if (st2.k === 'radial') { + if (st2.z !== undefined && z !== undefined) { + st2.z[0] += z[0] * percent; + st2.z[1] += z[1] * percent; + st2.z[2] += z[2] * percent; + st2.z[3] += z[3] * percent; + st2.z[4] += z[4] * percent; + } else if (st2.p !== undefined && p !== undefined) { st2.p[0][0] += p[0] * percent; st2.p[1][0] += p[1] * percent; } - } // fill纯色 - else { - st2[0] += c[0] * percent; - st2[1] += c[1] * percent; - st2[2] += c[2] * percent; - st2[3] += c[3] * percent; - } - }); - } // color可能超限[0,255],但浏览器已经做了限制,无需关心 - else if (COLOR_HASH$2.hasOwnProperty(k)) { - st = st[0]; - st[0] += v[0] * percent; - st[1] += v[1] * percent; - st[2] += v[2] * percent; - st[3] += v[3] * percent; - } else if (GEOM$3.hasOwnProperty(k)) { - var _st = style[k]; - var tagName = target.tagName; - - if (GEOM$3[k][tagName] && isFunction$4(GEOM$3[k][tagName].calIncrease)) { - var fn = GEOM$3[k][tagName].calIncrease; - - if (target.isMulti) { - style[k] = _st.map(function (item, i) { - return fn(item, v[i], percent); - }); - } else { - style[k] = fn(_st, v, percent); - } - } else if (target.isMulti) { - if (k === 'points' || k === 'controls') { - for (var _i19 = 0, _len10 = Math.min(_st.length, v.length); _i19 < _len10; _i19++) { - var o = _st[_i19]; - var n = v[_i19]; - - if (!isNil$5(o) && !isNil$5(n)) { - for (var _j6 = 0, len2 = Math.min(o.length, n.length); _j6 < len2; _j6++) { - var o2 = o[_j6]; - var n2 = n[_j6]; - - if (!isNil$5(o2) && !isNil$5(n2)) { - for (var _k4 = 0, len3 = Math.min(o2.length, n2.length); _k4 < len3; _k4++) { - if (!isNil$5(o2[_k4]) && !isNil$5(n2[_k4])) { - o2[_k4] += n2[_k4] * percent; - } - } + } else if (st2.k === 'conic' && st2.d !== undefined && d !== undefined) { + st2.d += d * percent; + st2.p[0][0] += p[0] * percent; + st2.p[1][0] += p[1] * percent; + } + } // fill纯色 + else { + st2[0] += c[0] * percent; + st2[1] += c[1] * percent; + st2[2] += c[2] * percent; + st2[3] += c[3] * percent; + } + }); + } // color可能超限[0,255],但浏览器已经做了限制,无需关心 + else if (COLOR_HASH.hasOwnProperty(k)) { + st = st[0]; + st[0] += v[0] * percent; + st[1] += v[1] * percent; + st[2] += v[2] * percent; + st[3] += v[3] * percent; + } else if (GEOM$1.hasOwnProperty(k)) { + var _st = style[k]; + var tagName = target.tagName; + + if (GEOM$1[k][tagName] && isFunction$4(GEOM$1[k][tagName].calIncrease)) { + var fn = GEOM$1[k][tagName].calIncrease; + + if (target.isMulti) { + style[k] = _st.map(function (item, i) { + return fn(item, v[i], percent); + }); + } else { + style[k] = fn(_st, v, percent); + } + } else if (target.isMulti) { + if (k === 'points' || k === 'controls') { + for (var _i19 = 0, _len10 = Math.min(_st.length, v.length); _i19 < _len10; _i19++) { + var o = _st[_i19]; + var n = v[_i19]; + + if (!isNil$a(o) && !isNil$a(n)) { + for (var _j6 = 0, len2 = Math.min(o.length, n.length); _j6 < len2; _j6++) { + var o2 = o[_j6]; + var n2 = n[_j6]; + + if (!isNil$a(o2) && !isNil$a(n2)) { + for (var _k4 = 0, len3 = Math.min(o2.length, n2.length); _k4 < len3; _k4++) { + if (!isNil$a(o2[_k4]) && !isNil$a(n2[_k4])) { + o2[_k4] += n2[_k4] * percent; } } } } - } else if (k === 'controlA' || k === 'controlB') { - v.forEach(function (item, i) { - var st2 = _st[i]; + } + } + } else if (k === 'controlA' || k === 'controlB') { + v.forEach(function (item, i) { + var st2 = _st[i]; - if (!isNil$5(item) && !isNil$5(st2)) { - for (var _i20 = 0, _len11 = Math.min(st2.length, item.length); _i20 < _len11; _i20++) { - var _o = st2[_i20]; - var _n2 = item[_i20]; + if (!isNil$a(item) && !isNil$a(st2)) { + for (var _i20 = 0, _len11 = Math.min(st2.length, item.length); _i20 < _len11; _i20++) { + var _o = st2[_i20]; + var _n2 = item[_i20]; - if (!isNil$5(_o) && !isNil$5(_n2)) { - st2[_i20] += _n2 * percent; - } - } - } - }); - } else { - v.forEach(function (item, i) { - if (!isNil$5(item) && !isNil$5(_st[i])) { - _st[i] += item * percent; + if (!isNil$a(_o) && !isNil$a(_n2)) { + st2[_i20] += _n2 * percent; } - }); + } } - } else { - if (k === 'points' || k === 'controls') { - for (var _i21 = 0, _len12 = Math.min(_st.length, v.length); _i21 < _len12; _i21++) { - var _o2 = _st[_i21]; - var _n3 = v[_i21]; - - if (!isNil$5(_o2) && !isNil$5(_n3)) { - for (var _j7 = 0, _len13 = Math.min(_o2.length, _n3.length); _j7 < _len13; _j7++) { - if (!isNil$5(_o2[_j7]) && !isNil$5(_n3[_j7])) { - _o2[_j7] += _n3[_j7] * percent; - } - } + }); + } else { + v.forEach(function (item, i) { + if (!isNil$a(item) && !isNil$a(_st[i])) { + _st[i] += item * percent; + } + }); + } + } else { + if (k === 'points' || k === 'controls') { + for (var _i21 = 0, _len12 = Math.min(_st.length, v.length); _i21 < _len12; _i21++) { + var _o2 = _st[_i21]; + var _n3 = v[_i21]; + + if (!isNil$a(_o2) && !isNil$a(_n3)) { + for (var _j7 = 0, _len13 = Math.min(_o2.length, _n3.length); _j7 < _len13; _j7++) { + if (!isNil$a(_o2[_j7]) && !isNil$a(_n3[_j7])) { + _o2[_j7] += _n3[_j7] * percent; } } - } else if (k === 'controlA' || k === 'controlB') { - if (!isNil$5(_st[0]) && !isNil$5(v[0])) { - _st[0] += v[0] * percent; - } - - if (!isNil$5(_st[1]) && !isNil$5(v[1])) { - _st[1] += v[1] * percent; - } - } else { - if (!isNil$5(_st) && !isNil$5(v)) { - style[k] += v * percent; - } } } - } else if (k === OPACITY$2 || k === Z_INDEX$1) { - style[k] += v * percent; // 精度问题可能会超过[0,1]区间 + } else if (k === 'controlA' || k === 'controlB') { + if (!isNil$a(_st[0]) && !isNil$a(v[0])) { + _st[0] += v[0] * percent; + } - if (k === OPACITY$2) { - if (style[k] < 0) { - style[k] = 0; - } else if (style[k] > 1) { - style[k] = 1; - } + if (!isNil$a(_st[1]) && !isNil$a(v[1])) { + _st[1] += v[1] * percent; + } + } else { + if (!isNil$a(_st) && !isNil$a(v)) { + style[k] += v * percent; } } + } + } else if (k === OPACITY$3 || k === Z_INDEX$3) { + style[k] += v * percent; // 精度问题可能会超过[0,1]区间 + + if (k === OPACITY$3) { + if (style[k] < 0) { + style[k] = 0; + } else if (style[k] > 1) { + style[k] = 1; + } + } + } }; for (var i = 0, len = transition.length; i < len; i++) { @@ -15225,7 +15229,7 @@ _this = _super.call(this); _this.__id = uuid$1++; - list = clone$3(list || []); + list = clone$1(list || []); if (Array.isArray(list)) { list = list.filter(function (item) { @@ -15233,25 +15237,25 @@ }); } // 动画过程另外一种形式,object描述k-v形式 else if (list && isObject$1(list)) { - var nl = []; - Object.keys(list).forEach(function (k) { - var v = list[k]; - - if (Array.isArray(v)) { - for (var i = 0, len = v.length; i < len; i++) { - var o = nl[i] = nl[i] || { - offset: i / (len - 1) - }; - o[k] = v[i]; - } + var nl = []; + Object.keys(list).forEach(function (k) { + var v = list[k]; + + if (Array.isArray(v)) { + for (var i = 0, len = v.length; i < len; i++) { + var o = nl[i] = nl[i] || { + offset: i / (len - 1) + }; + o[k] = v[i]; } - }); - list = nl; - } else { - list = []; - } + } + }); + list = nl; + } else { + list = []; + } - if (isNumber$1(options)) { + if (isNumber(options)) { _this.__options = { duration: options }; @@ -15377,19 +15381,19 @@ return "continue"; } // <=前面的 else if (current.offset <= offset) { - list.splice(_i22, 1); - _i22--; - _len14--; - i = _i22; - len = _len14; - return "continue"; - } + list.splice(_i22, 1); + _i22--; + _len14--; + i = _i22; + len = _len14; + return "continue"; + } } // 缩写处理 Object.keys(current).forEach(function (k) { - if (abbr.hasOwnProperty(k)) { - abbr.toFull(current, k); + if (abbr$1.hasOwnProperty(k)) { + abbr$1.toFull(current, k); } }); // 检查key合法性 @@ -15410,23 +15414,23 @@ if (list.length === 1) { - list[0] = clone$3(list[0]); + list[0] = clone$1(list[0]); if (list[0].offset === 1) { list.unshift({ offset: 0 }); } else { - var copy = clone$3(list[0]); + var copy = clone$1(list[0]); copy.offset = 1; list.push(copy); } } // 强制clone防止同引用 else { - list.forEach(function (item, i) { - list[i] = clone$3(item); - }); - } // 首尾时间偏移强制为[0, 1],不是的话前后加空帧 + list.forEach(function (item, i) { + list[i] = clone$1(item); + }); + } // 首尾时间偏移强制为[0, 1],不是的话前后加空帧 var first = list[0]; @@ -15488,13 +15492,13 @@ var keys = unify(frames, target); inherit(frames, keys, target); - var framesR = clone$3(frames).reverse(); // 存储原本样式以便恢复用 + var framesR = clone$1(frames).reverse(); // 存储原本样式以便恢复用 var style = target.style, props = target.props; var originStyle = {}; keys.forEach(function (k) { - if (isGeom$2(tagName, k)) { + if (isGeom$1(tagName, k)) { originStyle[k] = props[k]; } @@ -15564,7 +15568,7 @@ if (restore) { keys.forEach(function (k) { - if (GEOM$3.hasOwnProperty(k)) { + if (GEOM$1.hasOwnProperty(k)) { if (target.__currentProps[k] === style[k]) { target.__currentProps[k] = target.props[k]; } @@ -15776,11 +15780,11 @@ if (isLastFrame) ; // 否则根据目前到下一帧的时间差,计算百分比,再反馈到变化数值上 else if (is2) { - percent = currentTime / duration; - } else { - var total = currentFrames[i + 1][FRAME_TIME] - frameTime; - percent = (currentTime - frameTime) / total; - } + percent = currentTime / duration; + } else { + var total = currentFrames[i + 1][FRAME_TIME] - frameTime; + percent = (currentTime - frameTime) / total; + } var inEndDelay, currentFrame = currentFrames[i], @@ -15803,11 +15807,11 @@ inEndDelay = currentTime < duration + endDelay; // 停留对比最后一帧,endDelay可能会多次进入这里,第二次进入样式相等不再重绘 if (stayEnd) { - current = cloneStyle$1(currentFrame[FRAME_STYLE], __config[I_KEYS]); + current = cloneStyle(currentFrame[FRAME_STYLE], __config[I_KEYS]); } // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里 else { - current = cloneStyle$1(__config[I_ORIGIN_STYLE], __config[I_KEYS]); - } // 进入endDelay或结束阶段触发end事件,注意只触发一次,防重在触发的地方做 + current = cloneStyle(__config[I_ORIGIN_STYLE], __config[I_KEYS]); + } // 进入endDelay或结束阶段触发end事件,注意只触发一次,防重在触发的地方做 __config[I_NEXT_END] = true; @@ -16083,13 +16087,13 @@ if (style.hasOwnProperty(i)) { var v = style[i]; // geom的属性变化 - if (GEOM$3.hasOwnProperty(i)) { + if (GEOM$1.hasOwnProperty(i)) { target.currentProps[i] = v; } // 样式 else { - // 将动画样式直接赋给currentStyle - target.currentStyle[i] = v; - } + // 将动画样式直接赋给currentStyle + target.currentStyle[i] = v; + } } }); } @@ -16561,10 +16565,10 @@ return Animation; }(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; + var NODE_DEFS_CACHE$4 = enums.NODE_KEY.NODE_DEFS_CACHE; + var int2rgba$2 = util.int2rgba; + var canvasPolygon$3 = painter.canvasPolygon, + svgPolygon$3 = painter.svgPolygon; function renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h) { var _data = _slicedToArray(data, 6), @@ -16575,7 +16579,7 @@ color = _data[4], inset = _data[5]; - var c = int2rgba$1(color); + var c = int2rgba$2(color); var n = Math.abs(sigma) * 2 + Math.abs(spread) * 2 + Math.abs(x) * 2 + Math.abs(y) * 2; // box本身坐标顺时针 var box = [[x1, y1], [x2, y1], [x2, y2], [x1, y2], [x1, y1]]; // 算上各种偏移/扩散的最外层坐标,且逆时针 @@ -16594,7 +16598,7 @@ var yb = y2 + y - spread; var spreadBox = [[xa, ya], [xb, ya], [xb, yb], [xa, yb]]; // 是否相交判断需要绘制 - var cross = geom.getRectsIntersection([box[0][0], box[0][1], box[2][0], box[2][1]], [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]); + var cross = geom$1.getRectsIntersection([box[0][0], box[0][1], box[2][0], box[2][1]], [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]); if (!cross) { return; @@ -16603,8 +16607,8 @@ cross = [[cross[0], cross[1]], [cross[2], cross[1]], [cross[2], cross[3]], [cross[0], cross[3]], [cross[0], cross[1]]]; // 扩散区域类似边框填充 if (spread) { - canvasPolygon$4(ctx, cross); - canvasPolygon$4(ctx, box.slice(0).reverse()); + canvasPolygon$3(ctx, cross); + canvasPolygon$3(ctx, box.slice(0).reverse()); ctx.clip(); ctx.closePath(); ctx.beginPath(); @@ -16613,13 +16617,13 @@ ctx.fillStyle = c; } - canvasPolygon$4(ctx, box); + canvasPolygon$3(ctx, box); ctx.fill(); ctx.closePath(); ctx.restore(); ctx.save(); ctx.beginPath(); - canvasPolygon$4(ctx, cross); + canvasPolygon$3(ctx, cross); ctx.clip(); ctx.closePath(); ctx.beginPath(); @@ -16631,9 +16635,9 @@ ctx.shadowColor = c; ctx.shadowBlur = sigma; // 画在外围的空心矩形,宽度要比blur大,n考虑了这一情况取了最大值 - canvasPolygon$4(ctx, [[xa, ya], [xb, ya], [xb, yb], [x1 - n, yb], [x1 - n, y2 + n], [x2 + n, y2 + n], [x2 + n, y1 - n], [x1 - n, y1 - n], [x1 - n, yb], [xa, yb], [xa, ya]]); + canvasPolygon$3(ctx, [[xa, ya], [xb, ya], [xb, yb], [x1 - n, yb], [x1 - n, y2 + n], [x2 + n, y2 + n], [x2 + n, y1 - n], [x1 - n, y1 - n], [x1 - n, yb], [xa, yb], [xa, ya]]); } else { - canvasPolygon$4(ctx, box); + canvasPolygon$3(ctx, box); ctx.clip(); ctx.closePath(); ctx.beginPath(); @@ -16646,78 +16650,78 @@ ctx.shadowOffsetY = y; ctx.shadowColor = c; ctx.shadowBlur = sigma; - canvasPolygon$4(ctx, [[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]]); + canvasPolygon$3(ctx, [[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]]); } } // outset需裁减掉box本身的内容,clip()非零环绕显示box外的阴影内容,fill()绘制在内无效 else { - var _xa = x1 + x - spread; - - var _ya = y1 + y - spread; + var _xa = x1 + x - spread; - var _xb = x2 + x + spread; + var _ya = y1 + y - spread; - var _yb = y2 + y + spread; + var _xb = x2 + x + spread; - var blurBox = [[_xa, _ya], [_xb, _ya], [_xb, _yb], [_xa, _yb]]; + var _yb = y2 + y + spread; - var _cross = geom.getRectsIntersection([box[0][0], box[0][1], box[2][0], box[2][1]], [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]); // 分为是否有spread,因模糊成本spread区域将没有模糊 + var blurBox = [[_xa, _ya], [_xb, _ya], [_xb, _yb], [_xa, _yb]]; + var _cross = geom$1.getRectsIntersection([box[0][0], box[0][1], box[2][0], box[2][1]], [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]); // 分为是否有spread,因模糊成本spread区域将没有模糊 - if (spread) { - // 扩散区域类似边框填充 - canvasPolygon$4(ctx, box); - canvasPolygon$4(ctx, blurBox.slice(0).reverse()); - ctx.clip(); - ctx.closePath(); - ctx.beginPath(); - if (ctx.fillStyle !== c) { - ctx.fillStyle = c; - } + if (spread) { + // 扩散区域类似边框填充 + canvasPolygon$3(ctx, box); + canvasPolygon$3(ctx, blurBox.slice(0).reverse()); + ctx.clip(); + ctx.closePath(); + ctx.beginPath(); - canvasPolygon$4(ctx, blurBox); - ctx.fill(); - ctx.closePath(); - ctx.restore(); - ctx.save(); - ctx.beginPath(); // 阴影部分看相交情况裁剪,有相交时逆时针绘制相交区域即可排除之 + if (ctx.fillStyle !== c) { + ctx.fillStyle = c; + } - if (_cross) { - canvasPolygon$4(ctx, [[_cross[0], _cross[1]], [_cross[2], _cross[1]], [_cross[2], _cross[3]], [_cross[0], _cross[3]], [_cross[0], _cross[1]]].reverse()); - } + canvasPolygon$3(ctx, blurBox); + ctx.fill(); + ctx.closePath(); + ctx.restore(); + ctx.save(); + ctx.beginPath(); // 阴影部分看相交情况裁剪,有相交时逆时针绘制相交区域即可排除之 - canvasPolygon$4(ctx, box); - canvasPolygon$4(ctx, blurBox); - canvasPolygon$4(ctx, outer); - ctx.clip(); - ctx.closePath(); - ctx.beginPath(); + if (_cross) { + canvasPolygon$3(ctx, [[_cross[0], _cross[1]], [_cross[2], _cross[1]], [_cross[2], _cross[3]], [_cross[0], _cross[3]], [_cross[0], _cross[1]]].reverse()); + } - if (ctx.fillStyle !== '#FFF') { - ctx.fillStyle = '#FFF'; - } + canvasPolygon$3(ctx, box); + canvasPolygon$3(ctx, blurBox); + canvasPolygon$3(ctx, outer); + ctx.clip(); + ctx.closePath(); + ctx.beginPath(); - ctx.shadowColor = c; - ctx.shadowBlur = sigma; - canvasPolygon$4(ctx, blurBox); - } else { - canvasPolygon$4(ctx, box); - canvasPolygon$4(ctx, outer); - ctx.clip(); - ctx.closePath(); - ctx.beginPath(); + if (ctx.fillStyle !== '#FFF') { + ctx.fillStyle = '#FFF'; + } - if (ctx.fillStyle !== '#FFF') { - ctx.fillStyle = '#FFF'; - } + ctx.shadowColor = c; + ctx.shadowBlur = sigma; + canvasPolygon$3(ctx, blurBox); + } else { + canvasPolygon$3(ctx, box); + canvasPolygon$3(ctx, outer); + ctx.clip(); + ctx.closePath(); + ctx.beginPath(); - ctx.shadowOffsetX = x; - ctx.shadowOffsetY = y; - ctx.shadowColor = c; - ctx.shadowBlur = sigma; - canvasPolygon$4(ctx, box); + if (ctx.fillStyle !== '#FFF') { + ctx.fillStyle = '#FFF'; } + + ctx.shadowOffsetX = x; + ctx.shadowOffsetY = y; + ctx.shadowColor = c; + ctx.shadowBlur = sigma; + canvasPolygon$3(ctx, box); } + } ctx.fill(); ctx.closePath(); @@ -16736,7 +16740,7 @@ var _spreadBox = [[_xa2, _ya2], [_xb2, _ya2], [_xb2, _yb2], [_xa2, _yb2]]; - var _cross2 = geom.getRectsIntersection([box[0][0], box[0][1], box[2][0], box[2][1]], [_spreadBox[0][0], _spreadBox[0][1], _spreadBox[2][0], _spreadBox[2][1]]); + var _cross2 = geom$1.getRectsIntersection([box[0][0], box[0][1], box[2][0], box[2][1]], [_spreadBox[0][0], _spreadBox[0][1], _spreadBox[2][0], _spreadBox[2][1]]); if (!_cross2) { return; @@ -16754,40 +16758,40 @@ }] }; - xom.__config[NODE_DEFS_CACHE$2].push(v); + xom.__config[NODE_DEFS_CACHE$4].push(v); var filter = ctx.add(v); var v2 = { 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); - xom.__config[NODE_DEFS_CACHE$2].push(v2); + xom.__config[NODE_DEFS_CACHE$4].push(v2); 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); - xom.__config[NODE_DEFS_CACHE$2].push(v); + xom.__config[NODE_DEFS_CACHE$4].push(v); 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 = { @@ -16801,24 +16805,24 @@ var _filter = ctx.add(_v); - xom.__config[NODE_DEFS_CACHE$2].push(_v); + xom.__config[NODE_DEFS_CACHE$4].push(_v); _v = { tagName: 'clipPath', children: [{ tagName: 'path', - props: [['d', svgPolygon$4(box)], ['fill', '#FFF']] + props: [['d', svgPolygon$3(box)], ['fill', '#FFF']] }] }; var _clip = ctx.add(_v); - xom.__config[NODE_DEFS_CACHE$2].push(_v); + xom.__config[NODE_DEFS_CACHE$4].push(_v); 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 { @@ -16832,7 +16836,7 @@ var _blurBox = [[_xa3, _ya3], [_xb3, _ya3], [_xb3, _yb3], [_xa3, _yb3]]; - var _cross3 = geom.getRectsIntersection([box[0][0], box[0][1], box[2][0], box[2][1]], [_blurBox[0][0], _blurBox[0][1], _blurBox[2][0], _blurBox[2][1]]); + var _cross3 = geom$1.getRectsIntersection([box[0][0], box[0][1], box[2][0], box[2][1]], [_blurBox[0][0], _blurBox[0][1], _blurBox[2][0], _blurBox[2][1]]); if (spread) { var _v2 = { @@ -16846,40 +16850,40 @@ var _filter2 = ctx.add(_v2); - xom.__config[NODE_DEFS_CACHE$2].push(_v2); + xom.__config[NODE_DEFS_CACHE$4].push(_v2); _v2 = { 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']] }] }; var _clip2 = ctx.add(_v2); - xom.__config[NODE_DEFS_CACHE$2].push(_v2); + xom.__config[NODE_DEFS_CACHE$4].push(_v2); 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); - xom.__config[NODE_DEFS_CACHE$2].push(_v2); + xom.__config[NODE_DEFS_CACHE$4].push(_v2); 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 = { @@ -16893,24 +16897,24 @@ var _filter3 = ctx.add(_v3); - xom.__config[NODE_DEFS_CACHE$2].push(_v3); + xom.__config[NODE_DEFS_CACHE$4].push(_v3); _v3 = { 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']] }] }; var _clip3 = ctx.add(_v3); - xom.__config[NODE_DEFS_CACHE$2].push(_v3); + xom.__config[NODE_DEFS_CACHE$4].push(_v3); 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 + ')']] }); } } @@ -16940,7 +16944,7 @@ luminosity: true }; - function mbmName(v) { + function mbmName$2(v) { if (v) { return v.replace(/[A-Z]/, function ($0) { return '-' + $0.toLowerCase(); @@ -16948,22 +16952,22 @@ } } - function isValidMbm(v) { - return MBM_HASH.hasOwnProperty(mbmName(v)); + function isValidMbm$2(v) { + return MBM_HASH.hasOwnProperty(mbmName$2(v)); } var mbm = { - mbmName: mbmName, - isValidMbm: isValidMbm + mbmName: mbmName$2, + isValidMbm: isValidMbm$2 }; - 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; + var _enums$STYLE_KEY$e = enums.STYLE_KEY, + MARGIN_LEFT$6 = _enums$STYLE_KEY$e.MARGIN_LEFT, + MARGIN_RIGHT$5 = _enums$STYLE_KEY$e.MARGIN_RIGHT, + PADDING_LEFT$6 = _enums$STYLE_KEY$e.PADDING_LEFT, + PADDING_RIGHT$5 = _enums$STYLE_KEY$e.PADDING_RIGHT, + BORDER_LEFT_WIDTH$6 = _enums$STYLE_KEY$e.BORDER_LEFT_WIDTH, + BORDER_RIGHT_WIDTH$5 = _enums$STYLE_KEY$e.BORDER_RIGHT_WIDTH; /** * 获取inline的每一行内容的矩形坐标4个点,同时附带上border的矩形,比前面4个点尺寸大或相等(有无border/padding) * @param xom @@ -17015,9 +17019,9 @@ 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]; + marginLeft = _dom$computedStyle[MARGIN_LEFT$6], + _paddingLeft = _dom$computedStyle[PADDING_LEFT$6], + _borderLeftWidth = _dom$computedStyle[BORDER_LEFT_WIDTH$6]; x1 -= marginLeft + _paddingLeft + _borderLeftWidth; } @@ -17047,9 +17051,9 @@ 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]; + marginRight = _dom$computedStyle2[MARGIN_RIGHT$5], + _paddingRight = _dom$computedStyle2[PADDING_RIGHT$5], + _borderRightWidth = _dom$computedStyle2[BORDER_RIGHT_WIDTH$5]; x2 += marginRight + _paddingRight + _borderRightWidth; } @@ -17104,17 +17108,17 @@ 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]; + marginLeft = _dom$computedStyle3[MARGIN_LEFT$6], + paddingLeft = _dom$computedStyle3[PADDING_LEFT$6], + borderLeftWidth = _dom$computedStyle3[BORDER_LEFT_WIDTH$6]; 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]; + marginRight = _dom$computedStyle4[MARGIN_RIGHT$5], + paddingRight = _dom$computedStyle4[PADDING_RIGHT$5], + borderRightWidth = _dom$computedStyle4[BORDER_RIGHT_WIDTH$5]; sum += marginRight + paddingRight + borderRightWidth; } @@ -17130,151 +17134,151 @@ getInlineWidth: getInlineWidth }; - var svgPolygon$5 = painter.svgPolygon; - var CANVAS$1 = mode.CANVAS, + var svgPolygon$2 = painter.svgPolygon; + var CANVAS = mode.CANVAS, SVG = mode.SVG, - WEBGL$1 = mode.WEBGL; - 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$3 = _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$3 = _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$UPDATE_KEY$2 = enums.UPDATE_KEY, - UPDATE_NODE$2 = _enums$UPDATE_KEY$2.UPDATE_NODE, - UPDATE_FOCUS$1 = _enums$UPDATE_KEY$2.UPDATE_FOCUS, - UPDATE_STYLE$1 = _enums$UPDATE_KEY$2.UPDATE_STYLE, - UPDATE_OVERWRITE = _enums$UPDATE_KEY$2.UPDATE_OVERWRITE, - UPDATE_KEYS$1 = _enums$UPDATE_KEY$2.UPDATE_KEYS, - UPDATE_CONFIG$2 = _enums$UPDATE_KEY$2.UPDATE_CONFIG, - UPDATE_REMOVE_DOM = _enums$UPDATE_KEY$2.UPDATE_REMOVE_DOM, - STRUCT_HAS_MASK = enums.STRUCT_KEY.STRUCT_HAS_MASK, - _enums$NODE_KEY$4 = enums.NODE_KEY, - NODE_TAG_NAME = _enums$NODE_KEY$4.NODE_TAG_NAME, - NODE_CACHE_STYLE = _enums$NODE_KEY$4.NODE_CACHE_STYLE, - NODE_CURRENT_STYLE$1 = _enums$NODE_KEY$4.NODE_CURRENT_STYLE, - NODE_COMPUTED_STYLE$2 = _enums$NODE_KEY$4.NODE_COMPUTED_STYLE, - NODE_STYLE$1 = _enums$NODE_KEY$4.NODE_STYLE, - NODE_STRUCT$1 = _enums$NODE_KEY$4.NODE_STRUCT, - NODE_OPACITY$2 = _enums$NODE_KEY$4.NODE_OPACITY, - NODE_MATRIX_EVENT$2 = _enums$NODE_KEY$4.NODE_MATRIX_EVENT, - NODE_MATRIX$1 = _enums$NODE_KEY$4.NODE_MATRIX, - NODE_LIMIT_CACHE$1 = _enums$NODE_KEY$4.NODE_LIMIT_CACHE, - NODE_HAS_CONTENT$1 = _enums$NODE_KEY$4.NODE_HAS_CONTENT, - NODE_REFRESH_LV = _enums$NODE_KEY$4.NODE_REFRESH_LV, - NODE_CACHE$2 = _enums$NODE_KEY$4.NODE_CACHE, - NODE_CACHE_TOTAL = _enums$NODE_KEY$4.NODE_CACHE_TOTAL, - NODE_CACHE_FILTER$1 = _enums$NODE_KEY$4.NODE_CACHE_FILTER, - NODE_CACHE_MASK = _enums$NODE_KEY$4.NODE_CACHE_MASK, - NODE_CACHE_OVERFLOW$1 = _enums$NODE_KEY$4.NODE_CACHE_OVERFLOW, - NODE_IS_DESTROYED$1 = _enums$NODE_KEY$4.NODE_IS_DESTROYED, - NODE_DEFS_CACHE$3 = _enums$NODE_KEY$4.NODE_DEFS_CACHE, - NODE_DOM_PARENT$2 = _enums$NODE_KEY$4.NODE_DOM_PARENT, - NODE_IS_INLINE = _enums$NODE_KEY$4.NODE_IS_INLINE, - NODE_PERSPECTIVE_MATRIX = _enums$NODE_KEY$4.NODE_PERSPECTIVE_MATRIX, - NODE_IS_MASK = _enums$NODE_KEY$4.NODE_IS_MASK, - NODE_VIRTUAL_DOM$1 = _enums$NODE_KEY$4.NODE_VIRTUAL_DOM; - var AUTO$4 = o.AUTO, - PX$6 = o.PX, - PERCENT$7 = o.PERCENT, - INHERIT$4 = o.INHERIT, - NUMBER$5 = o.NUMBER, - REM$7 = o.REM, - VW$7 = o.VW, - VH$7 = o.VH, - DEG$2 = o.DEG; - var int2rgba$2 = util.int2rgba, - rgba2int$3 = util.rgba2int, - joinArr$2 = util.joinArr, - isNil$6 = util.isNil; - var calRelative$1 = css.calRelative; - var GEOM$4 = o$2.GEOM; + WEBGL = mode.WEBGL; + var STYLE_KEY = enums.STYLE_KEY, + STYLE_RV_KEY = enums.STYLE_RV_KEY, + style2Upper = enums.style2Upper, + _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$5 = _enums$STYLE_KEY$d.PADDING_LEFT, + PADDING_RIGHT$4 = _enums$STYLE_KEY$d.PADDING_RIGHT, + PADDING_TOP$4 = _enums$STYLE_KEY$d.PADDING_TOP, + PADDING_BOTTOM$4 = _enums$STYLE_KEY$d.PADDING_BOTTOM, + MARGIN_LEFT$5 = _enums$STYLE_KEY$d.MARGIN_LEFT, + MARGIN_TOP$4 = _enums$STYLE_KEY$d.MARGIN_TOP, + MARGIN_BOTTOM$4 = _enums$STYLE_KEY$d.MARGIN_BOTTOM, + MARGIN_RIGHT$4 = _enums$STYLE_KEY$d.MARGIN_RIGHT, + BORDER_LEFT_WIDTH$5 = _enums$STYLE_KEY$d.BORDER_LEFT_WIDTH, + BORDER_TOP_WIDTH$4 = _enums$STYLE_KEY$d.BORDER_TOP_WIDTH, + BORDER_BOTTOM_WIDTH$4 = _enums$STYLE_KEY$d.BORDER_BOTTOM_WIDTH, + BORDER_RIGHT_WIDTH$4 = _enums$STYLE_KEY$d.BORDER_RIGHT_WIDTH, + TOP$3 = _enums$STYLE_KEY$d.TOP, + RIGHT$2 = _enums$STYLE_KEY$d.RIGHT, + BOTTOM$3 = _enums$STYLE_KEY$d.BOTTOM, + LEFT$2 = _enums$STYLE_KEY$d.LEFT, + POSITION$4 = _enums$STYLE_KEY$d.POSITION, + DISPLAY$7 = _enums$STYLE_KEY$d.DISPLAY, + WIDTH$4 = _enums$STYLE_KEY$d.WIDTH, + HEIGHT$5 = _enums$STYLE_KEY$d.HEIGHT, + MATRIX = _enums$STYLE_KEY$d.MATRIX, + TRANSLATE_X = _enums$STYLE_KEY$d.TRANSLATE_X, + TRANSLATE_Y = _enums$STYLE_KEY$d.TRANSLATE_Y, + TRANSLATE_Z = _enums$STYLE_KEY$d.TRANSLATE_Z, + TRANSFORM$1 = _enums$STYLE_KEY$d.TRANSFORM, + SCALE_X = _enums$STYLE_KEY$d.SCALE_X, + SCALE_Y = _enums$STYLE_KEY$d.SCALE_Y, + SCALE_Z = _enums$STYLE_KEY$d.SCALE_Z, + ROTATE_X = _enums$STYLE_KEY$d.ROTATE_X, + ROTATE_Y = _enums$STYLE_KEY$d.ROTATE_Y, + ROTATE_Z = _enums$STYLE_KEY$d.ROTATE_Z, + SKEW_X = _enums$STYLE_KEY$d.SKEW_X, + SKEW_Y = _enums$STYLE_KEY$d.SKEW_Y, + PERSPECTIVE$2 = _enums$STYLE_KEY$d.PERSPECTIVE, + PERSPECTIVE_ORIGIN$1 = _enums$STYLE_KEY$d.PERSPECTIVE_ORIGIN, + ROTATE_3D = _enums$STYLE_KEY$d.ROTATE_3D, + TRANSFORM_ORIGIN$1 = _enums$STYLE_KEY$d.TRANSFORM_ORIGIN, + BACKGROUND_POSITION_X = _enums$STYLE_KEY$d.BACKGROUND_POSITION_X, + BACKGROUND_POSITION_Y = _enums$STYLE_KEY$d.BACKGROUND_POSITION_Y, + BACKGROUND_SIZE = _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$7 = _enums$STYLE_KEY$d.BOX_SHADOW, + OPACITY$2 = _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$3 = _enums$STYLE_KEY$d.MIX_BLEND_MODE, + TEXT_OVERFLOW = _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 = _enums$STYLE_KEY$d.FONT_STYLE, + COLOR$1 = _enums$STYLE_KEY$d.COLOR, + VISIBILITY$4 = _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 = _enums$STYLE_KEY$d.BACKGROUND_CLIP, + FONT_SIZE$9 = _enums$STYLE_KEY$d.FONT_SIZE, + FONT_FAMILY = _enums$STYLE_KEY$d.FONT_FAMILY, + LINE_HEIGHT$1 = _enums$STYLE_KEY$d.LINE_HEIGHT, + TEXT_STROKE_COLOR = _enums$STYLE_KEY$d.TEXT_STROKE_COLOR, + TEXT_STROKE_WIDTH = _enums$STYLE_KEY$d.TEXT_STROKE_WIDTH, + TEXT_STROKE_OVER = _enums$STYLE_KEY$d.TEXT_STROKE_OVER, + _enums$UPDATE_KEY$3 = enums.UPDATE_KEY, + UPDATE_NODE$3 = _enums$UPDATE_KEY$3.UPDATE_NODE, + UPDATE_FOCUS$3 = _enums$UPDATE_KEY$3.UPDATE_FOCUS, + UPDATE_STYLE$1 = _enums$UPDATE_KEY$3.UPDATE_STYLE, + UPDATE_OVERWRITE$1 = _enums$UPDATE_KEY$3.UPDATE_OVERWRITE, + UPDATE_KEYS$1 = _enums$UPDATE_KEY$3.UPDATE_KEYS, + UPDATE_CONFIG$3 = _enums$UPDATE_KEY$3.UPDATE_CONFIG, + UPDATE_REMOVE_DOM$1 = _enums$UPDATE_KEY$3.UPDATE_REMOVE_DOM, + STRUCT_HAS_MASK$1 = enums.STRUCT_KEY.STRUCT_HAS_MASK, + _enums$NODE_KEY$6 = enums.NODE_KEY, + NODE_TAG_NAME$1 = _enums$NODE_KEY$6.NODE_TAG_NAME, + NODE_CACHE_STYLE$2 = _enums$NODE_KEY$6.NODE_CACHE_STYLE, + NODE_CURRENT_STYLE$5 = _enums$NODE_KEY$6.NODE_CURRENT_STYLE, + NODE_COMPUTED_STYLE$3 = _enums$NODE_KEY$6.NODE_COMPUTED_STYLE, + NODE_STYLE$4 = _enums$NODE_KEY$6.NODE_STYLE, + NODE_STRUCT$3 = _enums$NODE_KEY$6.NODE_STRUCT, + NODE_OPACITY$1 = _enums$NODE_KEY$6.NODE_OPACITY, + NODE_MATRIX_EVENT$2 = _enums$NODE_KEY$6.NODE_MATRIX_EVENT, + NODE_MATRIX$2 = _enums$NODE_KEY$6.NODE_MATRIX, + NODE_LIMIT_CACHE$1 = _enums$NODE_KEY$6.NODE_LIMIT_CACHE, + NODE_HAS_CONTENT = _enums$NODE_KEY$6.NODE_HAS_CONTENT, + NODE_REFRESH_LV$2 = _enums$NODE_KEY$6.NODE_REFRESH_LV, + NODE_CACHE$3 = _enums$NODE_KEY$6.NODE_CACHE, + NODE_CACHE_TOTAL$2 = _enums$NODE_KEY$6.NODE_CACHE_TOTAL, + NODE_CACHE_FILTER$2 = _enums$NODE_KEY$6.NODE_CACHE_FILTER, + NODE_CACHE_MASK$2 = _enums$NODE_KEY$6.NODE_CACHE_MASK, + NODE_CACHE_OVERFLOW$2 = _enums$NODE_KEY$6.NODE_CACHE_OVERFLOW, + NODE_IS_DESTROYED$1 = _enums$NODE_KEY$6.NODE_IS_DESTROYED, + NODE_DEFS_CACHE$3 = _enums$NODE_KEY$6.NODE_DEFS_CACHE, + NODE_DOM_PARENT$4 = _enums$NODE_KEY$6.NODE_DOM_PARENT, + NODE_IS_INLINE$1 = _enums$NODE_KEY$6.NODE_IS_INLINE, + NODE_PERSPECTIVE_MATRIX$1 = _enums$NODE_KEY$6.NODE_PERSPECTIVE_MATRIX, + NODE_IS_MASK$3 = _enums$NODE_KEY$6.NODE_IS_MASK, + NODE_VIRTUAL_DOM$1 = _enums$NODE_KEY$6.NODE_VIRTUAL_DOM; + var AUTO$4 = o$4.AUTO, + PX$5 = o$4.PX, + PERCENT$5 = o$4.PERCENT, + INHERIT$1 = o$4.INHERIT, + NUMBER = o$4.NUMBER, + REM$9 = o$4.REM, + VW$9 = o$4.VW, + VH$9 = o$4.VH, + DEG = o$4.DEG; + var int2rgba$1 = util.int2rgba, + rgba2int = util.rgba2int, + joinArr$1 = util.joinArr, + isNil$9 = util.isNil; + var calRelative = css.calRelative; + var GEOM = o$2.GEOM; var mbmName$1 = mbm.mbmName, isValidMbm$1 = mbm.isValidMbm; - var point2d$1 = mx.point2d; - var contain = o$3.contain, - NONE = o$3.NONE, - TF = o$3.TRANSFORM, - REFLOW = o$3.REFLOW, - REPAINT$1 = o$3.REPAINT, - TX = o$3.TRANSLATE_X, - TY = o$3.TRANSLATE_Y, - TZ = o$3.TRANSLATE_Z; + var point2d = mx.point2d; + var contain$3 = o$1.contain, + NONE$3 = o$1.NONE, + TF = o$1.TRANSFORM, + REFLOW$2 = o$1.REFLOW, + REPAINT$2 = o$1.REPAINT, + TX = o$1.TRANSLATE_X, + TY = o$1.TRANSLATE_Y, + TZ = o$1.TRANSLATE_Z; function getFirstEmptyInlineWidth(xom) { var n = 0; @@ -17284,11 +17288,11 @@ for (var i = 0; i < length; i++) { var child = flowChildren[i]; - if (child instanceof Xom$1 || child instanceof Component$1 && child.shadowRoot instanceof Xom$1) { + if (child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) { if (child.flowChildren.length) { n += getFirstEmptyInlineWidth(child); break; - } else if (child.__config[NODE_IS_INLINE]) { + } else if (child.__config[NODE_IS_INLINE$1]) { n += child.outerWidth; } } else { @@ -17307,7 +17311,7 @@ for (var i = length - 1; i >= 0; i--) { var child = flowChildren[i]; - if (child instanceof Xom$1 || child instanceof Component$1 && child.shadowRoot instanceof Xom$1) { + if (child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) { if (child.flowChildren.length) { n += getLastEmptyInlineWidth(child); break; @@ -17322,7 +17326,7 @@ return n; } - var Xom$1 = /*#__PURE__*/function (_Node) { + var Xom = /*#__PURE__*/function (_Node) { _inherits(Xom, _Node); var _super = _createSuper(Xom); @@ -17370,16 +17374,16 @@ var isClip = _this.__isClip = !!_this.props.clip; var isMask = _this.__isMask = isClip || !!_this.props.mask; var config = _this.__config; - config[NODE_TAG_NAME] = tagName; - config[NODE_CACHE_STYLE] = _this.__cacheStyle; - config[NODE_CURRENT_STYLE$1] = _this.__currentStyle; - config[NODE_COMPUTED_STYLE$2] = _this.__computedStyle; - config[NODE_REFRESH_LV] = REFLOW; - config[NODE_STYLE$1] = _this.__style; - config[NODE_MATRIX$1] = []; + config[NODE_TAG_NAME$1] = tagName; + config[NODE_CACHE_STYLE$2] = _this.__cacheStyle; + config[NODE_CURRENT_STYLE$5] = _this.__currentStyle; + config[NODE_COMPUTED_STYLE$3] = _this.__computedStyle; + config[NODE_REFRESH_LV$2] = REFLOW$2; + config[NODE_STYLE$4] = _this.__style; + config[NODE_MATRIX$2] = []; config[NODE_MATRIX_EVENT$2] = []; config[NODE_DEFS_CACHE$3] = _this.__cacheDefs; - config[NODE_IS_MASK] = isMask; + config[NODE_IS_MASK$3] = isMask; _this.__frameAnimateList = []; _this.__contentBoxList = []; // inline存储内容用 // this.__json domApi需要获取生成时的json引用,builder过程添加,如appendChild时json也需要跟着变更 @@ -17393,10 +17397,10 @@ var res = _get(_getPrototypeOf(Xom.prototype), "__structure", this).call(this, i, lv, j); if (this.__hasMask) { - res[STRUCT_HAS_MASK] = this.__hasMask; + res[STRUCT_HAS_MASK$1] = this.__hasMask; } - this.__config[NODE_STRUCT$1] = res; + this.__config[NODE_STRUCT$3] = res; return res; } // 设置margin/padding的实际值,layout时执行,inline的垂直方向仍然计算值,但在布局时被忽略 @@ -17406,8 +17410,8 @@ var _this2 = this; ['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)]; + var a = STYLE_KEY[style2Upper('margin' + k)]; + var b = STYLE_KEY[style2Upper('padding' + k)]; computedStyle[a] = _this2.__mpWidth(currentStyle[a], w); computedStyle[b] = _this2.__mpWidth(currentStyle[b], w); }); @@ -17415,15 +17419,15 @@ }, { key: "__mpWidth", value: function __mpWidth(mp, w) { - if (mp[1] === PX$6) { + if (mp[1] === PX$5) { return mp[0]; - } else if (mp[1] === PERCENT$7) { + } else if (mp[1] === PERCENT$5) { return mp[0] * w * 0.01; - } else if (mp[1] === REM$7) { - return mp[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (mp[1] === VW$7) { + } else if (mp[1] === REM$9) { + return mp[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (mp[1] === VW$9) { return mp[0] * this.root.width * 0.01; - } else if (mp[1] === VH$7) { + } else if (mp[1] === VH$9) { return mp[0] * this.root.height * 0.01; } @@ -17434,12 +17438,12 @@ key: "__ioSize", value: function __ioSize(w, h) { var computedStyle = this.computedStyle; - this.__clientWidth = w += computedStyle[PADDING_LEFT$2] + computedStyle[PADDING_RIGHT$1]; - this.__clientHeight = h += computedStyle[PADDING_TOP$1] + computedStyle[PADDING_BOTTOM$1]; - this.__offsetWidth = w += computedStyle[BORDER_LEFT_WIDTH$3] + computedStyle[BORDER_RIGHT_WIDTH$2]; - this.__offsetHeight = h += computedStyle[BORDER_TOP_WIDTH$2] + computedStyle[BORDER_BOTTOM_WIDTH$2]; - this.__outerWidth = w + computedStyle[MARGIN_LEFT$1] + computedStyle[MARGIN_RIGHT$1]; - this.__outerHeight = h + computedStyle[MARGIN_TOP] + computedStyle[MARGIN_BOTTOM]; + this.__clientWidth = w += computedStyle[PADDING_LEFT$5] + computedStyle[PADDING_RIGHT$4]; + this.__clientHeight = h += computedStyle[PADDING_TOP$4] + computedStyle[PADDING_BOTTOM$4]; + this.__offsetWidth = w += computedStyle[BORDER_LEFT_WIDTH$5] + computedStyle[BORDER_RIGHT_WIDTH$4]; + this.__offsetHeight = h += computedStyle[BORDER_TOP_WIDTH$4] + computedStyle[BORDER_BOTTOM_WIDTH$4]; + this.__outerWidth = w + computedStyle[MARGIN_LEFT$5] + computedStyle[MARGIN_RIGHT$4]; + this.__outerHeight = h + computedStyle[MARGIN_TOP$4] + computedStyle[MARGIN_BOTTOM$4]; } // 换算margin/padding为px单位,onlyFixedValue只考虑绝对值,不考虑百分比等 }, { @@ -17447,17 +17451,17 @@ value: function __calMp(v, w, onlyFixedValue) { var n = 0; - if (v[1] === PX$6) { + if (v[1] === PX$5) { n += v[0]; - } else if (v[1] === PERCENT$7 && !onlyFixedValue) { + } else if (v[1] === PERCENT$5 && !onlyFixedValue) { v[0] *= w * 0.01; - v[1] = PX$6; + v[1] = PX$5; n += v[0]; - } else if (v[1] === REM$7) { - n += v[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (v[1] === VW$7) { + } else if (v[1] === REM$9) { + n += v[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (v[1] === VW$9) { n += v[0] * this.root.width * 0.01; - } else if (v[1] === VH$7) { + } else if (v[1] === VH$9) { n += v[0] * this.root.height * 0.01; } @@ -17467,39 +17471,39 @@ }, { key: "__addMp", value: function __addMp(isDirectionRow, w, currentStyle, res, isDirectItem) { - var marginLeft = currentStyle[MARGIN_LEFT$1], - marginTop = currentStyle[MARGIN_TOP], - marginRight = currentStyle[MARGIN_RIGHT$1], - marginBottom = currentStyle[MARGIN_BOTTOM], - paddingLeft = currentStyle[PADDING_LEFT$2], - paddingTop = currentStyle[PADDING_TOP$1], - paddingRight = currentStyle[PADDING_RIGHT$1], - paddingBottom = currentStyle[PADDING_BOTTOM$1], - borderTopWidth = currentStyle[BORDER_TOP_WIDTH$2], - borderRightWidth = currentStyle[BORDER_RIGHT_WIDTH$2], - borderBottomWidth = currentStyle[BORDER_BOTTOM_WIDTH$2], - borderLeftWidth = currentStyle[BORDER_LEFT_WIDTH$3]; - - if (isDirectionRow) { + var marginLeft = currentStyle[MARGIN_LEFT$5], + marginTop = currentStyle[MARGIN_TOP$4], + marginRight = currentStyle[MARGIN_RIGHT$4], + marginBottom = currentStyle[MARGIN_BOTTOM$4], + paddingLeft = currentStyle[PADDING_LEFT$5], + paddingTop = currentStyle[PADDING_TOP$4], + paddingRight = currentStyle[PADDING_RIGHT$4], + paddingBottom = currentStyle[PADDING_BOTTOM$4], + borderTopWidth = currentStyle[BORDER_TOP_WIDTH$4], + borderRightWidth = currentStyle[BORDER_RIGHT_WIDTH$4], + borderBottomWidth = currentStyle[BORDER_BOTTOM_WIDTH$4], + borderLeftWidth = currentStyle[BORDER_LEFT_WIDTH$5]; + + if (isDirectionRow) { var mp = this.__calMp(marginLeft, w, !isDirectItem) + this.__calMp(marginRight, w, !isDirectItem) + this.__calMp(paddingLeft, w, !isDirectItem) + this.__calMp(paddingRight, w, !isDirectItem); - if (borderLeftWidth[1] === PX$6) { + if (borderLeftWidth[1] === PX$5) { mp += borderLeftWidth[0]; - } else if (borderLeftWidth[1] === REM$7) { - mp += borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (borderLeftWidth[1] === VW$7) { + } else if (borderLeftWidth[1] === REM$9) { + mp += borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (borderLeftWidth[1] === VW$9) { mp += borderLeftWidth[0] * this.root.width * 0.01; - } else if (borderLeftWidth[1] === VH$7) { + } else if (borderLeftWidth[1] === VH$9) { mp += borderLeftWidth[0] * this.root.height * 0.01; } - if (borderRightWidth[1] === PX$6) { + if (borderRightWidth[1] === PX$5) { mp += borderRightWidth[0]; - } else if (borderRightWidth[1] === REM$7) { - mp += borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (borderRightWidth[1] === VW$7) { + } else if (borderRightWidth[1] === REM$9) { + mp += borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (borderRightWidth[1] === VW$9) { mp += borderRightWidth[0] * this.root.width * 0.01; - } else if (borderRightWidth[1] === VH$7) { + } else if (borderRightWidth[1] === VH$9) { mp += borderRightWidth[0] * this.root.height * 0.01; } @@ -17509,23 +17513,23 @@ } else { var _mp = this.__calMp(marginTop, w, !isDirectItem) + this.__calMp(marginBottom, w, !isDirectItem) + this.__calMp(paddingTop, w, !isDirectItem) + this.__calMp(paddingBottom, w, !isDirectItem); - if (borderTopWidth[1] === PX$6) { + if (borderTopWidth[1] === PX$5) { _mp += borderTopWidth[0]; - } else if (borderTopWidth[1] === REM$7) { - _mp += borderTopWidth[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (borderTopWidth[1] === VW$7) { + } else if (borderTopWidth[1] === REM$9) { + _mp += borderTopWidth[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (borderTopWidth[1] === VW$9) { _mp += borderTopWidth[0] * this.root.width * 0.01; - } else if (borderTopWidth[1] === VH$7) { + } else if (borderTopWidth[1] === VH$9) { _mp += borderTopWidth[0] * this.root.height * 0.01; } - if (borderBottomWidth[1] === PX$6) { + if (borderBottomWidth[1] === PX$5) { _mp += borderBottomWidth[0]; - } else if (borderBottomWidth[1] === REM$7) { - _mp += borderBottomWidth[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (borderBottomWidth[1] === VW$7) { + } else if (borderBottomWidth[1] === REM$9) { + _mp += borderBottomWidth[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (borderBottomWidth[1] === VW$9) { _mp += borderBottomWidth[0] * this.root.width * 0.01; - } else if (borderBottomWidth[1] === VH$7) { + } else if (borderBottomWidth[1] === VH$9) { _mp += borderBottomWidth[0] * this.root.height * 0.01; } @@ -17547,9 +17551,9 @@ currentStyle = this.currentStyle, computedStyle = this.computedStyle, __config = this.__config; - var display = computedStyle[DISPLAY$3]; + var display = computedStyle[DISPLAY$7]; var width = currentStyle[WIDTH$4], - position = currentStyle[POSITION$1]; + position = currentStyle[POSITION$4]; this.clearCache(); this.__layoutData = { x: data.x, @@ -17558,9 +17562,9 @@ h: data.h, lx: data.lx }; - __config[NODE_REFRESH_LV] = REFLOW; + __config[NODE_REFRESH_LV$2] = REFLOW$2; __config[NODE_LIMIT_CACHE$1] = false; - __config[NODE_IS_INLINE] = false; // 防止display:none不统计mask,isVirtual忽略,abs布局后续会真正来走一遍 + __config[NODE_IS_INLINE$1] = false; // 防止display:none不统计mask,isVirtual忽略,abs布局后续会真正来走一遍 if (!isVirtual) { var next = this.next; // mask关系只有布局才会变更,普通渲染关系不会改变,clip也是mask的一种 @@ -17585,7 +17589,7 @@ this.__ox = this.__oy = 0; if (isDestroyed || display === 'none') { - this.__width = this.__height = this.__clientWidth = this.__clientHeight = this.__offsetWidth = this.__offsetHeight = this.__outerWidth = this.__outerHeight = computedStyle[WIDTH$4] = computedStyle[HEIGHT$3] = 0; + this.__width = this.__height = this.__clientWidth = this.__clientHeight = this.__offsetWidth = this.__offsetHeight = this.__outerWidth = this.__outerHeight = computedStyle[WIDTH$4] = computedStyle[HEIGHT$5] = 0; this.__x = data.x; this.__y = data.y; @@ -17601,28 +17605,28 @@ if (width[1] !== AUTO$4) { - if (this.__isRealInline() && currentStyle[DISPLAY$3] === 'inline') { + if (this.__isRealInline() && currentStyle[DISPLAY$7] === 'inline') { width[0] = 0; width[1] = AUTO$4; } else { switch (width[1]) { - case PX$6: + case PX$5: w = width[0]; break; - case PERCENT$7: + case PERCENT$5: w *= width[0] * 0.01; break; - case REM$7: - w = width[0] * this.root.computedStyle[FONT_SIZE$8]; + case REM$9: + w = width[0] * this.root.computedStyle[FONT_SIZE$9]; break; - case VW$7: + case VW$9: w = width[0] * this.root.width * 0.01; break; - case VH$7: + case VH$9: w = width[0] * this.root.height * 0.01; break; } @@ -17643,72 +17647,72 @@ if (position === 'relative') { - var top = currentStyle[TOP$1], - right = currentStyle[RIGHT], - bottom = currentStyle[BOTTOM$1], - left = currentStyle[LEFT]; + var top = currentStyle[TOP$3], + right = currentStyle[RIGHT$2], + bottom = currentStyle[BOTTOM$3], + left = currentStyle[LEFT$2]; var parent = this.parent; if (top[1] !== AUTO$4) { - var n = calRelative$1(currentStyle, TOP$1, top, parent); + var n = calRelative(currentStyle, TOP$3, top, parent); this.__offsetY(n); - computedStyle[TOP$1] = n; - computedStyle[BOTTOM$1] = 'auto'; + computedStyle[TOP$3] = n; + computedStyle[BOTTOM$3] = 'auto'; } else if (bottom[1] !== AUTO$4) { - var _n = calRelative$1(currentStyle, BOTTOM$1, bottom, parent); + var _n = calRelative(currentStyle, BOTTOM$3, bottom, parent); this.__offsetY(-_n); - computedStyle[BOTTOM$1] = _n; - computedStyle[TOP$1] = 'auto'; + computedStyle[BOTTOM$3] = _n; + computedStyle[TOP$3] = 'auto'; } else { - computedStyle[TOP$1] = computedStyle[BOTTOM$1] = 'auto'; + computedStyle[TOP$3] = computedStyle[BOTTOM$3] = 'auto'; } if (left[1] !== AUTO$4) { - var _n2 = calRelative$1(currentStyle, LEFT, left, parent, true); + var _n2 = calRelative(currentStyle, LEFT$2, left, parent, true); this.__offsetX(_n2); - computedStyle[LEFT] = _n2; - computedStyle[RIGHT] = 'auto'; + computedStyle[LEFT$2] = _n2; + computedStyle[RIGHT$2] = 'auto'; } else if (right[1] !== AUTO$4) { - var _n3 = calRelative$1(currentStyle, RIGHT, right, parent, true); + var _n3 = calRelative(currentStyle, RIGHT$2, right, parent, true); this.__offsetX(-_n3); - computedStyle[RIGHT] = _n3; - computedStyle[LEFT] = 'auto'; + computedStyle[RIGHT$2] = _n3; + computedStyle[LEFT$2] = 'auto'; } else { - computedStyle[LEFT] = computedStyle[RIGHT] = 'auto'; + computedStyle[LEFT$2] = computedStyle[RIGHT$2] = 'auto'; } } else if (position !== 'absolute') { - computedStyle[TOP$1] = computedStyle[BOTTOM$1] = computedStyle[LEFT] = computedStyle[RIGHT] = 'auto'; + computedStyle[TOP$3] = computedStyle[BOTTOM$3] = computedStyle[LEFT$2] = computedStyle[RIGHT$2] = 'auto'; } // 计算结果存入computedStyle和6个坐标,inline在其inlineSize特殊处理 var x = this.__sx = this.x + this.ox; 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]; + if (!__config[NODE_IS_INLINE$1]) { + x = this.__sx1 = x + computedStyle[MARGIN_LEFT$5]; + x = this.__sx2 = x + computedStyle[BORDER_LEFT_WIDTH$5]; + x = this.__sx3 = x + computedStyle[PADDING_LEFT$5]; x = this.__sx4 = x + this.width; - x = this.__sx5 = x + computedStyle[PADDING_RIGHT$1]; - this.__sx6 = x + computedStyle[BORDER_RIGHT_WIDTH$2]; - y = this.__sy1 = y + computedStyle[MARGIN_TOP]; - y = this.__sy2 = y + computedStyle[BORDER_TOP_WIDTH$2]; - y = this.__sy3 = y + computedStyle[PADDING_TOP$1]; + x = this.__sx5 = x + computedStyle[PADDING_RIGHT$4]; + this.__sx6 = x + computedStyle[BORDER_RIGHT_WIDTH$4]; + y = this.__sy1 = y + computedStyle[MARGIN_TOP$4]; + y = this.__sy2 = y + computedStyle[BORDER_TOP_WIDTH$4]; + y = this.__sy3 = y + computedStyle[PADDING_TOP$4]; y = this.__sy4 = y + this.height; - y = this.__sy5 = y + computedStyle[PADDING_BOTTOM$1]; - this.__sy6 = y + computedStyle[BORDER_BOTTOM_WIDTH$2]; + y = this.__sy5 = y + computedStyle[PADDING_BOTTOM$4]; + this.__sy6 = y + computedStyle[BORDER_BOTTOM_WIDTH$4]; } computedStyle[WIDTH$4] = this.width; - computedStyle[HEIGHT$3] = this.height; // abs布局的不执行,在__layoutAbs末尾做,防止未布局没有尺寸从而动画计算错误 + computedStyle[HEIGHT$5] = this.height; // abs布局的不执行,在__layoutAbs末尾做,防止未布局没有尺寸从而动画计算错误 if (!fromAbs) { this.__execAr(); @@ -17746,8 +17750,8 @@ key: "__layoutNone", value: function __layoutNone() { var computedStyle = this.computedStyle; - computedStyle[DISPLAY$3] = 'none'; - computedStyle[MARGIN_TOP] = computedStyle[MARGIN_RIGHT$1] = computedStyle[MARGIN_BOTTOM] = computedStyle[MARGIN_LEFT$1] = computedStyle[PADDING_TOP$1] = computedStyle[PADDING_RIGHT$1] = computedStyle[PADDING_BOTTOM$1] = computedStyle[PADDING_LEFT$2] = 0; + computedStyle[DISPLAY$7] = 'none'; + computedStyle[MARGIN_TOP$4] = computedStyle[MARGIN_RIGHT$4] = computedStyle[MARGIN_BOTTOM$4] = computedStyle[MARGIN_LEFT$5] = computedStyle[PADDING_TOP$4] = computedStyle[PADDING_RIGHT$4] = computedStyle[PADDING_BOTTOM$4] = computedStyle[PADDING_LEFT$5] = 0; } // 预先计算是否是固定宽高,布局点位和尺寸考虑margin/border/padding }, { @@ -17771,19 +17775,19 @@ var currentStyle = this.currentStyle, computedStyle = this.computedStyle; var width = currentStyle[WIDTH$4], - height = currentStyle[HEIGHT$3]; - var borderTopWidth = computedStyle[BORDER_TOP_WIDTH$2], - borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$2], - borderBottomWidth = computedStyle[BORDER_BOTTOM_WIDTH$2], - borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$3], - marginTop = computedStyle[MARGIN_TOP], - marginRight = computedStyle[MARGIN_RIGHT$1], - marginBottom = computedStyle[MARGIN_BOTTOM], - marginLeft = computedStyle[MARGIN_LEFT$1], - paddingTop = computedStyle[PADDING_TOP$1], - paddingRight = computedStyle[PADDING_RIGHT$1], - paddingBottom = computedStyle[PADDING_BOTTOM$1], - paddingLeft = computedStyle[PADDING_LEFT$2]; // 除了auto外都是固定宽高度 + height = currentStyle[HEIGHT$5]; + var borderTopWidth = computedStyle[BORDER_TOP_WIDTH$4], + borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$4], + borderBottomWidth = computedStyle[BORDER_BOTTOM_WIDTH$4], + borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$5], + marginTop = computedStyle[MARGIN_TOP$4], + marginRight = computedStyle[MARGIN_RIGHT$4], + marginBottom = computedStyle[MARGIN_BOTTOM$4], + marginLeft = computedStyle[MARGIN_LEFT$5], + paddingTop = computedStyle[PADDING_TOP$4], + paddingRight = computedStyle[PADDING_RIGHT$4], + paddingBottom = computedStyle[PADDING_BOTTOM$4], + paddingLeft = computedStyle[PADDING_LEFT$5]; // 除了auto外都是固定宽高度 var fixedWidth; var fixedHeight; // 绝对定位是left+right这种其实等于定义了width,但不能修改原始style,存入特殊变量标识 @@ -17793,33 +17797,33 @@ w = w2; } // flex时也会用到,子级得出目标主尺寸后按这个来 else if (w3 !== undefined) { - fixedWidth = true; - w = w3; - } else if (width[1] !== AUTO$4) { - fixedWidth = true; + fixedWidth = true; + w = w3; + } else if (width[1] !== AUTO$4) { + fixedWidth = true; - switch (width[1]) { - case PX$6: - w = width[0]; - break; + switch (width[1]) { + case PX$5: + w = width[0]; + break; - case PERCENT$7: - w *= width[0] * 0.01; - break; + case PERCENT$5: + w *= width[0] * 0.01; + break; - case REM$7: - w = width[0] * this.root.computedStyle[FONT_SIZE$8]; - break; + case REM$9: + w = width[0] * this.root.computedStyle[FONT_SIZE$9]; + break; - case VW$7: - w = width[0] * this.root.width * 0.01; - break; + case VW$9: + w = width[0] * this.root.width * 0.01; + break; - case VH$7: - w = width[0] * this.root.height * 0.01; - break; - } + case VH$9: + w = width[0] * this.root.height * 0.01; + break; } + } if (h2 !== undefined) { fixedHeight = true; @@ -17831,23 +17835,23 @@ fixedHeight = true; switch (height[1]) { - case PX$6: + case PX$5: h = height[0]; break; - case PERCENT$7: + case PERCENT$5: h *= height[0] * 0.01; break; - case REM$7: - h = height[0] * this.root.computedStyle[FONT_SIZE$8]; + case REM$9: + h = height[0] * this.root.computedStyle[FONT_SIZE$9]; break; - case VW$7: + case VW$9: h = height[0] * this.root.width * 0.01; break; - case VH$7: + case VH$9: h = height[0] * this.root.height * 0.01; break; } @@ -17899,10 +17903,10 @@ }, { key: "__marginAuto", value: function __marginAuto(style, data) { - var position = style[POSITION$1], - display = style[DISPLAY$3], - marginLeft = style[MARGIN_LEFT$1], - marginRight = style[MARGIN_RIGHT$1], + var position = style[POSITION$4], + display = style[DISPLAY$7], + marginLeft = style[MARGIN_LEFT$5], + marginRight = style[MARGIN_RIGHT$4], width = style[WIDTH$4]; if (position !== 'absolute' && (display === 'block' || display === 'flex') && (width[1] !== AUTO$4 || this.tagName === 'img') && marginLeft[1] === AUTO$4 && marginRight[1] === AUTO$4) { @@ -17918,186 +17922,186 @@ value: function __calMatrix(lv, __cacheStyle, currentStyle, computedStyle, __config, sx1, sy1, offsetWidth, offsetHeight) { var _this3 = this; - if (__config[NODE_IS_INLINE]) { - computedStyle[TRANSFORM_ORIGIN$4] = [sx1, sy1]; - return __cacheStyle[MATRIX$3] = mx.identity(); + if (__config[NODE_IS_INLINE$1]) { + computedStyle[TRANSFORM_ORIGIN$1] = [sx1, sy1]; + return __cacheStyle[MATRIX] = mx.identity(); } - var matrixCache = __cacheStyle[MATRIX$3]; // tx/ty变化特殊优化 + var matrixCache = __cacheStyle[MATRIX]; // tx/ty变化特殊优化 - if (matrixCache && lv < REFLOW && !contain(lv, TF)) { + if (matrixCache && lv < REFLOW$2 && !contain$3(lv, TF)) { var x = 0, y = 0, z = 0; - if (contain(lv, TX)) { - var v = currentStyle[TRANSLATE_X$4]; + if (contain$3(lv, TX)) { + var v = currentStyle[TRANSLATE_X]; - if (isNil$6(v)) { + if (isNil$9(v)) { v = 0; - } else if (v[1] === PERCENT$7) { + } else if (v[1] === PERCENT$5) { v = v[0] * this.offsetWidth * 0.01; - } else if (v[1] === REM$7) { - v = v[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (v[1] === VW$7) { + } else if (v[1] === REM$9) { + v = v[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (v[1] === VW$9) { v = v[0] * this.root.width * 0.01; - } else if (v[1] === VH$7) { + } else if (v[1] === VH$9) { v = v[0] * this.root.height * 0.01; } else { v = v[0]; } - x = v - (computedStyle[TRANSLATE_X$4] || 0); - computedStyle[TRANSLATE_X$4] = v; - computedStyle[TRANSFORM$3][12] += x; + x = v - (computedStyle[TRANSLATE_X] || 0); + computedStyle[TRANSLATE_X] = v; + computedStyle[TRANSFORM$1][12] += x; matrixCache[12] += x; } - if (contain(lv, TY)) { - var _v = currentStyle[TRANSLATE_Y$4]; + if (contain$3(lv, TY)) { + var _v = currentStyle[TRANSLATE_Y]; - if (isNil$6(_v)) { + if (isNil$9(_v)) { _v = 0; - } else if (_v[1] === PERCENT$7) { + } else if (_v[1] === PERCENT$5) { _v = _v[0] * this.offsetHeight * 0.01; - } else if (_v[1] === REM$7) { - _v = _v[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (_v[1] === VW$7) { + } else if (_v[1] === REM$9) { + _v = _v[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (_v[1] === VW$9) { _v = _v[0] * this.root.width * 0.01; - } else if (_v[1] === VH$7) { + } else if (_v[1] === VH$9) { _v = _v[0] * this.root.height * 0.01; } else { _v = _v[0]; } - y = _v - (computedStyle[TRANSLATE_Y$4] || 0); - computedStyle[TRANSLATE_Y$4] = _v; - computedStyle[TRANSFORM$3][13] += y; + y = _v - (computedStyle[TRANSLATE_Y] || 0); + computedStyle[TRANSLATE_Y] = _v; + computedStyle[TRANSFORM$1][13] += y; matrixCache[13] += y; } - if (contain(lv, TZ)) { - var _v2 = currentStyle[TRANSLATE_Z$4]; + if (contain$3(lv, TZ)) { + var _v2 = currentStyle[TRANSLATE_Z]; - if (isNil$6(_v2)) { + if (isNil$9(_v2)) { _v2 = 0; - } else if (_v2[1] === PERCENT$7) { + } else if (_v2[1] === PERCENT$5) { _v2 = _v2[0] * this.offsetWidth * 0.01; - } else if (_v2[1] === REM$7) { - _v2 = _v2[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (_v2[1] === VW$7) { + } else if (_v2[1] === REM$9) { + _v2 = _v2[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (_v2[1] === VW$9) { _v2 = _v2[0] * this.root.width * 0.01; - } else if (_v2[1] === VH$7) { + } else if (_v2[1] === VH$9) { _v2 = _v2[0] * this.root.height * 0.01; } else { _v2 = _v2[0]; } - z = _v2 - (computedStyle[TRANSLATE_Z$4] || 0); - computedStyle[TRANSLATE_Z$4] = _v2; - computedStyle[TRANSFORM$3][14] += z; + z = _v2 - (computedStyle[TRANSLATE_Z] || 0); + computedStyle[TRANSLATE_Z] = _v2; + computedStyle[TRANSFORM$1][14] += z; matrixCache[14] += z; } - __cacheStyle[MATRIX$3] = matrixCache; + __cacheStyle[MATRIX] = matrixCache; } // 先根据cache计算需要重新计算的computedStyle else { - if (sx1 === undefined) { - sx1 = this.__sx1; - sy1 = this.__sy1; - offsetWidth = this.offsetWidth; - offsetHeight = this.offsetHeight; - } - - if (__cacheStyle[TRANSFORM_ORIGIN$4] === undefined) { - __cacheStyle[TRANSFORM_ORIGIN$4] = true; - matrixCache = null; - computedStyle[TRANSFORM_ORIGIN$4] = tf.calOrigin(currentStyle[TRANSFORM_ORIGIN$4], offsetWidth, offsetHeight, this.root); - } - - if (__cacheStyle[TRANSFORM$3] === undefined || __cacheStyle[TRANSLATE_X$4] === undefined || __cacheStyle[TRANSLATE_Y$4] === undefined || __cacheStyle[TRANSLATE_Z$4] === undefined || __cacheStyle[ROTATE_X$2] === undefined || __cacheStyle[ROTATE_Y$2] === undefined || __cacheStyle[ROTATE_Z$2] === undefined || __cacheStyle[ROTATE_3D$3] === undefined || __cacheStyle[SCALE_X$3] === undefined || __cacheStyle[SCALE_Y$3] === undefined || __cacheStyle[SCALE_Z$2] === undefined || __cacheStyle[SKEW_X$2] === undefined || __cacheStyle[SKEW_Y$2] === undefined) { - __cacheStyle[TRANSFORM$3] = __cacheStyle[TRANSLATE_X$4] = __cacheStyle[TRANSLATE_Y$4] = __cacheStyle[TRANSLATE_Z$4] = __cacheStyle[ROTATE_X$2] = __cacheStyle[ROTATE_Y$2] = __cacheStyle[ROTATE_Z$2] = __cacheStyle[SCALE_X$3] = __cacheStyle[SCALE_Y$3] = __cacheStyle[SCALE_Z$2] = __cacheStyle[SKEW_X$2] = __cacheStyle[SKEW_Y$2] = true; - matrixCache = null; - var matrix; // transform相对于自身 + if (sx1 === undefined) { + sx1 = this.__sx1; + sy1 = this.__sy1; + offsetWidth = this.offsetWidth; + offsetHeight = this.offsetHeight; + } - if (currentStyle[TRANSFORM$3]) { - matrix = tf.calMatrix(currentStyle[TRANSFORM$3], offsetWidth, offsetHeight, this.root); - } // 没有transform则看是否有扩展的css独立变换属性 - else { - var temp = []; - [TRANSLATE_X$4, TRANSLATE_Y$4, TRANSLATE_Z$4, ROTATE_X$2, ROTATE_Y$2, ROTATE_Z$2, ROTATE_3D$3, SKEW_X$2, SKEW_Y$2, SCALE_X$3, SCALE_Y$3, SCALE_Z$2].forEach(function (k) { - // 删除之前遗留的 - delete computedStyle[k]; - var v = currentStyle[k]; + if (__cacheStyle[TRANSFORM_ORIGIN$1] === undefined) { + __cacheStyle[TRANSFORM_ORIGIN$1] = true; + matrixCache = null; + computedStyle[TRANSFORM_ORIGIN$1] = tf.calOrigin(currentStyle[TRANSFORM_ORIGIN$1], offsetWidth, offsetHeight, this.root); + } - if (isNil$6(v)) { - return; - } + if (__cacheStyle[TRANSFORM$1] === undefined || __cacheStyle[TRANSLATE_X] === undefined || __cacheStyle[TRANSLATE_Y] === undefined || __cacheStyle[TRANSLATE_Z] === undefined || __cacheStyle[ROTATE_X] === undefined || __cacheStyle[ROTATE_Y] === undefined || __cacheStyle[ROTATE_Z] === undefined || __cacheStyle[ROTATE_3D] === undefined || __cacheStyle[SCALE_X] === undefined || __cacheStyle[SCALE_Y] === undefined || __cacheStyle[SCALE_Z] === undefined || __cacheStyle[SKEW_X] === undefined || __cacheStyle[SKEW_Y] === undefined) { + __cacheStyle[TRANSFORM$1] = __cacheStyle[TRANSLATE_X] = __cacheStyle[TRANSLATE_Y] = __cacheStyle[TRANSLATE_Z] = __cacheStyle[ROTATE_X] = __cacheStyle[ROTATE_Y] = __cacheStyle[ROTATE_Z] = __cacheStyle[SCALE_X] = __cacheStyle[SCALE_Y] = __cacheStyle[SCALE_Z] = __cacheStyle[SKEW_X] = __cacheStyle[SKEW_Y] = true; + matrixCache = null; + var matrix; // transform相对于自身 - if (k === ROTATE_3D$3) { - computedStyle[k] = [v[0], v[1], v[2], v[3][0]]; + if (currentStyle[TRANSFORM$1]) { + matrix = tf.calMatrix(currentStyle[TRANSFORM$1], offsetWidth, offsetHeight, this.root); + } // 没有transform则看是否有扩展的css独立变换属性 + else { + var temp = []; + [TRANSLATE_X, TRANSLATE_Y, TRANSLATE_Z, ROTATE_X, ROTATE_Y, ROTATE_Z, ROTATE_3D, SKEW_X, SKEW_Y, SCALE_X, SCALE_Y, SCALE_Z].forEach(function (k) { + // 删除之前遗留的 + delete computedStyle[k]; + var v = currentStyle[k]; - if (v[3][0] === 0) { - return; - } + if (isNil$9(v)) { + return; + } - temp.push([k, v]); - return; - } + if (k === ROTATE_3D) { + computedStyle[k] = [v[0], v[1], v[2], v[3][0]]; - computedStyle[k] = v[0]; // scale为1和其它为0避免计算浪费 + if (v[3][0] === 0) { + return; + } - var isScale = k === SCALE_X$3 || k === SCALE_Y$3 || k === SCALE_Z$2; + temp.push([k, v]); + return; + } - if (v[0] === 1 && isScale || !isScale && v[0] === 0) { - return; - } + computedStyle[k] = v[0]; // scale为1和其它为0避免计算浪费 - if (v[1] === PERCENT$7) { - if (k === TRANSLATE_X$4 || k === TRANSLATE_Z$4) { - computedStyle[k] = v[0] * offsetWidth * 0.01; - } else if (k === TRANSLATE_Y$4) { - computedStyle[k] = v[0] * offsetHeight * 0.01; - } - } 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]; - } else if (k === TRANSLATE_Y$4) { - computedStyle[k] = v[0] * _this3.root.computedStyle[FONT_SIZE$8]; - } - } else if (v[1] === VW$7) { - if (k === TRANSLATE_X$4 || k === TRANSLATE_Z$4) { - computedStyle[k] = v[0] * _this3.root.width * 0.01; - } else if (k === TRANSLATE_Y$4) { - computedStyle[k] = v[0] * _this3.root.width * 0.01; - } - } else if (v[1] === VH$7) { - if (k === TRANSLATE_X$4 || k === TRANSLATE_Z$4) { - computedStyle[k] = v[0] * _this3.root.height * 0.01; - } else if (k === TRANSLATE_Y$4) { - computedStyle[k] = v[0] * _this3.root.height * 0.01; - } - } + var isScale = k === SCALE_X || k === SCALE_Y || k === SCALE_Z; - temp.push([k, v]); - }); + if (v[0] === 1 && isScale || !isScale && v[0] === 0) { + return; + } - if (temp.length) { - matrix = tf.calMatrix(temp, offsetWidth, offsetHeight, this.root); + if (v[1] === PERCENT$5) { + if (k === TRANSLATE_X || k === TRANSLATE_Z) { + computedStyle[k] = v[0] * offsetWidth * 0.01; + } else if (k === TRANSLATE_Y) { + computedStyle[k] = v[0] * offsetHeight * 0.01; + } + } else if (v[1] === REM$9) { + if (k === TRANSLATE_X || k === TRANSLATE_Z) { + computedStyle[k] = v[0] * _this3.root.computedStyle[FONT_SIZE$9]; + } else if (k === TRANSLATE_Y) { + computedStyle[k] = v[0] * _this3.root.computedStyle[FONT_SIZE$9]; + } + } else if (v[1] === VW$9) { + if (k === TRANSLATE_X || k === TRANSLATE_Z) { + computedStyle[k] = v[0] * _this3.root.width * 0.01; + } else if (k === TRANSLATE_Y) { + computedStyle[k] = v[0] * _this3.root.width * 0.01; + } + } else if (v[1] === VH$9) { + if (k === TRANSLATE_X || k === TRANSLATE_Z) { + computedStyle[k] = v[0] * _this3.root.height * 0.01; + } else if (k === TRANSLATE_Y) { + computedStyle[k] = v[0] * _this3.root.height * 0.01; } } - computedStyle[TRANSFORM$3] = matrix || mx.identity(); - } + temp.push([k, v]); + }); - if (!matrixCache) { - var m = computedStyle[TRANSFORM$3]; - var tfo = computedStyle[TRANSFORM_ORIGIN$4].slice(0); - tfo[0] += sx1 || 0; - tfo[1] += sy1 || 0; - matrixCache = __cacheStyle[MATRIX$3] = tf.calMatrixByOrigin(m, tfo); + if (temp.length) { + matrix = tf.calMatrix(temp, offsetWidth, offsetHeight, this.root); + } } + + computedStyle[TRANSFORM$1] = matrix || mx.identity(); + } + + if (!matrixCache) { + var m = computedStyle[TRANSFORM$1]; + var tfo = computedStyle[TRANSFORM_ORIGIN$1].slice(0); + tfo[0] += sx1 || 0; + tfo[1] += sy1 || 0; + matrixCache = __cacheStyle[MATRIX] = tf.calMatrixByOrigin(m, tfo); } + } return matrixCache; } @@ -18146,7 +18150,7 @@ by1 = y1, bx2 = x6, by2 = y6; - var backgroundClip = computedStyle[BACKGROUND_CLIP$2] = currentStyle[BACKGROUND_CLIP$2]; // 默认border-box + var backgroundClip = computedStyle[BACKGROUND_CLIP] = currentStyle[BACKGROUND_CLIP]; // 默认border-box if (backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') { bx1 = x2; @@ -18160,83 +18164,83 @@ by2 = y4; } - var isInline = this.__config[NODE_IS_INLINE]; + var isInline = this.__config[NODE_IS_INLINE$1]; if (isInline && !this.contentBoxList.length) { isInline = false; } // 这些直接赋值的不需要再算缓存 - [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$2, Z_INDEX$2, BORDER_TOP_STYLE, BORDER_RIGHT_STYLE, BORDER_BOTTOM_STYLE, BORDER_LEFT_STYLE, BACKGROUND_REPEAT, OVERFLOW$2, MIX_BLEND_MODE$3, TEXT_OVERFLOW, BACKGROUND_CLIP].forEach(function (k) { computedStyle[k] = currentStyle[k]; }); - if (isNil$6(__cacheStyle[FILTER$3])) { + if (isNil$9(__cacheStyle[FILTER$3])) { __cacheStyle[FILTER$3] = true; this.__calFilter(currentStyle, computedStyle); } - if (isNil$6(__cacheStyle[BACKGROUND_POSITION_X$3])) { - __cacheStyle[BACKGROUND_POSITION_X$3] = true; - var bgX = currentStyle[BACKGROUND_POSITION_X$3]; - computedStyle[BACKGROUND_POSITION_X$3] = (bgX || []).map(function (item) { - if (item[1] === PX$6) { + if (isNil$9(__cacheStyle[BACKGROUND_POSITION_X])) { + __cacheStyle[BACKGROUND_POSITION_X] = true; + var bgX = currentStyle[BACKGROUND_POSITION_X]; + computedStyle[BACKGROUND_POSITION_X] = (bgX || []).map(function (item) { + if (item[1] === PX$5) { return item[0]; } - if (item[1] === REM$7) { - return item[0] * _this4.root.computedStyle[FONT_SIZE$8]; + if (item[1] === REM$9) { + return item[0] * _this4.root.computedStyle[FONT_SIZE$9]; } - if (item[1] === VW$7) { + if (item[1] === VW$9) { return item[0] * _this4.root.width * 0.01; } - if (item[1] === VH$7) { + if (item[1] === VH$9) { return item[0] * _this4.root.height * 0.01; } - if (item[1] === PERCENT$7) { + if (item[1] === PERCENT$5) { return item[0] + '%'; } }); } - if (isNil$6(__cacheStyle[BACKGROUND_POSITION_Y$3])) { - __cacheStyle[BACKGROUND_POSITION_Y$3] = true; - var bgY = currentStyle[BACKGROUND_POSITION_Y$3]; - computedStyle[BACKGROUND_POSITION_Y$3] = (bgY || []).map(function (item) { - if (item[1] === PX$6) { + if (isNil$9(__cacheStyle[BACKGROUND_POSITION_Y])) { + __cacheStyle[BACKGROUND_POSITION_Y] = true; + var bgY = currentStyle[BACKGROUND_POSITION_Y]; + computedStyle[BACKGROUND_POSITION_Y] = (bgY || []).map(function (item) { + if (item[1] === PX$5) { return item[0]; } - if (item[1] === REM$7) { - return item[0] * _this4.root.computedStyle[FONT_SIZE$8]; + if (item[1] === REM$9) { + return item[0] * _this4.root.computedStyle[FONT_SIZE$9]; } - if (item[1] === VW$7) { + if (item[1] === VW$9) { return item[0] * _this4.root.width * 0.01; } - if (item[1] === VH$7) { + if (item[1] === VH$9) { return item[0] * _this4.root.height * 0.01; } - if (item[1] === PERCENT$7) { + if (item[1] === PERCENT$5) { return item[0] + '%'; } }); } - if (isNil$6(__cacheStyle[BACKGROUND_SIZE$2])) { - __cacheStyle[BACKGROUND_SIZE$2] = true; - computedStyle[BACKGROUND_SIZE$2] = (currentStyle[BACKGROUND_SIZE$2] || []).map(function (item) { + if (isNil$9(__cacheStyle[BACKGROUND_SIZE])) { + __cacheStyle[BACKGROUND_SIZE] = true; + computedStyle[BACKGROUND_SIZE] = (currentStyle[BACKGROUND_SIZE] || []).map(function (item) { return bg.calBackgroundSize(item, bx2 - bx1, by2 - by1, _this4.root); }); } - if (isNil$6(__cacheStyle[BACKGROUND_IMAGE$1])) { + if (isNil$9(__cacheStyle[BACKGROUND_IMAGE$1])) { var bgI = computedStyle[BACKGROUND_IMAGE$1] = currentStyle[BACKGROUND_IMAGE$1].slice(0); __cacheStyle[BACKGROUND_IMAGE$1] = bgI.map(function (bgi, i) { if (!bgi) { @@ -18270,9 +18274,9 @@ __before: function __before() { __cacheStyle[BACKGROUND_IMAGE$1] = undefined; var res = {}; - res[UPDATE_NODE$2] = node; - res[UPDATE_FOCUS$1] = REPAINT$1; - res[UPDATE_CONFIG$2] = node.__config; + res[UPDATE_NODE$3] = node; + res[UPDATE_FOCUS$3] = REPAINT$2; + res[UPDATE_CONFIG$3] = node.__config; root.__addUpdate(node, node.__config, root, root.__config, res); } @@ -18294,9 +18298,9 @@ }); } - if (isNil$6(__cacheStyle[BOX_SHADOW$2])) { - __cacheStyle[BOX_SHADOW$2] = true; - computedStyle[BOX_SHADOW$2] = (currentStyle[BOX_SHADOW$2] || []).map(function (item) { + if (isNil$9(__cacheStyle[BOX_SHADOW$7])) { + __cacheStyle[BOX_SHADOW$7] = true; + computedStyle[BOX_SHADOW$7] = (currentStyle[BOX_SHADOW$7] || []).map(function (item) { return item.map(function (item2, i) { if (i > 3) { return item2; @@ -18304,17 +18308,17 @@ var v = item2[0]; - if (item2[1] === PERCENT$7) { + if (item2[1] === PERCENT$5) { if (i % 2 === 0) { v *= 0.01 * (bx2 - bx1); } else { v *= 0.01 * (by2 - by1); } - } else if (item2[1] === REM$7) { - v = v * _this4.root.computedStyle[FONT_SIZE$8]; - } else if (item2[1] === VW$7) { + } else if (item2[1] === REM$9) { + v = v * _this4.root.computedStyle[FONT_SIZE$9]; + } else if (item2[1] === VW$9) { v = v * _this4.root.width * 0.01; - } else if (item2[1] === VH$7) { + } else if (item2[1] === VH$9) { v = v * _this4.root.height * 0.01; } @@ -18324,20 +18328,20 @@ } [BACKGROUND_COLOR$1, BORDER_TOP_COLOR, BORDER_RIGHT_COLOR, BORDER_BOTTOM_COLOR, BORDER_LEFT_COLOR].forEach(function (k) { - if (isNil$6(__cacheStyle[k])) { - __cacheStyle[k] = int2rgba$2(computedStyle[k] = currentStyle[k][0]); + if (isNil$9(__cacheStyle[k])) { + __cacheStyle[k] = int2rgba$1(computedStyle[k] = currentStyle[k][0]); } }); // 圆角边计算 - if (isNil$6(__cacheStyle[BORDER_TOP_LEFT_RADIUS$1]) || isNil$6(__cacheStyle[BORDER_TOP_RIGHT_RADIUS$1]) || isNil$6(__cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS$1]) || isNil$6(__cacheStyle[BORDER_BOTTOM_LEFT_RADIUS$1])) { + if (isNil$9(__cacheStyle[BORDER_TOP_LEFT_RADIUS$1]) || isNil$9(__cacheStyle[BORDER_TOP_RIGHT_RADIUS$1]) || isNil$9(__cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS$1]) || isNil$9(__cacheStyle[BORDER_BOTTOM_LEFT_RADIUS$1])) { __cacheStyle[BORDER_TOP_LEFT_RADIUS$1] = __cacheStyle[BORDER_TOP_RIGHT_RADIUS$1] = __cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS$1] = __cacheStyle[BORDER_BOTTOM_LEFT_RADIUS$1] = true; // 非替代的inline计算看contentBox首尾 if (isInline) { border.calBorderRadiusInline(this.contentBoxList, currentStyle, computedStyle, this.root); } // 普通block整体计算 else { - border.calBorderRadius(offsetWidth, offsetHeight, currentStyle, computedStyle, this.root); - } + border.calBorderRadius(offsetWidth, offsetHeight, currentStyle, computedStyle, this.root); + } } // width/style/radius影响border,color不影响渲染缓存 @@ -18347,21 +18351,21 @@ var bblr = computedStyle[BORDER_BOTTOM_LEFT_RADIUS$1]; ['Top', 'Right', 'Bottom', 'Left'].forEach(function (k) { k = 'border' + k; - var k2 = STYLE_KEY$5[style2Upper$2(k)]; - var kw = STYLE_KEY$5[style2Upper$2(k + 'Width')]; - var ks = STYLE_KEY$5[style2Upper$2(k + 'Style')]; // width/style变更影响border重新计算 + var k2 = STYLE_KEY[style2Upper(k)]; + var kw = STYLE_KEY[style2Upper(k + 'Width')]; + var ks = STYLE_KEY[style2Upper(k + 'Style')]; // width/style变更影响border重新计算 - if (isNil$6(__cacheStyle[kw])) { + if (isNil$9(__cacheStyle[kw])) { __cacheStyle[kw] = true; __cacheStyle[k2] = undefined; } - if (isNil$6(__cacheStyle[ks])) { + if (isNil$9(__cacheStyle[ks])) { __cacheStyle[ks] = true; __cacheStyle[k2] = undefined; } - if (isNil$6(__cacheStyle[k2])) { + if (isNil$9(__cacheStyle[k2])) { if (k2 === BORDER_TOP) { if (borderTopWidth > 0) { if (!isInline) { @@ -18414,67 +18418,67 @@ var parentComputedStyle = parent && parent.computedStyle; - if (currentStyle[FONT_STYLE$4][1] === INHERIT$4) { - 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]; + if (currentStyle[FONT_STYLE][1] === INHERIT$1) { + computedStyle[FONT_STYLE] = parent ? parentComputedStyle[FONT_STYLE] : 'normal'; + } else if (isNil$9(__cacheStyle[FONT_STYLE])) { + computedStyle[FONT_STYLE] = currentStyle[FONT_STYLE][0]; } - __cacheStyle[FONT_STYLE$4] = computedStyle[FONT_STYLE$4]; + __cacheStyle[FONT_STYLE] = computedStyle[FONT_STYLE]; - 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$1][1] === INHERIT$1) { + computedStyle[COLOR$1] = parent ? parentComputedStyle[COLOR$1] : [0, 0, 0, 1]; + __cacheStyle[COLOR$1] = int2rgba$1(computedStyle[COLOR$1]); + } else if (isNil$9(__cacheStyle[COLOR$1])) { + computedStyle[COLOR$1] = rgba2int(currentStyle[COLOR$1][0]); + __cacheStyle[COLOR$1] = int2rgba$1(computedStyle[COLOR$1]); } - if (currentStyle[TEXT_STROKE_COLOR$4][1] === INHERIT$4) { - 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])) { - computedStyle[TEXT_STROKE_COLOR$4] = rgba2int$3(currentStyle[TEXT_STROKE_COLOR$4][0]); - __cacheStyle[TEXT_STROKE_COLOR$4] = int2rgba$2(computedStyle[TEXT_STROKE_COLOR$4]); + if (currentStyle[TEXT_STROKE_COLOR][1] === INHERIT$1) { + computedStyle[TEXT_STROKE_COLOR] = parent ? parentComputedStyle[TEXT_STROKE_COLOR] : [0, 0, 0, 1]; + __cacheStyle[TEXT_STROKE_COLOR] = int2rgba$1(computedStyle[TEXT_STROKE_COLOR]); + } else if (isNil$9(__cacheStyle[TEXT_STROKE_COLOR])) { + computedStyle[TEXT_STROKE_COLOR] = rgba2int(currentStyle[TEXT_STROKE_COLOR][0]); + __cacheStyle[TEXT_STROKE_COLOR] = int2rgba$1(computedStyle[TEXT_STROKE_COLOR]); } - if (currentStyle[TEXT_STROKE_WIDTH$3][1] === INHERIT$4) { - 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 (currentStyle[TEXT_STROKE_WIDTH][1] === INHERIT$1) { + computedStyle[TEXT_STROKE_WIDTH] = parent ? parentComputedStyle[TEXT_STROKE_WIDTH] : 0; + __cacheStyle[TEXT_STROKE_WIDTH] = true; + } else if (isNil$9(__cacheStyle[TEXT_STROKE_WIDTH])) { + var v = currentStyle[TEXT_STROKE_WIDTH]; - if (v[1] === REM$7) { - v = v[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (v[1] === VW$7) { + if (v[1] === REM$9) { + v = v[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (v[1] === VW$9) { v = v[0] * this.root.width * 0.01; - } else if (v[1] === VH$7) { + } else if (v[1] === VH$9) { v = v[0] * this.root.height * 0.01; } else { v = v[0]; } - computedStyle[TEXT_STROKE_WIDTH$3] = v; - __cacheStyle[TEXT_STROKE_WIDTH$3] = true; + computedStyle[TEXT_STROKE_WIDTH] = v; + __cacheStyle[TEXT_STROKE_WIDTH] = true; } - if (currentStyle[TEXT_STROKE_OVER$3][1] === INHERIT$4) { - __cacheStyle[TEXT_STROKE_OVER$3] = computedStyle[TEXT_STROKE_OVER$3] = parent ? parentComputedStyle[TEXT_STROKE_OVER$3] : 'none'; + if (currentStyle[TEXT_STROKE_OVER][1] === INHERIT$1) { + __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = parent ? parentComputedStyle[TEXT_STROKE_OVER] : 'none'; } else { - __cacheStyle[TEXT_STROKE_OVER$3] = computedStyle[TEXT_STROKE_OVER$3] = currentStyle[TEXT_STROKE_OVER$3][0]; + __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = currentStyle[TEXT_STROKE_OVER][0]; } - if (currentStyle[VISIBILITY$3][1] === INHERIT$4) { - computedStyle[VISIBILITY$3] = parent ? parentComputedStyle[VISIBILITY$3] : 'visible'; - } else if (isNil$6(__cacheStyle[VISIBILITY$3])) { - computedStyle[VISIBILITY$3] = currentStyle[VISIBILITY$3][0]; + if (currentStyle[VISIBILITY$4][1] === INHERIT$1) { + computedStyle[VISIBILITY$4] = parent ? parentComputedStyle[VISIBILITY$4] : 'visible'; + } else if (isNil$9(__cacheStyle[VISIBILITY$4])) { + computedStyle[VISIBILITY$4] = currentStyle[VISIBILITY$4][0]; } - __cacheStyle[VISIBILITY$3] = computedStyle[VISIBILITY$3]; + __cacheStyle[VISIBILITY$4] = computedStyle[VISIBILITY$4]; - if (currentStyle[POINTER_EVENTS$1][1] === INHERIT$4) { + if (currentStyle[POINTER_EVENTS$1][1] === INHERIT$1) { computedStyle[POINTER_EVENTS$1] = parent ? parentComputedStyle[POINTER_EVENTS$1] : 'auto'; - } else if (isNil$6(__cacheStyle[POINTER_EVENTS$1])) { + } else if (isNil$9(__cacheStyle[POINTER_EVENTS$1])) { computedStyle[POINTER_EVENTS$1] = currentStyle[POINTER_EVENTS$1][0]; } @@ -18486,29 +18490,29 @@ value: function __calPerspective(__cacheStyle, currentStyle, computedStyle, __config, sx1, sy1) { var rebuild; - if (isNil$6(__cacheStyle[PERSPECTIVE$3])) { - __cacheStyle[PERSPECTIVE$3] = true; + if (isNil$9(__cacheStyle[PERSPECTIVE$2])) { + __cacheStyle[PERSPECTIVE$2] = true; rebuild = true; - var v = currentStyle[PERSPECTIVE$3]; + var v = currentStyle[PERSPECTIVE$2]; var ppt = 0; - if (v[1] === REM$7) { - ppt = v[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (v[1] === VW$7) { + if (v[1] === REM$9) { + ppt = v[0] * this.root.computedStyle[FONT_SIZE$9]; + } else if (v[1] === VW$9) { ppt = v[0] * this.root.width * 0.01; - } else if (v[1] === VH$7) { + } else if (v[1] === VH$9) { ppt = v[0] * this.root.height * 0.01; } else { ppt = v[0]; } - computedStyle[PERSPECTIVE$3] = ppt; + computedStyle[PERSPECTIVE$2] = ppt; } - if (isNil$6(__cacheStyle[PERSPECTIVE_ORIGIN$3])) { - __cacheStyle[PERSPECTIVE_ORIGIN$3] = true; + if (isNil$9(__cacheStyle[PERSPECTIVE_ORIGIN$1])) { + __cacheStyle[PERSPECTIVE_ORIGIN$1] = true; rebuild = true; - computedStyle[PERSPECTIVE_ORIGIN$3] = tf.calOrigin(currentStyle[PERSPECTIVE_ORIGIN$3], this.offsetWidth, this.offsetHeight, this.root); + computedStyle[PERSPECTIVE_ORIGIN$1] = tf.calOrigin(currentStyle[PERSPECTIVE_ORIGIN$1], this.offsetWidth, this.offsetHeight, this.root); } if (rebuild) { @@ -18517,10 +18521,10 @@ sy1 = this.__sy1; } - var po = computedStyle[PERSPECTIVE_ORIGIN$3].slice(0); + var po = computedStyle[PERSPECTIVE_ORIGIN$1].slice(0); po[0] += sx1 || 0; po[1] += sy1 || 0; - __config[NODE_PERSPECTIVE_MATRIX] = tf.calPerspectiveMatrix(computedStyle[PERSPECTIVE$3], po); + __config[NODE_PERSPECTIVE_MATRIX$1] = tf.calPerspectiveMatrix(computedStyle[PERSPECTIVE$2], po); } } }, { @@ -18534,13 +18538,13 @@ v = _item[1]; // 部分%单位的滤镜强制使用数字 - if (v[1] === PX$6 || v[1] === DEG$2 || v[1] === PERCENT$7 || v[1] === NUMBER$5) { + if (v[1] === PX$5 || v[1] === DEG || v[1] === PERCENT$5 || v[1] === NUMBER) { v = v[0]; - } else if (v[1] === REM$7) { - v = v[0] * _this5.root.computedStyle[FONT_SIZE$8]; - } else if (v[1] === VW$7) { + } else if (v[1] === REM$9) { + v = v[0] * _this5.root.computedStyle[FONT_SIZE$9]; + } else if (v[1] === VW$9) { v = v[0] * _this5.root.width * 0.01; - } else if (v[1] === VH$7) { + } else if (v[1] === VH$9) { v = v[0] * _this5.root.height * 0.01; } @@ -18550,12 +18554,12 @@ }, { key: "__calContent", value: function __calContent(renderMode, lv, currentStyle, computedStyle) { - if (renderMode === CANVAS$1 || renderMode === WEBGL$1) { - if (lv < REPAINT$1) { + if (renderMode === CANVAS || renderMode === WEBGL) { + if (lv < REPAINT$2) { return this.__hasContent; } - var visibility = currentStyle[VISIBILITY$3]; + var visibility = currentStyle[VISIBILITY$4]; if (visibility !== 'hidden') { var bgI = currentStyle[BACKGROUND_IMAGE$1]; @@ -18570,11 +18574,11 @@ if (currentStyle[BACKGROUND_COLOR$1][0][3] > 0) { var width = computedStyle[WIDTH$4], - height = computedStyle[HEIGHT$3], - paddingTop = computedStyle[PADDING_TOP$1], - paddingRight = computedStyle[PADDING_RIGHT$1], - paddingBottom = computedStyle[PADDING_BOTTOM$1], - paddingLeft = computedStyle[PADDING_LEFT$2]; + height = computedStyle[HEIGHT$5], + paddingTop = computedStyle[PADDING_TOP$4], + paddingRight = computedStyle[PADDING_RIGHT$4], + paddingBottom = computedStyle[PADDING_BOTTOM$4], + paddingLeft = computedStyle[PADDING_LEFT$5]; if (width && height || paddingTop || paddingRight || paddingBottom || paddingLeft) { return true; @@ -18584,12 +18588,12 @@ for (var list = ['Top', 'Right', 'Bottom', 'Left'], _i = 0, _len = list.length; _i < _len; _i++) { var k = list[_i]; - if (computedStyle[STYLE_KEY$5[style2Upper$2('border' + k + 'Width')]] > 0 && currentStyle[STYLE_KEY$5[style2Upper$2('border' + k + 'Color')]][0][3] > 0) { + if (computedStyle[STYLE_KEY[style2Upper('border' + k + 'Width')]] > 0 && currentStyle[STYLE_KEY[style2Upper('border' + k + 'Color')]][0][3] > 0) { return true; } } - var _bs = currentStyle[BOX_SHADOW$2]; + var _bs = currentStyle[BOX_SHADOW$7]; if (Array.isArray(_bs)) { for (var _i2 = 0, _len2 = _bs.length; _i2 < _len2; _i2++) { @@ -18629,12 +18633,12 @@ var isDestroyed = this.isDestroyed, root = this.root, __config = this.__config; - var __cache = __config[NODE_CACHE$2]; - var __cacheStyle = __config[NODE_CACHE_STYLE]; - var currentStyle = __config[NODE_CURRENT_STYLE$1]; - var computedStyle = __config[NODE_COMPUTED_STYLE$2]; // 渲染完认为完全无变更,等布局/动画/更新重置 + var __cache = __config[NODE_CACHE$3]; + var __cacheStyle = __config[NODE_CACHE_STYLE$2]; + var currentStyle = __config[NODE_CURRENT_STYLE$5]; + var computedStyle = __config[NODE_COMPUTED_STYLE$3]; // 渲染完认为完全无变更,等布局/动画/更新重置 - __config[NODE_REFRESH_LV] = NONE; // >=REPAINT才会进入这里,清空bbox + __config[NODE_REFRESH_LV$2] = NONE$3; // >=REPAINT才会进入这里,清空bbox this.__bbox = null; @@ -18654,20 +18658,20 @@ visibility: 'visible' }; // svg mock,每次都生成,每个节点都是局部根,更新时自底向上清除 - if (!__config[NODE_CACHE_TOTAL]) { - __config[NODE_CACHE_TOTAL] = { + if (!__config[NODE_CACHE_TOTAL$2]) { + __config[NODE_CACHE_TOTAL$2] = { available: true, release: function release() { this.available = false; delete virtualDom.cache; } }; - } else if (!__config[NODE_CACHE_TOTAL].available) { - __config[NODE_CACHE_TOTAL].available = true; + } else if (!__config[NODE_CACHE_TOTAL$2].available) { + __config[NODE_CACHE_TOTAL$2].available = true; } } - var display = computedStyle[DISPLAY$3]; // canvas返回信息,svg已经初始化好了vd + var display = computedStyle[DISPLAY$7]; // canvas返回信息,svg已经初始化好了vd if (display === 'none') { return { @@ -18681,15 +18685,15 @@ offsetWidth = this.offsetWidth, offsetHeight = this.offsetHeight, __hasMask = this.__hasMask; - var paddingTop = computedStyle[PADDING_TOP$1], - paddingRight = computedStyle[PADDING_RIGHT$1], - paddingBottom = computedStyle[PADDING_BOTTOM$1], - paddingLeft = computedStyle[PADDING_LEFT$2], - borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$3], - borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$2], - borderTopWidth = computedStyle[BORDER_TOP_WIDTH$2], - borderBottomWidth = computedStyle[BORDER_BOTTOM_WIDTH$2]; - var isRealInline = __config[NODE_IS_INLINE]; // 考虑mpb的6个坐标,inline比较特殊单独计算 + var paddingTop = computedStyle[PADDING_TOP$4], + paddingRight = computedStyle[PADDING_RIGHT$4], + paddingBottom = computedStyle[PADDING_BOTTOM$4], + paddingLeft = computedStyle[PADDING_LEFT$5], + borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$5], + borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$4], + borderTopWidth = computedStyle[BORDER_TOP_WIDTH$4], + borderBottomWidth = computedStyle[BORDER_BOTTOM_WIDTH$4]; + var isRealInline = __config[NODE_IS_INLINE$1]; // 考虑mpb的6个坐标,inline比较特殊单独计算 var x1 = this.__sx1; var x2 = this.__sx2; @@ -18731,9 +18735,9 @@ sy6: y6 }; // 防止cp直接返回cp嵌套,拿到真实dom的parent - var p = __config[NODE_DOM_PARENT$2]; + var p = __config[NODE_DOM_PARENT$4]; - var hasContent = this.__hasContent = __config[NODE_HAS_CONTENT$1] = this.__calContent(renderMode, lv, currentStyle, computedStyle); + var hasContent = this.__hasContent = __config[NODE_HAS_CONTENT] = this.__calContent(renderMode, lv, currentStyle, computedStyle); this.__calPerspective(__cacheStyle, currentStyle, computedStyle, __config); @@ -18743,60 +18747,60 @@ var dx = 0, dy = 0; - if (cache && (renderMode === CANVAS$1 || renderMode === WEBGL$1)) { + if (cache && (renderMode === CANVAS || renderMode === WEBGL)) { // 无内容可释放并提前跳出,geom覆盖特殊判断,因为后面子类会绘制矢量,img也覆盖特殊判断,加载完肯定有内容 if (!hasContent && this.__releaseWhenEmpty(__cache)) { res["break"] = true; __config[NODE_LIMIT_CACHE$1] = false; } // 新生成根据最大尺寸,排除margin从border开始还要考虑阴影滤镜等,geom单独在dom里做 else if (!__config[NODE_LIMIT_CACHE$1]) { - var bbox = this.bbox; - - if (__cache) { - __cache.reset(bbox, x1, y1); - } else { - __cache = Cache.getInstance(bbox, x1, y1); - } // cache成功设置坐标偏移,否则为超过最大尺寸限制不使用缓存 - - - if (__cache && __cache.enabled) { - __cache.__bbox = bbox; - ctx = __cache.ctx; - dx = __cache.dx; - dy = __cache.dy; // 重置ctx为cache的,以及绘制坐标为cache的区域 - - if (dx) { - res.x1 = x1 += dx; - res.x2 = x2 += dx; - res.x3 = x3 += dx; - res.x4 = x4 += dx; - res.x5 = x5 += dx; - res.x6 = x6 += dx; - } + var bbox = this.bbox; - if (dy) { - res.y1 = y1 += dy; - res.y2 = y2 += dy; - res.y3 = y3 += dy; - res.y4 = y4 += dy; - res.y5 = y5 += dy; - res.y6 = y6 += dy; - } + if (__cache) { + __cache.reset(bbox, x1, y1); + } else { + __cache = Cache.getInstance(bbox, x1, y1); + } // cache成功设置坐标偏移,否则为超过最大尺寸限制不使用缓存 + + + if (__cache && __cache.enabled) { + __cache.__bbox = bbox; + ctx = __cache.ctx; + dx = __cache.dx; + dy = __cache.dy; // 重置ctx为cache的,以及绘制坐标为cache的区域 + + if (dx) { + res.x1 = x1 += dx; + res.x2 = x2 += dx; + res.x3 = x3 += dx; + res.x4 = x4 += dx; + res.x5 = x5 += dx; + res.x6 = x6 += dx; + } - res.ctx = ctx; - } else { - __config[NODE_LIMIT_CACHE$1] = true; - __cache = null; - res.limitCache = res["break"] = true; + if (dy) { + res.y1 = y1 += dy; + res.y2 = y2 += dy; + res.y3 = y3 += dy; + res.y4 = y4 += dy; + res.y5 = y5 += dy; + res.y6 = y6 += dy; } - __config[NODE_CACHE$2] = __cache; + res.ctx = ctx; + } else { + __config[NODE_LIMIT_CACHE$1] = true; + __cache = null; + res.limitCache = res["break"] = true; } - } // 降级的webgl绘制 - else if (renderMode === WEBGL$1) { - var c = inject.getCacheCanvas(root.width, root.height, '__$$OVERSIZE$$__'); - res.ctx = ctx = c.ctx; + + __config[NODE_CACHE$3] = __cache; } + } // 降级的webgl绘制 + else if (renderMode === WEBGL) { + var c = inject.getCacheCanvas(root.width, root.height, '__$$OVERSIZE$$__'); + res.ctx = ctx = c.ctx; + } res.dx = dx; res.dy = dy; // 计算好cacheStyle的内容,以及位图缓存指数 @@ -18821,23 +18825,23 @@ borderTopRightRadius = computedStyle[BORDER_TOP_RIGHT_RADIUS$1], borderBottomRightRadius = computedStyle[BORDER_BOTTOM_RIGHT_RADIUS$1], borderBottomLeftRadius = computedStyle[BORDER_BOTTOM_LEFT_RADIUS$1], - visibility = computedStyle[VISIBILITY$3], + visibility = computedStyle[VISIBILITY$4], backgroundRepeat = computedStyle[BACKGROUND_REPEAT], backgroundImage = computedStyle[BACKGROUND_IMAGE$1], - opacity = computedStyle[OPACITY$3], + opacity = computedStyle[OPACITY$2], filter = computedStyle[FILTER$3], - backgroundSize = computedStyle[BACKGROUND_SIZE$2], - boxShadow = computedStyle[BOX_SHADOW$2], - overflow = computedStyle[OVERFLOW$1], - mixBlendMode = computedStyle[MIX_BLEND_MODE], - backgroundClip = computedStyle[BACKGROUND_CLIP$2]; // 先设置透明度,canvas可以向上累积 + backgroundSize = computedStyle[BACKGROUND_SIZE], + boxShadow = computedStyle[BOX_SHADOW$7], + overflow = computedStyle[OVERFLOW$2], + mixBlendMode = computedStyle[MIX_BLEND_MODE$3], + backgroundClip = computedStyle[BACKGROUND_CLIP]; // 先设置透明度,canvas可以向上累积 - if (renderMode === CANVAS$1 || renderMode === WEBGL$1) { + if (renderMode === CANVAS || renderMode === WEBGL) { if (p) { - opacity *= p.__config[NODE_OPACITY$2]; + opacity *= p.__config[NODE_OPACITY$1]; } - __config[NODE_OPACITY$2] = opacity; + __config[NODE_OPACITY$1] = opacity; } else if (renderMode === SVG) { if (opacity === 1) { delete virtualDom.opacity; @@ -18849,7 +18853,7 @@ if (renderMode === SVG) { if (!mx.isE(matrix)) { - virtualDom.transform = 'matrix(' + joinArr$2(mx.m2m6(matrix), ',') + ')'; + virtualDom.transform = 'matrix(' + joinArr$1(mx.m2m6(matrix), ',') + ')'; } else { delete virtualDom.transform; } @@ -18857,7 +18861,7 @@ virtualDom.visibility = visibility; } - var m = __config[NODE_MATRIX$1]; + var m = __config[NODE_MATRIX$2]; util.assignMatrix(m, matrix); // 变换和canvas要以父元素matrixEvent为基础,svg使用自身即css规则,webgl在struct渲染时另算 if (p) { @@ -18882,42 +18886,40 @@ if (mixBlendMode !== 'normal' && isValidMbm$1(mixBlendMode)) { mixBlendMode = mbmName$1(mixBlendMode); - if (renderMode === CANVAS$1 && !cache) { + if (renderMode === CANVAS && !cache) { var width = root.width, height = root.height; - - var _c = inject.getCacheCanvas(width, height, null, 'blend'); - + var c = inject.getCacheCanvas(width, height, null, 'blend'); offscreenBlend = { ctx: ctx, - target: _c, + target: c, mixBlendMode: mixBlendMode, matrix: matrix }; - ctx = _c.ctx; + ctx = c.ctx; } else if (renderMode === SVG) { virtualDom.mixBlendMode = mixBlendMode; } } // svg特殊没有mbm删除 else if (renderMode === SVG) { - delete virtualDom.mixBlendMode; - } + delete virtualDom.mixBlendMode; + } var offscreenMask; if (__hasMask) { - if (renderMode === CANVAS$1 && !cache) { + if (renderMode === CANVAS && !cache) { var _width = root.width, _height = root.height; - var _c2 = inject.getCacheCanvas(_width, _height, null, 'mask1'); + var _c = inject.getCacheCanvas(_width, _height, null, 'mask1'); offscreenMask = { ctx: ctx, - target: _c2, + target: _c, matrix: matrix }; - ctx = _c2.ctx; + ctx = _c.ctx; } } // 无cache时canvas的blur需绘制到离屏上应用后反向绘制回来,有cache在Dom里另生成一个filter的cache @@ -18926,19 +18928,19 @@ var offscreenFilter; if (hasFilter) { - if (renderMode === CANVAS$1 && !cache) { + if (renderMode === CANVAS && !cache) { var _width2 = root.width, _height2 = root.height; - var _c3 = inject.getCacheCanvas(_width2, _height2, null, 'filter1'); + var _c2 = inject.getCacheCanvas(_width2, _height2, null, 'filter1'); offscreenFilter = { ctx: ctx, filter: filter, - target: _c3, + target: _c2, matrix: matrix }; - ctx = _c3.ctx; + ctx = _c2.ctx; } else if (renderMode === SVG) { virtualDom.filter = painter.svgFilter(filter); } @@ -18978,25 +18980,25 @@ if (overflow === 'hidden' && display !== 'inline') { borderList = border.calRadius(bx1, by1, bx2 - bx1, by2 - by1, btlr, btrr, bbrr, bblr); - if (renderMode === CANVAS$1 && !cache) { + if (renderMode === CANVAS && !cache) { var _width3 = root.width, _height3 = root.height; - var _c4 = inject.getCacheCanvas(_width3, _height3, null, 'overflow'); + var _c3 = inject.getCacheCanvas(_width3, _height3, null, 'overflow'); offscreenOverflow = { ctx: ctx, - target: _c4, + target: _c3, matrix: matrix }; - ctx = _c4.ctx; + ctx = _c3.ctx; offscreenOverflow.x = x1; offscreenOverflow.y = y1; offscreenOverflow.offsetWidth = offsetWidth; offscreenOverflow.offsetHeight = offsetHeight; offscreenOverflow.list = borderList; } else if (renderMode === SVG) { - var d = svgPolygon$5(borderList) || "M".concat(x1, ",").concat(y1, "L").concat(x1 + offsetWidth, ",").concat(y1, "L").concat(x1 + offsetWidth, ",").concat(y1 + offsetHeight, "L").concat(x1, ",").concat(y1 + offsetHeight, ",L").concat(x1, ",").concat(y1); + var d = svgPolygon$2(borderList) || "M".concat(x1, ",").concat(y1, "L").concat(x1 + offsetWidth, ",").concat(y1, "L").concat(x1 + offsetWidth, ",").concat(y1 + offsetHeight, "L").concat(x1, ",").concat(y1 + offsetHeight, ",L").concat(x1, ",").concat(y1); var v = { tagName: 'clipPath', props: [], @@ -19016,7 +19018,7 @@ } // 无法使用缓存时主画布直接绘制需设置 - if (renderMode === CANVAS$1 && !cache) { + if (renderMode === CANVAS && !cache) { res.offscreenBlend = offscreenBlend; res.offscreenMask = offscreenMask; res.offscreenFilter = offscreenFilter; @@ -19027,7 +19029,7 @@ } // 隐藏不渲染 - if ((visibility === 'hidden' || res["break"]) && (renderMode === CANVAS$1 || renderMode === WEBGL$1)) { + if ((visibility === 'hidden' || res["break"]) && (renderMode === CANVAS || renderMode === WEBGL)) { res["break"] = true; return res; } @@ -19055,9 +19057,9 @@ if (length) { var _ret = function () { - var fontSize = computedStyle[FONT_SIZE$8], - fontFamily = computedStyle[FONT_FAMILY$4], - lineHeight = computedStyle[LINE_HEIGHT$3]; + var fontSize = computedStyle[FONT_SIZE$9], + fontFamily = computedStyle[FONT_FAMILY], + lineHeight = computedStyle[LINE_HEIGHT$1]; var iw = 0, ih = 0; var offscreen, @@ -19075,7 +19077,7 @@ ih += paddingTop + paddingBottom + borderTopWidth + borderBottomWidth; } - if (renderMode === CANVAS$1 || renderMode === WEBGL$1) { + if (renderMode === CANVAS || renderMode === WEBGL) { offscreen = inject.getCacheCanvas(iw, ih, '__$$INLINE_BGI$$__'); } @@ -19102,7 +19104,7 @@ if (gd) { if (gd.k === 'conic') { - var _uuid = gradient$1.renderConic(_this6, renderMode, offscreen && offscreen.ctx || ctx, gd.v, 0, 0, iw, lineHeight, btlr, btrr, bbrr, bblr, true); + var _uuid = gradient.renderConic(_this6, renderMode, offscreen && offscreen.ctx || ctx, gd.v, 0, 0, iw, lineHeight, btlr, btrr, bbrr, bblr, true); if (renderMode === SVG && _uuid) { svgBgSymbol.push(_uuid); @@ -19123,7 +19125,7 @@ var ff = css.getFontFamily(fontFamily); var baseLine = css.getBaseLine(computedStyle); // lineGap,一般为0,某些字体如arial有,渲染高度需减去它,最终是lineHeight - diffL - var diffL = fontSize * (o$1.info[ff].lgr || 0); // 注意只有1个的时候特殊情况,圆角只在首尾行出现 + var diffL = fontSize * (o$3.info[ff].lgr || 0); // 注意只有1个的时候特殊情况,圆角只在首尾行出现 var isFirst = true; var lastContentBox = contentBoxList[0], @@ -19161,32 +19163,32 @@ var w = ix2 - ix1; // canvas的bg位图裁剪 - if ((renderMode === CANVAS$1 || renderMode === WEBGL$1) && offscreen) { + if ((renderMode === CANVAS || renderMode === WEBGL) && offscreen) { ctx.drawImage(offscreen.canvas, countW, 0, w, ih, ix1 + dx, iy1 + dy, w, ih); } //svg则特殊判断 else if (renderMode === SVG && svgBgSymbol.length) { - svgBgSymbol.forEach(function (symbol) { - if (symbol) { - var _v3 = { - tagName: 'clipPath', - props: [], - children: [{ - tagName: 'path', - props: [['d', "M".concat(countW, ",", 0, "L").concat(w + countW, ",", 0, "L").concat(w + countW, ",").concat(ih, "L").concat(countW, ",").concat(ih, ",L").concat(countW, ",", 0)]] - }] - }; - var clip = ctx.add(_v3); - - __config[NODE_DEFS_CACHE$3].push(_v3); - - virtualDom.bb.push({ - type: 'item', - tagName: 'use', - props: [['xlink:href', '#' + symbol], ['x', ix1 - countW], ['y', iy1], ['clip-path', 'url(#' + clip + ')']] - }); - } - }); - } + svgBgSymbol.forEach(function (symbol) { + if (symbol) { + var _v3 = { + tagName: 'clipPath', + props: [], + children: [{ + tagName: 'path', + props: [['d', "M".concat(countW, ",", 0, "L").concat(w + countW, ",", 0, "L").concat(w + countW, ",").concat(ih, "L").concat(countW, ",").concat(ih, ",L").concat(countW, ",", 0)]] + }] + }; + var clip = ctx.add(_v3); + + __config[NODE_DEFS_CACHE$3].push(_v3); + + virtualDom.bb.push({ + type: 'item', + tagName: 'use', + props: [['xlink:href', '#' + symbol], ['x', ix1 - countW], ['y', iy1], ['clip-path', 'url(#' + clip + ')']] + }); + } + }); + } countW += w; @@ -19262,32 +19264,32 @@ var w = ix2 - ix1; // canvas的bg位图裁剪 - if ((renderMode === CANVAS$1 || renderMode === WEBGL$1) && offscreen) { + if ((renderMode === CANVAS || renderMode === WEBGL) && offscreen) { ctx.drawImage(offscreen.canvas, countW, 0, w, ih, ix1 + dx, iy1 + dy, w, ih); } //svg则特殊判断 else if (renderMode === SVG && svgBgSymbol.length) { - svgBgSymbol.forEach(function (symbol) { - if (symbol) { - var _v4 = { - tagName: 'clipPath', - props: [], - children: [{ - tagName: 'path', - props: [['d', "M".concat(countW, ",", 0, "L").concat(w + countW, ",", 0, "L").concat(w + countW, ",").concat(ih, "L").concat(countW, ",").concat(ih, ",L").concat(countW, ",", 0)]] - }] - }; - var clip = ctx.add(_v4); - - __config[NODE_DEFS_CACHE$3].push(_v4); - - virtualDom.bb.push({ - type: 'item', - tagName: 'use', - props: [['xlink:href', '#' + symbol], ['x', ix1 - countW], ['y', iy1], ['clip-path', 'url(#' + clip + ')']] - }); - } - }); - } + svgBgSymbol.forEach(function (symbol) { + if (symbol) { + var _v4 = { + tagName: 'clipPath', + props: [], + children: [{ + tagName: 'path', + props: [['d', "M".concat(countW, ",", 0, "L").concat(w + countW, ",", 0, "L").concat(w + countW, ",").concat(ih, "L").concat(countW, ",").concat(ih, ",L").concat(countW, ",", 0)]] + }] + }; + var clip = ctx.add(_v4); + + __config[NODE_DEFS_CACHE$3].push(_v4); + + virtualDom.bb.push({ + type: 'item', + tagName: 'use', + props: [['xlink:href', '#' + symbol], ['x', ix1 - countW], ['y', iy1], ['clip-path', 'url(#' + clip + ')']] + }); + } + }); + } if (boxShadow) { boxShadow.forEach(function (item) { @@ -19347,8 +19349,8 @@ if (_typeof(_ret) === "object") return _ret.v; } // 无内容且无尺寸的无需渲染 else if (bx1 === bx2 || by1 === by2) { - return res; - } + return res; + } } // block渲染,bgc垫底 @@ -19377,7 +19379,7 @@ if (gd) { if (gd.k === 'conic') { - gradient$1.renderConic(_this6, renderMode, ctx, gd.v, bx1, by1, bx2 - bx1, by2 - by1, btlr, btrr, bbrr, bblr); + gradient.renderConic(_this6, renderMode, ctx, gd.v, bx1, by1, bx2 - bx1, by2 - by1, btlr, btrr, bbrr, bblr); } else { bg.renderBgc(_this6, renderMode, ctx, gd.v, borderList, bx1, by1, bx2 - bx1, by2 - by1, btlr, btrr, bbrr, bblr); } @@ -19438,7 +19440,7 @@ computedStyle = this.computedStyle, isMask = this.isMask; - if (isDestroyed || computedStyle[DISPLAY$3] === 'none' || e.__stopPropagation || isMask) { + if (isDestroyed || computedStyle[DISPLAY$7] === 'none' || e.__stopPropagation || isMask) { return; } @@ -19505,7 +19507,7 @@ return; } - var inThis = geom.pointInQuadrilateral(x, y, __sx1, __sy1, __sx1 + offsetWidth, __sy1, __sx1 + offsetWidth, __sy1 + offsetHeight, __sx1, __sy1 + offsetHeight, matrixEvent); + var inThis = geom$1.pointInQuadrilateral(x, y, __sx1, __sy1, __sx1 + offsetWidth, __sy1, __sx1 + offsetWidth, __sy1 + offsetHeight, __sx1, __sy1 + offsetHeight, matrixEvent); if (inThis) { if (!e.target && !ignore) { @@ -19542,10 +19544,10 @@ }; if (k === 'linear') { - var gd = gradient$1.getLinear(v, d, bx1, by1, cx, cy, iw, ih, this.root); + var gd = gradient.getLinear(v, d, bx1, by1, cx, cy, iw, ih, this.root); res.v = this.__getLg(renderMode, ctx, gd); } else if (k === 'radial') { - var _gd = gradient$1.getRadial(v, s, z, p, bx1, by1, bx2, by2, this.root); + var _gd = gradient.getRadial(v, s, z, p, bx1, by1, bx2, by2, this.root); if (_gd) { res.v = this.__getRg(renderMode, ctx, _gd); @@ -19559,7 +19561,7 @@ var m1 = Math.max(Math.abs(bbox[2] - bbox[0]), Math.abs(bbox[3] - bbox[1])); var m2 = Math.max(Math.abs(iw), Math.abs(ih)); - var _gd2 = gradient$1.getConic(v, d, p, bx1, by1, bx2, by2, m1 / m2, this.root); + var _gd2 = gradient.getConic(v, d, p, bx1, by1, bx2, by2, m1 / m2, this.root); res.v = this.__getCg(renderMode, ctx, _gd2); } @@ -19569,10 +19571,10 @@ }, { key: "__getLg", value: function __getLg(renderMode, ctx, gd) { - if (renderMode === CANVAS$1 || renderMode === WEBGL$1) { + if (renderMode === CANVAS || renderMode === WEBGL) { var lg = ctx.createLinearGradient(gd.x1, gd.y1, gd.x2, gd.y2); gd.stop.forEach(function (item) { - lg.addColorStop(item[1], int2rgba$2(item[0])); + lg.addColorStop(item[1], int2rgba$1(item[0])); }); return lg; } else if (renderMode === SVG) { @@ -19582,7 +19584,7 @@ children: gd.stop.map(function (item) { return { tagName: 'stop', - props: [['stop-color', int2rgba$2(item[0])], ['offset', item[1] * 100 + '%']] + props: [['stop-color', int2rgba$1(item[0])], ['offset', item[1] * 100 + '%']] }; }) }; @@ -19596,10 +19598,10 @@ }, { key: "__getRg", value: function __getRg(renderMode, ctx, gd) { - if (renderMode === CANVAS$1 || renderMode === WEBGL$1) { + if (renderMode === CANVAS || renderMode === WEBGL) { var rg = ctx.createRadialGradient(gd.cx, gd.cy, 0, gd.cx, gd.cy, gd.r); gd.stop.forEach(function (item) { - rg.addColorStop(item[1], int2rgba$2(item[0])); + rg.addColorStop(item[1], int2rgba$1(item[0])); }); return rg; } else if (renderMode === SVG) { @@ -19609,7 +19611,7 @@ children: gd.stop.map(function (item) { return { tagName: 'stop', - props: [['stop-color', int2rgba$2(item[0])], ['offset', item[1] * 100 + '%']] + props: [['stop-color', int2rgba$1(item[0])], ['offset', item[1] * 100 + '%']] }; }) }; @@ -19641,7 +19643,7 @@ var res = []; - if (renderMode === CANVAS$1 || renderMode === WEBGL$1) { + if (renderMode === CANVAS || renderMode === WEBGL) { return gd; } else if (renderMode === SVG) { var offset = 0.5; @@ -19664,12 +19666,12 @@ var pc = [dc[0] / n, dc[1] / n, dc[2] / n, dc[3] / n]; for (var j = 0; j < n; j++) { - var _geom$pointOnCircle = geom.pointOnCircle(cx, cy, r, begin + per * j + deg - offset), + var _geom$pointOnCircle = geom$1.pointOnCircle(cx, cy, r, begin + per * j + deg - offset), _geom$pointOnCircle2 = _slicedToArray(_geom$pointOnCircle, 2), x1 = _geom$pointOnCircle2[0], y1 = _geom$pointOnCircle2[1]; - var _geom$pointOnCircle3 = geom.pointOnCircle(cx, cy, r, begin + per * j + deg + offset), + var _geom$pointOnCircle3 = geom$1.pointOnCircle(cx, cy, r, begin + per * j + deg + offset), _geom$pointOnCircle4 = _slicedToArray(_geom$pointOnCircle3, 2), _x = _geom$pointOnCircle4[0], _y = _geom$pointOnCircle4[1]; @@ -19681,7 +19683,7 @@ var end = list[0].slice(0); - var _geom$pointOnCircle5 = geom.pointOnCircle(cx, cy, r, deg), + var _geom$pointOnCircle5 = geom$1.pointOnCircle(cx, cy, r, deg), _geom$pointOnCircle6 = _slicedToArray(_geom$pointOnCircle5, 2), x2 = _geom$pointOnCircle6[0], y2 = _geom$pointOnCircle6[1]; @@ -19704,10 +19706,10 @@ props: [['x1', prev[0]], ['y1', prev[1]], ['x2', cur[2]], ['y2', cur[3]]], children: [{ tagName: 'stop', - props: [['stop-color', int2rgba$2([prev[4], prev[5], prev[6], prev[7]])], ['offset', '0%']] + props: [['stop-color', int2rgba$1([prev[4], prev[5], prev[6], prev[7]])], ['offset', '0%']] }, { tagName: 'stop', - props: [['stop-color', int2rgba$2([cur[4], cur[5], cur[6], cur[7]])], ['offset', '100%']] + props: [['stop-color', int2rgba$1([cur[4], cur[5], cur[6], cur[7]])], ['offset', '100%']] }] }; var uuid = ctx.add(v); @@ -19728,14 +19730,14 @@ key: "clearCache", value: function clearCache(onlyTotal) { var __config = this.__config; - var __cacheTotal = __config[NODE_CACHE_TOTAL]; - var __cacheFilter = __config[NODE_CACHE_FILTER$1]; - var __cacheMask = __config[NODE_CACHE_MASK]; - var __cacheOverflow = __config[NODE_CACHE_OVERFLOW$1]; + var __cacheTotal = __config[NODE_CACHE_TOTAL$2]; + var __cacheFilter = __config[NODE_CACHE_FILTER$2]; + var __cacheMask = __config[NODE_CACHE_MASK$2]; + var __cacheOverflow = __config[NODE_CACHE_OVERFLOW$2]; if (!onlyTotal) { - __config[NODE_CACHE_STYLE] = this.__cacheStyle = {}; - var __cache = __config[NODE_CACHE$2]; + __config[NODE_CACHE_STYLE$2] = this.__cacheStyle = {}; + var __cache = __config[NODE_CACHE$3]; if (__cache) { __cache.release(); @@ -19777,18 +19779,18 @@ var res = {}; - res[UPDATE_NODE$2] = node; + res[UPDATE_NODE$3] = node; res[UPDATE_STYLE$1] = formatStyle; - res[UPDATE_OVERWRITE] = style; // 标识盖原有style样式不仅仅是修改currentStyle,不同于animate + res[UPDATE_OVERWRITE$1] = style; // 标识盖原有style样式不仅仅是修改currentStyle,不同于animate res[UPDATE_KEYS$1] = Object.keys(formatStyle).map(function (i) { - if (!GEOM$4.hasOwnProperty(i)) { + if (!GEOM.hasOwnProperty(i)) { i = parseInt(i); } return i; }); - res[UPDATE_CONFIG$2] = __config; + res[UPDATE_CONFIG$3] = __config; root.__addUpdate(node, __config, root, root.__config, res); }, @@ -19800,12 +19802,12 @@ }); } // 没有是在如parse()还未添加的时候,可以直接同步覆盖 else { - Object.assign(this.currentStyle, formatStyle); + Object.assign(this.currentStyle, formatStyle); - if (util.isFunction(cb)) { - cb.call(node, -1); - } + if (util.isFunction(cb)) { + cb.call(node, -1); } + } } // 传入格式化好key/value的样式 }, { @@ -19826,16 +19828,16 @@ var res = {}; - res[UPDATE_NODE$2] = node; + res[UPDATE_NODE$3] = node; res[UPDATE_STYLE$1] = style; res[UPDATE_KEYS$1] = Object.keys(style).map(function (i) { - if (!GEOM$4.hasOwnProperty(i)) { + if (!GEOM.hasOwnProperty(i)) { i = parseInt(i); } return i; }); - res[UPDATE_CONFIG$2] = __config; + res[UPDATE_CONFIG$3] = __config; root.__addUpdate(node, __config, root, root.__config, res); }, @@ -19847,12 +19849,12 @@ }); } // 没有是在如parse()还未添加的时候,可以直接同步覆盖 else { - Object.assign(this.currentStyle, style); + Object.assign(this.currentStyle, style); - if (util.isFunction(cb)) { - cb.call(node, -1); - } + if (util.isFunction(cb)) { + cb.call(node, -1); } + } } }, { key: "animate", @@ -19965,7 +19967,7 @@ } if (lv !== undefined) { - this.__config[NODE_REFRESH_LV] |= lv; + this.__config[NODE_REFRESH_LV$2] |= lv; } this.__sx1 += diff; @@ -19986,7 +19988,7 @@ } if (lv !== undefined) { - this.__config[NODE_REFRESH_LV] |= lv; + this.__config[NODE_REFRESH_LV$2] |= lv; } this.__sy1 += diff; @@ -20013,7 +20015,7 @@ } if (lv !== undefined) { - this.__config[NODE_REFRESH_LV] |= lv; + this.__config[NODE_REFRESH_LV$2] |= lv; } this.clearCache(); @@ -20035,7 +20037,7 @@ } if (lv !== undefined) { - this.__config[NODE_REFRESH_LV] |= lv; + this.__config[NODE_REFRESH_LV$2] |= lv; } this.clearCache(); @@ -20090,17 +20092,17 @@ } keys = keys.map(function (s) { - return STYLE_KEY$5[style2Upper$2(s)]; + return STYLE_KEY[style2Upper(s)]; }); } else { keys = Object.keys(computedStyle); } keys.forEach(function (k) { - if (GEOM$4.hasOwnProperty(k)) { + if (GEOM.hasOwnProperty(k)) { res[k] = computedStyle[k]; } else { - res[STYLE_RV_KEY$2[k]] = computedStyle[k]; + res[STYLE_RV_KEY[k]] = computedStyle[k]; } }); return res; @@ -20113,10 +20115,10 @@ offsetWidth = this.offsetWidth, offsetHeight = this.offsetHeight, matrixEvent = this.matrixEvent; - var p1 = point2d$1(mx.calPoint([__sx1, __sy1], matrixEvent)); - var p2 = point2d$1(mx.calPoint([__sx1 + offsetWidth, __sy1], matrixEvent)); - var p3 = point2d$1(mx.calPoint([__sx1 + offsetWidth, __sy1 + offsetHeight], matrixEvent)); - var p4 = point2d$1(mx.calPoint([__sx1, __sy1 + offsetHeight], matrixEvent)); + var p1 = point2d(mx.calPoint([__sx1, __sy1], matrixEvent)); + var p2 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1], matrixEvent)); + var p3 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1 + offsetHeight], matrixEvent)); + var p4 = point2d(mx.calPoint([__sx1, __sy1 + offsetHeight], matrixEvent)); return { left: Math.min(p1[0], Math.min(p2[0], Math.min(p3[0], p4[0]))), top: Math.min(p1[1], Math.min(p2[1], Math.min(p3[1], p4[1]))), @@ -20182,10 +20184,10 @@ var res = {}; - res[UPDATE_NODE$2] = self; - res[UPDATE_FOCUS$1] = o$3.REFLOW; - res[UPDATE_REMOVE_DOM] = true; - res[UPDATE_CONFIG$2] = self.__config; + res[UPDATE_NODE$3] = self; + res[UPDATE_FOCUS$3] = o$1.REFLOW; + res[UPDATE_REMOVE_DOM$1] = true; + res[UPDATE_CONFIG$3] = self.__config; root.__addUpdate(self, self.__config, root, root.__config, res); }, @@ -20252,12 +20254,18 @@ __sy1 = this.__sy1, clientWidth = this.clientWidth, clientHeight = this.clientHeight, - _this$currentStyle = this.currentStyle, - borderTopWidth = _this$currentStyle[BORDER_TOP_WIDTH$2], - borderRightWidth = _this$currentStyle[BORDER_RIGHT_WIDTH$2], - borderBottomWidth = _this$currentStyle[BORDER_BOTTOM_WIDTH$2], - borderLeftWidth = _this$currentStyle[BORDER_LEFT_WIDTH$3], - boxShadow = _this$currentStyle[BOX_SHADOW$2]; + _this$currentStyle = this.currentStyle; + _this$currentStyle = _this$currentStyle === void 0 ? {} : _this$currentStyle; + var _this$currentStyle$BO = _this$currentStyle[BORDER_TOP_WIDTH$4], + borderTopWidth = _this$currentStyle$BO === void 0 ? [0] : _this$currentStyle$BO, + _this$currentStyle$BO2 = _this$currentStyle[BORDER_RIGHT_WIDTH$4], + borderRightWidth = _this$currentStyle$BO2 === void 0 ? [0] : _this$currentStyle$BO2, + _this$currentStyle$BO3 = _this$currentStyle[BORDER_BOTTOM_WIDTH$4], + borderBottomWidth = _this$currentStyle$BO3 === void 0 ? [0] : _this$currentStyle$BO3, + _this$currentStyle$BO4 = _this$currentStyle[BORDER_LEFT_WIDTH$5], + borderLeftWidth = _this$currentStyle$BO4 === void 0 ? [0] : _this$currentStyle$BO4, + _this$currentStyle$BO5 = _this$currentStyle[BOX_SHADOW$7], + boxShadow = _this$currentStyle$BO5 === void 0 ? [] : _this$currentStyle$BO5; var _this$__spreadBbox = this.__spreadBbox(boxShadow), _this$__spreadBbox2 = _slicedToArray(_this$__spreadBbox, 2), @@ -20280,7 +20288,7 @@ }, { key: "matrix", get: function get() { - return this.__config[NODE_MATRIX$1]; + return this.__config[NODE_MATRIX$2]; } }, { key: "matrixEvent", @@ -20290,7 +20298,7 @@ }, { key: "perspectiveMatrix", get: function get() { - return this.__config[NODE_PERSPECTIVE_MATRIX]; + return this.__config[NODE_PERSPECTIVE_MATRIX$1]; } }, { key: "style", @@ -20347,14 +20355,14 @@ return Xom; }(Node); - var _enums$STYLE_KEY$d = enums.STYLE_KEY, - DISPLAY$4 = _enums$STYLE_KEY$d.DISPLAY, - MARGIN_LEFT$2 = _enums$STYLE_KEY$d.MARGIN_LEFT, - BORDER_LEFT_WIDTH$4 = _enums$STYLE_KEY$d.BORDER_LEFT_WIDTH, - PADDING_LEFT$3 = _enums$STYLE_KEY$d.PADDING_LEFT, - PADDING_RIGHT$2 = _enums$STYLE_KEY$d.PADDING_RIGHT, - BORDER_RIGHT_WIDTH$3 = _enums$STYLE_KEY$d.BORDER_RIGHT_WIDTH, - MARGIN_RIGHT$2 = _enums$STYLE_KEY$d.MARGIN_RIGHT; + var _enums$STYLE_KEY$c = enums.STYLE_KEY, + DISPLAY$6 = _enums$STYLE_KEY$c.DISPLAY, + MARGIN_LEFT$4 = _enums$STYLE_KEY$c.MARGIN_LEFT, + BORDER_LEFT_WIDTH$4 = _enums$STYLE_KEY$c.BORDER_LEFT_WIDTH, + PADDING_LEFT$4 = _enums$STYLE_KEY$c.PADDING_LEFT, + PADDING_RIGHT$3 = _enums$STYLE_KEY$c.PADDING_RIGHT, + BORDER_RIGHT_WIDTH$3 = _enums$STYLE_KEY$c.BORDER_RIGHT_WIDTH, + MARGIN_RIGHT$3 = _enums$STYLE_KEY$c.MARGIN_RIGHT; /** * css中常见的概念,一行内容,里面可能有若干不同的内容,仅在布局阶段出现,不参与渲染逻辑 * 本类是个抽象逻辑概念,会包含Text的内容TextBox和inlineBlock等节点,而内容TextBox则属于Text @@ -20463,10 +20471,10 @@ while (true) { var _list = dom.contentBoxList; var _dom$computedStyle = dom.computedStyle, - display = _dom$computedStyle[DISPLAY$4], - marginLeft = _dom$computedStyle[MARGIN_LEFT$2], + display = _dom$computedStyle[DISPLAY$6], + marginLeft = _dom$computedStyle[MARGIN_LEFT$4], borderLeftWidth = _dom$computedStyle[BORDER_LEFT_WIDTH$4], - paddingLeft = _dom$computedStyle[PADDING_LEFT$3]; + paddingLeft = _dom$computedStyle[PADDING_LEFT$4]; if (display !== 'inline') { break; @@ -20485,10 +20493,10 @@ while (true) { var _list2 = dom.contentBoxList; var _dom$computedStyle2 = dom.computedStyle, - _display = _dom$computedStyle2[DISPLAY$4], - marginRight = _dom$computedStyle2[MARGIN_RIGHT$2], + _display = _dom$computedStyle2[DISPLAY$6], + marginRight = _dom$computedStyle2[MARGIN_RIGHT$3], borderRightWidth = _dom$computedStyle2[BORDER_RIGHT_WIDTH$3], - paddingRight = _dom$computedStyle2[PADDING_RIGHT$2]; + paddingRight = _dom$computedStyle2[PADDING_RIGHT$3]; if (_display !== 'inline') { break; @@ -20897,16 +20905,16 @@ BOLD: BOLD }; - var _enums$STYLE_KEY$e = enums.STYLE_KEY, - DISPLAY$5 = _enums$STYLE_KEY$e.DISPLAY, - TOP$2 = _enums$STYLE_KEY$e.TOP, - BOTTOM$2 = _enums$STYLE_KEY$e.BOTTOM, - POSITION$2 = _enums$STYLE_KEY$e.POSITION, - HEIGHT$4 = _enums$STYLE_KEY$e.HEIGHT; - var AUTO$5 = o.AUTO, - PX$7 = o.PX, - PERCENT$8 = o.PERCENT; - var REFLOW$1 = o$3.REFLOW; + var _enums$STYLE_KEY$b = enums.STYLE_KEY, + DISPLAY$5 = _enums$STYLE_KEY$b.DISPLAY, + TOP$2 = _enums$STYLE_KEY$b.TOP, + BOTTOM$2 = _enums$STYLE_KEY$b.BOTTOM, + POSITION$3 = _enums$STYLE_KEY$b.POSITION, + HEIGHT$4 = _enums$STYLE_KEY$b.HEIGHT; + var AUTO$3 = o$4.AUTO, + PX$4 = o$4.PX, + PERCENT$4 = o$4.PERCENT; + var REFLOW$1 = o$1.REFLOW; function offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) { if (dy) { @@ -20924,7 +20932,7 @@ if (parent) { var cs = parent.computedStyle; - var ps = cs[POSITION$2]; + var ps = cs[POSITION$3]; isContainer = parent === root || parent.isShadowRoot || ps === 'relative' || ps === 'absolute'; } // 先偏移next,忽略有定位的absolute,本身非container也忽略 @@ -20934,25 +20942,25 @@ while (next) { if (next.currentStyle[DISPLAY$5] !== 'none') { - if (next.currentStyle[POSITION$2] === 'absolute') { + if (next.currentStyle[POSITION$3] === 'absolute') { var _next$currentStyle = next.currentStyle, top = _next$currentStyle[TOP$2], bottom = _next$currentStyle[BOTTOM$2], height = _next$currentStyle[HEIGHT$4]; - if (top[1] === AUTO$5) { - if (bottom[1] === AUTO$5 || bottom[1] === PX$7) { + if (top[1] === AUTO$3) { + if (bottom[1] === AUTO$3 || bottom[1] === PX$4) { next.__offsetY(dy, true, REFLOW$1); next.clearCache(); - } else if (bottom[1] === PERCENT$8) { + } else if (bottom[1] === PERCENT$4) { var v = (1 - bottom[0] * 0.01) * dy; next.__offsetY(v, true, REFLOW$1); next.clearCache(); } - } else if (top[1] === PERCENT$8) { + } else if (top[1] === PERCENT$4) { var _v = top[0] * 0.01 * dy; next.__offsetY(_v, true, REFLOW$1); @@ -20961,7 +20969,7 @@ } // 高度百分比需发生变化的重新布局,需要在容器内 - if (height[1] === PERCENT$8) { + if (height[1] === PERCENT$4) { if (isContainer) { parent.__layoutAbs(parent, null, next); } else { @@ -20975,7 +20983,7 @@ var _cs = container.currentStyle; - if (_cs[POSITION$2] === 'absolute' || _cs[POSITION$2] === 'relative') { + if (_cs[POSITION$3] === 'absolute' || _cs[POSITION$3] === 'relative') { break; } @@ -21005,17 +21013,17 @@ var _node = node, currentStyle = _node.currentStyle; - var isAbs = currentStyle[POSITION$2] === 'absolute'; + var isAbs = currentStyle[POSITION$3] === 'absolute'; var need = void 0; if (isAbs) { - if (currentStyle[HEIGHT$4][1] === AUTO$5 && (currentStyle[TOP$2][1] === AUTO$5 || currentStyle[BOTTOM$2][1] === AUTO$5)) { + if (currentStyle[HEIGHT$4][1] === AUTO$3 && (currentStyle[TOP$2][1] === AUTO$3 || currentStyle[BOTTOM$2][1] === AUTO$3)) { need = true; } } // height不定则需要 - else if (currentStyle[HEIGHT$4][1] === AUTO$5) { - need = true; - } + else if (currentStyle[HEIGHT$4][1] === AUTO$3) { + need = true; + } if (need) { node.__resizeY(dy, REFLOW$1); @@ -21023,8 +21031,8 @@ node.clearCache(); } // abs或者高度不需要继续向上调整提前跳出 else { - break; - } + break; + } if (node === root) { break; @@ -21082,70 +21090,70 @@ getMergeMarginTB: getMergeMarginTB }; - var _enums$STYLE_KEY$f = enums.STYLE_KEY, - POSITION$3 = _enums$STYLE_KEY$f.POSITION, - DISPLAY$6 = _enums$STYLE_KEY$f.DISPLAY, - FONT_WEIGHT$4 = _enums$STYLE_KEY$f.FONT_WEIGHT, - MARGIN_LEFT$3 = _enums$STYLE_KEY$f.MARGIN_LEFT, - MARGIN_TOP$1 = _enums$STYLE_KEY$f.MARGIN_TOP, - MARGIN_RIGHT$3 = _enums$STYLE_KEY$f.MARGIN_RIGHT, - MARGIN_BOTTOM$1 = _enums$STYLE_KEY$f.MARGIN_BOTTOM, - PADDING_LEFT$4 = _enums$STYLE_KEY$f.PADDING_LEFT, - PADDING_BOTTOM$2 = _enums$STYLE_KEY$f.PADDING_BOTTOM, - PADDING_RIGHT$3 = _enums$STYLE_KEY$f.PADDING_RIGHT, - PADDING_TOP$2 = _enums$STYLE_KEY$f.PADDING_TOP, - BORDER_TOP_WIDTH$3 = _enums$STYLE_KEY$f.BORDER_TOP_WIDTH, - BORDER_BOTTOM_WIDTH$3 = _enums$STYLE_KEY$f.BORDER_BOTTOM_WIDTH, - BORDER_RIGHT_WIDTH$4 = _enums$STYLE_KEY$f.BORDER_RIGHT_WIDTH, - BORDER_LEFT_WIDTH$5 = _enums$STYLE_KEY$f.BORDER_LEFT_WIDTH, - TOP$3 = _enums$STYLE_KEY$f.TOP, - RIGHT$1 = _enums$STYLE_KEY$f.RIGHT, - BOTTOM$3 = _enums$STYLE_KEY$f.BOTTOM, - LEFT$1 = _enums$STYLE_KEY$f.LEFT, - WIDTH$5 = _enums$STYLE_KEY$f.WIDTH, - HEIGHT$5 = _enums$STYLE_KEY$f.HEIGHT, - TEXT_ALIGN$2 = _enums$STYLE_KEY$f.TEXT_ALIGN, - FLEX_DIRECTION$2 = _enums$STYLE_KEY$f.FLEX_DIRECTION, - FLEX_BASIS$2 = _enums$STYLE_KEY$f.FLEX_BASIS, - FLEX_SHRINK$1 = _enums$STYLE_KEY$f.FLEX_SHRINK, - FLEX_GROW$1 = _enums$STYLE_KEY$f.FLEX_GROW, - ALIGN_SELF$1 = _enums$STYLE_KEY$f.ALIGN_SELF, - ALIGN_ITEMS$1 = _enums$STYLE_KEY$f.ALIGN_ITEMS, - JUSTIFY_CONTENT$1 = _enums$STYLE_KEY$f.JUSTIFY_CONTENT, - Z_INDEX$3 = _enums$STYLE_KEY$f.Z_INDEX, - WHITE_SPACE$2 = _enums$STYLE_KEY$f.WHITE_SPACE, - LINE_HEIGHT$4 = _enums$STYLE_KEY$f.LINE_HEIGHT, - LINE_CLAMP$1 = _enums$STYLE_KEY$f.LINE_CLAMP, - ORDER$1 = _enums$STYLE_KEY$f.ORDER, - FLEX_WRAP$1 = _enums$STYLE_KEY$f.FLEX_WRAP, - ALIGN_CONTENT$1 = _enums$STYLE_KEY$f.ALIGN_CONTENT, - OVERFLOW$2 = _enums$STYLE_KEY$f.OVERFLOW, - FONT_SIZE$9 = _enums$STYLE_KEY$f.FONT_SIZE, + var _enums$STYLE_KEY$a = enums.STYLE_KEY, + POSITION$2 = _enums$STYLE_KEY$a.POSITION, + DISPLAY$4 = _enums$STYLE_KEY$a.DISPLAY, + FONT_WEIGHT = _enums$STYLE_KEY$a.FONT_WEIGHT, + MARGIN_LEFT$3 = _enums$STYLE_KEY$a.MARGIN_LEFT, + MARGIN_TOP$3 = _enums$STYLE_KEY$a.MARGIN_TOP, + MARGIN_RIGHT$2 = _enums$STYLE_KEY$a.MARGIN_RIGHT, + MARGIN_BOTTOM$3 = _enums$STYLE_KEY$a.MARGIN_BOTTOM, + PADDING_LEFT$3 = _enums$STYLE_KEY$a.PADDING_LEFT, + PADDING_BOTTOM$3 = _enums$STYLE_KEY$a.PADDING_BOTTOM, + PADDING_RIGHT$2 = _enums$STYLE_KEY$a.PADDING_RIGHT, + PADDING_TOP$3 = _enums$STYLE_KEY$a.PADDING_TOP, + BORDER_TOP_WIDTH$3 = _enums$STYLE_KEY$a.BORDER_TOP_WIDTH, + BORDER_BOTTOM_WIDTH$3 = _enums$STYLE_KEY$a.BORDER_BOTTOM_WIDTH, + BORDER_RIGHT_WIDTH$2 = _enums$STYLE_KEY$a.BORDER_RIGHT_WIDTH, + BORDER_LEFT_WIDTH$3 = _enums$STYLE_KEY$a.BORDER_LEFT_WIDTH, + TOP$1 = _enums$STYLE_KEY$a.TOP, + RIGHT$1 = _enums$STYLE_KEY$a.RIGHT, + BOTTOM$1 = _enums$STYLE_KEY$a.BOTTOM, + LEFT$1 = _enums$STYLE_KEY$a.LEFT, + WIDTH$3 = _enums$STYLE_KEY$a.WIDTH, + HEIGHT$3 = _enums$STYLE_KEY$a.HEIGHT, + TEXT_ALIGN = _enums$STYLE_KEY$a.TEXT_ALIGN, + FLEX_DIRECTION = _enums$STYLE_KEY$a.FLEX_DIRECTION, + FLEX_BASIS$2 = _enums$STYLE_KEY$a.FLEX_BASIS, + FLEX_SHRINK = _enums$STYLE_KEY$a.FLEX_SHRINK, + FLEX_GROW = _enums$STYLE_KEY$a.FLEX_GROW, + ALIGN_SELF = _enums$STYLE_KEY$a.ALIGN_SELF, + ALIGN_ITEMS = _enums$STYLE_KEY$a.ALIGN_ITEMS, + JUSTIFY_CONTENT = _enums$STYLE_KEY$a.JUSTIFY_CONTENT, + Z_INDEX$1 = _enums$STYLE_KEY$a.Z_INDEX, + WHITE_SPACE = _enums$STYLE_KEY$a.WHITE_SPACE, + LINE_HEIGHT = _enums$STYLE_KEY$a.LINE_HEIGHT, + LINE_CLAMP = _enums$STYLE_KEY$a.LINE_CLAMP, + ORDER = _enums$STYLE_KEY$a.ORDER, + FLEX_WRAP = _enums$STYLE_KEY$a.FLEX_WRAP, + ALIGN_CONTENT = _enums$STYLE_KEY$a.ALIGN_CONTENT, + OVERFLOW$1 = _enums$STYLE_KEY$a.OVERFLOW, + FONT_SIZE$8 = _enums$STYLE_KEY$a.FONT_SIZE, _enums$NODE_KEY$5 = enums.NODE_KEY, - NODE_CURRENT_STYLE$2 = _enums$NODE_KEY$5.NODE_CURRENT_STYLE, - NODE_STYLE$2 = _enums$NODE_KEY$5.NODE_STYLE, + NODE_CURRENT_STYLE$4 = _enums$NODE_KEY$5.NODE_CURRENT_STYLE, + NODE_STYLE$3 = _enums$NODE_KEY$5.NODE_STYLE, NODE_STRUCT$2 = _enums$NODE_KEY$5.NODE_STRUCT, NODE_DOM_PARENT$3 = _enums$NODE_KEY$5.NODE_DOM_PARENT, - NODE_IS_INLINE$1 = _enums$NODE_KEY$5.NODE_IS_INLINE, - _enums$UPDATE_KEY$3 = enums.UPDATE_KEY, - UPDATE_NODE$3 = _enums$UPDATE_KEY$3.UPDATE_NODE, - UPDATE_FOCUS$2 = _enums$UPDATE_KEY$3.UPDATE_FOCUS, - UPDATE_ADD_DOM = _enums$UPDATE_KEY$3.UPDATE_ADD_DOM, - UPDATE_CONFIG$3 = _enums$UPDATE_KEY$3.UPDATE_CONFIG, - UPDATE_MEASURE$1 = _enums$UPDATE_KEY$3.UPDATE_MEASURE, - _enums$STRUCT_KEY$1 = enums.STRUCT_KEY, - STRUCT_NUM = _enums$STRUCT_KEY$1.STRUCT_NUM, - STRUCT_LV$1 = _enums$STRUCT_KEY$1.STRUCT_LV, - STRUCT_TOTAL = _enums$STRUCT_KEY$1.STRUCT_TOTAL, - STRUCT_CHILD_INDEX$1 = _enums$STRUCT_KEY$1.STRUCT_CHILD_INDEX, - STRUCT_INDEX$1 = _enums$STRUCT_KEY$1.STRUCT_INDEX; - var AUTO$6 = o.AUTO, - PX$8 = o.PX, - PERCENT$9 = o.PERCENT, - REM$8 = o.REM, - VW$8 = o.VW, - VH$8 = o.VH; - var calAbsolute$1 = css.calAbsolute, + NODE_IS_INLINE = _enums$NODE_KEY$5.NODE_IS_INLINE, + _enums$UPDATE_KEY$2 = enums.UPDATE_KEY, + UPDATE_NODE$2 = _enums$UPDATE_KEY$2.UPDATE_NODE, + UPDATE_FOCUS$2 = _enums$UPDATE_KEY$2.UPDATE_FOCUS, + UPDATE_ADD_DOM$1 = _enums$UPDATE_KEY$2.UPDATE_ADD_DOM, + UPDATE_CONFIG$2 = _enums$UPDATE_KEY$2.UPDATE_CONFIG, + UPDATE_MEASURE$1 = _enums$UPDATE_KEY$2.UPDATE_MEASURE, + _enums$STRUCT_KEY$2 = enums.STRUCT_KEY, + STRUCT_NUM = _enums$STRUCT_KEY$2.STRUCT_NUM, + STRUCT_LV$1 = _enums$STRUCT_KEY$2.STRUCT_LV, + STRUCT_TOTAL$2 = _enums$STRUCT_KEY$2.STRUCT_TOTAL, + STRUCT_CHILD_INDEX = _enums$STRUCT_KEY$2.STRUCT_CHILD_INDEX, + STRUCT_INDEX$1 = _enums$STRUCT_KEY$2.STRUCT_INDEX; + var AUTO$2 = o$4.AUTO, + PX$3 = o$4.PX, + PERCENT$3 = o$4.PERCENT, + REM$8 = o$4.REM, + VW$8 = o$4.VW, + VH$8 = o$4.VH; + var calAbsolute = css.calAbsolute, isRelativeOrAbsolute$1 = css.isRelativeOrAbsolute; function genZIndexChildren(dom) { @@ -21157,12 +21165,12 @@ children.forEach(function (item, i) { var child = item; - if (item instanceof Component$1) { + if (item instanceof Component) { item = item.shadowRoot; } // 遮罩单独保存后特殊排序 - if (item instanceof Xom$1 && item.isMask) { + if (item instanceof Xom && item.isMask) { // 开头的mc忽略,后续的连续mc以第一次出现为准 if (lastMaskIndex !== undefined) { mcHash[lastMaskIndex].push(item); @@ -21175,8 +21183,8 @@ } else { lastMaskIndex = undefined; - if (item instanceof Xom$1) { - child.__zIndex = item.currentStyle[Z_INDEX$3]; + if (item instanceof Xom) { + child.__zIndex = item.currentStyle[Z_INDEX$1]; if (isRelativeOrAbsolute$1(item)) { // 临时变量为排序使用 @@ -21230,12 +21238,12 @@ flowChildren.forEach(function (item, i) { var child = item; - if (item instanceof Component$1) { + if (item instanceof Component) { item = item.shadowRoot; } - if (item instanceof Xom$1) { - child.__order = item.currentStyle[ORDER$1]; + if (item instanceof Xom) { + child.__order = item.currentStyle[ORDER]; } else { child.__order = 0; } @@ -21254,7 +21262,7 @@ return normal; } - var Dom$1 = /*#__PURE__*/function (_Xom) { + var Dom = /*#__PURE__*/function (_Xom) { _inherits(Dom, _Xom); var _super = _createSuper(Dom); @@ -21284,7 +21292,7 @@ } } - if (!style[FONT_WEIGHT$4] && tag.BOLD.hasOwnProperty(tagName)) { + if (!style[FONT_WEIGHT] && tag.BOLD.hasOwnProperty(tagName)) { style.fontWeight = 700; } @@ -21295,8 +21303,8 @@ _this.__flexLine = []; // flex布局多行模式时存储行 var config = _this.__config; - config[NODE_CURRENT_STYLE$2] = _this.__currentStyle; - config[NODE_STYLE$2] = _this.__style; + config[NODE_CURRENT_STYLE$4] = _this.__currentStyle; + config[NODE_STYLE$3] = _this.__style; return _this; } @@ -21320,7 +21328,7 @@ }); var total = arr.length - 1; res[STRUCT_NUM] = zIndexChildren.length; - res[STRUCT_TOTAL] = total; + res[STRUCT_TOTAL$2] = total; return arr; } }, { @@ -21331,9 +21339,9 @@ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var __config = this.__config; var struct = __config[NODE_STRUCT$2]; - var total = struct[STRUCT_TOTAL] || 0; // 新生成了struct,引用也变了 + var total = struct[STRUCT_TOTAL$2] || 0; // 新生成了struct,引用也变了 - var nss = this.__structure(struct[STRUCT_INDEX$1], struct[STRUCT_LV$1], struct[STRUCT_CHILD_INDEX$1]); + var nss = this.__structure(struct[STRUCT_INDEX$1], struct[STRUCT_LV$1], struct[STRUCT_CHILD_INDEX]); (_root$__structs = root.__structs).splice.apply(_root$__structs, [struct[STRUCT_INDEX$1] + offset, total + 1].concat(_toConsumableArray(nss))); @@ -21341,10 +21349,10 @@ if (this !== root) { struct = __config[NODE_STRUCT$2]; - d = (struct[STRUCT_TOTAL] || 0) - total; + d = (struct[STRUCT_TOTAL$2] || 0) - total; var ps = __config[NODE_DOM_PARENT$3].__config[NODE_STRUCT$2]; - ps[STRUCT_TOTAL] = ps[STRUCT_TOTAL] || 0; - ps[STRUCT_TOTAL] += d; + ps[STRUCT_TOTAL$2] = ps[STRUCT_TOTAL$2] || 0; + ps[STRUCT_TOTAL$2] += d; } return [struct, d]; @@ -21361,7 +21369,7 @@ value: function __updateStruct(structs) { var _this$__config$NODE_S = this.__config[NODE_STRUCT$2], index = _this$__config$NODE_S[STRUCT_INDEX$1], - _this$__config$NODE_S2 = _this$__config$NODE_S[STRUCT_TOTAL], + _this$__config$NODE_S2 = _this$__config$NODE_S[STRUCT_TOTAL$2], total = _this$__config$NODE_S2 === void 0 ? 0 : _this$__config$NODE_S2; var zIndexChildren = this.__zIndexChildren = genZIndexChildren(this); var length = zIndexChildren.length; @@ -21371,7 +21379,7 @@ } zIndexChildren.forEach(function (child, i) { - child.__config[NODE_STRUCT$2][STRUCT_CHILD_INDEX$1] = i; + child.__config[NODE_STRUCT$2][STRUCT_CHILD_INDEX] = i; }); // 按直接子节点划分为相同数量的若干段进行排序 var arr = []; @@ -21381,15 +21389,15 @@ var child = structs[i]; var o = { child: child, - list: structs.slice(child[STRUCT_INDEX$1], child[STRUCT_INDEX$1] + child[STRUCT_TOTAL] + 1) + list: structs.slice(child[STRUCT_INDEX$1], child[STRUCT_INDEX$1] + child[STRUCT_TOTAL$2] + 1) }; arr.push(o); source.push(o); - i += child[STRUCT_TOTAL] || 0; + i += child[STRUCT_TOTAL$2] || 0; } arr.sort(function (a, b) { - return a.child[STRUCT_CHILD_INDEX$1] - b.child[STRUCT_CHILD_INDEX$1]; + return a.child[STRUCT_CHILD_INDEX] - b.child[STRUCT_CHILD_INDEX]; }); // 是否有变更,有才进行重新计算 var needSort; @@ -21427,24 +21435,24 @@ value: function __tryLayInline(w, total) { var flowChildren = this.flowChildren, _this$currentStyle = this.currentStyle, - display = _this$currentStyle[DISPLAY$6], - width = _this$currentStyle[WIDTH$5], + display = _this$currentStyle[DISPLAY$4], + width = _this$currentStyle[WIDTH$3], 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,并且尝试孩子第一个能放下即可,如果是文字就是第一个字符 + marginRight = _this$currentStyle[MARGIN_RIGHT$2], + paddingLeft = _this$currentStyle[PADDING_LEFT$3], + paddingRight = _this$currentStyle[PADDING_RIGHT$2], + borderLeftWidth = _this$currentStyle[BORDER_LEFT_WIDTH$3], + borderRightWidth = _this$currentStyle[BORDER_RIGHT_WIDTH$2]; // inline没w/h,并且尝试孩子第一个能放下即可,如果是文字就是第一个字符 if (display === 'inline') { if (flowChildren.length) { var first = flowChildren[0]; - if (first instanceof Component$1) { + if (first instanceof Component) { first = first.shadowRoot; } - if (first instanceof Xom$1) { + if (first instanceof Xom) { w = first.__tryLayInline(w, total); } else { w -= first.firstCharWidth; @@ -21452,103 +21460,103 @@ } } // 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 { - for (var i = 0; i < flowChildren.length; i++) { - // 当放不下时直接返回,无需继续多余的尝试计算 - if (w < 0) { - return w; - } + if (width[1] === PX$3) { + w -= width[0]; + } else if (width[1] === PERCENT$3) { + w -= total * width[0] * 0.01; + } else if (width[1] === REM$8) { + w -= width[0] * this.root.computedStyle[FONT_SIZE$8]; + } 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 { + for (var i = 0; i < flowChildren.length; i++) { + // 当放不下时直接返回,无需继续多余的尝试计算 + if (w < 0) { + return w; + } - var item = flowChildren[i]; + var item = flowChildren[i]; - if (item instanceof Component$1) { - item = item.shadowRoot; - } + if (item instanceof Component) { + item = item.shadowRoot; + } - if (item instanceof Xom$1) { - w = item.__tryLayInline(w, total); - } // text强制一行,否则非头就是放不下,需从头开始 - else { - w -= item.textWidth; - } + if (item instanceof Xom) { + w = item.__tryLayInline(w, total); + } // text强制一行,否则非头就是放不下,需从头开始 + else { + w -= item.textWidth; } - } // 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; - } - - 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; - } - - 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; - } - } // 还要减去开头的mpb - - - if (marginLeft[1] === PX$8) { + } + } // ib要减去末尾mpb + + + if (marginRight[1] === PX$3) { + w -= marginRight[0]; + } else if (marginRight[1] === PERCENT$3) { + w -= marginRight[0] * total * 0.01; + } else if (marginRight[1] === REM$8) { + w -= marginRight[0] * this.root.computedStyle[FONT_SIZE$8]; + } 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; + } + + if (paddingRight[1] === PX$3) { + w -= paddingRight[0]; + } else if (paddingRight[1] === PERCENT$3) { + w -= paddingRight[0] * total * 0.01; + } else if (paddingRight[1] === REM$8) { + w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE$8]; + } 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; + } + + if (borderRightWidth[1] === PX$3) { + w -= borderRightWidth[0]; + } else if (borderRightWidth[1] === REM$8) { + w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$8]; + } 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; + } + } // 还要减去开头的mpb + + + if (marginLeft[1] === PX$3) { w -= marginLeft[0]; - } else if (marginLeft[1] === PERCENT$9) { + } else if (marginLeft[1] === PERCENT$3) { w -= marginLeft[0] * total * 0.01; } else if (marginLeft[1] === REM$8) { - w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE$9]; + w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE$8]; } 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; } - if (paddingLeft[1] === PX$8) { + if (paddingLeft[1] === PX$3) { w -= paddingLeft[0]; - } else if (paddingLeft[1] === PERCENT$9) { + } else if (paddingLeft[1] === PERCENT$3) { w -= paddingLeft[0] * total * 0.01; } else if (paddingLeft[1] === REM$8) { - w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE$9]; + w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE$8]; } 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; } - if (borderLeftWidth[1] === PX$8) { + if (borderLeftWidth[1] === PX$3) { w -= borderLeftWidth[0]; } else if (borderLeftWidth[1] === REM$8) { - w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$9]; + w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$8]; } else if (borderLeftWidth[1] === VW$8) { w -= borderLeftWidth[0] * this.root.width * 0.01; } else if (borderLeftWidth[1] === VH$8) { @@ -21564,7 +21572,7 @@ _get(_getPrototypeOf(Dom.prototype), "__offsetX", this).call(this, diff, isLayout, lv); // 记得偏移LineBox - if (isLayout && !this.__config[NODE_IS_INLINE$1] && this.lineBoxManager) { + if (isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) { this.lineBoxManager.__offsetX(diff); } @@ -21579,7 +21587,7 @@ value: function __offsetY(diff, isLayout, lv) { _get(_getPrototypeOf(Dom.prototype), "__offsetY", this).call(this, diff, isLayout, lv); - if (isLayout && !this.__config[NODE_IS_INLINE$1] && this.lineBoxManager) { + if (isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) { this.lineBoxManager.__offsetY(diff); } @@ -21605,17 +21613,17 @@ h = data.h, lineBoxManager = data.lineBoxManager; // 计算需考虑style的属性 - var display = currentStyle[DISPLAY$6], - flexDirection = currentStyle[FLEX_DIRECTION$2], - width = currentStyle[WIDTH$5], - height = currentStyle[HEIGHT$5]; - var lineHeight = computedStyle[LINE_HEIGHT$4]; + var display = currentStyle[DISPLAY$4], + flexDirection = currentStyle[FLEX_DIRECTION], + width = currentStyle[WIDTH$3], + height = currentStyle[HEIGHT$3]; + var lineHeight = computedStyle[LINE_HEIGHT]; var main = isDirectionRow ? width : height; // 只绝对值生效,%不生效,依旧要判断 - if (main[1] === PX$8) { + if (main[1] === PX$3) { min = max = main[0]; } else if (main[1] === REM$8) { - min = max = main[0] * this.root.computedStyle[FONT_SIZE$9]; + min = max = main[0] * this.root.computedStyle[FONT_SIZE$8]; } else if (main[1] === VW$8) { min = max = main[0] * this.root.width * 0.01; } else if (main[1] === VH$8) { @@ -21625,12 +21633,12 @@ var isRow = flexDirection !== 'column'; flowChildren = genOrderChildren(flowChildren); flowChildren.forEach(function (item) { - if (item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1) { + if (item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) { var _currentStyle = item.currentStyle, _computedStyle = item.computedStyle; // flex的child如果是inline,变为block,在计算autoBasis前就要 - if (_currentStyle[DISPLAY$6] !== 'block' && _currentStyle[DISPLAY$6] !== 'flex') { - _currentStyle[DISPLAY$6] = _computedStyle[DISPLAY$6] = 'block'; + if (_currentStyle[DISPLAY$4] !== 'block' && _currentStyle[DISPLAY$4] !== 'flex') { + _currentStyle[DISPLAY$4] = _computedStyle[DISPLAY$4] = 'block'; } var _item$__calMinMax = item.__calMinMax(isDirectionRow, { @@ -21697,7 +21705,7 @@ var length = flowChildren.length; flowChildren.forEach(function (item, i) { - if (item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1) { + if (item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) { var _item$__calMinMax3 = item.__calMinMax(isDirectionRow, { x: x, y: y, @@ -21779,7 +21787,7 @@ } flowChildren.forEach(function (item) { - if (item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1) { + if (item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) { var _item$__calMinMax5 = item.__calMinMax(isDirectionRow, { x: x, y: y, @@ -21852,60 +21860,60 @@ w = data.w, h = data.h; // 计算需考虑style的属性 - var display = currentStyle[DISPLAY$6], - flexDirection = currentStyle[FLEX_DIRECTION$2], - width = currentStyle[WIDTH$5], - height = currentStyle[HEIGHT$5], + var display = currentStyle[DISPLAY$4], + flexDirection = currentStyle[FLEX_DIRECTION], + width = currentStyle[WIDTH$3], + height = currentStyle[HEIGHT$3], flexBasis = currentStyle[FLEX_BASIS$2]; - var lineHeight = computedStyle[LINE_HEIGHT$4]; + var lineHeight = computedStyle[LINE_HEIGHT]; var main = isDirectionRow ? width : height; // basis3种情况:auto、固定、content - var isAuto = flexBasis[1] === AUTO$6; - var isFixed = [PX$8, PERCENT$9, REM$8, VW$8, VH$8].indexOf(flexBasis[1]) > -1; + var isAuto = flexBasis[1] === AUTO$2; + var isFixed = [PX$3, PERCENT$3, REM$8, VW$8, VH$8].indexOf(flexBasis[1]) > -1; var isContent = !isAuto && !isFixed; var fixedSize; // flex的item固定basis计算 if (isFixed) { - if (flexBasis[1] === PX$8) { + if (flexBasis[1] === PX$3) { b = fixedSize = flexBasis[0]; - } else if (flexBasis[1] === PERCENT$9) { + } else if (flexBasis[1] === PERCENT$3) { 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]; + b = fixedSize = flexBasis[0] * this.root.computedStyle[FONT_SIZE$8]; } 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; } } // 已声明主轴尺寸的,当basis是auto时为值 - else if ([PX$8, PERCENT$9, REM$8, VW$8, VH$8].indexOf(main[1]) > -1 && isAuto) { - 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; - } - } // 非固定尺寸的basis为auto时降级为content - else if (isAuto) { - isContent = true; - } // flex的item还是flex时 + else if ([PX$3, PERCENT$3, REM$8, VW$8, VH$8].indexOf(main[1]) > -1 && isAuto) { + if (main[1] === PX$3) { + b = fixedSize = main[0]; + } else if (main[1] === PERCENT$3) { + b = fixedSize = main[0] * 0.01 * (isDirectionRow ? w : h); + } else if (main[1] === REM$8) { + b = fixedSize = main[0] * this.root.computedStyle[FONT_SIZE$8]; + } 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; + } + } // 非固定尺寸的basis为auto时降级为content + else if (isAuto) { + isContent = true; + } // flex的item还是flex时 if (display === 'flex') { var isRow = flexDirection !== 'column'; flowChildren = genOrderChildren(flowChildren); flowChildren.forEach(function (item) { - if (item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1) { + if (item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) { var _currentStyle2 = item.currentStyle, _computedStyle2 = item.computedStyle; // flex的child如果是inline,变为block,在计算autoBasis前就要 - if (_currentStyle2[DISPLAY$6] !== 'block' && _currentStyle2[DISPLAY$6] !== 'flex') { - _currentStyle2[DISPLAY$6] = _computedStyle2[DISPLAY$6] = 'block'; + if (_currentStyle2[DISPLAY$4] !== 'block' && _currentStyle2[DISPLAY$4] !== 'flex') { + _currentStyle2[DISPLAY$4] = _computedStyle2[DISPLAY$4] = 'block'; } var _item$__calMinMax7 = item.__calMinMax(isDirectionRow, { @@ -21966,87 +21974,87 @@ }); } // flex的item是block/inline时,inline也会变成block统一对待 else { - var countMin = 0, - countMax = 0; - var lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle)); - var length = flowChildren.length; - flowChildren.forEach(function (item, i) { - if (item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1) { - var _item$__calMinMax9 = item.__calMinMax(isDirectionRow, { - x: x, - y: y, - w: w, - h: h, - lineBoxManager: lineBoxManager - }), - _item$__calMinMax10 = _slicedToArray(_item$__calMinMax9, 2), - _display2 = _item$__calMinMax10[0], - _item$__calMinMax10$ = _slicedToArray(_item$__calMinMax10[1], 2), - min2 = _item$__calMinMax10$[0], - max2 = _item$__calMinMax10$[1]; // 块级查看之前是否有行内元素,设置换行 + var countMin = 0, + countMax = 0; + var lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle)); + var length = flowChildren.length; + flowChildren.forEach(function (item, i) { + if (item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) { + var _item$__calMinMax9 = item.__calMinMax(isDirectionRow, { + x: x, + y: y, + w: w, + h: h, + lineBoxManager: lineBoxManager + }), + _item$__calMinMax10 = _slicedToArray(_item$__calMinMax9, 2), + _display2 = _item$__calMinMax10[0], + _item$__calMinMax10$ = _slicedToArray(_item$__calMinMax10[1], 2), + min2 = _item$__calMinMax10$[0], + max2 = _item$__calMinMax10$[1]; // 块级查看之前是否有行内元素,设置换行 - if ((_display2 === 'block' || _display2 === 'flex') && lineBoxManager.isEnd) { - lineBoxManager.setNotEnd(); - lineBoxManager.setNewLine(); + if ((_display2 === 'block' || _display2 === 'flex') && lineBoxManager.isEnd) { + lineBoxManager.setNotEnd(); + lineBoxManager.setNewLine(); + } + + if (isDirectionRow) { + if (_display2 === 'block' || _display2 === 'flex') { + min = Math.max(min, min2); + max = Math.max(max, max2); + countMin = countMax = 0; + } else { + countMin += min2; + countMax += max2; + min = Math.max(min, countMin); + max = Math.max(max, countMax); } + } else { + if (_display2 === 'block' || _display2 === 'flex') { + // 之前行积累的极值,并清空 + min += countMin; + max += countMax; + countMin = countMax = 0; // 本身的 - if (isDirectionRow) { - if (_display2 === 'block' || _display2 === 'flex') { - min = Math.max(min, min2); - max = Math.max(max, max2); - countMin = countMax = 0; - } else { - countMin += min2; - countMax += max2; - min = Math.max(min, countMin); - max = Math.max(max, countMax); - } + min += min2; + max += max2; } else { - if (_display2 === 'block' || _display2 === 'flex') { - // 之前行积累的极值,并清空 + // 行内取极值,最后一个记得应用 + countMin = Math.max(countMin, min2); + countMax = Math.max(countMax, max2); + + if (i === length - 1) { min += countMin; max += countMax; - countMin = countMax = 0; // 本身的 - - min += min2; - max += max2; - } else { - // 行内取极值,最后一个记得应用 - countMin = Math.max(countMin, min2); - countMax = Math.max(countMax, max2); - - if (i === length - 1) { - min += countMin; - max += countMax; - } } } - } else if (isDirectionRow) { - countMin += item.charWidth; - countMax += item.textWidth; - min = Math.max(min, countMin); - max = Math.max(max, countMax); - } else { - item.__layout({ - x: x, - y: y, - w: w, - h: h, - lineBoxManager: lineBoxManager - }); // 行内取极值,最后一个记得应用 + } + } else if (isDirectionRow) { + countMin += item.charWidth; + countMax += item.textWidth; + min = Math.max(min, countMin); + max = Math.max(max, countMax); + } else { + item.__layout({ + x: x, + y: y, + w: w, + h: h, + lineBoxManager: lineBoxManager + }); // 行内取极值,最后一个记得应用 - countMin = Math.max(countMin, item.height); - countMax = Math.max(countMax, item.height); + countMin = Math.max(countMin, item.height); + countMax = Math.max(countMax, item.height); - if (i === length - 1) { - min += countMin; - max += countMax; - } + if (i === length - 1) { + min += countMin; + max += countMax; } - }); - } + } + }); + } if (fixedSize) { max = Math.max(fixedSize, max); @@ -22066,7 +22074,7 @@ var children = this.children; children.forEach(function (item) { - if (item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1) { + if (item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) { item.__layoutNone(); } }); @@ -22105,10 +22113,10 @@ return; } - var textAlign = computedStyle[TEXT_ALIGN$2], - whiteSpace = computedStyle[WHITE_SPACE$2], - lineClamp = computedStyle[LINE_CLAMP$1], - lineHeight = computedStyle[LINE_HEIGHT$4]; // 只有>=1的正整数才有效 + var textAlign = computedStyle[TEXT_ALIGN], + whiteSpace = computedStyle[WHITE_SPACE], + lineClamp = computedStyle[LINE_CLAMP], + lineHeight = computedStyle[LINE_HEIGHT]; // 只有>=1的正整数才有效 lineClamp = lineClamp || 0; var lineClampCount = 0; // 虚线管理一个block内部的LineBox列表,使得inline的元素可以中途衔接处理折行 @@ -22123,9 +22131,9 @@ mergeMarginTopList = []; var length = flowChildren.length; 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$6] === 'inline'; - var isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY$6]) > -1; + var isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom; + var isInline = isXom && item.currentStyle[DISPLAY$4] === 'inline'; + var isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY$4]) > -1; var isImg = item.tagName === 'img'; // 每次循环开始前,这次不是block的话,看之前遗留待合并margin,并重置 if (!isXom || isInline || isInlineBlock) { @@ -22167,10 +22175,10 @@ lineBoxManager.setNotEnd(); } // inline和不折行的ib,其中ib需要手动存入当前lb中 else { - (isInlineBlock || isImg) && lineBoxManager.addItem(item); - x = lineBoxManager.lastX; - y = lineBoxManager.lastY; - } // abs统计宽度 + (isInlineBlock || isImg) && lineBoxManager.addItem(item); + x = lineBoxManager.lastX; + y = lineBoxManager.lastY; + } // abs统计宽度 if (isVirtual) { @@ -22201,37 +22209,37 @@ y = lineBoxManager.lastY; } // 放不下处理之前的lineBox,并重新开头 else { - lineClampCount++; + lineClampCount++; + x = data.x; + y = lineBoxManager.endY; + lineBoxManager.setNewLine(); + lineClampCount = item.__layout({ + x: x, + y: y, + w: w, + h: h, + lx: data.x, + lineBoxManager: lineBoxManager, + lineClamp: lineClamp, + lineClampCount: lineClampCount + }, isVirtual); // 重新开头的ib和上面开头处一样逻辑 + + if (item.__isIbFull) { x = data.x; - y = lineBoxManager.endY; - lineBoxManager.setNewLine(); - lineClampCount = item.__layout({ - x: x, - y: y, - w: w, - h: h, - lx: data.x, - lineBoxManager: lineBoxManager, - lineClamp: lineClamp, - lineClampCount: lineClampCount - }, isVirtual); // 重新开头的ib和上面开头处一样逻辑 - - if (item.__isIbFull) { - x = data.x; - y += item.outerHeight; - lineBoxManager.setNotEnd(); - } // inline和不折行的ib,其中ib需要手动存入当前lb中 - else { - (isInlineBlock || isImg) && lineBoxManager.addItem(item); - x = lineBoxManager.lastX; - y = lineBoxManager.lastY; - } + y += item.outerHeight; + lineBoxManager.setNotEnd(); + } // inline和不折行的ib,其中ib需要手动存入当前lb中 + else { + (isInlineBlock || isImg) && lineBoxManager.addItem(item); + x = lineBoxManager.lastX; + y = lineBoxManager.lastY; + } - if (isVirtual) { - maxW = Math.max(maxW, cw); - cw = 0; - } + if (isVirtual) { + maxW = Math.max(maxW, cw); + cw = 0; } + } if (isVirtual) { cw += item.outerWidth; @@ -22240,95 +22248,137 @@ } } // block/flex先处理之前可能遗留的最后一行LineBox,然后递归时不传lineBoxManager,其内部生成新的 else { - // 非开头,说明之前的text未换行,需要增加行数 - if (x !== data.x && flowChildren[i - 1] instanceof Text) { - lineClampCount++; - } - - x = data.x; - - if (lineBoxManager.isEnd) { - y = lineBoxManager.endY; - lineBoxManager.setNotEnd(); - lineBoxManager.setNewLine(); - } - - item.__layout({ - x: x, - y: y, - w: w, - h: h - }, isVirtual); - - var isNone = item.currentStyle[DISPLAY$6] === 'none'; // 自身无内容 + // 非开头,说明之前的text未换行,需要增加行数 + if (x !== data.x && flowChildren[i - 1] instanceof Text) { + lineClampCount++; + } - var isEmptyBlock; + x = data.x; - if (!isNone && item.flowChildren && item.flowChildren.length === 0) { - var _item$computedStyle = item.computedStyle, - marginTop = _item$computedStyle[MARGIN_TOP$1], - marginBottom = _item$computedStyle[MARGIN_BOTTOM$1], - paddingTop = _item$computedStyle[PADDING_TOP$2], - paddingBottom = _item$computedStyle[PADDING_BOTTOM$2], - height = _item$computedStyle[HEIGHT$5], - borderTopWidth = _item$computedStyle[BORDER_TOP_WIDTH$3], - borderBottomWidth = _item$computedStyle[BORDER_BOTTOM_WIDTH$3]; // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理 + if (lineBoxManager.isEnd) { + y = lineBoxManager.endY; + lineBoxManager.setNotEnd(); + lineBoxManager.setNewLine(); + } - if (paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) { - mergeMarginBottomList.push(marginBottom); - mergeMarginTopList.push(marginTop); - isEmptyBlock = true; - } + item.__layout({ + x: x, + y: y, + w: w, + h: h + }, isVirtual); + + var isNone = item.currentStyle[DISPLAY$4] === 'none'; // 自身无内容 + + var isEmptyBlock; + + if (!isNone && item.flowChildren && item.flowChildren.length === 0) { + var _item$computedStyle = item.computedStyle, + marginTop = _item$computedStyle[MARGIN_TOP$3], + marginBottom = _item$computedStyle[MARGIN_BOTTOM$3], + paddingTop = _item$computedStyle[PADDING_TOP$3], + paddingBottom = _item$computedStyle[PADDING_BOTTOM$3], + height = _item$computedStyle[HEIGHT$3], + borderTopWidth = _item$computedStyle[BORDER_TOP_WIDTH$3], + borderBottomWidth = _item$computedStyle[BORDER_BOTTOM_WIDTH$3]; // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理 + + if (paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) { + mergeMarginBottomList.push(marginBottom); + mergeMarginTopList.push(marginTop); + isEmptyBlock = true; } + } - y += item.outerHeight; - lineBoxManager.__lastY = y; // absolute/flex前置虚拟计算 + y += item.outerHeight; + lineBoxManager.__lastY = y; // absolute/flex前置虚拟计算 - if (isVirtual) { - maxW = Math.max(maxW, item.outerWidth); - cw = 0; - } // 空block要留下轮循环看,除非是最后一个,此处非空本轮处理掉看是否要合并 + if (isVirtual) { + maxW = Math.max(maxW, item.outerWidth); + cw = 0; + } // 空block要留下轮循环看,除非是最后一个,此处非空本轮处理掉看是否要合并 - if (!isNone && !isEmptyBlock) { - var _item$computedStyle2 = item.computedStyle, - _marginTop = _item$computedStyle2[MARGIN_TOP$1], - _marginBottom = _item$computedStyle2[MARGIN_BOTTOM$1]; // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top - // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并 + if (!isNone && !isEmptyBlock) { + var _item$computedStyle2 = item.computedStyle, + _marginTop = _item$computedStyle2[MARGIN_TOP$3], + _marginBottom = _item$computedStyle2[MARGIN_BOTTOM$3]; // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top + // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并 - if (mergeMarginBottomList.length) { - mergeMarginTopList.push(_marginTop); + if (mergeMarginBottomList.length) { + mergeMarginTopList.push(_marginTop); - var _diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); + var _diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); - if (_diff) { - item.__offsetY(_diff, true); + if (_diff) { + item.__offsetY(_diff, true); - y += _diff; - } - } // 同时自己保存bottom,为后续block准备 + y += _diff; + } + } // 同时自己保存bottom,为后续block准备 - mergeMarginTopList = []; - mergeMarginBottomList = [_marginBottom]; - } // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0 - else if (i === length - 1) { - var _diff2 = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); + mergeMarginTopList = []; + mergeMarginBottomList = [_marginBottom]; + } // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0 + else if (i === length - 1) { + var _diff2 = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); - if (_diff2) { - y += _diff2; - } - } + if (_diff2) { + y += _diff2; + } } + } } // 文字和inline类似 else { - // lineClamp作用域为block下的inline(同LineBox上下文) - if (lineClamp && lineClampCount >= lineClamp) { - return; - } // x开头,不用考虑是否放得下直接放 + // lineClamp作用域为block下的inline(同LineBox上下文) + if (lineClamp && lineClampCount >= lineClamp) { + return; + } // x开头,不用考虑是否放得下直接放 - if (x === data.x || whiteSpace === 'nowrap') { + if (x === data.x || whiteSpace === 'nowrap') { + lineClampCount = item.__layout({ + x: x, + y: y, + w: w, + h: h, + lx: data.x, + lineBoxManager: lineBoxManager, + lineClamp: lineClamp, + lineClampCount: lineClampCount + }, isVirtual); + x = lineBoxManager.lastX; + y = lineBoxManager.lastY; + + if (isVirtual) { + maxW = Math.max(maxW, cw); + cw = item.width; + maxW = Math.max(maxW, cw); + } + } else { + // 非开头先尝试是否放得下 + var _fw = item.__tryLayInline(w - x + data.x); // 放得下继续 + + + if (_fw >= -1e-10) { + lineClampCount = item.__layout({ + x: x, + y: y, + w: w, + h: h, + lx: data.x, + lineBoxManager: lineBoxManager, + lineClamp: lineClamp, + lineClampCount: lineClampCount + }, isVirtual); + x = lineBoxManager.lastX; + y = lineBoxManager.lastY; + } // 放不下处理之前的lineBox,并重新开头 + else { + lineClampCount++; + x = data.x; + y = lineBoxManager.endY; + lineBoxManager.setNewLine(); lineClampCount = item.__layout({ x: x, y: y, @@ -22343,59 +22393,17 @@ y = lineBoxManager.lastY; if (isVirtual) { - maxW = Math.max(maxW, cw); - cw = item.width; - maxW = Math.max(maxW, cw); + maxW = Math.max(maxW, item.width); + cw = 0; } - } else { - // 非开头先尝试是否放得下 - var _fw = item.__tryLayInline(w - x + data.x); // 放得下继续 - - - if (_fw >= -1e-10) { - lineClampCount = item.__layout({ - x: x, - y: y, - w: w, - h: h, - lx: data.x, - lineBoxManager: lineBoxManager, - lineClamp: lineClamp, - lineClampCount: lineClampCount - }, isVirtual); - x = lineBoxManager.lastX; - y = lineBoxManager.lastY; - } // 放不下处理之前的lineBox,并重新开头 - else { - lineClampCount++; - x = data.x; - y = lineBoxManager.endY; - lineBoxManager.setNewLine(); - lineClampCount = item.__layout({ - x: x, - y: y, - w: w, - h: h, - lx: data.x, - lineBoxManager: lineBoxManager, - lineClamp: lineClamp, - lineClampCount: lineClampCount - }, isVirtual); - x = lineBoxManager.lastX; - y = lineBoxManager.lastY; - - if (isVirtual) { - maxW = Math.max(maxW, item.width); - cw = 0; - } - } + } - if (isVirtual) { - cw += item.width; - maxW = Math.max(maxW, cw); - } + if (isVirtual) { + cw += item.width; + maxW = Math.max(maxW, cw); } } + } }); // 结束后如果是以LineBox结尾,则需要设置y到这里,否则流布局中block会设置 // 当以block换行时,新行是true,否则是false即结尾 @@ -22416,7 +22424,7 @@ lineBoxManager.horizonAlign(tw, textAlign); // 直接text需计算size flowChildren.forEach(function (item) { - if (item instanceof Component$1) { + if (item instanceof Component) { item = item.shadowRoot; } @@ -22464,14 +22472,14 @@ __flexLine.splice(0); - var flexDirection = computedStyle[FLEX_DIRECTION$2], - justifyContent = computedStyle[JUSTIFY_CONTENT$1], - alignItems = computedStyle[ALIGN_ITEMS$1], - lineClamp = computedStyle[LINE_CLAMP$1], - flexWrap = computedStyle[FLEX_WRAP$1], - alignContent = computedStyle[ALIGN_CONTENT$1], - lineHeight = computedStyle[LINE_HEIGHT$4], - textAlign = computedStyle[TEXT_ALIGN$2]; // 只有>=1的正整数才有效 + var flexDirection = computedStyle[FLEX_DIRECTION], + justifyContent = computedStyle[JUSTIFY_CONTENT], + alignItems = computedStyle[ALIGN_ITEMS], + lineClamp = computedStyle[LINE_CLAMP], + flexWrap = computedStyle[FLEX_WRAP], + alignContent = computedStyle[ALIGN_CONTENT], + lineHeight = computedStyle[LINE_HEIGHT], + textAlign = computedStyle[TEXT_ALIGN]; // 只有>=1的正整数才有效 lineClamp = lineClamp || 0; var lineClampCount = 0; @@ -22485,12 +22493,12 @@ var minList = []; var orderChildren = genOrderChildren(flowChildren); orderChildren.forEach(function (item) { - if (item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1) { + if (item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) { var _currentStyle3 = item.currentStyle, _computedStyle3 = item.computedStyle; // flex的child如果是inline,变为block,在计算autoBasis前就要 - if (_currentStyle3[DISPLAY$6] !== 'block' && _currentStyle3[DISPLAY$6] !== 'flex') { - _currentStyle3[DISPLAY$6] = _computedStyle3[DISPLAY$6] = 'block'; + if (_currentStyle3[DISPLAY$4] !== 'block' && _currentStyle3[DISPLAY$4] !== 'flex') { + _currentStyle3[DISPLAY$4] = _computedStyle3[DISPLAY$4] = 'block'; } // abs虚拟布局计算时纵向也是看横向宽度 @@ -22515,8 +22523,8 @@ return; } - var flexGrow = _currentStyle3[FLEX_GROW$1], - flexShrink = _currentStyle3[FLEX_SHRINK$1]; + var flexGrow = _currentStyle3[FLEX_GROW], + flexShrink = _currentStyle3[FLEX_SHRINK]; _computedStyle3[FLEX_BASIS$2] = b; growList.push(flexGrow); shrinkList.push(flexShrink); // 根据basis不同,计算方式不同 @@ -22526,43 +22534,43 @@ minList.push(min); } // 文本 else { - if (isVirtual) { - if (isDirectionRow) { - maxX += item.textWidth; - } else { - maxX = Math.max(maxX, item.textWidth); - } - - return; + if (isVirtual) { + if (isDirectionRow) { + maxX += item.textWidth; + } else { + maxX = Math.max(maxX, item.textWidth); } - growList.push(0); - shrinkList.push(1); + return; + } - if (isDirectionRow) { - var cw = item.charWidth; - var _tw = item.textWidth; - basisList.push(_tw); - maxList.push(_tw); - minList.push(cw); - } else { - var lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle)); + growList.push(0); + shrinkList.push(1); - item.__layout({ - x: x, - y: y, - w: w, - h: _h, - lineBoxManager: lineBoxManager, - lineClamp: lineClamp, - lineClampCount: lineClampCount - }); + if (isDirectionRow) { + var cw = item.charWidth; + var _tw = item.textWidth; + basisList.push(_tw); + maxList.push(_tw); + minList.push(cw); + } else { + var lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle)); - var _h = item.height; - basisList.push(_h); - minList.push(_h); - } + item.__layout({ + x: x, + y: y, + w: w, + h: _h, + lineBoxManager: lineBoxManager, + lineClamp: lineClamp, + lineClampCount: lineClampCount + }); + + var _h = item.height; + basisList.push(_h); + minList.push(_h); } + } }); // abs时,只需关注宽度即可,无需真正布局 if (isVirtual) { @@ -22781,20 +22789,20 @@ }); } // 默认stretch else { - per = diff / length; // 除了第1行其它进行偏移 + per = diff / length; // 除了第1行其它进行偏移 - __flexLine.forEach(function (item, i) { - if (i) { - item.forEach(function (item) { - if (isDirectionRow) { - item.__offsetY(per * i, true); - } else { - item.__offsetX(per * i, true); - } - }); - } - }); - } + __flexLine.forEach(function (item, i) { + if (i) { + item.forEach(function (item) { + if (isDirectionRow) { + item.__offsetY(per * i, true); + } else { + item.__offsetX(per * i, true); + } + }); + } + }); + } } } // 每行再进行cross对齐,在alignContent为stretch时计算每行的高度 @@ -22922,9 +22930,9 @@ free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸 } // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算 else { - targetMainList[i] = n; - factorSum2 += item; - } + targetMainList[i] = n; + factorSum2 += item; + } } }); @@ -22966,9 +22974,9 @@ free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸 } // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算 else { - targetMainList[i] = n; - factorSum2 += item; - } + targetMainList[i] = n; + factorSum2 += item; + } } }); @@ -22986,7 +22994,7 @@ orderChildren.forEach(function (item, i) { var main = targetMainList[i]; - if (item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1) { + if (item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) { if (isDirectionRow) { item.__layout({ x: x, @@ -23088,7 +23096,7 @@ baseLine = Math.max(baseLine, item.firstBaseLine); }); line.forEach(function (item) { - var alignSelf = item.currentStyle[ALIGN_SELF$1]; + var alignSelf = item.currentStyle[ALIGN_SELF]; if (isDirectionRow) { if (alignSelf === 'flexStart' || alignSelf === 'flex-start') ; else if (alignSelf === 'flexEnd' || alignSelf === 'flex-end') { @@ -23105,17 +23113,17 @@ } } else if (alignSelf === 'stretch') { var computedStyle = item.computedStyle, - height = item.currentStyle[HEIGHT$5]; + height = item.currentStyle[HEIGHT$3]; var borderTopWidth = computedStyle[BORDER_TOP_WIDTH$3], borderBottomWidth = computedStyle[BORDER_BOTTOM_WIDTH$3], - marginTop = computedStyle[MARGIN_TOP$1], - marginBottom = computedStyle[MARGIN_BOTTOM$1], - paddingTop = computedStyle[PADDING_TOP$2], - paddingBottom = computedStyle[PADDING_BOTTOM$2]; + marginTop = computedStyle[MARGIN_TOP$3], + marginBottom = computedStyle[MARGIN_BOTTOM$3], + paddingTop = computedStyle[PADDING_TOP$3], + paddingBottom = computedStyle[PADDING_BOTTOM$3]; - if (height[1] === AUTO$6) { + if (height[1] === AUTO$2) { var old = item.height; - var v = item.__height = computedStyle[HEIGHT$5] = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth; + var v = item.__height = computedStyle[HEIGHT$3] = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth; var d = v - old; item.__sy4 += d; item.__sy5 += d; @@ -23133,156 +23141,156 @@ } } // 默认auto,取alignItems else { - if (alignItems === 'flexStart' || alignSelf === 'flex-start') ; else if (alignItems === 'center') { - var _diff5 = maxCross - item.outerHeight; + if (alignItems === 'flexStart' || alignSelf === 'flex-start') ; else if (alignItems === 'center') { + var _diff5 = maxCross - item.outerHeight; - if (_diff5 !== 0) { - item.__offsetY(_diff5 * 0.5, true); - } - } else if (alignItems === 'flexEnd' || alignItems === 'flex-end') { - var _diff6 = maxCross - item.outerHeight; + if (_diff5 !== 0) { + item.__offsetY(_diff5 * 0.5, true); + } + } else if (alignItems === 'flexEnd' || alignItems === 'flex-end') { + var _diff6 = maxCross - item.outerHeight; - if (_diff6 !== 0) { - item.__offsetY(_diff6, true); - } - } else if (alignItems === 'baseline') { - var _diff7 = baseLine - item.firstBaseLine; + if (_diff6 !== 0) { + item.__offsetY(_diff6, true); + } + } else if (alignItems === 'baseline') { + var _diff7 = baseLine - item.firstBaseLine; - if (_diff7 !== 0) { - item.__offsetY(_diff7, true); - } - } // 默认stretch - else { - var _computedStyle4 = item.computedStyle, - _item$currentStyle = item.currentStyle, - display = _item$currentStyle[DISPLAY$6], - flexDirection = _item$currentStyle[FLEX_DIRECTION$2], - _height = _item$currentStyle[HEIGHT$5]; // row的孩子还是flex且column且不定高时,如果高度<侧轴拉伸高度则重新布局 - - if (isDirectionRow && display === 'flex' && flexDirection === 'column' && _height[1] === AUTO$6 && item.outerHeight < maxCross) { - item.__layout(Object.assign(item.__layoutData, { - h3: maxCross - })); - } + if (_diff7 !== 0) { + item.__offsetY(_diff7, true); + } + } // 默认stretch + else { + var _computedStyle4 = item.computedStyle, + _item$currentStyle = item.currentStyle, + display = _item$currentStyle[DISPLAY$4], + flexDirection = _item$currentStyle[FLEX_DIRECTION], + _height = _item$currentStyle[HEIGHT$3]; // row的孩子还是flex且column且不定高时,如果高度<侧轴拉伸高度则重新布局 + + if (isDirectionRow && display === 'flex' && flexDirection === 'column' && _height[1] === AUTO$2 && item.outerHeight < maxCross) { + item.__layout(Object.assign(item.__layoutData, { + h3: maxCross + })); + } - var _borderTopWidth = _computedStyle4[BORDER_TOP_WIDTH$3], - _borderBottomWidth = _computedStyle4[BORDER_BOTTOM_WIDTH$3], - _marginTop2 = _computedStyle4[MARGIN_TOP$1], - _marginBottom2 = _computedStyle4[MARGIN_BOTTOM$1], - _paddingTop = _computedStyle4[PADDING_TOP$2], - _paddingBottom = _computedStyle4[PADDING_BOTTOM$2]; + var _borderTopWidth = _computedStyle4[BORDER_TOP_WIDTH$3], + _borderBottomWidth = _computedStyle4[BORDER_BOTTOM_WIDTH$3], + _marginTop2 = _computedStyle4[MARGIN_TOP$3], + _marginBottom2 = _computedStyle4[MARGIN_BOTTOM$3], + _paddingTop = _computedStyle4[PADDING_TOP$3], + _paddingBottom = _computedStyle4[PADDING_BOTTOM$3]; - if (_height[1] === AUTO$6) { - var _old = item.height; + if (_height[1] === AUTO$2) { + var _old = item.height; - var _v = maxCross - _marginTop2 - _marginBottom2 - _paddingTop - _paddingBottom - _borderTopWidth - _borderBottomWidth; + var _v = maxCross - _marginTop2 - _marginBottom2 - _paddingTop - _paddingBottom - _borderTopWidth - _borderBottomWidth; - var _d = _v - _old; + var _d = _v - _old; - item.__sy4 += _d; - item.__sy5 += _d; - item.__sy6 += _d; - item.__height += _d; - item.__clientHeight += _d; - item.__offsetHeight += _d; - item.__outerHeight += _d; - } - } + item.__sy4 += _d; + item.__sy5 += _d; + item.__sy6 += _d; + item.__height += _d; + item.__clientHeight += _d; + item.__offsetHeight += _d; + item.__outerHeight += _d; + } } + } } // column else { - if (alignSelf === 'flexStart' || alignSelf === 'flex-start') ; else if (alignSelf === 'flexEnd' || alignSelf === 'flex-end') { - var _diff8 = maxCross - item.outerWidth; + if (alignSelf === 'flexStart' || alignSelf === 'flex-start') ; else if (alignSelf === 'flexEnd' || alignSelf === 'flex-end') { + var _diff8 = maxCross - item.outerWidth; - if (_diff8 !== 0) { - item.__offsetX(_diff8, true); - } - } else if (alignSelf === 'center') { - var _diff9 = maxCross - item.outerWidth; + if (_diff8 !== 0) { + item.__offsetX(_diff8, true); + } + } else if (alignSelf === 'center') { + var _diff9 = maxCross - item.outerWidth; + + if (_diff9 !== 0) { + item.__offsetX(_diff9 * 0.5, true); + } + } else if (alignSelf === 'stretch') { + var _computedStyle5 = item.computedStyle, + width = item.currentStyle[WIDTH$3]; + var borderRightWidth = _computedStyle5[BORDER_RIGHT_WIDTH$2], + borderLeftWidth = _computedStyle5[BORDER_LEFT_WIDTH$3], + marginRight = _computedStyle5[MARGIN_RIGHT$2], + marginLeft = _computedStyle5[MARGIN_LEFT$3], + paddingRight = _computedStyle5[PADDING_RIGHT$2], + paddingLeft = _computedStyle5[PADDING_LEFT$3]; + + if (width[1] === AUTO$2) { + var _old2 = item.width; + + var _v2 = item.__width = _computedStyle5[WIDTH$3] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth; + + var _d2 = _v2 - _old2; + + item.__sx4 += _d2; + item.__sx5 += _d2; + item.__sx6 += _d2; + item.__width += _d2; + item.__clientWidth += _d2; + item.__offsetWidth += _d2; + item.__outerWidth += _d2; + } + } else if (alignItems === 'baseline') { + var _diff10 = baseLine - item.firstBaseLine; - if (_diff9 !== 0) { - item.__offsetX(_diff9 * 0.5, true); + if (_diff10 !== 0) { + item.__offsetX(_diff10, true); + } + } // 默认auto,取alignItems + else { + if (alignItems === 'flexStart' || alignSelf === 'flex-start') ; else if (alignItems === 'center') { + var _diff11 = maxCross - item.outerWidth; + + if (_diff11 !== 0) { + item.__offsetX(_diff11 * 0.5, true); } - } else if (alignSelf === 'stretch') { - var _computedStyle5 = item.computedStyle, - width = item.currentStyle[WIDTH$5]; - var borderRightWidth = _computedStyle5[BORDER_RIGHT_WIDTH$4], - borderLeftWidth = _computedStyle5[BORDER_LEFT_WIDTH$5], - marginRight = _computedStyle5[MARGIN_RIGHT$3], - marginLeft = _computedStyle5[MARGIN_LEFT$3], - paddingRight = _computedStyle5[PADDING_RIGHT$3], - paddingLeft = _computedStyle5[PADDING_LEFT$4]; - - if (width[1] === AUTO$6) { - var _old2 = item.width; - - var _v2 = item.__width = _computedStyle5[WIDTH$5] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth; - - var _d2 = _v2 - _old2; - - item.__sx4 += _d2; - item.__sx5 += _d2; - item.__sx6 += _d2; - item.__width += _d2; - item.__clientWidth += _d2; - item.__offsetWidth += _d2; - item.__outerWidth += _d2; + } else if (alignItems === 'flexEnd' || alignItems === 'flex-end') { + var _diff12 = maxCross - item.outerWidth; + + if (_diff12 !== 0) { + item.__offsetX(_diff12, true); } } else if (alignItems === 'baseline') { - var _diff10 = baseLine - item.firstBaseLine; + var _diff13 = baseLine - item.firstBaseLine; - if (_diff10 !== 0) { - item.__offsetX(_diff10, true); + if (_diff13 !== 0) { + item.__offsetX(_diff13, true); } - } // 默认auto,取alignItems + } // 默认stretch else { - if (alignItems === 'flexStart' || alignSelf === 'flex-start') ; else if (alignItems === 'center') { - var _diff11 = maxCross - item.outerWidth; - - if (_diff11 !== 0) { - item.__offsetX(_diff11 * 0.5, true); - } - } else if (alignItems === 'flexEnd' || alignItems === 'flex-end') { - var _diff12 = maxCross - item.outerWidth; - - if (_diff12 !== 0) { - item.__offsetX(_diff12, true); - } - } else if (alignItems === 'baseline') { - var _diff13 = baseLine - item.firstBaseLine; - - if (_diff13 !== 0) { - item.__offsetX(_diff13, true); - } - } // 默认stretch - else { - var _computedStyle6 = item.computedStyle, - _width = item.currentStyle[WIDTH$5]; - var _borderRightWidth = _computedStyle6[BORDER_RIGHT_WIDTH$4], - _borderLeftWidth = _computedStyle6[BORDER_LEFT_WIDTH$5], - _marginRight = _computedStyle6[MARGIN_RIGHT$3], - _marginLeft = _computedStyle6[MARGIN_LEFT$3], - _paddingRight = _computedStyle6[PADDING_RIGHT$3], - _paddingLeft = _computedStyle6[PADDING_LEFT$4]; - - if (_width[1] === AUTO$6) { - var _old3 = item.width; - - var _v3 = item.__width = _computedStyle6[WIDTH$5] = maxCross - _marginLeft - _marginRight - _paddingLeft - _paddingRight - _borderRightWidth - _borderLeftWidth; - - var _d3 = _v3 - _old3; - - item.__sx4 += _d3; - item.__sx5 += _d3; - item.__sx6 += _d3; - item.__width += _d3; - item.__clientWidth += _d3; - item.__offsetWidth += _d3; - item.__outerWidth += _d3; - } - } + var _computedStyle6 = item.computedStyle, + _width = item.currentStyle[WIDTH$3]; + var _borderRightWidth = _computedStyle6[BORDER_RIGHT_WIDTH$2], + _borderLeftWidth = _computedStyle6[BORDER_LEFT_WIDTH$3], + _marginRight = _computedStyle6[MARGIN_RIGHT$2], + _marginLeft = _computedStyle6[MARGIN_LEFT$3], + _paddingRight = _computedStyle6[PADDING_RIGHT$2], + _paddingLeft = _computedStyle6[PADDING_LEFT$3]; + + if (_width[1] === AUTO$2) { + var _old3 = item.width; + + var _v3 = item.__width = _computedStyle6[WIDTH$3] = maxCross - _marginLeft - _marginRight - _paddingLeft - _paddingRight - _borderRightWidth - _borderLeftWidth; + + var _d3 = _v3 - _old3; + + item.__sx4 += _d3; + item.__sx5 += _d3; + item.__sx6 += _d3; + item.__width += _d3; + item.__clientWidth += _d3; + item.__offsetWidth += _d3; + item.__outerWidth += _d3; } + } } + } }); } /** @@ -23328,17 +23336,17 @@ return; } - var width = currentStyle[WIDTH$5]; - var textAlign = computedStyle[TEXT_ALIGN$2], - whiteSpace = computedStyle[WHITE_SPACE$2], - lineClamp = computedStyle[LINE_CLAMP$1], - lineHeight = computedStyle[LINE_HEIGHT$4], + var width = currentStyle[WIDTH$3]; + var textAlign = computedStyle[TEXT_ALIGN], + whiteSpace = computedStyle[WHITE_SPACE], + lineClamp = computedStyle[LINE_CLAMP], + lineHeight = computedStyle[LINE_HEIGHT], 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]; + marginRight = computedStyle[MARGIN_RIGHT$2], + borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$3], + borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$2], + paddingLeft = computedStyle[PADDING_LEFT$3], + paddingRight = computedStyle[PADDING_RIGHT$2]; var lineClampCount = data.lineClampCount || 0; if (isInline && !this.__isRealInline()) { @@ -23348,7 +23356,7 @@ if (isInline) { - this.__config[NODE_IS_INLINE$1] = true; + this.__config[NODE_IS_INLINE] = true; this.__lineBoxManager = lineBoxManager; var baseLine = css.getBaseLine(computedStyle); // 特殊inline调用,有内容的话(如左右mbp),默认生成一个lineBox,即便是空,也要形成占位,只有开头时需要 @@ -23369,11 +23377,8 @@ endSpace = selfEndSpace = lineClampCount = 0; } // 存LineBox里的内容列表专用,布局过程中由lineBoxManager存入,递归情况每个inline节点都保存contentBox - - var contentBoxList; - if (isInline) { - contentBoxList = this.__contentBoxList = []; + this.__contentBoxList = []; lineBoxManager.pushContentBoxList(this); } @@ -23381,9 +23386,9 @@ var length = flowChildren.length; flowChildren.forEach(function (item, i) { - var isXom = item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1; - var isInline2 = isXom && item.currentStyle[DISPLAY$6] === 'inline'; - var isInlineBlock2 = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY$6]) > -1; + var isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom; + var isInline2 = isXom && item.currentStyle[DISPLAY$4] === 'inline'; + var isInlineBlock2 = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY$4]) > -1; var isRealInline = isXom && item.__isRealInline(); // 最后一个元素会产生最后一行,叠加父元素的尾部mpb @@ -23396,7 +23401,7 @@ if (isXom) { if (!isInline2 && !isInlineBlock2) { - item.currentStyle[DISPLAY$6] = item.computedStyle[DISPLAY$6] = 'inlineBlock'; + item.currentStyle[DISPLAY$4] = item.computedStyle[DISPLAY$4] = 'inlineBlock'; isInlineBlock2 = true; inject.warn('Inline can not contain block/flex'); } // x开头,不用考虑是否放得下直接放,i为0强制不换行 @@ -23415,76 +23420,129 @@ lineClampCount: lineClampCount }, isVirtual); // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样 - if (item.__isIbFull) { - isInlineBlock2 && w[1] === AUTO$6 && (isIbFull = true); - lineBoxManager.addItem(item); - x = lx; - y += item.outerHeight; - lineBoxManager.setNotEnd(); - } // inline和不折行的ib,其中ib需要手动存入当前lb中,以计算宽度 - else { - (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item); - x = lineBoxManager.lastX; - y = lineBoxManager.lastY; - } + if (item.__isIbFull) { + isInlineBlock2 && w[1] === AUTO$2 && (isIbFull = true); + lineBoxManager.addItem(item); + x = lx; + y += item.outerHeight; + lineBoxManager.setNotEnd(); + } // inline和不折行的ib,其中ib需要手动存入当前lb中,以计算宽度 + else { + (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item); + x = lineBoxManager.lastX; + y = lineBoxManager.lastY; + } + } else { + // 不换行继续排,换行非开头先尝试是否放得下,结尾要考虑mpb因此减去endSpace + var fw = whiteSpace === 'nowrap' ? 0 : item.__tryLayInline(w - x + lx, w - (isEnd ? endSpace : 0)); // 放得下继续 + + if (fw >= -1e-10) { + lineClampCount = item.__layout({ + x: x, + y: y, + w: w, + h: h, + lx: lx, + nowrap: whiteSpace === 'nowrap', + lineBoxManager: lineBoxManager, + endSpace: endSpace, + lineClamp: lineClamp, + lineClampCount: lineClampCount + }, isVirtual); // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb + + (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item); + x = lineBoxManager.lastX; + y = lineBoxManager.lastY; + } // 放不下处理之前的lineBox,并重新开头 + else { + isInline2 && lineClampCount++; + x = lx; + y = lineBoxManager.endY; + lineBoxManager.setNewLine(); + lineClampCount = item.__layout({ + x: x, + y: y, + w: w, + h: h, + lx: lx, + lineBoxManager: lineBoxManager, + endSpace: endSpace, + lineClamp: lineClamp, + lineClampCount: lineClampCount + }, isVirtual); // 重新开头的ib和上面开头处一样逻辑 + + if (item.__isIbFull) { + lineBoxManager.addItem(item); + x = lx; + y += item.outerHeight; + lineBoxManager.setNotEnd(); + } // inline和不折行的ib,其中ib需要手动存入当前lb中 + else { + (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item); + x = lineBoxManager.lastX; + y = lineBoxManager.lastY; + } + } + } + } // inline里的其它只有文本,可能开始紧跟着之前的x,也可能换行后从lx行头开始 + // 紧跟着x可能出现在前面有节点换行后第2行,此时不一定放得下,因此不能作为判断依据,开头仅有lx + else { + var n = lineBoxManager.size; // i为0时强制不换行 + + if (x === lx || !i || whiteSpace === 'nowrap') { + lineClampCount = item.__layout({ + x: x, + y: y, + w: w, + h: h, + lx: lx, + lineBoxManager: lineBoxManager, + endSpace: endSpace, + lineClamp: lineClamp, + lineClampCount: lineClampCount + }, isVirtual); + x = lineBoxManager.lastX; + y = lineBoxManager.lastY; // ib情况发生折行,且非定宽 + + if (!isInline && lineBoxManager.size - n > 1 && width[1] === AUTO$2) { + isIbFull = true; + } } else { - // 不换行继续排,换行非开头先尝试是否放得下,结尾要考虑mpb因此减去endSpace - var fw = whiteSpace === 'nowrap' ? 0 : item.__tryLayInline(w - x + lx, w - (isEnd ? endSpace : 0)); // 放得下继续 + // 非开头先尝试是否放得下,如果放得下再看是否end,加end且只有1个字时放不下要换行,否则可以放,换行由text内部做 + // 第一个Text且父元素声明了nowrap也强制不换行,非第一个则看本身whiteSpace声明 + var focusNoWrap = !i && nowrap || whiteSpace === 'nowrap'; - if (fw >= -1e-10) { + 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; + } + } // 放得下继续 + + + if (_fw2 >= -1e-10) { lineClampCount = item.__layout({ x: x, y: y, w: w, h: h, lx: lx, - nowrap: whiteSpace === 'nowrap', lineBoxManager: lineBoxManager, endSpace: endSpace, lineClamp: lineClamp, lineClampCount: lineClampCount - }, isVirtual); // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb - - (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item); + }, isVirtual); x = lineBoxManager.lastX; - y = lineBoxManager.lastY; + y = lineBoxManager.lastY; // 这里ib放得下一定是要么没换行要么固定宽度,所以无需判断isIbFull } // 放不下处理之前的lineBox,并重新开头 else { - isInline2 && lineClampCount++; - x = lx; - y = lineBoxManager.endY; - lineBoxManager.setNewLine(); - lineClampCount = item.__layout({ - x: x, - y: y, - w: w, - h: h, - lx: lx, - lineBoxManager: lineBoxManager, - endSpace: endSpace, - lineClamp: lineClamp, - lineClampCount: lineClampCount - }, isVirtual); // 重新开头的ib和上面开头处一样逻辑 - - if (item.__isIbFull) { - lineBoxManager.addItem(item); - x = lx; - y += item.outerHeight; - lineBoxManager.setNotEnd(); - } // inline和不折行的ib,其中ib需要手动存入当前lb中 - else { - (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item); - x = lineBoxManager.lastX; - y = lineBoxManager.lastY; - } - } - } - } // inline里的其它只有文本,可能开始紧跟着之前的x,也可能换行后从lx行头开始 - // 紧跟着x可能出现在前面有节点换行后第2行,此时不一定放得下,因此不能作为判断依据,开头仅有lx - else { - var n = lineBoxManager.size; // i为0时强制不换行 - - if (x === lx || !i || whiteSpace === 'nowrap') { + lineClampCount++; + x = lx; + y = lineBoxManager.endY; + lineBoxManager.setNewLine(); lineClampCount = item.__layout({ x: x, y: y, @@ -23497,67 +23555,14 @@ lineClampCount: lineClampCount }, isVirtual); x = lineBoxManager.lastX; - y = lineBoxManager.lastY; // ib情况发生折行,且非定宽 + y = lineBoxManager.lastY; // ib情况发生折行 - if (!isInline && lineBoxManager.size - n > 1 && width[1] === AUTO$6) { + if (!isInline && lineBoxManager.size - n > 1 && width[1] === AUTO$2) { isIbFull = 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; - } - } // 放得下继续 - - - if (_fw2 >= -1e-10) { - lineClampCount = item.__layout({ - x: x, - y: y, - w: w, - h: h, - lx: lx, - lineBoxManager: lineBoxManager, - endSpace: endSpace, - lineClamp: lineClamp, - lineClampCount: lineClampCount - }, isVirtual); - x = lineBoxManager.lastX; - y = lineBoxManager.lastY; // 这里ib放得下一定是要么没换行要么固定宽度,所以无需判断isIbFull - } // 放不下处理之前的lineBox,并重新开头 - else { - lineClampCount++; - x = lx; - y = lineBoxManager.endY; - lineBoxManager.setNewLine(); - lineClampCount = item.__layout({ - x: x, - y: y, - w: w, - h: h, - lx: lx, - lineBoxManager: lineBoxManager, - endSpace: endSpace, - lineClamp: lineClamp, - lineClampCount: lineClampCount - }, isVirtual); - x = lineBoxManager.lastX; - y = lineBoxManager.lastY; // ib情况发生折行 - - if (!isInline && lineBoxManager.size - n > 1 && width[1] === AUTO$6) { - isIbFull = true; - } - } } } + } }); // 同block结尾,不过这里一定是lineBox结束,无需判断 y = lineBoxManager.endY; // 标识ib情况同block一样占满行 @@ -23575,8 +23580,8 @@ if (!flowChildren.length) { var _marginLeft2 = computedStyle[MARGIN_LEFT$3], - _paddingLeft2 = computedStyle[PADDING_LEFT$4], - _borderLeftWidth2 = computedStyle[BORDER_LEFT_WIDTH$5]; + _paddingLeft2 = computedStyle[PADDING_LEFT$3], + _borderLeftWidth2 = computedStyle[BORDER_LEFT_WIDTH$3]; lineBoxManager.addX(_marginLeft2 + _paddingLeft2 + _borderLeftWidth2); } // 结束出栈contentBox,递归情况结束子inline获取contentBox,父inline继续 @@ -23603,7 +23608,7 @@ lineBoxManager.horizonAlign(tw, textAlign); // 直接text需计算size flowChildren.forEach(function (item) { - if (item instanceof Component$1) { + if (item instanceof Component) { item = item.shadowRoot; } @@ -23640,19 +23645,19 @@ computedStyle = this.computedStyle, __ox = this.__ox, __oy = this.__oy; - var marginTop = computedStyle[MARGIN_TOP$1], - marginRight = computedStyle[MARGIN_RIGHT$3], - marginBottom = computedStyle[MARGIN_BOTTOM$1], + var marginTop = computedStyle[MARGIN_TOP$3], + marginRight = computedStyle[MARGIN_RIGHT$2], + marginBottom = computedStyle[MARGIN_BOTTOM$3], marginLeft = computedStyle[MARGIN_LEFT$3], - paddingTop = computedStyle[PADDING_TOP$2], - paddingRight = computedStyle[PADDING_RIGHT$3], - paddingBottom = computedStyle[PADDING_BOTTOM$2], - paddingLeft = computedStyle[PADDING_LEFT$4], + paddingTop = computedStyle[PADDING_TOP$3], + paddingRight = computedStyle[PADDING_RIGHT$2], + paddingBottom = computedStyle[PADDING_BOTTOM$3], + paddingLeft = computedStyle[PADDING_LEFT$3], borderTopWidth = computedStyle[BORDER_TOP_WIDTH$3], - borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$4], + borderRightWidth = computedStyle[BORDER_RIGHT_WIDTH$2], 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$3], + lineHeight = computedStyle[LINE_HEIGHT]; // 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; @@ -23681,32 +23686,32 @@ } } // 第一个初始化 else { - minX = item.x; - minY = item.y; - minCX = minX - paddingLeft; - minCY = minY - paddingTop; - minFX = minCX - borderLeftWidth; - minFY = minCY - borderTopWidth; - minOX = minFX - marginLeft; - minOY = minFY - marginTop; - maxX = maxCX = maxFX = maxOX = item.x + item.outerWidth; - maxY = maxCY = maxFY = maxOY = item.y + item.outerHeight; + minX = item.x; + minY = item.y; + minCX = minX - paddingLeft; + minCY = minY - paddingTop; + minFX = minCX - borderLeftWidth; + minFY = minCY - borderTopWidth; + minOX = minFX - marginLeft; + minOY = minFY - marginTop; + maxX = maxCX = maxFX = maxOX = item.x + item.outerWidth; + maxY = maxCY = maxFY = maxOY = item.y + item.outerHeight; - if (i === length - 1) { - maxCX += paddingRight; - maxCY += paddingBottom; - maxFX += paddingRight + borderRightWidth; - maxFY += paddingBottom + borderBottomWidth; - maxOX += borderRightWidth + paddingRight + marginRight; - maxOY += borderBottomWidth + paddingBottom + marginBottom; - } + if (i === length - 1) { + maxCX += paddingRight; + maxCY += paddingBottom; + maxFX += paddingRight + borderRightWidth; + maxFY += paddingBottom + borderBottomWidth; + maxOX += borderRightWidth + paddingRight + marginRight; + maxOY += borderBottomWidth + paddingBottom + marginBottom; } + } }); this.__x = minOX; this.__y = minOY; - this.__width = computedStyle[WIDTH$5] = maxX - minX; // 防止比自己最小高度lineHeight还小,比如内容是个小字体 + this.__width = computedStyle[WIDTH$3] = maxX - minX; // 防止比自己最小高度lineHeight还小,比如内容是个小字体 - this.__height = computedStyle[HEIGHT$5] = Math.max(lineHeight, maxY - minY); + this.__height = computedStyle[HEIGHT$3] = Math.max(lineHeight, maxY - minY); this.__clientWidth = maxCX - minCX; this.__clientHeight = maxCY - minCY; this.__offsetWidth = maxFX - minFX; @@ -23737,41 +23742,41 @@ } } // 如果没有内容,宽度为0高度为lineHeight,对齐也特殊处理,lineBoxManager不会处理 else { - if (['center', 'right'].indexOf(textAlign) > -1) { - var diff = tw; + if (['center', 'right'].indexOf(textAlign) > -1) { + var diff = tw; - if (textAlign === 'center') { - diff *= 0.5; - } + if (textAlign === 'center') { + diff *= 0.5; + } - if (diff) { - this.__offsetX(diff, true); - } + if (diff) { + this.__offsetX(diff, true); } + } - this.__width = computedStyle[WIDTH$5] = 0; - var th = this.__height = computedStyle[HEIGHT$5] = lineHeight; + this.__width = computedStyle[WIDTH$3] = 0; + var th = this.__height = computedStyle[HEIGHT$3] = lineHeight; - this.__ioSize(0, th); + this.__ioSize(0, th); - this.__sy -= marginTop + paddingTop + borderTopWidth; - this.__sx1 = this.sx + marginLeft; - this.__sy1 = this.sy + marginTop; - this.__sx2 = this.__sx1 + borderLeftWidth; - this.__sy2 = this.__sy1 + borderTopWidth; - this.__sx4 = this.__sx3 = this.__sx2 + paddingLeft; - this.__sy4 = this.__sy3 = this.__sy2 + paddingTop; - this.__sx5 = this.__sx4 + paddingRight; - this.__sy5 = this.__sy4 + th + paddingBottom; - this.__sx6 = this.__sx5 + borderRightWidth; - this.__sy6 = this.__sy5 + borderBottomWidth; - this.__clientWidth = this.__sx5 - this.__sx2; - this.__clientHeight = this.__sy5 - this.__sy2; - this.__offsetWidth = this.__sx6 - this.__sx1; - this.__offsetHeight = this.__sy6 - this.__sy1; - this.__outerWidth = this.__offsetWidth + marginLeft + marginRight; - this.__outerHeight = this.__offsetHeight + marginTop + marginBottom; - } + this.__sy -= marginTop + paddingTop + borderTopWidth; + this.__sx1 = this.sx + marginLeft; + this.__sy1 = this.sy + marginTop; + this.__sx2 = this.__sx1 + borderLeftWidth; + this.__sy2 = this.__sy1 + borderTopWidth; + this.__sx4 = this.__sx3 = this.__sx2 + paddingLeft; + this.__sy4 = this.__sy3 = this.__sy2 + paddingTop; + this.__sx5 = this.__sx4 + paddingRight; + this.__sy5 = this.__sy4 + th + paddingBottom; + this.__sx6 = this.__sx5 + borderRightWidth; + this.__sy6 = this.__sy5 + borderBottomWidth; + this.__clientWidth = this.__sx5 - this.__sx2; + this.__clientHeight = this.__sy5 - this.__sy2; + this.__offsetWidth = this.__sx6 - this.__sx1; + this.__offsetHeight = this.__sy6 - this.__sy1; + this.__outerWidth = this.__offsetWidth + marginLeft + marginRight; + this.__outerHeight = this.__offsetHeight + marginTop + marginBottom; + } } /** * 只针对绝对定位children布局 @@ -23794,13 +23799,13 @@ var isDestroyed = this.isDestroyed, children = this.children, absChildren = this.absChildren; - var display = computedStyle[DISPLAY$6], + var display = computedStyle[DISPLAY$4], borderTopWidth = computedStyle[BORDER_TOP_WIDTH$3], - borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$5], - marginTop = computedStyle[MARGIN_TOP$1], + borderLeftWidth = computedStyle[BORDER_LEFT_WIDTH$3], + marginTop = computedStyle[MARGIN_TOP$3], marginLeft = computedStyle[MARGIN_LEFT$3], - paddingLeft = computedStyle[PADDING_LEFT$4], - paddingTop = computedStyle[PADDING_TOP$2]; + paddingLeft = computedStyle[PADDING_LEFT$3], + paddingTop = computedStyle[PADDING_TOP$3]; if (isDestroyed || display === 'none') { this.__layoutNone(); @@ -23816,7 +23821,7 @@ // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr var node = item; - if (node instanceof Component$1) { + if (node instanceof Component) { node = item.shadowRoot; } // 所以得2个都对比 @@ -23829,7 +23834,7 @@ var currentStyle = item.currentStyle, computedStyle = item.computedStyle; - if (currentStyle[DISPLAY$6] === 'none') { + if (currentStyle[DISPLAY$4] === 'none') { item.__layoutNone(); return; @@ -23838,18 +23843,18 @@ item.__mp(currentStyle, computedStyle, clientWidth); - if (currentStyle[DISPLAY$6] !== 'block' && currentStyle[DISPLAY$6] !== 'flex') { - currentStyle[DISPLAY$6] = computedStyle[DISPLAY$6] = 'block'; + if (currentStyle[DISPLAY$4] !== 'block' && currentStyle[DISPLAY$4] !== 'flex') { + currentStyle[DISPLAY$4] = computedStyle[DISPLAY$4] = 'block'; } var left = currentStyle[LEFT$1], - top = currentStyle[TOP$3], + top = currentStyle[TOP$1], right = currentStyle[RIGHT$1], - bottom = currentStyle[BOTTOM$3], - width = currentStyle[WIDTH$5], - height = currentStyle[HEIGHT$5], - display = currentStyle[DISPLAY$6], - flexDirection = currentStyle[FLEX_DIRECTION$2]; + bottom = currentStyle[BOTTOM$1], + width = currentStyle[WIDTH$3], + height = currentStyle[HEIGHT$3], + display = currentStyle[DISPLAY$4], + flexDirection = currentStyle[FLEX_DIRECTION]; var x2, y2, w2, h2; var onlyRight; var onlyBottom; @@ -23858,32 +23863,32 @@ var fixedBottom; var fixedLeft; // 判断何种方式的定位,比如左+宽度,左+右之类 - if (left[1] !== AUTO$6) { + if (left[1] !== AUTO$2) { fixedLeft = true; - computedStyle[LEFT$1] = calAbsolute$1(currentStyle, 'left', left, clientWidth, _this4.root); + computedStyle[LEFT$1] = calAbsolute(currentStyle, 'left', left, clientWidth, _this4.root); } else { computedStyle[LEFT$1] = 'auto'; } - if (right[1] !== AUTO$6) { + if (right[1] !== AUTO$2) { fixedRight = true; - computedStyle[RIGHT$1] = calAbsolute$1(currentStyle, 'right', right, clientWidth, _this4.root); + computedStyle[RIGHT$1] = calAbsolute(currentStyle, 'right', right, clientWidth, _this4.root); } else { computedStyle[RIGHT$1] = 'auto'; } - if (top[1] !== AUTO$6) { + if (top[1] !== AUTO$2) { fixedTop = true; - computedStyle[TOP$3] = calAbsolute$1(currentStyle, 'top', top, clientHeight, _this4.root); + computedStyle[TOP$1] = calAbsolute(currentStyle, 'top', top, clientHeight, _this4.root); } else { - computedStyle[TOP$3] = 'auto'; + computedStyle[TOP$1] = 'auto'; } - if (bottom[1] !== AUTO$6) { + if (bottom[1] !== AUTO$2) { fixedBottom = true; - computedStyle[BOTTOM$3] = calAbsolute$1(currentStyle, 'bottom', bottom, clientHeight, _this4.root); + computedStyle[BOTTOM$1] = calAbsolute(currentStyle, 'bottom', bottom, clientHeight, _this4.root); } else { - computedStyle[BOTTOM$3] = 'auto'; + computedStyle[BOTTOM$1] = 'auto'; } // 优先级最高left+right,其次left+width,再次right+width,再次仅申明单个,最次全部auto @@ -23893,11 +23898,11 @@ } else if (fixedLeft) { x2 = x + computedStyle[LEFT$1]; - if (width[1] !== AUTO$6) { - if (width[1] === PERCENT$9) { + if (width[1] !== AUTO$2) { + if (width[1] === PERCENT$3) { w2 = width[0] * clientWidth * 0.01; } else if (width[1] === REM$8) { - w2 = width[0] * _this4.root.computedStyle[FONT_SIZE$9]; + w2 = width[0] * _this4.root.computedStyle[FONT_SIZE$8]; } else if (width[1] === VW$8) { w2 = width[0] * _this4.root.width * 0.01; } else if (width[1] === VH$8) { @@ -23907,11 +23912,11 @@ } } } else if (fixedRight) { - if (width[1] !== AUTO$6) { - if (width[1] === PERCENT$9) { + if (width[1] !== AUTO$2) { + if (width[1] === PERCENT$3) { w2 = width[0] * clientWidth * 0.01; } else if (width[1] === REM$8) { - w2 = width[0] * _this4.root.computedStyle[FONT_SIZE$9]; + w2 = width[0] * _this4.root.computedStyle[FONT_SIZE$8]; } else if (width[1] === VW$8) { w2 = width[0] * _this4.root.width * 0.01; } else if (width[1] === VH$8) { @@ -23926,19 +23931,19 @@ 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 -= currentStyle[BORDER_LEFT_WIDTH$5][0]; - x2 -= currentStyle[BORDER_RIGHT_WIDTH$4][0]; + x2 -= computedStyle[MARGIN_RIGHT$2]; + x2 -= computedStyle[PADDING_LEFT$3]; + x2 -= computedStyle[PADDING_RIGHT$2]; + x2 -= currentStyle[BORDER_LEFT_WIDTH$3][0]; + x2 -= currentStyle[BORDER_RIGHT_WIDTH$2][0]; } else { x2 = x + paddingLeft; - if (width[1] !== AUTO$6) { - if (width[1] === PERCENT$9) { + if (width[1] !== AUTO$2) { + if (width[1] === PERCENT$3) { w2 = width[0] * clientWidth * 0.01; } else if (width[1] === REM$8) { - w2 = width[0] * _this4.root.computedStyle[FONT_SIZE$9]; + w2 = width[0] * _this4.root.computedStyle[FONT_SIZE$8]; } else if (width[1] === VW$8) { w2 = width[0] * _this4.root.width * 0.01; } else if (width[1] === VH$8) { @@ -23951,16 +23956,16 @@ if (fixedTop && fixedBottom) { - y2 = y + computedStyle[TOP$3]; - h2 = y + clientHeight - computedStyle[BOTTOM$3] - y2; + y2 = y + computedStyle[TOP$1]; + h2 = y + clientHeight - computedStyle[BOTTOM$1] - y2; } else if (fixedTop) { - y2 = y + computedStyle[TOP$3]; + y2 = y + computedStyle[TOP$1]; - if (height[1] !== AUTO$6) { - if (height[1] === PERCENT$9) { + if (height[1] !== AUTO$2) { + if (height[1] === PERCENT$3) { h2 = height[0] * clientHeight * 0.01; } else if (height[1] === REM$8) { - h2 = height[0] * _this4.root.computedStyle[FONT_SIZE$9]; + h2 = height[0] * _this4.root.computedStyle[FONT_SIZE$8]; } else if (height[1] === VW$8) { h2 = height[0] * _this4.root.width * 0.01; } else if (height[1] === VH$8) { @@ -23970,11 +23975,11 @@ } } } else if (fixedBottom) { - if (height[1] !== AUTO$6) { - if (height[1] === PERCENT$9) { + if (height[1] !== AUTO$2) { + if (height[1] === PERCENT$3) { h2 = height[0] * clientHeight * 0.01; } else if (height[1] === REM$8) { - h2 = height[0] * _this4.root.computedStyle[FONT_SIZE$9]; + h2 = height[0] * _this4.root.computedStyle[FONT_SIZE$8]; } else if (height[1] === VW$8) { h2 = height[0] * _this4.root.width * 0.01; } else if (height[1] === VH$8) { @@ -23986,41 +23991,41 @@ onlyBottom = true; } - y2 = y + clientHeight - computedStyle[BOTTOM$3] - (h2 || 0); // 底对齐有尺寸时y值还需减去margin/border/padding的 + y2 = y + clientHeight - computedStyle[BOTTOM$1] - (h2 || 0); // 底对齐有尺寸时y值还需减去margin/border/padding的 - y2 -= computedStyle[MARGIN_TOP$1]; - y2 -= computedStyle[MARGIN_BOTTOM$1]; - y2 -= computedStyle[PADDING_TOP$2]; - y2 -= computedStyle[PADDING_BOTTOM$2]; + y2 -= computedStyle[MARGIN_TOP$3]; + y2 -= computedStyle[MARGIN_BOTTOM$3]; + y2 -= computedStyle[PADDING_TOP$3]; + y2 -= computedStyle[PADDING_BOTTOM$3]; y2 -= currentStyle[BORDER_TOP_WIDTH$3][0]; y2 -= currentStyle[BORDER_BOTTOM_WIDTH$3][0]; } // 未声明y的找到之前的流布局child,紧随其下 else { - y2 = y + paddingTop; - var prev = item.prev; + y2 = y + paddingTop; + var prev = item.prev; - while (prev) { - // 目前不考虑margin合并,直接以前面的flow的最近的prev末尾为准 - if (prev instanceof Text || prev.computedStyle[POSITION$3] !== 'absolute') { - y2 = prev.y + prev.outerHeight; - break; - } - - prev = prev.prev; + while (prev) { + // 目前不考虑margin合并,直接以前面的flow的最近的prev末尾为准 + if (prev instanceof Text || prev.computedStyle[POSITION$2] !== 'absolute') { + y2 = prev.y + prev.outerHeight; + break; } - if (height[1] === PERCENT$9) { - h2 = height[0] * clientHeight * 0.01; - } else if (height[1] === REM$8) { - h2 = height[0] * _this4.root.computedStyle[FONT_SIZE$9]; - } else if (height[1] === VW$8) { - h2 = height[0] * _this4.root.width * 0.01; - } else if (height[1] === VH$8) { - h2 = height[0] * _this4.root.height * 0.01; - } else if (height[1] === PX$8) { - h2 = height[0]; - } - } // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局 + prev = prev.prev; + } + + if (height[1] === PERCENT$3) { + h2 = height[0] * clientHeight * 0.01; + } else if (height[1] === REM$8) { + h2 = height[0] * _this4.root.computedStyle[FONT_SIZE$8]; + } else if (height[1] === VW$8) { + h2 = height[0] * _this4.root.width * 0.01; + } else if (height[1] === VH$8) { + h2 = height[0] * _this4.root.height * 0.01; + } else if (height[1] === PX$3) { + h2 = height[0]; + } + } // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局 var needCalWidth; @@ -24076,7 +24081,7 @@ // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr var node = item; - if (node instanceof Component$1) { + if (node instanceof Component) { node = item.shadowRoot; } // 所以得2个都对比 @@ -24088,7 +24093,7 @@ if (item instanceof Dom) { item.__layoutAbs(isRelativeOrAbsolute$1(item) ? item : container, data); - } else if (item instanceof Component$1) { + } else if (item instanceof Component) { var sr = item.shadowRoot; if (sr instanceof Dom) { @@ -24156,7 +24161,7 @@ computedStyle = this.computedStyle, isMask = this.isMask; - if (isDestroyed || computedStyle[DISPLAY$6] === 'none' || e.__stopPropagation || isMask) { + if (isDestroyed || computedStyle[DISPLAY$4] === 'none' || e.__stopPropagation || isMask) { return; } // 检查perspective嵌套状态,自身有perspective则设置10位,自身有transform的p矩阵则设置01位 // if(computedStyle[PERSPECTIVE]) { @@ -24168,7 +24173,7 @@ // overflow:hidden时还需要判断是否超出范围外,如果是则无效 - if (computedStyle[OVERFLOW$2] === 'hidden' && !this.willResponseEvent(e, true)) { + if (computedStyle[OVERFLOW$1] === 'hidden' && !this.willResponseEvent(e, true)) { return; } // 找到对应的callback @@ -24186,7 +24191,7 @@ for (var i = zIndexChildren.length - 1; i >= 0; i--) { var child = zIndexChildren[i]; - if (child instanceof Xom$1 || child instanceof Component$1 && child.shadowRoot instanceof Xom$1) { + if (child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) { if (child.__emitEvent(e)) { // 孩子阻止冒泡 if (e.__stopPropagation) { @@ -24258,11 +24263,11 @@ self.__zIndexChildren = null; // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题 var res = {}; - res[UPDATE_NODE$3] = vd; - res[UPDATE_FOCUS$2] = o$3.REFLOW; - res[UPDATE_ADD_DOM] = true; + res[UPDATE_NODE$2] = vd; + res[UPDATE_FOCUS$2] = o$1.REFLOW; + res[UPDATE_ADD_DOM$1] = true; res[UPDATE_MEASURE$1] = true; - res[UPDATE_CONFIG$3] = vd.__config; + res[UPDATE_CONFIG$2] = vd.__config; root.__addUpdate(vd, vd.__config, root, root.__config, res); }, @@ -24318,11 +24323,11 @@ self.__zIndexChildren = null; // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题 var res = {}; - res[UPDATE_NODE$3] = vd; - res[UPDATE_FOCUS$2] = o$3.REFLOW; - res[UPDATE_ADD_DOM] = true; + res[UPDATE_NODE$2] = vd; + res[UPDATE_FOCUS$2] = o$1.REFLOW; + res[UPDATE_ADD_DOM$1] = true; res[UPDATE_MEASURE$1] = true; - res[UPDATE_CONFIG$3] = vd.__config; + res[UPDATE_CONFIG$2] = vd.__config; root.__addUpdate(vd, vd.__config, root, root.__config, res); }, @@ -24403,11 +24408,11 @@ domParent.__zIndexChildren = null; // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题 var res = {}; - res[UPDATE_NODE$3] = vd; - res[UPDATE_FOCUS$2] = o$3.REFLOW; - res[UPDATE_ADD_DOM] = true; + res[UPDATE_NODE$2] = vd; + res[UPDATE_FOCUS$2] = o$1.REFLOW; + res[UPDATE_ADD_DOM$1] = true; res[UPDATE_MEASURE$1] = true; - res[UPDATE_CONFIG$3] = vd.__config; + res[UPDATE_CONFIG$2] = vd.__config; root.__addUpdate(vd, vd.__config, root, root.__config, res); }, @@ -24488,11 +24493,11 @@ domParent.__zIndexChildren = null; // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题 var res = {}; - res[UPDATE_NODE$3] = vd; - res[UPDATE_FOCUS$2] = o$3.REFLOW; - res[UPDATE_ADD_DOM] = true; + res[UPDATE_NODE$2] = vd; + res[UPDATE_FOCUS$2] = o$1.REFLOW; + res[UPDATE_ADD_DOM$1] = true; res[UPDATE_MEASURE$1] = true; - res[UPDATE_CONFIG$3] = vd.__config; + res[UPDATE_CONFIG$2] = vd.__config; root.__addUpdate(vd, vd.__config, root, root.__config, res); }, @@ -24510,7 +24515,7 @@ }, { key: "removeChild", value: function removeChild(target, cb) { - if (target.parent === this && (target instanceof Xom$1 || target instanceof Component$1)) { + if (target.parent === this && (target instanceof Xom || target instanceof Component)) { if (this.isDestroyed) { inject.warn('Remove parent is destroyed.'); @@ -24535,22 +24540,22 @@ key: "flowChildren", get: function get() { return this.children.filter(function (item) { - if (item instanceof Component$1) { + if (item instanceof Component) { item = item.shadowRoot; } - return item instanceof Text || item.currentStyle[POSITION$3] !== 'absolute'; + return item instanceof Text || item.currentStyle[POSITION$2] !== 'absolute'; }); } }, { key: "absChildren", get: function get() { return this.children.filter(function (item) { - if (item instanceof Component$1) { + if (item instanceof Component) { item = item.shadowRoot; } - return item instanceof Xom$1 && item.currentStyle[POSITION$3] === 'absolute'; + return item instanceof Xom && item.currentStyle[POSITION$2] === 'absolute'; }); } }, { @@ -24571,9 +24576,9 @@ } var _this$computedStyle = this.computedStyle, - marginTop = _this$computedStyle[MARGIN_TOP$1], + marginTop = _this$computedStyle[MARGIN_TOP$3], borderTopWidth = _this$computedStyle[BORDER_TOP_WIDTH$3], - paddingTop = _this$computedStyle[PADDING_TOP$2]; + paddingTop = _this$computedStyle[PADDING_TOP$3]; return marginTop + borderTopWidth + paddingTop + this.lineBoxManager.baseLine; } }, { @@ -24584,9 +24589,9 @@ } var _this$computedStyle2 = this.computedStyle, - marginTop = _this$computedStyle2[MARGIN_TOP$1], + marginTop = _this$computedStyle2[MARGIN_TOP$3], borderTopWidth = _this$computedStyle2[BORDER_TOP_WIDTH$3], - paddingTop = _this$computedStyle2[PADDING_TOP$2]; + paddingTop = _this$computedStyle2[PADDING_TOP$3]; return marginTop + borderTopWidth + paddingTop + this.lineBoxManager.firstBaseLine; } }, { @@ -24597,55 +24602,55 @@ }]); return Dom; - }(Xom$1); + }(Xom); - var _enums$STYLE_KEY$g = enums.STYLE_KEY, - WIDTH$6 = _enums$STYLE_KEY$g.WIDTH, - HEIGHT$6 = _enums$STYLE_KEY$g.HEIGHT, - DISPLAY$7 = _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$4 = _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_TOP$2 = _enums$STYLE_KEY$g.MARGIN_TOP, - MARGIN_RIGHT$4 = _enums$STYLE_KEY$g.MARGIN_RIGHT, - MARGIN_BOTTOM$2 = _enums$STYLE_KEY$g.MARGIN_BOTTOM, - MARGIN_LEFT$4 = _enums$STYLE_KEY$g.MARGIN_LEFT, - PADDING_TOP$3 = _enums$STYLE_KEY$g.PADDING_TOP, - PADDING_RIGHT$4 = _enums$STYLE_KEY$g.PADDING_RIGHT, - PADDING_BOTTOM$3 = _enums$STYLE_KEY$g.PADDING_BOTTOM, - 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, - _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, - UPDATE_CONFIG$4 = _enums$UPDATE_KEY$4.UPDATE_CONFIG, - _enums$NODE_KEY$6 = enums.NODE_KEY, - NODE_CACHE$3 = _enums$NODE_KEY$6.NODE_CACHE, - NODE_DEFS_CACHE$4 = _enums$NODE_KEY$6.NODE_DEFS_CACHE, - NODE_IS_MASK$1 = _enums$NODE_KEY$6.NODE_IS_MASK; - var AUTO$7 = o.AUTO, - PX$9 = o.PX, - PERCENT$a = o.PERCENT, - REM$9 = o.REM, - VW$9 = o.VW, - VH$9 = o.VH, - RGBA$2 = o.RGBA; - var canvasPolygon$5 = painter.canvasPolygon, - svgPolygon$6 = painter.svgPolygon; - var isFunction$5 = util.isFunction; + var _enums$STYLE_KEY$9 = enums.STYLE_KEY, + WIDTH$2 = _enums$STYLE_KEY$9.WIDTH, + HEIGHT$2 = _enums$STYLE_KEY$9.HEIGHT, + DISPLAY$3 = _enums$STYLE_KEY$9.DISPLAY, + BORDER_TOP_WIDTH$2 = _enums$STYLE_KEY$9.BORDER_TOP_WIDTH, + BORDER_RIGHT_WIDTH$1 = _enums$STYLE_KEY$9.BORDER_RIGHT_WIDTH, + BORDER_LEFT_WIDTH$2 = _enums$STYLE_KEY$9.BORDER_LEFT_WIDTH, + BORDER_BOTTOM_WIDTH$2 = _enums$STYLE_KEY$9.BORDER_BOTTOM_WIDTH, + BORDER_TOP_LEFT_RADIUS = _enums$STYLE_KEY$9.BORDER_TOP_LEFT_RADIUS, + BORDER_TOP_RIGHT_RADIUS = _enums$STYLE_KEY$9.BORDER_TOP_RIGHT_RADIUS, + BORDER_BOTTOM_RIGHT_RADIUS = _enums$STYLE_KEY$9.BORDER_BOTTOM_RIGHT_RADIUS, + BORDER_BOTTOM_LEFT_RADIUS = _enums$STYLE_KEY$9.BORDER_BOTTOM_LEFT_RADIUS, + VISIBILITY$3 = _enums$STYLE_KEY$9.VISIBILITY, + BACKGROUND_IMAGE = _enums$STYLE_KEY$9.BACKGROUND_IMAGE, + BACKGROUND_COLOR = _enums$STYLE_KEY$9.BACKGROUND_COLOR, + BOX_SHADOW$6 = _enums$STYLE_KEY$9.BOX_SHADOW, + MIX_BLEND_MODE$2 = _enums$STYLE_KEY$9.MIX_BLEND_MODE, + MARGIN_TOP$2 = _enums$STYLE_KEY$9.MARGIN_TOP, + MARGIN_RIGHT$1 = _enums$STYLE_KEY$9.MARGIN_RIGHT, + MARGIN_BOTTOM$2 = _enums$STYLE_KEY$9.MARGIN_BOTTOM, + MARGIN_LEFT$2 = _enums$STYLE_KEY$9.MARGIN_LEFT, + PADDING_TOP$2 = _enums$STYLE_KEY$9.PADDING_TOP, + PADDING_RIGHT$1 = _enums$STYLE_KEY$9.PADDING_RIGHT, + PADDING_BOTTOM$2 = _enums$STYLE_KEY$9.PADDING_BOTTOM, + PADDING_LEFT$2 = _enums$STYLE_KEY$9.PADDING_LEFT, + FONT_SIZE$7 = _enums$STYLE_KEY$9.FONT_SIZE, + FLEX_BASIS$1 = _enums$STYLE_KEY$9.FLEX_BASIS, + _enums$UPDATE_KEY$1 = enums.UPDATE_KEY, + UPDATE_NODE$1 = _enums$UPDATE_KEY$1.UPDATE_NODE, + UPDATE_FOCUS$1 = _enums$UPDATE_KEY$1.UPDATE_FOCUS, + UPDATE_CONFIG$1 = _enums$UPDATE_KEY$1.UPDATE_CONFIG, + _enums$NODE_KEY$4 = enums.NODE_KEY, + NODE_CACHE$2 = _enums$NODE_KEY$4.NODE_CACHE, + NODE_DEFS_CACHE$2 = _enums$NODE_KEY$4.NODE_DEFS_CACHE, + NODE_IS_MASK$2 = _enums$NODE_KEY$4.NODE_IS_MASK; + var AUTO$1 = o$4.AUTO, + PX$2 = o$4.PX, + PERCENT$2 = o$4.PERCENT, + REM$7 = o$4.REM, + VW$7 = o$4.VW, + VH$7 = o$4.VH, + RGBA = o$4.RGBA; + var canvasPolygon$2 = painter.canvasPolygon, + svgPolygon$1 = painter.svgPolygon; + var isFunction$3 = util.isFunction; - var Img$1 = /*#__PURE__*/function (_Dom) { + var Img = /*#__PURE__*/function (_Dom) { _inherits(Img, _Dom); var _super = _createSuper(Img); @@ -24667,19 +24672,19 @@ var config = _this.__config; - if (config[NODE_IS_MASK$1]) { + if (config[NODE_IS_MASK$2]) { var _assertThisInitialize = _assertThisInitialized(_this), style = _assertThisInitialize.style, currentStyle = _assertThisInitialize.currentStyle; - 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_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'; + style[BACKGROUND_IMAGE] = currentStyle[BACKGROUND_IMAGE] = [null]; + style[BACKGROUND_COLOR] = currentStyle[BACKGROUND_COLOR] = [[0, 0, 0, 0], RGBA]; + style[BORDER_TOP_WIDTH$2] = currentStyle[BORDER_TOP_WIDTH$2] = [0, PX$2]; + style[BORDER_RIGHT_WIDTH$1] = currentStyle[BORDER_RIGHT_WIDTH$1] = [0, PX$2]; + style[BORDER_LEFT_WIDTH$2] = currentStyle[BORDER_LEFT_WIDTH$2] = [0, PX$2]; + style[BORDER_BOTTOM_WIDTH$2] = currentStyle[BORDER_BOTTOM_WIDTH$2] = [0, PX$2]; + style[BOX_SHADOW$6] = currentStyle[BOX_SHADOW$6] = null; + style[MIX_BLEND_MODE$2] = currentStyle[MIX_BLEND_MODE$2] = 'normal'; } return _this; @@ -24773,7 +24778,7 @@ if (!res) { var loadImg = this.__loadImg; - if (computedStyle[VISIBILITY$4] !== 'hidden' && (computedStyle[WIDTH$6] || computedStyle[HEIGHT$6]) && loadImg.source) { + if (computedStyle[VISIBILITY$3] !== 'hidden' && (computedStyle[WIDTH$2] || computedStyle[HEIGHT$2]) && loadImg.source) { res = true; } } @@ -24795,12 +24800,12 @@ placeholder = this.props.placeholder, computedStyle = this.computedStyle, _this$computedStyle = this.computedStyle, - display = _this$computedStyle[DISPLAY$7], - borderTopLeftRadius = _this$computedStyle[BORDER_TOP_LEFT_RADIUS$2], - borderTopRightRadius = _this$computedStyle[BORDER_TOP_RIGHT_RADIUS$2], - borderBottomRightRadius = _this$computedStyle[BORDER_BOTTOM_RIGHT_RADIUS$2], - borderBottomLeftRadius = _this$computedStyle[BORDER_BOTTOM_LEFT_RADIUS$2], - visibility = _this$computedStyle[VISIBILITY$4], + display = _this$computedStyle[DISPLAY$3], + borderTopLeftRadius = _this$computedStyle[BORDER_TOP_LEFT_RADIUS], + borderTopRightRadius = _this$computedStyle[BORDER_TOP_RIGHT_RADIUS], + borderBottomRightRadius = _this$computedStyle[BORDER_BOTTOM_RIGHT_RADIUS], + borderBottomLeftRadius = _this$computedStyle[BORDER_BOTTOM_LEFT_RADIUS], + visibility = _this$computedStyle[VISIBILITY$3], virtualDom = this.virtualDom, __config = this.__config, loadImg = this.__loadImg, @@ -24831,7 +24836,7 @@ return res; } - var __cache = __config[NODE_CACHE$3]; + var __cache = __config[NODE_CACHE$2]; if (cache && __cache && __cache.enabled) { ctx = __cache.ctx; @@ -24907,7 +24912,7 @@ if (list) { ctx.save(); ctx.beginPath(); - canvasPolygon$5(ctx, list); + canvasPolygon$2(ctx, list); ctx.clip(); ctx.closePath(); ctx.drawImage(source, originX, originY, width, height); @@ -24922,7 +24927,7 @@ virtualDom.children = [loadImg.cache]; // 但是还是要校验是否有borderRadius变化,引发img的圆角遮罩 if (!virtualDom.cache && list) { - var d = svgPolygon$6(list); + var d = svgPolygon$1(list); var v = { tagName: 'clipPath', props: [], @@ -24934,7 +24939,7 @@ }; var id = ctx.add(v); - __config[NODE_DEFS_CACHE$4].push(v); + __config[NODE_DEFS_CACHE$2].push(v); virtualDom.conClip = 'url(#' + id + ')'; } @@ -24952,7 +24957,7 @@ 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$1(list); var _v = { tagName: 'clipPath', @@ -24966,7 +24971,7 @@ var _id = ctx.add(_v); - __config[NODE_DEFS_CACHE$4].push(_v); + __config[NODE_DEFS_CACHE$2].push(_v); virtualDom.conClip = 'url(#' + _id + ')'; delete virtualDom.cache; @@ -25006,38 +25011,38 @@ key: "__tryLayInline", value: function __tryLayInline(w, total) { 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]; - - if (width[1] === PX$9) { + width = _this$currentStyle[WIDTH$2], + height = _this$currentStyle[HEIGHT$2], + marginLeft = _this$currentStyle[MARGIN_LEFT$2], + marginRight = _this$currentStyle[MARGIN_RIGHT$1], + paddingLeft = _this$currentStyle[PADDING_LEFT$2], + paddingRight = _this$currentStyle[PADDING_RIGHT$1], + borderLeftWidth = _this$currentStyle[BORDER_LEFT_WIDTH$2], + borderRightWidth = _this$currentStyle[BORDER_RIGHT_WIDTH$1]; + + if (width[1] === PX$2) { w -= width[0]; - } else if (width[1] === PERCENT$a) { + } else if (width[1] === PERCENT$2) { w -= total * width[0] * 0.01; - } else if (width[1] === REM$9) { - w -= width[0] * this.root.computedStyle[FONT_SIZE$a]; - } else if (width[1] === VW$9) { + } else if (width[1] === REM$7) { + w -= width[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (width[1] === VW$7) { w -= width[0] * this.root.width * 0.01; - } else if (width[1] === VH$9) { + } else if (width[1] === VH$7) { w -= width[0] * this.root.height * 0.01; } else { var loadImg = this.__loadImg; // 加载成功计算缩放后的宽度 if (loadImg.source) { - if (height[1] === PX$9) { + if (height[1] === PX$2) { w -= loadImg.width * height[0] / loadImg.height; - } else if (height[1] === PERCENT$a) { + } else if (height[1] === PERCENT$2) { 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; - } else if (height[1] === VW$9) { + } else if (height[1] === REM$7) { + w -= loadImg.width * height[0] * this.root.computedStyle[FONT_SIZE$7] / loadImg.height; + } else if (height[1] === VW$7) { w -= loadImg.width * height[0] * this.root.width * 0.01 / loadImg.height; - } else if (height[1] === VH$9) { + } else if (height[1] === VH$7) { w -= loadImg.width * height[0] * this.root.height * 0.01 / loadImg.height; } else { w -= loadImg.width; @@ -25046,71 +25051,71 @@ } // 减去水平mbp - if (marginLeft[1] === PX$9) { + if (marginLeft[1] === PX$2) { w -= marginLeft[0]; - } else if (marginLeft[1] === PERCENT$a) { + } else if (marginLeft[1] === PERCENT$2) { w -= marginLeft[0] * total * 0.01; - } else if (marginLeft[1] === REM$9) { - w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE$a]; - } else if (marginLeft[1] === VW$9) { + } else if (marginLeft[1] === REM$7) { + w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (marginLeft[1] === VW$7) { w -= marginLeft[0] * this.root.width * 0.01; - } else if (marginLeft[1] === VH$9) { + } else if (marginLeft[1] === VH$7) { w -= marginLeft[0] * this.root.height * 0.01; } - if (paddingLeft[1] === PX$9) { + if (paddingLeft[1] === PX$2) { w -= paddingLeft[0]; - } else if (paddingLeft[1] === PERCENT$a) { + } else if (paddingLeft[1] === PERCENT$2) { w -= paddingLeft[0] * total * 0.01; - } else if (paddingLeft[1] === REM$9) { - w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE$a]; - } else if (paddingLeft[1] === VW$9) { + } else if (paddingLeft[1] === REM$7) { + w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (paddingLeft[1] === VW$7) { w -= paddingLeft[0] * this.root.width * 0.01; - } else if (paddingLeft[1] === VH$9) { + } else if (paddingLeft[1] === VH$7) { w -= paddingLeft[0] * this.root.height * 0.01; } - if (borderLeftWidth[1] === PX$9) { + if (borderLeftWidth[1] === PX$2) { w -= borderLeftWidth[0]; - } else if (borderLeftWidth[1] === REM$9) { - w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$a]; - } else if (borderLeftWidth[1] === VW$9) { + } else if (borderLeftWidth[1] === REM$7) { + w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (borderLeftWidth[1] === VW$7) { w -= borderLeftWidth[0] * this.root.width * 0.01; - } else if (borderLeftWidth[1] === VH$9) { + } else if (borderLeftWidth[1] === VH$7) { w -= borderLeftWidth[0] * this.root.height * 0.01; } - if (marginRight[1] === PX$9) { + if (marginRight[1] === PX$2) { w -= marginRight[0]; - } else if (marginRight[1] === PERCENT$a) { + } else if (marginRight[1] === PERCENT$2) { w -= marginRight[0] * total * 0.01; - } else if (marginRight[1] === REM$9) { - w -= marginRight[0] * this.root.computedStyle[FONT_SIZE$a]; - } else if (marginRight[1] === VW$9) { + } else if (marginRight[1] === REM$7) { + w -= marginRight[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (marginRight[1] === VW$7) { w -= marginRight[0] * this.root.width * 0.01; - } else if (marginRight[1] === VH$9) { + } else if (marginRight[1] === VH$7) { w -= marginRight[0] * this.root.height * 0.01; } - if (paddingRight[1] === PX$9) { + if (paddingRight[1] === PX$2) { w -= paddingRight[0]; - } else if (paddingRight[1] === PERCENT$a) { + } else if (paddingRight[1] === PERCENT$2) { w -= paddingRight[0] * total * 0.01; - } else if (paddingRight[1] === REM$9) { - w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE$a]; - } else if (paddingRight[1] === VW$9) { + } else if (paddingRight[1] === REM$7) { + w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (paddingRight[1] === VW$7) { w -= paddingRight[0] * this.root.width * 0.01; - } else if (paddingRight[1] === VH$9) { + } else if (paddingRight[1] === VH$7) { w -= paddingRight[0] * this.root.height * 0.01; } - if (borderRightWidth[1] === PX$9) { + if (borderRightWidth[1] === PX$2) { w -= borderRightWidth[0]; - } else if (borderRightWidth[1] === REM$9) { - w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$a]; - } else if (borderRightWidth[1] === VW$9) { + } else if (borderRightWidth[1] === REM$7) { + w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (borderRightWidth[1] === VW$7) { w -= borderRightWidth[0] * this.root.width * 0.01; - } else if (borderRightWidth[1] === VH$9) { + } else if (borderRightWidth[1] === VH$7) { w -= borderRightWidth[0] * this.root.height * 0.01; } @@ -25127,71 +25132,71 @@ var w = data.w, h = data.h; // 计算需考虑style的属性 - var flexBasis = currentStyle[FLEX_BASIS$3], - width = currentStyle[WIDTH$6], - height = currentStyle[HEIGHT$6], - marginLeft = currentStyle[MARGIN_LEFT$4], + var flexBasis = currentStyle[FLEX_BASIS$1], + width = currentStyle[WIDTH$2], + height = currentStyle[HEIGHT$2], + marginLeft = currentStyle[MARGIN_LEFT$2], marginTop = currentStyle[MARGIN_TOP$2], - marginRight = currentStyle[MARGIN_RIGHT$4], + marginRight = currentStyle[MARGIN_RIGHT$1], marginBottom = currentStyle[MARGIN_BOTTOM$2], - paddingLeft = currentStyle[PADDING_LEFT$5], - paddingTop = currentStyle[PADDING_TOP$3], - paddingRight = currentStyle[PADDING_RIGHT$4], - paddingBottom = currentStyle[PADDING_BOTTOM$3], - borderTopWidth = currentStyle[BORDER_TOP_WIDTH$4], - borderRightWidth = currentStyle[BORDER_RIGHT_WIDTH$5], - borderBottomWidth = currentStyle[BORDER_BOTTOM_WIDTH$4], - borderLeftWidth = currentStyle[BORDER_LEFT_WIDTH$6]; + paddingLeft = currentStyle[PADDING_LEFT$2], + paddingTop = currentStyle[PADDING_TOP$2], + paddingRight = currentStyle[PADDING_RIGHT$1], + paddingBottom = currentStyle[PADDING_BOTTOM$2], + borderTopWidth = currentStyle[BORDER_TOP_WIDTH$2], + borderRightWidth = currentStyle[BORDER_RIGHT_WIDTH$1], + borderBottomWidth = currentStyle[BORDER_BOTTOM_WIDTH$2], + borderLeftWidth = currentStyle[BORDER_LEFT_WIDTH$2]; var main = isDirectionRow ? width : height; var cross = isDirectionRow ? height : width; // basis3种情况:auto、固定、content,只区分固定和其它 - var isFixed = [PX$9, PERCENT$a, REM$9, VW$9, VH$9].indexOf(flexBasis[1]) > -1; + var isFixed = [PX$2, PERCENT$2, REM$7, VW$7, VH$7].indexOf(flexBasis[1]) > -1; if (isFixed) { - if (flexBasis[1] === PX$9) { + if (flexBasis[1] === PX$2) { b = max = min = flexBasis[0]; - } else if (flexBasis[1] === PERCENT$a) { + } else if (flexBasis[1] === PERCENT$2) { 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]; - } else if (flexBasis[1] === VW$9) { + } else if (flexBasis[1] === REM$7) { + b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (flexBasis[1] === VW$7) { b = max = min = flexBasis[0] * this.root.width * 0.01; - } else if (flexBasis[1] === VH$9) { + } else if (flexBasis[1] === VH$7) { b = max = min = flexBasis[0] * this.root.height * 0.01; } - } else if ([PX$9, PERCENT$a, REM$9, VW$9, VH$9].indexOf(main[1]) > -1) { - if (main[1] === PX$9) { + } else if ([PX$2, PERCENT$2, REM$7, VW$7, VH$7].indexOf(main[1]) > -1) { + if (main[1] === PX$2) { b = max = min = main[0]; - } else if (main[1] === PERCENT$a) { + } else if (main[1] === PERCENT$2) { 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]; - } else if (main[1] === VW$9) { + } else if (main[1] === REM$7) { + b = max = min = main[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (main[1] === VW$7) { b = max = min = main[0] * this.root.width * 0.01; - } else if (main[1] === VH$9) { + } else if (main[1] === VH$7) { b = max = min = main[0] * this.root.height * 0.01; } } // auto和content固定尺寸比例计算 else if (__loadImg.source || __loadImg.error) { - if (cross[1] !== AUTO$7) { - if (cross[1] === PX$9) { - cross = cross[0]; - } 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]; - } else if (cross[1] === VW$9) { - cross = cross[0] * this.root.width * 0.01; - } else if (cross[1] === VH$9) { - cross = cross[0] * this.root.height * 0.01; - } - - var ratio = __loadImg.width / __loadImg.height; - b = max = min = isDirectionRow ? cross * ratio : cross / ratio; - } else { - b = max = min = isDirectionRow ? __loadImg.width : __loadImg.height; - } - } // border也得计算在内 + if (cross[1] !== AUTO$1) { + if (cross[1] === PX$2) { + cross = cross[0]; + } else if (cross[1] === PERCENT$2) { + cross = cross[0] * 0.01 * (isDirectionRow ? h : w); + } else if (cross[1] === REM$7) { + cross = cross[0] * this.root.computedStyle[FONT_SIZE$7]; + } else if (cross[1] === VW$7) { + cross = cross[0] * this.root.width * 0.01; + } else if (cross[1] === VH$7) { + cross = cross[0] * this.root.height * 0.01; + } + + var ratio = __loadImg.width / __loadImg.height; + b = max = min = isDirectionRow ? cross * ratio : cross / ratio; + } else { + b = max = min = isDirectionRow ? __loadImg.width : __loadImg.height; + } + } // border也得计算在内 if (isDirectionRow) { @@ -25229,10 +25234,10 @@ var res = {}; - res[UPDATE_NODE$4] = self; - res[UPDATE_FOCUS$3] = o$3.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行 + res[UPDATE_NODE$1] = self; + res[UPDATE_FOCUS$1] = o$1.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行 - res[UPDATE_CONFIG$4] = self.__config; + res[UPDATE_CONFIG$1] = self.__config; root.__addUpdate(self, self.__config, root, root.__config, res); } @@ -25247,11 +25252,11 @@ if (data.url === loadImg.src && !self.isDestroyed) { var reload = function reload() { var _self$currentStyle = self.currentStyle, - width = _self$currentStyle[WIDTH$6], - height = _self$currentStyle[HEIGHT$6]; + width = _self$currentStyle[WIDTH$2], + height = _self$currentStyle[HEIGHT$2]; root.delRefreshTask(self.__task); - if (width[1] !== AUTO$7 && height[1] !== AUTO$7) { + if (width[1] !== AUTO$1 && height[1] !== AUTO$1) { root.addRefreshTask(self.__task = { __before: function __before() { self.__task = null; @@ -25262,14 +25267,14 @@ var res = {}; - res[UPDATE_NODE$4] = self; - res[UPDATE_FOCUS$3] = o$3.REPAINT; - res[UPDATE_CONFIG$4] = self.__config; + res[UPDATE_NODE$1] = self; + res[UPDATE_FOCUS$1] = o$1.REPAINT; + res[UPDATE_CONFIG$1] = self.__config; root.__addUpdate(self, self.__config, root, root.__config, res); }, __after: function __after() { - if (isFunction$5(cb)) { + if (isFunction$3(cb)) { cb.call(self); } } @@ -25285,15 +25290,15 @@ var res = {}; - res[UPDATE_NODE$4] = self; - res[UPDATE_FOCUS$3] = o$3.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行 + res[UPDATE_NODE$1] = self; + res[UPDATE_FOCUS$1] = o$1.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行 - res[UPDATE_CONFIG$4] = self.__config; + res[UPDATE_CONFIG$1] = self.__config; root.__addUpdate(self, self.__config, root, root.__config, res); }, __after: function __after() { - if (isFunction$5(cb)) { + if (isFunction$3(cb)) { cb.call(self); } } @@ -25329,7 +25334,7 @@ } // 可见状态进行刷新操作,visibility某些情况需要刷新,可能宽高未定义要重新布局 - if (computedStyle[DISPLAY$7] !== 'none') { + if (computedStyle[DISPLAY$3] !== 'none') { reload(); } } @@ -25348,7 +25353,7 @@ var root = this.root; // 相等或空且当前error直接返回 if (v === loadImg.src || !v && loadImg.error) { - if (isFunction$5(cb)) { + if (isFunction$3(cb)) { cb(-1); } } else if (v) { @@ -25369,14 +25374,14 @@ } var res = {}; - res[UPDATE_NODE$4] = self; - res[UPDATE_FOCUS$3] = o$3.REFLOW; - res[UPDATE_CONFIG$4] = self.__config; + res[UPDATE_NODE$1] = self; + res[UPDATE_FOCUS$1] = o$1.REFLOW; + res[UPDATE_CONFIG$1] = self.__config; root.__addUpdate(self, self.__config, root, self.__config, res); }, __after: function __after(diff) { - if (isFunction$5(cb)) { + if (isFunction$3(cb)) { cb(diff); } } @@ -25396,9 +25401,9 @@ }]); return Img; - }(Dom$1); + }(Dom); - _defineProperty(Img$1, "showError", true); + _defineProperty(Img, "showError", true); var Defs = /*#__PURE__*/function () { function Defs(uuid) { @@ -25470,53 +25475,53 @@ return Defs; }(); - var _enums$STYLE_KEY$h = enums.STYLE_KEY, - DISPLAY$8 = _enums$STYLE_KEY$h.DISPLAY, - MARGIN_TOP$3 = _enums$STYLE_KEY$h.MARGIN_TOP, - MARGIN_RIGHT$5 = _enums$STYLE_KEY$h.MARGIN_RIGHT, - MARGIN_BOTTOM$3 = _enums$STYLE_KEY$h.MARGIN_BOTTOM, - MARGIN_LEFT$5 = _enums$STYLE_KEY$h.MARGIN_LEFT, - PADDING_TOP$4 = _enums$STYLE_KEY$h.PADDING_TOP, - PADDING_RIGHT$5 = _enums$STYLE_KEY$h.PADDING_RIGHT, - PADDING_BOTTOM$4 = _enums$STYLE_KEY$h.PADDING_BOTTOM, - PADDING_LEFT$6 = _enums$STYLE_KEY$h.PADDING_LEFT, - WIDTH$7 = _enums$STYLE_KEY$h.WIDTH, - HEIGHT$7 = _enums$STYLE_KEY$h.HEIGHT, - BORDER_TOP_WIDTH$5 = _enums$STYLE_KEY$h.BORDER_TOP_WIDTH, - BORDER_RIGHT_WIDTH$6 = _enums$STYLE_KEY$h.BORDER_RIGHT_WIDTH, - BORDER_BOTTOM_WIDTH$5 = _enums$STYLE_KEY$h.BORDER_BOTTOM_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$5 = _enums$STYLE_KEY$h.VISIBILITY, - FONT_SIZE$b = _enums$STYLE_KEY$h.FONT_SIZE, - FLEX_BASIS$4 = _enums$STYLE_KEY$h.FLEX_BASIS, - _enums$NODE_KEY$7 = enums.NODE_KEY, - NODE_CACHE_PROPS = _enums$NODE_KEY$7.NODE_CACHE_PROPS, - NODE_CURRENT_PROPS = _enums$NODE_KEY$7.NODE_CURRENT_PROPS, - NODE_CURRENT_STYLE$3 = _enums$NODE_KEY$7.NODE_CURRENT_STYLE, - NODE_STYLE$3 = _enums$NODE_KEY$7.NODE_STYLE, - NODE_DEFS_CACHE$5 = _enums$NODE_KEY$7.NODE_DEFS_CACHE; - var PX$a = o.PX, - PERCENT$b = o.PERCENT, - REM$a = o.REM, - VW$a = o.VW, - VH$a = o.VH; - var int2rgba$3 = util.int2rgba, - isNil$7 = util.isNil, - joinArr$3 = util.joinArr; - var canvasPolygon$6 = painter.canvasPolygon, - svgPolygon$7 = painter.svgPolygon; - var REGISTER$1 = {}; + var _enums$STYLE_KEY$8 = enums.STYLE_KEY, + DISPLAY$2 = _enums$STYLE_KEY$8.DISPLAY, + MARGIN_TOP$1 = _enums$STYLE_KEY$8.MARGIN_TOP, + MARGIN_RIGHT = _enums$STYLE_KEY$8.MARGIN_RIGHT, + MARGIN_BOTTOM$1 = _enums$STYLE_KEY$8.MARGIN_BOTTOM, + MARGIN_LEFT$1 = _enums$STYLE_KEY$8.MARGIN_LEFT, + PADDING_TOP$1 = _enums$STYLE_KEY$8.PADDING_TOP, + PADDING_RIGHT = _enums$STYLE_KEY$8.PADDING_RIGHT, + PADDING_BOTTOM$1 = _enums$STYLE_KEY$8.PADDING_BOTTOM, + PADDING_LEFT$1 = _enums$STYLE_KEY$8.PADDING_LEFT, + WIDTH$1 = _enums$STYLE_KEY$8.WIDTH, + HEIGHT$1 = _enums$STYLE_KEY$8.HEIGHT, + BORDER_TOP_WIDTH$1 = _enums$STYLE_KEY$8.BORDER_TOP_WIDTH, + BORDER_RIGHT_WIDTH = _enums$STYLE_KEY$8.BORDER_RIGHT_WIDTH, + BORDER_BOTTOM_WIDTH$1 = _enums$STYLE_KEY$8.BORDER_BOTTOM_WIDTH, + BORDER_LEFT_WIDTH$1 = _enums$STYLE_KEY$8.BORDER_LEFT_WIDTH, + FILL$1 = _enums$STYLE_KEY$8.FILL, + STROKE = _enums$STYLE_KEY$8.STROKE, + STROKE_MITERLIMIT = _enums$STYLE_KEY$8.STROKE_MITERLIMIT, + STROKE_WIDTH$6 = _enums$STYLE_KEY$8.STROKE_WIDTH, + STROKE_LINECAP = _enums$STYLE_KEY$8.STROKE_LINECAP, + STROKE_LINEJOIN = _enums$STYLE_KEY$8.STROKE_LINEJOIN, + STROKE_DASHARRAY = _enums$STYLE_KEY$8.STROKE_DASHARRAY, + STROKE_DASHARRAY_STR = _enums$STYLE_KEY$8.STROKE_DASHARRAY_STR, + FILL_RULE = _enums$STYLE_KEY$8.FILL_RULE, + VISIBILITY$2 = _enums$STYLE_KEY$8.VISIBILITY, + FONT_SIZE$6 = _enums$STYLE_KEY$8.FONT_SIZE, + FLEX_BASIS = _enums$STYLE_KEY$8.FLEX_BASIS, + _enums$NODE_KEY$3 = enums.NODE_KEY, + NODE_CACHE_PROPS$1 = _enums$NODE_KEY$3.NODE_CACHE_PROPS, + NODE_CURRENT_PROPS$1 = _enums$NODE_KEY$3.NODE_CURRENT_PROPS, + NODE_CURRENT_STYLE$3 = _enums$NODE_KEY$3.NODE_CURRENT_STYLE, + NODE_STYLE$2 = _enums$NODE_KEY$3.NODE_STYLE, + NODE_DEFS_CACHE$1 = _enums$NODE_KEY$3.NODE_DEFS_CACHE; + var PX$1 = o$4.PX, + PERCENT$1 = o$4.PERCENT, + REM$6 = o$4.REM, + VW$6 = o$4.VW, + VH$6 = o$4.VH; + var int2rgba = util.int2rgba, + isNil$8 = util.isNil, + joinArr = util.joinArr; + var canvasPolygon$1 = painter.canvasPolygon, + svgPolygon = painter.svgPolygon; + var REGISTER = {}; - var Geom$1 = /*#__PURE__*/function (_Xom) { + var Geom = /*#__PURE__*/function (_Xom) { _inherits(Geom, _Xom); var _super = _createSuper(Geom); @@ -25532,10 +25537,10 @@ _this.__currentStyle = util.extend({}, _this.__style); _this.__currentProps = util.clone(_this.props); var config = _this.__config; - config[NODE_CACHE_PROPS] = _this.__cacheProps = {}; - config[NODE_CURRENT_PROPS] = _this.__currentProps; + config[NODE_CACHE_PROPS$1] = _this.__cacheProps = {}; + config[NODE_CURRENT_PROPS$1] = _this.__currentProps; config[NODE_CURRENT_STYLE$3] = _this.__currentStyle; - config[NODE_STYLE$3] = _this.__style; + config[NODE_STYLE$2] = _this.__style; return _this; } @@ -25544,92 +25549,92 @@ value: function __tryLayInline(w, total) { // 无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]; - - if (width[1] === PX$a) { + width = _this$currentStyle[WIDTH$1], + marginLeft = _this$currentStyle[MARGIN_LEFT$1], + marginRight = _this$currentStyle[MARGIN_RIGHT], + paddingLeft = _this$currentStyle[PADDING_LEFT$1], + paddingRight = _this$currentStyle[PADDING_RIGHT], + borderLeftWidth = _this$currentStyle[BORDER_LEFT_WIDTH$1], + borderRightWidth = _this$currentStyle[BORDER_RIGHT_WIDTH]; + + if (width[1] === PX$1) { w -= width[0]; - } else if (width[1] === PERCENT$b) { + } else if (width[1] === PERCENT$1) { w -= total * width[0] * 0.01; - } else if (width[1] === REM$a) { - w -= width[0] * this.root.computedStyle[FONT_SIZE$b]; - } else if (width[1] === VW$a) { + } else if (width[1] === REM$6) { + w -= width[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (width[1] === VW$6) { w -= width[0] * this.root.width * 0.01; - } else if (width[1] === VH$a) { + } else if (width[1] === VH$6) { w -= width[0] * this.root.height * 0.01; } // 减去水平mbp - if (marginLeft[1] === PX$a) { + if (marginLeft[1] === PX$1) { w -= marginLeft[0]; - } else if (marginLeft[1] === PERCENT$b) { + } else if (marginLeft[1] === PERCENT$1) { w -= marginLeft[0] * total * 0.01; - } else if (marginLeft[1] === REM$a) { - w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE$b]; - } else if (marginLeft[1] === VW$a) { + } else if (marginLeft[1] === REM$6) { + w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (marginLeft[1] === VW$6) { w -= marginLeft[0] * this.root.width * 0.01; - } else if (marginLeft[1] === VH$a) { + } else if (marginLeft[1] === VH$6) { w -= marginLeft[0] * this.root.height * 0.01; } - if (paddingLeft[1] === PX$a) { + if (paddingLeft[1] === PX$1) { w -= paddingLeft[0]; - } else if (paddingLeft[1] === PERCENT$b) { + } else if (paddingLeft[1] === PERCENT$1) { w -= paddingLeft[0] * total * 0.01; - } else if (paddingLeft[1] === REM$a) { - w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE$b]; - } else if (paddingLeft[1] === VW$a) { + } else if (paddingLeft[1] === REM$6) { + w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (paddingLeft[1] === VW$6) { w -= paddingLeft[0] * this.root.width * 0.01; - } else if (paddingLeft[1] === VH$a) { + } else if (paddingLeft[1] === VH$6) { w -= paddingLeft[0] * this.root.height * 0.01; } - if (borderLeftWidth[1] === PX$a) { + if (borderLeftWidth[1] === PX$1) { w -= borderLeftWidth[0]; - } else if (borderLeftWidth[1] === REM$a) { - w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$b]; - } else if (borderLeftWidth[1] === VW$a) { + } else if (borderLeftWidth[1] === REM$6) { + w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (borderLeftWidth[1] === VW$6) { w -= borderLeftWidth[0] * this.root.width * 0.01; - } else if (borderLeftWidth[1] === VH$a) { + } else if (borderLeftWidth[1] === VH$6) { w -= borderLeftWidth[0] * this.root.height * 0.01; } - if (marginRight[1] === PX$a) { + if (marginRight[1] === PX$1) { w -= marginRight[0]; - } else if (marginRight[1] === PERCENT$b) { + } else if (marginRight[1] === PERCENT$1) { w -= marginRight[0] * total * 0.01; - } else if (marginRight[1] === REM$a) { - w -= marginRight[0] * this.root.computedStyle[FONT_SIZE$b]; - } else if (marginRight[1] === VW$a) { + } else if (marginRight[1] === REM$6) { + w -= marginRight[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (marginRight[1] === VW$6) { w -= marginRight[0] * this.root.width * 0.01; - } else if (marginRight[1] === VH$a) { + } else if (marginRight[1] === VH$6) { w -= marginRight[0] * this.root.height * 0.01; } - if (paddingRight[1] === PX$a) { + if (paddingRight[1] === PX$1) { w -= paddingRight[0]; - } else if (paddingRight[1] === PERCENT$b) { + } else if (paddingRight[1] === PERCENT$1) { w -= paddingRight[0] * total * 0.01; - } else if (paddingRight[1] === REM$a) { - w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE$b]; - } else if (paddingRight[1] === VW$a) { + } else if (paddingRight[1] === REM$6) { + w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (paddingRight[1] === VW$6) { w -= paddingRight[0] * this.root.width * 0.01; - } else if (paddingRight[1] === VH$a) { + } else if (paddingRight[1] === VH$6) { w -= paddingRight[0] * this.root.height * 0.01; } - if (borderRightWidth[1] === PX$a) { + if (borderRightWidth[1] === PX$1) { w -= borderRightWidth[0]; - } else if (borderRightWidth[1] === REM$a) { - w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$b]; - } else if (borderRightWidth[1] === VW$a) { + } else if (borderRightWidth[1] === REM$6) { + w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (borderRightWidth[1] === VW$6) { w -= borderRightWidth[0] * this.root.width * 0.01; - } else if (borderRightWidth[1] === VH$a) { + } else if (borderRightWidth[1] === VH$6) { w -= borderRightWidth[0] * this.root.height * 0.01; } @@ -25643,18 +25648,18 @@ var max = 0; var currentStyle = this.currentStyle; // 计算需考虑style的属性 - var width = currentStyle[WIDTH$7], - height = currentStyle[HEIGHT$7], - display = currentStyle[DISPLAY$8]; + var width = currentStyle[WIDTH$1], + height = currentStyle[HEIGHT$1], + display = currentStyle[DISPLAY$2]; var main = isDirectionRow ? width : height; // 只绝对值生效,%不生效,依旧要判断 - if (main[1] === PX$a) { + if (main[1] === PX$1) { min = max = main[0]; - } else if (main[1] === REM$a) { - min = max = main[0] * this.root.computedStyle[FONT_SIZE$b]; - } else if (main[1] === VW$a) { + } else if (main[1] === REM$6) { + min = max = main[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (main[1] === VW$6) { min = max = main[0] * this.root.width * 0.01; - } else if (main[1] === VH$a) { + } else if (main[1] === VH$6) { min = max = main[0] * this.root.height * 0.01; } @@ -25670,47 +25675,47 @@ var w = data.w, h = data.h; // 计算需考虑style的属性 - var flexBasis = currentStyle[FLEX_BASIS$4], - width = currentStyle[WIDTH$7], - height = currentStyle[HEIGHT$7], - marginLeft = currentStyle[MARGIN_LEFT$5], - marginTop = currentStyle[MARGIN_TOP$3], - marginRight = currentStyle[MARGIN_RIGHT$5], - marginBottom = currentStyle[MARGIN_BOTTOM$3], - paddingLeft = currentStyle[PADDING_LEFT$6], - paddingTop = currentStyle[PADDING_TOP$4], - paddingRight = currentStyle[PADDING_RIGHT$5], - paddingBottom = currentStyle[PADDING_BOTTOM$4], - borderTopWidth = currentStyle[BORDER_TOP_WIDTH$5], - borderRightWidth = currentStyle[BORDER_RIGHT_WIDTH$6], - borderBottomWidth = currentStyle[BORDER_BOTTOM_WIDTH$5], - borderLeftWidth = currentStyle[BORDER_LEFT_WIDTH$7]; + var flexBasis = currentStyle[FLEX_BASIS], + width = currentStyle[WIDTH$1], + height = currentStyle[HEIGHT$1], + marginLeft = currentStyle[MARGIN_LEFT$1], + marginTop = currentStyle[MARGIN_TOP$1], + marginRight = currentStyle[MARGIN_RIGHT], + marginBottom = currentStyle[MARGIN_BOTTOM$1], + paddingLeft = currentStyle[PADDING_LEFT$1], + paddingTop = currentStyle[PADDING_TOP$1], + paddingRight = currentStyle[PADDING_RIGHT], + paddingBottom = currentStyle[PADDING_BOTTOM$1], + borderTopWidth = currentStyle[BORDER_TOP_WIDTH$1], + borderRightWidth = currentStyle[BORDER_RIGHT_WIDTH], + borderBottomWidth = currentStyle[BORDER_BOTTOM_WIDTH$1], + borderLeftWidth = currentStyle[BORDER_LEFT_WIDTH$1]; var main = isDirectionRow ? width : height; // basis3种情况:auto、固定、content,只区分固定和其它 - var isFixed = [PX$a, PERCENT$b, REM$a, VW$a, VH$a].indexOf(flexBasis[1]) > -1; + var isFixed = [PX$1, PERCENT$1, REM$6, VW$6, VH$6].indexOf(flexBasis[1]) > -1; if (isFixed) { - if (flexBasis[1] === PX$a) { + if (flexBasis[1] === PX$1) { b = max = min = flexBasis[0]; - } else if (flexBasis[1] === PERCENT$b) { + } else if (flexBasis[1] === PERCENT$1) { 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]; - } else if (flexBasis[1] === VW$a) { + } else if (flexBasis[1] === REM$6) { + b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (flexBasis[1] === VW$6) { b = max = min = flexBasis[0] * this.root.width * 0.01; - } else if (flexBasis[1] === VH$a) { + } else if (flexBasis[1] === VH$6) { b = max = min = flexBasis[0] * this.root.height * 0.01; } - } else if ([PX$a, PERCENT$b, REM$a, VW$a, VH$a].indexOf(main[1]) > -1) { - if (main[1] === PX$a) { + } else if ([PX$1, PERCENT$1, REM$6, VW$6, VH$6].indexOf(main[1]) > -1) { + if (main[1] === PX$1) { b = max = min = main[0]; - } else if (main[1] === PERCENT$b) { + } else if (main[1] === PERCENT$1) { 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]; - } else if (main[1] === VW$a) { + } else if (main[1] === REM$6) { + b = max = min = main[0] * this.root.computedStyle[FONT_SIZE$6]; + } else if (main[1] === VW$6) { b = max = min = main[0] * this.root.width * 0.01; - } else if (main[1] === VH$a) { + } else if (main[1] === VH$6) { b = max = min = main[0] * this.root.height * 0.01; } } // border也得计算在内 @@ -25756,7 +25761,7 @@ this.__marginAuto(this.currentStyle, data); - this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {}; + this.__config[NODE_CACHE_PROPS$1] = this.__cacheProps = {}; } }, { key: "__layoutFlex", @@ -25781,7 +25786,7 @@ this.__ioSize(tw, th); - this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {}; + this.__config[NODE_CACHE_PROPS$1] = this.__cacheProps = {}; } }, { key: "__calCache", @@ -25790,20 +25795,20 @@ var res = _get(_getPrototypeOf(Geom.prototype), "__calCache", this).call(this, renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle, clientWidth, clientHeight, offsetWidth, offsetHeight, borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth, paddingTop, paddingRight, paddingBottom, paddingLeft, x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6); - if (isNil$7(__cacheStyle[STROKE_WIDTH$1])) { - __cacheStyle[STROKE_WIDTH$1] = true; - var strokeWidth = currentStyle[STROKE_WIDTH$1] || []; + if (isNil$8(__cacheStyle[STROKE_WIDTH$6])) { + __cacheStyle[STROKE_WIDTH$6] = true; + var strokeWidth = currentStyle[STROKE_WIDTH$6] || []; var w = this.width; - computedStyle[STROKE_WIDTH$1] = strokeWidth.map(function (item) { - if (item[1] === PX$a) { + computedStyle[STROKE_WIDTH$6] = strokeWidth.map(function (item) { + if (item[1] === PX$1) { return item[0]; - } else if (item[1] === PERCENT$b) { + } else if (item[1] === PERCENT$1) { return item[0] * w * 0.01; - } else if (item[1] === REM$a) { - return item[0] * _this2.root.computedStyle[FONT_SIZE$b]; - } else if (item[1] === VW$a) { + } else if (item[1] === REM$6) { + return item[0] * _this2.root.computedStyle[FONT_SIZE$6]; + } else if (item[1] === VW$6) { return item[0] * _this2.root.width * 0.01; - } else if (item[1] === VH$a) { + } else if (item[1] === VH$6) { return item[0] * _this2.root.height * 0.01; } else { return 0; @@ -25811,11 +25816,11 @@ }); } - if (isNil$7(__cacheStyle[STROKE_DASHARRAY$1])) { - __cacheStyle[STROKE_DASHARRAY$1] = true; - computedStyle[STROKE_DASHARRAY$1] = currentStyle[STROKE_DASHARRAY$1] || []; - __cacheStyle[STROKE_DASHARRAY_STR] = computedStyle[STROKE_DASHARRAY$1].map(function (item) { - return joinArr$3(item, ','); + if (isNil$8(__cacheStyle[STROKE_DASHARRAY])) { + __cacheStyle[STROKE_DASHARRAY] = true; + computedStyle[STROKE_DASHARRAY] = currentStyle[STROKE_DASHARRAY] || []; + __cacheStyle[STROKE_DASHARRAY_STR] = computedStyle[STROKE_DASHARRAY].map(function (item) { + return joinArr(item, ','); }); } // 直接赋值的 @@ -25824,8 +25829,8 @@ computedStyle[k] = currentStyle[k]; }); // stroke/fll移至render里处理,因为cache涉及渐变坐标偏移 - [STROKE$1, FILL$1].forEach(function (k) { - if (isNil$7(__cacheStyle[k])) { + [STROKE, FILL$1].forEach(function (k) { + if (isNil$8(__cacheStyle[k])) { var v = currentStyle[k]; computedStyle[k] = v; var _res = []; @@ -25835,7 +25840,7 @@ if (item && (item.k === 'linear' || item.k === 'radial' || item.k === 'conic')) { _res.push(_this2.__gradient(renderMode, ctx, x3, y3, x4, y4, item)); } else if (item[3] > 0) { - _res.push(int2rgba$3(item)); + _res.push(int2rgba(item)); } else { _res.push('none'); } @@ -25851,7 +25856,7 @@ key: "__calContent", value: function __calContent(renderMode, lv, currentStyle, computedStyle) { // Geom强制有内容 - return computedStyle[VISIBILITY$5] !== 'hidden'; + return computedStyle[VISIBILITY$2] !== 'hidden'; } }, { key: "__preSet", @@ -25863,13 +25868,13 @@ var cx = res.sx3 + width * 0.5; var cy = res.sy3 + height * 0.5; var fill = __cacheStyle[FILL$1], - stroke = __cacheStyle[STROKE$1], + stroke = __cacheStyle[STROKE], strokeDasharrayStr = __cacheStyle[STROKE_DASHARRAY_STR]; - var strokeWidth = computedStyle[STROKE_WIDTH$1], + var strokeWidth = computedStyle[STROKE_WIDTH$6], strokeLinecap = computedStyle[STROKE_LINECAP], strokeLinejoin = computedStyle[STROKE_LINEJOIN], strokeMiterlimit = computedStyle[STROKE_MITERLIMIT], - strokeDasharray = computedStyle[STROKE_DASHARRAY$1], + strokeDasharray = computedStyle[STROKE_DASHARRAY], fillRule = computedStyle[FILL_RULE]; return { cx: cx, @@ -25999,43 +26004,43 @@ this.__renderOnePolygon(renderMode, ctx, isMulti, list, o); } // 多个需要fill在下面,stroke在上面,依次循环 else { - for (var i = 0, len = fills.length; i < len; i++) { - var fill = fills[i]; - - if (fill) { - var _o = { - fill: fill, - fillRule: fillRules[i], - dx: dx, - dy: dy, - bbox: bbox - }; + for (var i = 0, len = fills.length; i < len; i++) { + var fill = fills[i]; + + if (fill) { + var _o = { + fill: fill, + fillRule: fillRules[i], + dx: dx, + dy: dy, + bbox: bbox + }; - this.__renderOnePolygon(renderMode, ctx, isMulti, list, _o); - } + this.__renderOnePolygon(renderMode, ctx, isMulti, list, _o); } + } - for (var _i = 0, _len = strokes.length; _i < _len; _i++) { - var stroke = strokes[_i]; - - if (stroke) { - var _o2 = { - stroke: stroke, - strokeWidth: strokeWidths[_i], - strokeDasharray: strokeDasharrays[_i], - strokeDasharrayStr: strokeDasharrayStrs[_i], - strokeLinecap: strokeLinecaps[_i], - strokeLinejoin: strokeLinejoins[_i], - strokeMiterlimit: strokeMiterlimits[_i], - dx: dx, - dy: dy, - bbox: bbox - }; + for (var _i = 0, _len = strokes.length; _i < _len; _i++) { + var stroke = strokes[_i]; - this.__renderOnePolygon(renderMode, ctx, isMulti, list, _o2); - } + if (stroke) { + var _o2 = { + stroke: stroke, + strokeWidth: strokeWidths[_i], + strokeDasharray: strokeDasharrays[_i], + strokeDasharrayStr: strokeDasharrayStrs[_i], + strokeLinecap: strokeLinecaps[_i], + strokeLinejoin: strokeLinejoins[_i], + strokeMiterlimit: strokeMiterlimits[_i], + dx: dx, + dy: dy, + bbox: bbox + }; + + this.__renderOnePolygon(renderMode, ctx, isMulti, list, _o2); } } + } } }, { key: "__renderOnePolygon", @@ -26102,10 +26107,10 @@ if (isMulti) { list.forEach(function (item) { - return canvasPolygon$6(ctx, item, dx, dy); + return canvasPolygon$1(ctx, item, dx, dy); }); } else { - canvasPolygon$6(ctx, list, dx, dy); + canvasPolygon$1(ctx, list, dx, dy); } if (isFill && fill && fill !== 'none') { @@ -26122,10 +26127,10 @@ if (isMulti) { list.forEach(function (item) { - return d += svgPolygon$7(item); + return d += svgPolygon(item); }); } else { - d = svgPolygon$7(list); + d = svgPolygon(list); } var props = [['d', d]]; // 2个都没有常出现在多fill/stroke时,也有可能特殊单个故意这样写的 @@ -26241,7 +26246,7 @@ return painter.canvasPolygon(ctx, item, dx, dy); }); } else { - canvasPolygon$6(ctx, list, dx, dy); + canvasPolygon$1(ctx, list, dx, dy); } ctx[method](); @@ -26255,10 +26260,10 @@ if (isMulti) { list.forEach(function (item) { - return d += svgPolygon$7(item); + return d += svgPolygon(item); }); } else { - d = svgPolygon$7(list); + d = svgPolygon(list); } var props = [['d', d]]; @@ -26274,7 +26279,7 @@ this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit); } - props.push(['transform', "matrix(".concat(joinArr$3(mx.m2m6(matrix), ','), ")")]); + props.push(['transform', "matrix(".concat(joinArr(mx.m2m6(matrix), ','), ")")]); this.addGeom('path', props); } } @@ -26302,14 +26307,14 @@ h = y2 - y1; var offscreen = inject.getCacheCanvas(w, h, '__$$CONIC_GRADIENT$$__'); var imgData = offscreen.ctx.getImageData(0, 0, w, h); - gradient.getConicGradientImage(w * 0.5, h * 0.5, w, h, fill.v.stop, imgData.data); + gradient$1.getConicGradientImage(w * 0.5, h * 0.5, w, h, fill.v.stop, imgData.data); offscreen.ctx.putImageData(imgData, 0, 0); if (isMulti) { list.forEach(function (item) { ctx.save(); ctx.beginPath(); - canvasPolygon$6(ctx, item, dx, dy); + canvasPolygon$1(ctx, item, dx, dy); ctx.clip(); ctx.closePath(); ctx.drawImage(offscreen.canvas, x1 + dx, y1 + dy); @@ -26318,7 +26323,7 @@ } else { ctx.save(); ctx.beginPath(); - canvasPolygon$6(ctx, list, dx, dy); + canvasPolygon$1(ctx, list, dx, dy); ctx.clip(); ctx.closePath(); ctx.drawImage(offscreen.canvas, x1 + dx, y1 + dy); @@ -26333,18 +26338,18 @@ tagName: 'clipPath', children: [{ tagName: 'path', - props: [['d', svgPolygon$7(item)]] + props: [['d', svgPolygon(item)]] }] }; var clip = ctx.add(v); - _this3.__config[NODE_DEFS_CACHE$5].push(v); + _this3.__config[NODE_DEFS_CACHE$1].push(v); color.forEach(function (item) { _this3.virtualDom.bb.push({ type: 'item', tagName: 'path', - props: [['d', svgPolygon$7(item[0])], ['fill', item[1]], ['clip-path', 'url(#' + clip + ')']] + props: [['d', svgPolygon(item[0])], ['fill', item[1]], ['clip-path', 'url(#' + clip + ')']] }); }); }); @@ -26353,18 +26358,18 @@ tagName: 'clipPath', children: [{ tagName: 'path', - props: [['d', svgPolygon$7(list)]] + props: [['d', svgPolygon(list)]] }] }; var clip = ctx.add(v); - this.__config[NODE_DEFS_CACHE$5].push(v); + this.__config[NODE_DEFS_CACHE$1].push(v); color.forEach(function (item) { _this3.virtualDom.bb.push({ type: 'item', tagName: 'path', - props: [['d', svgPolygon$7(item[0])], ['fill', item[1]], ['clip-path', 'url(#' + clip + ')']] + props: [['d', svgPolygon(item[0])], ['fill', item[1]], ['clip-path', 'url(#' + clip + ')']] }); }); } @@ -26399,28 +26404,28 @@ value: function __offsetX(diff, isLayout, lv) { _get(_getPrototypeOf(Geom.prototype), "__offsetX", this).call(this, diff, isLayout, lv); - this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {}; + this.__config[NODE_CACHE_PROPS$1] = this.__cacheProps = {}; } }, { key: "__offsetY", value: function __offsetY(diff, isLayout, lv) { _get(_getPrototypeOf(Geom.prototype), "__offsetY", this).call(this, diff, isLayout, lv); - this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {}; + this.__config[NODE_CACHE_PROPS$1] = this.__cacheProps = {}; } }, { key: "__resizeX", value: function __resizeX(diff, lv) { _get(_getPrototypeOf(Geom.prototype), "__resizeX", this).call(this, diff, lv); - this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {}; + this.__config[NODE_CACHE_PROPS$1] = this.__cacheProps = {}; } }, { key: "__resizeY", value: function __resizeY(diff, lv) { _get(_getPrototypeOf(Geom.prototype), "__resizeY", this).call(this, diff, lv); - this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {}; + this.__config[NODE_CACHE_PROPS$1] = this.__cacheProps = {}; } }, { key: "addGeom", @@ -26437,7 +26442,7 @@ value: function getProps(k) { var v = this.currentProps[k]; - if (!isNil$7(v)) { + if (!isNil$8(v)) { return v; } @@ -26461,7 +26466,7 @@ }], [{ key: "REGISTER", get: function get() { - return REGISTER$1; + return REGISTER; } }, { key: "getRegister", @@ -26470,11 +26475,11 @@ throw new Error('Invalid param'); } - if (!REGISTER$1.hasOwnProperty(name)) { + if (!REGISTER.hasOwnProperty(name)) { throw new Error("Geom has not register: ".concat(name)); } - return REGISTER$1[name]; + return REGISTER[name]; } }, { key: "register", @@ -26487,36 +26492,36 @@ throw new Error("Geom has already register: ".concat(name)); } - REGISTER$1[name] = obj; + REGISTER[name] = obj; } }, { key: "hasRegister", value: function hasRegister(name) { - return name && REGISTER$1.hasOwnProperty(name); + return name && REGISTER.hasOwnProperty(name); } }, { key: "delRegister", value: function delRegister(name) { if (Geom.hasRegister(name)) { - delete REGISTER$1[name]; + delete REGISTER[name]; } } }]); return Geom; - }(Xom$1); - - var _enums$NODE_KEY$8 = enums.NODE_KEY, - NODE_STYLE$4 = _enums$NODE_KEY$8.NODE_STYLE, - NODE_CURRENT_STYLE$4 = _enums$NODE_KEY$8.NODE_CURRENT_STYLE, - NODE_COMPUTED_STYLE$3 = _enums$NODE_KEY$8.NODE_COMPUTED_STYLE, - NODE_DOM_PARENT$4 = _enums$NODE_KEY$8.NODE_DOM_PARENT, - NODE_MATRIX$2 = _enums$NODE_KEY$8.NODE_MATRIX, - NODE_MATRIX_EVENT$3 = _enums$NODE_KEY$8.NODE_MATRIX_EVENT, - NODE_STRUCT$3 = _enums$NODE_KEY$8.NODE_STRUCT; - var TYPE_VD$3 = $$type.TYPE_VD, - TYPE_GM$3 = $$type.TYPE_GM, - TYPE_CP$3 = $$type.TYPE_CP; + }(Xom); + + var _enums$NODE_KEY$2 = enums.NODE_KEY, + NODE_STYLE$1 = _enums$NODE_KEY$2.NODE_STYLE, + NODE_CURRENT_STYLE$2 = _enums$NODE_KEY$2.NODE_CURRENT_STYLE, + NODE_COMPUTED_STYLE$2 = _enums$NODE_KEY$2.NODE_COMPUTED_STYLE, + NODE_DOM_PARENT$2 = _enums$NODE_KEY$2.NODE_DOM_PARENT, + NODE_MATRIX$1 = _enums$NODE_KEY$2.NODE_MATRIX, + NODE_MATRIX_EVENT$1 = _enums$NODE_KEY$2.NODE_MATRIX_EVENT, + NODE_STRUCT$1 = _enums$NODE_KEY$2.NODE_STRUCT; + var TYPE_VD$1 = $$type.TYPE_VD, + TYPE_GM$1 = $$type.TYPE_GM, + TYPE_CP$1 = $$type.TYPE_CP; var updateList = []; var removeList = []; var KEY_FLAG = {}; @@ -26525,21 +26530,21 @@ */ function check(vd) { - if (vd instanceof Dom$1) { + if (vd instanceof Dom) { vd.children.forEach(function (child) { - if (child instanceof Dom$1) { + if (child instanceof Dom) { check(child); } // 当组件有setState更新时,从叶子到根链路会标识__hasUpdate,以便节约遍历成本忽略那些没变化的链路 - else if (child instanceof Component$1 && child.__hasUpdate) { - child.__hasUpdate = false; - checkCp(child, child.props); - } + else if (child instanceof Component && child.__hasUpdate) { + child.__hasUpdate = false; + checkCp(child, child.props); + } }); } // 高阶组件会进入此分支,被父组件调用 - else if (vd instanceof Component$1 && vd.__hasUpdate) { - vd.__hasUpdate = false; - checkCp(vd, vd.props); - } + else if (vd instanceof Component && vd.__hasUpdate) { + vd.__hasUpdate = false; + checkCp(vd, vd.props); + } } /** * 检查cp是否有state变更,注意递归检查时需要看shadow不能看shadowRoot, @@ -26565,10 +26570,10 @@ updateCp(cp, nextProps, cp.__nextState || cp.state); } // 不更新则递归检查子tree的cp else { - cp.props = nextProps; - cp.state = cp.__nextState || cp.state; - check(cp.shadow); - } + cp.props = nextProps; + cp.state = cp.__nextState || cp.state; + check(cp.shadow); + } } else { check(cp.shadow); } @@ -26598,14 +26603,14 @@ var sr = cp.shadowRoot; - if (sr instanceof Xom$1) { + if (sr instanceof Xom) { ['__outerWidth', '__outerHeight', '__sx', '__sy', '__sx2', '__sx3', '__sx4', '__sx5', '__sx6', '__sy2', '__sy3', '__sy4', '__sy5', '__sy6'].forEach(function (k) { sr[k] = oldSr[k]; }); - sr.__computedStyle = sr.__config[NODE_COMPUTED_STYLE$3] = oldSr.computedStyle; + sr.__computedStyle = sr.__config[NODE_COMPUTED_STYLE$2] = oldSr.computedStyle; } else { var domParent = cp.domParent; - [NODE_STYLE$4, NODE_CURRENT_STYLE$4, NODE_COMPUTED_STYLE$3, NODE_MATRIX$2, NODE_MATRIX_EVENT$3].forEach(function (k) { + [NODE_STYLE$1, NODE_CURRENT_STYLE$2, NODE_COMPUTED_STYLE$2, NODE_MATRIX$1, NODE_MATRIX_EVENT$1].forEach(function (k) { sr.__config[k] = domParent.__config[k]; }); } @@ -26614,8 +26619,8 @@ '__sy1', '__layoutData', '__parent', '__domParent'].forEach(function (k) { sr[k] = oldSr[k]; }); - sr.__config[NODE_DOM_PARENT$4] = oldSr.domParent; - sr.__config[NODE_STRUCT$3] = oldSr.__config[NODE_STRUCT$3]; + sr.__config[NODE_DOM_PARENT$2] = oldSr.domParent; + sr.__config[NODE_STRUCT$1] = oldSr.__config[NODE_STRUCT$1]; updateList.push(cp); // 老的需回收,diff会生成新的dom,唯一列外是cp直接返回一个没变化的cp if (!util.isObject(json) || !json.__placeholder) { @@ -26685,7 +26690,7 @@ var nj = n.json; var vd = o.vd; // 相同class的组件进行对比替换 - if (oj.$$type === TYPE_CP$3 && nj.$$type === TYPE_CP$3) { + if (oj.$$type === TYPE_CP$1 && nj.$$type === TYPE_CP$1) { if (oj.klass === nj.klass) { // 对比props和children看是否全等,是则直接替换新json类型为占位符,引用老vd,否则强制更新 diffCp(oj, nj, vd); // 标识对比过了 @@ -26696,28 +26701,28 @@ } } // 相同类型的vd进行对比继承动画 else if (oj.$$type === nj.$$type && oj.tagName === nj.tagName) { - // 需判断矢量标签mutil是否相等 - if (nj.$$type !== TYPE_GM$3 || oj.props.multi === nj.props.multi) { - nj.__inheritAnimate = vd; - } + // 需判断矢量标签mutil是否相等 + if (nj.$$type !== TYPE_GM$1 || oj.props.multi === nj.props.multi) { + nj.__inheritAnimate = vd; + } - oj.key = nj.key = KEY_FLAG; // key相同的dom暂存下来 + oj.key = nj.key = KEY_FLAG; // key相同的dom暂存下来 - if (nj.$$type === TYPE_VD$3) { - keyList.push({ - vd: vd, - oj: oj, - nj: nj - }); - } + if (nj.$$type === TYPE_VD$1) { + keyList.push({ + vd: vd, + oj: oj, + nj: nj + }); } + } }); // key相同的dom对比children,下面非key逻辑就不做了 keyList.forEach(function (item) { diffChildren(item.vd, item.oj, item.nj); }); // 整体tree进行对比 - diffChild(vd, oj, nj); // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的 + diffChild$1(vd, oj, nj); // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的 cpList.forEach(function (vd) { removeCpFromOldTree(vd); @@ -26731,9 +26736,9 @@ */ - function diffChild(vd, oj, nj) { + function diffChild$1(vd, oj, nj) { if (util.isObject(nj)) { - if (nj.$$type === TYPE_CP$3) { + if (nj.$$type === TYPE_CP$1) { // key对比过了忽略 if (nj.key === KEY_FLAG) { return; @@ -26745,19 +26750,19 @@ removeCpFromOldTree(vd); } - } else if (nj.$$type === TYPE_GM$3 && oj && oj.$$type === TYPE_GM$3) { + } else if (nj.$$type === TYPE_GM$1 && oj && oj.$$type === TYPE_GM$1) { // $geom的multi必须一致 if (oj.tagName === nj.tagName && oj.props.multi === nj.props.multi) { nj.__inheritAnimate = vd; } } // dom类型递归children - else if (nj.$$type === TYPE_VD$3 && oj && oj.$$type === TYPE_VD$3) { - if (oj.tagName === nj.tagName) { - nj.__inheritAnimate = vd; - } - - diffChildren(vd, oj, nj); + else if (nj.$$type === TYPE_VD$1 && oj && oj.$$type === TYPE_VD$1) { + if (oj.tagName === nj.tagName) { + nj.__inheritAnimate = vd; } + + diffChildren(vd, oj, nj); + } } } /** @@ -26781,18 +26786,18 @@ if (o.key === KEY_FLAG && n.key === KEY_FLAG) ; // 其中一个是key对比过了调整索引和长度 else if (o.key === KEY_FLAG) { - of++; - i--; - ol--; - len = Math.min(ol, nl); - } else if (n.key === KEY_FLAG) { - nf++; - i--; - nl--; - len = Math.min(ol, nl); - } else { - diffChild(children[i + of], o, n); - } + of++; + i--; + ol--; + len = Math.min(ol, nl); + } else if (n.key === KEY_FLAG) { + nf++; + i--; + nl--; + len = Math.min(ol, nl); + } else { + diffChild$1(children[i + of], o, n); + } } // 长度不同增减的无需关注,新json创建cp有didMount,老vd会调用cp的destroy } @@ -26884,9 +26889,9 @@ return getKeyHash(item, hash, vd && vd[i]); }); } else if (util.isObject(json)) { - if (json.$$type === TYPE_VD$3 || json.$$type === TYPE_GM$3 || json.$$type === TYPE_CP$3) { + if (json.$$type === TYPE_VD$1 || json.$$type === TYPE_GM$1 || json.$$type === TYPE_CP$1) { // 深度优先 - if (json.$$type === TYPE_VD$3) { + if (json.$$type === TYPE_VD$1) { getKeyHash(json.children, hash, vd && vd.children); } @@ -26955,14 +26960,14 @@ did: did }; - var joinVd$1 = util.joinVd, - joinDef$1 = util.joinDef; - var contain$1 = o$3.contain, - NONE$1 = o$3.NONE, - TRANSFORM_ALL = o$3.TRANSFORM_ALL, - OPACITY$4 = o$3.OPACITY, - FILTER$4 = o$3.FILTER, - MIX_BLEND_MODE$2 = o$3.MIX_BLEND_MODE; + var joinVd = util.joinVd, + joinDef = util.joinDef; + var contain$2 = o$1.contain, + NONE$2 = o$1.NONE, + TRANSFORM_ALL$1 = o$1.TRANSFORM_ALL, + OPACITY$1 = o$1.OPACITY, + FILTER$2 = o$1.FILTER, + MIX_BLEND_MODE$1 = o$1.MIX_BLEND_MODE; function diff(elem, ovd, nvd) { var cns = elem.childNodes; @@ -26991,14 +26996,14 @@ } } else if (i < nl) { for (; i < nl; i++) { - insertAt(elem, cns, i, joinDef$1(nd[i])); + insertAt(elem, cns, i, joinDef(nd[i])); } } } function diffDef(elem, od, nd) { if (od.tagName !== nd.tagName) { - insertAdjacentHTML(elem, 'beforebegin', joinDef$1(nd)); // elem.insertAdjacentHTML('beforebegin', joinDef(nd)); + insertAdjacentHTML(elem, 'beforebegin', joinDef(nd)); // elem.insertAdjacentHTML('beforebegin', joinDef(nd)); elem.parentNode.removeChild(elem); } else { @@ -27056,13 +27061,13 @@ } } else if (i < nl) { for (; i < nl; i++) { - insertAt(elem, cns, i, joinVd$1(nd.children[i])); + insertAt(elem, cns, i, joinVd(nd.children[i])); } } } } - function diffChild$1(elem, ovd, nvd) { + function diffChild(elem, ovd, nvd) { if (ovd.type === 'dom') { if (nvd.type === 'dom') { diffD2D(elem, ovd, nvd); @@ -27180,11 +27185,11 @@ elem.removeAttribute('mask'); } - if (lv === NONE$1) { + if (lv === NONE$2) { return; } - if (contain$1(lv, TRANSFORM_ALL)) { + if (contain$2(lv, TRANSFORM_ALL$1)) { if (transform) { elem.setAttribute('transform', transform); } else { @@ -27192,7 +27197,7 @@ } } - if (contain$1(lv, OPACITY$4)) { + if (contain$2(lv, OPACITY$1)) { if (opacity !== 1 && opacity !== undefined) { elem.setAttribute('opacity', opacity); } else { @@ -27200,7 +27205,7 @@ } } - if (contain$1(lv, FILTER$4) || contain$1(lv, MIX_BLEND_MODE$2)) { + if (contain$2(lv, FILTER$2) || contain$2(lv, MIX_BLEND_MODE$1)) { var s = (filter ? "filter:".concat(filter, ";") : '') + (mixBlendMode ? "mix-blend-mode:".concat(mixBlendMode, ";") : ''); if (s) { @@ -27236,7 +27241,7 @@ var cns = lastChild.childNodes; for (; i < Math.min(ol, nl); i++) { - diffChild$1(cns[i], ovd.children[i], nvd.children[i]); + diffChild(cns[i], ovd.children[i], nvd.children[i]); } if (i < ol) { @@ -27245,7 +27250,7 @@ } } else if (i < nl) { for (; i < nl; i++) { - insertAt(lastChild, cns, i, joinVd$1(nvd.children[i])); + insertAt(lastChild, cns, i, joinVd(nvd.children[i])); } } } @@ -27269,7 +27274,7 @@ } } else if (i < nl) { for (; i < nl; i++) { - insertAt(lastChild, cns, i, joinVd$1(nvd.children[i])); + insertAt(lastChild, cns, i, joinVd(nvd.children[i])); } } } @@ -27295,7 +27300,7 @@ } } else if (i < nl) { for (; i < nl; i++) { - insertAt(elem, cns, i, joinVd$1(nvd.children[i])); + insertAt(elem, cns, i, joinVd(nvd.children[i])); } } } @@ -27332,7 +27337,7 @@ } } else if (i < nl) { for (; i < nl; i++) { - insertAt(lastChild, cns, i, joinVd$1(nvd.children[i])); + insertAt(lastChild, cns, i, joinVd(nvd.children[i])); } } } @@ -27355,7 +27360,7 @@ } } else if (i < nl) { for (; i < nl; i++) { - insertAt(elem, cns, i, joinVd$1(nbb[i])); + insertAt(elem, cns, i, joinVd(nbb[i])); } } } @@ -27422,10 +27427,10 @@ if (Array.isArray(vd)) { res = ''; vd.forEach(function (item) { - res += joinVd$1(item); + res += joinVd(item); }); } else { - res = joinVd$1(vd); + res = joinVd(vd); } insertAdjacentHTML(elem, 'beforebegin', res); // elem.insertAdjacentHTML('beforebegin', res); @@ -27467,7 +27472,7 @@ } } - var isFunction$6 = util.isFunction; + var isFunction$2 = util.isFunction; var Controller = /*#__PURE__*/function () { function Controller() { @@ -27592,7 +27597,7 @@ if (once) { once = false; - if (isFunction$6(cb)) { + if (isFunction$2(cb)) { cb(diff); } } @@ -27612,7 +27617,7 @@ if (once) { once = false; - if (isFunction$6(cb)) { + if (isFunction$2(cb)) { cb(diff); } } @@ -27641,7 +27646,7 @@ if (once) { once = false; - if (isFunction$6(cb)) { + if (isFunction$2(cb)) { cb(diff); } } @@ -27659,7 +27664,7 @@ if (once) { once = false; - if (isFunction$6(cb)) { + if (isFunction$2(cb)) { cb(diff); } } @@ -27677,7 +27682,7 @@ if (once) { once = false; - if (isFunction$6(cb)) { + if (isFunction$2(cb)) { cb(diff); } } @@ -27695,7 +27700,7 @@ if (once) { once = false; - if (isFunction$6(cb)) { + if (isFunction$2(cb)) { cb(diff); } } @@ -27704,7 +27709,7 @@ }, { key: "on", value: function on(id, handle) { - if (!isFunction$6(handle)) { + if (!isFunction$2(handle)) { return; } @@ -27824,7 +27829,7 @@ return Controller; }(); - var MockPage = function MockPage(texture, width, height) { + var MockPage = /*#__PURE__*/_createClass(function MockPage(texture, width, height) { _classCallCheck(this, MockPage); this.uuid = Page.genUuid(); @@ -27832,7 +27837,7 @@ this.texture = texture; this.width = width; this.height = height; - }; + }); /** * 一个fbo离屏纹理,mock成cache,当webgl需要局部根节点汇总时生成,即cacheTotal, @@ -27911,57 +27916,57 @@ var fragmentLuminosity = "#version 100\n#ifdef GL_ES\nprecision mediump float;\n#define GLSLIFY 1\n#endif\nvarying vec2 v_texCoords;uniform sampler2D u_texture1;uniform sampler2D u_texture2;float getLuminosity(vec3 color){return 0.3*color[0]+0.59*color[1]+0.11*color[2];}float clipLowest(float channel,float lowestChannel,float luminosity){return luminosity+((channel-luminosity)*luminosity)/(luminosity-lowestChannel);}float clipHighest(float channel,float highestChannel,float luminosity){return luminosity+((channel-luminosity)*(1.0-luminosity))/(highestChannel-luminosity);}vec3 clipColor(vec3 rgb){float luminosity=getLuminosity(rgb);float lowestChannel=min(rgb[0],min(rgb[1],rgb[2]));float highestChannel=max(rgb[0],max(rgb[1],rgb[2]));float r=rgb[0],g=rgb[1],b=rgb[2];if(lowestChannel<0.0){r=clipLowest(r,lowestChannel,luminosity);g=clipLowest(g,lowestChannel,luminosity);b=clipLowest(b,lowestChannel,luminosity);}if(highestChannel>1.0){r=clipHighest(r,highestChannel,luminosity);g=clipHighest(g,highestChannel,luminosity);b=clipHighest(b,highestChannel,luminosity);}return vec3(r,g,b);}vec3 setLuminosity(vec3 rgb,float luminosity){float delta=luminosity-getLuminosity(rgb);float r=rgb[0],g=rgb[1],b=rgb[2];return clipColor(vec3(r+delta,g+delta,b+delta));}float getSaturation(vec3 rgb){return max(rgb[0],max(rgb[1],rgb[2]))-min(rgb[0],min(rgb[1],rgb[2]));}vec3 setSaturation(vec3 rgb,float saturation){float r=rgb[0],g=rgb[1],b=rgb[2];float maxC=0.0,minC=0.0,midC=0.0;int maxI=0,minI=0,midI=0;if(r>=g&&r>=b){maxI=0;maxC=r;if(g>=b){minI=2;midI=1;minC=b;midC=g;}else{minI=1;midI=2;minC=g;midC=b;}}else if(g>=r&&g>=b){maxI=1;maxC=g;if(r>=b){minI=2;midI=0;minC=b;midC=r;}else{minI=0;midI=2;minC=r;midC=b;}}else if(b>=r&&b>=g){maxI=2;maxC=b;if(r>=g){minI=1;midI=0;minC=g;midC=r;}else{minI=0;midI=1;minC=r;midC=g;}}vec3 result=vec3(r,g,b);if(maxC>minC){midC=(midC-minC)*saturation/(maxC-minC);maxC=saturation;}else{maxC=midC=0.0;}minC=0.0;if(maxI==0){result[0]=maxC;}else if(maxI==1){result[1]=maxC;}else if(maxI==2){result[2]=maxC;}if(minI==0){result[0]=minC;}else if(minI==1){result[1]=minC;}else if(minI==2){result[2]=minC;}if(midI==0){result[0]=midC;}else if(midI==1){result[1]=midC;}else if(midI==2){result[2]=midC;}return result;}vec3 op(vec3 a,vec3 b){float l=getLuminosity(b);return setLuminosity(a,l);}vec3 premultipliedAlpha(vec4 color){float a=color.a;if(a==0.0){return vec3(0.0,0.0,0.0);}return vec3(color.r/a,color.g/a,color.b/a);}float alphaCompose(float a1,float a2,float a3,float c1,float c2,float c3){return(1.0-a2/a3)*c1+a2/a3*((1.0-a1)*c2+a1*c3);}void main(){vec4 color1=texture2D(u_texture1,v_texCoords);vec4 color2=texture2D(u_texture2,v_texCoords);if(color1.a==0.0){gl_FragColor=color2;}else if(color2.a==0.0){gl_FragColor=color1;}else{vec3 bottom=premultipliedAlpha(color1);vec3 top=premultipliedAlpha(color2);vec3 res=op(bottom,top);float a=color1.a+color2.a-color1.a*color2.a;gl_FragColor=vec4(alphaCompose(color1.a,color2.a,a,bottom.r,top.r,res.r)*a,alphaCompose(color1.a,color2.a,a,bottom.g,top.g,res.g)*a,alphaCompose(color1.a,color2.a,a,bottom.b,top.b,res.b)*a,a);}}"; // eslint-disable-line - var canvasPolygon$7 = painter.canvasPolygon; - var _enums$STYLE_KEY$i = enums.STYLE_KEY, - POSITION$4 = _enums$STYLE_KEY$i.POSITION, - DISPLAY$9 = _enums$STYLE_KEY$i.DISPLAY, - OPACITY$5 = _enums$STYLE_KEY$i.OPACITY, - VISIBILITY$6 = _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, - _enums$NODE_KEY$9 = enums.NODE_KEY, - NODE_CACHE$4 = _enums$NODE_KEY$9.NODE_CACHE, - NODE_CACHE_TOTAL$1 = _enums$NODE_KEY$9.NODE_CACHE_TOTAL, - NODE_CACHE_OVERFLOW$2 = _enums$NODE_KEY$9.NODE_CACHE_OVERFLOW, - NODE_CACHE_MASK$1 = _enums$NODE_KEY$9.NODE_CACHE_MASK, - NODE_CACHE_FILTER$2 = _enums$NODE_KEY$9.NODE_CACHE_FILTER, - NODE_MATRIX$3 = _enums$NODE_KEY$9.NODE_MATRIX, - NODE_MATRIX_EVENT$4 = _enums$NODE_KEY$9.NODE_MATRIX_EVENT, - NODE_OPACITY$3 = _enums$NODE_KEY$9.NODE_OPACITY, - NODE_COMPUTED_STYLE$4 = _enums$NODE_KEY$9.NODE_COMPUTED_STYLE, - NODE_CURRENT_STYLE$5 = _enums$NODE_KEY$9.NODE_CURRENT_STYLE, - NODE_LIMIT_CACHE$2 = _enums$NODE_KEY$9.NODE_LIMIT_CACHE, - NODE_REFRESH_LV$1 = _enums$NODE_KEY$9.NODE_REFRESH_LV, - NODE_CACHE_STYLE$1 = _enums$NODE_KEY$9.NODE_CACHE_STYLE, - NODE_DEFS_CACHE$6 = _enums$NODE_KEY$9.NODE_DEFS_CACHE, - NODE_IS_MASK$2 = _enums$NODE_KEY$9.NODE_IS_MASK, - NODE_DOM_PARENT$5 = _enums$NODE_KEY$9.NODE_DOM_PARENT, - NODE_PERSPECTIVE_MATRIX$1 = _enums$NODE_KEY$9.NODE_PERSPECTIVE_MATRIX, - NODE_VIRTUAL_DOM$2 = _enums$NODE_KEY$9.NODE_VIRTUAL_DOM, - _enums$STRUCT_KEY$2 = enums.STRUCT_KEY, - STRUCT_NODE$1 = _enums$STRUCT_KEY$2.STRUCT_NODE, - STRUCT_TOTAL$1 = _enums$STRUCT_KEY$2.STRUCT_TOTAL, - STRUCT_HAS_MASK$1 = _enums$STRUCT_KEY$2.STRUCT_HAS_MASK, - STRUCT_LV$2 = _enums$STRUCT_KEY$2.STRUCT_LV; - var NONE$2 = o$3.NONE, - TRANSFORM_ALL$1 = o$3.TRANSFORM_ALL, - OP = o$3.OPACITY, - FT = o$3.FILTER, - REPAINT$2 = o$3.REPAINT, - contain$2 = o$3.contain, - MBM = o$3.MIX_BLEND_MODE, - PPT = o$3.PERSPECTIVE; - var isE$3 = mx.isE, - inverse$1 = mx.inverse, - multiply$2 = mx.multiply; - var mbmName$2 = mbm.mbmName, - isValidMbm$2 = mbm.isValidMbm; // 无cache时应用离屏时的优先级,从小到大,OFFSCREEN_MASK2是个特殊的 + var canvasPolygon = painter.canvasPolygon; + var _enums$STYLE_KEY$7 = enums.STYLE_KEY, + POSITION$1 = _enums$STYLE_KEY$7.POSITION, + DISPLAY$1 = _enums$STYLE_KEY$7.DISPLAY, + OPACITY = _enums$STYLE_KEY$7.OPACITY, + VISIBILITY$1 = _enums$STYLE_KEY$7.VISIBILITY, + FILTER$1 = _enums$STYLE_KEY$7.FILTER, + OVERFLOW = _enums$STYLE_KEY$7.OVERFLOW, + MIX_BLEND_MODE = _enums$STYLE_KEY$7.MIX_BLEND_MODE, + FILL = _enums$STYLE_KEY$7.FILL, + TRANSFORM = _enums$STYLE_KEY$7.TRANSFORM, + TRANSFORM_ORIGIN = _enums$STYLE_KEY$7.TRANSFORM_ORIGIN, + PERSPECTIVE$1 = _enums$STYLE_KEY$7.PERSPECTIVE, + PERSPECTIVE_ORIGIN = _enums$STYLE_KEY$7.PERSPECTIVE_ORIGIN, + _enums$NODE_KEY$1 = enums.NODE_KEY, + NODE_CACHE$1 = _enums$NODE_KEY$1.NODE_CACHE, + NODE_CACHE_TOTAL$1 = _enums$NODE_KEY$1.NODE_CACHE_TOTAL, + NODE_CACHE_OVERFLOW$1 = _enums$NODE_KEY$1.NODE_CACHE_OVERFLOW, + NODE_CACHE_MASK$1 = _enums$NODE_KEY$1.NODE_CACHE_MASK, + NODE_CACHE_FILTER$1 = _enums$NODE_KEY$1.NODE_CACHE_FILTER, + NODE_MATRIX = _enums$NODE_KEY$1.NODE_MATRIX, + NODE_MATRIX_EVENT = _enums$NODE_KEY$1.NODE_MATRIX_EVENT, + NODE_OPACITY = _enums$NODE_KEY$1.NODE_OPACITY, + NODE_COMPUTED_STYLE$1 = _enums$NODE_KEY$1.NODE_COMPUTED_STYLE, + NODE_CURRENT_STYLE$1 = _enums$NODE_KEY$1.NODE_CURRENT_STYLE, + NODE_LIMIT_CACHE = _enums$NODE_KEY$1.NODE_LIMIT_CACHE, + NODE_REFRESH_LV$1 = _enums$NODE_KEY$1.NODE_REFRESH_LV, + NODE_CACHE_STYLE$1 = _enums$NODE_KEY$1.NODE_CACHE_STYLE, + NODE_DEFS_CACHE = _enums$NODE_KEY$1.NODE_DEFS_CACHE, + NODE_IS_MASK$1 = _enums$NODE_KEY$1.NODE_IS_MASK, + NODE_DOM_PARENT$1 = _enums$NODE_KEY$1.NODE_DOM_PARENT, + NODE_PERSPECTIVE_MATRIX = _enums$NODE_KEY$1.NODE_PERSPECTIVE_MATRIX, + NODE_VIRTUAL_DOM = _enums$NODE_KEY$1.NODE_VIRTUAL_DOM, + _enums$STRUCT_KEY$1 = enums.STRUCT_KEY, + STRUCT_NODE$1 = _enums$STRUCT_KEY$1.STRUCT_NODE, + STRUCT_TOTAL$1 = _enums$STRUCT_KEY$1.STRUCT_TOTAL, + STRUCT_HAS_MASK = _enums$STRUCT_KEY$1.STRUCT_HAS_MASK, + STRUCT_LV = _enums$STRUCT_KEY$1.STRUCT_LV; + var NONE$1 = o$1.NONE, + TRANSFORM_ALL = o$1.TRANSFORM_ALL, + OP = o$1.OPACITY, + FT = o$1.FILTER, + REPAINT$1 = o$1.REPAINT, + contain$1 = o$1.contain, + MBM = o$1.MIX_BLEND_MODE, + PPT = o$1.PERSPECTIVE; + var isE = mx.isE, + inverse = mx.inverse, + multiply = mx.multiply; + var mbmName = mbm.mbmName, + isValidMbm = mbm.isValidMbm; // 无cache时应用离屏时的优先级,从小到大,OFFSCREEN_MASK2是个特殊的 var OFFSCREEN_OVERFLOW = 0; var OFFSCREEN_FILTER = 1; @@ -27997,11 +28002,11 @@ var sx1 = node.__sx1, sy1 = node.__sy1, __config = node.__config; - var cache = __config[NODE_CACHE$4], - _config$NODE_COMPUTE = __config[NODE_COMPUTED_STYLE$4], - filter = _config$NODE_COMPUTE[FILTER$5], - perspective = _config$NODE_COMPUTE[PERSPECTIVE$4], - perspectiveOrigin = _config$NODE_COMPUTE[PERSPECTIVE_ORIGIN$4]; // 先将局部根节点的bbox算好,可能没内容是空 + var cache = __config[NODE_CACHE$1], + _config$NODE_COMPUTE = __config[NODE_COMPUTED_STYLE$1], + filter = _config$NODE_COMPUTE[FILTER$1], + perspective = _config$NODE_COMPUTE[PERSPECTIVE$1], + perspectiveOrigin = _config$NODE_COMPUTE[PERSPECTIVE_ORIGIN]; // 先将局部根节点的bbox算好,可能没内容是空 var bboxTotal; @@ -28054,18 +28059,18 @@ var __sx1 = node2.__sx1, __sy1 = node2.__sy1, _node2$__config = node2.__config, - limitCache = _node2$__config[NODE_LIMIT_CACHE$2], - __cache = _node2$__config[NODE_CACHE$4], + limitCache = _node2$__config[NODE_LIMIT_CACHE], + __cache = _node2$__config[NODE_CACHE$1], __cacheTotal = _node2$__config[NODE_CACHE_TOTAL$1], - __cacheFilter = _node2$__config[NODE_CACHE_FILTER$2], + __cacheFilter = _node2$__config[NODE_CACHE_FILTER$1], __cacheMask = _node2$__config[NODE_CACHE_MASK$1], - __cacheOverflow = _node2$__config[NODE_CACHE_OVERFLOW$2], - _node2$__config$NODE_ = _node2$__config[NODE_COMPUTED_STYLE$4], - display = _node2$__config$NODE_[DISPLAY$9], - visibility = _node2$__config$NODE_[VISIBILITY$6], - transform = _node2$__config$NODE_[TRANSFORM$4], - transformOrigin = _node2$__config$NODE_[TRANSFORM_ORIGIN$5], - opacity = _node2$__config$NODE_[OPACITY$5]; // webgl不能跳过超限 + __cacheOverflow = _node2$__config[NODE_CACHE_OVERFLOW$1], + _node2$__config$NODE_ = _node2$__config[NODE_COMPUTED_STYLE$1], + display = _node2$__config$NODE_[DISPLAY$1], + visibility = _node2$__config$NODE_[VISIBILITY$1], + transform = _node2$__config$NODE_[TRANSFORM], + transformOrigin = _node2$__config$NODE_[TRANSFORM_ORIGIN], + opacity = _node2$__config$NODE_[OPACITY]; // webgl不能跳过超限 if (limitCache && !includeLimitCache) { return; @@ -28116,7 +28121,7 @@ bbox[3] -= sy1; var matrix = matrixHash[parentIndex]; // 父级matrix初始化E为null,自身不为E时才运算,可以加速 - if (transform && !isE$3(transform)) { + if (transform && !isE(transform)) { var tfo = transformOrigin.slice(0); // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标 tfo[0] += __sx1 - sx1 + dx; @@ -28124,7 +28129,7 @@ var m = tf.calMatrixByOrigin(transform, tfo); if (matrix) { - matrix = multiply$2(matrix, m); + matrix = multiply(matrix, m); } else { matrix = m; } @@ -28135,7 +28140,7 @@ } if (pm) { - matrix = multiply$2(pm, matrix); + matrix = multiply(pm, matrix); } bbox = util.transformBbox(bbox, matrix, d, d); // 有孩子才继续存入下层级广度运算 @@ -28182,7 +28187,7 @@ var parentIndexHash = {}; var opacityHash = {}; - var _genBboxTotal = genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHash), + var _genBboxTotal = genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHash, Cache.MAX), _genBboxTotal2 = _slicedToArray(_genBboxTotal, 1), bboxTotal = _genBboxTotal2[0]; @@ -28225,7 +28230,7 @@ var _structs$i = __structs[i], _node = _structs$i[STRUCT_NODE$1], _total3 = _structs$i[STRUCT_TOTAL$1], - hasMask = _structs$i[STRUCT_HAS_MASK$1]; + hasMask = _structs$i[STRUCT_HAS_MASK]; var _config = _node.__config; var parentIndex = parentIndexHash[i]; var matrix = matrixHash[parentIndex]; // 父节点的在每个节点计算后保存,第一个为top的默认为E(空) @@ -28238,91 +28243,91 @@ var m = matrix || mx.identity(); ctx.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]); - _node.render(renderMode, 0, ctx, true, tx - sx1 + dbx, ty - sy1 + dby); - } // 再看total缓存/cache,都没有的是无内容的Xom节点 - else { - var __cache = _config[NODE_CACHE$4], - __cacheTotal = _config[NODE_CACHE_TOTAL$1], - __cacheFilter = _config[NODE_CACHE_FILTER$2], - __cacheMask = _config[NODE_CACHE_MASK$1], - __cacheOverflow = _config[NODE_CACHE_OVERFLOW$2], - isMask = _config[NODE_IS_MASK$2], - _config$NODE_COMPUTED = _config[NODE_COMPUTED_STYLE$4], - display = _config$NODE_COMPUTED[DISPLAY$9], - visibility = _config$NODE_COMPUTED[VISIBILITY$6], - transform = _config$NODE_COMPUTED[TRANSFORM$4], - transformOrigin = _config$NODE_COMPUTED[TRANSFORM_ORIGIN$5], - mixBlendMode = _config$NODE_COMPUTED[MIX_BLEND_MODE$3]; - - if (display === 'none') { - i += _total3 || 0; - - if (hasMask) { - i += hasMask; - } - - continue; - } // mask和不可见不能被汇总到top上 + _node.render(renderMode, 0, ctx, true, tx - sx1 + dbx, ty - sy1 + dby); + } // 再看total缓存/cache,都没有的是无内容的Xom节点 + else { + var __cache = _config[NODE_CACHE$1], + __cacheTotal = _config[NODE_CACHE_TOTAL$1], + __cacheFilter = _config[NODE_CACHE_FILTER$1], + __cacheMask = _config[NODE_CACHE_MASK$1], + __cacheOverflow = _config[NODE_CACHE_OVERFLOW$1], + isMask = _config[NODE_IS_MASK$1], + _config$NODE_COMPUTED = _config[NODE_COMPUTED_STYLE$1], + display = _config$NODE_COMPUTED[DISPLAY$1], + visibility = _config$NODE_COMPUTED[VISIBILITY$1], + transform = _config$NODE_COMPUTED[TRANSFORM], + transformOrigin = _config$NODE_COMPUTED[TRANSFORM_ORIGIN], + mixBlendMode = _config$NODE_COMPUTED[MIX_BLEND_MODE]; + if (display === 'none') { + i += _total3 || 0; - if (visibility === 'hidden' || isMask) { - continue; + if (hasMask) { + i += hasMask; } - if (transform && !isE$3(transform)) { - var tfo = transformOrigin.slice(0); // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标 + continue; + } // mask和不可见不能被汇总到top上 - if (__cache && __cache.available) { - tfo[0] += __cache.sx1; - tfo[1] += __cache.sy1; - } else { - tfo[0] += _node.__sx1; - tfo[1] += _node.__sy1; - } - var dx = -sx1 + dbx + tx; - var dy = -sy1 + dby + ty; - tfo[0] += dx; - tfo[1] += dy; + if (visibility === 'hidden' || isMask) { + continue; + } - var _m = tf.calMatrixByOrigin(transform, tfo); + if (transform && !isE(transform)) { + var tfo = transformOrigin.slice(0); // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标 - if (matrix) { - matrix = multiply$2(matrix, _m); - } else { - matrix = _m; - } + if (__cache && __cache.available) { + tfo[0] += __cache.sx1; + tfo[1] += __cache.sy1; + } else { + tfo[0] += _node.__sx1; + tfo[1] += _node.__sy1; } + var dx = -sx1 + dbx + tx; + var dy = -sy1 + dby + ty; + tfo[0] += dx; + tfo[1] += dy; + + var _m = tf.calMatrixByOrigin(transform, tfo); + if (matrix) { - matrixHash[i] = matrix; + matrix = multiply(matrix, _m); + } else { + matrix = _m; } + } - var target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]); + if (matrix) { + matrixHash[i] = matrix; + } - if (target) { - if (isValidMbm$2(mixBlendMode)) { - ctx.globalCompositeOperation = mbmName$2(mixBlendMode); - } else { - ctx.globalCompositeOperation = 'source-over'; - } + var target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]); - ctx.globalAlpha = opacity; + if (target) { + if (isValidMbm(mixBlendMode)) { + ctx.globalCompositeOperation = mbmName(mixBlendMode); + } else { + ctx.globalCompositeOperation = 'source-over'; + } - if (matrix) { - ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]); - } else { - ctx.setTransform(1, 0, 0, 1, 0, 0); - } + ctx.globalAlpha = opacity; - Cache.drawCache(target, cacheTop); + if (matrix) { + ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]); + } else { + ctx.setTransform(1, 0, 0, 1, 0, 0); + } - if (target !== __cache) { - i += _total3 || 0; - i += hasMask || 0; - } + Cache.drawCache(target, cacheTop); + + if (target !== __cache) { + i += _total3 || 0; + i += hasMask || 0; } } + } } return cacheTop; @@ -28334,8 +28339,8 @@ function genMask(node, cache) { var _node$computedStyle = node.computedStyle, - transform = _node$computedStyle[TRANSFORM$4], - transformOrigin = _node$computedStyle[TRANSFORM_ORIGIN$5]; + transform = _node$computedStyle[TRANSFORM], + transformOrigin = _node$computedStyle[TRANSFORM_ORIGIN]; var isClip = node.next.isClip; return Cache.genMask(cache, node.next, isClip, transform, transformOrigin); } @@ -28433,24 +28438,24 @@ texCache.addTexAndDrawWhenLimit(gl, cache, 1, null, cx, cy, dx, dy); } // limitCache无cache需先绘制到统一的离屏画布上 else if (limitCache) { - var c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__'); - node.render(mode.WEBGL, 0, gl); - var j = texCache.lockOneChannel(); + var c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__'); + node.render(mode.WEBGL, 0, gl); + var j = texCache.lockOneChannel(); - var _texture = webgl.createTexture(gl, c.canvas, j); + var _texture = webgl.createTexture(gl, c.canvas, j); - var _mockCache = new MockCache(gl, _texture, 0, 0, width, height, [0, 0, width, height]); + var _mockCache = new MockCache(gl, _texture, 0, 0, width, height, [0, 0, width, height]); - texCache.addTexAndDrawWhenLimit(gl, _mockCache, 1, null, cx, cy, 0, 0); - texCache.refresh(gl, cx, cy); - c.ctx.setTransform(1, 0, 0, 1, 0, 0); - c.ctx.globalAlpha = 1; - c.ctx.clearRect(0, 0, width, height); + texCache.addTexAndDrawWhenLimit(gl, _mockCache, 1, null, cx, cy, 0, 0); + texCache.refresh(gl, cx, cy); + c.ctx.setTransform(1, 0, 0, 1, 0, 0); + c.ctx.globalAlpha = 1; + c.ctx.clearRect(0, 0, width, height); - _mockCache.release(); + _mockCache.release(); - texCache.releaseLockChannel(j); - } // 因为cacheTotal不总是以左上角原点为开始,所以必须每个节点重算matrix,合并box时计算的无法用到 + texCache.releaseLockChannel(j); + } // 因为cacheTotal不总是以左上角原点为开始,所以必须每个节点重算matrix,合并box时计算的无法用到 var matrixHash = {}; // 先序遍历汇总到total @@ -28459,7 +28464,7 @@ var _structs$i2 = __structs[i], _node2 = _structs$i2[STRUCT_NODE$1], _total4 = _structs$i2[STRUCT_TOTAL$1], - hasMask = _structs$i2[STRUCT_HAS_MASK$1]; + hasMask = _structs$i2[STRUCT_HAS_MASK]; var _config2 = _node2.__config; var parentIndex = parentIndexHash[i]; var matrix = matrixHash[parentIndex]; // 父节点的在每个节点计算后保存,第一个为top的默认为E(空) @@ -28469,108 +28474,108 @@ if (_node2 instanceof Text) { if (parentPm) { - matrix = multiply$2(parentPm, matrix); + matrix = multiply(parentPm, matrix); } - texCache.addTexAndDrawWhenLimit(gl, _config2[NODE_CACHE$4], opacity, matrix, cx, cy, dx, dy); + texCache.addTexAndDrawWhenLimit(gl, _config2[NODE_CACHE$1], opacity, matrix, cx, cy, dx, dy); } // 再看total缓存/cache,都没有的是无内容的Xom节点 else { - var __cache = _config2[NODE_CACHE$4], - __cacheTotal = _config2[NODE_CACHE_TOTAL$1], - __cacheFilter = _config2[NODE_CACHE_FILTER$2], - __cacheMask = _config2[NODE_CACHE_MASK$1], - __cacheOverflow = _config2[NODE_CACHE_OVERFLOW$2], - isMask = _config2[NODE_IS_MASK$2], - _config2$NODE_COMPUTE = _config2[NODE_COMPUTED_STYLE$4], - display = _config2$NODE_COMPUTE[DISPLAY$9], - visibility = _config2$NODE_COMPUTE[VISIBILITY$6], - transform = _config2$NODE_COMPUTE[TRANSFORM$4], - transformOrigin = _config2$NODE_COMPUTE[TRANSFORM_ORIGIN$5], - mixBlendMode = _config2$NODE_COMPUTE[MIX_BLEND_MODE$3]; - - if (display === 'none') { - i += _total4 || 0; + var __cache = _config2[NODE_CACHE$1], + __cacheTotal = _config2[NODE_CACHE_TOTAL$1], + __cacheFilter = _config2[NODE_CACHE_FILTER$1], + __cacheMask = _config2[NODE_CACHE_MASK$1], + __cacheOverflow = _config2[NODE_CACHE_OVERFLOW$1], + isMask = _config2[NODE_IS_MASK$1], + _config2$NODE_COMPUTE = _config2[NODE_COMPUTED_STYLE$1], + display = _config2$NODE_COMPUTE[DISPLAY$1], + visibility = _config2$NODE_COMPUTE[VISIBILITY$1], + transform = _config2$NODE_COMPUTE[TRANSFORM], + transformOrigin = _config2$NODE_COMPUTE[TRANSFORM_ORIGIN], + mixBlendMode = _config2$NODE_COMPUTE[MIX_BLEND_MODE]; - if (hasMask) { - i += hasMask; - } + if (display === 'none') { + i += _total4 || 0; - continue; - } // mask和不可见不能被汇总到top上 + if (hasMask) { + i += hasMask; + } + continue; + } // mask和不可见不能被汇总到top上 - if (visibility === 'hidden' || isMask) { - continue; - } - if (transform && !isE$3(transform)) { - var tfo = transformOrigin.slice(0); // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标 + if (visibility === 'hidden' || isMask) { + continue; + } - if (__cache && __cache.available) { - tfo[0] += __cache.sx1; - tfo[1] += __cache.sy1; - } else { - tfo[0] += _node2.__sx1; - tfo[1] += _node2.__sy1; - } + if (transform && !isE(transform)) { + var tfo = transformOrigin.slice(0); // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标 - var _dx = -sx1 + dbx; + if (__cache && __cache.available) { + tfo[0] += __cache.sx1; + tfo[1] += __cache.sy1; + } else { + tfo[0] += _node2.__sx1; + tfo[1] += _node2.__sy1; + } - var _dy = -sy1 + dby; + var _dx = -sx1 + dbx; - tfo[0] += _dx; - tfo[1] += _dy; - var m = tf.calMatrixByOrigin(transform, tfo); + var _dy = -sy1 + dby; - if (matrix) { - matrix = multiply$2(matrix, m); - } else { - matrix = m; - } - } + tfo[0] += _dx; + tfo[1] += _dy; + var m = tf.calMatrixByOrigin(transform, tfo); if (matrix) { - matrixHash[i] = matrix; + matrix = multiply(matrix, m); + } else { + matrix = m; } + } - if (parentPm) { - matrix = multiply$2(parentPm, matrix); - } + if (matrix) { + matrixHash[i] = matrix; + } - var target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]); + if (parentPm) { + matrix = multiply(parentPm, matrix); + } - if (target) { - // 局部的mbm和主画布一样,先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成 - if (isValidMbm$2(mixBlendMode)) { - texCache.refresh(gl, cx, cy); + var target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]); - var _genFrameBufferWithTe3 = genFrameBufferWithTexture(gl, texCache, width, height), - _genFrameBufferWithTe4 = _slicedToArray(_genFrameBufferWithTe3, 3), - n2 = _genFrameBufferWithTe4[0], - frameBuffer2 = _genFrameBufferWithTe4[1], - texture2 = _genFrameBufferWithTe4[2]; + if (target) { + // 局部的mbm和主画布一样,先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成 + if (isValidMbm(mixBlendMode)) { + texCache.refresh(gl, cx, cy); - texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy); - texCache.refresh(gl, cx, cy); // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前fbo作为绘制对象 + var _genFrameBufferWithTe3 = genFrameBufferWithTexture(gl, texCache, width, height), + _genFrameBufferWithTe4 = _slicedToArray(_genFrameBufferWithTe3, 3), + n2 = _genFrameBufferWithTe4[0], + frameBuffer2 = _genFrameBufferWithTe4[1], + texture2 = _genFrameBufferWithTe4[2]; - var _genMbmWebgl = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName$2(mixBlendMode), width, height); + texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy); + texCache.refresh(gl, cx, cy); // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前fbo作为绘制对象 - var _genMbmWebgl2 = _slicedToArray(_genMbmWebgl, 3); + var _genMbmWebgl = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height); - n = _genMbmWebgl2[0]; - frameBuffer = _genMbmWebgl2[1]; - texture = _genMbmWebgl2[2]; - gl.deleteFramebuffer(frameBuffer2); - gl.deleteTexture(texture2); - } else { - texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy); - } + var _genMbmWebgl2 = _slicedToArray(_genMbmWebgl, 3); - if (target !== __cache) { - i += (_total4 || 0) + (hasMask || 0); - } + n = _genMbmWebgl2[0]; + frameBuffer = _genMbmWebgl2[1]; + texture = _genMbmWebgl2[2]; + gl.deleteFramebuffer(frameBuffer2); + gl.deleteTexture(texture2); + } else { + texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy); + } + + if (target !== __cache) { + i += (_total4 || 0) + (hasMask || 0); } } + } } // 绘制到fbo的纹理对象上并删除fbo恢复 @@ -28608,7 +28613,7 @@ bbox = _res[3]; } } else if (k === 'hue-rotate') { - var rotation = geom.d2r(v % 360); + var rotation = geom$1.d2r(v % 360); var cosR = Math.cos(rotation); var sinR = Math.sin(rotation); @@ -28866,12 +28871,12 @@ var dx = -bbox[0], dy = -bbox[1]; // 先求得被遮罩的matrix,用作inverse给mask计算 - var _config$NODE_COMPUTE2 = __config[NODE_COMPUTED_STYLE$4], - transform = _config$NODE_COMPUTE2[TRANSFORM$4], - transformOrigin = _config$NODE_COMPUTE2[TRANSFORM_ORIGIN$5]; + var _config$NODE_COMPUTE2 = __config[NODE_COMPUTED_STYLE$1], + transform = _config$NODE_COMPUTE2[TRANSFORM], + transformOrigin = _config$NODE_COMPUTE2[TRANSFORM_ORIGIN]; var inverse; - if (isE$3(transform)) { + if (isE(transform)) { inverse = mx.identity(); } else { var tfo = transformOrigin.slice(0); @@ -28892,15 +28897,15 @@ while (next && next.isMask) { var _config3 = next.__config; - var __cache = _config3[NODE_CACHE$4], - __cacheFilter = _config3[NODE_CACHE_FILTER$2], - __cacheOverflow = _config3[NODE_CACHE_OVERFLOW$2], - _config3$NODE_COMPUTE = _config3[NODE_COMPUTED_STYLE$4], - display = _config3$NODE_COMPUTE[DISPLAY$9], - visibility = _config3$NODE_COMPUTE[VISIBILITY$6], - opacity = _config3$NODE_COMPUTE[OPACITY$5], - _transform = _config3$NODE_COMPUTE[TRANSFORM$4], - _transformOrigin = _config3$NODE_COMPUTE[TRANSFORM_ORIGIN$5]; + var __cache = _config3[NODE_CACHE$1], + __cacheFilter = _config3[NODE_CACHE_FILTER$1], + __cacheOverflow = _config3[NODE_CACHE_OVERFLOW$1], + _config3$NODE_COMPUTE = _config3[NODE_COMPUTED_STYLE$1], + display = _config3$NODE_COMPUTE[DISPLAY$1], + visibility = _config3$NODE_COMPUTE[VISIBILITY$1], + opacity = _config3$NODE_COMPUTE[OPACITY], + _transform = _config3$NODE_COMPUTE[TRANSFORM], + _transformOrigin = _config3$NODE_COMPUTE[TRANSFORM_ORIGIN]; if (display === 'none' || visibility === 'hidden') { continue; @@ -28912,23 +28917,23 @@ if (target) { var m = void 0; - if (isE$3(_transform)) { + if (isE(_transform)) { m = mx.identity(); } else { - var _tfo = _transformOrigin.slice(0); + var tfo = _transformOrigin.slice(0); - _tfo[0] += target.bbox[0] + dx; - _tfo[1] += target.bbox[1] + dy; - m = tf.calMatrixByOrigin(_transform, _tfo); + tfo[0] += target.bbox[0] + dx; + tfo[1] += target.bbox[1] + dy; + m = tf.calMatrixByOrigin(_transform, tfo); } m = mx.multiply(inverse, m); // m = mx.m2Mat4(m, cx, cy); texCache.addTexAndDrawWhenLimit(gl, target, opacity, m, cx, cy, dx, dy); } // 异常情况超限 - else if (_config3[NODE_LIMIT_CACHE$2]) { - return; - } + else if (_config3[NODE_LIMIT_CACHE]) { + return; + } next = next.next; } @@ -28995,7 +29000,7 @@ function genMbmWebgl(gl, texCache, i, j, fbo, tex, mbm, W, H) { var frag; - mbm = mbmName$2(mbm); + mbm = mbmName(mbm); if (mbm === 'multiply') { frag = fragmentMultiply; @@ -29084,7 +29089,7 @@ ctx.beginPath(); if (_list) { - canvasPolygon$7(ctx, _list); + canvasPolygon(ctx, _list); } else { ctx.rect(x, y, offsetWidth, offsetHeight); } @@ -29224,8 +29229,8 @@ inject.releaseCacheCanvas(_target3.canvas); } // 特殊的mask节点汇总结束,还原ctx else if (type === OFFSCREEN_MASK2) { - ctx = offscreen.ctx; - } + ctx = offscreen.ctx; + } }); return ctx; } @@ -29253,9 +29258,9 @@ for (var i = 0, len = __structs.length; i < len; i++) { var _structs$i3 = __structs[i], node = _structs$i3[STRUCT_NODE$1], - lv = _structs$i3[STRUCT_LV$2], + lv = _structs$i3[STRUCT_LV], total = _structs$i3[STRUCT_TOTAL$1], - hasMask = _structs$i3[STRUCT_HAS_MASK$1]; // 排除Text,要么根节点直接绘制,要么被局部根节点汇总,自身并不缓存(fillText比位图更快) + hasMask = _structs$i3[STRUCT_HAS_MASK]; // 排除Text,要么根节点直接绘制,要么被局部根节点汇总,自身并不缓存(fillText比位图更快) if (node instanceof Text) { continue; @@ -29264,31 +29269,32 @@ var __config = node.__config; // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,Root节点是第一个特殊处理 if (i === 0) ; else if (lv > lastLv) { - parentMatrix = lastConfig[NODE_MATRIX_EVENT$4]; + parentMatrix = lastConfig[NODE_MATRIX_EVENT]; - if (isE$3(parentMatrix)) { + if (isE(parentMatrix)) { parentMatrix = null; } matrixList.push(parentMatrix); - parentOpacity = lastConfig[NODE_OPACITY$3]; + parentOpacity = lastConfig[NODE_OPACITY]; opacityList.push(parentOpacity); } // 变小出栈索引需注意,可能不止一层,多层计算diff层级 else if (lv < lastLv) { - var diff = lastLv - lv; - matrixList.splice(-diff); - parentMatrix = matrixList[lv - 1]; - opacityList.splice(-diff); - parentOpacity = opacityList[lv - 1]; - } + var diff = lastLv - lv; + matrixList.splice(-diff); + parentMatrix = matrixList[lv - 1]; + opacityList.splice(-diff); + parentOpacity = opacityList[lv - 1]; + } // 不变是同级兄弟,无需特殊处理 + else ; lastConfig = __config; lastLv = lv; var refreshLevel = __config[NODE_REFRESH_LV$1], __cacheTotal = __config[NODE_CACHE_TOTAL$1], - computedStyle = __config[NODE_COMPUTED_STYLE$4]; // 跳过display:none元素和它的所有子节点 + computedStyle = __config[NODE_COMPUTED_STYLE$1]; // 跳过display:none元素和它的所有子节点 - if (computedStyle[DISPLAY$9] === 'none') { + if (computedStyle[DISPLAY$1] === 'none') { i += total || 0; // 只跳过自身不能跳过后面的mask,mask要渲染自身并进行缓存cache,以备对象切换display用 continue; @@ -29303,8 +29309,8 @@ * 如果没有或无效,直接添加,无视节点本身变化,后面防重即可 */ - if (refreshLevel < REPAINT$2) { - __config[NODE_REFRESH_LV$1] = NONE$2; + if (refreshLevel < REPAINT$1) { + __config[NODE_REFRESH_LV$1] = NONE$1; if (hasMask) { var cacheMask = __config[NODE_CACHE_MASK$1]; @@ -29315,43 +29321,43 @@ } } - var currentStyle = __config[NODE_CURRENT_STYLE$5], + var currentStyle = __config[NODE_CURRENT_STYLE$1], __cacheStyle = __config[NODE_CACHE_STYLE$1], - matrixEvent = __config[NODE_MATRIX_EVENT$4]; + matrixEvent = __config[NODE_MATRIX_EVENT]; var matrix = void 0; - if (contain$2(refreshLevel, TRANSFORM_ALL$1)) { + if (contain$1(refreshLevel, TRANSFORM_ALL)) { matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config); // 恶心的v8性能优化 - var m = __config[NODE_MATRIX$3]; + var m = __config[NODE_MATRIX]; util.assignMatrix(m, matrix); } else { - matrix = __config[NODE_MATRIX$3]; + matrix = __config[NODE_MATRIX]; } // 父不为E时要点乘继承父的 if (parentMatrix) { - matrix = multiply$2(parentMatrix, matrix); + matrix = multiply(parentMatrix, matrix); } // 恶心的v8性能优化 util.assignMatrix(matrixEvent, matrix); var opacity = void 0; - if (contain$2(refreshLevel, OP)) { - opacity = computedStyle[OPACITY$5] = currentStyle[OPACITY$5]; + if (contain$1(refreshLevel, OP)) { + opacity = computedStyle[OPACITY] = currentStyle[OPACITY]; } else { - opacity = computedStyle[OPACITY$5]; + opacity = computedStyle[OPACITY]; } - __config[NODE_OPACITY$3] = parentOpacity * opacity; // filter会改变bbox范围 + __config[NODE_OPACITY] = parentOpacity * opacity; // filter会改变bbox范围 - if (contain$2(refreshLevel, FT)) { + if (contain$1(refreshLevel, FT)) { node.__bbox = null; var _filter = node.__calFilter(currentStyle, computedStyle); - var __cacheFilter = __config[NODE_CACHE_FILTER$2]; + var __cacheFilter = __config[NODE_CACHE_FILTER$1]; if (__cacheFilter) { __cacheFilter.release(); @@ -29367,8 +29373,8 @@ } } - if (contain$2(refreshLevel, MBM)) { - computedStyle[MIX_BLEND_MODE$3] = currentStyle[MIX_BLEND_MODE$3]; + if (contain$1(refreshLevel, MBM)) { + computedStyle[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE]; } // total可以跳过所有孩子节点省略循环,filter/mask等的强制前提是有total @@ -29382,17 +29388,17 @@ * Geom没有子节点无需汇总局部根,Dom中Img也是,它们的局部根等于自身的cache,其它符合条件的Dom需要生成 */ else { - node.render(renderMode, refreshLevel, ctx, true); - } // 每个元素检查cacheTotal生成,已有的上面会continue跳过 + node.render(renderMode, refreshLevel, ctx, true); + } // 每个元素检查cacheTotal生成,已有的上面会continue跳过 - var limitCache = __config[NODE_LIMIT_CACHE$2]; - var position = computedStyle[POSITION$4], - overflow = computedStyle[OVERFLOW$3], - filter = computedStyle[FILTER$5], - mixBlendMode = computedStyle[MIX_BLEND_MODE$3]; + var limitCache = __config[NODE_LIMIT_CACHE]; + var position = computedStyle[POSITION$1], + overflow = computedStyle[OVERFLOW], + filter = computedStyle[FILTER$1], + mixBlendMode = computedStyle[MIX_BLEND_MODE]; - if (!limitCache && (hasMask || position === 'absolute' || filter.length || overflow === 'hidden' && total || isValidMbm$2(mixBlendMode))) { + if (!limitCache && (hasMask || position === 'absolute' || filter.length || overflow === 'hidden' && total || isValidMbm(mixBlendMode))) { if (hasRecordAsMask) { hasRecordAsMask[6] = filter; hasRecordAsMask[7] = overflow; @@ -29422,11 +29428,11 @@ filter = _item4[6], overflow = _item4[7]; - var __cache = __config[NODE_CACHE$4], + var __cache = __config[NODE_CACHE$1], __cacheTotal = __config[NODE_CACHE_TOTAL$1], - __cacheFilter = __config[NODE_CACHE_FILTER$2], + __cacheFilter = __config[NODE_CACHE_FILTER$1], __cacheMask = __config[NODE_CACHE_MASK$1], - __cacheOverflow = __config[NODE_CACHE_OVERFLOW$2]; + __cacheOverflow = __config[NODE_CACHE_OVERFLOW$1]; var needGen; // 可能没变化,比如被遮罩节点、filter变更等 if (!__cacheTotal || !__cacheTotal.available) { @@ -29445,20 +29451,20 @@ if (overflow === 'hidden') { if (!__cacheOverflow || !__cacheOverflow.available || needGen) { - __config[NODE_CACHE_OVERFLOW$2] = genOverflow(node, target); + __config[NODE_CACHE_OVERFLOW$1] = genOverflow(node, target); needGen = true; } - target = __config[NODE_CACHE_OVERFLOW$2] || target; + target = __config[NODE_CACHE_OVERFLOW$1] || target; } if (filter && filter.length) { if (!__cacheFilter || !__cacheFilter.available || needGen) { - __config[NODE_CACHE_FILTER$2] = genFilter(node, target, filter); + __config[NODE_CACHE_FILTER$1] = genFilter(node, target, filter); needGen = true; } - target = __config[NODE_CACHE_FILTER$2] || target; + target = __config[NODE_CACHE_FILTER$1] || target; } if (hasMask && (!__cacheMask || !__cacheMask.available || needGen)) { @@ -29479,15 +29485,15 @@ for (var _i4 = 0, _len2 = __structs.length; _i4 < _len2; _i4++) { var _structs$_i2 = __structs[_i4], _node3 = _structs$_i2[STRUCT_NODE$1], - _lv = _structs$_i2[STRUCT_LV$2], + _lv = _structs$_i2[STRUCT_LV], _total5 = _structs$_i2[STRUCT_TOTAL$1], - _hasMask = _structs$_i2[STRUCT_HAS_MASK$1]; + _hasMask = _structs$_i2[STRUCT_HAS_MASK]; var _config4 = _node3.__config; // text如果display不可见,parent会直接跳过,不会走到这里,这里一定是直接绘制到root的,visibility在其内部判断 if (_node3 instanceof Text) { - var _config4$NODE_DOM_PAR = _config4[NODE_DOM_PARENT$5].__config, - _opacity = _config4$NODE_DOM_PAR[NODE_OPACITY$3], - _matrixEvent = _config4$NODE_DOM_PAR[NODE_MATRIX_EVENT$4]; + var _config4$NODE_DOM_PAR = _config4[NODE_DOM_PARENT$1].__config, + _opacity = _config4$NODE_DOM_PAR[NODE_OPACITY], + _matrixEvent = _config4$NODE_DOM_PAR[NODE_MATRIX_EVENT]; ctx.globalAlpha = _opacity; ctx.setTransform(_matrixEvent[0], _matrixEvent[1], _matrixEvent[4], _matrixEvent[5], _matrixEvent[12], _matrixEvent[13]); @@ -29497,21 +29503,21 @@ ctx = applyOffscreen(ctx, offscreenHash[_i4], width, height); } } else { - var _opacity2 = _config4[NODE_OPACITY$3], - _matrixEvent2 = _config4[NODE_MATRIX_EVENT$4], - _limitCache = _config4[NODE_LIMIT_CACHE$2], - __cache = _config4[NODE_CACHE$4], + var _opacity2 = _config4[NODE_OPACITY], + _matrixEvent2 = _config4[NODE_MATRIX_EVENT], + _limitCache = _config4[NODE_LIMIT_CACHE], + __cache = _config4[NODE_CACHE$1], _cacheTotal = _config4[NODE_CACHE_TOTAL$1], - _cacheFilter = _config4[NODE_CACHE_FILTER$2], + _cacheFilter = _config4[NODE_CACHE_FILTER$1], __cacheMask = _config4[NODE_CACHE_MASK$1], - __cacheOverflow = _config4[NODE_CACHE_OVERFLOW$2], + __cacheOverflow = _config4[NODE_CACHE_OVERFLOW$1], _refreshLevel = _config4[NODE_REFRESH_LV$1], - _config4$NODE_COMPUTE = _config4[NODE_COMPUTED_STYLE$4], - display = _config4$NODE_COMPUTE[DISPLAY$9], - visibility = _config4$NODE_COMPUTE[VISIBILITY$6], - _overflow = _config4$NODE_COMPUTE[OVERFLOW$3], - _filter2 = _config4$NODE_COMPUTE[FILTER$5], - _mixBlendMode = _config4$NODE_COMPUTE[MIX_BLEND_MODE$3]; // 有total的可以直接绘制并跳过子节点索引 + _config4$NODE_COMPUTE = _config4[NODE_COMPUTED_STYLE$1], + display = _config4$NODE_COMPUTE[DISPLAY$1], + visibility = _config4$NODE_COMPUTE[VISIBILITY$1], + _overflow = _config4$NODE_COMPUTE[OVERFLOW], + _filter2 = _config4$NODE_COMPUTE[FILTER$1], + _mixBlendMode = _config4$NODE_COMPUTE[MIX_BLEND_MODE]; // 有total的可以直接绘制并跳过子节点索引 var target = getCache([__cacheMask, _cacheFilter, __cacheOverflow, _cacheTotal]); // total的尝试 @@ -29522,8 +29528,8 @@ continue; } - if (isValidMbm$2(_mixBlendMode)) { - ctx.globalCompositeOperation = mbmName$2(_mixBlendMode); + if (isValidMbm(_mixBlendMode)) { + ctx.globalCompositeOperation = mbmName(_mixBlendMode); } else { ctx.globalCompositeOperation = 'source-over'; } @@ -29537,163 +29543,163 @@ } } // 自身cache尝试 else { - if (maskStartHash.hasOwnProperty(_i4)) { - var _maskStartHash$_i = _slicedToArray(maskStartHash[_i4], 3), - idx = _maskStartHash$_i[0], - n = _maskStartHash$_i[1], - _offscreenMask = _maskStartHash$_i[2]; + if (maskStartHash.hasOwnProperty(_i4)) { + var _maskStartHash$_i = _slicedToArray(maskStartHash[_i4], 3), + idx = _maskStartHash$_i[0], + n = _maskStartHash$_i[1], + _offscreenMask = _maskStartHash$_i[2]; - var _target4 = inject.getCacheCanvas(width, height, null, 'mask2'); + var _target4 = inject.getCacheCanvas(width, height, null, 'mask2'); - _offscreenMask.mask = _target4; // 应用mask用到 + _offscreenMask.mask = _target4; // 应用mask用到 - _offscreenMask.isClip = _node3.isClip; // 定位到最后一个mask元素上的末尾 + _offscreenMask.isClip = _node3.isClip; // 定位到最后一个mask元素上的末尾 - var j = _i4 + (_total5 || 0) + 1; + var j = _i4 + (_total5 || 0) + 1; - while (--n) { - var _total6 = __structs[j][STRUCT_TOTAL$1]; - j += (_total6 || 0) + 1; - } + while (--n) { + var _total6 = __structs[j][STRUCT_TOTAL$1]; + j += (_total6 || 0) + 1; + } - j--; - var list = offscreenHash[j] = offscreenHash[j] || []; - list.push([idx, _lv, OFFSCREEN_MASK, _offscreenMask]); - list.push([j, _lv, OFFSCREEN_MASK2, { - ctx: ctx, - // 保存等待OFFSCREEN_MASK2时还原 - target: _target4 - }]); - ctx = _target4.ctx; - } - - var offscreenBlend = void 0, - offscreenMask = void 0, - offscreenFilter = void 0, - offscreenOverflow = void 0; // 这里比较特殊,可能会有__cache但超限没被汇聚到total上,需mock出离屏对象数据,还有可能本身就超限 - - if (__cache && __cache.available || _limitCache) { - if (__cache && __cache.available) { - // 有cache但没生成total的都在这 - if (isValidMbm$2(_mixBlendMode)) { - var c = inject.getCacheCanvas(width, height, null, 'blend'); - offscreenBlend = { - ctx: ctx, - target: c, - mixBlendMode: mbmName$2(_mixBlendMode), - matrix: _matrixEvent2 - }; - ctx = c.ctx; - } + j--; + var list = offscreenHash[j] = offscreenHash[j] || []; + list.push([idx, _lv, OFFSCREEN_MASK, _offscreenMask]); + list.push([j, _lv, OFFSCREEN_MASK2, { + ctx: ctx, + // 保存等待OFFSCREEN_MASK2时还原 + target: _target4 + }]); + ctx = _target4.ctx; + } - if (_hasMask) { - var _c2 = inject.getCacheCanvas(width, height, null, 'mask1'); + var offscreenBlend = void 0, + offscreenMask = void 0, + offscreenFilter = void 0, + offscreenOverflow = void 0; // 这里比较特殊,可能会有__cache但超限没被汇聚到total上,需mock出离屏对象数据,还有可能本身就超限 - offscreenMask = { - ctx: ctx, - target: _c2, - matrix: _matrixEvent2 - }; - ctx = _c2.ctx; - } + if (__cache && __cache.available || _limitCache) { + if (__cache && __cache.available) { + // 有cache但没生成total的都在这 + if (isValidMbm(_mixBlendMode)) { + var c = inject.getCacheCanvas(width, height, null, 'blend'); + offscreenBlend = { + ctx: ctx, + target: c, + mixBlendMode: mbmName(_mixBlendMode), + matrix: _matrixEvent2 + }; + ctx = c.ctx; + } - if (_filter2 && _filter2.length) { - var _c3 = inject.getCacheCanvas(width, height, null, 'filter1'); + if (_hasMask) { + var _c2 = inject.getCacheCanvas(width, height, null, 'mask1'); - offscreenFilter = { - ctx: ctx, - filter: _filter2, - target: _c3, - matrix: _matrixEvent2 - }; - ctx = _c3.ctx; - } + offscreenMask = { + ctx: ctx, + target: _c2, + matrix: _matrixEvent2 + }; + ctx = _c2.ctx; + } - if (_overflow === 'hidden' && display !== 'inline') { - var _c4 = inject.getCacheCanvas(width, height, null, 'overflow'); - - offscreenOverflow = { - ctx: ctx, - target: _c4, - matrix: _matrixEvent2, - x: __cache.sx1, - y: __cache.sy1, - offsetWidth: _node3.offsetWidth, - offsetHeight: _node3.offsetHeight - }; - ctx = _c4.ctx; - } + if (_filter2 && _filter2.length) { + var _c3 = inject.getCacheCanvas(width, height, null, 'filter1'); - if (visibility !== 'hidden') { - Cache.draw(ctx, _opacity2, _matrixEvent2, __cache); - } - } else { - // 连cache都没生成的超限 - var res = _node3.render(renderMode, _refreshLevel, ctx) || {}; - offscreenBlend = res.offscreenBlend; - offscreenMask = res.offscreenMask; - offscreenFilter = res.offscreenFilter; - offscreenOverflow = res.offscreenOverflow; - } // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反 + offscreenFilter = { + ctx: ctx, + filter: _filter2, + target: _c3, + matrix: _matrixEvent2 + }; + ctx = _c3.ctx; + } + if (_overflow === 'hidden' && display !== 'inline') { + var _c4 = inject.getCacheCanvas(width, height, null, 'overflow'); - if (offscreenBlend) { - var _j = _i4 + (_total5 || 0) + (_hasMask || 0); + offscreenOverflow = { + ctx: ctx, + target: _c4, + matrix: _matrixEvent2, + x: __cache.sx1, + y: __cache.sy1, + offsetWidth: _node3.offsetWidth, + offsetHeight: _node3.offsetHeight + }; + ctx = _c4.ctx; + } - var _list2 = offscreenHash[_j] = offscreenHash[_j] || []; + if (visibility !== 'hidden') { + Cache.draw(ctx, _opacity2, _matrixEvent2, __cache); + } + } else { + // 连cache都没生成的超限 + var res = _node3.render(renderMode, _refreshLevel, ctx) || {}; + offscreenBlend = res.offscreenBlend; + offscreenMask = res.offscreenMask; + offscreenFilter = res.offscreenFilter; + offscreenOverflow = res.offscreenOverflow; + } // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反 - _list2.push([_i4, _lv, OFFSCREEN_BLEND, offscreenBlend]); - ctx = offscreenBlend.target.ctx; - } // 被遮罩的节点要为第一个遮罩和最后一个遮罩的索引打标,被遮罩的本身在一个离屏canvas,遮罩的元素在另外一个 + if (offscreenBlend) { + var _j = _i4 + (_total5 || 0) + (_hasMask || 0); + var _list2 = offscreenHash[_j] = offscreenHash[_j] || []; - if (offscreenMask) { - var _j2 = _i4 + (_total5 || 0); + _list2.push([_i4, _lv, OFFSCREEN_BLEND, offscreenBlend]); - maskStartHash[_j2 + 1] = [_i4, _hasMask, offscreenMask]; - ctx = offscreenMask.target.ctx; - } // filter造成的离屏,需要将后续一段孩子节点区域的ctx替换,并在结束后应用结果,再替换回来 + ctx = offscreenBlend.target.ctx; + } // 被遮罩的节点要为第一个遮罩和最后一个遮罩的索引打标,被遮罩的本身在一个离屏canvas,遮罩的元素在另外一个 - if (offscreenFilter) { - var _j3 = _i4 + (_total5 || 0) + (_hasMask || 0); + if (offscreenMask) { + var _j2 = _i4 + (_total5 || 0); - var _list3 = offscreenHash[_j3] = offscreenHash[_j3] || []; + maskStartHash[_j2 + 1] = [_i4, _hasMask, offscreenMask]; + ctx = offscreenMask.target.ctx; + } // filter造成的离屏,需要将后续一段孩子节点区域的ctx替换,并在结束后应用结果,再替换回来 - _list3.push([_i4, _lv, OFFSCREEN_FILTER, offscreenFilter]); - ctx = offscreenFilter.target.ctx; - } // overflow:hidden的离屏,最后孩子进行截取 + if (offscreenFilter) { + var _j3 = _i4 + (_total5 || 0) + (_hasMask || 0); + var _list3 = offscreenHash[_j3] = offscreenHash[_j3] || []; - if (offscreenOverflow) { - var _j4 = _i4 + (_total5 || 0) + (_hasMask || 0); + _list3.push([_i4, _lv, OFFSCREEN_FILTER, offscreenFilter]); - var _list4 = offscreenHash[_j4] = offscreenHash[_j4] || []; + ctx = offscreenFilter.target.ctx; + } // overflow:hidden的离屏,最后孩子进行截取 - _list4.push([_i4, _lv, OFFSCREEN_OVERFLOW, offscreenOverflow]); - ctx = offscreenOverflow.target.ctx; - } + if (offscreenOverflow) { + var _j4 = _i4 + (_total5 || 0) + (_hasMask || 0); - if (_limitCache && _node3 instanceof Geom$1) { - _node3.render(renderMode, _refreshLevel, ctx); - } - } // 没内容的遮罩跳过,比如未加载的img,否则会将遮罩绘制出来 - else if (_hasMask) { - _i4 += (_total5 || 0) + _hasMask; - } // 同无cache一样的离屏应用 + var _list4 = offscreenHash[_j4] = offscreenHash[_j4] || []; + _list4.push([_i4, _lv, OFFSCREEN_OVERFLOW, offscreenOverflow]); - if (offscreenHash.hasOwnProperty(_i4)) { - ctx = applyOffscreen(ctx, offscreenHash[_i4], width, height); + ctx = offscreenOverflow.target.ctx; } - if (display === 'none') { - _i4 += (_total5 || 0) + (_hasMask || 0); + if (_limitCache && _node3 instanceof Geom) { + _node3.render(renderMode, _refreshLevel, ctx); } + } // 没内容的遮罩跳过,比如未加载的img,否则会将遮罩绘制出来 + else if (_hasMask) { + _i4 += (_total5 || 0) + _hasMask; + } // 同无cache一样的离屏应用 + + + if (offscreenHash.hasOwnProperty(_i4)) { + ctx = applyOffscreen(ctx, offscreenHash[_i4], width, height); } + + if (display === 'none') { + _i4 += (_total5 || 0) + (_hasMask || 0); + } + } } } } @@ -29724,11 +29730,11 @@ for (var i = 0, len = __structs.length; i < len; i++) { var _structs$i4 = __structs[i], node = _structs$i4[STRUCT_NODE$1], - lv = _structs$i4[STRUCT_LV$2], + lv = _structs$i4[STRUCT_LV], total = _structs$i4[STRUCT_TOTAL$1], - hasMask = _structs$i4[STRUCT_HAS_MASK$1]; + hasMask = _structs$i4[STRUCT_HAS_MASK]; var _node$__config = node.__config, - computedStyle = _node$__config[NODE_COMPUTED_STYLE$4], + computedStyle = _node$__config[NODE_COMPUTED_STYLE$1], refreshLevel = _node$__config[NODE_REFRESH_LV$1]; // 遮罩对象申请了个离屏,其第一个mask申请另外一个离屏mask2,开始聚集所有mask元素的绘制, // 这是一个十分特殊的逻辑,保存的index是最后一个节点的索引,OFFSCREEN_MASK2是最低优先级, // 这样当mask本身有filter时优先自身,然后才是OFFSCREEN_MASK2 @@ -29819,7 +29825,7 @@ } // render后判断可见状态,此时computedStyle才有值,以及svg的virtualDom也要生成 - if (computedStyle[DISPLAY$9] === 'none') { + if (computedStyle[DISPLAY$1] === 'none') { i += (total || 0) + (hasMask || 0); } } @@ -29838,12 +29844,12 @@ var _structs$i5 = __structs[i], node = _structs$i5[STRUCT_NODE$1], total = _structs$i5[STRUCT_TOTAL$1], - hasMask = _structs$i5[STRUCT_HAS_MASK$1]; + hasMask = _structs$i5[STRUCT_HAS_MASK]; var _node$__config2 = node.__config, refreshLevel = _node$__config2[NODE_REFRESH_LV$1], - defsCache = _node$__config2[NODE_DEFS_CACHE$6]; // 只要涉及到matrix和opacity就影响mask + defsCache = _node$__config2[NODE_DEFS_CACHE]; // 只要涉及到matrix和opacity就影响mask - var hasEffectMask = hasMask && (refreshLevel >= REPAINT$2 || contain$2(refreshLevel, TRANSFORM_ALL$1 | OP)); + var hasEffectMask = hasMask && (refreshLevel >= REPAINT$1 || contain$1(refreshLevel, TRANSFORM_ALL | OP)); if (hasEffectMask) { var start = i + (total || 0) + 1; @@ -29853,22 +29859,22 @@ } // >=REPAINT重绘生成走render()跳过这里 - if (refreshLevel < REPAINT$2) { + if (refreshLevel < REPAINT$1) { // 特殊的mask判断,遮罩对象影响这个mask了,除去filter、遮罩对象无TRANSFORM变化外都可缓存 if (maskEffectHash.hasOwnProperty(i)) { var v = maskEffectHash[i]; - if (!contain$2(refreshLevel, TRANSFORM_ALL$1) && v < REPAINT$2 && !contain$2(v, TRANSFORM_ALL$1)) { + if (!contain$1(refreshLevel, TRANSFORM_ALL) && v < REPAINT$1 && !contain$1(v, TRANSFORM_ALL)) { defsCache.forEach(function (item) { ctx.addCache(item); }); } } // 去除特殊的filter,普通节点或不影响的mask在 lastLv) { - matrixList.push(lastConfig[NODE_MATRIX$3]); - var vd = lastConfig[NODE_VIRTUAL_DOM$2]; + matrixList.push(lastConfig[NODE_MATRIX]); + var vd = lastConfig[NODE_VIRTUAL_DOM]; vdList.push(vd); parentVd = vd; } @@ -29927,18 +29933,18 @@ lastConfig = __config; var virtualDom = void 0; // svg小刷新等级时直接修改vd,这样Geom不再感知 - if (_refreshLevel2 < REPAINT$2 && !(_node4 instanceof Text)) { - __config[NODE_REFRESH_LV$1] = NONE$2; - virtualDom = __config[NODE_VIRTUAL_DOM$2]; // total可以跳过所有孩子节点省略循环 + if (_refreshLevel2 < REPAINT$1 && !(_node4 instanceof Text)) { + __config[NODE_REFRESH_LV$1] = NONE$1; + virtualDom = __config[NODE_VIRTUAL_DOM]; // total可以跳过所有孩子节点省略循环 if (__cacheTotal && __cacheTotal.available) { _i5 += _total8 || 0; virtualDom.cache = true; } else { __cacheTotal && (__cacheTotal.available = true); - virtualDom = __config[NODE_VIRTUAL_DOM$2] = _node4.__virtualDom = util.extend({}, virtualDom); // dom要清除children缓存,geom和img无需 + virtualDom = __config[NODE_VIRTUAL_DOM] = _node4.__virtualDom = util.extend({}, virtualDom); // dom要清除children缓存,geom和img无需 - if (_node4 instanceof Dom$1 && !(_node4 instanceof Img$1)) { + if (_node4 instanceof Dom && !(_node4 instanceof Img)) { virtualDom.children = []; } // 还得判断,和img加载混在一起时,触发刷新如果display:none,则还有cacheTotal @@ -29954,34 +29960,34 @@ } } - var currentStyle = __config[NODE_CURRENT_STYLE$5], - _computedStyle = __config[NODE_COMPUTED_STYLE$4], + var currentStyle = __config[NODE_CURRENT_STYLE$1], + _computedStyle = __config[NODE_COMPUTED_STYLE$1], __cacheStyle = __config[NODE_CACHE_STYLE$1]; - if (contain$2(_refreshLevel2, TRANSFORM_ALL$1)) { + if (contain$1(_refreshLevel2, TRANSFORM_ALL)) { var matrix = _node4.__calMatrix(_refreshLevel2, __cacheStyle, currentStyle, _computedStyle, __config); // 恶心的v8性能优化 - var m = __config[NODE_MATRIX$3]; + var m = __config[NODE_MATRIX]; util.assignMatrix(m, matrix); - if (!matrix || isE$3(matrix)) { + if (!matrix || isE(matrix)) { delete virtualDom.transform; } else { virtualDom.transform = 'matrix(' + util.joinArr(mx.m2m6(matrix), ',') + ')'; } if (parentMatrix && matrix) { - matrix = multiply$2(parentMatrix, matrix); + matrix = multiply(parentMatrix, matrix); } // 恶心的v8性能优化 - m = __config[NODE_MATRIX_EVENT$4]; + m = __config[NODE_MATRIX_EVENT]; util.assignMatrix(m, matrix); } - if (contain$2(_refreshLevel2, OP)) { - var opacity = _computedStyle[OPACITY$5] = currentStyle[OPACITY$5]; + if (contain$1(_refreshLevel2, OP)) { + var opacity = _computedStyle[OPACITY] = currentStyle[OPACITY]; if (opacity === 1) { delete virtualDom.opacity; @@ -29990,7 +29996,7 @@ } } - if (contain$2(_refreshLevel2, FT)) { + if (contain$1(_refreshLevel2, FT)) { var filter = _node4.__calFilter(currentStyle, _computedStyle); var s = painter.svgFilter(filter); @@ -30002,11 +30008,11 @@ } } - if (contain$2(_refreshLevel2, MBM)) { - var mixBlendMode = _computedStyle[MIX_BLEND_MODE$3] = currentStyle[MIX_BLEND_MODE$3]; + if (contain$1(_refreshLevel2, MBM)) { + var mixBlendMode = _computedStyle[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE]; - if (isValidMbm$2(mixBlendMode)) { - virtualDom.mixBlendMode = mbmName$2(mixBlendMode); + if (isValidMbm(mixBlendMode)) { + virtualDom.mixBlendMode = mbmName(mixBlendMode); } else { delete virtualDom.mixBlendMode; } @@ -30015,13 +30021,13 @@ virtualDom.lv = _refreshLevel2; } else { // >=REPAINT会调用render,重新生成defsCache,text没有这个东西 - __config[NODE_DEFS_CACHE$6] && __config[NODE_DEFS_CACHE$6].splice(0); + __config[NODE_DEFS_CACHE] && __config[NODE_DEFS_CACHE].splice(0); _node4.render(renderMode, _refreshLevel2, ctx); - virtualDom = __config[NODE_VIRTUAL_DOM$2]; // 渲染后更新取值 + virtualDom = __config[NODE_VIRTUAL_DOM]; // 渲染后更新取值 - display = computedStyle[DISPLAY$9]; + display = computedStyle[DISPLAY$1]; if (display === 'none') { _i5 += _total8 || 0; @@ -30038,7 +30044,7 @@ */ - if (maskHash.hasOwnProperty(_i5) && (maskEffectHash.hasOwnProperty(_i5) || _refreshLevel2 >= REPAINT$2 || contain$2(_refreshLevel2, TRANSFORM_ALL$1 | OP))) { + if (maskHash.hasOwnProperty(_i5) && (maskEffectHash.hasOwnProperty(_i5) || _refreshLevel2 >= REPAINT$1 || contain$1(_refreshLevel2, TRANSFORM_ALL | OP))) { var _maskHash$_i = maskHash[_i5], index = _maskHash$_i.index, _start2 = _maskHash$_i.start, @@ -30059,9 +30065,9 @@ for (var j = _start2; j < _end2; j++) { var _node5 = __structs[j][STRUCT_NODE$1]; var _node5$computedStyle = _node5.computedStyle, - _display = _node5$computedStyle[DISPLAY$9], - visibility = _node5$computedStyle[VISIBILITY$6], - fill = _node5$computedStyle[FILL$2], + _display = _node5$computedStyle[DISPLAY$1], + visibility = _node5$computedStyle[VISIBILITY$1], + fill = _node5$computedStyle[FILL], _node5$virtualDom = _node5.virtualDom, children = _node5$virtualDom.children, _opacity3 = _node5$virtualDom.opacity; @@ -30088,8 +30094,8 @@ } var _matrix = _node5.matrix; - var ivs = inverse$1(dom.matrix); - _matrix = multiply$2(ivs, _matrix); // path没有transform属性,在vd上,需要弥补 + var ivs = inverse(dom.matrix); + _matrix = multiply(ivs, _matrix); // path没有transform属性,在vd上,需要弥补 props.push(['transform', "matrix(".concat(util.joinArr(mx.m2m6(_matrix), ','), ")")]); // path没有opacity属性,在vd上,需要弥补 @@ -30098,32 +30104,32 @@ } } // img可能有matrix属性,需判断 else if (tagName === 'image') { - var hasTransform = -1; + var hasTransform = -1; - for (var _m2 = 0, _len6 = props.length; _m2 < _len6; _m2++) { - if (props[_m2][0] === 'transform') { - hasTransform = _m2; - break; - } + for (var _m2 = 0, _len6 = props.length; _m2 < _len6; _m2++) { + if (props[_m2][0] === 'transform') { + hasTransform = _m2; + break; } + } - if (hasTransform === -1) { - var _ivs = inverse$1(dom.matrix); + if (hasTransform === -1) { + var _ivs = inverse(dom.matrix); - if (!isE$3(_ivs)) { - props.push(['transform', "matrix(".concat(util.joinArr(mx.m2m6(_ivs), ','), ")")]); - } - } else { - var _matrix2 = props[hasTransform][1].match(/[\d.]+/g).map(function (i) { - return parseFloat(i); - }); + if (!isE(_ivs)) { + props.push(['transform', "matrix(".concat(util.joinArr(mx.m2m6(_ivs), ','), ")")]); + } + } else { + var _matrix2 = props[hasTransform][1].match(/[\d.]+/g).map(function (i) { + return parseFloat(i); + }); - var _ivs2 = inverse$1(dom.matrix); + var _ivs2 = inverse(dom.matrix); - _matrix2 = multiply$2(_ivs2, _matrix2); - props[hasTransform][1] = "matrix(".concat(util.joinArr(mx.m2m6(_matrix2), ','), ")"); - } + _matrix2 = multiply(_ivs2, _matrix2); + props[hasTransform][1] = "matrix(".concat(util.joinArr(mx.m2m6(_matrix2), ','), ")"); } + } } } } // 清掉上次的 @@ -30156,7 +30162,7 @@ } if (_i5 === 0) { - parentMatrix = __config[NODE_MATRIX$3]; + parentMatrix = __config[NODE_MATRIX]; parentVd = virtualDom; } @@ -30195,12 +30201,12 @@ for (var i = 0, len = __structs.length; i < len; i++) { var _structs$i6 = __structs[i], node = _structs$i6[STRUCT_NODE$1], - lv = _structs$i6[STRUCT_LV$2], + lv = _structs$i6[STRUCT_LV], total = _structs$i6[STRUCT_TOTAL$1], - hasMask = _structs$i6[STRUCT_HAS_MASK$1]; // Text特殊处理,webgl中先渲染为bitmap,再作为贴图绘制,缓存交由text内部判断,直接调用渲染纹理方法 + hasMask = _structs$i6[STRUCT_HAS_MASK]; // Text特殊处理,webgl中先渲染为bitmap,再作为贴图绘制,缓存交由text内部判断,直接调用渲染纹理方法 if (node instanceof Text) { - if (lastRefreshLevel >= REPAINT$2) { + if (lastRefreshLevel >= REPAINT$1) { node.render(renderMode, 0, gl, true); } @@ -30211,40 +30217,41 @@ var refreshLevel = __config[NODE_REFRESH_LV$1]; // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,Root节点是第一个特殊处理 if (i === 0) ; else if (lv > lastLv) { - parentMatrix = lastConfig[NODE_MATRIX_EVENT$4]; + parentMatrix = lastConfig[NODE_MATRIX_EVENT]; - if (isE$3(parentMatrix)) { + if (isE(parentMatrix)) { parentMatrix = null; } matrixList.push(parentMatrix); - parentOpacity = lastConfig[NODE_OPACITY$3]; + parentOpacity = lastConfig[NODE_OPACITY]; opacityList.push(parentOpacity); - parentPm = lastConfig[NODE_PERSPECTIVE_MATRIX$1]; + parentPm = lastConfig[NODE_PERSPECTIVE_MATRIX]; - if (isE$3(parentPm)) { + if (isE(parentPm)) { parentPm = null; } pmList.push(parentPm); } // 变小出栈索引需注意,可能不止一层,多层计算diff层级 else if (lv < lastLv) { - var diff = lastLv - lv; - matrixList.splice(-diff); - parentMatrix = matrixList[lv - 1]; - opacityList.splice(-diff); - parentOpacity = opacityList[lv - 1]; - pmList.splice(-diff); - parentPm = pmList[lv - 1]; - } + var diff = lastLv - lv; + matrixList.splice(-diff); + parentMatrix = matrixList[lv - 1]; + opacityList.splice(-diff); + parentOpacity = opacityList[lv - 1]; + pmList.splice(-diff); + parentPm = pmList[lv - 1]; + } // 不变是同级兄弟,无需特殊处理 + else ; lastRefreshLevel = refreshLevel; lastConfig = __config; lastLv = lv; var __cacheTotal = __config[NODE_CACHE_TOTAL$1], - computedStyle = __config[NODE_COMPUTED_STYLE$4]; // 跳过display:none元素和它的所有子节点 + computedStyle = __config[NODE_COMPUTED_STYLE$1]; // 跳过display:none元素和它的所有子节点 - if (computedStyle[DISPLAY$9] === 'none') { + if (computedStyle[DISPLAY$1] === 'none') { i += total || 0; // 只跳过自身不能跳过后面的mask,mask要渲染自身并进行缓存cache,以备对象切换display用 continue; @@ -30259,8 +30266,8 @@ * 如果没有或无效,直接添加,无视节点本身变化,后面防重即可 */ - if (refreshLevel < REPAINT$2) { - __config[NODE_REFRESH_LV$1] = NONE$2; + if (refreshLevel < REPAINT$1) { + __config[NODE_REFRESH_LV$1] = NONE$1; if (hasMask) { var cacheMask = __config[NODE_CACHE_MASK$1]; @@ -30271,24 +30278,24 @@ } } - var currentStyle = __config[NODE_CURRENT_STYLE$5], + var currentStyle = __config[NODE_CURRENT_STYLE$1], __cacheStyle = __config[NODE_CACHE_STYLE$1], - matrixEvent = __config[NODE_MATRIX_EVENT$4]; + matrixEvent = __config[NODE_MATRIX_EVENT]; - if (contain$2(refreshLevel, PPT)) { + if (contain$1(refreshLevel, PPT)) { node.__calPerspective(__cacheStyle, currentStyle, computedStyle, __config); } // transform变化,父元素的perspective变化也会在Root特殊处理重新计算 var matrix = void 0; - if (contain$2(refreshLevel, TRANSFORM_ALL$1)) { + if (contain$1(refreshLevel, TRANSFORM_ALL)) { matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config); // 恶心的v8性能优化 - var m = __config[NODE_MATRIX$3]; + var m = __config[NODE_MATRIX]; util.assignMatrix(m, matrix); } else { - matrix = __config[NODE_MATRIX$3]; + matrix = __config[NODE_MATRIX]; } // node本身有或者父有perspective都认为需要生成3d渲染上下文 @@ -30302,31 +30309,31 @@ if (parentPm) { - matrix = multiply$2(parentPm, matrix); + matrix = multiply(parentPm, matrix); } if (parentMatrix) { - matrix = multiply$2(parentMatrix, matrix); + matrix = multiply(parentMatrix, matrix); } // 恶心的v8性能优化 util.assignMatrix(matrixEvent, matrix); var opacity = void 0; - if (contain$2(refreshLevel, OP)) { - opacity = computedStyle[OPACITY$5] = currentStyle[OPACITY$5]; + if (contain$1(refreshLevel, OP)) { + opacity = computedStyle[OPACITY] = currentStyle[OPACITY]; } else { - opacity = computedStyle[OPACITY$5]; + opacity = computedStyle[OPACITY]; } - __config[NODE_OPACITY$3] = parentOpacity * opacity; // filter会改变bbox范围 + __config[NODE_OPACITY] = parentOpacity * opacity; // filter会改变bbox范围 - if (contain$2(refreshLevel, FT)) { + if (contain$1(refreshLevel, FT)) { node.__bbox = null; var _filter3 = node.__calFilter(currentStyle, computedStyle); - var __cacheFilter = __config[NODE_CACHE_FILTER$2]; + var __cacheFilter = __config[NODE_CACHE_FILTER$1]; if (__cacheFilter) { __cacheFilter.release(); @@ -30342,8 +30349,8 @@ } } - if (contain$2(refreshLevel, MBM)) { - computedStyle[MIX_BLEND_MODE$3] = currentStyle[MIX_BLEND_MODE$3]; + if (contain$1(refreshLevel, MBM)) { + computedStyle[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE]; } // total可以跳过所有孩子节点省略循环,filter/mask等的强制前提是有total @@ -30357,27 +30364,27 @@ * Geom没有子节点无需汇总局部根,Dom中Img也是,它们的局部根等于自身的cache,其它符合条件的Dom需要生成 */ else { - var res = node.render(renderMode, refreshLevel, gl, true); // geom可返回texture纹理,替代原有xom的__cache纹理 + var res = node.render(renderMode, refreshLevel, gl, true); // geom可返回texture纹理,替代原有xom的__cache纹理 - if (res && inject.isWebGLTexture(res.texture)) { - var sx1 = node.__sx1, - sy1 = node.__sy1, - w = node.offsetWidth, - h = node.offsetHeight, - bbox = node.bbox; - __config[NODE_CACHE$4] = new MockCache(gl, res.texture, sx1, sy1, w, h, bbox); - gl.viewport(0, 0, width, height); - gl.useProgram(gl.program); - } - } // 每个元素检查cacheTotal生成,已有的上面会continue跳过 + if (res && inject.isWebGLTexture(res.texture)) { + var sx1 = node.__sx1, + sy1 = node.__sy1, + w = node.offsetWidth, + h = node.offsetHeight, + bbox = node.bbox; + __config[NODE_CACHE$1] = new MockCache(gl, res.texture, sx1, sy1, w, h, bbox); + gl.viewport(0, 0, width, height); + gl.useProgram(gl.program); + } + } // 每个元素检查cacheTotal生成,已有的上面会continue跳过 - var limitCache = __config[NODE_LIMIT_CACHE$2]; - var overflow = computedStyle[OVERFLOW$3], - filter = computedStyle[FILTER$5], - mixBlendMode = computedStyle[MIX_BLEND_MODE$3], - transform = computedStyle[TRANSFORM$4]; - var validMbm = isValidMbm$2(mixBlendMode); // 3d渲染上下文 + var limitCache = __config[NODE_LIMIT_CACHE]; + var overflow = computedStyle[OVERFLOW], + filter = computedStyle[FILTER$1], + mixBlendMode = computedStyle[MIX_BLEND_MODE], + transform = computedStyle[TRANSFORM]; + var validMbm = isValidMbm(mixBlendMode); // 3d渲染上下文 var isPerspective = tf.isPerspectiveMatrix(transform) || parentPm; @@ -30419,11 +30426,11 @@ filter = _item6[7], overflow = _item6[8]; - var __cache = __config[NODE_CACHE$4], + var __cache = __config[NODE_CACHE$1], __cacheTotal = __config[NODE_CACHE_TOTAL$1], - __cacheFilter = __config[NODE_CACHE_FILTER$2], + __cacheFilter = __config[NODE_CACHE_FILTER$1], __cacheMask = __config[NODE_CACHE_MASK$1], - __cacheOverflow = __config[NODE_CACHE_OVERFLOW$2]; + __cacheOverflow = __config[NODE_CACHE_OVERFLOW$1]; var needGen; // 可能没变化,比如被遮罩节点、filter变更等 if (!__cacheTotal || !__cacheTotal.available) { @@ -30450,7 +30457,7 @@ needGen = true; if (!limitCache) { - __config[NODE_CACHE_FILTER$2] = target; + __config[NODE_CACHE_FILTER$1] = target; } } } @@ -30464,7 +30471,7 @@ needGen = true; if (!limitCache) { - __config[NODE_CACHE_FILTER$2] = target; + __config[NODE_CACHE_FILTER$1] = target; } } } @@ -30508,52 +30515,52 @@ var _structs$_i4 = __structs[_i7], _node6 = _structs$_i4[STRUCT_NODE$1], _total9 = _structs$_i4[STRUCT_TOTAL$1], - _hasMask3 = _structs$_i4[STRUCT_HAS_MASK$1]; + _hasMask3 = _structs$_i4[STRUCT_HAS_MASK]; var _config5 = _node6.__config; // text如果display不可见,parent会直接跳过,不会走到这里,这里一定是直接绘制到root的,visibility在其内部判断 if (_node6 instanceof Text) { // text特殊之处,__config部分是复用parent的 - var __cache = _config5[NODE_CACHE$4], - _limitCache2 = _config5[NODE_LIMIT_CACHE$2], - _config5$NODE_DOM_PAR = _config5[NODE_DOM_PARENT$5].__config, - _matrixEvent3 = _config5$NODE_DOM_PAR[NODE_MATRIX_EVENT$4], - _opacity4 = _config5$NODE_DOM_PAR[NODE_OPACITY$3]; + var __cache = _config5[NODE_CACHE$1], + _limitCache2 = _config5[NODE_LIMIT_CACHE], + _config5$NODE_DOM_PAR = _config5[NODE_DOM_PARENT$1].__config, + _matrixEvent3 = _config5$NODE_DOM_PAR[NODE_MATRIX_EVENT], + _opacity4 = _config5$NODE_DOM_PAR[NODE_OPACITY]; if (__cache && __cache.available) { texCache.addTexAndDrawWhenLimit(gl, __cache, _opacity4, _matrixEvent3, cx, cy, 0, 0, true); } // 超限特殊处理,先生成画布尺寸大小的纹理然后原始位置绘制 else if (_limitCache2) { - var c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__'); + var c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__'); - _node6.render(renderMode, 0, gl); + _node6.render(renderMode, 0, gl); - var j = texCache.lockOneChannel(); + var j = texCache.lockOneChannel(); - var _texture2 = webgl.createTexture(gl, c.canvas, j); + var _texture2 = webgl.createTexture(gl, c.canvas, j); - var mockCache = new MockCache(gl, _texture2, 0, 0, width, height, [0, 0, width, height]); - texCache.addTexAndDrawWhenLimit(gl, mockCache, _opacity4, _matrixEvent3, cx, cy, 0, 0, true); - texCache.refresh(gl, cx, cy, true); - c.ctx.setTransform(1, 0, 0, 1, 0, 0); - c.ctx.globalAlpha = 1; - c.ctx.clearRect(0, 0, width, height); - mockCache.release(); - texCache.releaseLockChannel(j); - } + var mockCache = new MockCache(gl, _texture2, 0, 0, width, height, [0, 0, width, height]); + texCache.addTexAndDrawWhenLimit(gl, mockCache, _opacity4, _matrixEvent3, cx, cy, 0, 0, true); + texCache.refresh(gl, cx, cy, true); + c.ctx.setTransform(1, 0, 0, 1, 0, 0); + c.ctx.globalAlpha = 1; + c.ctx.clearRect(0, 0, width, height); + mockCache.release(); + texCache.releaseLockChannel(j); + } } else { - var _opacity5 = _config5[NODE_OPACITY$3], - _matrixEvent4 = _config5[NODE_MATRIX_EVENT$4], - _limitCache3 = _config5[NODE_LIMIT_CACHE$2], - _cache = _config5[NODE_CACHE$4], + var _opacity5 = _config5[NODE_OPACITY], + _matrixEvent4 = _config5[NODE_MATRIX_EVENT], + _limitCache3 = _config5[NODE_LIMIT_CACHE], + _cache = _config5[NODE_CACHE$1], _cacheTotal2 = _config5[NODE_CACHE_TOTAL$1], - _cacheFilter2 = _config5[NODE_CACHE_FILTER$2], + _cacheFilter2 = _config5[NODE_CACHE_FILTER$1], __cacheMask = _config5[NODE_CACHE_MASK$1], - __cacheOverflow = _config5[NODE_CACHE_OVERFLOW$2], + __cacheOverflow = _config5[NODE_CACHE_OVERFLOW$1], _refreshLevel3 = _config5[NODE_REFRESH_LV$1], - _config5$NODE_COMPUTE = _config5[NODE_COMPUTED_STYLE$4], - display = _config5$NODE_COMPUTE[DISPLAY$9], - visibility = _config5$NODE_COMPUTE[VISIBILITY$6], - _mixBlendMode2 = _config5$NODE_COMPUTE[MIX_BLEND_MODE$3]; + _config5$NODE_COMPUTE = _config5[NODE_COMPUTED_STYLE$1], + display = _config5$NODE_COMPUTE[DISPLAY$1], + visibility = _config5$NODE_COMPUTE[VISIBILITY$1], + _mixBlendMode2 = _config5$NODE_COMPUTE[MIX_BLEND_MODE]; if (display === 'none') { _i7 += (_total9 || 0) + (_hasMask3 || 0); @@ -30568,7 +30575,7 @@ if (target) { // 有mbm先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成 - if (hasMbm && isValidMbm$2(_mixBlendMode2)) { + if (hasMbm && isValidMbm(_mixBlendMode2)) { texCache.refresh(gl, cx, cy, true); var _genFrameBufferWithTe19 = genFrameBufferWithTexture(gl, texCache, width, height), @@ -30580,7 +30587,7 @@ texCache.addTexAndDrawWhenLimit(gl, target, _opacity5, _matrixEvent4, cx, cy, 0, 0, true); texCache.refresh(gl, cx, cy, true); // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前画布作为绘制对象 - var _genMbmWebgl3 = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName$2(_mixBlendMode2), width, height); + var _genMbmWebgl3 = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(_mixBlendMode2), width, height); var _genMbmWebgl4 = _slicedToArray(_genMbmWebgl3, 3); @@ -30599,7 +30606,7 @@ } else if (limitHash.hasOwnProperty(_i7)) { var _target5 = limitHash[_i7]; - if (hasMbm && isValidMbm$2(_mixBlendMode2)) { + if (hasMbm && isValidMbm(_mixBlendMode2)) { texCache.refresh(gl, cx, cy, true); var _genFrameBufferWithTe21 = genFrameBufferWithTexture(gl, texCache, width, height), @@ -30611,7 +30618,7 @@ texCache.addTexAndDrawWhenLimit(gl, _target5, _opacity5, _matrixEvent4, cx, cy, 0, 0, true); texCache.refresh(gl, cx, cy, true); // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前画布作为绘制对象 - var _genMbmWebgl5 = genMbmWebgl(gl, texCache, n, _n, frameBuffer, texture, mbmName$2(_mixBlendMode2), width, height); + var _genMbmWebgl5 = genMbmWebgl(gl, texCache, n, _n, frameBuffer, texture, mbmName(_mixBlendMode2), width, height); var _genMbmWebgl6 = _slicedToArray(_genMbmWebgl5, 3); @@ -30628,30 +30635,30 @@ } // 超限的情况,这里是普通单节点超限,没有合成total后再合成特殊cache如filter/mask/mbm之类的, // 直接按原始位置绘制到离屏canvas,再作为纹理绘制即可,特殊的在total那做过降级了 else if (_limitCache3 && display !== 'none' && visibility !== 'hidden') { - // let m = mx.m2Mat4(matrixEvent, cx, cy); - var _c5 = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__'); + // let m = mx.m2Mat4(matrixEvent, cx, cy); + var _c5 = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__'); - _node6.render(renderMode, _refreshLevel3, gl); + _node6.render(renderMode, _refreshLevel3, gl); - var _j10 = texCache.lockOneChannel(); + var _j10 = texCache.lockOneChannel(); - var _texture4 = webgl.createTexture(gl, _c5.canvas, _j10); + var _texture4 = webgl.createTexture(gl, _c5.canvas, _j10); - var _mockCache2 = new MockCache(gl, _texture4, 0, 0, width, height, [0, 0, width, height]); + var _mockCache2 = new MockCache(gl, _texture4, 0, 0, width, height, [0, 0, width, height]); - texCache.addTexAndDrawWhenLimit(gl, _mockCache2, _opacity5, _matrixEvent4, cx, cy, 0, 0, true); - texCache.refresh(gl, cx, cy, true); + texCache.addTexAndDrawWhenLimit(gl, _mockCache2, _opacity5, _matrixEvent4, cx, cy, 0, 0, true); + texCache.refresh(gl, cx, cy, true); - _c5.ctx.setTransform(1, 0, 0, 1, 0, 0); + _c5.ctx.setTransform(1, 0, 0, 1, 0, 0); - _c5.ctx.globalAlpha = 1; + _c5.ctx.globalAlpha = 1; - _c5.ctx.clearRect(0, 0, width, height); + _c5.ctx.clearRect(0, 0, width, height); - _mockCache2.release(); + _mockCache2.release(); - texCache.releaseLockChannel(_j10); - } + texCache.releaseLockChannel(_j10); + } } } @@ -30772,16 +30779,16 @@ list.push([cache, opacity, matrix, dx, dy]); } // 找不到说明是新的纹理贴图,此时看是否超过纹理单元限制,超过则刷新绘制并清空,然后/否则 存入纹理列表 else { - i = pages.length; - - if (i >= this.__units - this.__lockUnits) { - // 绘制且清空,队列索引重新为0 - this.refresh(gl, cx, cy, revertY); - } + i = pages.length; - pages.push(page); - list.push([cache, opacity, matrix, dx, dy]); + if (i >= this.__units - this.__lockUnits) { + // 绘制且清空,队列索引重新为0 + this.refresh(gl, cx, cy, revertY); } + + pages.push(page); + list.push([cache, opacity, matrix, dx, dy]); + } } /** * 刷新 @@ -31035,85 +31042,85 @@ }(); 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$5 = _enums$STYLE_KEY$j.POSITION, - DISPLAY$a = _enums$STYLE_KEY$j.DISPLAY, - VISIBILITY$7 = _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$4 = _enums$STYLE_KEY$j.MARGIN_TOP, - MARGIN_LEFT$6 = _enums$STYLE_KEY$j.MARGIN_LEFT, - MARGIN_BOTTOM$4 = _enums$STYLE_KEY$j.MARGIN_BOTTOM, - PADDING_TOP$5 = _enums$STYLE_KEY$j.PADDING_TOP, - PADDING_LEFT$7 = _enums$STYLE_KEY$j.PADDING_LEFT, - PADDING_BOTTOM$5 = _enums$STYLE_KEY$j.PADDING_BOTTOM, - BORDER_TOP_WIDTH$6 = _enums$STYLE_KEY$j.BORDER_TOP_WIDTH, - BORDER_LEFT_WIDTH$8 = _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, - _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, - UPDATE_ADD_DOM$1 = _enums$UPDATE_KEY$5.UPDATE_ADD_DOM, - UPDATE_REMOVE_DOM$1 = _enums$UPDATE_KEY$5.UPDATE_REMOVE_DOM, - _enums$NODE_KEY$a = enums.NODE_KEY, - NODE_TAG_NAME$1 = _enums$NODE_KEY$a.NODE_TAG_NAME, - NODE_CACHE_STYLE$2 = _enums$NODE_KEY$a.NODE_CACHE_STYLE, - NODE_CACHE_PROPS$1 = _enums$NODE_KEY$a.NODE_CACHE_PROPS, - NODE_CURRENT_STYLE$6 = _enums$NODE_KEY$a.NODE_CURRENT_STYLE, - NODE_COMPUTED_STYLE$5 = _enums$NODE_KEY$a.NODE_COMPUTED_STYLE, - NODE_CURRENT_PROPS$1 = _enums$NODE_KEY$a.NODE_CURRENT_PROPS, - NODE_DOM_PARENT$6 = _enums$NODE_KEY$a.NODE_DOM_PARENT, - NODE_IS_MASK$3 = _enums$NODE_KEY$a.NODE_IS_MASK, - NODE_REFRESH_LV$2 = _enums$NODE_KEY$a.NODE_REFRESH_LV, - NODE_IS_DESTROYED$2 = _enums$NODE_KEY$a.NODE_IS_DESTROYED, - NODE_STYLE$5 = _enums$NODE_KEY$a.NODE_STYLE, - NODE_UPDATE_HASH = _enums$NODE_KEY$a.NODE_UPDATE_HASH, - NODE_UNIQUE_UPDATE_ID = _enums$NODE_KEY$a.NODE_UNIQUE_UPDATE_ID, - NODE_CACHE$5 = _enums$NODE_KEY$a.NODE_CACHE, - NODE_CACHE_TOTAL$2 = _enums$NODE_KEY$a.NODE_CACHE_TOTAL, - NODE_CACHE_FILTER$3 = _enums$NODE_KEY$a.NODE_CACHE_FILTER, - NODE_CACHE_OVERFLOW$3 = _enums$NODE_KEY$a.NODE_CACHE_OVERFLOW, - NODE_CACHE_MASK$2 = _enums$NODE_KEY$a.NODE_CACHE_MASK, - NODE_STRUCT$4 = _enums$NODE_KEY$a.NODE_STRUCT, - _enums$STRUCT_KEY$3 = enums.STRUCT_KEY, - STRUCT_INDEX$2 = _enums$STRUCT_KEY$3.STRUCT_INDEX, - STRUCT_TOTAL$2 = _enums$STRUCT_KEY$3.STRUCT_TOTAL, - STRUCT_NODE$2 = _enums$STRUCT_KEY$3.STRUCT_NODE; - var DIRECTION_HASH = (_DIRECTION_HASH = {}, _defineProperty(_DIRECTION_HASH, TOP$4, true), _defineProperty(_DIRECTION_HASH, RIGHT$2, true), _defineProperty(_DIRECTION_HASH, BOTTOM$4, true), _defineProperty(_DIRECTION_HASH, LEFT$2, true), _DIRECTION_HASH); - var isNil$8 = util.isNil, - isObject$2 = util.isObject, - isFunction$7 = util.isFunction; - var AUTO$8 = o.AUTO, - PX$b = o.PX, - PERCENT$c = o.PERCENT, - INHERIT$5 = o.INHERIT; - var isRelativeOrAbsolute$2 = css.isRelativeOrAbsolute, - equalStyle$1 = css.equalStyle; - var contain$3 = o$3.contain, - getLevel = o$3.getLevel, - isRepaint = o$3.isRepaint, - NONE$3 = o$3.NONE, - FILTER$6 = o$3.FILTER, - PERSPECTIVE$5 = o$3.PERSPECTIVE, - REPAINT$3 = o$3.REPAINT, - REFLOW$2 = o$3.REFLOW, - REBUILD = o$3.REBUILD; + var _enums$STYLE_KEY$6 = enums.STYLE_KEY, + TOP = _enums$STYLE_KEY$6.TOP, + RIGHT = _enums$STYLE_KEY$6.RIGHT, + BOTTOM = _enums$STYLE_KEY$6.BOTTOM, + LEFT = _enums$STYLE_KEY$6.LEFT, + POSITION = _enums$STYLE_KEY$6.POSITION, + DISPLAY = _enums$STYLE_KEY$6.DISPLAY, + VISIBILITY = _enums$STYLE_KEY$6.VISIBILITY, + COLOR = _enums$STYLE_KEY$6.COLOR, + WIDTH = _enums$STYLE_KEY$6.WIDTH, + HEIGHT = _enums$STYLE_KEY$6.HEIGHT, + Z_INDEX = _enums$STYLE_KEY$6.Z_INDEX, + MARGIN_TOP = _enums$STYLE_KEY$6.MARGIN_TOP, + MARGIN_LEFT = _enums$STYLE_KEY$6.MARGIN_LEFT, + MARGIN_BOTTOM = _enums$STYLE_KEY$6.MARGIN_BOTTOM, + PADDING_TOP = _enums$STYLE_KEY$6.PADDING_TOP, + PADDING_LEFT = _enums$STYLE_KEY$6.PADDING_LEFT, + PADDING_BOTTOM = _enums$STYLE_KEY$6.PADDING_BOTTOM, + BORDER_TOP_WIDTH = _enums$STYLE_KEY$6.BORDER_TOP_WIDTH, + BORDER_LEFT_WIDTH = _enums$STYLE_KEY$6.BORDER_LEFT_WIDTH, + BORDER_BOTTOM_WIDTH = _enums$STYLE_KEY$6.BORDER_BOTTOM_WIDTH, + POINTER_EVENTS = _enums$STYLE_KEY$6.POINTER_EVENTS, + _enums$UPDATE_KEY = enums.UPDATE_KEY, + UPDATE_NODE = _enums$UPDATE_KEY.UPDATE_NODE, + UPDATE_STYLE = _enums$UPDATE_KEY.UPDATE_STYLE, + UPDATE_KEYS = _enums$UPDATE_KEY.UPDATE_KEYS, + UPDATE_COMPONENT = _enums$UPDATE_KEY.UPDATE_COMPONENT, + UPDATE_FOCUS = _enums$UPDATE_KEY.UPDATE_FOCUS, + UPDATE_MEASURE = _enums$UPDATE_KEY.UPDATE_MEASURE, + UPDATE_OVERWRITE = _enums$UPDATE_KEY.UPDATE_OVERWRITE, + UPDATE_LIST = _enums$UPDATE_KEY.UPDATE_LIST, + UPDATE_CONFIG = _enums$UPDATE_KEY.UPDATE_CONFIG, + UPDATE_ADD_DOM = _enums$UPDATE_KEY.UPDATE_ADD_DOM, + UPDATE_REMOVE_DOM = _enums$UPDATE_KEY.UPDATE_REMOVE_DOM, + _enums$NODE_KEY = enums.NODE_KEY, + NODE_TAG_NAME = _enums$NODE_KEY.NODE_TAG_NAME, + NODE_CACHE_STYLE = _enums$NODE_KEY.NODE_CACHE_STYLE, + NODE_CACHE_PROPS = _enums$NODE_KEY.NODE_CACHE_PROPS, + NODE_CURRENT_STYLE = _enums$NODE_KEY.NODE_CURRENT_STYLE, + NODE_COMPUTED_STYLE = _enums$NODE_KEY.NODE_COMPUTED_STYLE, + NODE_CURRENT_PROPS = _enums$NODE_KEY.NODE_CURRENT_PROPS, + NODE_DOM_PARENT = _enums$NODE_KEY.NODE_DOM_PARENT, + NODE_IS_MASK = _enums$NODE_KEY.NODE_IS_MASK, + NODE_REFRESH_LV = _enums$NODE_KEY.NODE_REFRESH_LV, + NODE_IS_DESTROYED = _enums$NODE_KEY.NODE_IS_DESTROYED, + NODE_STYLE = _enums$NODE_KEY.NODE_STYLE, + NODE_UPDATE_HASH = _enums$NODE_KEY.NODE_UPDATE_HASH, + NODE_UNIQUE_UPDATE_ID = _enums$NODE_KEY.NODE_UNIQUE_UPDATE_ID, + NODE_CACHE = _enums$NODE_KEY.NODE_CACHE, + NODE_CACHE_TOTAL = _enums$NODE_KEY.NODE_CACHE_TOTAL, + NODE_CACHE_FILTER = _enums$NODE_KEY.NODE_CACHE_FILTER, + NODE_CACHE_OVERFLOW = _enums$NODE_KEY.NODE_CACHE_OVERFLOW, + NODE_CACHE_MASK = _enums$NODE_KEY.NODE_CACHE_MASK, + NODE_STRUCT = _enums$NODE_KEY.NODE_STRUCT, + _enums$STRUCT_KEY = enums.STRUCT_KEY, + STRUCT_INDEX = _enums$STRUCT_KEY.STRUCT_INDEX, + STRUCT_TOTAL = _enums$STRUCT_KEY.STRUCT_TOTAL, + STRUCT_NODE = _enums$STRUCT_KEY.STRUCT_NODE; + var DIRECTION_HASH = (_DIRECTION_HASH = {}, _defineProperty(_DIRECTION_HASH, TOP, true), _defineProperty(_DIRECTION_HASH, RIGHT, true), _defineProperty(_DIRECTION_HASH, BOTTOM, true), _defineProperty(_DIRECTION_HASH, LEFT, true), _DIRECTION_HASH); + var isNil$7 = util.isNil, + isObject = util.isObject, + isFunction$1 = util.isFunction; + var AUTO = o$4.AUTO, + PX = o$4.PX, + PERCENT = o$4.PERCENT, + INHERIT = o$4.INHERIT; + var isRelativeOrAbsolute = css.isRelativeOrAbsolute, + equalStyle = css.equalStyle; + var contain = o$1.contain, + getLevel = o$1.getLevel, + isRepaint = o$1.isRepaint, + NONE = o$1.NONE, + FILTER = o$1.FILTER, + PERSPECTIVE = o$1.PERSPECTIVE, + REPAINT = o$1.REPAINT, + REFLOW = o$1.REFLOW, + REBUILD = o$1.REBUILD; var isIgnore = o$2.isIgnore, - isGeom$3 = o$2.isGeom, + isGeom = o$2.isGeom, isMeasure = o$2.isMeasure; var ROOT_DOM_NAME = { canvas: 'canvas', @@ -31193,18 +31200,18 @@ function isFixedWidthOrHeight(node, k) { var c = node.currentStyle[k]; - return c[1] !== AUTO$8; + return c[1] !== AUTO; } // 除了固定尺寸,父级也不能是flex或变化flex function isFixedSize(node, includeParentFlex) { - var res = isFixedWidthOrHeight(node, WIDTH$8) && isFixedWidthOrHeight(node, HEIGHT$8); + var res = isFixedWidthOrHeight(node, WIDTH) && isFixedWidthOrHeight(node, HEIGHT); if (res && includeParentFlex) { var parent = node.domParent; if (parent) { - if (parent.currentStyle[DISPLAY$a] === 'flex' || parent.computedStyle[DISPLAY$a] === 'flex') { + if (parent.currentStyle[DISPLAY] === 'flex' || parent.computedStyle[DISPLAY] === 'flex') { return false; } } @@ -31247,13 +31254,13 @@ function checkInfluence(root, reflowHash, node, component, addDom) { // add情况abs节点特殊对待不影响其它节点,不能判断display,因为inline会强制block - if (addDom && node.currentStyle[POSITION$5] === 'absolute') { + if (addDom && node.currentStyle[POSITION] === 'absolute') { return; } var target = node; // inline新老都影响,节点变为最近的父非inline - if (['inline', 'inlineBlock', 'inline-block'].indexOf(target.currentStyle[DISPLAY$a]) > -1 || ['inline', 'inlineBlock', 'inline-block'].indexOf(target.computedStyle[DISPLAY$a]) > -1) { + if (['inline', 'inlineBlock', 'inline-block'].indexOf(target.currentStyle[DISPLAY]) > -1 || ['inline', 'inlineBlock', 'inline-block'].indexOf(target.computedStyle[DISPLAY]) > -1) { do { target = target.domParent; // 父到root提前跳出 @@ -31267,11 +31274,11 @@ } // 遇到absolute跳出,设置其布局;如果absolute不变化普通处理,如果absolute发生变化,一定会存在于列表中,不用考虑 - if (target.currentStyle[POSITION$5] === 'absolute' || target.computedStyle[POSITION$5] === 'absolute') { + if (target.currentStyle[POSITION] === 'absolute' || target.computedStyle[POSITION] === 'absolute') { setLAYOUT(target, reflowHash, component, addDom); return; } - } while (target && (['inline', 'inlineBlock', 'inline-block'].indexOf(target.currentStyle[DISPLAY$a]) > -1 || ['inline', 'inlineBlock', 'inline-block'].indexOf(target.computedStyle[DISPLAY$a]) > -1)); // target已不是inline,父固定宽高跳出直接父进行LAYOUT即可,不影响上下文,但不能是flex孩子,此时固定尺寸无用 + } while (target && (['inline', 'inlineBlock', 'inline-block'].indexOf(target.currentStyle[DISPLAY]) > -1 || ['inline', 'inlineBlock', 'inline-block'].indexOf(target.computedStyle[DISPLAY]) > -1)); // target已不是inline,父固定宽高跳出直接父进行LAYOUT即可,不影响上下文,但不能是flex孩子,此时固定尺寸无用 if (isFixedSize(target, true)) { @@ -31297,12 +31304,12 @@ } // flex相关,包含变化或不变化 - if (parent.computedStyle[DISPLAY$a] === 'flex' || parent.currentStyle[DISPLAY$a] === 'flex') { + if (parent.computedStyle[DISPLAY] === 'flex' || parent.currentStyle[DISPLAY] === 'flex') { topFlex = parent; } // 遇到absolute跳出,如果absolute不变化普通处理,如果absolute发生变化,一定会存在于列表中,不用考虑 - if (parent.currentStyle[POSITION$5] === 'absolute' || parent.computedStyle[POSITION$5] === 'absolute') { + if (parent.currentStyle[POSITION] === 'absolute' || parent.computedStyle[POSITION] === 'absolute') { break; } // 父固定宽高跳出 @@ -31327,7 +31334,7 @@ while (parent) { // 无论新老absolute,不变化则设置,变化一定会出现在列表中 - if (parent.currentStyle[POSITION$5] === 'absolute' || parent.computedStyle[POSITION$5] === 'absolute') { + if (parent.currentStyle[POSITION] === 'absolute' || parent.computedStyle[POSITION] === 'absolute') { if (parent === root) { break; } // 固定尺寸的不用设置,需要跳出循环 @@ -31353,9 +31360,9 @@ var prev = node.prev, next = node.next; - if (prev && ['inline', 'inline-block', 'inlineBlock'].indexOf(prev.currentStyle[DISPLAY$a]) > -1) { + if (prev && ['inline', 'inline-block', 'inlineBlock'].indexOf(prev.currentStyle[DISPLAY]) > -1) { isSiblingBlock = false; - } else if (next && ['inline', 'inline-block', 'inlineBlock'].indexOf(next.currentStyle[DISPLAY$a]) > -1) { + } else if (next && ['inline', 'inline-block', 'inlineBlock'].indexOf(next.currentStyle[DISPLAY]) > -1) { isSiblingBlock = false; } @@ -31374,25 +31381,25 @@ var uniqueUpdateId = 0; function parseUpdate(renderMode, root, target, reflowList, measureList, 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], + var node = target[UPDATE_NODE], + style = target[UPDATE_STYLE], + overwrite = target[UPDATE_OVERWRITE], + focus = target[UPDATE_FOCUS], component = target[UPDATE_COMPONENT], - measure = target[UPDATE_MEASURE$2], + measure = target[UPDATE_MEASURE], list = target[UPDATE_LIST], - keys = target[UPDATE_KEYS$2], - __config = target[UPDATE_CONFIG$5], - addDom = target[UPDATE_ADD_DOM$1], - removeDom = target[UPDATE_REMOVE_DOM$1]; + keys = target[UPDATE_KEYS], + __config = target[UPDATE_CONFIG], + addDom = target[UPDATE_ADD_DOM], + removeDom = target[UPDATE_REMOVE_DOM]; - if (__config[NODE_IS_DESTROYED$2]) { + if (__config[NODE_IS_DESTROYED]) { return; } // updateStyle()这样的调用需要覆盖原有样式,因为是按顺序遍历,后面的优先级自动更高不怕重复 if (overwrite) { - Object.assign(__config[NODE_STYLE$5], overwrite); + Object.assign(__config[NODE_STYLE], overwrite); } // 多次调用更新才会有list,一般没有,优化;component无需,因为多次都是它自己 @@ -31404,9 +31411,9 @@ hash[k] = true; }); list.forEach(function (item) { - var style2 = item[UPDATE_STYLE$2], - overwrite = item[UPDATE_OVERWRITE$1], - keys2 = item[UPDATE_KEYS$2]; + var style2 = item[UPDATE_STYLE], + overwrite = item[UPDATE_OVERWRITE], + keys2 = item[UPDATE_KEYS]; (keys2 || []).forEach(function (k2) { if (!hash.hasOwnProperty(k2)) { hash[k2] = true; @@ -31415,7 +31422,7 @@ }); if (overwrite) { - Object.assign(__config[NODE_STYLE$5], overwrite); + Object.assign(__config[NODE_STYLE], overwrite); } if (style2) { @@ -31429,15 +31436,15 @@ } // 按节点合并完style后判断改变等级 - var tagName = __config[NODE_TAG_NAME$1], - __cacheStyle = __config[NODE_CACHE_STYLE$2], - __cacheProps = __config[NODE_CACHE_PROPS$1], - currentStyle = __config[NODE_CURRENT_STYLE$6], - computedStyle = __config[NODE_COMPUTED_STYLE$5], - currentProps = __config[NODE_CURRENT_PROPS$1], - domParent = __config[NODE_DOM_PARENT$6], - isMask = __config[NODE_IS_MASK$3]; - var lv = focus || NONE$3; + var tagName = __config[NODE_TAG_NAME], + __cacheStyle = __config[NODE_CACHE_STYLE], + __cacheProps = __config[NODE_CACHE_PROPS], + currentStyle = __config[NODE_CURRENT_STYLE], + computedStyle = __config[NODE_COMPUTED_STYLE], + currentProps = __config[NODE_CURRENT_PROPS], + domParent = __config[NODE_DOM_PARENT], + isMask = __config[NODE_IS_MASK]; + var lv = focus || NONE; var hasMeasure = measure; var hasZ, hasVisibility, hasColor, hasDisplay; // component无需遍历直接赋值,img重新加载等情况没有样式更新 @@ -31446,15 +31453,15 @@ var k = keys[i]; var v = style[k]; // 只有geom的props和style2种可能 - if (node instanceof Geom$1 && isGeom$3(tagName, k)) { - if (!equalStyle$1(k, v, currentProps[k], node)) { - lv |= REPAINT$3; + if (node instanceof Geom && isGeom(tagName, k)) { + if (!equalStyle(k, v, currentProps[k], node)) { + lv |= REPAINT; __cacheProps[k] = undefined; currentProps[k] = v; } } else { // 需和现在不等,且不是pointerEvents这种无关的 - if (!equalStyle$1(k, v, currentStyle[k], node)) { + if (!equalStyle(k, v, currentStyle[k], node)) { // pointerEvents这种无关的只需更新 if (isIgnore(k)) { __cacheStyle[k] = undefined; @@ -31462,13 +31469,13 @@ } else { // TRBL变化只对relative/absolute起作用,其它忽视 if (DIRECTION_HASH.hasOwnProperty(k)) { - var position = currentStyle[POSITION$5]; + var position = currentStyle[POSITION]; if (position !== 'relative' && position !== 'absolute') { delete style[k]; continue; } - } else if (k === DISPLAY$a) { + } else if (k === DISPLAY) { hasDisplay = true; } // repaint细化等级,reflow在checkReflow() @@ -31483,15 +31490,15 @@ __cacheStyle[k] = undefined; currentStyle[k] = v; - if (k === Z_INDEX$4 && node !== root) { + if (k === Z_INDEX && node !== root) { hasZ = true; } - if (k === VISIBILITY$7) { + if (k === VISIBILITY) { hasVisibility = true; } - if (k === COLOR$5) { + if (k === COLOR) { hasColor = true; } } @@ -31502,13 +31509,13 @@ // 但是perspective需考虑进来,虽然不影响自己但影响别人,要返回true表明有变更 - if (lv === NONE$3 && !component) { + if (lv === NONE && !component) { delete __config[NODE_UNIQUE_UPDATE_ID]; return; } // 由于父节点中有display:none,或本身节点也为none,执行普通动画是无效的,此时没有display变化 - if (computedStyle[DISPLAY$a] === 'none' && !hasDisplay) { + if (computedStyle[DISPLAY] === 'none' && !hasDisplay) { return; } // 记录下来清除parent的zIndexChildren缓存 @@ -31519,28 +31526,28 @@ if (hasVisibility || hasColor) { - for (var __structs = root.__structs, __struct = node.__config[NODE_STRUCT$4], _i = __struct[STRUCT_INDEX$2] + 1, _len = _i + __struct[STRUCT_TOTAL$2]; _i < _len; _i++) { + for (var __structs = root.__structs, __struct = node.__config[NODE_STRUCT], _i = __struct[STRUCT_INDEX] + 1, _len = _i + __struct[STRUCT_TOTAL]; _i < _len; _i++) { var _structs$_i = __structs[_i], - _node = _structs$_i[STRUCT_NODE$2], - total = _structs$_i[STRUCT_TOTAL$2]; + _node = _structs$_i[STRUCT_NODE], + total = _structs$_i[STRUCT_TOTAL]; var _config = _node.__config; - var _currentStyle = _config[NODE_CURRENT_STYLE$6]; + var _currentStyle = _config[NODE_CURRENT_STYLE]; var _need = void 0; // text的style指向parent,因此text一定变更 - if (hasVisibility && (_node instanceof Text || _currentStyle[VISIBILITY$7][1] === INHERIT$5)) { + if (hasVisibility && (_node instanceof Text || _currentStyle[VISIBILITY][1] === INHERIT)) { _need = true; } - if (hasColor && (_node instanceof Text || _currentStyle[COLOR$5][1] === INHERIT$5)) { + if (hasColor && (_node instanceof Text || _currentStyle[COLOR][1] === INHERIT)) { _need = true; } if (_need) { - _config[NODE_REFRESH_LV$2] |= REPAINT$3; + _config[NODE_REFRESH_LV] |= REPAINT; - if (_node instanceof Xom$1) { + if (_node instanceof Xom) { _node.clearCache(); } } else { @@ -31557,8 +31564,8 @@ prev = prev.prev; } - if (prev && prev.__config[NODE_CACHE_MASK$2]) { - prev.__config[NODE_CACHE_MASK$2].release(); + if (prev && prev.__config[NODE_CACHE_MASK]) { + prev.__config[NODE_CACHE_MASK].release(); } } // 特殊情况,父节点display:none,子节点进行任意变更,应视为无效 // 如果父节点由none变block,这里也return false,因为父节点会重新layout+render @@ -31570,8 +31577,8 @@ if (hasDisplay && parent) { var _config2 = parent.__config; - if (_config2[NODE_CURRENT_STYLE$6][DISPLAY$a] === 'none' || _config2[NODE_COMPUTED_STYLE$5][DISPLAY$a] === 'none') { - computedStyle[DISPLAY$a] = 'none'; + if (_config2[NODE_CURRENT_STYLE][DISPLAY] === 'none' || _config2[NODE_COMPUTED_STYLE][DISPLAY] === 'none') { + computedStyle[DISPLAY] = 'none'; return; } } // reflow/repaint/measure相关的记录下来 @@ -31582,7 +31589,7 @@ if (isRp) { // zIndex变化需清空svg缓存 if (hasZ && renderMode === mode.SVG) { - lv |= REPAINT$3; + lv |= REPAINT; domParent && cleanSvgCache(domParent); } // z改变影响struct局部重排,它的数量不会变因此不影响外围,此处先收集,最后统一对局部根节点进行更新 @@ -31596,21 +31603,21 @@ } } // reflow在root的refresh中做 else { - reflowList.push({ - node: node, - style: style, - component: component, - addDom: addDom, - removeDom: removeDom - }); // measure需要提前先处理 + reflowList.push({ + node: node, + style: style, + component: component, + addDom: addDom, + removeDom: removeDom + }); // measure需要提前先处理 - if (hasMeasure) { - measureList.push(node); - } - } // 这里也需|运算,每次刷新会置0,但是如果父元素进行继承变更,会在此元素分析前更改,比如visibility,此时不能直接赋值 + if (hasMeasure) { + measureList.push(node); + } + } // 这里也需|运算,每次刷新会置0,但是如果父元素进行继承变更,会在此元素分析前更改,比如visibility,此时不能直接赋值 - __config[NODE_REFRESH_LV$2] |= lv; + __config[NODE_REFRESH_LV] |= lv; if (component || addDom || removeDom) { root.__rlv = REBUILD; @@ -31619,32 +31626,32 @@ } // dom在>=REPAINT时total失效,svg的Geom比较特殊 - var need = lv >= REPAINT$3 || renderMode === mode.SVG && node instanceof Geom$1; + var need = lv >= REPAINT || renderMode === mode.SVG && node instanceof Geom; if (need) { - if (__config[NODE_CACHE$5]) { - __config[NODE_CACHE$5].release(); + if (__config[NODE_CACHE]) { + __config[NODE_CACHE].release(); } } // perspective也特殊只清空total的cache,和>=REPAINT清空total共用 - if (need || contain$3(lv, PERSPECTIVE$5)) { - if (__config[NODE_CACHE_TOTAL$2]) { - __config[NODE_CACHE_TOTAL$2].release(); + if (need || contain(lv, PERSPECTIVE)) { + if (__config[NODE_CACHE_TOTAL]) { + __config[NODE_CACHE_TOTAL].release(); } - if (__config[NODE_CACHE_MASK$2]) { - __config[NODE_CACHE_MASK$2].release(); + if (__config[NODE_CACHE_MASK]) { + __config[NODE_CACHE_MASK].release(); } - if (__config[NODE_CACHE_OVERFLOW$3]) { - __config[NODE_CACHE_OVERFLOW$3].release(); + if (__config[NODE_CACHE_OVERFLOW]) { + __config[NODE_CACHE_OVERFLOW].release(); } } // 特殊的filter清除cache - if ((need || contain$3(lv, FILTER$6)) && __config[NODE_CACHE_FILTER$3]) { - __config[NODE_CACHE_FILTER$3].release(); + if ((need || contain(lv, FILTER)) && __config[NODE_CACHE_FILTER]) { + __config[NODE_CACHE_FILTER].release(); } // 向上清除等级>=REPAINT的汇总缓存信息,过程中可能会出现重复,因此节点上记录一个临时标防止重复递归 @@ -31661,37 +31668,37 @@ cacheHash[id] = true; } // 没有的需要设置一个标识 else { - cacheHash[uniqueUpdateId] = true; - _config3[NODE_UNIQUE_UPDATE_ID] = uniqueUpdateId++; - cacheList.push(_config3); - } + cacheHash[uniqueUpdateId] = true; + _config3[NODE_UNIQUE_UPDATE_ID] = uniqueUpdateId++; + cacheList.push(_config3); + } - var _lv = _config3[NODE_REFRESH_LV$2]; + var _lv = _config3[NODE_REFRESH_LV]; - var _need2 = _lv >= REPAINT$3; + var _need2 = _lv >= REPAINT; - if (_need2 && _config3[NODE_CACHE$5]) { - _config3[NODE_CACHE$5].release(); + if (_need2 && _config3[NODE_CACHE]) { + _config3[NODE_CACHE].release(); } // 前面已经过滤了无改变NONE的,只要孩子有任何改变父亲就要清除 - if (_config3[NODE_CACHE_TOTAL$2]) { - _config3[NODE_CACHE_TOTAL$2].release(); + if (_config3[NODE_CACHE_TOTAL]) { + _config3[NODE_CACHE_TOTAL].release(); } - if (_config3[NODE_CACHE_FILTER$3]) { - _config3[NODE_CACHE_FILTER$3].release(); + if (_config3[NODE_CACHE_FILTER]) { + _config3[NODE_CACHE_FILTER].release(); } - if (_config3[NODE_CACHE_MASK$2]) { - _config3[NODE_CACHE_MASK$2].release(); + if (_config3[NODE_CACHE_MASK]) { + _config3[NODE_CACHE_MASK].release(); } - if (_config3[NODE_CACHE_OVERFLOW$3]) { - _config3[NODE_CACHE_OVERFLOW$3].release(); + if (_config3[NODE_CACHE_OVERFLOW]) { + _config3[NODE_CACHE_OVERFLOW].release(); } - parent = _config3[NODE_DOM_PARENT$6]; + parent = _config3[NODE_DOM_PARENT]; } return true; @@ -31701,14 +31708,14 @@ var __config = node.__config; if (child) { - __config[NODE_REFRESH_LV$2] |= REPAINT$3; + __config[NODE_REFRESH_LV] |= REPAINT; } else { - __config[NODE_CACHE_TOTAL$2].release(); + __config[NODE_CACHE_TOTAL].release(); } if (Array.isArray(node.children)) { node.children.forEach(function (child) { - if (child instanceof Component$1) { + if (child instanceof Component) { child = child.shadowRoot; } @@ -31719,7 +31726,7 @@ } } - var uuid$2 = 0; + var uuid = 0; var Root = /*#__PURE__*/function (_Dom) { _inherits(Root, _Dom); @@ -31751,7 +31758,7 @@ _this.__animateController = new Controller(); Event.mix(_assertThisInitialized(_this)); _this.__config[NODE_UPDATE_HASH] = _this.__updateHash = {}; - _this.__uuid = uuid$2++; + _this.__uuid = uuid++; _this.__rlv = REBUILD; // 每次刷新最大lv return _this; @@ -31762,7 +31769,7 @@ value: function __initProps() { var w = this.props.width; - if (!isNil$8(w)) { + if (!isNil$7(w)) { var value = parseFloat(w) || 0; if (value > 0) { @@ -31772,7 +31779,7 @@ var h = this.props.height; - if (!isNil$8(h)) { + if (!isNil$7(h)) { var _value = parseFloat(h) || 0; if (_value > 0) { @@ -31825,13 +31832,13 @@ x = clientX - x; y = clientY - y; // 外边的scale影响元素事件响应,根据倍数计算真实的坐标,优先手动指定,否则自动计算 - if (!isNil$8(__scx)) { + if (!isNil$7(__scx)) { x /= __scx; } else { x *= this.width / width; } - if (!isNil$8(__scy)) { + if (!isNil$7(__scy)) { y /= __scy; } else { y *= this.height / height; @@ -31895,24 +31902,24 @@ this.__height = dom.height; } // 已有root节点 else if (dom.nodeName.toLowerCase() === domName) { - this.__dom = dom; + this.__dom = dom; - if (this.width) { - dom.setAttribute('width', this.width); - } + if (this.width) { + dom.setAttribute('width', this.width); + } - if (this.height) { - dom.setAttribute('height', this.height); - } - } // 没有canvas/svg节点则生成一个新的 - else { - this.__dom = dom.querySelector(domName); + if (this.height) { + dom.setAttribute('height', this.height); + } + } // 没有canvas/svg节点则生成一个新的 + else { + this.__dom = dom.querySelector(domName); - if (!this.__dom) { - dom.innerHTML = this.__genHtml(domName); - this.__dom = dom.querySelector(domName); - } - } + if (!this.__dom) { + dom.innerHTML = this.__genHtml(domName); + this.__dom = dom.querySelector(domName); + } + } this.__defs = this.dom.__defs || Defs.getInstance(this.__uuid); // 没有设置width/height则采用css计算形式 @@ -31983,8 +31990,8 @@ this.__computeMeasure(renderMode, ctx); } // 非首次刷新如果没有更新则无需继续 else if (!this.__checkUpdate(renderMode, ctx, width, height)) { - return; - } // 获取所有字体和大小测量,仅svg需要,canvas直接做 + return; + } // 获取所有字体和大小测量,仅svg需要,canvas直接做 inject.measureText(); @@ -32002,33 +32009,33 @@ } } // svg的特殊diff需要 else if (renderMode === mode.SVG && !this.props.noRender) { - struct.renderSvg(renderMode, defs, this, isFirst); - var nvd = this.virtualDom; - nvd.defs = defs.value; - - if (this.dom.__vd) { - // console.log(this.dom.__vd); - // console.log(nvd); - diff(this.dom, this.dom.__vd, nvd); - } else { - this.dom.innerHTML = util.joinVirtualDom(nvd); - } + struct.renderSvg(renderMode, defs, this, isFirst); + var nvd = this.virtualDom; + nvd.defs = defs.value; + + if (this.dom.__vd) { + // console.log(this.dom.__vd); + // console.log(nvd); + diff(this.dom, this.dom.__vd, nvd); + } else { + this.dom.innerHTML = util.joinVirtualDom(nvd); + } - this.dom.__vd = nvd; - this.dom.__defs = defs; - } else if (renderMode === mode.WEBGL && !this.props.noRender) { - this.__clear(ctx, renderMode); + this.dom.__vd = nvd; + this.dom.__defs = defs; + } else if (renderMode === mode.WEBGL && !this.props.noRender) { + this.__clear(ctx, renderMode); - struct.renderWebgl(renderMode, ctx, this); - } // 特殊cb,供小程序绘制完回调使用 + struct.renderWebgl(renderMode, ctx, this); + } // 特殊cb,供小程序绘制完回调使用 - if (isFunction$7(cb)) { + if (isFunction$1(cb)) { cb(); } this.emit(Event.REFRESH, this.__rlv); - this.__rlv = NONE$3; + this.__rlv = NONE; } }, { key: "destroy", @@ -32088,7 +32095,7 @@ width: w, height: h }, cb); - } else if (isFunction$7(cb)) { + } else if (isFunction$1(cb)) { cb(-1); } } @@ -32117,7 +32124,7 @@ if (clone.length) { clone.forEach(function (item, i) { - if (isObject$2(item) && isFunction$7(item.__before)) { + if (isObject(item) && isFunction$1(item.__before)) { item.__before(diff); } }); @@ -32129,9 +32136,9 @@ } clone.forEach(function (item) { - if (isObject$2(item) && isFunction$7(item.__after)) { + if (isObject(item) && isFunction$1(item.__after)) { item.__after(diff); - } else if (isFunction$7(item)) { + } else if (isFunction$1(item)) { item(diff); } }); @@ -32212,12 +32219,12 @@ } var res = {}; - res[UPDATE_NODE$5] = sr; - res[UPDATE_STYLE$2] = sr.currentStyle; - res[UPDATE_FOCUS$4] = REFLOW$2; - res[UPDATE_MEASURE$2] = true; + res[UPDATE_NODE] = sr; + res[UPDATE_STYLE] = sr.currentStyle; + res[UPDATE_FOCUS] = REFLOW; + res[UPDATE_MEASURE] = true; res[UPDATE_COMPONENT] = cp; - res[UPDATE_CONFIG$5] = sr.__config; + res[UPDATE_CONFIG] = sr.__config; _this4.__addUpdate(sr, sr.__config, _this4, _this4.__config, res); }); @@ -32256,8 +32263,8 @@ children = vd.children, zIndexChildren = vd.zIndexChildren, _vd$computedStyle = vd.computedStyle, - display = _vd$computedStyle[DISPLAY$a], - pointerEvents = _vd$computedStyle[POINTER_EVENTS$2]; + display = _vd$computedStyle[DISPLAY], + pointerEvents = _vd$computedStyle[POINTER_EVENTS]; if (!includeIgnore && display === 'none') { return; @@ -32291,7 +32298,7 @@ return; } - var inThis = geom.pointInQuadrilateral(x, y, __sx1, __sy1, __sx1 + offsetWidth, __sy1, __sx1 + offsetWidth, __sy1 + offsetHeight, __sx1, __sy1 + offsetHeight, matrixEvent); + var inThis = geom$1.pointInQuadrilateral(x, y, __sx1, __sy1, __sx1 + offsetWidth, __sy1, __sx1 + offsetWidth, __sy1 + offsetHeight, __sx1, __sy1 + offsetHeight, matrixEvent); if (inThis) { return { @@ -32319,20 +32326,20 @@ currentStyle = this.currentStyle, computedStyle = this.computedStyle; // canvas/svg作为根节点一定是block或flex,不会是inline - if (['flex', 'block'].indexOf(currentStyle[DISPLAY$a]) === -1) { - computedStyle[DISPLAY$a] = currentStyle[DISPLAY$a] = 'block'; + if (['flex', 'block'].indexOf(currentStyle[DISPLAY]) === -1) { + computedStyle[DISPLAY] = currentStyle[DISPLAY] = 'block'; } // 同理position不能为absolute - if (currentStyle[POSITION$5] === 'absolute') { - computedStyle[POSITION$5] = currentStyle[POSITION$5] = 'static'; + if (currentStyle[POSITION] === 'absolute') { + computedStyle[POSITION] = currentStyle[POSITION] = 'static'; } // 根节点满宽高 - currentStyle[WIDTH$8] = [width, PX$b]; - currentStyle[HEIGHT$8] = [height, PX$b]; - computedStyle[WIDTH$8] = width; - computedStyle[HEIGHT$8] = height; // 可能调用resize()导致变更,要重设,canvas无论离屏与否都可使用直接赋值,svg则按dom属性api + currentStyle[WIDTH] = [width, PX]; + currentStyle[HEIGHT] = [height, PX]; + computedStyle[WIDTH] = width; + computedStyle[HEIGHT] = height; // 可能调用resize()导致变更,要重设,canvas无论离屏与否都可使用直接赋值,svg则按dom属性api if (renderMode === mode.CANVAS || renderMode === mode.WEBGL) { if (dom.width !== width) { @@ -32361,20 +32368,20 @@ updateHash = root.__updateRoot; if (updateHash) { - if (o[UPDATE_FOCUS$4]) { - updateHash[UPDATE_FOCUS$4] |= o[UPDATE_FOCUS$4]; + if (o[UPDATE_FOCUS]) { + updateHash[UPDATE_FOCUS] |= o[UPDATE_FOCUS]; } - if (o[UPDATE_MEASURE$2]) { - updateHash[UPDATE_MEASURE$2] = true; + if (o[UPDATE_MEASURE]) { + updateHash[UPDATE_MEASURE] = true; } // 后续存在新建list上,需增加遍历逻辑 - if (o[UPDATE_STYLE$2]) { + if (o[UPDATE_STYLE]) { var _list$push; var list = updateHash[UPDATE_LIST] = updateHash[UPDATE_LIST] || []; - list.push((_list$push = {}, _defineProperty(_list$push, UPDATE_STYLE$2, o[UPDATE_STYLE$2]), _defineProperty(_list$push, UPDATE_OVERWRITE$1, o[UPDATE_OVERWRITE$1]), _defineProperty(_list$push, UPDATE_KEYS$2, o[UPDATE_KEYS$2]), _list$push)); + list.push((_list$push = {}, _defineProperty(_list$push, UPDATE_STYLE, o[UPDATE_STYLE]), _defineProperty(_list$push, UPDATE_OVERWRITE, o[UPDATE_OVERWRITE]), _defineProperty(_list$push, UPDATE_KEYS, o[UPDATE_KEYS]), _list$push)); } } else { root.__updateRoot = o; @@ -32386,21 +32393,21 @@ } else if (updateHash.hasOwnProperty(nodeConfig[NODE_UNIQUE_UPDATE_ID])) { var target = updateHash[nodeConfig[NODE_UNIQUE_UPDATE_ID]]; - if (o[UPDATE_FOCUS$4]) { - target[UPDATE_FOCUS$4] |= o[UPDATE_FOCUS$4]; + if (o[UPDATE_FOCUS]) { + target[UPDATE_FOCUS] |= o[UPDATE_FOCUS]; } - if (o[UPDATE_MEASURE$2]) { - target[UPDATE_MEASURE$2] = true; + if (o[UPDATE_MEASURE]) { + target[UPDATE_MEASURE] = true; } // 后续存在新建list上,需增加遍历逻辑 - if (o[UPDATE_STYLE$2]) { + if (o[UPDATE_STYLE]) { var _list$push2; var _list = target[UPDATE_LIST] = target[UPDATE_LIST] || []; - _list.push((_list$push2 = {}, _defineProperty(_list$push2, UPDATE_STYLE$2, o[UPDATE_STYLE$2]), _defineProperty(_list$push2, UPDATE_OVERWRITE$1, o[UPDATE_OVERWRITE$1]), _defineProperty(_list$push2, UPDATE_KEYS$2, o[UPDATE_KEYS$2]), _list$push2)); + _list.push((_list$push2 = {}, _defineProperty(_list$push2, UPDATE_STYLE, o[UPDATE_STYLE]), _defineProperty(_list$push2, UPDATE_OVERWRITE, o[UPDATE_OVERWRITE]), _defineProperty(_list$push2, UPDATE_KEYS, o[UPDATE_KEYS]), _list$push2)); } } else { inject.error('Update process miss uniqueUpdateId'); @@ -32466,7 +32473,7 @@ 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 + parent = _node$__config[NODE_DOM_PARENT]; // 在root下的component变更时root会进入,但其没有__uniqueUpdateId if (node !== root) { if (measureHash.hasOwnProperty(__uniqueUpdateId)) { @@ -32479,7 +32486,7 @@ 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,需要向上查找,从顶部向下递归计算继承信息 + var isInherit = node !== root && (updateHash[__uniqueUpdateId][UPDATE_ADD_DOM] || o$2.isMeasureInherit(updateHash[__uniqueUpdateId][UPDATE_STYLE])); // 是inherit,需要向上查找,从顶部向下递归计算继承信息 if (isInherit) { while (parent && parent !== root) { @@ -32490,7 +32497,7 @@ var _isInherit = void 0; if (parent.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) { - var style = updateHash[_uniqueUpdateId][UPDATE_STYLE$2]; + var style = updateHash[_uniqueUpdateId][UPDATE_STYLE]; measureHash[_uniqueUpdateId] = true; var temp = o$2.measureInheritList(style); _isInherit = !!temp.length; @@ -32519,7 +32526,7 @@ }); // 做完清空留待下次刷新重来 for (var _i3 = 0, _len2 = keys.length; _i3 < _len2; _i3++) { - delete updateHash[keys[_i3]][UPDATE_CONFIG$5][NODE_UNIQUE_UPDATE_ID]; + delete updateHash[keys[_i3]][UPDATE_CONFIG][NODE_UNIQUE_UPDATE_ID]; } return hasUpdate; @@ -32574,7 +32581,7 @@ } // 添加时如果是cp则node取sr来布局 - if (addDom && node instanceof Component$1) { + if (addDom && node instanceof Component) { node = node.shadowRoot; } // 每个节点生成唯一的布局识别id存入hash防止重复 @@ -32595,8 +32602,8 @@ break; } // remove的要特殊对待,因为提前删除了父子兄弟关系,下面deepScan不会出现 else if (removeDom) { - uniqueList.push(item); - } + uniqueList.push(item); + } } __uniqueReflowId = 0; @@ -32629,97 +32636,181 @@ * OFFSET节点作为局部根,其递归子节点先执行任何操作,后续根节点再偏移一次 */ else { - this.__deepScan(function (node, options) { - if (node.hasOwnProperty('__uniqueReflowId')) { - var o = reflowHash[node.__uniqueReflowId]; - options.uniqueList.push(o); // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行 + this.__deepScan(function (node, options) { + if (node.hasOwnProperty('__uniqueReflowId')) { + var o = reflowHash[node.__uniqueReflowId]; + options.uniqueList.push(o); // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行 - return true; - } // reflowHash没有记录则无返回继续递归执行 + return true; + } // reflowHash没有记录则无返回继续递归执行 - }, { - uniqueList: uniqueList - }); - /** - * 按顺序执行列表即可,上层LAYOUT先执行且停止递归子节点,上层OFFSET后执行等子节点先LAYOUT/OFFSET - * 同级按先后顺序排列,过程中记录diff在结束后进行structs更新 - * 这里要注意margin合并的逻辑,因为最终都是block(flex等同),需要进行合并 - * 在处理一个block时,先判断是否是空block,同时看后面紧邻的有没有在uniqueList的下一个 - * 单独空block处理、2个相邻的非block处理直接可以进行判断 - * 中间的空block(即非空block的下一个是空block,且下一个不是最后一个),先记录下来list,合并后一并offset - * 合并margin和Dom的逻辑一样,抽离共有方法 - **/ - - - var diffList = []; - var diffI = 0; - var mergeOffsetList = []; - var __uniqueMergeOffsetId = 0; - uniqueList.forEach(function (item) { - var node = item.node, - component = item.component, - addDom = item.addDom, - removeDom = item.removeDom; // 重新layout的w/h数据使用之前parent暂存的,x使用parent,y使用prev或者parent的 - - var cps = node.computedStyle, - cts = node.currentStyle; - var zIndex = cps[Z_INDEX$4], - position = cps[POSITION$5], - display = cps[DISPLAY$a]; - var isLastAbs = position === 'absolute'; - var isNowAbs = cts[POSITION$5] === 'absolute'; - var isLastNone = display === 'none'; - var isNowNone = cts[DISPLAY$a] === 'none'; // none不可见布局无效可以无视 - - if (isLastNone && isNowNone) { - return; + }, { + uniqueList: uniqueList + }); + /** + * 按顺序执行列表即可,上层LAYOUT先执行且停止递归子节点,上层OFFSET后执行等子节点先LAYOUT/OFFSET + * 同级按先后顺序排列,过程中记录diff在结束后进行structs更新 + * 这里要注意margin合并的逻辑,因为最终都是block(flex等同),需要进行合并 + * 在处理一个block时,先判断是否是空block,同时看后面紧邻的有没有在uniqueList的下一个 + * 单独空block处理、2个相邻的非block处理直接可以进行判断 + * 中间的空block(即非空block的下一个是空block,且下一个不是最后一个),先记录下来list,合并后一并offset + * 合并margin和Dom的逻辑一样,抽离共有方法 + **/ + + + var diffList = []; + var diffI = 0; + var mergeOffsetList = []; + var __uniqueMergeOffsetId = 0; + uniqueList.forEach(function (item) { + var node = item.node, + component = item.component, + addDom = item.addDom, + removeDom = item.removeDom; // 重新layout的w/h数据使用之前parent暂存的,x使用parent,y使用prev或者parent的 + + var cps = node.computedStyle, + cts = node.currentStyle; + var zIndex = cps[Z_INDEX], + position = cps[POSITION], + display = cps[DISPLAY]; + var isLastAbs = position === 'absolute'; + var isNowAbs = cts[POSITION] === 'absolute'; + var isLastNone = display === 'none'; + var isNowNone = cts[DISPLAY] === 'none'; // none不可见布局无效可以无视 + + if (isLastNone && isNowNone) { + return; + } + + var parent = node.domParent; + var _parent$__layoutData = parent.__layoutData, + x = _parent$__layoutData.x, + y = _parent$__layoutData.y, + h = _parent$__layoutData.h, + width = parent.width, + computedStyle = parent.computedStyle; + var current = node; // cp的shadowRoot要向上到cp本身,考虑高阶组件在内到真正的顶层cp + + if (current.isShadowRoot) { + current = current.hostRoot; + } // y使用prev或者parent的,首个节点无prev,prev要忽略absolute的和display:none的 + + + var ref = current.prev; + var hasFlowPrev; + + while (ref) { + if (ref instanceof Text || ref.computedStyle[POSITION] !== 'absolute' && ref.computedStyle[DISPLAY] !== 'none') { + y = ref.y + ref.outerHeight; + hasFlowPrev = true; + break; } - var parent = node.domParent; - var _parent$__layoutData = parent.__layoutData, - x = _parent$__layoutData.x, - y = _parent$__layoutData.y, - h = _parent$__layoutData.h, - width = parent.width, - computedStyle = parent.computedStyle; - var current = node; // cp的shadowRoot要向上到cp本身,考虑高阶组件在内到真正的顶层cp + ref = ref.prev; + } // 找不到prev以parent为基准,找到则增加自身,排除remove - if (current.isShadowRoot) { - current = current.hostRoot; - } // y使用prev或者parent的,首个节点无prev,prev要忽略absolute的和display:none的 + if (!removeDom) { + if (!hasFlowPrev) { + y += computedStyle[MARGIN_TOP] + computedStyle[BORDER_TOP_WIDTH] + computedStyle[PADDING_TOP]; + } - var ref = current.prev; - var hasFlowPrev; + x += computedStyle[MARGIN_LEFT] + computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT]; + } // 找到最上层容器,如果是组件的子节点,以sr为container,sr本身往上找 - while (ref) { - if (ref instanceof Text || ref.computedStyle[POSITION$5] !== 'absolute' && ref.computedStyle[DISPLAY$a] !== 'none') { - y = ref.y + ref.outerHeight; - hasFlowPrev = true; - break; - } - ref = ref.prev; - } // 找不到prev以parent为基准,找到则增加自身,排除remove + var container = node; // remove的节点本身无需再次布局 + + if (!removeDom) { + if (isNowAbs) { + container = container.domParent; + + while (container && container !== root) { + if (isRelativeOrAbsolute(container)) { + break; + } // 不能用domParent,必须在组件环境内 - if (!removeDom) { - if (!hasFlowPrev) { - y += computedStyle[MARGIN_TOP$4] + computedStyle[BORDER_TOP_WIDTH$6] + computedStyle[PADDING_TOP$5]; + if (container.parent) { + container = container.parent; + } else if (container.host) { + break; + } } - x += computedStyle[MARGIN_LEFT$6] + computedStyle[BORDER_LEFT_WIDTH$8] + computedStyle[PADDING_LEFT$7]; - } // 找到最上层容器,如果是组件的子节点,以sr为container,sr本身往上找 + if (!container) { + container = root; + } // 由setState引发的要检查是cp自身还是更上层,如果cp被abs包含,那么node是cp的父亲,否则node是cp的sr + // 而这种情况下传cp或node都一样,所以最终统一传node + + + parent.__layoutAbs(container, null, node); // 优先判断dom变更 + + + if (addDom) { + var arr = parent.__modifyStruct(root, diffI); + + diffI += arr[1]; + diffList.push(arr); + + parent.__updateStruct(root.__structs); + + if (_this5.renderMode === mode.SVG) { + cleanSvgCache(parent); + } + + return; + } // 前后都是abs无需偏移后面兄弟和parent调整,component变化节点需更新struct + else if (isLastAbs) { + if (component) { + var _arr = node.__modifyStruct(root, diffI); + + diffI += _arr[1]; + diffList.push(_arr); + + if (position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static') || zIndex !== cts[Z_INDEX]) { + parent.__updateStruct(root.__structs); + + if (_this5.renderMode === mode.SVG) { + cleanSvgCache(parent); + } + } + } else if (isLastNone || isNowNone) { + node.__zIndexChildren = null; + + var _arr2 = node.__modifyStruct(root, diffI); + diffI += _arr2[1]; + diffList.push(_arr2); + } + + return; + } // 标识flow变abs,可能引发zIndex变更,重设struct和svg + + + parent.__updateStruct(root.__structs); + + if (_this5.renderMode === mode.SVG) { + cleanSvgCache(parent); + } + } // 现在是普通流,不管之前是啥直接布局,排除remove删除的 + else { + node.__layout({ + x: x, + y: y, + w: width, + h: h + }); - var container = node; // remove的节点本身无需再次布局 + y += node.outerHeight; - if (!removeDom) { - if (isNowAbs) { + if (component) { + container = node; + } else { container = container.domParent; while (container && container !== root) { - if (isRelativeOrAbsolute$2(container)) { + if (isRelativeOrAbsolute(container)) { break; } // 不能用domParent,必须在组件环境内 @@ -32730,533 +32821,449 @@ break; } } + } - if (!container) { - container = root; - } // 由setState引发的要检查是cp自身还是更上层,如果cp被abs包含,那么node是cp的父亲,否则node是cp的sr - // 而这种情况下传cp或node都一样,所以最终统一传node - - - parent.__layoutAbs(container, null, node); // 优先判断dom变更 - + if (!container) { + container = root; + } // 防止geom - if (addDom) { - var arr = parent.__modifyStruct(root, diffI); - diffI += arr[1]; - diffList.push(arr); + if (node instanceof Dom) { + node.__layoutAbs(container, { + x: x, + y: y, + w: width, + h: h + }); + } + } + } // 向上查找最近的parent是relative,需再次累加ox/oy,无需继续向上递归,因为parent已经递归包含了 + // 这样node重新布局后再次设置其使用parent的偏移 - parent.__updateStruct(root.__structs); - if (_this5.renderMode === mode.SVG) { - cleanSvgCache(parent); - } + var p = node; - return; - } // 前后都是abs无需偏移后面兄弟和parent调整,component变化节点需更新struct - else if (isLastAbs) { - if (component) { - var _arr = node.__modifyStruct(root, diffI); + while (p && p !== root) { + p = p.domParent; + computedStyle = p.computedStyle; - diffI += _arr[1]; - diffList.push(_arr); + if (computedStyle[POSITION] === 'relative') { + var _p = p, + ox = _p.ox, + oy = _p.oy; + ox && node.__offsetX(ox); + oy && node.__offsetY(oy); + break; + } + } // 向下调整next的flow位置,遇到重复LAYOUT的跳出等待其调用并处理其next,忽视掉abs,margin和abs在merge中做 - 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) { - cleanSvgCache(parent); - } - } - } else if (isLastNone || isNowNone) { - node.__zIndexChildren = null; + if (node.isShadowRoot) { + node = node.hostRoot; + } - var _arr2 = node.__modifyStruct(root, diffI); + var next = node.next; - diffI += _arr2[1]; - diffList.push(_arr2); - } + while (next && !next.hasOwnProperty('__uniqueReflowId')) { + if (next.computedStyle[POSITION] === 'absolute') { + next = next.next; + continue; + } - return; - } // 标识flow变abs,可能引发zIndex变更,重设struct和svg + var _next = next, + _oy = _next.y; + var _diff = y - _oy; - parent.__updateStruct(root.__structs); + if (_diff) { + while (next && !next.hasOwnProperty('__uniqueReflowId')) { + var target = next; - if (_this5.renderMode === mode.SVG) { - cleanSvgCache(parent); + if (target instanceof Component) { + target = target.shadowRoot; } - } // 现在是普通流,不管之前是啥直接布局,排除remove删除的 - else { - node.__layout({ - x: x, - y: y, - w: width, - h: h - }); - - y += node.outerHeight; - - if (component) { - container = node; - } else { - container = container.domParent; - - while (container && container !== root) { - if (isRelativeOrAbsolute$2(container)) { - break; - } // 不能用domParent,必须在组件环境内 - - if (container.parent) { - container = container.parent; - } else if (container.host) { - break; - } - } - } + var cs = target.computedStyle; - if (!container) { - container = root; - } // 防止geom - - - if (node instanceof Dom$1) { - node.__layoutAbs(container, { - x: x, - y: y, - w: width, - h: h - }); - } + if (cs[POSITION] !== 'absolute' && cs[DISPLAY] !== 'none') { + target.__offsetY(_diff, true, REPAINT); } - } // 向上查找最近的parent是relative,需再次累加ox/oy,无需继续向上递归,因为parent已经递归包含了 - // 这样node重新布局后再次设置其使用parent的偏移 - - var p = node; - - while (p && p !== root) { - p = p.domParent; - computedStyle = p.computedStyle; - - if (computedStyle[POSITION$5] === 'relative') { - var _p = p, - ox = _p.ox, - oy = _p.oy; - ox && node.__offsetX(ox); - oy && node.__offsetY(oy); - break; + next = next.next; } - } // 向下调整next的flow位置,遇到重复LAYOUT的跳出等待其调用并处理其next,忽视掉abs,margin和abs在merge中做 - - - if (node.isShadowRoot) { - node = node.hostRoot; } - var next = node.next; - - while (next && !next.hasOwnProperty('__uniqueReflowId')) { - if (next.computedStyle[POSITION$5] === 'absolute') { - next = next.next; - continue; - } + break; + } // 去重防止abs并记录parent,整个结束后按先序顺序进行margin合并以及偏移,注意忽略有display:none变block同时为absolute的 - var _next = next, - _oy = _next.y; - var _diff = y - _oy; + if (!parent.hasOwnProperty('__uniqueMergeOffsetId') && !(isNowAbs && isLastNone)) { + parent.__uniqueMergeOffsetId = __uniqueMergeOffsetId++; + mergeOffsetList.push(parent); + } // add和remove都需父节点重新生成struct,zIndexChildren已在对应api操作的before()侦听做了 - if (_diff) { - while (next && !next.hasOwnProperty('__uniqueReflowId')) { - var target = next; - if (target instanceof Component$1) { - target = target.shadowRoot; - } + if (addDom || removeDom) { + var _arr3 = parent.__modifyStruct(root, diffI); - var cs = target.computedStyle; + diffI += _arr3[1]; + diffList.push(_arr3); - if (cs[POSITION$5] !== 'absolute' && cs[DISPLAY$a] !== 'none') { - target.__offsetY(_diff, true, REPAINT$3); - } + if (_this5.renderMode === mode.SVG) { + cleanSvgCache(parent); + } + } // component未知dom变化,所以强制重新struct,text则为其父节点,同时防止zIndex变更影响父节点 + else if (component) { + var _arr4 = node.__modifyStruct(root, diffI); - next = next.next; - } - } + diffI += _arr4[1]; + diffList.push(_arr4); - break; - } // 去重防止abs并记录parent,整个结束后按先序顺序进行margin合并以及偏移,注意忽略有display:none变block同时为absolute的 + if (position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static') || zIndex !== cts[Z_INDEX]) { + node.domParent.__updateStruct(root.__structs); + if (_this5.renderMode === mode.SVG) { + cleanSvgCache(node.domParent); + } + } + } // display有none变化,重置struct和zIndexChildren + else if (isLastNone || isNowNone) { + node.__zIndexChildren = null; - if (!parent.hasOwnProperty('__uniqueMergeOffsetId') && !(isNowAbs && isLastNone)) { - parent.__uniqueMergeOffsetId = __uniqueMergeOffsetId++; - mergeOffsetList.push(parent); - } // add和remove都需父节点重新生成struct,zIndexChildren已在对应api操作的before()侦听做了 + var _arr5 = node.__modifyStruct(root, diffI); + diffI += _arr5[1]; + diffList.push(_arr5); + } + }); + /** + * mergeMargin后续调整,记录的是变更节点的父节点,因此每个节点内部直接遍历孩子进行 + * 由于保持先根遍历的顺序,因此会从最上最里的节点开始,先进行margin合并 + * 由于之前忽略掉abs节点,因此再检查直接abs是否要调整 + * 完成后对此父节点的后续兄弟节点进行调整,多次不会干扰影响 + * 然后继续往上循环,直到root结束 + */ - if (addDom || removeDom) { - var _arr3 = parent.__modifyStruct(root, diffI); + var inDirectAbsList = []; + mergeOffsetList.forEach(function (parent) { + delete parent.__uniqueMergeOffsetId; + var flowChildren = parent.flowChildren, + absChildren = parent.absChildren; + var mergeMarginBottomList = [], + mergeMarginTopList = []; + var length = flowChildren.length, + lastChild; + var isStart, startIndex; // 遍历flow孩子,从开始变化的节点开始,看变化造成的影响,对其后面节点进行偏移,并统计总偏移量 + + for (var _i4 = 0; _i4 < length; _i4++) { + var _item = flowChildren[_i4]; + + if (_item instanceof Component) { + _item = _item.shadowRoot; + } - diffI += _arr3[1]; - diffList.push(_arr3); + var isXom = _item instanceof Xom; // 忽略掉前面没有变更的节点,不能合并 - if (_this5.renderMode === mode.SVG) { - cleanSvgCache(parent); + if (!isStart && isXom) { + if (_item.hasOwnProperty('__uniqueReflowId')) { + isStart = true; + startIndex = _i4; } - } // component未知dom变化,所以强制重新struct,text则为其父节点,同时防止zIndex变更影响父节点 - else if (component) { - var _arr4 = node.__modifyStruct(root, diffI); + } // 开始变更的节点,至少不是第0个 - diffI += _arr4[1]; - diffList.push(_arr4); - if (position !== cts[POSITION$5] && (position === 'static' || cts[POSITION$5] === 'static') || zIndex !== cts[Z_INDEX$4]) { - node.domParent.__updateStruct(root.__structs); + var _cs = isXom && _item.currentStyle; - if (_this5.renderMode === mode.SVG) { - cleanSvgCache(node.domParent); - } - } - } // display有none变化,重置struct和zIndexChildren - else if (isLastNone || isNowNone) { - node.__zIndexChildren = null; + var isInline = isXom && _cs[DISPLAY] === 'inline'; + var isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(_cs[DISPLAY]) > -1; + lastChild = _item; // 每次循环开始前,这次不是block的话,看之前遗留的,可能是以空block结束,需要特殊处理,单独一个空block也包含 - var _arr5 = node.__modifyStruct(root, diffI); + if (!isXom || isInline || isInlineBlock) { + if (mergeMarginBottomList.length && mergeMarginTopList.length && isStart) { + var _diff2 = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); - diffI += _arr5[1]; - diffList.push(_arr5); + if (_diff2) { + for (var j = Math.max(startIndex, _i4 - mergeMarginBottomList.length + 1); j < length; j++) { + flowChildren[j].__offsetY(_diff2, true, REPAINT); + } } - }); - /** - * mergeMargin后续调整,记录的是变更节点的父节点,因此每个节点内部直接遍历孩子进行 - * 由于保持先根遍历的顺序,因此会从最上最里的节点开始,先进行margin合并 - * 由于之前忽略掉abs节点,因此再检查直接abs是否要调整 - * 完成后对此父节点的后续兄弟节点进行调整,多次不会干扰影响 - * 然后继续往上循环,直到root结束 - */ - - var inDirectAbsList = []; - mergeOffsetList.forEach(function (parent) { - delete parent.__uniqueMergeOffsetId; - var flowChildren = parent.flowChildren, - absChildren = parent.absChildren; - var mergeMarginBottomList = [], - mergeMarginTopList = []; - var length = flowChildren.length, - lastChild; - var isStart, startIndex; // 遍历flow孩子,从开始变化的节点开始,看变化造成的影响,对其后面节点进行偏移,并统计总偏移量 - - for (var _i4 = 0; _i4 < length; _i4++) { - var _item = flowChildren[_i4]; - - if (_item instanceof Component$1) { - _item = _item.shadowRoot; } - var isXom = _item instanceof Xom$1; // 忽略掉前面没有变更的节点,不能合并 - - if (!isStart && isXom) { - if (_item.hasOwnProperty('__uniqueReflowId')) { - isStart = true; - startIndex = _i4; - } - } // 开始变更的节点,至少不是第0个 + mergeMarginTopList = []; + mergeMarginBottomList = []; + } // 和普通布局类似,只是不用重新布局只需处理合并margin再根据差值偏移 - var _cs = isXom && _item.currentStyle; + if (isXom && !isInline) { + var isNone = isXom && _cs[DISPLAY] === 'none'; + var isEmptyBlock = void 0; - var isInline = isXom && _cs[DISPLAY$a] === 'inline'; - var isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(_cs[DISPLAY$a]) > -1; - lastChild = _item; // 每次循环开始前,这次不是block的话,看之前遗留的,可能是以空block结束,需要特殊处理,单独一个空block也包含 + if (!isNone && _item.flowChildren && _item.flowChildren.length === 0) { + var _item$computedStyle = _item.computedStyle, + marginTop = _item$computedStyle[MARGIN_TOP], + marginBottom = _item$computedStyle[MARGIN_BOTTOM], + paddingTop = _item$computedStyle[PADDING_TOP], + paddingBottom = _item$computedStyle[PADDING_BOTTOM], + _height = _item$computedStyle[HEIGHT], + borderTopWidth = _item$computedStyle[BORDER_TOP_WIDTH], + borderBottomWidth = _item$computedStyle[BORDER_BOTTOM_WIDTH]; // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理 - if (!isXom || isInline || isInlineBlock) { - if (mergeMarginBottomList.length && mergeMarginTopList.length && isStart) { - var _diff2 = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); - - if (_diff2) { - for (var j = Math.max(startIndex, _i4 - mergeMarginBottomList.length + 1); j < length; j++) { - flowChildren[j].__offsetY(_diff2, true, REPAINT$3); - } - } + if (paddingTop <= 0 && paddingBottom <= 0 && _height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) { + mergeMarginBottomList.push(marginBottom); + mergeMarginTopList.push(marginTop); + isEmptyBlock = true; } + } // 空block要留下轮循环看,除非是最后一个,非空本轮处理掉看是否要合并 - mergeMarginTopList = []; - mergeMarginBottomList = []; - } // 和普通布局类似,只是不用重新布局只需处理合并margin再根据差值偏移 - - - if (isXom && !isInline) { - var isNone = isXom && _cs[DISPLAY$a] === 'none'; - var isEmptyBlock = void 0; - - if (!isNone && _item.flowChildren && _item.flowChildren.length === 0) { - var _item$computedStyle = _item.computedStyle, - marginTop = _item$computedStyle[MARGIN_TOP$4], - marginBottom = _item$computedStyle[MARGIN_BOTTOM$4], - paddingTop = _item$computedStyle[PADDING_TOP$5], - paddingBottom = _item$computedStyle[PADDING_BOTTOM$5], - _height = _item$computedStyle[HEIGHT$8], - borderTopWidth = _item$computedStyle[BORDER_TOP_WIDTH$6], - borderBottomWidth = _item$computedStyle[BORDER_BOTTOM_WIDTH$6]; // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理 - - if (paddingTop <= 0 && paddingBottom <= 0 && _height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) { - mergeMarginBottomList.push(marginBottom); - mergeMarginTopList.push(marginTop); - isEmptyBlock = true; - } - } // 空block要留下轮循环看,除非是最后一个,非空本轮处理掉看是否要合并 + if (!isNone && !isEmptyBlock) { + var _item$computedStyle2 = _item.computedStyle, + _marginTop = _item$computedStyle2[MARGIN_TOP], + _marginBottom = _item$computedStyle2[MARGIN_BOTTOM]; // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top + // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并 - if (!isNone && !isEmptyBlock) { - var _item$computedStyle2 = _item.computedStyle, - _marginTop = _item$computedStyle2[MARGIN_TOP$4], - _marginBottom = _item$computedStyle2[MARGIN_BOTTOM$4]; // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top - // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并 - - if (mergeMarginBottomList.length) { - mergeMarginTopList.push(_marginTop); + if (mergeMarginBottomList.length) { + mergeMarginTopList.push(_marginTop); - if (isStart) { - var _diff3 = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); // 需要合并的情况,根据记录数和索引向上向下遍历节点设置偏移,同时设置总偏移量供父级使用 + if (isStart) { + var _diff3 = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); // 需要合并的情况,根据记录数和索引向上向下遍历节点设置偏移,同时设置总偏移量供父级使用 - if (_diff3) { - for (var _j = Math.max(startIndex, _i4 - mergeMarginBottomList.length + 1); _j < length; _j++) { - flowChildren[_j].__offsetY(_diff3, true, REPAINT$3); - } + if (_diff3) { + for (var _j = Math.max(startIndex, _i4 - mergeMarginBottomList.length + 1); _j < length; _j++) { + flowChildren[_j].__offsetY(_diff3, true, REPAINT); } } - } // 同时自己保存bottom,为后续block准备 + } + } // 同时自己保存bottom,为后续block准备 - mergeMarginTopList = []; - mergeMarginBottomList = [_marginBottom]; - } // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0,最后一个一定有不必判断isStart - else if (_i4 === length - 1) { - var _diff4 = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); + mergeMarginTopList = []; + mergeMarginBottomList = [_marginBottom]; + } // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0,最后一个一定有不必判断isStart + else if (_i4 === length - 1) { + var _diff4 = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList); - if (_diff4) { - for (var _j2 = Math.max(startIndex, _i4 - mergeMarginBottomList.length + 1); _j2 < length; _j2++) { - flowChildren[_j2].__offsetY(_diff4, true, REPAINT$3); - } - } + if (_diff4) { + for (var _j2 = Math.max(startIndex, _i4 - mergeMarginBottomList.length + 1); _j2 < length; _j2++) { + flowChildren[_j2].__offsetY(_diff4, true, REPAINT); } + } } - } // 先检查parent的尺寸是否发生了变化,从而决定是否调整next以及向上递归调整 - + } + } // 先检查parent的尺寸是否发生了变化,从而决定是否调整next以及向上递归调整 - var cs = parent.currentStyle; - var height = cs[HEIGHT$8]; - 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$5]; - var nowH = lastChild.y + lastChild.outerHeight - parent.y; + var cs = parent.currentStyle; + var height = cs[HEIGHT]; + var isContainer = parent === root || parent.isShadowRoot || cs[POSITION] === 'absolute' || cs[POSITION] === 'relative'; - var _diff5 = nowH - oldH; // 调整next以及非固定PX的abs,再递归向上 + if (height[1] === AUTO && lastChild) { + var oldH = parent.height + parent.computedStyle[PADDING_TOP]; + var nowH = lastChild.y + lastChild.outerHeight - parent.y; + var _diff5 = nowH - oldH; // 调整next以及非固定PX的abs,再递归向上 - if (_diff5) { - parent.__resizeY(_diff5, REPAINT$3); - var container; + if (_diff5) { + parent.__resizeY(_diff5, REPAINT); - for (var _i5 = 0, _len3 = absChildren.length; _i5 < _len3; _i5++) { - var _item2 = absChildren[_i5]; - var _item2$currentStyle = _item2.currentStyle, - top = _item2$currentStyle[TOP$4], - bottom = _item2$currentStyle[BOTTOM$4], - _height2 = _item2$currentStyle[HEIGHT$8]; // 是容器,所有的都调整,不是容器,其偏移是上级parent的某一个,根据情况具体不同 + var container; - if (top[1] === AUTO$8) { - if (bottom[1] === AUTO$8) { - var prev = _item2.prev; + for (var _i5 = 0, _len3 = absChildren.length; _i5 < _len3; _i5++) { + var _item2 = absChildren[_i5]; + var _item2$currentStyle = _item2.currentStyle, + top = _item2$currentStyle[TOP], + bottom = _item2$currentStyle[BOTTOM], + _height2 = _item2$currentStyle[HEIGHT]; // 是容器,所有的都调整,不是容器,其偏移是上级parent的某一个,根据情况具体不同 - while (prev) { - var target = prev; + if (top[1] === AUTO) { + if (bottom[1] === AUTO) { + var prev = _item2.prev; - if (target instanceof Component$1) { - target = target.shadowRoot; - } + while (prev) { + var target = prev; - var _isXom = target instanceof Xom$1; + if (target instanceof Component) { + target = target.shadowRoot; + } - var _cs2 = _isXom && target.currentStyle; + var _isXom = target instanceof Xom; - var isAbs = _isXom && _cs2[POSITION$5] === 'absolute'; + var _cs2 = _isXom && target.currentStyle; - if (!isAbs) { - var y = target.y + target.outerHeight; - var d = y - _item2.y; + var isAbs = _isXom && _cs2[POSITION] === 'absolute'; - if (d) { - _item2.__offsetY(d, true, REPAINT$3); - } + if (!isAbs) { + var y = target.y + target.outerHeight; + var d = y - _item2.y; - break; + if (d) { + _item2.__offsetY(d, true, REPAINT); } - prev = prev.prev; + break; } - } else if (bottom[1] === PX$b) { - _item2.__offsetY(_diff5, true, REPAINT$3); - } else if (bottom[1] === PERCENT$c) { - var v = (1 - bottom[0] * 0.01) * _diff5; - _item2.__offsetY(v, true, REPAINT$3); + prev = prev.prev; } - } else if (top[1] === PERCENT$c) { - if (isContainer) { - var _v = top[0] * 0.01 * _diff5; - - _item2.__offsetY(_v, true, REPAINT$3); - } // 非容器的特殊处理 - else { - if (!container) { - container = parent.domParent; - - while (container) { - if (container === root || container.isShadowRoot) { - break; - } + } else if (bottom[1] === PX) { + _item2.__offsetY(_diff5, true, REPAINT); + } else if (bottom[1] === PERCENT) { + var v = (1 - bottom[0] * 0.01) * _diff5; - var _cs3 = container.currentStyle; + _item2.__offsetY(v, true, REPAINT); + } + } else if (top[1] === PERCENT) { + if (isContainer) { + var _v = top[0] * 0.01 * _diff5; - if (_cs3[POSITION$5] === 'absolute' || _cs3[POSITION$5] === 'relative') { - break; - } + _item2.__offsetY(_v, true, REPAINT); + } // 非容器的特殊处理 + else { + if (!container) { + container = parent.domParent; - container = container.domParent; - } + while (container) { + if (container === root || container.isShadowRoot) { + break; } - if (container.currentStyle[HEIGHT$8][1] !== PX$b) { - var _v2 = top[0] * 0.01 * _diff5; + var _cs3 = container.currentStyle; - _item2.__offsetY(_v2, true, REPAINT$3); + if (_cs3[POSITION] === 'absolute' || _cs3[POSITION] === 'relative') { + break; } + + container = container.domParent; } - } // 高度百分比需发生变化的重新布局,需要在容器内 + } + if (container.currentStyle[HEIGHT][1] !== PX) { + var _v2 = top[0] * 0.01 * _diff5; + + _item2.__offsetY(_v2, true, REPAINT); + } + } + } // 高度百分比需发生变化的重新布局,需要在容器内 - if (_height2[1] === PERCENT$c) { - if (isContainer) { - parent.__layoutAbs(parent, null, _item2); - } // 不在容器内说明在上级,存入等结束后统一重新布局 - else { - if (!container) { - container = parent.domParent; - while (container) { - if (container === root || container.isShadowRoot) { - break; - } + if (_height2[1] === PERCENT) { + if (isContainer) { + parent.__layoutAbs(parent, null, _item2); + } // 不在容器内说明在上级,存入等结束后统一重新布局 + else { + if (!container) { + container = parent.domParent; - var _cs4 = container.currentStyle; + while (container) { + if (container === root || container.isShadowRoot) { + break; + } - if (_cs4[POSITION$5] === 'absolute' || _cs4[POSITION$5] === 'relative') { - break; - } + var _cs4 = container.currentStyle; - container = container.domParent; - } + if (_cs4[POSITION] === 'absolute' || _cs4[POSITION] === 'relative') { + break; } - inDirectAbsList.push([parent, container, _item2]); + container = container.domParent; } + } + + inDirectAbsList.push([parent, container, _item2]); } } - - reflow.offsetAndResizeByNodeOnY(parent, root, reflowHash, _diff5, inDirectAbsList); - return; } - } // 没有diff变化或者固定尺寸,可能内部发生变化,调整AUTO的abs,不递归向上 + reflow.offsetAndResizeByNodeOnY(parent, root, reflowHash, _diff5, inDirectAbsList); + return; + } + } // 没有diff变化或者固定尺寸,可能内部发生变化,调整AUTO的abs,不递归向上 - for (var _i6 = 0, _len4 = absChildren.length; _i6 < _len4; _i6++) { - var _item3 = absChildren[_i6]; - var _item3$currentStyle = _item3.currentStyle, - _top = _item3$currentStyle[TOP$4], - _bottom = _item3$currentStyle[BOTTOM$4]; - if (_top[1] === AUTO$8 && _bottom[1] === AUTO$8) { - var _prev = _item3.prev; + for (var _i6 = 0, _len4 = absChildren.length; _i6 < _len4; _i6++) { + var _item3 = absChildren[_i6]; + var _item3$currentStyle = _item3.currentStyle, + _top = _item3$currentStyle[TOP], + _bottom = _item3$currentStyle[BOTTOM]; - while (_prev) { - var _target = _prev; + if (_top[1] === AUTO && _bottom[1] === AUTO) { + var _prev = _item3.prev; - if (_target instanceof Component$1) { - _target = _target.shadowRoot; - } + while (_prev) { + var _target = _prev; - var _isXom2 = _target instanceof Xom$1; + if (_target instanceof Component) { + _target = _target.shadowRoot; + } - var _cs5 = _isXom2 && _target.currentStyle; + var _isXom2 = _target instanceof Xom; - var _isAbs = _isXom2 && _cs5[POSITION$5] === 'absolute'; + var _cs5 = _isXom2 && _target.currentStyle; - if (!_isAbs) { - var _y = _target.y + _target.outerHeight; + var _isAbs = _isXom2 && _cs5[POSITION] === 'absolute'; - var _d = _y - _item3.y; + if (!_isAbs) { + var _y = _target.y + _target.outerHeight; - if (_d) { - _item3.__offsetY(_d, true, REPAINT$3); - } + var _d = _y - _item3.y; - break; + if (_d) { + _item3.__offsetY(_d, true, REPAINT); } - _prev = _prev.prev; + break; } + + _prev = _prev.prev; } } - }); // merge过程中需要重新布局的abs - - inDirectAbsList.forEach(function (arr) { - arr[0].__layoutAbs(arr[1], null, arr[2]); - }); // 调整因reflow造成的原struct数据索引数量偏差,纯zIndex的已经在repaint里面重新生成过了 - // 这里因为和update保持一致的顺序,因此一定是先根顺序且互不包含 - - var diff = 0, - lastIndex = 0, - isFirst = true, - structs = root.__structs; - diffList.forEach(function (item) { - var _item4 = _slicedToArray(item, 2), - ns = _item4[0], - d = _item4[1]; // 第一个有变化的,及后面无论有无变化都需更新 - // 第1个变化区域无需更改前面一段 - - - if (isFirst) { - isFirst = false; - lastIndex = ns[STRUCT_INDEX$2] + (ns[STRUCT_TOTAL$2] || 0) + 1; - diff += d; - } // 第2+个变化区域看是否和前面一个相连,有不变的段则先偏移它,然后再偏移自己 - else { - var j = ns[STRUCT_INDEX$2] + (ns[STRUCT_TOTAL$2] || 0) + 1 + diff; + } + }); // merge过程中需要重新布局的abs + + inDirectAbsList.forEach(function (arr) { + arr[0].__layoutAbs(arr[1], null, arr[2]); + }); // 调整因reflow造成的原struct数据索引数量偏差,纯zIndex的已经在repaint里面重新生成过了 + // 这里因为和update保持一致的顺序,因此一定是先根顺序且互不包含 + + var diff = 0, + lastIndex = 0, + isFirst = true, + structs = root.__structs; + diffList.forEach(function (item) { + var _item4 = _slicedToArray(item, 2), + ns = _item4[0], + d = _item4[1]; // 第一个有变化的,及后面无论有无变化都需更新 + // 第1个变化区域无需更改前面一段 + + + if (isFirst) { + isFirst = false; + lastIndex = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1; + diff += d; + } // 第2+个变化区域看是否和前面一个相连,有不变的段则先偏移它,然后再偏移自己 + else { + var j = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1 + diff; - for (var _i7 = lastIndex; _i7 < j; _i7++) { - structs[_i7][STRUCT_INDEX$2] += diff; - } + for (var _i7 = lastIndex; _i7 < j; _i7++) { + structs[_i7][STRUCT_INDEX] += diff; + } - lastIndex = j; - diff += d; - } - }); // 后面的要根据偏移量校正索引 + lastIndex = j; + diff += d; + } + }); // 后面的要根据偏移量校正索引 - if (diff) { - for (var _i8 = lastIndex, _len5 = structs.length; _i8 < _len5; _i8++) { - structs[_i8][STRUCT_INDEX$2] += diff; - } - } // 清除id + if (diff) { + for (var _i8 = lastIndex, _len5 = structs.length; _i8 < _len5; _i8++) { + structs[_i8][STRUCT_INDEX] += diff; + } + } // 清除id - reflow.clearUniqueReflowId(reflowHash); - } + reflow.clearUniqueReflowId(reflowHash); + } } // 特殊覆盖方法,不需要super()计算自己,因为放在每次checkRoot()做过了 }, { @@ -33350,16 +33357,16 @@ }]); return Root; - }(Dom$1); + }(Dom); - 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; - var isNil$9 = util.isNil; - var REM$b = o.REM, - VW$b = o.VW, - VH$b = o.VH; + var _enums$STYLE_KEY$5 = enums.STYLE_KEY, + STROKE_WIDTH$5 = _enums$STYLE_KEY$5.STROKE_WIDTH, + BOX_SHADOW$5 = _enums$STYLE_KEY$5.BOX_SHADOW, + FONT_SIZE$5 = _enums$STYLE_KEY$5.FONT_SIZE; + var isNil$6 = util.isNil; + var REM$5 = o$4.REM, + VW$5 = o$4.VW, + VH$5 = o$4.VH; function reBuild(target, origin, base, isMulti) { if (isMulti) { @@ -33401,7 +33408,7 @@ return num; } - function limitStartEnd(v) { + function limitStartEnd$1(v) { if (v < 0) { v = 0; } else if (v > 1) { @@ -33417,7 +33424,7 @@ if (start > 0 || end < 1) { if (num === 3) { - var _geom$sliceBezier2Bot = geom.sliceBezier2Both([[x1, y1], controlA, controlB, [x2, y2]], start, end); + var _geom$sliceBezier2Bot = geom$1.sliceBezier2Both([[x1, y1], controlA, controlB, [x2, y2]], start, end); var _geom$sliceBezier2Bot2 = _slicedToArray(_geom$sliceBezier2Bot, 4); @@ -33433,7 +33440,7 @@ x2 = _geom$sliceBezier2Bot4[0]; y2 = _geom$sliceBezier2Bot4[1]; } else if (num === 2) { - var _geom$sliceBezier2Bot5 = geom.sliceBezier2Both([[x1, y1], controlB, [x2, y2]], start, end); + var _geom$sliceBezier2Bot5 = geom$1.sliceBezier2Both([[x1, y1], controlB, [x2, y2]], start, end); var _geom$sliceBezier2Bot6 = _slicedToArray(_geom$sliceBezier2Bot5, 3); @@ -33448,7 +33455,7 @@ x2 = _geom$sliceBezier2Bot8[0]; y2 = _geom$sliceBezier2Bot8[1]; } else if (num === 1) { - var _geom$sliceBezier2Bot9 = geom.sliceBezier2Both([[x1, y1], controlA, [x2, y2]], start, end); + var _geom$sliceBezier2Bot9 = geom$1.sliceBezier2Both([[x1, y1], controlA, [x2, y2]], start, end); var _geom$sliceBezier2Bot10 = _slicedToArray(_geom$sliceBezier2Bot9, 3); @@ -33501,7 +33508,7 @@ _this.__x1 = props.x1.map(function (i) { return parseFloat(i) || 0; }); - } else if (!isNil$9(props.x1)) { + } else if (!isNil$6(props.x1)) { _this.__x1 = [parseFloat(props.x1) || 0]; } @@ -33509,7 +33516,7 @@ _this.__y1 = props.y1.map(function (i) { return parseFloat(i) || 0; }); - } else if (!isNil$9(props.y1)) { + } else if (!isNil$6(props.y1)) { _this.__y1 = [parseFloat(props.y1) || 0]; } @@ -33517,7 +33524,7 @@ _this.__x2 = props.x2.map(function (i) { return parseFloat(i) || 0; }); - } else if (!isNil$9(props.x2)) { + } else if (!isNil$6(props.x2)) { _this.__x2 = [parseFloat(props.x2) || 0]; } @@ -33525,7 +33532,7 @@ _this.__y2 = props.y2.map(function (i) { return parseFloat(i) || 0; }); - } else if (!isNil$9(props.y2)) { + } else if (!isNil$6(props.y2)) { _this.__y2 = [parseFloat(props.y2) || 0]; } @@ -33551,14 +33558,14 @@ if (Array.isArray(props.start)) { _this.__start = props.start.map(function (i) { - return limitStartEnd(parseFloat(i) || 0); + return limitStartEnd$1(parseFloat(i) || 0); }); for (var i = _this.__start.length; i < _this.__x1.length; i++) { _this.__start.push(0); } - } else if (!isNil$9(props.start)) { - var v = limitStartEnd(parseFloat(props.start) || 0); + } else if (!isNil$6(props.start)) { + var v = limitStartEnd$1(parseFloat(props.start) || 0); _this.__start = _this.__x1.map(function () { return v; }); @@ -33572,20 +33579,20 @@ v = 1; } - return limitStartEnd(v); + return limitStartEnd$1(v); }); for (var _i = _this.__end.length; _i < _this.__x1.length; _i++) { _this.__end.push(1); } - } else if (!isNil$9(props.end)) { + } else if (!isNil$6(props.end)) { var _v = parseFloat(props.end); if (isNaN(_v)) { _v = 1; } - _v = limitStartEnd(_v); + _v = limitStartEnd$1(_v); _this.__end = _this.__x1.map(function () { return _v; }); @@ -33596,34 +33603,34 @@ _this.__controlA = []; _this.__controlB = []; - if (!isNil$9(props.x1)) { + if (!isNil$6(props.x1)) { _this.__x1 = parseFloat(props.x1) || 0; } - if (!isNil$9(props.y1)) { + if (!isNil$6(props.y1)) { _this.__y1 = parseFloat(props.y1) || 0; } - if (!isNil$9(props.x2)) { + if (!isNil$6(props.x2)) { _this.__x2 = parseFloat(props.x2) || 0; } - if (!isNil$9(props.y2)) { + if (!isNil$6(props.y2)) { _this.__y2 = parseFloat(props.y2) || 0; } - if (!isNil$9(props.start)) { - _this.__start = limitStartEnd(parseFloat(props.start) || 0); + if (!isNil$6(props.start)) { + _this.__start = limitStartEnd$1(parseFloat(props.start) || 0); } - if (!isNil$9(props.end)) { + if (!isNil$6(props.end)) { var _v2 = parseFloat(props.end); if (isNaN(_v2)) { _v2 = 1; } - _this.__end = limitStartEnd(_v2); + _this.__end = limitStartEnd$1(_v2); } if (Array.isArray(props.controlA)) { @@ -33649,25 +33656,25 @@ isMulti = this.isMulti; var rebuild; ['x1', 'x2'].forEach(function (k) { - if (isNil$9(__cacheProps[k]) || focus) { + if (isNil$6(__cacheProps[k]) || focus) { rebuild = true; __cacheProps[k] = reBuild(_this2[k], originX, width, isMulti); } }); ['y1', 'y2'].forEach(function (k) { - if (isNil$9(__cacheProps[k]) || focus) { + if (isNil$6(__cacheProps[k]) || focus) { rebuild = true; __cacheProps[k] = reBuild(_this2[k], originY, height, isMulti); } }); ['controlA', 'controlB'].forEach(function (k) { - if (isNil$9(__cacheProps[k]) || focus) { + if (isNil$6(__cacheProps[k]) || focus) { rebuild = true; __cacheProps[k] = reBuildC(_this2[k], originX, originY, width, height, isMulti); } }); ['start', 'end'].forEach(function (k) { - if (isNil$9(__cacheProps[k]) || focus) { + if (isNil$6(__cacheProps[k]) || focus) { rebuild = true; __cacheProps[k] = _this2[k]; } @@ -33902,8 +33909,8 @@ originX = this.__sx3, originY = this.__sy3, _this$currentStyle = this.currentStyle, - strokeWidth = _this$currentStyle[STROKE_WIDTH$2], - boxShadow = _this$currentStyle[BOX_SHADOW$4]; + strokeWidth = _this$currentStyle[STROKE_WIDTH$5], + boxShadow = _this$currentStyle[BOX_SHADOW$5]; this.buildCache(originX, originY); var x1 = __cacheProps.x1, y1 = __cacheProps.y1, @@ -33916,11 +33923,11 @@ var half = 0; strokeWidth.forEach(function (item) { - if (item[1] === REM$b) { - half = Math.max(item[0] * root.computedStyle[FONT_SIZE$c] * 0.5, half); - } else if (item[1] === VW$b) { + if (item[1] === REM$5) { + half = Math.max(item[0] * root.computedStyle[FONT_SIZE$5] * 0.5, half); + } else if (item[1] === VW$5) { half = Math.max(item[0] * root.width * 0.01 * 0.5, half); - } else if (item[1] === VH$b) { + } else if (item[1] === VH$5) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); @@ -33952,7 +33959,7 @@ var ca = controlA[i]; var cb = controlB[i]; - if ((isNil$9(ca) || ca.length < 2) && (isNil$9(cb) || cb.length < 2)) { + if ((isNil$6(ca) || ca.length < 2) && (isNil$6(cb) || cb.length < 2)) { bbox[0] = Math.min(bbox[0], xa - ox); bbox[0] = Math.min(bbox[0], xb - ox); bbox[1] = Math.min(bbox[1], ya - oy); @@ -33961,8 +33968,8 @@ bbox[2] = Math.max(bbox[2], xb + ox); bbox[3] = Math.max(bbox[3], ya + oy); bbox[3] = Math.max(bbox[3], yb + oy); - } else if (isNil$9(ca) || ca.length < 2) { - var bezierBox = geom.bboxBezier(xa, ya, cb[0], cb[1], xb, yb); + } else if (isNil$6(ca) || ca.length < 2) { + var bezierBox = geom$1.bboxBezier(xa, ya, cb[0], cb[1], xb, yb); bbox[0] = Math.min(bbox[0], bezierBox[0] - ox); bbox[0] = Math.min(bbox[0], bezierBox[2] - ox); bbox[1] = Math.min(bbox[1], bezierBox[1] - oy); @@ -33971,8 +33978,8 @@ bbox[2] = Math.max(bbox[2], bezierBox[2] + ox); bbox[3] = Math.max(bbox[3], bezierBox[1] + oy); bbox[3] = Math.max(bbox[3], bezierBox[3] + oy); - } else if (isNil$9(cb) || cb.length < 2) { - var _bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], xb, yb); + } else if (isNil$6(cb) || cb.length < 2) { + var _bezierBox = geom$1.bboxBezier(xa, ya, ca[0], ca[1], xb, yb); bbox[0] = Math.min(bbox[0], _bezierBox[0] - ox); bbox[0] = Math.min(bbox[0], _bezierBox[2] - ox); @@ -33983,7 +33990,7 @@ bbox[3] = Math.max(bbox[3], _bezierBox[1] + oy); bbox[3] = Math.max(bbox[3], _bezierBox[3] + oy); } else { - var _bezierBox2 = geom.bboxBezier(xa, ya, ca[0], ca[1], cb[0], cb[1], xb, yb); + var _bezierBox2 = geom$1.bboxBezier(xa, ya, ca[0], ca[1], cb[0], cb[1], xb, yb); bbox[0] = Math.min(bbox[0], _bezierBox2[0] - ox); bbox[0] = Math.min(bbox[0], _bezierBox2[2] - ox); @@ -34000,16 +34007,16 @@ }]); return Line; - }(Geom$1); + }(Geom); - 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; - var isNil$a = util.isNil; - var REM$c = o.REM, - VW$c = o.VW, - VH$c = o.VH; + var _enums$STYLE_KEY$4 = enums.STYLE_KEY, + STROKE_WIDTH$4 = _enums$STYLE_KEY$4.STROKE_WIDTH, + BOX_SHADOW$4 = _enums$STYLE_KEY$4.BOX_SHADOW, + FONT_SIZE$4 = _enums$STYLE_KEY$4.FONT_SIZE; + var isNil$5 = util.isNil; + var REM$4 = o$4.REM, + VW$4 = o$4.VW, + VH$4 = o$4.VH; function concatPointAndControl(point, control) { if (Array.isArray(control) && (control.length === 2 || control.length === 4) && Array.isArray(point) && point.length === 2) { @@ -34019,7 +34026,7 @@ return point; } - function limitStartEnd$1(v) { + function limitStartEnd(v) { if (v < 0) { v = 0; } else if (v > 1) { @@ -34074,14 +34081,14 @@ increase.push(total); prev = _item; } else if (_item.length === 4) { - var _c = geom.bezierLength([prev, [_item[0], _item[1]], [_item[2], _item[3]]], 2); + var _c = geom$1.bezierLength([prev, [_item[0], _item[1]], [_item[2], _item[3]]], 2); res.push(_c); total += _c; increase.push(total); prev = [_item[2], _item[3]]; } else if (_item.length === 6) { - var _c2 = geom.bezierLength([prev, [_item[0], _item[1]], [_item[2], _item[3]], [_item[4], _item[5]]], 3); + var _c2 = geom$1.bezierLength([prev, [_item[0], _item[1]], [_item[2], _item[3]], [_item[4], _item[5]]], 3); res.push(_c2); total += _c2; @@ -34168,10 +34175,10 @@ list[j + 1] = [current[1] - (1 - t) * a, current[1] - (1 - t) * b]; } else if (current.length === 4) { - var res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t); + var res = geom$1.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t); list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]]; } else if (current.length === 6) { - var _res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t); + var _res = geom$1.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t); list[j + 1] = [_res[1][0], _res[1][1], _res[2][0], _res[2][1], _res[3][0], _res[3][1]]; } @@ -34208,12 +34215,12 @@ list[i] = [_prev[0] + _t * _a, _prev[1] + _t * _b]; } else if (_current.length === 4) { - var _res2 = geom.sliceBezier([[_current[2], _current[3]], [_current[0], _current[1]], _prev], 1 - _t).reverse(); + var _res2 = geom$1.sliceBezier([[_current[2], _current[3]], [_current[0], _current[1]], _prev], 1 - _t).reverse(); list[i] = _res2[0]; list[i + 1] = [_res2[1][0], _res2[1][1], _res2[2][0], _res2[2][1]]; } else if (_current.length === 6) { - var _res3 = geom.sliceBezier([[_current[4], _current[5]], [_current[2], _current[3]], [_current[0], _current[1]], _prev], 1 - _t).reverse(); + var _res3 = geom$1.sliceBezier([[_current[4], _current[5]], [_current[2], _current[3]], [_current[0], _current[1]], _prev], 1 - _t).reverse(); list[i] = _res3[0]; list[i + 1] = [_res3[1][0], _res3[1][1], _res3[2][0], _res3[2][1], _current[4], _current[5]]; @@ -34251,14 +34258,14 @@ if (Array.isArray(props.start)) { _this.__start = props.start.map(function (i) { - return limitStartEnd$1(parseFloat(i) || 0); + return limitStartEnd(parseFloat(i) || 0); }); for (var i = _this.__start.length; i < _this.__points.length; i++) { _this.__start.push(0); } - } else if (!isNil$a(props.start)) { - var v = limitStartEnd$1(parseFloat(props.start) || 0); + } else if (!isNil$5(props.start)) { + var v = limitStartEnd(parseFloat(props.start) || 0); _this.__start = _this.__points.map(function () { return v; }); @@ -34272,20 +34279,20 @@ v = 1; } - return limitStartEnd$1(v); + return limitStartEnd(v); }); for (var _i2 = _this.__end.length; _i2 < _this.__points.length; _i2++) { _this.__end.push(1); } - } else if (!isNil$a(props.end)) { + } else if (!isNil$5(props.end)) { var _v = parseFloat(props.end); if (isNaN(_v)) { _v = 1; } - _v = limitStartEnd$1(_v); + _v = limitStartEnd(_v); _this.__end = _this.__points.map(function () { return _v; }); @@ -34297,18 +34304,18 @@ _this.__start = 0; _this.__end = 1; - if (!isNil$a(props.start)) { - _this.__start = limitStartEnd$1(parseFloat(props.start) || 0); + if (!isNil$5(props.start)) { + _this.__start = limitStartEnd(parseFloat(props.start) || 0); } - if (!isNil$a(props.end)) { + if (!isNil$5(props.end)) { var _v2 = parseFloat(props.end); if (isNaN(_v2)) { _v2 = 1; } - _this.__end = limitStartEnd$1(_v2); + _this.__end = limitStartEnd(_v2); } } @@ -34371,7 +34378,7 @@ isMulti = this.isMulti; var rebuild, rebuildSE; - if (isNil$a(__cacheProps.points)) { + if (isNil$5(__cacheProps.points)) { rebuild = true; if (isMulti) { @@ -34385,7 +34392,7 @@ } } - if (isNil$a(__cacheProps.controls)) { + if (isNil$5(__cacheProps.controls)) { rebuild = true; if (isMulti) { @@ -34401,12 +34408,12 @@ } } - if (isNil$a(__cacheProps.start)) { + if (isNil$5(__cacheProps.start)) { rebuildSE = true; __cacheProps.start = start; } - if (isNil$a(__cacheProps.end)) { + if (isNil$5(__cacheProps.end)) { rebuildSE = true; __cacheProps.end = end; } // points/controls有变化就需要重建顶点 @@ -34512,19 +34519,19 @@ originX = this.__sx3, originY = this.__sy3, _this$currentStyle = this.currentStyle, - strokeWidth = _this$currentStyle[STROKE_WIDTH$3], - boxShadow = _this$currentStyle[BOX_SHADOW$5]; + strokeWidth = _this$currentStyle[STROKE_WIDTH$4], + boxShadow = _this$currentStyle[BOX_SHADOW$4]; this.buildCache(originX, originY); var bbox = _get(_getPrototypeOf(Polyline.prototype), "bbox", this); var half = 0; strokeWidth.forEach(function (item) { - if (item[1] === REM$c) { - half = Math.max(item[0] * root.computedStyle[FONT_SIZE$d] * 0.5, half); - } else if (item[1] === VW$c) { + if (item[1] === REM$4) { + half = Math.max(item[0] * root.computedStyle[FONT_SIZE$4] * 0.5, half); + } else if (item[1] === VW$4) { half = Math.max(item[0] * root.width * 0.01 * 0.5, half); - } else if (item[1] === VH$c) { + } else if (item[1] === VH$4) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); @@ -34566,13 +34573,13 @@ var c = controlList[_i4 - 1]; if (c && c.length === 4) { - var bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], c[2], c[3], xb, yb); + var bezierBox = geom$1.bboxBezier(xa, ya, c[0], c[1], c[2], c[3], xb, yb); bbox[0] = Math.min(bbox[0], bezierBox[0] - ox); bbox[1] = Math.min(bbox[1], bezierBox[1] - oy); bbox[2] = Math.max(bbox[2], bezierBox[2] + ox); bbox[3] = Math.max(bbox[3], bezierBox[3] + oy); } else if (c && c.length === 2) { - var _bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], xb, yb); + var _bezierBox = geom$1.bboxBezier(xa, ya, c[0], c[1], xb, yb); bbox[0] = Math.min(bbox[0], _bezierBox[0] - ox); bbox[1] = Math.min(bbox[1], _bezierBox[1] - oy); @@ -34597,7 +34604,7 @@ }]); return Polyline; - }(Geom$1); + }(Geom); var Polygon = /*#__PURE__*/function (_Polyline) { _inherits(Polygon, _Polyline); @@ -34626,17 +34633,17 @@ 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; - var isNil$b = util.isNil; - var sectorPoints$1 = geom.sectorPoints; - var REM$d = o.REM, - VW$d = o.VW, - VH$d = o.VH; - - function getR(v, dft) { + var _enums$STYLE_KEY$3 = enums.STYLE_KEY, + STROKE_WIDTH$3 = _enums$STYLE_KEY$3.STROKE_WIDTH, + BOX_SHADOW$3 = _enums$STYLE_KEY$3.BOX_SHADOW, + FONT_SIZE$3 = _enums$STYLE_KEY$3.FONT_SIZE; + var isNil$4 = util.isNil; + var sectorPoints = geom$1.sectorPoints; + var REM$3 = o$4.REM, + VW$3 = o$4.VW, + VH$3 = o$4.VH; + + function getR$3(v, dft) { v = parseFloat(v); if (isNaN(v)) { @@ -34665,19 +34672,19 @@ if (Array.isArray(props.begin)) { _this.__begin = props.begin.map(function (i) { - return getR(i, 0); + return getR$3(i, 0); }); } if (Array.isArray(props.end)) { _this.__end = props.end.map(function (i) { - return getR(i, 0); + return getR$3(i, 0); }); } if (Array.isArray(props.r)) { _this.__r = props.r.map(function (i) { - return getR(i, 1); + return getR$3(i, 1); }); } @@ -34701,23 +34708,23 @@ _this.__closure = false; - if (!isNil$b(props.begin)) { - _this.__begin = getR(props.begin, 0); + if (!isNil$4(props.begin)) { + _this.__begin = getR$3(props.begin, 0); } - if (!isNil$b(props.end)) { - _this.__end = getR(props.end, 0); + if (!isNil$4(props.end)) { + _this.__end = getR$3(props.end, 0); } - if (!isNil$b(props.r)) { - _this.__r = getR(props.r, 1); + if (!isNil$4(props.r)) { + _this.__r = getR$3(props.r, 1); } - if (!isNil$b(props.edge)) { + if (!isNil$4(props.edge)) { _this.__edge = !!props.edge; } - if (!isNil$b(props.closure)) { + if (!isNil$4(props.closure)) { _this.__closure = !!props.closure; } } @@ -34738,17 +34745,17 @@ isMulti = this.isMulti; var rebuild; - if (isNil$b(__cacheProps.begin) || focus) { + if (isNil$4(__cacheProps.begin) || focus) { rebuild = true; __cacheProps.begin = (begin || 0) % 360; } - if (isNil$b(__cacheProps.end) || focus) { + if (isNil$4(__cacheProps.end) || focus) { rebuild = true; __cacheProps.end = (end || 0) % 360; } - if (isNil$b(__cacheProps.r) || focus) { + if (isNil$4(__cacheProps.r) || focus) { rebuild = true; if (isMulti) { @@ -34762,12 +34769,12 @@ r = __cacheProps.r; - if (isNil$b(__cacheProps.edge) || focus) { + if (isNil$4(__cacheProps.edge) || focus) { rebuild = true; __cacheProps.edge = edge; } - if (isNil$b(__cacheProps.closure) || focus) { + if (isNil$4(__cacheProps.closure) || focus) { rebuild = true; __cacheProps.closure = closure; } @@ -34777,8 +34784,8 @@ __cacheProps.list = []; __cacheProps.sList = []; begin.forEach(function (begin, i) { - var r2 = isNil$b(r[i]) ? width * 0.5 : r[i]; - var list = sectorPoints$1(cx, cy, r2, parseFloat(begin || 0) % 360, parseFloat(end[i] || 0) % 360); + var r2 = isNil$4(r[i]) ? width * 0.5 : r[i]; + var list = sectorPoints(cx, cy, r2, parseFloat(begin || 0) % 360, parseFloat(end[i] || 0) % 360); var sList = list.slice(0); if (closure[i]) { @@ -34802,7 +34809,7 @@ __cacheProps.sList.push(sList); }); } else { - var list = sectorPoints$1(cx, cy, r, parseFloat(begin || 0), parseFloat(end || 0)); + var list = sectorPoints(cx, cy, r, parseFloat(begin || 0), parseFloat(end || 0)); var sList = list.slice(0); if (closure) { @@ -34873,41 +34880,41 @@ this.__renderOneSector(renderMode, ctx, isMulti, list, sList, o); } // 多个需要fill在下面,stroke在上面,依次循环 else { - for (var i = 0, len = fills.length; i < len; i++) { - var fill = fills[i]; - - if (fill) { - var _o = { - fill: fill, - fillRule: fillRules[i], - dx: dx, - dy: dy - }; + for (var i = 0, len = fills.length; i < len; i++) { + var fill = fills[i]; + + if (fill) { + var _o = { + fill: fill, + fillRule: fillRules[i], + dx: dx, + dy: dy + }; - this.__renderOneSector(renderMode, ctx, isMulti, list, sList, _o); - } + this.__renderOneSector(renderMode, ctx, isMulti, list, sList, _o); } + } - for (var _i = 0, _len = strokes.length; _i < _len; _i++) { - var stroke = strokes[_i]; - - if (stroke) { - var _o2 = { - stroke: stroke, - strokeWidth: strokeWidths[_i], - strokeDasharray: strokeDasharrays[_i], - strokeDasharrayStr: strokeDasharrayStrs[_i], - strokeLinecap: strokeLinecaps[_i], - strokeLinejoin: strokeLinejoins[_i], - strokeMiterlimit: strokeMiterlimits[_i], - dx: dx, - dy: dy - }; + for (var _i = 0, _len = strokes.length; _i < _len; _i++) { + var stroke = strokes[_i]; - this.__renderOnePolygon(renderMode, ctx, isMulti, list, sList, _o2); - } + if (stroke) { + var _o2 = { + stroke: stroke, + strokeWidth: strokeWidths[_i], + strokeDasharray: strokeDasharrays[_i], + strokeDasharrayStr: strokeDasharrayStrs[_i], + strokeLinecap: strokeLinecaps[_i], + strokeLinejoin: strokeLinejoins[_i], + strokeMiterlimit: strokeMiterlimits[_i], + dx: dx, + dy: dy + }; + + this.__renderOnePolygon(renderMode, ctx, isMulti, list, sList, _o2); } } + } return res; } @@ -35019,8 +35026,8 @@ width = this.width, height = this.height, _this$currentStyle = this.currentStyle, - strokeWidth = _this$currentStyle[STROKE_WIDTH$4], - boxShadow = _this$currentStyle[BOX_SHADOW$6]; + strokeWidth = _this$currentStyle[STROKE_WIDTH$3], + boxShadow = _this$currentStyle[BOX_SHADOW$3]; var cx = originX + width * 0.5; var cy = originY + height * 0.5; this.buildCache(cx, cy); @@ -35042,11 +35049,11 @@ var half = 0; strokeWidth.forEach(function (item) { - if (item[1] === REM$d) { - half = Math.max(item[0] * root.computedStyle[FONT_SIZE$e] * 0.5, half); - } else if (item[1] === VW$d) { + if (item[1] === REM$3) { + half = Math.max(item[0] * root.computedStyle[FONT_SIZE$3] * 0.5, half); + } else if (item[1] === VW$3) { half = Math.max(item[0] * root.width * 0.01 * 0.5, half); - } else if (item[1] === VH$d) { + } else if (item[1] === VH$3) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); @@ -35077,16 +35084,16 @@ }]); return Sector; - }(Geom$1); + }(Geom); - 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; - var isNil$c = util.isNil; - var REM$e = o.REM, - VW$e = o.VW, - VH$e = o.VH; + var _enums$STYLE_KEY$2 = enums.STYLE_KEY, + STROKE_WIDTH$2 = _enums$STYLE_KEY$2.STROKE_WIDTH, + BOX_SHADOW$2 = _enums$STYLE_KEY$2.BOX_SHADOW, + FONT_SIZE$2 = _enums$STYLE_KEY$2.FONT_SIZE; + var isNil$3 = util.isNil; + var REM$2 = o$4.REM, + VW$2 = o$4.VW, + VH$2 = o$4.VH; function genVertex(x, y, width, height) { var rx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; @@ -35096,12 +35103,12 @@ return [[x, y], [x + width, y], [x + width, y + height], [x, y + height], [x, y]]; } - var ox = rx * geom.H; - var oy = ry * geom.H; + var ox = rx * geom$1.H; + var oy = ry * geom$1.H; return [[x + rx, y], [x + width - rx, y], [x + width + ox - rx, y, x + width, y + ry - oy, x + width, y + ry], [x + width, y + height - ry], [x + width, y + height + oy - ry, x + width + ox - rx, y + height, x + width - rx, y + height], [x + rx, y + height], [x + rx - ox, y + height, x, y + height + oy - ry, x, y + height - ry], [x, y + ry], [x, y + ry - oy, x + rx - ox, y, x + rx, y]]; } - function getR$1(v) { + function getR$2(v) { v = parseFloat(v); if (isNaN(v)) { @@ -35129,24 +35136,24 @@ if (Array.isArray(props.rx)) { _this.__rx = props.rx.map(function (i) { - return getR$1(i); + return getR$2(i); }); } if (Array.isArray(props.ry)) { _this.__ry = props.ry.map(function (i) { - return getR$1(i); + return getR$2(i); }); } } else { _this.__rx = _this.__ry = 0; - if (!isNil$c(props.rx)) { - _this.__rx = getR$1(props.rx); + if (!isNil$3(props.rx)) { + _this.__rx = getR$2(props.rx); } - if (!isNil$c(props.ry)) { - _this.__ry = getR$1(props.ry); + if (!isNil$3(props.ry)) { + _this.__ry = getR$2(props.ry); } } @@ -35164,7 +35171,7 @@ isMulti = this.isMulti; var rebuild; - if (isNil$c(__cacheProps.rx) || focus) { + if (isNil$3(__cacheProps.rx) || focus) { rebuild = true; if (isMulti) { @@ -35176,7 +35183,7 @@ } } - if (isNil$c(__cacheProps.ry) || focus) { + if (isNil$3(__cacheProps.ry) || focus) { rebuild = true; if (isMulti) { @@ -35239,19 +35246,19 @@ width = this.width, height = this.height, _this$currentStyle = this.currentStyle, - strokeWidth = _this$currentStyle[STROKE_WIDTH$5], - boxShadow = _this$currentStyle[BOX_SHADOW$7]; + strokeWidth = _this$currentStyle[STROKE_WIDTH$2], + boxShadow = _this$currentStyle[BOX_SHADOW$2]; this.buildCache(originX, originY); var bbox = _get(_getPrototypeOf(Rect.prototype), "bbox", this); var half = 0; strokeWidth.forEach(function (item) { - if (item[1] === REM$e) { - half = Math.max(item[0] * root.computedStyle[FONT_SIZE$f] * 0.5, half); - } else if (item[1] === VW$e) { + if (item[1] === REM$2) { + half = Math.max(item[0] * root.computedStyle[FONT_SIZE$2] * 0.5, half); + } else if (item[1] === VW$2) { half = Math.max(item[0] * root.width * 0.01 * 0.5, half); - } else if (item[1] === VH$e) { + } else if (item[1] === VH$2) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); @@ -35278,18 +35285,18 @@ }]); return Rect; - }(Geom$1); + }(Geom); - 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; - var isNil$d = util.isNil; - var REM$f = o.REM, - VW$f = o.VW, - VH$f = o.VH; + var _enums$STYLE_KEY$1 = enums.STYLE_KEY, + STROKE_WIDTH$1 = _enums$STYLE_KEY$1.STROKE_WIDTH, + BOX_SHADOW$1 = _enums$STYLE_KEY$1.BOX_SHADOW, + FONT_SIZE$1 = _enums$STYLE_KEY$1.FONT_SIZE; + var isNil$2 = util.isNil; + var REM$1 = o$4.REM, + VW$1 = o$4.VW, + VH$1 = o$4.VH; - function getR$2(v) { + function getR$1(v) { v = parseFloat(v); if (isNaN(v)) { @@ -35316,16 +35323,16 @@ if (Array.isArray(props.r)) { _this.__r = props.r.map(function (i) { - return getR$2(i); + return getR$1(i); }); - } else if (!isNil$d(props.r)) { - _this.__r = getR$2(props.r); + } else if (!isNil$2(props.r)) { + _this.__r = getR$1(props.r); } } else { _this.__r = 1; - if (!isNil$d(props.r)) { - _this.__r = getR$2(props.r); + if (!isNil$2(props.r)) { + _this.__r = getR$1(props.r); } } @@ -35340,17 +35347,17 @@ __cacheProps = this.__cacheProps, isMulti = this.isMulti; - if (isNil$d(__cacheProps.r) || focus) { + if (isNil$2(__cacheProps.r) || focus) { if (isMulti) { __cacheProps.r = r.map(function (i) { return i * width * 0.5; }); __cacheProps.list = __cacheProps.r.map(function (r) { - return geom.ellipsePoints(cx, cy, r); + return geom$1.ellipsePoints(cx, cy, r); }); } else { __cacheProps.r = r * width * 0.5; - __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r); + __cacheProps.list = geom$1.ellipsePoints(cx, cy, __cacheProps.r); } } } @@ -35387,8 +35394,8 @@ width = this.width, height = this.height, _this$currentStyle = this.currentStyle, - strokeWidth = _this$currentStyle[STROKE_WIDTH$6], - boxShadow = _this$currentStyle[BOX_SHADOW$8]; + strokeWidth = _this$currentStyle[STROKE_WIDTH$1], + boxShadow = _this$currentStyle[BOX_SHADOW$1]; var cx = originX + width * 0.5; var cy = originY + height * 0.5; this.buildCache(cx, cy); @@ -35410,11 +35417,11 @@ var half = 0; strokeWidth.forEach(function (item) { - if (item[1] === REM$f) { - half = Math.max(item[0] * root.computedStyle[FONT_SIZE$g] * 0.5, half); - } else if (item[1] === VW$f) { + if (item[1] === REM$1) { + half = Math.max(item[0] * root.computedStyle[FONT_SIZE$1] * 0.5, half); + } else if (item[1] === VW$1) { half = Math.max(item[0] * root.width * 0.01 * 0.5, half); - } else if (item[1] === VH$f) { + } else if (item[1] === VH$1) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); @@ -35445,18 +35452,18 @@ }]); return Circle; - }(Geom$1); + }(Geom); - 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; - var isNil$e = util.isNil; - var REM$g = o.REM, - VW$g = o.VW, - VH$g = o.VH; - - function getR$3(v) { + var _enums$STYLE_KEY = enums.STYLE_KEY, + STROKE_WIDTH = _enums$STYLE_KEY.STROKE_WIDTH, + BOX_SHADOW = _enums$STYLE_KEY.BOX_SHADOW, + FONT_SIZE = _enums$STYLE_KEY.FONT_SIZE; + var isNil$1 = util.isNil; + var REM = o$4.REM, + VW = o$4.VW, + VH = o$4.VH; + + function getR(v) { v = parseFloat(v); if (isNaN(v)) { @@ -35484,30 +35491,30 @@ if (Array.isArray(props.rx)) { _this.__rx = props.rx.map(function (i) { - return getR$3(i); + return getR(i); }); - } else if (!isNil$e(props.rx)) { - _this.__rx = [getR$3(props.rx)]; + } else if (!isNil$1(props.rx)) { + _this.__rx = [getR(props.rx)]; } if (Array.isArray(props.ry)) { _this.__ry = props.ry.map(function (i) { - return getR$3(i); + return getR(i); }); - } else if (!isNil$e(props.ry)) { - _this.__ry = [getR$3(props.ry)]; + } else if (!isNil$1(props.ry)) { + _this.__ry = [getR(props.ry)]; } } else { _this.__rx = 1; - if (!isNil$e(props.rx)) { - _this.__rx = getR$3(props.rx); + if (!isNil$1(props.rx)) { + _this.__rx = getR(props.rx); } _this.__ry = 1; - if (!isNil$e(props.ry)) { - _this.__ry = getR$3(props.ry); + if (!isNil$1(props.ry)) { + _this.__ry = getR(props.ry); } } @@ -35525,7 +35532,7 @@ isMulti = this.isMulti; var rebuild; - if (isNil$e(__cacheProps.rx) || focus) { + if (isNil$1(__cacheProps.rx) || focus) { rebuild = true; if (isMulti) { @@ -35537,7 +35544,7 @@ } } - if (isNil$e(__cacheProps.ry) || focus) { + if (isNil$1(__cacheProps.ry) || focus) { rebuild = true; if (isMulti) { @@ -35555,10 +35562,10 @@ if (isMulti) { __cacheProps.list = _rx.map(function (rx, i) { - return geom.ellipsePoints(cx, cy, rx, _ry[i]); + return geom$1.ellipsePoints(cx, cy, rx, _ry[i]); }); } else { - __cacheProps.list = geom.ellipsePoints(cx, cy, _rx, _ry); + __cacheProps.list = geom$1.ellipsePoints(cx, cy, _rx, _ry); } } @@ -35602,8 +35609,8 @@ width = this.width, height = this.height, _this$currentStyle = this.currentStyle, - strokeWidth = _this$currentStyle[STROKE_WIDTH$7], - boxShadow = _this$currentStyle[BOX_SHADOW$9]; + strokeWidth = _this$currentStyle[STROKE_WIDTH], + boxShadow = _this$currentStyle[BOX_SHADOW]; var cx = originX + width * 0.5; var cy = originY + height * 0.5; this.buildCache(cx, cy); @@ -35630,11 +35637,11 @@ var half = 0; strokeWidth.forEach(function (item) { - if (item[1] === REM$g) { - half = Math.max(item[0] * root.computedStyle[FONT_SIZE$h] * 0.5, half); - } else if (item[1] === VW$g) { + if (item[1] === REM) { + half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half); + } else if (item[1] === VW) { half = Math.max(item[0] * root.width * 0.01 * 0.5, half); - } else if (item[1] === VH$g) { + } else if (item[1] === VH) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); @@ -35665,7 +35672,7 @@ }]); return Ellipse; - }(Geom$1); + }(Geom); var fullCssProperty = { skewX: 'kx', @@ -35683,7 +35690,7 @@ perspective: 'ppt', rotate3d: 'r3' }; - var abbrCssProperty = { + var abbrCssProperty$1 = { os: 'offset', // 非css属性不会被下面反向遍历插入,手动 e: 'easing' @@ -35692,7 +35699,7 @@ value: 'v', options: 'o' }; - var abbrAnimate = {}; + var abbrAnimate$1 = {}; var fullAnimateOption = { duration: 'dt', delay: 'd', @@ -35704,43 +35711,43 @@ playbackRate: 'p', spfLimit: 'sl' }; - var abbrAnimateOption = {}; + var abbrAnimateOption$1 = {}; reset.DOM_KEY_SET.concat(reset.GEOM_KEY_SET).forEach(function (k) { if (fullCssProperty.hasOwnProperty(k)) { - abbrCssProperty[fullCssProperty[k]] = k; + abbrCssProperty$1[fullCssProperty[k]] = k; return; } var v = k.charAt(0) + k.replace(/[a-z]/g, '').toLowerCase(); fullCssProperty[k] = v; - abbrCssProperty[v] = k; + abbrCssProperty$1[v] = k; }); Object.keys(fullAnimate).forEach(function (k) { - abbrAnimate[fullAnimate[k]] = k; + abbrAnimate$1[fullAnimate[k]] = k; }); Object.keys(fullAnimateOption).forEach(function (k) { - abbrAnimateOption[fullAnimateOption[k]] = k; + abbrAnimateOption$1[fullAnimateOption[k]] = k; }); - var abbr$1 = { + var abbr = { fullCssProperty: fullCssProperty, - abbrCssProperty: abbrCssProperty, + abbrCssProperty: abbrCssProperty$1, fullAnimate: fullAnimate, - abbrAnimate: abbrAnimate, + abbrAnimate: abbrAnimate$1, fullAnimateOption: fullAnimateOption, - abbrAnimateOption: abbrAnimateOption + abbrAnimateOption: abbrAnimateOption$1 }; - var TYPE_VD$4 = $$type.TYPE_VD, - TYPE_GM$4 = $$type.TYPE_GM, - TYPE_CP$4 = $$type.TYPE_CP; - var isNil$f = util.isNil, - isFunction$8 = util.isFunction, + var TYPE_VD = $$type.TYPE_VD, + TYPE_GM = $$type.TYPE_GM, + TYPE_CP = $$type.TYPE_CP; + var isNil = util.isNil, + isFunction = util.isFunction, isPrimitive = util.isPrimitive, - clone$4 = util.clone, - extend$2 = util.extend; - var abbrCssProperty$1 = abbr$1.abbrCssProperty, - abbrAnimateOption$1 = abbr$1.abbrAnimateOption, - abbrAnimate$1 = abbr$1.abbrAnimate; + clone = util.clone, + extend = util.extend; + var abbrCssProperty = abbr.abbrCssProperty, + abbrAnimateOption = abbr.abbrAnimateOption, + abbrAnimate = abbr.abbrAnimate; /** * 还原缩写到全称,涉及样式和动画属性 * @param target 还原的对象 @@ -35761,11 +35768,11 @@ } } // 普通样式缩写还原 else if (hash.hasOwnProperty(k)) { - var _fk = hash[k]; - target[_fk] = target[k]; // 删除以免二次解析 + var _fk = hash[k]; + target[_fk] = target[k]; // 删除以免二次解析 - delete target[k]; - } + delete target[k]; + } }); } } @@ -35806,7 +35813,7 @@ } // 支持函数模式和值模式 - if (isFunction$8(v)) { + if (isFunction(v)) { v = v(target(k)); } @@ -35861,7 +35868,7 @@ } // 支持函数模式和值模式 - if (isFunction$8(value)) { + if (isFunction(value)) { value = value(v); } @@ -35905,7 +35912,7 @@ if (i === len - 1) { var v = vars[id]; // 支持函数模式和值模式 - if (isFunction$8(v)) { + if (isFunction(v)) { v = v(target(k)); } @@ -35918,8 +35925,8 @@ }, v); } // 替换library中子对象的一个属性直接赋值 else { - target[k] = v; - } + target[k] = v; + } } else { target = target[k]; } @@ -35934,38 +35941,38 @@ } } // 兼容老版var- else { - Object.keys(json).forEach(function (k) { - if (k.indexOf('var-library.') === 0) { - var v = json[k]; // 直接移除library插槽,防止下面调用replaceVars(json, vars)时报错 + Object.keys(json).forEach(function (k) { + if (k.indexOf('var-library.') === 0) { + var v = json[k]; // 直接移除library插槽,防止下面调用replaceVars(json, vars)时报错 - delete json[k]; + delete json[k]; - if (!v) { - return; - } + if (!v) { + return; + } - var k2 = k.slice(12); // 有id且变量里面传入了替换的值 + var k2 = k.slice(12); // 有id且变量里面传入了替换的值 - if (k2 && v.id && vars.hasOwnProperty(v.id)) { - var value = vars[v.id]; + if (k2 && v.id && vars.hasOwnProperty(v.id)) { + var value = vars[v.id]; - if (isFunction$8(value)) { - value = value(v); - } // 替换图层的值必须是一个有tagName的对象 + if (isFunction(value)) { + value = value(v); + } // 替换图层的值必须是一个有tagName的对象 - if (!value || !value.tagName) { - return; - } // library对象也要加上id,与正常的library保持一致 + if (!value || !value.tagName) { + return; + } // library对象也要加上id,与正常的library保持一致 - hash[k2] = Object.assign({ - id: k2 - }, value); - } + hash[k2] = Object.assign({ + id: k2 + }, value); } - }); - } + } + }); + } } } /** @@ -35981,7 +35988,7 @@ function linkLibrary(item, hash) { var id = item.id; // library中一定有id,因为是一级,二级+特殊需求才会出现放开 - if (isNil$f(id)) { + if (isNil(id)) { throw new Error('Library item miss id: ' + JSON.stringify(item)); } else { hash[id] = item; @@ -36000,7 +36007,7 @@ function linkChild(child, libraryItem) { // 规定图层child只有init和动画,属性和子图层来自库 child.tagName = libraryItem.tagName; - child.props = clone$4(libraryItem.props); + child.props = clone(libraryItem.props); child.children = libraryItem.children; child.library = libraryItem.library; // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况 @@ -36017,10 +36024,10 @@ if (init) { var props = child.props = child.props || {}; var style = props.style; - extend$2(props, init); // style特殊处理,防止被上面覆盖丢失原始值 + extend(props, init); // style特殊处理,防止被上面覆盖丢失原始值 if (style) { - extend$2(style, init.style); + extend(style, init.style); props.style = style; } // 删除以免二次解析 @@ -36032,7 +36039,7 @@ function parse(karas, json, animateRecords, opt) { var hash = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; - if (isPrimitive(json) || json instanceof Node || json instanceof Component$1) { + if (isPrimitive(json) || json instanceof Node || json instanceof Component) { return json; } @@ -36045,7 +36052,7 @@ var libraryId = json.libraryId; - if (!isNil$f(libraryId)) { + if (!isNil(libraryId)) { var libraryItem = hash[libraryId]; // 规定图层child只有init和动画,tagName和属性和子图层来自库 if (libraryItem) { @@ -36083,7 +36090,7 @@ } var style = props.style; - opt.abbr !== false && abbr2full(style, abbrCssProperty$1); // 先替换style的 + opt.abbr !== false && abbr2full(style, abbrCssProperty); // 先替换style的 replaceVars(style, opt.vars); // 再替换静态属性,style也作为属性的一种,目前尚未被设计为被替换 @@ -36095,9 +36102,9 @@ if (tagName.charAt(0) === '$') { vd = karas.createGm(tagName, props); } else if (/^[A-Z]/.test(tagName)) { - var cp = Component$1.getRegister(tagName); + var cp = Component.getRegister(tagName); vd = karas.createCp(cp, props, children.map(function (item) { - if (item && [TYPE_VD$4, TYPE_GM$4, TYPE_CP$4].indexOf(item.$$type) > -1) { + if (item && [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(item.$$type) > -1) { return item; } @@ -36105,7 +36112,7 @@ })); } else { vd = karas.createVd(tagName, props, children.map(function (item) { - if (item && [TYPE_VD$4, TYPE_GM$4, TYPE_CP$4].indexOf(item.$$type) > -1) { + if (item && [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(item.$$type) > -1) { return item; } @@ -36119,20 +36126,20 @@ if (Array.isArray(animate)) { var has; animate.forEach(function (item) { - opt.abbr !== false && abbr2full(item, abbrAnimate$1); + opt.abbr !== false && abbr2full(item, abbrAnimate); var value = item.value, options = item.options; // 忽略空动画 if (Array.isArray(value) && value.length) { has = true; value.forEach(function (item) { - opt.abbr !== false && abbr2full(item, abbrCssProperty$1); + opt.abbr !== false && abbr2full(item, abbrCssProperty); replaceVars(item, opt.vars); }); } if (options) { - opt.abbr !== false && abbr2full(options, abbrAnimateOption$1); + opt.abbr !== false && abbr2full(options, abbrAnimateOption); replaceVars(options, opt.vars); } }); @@ -36144,13 +36151,13 @@ }; } } else { - opt.abbr !== false && abbr2full(animate, abbrAnimate$1); + opt.abbr !== false && abbr2full(animate, abbrAnimate); var value = animate.value, options = animate.options; if (Array.isArray(value) && value.length) { value.forEach(function (item) { - opt.abbr !== false && abbr2full(item, abbrCssProperty$1); + opt.abbr !== false && abbr2full(item, abbrCssProperty); replaceVars(item, opt.vars); }); animationRecord = { @@ -36160,7 +36167,7 @@ } if (options) { - opt.abbr !== false && abbr2full(options, abbrAnimateOption$1); + opt.abbr !== false && abbr2full(options, abbrAnimateOption); replaceVars(options, opt.vars); } } @@ -36174,7 +36181,7 @@ return vd; } - var o$4 = { + var o = { parse: function parse$1(karas, json, dom) { var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; json = util.clone(json); // 根节点的fonts字段定义字体信息 @@ -36191,7 +36198,7 @@ data = item.data; if (fontFamily && data) { - o$1.register(fontFamily, data); + o$3.register(fontFamily, data); } }); } // json中定义无abbr @@ -36240,19 +36247,19 @@ ac.__playAuto(); } // 不自动播放进入记录列表,初始化并等待手动调用 else { - ac.__records2 = ac.__records2.concat(animateRecords); - ac.init(ac.__records2, ac.list2); - } + ac.__records2 = ac.__records2.concat(animateRecords); + ac.init(ac.__records2, ac.list2); + } } // 递归的parse,如果有动画,此时还没root,先暂存下来,等上面的root的render第一次布局时收集 else { - if (animateRecords.length) { - vd.__animateRecords = { - options: options, - list: animateRecords, - controller: options.controller instanceof Controller ? options.controller : null - }; - } + if (animateRecords.length) { + vd.__animateRecords = { + options: options, + list: animateRecords, + controller: options.controller instanceof Controller ? options.controller : null + }; } + } return vd; }, @@ -36322,7 +36329,7 @@ var cb = function cb() { if (count === a + b + c) { - var res = o$4.parse(karas, json, dom, options); + var res = o.parse(karas, json, dom, options); if (options && util.isFunction(options.callback)) { options.callback(res); @@ -36353,7 +36360,7 @@ cb(); }); } else { - var res = o$4.parse(karas, json, dom, options); + var res = o.parse(karas, json, dom, options); if (options && util.isFunction(options.callback)) { options.callback(res); @@ -36362,15 +36369,15 @@ return res; } }, - abbr: abbr$1 + abbr: abbr }; var style = { css: css, reset: reset, - unit: o, - font: o$1, - abbr: abbr + unit: o$4, + font: o$3, + abbr: abbr$1 }; var animate = { @@ -36381,21 +36388,21 @@ }; var refresh = { - level: o$3, + level: o$1, change: o$2, Page: Page, Cache: Cache }; - var version = "0.63.6"; + var version = "0.63.7"; - Geom$1.register('$line', Line); - Geom$1.register('$polyline', Polyline); - Geom$1.register('$polygon', Polygon); - Geom$1.register('$sector', Sector); - Geom$1.register('$rect', Rect); - Geom$1.register('$circle', Circle); - Geom$1.register('$ellipse', Ellipse); + Geom.register('$line', Line); + Geom.register('$polyline', Polyline); + Geom.register('$polygon', Polygon); + Geom.register('$sector', Sector); + Geom.register('$rect', Rect); + Geom.register('$circle', Circle); + Geom.register('$ellipse', Ellipse); var karas$1 = { version: version, render: function render(root, dom) { @@ -36462,25 +36469,25 @@ }; }, parse: function parse(json, dom, options) { - return o$4.parse(this, json, dom, options); + return o.parse(this, json, dom, options); }, loadAndParse: function loadAndParse(json, dom, options) { - return o$4.loadAndParse(this, json, dom, options); + return o.loadAndParse(this, json, dom, options); }, mode: mode, - Component: Component$1, + Component: Component, Node: Node, Text: Text, - Geom: Geom$1, - Xom: Xom$1, - Dom: Dom$1, - Img: Img$1, + Geom: Geom, + Xom: Xom, + Dom: Dom, + Img: Img, Root: Root, Event: Event, util: util, inject: inject, style: style, - parser: o$4, + parser: o, animate: animate, math: math, builder: builder, @@ -36494,11 +36501,11 @@ }; builder.ref({ - Xom: Xom$1, - Dom: Dom$1, - Img: Img$1, - Geom: Geom$1, - Component: Component$1 + Xom: Xom, + Dom: Dom, + Img: Img, + Geom: Geom, + Component: Component }); if (typeof window !== 'undefined') { @@ -36509,5 +36516,5 @@ return karas$1; -}))); +})); //# sourceMappingURL=index.js.map diff --git a/index.js.map b/index.js.map index 74bf39a70..c3a5e789f 100644 --- a/index.js.map +++ b/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["src/util/enums.js","src/node/Node.js","src/node/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/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/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};\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\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};\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.__width = 0;\n this.__height = 0;\n this.__baseLine = 0;\n this.__config = {};\n // 默认undefined\n // this.__prev = undefined;\n // this.__next = undefined;\n // this.__parent = undefined;\n // this.__domParent = undefined;\n // this.__root = undefined;\n // this.__host = undefined;\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\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 /**\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 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 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 = 67, 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;\n\nexport default o;\n","export default {\n position: /(([-+]?[\\d.]+[pxremvwh%]*)|(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];\n let a1 = a[i + 4];\n let a2 = a[i + 8];\n let a3 = a[i + 12];\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) {\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 = 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 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 = 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 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') {\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 '../node/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 } = 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(['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 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 = { _: 1 };\nconst TYPE_GM = { _: 2 };\nconst TYPE_CP = { _: 3 };\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 s += joinDef(item);\n });\n s += '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\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 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 += '';\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 += '>';\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(/`;\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(location.hostname !== host[1]) {\n img.crossOrigin = 'anonymous';\n }\n }\n }\n img.src = url;\n if(debug.flag) {\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') {\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(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.loadFont(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 font invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\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 let f = new FontFace(url, `url(${url})`);\n f.load().then(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 }).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 '../node/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, 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 {\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 {\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 {\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, d = 0;\n // 扩展的from to ratio格式,圆心、长轴坐标、短轴缩放比\n if(Array.isArray(size)) {\n cx = x1 + size[0] * iw;\n cy = y1 + size[1] * ih;\n if(size[4] <= 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[4];\n r = Math.max(xl, yl);\n // 看旋转\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 else {\n // 默认椭圆a是水平轴,b是垂直轴\n [cx, cy] = calCircleCentre(position, x1, y1, iw, ih, root);\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, 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.]+))?/.exec(gradient[2]);\n if(points) {\n o.z = [parseFloat(points[1]), parseFloat(points[2]), parseFloat(points[3]), parseFloat(points[4])];\n if(!isNil(points[5])) {\n o.z.push(parseFloat(points[5]));\n }\n else {\n o.z.push(1);\n }\n }\n else {\n o.z = 'farthest-corner';\n }\n }\n let position = /at\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?: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.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?: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.]+[pxremvwh%]+)?\\s*((#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))\\s*([-+]?[\\d.]+[pxremvwh%]+)?/ig) || [];\n o.v = v.map(item => {\n let color = /((?:#[0-9a-f]{3,8})|(?:rgba?\\s*\\(.+?\\)))/i.exec(item);\n let arr = [rgba2int(color[1])];\n let percent = /[-+]?[\\d.]+[pxremvwh%]+/.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) {\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, 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 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: '#000',\n borderRightColor: '#000',\n borderBottomColor: '#000',\n borderLeftColor: '#000',\n borderTopStyle: 'solid',\n borderRightStyle: 'solid',\n borderBottomStyle: 'solid',\n borderLeftStyle: 'solid',\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.]+[pxremvwh%]*)|(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.]+[pxremvwh%]*\\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)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]);\n }\n else if(/^[\\d.]+\\s+[\\d.]+\\s+[\\d.]+[pxremvwh%]*/.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.]+[pxremvwh%]+/.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.]+[pxremvwh%]+/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.]+[pxremvwh%]*)/.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};\n\no.isIgnore = function(k) {\n return IGNORE.hasOwnProperty(k);\n};\nfunction isGeom(tagName, k) {\n return GEOM.hasOwnProperty(k) && GEOM[k].hasOwnProperty(tagName);\n}\no.isGeom = isGeom;\no.isRepaint = function(k) {\n return REPAINT.hasOwnProperty(k) || isGeom(k);\n};\no.isMeasure = function(k) {\n return MEASURE.hasOwnProperty(k);\n};\no.isValid = function(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\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']);\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, 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 // 扩展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(!isNil(v) && 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) {\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(!isNil(temp)) {\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) {\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.]+[pxremvwh%]*)|(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(!isNil(v)) {\n res[STYLE_KEY[style2Upper(k)]] = [rgba2int(v), 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(!isNil(v)) {\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) {\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]);\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(!isNil(temp)) {\n let arr = calUnit(temp);\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(!isNil(temp)) {\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(isNil(v)) {\n return;\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) {\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]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n res[ROTATE_3D] = arr;\n }\n }\n temp = style.opacity;\n if(!isNil(temp)) {\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(!isNil(temp)) {\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(isNil(v)) {\n return;\n }\n if(v === 'auto') {\n v = [0, AUTO];\n }\n else {\n v = calUnit(v);\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(!isNil(temp)) {\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(!isNil(temp)) {\n res[ORDER] = parseInt(temp) || 0;\n }\n temp = style.color;\n if(!isNil(temp)) {\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(!isNil(temp)) {\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 || temp === 0) {\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(!isNil(temp)) {\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(!isNil(temp)) {\n if(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(!isNil(temp)) {\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) {\n if(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) {\n if(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) {\n if(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 === '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) {\n if(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(!isNil(temp)) {\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(!isNil(temp)) {\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') {\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) {\n if(temp === 'inherit') {\n res[VISIBILITY] = [0, INHERIT];\n }\n else {\n res[VISIBILITY] = [temp, STRING];\n }\n }\n temp = style.pointerEvents;\n if(temp) {\n if(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.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*\\s*)?([-+]?[\\d.]+[pxremvwh%]*\\s*)?(((transparent)|(#[0-9a-f]{3,8})|(rgba?\\(.+?\\)))\\s*)?(inset|outset)?\\s*,?/ig);\n if(match) {\n match.forEach(item => {\n let boxShadow = /([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*\\s*)?([-+]?[\\d.]+[pxremvwh%]*\\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(!isNil(temp)) {\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 {\n computedStyle[k] = v[0];\n }\n });\n}\n\n/**\n * 每次布局前需要计算的reflow相关的computedStyle\n * @param node 对象节点\n * @param isHost 是否是根节点或组件节点这种局部根节点,无继承需使用默认值\n */\nfunction computeReflow(node, isHost) {\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 {\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 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] === 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 {\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];\n return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' '\n + fontSize + 'px/' + fontSize + 'px ' + (style[FONT_FAMILY] || 'arial');\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 }\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 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 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\nexport default {\n normalize,\n computeMeasure,\n computeReflow,\n setFontStyle,\n getFontFamily,\n getBaseLine,\n calRelative,\n calAbsolute,\n equalStyle,\n isRelativeOrAbsolute,\n cloneStyle,\n};\n","import mode from './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\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","import matrix from './matrix';\nimport tar from './tar';\nimport geom from './geom';\n\nexport default {\n matrix,\n tar,\n geom,\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 } = 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 }\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 }\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 });\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 DISPLAY,\n VISIBILITY,\n },\n NODE_KEY: {\n NODE_OPACITY,\n NODE_CACHE,\n NODE_CACHE_FILTER,\n NODE_CACHE_OVERFLOW,\n NODE_HAS_CONTENT,\n NODE_COMPUTED_STYLE,\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 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 }\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 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, 'filter1');\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, next, isClip, transform, tfo) {\n let cacheMask = genSingle(target, 'mask1');\n let list = [];\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;\n tfo[1] += y + dby;\n let inverse = tf.calMatrixByOrigin(transform, tfo);\n // 先将mask本身绘制到cache上,再设置模式绘制dom本身,因为都是img所以1个就够了\n list.forEach(item => {\n let __config = item.__config;\n let cacheOverflow = __config[NODE_CACHE_OVERFLOW], cacheFilter = __config[NODE_CACHE_FILTER], cache = __config[NODE_CACHE];\n let source = cacheOverflow && cacheOverflow.available && cacheOverflow;\n if(!source) {\n source = cacheFilter && cacheFilter.available && cacheFilter;\n }\n if(!source) {\n source = cache && cache.available && cache;\n }\n if(source) {\n ctx.globalAlpha = __config[NODE_OPACITY];\n Cache.drawCache(\n source, cacheMask,\n __config[NODE_COMPUTED_STYLE][TRANSFORM],\n mx.identity(),\n __config[NODE_COMPUTED_STYLE][TRANSFORM_ORIGIN].slice(0),\n inverse\n );\n }\n // 没有内容或者img没加载成功导致没有内容,有内容且可见则是超限,不可能进这里\n else if(__config[NODE_HAS_CONTENT]\n && __config[NODE_COMPUTED_STYLE][DISPLAY] !== 'none'\n && __config[NODE_COMPUTED_STYLE][VISIBILITY] !== 'hidden') {\n inject.error('CacheMask is oversize');\n }\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, 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(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\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 './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 } = 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 }\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 // text-overflow:ellipse需要,即便没有也要先测量,其基于最近非inline父节点的字体\n let bp = this.domParent;\n while(bp.currentStyle[DISPLAY] === 'inline') {\n bp = bp.domParent;\n }\n this.__bp = bp;\n let parentComputedStyle = bp.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.__sx1 = x;\n this.__y = this.__sy1 = y;\n let { isDestroyed, content, currentStyle, 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 || currentStyle[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 let lineCount = 0;\n // 不换行特殊对待,同时考虑overflow和textOverflow\n if(whiteSpace === 'nowrap') {\n let isTextOverflow;\n // block的overflow:hidden和textOverflow:clip/ellipsis才生效,inline要看最近非inline父元素\n let bp = this.__bp;\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) {\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.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.__width = maxX - minX;\n }\n\n __calMaxAndMinWidth() {\n let n = 0;\n this.charWidthList.forEach(item => {\n n = Math.max(n, item);\n });\n return { max: this.textWidth, min: n };\n }\n\n __calAbsWidth(x, y, w) {\n this.__layout({\n x,\n y,\n w,\n }, true);\n return this.width;\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 { sx, 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] * 0.5, half);\n }\n else if(textStrokeWidth[1] === VW) {\n half = Math.max(textStrokeWidth[0] * root.width * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VH) {\n half = Math.max(textStrokeWidth[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(textStrokeWidth[0] * 0.5, half);\n }\n half += 1;\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 let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\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.__hasUpdate) {\n return;\n }\n cp.__hasUpdate = 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 '../node/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 } = unit;\n\nfunction renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bbrr, bblr, method = 'fill', isInline) {\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);\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] === 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 }\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 let source = loadBgi.source;\n // 无source不绘制,可能错误或加载中\n if(source) {\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} = enums;\nconst { AUTO, PX, PERCENT, INHERIT, RGBA, STRING, NUMBER, REM, VW, VH, 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 }\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 }\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 }\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 }\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 }\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,其余都是特殊固定单位\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') {\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') {\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没有增量\n else {\n if(n === p || k === 'edge' || k === 'closure') {\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 {\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') {\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\nlet uuid = 0;\n\nconst I_ASSIGNING = 0;\nconst I_IN_FPS = 1;\nconst I_IS_DELAY = 2;\nconst I_BEGIN = 3;\nconst I_END = 4;\nconst I_FINISHED = 5;\nconst I_NEXT_END = 6;\nconst I_FIRST_PLAY = 7;\nconst I_FRAME_CB = 8;\nconst I_PLAY_CB = 9;\nconst I_TARGET = 10;\nconst I_ROOT = 11;\nconst I_FRAMES = 12;\nconst I_FRAMES_R = 13;\nconst I_CURRENT_TIME = 14;\nconst I_NEXT_TIME = 15;\nconst I_STYLE = 16;\nconst I_DURATION = 17;\nconst I_ITERATIONS = 18;\nconst I_FILL = 19;\nconst I_PLAYBACK_RATE = 20;\nconst I_PLAY_COUNT = 21;\nconst I_PLAY_STATE = 22;\nconst I_DESTROYED = 23;\nconst I_START_TIME = 24;\nconst I_FPS_TIME = 25;\nconst I_EASING = 26;\nconst I_ENTER_FRAME = 27;\nconst I_DELAY = 28;\nconst I_END_DELAY = 29;\nconst I_KEYS = 30;\nconst I_ORIGIN_STYLE = 31;\nconst I_CURRENT_FRAMES = 32;\nconst I_CURRENT_FRAME = 33;\nconst I_SPF_LIMIT = 34;\nconst I_FPS = 35;\nconst I_DIRECTION = 36;\nconst I_CAL_DIFF_TIME = 37;\nconst I_FIRST_ENTER = 38;\nconst I_STAY_BEGIN = 39;\nconst I_STAY_END = 40;\nconst I_IS2 = 41;\nconst I_END_TIME = 42;\nconst I_NODE_CONFIG = 43;\nconst I_ROOT_CONFIG = 44;\nconst I_OUT_BEGIN_DELAY = 45;\nconst I_TIME_STAMP = 46;\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 this.__frameCb,\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 this.__calDiffTime,\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 __config[I_CURRENT_TIME] = __config[I_DELAY] + __config[I_DURATION] + __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 __frameCb(__config, diff, isDelay) {\n this.emit(Event.FRAME, diff, isDelay);\n if(__config[I_FIRST_PLAY]) {\n __config[I_FIRST_PLAY] = false;\n this.emit(Event.PLAY);\n }\n if(isFunction(__config[I_PLAY_CB])) {\n __config[I_PLAY_CB].call(this, diff, isDelay);\n __config[I_PLAY_CB] = null;\n }\n }\n\n __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\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 = __config[I_PLAY_COUNT];\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] = __config[I_CAL_DIFF_TIME](__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(playCount === 0 && 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 if(playCount === 0) {\n currentTime -= delay;\n }\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 __config[I_NEXT_TIME] -= duration;\n playCount = ++__config[I_PLAY_COUNT];\n __config[I_BEGIN] = true;\n round = true;\n }\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 this.__clean(true);\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 __config[I_FRAME_CB].call(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 __config[I_FRAME_CB].call(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 __config[I_FRAME_CB].call(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 __goto(v, isFrame, excludeDelay) {\n let __config = this.__config;\n let duration = __config[I_DURATION];\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\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 // 超过一轮去掉delay\n if(v > duration + __config[I_DELAY]) {\n v -= __config[I_DELAY];\n }\n // 超过时间长度需要累加次数\n __config[I_PLAY_COUNT] = 0;\n while(v > duration && __config[I_PLAY_COUNT] < __config[I_ITERATIONS] - 1) {\n __config[I_PLAY_COUNT]++;\n v -= duration;\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n __config[I_NEXT_TIME] = v;\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 = __config[I_PLAY_COUNT] % 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 '../node/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) {\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 mode from './mode';\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 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;\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 }\n} = enums;\nconst { AUTO, PX, PERCENT, INHERIT, NUMBER, REM, VW, VH, DEG } = unit;\nconst { int2rgba, rgba2int, joinArr, isNil } = 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 }\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.__mpWidth(currentStyle[a], w);\n computedStyle[b] = this.__mpWidth(currentStyle[b], w);\n });\n }\n\n __mpWidth(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 return 0;\n }\n\n // dom常用的几种尺寸赋值\n __ioSize(w, h) {\n let computedStyle = this.computedStyle;\n this.__clientWidth = w += computedStyle[PADDING_LEFT] + computedStyle[PADDING_RIGHT];\n this.__clientHeight = h += computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM];\n this.__offsetWidth = w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[BORDER_RIGHT_WIDTH];\n this.__offsetHeight = h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH];\n this.__outerWidth = w + computedStyle[MARGIN_LEFT] + computedStyle[MARGIN_RIGHT];\n this.__outerHeight = h + computedStyle[MARGIN_TOP] + computedStyle[MARGIN_BOTTOM];\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 return n;\n }\n\n // 为basis的b/min/max添加mpb,只有当b未显示指定等于w/content时才加,同时返回mpb值\n __addMp(isDirectionRow, w, currentStyle, 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 [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w, !isDirectItem)\n + this.__calMp(marginRight, w, !isDirectItem)\n + this.__calMp(paddingLeft, w, !isDirectItem)\n + this.__calMp(paddingRight, w, !isDirectItem);\n if(borderLeftWidth[1] === PX) {\n mp += borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n mp += borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n mp += borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n mp += borderLeftWidth[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n mp += borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n mp += borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n mp += borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n mp += borderRightWidth[0] * this.root.height * 0.01;\n }\n res = res.map(item => item + mp);\n }\n else {\n let mp = this.__calMp(marginTop, w, !isDirectItem)\n + this.__calMp(marginBottom, w, !isDirectItem)\n + this.__calMp(paddingTop, w, !isDirectItem)\n + this.__calMp(paddingBottom, w, !isDirectItem);\n if(borderTopWidth[1] === PX) {\n mp += borderTopWidth[0];\n }\n else if(borderTopWidth[1] === REM) {\n mp += borderTopWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderTopWidth[1] === VW) {\n mp += borderTopWidth[0] * this.root.width * 0.01;\n }\n else if(borderTopWidth[1] === VH) {\n mp += borderTopWidth[0] * this.root.height * 0.01;\n }\n if(borderBottomWidth[1] === PX) {\n mp += borderBottomWidth[0];\n }\n else if(borderBottomWidth[1] === REM) {\n mp += borderBottomWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderBottomWidth[1] === VW) {\n mp += borderBottomWidth[0] * this.root.width * 0.01;\n }\n else if(borderBottomWidth[1] === VH) {\n mp += borderBottomWidth[0] * this.root.height * 0.01;\n }\n res = res.map(item => item + mp);\n }\n return res;\n }\n\n // absolute且无尺寸时,isVirtual标明先假布局一次计算尺寸,还有flex列计算时\n // fromAbs为absolute节点特有省略计算标识,本节点是abs时真正布局传入\n __layout(data, isVirtual, fromAbs) {\n css.computeReflow(this, this.isShadowRoot);\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.clearCache();\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 __config[NODE_REFRESH_LV] = REFLOW;\n __config[NODE_LIMIT_CACHE] = false;\n __config[NODE_IS_INLINE] = false;\n // 防止display:none不统计mask,isVirtual忽略,abs布局后续会真正来走一遍\n if(!isVirtual) {\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 return;\n }\n // margin/padding在abs前已经计算过了,无需二次计算\n if(!fromAbs) {\n this.__mp(currentStyle, computedStyle, w);\n }\n // inline的width/height无效,其它有效\n if(width[1] !== AUTO) {\n if(this.__isRealInline() && currentStyle[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 }\n }\n }\n let lineClampCount = 0;\n // 4种布局,默认block,inlineBlock基本可以复用inline逻辑,除了尺寸\n if(display === 'flex') {\n this.__layoutFlex(data, isVirtual);\n }\n else if(display === 'inlineBlock' || display === 'inline-block') {\n lineClampCount = this.__layoutInline(data, isVirtual);\n }\n else if(display === 'inline') {\n lineClampCount = this.__layoutInline(data, isVirtual, true);\n }\n else {\n this.__layoutBlock(data, isVirtual);\n }\n // relative渲染时做偏移,百分比基于父元素,若父元素没有定高则为0\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布局的不执行,在__layoutAbs末尾做,防止未布局没有尺寸从而动画计算错误\n if(!fromAbs) {\n this.__execAr();\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[PADDING_TOP]\n = computedStyle[PADDING_RIGHT]\n = computedStyle[PADDING_BOTTOM]\n = computedStyle[PADDING_LEFT]\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 }\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 }\n }\n // margin/padding/border影响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已知目标主尺寸,需减去mpb,其一定是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.tagName === 'img') && 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 {\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 {\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 {\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 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] === 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] === 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 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 {\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 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 {\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 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 * @param lv\n * @param ctx canvas/svg/webgl共用\n * @param cache 是否开启缓存\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 * offscreenMask 无cache时的离屏canvas,仅canvas\n * offscreenOverflow 无cache时的离屏canvas,仅canvas\n */\n render(renderMode, lv, ctx, cache) {\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 this.__bbox = null;\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);\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);\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 + dx, iy1 + dy, ix2 - ix1, iy2 - iy1, btlr, [0, 0], [0, 0], bblr);\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);\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 + dx, iy1 + dy, ix2 - ix1, iy2 - iy1, isFirst ? btlr : [0, 0], btrr, bbrr, isFirst ? bblr : [0, 0]);\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);\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);\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);\n }\n }\n else if(bgi.k) {\n let gd = this.__gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi);\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);\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);\n });\n }\n // 边框需考虑尖角,两条相交边平分45°夹角\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_TOP], __cacheStyle[BORDER_TOP_COLOR]);\n }\n if(borderRightWidth > 0 && borderRightColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_RIGHT], __cacheStyle[BORDER_RIGHT_COLOR]);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_BOTTOM], __cacheStyle[BORDER_BOTTOM_COLOR]);\n }\n if(borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_LEFT], __cacheStyle[BORDER_LEFT_COLOR]);\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.delRefreshTask(this.__loadBgi.cb);\n 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' && util.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(util.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) {\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);\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);\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);\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.cx, gd.cy, 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.cx],\n ['cy', gd.cy],\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 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(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, formatStyle);\n if(util.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(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, style);\n if(util.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(util.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(util.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.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) {\n let ox = 0, oy = 0;\n if(Array.isArray(boxShadow)) {\n boxShadow.forEach(item => {\n let [x, y, sigma, spread, , inset] = item;\n if(inset !== 'inset') {\n let d = blur.outerSize(sigma);\n d += spread;\n ox = Math.max(ox, x + d);\n oy = Math.max(oy, y + d);\n }\n });\n }\n return [ox, oy];\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() {\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent } = this;\n let p1 = point2d(mx.calPoint([__sx1, __sy1], matrixEvent));\n let p2 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1], matrixEvent));\n let p3 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1 + offsetHeight], matrixEvent));\n let p4 = point2d(mx.calPoint([__sx1, __sy1 + offsetHeight], 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(util.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(util.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] = level.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(util.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, clientWidth, clientHeight,\n currentStyle: {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BOX_SHADOW]: boxShadow,\n },\n } = this;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n clientWidth += borderLeftWidth[0] + borderRightWidth[0];\n clientHeight += borderTopWidth[0] + borderBottomWidth[0];\n let half = 1;\n this.__bbox = [__sx1 - ox - half, __sy1 - oy - half, __sx1 + clientWidth + ox + half, __sy1 + clientHeight + oy + half];\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\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 n = this.baseLine;\n // 只有1个也需要对齐,因为可能内嵌了空inline使得baseLine发生变化\n if(this.list.length) {\n this.list.forEach(item => {\n let m = item.baseLine;\n if(m !== n) {\n item.__offsetY(n - m);\n }\n });\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\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 = 0;\n this.list.forEach(item => {\n baseLine = Math.max(baseLine, item.baseLine);\n });\n return Math.max(this.__baseLine, baseLine);\n }\n\n get lineHeight() {\n let lineHeight = 0;\n // 只有TextBox和InlineBlock\n this.list.forEach(item => {\n lineHeight = Math.max(lineHeight, item.outerHeight);\n });\n return Math.max(this.__lineHeight, 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 }\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 verticalAlign() {\n this.list.forEach(lineBox => {\n lineBox.verticalAlign();\n });\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\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.currentStyle[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, null, 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 mode from './mode';\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 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 // PERSPECTIVE,\n // TRANSFORM,\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 } = unit;\nconst { calAbsolute, isRelativeOrAbsolute } = css;\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 = util.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 {\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 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 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 }\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 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 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 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 // item的递归子节点求min/max,只考虑固定值单位,忽略百分比,同时按方向和display\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this, this.isShadowRoot);\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h, lineBoxManager } = data;\n // 计算需考虑style的属性\n let {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n else {\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\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 = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\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 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 });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n else if(display === 'block') {\n let countMin = 0, countMax = 0;\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\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 if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n else {\n if(display === 'inlineBlock' || display === 'inline-block') {\n lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n }\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n if(isDirectionRow) {\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 min += item.charWidth;\n max += item.textWidth;\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n });\n }\n }\n return [display, this.__addMp(isDirectionRow, w, currentStyle, [min, max])];\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时isVirtual状态参与计算,文本抵达边界才进行换行\n * @param isDirectionRow\n * @param data\n * @param isVirtual abs非固定尺寸时先进行虚拟布局标识\n * @private\n */\n __calBasis(isDirectionRow, data, isVirtual) {\n css.computeReflow(this, this.isShadowRoot);\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 [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n [FLEX_BASIS]: flexBasis,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\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].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 }\n // 已声明主轴尺寸的,当basis是auto时为值\n else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1) && isAuto) {\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 }\n // 非固定尺寸的basis为auto时降级为content\n else if(isAuto) {\n isContent = true;\n }\n // flex的item还是flex时\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\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 = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\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 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 });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n // flex的item是block/inline时,inline也会变成block统一对待\n else {\n let countMin = 0, countMax = 0;\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\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 if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n if(fixedSize) {\n max = Math.max(fixedSize, max);\n }\n if(isContent) {\n b = max;\n }\n // 直接item的mpb影响basis\n return this.__addMp(isDirectionRow, w, currentStyle, [b, min, max], true);\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 isVirtual abs无尺寸时提前虚拟布局计算尺寸\n * @private\n */\n __layoutBlock(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\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 isImg = item.tagName === 'img';\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 }, isVirtual);\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 || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // abs统计宽度\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.outerWidth;\n maxW = Math.max(maxW, cw);\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 }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock || isImg) && 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 }, isVirtual);\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 || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n if(isVirtual) {\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 }, isVirtual);\n let isNone = item.currentStyle[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(isVirtual) {\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 }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.width;\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 }, isVirtual);\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 }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, item.width);\n cw = 0;\n }\n }\n if(isVirtual) {\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 || !isVirtual) ? w : maxW;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // 非abs提前的虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐\n if(!isVirtual) {\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 // 所有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, isVirtual) {\n let { flowChildren, currentStyle, computedStyle, __flexLine } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\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 maxX = 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 // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n // abs虚拟布局计算时纵向也是看横向宽度\n let [b, min, max] = item.__calBasis(isVirtual ? true : isDirectionRow, { x, y, w, h }, isVirtual);\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += max;\n }\n else {\n maxX = Math.max(maxX, max);\n }\n return;\n }\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 if(isVirtual) {\n if(isDirectionRow) {\n maxX += item.textWidth;\n }\n else {\n maxX = Math.max(maxX, item.textWidth);\n }\n return;\n }\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 });\n let h = item.height;\n basisList.push(h);\n minList.push(h);\n }\n }\n });\n // abs时,只需关注宽度即可,无需真正布局\n if(isVirtual) {\n let tw = this.__width = Math.min(maxX, w);\n this.__ioSize(tw, this.height);\n return;\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, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, 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 let tw = this.__width = w;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\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(!isVirtual && 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(!isVirtual) {\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 }\n this.__marginAuto(currentStyle, data);\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, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, 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 });\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h: main,\n h3: main, // 同w2\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 });\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(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(['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 isVirtual\n * @param isInline\n * @private\n */\n __layoutInline(data, isVirtual, 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(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\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 }, isVirtual);\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 }, isVirtual);\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 }, isVirtual);\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 }, isVirtual);\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 }, isVirtual);\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 }, isVirtual);\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(isVirtual) {\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(!isVirtual && !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(currentStyle[DISPLAY] === 'none') {\n item.__layoutNone();\n return;\n }\n // 先根据容器宽度计算margin/padding\n item.__mp(currentStyle, computedStyle, clientWidth);\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let { [LEFT]: left, [TOP]: top, [RIGHT]: right,\n [BOTTOM]: bottom, [WIDTH]: width, [HEIGHT]: height, [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection } = 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 = x + clientWidth - computedStyle[RIGHT] - x2;\n }\n else if(fixedLeft) {\n x2 = x + computedStyle[LEFT];\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n }\n else if(fixedRight) {\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\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 -= currentStyle[BORDER_LEFT_WIDTH][0];\n x2 -= currentStyle[BORDER_RIGHT_WIDTH][0];\n }\n else {\n x2 = x + paddingLeft;\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n }\n // top/bottom/height优先级同上\n if(fixedTop && fixedBottom) {\n y2 = y + computedStyle[TOP];\n h2 = y + clientHeight - computedStyle[BOTTOM] - y2;\n }\n else if(fixedTop) {\n y2 = y + computedStyle[TOP];\n if(height[1] !== AUTO) {\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else {\n h2 = height[0];\n }\n }\n }\n else if(fixedBottom) {\n if(height[1] !== AUTO) {\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else {\n h2 = height[0];\n }\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 -= currentStyle[BORDER_TOP_WIDTH][0];\n y2 -= currentStyle[BORDER_BOTTOM_WIDTH][0];\n }\n // 未声明y的找到之前的流布局child,紧随其下\n else {\n y2 = y + paddingTop;\n let prev = item.prev;\n while(prev) {\n // 目前不考虑margin合并,直接以前面的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] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else if(height[1] === PX) {\n h2 = height[0];\n }\n }\n // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局\n let needCalWidth;\n if((display === 'block' || ['inlineBlock', 'inline-block'].indexOf(display) > -1) && w2 === undefined) {\n needCalWidth = true;\n }\n else if(display === 'flex') {\n if(w2 === undefined) {\n needCalWidth = true;\n }\n else if(flexDirection === 'column' && h2 === undefined) {\n needCalWidth = true;\n }\n }\n // onlyRight时做的布局其实是以那个点位为left/top布局然后offset,limit要特殊计算,从本点向左侧为边界\n let wl = onlyRight ? x2 - x : clientWidth + x - x2;\n // onlyBottom相同,正常情况是左上到右下的尺寸限制\n let hl = onlyBottom ? y2 - y : clientHeight + y - y2;\n // 未直接或间接定义尺寸,取孩子宽度最大值\n if(needCalWidth) {\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n }, true, true);\n wl = item.outerWidth;\n }\n // needCalWidth传入,因为自适应尺寸上面已经计算过一次margin/padding了\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n w2, // left+right这种等于有宽度,但不能修改style,继续传入到__preLayout中特殊对待\n h2,\n }, false, true);\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 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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(util.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(!util.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(util.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(!util.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(util.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(!util.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(util.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(!util.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(util.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(util.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 './mode';\nimport painter from '../util/painter';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport unit from '../style/unit';\nimport image from '../style/image';\nimport border from '../style/border';\nimport enums from '../util/enums';\nimport level from '../refresh/level';\nimport mx from '../math/matrix';\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_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\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, RGBA } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { isFunction } = util;\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 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的方法,在__layout3个分支中会首先被调用\n * 当样式中固定宽高时,图片按样式尺寸,加载后重新绘制即可\n * 只固定宽高一个时,加载完要计算缩放比,重新布局绘制\n * 都没有固定,按照图片尺寸,重新布局绘制\n * 这里计算非固定的情况,将其改为固定供布局渲染使用,未加载完成为0\n * @param data\n * @returns {{fixedWidth: boolean, w: *, x: *, h: *, y: *, fixedHeight: boolean}}\n * @private\n */\n __preLayout(data) {\n let res = super.__preLayout(data);\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) {\n let res = super.render(renderMode, lv, ctx, cache);\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;\n originY = res.y3;\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 ctx.arc(cx, cy, r, 0, 2 * Math.PI);\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);\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 {\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 {\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 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 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 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 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 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 return w;\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle, __loadImg } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\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 [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\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].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 }\n else if(([PX, PERCENT, REM, VW, VH].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 }\n // auto和content固定尺寸比例计算\n else if(__loadImg.source || __loadImg.error) {\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 let ratio = __loadImg.width / __loadImg.height;\n b = max = min = isDirectionRow ? cross * ratio : cross / ratio;\n }\n else {\n b = max = min = isDirectionRow ? __loadImg.width : __loadImg.height;\n }\n }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\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 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 '../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 DISPLAY,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n WIDTH,\n HEIGHT,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_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 }\n} = enums;\nconst { PX, PERCENT, REM, VW, VH } = unit;\nconst { int2rgba, isNil, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\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 // 减去水平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 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 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 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 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 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 return w;\n }\n\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this, this.isShadowRoot);\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n // 计算需考虑style的属性\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n [DISPLAY]: display,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n return [display, this.__addMp(isDirectionRow, data.w, currentStyle, [min, max])];\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\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 [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH].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 }\n else if(([PX, PERCENT, REM, VW, VH].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 }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\n }\n\n __layoutBlock(data, isVirtual) {\n let { fixedWidth, fixedHeight, w, h } = this.__preLayout(data);\n this.__height = fixedHeight ? h : 0;\n if(isVirtual) {\n this.__width = fixedWidth ? w : 0;\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) {\n // 无children所以等同于block\n this.__layoutBlock(data);\n }\n\n __layoutInline(data) {\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\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 {\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 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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() {}\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更新时,从叶子到根链路会标识__hasUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasUpdate) {\n child.__hasUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n // 高阶组件会进入此分支,被父组件调用\n else if(vd instanceof Component && vd.__hasUpdate) {\n vd.__hasUpdate = 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}\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 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 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 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 Geom from '../node/geom/Geom';\nimport Text from '../node/Text';\nimport Dom from '../node/Dom';\nimport Img from '../node/Img';\nimport mx from '../math/matrix';\nimport geom from '../math/geom';\nimport level from './level';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport painter from '../util/painter';\nimport Cache from './Cache';\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';\nimport mode from '../node/mode';\n\nconst { canvasPolygon } = painter;\n\nconst {\n STYLE_KEY: {\n POSITION,\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 },\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 },\n STRUCT_KEY: {\n STRUCT_NODE,\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;\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\n// 依次从list获取首个available可用的cache\nfunction 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/**\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;\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;\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 = util.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 * @param renderMode\n * @param node\n * @param __config\n * @param index\n * @param total\n * @param __structs\n * @param cacheTop\n * @param cache\n * @returns {{enabled}|Cache|*}\n */\nfunction genTotal(renderMode, node, __config, index, total, __structs, cacheTop, cache) {\n if(total === 0) {\n return cache;\n }\n // 存每层父亲的matrix和opacity和index,bbox计算过程中生成,缓存给下面渲染过程用\n let parentIndexHash = {};\n let opacityHash = {};\n let [bboxTotal] = genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHash, Cache.MAX);\n if(!bboxTotal) {\n return;\n }\n let { __sx1: sx1, __sy1: sy1 } = node;\n if(cacheTop) {\n cacheTop.reset(bboxTotal, sx1, sy1);\n }\n else {\n cacheTop = Cache.getInstance(bboxTotal, sx1, sy1);\n }\n // 创建失败,再次降级\n if(!cacheTop || !cacheTop.enabled) {\n return;\n }\n cacheTop.__available = true;\n let { x: tx, y: ty, ctx, dbx, dby } = cacheTop;\n // 先绘制自己的cache,起点所以matrix视作E为空,opacity固定1\n if(cache && cache.available) {\n ctx.globalAlpha = 1;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n Cache.drawCache(cache, cacheTop);\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 ctx.globalAlpha = opacity;\n let m = matrix || mx.identity();\n ctx.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]);\n node.render(renderMode, 0, ctx, true, tx - sx1 + dbx, ty - sy1 + dby);\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);\n if(hasMask) {\n i += hasMask;\n }\n continue;\n }\n // mask和不可见不能被汇总到top上\n if(visibility === 'hidden' || isMask) {\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 + tx;\n let dy = -sy1 + dby + ty;\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 let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n if(target) {\n if(isValidMbm(mixBlendMode)) {\n ctx.globalCompositeOperation = mbmName(mixBlendMode);\n }\n else {\n ctx.globalCompositeOperation = 'source-over';\n }\n ctx.globalAlpha = opacity;\n if(matrix) {\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n }\n else {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n }\n Cache.drawCache(target, cacheTop);\n if(target !== __cache) {\n i += total || 0;\n i += hasMask || 0;\n }\n }\n }\n }\n return cacheTop;\n}\n\nfunction genFilter(node, cache, v) {\n return Cache.genFilter(cache, v);\n}\n\nfunction genMask(node, cache) {\n let { [TRANSFORM]: transform, [TRANSFORM_ORIGIN]: transformOrigin } = node.computedStyle;\n let isClip = node.next.isClip;\n return Cache.genMask(cache, node.next, isClip, transform, transformOrigin);\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\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 W\n * @param H\n * @returns {*}\n */\nfunction genTotalWebgl(gl, texCache, node, __config, index, total, __structs, cache, limitCache, 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);\n }\n // limitCache无cache需先绘制到统一的离屏画布上\n else if(limitCache) {\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(mode.WEBGL, 0, gl);\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);\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);\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);\n if(hasMask) {\n i += hasMask;\n }\n continue;\n }\n // mask和不可见不能被汇总到top上\n if(visibility === 'hidden' || isMask) {\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);\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);\n }\n if(target !== __cache) {\n i += (total || 0) + (hasMask || 0);\n }\n }\n }\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 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;\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 += `\\nv_texCoordsBlur[${i}] = a_texCoords + vec2(-${c}, -${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i}]) * ${weights[i]};`;\n }\n vert += `\\nv_texCoordsBlur[${r}] = a_texCoords;`;\n frag += `\\ngl_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 += `\\nv_texCoordsBlur[${i + r + 1}] = a_texCoords + vec2(${c}, ${c}) * u_direction;`;\n frag += `\\ngl_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) {\n let { sx1, sy1, width, height, bbox } = cache;\n // cache一定是mockCache,可能是total/filter/overflow一种\n let cx = width * 0.5, cy = height * 0.5;\n let dx = -bbox[0], dy = -bbox[1];\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 while(next && next.isMask) {\n let __config = next.__config;\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [OPACITY]: opacity,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n },\n } = __config;\n if(display === 'none' || visibility === 'hidden') {\n continue;\n }\n // total无用,都是单节点\n let target = getCache([__cacheFilter, __cacheOverflow, __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 // m = mx.m2Mat4(m, cx, cy);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, m, cx, cy, dx, dy);\n }\n // 异常情况超限\n else if(__config[NODE_LIMIT_CACHE]) {\n return;\n }\n next = next.next;\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 isClip = node.next.isClip;\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 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 ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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, 'filter2');\n apply.ctx.filter = painter.canvasFilter(filter);\n apply.ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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 target.ctx.drawImage(apply.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(offscreen.target.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(mask.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(mask.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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\nfunction renderCacheCanvas(renderMode, ctx, root) {\n let { __structs, width, height } = root;\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 = 0;\n let mergeList = [];\n /**\n * 先一遍先序遍历每个节点绘制到自己__cache上,排除Text和已有的缓存以及局部根缓存,\n * 根据refreshLevel进行等级区分,可能是=REPAINT,REFLOW布局已前置处理完。\n * 首次绘制没有catchTotal等,后续则可能会有,在 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 // 不变是同级兄弟,无需特殊处理\n else {}\n lastConfig = __config;\n lastLv = lv;\n let {\n [NODE_REFRESH_LV]: refreshLevel,\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, 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 let matrix;\n if(contain(refreshLevel, TRANSFORM_ALL)) {\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n util.assignMatrix(m, matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n // 父不为E时要点乘继承父的\n if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n util.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 let __cacheFilter = __config[NODE_CACHE_FILTER];\n if(__cacheFilter) {\n __cacheFilter.release();\n }\n // 防重\n if(hasRecordAsMask) {\n hasRecordAsMask[6] = filter;\n }\n else {\n // 强制存hasMask,因为filter改变影响mask\n hasRecordAsMask = [i, lv, total, node, __config, 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重新渲染,并根据结果判断是否离屏限制limitCache\n * Geom没有子节点无需汇总局部根,Dom中Img也是,它们的局部根等于自身的cache,其它符合条件的Dom需要生成\n */\n else {\n node.render(renderMode, refreshLevel, ctx, true);\n }\n // 每个元素检查cacheTotal生成,已有的上面会continue跳过\n let {\n [NODE_LIMIT_CACHE]: limitCache,\n } = __config;\n let {\n [POSITION]: position,\n [OVERFLOW]: overflow,\n [FILTER]: filter,\n [MIX_BLEND_MODE]: mixBlendMode,\n } = computedStyle;\n if(!limitCache && (hasMask || position === 'absolute'\n || filter.length || (overflow === 'hidden' && total) || isValidMbm(mixBlendMode))) {\n if(hasRecordAsMask) {\n hasRecordAsMask[6] = filter;\n hasRecordAsMask[7] = overflow;\n }\n else {\n mergeList.push([i, lv, total, node, __config, hasMask, filter, overflow]);\n }\n }\n }\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 mergeList.forEach(item => {\n let [i, , total, node, __config, hasMask, filter, overflow] = item;\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 __cacheTotal = genTotal(renderMode, node, __config, i, total || 0, __structs, __cacheTotal, __cache);\n if(__cacheTotal && __cacheTotal !== __cache) {\n __config[NODE_CACHE_TOTAL] = __cacheTotal;\n }\n needGen = true;\n }\n // 防止失败超限,必须有total结果\n if(__cacheTotal && __cacheTotal.available) {\n let target = __cacheTotal;\n if(overflow === 'hidden') {\n if(!__cacheOverflow || !__cacheOverflow.available || needGen) {\n __config[NODE_CACHE_OVERFLOW] = genOverflow(node, target);\n needGen = true;\n }\n target = __config[NODE_CACHE_OVERFLOW] || target;\n }\n if(filter && filter.length) {\n if(!__cacheFilter || !__cacheFilter.available || needGen) {\n __config[NODE_CACHE_FILTER] = genFilter(node, target, filter);\n needGen = true;\n }\n target = __config[NODE_CACHE_FILTER] || target;\n }\n if(hasMask && (!__cacheMask || !__cacheMask.available || needGen)) {\n __config[NODE_CACHE_MASK] = genMask(node, target);\n }\n }\n });\n }\n /**\n * 最后先序遍历一次应用__cacheTotal即可,没有的用__cache,以及剩下的超尺寸的和Text\n * 超尺寸的依旧要走无cache逻辑render,这部分和无cache渲染很像\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 let __config = node.__config;\n // text如果display不可见,parent会直接跳过,不会走到这里,这里一定是直接绘制到root的,visibility在其内部判断\n if(node instanceof Text) {\n let {\n [NODE_OPACITY]: opacity,\n [NODE_MATRIX_EVENT]: matrixEvent,\n } = __config[NODE_DOM_PARENT].__config;\n ctx.globalAlpha = opacity;\n ctx.setTransform(matrixEvent[0], matrixEvent[1], matrixEvent[4], matrixEvent[5], matrixEvent[12], matrixEvent[13]);\n node.render(renderMode, 0, ctx);\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\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 [OVERFLOW]: overflow,\n [FILTER]: filter,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n // 有total的可以直接绘制并跳过子节点索引\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n // total的尝试\n if(target) {\n i += (total || 0) + (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.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 }\n // 自身cache尝试\n else {\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 let offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow;\n // 这里比较特殊,可能会有__cache但超限没被汇聚到total上,需mock出离屏对象数据,还有可能本身就超限\n if(__cache && __cache.available || limitCache) {\n if(__cache && __cache.available) {\n // 有cache但没生成total的都在这\n if(isValidMbm(mixBlendMode)) {\n let c = inject.getCacheCanvas(width, height, null, 'blend');\n offscreenBlend = {\n ctx,\n target: c,\n mixBlendMode: mbmName(mixBlendMode),\n matrix: matrixEvent,\n };\n ctx = c.ctx;\n }\n if(hasMask) {\n let c = inject.getCacheCanvas(width, height, null, 'mask1');\n offscreenMask = {\n ctx,\n target: c,\n matrix: matrixEvent,\n };\n ctx = c.ctx;\n }\n if(filter && filter.length) {\n let c = inject.getCacheCanvas(width, height, null, 'filter1');\n offscreenFilter = {\n ctx,\n filter,\n target: c,\n matrix: matrixEvent,\n };\n ctx = c.ctx;\n }\n if(overflow === 'hidden' && display !== 'inline') {\n let c = inject.getCacheCanvas(width, height, null, 'overflow');\n offscreenOverflow = {\n ctx,\n target: c,\n matrix: matrixEvent,\n x: __cache.sx1,\n y: __cache.sy1,\n offsetWidth: node.offsetWidth,\n offsetHeight: node.offsetHeight,\n };\n ctx = c.ctx;\n }\n if(visibility !== 'hidden') {\n Cache.draw(ctx, opacity, matrixEvent, __cache);\n }\n }\n else {\n // 连cache都没生成的超限\n let res = node.render(renderMode, refreshLevel, ctx) || {};\n offscreenBlend = res.offscreenBlend;\n offscreenMask = res.offscreenMask;\n offscreenFilter = res.offscreenFilter;\n offscreenOverflow = res.offscreenOverflow;\n }\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + (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 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) + (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) + (hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_OVERFLOW, offscreenOverflow]);\n ctx = offscreenOverflow.target.ctx;\n }\n if(limitCache && node instanceof Geom) {\n node.render(renderMode, refreshLevel, ctx);\n }\n }\n // 没内容的遮罩跳过,比如未加载的img,否则会将遮罩绘制出来\n else if(hasMask) {\n i += (total || 0) + hasMask;\n }\n // 同无cache一样的离屏应用\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n if(display === 'none') {\n i += (total || 0) + (hasMask || 0);\n }\n }\n }\n }\n}\n\n/**\n * 无缓存模式canvas渲染,O(n)一次循环完成\n * @param renderMode\n * @param ctx\n * @param root\n */\nfunction renderCanvas(renderMode, ctx, root) {\n let { __structs, width, height } = root;\n /**\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 */\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 let {\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_REFRESH_LV]: refreshLevel,\n } = node.__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 let res = node.render(renderMode, refreshLevel, ctx);\n let { offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow } = res || {};\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + (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) + (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) + (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才有值,以及svg的virtualDom也要生成\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + (hasMask || 0);\n }\n }\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 util.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 util.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);\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, 0, gl, true);\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 // 不变是同级兄弟,无需特殊处理\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 // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n util.assignMatrix(m, 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 util.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 let __cacheFilter = __config[NODE_CACHE_FILTER];\n if(__cacheFilter) {\n __cacheFilter.release();\n }\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, true);\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 } = __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(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 }\n else {\n mergeList.push([i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective]);\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 mergeList.forEach(item => {\n let [i, , total, node, __config, limitCache, hasMask, filter, overflow] = item;\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, 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 target = genOverflowWebgl(gl, texCache, node, target, width, height);\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\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);\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);\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) + (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的尝试\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) + (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) + (hasMask || 0);\n }\n // 超限的情况,这里是普通单节点超限,没有合成total后再合成特殊cache如filter/mask/mbm之类的,\n // 直接按原始位置绘制到离屏canvas,再作为纹理绘制即可,特殊的在total那做过降级了\n else if(limitCache && display !== 'none' && visibility !== 'hidden') {\n // let m = mx.m2Mat4(matrixEvent, cx, cy);\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(renderMode, refreshLevel, gl);\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 }\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\nexport default {\n renderCacheCanvas,\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[0] !== page || page.update) {\n // page可能为一个已有纹理,或者贴图\n if(page instanceof MockPage) {\n webgl.bindTexture(gl, page.texture, i);\n channels[i] = page;\n }\n else {\n // 可能老的先删除\n if(last) {\n gl.deleteTexture(last.texture);\n }\n page.texture = webgl.createTexture(gl, page.canvas, i);\n channels[i] = page;\n }\n hash[page.uuid] = i;\n }\n else {\n hash[page.uuid] = i;\n }\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\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 mode from './mode';\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 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 += `>`;\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 this.cache = !!this.props.cache;\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 css = window.getComputedStyle(dom, null);\n if(!this.width) {\n this.__width = parseFloat(css.getPropertyValue('width')) || 0;\n dom.setAttribute('width', this.width);\n }\n if(!this.height) {\n this.__height = parseFloat(css.getPropertyValue('height')) || 0;\n dom.setAttribute('height', this.height);\n }\n }\n // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d');\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', ca);\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 // 利用list循环代替tree递归快速渲染\n if(this.cache) {\n struct.renderCacheCanvas(renderMode, ctx, this);\n }\n else {\n struct.renderCanvas(renderMode, ctx, this);\n }\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 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 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, this, this.__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 let hasUpdate;\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 });\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, null, 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 });\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, null, 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], null, 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()计算自己,因为放在每次checkRoot()做过了\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 '../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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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.length >= 2) {\n num++;\n }\n if(controlB.length >= 2) {\n num += 2;\n }\n return num;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getNewPoint(x1, y1, x2, y2, controlA, controlB, num, start = 0, end = 1) {\n if(start > 0 || end < 1) {\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 = Math.abs(x1 - x2);\n let b = Math.abs(y1 - y2);\n x1 += a * start;\n y1 += b * start;\n x2 -= a * (1 - end);\n y2 -= b * (1 - end);\n }\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 => limitStartEnd(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 = limitStartEnd(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 limitStartEnd(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 = limitStartEnd(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 = limitStartEnd(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 = limitStartEnd(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) {\n let res = super.render(renderMode, lv, ctx, cache);\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 },\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += 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 - ox);\n bbox[0] = Math.min(bbox[0], xb - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[1] = Math.min(bbox[1], yb - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[2] = Math.max(bbox[2], xb + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n bbox[3] = Math.max(bbox[3], yb + oy);\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] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\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] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\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] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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 limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\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 let i = 0, j = list.length - 1;\n if(start > 0) {\n i = getIndex(len.increase, start * len.total, i, j);\n }\n if(end < 1) {\n j = getIndex(len.increase, end * len.total, i, j);\n }\n list = util.clone(list);\n end *= len.total;\n let prePercent = 1;\n if(end > 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 = end - len.increase[j];\n let t = diff / l;\n prePercent = t;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[j + 1] = [current[1] - (1 - t) * a, current[1] - (1 - t) * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], res[3][0], res[3][1]];\n }\n }\n start *= len.total;\n if(start > len.increase[i]) {\n let prev = list[i].slice(list[i].length - 2);\n let current = list[i + 1];\n let l = len.list[i];\n // 同一条线段时如果有end裁剪,会影响start长度\n if(i === j && prePercent !== 1) {\n l *= prePercent;\n }\n let diff = start - len.increase[i];\n let t = diff / l;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[i] = [prev[0] + t * a, prev[1] + t * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([[current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([[current[4], current[5]], [current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], current[4], current[5]];\n }\n }\n if(j < list.length - 2) {\n list = list.slice(0, j + 2);\n }\n if(i > 0) {\n list = list.slice(i);\n }\n return list;\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 => limitStartEnd(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 = limitStartEnd(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 limitStartEnd(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 v = limitStartEnd(v);\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 = limitStartEnd(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 = limitStartEnd(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 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 // points/controls有变化就需要重建顶点\n if(rebuild) {\n let { points, controls } = __cacheProps;\n if(isMulti) {\n __cacheProps.list2 = points.filter(item => Array.isArray(item)).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.filter(item => Array.isArray(item)).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 }\n return rebuild || rebuildSE;\n }\n\n render(renderMode, lv, ctx, cache) {\n let res = super.render(renderMode, lv, ctx, cache);\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 },\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += 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].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] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\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] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\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';\n\nclass Polygon extends Polyline {\n constructor(tagName, props) {\n super(tagName, props);\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\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} } = enums;\nconst { isNil } = util;\nconst { sectorPoints } = geom;\nconst { REM, VW, VH } = 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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 }\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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 }\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n bbox[0] = Math.min(bbox[0], originX - ox);\n bbox[1] = Math.min(bbox[1], originY - oy);\n bbox[2] = Math.max(bbox[2], originX + width + ox);\n bbox[3] = Math.max(bbox[3], originY + height + oy);\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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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));\n }\n else {\n __cacheProps.r = r * width * 0.5;\n __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache) {\n let res = super.render(renderMode, lv, ctx, cache);\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 }\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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 }\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - rx - ox;\n let xb = cx + rx + ox;\n let ya = cy - ry - oy;\n let yb = cy + ry + oy;\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 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 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 let animationRecord;\n if(animate) {\n if(Array.isArray(animate)) {\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 }\n });\n if(has) {\n animationRecord = {\n animate,\n target: vd,\n };\n }\n }\n else {\n (opt.abbr !== false) && abbr2full(animate, abbrAnimate);\n let { value, options } = animate;\n if(Array.isArray(value) && value.length) {\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n animationRecord = {\n animate,\n target: vd,\n };\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n }\n }\n // 产生实际动画运行才存入列表供root调用执行\n if(animationRecord) {\n animateRecords.push(animationRecord);\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 json = util.clone(json);\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(url);\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';\n\nexport default {\n css,\n reset,\n unit,\n font,\n abbr,\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 './node/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 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","STRUCT_KEY","STRUCT_NODE","STRUCT_INDEX","STRUCT_CHILD_INDEX","STRUCT_LV","STRUCT_NUM","STRUCT_TOTAL","STRUCT_HAS_MASK","enums","Node","__x","__y","__ox","__oy","__width","__height","__baseLine","__config","i","lv","j","root","struct","diff","isLayout","__sx","__sy","x","ox","y","oy","__prev","__next","__parent","__domParent","__root","__host","__hostRoot","__virtualDom","CANVAS","SVG","WEBGL","o","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","REM","EM","VW","VH","calUnit","v","n","parseFloat","test","info","arial","lhr","blr","lgr","padding","f","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","_","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","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","getLinear","coords","l1","l2","l3","l4","r1","getRadial","scx","scy","getConic","calConicRadius","renderConic","isInline","border","offscreen","imgData","putImageData","save","clip","drawImage","restore","add","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","isHost","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","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","tar","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","__enabled","setTransform","globalAlpha","update","__available","clear","del","ceil","getInstance","blur","isClip","cacheMask","tf","cacheOverflow","cacheFilter","drawCache","globalCompositeOperation","xe","ye","rect","old","newCache","nx","ny","dbx2","dby2","ENUM","NONE","TRANSFORM_ALL","REFLOW","REBUILD","TRANSFORMS","contain","value","getLevel","isReflow","isRebuild","Text","__textBoxes","__charWidthList","__charWidth","__textWidth","charWidthList","ffs","__ff","__key","wait","needMeasure","bp","__bp","pff","pffs","pfs","pfw","pKey","__pKey","parentCache","mw","__cache","lx","lineBoxManager","endSpace","lineClampCount","__sx1","__sy1","isDestroyed","textBoxes","beginSpace","maxW","needReduce","lastChar","ew","lineCount","isTextOverflow","__lineBack","textBox","addItem","cw","hasCache","needBack","setNewLine","__ellipsis","lineBox","tb","__offsetX","__offsetY","textWidth","__layout","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","event","fns","fn","REGISTER","setUpdateFlag","cp","__hasUpdate","__ref","__isMounted","__taskList","__nextState","addRefreshCp","builder","__cd","listener","__shadow","shadow","__shadowRoot","componentDidMount","REFRESH","__isDestroyed","componentWillUnmount","__destroy","force","__emitEvent","__state","hasRegister","defineProperty","get","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","copy","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","B","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","I_NODE_CONFIG","I_ROOT_CONFIG","I_STYLE","I_ASSIGNING","__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","u","calFrame","ts","binarySearch","frame","middle","ea","steps","stepsD","calIntermediateStyle","transition","st2","calIncrease","o2","n2","gotoOverload","I_IN_FPS","I_IS_DELAY","I_BEGIN","I_END","I_FINISHED","I_NEXT_END","I_FIRST_PLAY","I_FRAME_CB","I_PLAY_CB","I_TARGET","I_ROOT","I_FRAMES","I_FRAMES_R","I_CURRENT_TIME","I_NEXT_TIME","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_CAL_DIFF_TIME","I_FIRST_ENTER","I_STAY_BEGIN","I_STAY_END","I_IS2","I_END_TIME","I_OUT_BEGIN_DELAY","I_TIME_STAMP","Animation","__id","nl","__options","op","config","__frameCb","__calDiffTime","iterations","framesR","originStyle","fps","spfLimit","delay","endDelay","playbackRate","current","isFinish","__cancelTask","__currentProps","__currentStyle","isDelay","FRAME","PLAY","playState","__hasFin","__hasCancel","playCount","currentFrames","stayBegin","stayEnd","is2","endTime","currentTime","currentFrame","round","isAlternate","alternate","isEven","isLastCount","frameTime","isLastFrame","inEndDelay","needClean","__clean","BEGIN","END","FINISH","silence","pending","PAUSE","play","CANCEL","__goto","isFrame","excludeDelay","finish","currentProps","spf","animateController","remove","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","mbm","TF","TX","TY","TZ","getFirstEmptyInlineWidth","flowChildren","child","getLastEmptyInlineWidth","__computedStyle","__listener","__loadBgi","__cacheDefs","__isClip","__isMask","__contentBoxList","__hasMask","__mpWidth","mp","__clientWidth","__clientHeight","__offsetWidth","__offsetHeight","__outerWidth","__outerHeight","onlyFixedValue","isDirectionRow","isDirectItem","__calMp","isVirtual","fromAbs","isShadowRoot","clearCache","__layoutData","__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","offsetWidth","offsetHeight","matrixCache","isScale","clientHeight","x5","x6","y5","y6","__calFilter","bg","bgI","item2","kw","rebuild","__hasContent","isRealInline","sx4","sx5","sx6","sy4","sy5","sy6","hasContent","__calContent","__calPerspective","__calMatrix","__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","hostRoot","pJson","zChildren","zIndexChildren","__spreadBbox","LineBox","__list","__lineHeight","LineBoxManager","__lastX","__lastY","__maxX","__domList","__domStack","__isNewLine","__isEnd","__setLB","nextNewLine","genLineBox","verticalAlign","isNewLine","TAG_NAME","INLINE","BOLD","offsetAndResizeByNodeOnY","reflowHash","inDirectAbsList","isContainer","cs","__layoutAbs","isAbs","__resizeY","clearUniqueReflowId","__uniqueReflowId","getMergeMarginTB","topList","bottomList","genZIndexChildren","hasMc","mcHash","lastMaskIndex","__iIndex","__zIndex","__aIndex","sort","genOrderChildren","__order","block","inlineBlock","none","tag","__flexLine","__zIndexChildren","__structure","nss","__structs","structs","needSort","__tryLayInline","firstCharWidth","main","isRow","__calMinMax","min2","max2","countMin","countMax","setNotEnd","__addMp","isFixed","isContent","fixedSize","__lineBoxManager","__preLayout","__ioSize","mergeMarginBottomList","mergeMarginTopList","isXom","isInlineBlock","isImg","reflow","__isIbFull","lastX","lastY","isNone","isEmptyBlock","tw","th","horizonAlign","__inlineSize","domList","__marginAuto","growList","shrinkList","basisList","maxList","minList","orderChildren","__calBasis","containerSize","isMultiLine","line","hypotheticalList","hypothetical","maxCrossList","__layoutFlexLine","maxCross","crossSum","crossSumList","between","around","__crossAlign","flexLine","hypotheticalSum","targetMainList","factorSum","factorList","needReset","factorSum2","lbmList","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","needCalWidth","wl","hl","__computeMeasure","__deepScan","loadImg","__loadImg","placeholder","loading","__loadAndRefresh","showError","pts","arc","__addGeom","reload","Defs","cacheHash","__isMulti","multi","__cacheProps","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","MockPage","genUuid","MockCache","OP","FT","MBM","PPT","OFFSCREEN_OVERFLOW","OFFSCREEN_FILTER","OFFSCREEN_MASK","OFFSCREEN_BLEND","OFFSCREEN_MASK2","getCache","genBboxTotal","parentIndexHash","opacityHash","includeLimitCache","bboxTotal","matrixHash","parentIndex","node2","hasTotal","mergeBbox","genTotal","cacheTop","hasMask","genFilter","genMask","genOverflow","sbox","genFrameBufferWithTexture","lockOneChannel","webgl","createFramebuffer","bindFramebuffer","checkFramebufferStatus","FRAMEBUFFER_COMPLETE","viewport","clearColor","COLOR_BUFFER_BIT","genTotalWebgl","getParameter","MAX_TEXTURE_SIZE","parentPm","totalLimitCache","addTexAndDrawWhenLimit","mockCache","refresh","releaseLockChannel","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","applyOffscreen","origin","renderCacheCanvas","matrixList","parentMatrix","opacityList","parentOpacity","lastConfig","lastLv","mergeList","refreshLevel","hasRecordAsMask","needGen","maskStartHash","offscreenHash","renderCanvas","renderSvg","maskEffectHash","defsCache","hasEffectMask","addCache","maskHash","vdList","parentVd","mChildren","ivs","hasTransform","renderWebgl","pmList","lastRefreshLevel","hasMbm","validMbm","isPerspective","limitHash","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","getPropertyValue","__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","__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","limitStartEnd","getNewPoint","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","__start","__end","buildCache","curve","bezierBox","concatPointAndControl","control","getLength","increase","getIndex","getNewList","prePercent","Polyline","__points","__controls","controls","isControl","rebuildSE","__getPoints","__renderPolygon","pointList","controlList","Polygon","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","replaceLibraryVars","linkLibrary","JSON","linkChild","libraryItem","library","libraryId","parse","animateRecords","opt","createGm","createCp","createVd","animationRecord","fonts","loadAndParse","components","imgs","list1","list3","callback","version","appendTo","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A,KAAK,EAALA,KAzEU;EA0EVjuB,EAAAA,IAAI,EAAJA,IA1EU;EA2EV0L,EAAAA,MAAM,EAANA,MA3EU;EA4EV3X,EAAAA,KAAK,EAALA,KA5EU;EA6EV8/D,EAAAA,MAAM,EAANA,GA7EU;EA8EVxX,EAAAA,OAAO,EAAPA,OA9EU;EA+EVj5B,EAAAA,IAAI,EAAJA,IA/EU;EAgFVkM,EAAAA,OAAO,EAAPA,OAhFU;EAiFVq8B,EAAAA,OAAO,EAAPA,OAjFU;EAkFVhM,EAAAA,OAAO,EAAPA,OAlFU;EAmFV9gE,EAAAA,KAAK,EAALA,KAnFU;;EAoFV,MAAI0rB,KAAJ,CAAU1oB,CAAV,EAAa;EACX0oB,IAAAA,KAAK,CAACrI,IAAN,GAAa,CAAC,CAACrgB,CAAf;EACD;;EAtFS,CAAZ;EAyFAytC,OAAO,CAACvB,GAAR,CAAY;EACVvB,EAAAA,GAAG,EAAHA,KADU;EAEVC,EAAAA,GAAG,EAAHA,KAFU;EAGVC,EAAAA,GAAG,EAAHA,KAHU;EAIVC,EAAAA,IAAI,EAAJA,MAJU;EAKVC,EAAAA,SAAS,EAATA;EALU,CAAZ;;EAQA,IAAG,OAAO/f,MAAP,KAAkB,WAArB,EAAkC;EAChCA,EAAAA,MAAM,CAACo/C,KAAP,GAAeA,OAAf;EACD,CAFD,MAGK,IAAG,OAAO38C,IAAP,KAAgB,WAAnB,EAAgC;EACnCA,EAAAA,IAAI,CAAC28C,KAAL,GAAaA,OAAb;EACD;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["src/util/enums.js","src/node/Node.js","src/node/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/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/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};\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\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};\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.__width = 0;\n this.__height = 0;\n this.__baseLine = 0;\n this.__config = {};\n // 默认undefined\n // this.__prev = undefined;\n // this.__next = undefined;\n // this.__parent = undefined;\n // this.__domParent = undefined;\n // this.__root = undefined;\n // this.__host = undefined;\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\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 /**\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 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 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 = 67, 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;\n\nexport default o;\n","export default {\n position: /(([-+]?[\\d.]+[pxremvwh%]*)|(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];\n let a1 = a[i + 4];\n let a2 = a[i + 8];\n let a3 = a[i + 12];\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) {\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 = 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 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 = 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 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') {\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 '../node/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 } = 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(['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 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 = { _: 1 };\nconst TYPE_GM = { _: 2 };\nconst TYPE_CP = { _: 3 };\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 s += joinDef(item);\n });\n s += '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\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 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 += '';\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 += '>';\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(/`;\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(location.hostname !== host[1]) {\n img.crossOrigin = 'anonymous';\n }\n }\n }\n img.src = url;\n if(debug.flag) {\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') {\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(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.loadFont(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 font invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\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 let f = new FontFace(url, `url(${url})`);\n f.load().then(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 }).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 '../node/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, 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 {\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 {\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 {\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, d = 0;\n // 扩展的from to ratio格式,圆心、长轴坐标、短轴缩放比\n if(Array.isArray(size)) {\n cx = x1 + size[0] * iw;\n cy = y1 + size[1] * ih;\n if(size[4] <= 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[4];\n r = Math.max(xl, yl);\n // 看旋转\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 else {\n // 默认椭圆a是水平轴,b是垂直轴\n [cx, cy] = calCircleCentre(position, x1, y1, iw, ih, root);\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, 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.]+))?/.exec(gradient[2]);\n if(points) {\n o.z = [parseFloat(points[1]), parseFloat(points[2]), parseFloat(points[3]), parseFloat(points[4])];\n if(!isNil(points[5])) {\n o.z.push(parseFloat(points[5]));\n }\n else {\n o.z.push(1);\n }\n }\n else {\n o.z = 'farthest-corner';\n }\n }\n let position = /at\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?: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.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?: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.]+[pxremvwh%]+)?\\s*((#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))\\s*([-+]?[\\d.]+[pxremvwh%]+)?/ig) || [];\n o.v = v.map(item => {\n let color = /((?:#[0-9a-f]{3,8})|(?:rgba?\\s*\\(.+?\\)))/i.exec(item);\n let arr = [rgba2int(color[1])];\n let percent = /[-+]?[\\d.]+[pxremvwh%]+/.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) {\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, 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 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: '#000',\n borderRightColor: '#000',\n borderBottomColor: '#000',\n borderLeftColor: '#000',\n borderTopStyle: 'solid',\n borderRightStyle: 'solid',\n borderBottomStyle: 'solid',\n borderLeftStyle: 'solid',\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.]+[pxremvwh%]*)|(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.]+[pxremvwh%]*\\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)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]);\n }\n else if(/^[\\d.]+\\s+[\\d.]+\\s+[\\d.]+[pxremvwh%]*/.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.]+[pxremvwh%]+/.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.]+[pxremvwh%]+/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.]+[pxremvwh%]*)/.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};\n\no.isIgnore = function(k) {\n return IGNORE.hasOwnProperty(k);\n};\nfunction isGeom(tagName, k) {\n return GEOM.hasOwnProperty(k) && GEOM[k].hasOwnProperty(tagName);\n}\no.isGeom = isGeom;\no.isRepaint = function(k) {\n return REPAINT.hasOwnProperty(k) || isGeom(k);\n};\no.isMeasure = function(k) {\n return MEASURE.hasOwnProperty(k);\n};\no.isValid = function(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\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']);\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, 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 // 扩展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(!isNil(v) && 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) {\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(!isNil(temp)) {\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) {\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.]+[pxremvwh%]*)|(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(!isNil(v)) {\n res[STYLE_KEY[style2Upper(k)]] = [rgba2int(v), 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(!isNil(v)) {\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) {\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]);\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(!isNil(temp)) {\n let arr = calUnit(temp);\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(!isNil(temp)) {\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(isNil(v)) {\n return;\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) {\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]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n res[ROTATE_3D] = arr;\n }\n }\n temp = style.opacity;\n if(!isNil(temp)) {\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(!isNil(temp)) {\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(isNil(v)) {\n return;\n }\n if(v === 'auto') {\n v = [0, AUTO];\n }\n else {\n v = calUnit(v);\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(!isNil(temp)) {\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(!isNil(temp)) {\n res[ORDER] = parseInt(temp) || 0;\n }\n temp = style.color;\n if(!isNil(temp)) {\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(!isNil(temp)) {\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 || temp === 0) {\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(!isNil(temp)) {\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(!isNil(temp)) {\n if(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(!isNil(temp)) {\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) {\n if(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) {\n if(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) {\n if(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 === '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) {\n if(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(!isNil(temp)) {\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(!isNil(temp)) {\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') {\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) {\n if(temp === 'inherit') {\n res[VISIBILITY] = [0, INHERIT];\n }\n else {\n res[VISIBILITY] = [temp, STRING];\n }\n }\n temp = style.pointerEvents;\n if(temp) {\n if(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.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*\\s*)?([-+]?[\\d.]+[pxremvwh%]*\\s*)?(((transparent)|(#[0-9a-f]{3,8})|(rgba?\\(.+?\\)))\\s*)?(inset|outset)?\\s*,?/ig);\n if(match) {\n match.forEach(item => {\n let boxShadow = /([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*\\s*)?([-+]?[\\d.]+[pxremvwh%]*\\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(!isNil(temp)) {\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 {\n computedStyle[k] = v[0];\n }\n });\n}\n\n/**\n * 每次布局前需要计算的reflow相关的computedStyle\n * @param node 对象节点\n * @param isHost 是否是根节点或组件节点这种局部根节点,无继承需使用默认值\n */\nfunction computeReflow(node, isHost) {\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 {\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 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] === 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 {\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];\n return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' '\n + fontSize + 'px/' + fontSize + 'px ' + (style[FONT_FAMILY] || 'arial');\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 }\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 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 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\nexport default {\n normalize,\n computeMeasure,\n computeReflow,\n setFontStyle,\n getFontFamily,\n getBaseLine,\n calRelative,\n calAbsolute,\n equalStyle,\n isRelativeOrAbsolute,\n cloneStyle,\n};\n","import mode from './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\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","import matrix from './matrix';\nimport tar from './tar';\nimport geom from './geom';\n\nexport default {\n matrix,\n tar,\n geom,\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 } = 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 }\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 }\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 });\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 DISPLAY,\n VISIBILITY,\n },\n NODE_KEY: {\n NODE_OPACITY,\n NODE_CACHE,\n NODE_CACHE_FILTER,\n NODE_CACHE_OVERFLOW,\n NODE_HAS_CONTENT,\n NODE_COMPUTED_STYLE,\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 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 }\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 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, 'filter1');\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, next, isClip, transform, tfo) {\n let cacheMask = genSingle(target, 'mask1');\n let list = [];\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;\n tfo[1] += y + dby;\n let inverse = tf.calMatrixByOrigin(transform, tfo);\n // 先将mask本身绘制到cache上,再设置模式绘制dom本身,因为都是img所以1个就够了\n list.forEach(item => {\n let __config = item.__config;\n let cacheOverflow = __config[NODE_CACHE_OVERFLOW], cacheFilter = __config[NODE_CACHE_FILTER], cache = __config[NODE_CACHE];\n let source = cacheOverflow && cacheOverflow.available && cacheOverflow;\n if(!source) {\n source = cacheFilter && cacheFilter.available && cacheFilter;\n }\n if(!source) {\n source = cache && cache.available && cache;\n }\n if(source) {\n ctx.globalAlpha = __config[NODE_OPACITY];\n Cache.drawCache(\n source, cacheMask,\n __config[NODE_COMPUTED_STYLE][TRANSFORM],\n mx.identity(),\n __config[NODE_COMPUTED_STYLE][TRANSFORM_ORIGIN].slice(0),\n inverse\n );\n }\n // 没有内容或者img没加载成功导致没有内容,有内容且可见则是超限,不可能进这里\n else if(__config[NODE_HAS_CONTENT]\n && __config[NODE_COMPUTED_STYLE][DISPLAY] !== 'none'\n && __config[NODE_COMPUTED_STYLE][VISIBILITY] !== 'hidden') {\n inject.error('CacheMask is oversize');\n }\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, 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(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\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 './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 } = 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 }\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 // text-overflow:ellipse需要,即便没有也要先测量,其基于最近非inline父节点的字体\n let bp = this.domParent;\n while(bp.currentStyle[DISPLAY] === 'inline') {\n bp = bp.domParent;\n }\n this.__bp = bp;\n let parentComputedStyle = bp.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.__sx1 = x;\n this.__y = this.__sy1 = y;\n let { isDestroyed, content, currentStyle, 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 || currentStyle[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 let lineCount = 0;\n // 不换行特殊对待,同时考虑overflow和textOverflow\n if(whiteSpace === 'nowrap') {\n let isTextOverflow;\n // block的overflow:hidden和textOverflow:clip/ellipsis才生效,inline要看最近非inline父元素\n let bp = this.__bp;\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) {\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.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.__width = maxX - minX;\n }\n\n __calMaxAndMinWidth() {\n let n = 0;\n this.charWidthList.forEach(item => {\n n = Math.max(n, item);\n });\n return { max: this.textWidth, min: n };\n }\n\n __calAbsWidth(x, y, w) {\n this.__layout({\n x,\n y,\n w,\n }, true);\n return this.width;\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 { sx, sy, width, height, root, currentStyle: { [TEXT_STROKE_WIDTH]: textStrokeWidth = [0] } = {} } = this;\n let half = 0;\n if(textStrokeWidth[1] === REM) {\n half = Math.max(textStrokeWidth[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(textStrokeWidth[1] === VW) {\n half = Math.max(textStrokeWidth[0] * root.width * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VH) {\n half = Math.max(textStrokeWidth[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(textStrokeWidth[0] * 0.5, half);\n }\n half += 1;\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 let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\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.__hasUpdate) {\n return;\n }\n cp.__hasUpdate = 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 '../node/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 } = unit;\n\nfunction renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bbrr, bblr, method = 'fill', isInline) {\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);\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] === 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 }\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 let source = loadBgi.source;\n // 无source不绘制,可能错误或加载中\n if(source) {\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} = enums;\nconst { AUTO, PX, PERCENT, INHERIT, RGBA, STRING, NUMBER, REM, VW, VH, 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 }\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 }\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 }\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 }\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 }\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,其余都是特殊固定单位\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') {\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') {\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没有增量\n else {\n if(n === p || k === 'edge' || k === 'closure') {\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 {\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') {\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\nlet uuid = 0;\n\nconst I_ASSIGNING = 0;\nconst I_IN_FPS = 1;\nconst I_IS_DELAY = 2;\nconst I_BEGIN = 3;\nconst I_END = 4;\nconst I_FINISHED = 5;\nconst I_NEXT_END = 6;\nconst I_FIRST_PLAY = 7;\nconst I_FRAME_CB = 8;\nconst I_PLAY_CB = 9;\nconst I_TARGET = 10;\nconst I_ROOT = 11;\nconst I_FRAMES = 12;\nconst I_FRAMES_R = 13;\nconst I_CURRENT_TIME = 14;\nconst I_NEXT_TIME = 15;\nconst I_STYLE = 16;\nconst I_DURATION = 17;\nconst I_ITERATIONS = 18;\nconst I_FILL = 19;\nconst I_PLAYBACK_RATE = 20;\nconst I_PLAY_COUNT = 21;\nconst I_PLAY_STATE = 22;\nconst I_DESTROYED = 23;\nconst I_START_TIME = 24;\nconst I_FPS_TIME = 25;\nconst I_EASING = 26;\nconst I_ENTER_FRAME = 27;\nconst I_DELAY = 28;\nconst I_END_DELAY = 29;\nconst I_KEYS = 30;\nconst I_ORIGIN_STYLE = 31;\nconst I_CURRENT_FRAMES = 32;\nconst I_CURRENT_FRAME = 33;\nconst I_SPF_LIMIT = 34;\nconst I_FPS = 35;\nconst I_DIRECTION = 36;\nconst I_CAL_DIFF_TIME = 37;\nconst I_FIRST_ENTER = 38;\nconst I_STAY_BEGIN = 39;\nconst I_STAY_END = 40;\nconst I_IS2 = 41;\nconst I_END_TIME = 42;\nconst I_NODE_CONFIG = 43;\nconst I_ROOT_CONFIG = 44;\nconst I_OUT_BEGIN_DELAY = 45;\nconst I_TIME_STAMP = 46;\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 this.__frameCb,\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 this.__calDiffTime,\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 __config[I_CURRENT_TIME] = __config[I_DELAY] + __config[I_DURATION] + __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 __frameCb(__config, diff, isDelay) {\n this.emit(Event.FRAME, diff, isDelay);\n if(__config[I_FIRST_PLAY]) {\n __config[I_FIRST_PLAY] = false;\n this.emit(Event.PLAY);\n }\n if(isFunction(__config[I_PLAY_CB])) {\n __config[I_PLAY_CB].call(this, diff, isDelay);\n __config[I_PLAY_CB] = null;\n }\n }\n\n __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\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 = __config[I_PLAY_COUNT];\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] = __config[I_CAL_DIFF_TIME](__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(playCount === 0 && 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 if(playCount === 0) {\n currentTime -= delay;\n }\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 __config[I_NEXT_TIME] -= duration;\n playCount = ++__config[I_PLAY_COUNT];\n __config[I_BEGIN] = true;\n round = true;\n }\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 this.__clean(true);\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 __config[I_FRAME_CB].call(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 __config[I_FRAME_CB].call(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 __config[I_FRAME_CB].call(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 __goto(v, isFrame, excludeDelay) {\n let __config = this.__config;\n let duration = __config[I_DURATION];\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\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 // 超过一轮去掉delay\n if(v > duration + __config[I_DELAY]) {\n v -= __config[I_DELAY];\n }\n // 超过时间长度需要累加次数\n __config[I_PLAY_COUNT] = 0;\n while(v > duration && __config[I_PLAY_COUNT] < __config[I_ITERATIONS] - 1) {\n __config[I_PLAY_COUNT]++;\n v -= duration;\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n __config[I_NEXT_TIME] = v;\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 = __config[I_PLAY_COUNT] % 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 '../node/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) {\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 mode from './mode';\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 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;\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 }\n} = enums;\nconst { AUTO, PX, PERCENT, INHERIT, NUMBER, REM, VW, VH, DEG } = unit;\nconst { int2rgba, rgba2int, joinArr, isNil } = 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 }\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.__mpWidth(currentStyle[a], w);\n computedStyle[b] = this.__mpWidth(currentStyle[b], w);\n });\n }\n\n __mpWidth(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 return 0;\n }\n\n // dom常用的几种尺寸赋值\n __ioSize(w, h) {\n let computedStyle = this.computedStyle;\n this.__clientWidth = w += computedStyle[PADDING_LEFT] + computedStyle[PADDING_RIGHT];\n this.__clientHeight = h += computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM];\n this.__offsetWidth = w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[BORDER_RIGHT_WIDTH];\n this.__offsetHeight = h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH];\n this.__outerWidth = w + computedStyle[MARGIN_LEFT] + computedStyle[MARGIN_RIGHT];\n this.__outerHeight = h + computedStyle[MARGIN_TOP] + computedStyle[MARGIN_BOTTOM];\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 return n;\n }\n\n // 为basis的b/min/max添加mpb,只有当b未显示指定等于w/content时才加,同时返回mpb值\n __addMp(isDirectionRow, w, currentStyle, 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 [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w, !isDirectItem)\n + this.__calMp(marginRight, w, !isDirectItem)\n + this.__calMp(paddingLeft, w, !isDirectItem)\n + this.__calMp(paddingRight, w, !isDirectItem);\n if(borderLeftWidth[1] === PX) {\n mp += borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n mp += borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n mp += borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n mp += borderLeftWidth[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n mp += borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n mp += borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n mp += borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n mp += borderRightWidth[0] * this.root.height * 0.01;\n }\n res = res.map(item => item + mp);\n }\n else {\n let mp = this.__calMp(marginTop, w, !isDirectItem)\n + this.__calMp(marginBottom, w, !isDirectItem)\n + this.__calMp(paddingTop, w, !isDirectItem)\n + this.__calMp(paddingBottom, w, !isDirectItem);\n if(borderTopWidth[1] === PX) {\n mp += borderTopWidth[0];\n }\n else if(borderTopWidth[1] === REM) {\n mp += borderTopWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderTopWidth[1] === VW) {\n mp += borderTopWidth[0] * this.root.width * 0.01;\n }\n else if(borderTopWidth[1] === VH) {\n mp += borderTopWidth[0] * this.root.height * 0.01;\n }\n if(borderBottomWidth[1] === PX) {\n mp += borderBottomWidth[0];\n }\n else if(borderBottomWidth[1] === REM) {\n mp += borderBottomWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderBottomWidth[1] === VW) {\n mp += borderBottomWidth[0] * this.root.width * 0.01;\n }\n else if(borderBottomWidth[1] === VH) {\n mp += borderBottomWidth[0] * this.root.height * 0.01;\n }\n res = res.map(item => item + mp);\n }\n return res;\n }\n\n // absolute且无尺寸时,isVirtual标明先假布局一次计算尺寸,还有flex列计算时\n // fromAbs为absolute节点特有省略计算标识,本节点是abs时真正布局传入\n __layout(data, isVirtual, fromAbs) {\n css.computeReflow(this, this.isShadowRoot);\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.clearCache();\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 __config[NODE_REFRESH_LV] = REFLOW;\n __config[NODE_LIMIT_CACHE] = false;\n __config[NODE_IS_INLINE] = false;\n // 防止display:none不统计mask,isVirtual忽略,abs布局后续会真正来走一遍\n if(!isVirtual) {\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 return;\n }\n // margin/padding在abs前已经计算过了,无需二次计算\n if(!fromAbs) {\n this.__mp(currentStyle, computedStyle, w);\n }\n // inline的width/height无效,其它有效\n if(width[1] !== AUTO) {\n if(this.__isRealInline() && currentStyle[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 }\n }\n }\n let lineClampCount = 0;\n // 4种布局,默认block,inlineBlock基本可以复用inline逻辑,除了尺寸\n if(display === 'flex') {\n this.__layoutFlex(data, isVirtual);\n }\n else if(display === 'inlineBlock' || display === 'inline-block') {\n lineClampCount = this.__layoutInline(data, isVirtual);\n }\n else if(display === 'inline') {\n lineClampCount = this.__layoutInline(data, isVirtual, true);\n }\n else {\n this.__layoutBlock(data, isVirtual);\n }\n // relative渲染时做偏移,百分比基于父元素,若父元素没有定高则为0\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布局的不执行,在__layoutAbs末尾做,防止未布局没有尺寸从而动画计算错误\n if(!fromAbs) {\n this.__execAr();\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[PADDING_TOP]\n = computedStyle[PADDING_RIGHT]\n = computedStyle[PADDING_BOTTOM]\n = computedStyle[PADDING_LEFT]\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 }\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 }\n }\n // margin/padding/border影响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已知目标主尺寸,需减去mpb,其一定是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.tagName === 'img') && 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 {\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 {\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 {\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 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] === 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] === 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 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 {\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 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 {\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 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 * @param lv\n * @param ctx canvas/svg/webgl共用\n * @param cache 是否开启缓存\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 * offscreenMask 无cache时的离屏canvas,仅canvas\n * offscreenOverflow 无cache时的离屏canvas,仅canvas\n */\n render(renderMode, lv, ctx, cache) {\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 this.__bbox = null;\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);\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);\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 + dx, iy1 + dy, ix2 - ix1, iy2 - iy1, btlr, [0, 0], [0, 0], bblr);\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);\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 + dx, iy1 + dy, ix2 - ix1, iy2 - iy1, isFirst ? btlr : [0, 0], btrr, bbrr, isFirst ? bblr : [0, 0]);\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);\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);\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);\n }\n }\n else if(bgi.k) {\n let gd = this.__gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi);\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);\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);\n });\n }\n // 边框需考虑尖角,两条相交边平分45°夹角\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_TOP], __cacheStyle[BORDER_TOP_COLOR]);\n }\n if(borderRightWidth > 0 && borderRightColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_RIGHT], __cacheStyle[BORDER_RIGHT_COLOR]);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_BOTTOM], __cacheStyle[BORDER_BOTTOM_COLOR]);\n }\n if(borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_LEFT], __cacheStyle[BORDER_LEFT_COLOR]);\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.delRefreshTask(this.__loadBgi.cb);\n 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' && util.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(util.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) {\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);\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);\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);\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.cx, gd.cy, 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.cx],\n ['cy', gd.cy],\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 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(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, formatStyle);\n if(util.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(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, style);\n if(util.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(util.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(util.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.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) {\n let ox = 0, oy = 0;\n if(Array.isArray(boxShadow)) {\n boxShadow.forEach(item => {\n let [x, y, sigma, spread, , inset] = item;\n if(inset !== 'inset') {\n let d = blur.outerSize(sigma);\n d += spread;\n ox = Math.max(ox, x + d);\n oy = Math.max(oy, y + d);\n }\n });\n }\n return [ox, oy];\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() {\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent } = this;\n let p1 = point2d(mx.calPoint([__sx1, __sy1], matrixEvent));\n let p2 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1], matrixEvent));\n let p3 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1 + offsetHeight], matrixEvent));\n let p4 = point2d(mx.calPoint([__sx1, __sy1 + offsetHeight], 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(util.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(util.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] = level.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(util.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, clientWidth, clientHeight,\n currentStyle: {\n [BORDER_TOP_WIDTH]: borderTopWidth = [0],\n [BORDER_RIGHT_WIDTH]: borderRightWidth = [0],\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth = [0],\n [BORDER_LEFT_WIDTH]: borderLeftWidth = [0],\n [BOX_SHADOW]: boxShadow = [],\n } = {},\n } = this;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n clientWidth += borderLeftWidth[0] + borderRightWidth[0];\n clientHeight += borderTopWidth[0] + borderBottomWidth[0];\n let half = 1;\n this.__bbox = [__sx1 - ox - half, __sy1 - oy - half, __sx1 + clientWidth + ox + half, __sy1 + clientHeight + oy + half];\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\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 n = this.baseLine;\n // 只有1个也需要对齐,因为可能内嵌了空inline使得baseLine发生变化\n if(this.list.length) {\n this.list.forEach(item => {\n let m = item.baseLine;\n if(m !== n) {\n item.__offsetY(n - m);\n }\n });\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\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 = 0;\n this.list.forEach(item => {\n baseLine = Math.max(baseLine, item.baseLine);\n });\n return Math.max(this.__baseLine, baseLine);\n }\n\n get lineHeight() {\n let lineHeight = 0;\n // 只有TextBox和InlineBlock\n this.list.forEach(item => {\n lineHeight = Math.max(lineHeight, item.outerHeight);\n });\n return Math.max(this.__lineHeight, 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 }\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 verticalAlign() {\n this.list.forEach(lineBox => {\n lineBox.verticalAlign();\n });\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\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.currentStyle[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, null, 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 mode from './mode';\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 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 // PERSPECTIVE,\n // TRANSFORM,\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 } = unit;\nconst { calAbsolute, isRelativeOrAbsolute } = css;\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 = util.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 {\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 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 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 }\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 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 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 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 // item的递归子节点求min/max,只考虑固定值单位,忽略百分比,同时按方向和display\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this, this.isShadowRoot);\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h, lineBoxManager } = data;\n // 计算需考虑style的属性\n let {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n else {\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\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 = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\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 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 });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n else if(display === 'block') {\n let countMin = 0, countMax = 0;\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\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 if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n else {\n if(display === 'inlineBlock' || display === 'inline-block') {\n lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n }\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n if(isDirectionRow) {\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 min += item.charWidth;\n max += item.textWidth;\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n });\n }\n }\n return [display, this.__addMp(isDirectionRow, w, currentStyle, [min, max])];\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时isVirtual状态参与计算,文本抵达边界才进行换行\n * @param isDirectionRow\n * @param data\n * @param isVirtual abs非固定尺寸时先进行虚拟布局标识\n * @private\n */\n __calBasis(isDirectionRow, data, isVirtual) {\n css.computeReflow(this, this.isShadowRoot);\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 [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n [FLEX_BASIS]: flexBasis,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\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].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 }\n // 已声明主轴尺寸的,当basis是auto时为值\n else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1) && isAuto) {\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 }\n // 非固定尺寸的basis为auto时降级为content\n else if(isAuto) {\n isContent = true;\n }\n // flex的item还是flex时\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\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 = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\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 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 });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n // flex的item是block/inline时,inline也会变成block统一对待\n else {\n let countMin = 0, countMax = 0;\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\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 if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n if(fixedSize) {\n max = Math.max(fixedSize, max);\n }\n if(isContent) {\n b = max;\n }\n // 直接item的mpb影响basis\n return this.__addMp(isDirectionRow, w, currentStyle, [b, min, max], true);\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 isVirtual abs无尺寸时提前虚拟布局计算尺寸\n * @private\n */\n __layoutBlock(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\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 isImg = item.tagName === 'img';\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 }, isVirtual);\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 || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // abs统计宽度\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.outerWidth;\n maxW = Math.max(maxW, cw);\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 }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock || isImg) && 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 }, isVirtual);\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 || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n if(isVirtual) {\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 }, isVirtual);\n let isNone = item.currentStyle[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(isVirtual) {\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 }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.width;\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 }, isVirtual);\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 }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, item.width);\n cw = 0;\n }\n }\n if(isVirtual) {\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 || !isVirtual) ? w : maxW;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // 非abs提前的虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐\n if(!isVirtual) {\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 // 所有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, isVirtual) {\n let { flowChildren, currentStyle, computedStyle, __flexLine } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\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 maxX = 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 // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n // abs虚拟布局计算时纵向也是看横向宽度\n let [b, min, max] = item.__calBasis(isVirtual ? true : isDirectionRow, { x, y, w, h }, isVirtual);\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += max;\n }\n else {\n maxX = Math.max(maxX, max);\n }\n return;\n }\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 if(isVirtual) {\n if(isDirectionRow) {\n maxX += item.textWidth;\n }\n else {\n maxX = Math.max(maxX, item.textWidth);\n }\n return;\n }\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 });\n let h = item.height;\n basisList.push(h);\n minList.push(h);\n }\n }\n });\n // abs时,只需关注宽度即可,无需真正布局\n if(isVirtual) {\n let tw = this.__width = Math.min(maxX, w);\n this.__ioSize(tw, this.height);\n return;\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, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, 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 let tw = this.__width = w;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\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(!isVirtual && 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(!isVirtual) {\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 }\n this.__marginAuto(currentStyle, data);\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, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, 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 });\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h: main,\n h3: main, // 同w2\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 });\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(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(['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 isVirtual\n * @param isInline\n * @private\n */\n __layoutInline(data, isVirtual, 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(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\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 }, isVirtual);\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 }, isVirtual);\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 }, isVirtual);\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 }, isVirtual);\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 }, isVirtual);\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 }, isVirtual);\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(isVirtual) {\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(!isVirtual && !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(currentStyle[DISPLAY] === 'none') {\n item.__layoutNone();\n return;\n }\n // 先根据容器宽度计算margin/padding\n item.__mp(currentStyle, computedStyle, clientWidth);\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let { [LEFT]: left, [TOP]: top, [RIGHT]: right,\n [BOTTOM]: bottom, [WIDTH]: width, [HEIGHT]: height, [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection } = 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 = x + clientWidth - computedStyle[RIGHT] - x2;\n }\n else if(fixedLeft) {\n x2 = x + computedStyle[LEFT];\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n }\n else if(fixedRight) {\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\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 -= currentStyle[BORDER_LEFT_WIDTH][0];\n x2 -= currentStyle[BORDER_RIGHT_WIDTH][0];\n }\n else {\n x2 = x + paddingLeft;\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n }\n // top/bottom/height优先级同上\n if(fixedTop && fixedBottom) {\n y2 = y + computedStyle[TOP];\n h2 = y + clientHeight - computedStyle[BOTTOM] - y2;\n }\n else if(fixedTop) {\n y2 = y + computedStyle[TOP];\n if(height[1] !== AUTO) {\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else {\n h2 = height[0];\n }\n }\n }\n else if(fixedBottom) {\n if(height[1] !== AUTO) {\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else {\n h2 = height[0];\n }\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 -= currentStyle[BORDER_TOP_WIDTH][0];\n y2 -= currentStyle[BORDER_BOTTOM_WIDTH][0];\n }\n // 未声明y的找到之前的流布局child,紧随其下\n else {\n y2 = y + paddingTop;\n let prev = item.prev;\n while(prev) {\n // 目前不考虑margin合并,直接以前面的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] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else if(height[1] === PX) {\n h2 = height[0];\n }\n }\n // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局\n let needCalWidth;\n if((display === 'block' || ['inlineBlock', 'inline-block'].indexOf(display) > -1) && w2 === undefined) {\n needCalWidth = true;\n }\n else if(display === 'flex') {\n if(w2 === undefined) {\n needCalWidth = true;\n }\n else if(flexDirection === 'column' && h2 === undefined) {\n needCalWidth = true;\n }\n }\n // onlyRight时做的布局其实是以那个点位为left/top布局然后offset,limit要特殊计算,从本点向左侧为边界\n let wl = onlyRight ? x2 - x : clientWidth + x - x2;\n // onlyBottom相同,正常情况是左上到右下的尺寸限制\n let hl = onlyBottom ? y2 - y : clientHeight + y - y2;\n // 未直接或间接定义尺寸,取孩子宽度最大值\n if(needCalWidth) {\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n }, true, true);\n wl = item.outerWidth;\n }\n // needCalWidth传入,因为自适应尺寸上面已经计算过一次margin/padding了\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n w2, // left+right这种等于有宽度,但不能修改style,继续传入到__preLayout中特殊对待\n h2,\n }, false, true);\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 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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(util.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(!util.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(util.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(!util.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(util.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(!util.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(util.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(!util.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(util.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(util.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 './mode';\nimport painter from '../util/painter';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport unit from '../style/unit';\nimport image from '../style/image';\nimport border from '../style/border';\nimport enums from '../util/enums';\nimport level from '../refresh/level';\nimport mx from '../math/matrix';\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_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\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, RGBA } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { isFunction } = util;\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 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的方法,在__layout3个分支中会首先被调用\n * 当样式中固定宽高时,图片按样式尺寸,加载后重新绘制即可\n * 只固定宽高一个时,加载完要计算缩放比,重新布局绘制\n * 都没有固定,按照图片尺寸,重新布局绘制\n * 这里计算非固定的情况,将其改为固定供布局渲染使用,未加载完成为0\n * @param data\n * @returns {{fixedWidth: boolean, w: *, x: *, h: *, y: *, fixedHeight: boolean}}\n * @private\n */\n __preLayout(data) {\n let res = super.__preLayout(data);\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) {\n let res = super.render(renderMode, lv, ctx, cache);\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;\n originY = res.y3;\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 ctx.arc(cx, cy, r, 0, 2 * Math.PI);\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);\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 {\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 {\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 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 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 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 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 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 return w;\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle, __loadImg } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\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 [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\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].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 }\n else if(([PX, PERCENT, REM, VW, VH].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 }\n // auto和content固定尺寸比例计算\n else if(__loadImg.source || __loadImg.error) {\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 let ratio = __loadImg.width / __loadImg.height;\n b = max = min = isDirectionRow ? cross * ratio : cross / ratio;\n }\n else {\n b = max = min = isDirectionRow ? __loadImg.width : __loadImg.height;\n }\n }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\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 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 '../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 DISPLAY,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n WIDTH,\n HEIGHT,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_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 }\n} = enums;\nconst { PX, PERCENT, REM, VW, VH } = unit;\nconst { int2rgba, isNil, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\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 // 减去水平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 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 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 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 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 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 return w;\n }\n\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this, this.isShadowRoot);\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n // 计算需考虑style的属性\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n [DISPLAY]: display,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n return [display, this.__addMp(isDirectionRow, data.w, currentStyle, [min, max])];\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\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 [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH].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 }\n else if(([PX, PERCENT, REM, VW, VH].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 }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\n }\n\n __layoutBlock(data, isVirtual) {\n let { fixedWidth, fixedHeight, w, h } = this.__preLayout(data);\n this.__height = fixedHeight ? h : 0;\n if(isVirtual) {\n this.__width = fixedWidth ? w : 0;\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) {\n // 无children所以等同于block\n this.__layoutBlock(data);\n }\n\n __layoutInline(data) {\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\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 {\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 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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() {}\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更新时,从叶子到根链路会标识__hasUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasUpdate) {\n child.__hasUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n // 高阶组件会进入此分支,被父组件调用\n else if(vd instanceof Component && vd.__hasUpdate) {\n vd.__hasUpdate = 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}\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 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 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 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 Geom from '../node/geom/Geom';\nimport Text from '../node/Text';\nimport Dom from '../node/Dom';\nimport Img from '../node/Img';\nimport mx from '../math/matrix';\nimport geom from '../math/geom';\nimport level from './level';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport painter from '../util/painter';\nimport Cache from './Cache';\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';\nimport mode from '../node/mode';\n\nconst { canvasPolygon } = painter;\n\nconst {\n STYLE_KEY: {\n POSITION,\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 },\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 },\n STRUCT_KEY: {\n STRUCT_NODE,\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;\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\n// 依次从list获取首个available可用的cache\nfunction 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/**\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;\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;\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 = util.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 * @param renderMode\n * @param node\n * @param __config\n * @param index\n * @param total\n * @param __structs\n * @param cacheTop\n * @param cache\n * @returns {{enabled}|Cache|*}\n */\nfunction genTotal(renderMode, node, __config, index, total, __structs, cacheTop, cache) {\n if(total === 0) {\n return cache;\n }\n // 存每层父亲的matrix和opacity和index,bbox计算过程中生成,缓存给下面渲染过程用\n let parentIndexHash = {};\n let opacityHash = {};\n let [bboxTotal] = genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHash, Cache.MAX);\n if(!bboxTotal) {\n return;\n }\n let { __sx1: sx1, __sy1: sy1 } = node;\n if(cacheTop) {\n cacheTop.reset(bboxTotal, sx1, sy1);\n }\n else {\n cacheTop = Cache.getInstance(bboxTotal, sx1, sy1);\n }\n // 创建失败,再次降级\n if(!cacheTop || !cacheTop.enabled) {\n return;\n }\n cacheTop.__available = true;\n let { x: tx, y: ty, ctx, dbx, dby } = cacheTop;\n // 先绘制自己的cache,起点所以matrix视作E为空,opacity固定1\n if(cache && cache.available) {\n ctx.globalAlpha = 1;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n Cache.drawCache(cache, cacheTop);\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 ctx.globalAlpha = opacity;\n let m = matrix || mx.identity();\n ctx.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]);\n node.render(renderMode, 0, ctx, true, tx - sx1 + dbx, ty - sy1 + dby);\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);\n if(hasMask) {\n i += hasMask;\n }\n continue;\n }\n // mask和不可见不能被汇总到top上\n if(visibility === 'hidden' || isMask) {\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 + tx;\n let dy = -sy1 + dby + ty;\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 let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n if(target) {\n if(isValidMbm(mixBlendMode)) {\n ctx.globalCompositeOperation = mbmName(mixBlendMode);\n }\n else {\n ctx.globalCompositeOperation = 'source-over';\n }\n ctx.globalAlpha = opacity;\n if(matrix) {\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n }\n else {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n }\n Cache.drawCache(target, cacheTop);\n if(target !== __cache) {\n i += total || 0;\n i += hasMask || 0;\n }\n }\n }\n }\n return cacheTop;\n}\n\nfunction genFilter(node, cache, v) {\n return Cache.genFilter(cache, v);\n}\n\nfunction genMask(node, cache) {\n let { [TRANSFORM]: transform, [TRANSFORM_ORIGIN]: transformOrigin } = node.computedStyle;\n let isClip = node.next.isClip;\n return Cache.genMask(cache, node.next, isClip, transform, transformOrigin);\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\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 W\n * @param H\n * @returns {*}\n */\nfunction genTotalWebgl(gl, texCache, node, __config, index, total, __structs, cache, limitCache, 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);\n }\n // limitCache无cache需先绘制到统一的离屏画布上\n else if(limitCache) {\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(mode.WEBGL, 0, gl);\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);\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);\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);\n if(hasMask) {\n i += hasMask;\n }\n continue;\n }\n // mask和不可见不能被汇总到top上\n if(visibility === 'hidden' || isMask) {\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);\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);\n }\n if(target !== __cache) {\n i += (total || 0) + (hasMask || 0);\n }\n }\n }\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 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;\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 += `\\nv_texCoordsBlur[${i}] = a_texCoords + vec2(-${c}, -${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i}]) * ${weights[i]};`;\n }\n vert += `\\nv_texCoordsBlur[${r}] = a_texCoords;`;\n frag += `\\ngl_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 += `\\nv_texCoordsBlur[${i + r + 1}] = a_texCoords + vec2(${c}, ${c}) * u_direction;`;\n frag += `\\ngl_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) {\n let { sx1, sy1, width, height, bbox } = cache;\n // cache一定是mockCache,可能是total/filter/overflow一种\n let cx = width * 0.5, cy = height * 0.5;\n let dx = -bbox[0], dy = -bbox[1];\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 while(next && next.isMask) {\n let __config = next.__config;\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [OPACITY]: opacity,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n },\n } = __config;\n if(display === 'none' || visibility === 'hidden') {\n continue;\n }\n // total无用,都是单节点\n let target = getCache([__cacheFilter, __cacheOverflow, __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 // m = mx.m2Mat4(m, cx, cy);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, m, cx, cy, dx, dy);\n }\n // 异常情况超限\n else if(__config[NODE_LIMIT_CACHE]) {\n return;\n }\n next = next.next;\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 isClip = node.next.isClip;\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 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 ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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, 'filter2');\n apply.ctx.filter = painter.canvasFilter(filter);\n apply.ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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 target.ctx.drawImage(apply.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(offscreen.target.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(mask.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(mask.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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 ctx.drawImage(target.canvas, 0, 0, width, height, 0, 0, width, height);\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\nfunction renderCacheCanvas(renderMode, ctx, root) {\n let { __structs, width, height } = root;\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 = 0;\n let mergeList = [];\n /**\n * 先一遍先序遍历每个节点绘制到自己__cache上,排除Text和已有的缓存以及局部根缓存,\n * 根据refreshLevel进行等级区分,可能是=REPAINT,REFLOW布局已前置处理完。\n * 首次绘制没有catchTotal等,后续则可能会有,在 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 // 不变是同级兄弟,无需特殊处理\n else {}\n lastConfig = __config;\n lastLv = lv;\n let {\n [NODE_REFRESH_LV]: refreshLevel,\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, 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 let matrix;\n if(contain(refreshLevel, TRANSFORM_ALL)) {\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n util.assignMatrix(m, matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n // 父不为E时要点乘继承父的\n if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n util.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 let __cacheFilter = __config[NODE_CACHE_FILTER];\n if(__cacheFilter) {\n __cacheFilter.release();\n }\n // 防重\n if(hasRecordAsMask) {\n hasRecordAsMask[6] = filter;\n }\n else {\n // 强制存hasMask,因为filter改变影响mask\n hasRecordAsMask = [i, lv, total, node, __config, 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重新渲染,并根据结果判断是否离屏限制limitCache\n * Geom没有子节点无需汇总局部根,Dom中Img也是,它们的局部根等于自身的cache,其它符合条件的Dom需要生成\n */\n else {\n node.render(renderMode, refreshLevel, ctx, true);\n }\n // 每个元素检查cacheTotal生成,已有的上面会continue跳过\n let {\n [NODE_LIMIT_CACHE]: limitCache,\n } = __config;\n let {\n [POSITION]: position,\n [OVERFLOW]: overflow,\n [FILTER]: filter,\n [MIX_BLEND_MODE]: mixBlendMode,\n } = computedStyle;\n if(!limitCache && (hasMask || position === 'absolute'\n || filter.length || (overflow === 'hidden' && total) || isValidMbm(mixBlendMode))) {\n if(hasRecordAsMask) {\n hasRecordAsMask[6] = filter;\n hasRecordAsMask[7] = overflow;\n }\n else {\n mergeList.push([i, lv, total, node, __config, hasMask, filter, overflow]);\n }\n }\n }\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 mergeList.forEach(item => {\n let [i, , total, node, __config, hasMask, filter, overflow] = item;\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 __cacheTotal = genTotal(renderMode, node, __config, i, total || 0, __structs, __cacheTotal, __cache);\n if(__cacheTotal && __cacheTotal !== __cache) {\n __config[NODE_CACHE_TOTAL] = __cacheTotal;\n }\n needGen = true;\n }\n // 防止失败超限,必须有total结果\n if(__cacheTotal && __cacheTotal.available) {\n let target = __cacheTotal;\n if(overflow === 'hidden') {\n if(!__cacheOverflow || !__cacheOverflow.available || needGen) {\n __config[NODE_CACHE_OVERFLOW] = genOverflow(node, target);\n needGen = true;\n }\n target = __config[NODE_CACHE_OVERFLOW] || target;\n }\n if(filter && filter.length) {\n if(!__cacheFilter || !__cacheFilter.available || needGen) {\n __config[NODE_CACHE_FILTER] = genFilter(node, target, filter);\n needGen = true;\n }\n target = __config[NODE_CACHE_FILTER] || target;\n }\n if(hasMask && (!__cacheMask || !__cacheMask.available || needGen)) {\n __config[NODE_CACHE_MASK] = genMask(node, target);\n }\n }\n });\n }\n /**\n * 最后先序遍历一次应用__cacheTotal即可,没有的用__cache,以及剩下的超尺寸的和Text\n * 超尺寸的依旧要走无cache逻辑render,这部分和无cache渲染很像\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 let __config = node.__config;\n // text如果display不可见,parent会直接跳过,不会走到这里,这里一定是直接绘制到root的,visibility在其内部判断\n if(node instanceof Text) {\n let {\n [NODE_OPACITY]: opacity,\n [NODE_MATRIX_EVENT]: matrixEvent,\n } = __config[NODE_DOM_PARENT].__config;\n ctx.globalAlpha = opacity;\n ctx.setTransform(matrixEvent[0], matrixEvent[1], matrixEvent[4], matrixEvent[5], matrixEvent[12], matrixEvent[13]);\n node.render(renderMode, 0, ctx);\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\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 [OVERFLOW]: overflow,\n [FILTER]: filter,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n // 有total的可以直接绘制并跳过子节点索引\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n // total的尝试\n if(target) {\n i += (total || 0) + (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.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 }\n // 自身cache尝试\n else {\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 let offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow;\n // 这里比较特殊,可能会有__cache但超限没被汇聚到total上,需mock出离屏对象数据,还有可能本身就超限\n if(__cache && __cache.available || limitCache) {\n if(__cache && __cache.available) {\n // 有cache但没生成total的都在这\n if(isValidMbm(mixBlendMode)) {\n let c = inject.getCacheCanvas(width, height, null, 'blend');\n offscreenBlend = {\n ctx,\n target: c,\n mixBlendMode: mbmName(mixBlendMode),\n matrix: matrixEvent,\n };\n ctx = c.ctx;\n }\n if(hasMask) {\n let c = inject.getCacheCanvas(width, height, null, 'mask1');\n offscreenMask = {\n ctx,\n target: c,\n matrix: matrixEvent,\n };\n ctx = c.ctx;\n }\n if(filter && filter.length) {\n let c = inject.getCacheCanvas(width, height, null, 'filter1');\n offscreenFilter = {\n ctx,\n filter,\n target: c,\n matrix: matrixEvent,\n };\n ctx = c.ctx;\n }\n if(overflow === 'hidden' && display !== 'inline') {\n let c = inject.getCacheCanvas(width, height, null, 'overflow');\n offscreenOverflow = {\n ctx,\n target: c,\n matrix: matrixEvent,\n x: __cache.sx1,\n y: __cache.sy1,\n offsetWidth: node.offsetWidth,\n offsetHeight: node.offsetHeight,\n };\n ctx = c.ctx;\n }\n if(visibility !== 'hidden') {\n Cache.draw(ctx, opacity, matrixEvent, __cache);\n }\n }\n else {\n // 连cache都没生成的超限\n let res = node.render(renderMode, refreshLevel, ctx) || {};\n offscreenBlend = res.offscreenBlend;\n offscreenMask = res.offscreenMask;\n offscreenFilter = res.offscreenFilter;\n offscreenOverflow = res.offscreenOverflow;\n }\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + (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 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) + (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) + (hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_OVERFLOW, offscreenOverflow]);\n ctx = offscreenOverflow.target.ctx;\n }\n if(limitCache && node instanceof Geom) {\n node.render(renderMode, refreshLevel, ctx);\n }\n }\n // 没内容的遮罩跳过,比如未加载的img,否则会将遮罩绘制出来\n else if(hasMask) {\n i += (total || 0) + hasMask;\n }\n // 同无cache一样的离屏应用\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n if(display === 'none') {\n i += (total || 0) + (hasMask || 0);\n }\n }\n }\n }\n}\n\n/**\n * 无缓存模式canvas渲染,O(n)一次循环完成\n * @param renderMode\n * @param ctx\n * @param root\n */\nfunction renderCanvas(renderMode, ctx, root) {\n let { __structs, width, height } = root;\n /**\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 */\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 let {\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_REFRESH_LV]: refreshLevel,\n } = node.__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 let res = node.render(renderMode, refreshLevel, ctx);\n let { offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow } = res || {};\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + (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) + (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) + (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才有值,以及svg的virtualDom也要生成\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + (hasMask || 0);\n }\n }\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 util.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 util.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);\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, 0, gl, true);\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 // 不变是同级兄弟,无需特殊处理\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 // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n util.assignMatrix(m, 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 util.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 let __cacheFilter = __config[NODE_CACHE_FILTER];\n if(__cacheFilter) {\n __cacheFilter.release();\n }\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, true);\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 } = __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(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 }\n else {\n mergeList.push([i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective]);\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 mergeList.forEach(item => {\n let [i, , total, node, __config, limitCache, hasMask, filter, overflow] = item;\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, 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 target = genOverflowWebgl(gl, texCache, node, target, width, height);\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\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);\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);\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) + (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的尝试\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) + (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) + (hasMask || 0);\n }\n // 超限的情况,这里是普通单节点超限,没有合成total后再合成特殊cache如filter/mask/mbm之类的,\n // 直接按原始位置绘制到离屏canvas,再作为纹理绘制即可,特殊的在total那做过降级了\n else if(limitCache && display !== 'none' && visibility !== 'hidden') {\n // let m = mx.m2Mat4(matrixEvent, cx, cy);\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(renderMode, refreshLevel, gl);\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 }\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\nexport default {\n renderCacheCanvas,\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[0] !== page || page.update) {\n // page可能为一个已有纹理,或者贴图\n if(page instanceof MockPage) {\n webgl.bindTexture(gl, page.texture, i);\n channels[i] = page;\n }\n else {\n // 可能老的先删除\n if(last) {\n gl.deleteTexture(last.texture);\n }\n page.texture = webgl.createTexture(gl, page.canvas, i);\n channels[i] = page;\n }\n hash[page.uuid] = i;\n }\n else {\n hash[page.uuid] = i;\n }\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\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 mode from './mode';\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 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 += `>`;\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 this.cache = !!this.props.cache;\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 css = window.getComputedStyle(dom, null);\n if(!this.width) {\n this.__width = parseFloat(css.getPropertyValue('width')) || 0;\n dom.setAttribute('width', this.width);\n }\n if(!this.height) {\n this.__height = parseFloat(css.getPropertyValue('height')) || 0;\n dom.setAttribute('height', this.height);\n }\n }\n // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d');\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', ca);\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 // 利用list循环代替tree递归快速渲染\n if(this.cache) {\n struct.renderCacheCanvas(renderMode, ctx, this);\n }\n else {\n struct.renderCanvas(renderMode, ctx, this);\n }\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 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 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, this, this.__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 let hasUpdate;\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 });\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, null, 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 });\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, null, 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], null, 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()计算自己,因为放在每次checkRoot()做过了\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 '../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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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.length >= 2) {\n num++;\n }\n if(controlB.length >= 2) {\n num += 2;\n }\n return num;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getNewPoint(x1, y1, x2, y2, controlA, controlB, num, start = 0, end = 1) {\n if(start > 0 || end < 1) {\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 = Math.abs(x1 - x2);\n let b = Math.abs(y1 - y2);\n x1 += a * start;\n y1 += b * start;\n x2 -= a * (1 - end);\n y2 -= b * (1 - end);\n }\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 => limitStartEnd(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 = limitStartEnd(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 limitStartEnd(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 = limitStartEnd(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 = limitStartEnd(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 = limitStartEnd(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) {\n let res = super.render(renderMode, lv, ctx, cache);\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 },\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += 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 - ox);\n bbox[0] = Math.min(bbox[0], xb - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[1] = Math.min(bbox[1], yb - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[2] = Math.max(bbox[2], xb + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n bbox[3] = Math.max(bbox[3], yb + oy);\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] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\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] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\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] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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 limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\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 let i = 0, j = list.length - 1;\n if(start > 0) {\n i = getIndex(len.increase, start * len.total, i, j);\n }\n if(end < 1) {\n j = getIndex(len.increase, end * len.total, i, j);\n }\n list = util.clone(list);\n end *= len.total;\n let prePercent = 1;\n if(end > 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 = end - len.increase[j];\n let t = diff / l;\n prePercent = t;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[j + 1] = [current[1] - (1 - t) * a, current[1] - (1 - t) * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], res[3][0], res[3][1]];\n }\n }\n start *= len.total;\n if(start > len.increase[i]) {\n let prev = list[i].slice(list[i].length - 2);\n let current = list[i + 1];\n let l = len.list[i];\n // 同一条线段时如果有end裁剪,会影响start长度\n if(i === j && prePercent !== 1) {\n l *= prePercent;\n }\n let diff = start - len.increase[i];\n let t = diff / l;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[i] = [prev[0] + t * a, prev[1] + t * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([[current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([[current[4], current[5]], [current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], current[4], current[5]];\n }\n }\n if(j < list.length - 2) {\n list = list.slice(0, j + 2);\n }\n if(i > 0) {\n list = list.slice(i);\n }\n return list;\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 => limitStartEnd(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 = limitStartEnd(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 limitStartEnd(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 v = limitStartEnd(v);\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 = limitStartEnd(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 = limitStartEnd(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 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 // points/controls有变化就需要重建顶点\n if(rebuild) {\n let { points, controls } = __cacheProps;\n if(isMulti) {\n __cacheProps.list2 = points.filter(item => Array.isArray(item)).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.filter(item => Array.isArray(item)).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 }\n return rebuild || rebuildSE;\n }\n\n render(renderMode, lv, ctx, cache) {\n let res = super.render(renderMode, lv, ctx, cache);\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 },\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += 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].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] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\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] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\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';\n\nclass Polygon extends Polyline {\n constructor(tagName, props) {\n super(tagName, props);\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\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} } = enums;\nconst { isNil } = util;\nconst { sectorPoints } = geom;\nconst { REM, VW, VH } = 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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 }\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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 }\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n bbox[0] = Math.min(bbox[0], originX - ox);\n bbox[1] = Math.min(bbox[1], originY - oy);\n bbox[2] = Math.max(bbox[2], originX + width + ox);\n bbox[3] = Math.max(bbox[3], originY + height + oy);\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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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));\n }\n else {\n __cacheProps.r = r * width * 0.5;\n __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache) {\n let res = super.render(renderMode, lv, ctx, cache);\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 }\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\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} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = 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) {\n let res = super.render(renderMode, lv, ctx, cache);\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 }\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] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - rx - ox;\n let xb = cx + rx + ox;\n let ya = cy - ry - oy;\n let yb = cy + ry + oy;\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 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 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 let animationRecord;\n if(animate) {\n if(Array.isArray(animate)) {\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 }\n });\n if(has) {\n animationRecord = {\n animate,\n target: vd,\n };\n }\n }\n else {\n (opt.abbr !== false) && abbr2full(animate, abbrAnimate);\n let { value, options } = animate;\n if(Array.isArray(value) && value.length) {\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n animationRecord = {\n animate,\n target: vd,\n };\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n }\n }\n // 产生实际动画运行才存入列表供root调用执行\n if(animationRecord) {\n animateRecords.push(animationRecord);\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 json = util.clone(json);\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(url);\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';\n\nexport default {\n css,\n reset,\n unit,\n font,\n abbr,\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 './node/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 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","STRUCT_KEY","STRUCT_NODE","STRUCT_INDEX","STRUCT_CHILD_INDEX","STRUCT_LV","STRUCT_NUM","STRUCT_TOTAL","STRUCT_HAS_MASK","enums","Node","__x","__y","__ox","__oy","__width","__height","__baseLine","__config","i","lv","j","root","struct","diff","isLayout","__sx","__sy","x","ox","y","oy","__prev","__next","__parent","__domParent","__root","__host","__hostRoot","__virtualDom","CANVAS","SVG","WEBGL","o","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","REM","EM","VW","VH","calUnit","v","n","parseFloat","test","info","arial","lhr","blr","lgr","padding","f","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","_","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","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","getLinear","coords","l1","l2","l3","l4","r1","getRadial","scx","scy","getConic","calConicRadius","renderConic","isInline","border","offscreen","imgData","putImageData","save","clip","drawImage","restore","add","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","isHost","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","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","tar","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","_enums$NODE_KEY","genSingle","dbx","dby","Cache","__init","__bbox","__page","__pos","getCoords","__appendData","__enabled","setTransform","globalAlpha","update","__available","clear","del","ceil","getInstance","blur","isClip","cacheMask","tf","cacheOverflow","cacheFilter","drawCache","globalCompositeOperation","xe","ye","rect","old","newCache","nx","ny","dbx2","dby2","ENUM","NONE","TRANSFORM_ALL","REFLOW","REBUILD","TRANSFORMS","contain","value","getLevel","isReflow","isRebuild","Text","__textBoxes","__charWidthList","__charWidth","__textWidth","charWidthList","ffs","__ff","__key","wait","needMeasure","bp","__bp","pff","pffs","pfs","pfw","pKey","__pKey","parentCache","mw","__cache","lx","lineBoxManager","endSpace","lineClampCount","__sx1","__sy1","isDestroyed","textBoxes","beginSpace","maxW","needReduce","lastChar","ew","lineCount","isTextOverflow","__lineBack","textBox","addItem","cw","hasCache","needBack","setNewLine","__ellipsis","lineBox","tb","__offsetX","__offsetY","textWidth","__layout","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","event","fns","fn","REGISTER","setUpdateFlag","cp","__hasUpdate","__ref","__isMounted","__taskList","__nextState","addRefreshCp","builder","__cd","listener","__shadow","shadow","__shadowRoot","componentDidMount","REFRESH","__isDestroyed","componentWillUnmount","__destroy","force","__emitEvent","__state","hasRegister","defineProperty","get","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","copy","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","B","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","I_NODE_CONFIG","I_ROOT_CONFIG","I_STYLE","I_ASSIGNING","__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","u","calFrame","ts","binarySearch","frame","middle","ea","steps","stepsD","calIntermediateStyle","transition","st2","calIncrease","o2","n2","gotoOverload","I_IN_FPS","I_IS_DELAY","I_BEGIN","I_END","I_FINISHED","I_NEXT_END","I_FIRST_PLAY","I_FRAME_CB","I_PLAY_CB","I_TARGET","I_ROOT","I_FRAMES","I_FRAMES_R","I_CURRENT_TIME","I_NEXT_TIME","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_CAL_DIFF_TIME","I_FIRST_ENTER","I_STAY_BEGIN","I_STAY_END","I_IS2","I_END_TIME","I_OUT_BEGIN_DELAY","I_TIME_STAMP","Animation","__id","nl","__options","op","config","__frameCb","__calDiffTime","iterations","framesR","originStyle","fps","spfLimit","delay","endDelay","playbackRate","current","isFinish","__cancelTask","__currentProps","__currentStyle","isDelay","FRAME","PLAY","playState","__hasFin","__hasCancel","playCount","currentFrames","stayBegin","stayEnd","is2","endTime","currentTime","currentFrame","round","isAlternate","alternate","isEven","isLastCount","frameTime","isLastFrame","inEndDelay","needClean","__clean","BEGIN","END","FINISH","silence","pending","PAUSE","play","CANCEL","__goto","isFrame","excludeDelay","finish","currentProps","spf","animateController","remove","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","mbm","TF","TX","TY","TZ","getFirstEmptyInlineWidth","flowChildren","child","getLastEmptyInlineWidth","__computedStyle","__listener","__loadBgi","__cacheDefs","__isClip","__isMask","__contentBoxList","__hasMask","__mpWidth","mp","__clientWidth","__clientHeight","__offsetWidth","__offsetHeight","__outerWidth","__outerHeight","onlyFixedValue","isDirectionRow","isDirectItem","__calMp","isVirtual","fromAbs","isShadowRoot","clearCache","__layoutData","__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","offsetWidth","offsetHeight","matrixCache","isScale","clientHeight","x5","x6","y5","y6","__calFilter","bg","bgI","item2","kw","rebuild","__hasContent","isRealInline","sx4","sx5","sx6","sy4","sy5","sy6","hasContent","__calContent","__calPerspective","__calMatrix","__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","hostRoot","pJson","zChildren","zIndexChildren","__spreadBbox","LineBox","__list","__lineHeight","LineBoxManager","__lastX","__lastY","__maxX","__domList","__domStack","__isNewLine","__isEnd","__setLB","nextNewLine","genLineBox","verticalAlign","isNewLine","TAG_NAME","INLINE","BOLD","offsetAndResizeByNodeOnY","reflowHash","inDirectAbsList","isContainer","cs","__layoutAbs","isAbs","__resizeY","clearUniqueReflowId","__uniqueReflowId","getMergeMarginTB","topList","bottomList","genZIndexChildren","hasMc","mcHash","lastMaskIndex","__iIndex","__zIndex","__aIndex","sort","genOrderChildren","__order","block","inlineBlock","none","tag","__flexLine","__zIndexChildren","__structure","nss","__structs","structs","needSort","__tryLayInline","firstCharWidth","main","isRow","__calMinMax","min2","max2","countMin","countMax","setNotEnd","__addMp","isFixed","isContent","fixedSize","__lineBoxManager","__preLayout","__ioSize","mergeMarginBottomList","mergeMarginTopList","isXom","isInlineBlock","isImg","reflow","__isIbFull","lastX","lastY","isNone","isEmptyBlock","tw","th","horizonAlign","__inlineSize","domList","__marginAuto","growList","shrinkList","basisList","maxList","minList","orderChildren","__calBasis","containerSize","isMultiLine","line","hypotheticalList","hypothetical","maxCrossList","__layoutFlexLine","maxCross","crossSum","crossSumList","between","around","__crossAlign","flexLine","hypotheticalSum","targetMainList","factorSum","factorList","needReset","factorSum2","lbmList","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","needCalWidth","wl","hl","__computeMeasure","__deepScan","loadImg","__loadImg","placeholder","loading","__loadAndRefresh","showError","pts","arc","__addGeom","reload","Defs","cacheHash","__isMulti","multi","__cacheProps","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","MockPage","genUuid","MockCache","OP","FT","MBM","PPT","OFFSCREEN_OVERFLOW","OFFSCREEN_FILTER","OFFSCREEN_MASK","OFFSCREEN_BLEND","OFFSCREEN_MASK2","getCache","genBboxTotal","parentIndexHash","opacityHash","includeLimitCache","bboxTotal","matrixHash","parentIndex","node2","hasTotal","mergeBbox","genTotal","cacheTop","hasMask","genFilter","genMask","genOverflow","sbox","genFrameBufferWithTexture","lockOneChannel","webgl","createFramebuffer","bindFramebuffer","checkFramebufferStatus","FRAMEBUFFER_COMPLETE","viewport","clearColor","COLOR_BUFFER_BIT","genTotalWebgl","getParameter","MAX_TEXTURE_SIZE","parentPm","totalLimitCache","addTexAndDrawWhenLimit","mockCache","refresh","releaseLockChannel","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","applyOffscreen","origin","renderCacheCanvas","matrixList","parentMatrix","opacityList","parentOpacity","lastConfig","lastLv","mergeList","refreshLevel","hasRecordAsMask","needGen","maskStartHash","offscreenHash","renderCanvas","renderSvg","maskEffectHash","defsCache","hasEffectMask","addCache","maskHash","vdList","parentVd","mChildren","ivs","hasTransform","renderWebgl","pmList","lastRefreshLevel","hasMbm","validMbm","isPerspective","limitHash","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","getPropertyValue","__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","__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","oldH","nowH","lastIndex","ns","reBuild","base","reBuildC","curveNum","limitStartEnd","getNewPoint","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","__start","__end","buildCache","curve","bezierBox","concatPointAndControl","control","getLength","increase","getIndex","getNewList","prePercent","Polyline","__points","__controls","controls","isControl","rebuildSE","__getPoints","__renderPolygon","pointList","controlList","Polygon","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","replaceLibraryVars","linkLibrary","JSON","linkChild","libraryItem","library","libraryId","parse","animateRecords","opt","createGm","createCp","createVd","animationRecord","fonts","loadAndParse","components","imgs","list1","list3","callback","version","appendTo","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,EAAJA,IApEU;EAqEVH,EAAAA,GAAG,EAAHA,GArEU;EAsEVC,EAAAA,GAAG,EAAHA,GAtEU;EAuEVC,EAAAA,GAAG,EAAHA,GAvEU;EAwEV05B,EAAAA,IAAI,EAAJA,IAxEU;EAyEVn4B,EAAAA,KAAK,EAALA,KAzEU;EA0EVluB,EAAAA,IAAI,EAAJA,IA1EU;EA2EV0L,EAAAA,MAAM,EAANA,MA3EU;EA4EV3X,EAAAA,KAAK,EAALA,KA5EU;EA6EV8/D,EAAAA,MAAM,EAANA,CA7EU;EA8EVvX,EAAAA,OAAO,EAAPA,OA9EU;EA+EVl5B,EAAAA,IAAI,EAAJA,IA/EU;EAgFVmM,EAAAA,OAAO,EAAPA,OAhFU;EAiFVq8B,EAAAA,OAAO,EAAPA,OAjFU;EAkFVhM,EAAAA,OAAO,EAAPA,OAlFU;EAmFV/gE,EAAAA,KAAK,EAALA,KAnFU;;IAoFV,IAAI0rB,KAAJ,CAAU1oB,CAAV,EAAa;EACX0oB,IAAAA,KAAK,CAACrI,IAAN,GAAa,CAAC,CAACrgB,CAAf,CAAA;EACD,GAAA;;EAtFS,EAAZ;EAyFA0tC,OAAO,CAACvB,GAAR,CAAY;EACVvB,EAAAA,GAAG,EAAHA,GADU;EAEVC,EAAAA,GAAG,EAAHA,GAFU;EAGVC,EAAAA,GAAG,EAAHA,GAHU;EAIVC,EAAAA,IAAI,EAAJA,IAJU;EAKVC,EAAAA,SAAS,EAATA,SAAAA;EALU,CAAZ,CAAA,CAAA;;EAQA,IAAG,OAAOhgB,MAAP,KAAkB,WAArB,EAAkC;IAChCA,MAAM,CAACq/C,KAAP,GAAeA,OAAf,CAAA;EACD,CAFD,MAGK,IAAG,OAAO58C,IAAP,KAAgB,WAAnB,EAAgC;IACnCA,IAAI,CAAC48C,KAAL,GAAaA,OAAb,CAAA;EACD;;;;;;;;"} \ No newline at end of file diff --git a/package.json b/package.json index ea471e354..a7c0f3fc6 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "karas", - "version": "0.63.6", + "version": "0.63.7", "description": "A flexible JavaScript framework for RIA on Canvas/Svg/Webgl.", "maintainers": [ { diff --git a/src/node/Text.js b/src/node/Text.js index 4bd5a7f60..7ab420b52 100644 --- a/src/node/Text.js +++ b/src/node/Text.js @@ -784,11 +784,11 @@ class Text extends Node { } get root() { - return this.domParent.root; + return (this.domParent || {}).root; } get currentStyle() { - return this.domParent.currentStyle; + return (this.domParent || {}).currentStyle; } get style() { @@ -796,15 +796,15 @@ class Text extends Node { } get computedStyle() { - return this.domParent.computedStyle; + return (this.domParent || {}).computedStyle; } get cacheStyle() { - return this.domParent.__cacheStyle; + return (this.domParent || {}).__cacheStyle; } get bbox() { - let { sx, sy, width, height, root, currentStyle: { [TEXT_STROKE_WIDTH]: textStrokeWidth } } = this; + let { sx, sy, width, height, root, currentStyle: { [TEXT_STROKE_WIDTH]: textStrokeWidth = [0] } = {} } = this; let half = 0; if(textStrokeWidth[1] === REM) { half = Math.max(textStrokeWidth[0] * root.computedStyle[FONT_SIZE] * 0.5, half); diff --git a/src/node/Xom.js b/src/node/Xom.js index 2a9eef4dd..aa3138697 100644 --- a/src/node/Xom.js +++ b/src/node/Xom.js @@ -2879,12 +2879,12 @@ class Xom extends Node { let { __sx1, __sy1, clientWidth, clientHeight, currentStyle: { - [BORDER_TOP_WIDTH]: borderTopWidth, - [BORDER_RIGHT_WIDTH]: borderRightWidth, - [BORDER_BOTTOM_WIDTH]: borderBottomWidth, - [BORDER_LEFT_WIDTH]: borderLeftWidth, - [BOX_SHADOW]: boxShadow, - }, + [BORDER_TOP_WIDTH]: borderTopWidth = [0], + [BORDER_RIGHT_WIDTH]: borderRightWidth = [0], + [BORDER_BOTTOM_WIDTH]: borderBottomWidth = [0], + [BORDER_LEFT_WIDTH]: borderLeftWidth = [0], + [BOX_SHADOW]: boxShadow = [], + } = {}, } = this; let [ox, oy] = this.__spreadBbox(boxShadow); clientWidth += borderLeftWidth[0] + borderRightWidth[0];