From 5a153815cc91e0f2323871e4cda679e15912b0ac Mon Sep 17 00:00:00 2001 From: army8735 Date: Thu, 10 Mar 2022 09:41:40 +0800 Subject: [PATCH] chore: 0.70 --- api.md | 45 ++++++++- index.es.js | 249 +++++++++++++++++++++--------------------------- index.es.js.map | 2 +- index.js | 2 +- json.md | 4 +- package.json | 2 +- 6 files changed, 157 insertions(+), 147 deletions(-) diff --git a/api.md b/api.md index ddc9c47e9..403720e58 100755 --- a/api.md +++ b/api.md @@ -2309,7 +2309,44 @@ karas.inject.measureImg('http://xxx', function(cache) { 判断参数是否是个真实Dom节点。 * **示例** ```jsx -karas.inject.isDom(document.body); +karas.inject.isDom(document.body); // true +``` + +### isWebGLTexture +* **类型** `Function` +* **参数** + * target `Object` +* **说明** + 判断参数是否是个WebGLTexture。 +* **示例** +```jsx +karas.inject.isWebGLTexture(gl.createTexture()); // true +``` + +### checkSupportFontFamily +* **类型** `Function` +* **参数** + * fontFamily `String` +* **说明** + 判断字体是否被注册。 +* **示例** +```jsx +karas.inject.checkSupportFontFamily('Arial'); +``` + +### loadFont +* **类型** `Function` +* **参数** + * fontFamily `String/Array` + * url `String` + * cb `Function` +* **说明** + 加载并注册字体,可重载为加载一个字体列表。注册使用`document.fonts.add()`。 +* **示例** +```jsx +karas.inject.loadFont('puhui', 'xxx', function() {}); +// or +karas.inject.loadFont([{fontFamily: 'puhui', url: 'xxx'}], function() {}); ``` ### now @@ -2516,10 +2553,10 @@ Geom矢量几何图形的样式键值对列表。 #### register * **类型** `Function` * **参数** - * name `String` + * fontFamily `String` 注册的字体名。 * data `Object` - 字体信息,需包含`emSquare`、`ascent`、`descent`、`lineGap`。 + 字体信息,需包含`emSquare`、`ascent`、`descent`、`lineGap`(默认0)。 * **说明** 注册使用的新字体。 * **示例** @@ -2535,7 +2572,7 @@ karas.style.font.register('newFont', { #### support * **类型** `Function` * **参数** - * name `String` + * fontFamily `String` 字体名。 * **说明** 返回是否支持字体。 diff --git a/index.es.js b/index.es.js index 684e7353e..4761474b1 100644 --- a/index.es.js +++ b/index.es.js @@ -831,7 +831,7 @@ var o$1 = { _ref$descent = _ref.descent, descent = _ref$descent === void 0 ? 434 : _ref$descent, _ref$lineGap = _ref.lineGap, - lineGap = _ref$lineGap === void 0 ? 67 : _ref$lineGap, + lineGap = _ref$lineGap === void 0 ? 0 : _ref$lineGap, _ref$padding = _ref.padding, padding = _ref$padding === void 0 ? {} : _ref$padding; @@ -6391,7 +6391,12 @@ var inject = { return o$1.info[ff].checked = false; }, - loadFont: function loadFont(url, cb) { + loadFont: function loadFont(fontFamily, url, cb) { + if (util.isFunction(url)) { + cb = url; + url = fontFamily; + } + if (Array.isArray(url)) { if (!url.length) { return cb(); @@ -6401,7 +6406,7 @@ var inject = { var len = url.length; var list = []; url.forEach(function (item, i) { - inject.loadFont(item, function (cache) { + inject.loadFont(item.fontFamily, item.url, function (cache) { list[i] = cache; if (++count === len) { @@ -6420,6 +6425,10 @@ var inject = { return; } + if (!fontFamily) { + fontFamily = url; + } + var cache = FONT[url] = FONT[url] || { state: INIT, task: [] @@ -6432,8 +6441,14 @@ var inject = { } else { cache.state = LOADING; cb && cache.task.push(cb); - var f = new FontFace(url, "url(".concat(url, ")")); + + if (!/url\(/.test(url)) { + url = "url(".concat(url, ")"); + } + + var f = new FontFace(fontFamily, url); f.load().then(function () { + document.fonts.add(f); cache.state = LOADED; cache.success = true; cache.url = url; @@ -9217,11 +9232,10 @@ function computeMeasure(node, isRoot) { /** * 每次布局前需要计算的reflow相关的computedStyle * @param node 对象节点 - * @param isHost 是否是根节点或组件节点这种局部根节点,无继承需使用默认值 */ -function computeReflow(node, isHost) { +function computeReflow(node) { var currentStyle = node.currentStyle, computedStyle = node.computedStyle, parent = node.domParent, @@ -9251,7 +9265,14 @@ function computeReflow(node, isHost) { }); [POSITION, DISPLAY, FLEX_DIRECTION, JUSTIFY_CONTENT, ALIGN_ITEMS, ALIGN_SELF, FLEX_GROW, FLEX_SHRINK, LINE_CLAMP, ORDER, FLEX_WRAP, ALIGN_CONTENT].forEach(function (k) { computedStyle[k] = currentStyle[k]; - }); + }); // 匿名块对象 + + if (computedStyle[POSITION] === 'absolute' || parentComputedStyle && parentComputedStyle[DISPLAY] === 'flex') { + if (['block', 'flex'].indexOf(computedStyle[DISPLAY]) === -1) { + computedStyle[DISPLAY] = 'block'; + } + } + var textAlign = currentStyle[TEXT_ALIGN]; if (textAlign[1] === INHERIT$2) { @@ -13856,22 +13877,8 @@ var Text = /*#__PURE__*/function (_Node) { }; var cache = textCache.charWidth[key] = textCache.charWidth[key] || {}; var sum = 0; - var needMeasure = false; // text-overflow:ellipse需要,即便没有也要先测量,其基于最近非inline父节点的字体 - - var bp = this.domParent; - - while (bp.currentStyle[DISPLAY$1] === 'inline' && bp.currentStyle[POSITION$1] !== 'absolute') { - var p = bp.domParent; - - if (p.currentStyle[DISPLAY$1] === 'flex') { - break; - } - - bp = p; - } - - this.__bp = bp; - var parentComputedStyle = bp.computedStyle; + var needMeasure = false; + var parentComputedStyle = this.domParent.computedStyle; var pff = 'arial'; for (var _i = 0, pffs = parentComputedStyle[FONT_FAMILY$2].split(','), _len = pffs.length; _i < _len; _i++) { @@ -14002,7 +14009,6 @@ var Text = /*#__PURE__*/function (_Node) { this.__y = this.__sy = this.__sy1 = y; var isDestroyed = this.isDestroyed, content = this.content, - currentStyle = this.currentStyle, computedStyle = this.computedStyle, textBoxes = this.textBoxes, charWidthList = this.charWidthList, @@ -14013,7 +14019,7 @@ var Text = /*#__PURE__*/function (_Node) { var __config = this.__config; __config[NODE_LIMIT_CACHE] = false; // 空内容w/h都为0可以提前跳出 - if (isDestroyed || currentStyle[DISPLAY$1] === 'none' || !content) { + if (isDestroyed || computedStyle[DISPLAY$1] === 'none' || !content) { return lineClampCount; } @@ -14035,13 +14041,25 @@ var Text = /*#__PURE__*/function (_Node) { var padding = o$1.info[__ff].padding; var needReduce = !!padding; var lastChar; - var ew = textCache.charWidth[this.__pKey][ELLIPSIS]; + var ew = textCache.charWidth[this.__pKey][ELLIPSIS]; // block的overflow:hidden和textOverflow:clip/ellipsis才生效,inline要看最近非inline父元素 + + var bp = this.domParent; + + while (bp.computedStyle[DISPLAY$1] === 'inline') { + var p = bp.domParent; + + if (p.computedStyle[DISPLAY$1] === 'flex') { + break; + } + + bp = p; + } + + this.__bp = bp; var lineCount = 0; // 不换行特殊对待,同时考虑overflow和textOverflow if (whiteSpace === 'nowrap') { - var isTextOverflow; // block的overflow:hidden和textOverflow:clip/ellipsis才生效,inline要看最近非inline父元素 - - var bp = this.__bp; + var isTextOverflow; var _bp$currentStyle = bp.currentStyle, display = _bp$currentStyle[DISPLAY$1], overflow = _bp$currentStyle[OVERFLOW], @@ -14099,12 +14117,12 @@ var Text = /*#__PURE__*/function (_Node) { if (_char2 === lastChar && padding.hasOwnProperty(_char2) && padding[_char2]) { var hasCache = void 0, - p = textCache.padding[__key] = textCache.padding[__key] || {}; + _p = textCache.padding[__key] = textCache.padding[__key] || {}; if (textCache.padding.hasOwnProperty(__key)) { - if (p.hasOwnProperty(_char2)) { + if (_p.hasOwnProperty(_char2)) { hasCache = true; - count -= p[_char2]; + count -= _p[_char2]; } } @@ -14123,7 +14141,7 @@ var Text = /*#__PURE__*/function (_Node) { } count -= n; - p[_char2] = n; + _p[_char2] = n; } } @@ -14430,17 +14448,6 @@ var Text = /*#__PURE__*/function (_Node) { min: n }; } - }, { - key: "__calAbsWidth", - value: function __calAbsWidth(x, y, w) { - this.__layout({ - x: x, - y: y, - w: w - }, true); - - return this.width; - } }, { key: "render", value: function render(renderMode, lv, ctx, cache) { @@ -20147,8 +20154,8 @@ var Xom$1 = /*#__PURE__*/function (_Node) { } // 为basis的b/min/max添加mpb,只有当b未显示指定等于w/content时才加,同时返回mpb值 }, { - key: "__addMp", - value: function __addMp(isDirectionRow, w, currentStyle, res, res2, isDirectItem) { + key: "__addMBP", + value: function __addMBP(isDirectionRow, w, currentStyle, res, res2, isDirectItem) { var marginLeft = currentStyle[MARGIN_LEFT$1], marginTop = currentStyle[MARGIN_TOP], marginRight = currentStyle[MARGIN_RIGHT$1], @@ -20162,88 +20169,53 @@ var Xom$1 = /*#__PURE__*/function (_Node) { borderBottomWidth = currentStyle[BORDER_BOTTOM_WIDTH$2], borderLeftWidth = currentStyle[BORDER_LEFT_WIDTH$3]; - 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) { - mp += borderLeftWidth[0]; - } else if (borderLeftWidth[1] === REM$7) { - mp += borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (borderLeftWidth[1] === VW$7) { - mp += borderLeftWidth[0] * this.root.width * 0.01; - } else if (borderLeftWidth[1] === VH$7) { - mp += borderLeftWidth[0] * this.root.height * 0.01; - } else if (borderLeftWidth[1] === VMAX$7) { - mp += borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; - } else if (borderLeftWidth[1] === VMIN$7) { - mp += borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; - } - - if (borderRightWidth[1] === PX$6) { - mp += borderRightWidth[0]; - } else if (borderRightWidth[1] === REM$7) { - mp += borderRightWidth[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (borderRightWidth[1] === VW$7) { - mp += borderRightWidth[0] * this.root.width * 0.01; - } else if (borderRightWidth[1] === VH$7) { - mp += borderRightWidth[0] * this.root.height * 0.01; - } else if (borderRightWidth[1] === VMAX$7) { - mp += borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; - } else if (borderRightWidth[1] === VMIN$7) { - mp += borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; - } + var mbp = this.__calMp(marginLeft, w, !isDirectItem) + this.__calMp(marginRight, w, !isDirectItem) + this.__calMp(paddingLeft, w, !isDirectItem) + this.__calMp(paddingRight, w, !isDirectItem) + this.__calBorder(borderLeftWidth) + this.__calBorder(borderRightWidth); res2 = res2.map(function (item) { - return item + mp; + return item + mbp; }); if (isDirectionRow) { res = res.map(function (item) { - return item + mp; + return item + mbp; }); } 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) { - _mp += borderTopWidth[0]; - } else if (borderTopWidth[1] === REM$7) { - _mp += borderTopWidth[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (borderTopWidth[1] === VW$7) { - _mp += borderTopWidth[0] * this.root.width * 0.01; - } else if (borderTopWidth[1] === VH$7) { - _mp += borderTopWidth[0] * this.root.height * 0.01; - } else if (borderTopWidth[1] === VMAX$7) { - _mp += borderTopWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; - } else if (borderTopWidth[1] === VMIN$7) { - _mp += borderTopWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; - } - - if (borderBottomWidth[1] === PX$6) { - _mp += borderBottomWidth[0]; - } else if (borderBottomWidth[1] === REM$7) { - _mp += borderBottomWidth[0] * this.root.computedStyle[FONT_SIZE$8]; - } else if (borderBottomWidth[1] === VW$7) { - _mp += borderBottomWidth[0] * this.root.width * 0.01; - } else if (borderBottomWidth[1] === VH$7) { - _mp += borderBottomWidth[0] * this.root.height * 0.01; - } else if (borderBottomWidth[1] === VMAX$7) { - _mp += borderBottomWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; - } else if (borderBottomWidth[1] === VMIN$7) { - _mp += borderBottomWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; - } + var _mbp = this.__calMp(marginTop, w, !isDirectItem) + this.__calMp(marginBottom, w, !isDirectItem) + this.__calMp(paddingTop, w, !isDirectItem) + this.__calMp(paddingBottom, w, !isDirectItem) + this.__calBorder(borderTopWidth) + this.__calBorder(borderBottomWidth); res = res.map(function (item) { - return item + _mp; + return item + _mbp; }); } return [res, res2]; + } + }, { + key: "__calBorder", + value: function __calBorder(data) { + var n = 0; + + if (data[1] === PX$6) { + n = data[0]; + } else if (data[1] === REM$7) { + n = data[0] * this.root.computedStyle[FONT_SIZE$8]; + } else if (data[1] === VW$7) { + n = data[0] * this.root.width * 0.01; + } else if (data[1] === VH$7) { + n = data[0] * this.root.height * 0.01; + } else if (data[1] === VMAX$7) { + n = data[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (data[1] === VMIN$7) { + n = data[0] * Math.min(this.root.width, this.root.height) * 0.01; + } + + return n; } // absolute且无尺寸时,isVirtual标明先假布局一次计算尺寸,还有flex列计算时 // fromAbs为absolute节点特有省略计算标识,本节点是abs时真正布局传入 }, { key: "__layout", value: function __layout(data, isVirtual, fromAbs) { - css.computeReflow(this, this.isShadowRoot); + css.computeReflow(this); var w = data.w; var isDestroyed = this.isDestroyed, currentStyle = this.currentStyle, @@ -20303,7 +20275,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { if (width[1] !== AUTO$4) { - if (this.__isRealInline() && currentStyle[DISPLAY$2] === 'inline') { + if (this.__isRealInline() && computedStyle[DISPLAY$2] === 'inline') { width[0] = 0; width[1] = AUTO$4; } else { @@ -20457,7 +20429,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { value: function __layoutNone() { var computedStyle = this.computedStyle; computedStyle[DISPLAY$2] = 'none'; - computedStyle[MARGIN_TOP] = computedStyle[MARGIN_RIGHT$1] = computedStyle[MARGIN_BOTTOM] = computedStyle[MARGIN_LEFT$1] = computedStyle[PADDING_TOP$1] = computedStyle[PADDING_RIGHT$1] = computedStyle[PADDING_BOTTOM$1] = computedStyle[PADDING_LEFT$2] = 0; + computedStyle[MARGIN_TOP] = computedStyle[MARGIN_RIGHT$1] = computedStyle[MARGIN_BOTTOM] = computedStyle[MARGIN_LEFT$1] = computedStyle[BORDER_TOP_WIDTH$2] = computedStyle[BORDER_RIGHT_WIDTH$2] = computedStyle[BORDER_BOTTOM_WIDTH$2] = computedStyle[BORDER_LEFT_WIDTH$3] = computedStyle[PADDING_TOP$1] = computedStyle[PADDING_RIGHT$1] = computedStyle[PADDING_BOTTOM$1] = computedStyle[PADDING_LEFT$2] = computedStyle[WIDTH$4] = computedStyle[HEIGHT$3] = this.__width = this.__height = 0; } // 预先计算是否是固定宽高,布局点位和尺寸考虑margin/border/padding }, { @@ -20543,8 +20515,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { fixedHeight = true; h = h2; } else if (h3 !== undefined) { - // fixedHeight = true; - // TODO: 暂时解决问题,当column的flex排版时,计算的高度不能视作fixedHeight,另其child的mbp未参与basis计算 + fixedHeight = true; h = h3; } else if (height[1] !== AUTO$4) { fixedHeight = true; @@ -20578,7 +20549,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { h = height[0] * Math.min(this.root.width, this.root.height) * 0.01; break; } - } // margin/padding/border影响x和y和尺寸,注意inline的y不受mpb影响 + } // margin/border/padding影响x和y和尺寸,注意inline的y不受mpb影响 x += borderLeftWidth + marginLeft + paddingLeft; @@ -20595,7 +20566,7 @@ var Xom$1 = /*#__PURE__*/function (_Node) { if (isInline) { selfEndSpace = paddingRight + borderRightWidth + marginRight; - } // 传入w3/h3时,flex的item已知目标主尺寸,需减去mpb,其一定是block和inline互斥 + } // 传入w3/h3时,flex的item已知目标主尺寸,需减去mbp,其一定是block,和inline互斥 if (!isInline) { @@ -23876,7 +23847,7 @@ function offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) { var container = void 0; while (next) { - if (next.currentStyle[DISPLAY$4] !== 'none') { + if (next.computedStyle[DISPLAY$4] !== 'none') { if (next.currentStyle[POSITION$3] === 'absolute') { var _next$currentStyle = next.currentStyle, top = _next$currentStyle[TOP$2], @@ -24566,7 +24537,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { }, { key: "__calMinMax", value: function __calMinMax(isDirectionRow, data) { - css.computeReflow(this, this.isShadowRoot); + css.computeReflow(this); var min = 0; var max = 0; var flowChildren = this.flowChildren, @@ -24578,11 +24549,11 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { h = data.h, lineBoxManager = data.lineBoxManager; // 计算需考虑style的属性 - var display = currentStyle[DISPLAY$5], - flexDirection = currentStyle[FLEX_DIRECTION$2], + var flexDirection = currentStyle[FLEX_DIRECTION$2], width = currentStyle[WIDTH$5], height = currentStyle[HEIGHT$5]; - var lineHeight = computedStyle[LINE_HEIGHT$4]; + var display = computedStyle[DISPLAY$5], + lineHeight = computedStyle[LINE_HEIGHT$4]; var main = isDirectionRow ? width : height; var length = flowChildren.length; var hasLayout; @@ -24613,7 +24584,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { _computedStyle = item.computedStyle; // flex的child如果是inline,变为block,在计算autoBasis前就要 if (_currentStyle[DISPLAY$5] !== 'block' && _currentStyle[DISPLAY$5] !== 'flex') { - _currentStyle[DISPLAY$5] = _computedStyle[DISPLAY$5] = 'block'; + _computedStyle[DISPLAY$5] = 'block'; } var _item$__calMinMax = item.__calMinMax(isDirectionRow, { @@ -24860,7 +24831,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { _computedStyle2 = item.computedStyle; // flex的child如果是inline,变为block,在计算autoBasis前就要 if (_currentStyle2[DISPLAY$5] !== 'block' && _currentStyle2[DISPLAY$5] !== 'flex') { - _currentStyle2[DISPLAY$5] = _computedStyle2[DISPLAY$5] = 'block'; + _computedStyle2[DISPLAY$5] = 'block'; } var _item$__calMinMax7 = item.__calMinMax(isDirectionRow, { @@ -25021,7 +24992,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { } } - return this.__addMp(isDirectionRow, w, currentStyle, [min, max], [columnCrossMax]); + return this.__addMBP(isDirectionRow, w, currentStyle, [min, max], [columnCrossMax]); } /** * flex布局时,计算basis尺寸,如果有固定声明则以其为标准,content为内容最大尺寸,auto依赖w/h或降级content @@ -25043,7 +25014,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { }, { key: "__calBasis", value: function __calBasis(isDirectionRow, data) { - css.computeReflow(this, this.isShadowRoot); + css.computeReflow(this); var b = 0; var min = 0; var max = 0; @@ -25055,12 +25026,12 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { w = data.w, h = data.h; // 计算需考虑style的属性 - var display = currentStyle[DISPLAY$5], - flexDirection = currentStyle[FLEX_DIRECTION$2], + var flexDirection = currentStyle[FLEX_DIRECTION$2], width = currentStyle[WIDTH$5], height = currentStyle[HEIGHT$5], flexBasis = currentStyle[FLEX_BASIS$2]; - var lineHeight = computedStyle[LINE_HEIGHT$4]; + var lineHeight = computedStyle[LINE_HEIGHT$4], + display = computedStyle[DISPLAY$5]; var main = isDirectionRow ? width : height; // basis3种情况:auto、固定、content var isAuto = flexBasis[1] === AUTO$6; @@ -25120,7 +25091,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { _computedStyle3 = item.computedStyle; // flex的child如果是inline,变为block,在计算autoBasis前就要 if (_currentStyle3[DISPLAY$5] !== 'block' && _currentStyle3[DISPLAY$5] !== 'flex') { - _currentStyle3[DISPLAY$5] = _computedStyle3[DISPLAY$5] = 'block'; + _computedStyle3[DISPLAY$5] = 'block'; } var _item$__calMinMax13 = item.__calMinMax(isDirectionRow, { @@ -25313,7 +25284,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { } // 直接item的mpb影响basis - return this.__addMp(isDirectionRow, w, currentStyle, [b, min, max], [columnCrossMax], true); + return this.__addMBP(isDirectionRow, w, currentStyle, [b, min, max], [columnCrossMax], true); } }, { key: "__layoutNone", @@ -25516,7 +25487,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { h: h }, isVirtual); - var isNone = item.currentStyle[DISPLAY$5] === 'none'; // 自身无内容 + var isNone = item.computedStyle[DISPLAY$5] === 'none'; // 自身无内容 var isEmptyBlock; @@ -25684,7 +25655,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { var isLastBlock = false; flowChildren.forEach(function (item) { var isXom = item instanceof Xom$1 || item instanceof Component$1 && item.shadowRoot instanceof Xom$1; - var isBlock = isXom && item.currentStyle[DISPLAY$5] === 'block'; + var isBlock = isXom && item.computedStyle[DISPLAY$5] === 'block'; if (isBlock) { isLastBlock = true; @@ -25782,7 +25753,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { _computedStyle4 = item.computedStyle; // flex的child如果是inline,变为block,在计算autoBasis前就要 if (_currentStyle4[DISPLAY$5] !== 'block' && _currentStyle4[DISPLAY$5] !== 'flex') { - _currentStyle4[DISPLAY$5] = _computedStyle4[DISPLAY$5] = 'block'; + _computedStyle4[DISPLAY$5] = 'block'; } // abs虚拟布局计算时纵向也是看横向宽度 @@ -27147,13 +27118,15 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { item.__layoutNone(); return; - } // 先根据容器宽度计算margin/padding + } // 先根据容器宽度计算margin/padding,匿名块对象特殊处理,此时没有computedStyle item.__mp(currentStyle, computedStyle, clientWidth); if (currentStyle[DISPLAY$5] !== 'block' && currentStyle[DISPLAY$5] !== 'flex') { - currentStyle[DISPLAY$5] = computedStyle[DISPLAY$5] = 'block'; + computedStyle[DISPLAY$5] = 'block'; + } else { + computedStyle[DISPLAY$5] = currentStyle[DISPLAY$5]; } var left = currentStyle[LEFT$1], @@ -27162,8 +27135,8 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { bottom = currentStyle[BOTTOM$3], width = currentStyle[WIDTH$5], height = currentStyle[HEIGHT$5], - display = currentStyle[DISPLAY$5], flexDirection = currentStyle[FLEX_DIRECTION$2]; + var display = computedStyle[DISPLAY$5]; var x2, y2, w2, h2; var onlyRight; var onlyBottom; @@ -28501,7 +28474,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) { }, { key: "__calMinMax", value: function __calMinMax(isDirectionRow, data) { - css.computeReflow(this, this.isShadowRoot); + css.computeReflow(this); return this.__calBasis(isDirectionRow, data); } }, { @@ -29100,7 +29073,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { }, { key: "__calMinMax", value: function __calMinMax(isDirectionRow, data) { - css.computeReflow(this, this.isShadowRoot); + css.computeReflow(this); return this.__calBasis(isDirectionRow, data); } }, { @@ -40535,7 +40508,7 @@ var o$4 = { var url = item.url; if (url) { - list1.push(url); + list1.push(item); } }); } @@ -40650,7 +40623,7 @@ var refresh = { Cache: Cache }; -var version = "0.69.9"; +var version = "0.70.0"; Geom$1.register('$line', Line); Geom$1.register('$polyline', Polyline); diff --git a/index.es.js.map b/index.es.js.map index 4f0574386..2236365b8 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/martinez.js","src/math/index.js","src/style/transform.js","src/math/blur.js","src/refresh/Cache.js","src/refresh/level.js","src/node/Text.js","src/util/flatten.js","src/util/builder.js","src/util/Event.js","src/node/Component.js","src/style/image.js","src/style/bg.js","src/animate/frame.js","src/animate/easing.js","src/animate/Animation.js","src/style/bs.js","src/style/mbm.js","src/node/inline.js","src/node/Xom.js","src/node/LineBox.js","src/node/LineBoxManager.js","src/node/tag.js","src/refresh/reflow.js","src/node/Dom.js","src/node/Img.js","src/node/Defs.js","src/node/geom/Geom.js","src/util/updater.js","src/util/diff.js","src/animate/Controller.js","src/refresh/offscreen.js","src/gl/MockPage.js","src/gl/MockCache.js","src/refresh/struct.js","src/gl/TexCache.js","src/node/Root.js","src/node/geom/Line.js","src/node/geom/Polyline.js","src/node/geom/Polygon.js","src/node/geom/Sector.js","src/node/geom/Rect.js","src/node/geom/Circle.js","src/node/geom/Ellipse.js","src/parser/abbr.js","src/parser/parse.js","src/parser/index.js","src/style/index.js","src/animate/index.js","src/refresh/index.js","src/index.js"],"sourcesContent":["const STYLE_KEY = {\n POSITION: 0,\n DISPLAY: 1,\n TOP: 2,\n RIGHT: 3,\n BOTTOM: 4,\n LEFT: 5,\n MARGIN_TOP: 6,\n MARGIN_RIGHT: 7,\n MARGIN_BOTTOM: 8,\n MARGIN_LEFT: 9,\n PADDING_TOP: 10,\n PADDING_RIGHT: 11,\n PADDING_BOTTOM: 12,\n PADDING_LEFT: 13,\n FONT_SIZE: 14,\n FONT_FAMILY: 15,\n COLOR: 16,\n FONT_STYLE: 17,\n FONT_WEIGHT: 18,\n LINE_HEIGHT: 19,\n BACKGROUND_IMAGE: 20,\n BACKGROUND_COLOR: 21,\n BACKGROUND_SIZE: 22,\n BACKGROUND_REPEAT: 23,\n BACKGROUND_POSITION_X: 24,\n BACKGROUND_POSITION_Y: 25,\n BORDER_TOP_WIDTH: 26,\n BORDER_RIGHT_WIDTH: 27,\n BORDER_BOTTOM_WIDTH: 28,\n BORDER_LEFT_WIDTH: 29,\n BORDER_TOP_COLOR: 30,\n BORDER_RIGHT_COLOR: 31,\n BORDER_BOTTOM_COLOR: 32,\n BORDER_LEFT_COLOR: 33,\n BORDER_TOP_STYLE: 34,\n BORDER_RIGHT_STYLE: 35,\n BORDER_BOTTOM_STYLE: 36,\n BORDER_LEFT_STYLE: 37,\n BORDER_TOP_LEFT_RADIUS: 38,\n BORDER_TOP_RIGHT_RADIUS: 39,\n BORDER_BOTTOM_RIGHT_RADIUS: 40,\n BORDER_BOTTOM_LEFT_RADIUS: 41,\n WIDTH: 42,\n HEIGHT: 43,\n FLEX_GROW: 44,\n FLEX_SHRINK: 45,\n FLEX_BASIS: 46,\n FLEX_DIRECTION: 47,\n JUSTIFY_CONTENT: 48,\n ALIGN_ITEMS: 49,\n ALIGN_SELF: 50,\n TEXT_ALIGN: 51,\n TRANSFORM_ORIGIN: 52,\n VISIBILITY: 53,\n OPACITY: 54,\n Z_INDEX: 55,\n TRANSFORM: 56,\n TRANSLATE_X: 57,\n TRANSLATE_Y: 58,\n TRANSLATE_Z: 59,\n SCALE_X: 60,\n SCALE_Y: 61,\n SCALE_Z: 62,\n SKEW_X: 63,\n SKEW_Y: 64,\n ROTATE_X: 65,\n ROTATE_Y: 66,\n ROTATE_Z: 67,\n ROTATE_3D: 68,\n PERSPECTIVE: 69,\n PERSPECTIVE_ORIGIN: 70,\n FILTER: 71,\n BOX_SHADOW: 72,\n POINTER_EVENTS: 73,\n OVERFLOW: 74,\n MIX_BLEND_MODE: 75,\n BACKGROUND_CLIP: 76,\n WHITE_SPACE: 77,\n TEXT_OVERFLOW: 78,\n LETTER_SPACING: 79,\n LINE_CLAMP: 80,\n ORDER: 81,\n FLEX_WRAP: 82,\n ALIGN_CONTENT: 83,\n TEXT_STROKE_WIDTH: 84,\n TEXT_STROKE_COLOR: 85,\n TEXT_STROKE_OVER: 86,\n // GEOM\n FILL: 87,\n STROKE: 88,\n STROKE_WIDTH: 89,\n STROKE_DASHARRAY: 90,\n STROKE_DASHARRAY_STR: 91,\n STROKE_LINECAP: 92,\n STROKE_LINEJOIN: 93,\n STROKE_MITERLIMIT: 94,\n FILL_RULE: 95,\n // 无此样式,仅cache或特殊情况需要\n MATRIX: 96,\n BORDER_TOP: 97,\n BORDER_RIGHT: 98,\n BORDER_BOTTOM: 99,\n BORDER_LEFT: 100,\n TRANSLATE_PATH: 101,\n};\n\nconst STYLE2LOWER_MAP = {};\nfunction style2Lower(s) {\n STYLE2LOWER_MAP[s] = STYLE2LOWER_MAP[s] || s.toLowerCase().replace(/_([a-z])/g, function($0, $1) {\n return $1.toUpperCase();\n });\n\n return STYLE2LOWER_MAP[s];\n}\n\nconst STYLE2UPPER_MAP = {};\nfunction style2Upper(s) {\n STYLE2UPPER_MAP[s] = STYLE2UPPER_MAP[s] || s.replace(/([a-z\\d_])([A-Z])/g, function($0, $1, $2) {\n return $1 + '_' + $2;\n }).toUpperCase();\n\n return STYLE2UPPER_MAP[s];\n}\n\nconst STYLE_R_KEY = {};\nconst STYLE_RV_KEY = {};\nconst STYLE_V_KEY = {};\nObject.keys(STYLE_KEY).forEach(k => {\n let k2 = STYLE_KEY[k];\n STYLE_R_KEY[k2] = k;\n let l = style2Lower(k);\n STYLE_RV_KEY[k2] = l;\n STYLE_V_KEY[l] = k2;\n});\n\n// Root的update过程使用\nconst UPDATE_KEY = {\n UPDATE_NODE: 0,\n UPDATE_STYLE: 1,\n UPDATE_FOCUS: 2,\n UPDATE_MEASURE: 3,\n UPDATE_COMPONENT: 4,\n UPDATE_OVERWRITE: 5,\n UPDATE_KEYS: 6,\n UPDATE_LIST: 7,\n UPDATE_CONFIG: 8,\n UPDATE_ADD_DOM: 9,\n UPDATE_REMOVE_DOM: 10,\n};\n\n// animation计算每帧使用\nconst KEY_FRAME_KEY = {\n FRAME_STYLE: 0,\n FRAME_TIME: 1,\n FRAME_EASING: 2,\n FRAME_TRANSITION: 3,\n};\n\n// 节点使用\nconst NODE_KEY = {\n NODE_DOM_PARENT: 0,\n NODE_OPACITY: 1,\n NODE_MATRIX: 2,\n NODE_MATRIX_EVENT: 3,\n NODE_CACHE: 4,\n NODE_CACHE_TOTAL: 5,\n NODE_CACHE_FILTER: 6,\n NODE_CACHE_MASK: 7,\n NODE_CACHE_OVERFLOW: 8,\n NODE_STRUCT: 9,\n NODE_TAG_NAME: 10,\n NODE_CURRENT_STYLE: 11,\n NODE_CURRENT_PROPS: 12,\n NODE_COMPUTED_STYLE: 13,\n NODE_CACHE_STYLE: 14,\n NODE_CACHE_PROPS: 15,\n NODE_LIMIT_CACHE: 16,\n NODE_IS_MASK: 17,\n NODE_IS_INLINE: 18,\n NODE_HAS_CONTENT: 19,\n NODE_REFRESH_LV: 20,\n NODE_IS_DESTROYED: 21,\n NODE_STYLE: 22,\n NODE_UPDATE_HASH: 23,\n NODE_UNIQUE_UPDATE_ID: 24,\n NODE_DEFS_CACHE: 25,\n NODE_PERSPECTIVE_MATRIX: 26,\n NODE_VIRTUAL_DOM: 27,\n NODE_CACHE_AS_BITMAP: 28,\n};\n\n// struct用\nconst STRUCT_KEY = {\n STRUCT_NODE: 0,\n STRUCT_INDEX: 1,\n STRUCT_CHILD_INDEX: 2,\n STRUCT_LV: 3,\n STRUCT_NUM: 4,\n STRUCT_TOTAL: 5,\n STRUCT_HAS_MASK: 6,\n};\n\nconst ANIMATE_KEY = {\n I_ASSIGNING: 0,\n I_IN_FPS: 1,\n I_IS_DELAY: 2,\n I_BEGIN: 3,\n I_END: 4,\n I_FINISHED: 5,\n I_NEXT_END: 6,\n I_FIRST_PLAY: 7,\n I_PLAY_CB: 8,\n I_TARGET: 9,\n I_ROOT: 10,\n I_FRAMES: 11,\n I_FRAMES_R: 12,\n I_CURRENT_TIME: 13,\n I_NEXT_TIME: 14,\n I_STYLE: 15,\n I_DURATION: 16,\n I_ITERATIONS: 17,\n I_FILL: 18,\n I_PLAYBACK_RATE: 19,\n I_PLAY_COUNT: 20,\n I_PLAY_STATE: 21,\n I_DESTROYED: 22,\n I_START_TIME: 23,\n I_FPS_TIME: 24,\n I_EASING: 25,\n I_ENTER_FRAME: 26,\n I_DELAY: 27,\n I_END_DELAY: 28,\n I_KEYS: 29,\n I_ORIGIN_STYLE: 30,\n I_CURRENT_FRAMES: 31,\n I_CURRENT_FRAME: 32,\n I_SPF_LIMIT: 33,\n I_FPS: 34,\n I_DIRECTION: 35,\n I_FIRST_ENTER: 36,\n I_STAY_BEGIN: 37,\n I_STAY_END: 38,\n I_IS2: 39,\n I_END_TIME: 40,\n I_NODE_CONFIG: 41,\n I_ROOT_CONFIG: 42,\n I_OUT_BEGIN_DELAY: 43,\n I_TIME_STAMP: 44,\n};\n\nexport default {\n STYLE_KEY, // 大写常量为k,数字为值\n STYLE_R_KEY, // 数字为k,大写常量为值\n STYLE_RV_KEY, // 数字为k,小写为值\n STYLE_V_KEY, // 小写为k,数字为值\n style2Lower,\n style2Upper,\n UPDATE_KEY,\n KEY_FRAME_KEY,\n NODE_KEY,\n STRUCT_KEY,\n ANIMATE_KEY,\n};\n","import enums from '../util/enums';\n\nconst {\n STRUCT_KEY: {\n STRUCT_NODE,\n STRUCT_INDEX,\n STRUCT_CHILD_INDEX,\n STRUCT_LV,\n },\n NODE_KEY: {\n NODE_IS_DESTROYED,\n NODE_STRUCT,\n },\n} = enums;\n\nclass Node {\n constructor() {\n this.__x = 0;\n this.__y = 0;\n this.__ox = 0; // relative造成的偏移量\n this.__oy = 0;\n this.__sx = 0;\n this.__sy = 0;\n this.__width = 0;\n this.__height = 0;\n this.__baseline = 0;\n this.__config = {};\n this.__prev = null;\n this.__next = null;\n this.__parent = null;\n this.__domParent = null;\n this.__root = null;\n this.__host = null;\n }\n\n __structure(i, lv, j) {\n return this.__config[NODE_STRUCT] = {\n [STRUCT_NODE]: this,\n [STRUCT_INDEX]: i,\n [STRUCT_CHILD_INDEX]: j,\n [STRUCT_LV]: lv,\n };\n }\n\n __modifyStruct(root, offset = 0) {\n let struct = this.__config[NODE_STRUCT];\n return [struct, 0];\n }\n\n __offsetX(diff, isLayout) {\n if(isLayout) {\n this.__x += diff;\n }\n else {\n this.__ox += diff;\n }\n this.__sx += diff;\n }\n\n __offsetY(diff, isLayout) {\n if(isLayout) {\n this.__y += diff;\n }\n else {\n this.__oy += diff;\n }\n this.__sy += diff;\n }\n\n __destroy() {\n this.__config[NODE_IS_DESTROYED] = true;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get ox() {\n return this.__ox;\n }\n\n get oy() {\n return this.__oy;\n }\n\n get sx() {\n return this.x + this.ox;\n }\n\n get sy() {\n return this.y + this.oy;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n // canvas/svg根节点\n get root() {\n return this.__root;\n }\n\n // component根节点\n get host() {\n return this.__host;\n }\n\n // 考虑高阶组件在内的component根节点\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get baseline() {\n return this.__baseline;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get isDestroyed() {\n return this.__config[NODE_IS_DESTROYED];\n }\n\n get isReplaced() {\n return false;\n }\n}\n\nexport default Node;\n","export default {\n CANVAS: 0,\n SVG: 1,\n WEBGL: 2,\n};\n","let o = {\n AUTO: 0,\n PX: 1,\n PERCENT: 2,\n NUMBER: 3,\n INHERIT: 4,\n DEG: 5,\n STRING: 6,\n RGBA: 7,\n REM: 8,\n EM: 9,\n VW: 10,\n VH: 11,\n VMAX: 12,\n VMIN: 13,\n /**\n * 通用的格式化计算数值单位的方法,百分比/像素/REM/VW/auto和纯数字\n * @param v value\n * @returns 格式化好的[number, unit]\n */\n calUnit(v) {\n let n = parseFloat(v) || 0;\n if(/%$/.test(v)) {\n return [n, o.PERCENT];\n }\n else if(/px$/i.test(v)) {\n return [n, o.PX];\n }\n else if(/deg$/i.test(v)) {\n return [n, o.DEG];\n }\n else if(/rem$/i.test(v)) {\n return [n, o.REM];\n }\n else if(/vw$/i.test(v)) {\n return [n, o.VW];\n }\n else if(/vh$/i.test(v)) {\n return [n, o.VH];\n }\n else if(/em$/i.test(v)) {\n return [n, o.EM];\n }\n else if(/vw$/i.test(v)) {\n return [n, o.VW];\n }\n else if(/vh$/i.test(v)) {\n return [n, o.VH];\n }\n else if(/vmax$/i.test(v)) {\n return [n, o.VMAX];\n }\n else if(/vmin$/i.test(v)) {\n return [n, o.VMIN];\n }\n return [n, o.NUMBER];\n },\n};\n\nexport default o;\n","'use strict';\n\nlet o = {\n info: {\n arial: {\n lhr: 1.14990234375, // 默认line-height ratio,(67+1854+434)/2048\n // car: 1.1171875, // content-area ratio,(1854+434)/2048\n blr: 0.9052734375, // base-line ratio,1854/2048\n // mdr: 0.64599609375, // middle ratio,(1854-1062/2)/2048\n lgr: 0.03271484375, // line-gap ratio,67/2048,默认0\n // 个别字符误差,初次之外误差还有根据经验得的比例系数,https://github.com/karasjs/karas/issues/145\n padding: {\n 1: 1,\n f: 0.9,\n },\n },\n helvetica: {\n lhr: 1.14990234375, // (8+1900+447)/2048\n blr: 0.927734375, // 1900/2048\n lgr: 0.00390625, // 8/2048\n },\n verdana: {\n lhr: 1.21533203125, // (0+2059+430)/2048\n blr: 1.00537109375, // 2059/2048\n },\n tahoma: {\n lhr: 1.20703125, // (0+2049+423)/2048\n blr: 1.00048828125, // 2049/2048\n padding: {\n S: 1,\n T: 1,\n Z: 1,\n c: 1,\n f: 0.7,\n i: 1,\n l: 1,\n t: 0.9,\n },\n },\n georgia: {\n lhr: 1.13623046875, // (0+1878+449)/2048\n blr: 0.9169921875, // 1878/2048\n },\n 'courier new': {\n lhr: 1.1328125, // (0+1705+615)/2048\n blr: 0.83251953125, // 1705/2048\n },\n 'pingfang sc': {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06, // 1060/1000\n padding: {\n f: 0.5,\n },\n },\n simsun: {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06,\n padding: {\n f: 0.5,\n },\n },\n },\n support(fontFamily) {\n return this.info.hasOwnProperty(fontFamily);\n },\n register(name, info) {\n let { emSquare = 2048, ascent = 1854, descent = 434, lineGap = 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;\no.info['pingfang'] = o.info['pingfang sc'];\n\nexport default o;\n","export default {\n position: /(([-+]?[\\d.]+[pxremvwhina%]*)|(left|top|right|bottom|center)){1,2}/ig,\n // tfo: /((-?[\\d.]+(px|%)?)|(left|top|right|bottom|center)){1,2}/ig,\n gradient: /\\b(\\w+)-?gradient\\((.+)\\)/i,\n img: /(?:\\burl\\((['\"]?)(.*?)\\1\\))|(?:\\b((data:)))/i,\n};\n","// 生成4*4单位矩阵\nfunction identity() {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n}\n\n// 矩阵a*b,固定两个matrix都是长度16\nfunction multiply(a, b) {\n if(isE(a)) {\n return b;\n }\n if(isE(b)) {\n return a;\n }\n let c = [];\n for(let i = 0; i < 4; i++) {\n let a0 = a[i] || 0;\n let a1 = a[i + 4] || 0;\n let a2 = a[i + 8] || 0;\n let a3 = a[i + 12] || 0;\n c[i] = a0 * b[0] + a1 * b[1] + a2 * b[2] + a3 * b[3];\n c[i + 4] = a0 * b[4] + a1 * b[5] + a2 * b[6] + a3 * b[7];\n c[i + 8] = a0 * b[8] + a1 * b[9] + a2 * b[10] + a3 * b[11];\n c[i + 12] = a0 * b[12] + a1 * b[13] + a2 * b[14] + a3 * b[15];\n }\n return c;\n}\n\nfunction calPoint(point, m) {\n let [x, y, z, w] = point;\n if(w === undefined) {\n w = 1;\n }\n if(m && !isE(m)) {\n if(m.length === 16) {\n z = z || 0;\n let [a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4] = m;\n w *= x * d1 + y * d2 + z * d3 + d4;\n return [\n (x * a1 + y * a2 + z * a3 + a4),\n (x * b1 + y * b2 + z * b3 + b4),\n (x * c1 + y * c2 + z * c3 + c4),\n w\n ];\n }\n // 6位类型\n let [a, b, c, d, e, f] = m;\n return [a * x + c * y + e, b * x + d * y + f];\n }\n return [x, y, z, w];\n}\n\n/**\n * 初等行变换求3*3特定css的matrix方阵,一维6长度\n * https://blog.csdn.net/iloveas2014/article/details/82930946\n * @param m\n * @returns {number[]|*}\n */\nfunction inverse(m) {\n if(m.length === 16) {\n return inverse4(m);\n }\n let [a, b, c, d, e, f] = m;\n if(a === 1 && b === 0 && c === 0 && d === 1 && e === 0 && f === 0) {\n return m;\n }\n let divisor = a * d - b * c;\n if(divisor === 0) {\n return m;\n }\n return [d / divisor, -b / divisor, -c / divisor, a / divisor,\n (c * f - d * e) / divisor, (b * e - a * f) / divisor];\n}\n\n// 16位或者6位单位矩阵判断,空也认为是\nfunction isE(m) {\n if(!m || !m.length) {\n return true;\n }\n if(m.length === 16) {\n return m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 0\n && m[4] === 0 && m[5] === 1 && m[6] === 0 && m[7] === 0\n && m[8] === 0 && m[9] === 0 && m[10] === 1 && m[11] === 0\n && m[12] === 0 && m[13] === 0 && m[14] === 0 && m[15] === 1;\n }\n return m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 1 && m[4] === 0 && m[5] === 0;\n}\n\n/**\n * 求任意4*4矩阵的逆矩阵,行列式为 0 则返回单位矩阵兜底\n * 格式:matrix3d(a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4)\n * 参见: https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix3d()\n * 对应:\n * [\n * a1,a2,a3,a4,\n * b1,b2,b3,b4,\n * c1,c2,c3,c4,\n * d1,d2,d3,d4,\n * ]\n *\n * 根据公式 A* = |A|A^-1 来计算\n * A* 表示矩阵 A 的伴随矩阵,A^-1 表示矩阵 A 的逆矩阵,|A| 表示行列式的值\n *\n * @returns {number[]}\n */\n\nfunction inverse4(s) {\n let inv = [];\n\n inv[0] = s[5] * s[10] * s[15] - s[5] * s[11] * s[14] - s[9] * s[6] * s[15]\n + s[9] * s[7] * s[14] + s[13] * s[6] * s[11] - s[13] * s[7] * s[10];\n inv[4] = -s[4] * s[10] * s[15] + s[4] * s[11] * s[14] + s[8] * s[6] * s[15]\n - s[8] * s[7] * s[14] - s[12] * s[6] * s[11] + s[12] * s[7] * s[10];\n inv[8] = s[4] * s[9] * s[15] - s[4] * s[11] * s[13] - s[8] * s[5] * s[15]\n + s[8] * s[7] * s[13] + s[12] * s[5] * s[11] - s[12] * s[7] * s[9];\n inv[12] = -s[4] * s[9] * s[14] + s[4] * s[10] * s[13] + s[8] * s[5] * s[14]\n - s[8] * s[6] * s[13] - s[12] * s[5] * s[10] + s[12] * s[6] * s[9];\n\n inv[1] = -s[1] * s[10] * s[15] + s[1] * s[11] * s[14] + s[9] * s[2] * s[15]\n - s[9] * s[3] * s[14] - s[13] * s[2] * s[11] + s[13] * s[3] * s[10];\n inv[5] = s[0] * s[10] * s[15] - s[0] * s[11] * s[14] - s[8] * s[2] * s[15]\n + s[8] * s[3] * s[14] + s[12] * s[2] * s[11] - s[12] * s[3] * s[10];\n inv[9] = -s[0] * s[9] * s[15] + s[0] * s[11] * s[13] + s[8] * s[1] * s[15]\n - s[8] * s[3] * s[13] - s[12] * s[1] * s[11] + s[12] * s[3] * s[9];\n inv[13] = s[0] * s[9] * s[14] - s[0] * s[10] * s[13] - s[8] * s[1] * s[14]\n + s[8] * s[2] * s[13] + s[12] * s[1] * s[10] - s[12] * s[2] * s[9];\n\n inv[2] = s[1] * s[6] * s[15] - s[1] * s[7] * s[14] - s[5] * s[2] * s[15]\n + s[5] * s[3] * s[14] + s[13] * s[2] * s[7] - s[13] * s[3] * s[6];\n inv[6] = -s[0] * s[6] * s[15] + s[0] * s[7] * s[14] + s[4] * s[2] * s[15]\n - s[4] * s[3] * s[14] - s[12] * s[2] * s[7] + s[12] * s[3] * s[6];\n inv[10] = s[0] * s[5] * s[15] - s[0] * s[7] * s[13] - s[4] * s[1] * s[15]\n + s[4] * s[3] * s[13] + s[12] * s[1] * s[7] - s[12] * s[3] * s[5];\n inv[14] = -s[0] * s[5] * s[14] + s[0] * s[6] * s[13] + s[4] * s[1] * s[14]\n - s[4] * s[2] * s[13] - s[12] * s[1] * s[6] + s[12] * s[2] * s[5];\n\n inv[3] = -s[1] * s[6] * s[11] + s[1] * s[7] * s[10] + s[5] * s[2] * s[11]\n - s[5] * s[3] * s[10] - s[9] * s[2] * s[7] + s[9] * s[3] * s[6];\n inv[7] = s[0] * s[6] * s[11] - s[0] * s[7] * s[10] - s[4] * s[2] * s[11]\n + s[4] * s[3] * s[10] + s[8] * s[2] * s[7] - s[8] * s[3] * s[6];\n inv[11] = -s[0] * s[5] * s[11] + s[0] * s[7] * s[9] + s[4] * s[1] * s[11]\n - s[4] * s[3] * s[9] - s[8] * s[1] * s[7] + s[8] * s[3] * s[5];\n inv[15] = s[0] * s[5] * s[10] - s[0] * s[6] * s[9] - s[4] * s[1] * s[10]\n + s[4] * s[2] * s[9] + s[8] * s[1] * s[6] - s[8] * s[2] * s[5];\n\n let det = s[0] * inv[0] + s[1] * inv[4] + s[2] * inv[8] + s[3] * inv[12];\n if (det === 0) {\n return identity();\n }\n\n det = 1 / det;\n let d = [];\n for (let i = 0; i < 16; i++) {\n d[i] = inv[i] * det;\n }\n return d;\n}\n\n// 将4*4的16长度矩阵转成css/canvas的6位标准使用,忽略transform3d\nfunction m2m6(m) {\n return [\n m[0],\n m[1],\n m[4],\n m[5],\n m[12],\n m[13],\n ];\n}\n\nfunction point2d(point) {\n let w = point[3];\n if(w && w !== 1) {\n point = point.slice(0, 2);\n point[0] /= w;\n point[1] /= w;\n }\n return point;\n}\n\nexport default {\n identity,\n multiply,\n calPoint,\n point2d,\n inverse,\n isE,\n m2m6,\n};\n","// 向量点乘积\nfunction dotProduct(x1, y1, x2, y2) {\n return x1 * x2 + y1 * y2;\n}\n\n// 向量叉乘积\nfunction crossProduct(x1, y1, x2, y2) {\n return x1 * y2 - x2 * y1;\n}\n\nexport default {\n dotProduct,\n crossProduct,\n};\n","import mx from './matrix';\nimport vector from './vector';\nimport enums from '../util/enums';\n\nconst H = 4 * (Math.sqrt(2) - 1) / 3;\nconst { crossProduct } = vector;\nconst { calPoint, isE } = mx;\nconst { STYLE_KEY: {\n WIDTH,\n HEIGHT,\n TRANSFORM_ORIGIN,\n} } = enums;\n\n/**\n * 圆弧拟合公式,根据角度求得3阶贝塞尔控制点比例长度,一般<=90,超过拆分\n * @param deg\n * @returns {number}\n */\nfunction h(deg) {\n deg *= 0.5;\n return 4 * ((1 - Math.cos(deg)) / Math.sin(deg)) / 3;\n}\n\n/**\n * 判断点是否在多边形内\n * @param x 点坐标\n * @param y\n * @param vertexes 多边形顶点坐标\n * @returns {boolean}\n */\nfunction pointInPolygon(x, y, vertexes) {\n // 先取最大最小值得一个外围矩形,在外边可快速判断false\n let [xmax, ymax] = vertexes[0];\n let [xmin, ymin] = vertexes[0];\n let len = vertexes.length;\n for(let i = 1; i < len; i++) {\n let [x, y] = vertexes[i];\n xmax = Math.max(xmax, x);\n ymax = Math.max(ymax, y);\n xmin = Math.min(xmin, x);\n ymin = Math.min(ymin, y);\n }\n if(x < xmin || y < ymin || x > xmax || y > ymax) {\n return false;\n }\n // 所有向量积均为非负数说明在多边形内或边上\n for(let i = 0, len = vertexes.length; i < len; i++) {\n let [x1, y1] = vertexes[i];\n let [x2, y2] = vertexes[(i + 1) % len];\n if(crossProduct(x2 - x1, y2 - y1, x - x1, y - y1) < 0) {\n return false;\n }\n }\n return true;\n}\n\n// 判断点是否在一个4边形内,比如事件发生是否在节点上\nfunction pointInQuadrilateral(x, y, x1, y1, x2, y2, x4, y4, x3, y3, matrix) {\n if(matrix && !isE(matrix)) {\n let w1, w2, w3, w4;\n [x1, y1,, w1] = calPoint([x1, y1], matrix);\n [x2, y2,, w2] = calPoint([x2, y2], matrix);\n [x3, y3,, w3] = calPoint([x3, y3], matrix);\n [x4, y4,, w4] = calPoint([x4, y4], matrix);\n if(w1 && w1 !== 1) {\n x1 /= w1;\n y1 /= w1;\n }\n if(w2 && w2 !== 1) {\n x2 /= w2;\n y2 /= w2;\n }\n if(w3 && w3 !== 1) {\n x3 /= w3;\n y3 /= w3;\n }\n if(w4 && w4 !== 1) {\n x4 /= w4;\n y4 /= w4;\n }\n return pointInPolygon(x, y, [\n [x1, y1],\n [x2, y2],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n return x >= x1 && y >= y1 && x <= x4 && y <= y4;\n }\n}\n\n/**\n * 余弦定理3边长求夹角\n * @param a\n * @param b\n * @param c\n */\nfunction angleBySide(a, b, c) {\n let theta = (Math.pow(b, 2) + Math.pow(c, 2) - Math.pow(a, 2)) / (2 * b * c);\n return Math.acos(theta);\n}\n\n/**\n * 余弦定理2边长和夹角求3边\n * @param alpha 弧度\n * @param a\n * @param b\n */\nfunction sideByAngle(alpha, a, b) {\n let cos = Math.cos(alpha);\n return Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2) - 2 * a * b * cos);\n}\n\n/**\n * 两点距离\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n */\nfunction pointsDistance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n}\n\n/**\n * 三角形内心\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param x3\n * @param y3\n */\nfunction triangleIncentre(x1, y1, x2, y2, x3, y3) {\n let a = pointsDistance(x2, y2, x3, y3);\n let b = pointsDistance(x1, y1, x3, y3);\n let c = pointsDistance(x1, y1, x2, y2);\n return [\n (a * x1 + b * x2 + c * x3) / (a + b + c),\n (a * y1 + b * y2 + c * y3) / (a + b + c),\n ];\n}\n\n/**\n * 椭圆圆心和长短轴生成4个端点和控制点\n */\nfunction ellipsePoints(x, y, a, b = a) {\n let ox = a * H;\n let oy = b === a ? ox : b * H;\n return [\n [x - a, y],\n [x - a, y - oy, x - ox, y - b, x, y - b],\n [x + ox, y - b, x + a, y - oy, x + a, y],\n [x + a, y + oy, x + ox, y + b, x, y + b],\n [x - ox, y + b, x - a, y + oy, x - a, y],\n ];\n}\n\n/**\n * 扇形圆心和半径起始角度生成4个端点和控制点\n * 分为4个象限进行拟合,0、1、2、3\n */\nfunction sectorPoints(x, y, r, begin, end) {\n if(begin > end) {\n [begin, end] = [end, begin];\n }\n if(begin === end) {\n return [];\n }\n let list = [];\n let b = Math.floor(begin / 90);\n let e = Math.floor(end / 90);\n // 同象限直接算\n if(b === e || (e - b) === 1 && end % 90 === 0) {\n let h2 = h(d2r(Math.abs(begin - end)));\n let d = h2 * r;\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let alpha = Math.atan(d / r);\n if(b < 90) {\n // 第1个交点\n let rx = Math.sin(d2r(begin)) * r;\n let ry = Math.cos(d2r(begin)) * r;\n let p1 = [x + rx, y - ry];\n // 第1个控制点\n let deg = alpha + d2r(begin);\n rx = Math.sin(deg) * c;\n ry = Math.cos(deg) * c;\n let p2 = [x + rx, y - ry];\n // 第2个交点\n rx = Math.sin(d2r(end)) * r;\n ry = Math.cos(d2r(end)) * r;\n let p4 = [x + rx, y - ry];\n // 第2个控制点\n deg = d2r(end) - alpha;\n rx = Math.sin(deg) * c;\n ry = Math.cos(deg) * c;\n let p3 = [x + rx, y - ry];\n list.push(p1);\n list.push(p2.concat(p3).concat(p4));\n }\n else if(b < 180) {\n // 第1个交点\n let rx = Math.cos(d2r(begin - 90)) * r;\n let ry = Math.sin(d2r(begin - 90)) * r;\n let p1 = [x + rx, y + ry];\n // 第1个控制点\n let deg = alpha + d2r(begin - 90);\n rx = Math.cos(deg) * c;\n ry = Math.sin(deg) * c;\n let p2 = [x + rx, y + ry];\n // 第2个交点\n rx = Math.cos(d2r(end - 90)) * r;\n ry = Math.sin(d2r(end - 90)) * r;\n let p4 = [x + rx, y + ry];\n // 第2个控制点\n deg = d2r(end - 90) - alpha;\n rx = Math.cos(deg) * c;\n ry = Math.sin(deg) * c;\n let p3 = [x + rx, y + ry];\n list.push(p1);\n list.push(p2.concat(p3).concat(p4));\n }\n else if(b < 270) {\n // 第1个交点\n let rx = Math.sin(d2r(begin - 180)) * r;\n let ry = Math.cos(d2r(begin - 180)) * r;\n let p1 = [x - rx, y + ry];\n // 第1个控制点\n let deg = alpha + d2r(begin - 180);\n rx = Math.sin(deg) * c;\n ry = Math.cos(deg) * c;\n let p2 = [x - rx, y + ry];\n // 第2个交点\n rx = Math.sin(d2r(end - 180)) * r;\n ry = Math.cos(d2r(end - 180)) * r;\n let p4 = [x - rx, y + ry];\n // 第2个控制点\n deg = d2r(end - 180) - alpha;\n rx = Math.sin(deg) * c;\n ry = Math.cos(deg) * c;\n let p3 = [x - rx, y + ry];\n list.push(p1);\n list.push(p2.concat(p3).concat(p4));\n }\n else {\n // 第1个交点\n let rx = Math.cos(d2r(begin - 270)) * r;\n let ry = Math.sin(d2r(begin - 270)) * r;\n let p1 = [x - rx, y + ry];\n // 第1个控制点\n let deg = alpha + d2r(begin - 270);\n rx = Math.cos(deg) * c;\n ry = Math.sin(deg) * c;\n let p2 = [x - rx, y + ry];\n // 第2个交点\n rx = Math.cos(d2r(end - 270)) * r;\n ry = Math.sin(d2r(end - 270)) * r;\n let p4 = [x - rx, y + ry];\n // 第2个控制点\n deg = d2r(end - 270) - alpha;\n rx = Math.cos(deg) * c;\n ry = Math.sin(deg) * c;\n let p3 = [x - rx, y + ry];\n list.push(p1);\n list.push(p2.concat(p3).concat(p4));\n }\n }\n // 跨象限循环算\n else {\n let i = b;\n let temp = [];\n for(; i <= e; i++) {\n if(i === 0) {\n let res = sectorPoints(x, y, r, begin, 90);\n temp.push(res);\n }\n else if(i === 1) {\n // 防止90~90这种情况,但如果begin和end都是90时又要显示\n if(b === i || end > 90) {\n let res = sectorPoints(x, y, r, begin < 90 ? 90 : begin, end > 180 ? 180 : end);\n temp.push(res);\n }\n }\n else if(i === 2) {\n // 防止180~180这种情况,但如果begin和end都是90时又要显示\n if(b === i || end > 180) {\n let res = sectorPoints(x, y, r, begin < 180 ? 180 : begin, end > 270 ? 270 : end);\n temp.push(res);\n }\n }\n else if(i === 3) {\n // 防止180~180这种情况,但如果begin和end都是90时又要显示\n if(b === i || end > 270) {\n let res = sectorPoints(x, y, r, begin < 270 ? 270 : begin, end);\n temp.push(res);\n }\n }\n }\n // 去掉重复的首尾扇弧点\n list = temp[0];\n for(let i = 1, len = temp.length; i < len; i++) {\n list.push(temp[i][1]);\n }\n }\n return list;\n}\n\n/**\n * 获取2个矩形重叠区域,如不重叠返回null\n * @param a\n * @param b\n */\nfunction getRectsIntersection(a, b) {\n if(!isRectsOverlap(a, b)) {\n return null;\n }\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n return [\n Math.max(ax1, bx1),\n Math.max(ay1, by1),\n Math.min(ax4, bx4),\n Math.min(ay4, by4),\n ];\n}\n\n/**\n * 2个矩形是否重叠\n * @param a\n * @param b\n */\nfunction isRectsOverlap(a, b) {\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n if(ax1 >= bx4 || ay1 >= by4 || bx1 >= ax4 || by1 >= ay4) {\n return false;\n }\n return true;\n}\n\n/**\n * 2个矩形是否包含,a包含b\n * @param a\n * @param b\n */\nfunction isRectsInside(a, b) {\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n if(ax1 <= bx1 && ay1 <= by1 && ax4 >= bx4 && ay4 >= by4) {\n return true;\n }\n return false;\n}\n\nfunction calCoordsInNode(px, py, node) {\n let { matrix = [1, 0, 0, 1, 0, 0], computedStyle = {} } = node;\n let { [WIDTH]: width, [HEIGHT]: height, [TRANSFORM_ORIGIN]: [ox, oy] = [width * 0.5, height * 0.5] } = computedStyle;\n [px, py] = calPoint([px * width - ox, py * height - oy], matrix);\n return [px + ox, py + oy];\n}\n\nfunction calPercentInNode(x, y, node) {\n let { computedStyle: { [WIDTH]: width, [HEIGHT]: height, [TRANSFORM_ORIGIN]: [ox, oy] } } = node;\n // 先求无旋转时右下角相对于原点的角度ds\n let ds = Math.atan((height - oy) / (width - ox));\n let [x1, y1] = calCoordsInNode(1, 1, node);\n let d1;\n let deg;\n // 根据旋转后的坐标,分4个象限,求旋转后的右下角相对于原点的角度d1,得出偏移角度deg,分顺逆时针[-180, 180]\n if(x1 >= ox && y1 >= oy) {\n if(ox === x1) {\n d1 = -Math.atan(Infinity);\n }\n else {\n d1 = Math.atan((y1 - oy) / (x1 - ox));\n }\n deg = d1 - ds;\n }\n else if(x1 >= ox && y1 < oy) {\n if(ox === x1) {\n d1 = -Math.atan(Infinity);\n }\n else {\n d1 = Math.atan((oy - y1) / (x1 - ox));\n }\n deg = d1 + ds;\n }\n else if(x1 < ox && y1 >= oy) {\n d1 = Math.atan((y1 - oy) / (ox - x1));\n deg = d1 - ds;\n }\n else if(x1 < ox && y1 < oy) {\n d1 = Math.atan((y1 - oy) / (x1 - ox));\n if(ds >= d1) {\n deg = d1 + Math.PI - ds;\n }\n else {\n deg = Math.PI - d1 + ds;\n deg = -deg;\n }\n }\n else {\n deg = 0;\n }\n // 目标点到原点的边长不会变\n let dt = Math.sqrt(Math.pow(x - ox, 2) + Math.pow(y - oy, 2));\n // 分4个象限,先求目标点到原点的角度d2,再偏移deg后求得原始坐标\n let d2;\n if(x >= ox && y >= oy) {\n if(ox === x) {\n d2 = -Math.atan(Infinity);\n }\n else {\n d2 = Math.atan((y - oy) / (x - ox));\n }\n }\n else if(x >= ox && y < oy) {\n if(ox === x) {\n d2 = -Math.atan(Infinity);\n }\n else {\n d2 = -Math.atan((y - oy) / (ox - x));\n }\n }\n else if(x < ox && y >= oy) {\n d2 = Math.PI - Math.atan((y - oy) / (ox - x));\n }\n else {\n d2 = Math.atan((y - oy) / (x - ox)) - Math.PI;\n }\n d2 -= deg;\n if(d2 > Math.PI) {\n d2 -= Math.PI;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 > Math.PI * 0.5) {\n d2 = Math.PI - d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= 0) {\n return [\n (ox + dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= -Math.PI * 0.5) {\n d2 = -d2;\n return [\n (ox + dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= -Math.PI) {\n d2 = Math.PI + d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n d2 = -Math.PI - d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n}\n\nfunction d2r(n) {\n return n * Math.PI / 180;\n}\n\nfunction r2d(n) {\n return n * 180 / Math.PI;\n}\n\n/**\n * 二阶贝塞尔曲线范围框\n * @param x0\n * @param y0\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @returns {number[]}\n * https://www.iquilezles.org/www/articles/bezierbbox/bezierbbox.htm\n */\nfunction bboxBezier2(x0, y0, x1, y1, x2, y2) {\n let minX = Math.min(x0, x2);\n let minY = Math.min(y0, y2);\n let maxX = Math.max(x0, x2);\n let maxY = Math.max(y0, y2);\n // 控制点位于边界内部时,边界就是范围框,否则计算导数获取极值\n if(x1 < minX || y1 < minY || x1 > maxX || y1 > maxY) {\n let tx = (x0 - x1) / (x0 - 2 * x1 + x2);\n let ty = (y0 - y1) / (y0 - 2 * y1 + y2);\n let sx = 1 - tx;\n let sy = 1 - ty;\n let qx = sx * sx * x0 + 2 * sx * tx * x1 + tx * tx * x2;\n let qy = sy * sy * y0 + 2 * sy * ty * y1 + ty * ty * y2;\n minX = Math.min(minX, qx);\n minY = Math.min(minY, qy);\n maxX = Math.min(maxX, qx);\n maxY = Math.min(maxY, qy);\n }\n return [minX, minY, maxX, maxY];\n}\n\n/**\n * 同上三阶的\n */\nfunction bboxBezier3(x0, y0, x1, y1, x2, y2, x3, y3) {\n let minX = Math.min(x0, x3);\n let minY = Math.min(y0, y3);\n let maxX = Math.max(x0, x3);\n let maxY = Math.max(y0, y3);\n if(x1 < minX || y1 < minY || x1 > maxX || y1 > maxY || x2 < minX || y2 < minY || x2 > maxX || y2 > maxY) {\n let cx = -x0 + x1;\n let cy = -y0 + y1;\n let bx = x0 - 2 * x1 + x2;\n let by = y0 - 2 * y1 + y2;\n let ax = -x0 + 3 * x1 - 3 * x2 + x3;\n let ay = -y0 + 3 * y1 - 3 * y2 + y3;\n let hx = bx * bx - ax * cx;\n let hy = by * by - ay * cy;\n if(hx > 0) {\n hx = Math.sqrt(hx);\n let t = (-bx - hx) / ax;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * x0 + 3 * s * s * t * x1 + 3 * s * t * t * x2 + t * t * t * x3;\n minX = Math.min(minX, q);\n maxX = Math.max(maxX, q);\n }\n t = (-bx + hx) / ax;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * x0 + 3 * s * s * t * x1 + 3 * s * t * t * x2 + t * t * t * x3;\n minX = Math.min(minX, q);\n maxX = Math.max(maxX, q);\n }\n }\n if(hy > 0) {\n hy = Math.sqrt(hy);\n let t = (-by - hy) / ay;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * y0 + 3 * s * s * t * y1 + 3 * s * t * t * y2 + t * t * t * y3;\n minY = Math.min(minY, q);\n maxY = Math.max(maxY, q);\n }\n t = (-by + hy) / ay;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * y0 + 3 * s * s * t * y1 + 3 * s * t * t * y2 + t * t * t * y3;\n minY = Math.min(minY, q);\n maxY = Math.max(maxY, q);\n }\n }\n }\n return [minX, minY, maxX, maxY];\n}\n\nfunction bboxBezier(x0, y0, x1, y1, x2, y2, x3, y3) {\n if(arguments.length === 4) {\n return [x0, y0, x1, y1];\n }\n if(arguments.length === 6) {\n return bboxBezier2(x0, y0, x1, y1, x2, y2);\n }\n if(arguments.length === 8) {\n return bboxBezier3(x0, y0, x1, y1, x2, y2, x3, y3);\n }\n}\n\n/**\n * 范数 or 模\n */\nfunction norm(v) {\n let order = v.length;\n let sum = v.reduce((a, b) => Math.pow(a, order) + Math.pow(b, order));\n return Math.pow(sum, 1 / order);\n}\n\nfunction simpson38(derivativeFunc, l, r) {\n let f = derivativeFunc;\n let middleL = (2 * l + r) / 3;\n let middleR = (l + 2 * r) / 3;\n return (f(l) + 3 * f(middleL) + 3 * f(middleR) + f(r)) * (r - l) / 8;\n}\n\n/**\n * bezier 曲线的长度\n * @param derivativeFunc 微分函数\n * @param l 左点\n * @param r 右点\n * @param eps 精度\n * @return {*} number\n */\nfunction adaptiveSimpson38(derivativeFunc, l, r, eps = 0.001) {\n let f = derivativeFunc;\n let mid = (l + r) / 2;\n let st = simpson38(f, l, r);\n let sl = simpson38(f, l, mid);\n let sr = simpson38(f, mid, r);\n let ans = sl + sr - st;\n if(Math.abs(ans) <= 15 * eps) {\n return sl + sr + ans / 15;\n }\n return adaptiveSimpson38(f, l, mid, eps / 2) + adaptiveSimpson38(f, mid, r, eps / 2);\n}\n\n/**\n * bezier 曲线的长度\n * @param points 曲线的起止点 和 控制点\n * @param order 阶次, 2 和 3\n * @param startT 计算长度的起点,满足 0 <= startT <= endT <= 1\n * @param endT 计算长度的终点\n * @return {*} number\n */\nfunction bezierLength(points, order, startT = 0, endT = 1) {\n let derivativeFunc = t => norm(at(t, points, order));\n return adaptiveSimpson38(derivativeFunc, startT, endT);\n}\n\n/**\n * 3 阶 bezier 曲线的 order 阶导数在 t 位置时候的 (x, y) 的值\n */\nfunction at3(t, points, order = 1) {\n let [p0, p1, p2, p3] = points;\n let [x0, y0] = p0;\n let [x1, y1] = p1;\n let [x2, y2] = p2;\n let [x3, y3] = p3;\n let x = 0;\n let y = 0;\n if(order === 0) {\n x = Math.pow((1 - t), 3) * x0 + 3 * t * Math.pow((1 - t), 2) * x1 + 3 * (1 - t) * Math.pow(t, 2) * x2 + Math.pow(t, 3) * x3;\n y = Math.pow((1 - t), 3) * y0 + 3 * t * Math.pow((1 - t), 2) * y1 + 3 * (1 - t) * Math.pow(t, 2) * y2 + Math.pow(t, 3) * y3;\n }\n else if(order === 1) {\n x = 3 * ((1 - t) * (1 - t) * (x1 - x0) + 2 * (1 - t) * t * (x2 - x1) + t * t * (x3 - x2));\n y = 3 * ((1 - t) * (1 - t) * (y1 - y0) + 2 * (1 - t) * t * (y2 - y1) + t * t * (y3 - y2));\n }\n else if(order === 2) {\n x = 6 * (x2 - 2 * x1 + x0) * (1 - t) + 6 * (x3 - 2 * x2 + x1) * t;\n y = 6 * (y2 - 2 * y1 + y0) * (1 - t) + 6 * (y3 - 2 * y2 + y1) * t;\n }\n else if(order === 3) {\n x = 6 * (x3 - 3 * x2 + 3 * x1 - x0);\n y = 6 * (y3 - 3 * y2 + 3 * y1 - y0);\n }\n else {\n // 3阶导数就是常数了,大于3阶的都是0\n x = 0;\n y = 0;\n }\n return [x, y];\n}\n\n/**\n * 2 阶 bezier 曲线的 order 阶导数在 t 位置时候的 (x, y) 的值\n */\nfunction at2(t, points, order = 1) {\n let [p0, p1, p2] = points;\n let [x0, y0] = p0;\n let [x1, y1] = p1;\n let [x2, y2] = p2;\n let x = 0;\n let y = 0;\n if(order === 0) {\n x = Math.pow((1 - t), 2) * x0 + 2 * t * (1 - t) * x1 + Math.pow(t, 2) * x2;\n y = Math.pow((1 - t), 2) * y0 + 2 * t * (1 - t) * y1 + Math.pow(t, 2) * y2;\n }\n else if(order === 1) {\n x = 2 * (1 - t) * (x1 - x0) + 2 * t * (x2 - x1);\n y = 2 * (1 - t) * (y1 - y0) + 2 * t * (y2 - y1);\n }\n else if(order === 2) {\n x = 2 * (x2 - 2 * x1 + x0);\n y = 2 * (y2 - 2 * y1 + y0);\n }\n else {\n x = 0;\n y = 0;\n }\n return [x, y];\n}\n\nfunction at(t, points, bezierOrder, derivativeOrder = 1) {\n if(bezierOrder === 2) {\n return at2(t, points, derivativeOrder);\n }\n else if(bezierOrder === 3) {\n return at3(t, points, derivativeOrder);\n }\n}\n\nfunction pointAtBezier(points, order, percent, maxIteration, eps) {\n let length = bezierLength(points, order, 0, 1);\n return pointAtBezierWithLength(points, order, length, percent, maxIteration, eps);\n}\n\nfunction pointAtBezierWithLength(points, order, length, percent = 1, maxIteration = 20, eps = 0.001) {\n let derivativeFunc = t => norm(at(t, points, order));\n let targetLen = length * percent;\n let approachLen = length;\n let approachT = percent;\n let preApproachT = approachT;\n for(let i = 0; i < maxIteration; i++) {\n approachLen = simpson38(derivativeFunc, 0, approachT);\n let d = approachLen - targetLen;\n if(Math.abs(d) < eps) {\n break;\n }\n // Newton 法\n let derivative1 = norm(at(approachT, points, order, 1)); // 1 阶导数\n let derivative2 = norm(at(approachT, points, order, 2)); // 2 阶导数\n let numerator = d * derivative1;\n let denominator = d * derivative2 + derivative1 * derivative1;\n approachT = approachT - numerator / denominator;\n if(Math.abs(approachT - preApproachT) < eps) {\n break;\n }\n else {\n preApproachT = approachT;\n }\n }\n return at(approachT, points, order, 0);\n}\n\nfunction sliceBezier(points, t) {\n let [[x1, y1], [x2, y2], [x3, y3], p4] = points;\n let x12 = (x2 - x1) * t + x1;\n let y12 = (y2 - y1) * t + y1;\n let x23 = (x3 - x2) * t + x2;\n let y23 = (y3 - y2) * t + y2;\n let x123 = (x23 - x12) * t + x12;\n let y123 = (y23 - y12) * t + y12;\n if(points.length === 4) {\n let [x4, y4] = p4;\n let x34 = (x4 - x3) * t + x3;\n let y34 = (y4 - y3) * t + y3;\n let x234 = (x34 - x23) * t + x23;\n let y234 = (y34 - y23) * t + y23;\n let x1234 = (x234 - x123) * t + x123;\n let y1234 = (y234 - y123) * t + y123;\n return [[x1, y1], [x12, y12], [x123, y123], [x1234, y1234]];\n }\n else if(points.length === 3) {\n return [[x1, y1], [x12, y12], [x123, y123]];\n }\n}\n\nfunction sliceBezier2Both(points, start = 0, end = 1) {\n start = Math.max(start, 0);\n end = Math.min(end, 1);\n if(start === 0 && end === 1) {\n return points;\n }\n if(end < 1) {\n points = sliceBezier(points, end);\n }\n if(start > 0) {\n if(end < 1) {\n start = start / end;\n }\n points = sliceBezier(points.reverse(), (1 - start)).reverse();\n }\n return points;\n}\n\nfunction pointOnCircle(x, y, r, deg) {\n if(deg >= 270) {\n deg -= 270;\n deg = d2r(deg);\n return [\n x - Math.cos(deg) * r,\n y - Math.sin(deg) * r,\n ];\n }\n else if(deg >= 180) {\n deg -= 180;\n deg = d2r(deg);\n return [\n x - Math.sin(deg) * r,\n y + Math.cos(deg) * r,\n ];\n }\n else if(deg >= 90) {\n deg -= 90;\n deg = d2r(deg);\n return [\n x + Math.cos(deg) * r,\n y + Math.sin(deg) * r,\n ];\n }\n else {\n deg = d2r(deg);\n return [\n x + Math.sin(deg) * r,\n y - Math.cos(deg) * r,\n ];\n }\n}\n\nexport default {\n pointInPolygon,\n pointInQuadrilateral,\n d2r,\n r2d,\n // 贝塞尔曲线模拟1/4圆弧比例\n H,\n // <90任意角度贝塞尔曲线拟合圆弧的比例公式\n h,\n angleBySide,\n sideByAngle,\n pointsDistance,\n triangleIncentre,\n ellipsePoints,\n sectorPoints,\n getRectsIntersection,\n isRectsOverlap,\n isRectsInside,\n calCoordsInNode,\n calPercentInNode,\n bboxBezier,\n bezierLength,\n pointAtBezier,\n pointAtBezierWithLength,\n sliceBezier,\n sliceBezier2Both,\n pointOnCircle,\n};\n","/**\n * @typedef {Object} gradientStatement\n * @property {Array} color - 颜色rgba,0~255,如 [0, 255, 0, 255]\n * @property {number} angle - 角度,0~2 * Math.PI,(originX, originY) 为原点,垂直向上为0\n */\n\n/**\n * 获取渐变图像像素数组\n * @param {number} originX - 渐变中心x坐标(相对图片左上角(0,0)的值,可在图片外,下同)\n * @param {number} originY - 渐变中心y坐标\n * @param {number} width - 图片宽度\n * @param {number} height - 图片高度\n * @param {Array} stop - 渐变声明列表\n * @param data - canvas的imgData.data\n * @returns {Array} 图像像素数组,每4个元素(rgba)构成一个像素点\n * @example\n // 矩形宽度为200*200,此时坐标为0~199,渐变中心为中点时,应传入99.5,可消除零点问题\n // 若渐变中心在某一整数轴上,就会引入零点问题,此时零点取y轴正半轴的色值,要消除这个问题,可以对渐变中心增加一个偏移量,使其不为整数\n let w = 200;\n let h = 200;\n let ctx = document.getElementById('example').getContext('2d');\n let imgData = ctx.getImageData(0,0, w, h);\n let data = getConicGradientImage(99.5, 99.5, w, h, [{\n color: [0,0,0,255],\n angle: 0,\n } ,{\n color: [255,0,0,255],\n angle: 2 * Math.PI,\n }]);\n for (let i = 0; i < imgData.data.length; i++) {\n imgData.data[i] = data[i];\n }\n ctx.putImageData(imgData, 0, 0);\n */\nfunction getConicGradientImage(\n originX,\n originY,\n width,\n height,\n stop,\n data\n) {\n if(stop.length < 2) {\n throw new Error(\n 'Conic gradient should recieve at least 2 gradient statements (start line and end line).'\n );\n }\n\n width = Math.floor(width);\n height = Math.floor(height);\n\n /**\n * 根据坐标获取角度\n * @param {number} x - x坐标,左上角为原点\n * @param {number} y - y坐标,左上角为原点\n * @returns {number} angle - 角度,0~2 * Math.PI,(originX, originY) 为原点,垂直向上为0\n */\n let getAngle = (x, y) => {\n // 此函数注释内的x、y轴基于 (originX, originY)\n // 计算相对 (originX, originY) 的坐标(dx, dy)\n let dx = x - originX;\n let dy = originY - y;\n // 在y轴上\n if(dx === 0) {\n return dy < 0\n ? // y轴负半轴,\n 1 * Math.PI\n : // y轴正半轴,因此,(originX, originY) 的angle视作0\n 0;\n }\n // 在x轴上\n if(dy === 0) {\n return dx < 0\n ? // x轴负半轴\n 1.5 * Math.PI\n : // x轴正半轴\n 0.5 * Math.PI;\n }\n let atan = Math.atan(dy / dx);\n /**\n * 2 | 1\n * -----|-----\n * 3 | 4\n */\n // 第一象限,atan > 0\n // 第四象限,atan < 0\n if(dx > 0) {\n return 0.5 * Math.PI - atan;\n }\n // 第二象限,atan < 0\n // 第三象限,atan > 0\n if(dx < 0) {\n return 1.5 * Math.PI - atan;\n }\n };\n\n let increasingList = stop.map(item => ({\n color: item[0],\n angle: item[1] * Math.PI * 2,\n }));\n\n for(let y = 0; y < height; y++) {\n for(let x = 0; x < width; x++) {\n // step 1. 找到当前点坐标相对 (originX, originY) 的角度\n let angle = getAngle(x, y);\n // step 2. 找到当前点坐标对应的渐变区间\n let j;\n for(j = 0; j < increasingList.length && increasingList[j].angle <= angle; j++) {\n }\n let start = increasingList[j - 1];\n let end = increasingList[j];\n if(!(start && end)) {\n // step 2-1. 不在渐变区间里\n continue;\n }\n // step 3. 计算色值并填充\n let factor = (angle - start.angle) / (end.angle - start.angle);\n let color = end.color.map(\n (v, idx) => factor * (v - start.color[idx]) + start.color[idx]\n );\n let i = (x + y * width) * 4;\n data[i] = color[0];\n data[i+1] = color[1];\n data[i+2] = color[2];\n data[i+3] = Math.min(255, color[3] * 255);\n }\n }\n return data;\n}\n\nexport default {\n getConicGradientImage,\n};\n","function canvasPolygon(ctx, list, dx = 0, dy = 0) {\n if(!list || !list.length) {\n return;\n }\n let start = -1;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item) && item.length) {\n start = i;\n break;\n }\n }\n if(start === -1) {\n return;\n }\n ctx.moveTo(list[start][0] + dx, list[start][1] + dy);\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n ctx.lineTo(item[0] + dx, item[1] + dy);\n }\n else if(item.length === 4) {\n ctx.quadraticCurveTo(item[0] + dx, item[1] + dy, item[2] + dx, item[3] + dy);\n }\n else if(item.length === 6) {\n ctx.bezierCurveTo(item[0] + dx, item[1] + dy, item[2] + dx, item[3] + dy, item[4] + dx, item[5] + dy);\n }\n }\n}\n\nfunction svgPolygon(list) {\n if(!list || !list.length) {\n return '';\n }\n let start = -1;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item) && item.length) {\n start = i;\n break;\n }\n }\n if(start === -1) {\n return '';\n }\n let s = 'M' + list[start][0] + ',' + list[start][1];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n s += 'L' + item[0] + ',' + item[1];\n }\n else if(item.length === 4) {\n s += 'Q' + item[0] + ',' + item[1] + ' ' + item[2] + ',' + item[3];\n }\n else if(item.length === 6) {\n s += 'C' + item[0] + ',' + item[1] + ' ' + item[2] + ',' + item[3] + ' ' + item[4] + ',' + item[5];\n }\n }\n return s;\n}\n\nfunction canvasLine(ctx, x1, y1, x2, y2, controlA, controlB, num, dx = 0, dy = 0) {\n ctx.moveTo(x1 + dx, y1 + dy);\n if(num === 3) {\n ctx.bezierCurveTo(controlA[0] + dx, controlA[1] + dy, controlB[0] + dx, controlB[1], x2 + dx, y2 + dy);\n return 2;\n }\n else if(num === 2) {\n ctx.quadraticCurveTo(controlB[0] + dx, controlB[1] + dy, x2 + dx, y2 + dy);\n return 2;\n }\n else if(num === 1) {\n ctx.quadraticCurveTo(controlA[0] + dx, controlA[1] + dy, x2 + dx, y2 + dy);\n return 2;\n }\n else {\n ctx.lineTo(x2 + dx, y2 + dy);\n return 1;\n }\n}\n\nfunction svgLine(x1, y1, x2, y2, controlA, controlB, num) {\n if(num === 3) {\n return 'M' + x1 + ',' + y1\n + 'C' + controlA[0] + ',' + controlA[1] + ' ' + controlB[0] + ',' + controlB[1]\n + ' ' + x2 + ',' + y2;\n }\n else if(num === 2) {\n return 'M' + x1 + ',' + y1\n + 'Q' + controlB[0] + ',' + controlB[1]\n + ' ' + x2 + ',' + y2;\n }\n else if(num === 1) {\n return 'M' + x1 + ',' + y1\n + 'Q' + controlA[0] + ',' + controlA[1]\n + ' ' + x2 + ',' + y2;\n }\n else {\n return 'M' + x1 + ',' + y1 + 'L' + x2 + ',' + y2;\n }\n}\n\nfunction canvasFilter(filter) {\n let s = '';\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n s += `blur(${v}px)`;\n }\n else if(k === 'hue-rotate') {\n s += `hue-rotate(${v}deg)`;\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'grayscale' || k === 'contrast' || k === 'sepia' || k === 'invert') {\n s += `${k}(${v}%)`;\n }\n });\n return s;\n}\n\nexport default {\n canvasPolygon,\n svgPolygon,\n canvasLine,\n svgLine,\n canvasFilter,\n svgFilter: canvasFilter,\n};\n","import geom from '../math/geom';\nimport mode from '../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, VMAX, VMIN } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\nconst {\n STYLE_KEY: {\n BORDER_LEFT_WIDTH,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n PADDING_LEFT,\n PADDING_BOTTOM,\n PADDING_TOP,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n FONT_SIZE,\n },\n} = enums;\n\n/* 获取合适的虚线实体空白宽度ps/pd和数量n\n * 总长total,start边长bs,end边长be,内容长w,\n * 实体长范围[smin,smax],空白长范围[dmin,dmax]\n */\nfunction calFitDashed(total, bs, be, w, smin, smax, dmin, dmax) {\n let n = 1;\n let ps = 1;\n let pd = 1;\n // 从最大实体空白长开始尝试\n outer:\n for(let i = smax; i >= smin; i--) {\n for(let j = dmax; j >= dmin; j--) {\n // 已知实体空白长度,n实体和n-1空白组成total,计算获取n数量\n let per = i + j;\n let num = Math.floor((total + j) / per);\n let k = j;\n // 可能除不尽,此时扩展空白长\n if(num * per < j + total) {\n let free = total - num * i;\n k = free / (num - 1);\n if(k > dmax) {\n continue;\n }\n }\n per = i + k;\n // bs比实体大才有效,因为小的话必定和第一个实体完整相连\n if(bs > 1 && bs > i) {\n let mo = bs % per;\n if(mo > i) {\n continue;\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n if(num > 0) {\n n = num;\n ps = i;\n pd = k;\n }\n break outer;\n }\n }\n return {\n n,\n ps,\n pd,\n };\n}\n\n// dashed时n个实线和n-1虚线默认以3:1宽度组成,dotted则是n和n以1:1组成\nfunction calDashed(style, m1, m2, m3, m4, bw) {\n let total = m4 - m1;\n let w = m3 - m2;\n let bs = m2 - m1;\n let be = m4 - m3;\n if(style === 'dotted') {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n else {\n let { n, ps, pd } = calFitDashed(total, bs, be, w, bw, bw * 3, Math.max(1, bw * 0.25), bw * 2);\n if(n === 1) {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n // 降级为dotted\n return { n, ps, pd };\n }\n}\n\n// 获取边框分割为几块的坐标,虚线分割为若干四边形、三边型、五边形\n// 三边形重复内外边交点形成四边形,五边形进行切割形成2个四边形\n// direction为上右下左0123\nfunction calPoints(borderWidth, borderStyle, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, direction, beginRadius, endRadius) {\n let points = [];\n if(borderStyle === 'none') {\n return points;\n }\n if(['dashed', 'dotted'].indexOf(borderStyle) > -1) {\n // 寻找一个合适的虚线线段长度和之间空白边距长度\n let { n, ps, pd } = (direction === 0 || direction === 2)\n ? calDashed(borderStyle, x1, x2, x3, x4, borderWidth)\n : calDashed(borderStyle, y1, y2, y3, y4, borderWidth);\n if(n > 1) {\n for(let i = 0; i < n; i++) {\n // 最后一个可能没有到底,延长之\n let isLast = i === n - 1;\n let main1;\n let main2;\n let cross1;\n let cross2;\n if(direction === 0 || direction === 2) {\n main1 = i ? (x1 + ps * i + pd * i) : x1;\n }\n else {\n main1 = i ? (y1 + ps * i + pd * i) : y1;\n }\n main2 = main1 + ps;\n if(direction === 0) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x4, y1],\n [x3, y2],\n [x2, y2]\n ]);\n }\n else {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n cross2 = y1 + (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y1 + (x4 - main1) * Math.tan(deg2);\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x4, y1],\n [main1, cross1]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross1]\n ]);\n if(isLast) {\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x2, y2]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross2],\n [x3, y2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y1],\n [main2, y1],\n [main2, y2],\n [x2, y2]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y1 + (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross2]\n ]);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y1],\n [x3, y1],\n [x3, y2],\n [main1, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x3, y2],\n [main1, y2]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, y2],\n [main1, y2]\n ]);\n }\n }\n }\n }\n else if(direction === 1) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n cross1 = x4 - (main1 - y1) * Math.tan(deg1);\n cross2 = x4 - (main2 - y1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2],\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x3 + (main1 - y3) * Math.tan(deg2);\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x3 + (main2 - y3) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross2, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, x4],\n [x4, x4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n }\n else if(direction === 2) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x3, y3],\n [x4, y4]\n ]);\n }\n else {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n cross2 = y4 - (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y4 - (x4 - main1) * Math.tan(deg2);\n cross2 = y4 - (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, cross1],\n [x4, y4],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y4 - (main2 - x3) * Math.tan(deg2);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [main2, cross2],\n [main2, y4],\n [x3, y4]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y3],\n [main2, y3],\n [main2, y4],\n [x2, y4]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y4 - (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y4 - (main1 - x3) * Math.tan(deg1);\n points.push([\n [main1, cross2],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y3],\n [x3, y3],\n [x3, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y3],\n [x3, y3],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, y3],\n [main2, y3],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n }\n }\n else if(direction === 3) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x2, y2],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n cross2 = x1 + (main2 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x1 + (y4 - main1) * Math.tan(deg2);\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [x1, main1],\n [cross1, main1],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [x2, y2],\n [x1, y2]\n ]);\n if(isLast) {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4],\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x1 + (y4 - main2) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross2, main1],\n [x2, y2],\n [x1, y1]\n ]);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n }\n }\n if(direction === 0) {\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n }\n }\n // 兜底返回实线\n if(direction === 0) {\n if(x2 > x1) {\n points.push([\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1, y1]\n ]);\n }\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n if(y2 > y1) {\n points.push([\n [x4, y1],\n [x4, y1],\n [x4, y2],\n [x3, y2]\n ]);\n }\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n if(x2 > x1) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x2, y4],\n [x1, y4]\n ]);\n }\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n if(y2 > y1) {\n points.push([\n [x1, y1],\n [x1, y1],\n [x2, y2],\n [x1, y2]\n ]);\n }\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n}\n\nfunction calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[1][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[0][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[1][0] > oxr && points[0][0] < oxl) {\n let ya = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, ya],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y1],\n [oxr, y1],\n [oxr, y2],\n [oxl, y2],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y1],\n [x3, y1],\n [x3, y2],\n [oxl, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [oxr, y1],\n [oxr, y2],\n [x2, y2],\n ]);\n }\n else {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n }\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, yb]\n ]);\n }\n // 跨越右圆角\n else if(points[1][0] > oxr) {\n let y = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n centerList.push([\n points[0],\n [oxr, y1],\n [oxr, y],\n points[3]\n ]);\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, y]\n ]);\n }\n // 跨越左圆角\n else if(points[0][0] < oxl) {\n let y = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, y],\n points[3]\n ]);\n centerList.push([\n [oxl, y1],\n points[1],\n points[2],\n [oxl, y],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y1 + bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierTopLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopLeft(points[0], points[1], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopLeft(points[3], points[2], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 0);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 0);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y1 + ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierTopRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopRight(points[0], points[1], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopRight(points[3], points[2], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 1);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 1);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierTopLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(p1x, p1y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(p2x, p2y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierTopRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (oy - p1y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy - Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy - Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (oy - p2y));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy - Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[2][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[1][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[2][1] > oyb && points[1][1] < oyt) {\n let xa = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n let xb = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [xa, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x3, oyt],\n [x4, oyt],\n [x4, oyb],\n [x3, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, oyb],\n [x3, oyb],\n ]);\n }\n else {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n }\n endList.push([\n [xb, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[2][1] > oyb) {\n let x = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n centerList.push([\n points[0],\n points[1],\n [x4, oyb],\n [x, oyb]\n ]);\n endList.push([\n [x, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [x, oyt]\n ]);\n centerList.push([\n [x, oyt],\n [x4, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x4 - brx;\n let rx2 = brx - (x4 - x3);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightTop(beginList[0][1], beginList[0][2], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierRightTop(beginList[0][0], beginList[0][3], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightTop(points[1], points[2], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightTop(points[0], points[3], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 2);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 2);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x4 - erx;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierRightBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightBottom(points[1], points[2], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightBottom(points[0], points[3], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 3);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 3);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierRightTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox + Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox + Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox + Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierRightBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[2][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[3][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[2][0] > oxr && points[3][0] < oxl) {\n let ya = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n beginList.push([\n points[0],\n [oxl, ya],\n [oxl, y4],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y3],\n [oxr, y3],\n [oxr, y4],\n [oxl, y4],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y3],\n [x3, y3],\n [x3, y4],\n [oxl, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [oxr, y3],\n [oxr, y4],\n [x2, y4],\n ]);\n }\n else {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n }\n endList.push([\n [oxr, yb],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越右圆角\n else if(points[2][0] > oxr) {\n let y = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n centerList.push([\n points[0],\n [oxr, y],\n [oxr, y4],\n points[3]\n ]);\n endList.push([\n [oxr, y],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越左圆角\n else if(points[3][0] < oxl) {\n let y = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y3;\n beginList.push([\n points[0],\n [oxl, y],\n [oxl, y4],\n points[3]\n ]);\n centerList.push([\n [oxl, y],\n points[1],\n points[2],\n [oxl, y4],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y4 - bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierBottomLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomLeft(points[3], points[2], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomLeft(points[0], points[1], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 4);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 4);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y4 - ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierBottomRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomRight(points[3], points[2], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomRight(points[0], points[1], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 5);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 5);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierBottomLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (p2y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy + Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy + Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (p1y - oy));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy + Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierBottomRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[3][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[0][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[3][1] > oyb && points[0][1] < oyt) {\n let xa = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n let xb = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n beginList.push([\n points[0],\n points[1],\n [xa, oyt],\n [x1, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, oyb],\n [x1, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, oyb],\n [x1, oyb],\n ]);\n }\n else {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n }\n endList.push([\n [x1, oyb],\n [xb, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[3][1] > oyb) {\n let x = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n centerList.push([\n points[0],\n points[1],\n [x, oyb],\n [x1, oyb]\n ]);\n endList.push([\n [x1, oyb],\n [x, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n beginList.push([\n points[0],\n points[1],\n [x, oyt],\n [x1, oyt]\n ]);\n centerList.push([\n [x1, oyt],\n [x, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x1 + brx;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftTop(beginList[0][0], beginList[0][3], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierLeftTop(beginList[0][1], beginList[0][2], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftTop(points[0], points[3], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftTop(points[1], points[2], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 6);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 6);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x1 + erx;\n let rx2 = erx - (x2 - x1);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierLeftBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftBottom(points[0], points[3], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftBottom(points[1], points[2], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 7);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 7);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierLeftTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierLeftBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox - Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox - Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox - Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\n/**\n * 简单计算椭圆的圆化坐标控制点,视作重合位置,外面判断backgroundClip并调整坐标\n * @param x 起始x\n * @param y 起始y\n * @param w 宽\n * @param h 高\n * @param btlr borderTopLeftRadius\n * @param btrr borderTopRightRadius\n * @param bbrr borderBottomRightRadius\n * @param bblr borderBottomLeftRadius\n * @returns {[]} 多边形的顶点和曲线控制点\n */\nfunction calRadius(x, y, w, h, btlr, btrr, bbrr, bblr) {\n let need;\n let [btlx, btly] = btlr;\n let [btrx, btry] = btrr;\n let [bbrx, bbry] = bbrr;\n let [bblx, bbly] = bblr;\n btlx = Math.max(btlx, 0);\n btly = Math.max(btly, 0);\n btrx = Math.max(btrx, 0);\n btry = Math.max(btry, 0);\n bbrx = Math.max(bbrx, 0);\n bbry = Math.max(bbry, 0);\n bblx = Math.max(bblx, 0);\n bbly = Math.max(bbly, 0);\n // 圆角必须x/y都>0才有效,否则视为不绘制\n if(btlx > 0 && btly > 0 || btrx > 0 && btry > 0 || bbrx > 0 && bbry > 0 || bblx > 0 && bbly > 0) {\n need = true;\n }\n if(need) {\n let list = [];\n if(btlx > 0 && btly > 0) {\n list.push([x, y + btly]);\n list.push([x, y + (btly) * (1 - H), x + btlx * (1 - H), y, x + btlx, y]);\n }\n else {\n list.push([x, y]);\n }\n if(btrx > 0 && btry > 0) {\n list.push([x + w - btrx, y]);\n list.push([x + w - btrx * (1 - H), y, x + w, y + btry * (1 - H), x + w, y + btry]);\n }\n else {\n list.push([x + w, y]);\n }\n if(bbrx > 0 && bbry > 0) {\n list.push([x + w, y + h - bbry]);\n list.push([x + w, y + h - bbry * (1 - H), x + w - bbrx * (1 - H), y + h, x + w - bbrx, y + h]);\n }\n else {\n list.push([x + w, y + h]);\n }\n if(bblx > 0 && bbly > 0) {\n list.push([x + bblx, y + h]);\n list.push([x + bblx * (1 - H), y + h, x, y + h - bbly * (1 - H), x, y + h - bbly]);\n }\n else {\n list.push([x, y + h]);\n }\n return list;\n }\n}\n\nfunction limit(points, x, y, direction) {\n if(direction === 0) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 1) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 2) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 3) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 4) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 5) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 6) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 7) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n}\n\nconst BR_KS = [BORDER_TOP_LEFT_RADIUS, BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS];\nfunction calBorderRadius(w, h, currentStyle, computedStyle, root) {\n let noRadius = true;\n BR_KS.forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n if(item[0] > 0) {\n noRadius = false;\n }\n else {\n return 0;\n }\n if(item[1] === PX) {\n return Math.max(0, item[0]);\n }\n else if(item[1] === PERCENT) {\n return Math.max(0, item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n return Math.max(0, item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n return Math.max(0, item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n return Math.max(0, item[0] * root.height * 0.01);\n }\n else if(item[1] === VMAX) {\n return Math.max(0, item[0] * Math.max(root.width, root.height) * 0.01);\n }\n else if(item[1] === VMIN) {\n return Math.max(0, item[0] * Math.min(root.width, root.height) * 0.01);\n }\n return 0;\n });\n });\n // 优化提前跳出\n if(noRadius) {\n return;\n }\n // radius限制,相交的2个之和不能超过边长,如果2个都超过中点取中点,只有1个超过取交点,这包含了单个不能超过总长的逻辑\n BR_KS.forEach((k, i) => {\n let j = i % 2 === 0 ? 0 : 1;\n let target = j ? h : w;\n let prev = computedStyle[k];\n let next = computedStyle[BR_KS[(i + 1) % 4]];\n // 相加超过边长则是相交\n if(prev[j] + next[j] > target) {\n let half = target * 0.5;\n // 都超过一半中点取中点\n if(prev[j] >= half && next[j] >= half) {\n prev[j] = next[j] = half;\n }\n // 仅1个超过中点,因相交用总长减去另一方即可\n else if(prev[j] > half) {\n prev[j] = target - next[j];\n }\n else if(next[j] > half) {\n next[j] = target - prev[j];\n }\n }\n });\n}\n\nfunction calBorderRadiusInline(contentBoxList, currentStyle, computedStyle) {\n let first, last;\n if(contentBoxList.length) {\n first = contentBoxList[0];\n last = contentBoxList[contentBoxList.length - 1]\n }\n // 先看first的左侧\n let w = first ? first.outerWidth : 0, h = first ? first.outerHeight : 0;\n w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT];\n h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH]\n + computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM];\n [BORDER_TOP_LEFT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS].forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n let v;\n if(item[1] === PX) {\n v = Math.max(0, item[0]);\n v = Math.min(i ? h : w, v);\n }\n else {\n v = Math.max(0, item[0] * (i ? h : w) * 0.01);\n v = Math.min(i ? h : w, v);\n }\n return v;\n });\n });\n // 再看end的右侧\n w = last ? last.outerWidth : 0;\n h = last ? last.outerHeight : 0;\n [BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS].forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n let v;\n if(item[1] === PX) {\n v = Math.max(0, item[0]);\n v = Math.min(i ? h : w, v);\n }\n else {\n v = Math.max(0, item[0] * (i ? h : w) * 0.01);\n v = Math.min(i ? h : w, v);\n }\n return v;\n });\n });\n}\n\nfunction renderBorder(xom, renderMode, ctx, points, color, dx, dy) {\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n points.forEach(point => {\n canvasPolygon(ctx, point, dx, dy);\n });\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let s = '';\n points.forEach(point => {\n s += svgPolygon(point);\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', s],\n ['fill', color],\n ],\n });\n }\n}\n\nexport default {\n calPoints,\n calRadius,\n calBorderRadius,\n calBorderRadiusInline,\n renderBorder,\n};\n","// 类型为引用防止json仿造\nconst TYPE_VD = Symbol('Dom');\nconst TYPE_GM = Symbol('Geom');\nconst TYPE_CP = Symbol('Component');\n\nexport default {\n TYPE_VD,\n TYPE_GM,\n TYPE_CP,\n};\n","import $$type from './$$type';\nimport mx from '../math/matrix';\n\nlet toString = {}.toString;\nfunction isType(type) {\n return function(obj) {\n return toString.call(obj) === '[object ' + type + ']';\n }\n}\n\nlet isObject = isType('Object');\nlet isString = isType('String');\nlet isFunction = isType('Function');\nlet isNumber = isType('Number');\nlet isBoolean = isType('Boolean');\nlet isDate = isType('Date');\n\nlet hasOwn = {}.hasOwnProperty;\nlet fnToString = hasOwn.toString;\nlet ObjectFunctionString = fnToString.call(Object);\n\nfunction isNil(v) {\n return v === undefined || v === null;\n}\n\nfunction joinSourceArray(arr) {\n let res = '';\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n res += joinSourceArray(item);\n }\n else {\n res += stringify(item);\n }\n }\n return res;\n}\n\nfunction stringify(s) {\n if(isNil(s)) {\n return '';\n }\n return s.toString();\n}\n\nfunction encodeHtml(s, prop) {\n if(prop) {\n return s.replace(/\"/g, '"');\n }\n return s.replace(/&/g, '&').replace(/ {\n 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(typeof location === 'undefined' || location.hostname !== host[1]) {\n img.crossOrigin = 'anonymous';\n }\n }\n }\n img.src = url;\n if(debug.flag && typeof document !== 'undefined') {\n document.body.appendChild(img);\n }\n }\n },\n warn(s) {\n console.warn(s);\n },\n error(s) {\n console.error(s);\n },\n requestAnimationFrame(cb) {\n if(!cb) {\n return;\n }\n let res;\n if(typeof requestAnimationFrame !== 'undefined') {\n inject.requestAnimationFrame = requestAnimationFrame.bind(window);\n res = requestAnimationFrame(cb);\n }\n else {\n res = setTimeout(cb, SPF);\n inject.requestAnimationFrame = function(cb) {\n return setTimeout(cb, SPF);\n };\n }\n return res;\n },\n cancelAnimationFrame(id) {\n let res;\n if(typeof cancelAnimationFrame !== 'undefined') {\n inject.cancelAnimationFrame = cancelAnimationFrame.bind(window);\n res = cancelAnimationFrame(id);\n }\n else {\n res = clearTimeout(id);\n inject.cancelAnimationFrame = function(id) {\n return clearTimeout(id);\n };\n }\n return res;\n },\n now() {\n if(typeof performance !== 'undefined') {\n inject.now = function() {\n return Math.floor(performance.now());\n };\n return Math.floor(performance.now());\n }\n inject.now = Date.now.bind(Date);\n return Date.now();\n },\n hasCacheCanvas(key) {\n return key && CANVAS.hasOwnProperty(key);\n },\n getCacheCanvas(width, height, key, message) {\n return cacheCanvas(key, width, height, message);\n },\n releaseCacheCanvas(o) {\n CANVAS_LIST.push(o);\n },\n delCacheCanvas(key) {\n key && delete CANVAS[key];\n },\n hasCacheWebgl(key) {\n return key && WEBGL.hasOwnProperty(key);\n },\n getCacheWebgl(width, height, key, message) {\n return cacheWebgl(key, width, height, message);\n },\n releaseCacheWebgl(o) {\n WEBGL_LIST.push(o);\n },\n delCacheWebgl(key) {\n key && delete WEBGL[key];\n },\n isDom(o) {\n if(o) {\n if(util.isString(o)) {\n return true;\n }\n if(typeof window !== 'undefined' && window.Element && (o instanceof window.Element)) {\n return true;\n }\n if(typeof window !== 'undefined' && window.OffscreenCanvas && (o instanceof window.OffscreenCanvas)) {\n return true;\n }\n // worker\n if(typeof self !== 'undefined' && self.OffscreenCanvas && (o instanceof self.OffscreenCanvas)) {\n return true;\n }\n if(util.isFunction(o.getElementsByTagName)) {\n return true;\n }\n }\n return false;\n },\n isWebGLTexture(o) {\n if(o && typeof WebGLTexture !== 'undefined') {\n return o instanceof WebGLTexture;\n }\n },\n checkSupportFontFamily(ff) {\n ff = ff.toLowerCase();\n // 强制arial兜底\n if(ff === 'arial' || ff === 'serif' || ff === 'sans-serif' || ff === 'sansserif') {\n return true;\n }\n if(!font.info.hasOwnProperty(ff)) {\n return false;\n }\n if(font.info[ff].hasOwnProperty('checked')) {\n return font.info[ff].checked;\n }\n let canvas = inject.getCacheCanvas(16, 16, '__$$CHECK_SUPPORT_FONT_FAMILY$$__');\n let context = canvas.ctx;\n context.textAlign = 'center';\n context.fillStyle = '#000';\n context.textBaseline = 'middle';\n if(!defaultFontFamilyData) {\n context.clearRect(0, 0, 16, 16);\n context.font = '16px arial';\n context.fillText('a', 8, 8);\n canvas.draw();\n defaultFontFamilyData = context.getImageData(0, 0, 16, 16).data;\n }\n context.clearRect(0, 0, 16, 16);\n context.font = '16px ' + ff;\n context.fillText('a', 8, 8);\n canvas.draw();\n let data = context.getImageData(0, 0, 16, 16).data;\n for(let i = 0, len = data.length; i < len; i++) {\n if(defaultFontFamilyData[i] !== data[i]) {\n return font.info[ff].checked = true;\n }\n }\n return font.info[ff].checked = false;\n },\n loadFont(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, VMAX, VMIN, calUnit } = unit;\nconst { d2r } = geom;\nconst { canvasPolygon, svgPolygon } = painter;\nconst {\n STYLE_KEY: {\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\n\nfunction getLinearDeg(v) {\n let deg = 180;\n if(v === 'to top') {\n deg = 0;\n }\n else if(v === 'to top right') {\n deg = 45;\n }\n else if(v === 'to right') {\n deg = 90;\n }\n else if(v === 'to bottom right') {\n deg = 135;\n }\n else if(v === 'to bottom') {\n }\n else if(v === 'to bottom left') {\n deg = 225;\n }\n else if(v === 'to left') {\n deg = 270;\n }\n else if(v === 'to top left') {\n deg = 315;\n }\n // 数字角度,没有的话取默认角度\n else {\n let match = /([-+]?[\\d.]+)deg/.exec(v);\n if(match) {\n deg = parseFloat(match[1]);\n }\n }\n return deg % 360;\n}\n\nfunction getRadialPosition(data) {\n if(/^[-+]?[\\d.]/.test(data)) {\n let v = calUnit(data);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[data] || 50,\n PERCENT,\n ];\n }\n}\n\n// 获取color-stop区间范围,去除无用值\nfunction getColorStop(v, length, root) {\n let list = [];\n let firstColor = v[0][0];\n // 先把已经声明距离的换算成[0,1]以数组形式存入,未声明的原样存入\n for(let i = 0, len = v.length; i < len; i++) {\n let item = v[i];\n // 考虑是否声明了位置\n if(item.length > 1) {\n let p = item[1];\n if(p[1] === PERCENT) {\n list.push([item[0], p[0] * 0.01]);\n }\n else if(p[1] === REM) {\n list.push([item[0], p[0] * root.computedStyle[FONT_SIZE] / length]);\n }\n else if(p[1] === VW) {\n list.push([item[0], p[0] * root.width / length]);\n }\n else if(p[1] === VH) {\n list.push([item[0], p[0] * root.height / length]);\n }\n else if(p[1] === VMAX) {\n list.push([item[0], p[0] * Math.max(root.width, root.height) / length]);\n }\n else if(p[1] === VMIN) {\n list.push([item[0], p[0] * Math.min(root.width, root.height) / length]);\n }\n else {\n list.push([item[0], p[0] / length]);\n }\n }\n else {\n list.push([item[0]]);\n }\n }\n if(list.length === 1) {\n list.push(util.clone(list[0]));\n }\n // 首尾不声明默认为[0, 1]\n if(list[0].length === 1) {\n list[0].push(0);\n }\n if(list.length > 1) {\n let i = list.length - 1;\n if(list[i].length === 1) {\n list[i].push(1);\n }\n }\n // 找到未声明位置的,需区间计算,找到连续的未声明的,前后的区间平分\n let start = list[0][1];\n for(let i = 1, len = list.length; i < len - 1; i++) {\n let item = list[i];\n if(item.length > 1) {\n start = item[1];\n }\n else {\n let j = i + 1;\n let end = list[list.length - 1][1];\n for(; j < len - 1; j++) {\n let item = list[j];\n if(item.length > 1) {\n end = item[1];\n break;\n }\n }\n let num = j - i + 1;\n let per = (end - start) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.push(start + per * (k + 1 - i));\n }\n i = j;\n }\n }\n // 每个不能小于前面的,canvas/svg不能兼容这种情况,需处理\n for(let i = 1, len = list.length; i < len; i++) {\n let item = list[i];\n let prev = list[i - 1];\n if(item[1] < prev[1]) {\n item[1] = prev[1];\n }\n }\n // 0之前的和1之后的要过滤掉\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item[1] > 1) {\n list.splice(i);\n let prev = list[i - 1];\n if(prev && prev[1] < 1) {\n let dr = item[0][0] - prev[0][0];\n let dg = item[0][1] - prev[0][1];\n let db = item[0][2] - prev[0][2];\n let da = item[0][3] - prev[0][3];\n let p = (1 - prev[1]) / (item[1] - prev[1]);\n list.push([\n [\n item[0][0] + dr * p,\n item[0][1] + dg * p,\n item[0][2] + db * p,\n item[0][3] + da * p,\n ],\n 1],\n );\n }\n break;\n }\n }\n for(let i = list.length - 1; i >= 0; i--) {\n let item = list[i];\n if(item[1] < 0) {\n list.splice(0, i + 1);\n let next = list[i];\n if(next && next[1] > 0) {\n let dr = next[0][0] - item[0][0];\n let dg = next[0][1] - item[0][1];\n let db = next[0][2] - item[0][2];\n let da = next[0][3] - item[0][3];\n let p = (-item[1]) / (next[1] - item[1]);\n list.unshift([\n [\n item[0][0] + dr * p,\n item[0][1] + dg * p,\n item[0][2] + db * p,\n item[0][3] + da * p,\n ],\n 0],\n );\n }\n break;\n }\n }\n // 可能存在超限情况,如在使用px单位超过len或 {\n // item[0] = int2rgba(item[0]);\n if(item[1] < 0) {\n item[1] = 0;\n }\n else if(item[1] > 1) {\n item[1] = 1;\n }\n });\n // 都超限时,第一个颜色兜底\n if(!list.length) {\n list.push([firstColor, 0]);\n }\n return list;\n}\n\n// 根据角度和圆心获取渐变的4个点坐标\nfunction calLinearCoords(deg, length, cx, cy) {\n let x0;\n let y0;\n let x1;\n let y1;\n if(deg >= 270) {\n let r = d2r(360 - deg);\n x0 = cx + Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n else if(deg >= 180) {\n let r = d2r(deg - 180);\n x0 = cx + Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else if(deg >= 90) {\n let r = d2r(180 - deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else {\n let r = d2r(deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n return [x0, y0, x1, y1];\n}\n\nfunction calCircleCentre(position, x1, y1, iw, ih, root) {\n let cx, cy;\n let positionX = position[0], positionY = position[1];\n if(positionX[1] === PERCENT) {\n cx = x1 + positionX[0] * iw * 0.01;\n }\n else if(positionX[1] === REM) {\n cx = x1 + positionX[0] * root.computedStyle[FONT_SIZE];\n }\n else if(positionX[1] === VW) {\n cx = x1 + positionX[0] * root.width * 0.01;\n }\n else if(positionX[1] === VH) {\n cx = x1 + positionX[0] * root.height * 0.01;\n }\n else if(positionX[1] === VMAX) {\n cx = x1 + positionX[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(positionX[1] === VMIN) {\n cx = x1 + positionX[0] * Math.min(root.width, root.height) * 0.01;\n }\n else {\n cx = x1 + positionX[0];\n }\n if(positionY[1] === PERCENT) {\n cy = y1 + positionY[0] * ih * 0.01;\n }\n else if(positionY[1] === REM) {\n cy = y1 + positionY[0] * root.computedStyle[FONT_SIZE];\n }\n else if(positionY[1] === VW) {\n cy = y1 + positionY[0] * root.width * 0.01;\n }\n else if(positionY[1] === VH) {\n cy = y1 + positionY[0] * root.height * 0.01;\n }\n else if(positionY[1] === VH) {\n cy = y1 + positionY[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(positionY[1] === VH) {\n cy = y1 + positionY[0] * Math.min(root.width, root.height) * 0.01;\n }\n else {\n cy = y1 + positionY[0];\n }\n return [cx, cy];\n}\n\n// 获取径向渐变圆心半径\nfunction calRadialRadius(shape, size, position, iw, ih, x1, y1, x2, y2, root) {\n let cx, cy, xl, yl, r, tx, ty, d = 0;\n // 扩展的from to ratio格式,圆心、长轴坐标、短轴缩放比\n if(Array.isArray(size)) {\n cx = x1 + size[0] * iw;\n cy = y1 + size[1] * ih;\n tx = x1 + size[4] * iw;\n ty = y1 + size[5] * ih;\n if(size[6] <= 0) {\n r = Math.min(Math.abs(cx - x1), Math.min(Math.abs(cy - y1), Math.min(Math.abs(cy - y2), Math.min(Math.abs(cx - y2)))));\n }\n else {\n xl = Math.sqrt(Math.pow((size[2] - size[0]) * iw, 2) + Math.pow((size[3] - size[1]) * ih, 2));\n yl = xl * size[6];\n r = Math.max(xl, yl);\n // 看旋转\n if(xl !== yl) {\n if(size[2] >= size[0]) {\n if(size[3] >= size[1]) {\n d = Math.asin((size[3] - size[1]) * ih / xl);\n }\n else {\n d = -Math.asin((size[1] - size[3]) * ih / xl);\n }\n }\n else {\n if(size[3] >= size[1]) {\n d = d2r(180) - Math.asin((size[3] - size[1]) * ih / xl);\n }\n else {\n d = Math.asin((size[1] - size[3]) * ih / xl) - d2r(180);\n }\n }\n }\n }\n }\n else {\n // 默认椭圆a是水平轴,b是垂直轴\n [cx, cy] = calCircleCentre(position, x1, y1, iw, ih, root);\n tx = cx;\n ty = cy;\n let ratio = 1;\n if(size === 'closest-corner' && shape === 'circle') {\n if(cx <= x1 || cx >= x2 || cy <= y1 || cy >= y2) {\n r = Math.min(Math.abs(cx - x1), Math.min(Math.abs(cy - y1), Math.min(Math.abs(cy - y2), Math.min(Math.abs(cx - y2)))));\n }\n else {\n if(cx < x1 + iw * 0.5) {\n xl = cx - x1;\n }\n else {\n xl = x2 - cx;\n }\n if(cy < y1 + ih * 0.5) {\n yl = cy - y1;\n }\n else {\n yl = y2 - cy;\n }\n r = Math.sqrt(Math.pow(xl, 2) + Math.pow(yl, 2));\n }\n }\n else if(size === 'closest-side' || size === 'closest-corner') {\n // 在边外特殊情况只有end颜色填充\n if(cx <= x1 || cx >= x2 || cy <= y1 || cy >= y2) {\n r = Math.min(Math.abs(cx - x1), Math.min(Math.abs(cy - y1), Math.min(Math.abs(cy - y2), Math.min(Math.abs(cx - y2)))));\n }\n else {\n let ratio = 1;\n if(cx < x1 + iw * 0.5) {\n xl = cx - x1;\n }\n else {\n xl = x2 - cx;\n }\n if(cy < y1 + ih * 0.5) {\n yl = cy - y1;\n }\n else {\n yl = y2 - cy;\n }\n r = Math.min(xl, yl);\n // css的角和边有对应关系,即边扩展倍数,计算为固定值\n if(size === 'closest-corner') {\n ratio = Math.sqrt(2);\n }\n xl *= ratio;\n yl *= ratio;\n r *= ratio;\n }\n }\n else {\n if(cx <= x1) {\n xl = x1 - cx + iw;\n }\n else if(cx >= x2) {\n xl = cx - x2 + iw;\n }\n else if(cx < x1 + iw * 0.5) {\n xl = x2 - cx;\n }\n else {\n xl = cx - x1;\n }\n if(cy <= y1) {\n yl = y1 - cy + ih;\n }\n else if(cy >= y2) {\n yl = cy - y2 + ih;\n }\n else if(cy < y1 + ih * 0.5) {\n yl = y2 - cy;\n }\n else {\n yl = cy - y1;\n }\n r = Math.max(xl, yl);\n if(size !== 'farthest-side') {\n ratio = Math.sqrt(2);\n }\n xl *= ratio;\n yl *= ratio;\n r *= ratio;\n }\n }\n if(shape === 'circle') {\n xl = yl = r;\n }\n return [cx, cy, r, xl, yl, tx, ty, d];\n}\n\nfunction parseGradient(s) {\n let gradient = reg.gradient.exec(s);\n if(gradient) {\n let o = {\n k: gradient[1],\n };\n if(o.k === 'linear') {\n let deg = /([-+]?[\\d.]+deg)|(to\\s+[toprighbml]+)/i.exec(gradient[2]);\n if(deg) {\n o.d = getLinearDeg(deg[0].toLowerCase());\n }\n // 扩展支持从a点到b点相对坐标,而不是css角度,sketch等ui软件中用此格式\n else {\n let points = /([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)/.exec(gradient[2]);\n if(points) {\n o.d = [parseFloat(points[1]), parseFloat(points[2]), parseFloat(points[3]), parseFloat(points[4])];\n }\n else {\n o.d = 180;\n }\n }\n }\n else if(o.k === 'radial') {\n o.s = gradient[2].indexOf('circle') > -1 ? 'circle' : 'ellipse';\n let size = /(closest|farthest)-(side|corner)/i.exec(gradient[2]);\n if(size) {\n o.z = size[0].toLowerCase();\n }\n // 扩展支持从a点到b点相对坐标,而不是size,sketch等ui软件中用此格式\n else {\n let points = /([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)(?:\\s+([-+]?[\\d.]+))?(?:\\s+([-+]?[\\d.]+))?(?:\\s+([-+]?[\\d.]+))?/.exec(gradient[2]);\n if(points) {\n o.z = [parseFloat(points[1]), parseFloat(points[2]), parseFloat(points[3]), parseFloat(points[4])];\n let i5 = !isNil(points[5]), i6 = !isNil(points[6]), i7 = !isNil(points[7]);\n // 重载,567是偏移x/y和ratio,都可省略即不偏移和半径1,只有5是ratio,只有56是x/y\n if(i5 && i6 && i7) {\n o.z.push(parseFloat(points[5]));\n o.z.push(parseFloat(points[6]));\n o.z.push(parseFloat(points[7]));\n }\n else if(i5 && i6) {\n o.z.push(parseFloat(points[5]));\n o.z.push(parseFloat(points[6]));\n o.z.push(1);\n }\n else if(i5) {\n o.z.push(o.z[0]);\n o.z.push(o.z[1]);\n o.z.push(parseFloat(points[5]));\n }\n else {\n o.z.push(o.z[0]);\n o.z.push(o.z[1])\n o.z.push(1);\n }\n }\n else {\n o.z = 'farthest-corner';\n }\n }\n let position = /at\\s+((?:[-+]?[\\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]);\n if(position) {\n let x = getRadialPosition(position[1]);\n let y = position[2] ? getRadialPosition(position[2]) : x;\n o.p = [x, y];\n }\n else {\n o.p = [[50, PERCENT], [50, PERCENT]];\n }\n }\n else if(o.k === 'conic') {\n let deg = /([-+]?[\\d.]+deg)/i.exec(gradient[2]);\n if(deg) {\n o.d = parseFloat(deg[0]) % 360;\n }\n else {\n o.d = 0;\n }\n let position = /at\\s+((?:[-+]?[\\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]);\n if(position) {\n let x = getRadialPosition(position[1]);\n let y = position[2] ? getRadialPosition(position[2]) : x;\n o.p = [x, y];\n }\n else {\n o.p = [[50, PERCENT], [50, PERCENT]];\n }\n }\n let v = gradient[2].match(/(([-+]?[\\d.]+[pxremvwhina%]+)?\\s*((#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))\\s*([-+]?[\\d.]+[pxremvwhina%]+)?)|(transparent)/ig) || [];\n o.v = v.map(item => {\n let color = /(?:#[0-9a-f]{3,8})|(?:rgba?\\s*\\(.+?\\))|(?:transparent)/i.exec(item);\n let arr = [rgba2int(color[0])];\n let percent = /[-+]?[\\d.]+[pxremvwhina%]+/.exec(item);\n if(percent) {\n let v = calUnit(percent[0]);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n arr[1] = v;\n }\n return arr;\n });\n return o;\n }\n}\n\nfunction getLinear(v, d, ox, oy, cx, cy, w, h, root, dx = 0, dy = 0) {\n ox += dx;\n oy += dy;\n cx += dx;\n cy += dy;\n // d为数组是2个坐标点,数字是css标准角度\n let x1, y1, x2, y2, stop;\n if(Array.isArray(d)) {\n x1 = ox + d[0] * w;\n y1 = oy + d[1] * h;\n x2 = ox + d[2] * w;\n y2 = oy + d[3] * h;\n let total = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n stop = getColorStop(v, total);\n }\n else {\n while(d >= 360) {\n d -= 360;\n }\n while(d < 0) {\n d += 360;\n }\n // 根据角度求直线上2点,设置半径为长宽最大值,这样一定在矩形外,看做一个向量A\n let len = Math.max(w, h);\n let coords = calLinearCoords(d, len, cx, cy, w, h);\n len *= 2;\n // start和4个顶点的向量在A上的投影长度\n let l1 = vector.dotProduct(ox - coords[0], oy - coords[1], coords[2] - coords[0], coords[3] - coords[1]) / len;\n let l2 = vector.dotProduct(ox + w - coords[0], oy - coords[1], coords[2] - coords[0], coords[3] - coords[1]) / len;\n let l3 = vector.dotProduct(ox + w - coords[0], oy + h - coords[1], coords[2] - coords[0], coords[3] - coords[1]) / len;\n let l4 = vector.dotProduct(ox - coords[0], oy + h - coords[1], coords[2] - coords[0], coords[3] - coords[1]) / len;\n // 最小和最大值为0~100%\n let min = l1, max = l1;\n min = Math.min(min, Math.min(l2, Math.min(l3, l4)));\n max = Math.max(max, Math.max(l2, Math.max(l3, l4)));\n // 求得0和100%的长度和坐标\n let total = max - min;\n let r1 = min / len;\n let dx = coords[2] - coords[0];\n let dy = coords[3] - coords[1];\n x1 = coords[0] + dx * r1;\n y1 = coords[1] + dy * r1;\n x2 = coords[2] - dx * r1;\n y2 = coords[3] - dy * r1;\n stop = getColorStop(v, total, root);\n }\n return {\n x1,\n y1,\n x2,\n y2,\n stop,\n };\n}\n\nfunction getRadial(v, shape, size, position, x1, y1, x2, y2, root) {\n let w = x2 - x1;\n let h = y2 - y1;\n let [cx, cy, r, xl, yl, tx, ty, d] = calRadialRadius(shape, size, position, w, h, x1, y1, x2, y2, root);\n // 圆形取最小值,椭圆根据最小圆进行transform,椭圆其中一边轴和r一样,另一边则大小缩放可能\n let matrix, scx = 1, scy = 1;\n if(xl !== yl || d) {\n matrix = [1, 0, 0, 1, 0, 0];\n if(d) {\n let sin = Math.sin(d);\n let cos = Math.cos(d);\n matrix = [cos, sin, 0, 0, -sin, cos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n }\n if(xl !== r) {\n scx = xl / r;\n let m = [scx, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n matrix = mx.multiply(matrix, m);\n }\n if(yl !== r) {\n scy = yl / r;\n let m = [1, 0, 0, 0, 0, scy, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n matrix = mx.multiply(matrix, m);\n }\n }\n let stop = getColorStop(v, r, root);\n return {\n cx,\n cy,\n tx,\n ty,\n r,\n stop,\n scx,\n scy,\n matrix,\n d,\n };\n}\n\nfunction getConic(v, d, p, x1, y1, x2, y2, ratio, root) {\n let [cx, cy, r, deg] = calConicRadius(v, d, p, x1, y1, x2, y2, root);\n let stop = getColorStop(v, 1, root);\n r <<= 1; // 锥形半径*2,这样分割画圆时保证一定会填满原有矩形\n r *= ratio; // 矢量图形比较特殊,有可能超限,传入个倍数扩大半径\n return {\n cx,\n cy,\n w: x2 - x1,\n h: y2 - y1,\n r,\n deg,\n stop,\n };\n}\n\nfunction calConicRadius(v, deg, position, x1, y1, x2, y2, root) {\n let iw = x2 - x1;\n let ih = y2 - y1;\n let [cx, cy] = calCircleCentre(position, x1, y1, iw, ih, root);\n let r, a, b;\n if(cx >= x1 + iw * 0.5) {\n a = cx - x1;\n }\n else {\n a = x2 - cx;\n }\n if(cy >= y1 + ih * 0.5) {\n b = cy - y1;\n }\n else {\n b = y2 - cy;\n }\n r = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n return [cx, cy, r, deg];\n}\n\nfunction renderConic(xom, renderMode, ctx, res, x, y, w, h, btlr, btrr, bbrr, bblr, isInline) {\n // border-radius使用三次贝塞尔曲线模拟1/4圆角,误差在[0, 0.000273]之间\n let list = border.calRadius(x, y, w, h, btlr, btrr, bbrr, bblr);\n if(!list) {\n list = [\n [x, y],\n [x + w, y],\n [x + w, y + h],\n [x, y + h],\n [x, y],\n ];\n }\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n let offscreen = inject.getCacheCanvas(w, h, '__$$CONIC_GRADIENT$$__');\n let imgData = offscreen.ctx.getImageData(0,0, w, h);\n gradient.getConicGradientImage(res.cx - x, res.cy - y, res.w, res.h, res.stop, imgData.data);\n offscreen.ctx.putImageData(imgData, 0, 0);\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(offscreen.canvas, x, y);\n ctx.restore();\n offscreen.ctx.clearRect(0, 0, w, h);\n }\n else if(renderMode === mode.SVG) {\n if(isInline) {\n let v = {\n tagName: 'symbol',\n props: [],\n children: [],\n };\n xom.__config[NODE_DEFS_CACHE].push(v);\n res.forEach(item => {\n v.children.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(item[0])],\n ['fill', item[1]],\n ],\n });\n });\n return ctx.add(v);\n }\n else {\n let v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(list)],\n ],\n }],\n };\n xom.__config[NODE_DEFS_CACHE].push(v);\n let clip = ctx.add(v);\n res.forEach(item => {\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(item[0])],\n ['fill', item[1]],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n });\n }\n }\n}\n\nexport default {\n parseGradient,\n getLinear,\n getRadial,\n getConic,\n renderConic,\n};\n","const DOM = {\n position: 'static',\n display: 'block',\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto',\n marginTop: 0,\n marginRight: 0,\n marginBottom: 0,\n marginLeft: 0,\n paddingTop: 0,\n paddingRight: 0,\n paddingBottom: 0,\n paddingLeft: 0,\n fontSize: 'inherit',\n fontFamily: 'inherit',\n color: 'inherit',\n fontStyle: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'inherit',\n backgroundImage: null,\n backgroundColor: 'transparent',\n backgroundSize: 'auto',\n backgroundRepeat: 'repeat',\n backgroundPositionX: 0,\n backgroundPositionY: 0,\n backgroundClip: 'borderBox',\n borderTopWidth: 0,\n borderRightWidth: 0,\n borderBottomWidth: 0,\n borderLeftWidth: 0,\n borderTopColor: 'transparent',\n borderRightColor: 'transparent',\n borderBottomColor: 'transparent',\n borderLeftColor: 'transparent',\n borderTopStyle: 'none',\n borderRightStyle: 'none',\n borderBottomStyle: 'none',\n borderLeftStyle: 'none',\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomLeftRadius: 0,\n width: 'auto',\n height: 'auto',\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto',\n flexDirection: 'row',\n flexWrap: 'nowrap',\n order: 0,\n justifyContent: 'flexStart',\n alignItems: 'stretch',\n alignSelf: 'auto',\n alignContent: 'stretch',\n textAlign: 'inherit',\n letterSpacing: 'inherit',\n transformOrigin: 'center',\n visibility: 'inherit',\n opacity: 1,\n zIndex: 0,\n transform: null,\n translateX: 0,\n translateY: 0,\n translateZ: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n skewX: 0,\n skewY: 0,\n rotateX: 0,\n rotateY: 0,\n rotateZ: 0,\n rotate3d: '0, 0, 0, 0',\n perspective: 0,\n perspectiveOrigin: 'center',\n filter: null,\n boxShadow: null,\n pointerEvents: 'inherit',\n overflow: 'visible',\n mixBlendMode: 'normal',\n whiteSpace: 'inherit',\n textOverflow: 'clip',\n lineClamp: 0,\n textStrokeWidth: 'inherit',\n textStrokeColor: 'inherit',\n textStrokeOver: 'inherit',\n};\n\nconst GEOM = {\n fill: 'transparent',\n stroke: '#000',\n strokeWidth: 1,\n strokeDasharray: '',\n strokeLinecap: 'butt',\n strokeLinejoin: 'miter',\n strokeMiterlimit: 4,\n fillRule: 'nonzero',\n};\n\nlet DOM_ENTRY_SET = [];\nlet DOM_KEY_SET = [];\nObject.keys(DOM).forEach(k => {\n DOM_KEY_SET.push(k);\n let v = DOM[k];\n DOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet GEOM_ENTRY_SET = [];\nlet GEOM_KEY_SET = [];\nObject.keys(GEOM).forEach(k => {\n GEOM_KEY_SET.push(k);\n let v = GEOM[k];\n GEOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet INHERIT = {\n fontFamily: 'arial',\n fontSize: 16,\n fontWeight: 400,\n fontStyle: 'normal',\n color: '#000',\n textAlign: 'left',\n visibility: 'visible',\n pointerEvents: 'auto',\n textStrokeColor: '#000',\n textStrokeWidth: 1,\n textStrokeOver: 'none',\n};\n\nlet INHERIT_KEY_SET = [];\nObject.keys(INHERIT).forEach(k => {\n INHERIT_KEY_SET.push(k);\n});\n\nexport default {\n DOM,\n GEOM,\n isValid(i) {\n return DOM.hasOwnProperty(i) || GEOM.hasOwnProperty(i);\n },\n DOM_KEY_SET,\n GEOM_KEY_SET,\n DOM_ENTRY_SET,\n GEOM_ENTRY_SET,\n INHERIT,\n INHERIT_KEY_SET,\n};\n","import reg from './reg';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction parseFlex(style, grow, shrink, basis) {\n if(isNil(style.flexGrow)) {\n style.flexGrow = grow || 0;\n }\n if(isNil(style.flexShrink)) {\n style.flexShrink = shrink || 0;\n }\n if(isNil(style.flexBasis)) {\n style.flexBasis = basis || 0;\n }\n}\n\nfunction parseMarginPadding(style, key, list) {\n let temp = style[key];\n if(!isNil(temp)) {\n let match = temp.toString().match(/([-+]?[\\d.]+[pxremvwhina%]*)|(auto)/ig);\n if(match) {\n if(match.length === 1) {\n match[3] = match[2] = match[1] = match[0];\n }\n else if(match.length === 2) {\n match[2] = match[0];\n match[3] = match[1];\n }\n else if(match.length === 3) {\n match[3] = match[1];\n }\n list.forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = match[i];\n }\n });\n }\n }\n}\n\nfunction parseOneBorder(style, k) {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n // 后面会统一格式化处理\n if(isNil(style[k + 'Width'])) {\n let w = /\\b[\\d.]+[pxremvwhina%]*\\b/i.exec(v);\n style[k + 'Width'] = w ? w[0] : 0;\n }\n if(isNil(style[k + 'Style'])) {\n let s = /\\b(solid|dashed|dotted)\\b/i.exec(v);\n style[k + 'Style'] = s ? s[1] : 'solid';\n }\n if(isNil(style[k + 'Color'])) {\n let c = /#[0-9a-f]{3,8}/i.exec(v);\n if(c && [4, 7, 9].indexOf(c[0].length) > -1) {\n style[k + 'Color'] = c[0];\n }\n else if(/\\btransparent\\b/i.test(v)) {\n style[k + 'Color'] = 'transparent';\n }\n else {\n c = /rgba?\\s*\\(.+\\)/i.exec(v);\n style[k + 'Color'] = c ? c[0] : 'transparent';\n }\n }\n}\n\nexport default {\n margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'],\n padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n border: ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'],\n borderTop: ['borderTopWidth', 'borderTopStyle', 'borderTopColor'],\n borderRight: ['borderRightWidth', 'borderRightStyle', 'borderRightColor'],\n borderBottom: ['borderBottomWidth', 'borderBottomStyle', 'borderBottomColor'],\n borderLeft: ['borderLeftWidth', 'borderLeftStyle', 'borderLeftColor'],\n borderWidth: ['borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth'],\n borderColor: ['borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor'],\n borderStyle: ['borderTopStyle', 'borderRightStyle', 'borderBottomStyle', 'borderLeftStyle'],\n borderRadius: ['borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'],\n background: ['backgroundColor', 'backgroundImage', 'backgroundRepeat', 'backgroundPosition'],\n backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n flex: ['flexGrow', 'flexShrink', 'flexBasis'],\n translate: ['translateX', 'translateY'],\n translate3d: ['translateX', 'translateY', 'translateY'],\n scale: ['scaleX', 'scaleY'],\n scale3d: ['scaleX', 'scaleY', 'scaleZ'],\n rotate: ['rotateZ'],\n skew: ['skewX', 'skewY'],\n textStroke: ['textStrokeWidth', 'textStrokeColor', 'textStrokeOver'],\n\n toFull(style, k) {\n let v = style[k];\n if(k === 'background') {\n // bg缩写多个时有color则必须是最后一个\n if(Array.isArray(v)) {\n let length = v.length;\n if(isNil(style.backgroundColor)) {\n let bgc = /^\\s*((transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))/i.exec(v[length - 1]);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.slice(0, length - 1);\n }\n }\n let bgi = [];\n let bgr = [];\n let bgp = [];\n v.forEach(item => {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(item);\n if(gd) {\n bgi.push(gd[0]);\n item = item.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n bgi.push(img[0]);\n item = item.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-?)?repeat(-?[xy])?/i.exec(item);\n if(repeat) {\n bgr.push(repeat[0].toLowerCase());\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = item.match(reg.position);\n if(position) {\n bgp.push(position.join(' '));\n }\n }\n });\n if(bgi.length) {\n style.backgroundImage = bgi;\n }\n if(bgr.length) {\n style.backgroundRepeat = bgr;\n }\n if(bgp.length) {\n style.backgroundPosition = bgp;\n this.toFull(style, 'backgroundPosition');\n }\n }\n else {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(v);\n if(gd) {\n style.backgroundImage = gd[0];\n v = v.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n style.backgroundImage = img[0];\n v = v.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-?)?repeat(-?[xy])?/i.exec(v);\n if(repeat) {\n style.backgroundRepeat = repeat[0].toLowerCase();\n }\n }\n if(isNil(style.backgroundColor)) {\n let bgc = /^(transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\))/i.exec(v);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.replace(bgc[0], '');\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = v.match(reg.position);\n if(position) {\n style.backgroundPosition = position.join(' ');\n this.toFull(style, 'backgroundPosition');\n }\n }\n }\n }\n else if(k === 'flex') {\n if(v === 'none') {\n parseFlex(style, 0, 0, 'auto');\n }\n else if(v === 'auto') {\n parseFlex(style, 1, 1, 'auto');\n }\n else if(/^[\\d.]+\\s+[\\d.]+\\s+(auto|none|content)/.test(v)) {\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.]+[pxremvwhina%]*/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]);\n }\n else if(/^[\\d.]+\\s+[\\d.]+$/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), 0);\n }\n else if(/^[\\d.]+\\s+[\\d.]+[pxremvwhina%]+/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), 1, arr[1]);\n }\n else if(/^[\\d.]+$/.test(v)) {\n parseFlex(style, parseFloat(v), 1, 0);\n }\n else if(/^[\\d.]+[pxremvwhina%]+/i.test(v)) {\n parseFlex(style, 1, 1, v);\n }\n else {\n parseFlex(style, 0, 1, 'auto');\n }\n }\n else if(k === 'flexFlow') {\n v = v.toString().split(/\\s+/);\n if(v.length) {\n if(isNil(style.flexDirection)) {\n }\n style.flexDirection = v[0];\n if(v.length > 1) {\n style.flexWrap = v[1];\n }\n }\n }\n else if(k === 'borderRadius') {\n // borderRadius缩写很特殊,/分隔x/y,然后上右下左4个\n v = v.toString().split('/');\n if(v.length === 1) {\n v[1] = v[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = v[i].toString().split(/\\s+/);\n if(item.length === 0) {\n v[i] = [0, 0, 0, 0];\n }\n else if(item.length === 1) {\n v[i] = [item[0], item[0], item[0], item[0]];\n }\n else if(item.length === 2) {\n v[i] = [item[0], item[1], item[0], item[1]];\n }\n else if(item.length === 3) {\n v[i] = [item[0], item[1], item[2], item[1]];\n }\n else {\n v[i] = item.slice(0, 4);\n }\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = v[0][i] + ' ' + v[1][i];\n }\n });\n }\n else if(k === 'backgroundPosition') {\n if(!Array.isArray(v)) {\n v = [v];\n }\n let isEmpty = this[k].map(k2 => isNil(style[k2]));\n v.forEach(v2 => {\n v2 = v2.toString().split(/\\s+/);\n if(v2.length === 1) {\n v2[1] = '50%';\n }\n this[k].forEach((k2, i) => {\n if(isEmpty[i]) {\n style[k2] = style[k2] || [];\n style[k2].push(v2[i]);\n }\n });\n });\n }\n else if(['translate', 'scale', 'skew'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(['translate3d', 'scale3d'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[2] = arr[1] = arr[0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? 1 : 0;\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(k === 'margin' || k === 'padding') {\n parseMarginPadding(style, k, this[k]);\n }\n else if(/^border((Top)|(Right)|(Bottom)|(Left))$/.test(k)) {\n parseOneBorder(style, k);\n }\n else if(k === 'textStroke') {\n let w = /(?:^|\\s)([-+]?[\\d.]+[pxremvwhina%]*)/.exec(v);\n if(w) {\n style.textStrokeWidth = w[1];\n }\n let c = /(transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\))/i.exec(v);\n if(c) {\n style.textStrokeColor = c[0];\n }\n if(/\\bfill\\b/i.test(v)) {\n style.textStrokeOver = 'fill';\n }\n else {\n style.textStrokeOver = 'none';\n }\n }\n else if(this[k]) {\n this[k].forEach(k => {\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n }\n return style;\n }\n};\n","import enums from '../util/enums';\n\nconst { STYLE_KEY } = enums;\n\nconst KEY_COLOR = [\n [STYLE_KEY.BACKGROUND_COLOR],\n [STYLE_KEY.BORDER_BOTTOM_COLOR],\n [STYLE_KEY.BORDER_LEFT_COLOR],\n [STYLE_KEY.BORDER_RIGHT_COLOR],\n [STYLE_KEY.BORDER_TOP_COLOR],\n [STYLE_KEY.COLOR],\n [STYLE_KEY.TEXT_STROKE_COLOR],\n];\n\nconst KEY_LENGTH = [\n [STYLE_KEY.FONT_SIZE],\n [STYLE_KEY.BORDER_BOTTOM_WIDTH],\n [STYLE_KEY.BORDER_LEFT_WIDTH],\n [STYLE_KEY.BORDER_RIGHT_WIDTH],\n [STYLE_KEY.BORDER_TOP_WIDTH],\n [STYLE_KEY.LEFT],\n [STYLE_KEY.TOP],\n [STYLE_KEY.RIGHT],\n [STYLE_KEY.BOTTOM],\n [STYLE_KEY.FLEX_BASIS],\n [STYLE_KEY.WIDTH],\n [STYLE_KEY.HEIGHT],\n [STYLE_KEY.LINE_HEIGHT],\n [STYLE_KEY.MARGIN_BOTTOM],\n [STYLE_KEY.MARGIN_LEFT],\n [STYLE_KEY.MARGIN_TOP],\n [STYLE_KEY.MARGIN_RIGHT],\n [STYLE_KEY.PADDING_TOP],\n [STYLE_KEY.PADDING_RIGHT],\n [STYLE_KEY.PADDING_BOTTOM],\n [STYLE_KEY.PADDING_LEFT],\n [STYLE_KEY.STROKE_WIDTH],\n [STYLE_KEY.STROKE_MITERLIMIT],\n [STYLE_KEY.LETTER_SPACING],\n [STYLE_KEY.PERSPECTIVE],\n [STYLE_KEY.TEXT_STROKE_WIDTH],\n];\n\nconst KEY_GRADIENT = [\n [STYLE_KEY.BACKGROUND_IMAGE],\n [STYLE_KEY.FILL],\n [STYLE_KEY.STROKE],\n];\n\nconst KEY_RADIUS = [\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS],\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS],\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS],\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS],\n];\n\nconst COLOR_HASH = {};\nKEY_COLOR.forEach(k => {\n COLOR_HASH[k] = true;\n});\n\nconst LENGTH_HASH = {};\nKEY_LENGTH.forEach(k => {\n LENGTH_HASH[k] = true;\n});\n\nconst RADIUS_HASH = {};\nKEY_RADIUS.forEach(k => {\n RADIUS_HASH[k] = true;\n});\n\nconst GRADIENT_HASH = {};\nKEY_GRADIENT.forEach(k => {\n GRADIENT_HASH[k] = true;\n});\n\nconst GRADIENT_TYPE = {\n linear: true,\n radial: true,\n conic: true,\n};\n\nconst KEY_EXPAND = [\n [STYLE_KEY.TRANSLATE_X],\n [STYLE_KEY.TRANSLATE_Y],\n [STYLE_KEY.TRANSLATE_Z],\n [STYLE_KEY.SKEW_X],\n [STYLE_KEY.SKEW_Y],\n [STYLE_KEY.SCALE_X],\n [STYLE_KEY.SCALE_Y],\n [STYLE_KEY.SCALE_Z],\n [STYLE_KEY.ROTATE_X],\n [STYLE_KEY.ROTATE_Y],\n [STYLE_KEY.ROTATE_Z],\n];\n\nconst EXPAND_HASH = {};\nKEY_EXPAND.forEach(k => {\n EXPAND_HASH[k] = true;\n});\n\nexport default {\n KEY_COLOR,\n KEY_EXPAND,\n KEY_GRADIENT,\n KEY_LENGTH,\n KEY_RADIUS,\n COLOR_HASH,\n EXPAND_HASH,\n GRADIENT_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_TYPE,\n};\n","import reset from '../style/reset';\nimport unit from '../style/unit';\nimport enums from '../util/enums';\n\nconst { DOM: RESET_DOM, GEOM: RESET_GEOM } = reset;\nconst { INHERIT } = unit;\nconst { STYLE_KEY } = enums;\n\nconst GEOM = {};\nconst GEOM_KEY_SET = [];\nconst IGNORE = {\n [STYLE_KEY.POINTER_EVENTS]: true,\n};\nconst REPAINT = {\n [STYLE_KEY.TRANSFORM]: true,\n [STYLE_KEY.TRANSLATE_X]: true,\n [STYLE_KEY.TRANSLATE_Y]: true,\n [STYLE_KEY.SKEW_X]: true,\n [STYLE_KEY.SKEW_Y]: true,\n [STYLE_KEY.SCALE_X]: true,\n [STYLE_KEY.SCALE_Y]: true,\n [STYLE_KEY.ROTATE_Z]: true,\n [STYLE_KEY.COLOR]: true,\n [STYLE_KEY.FONT_STYLE]: true,\n [STYLE_KEY.STROKE_WIDTH]: true,\n [STYLE_KEY.FILL]: true,\n [STYLE_KEY.STROKE_DASHARRAY]: true,\n [STYLE_KEY.STROKE_LINECAP]: true,\n [STYLE_KEY.STROKE_LINEJOIN]: true,\n [STYLE_KEY.STROKE_MITERLIMIT]: true,\n [STYLE_KEY.BACKGROUND_COLOR]: true,\n [STYLE_KEY.BACKGROUND_IMAGE]: true,\n [STYLE_KEY.BACKGROUND_POSITION_X]: true,\n [STYLE_KEY.BACKGROUND_POSITION_Y]: true,\n [STYLE_KEY.BACKGROUND_REPEAT]: true,\n [STYLE_KEY.BACKGROUND_SIZE]: true,\n [STYLE_KEY.STROKE]: true,\n [STYLE_KEY.BORDER_BOTTOM_COLOR]: true,\n [STYLE_KEY.BORDER_LEFT_COLOR]: true,\n [STYLE_KEY.BORDER_RIGHT_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS]: true,\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS]: true,\n [STYLE_KEY.VISIBILITY]: true,\n [STYLE_KEY.OPACITY]: true,\n [STYLE_KEY.Z_INDEX]: true,\n [STYLE_KEY.FILTER]: true,\n [STYLE_KEY.BOX_SHADOW]: true,\n [STYLE_KEY.OVERFLOW]: true,\n [STYLE_KEY.BACKGROUND_CLIP]: true,\n [STYLE_KEY.TEXT_STROKE_WIDTH]: true,\n [STYLE_KEY.TEXT_STROKE_COLOR]: true,\n [STYLE_KEY.TEXT_STROKE_OVER]: true,\n};\nconst MEASURE = {\n [STYLE_KEY.FONT_SIZE]: true,\n [STYLE_KEY.FONT_WEIGHT]: true,\n [STYLE_KEY.FONT_FAMILY]: true,\n};\n\nlet o = {\n GEOM,\n GEOM_KEY_SET,\n IGNORE,\n REPAINT,\n MEASURE,\n addGeom(tagName, ks, cb) {\n if(Array.isArray(ks)) {\n ks.forEach(k => {\n o.addGeom(tagName, k, cb);\n });\n }\n else if(ks) {\n if(!GEOM.hasOwnProperty(ks)) {\n GEOM_KEY_SET.push(ks);\n }\n let hash = GEOM[ks] = GEOM[ks] || {};\n hash[tagName] = cb || true;\n }\n },\n isIgnore(k) {\n return IGNORE.hasOwnProperty(k);\n },\n isGeom(tagName, k) {\n return tagName && k && GEOM.hasOwnProperty(k) && GEOM[k].hasOwnProperty(tagName);\n },\n isRepaint(k, tagName) {\n return REPAINT.hasOwnProperty(k) || o.isGeom(tagName, k);\n },\n isMeasure(k) {\n return MEASURE.hasOwnProperty(k);\n },\n isValid(tagName, k) {\n if(!k) {\n return false;\n }\n if(RESET_DOM.hasOwnProperty(k)) {\n return true;\n }\n // geom的fill等矢量才有的样式\n if(tagName.charAt(0) === '$' && RESET_GEOM.hasOwnProperty(k)) {\n return true;\n }\n if(GEOM.hasOwnProperty(k)) {\n return GEOM[k].hasOwnProperty(tagName);\n }\n if(k === 'translatePath') {\n return true;\n }\n return false;\n },\n};\n\nlet MEASURE_KEY_SET = o.MEASURE_KEY_SET = Object.keys(MEASURE).map(i => parseInt(i));\nlet len = MEASURE_KEY_SET.length;\no.isMeasureInherit = function(target) {\n if(target) {\n for(let i = 0; i < len; i++) {\n let k = MEASURE_KEY_SET[i];\n if(target.hasOwnProperty(k) && target[k][1] === INHERIT) {\n return true;\n }\n }\n }\n return false;\n};\no.measureInheritList = function(target) {\n let list = [];\n for(let i = 0; i < len; i++) {\n let k = MEASURE_KEY_SET[i];\n if(target.hasOwnProperty(k) && target[k][1] === INHERIT) {\n list.push(k);\n }\n }\n return list;\n};\n\no.addGeom('$line', ['x1', 'y1', 'x2', 'y2', 'controlA', 'controlB', 'start', 'end']);\no.addGeom('$circle', ['r']);\no.addGeom('$ellipse', ['rx', 'ry']);\no.addGeom('$rect', ['rx', 'ry']);\no.addGeom('$sector', ['begin', 'end', 'edge', 'closure']);\no.addGeom('$polyline', ['points', 'controls', 'start', 'end']);\no.addGeom('$polygon', ['points', 'controls', 'start', 'end', 'booleanOperations']);\n\nexport default o;\n","import unit from './unit';\nimport font from './font';\nimport gradient from './gradient';\nimport reg from './reg';\nimport reset from './reset';\nimport abbr from './abbr';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport key from '../animate/key';\nimport change from '../refresh/change';\n\nconst { STYLE_KEY, STYLE_RV_KEY, style2Upper, STYLE_KEY: {\n POSITION,\n WIDTH,\n HEIGHT,\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n SKEW_X,\n SKEW_Y,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n ROTATE_3D,\n PERSPECTIVE,\n PERSPECTIVE_ORIGIN,\n TRANSFORM,\n TRANSFORM_ORIGIN,\n BACKGROUND_IMAGE,\n BACKGROUND_COLOR,\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n BACKGROUND_SIZE,\n OPACITY,\n Z_INDEX,\n COLOR,\n FONT_SIZE,\n FONT_FAMILY,\n FONT_WEIGHT,\n FONT_STYLE,\n LINE_HEIGHT,\n TEXT_ALIGN,\n FILTER,\n VISIBILITY,\n BOX_SHADOW,\n POINTER_EVENTS,\n FILL,\n STROKE,\n STROKE_WIDTH,\n STROKE_DASHARRAY,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n DISPLAY,\n FLEX_DIRECTION,\n FLEX_GROW,\n FLEX_SHRINK,\n FLEX_BASIS,\n JUSTIFY_CONTENT,\n ALIGN_SELF,\n ALIGN_ITEMS,\n MATRIX,\n LETTER_SPACING,\n BACKGROUND_CLIP,\n WHITE_SPACE,\n TEXT_OVERFLOW,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n TRANSLATE_PATH,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_WIDTH,\n TEXT_STROKE_OVER,\n} } = enums;\nconst { AUTO, PX, PERCENT, NUMBER, INHERIT, DEG, RGBA, STRING, REM, VW, VH, VMAX, VMIN, calUnit } = unit;\nconst { isNil, rgba2int, equalArr } = util;\nconst { MEASURE_KEY_SET, isGeom, GEOM, GEOM_KEY_SET } = change;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nconst TRANSFORM_HASH = {\n translateX: TRANSLATE_X,\n translateY: TRANSLATE_Y,\n translateZ: TRANSLATE_Z,\n scaleX: SCALE_X,\n scaleY: SCALE_Y,\n scaleZ: SCALE_Z,\n skewX: SKEW_X,\n skewY: SKEW_Y,\n rotateX: ROTATE_X,\n rotateY: ROTATE_Y,\n rotateZ: ROTATE_Z,\n rotate: ROTATE_Z,\n};\n\nfunction compatibleTransform(k, arr) {\n if(k === SCALE_X || k === SCALE_Y || k === SCALE_Z) {\n arr[1] = NUMBER;\n }\n else if(k === TRANSLATE_X || k === TRANSLATE_Y || k === TRANSLATE_Z) {\n if(arr[1] === NUMBER) {\n arr[1] = PX;\n }\n }\n else if(k === PERSPECTIVE) {\n if([NUMBER, PERCENT, DEG].indexOf(arr[1]) > -1) {\n arr[1] = PX;\n }\n }\n else {\n if(arr[1] === NUMBER) {\n arr[1] = DEG;\n }\n }\n}\n\n/**\n * 将传入的手写style标准化,并且用reset默认值覆盖其中为空的\n * @param style 手写的style样式\n * @param reset 默认样式,可选\n * @returns Object 标准化的枚举数组结构样式\n */\nfunction normalize(style, reset = []) {\n if(!util.isObject(style)) {\n return {};\n }\n let res = {};\n // style只有单层无需深度clone\n style = util.extend({}, style);\n // 缩写提前处理,因为reset里没有缩写\n let temp = style.border;\n if(temp) {\n abbr.toFull(style, 'border');\n }\n ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'].forEach(k => {\n abbr.toFull(style, k);\n });\n temp = style.borderWidth;\n if(temp) {\n abbr.toFull(style, 'borderWidth');\n }\n temp = style.borderColor;\n if(temp) {\n abbr.toFull(style, 'borderColor');\n }\n temp = style.borderStyle;\n if(temp) {\n abbr.toFull(style, 'borderStyle');\n }\n temp = style.borderRadius;\n if(temp) {\n abbr.toFull(style, 'borderRadius');\n }\n temp = style.background;\n // 处理渐变背景缩写\n if(temp) {\n abbr.toFull(style, 'background');\n }\n // 背景位置\n temp = style.backgroundPosition;\n if(!isNil(temp)) {\n abbr.toFull(style, 'backgroundPosition');\n }\n // flex\n temp = style.flex;\n if(temp) {\n abbr.toFull(style, 'flex');\n }\n // flex-flow\n temp = style.flexFlow;\n if(temp) {\n abbr.toFull(style, 'flexFlow');\n }\n temp = style.margin;\n if(!isNil(temp)) {\n abbr.toFull(style, 'margin');\n }\n temp = style.padding;\n if(!isNil(temp)) {\n abbr.toFull(style, 'padding');\n }\n temp = style.textStroke;\n if(temp) {\n abbr.toFull(style, 'textStroke');\n }\n temp = style.rotate3d;\n if(temp) {\n abbr.toFull(style, 'rotate3d');\n }\n // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform\n ['translate', 'scale', 'skew', 'translate3d', 'scale3d', 'rotate'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n abbr.toFull(style, k);\n }\n });\n // 扩展的不能和transform混用,给出警告\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate3d',\n ].forEach(k => {\n let v = style[k];\n if(v !== undefined && style.transform) {\n inject.warn(`Can not use expand style \"${k}\" with transform`);\n }\n });\n // 默认reset,根据传入不同,当style为空时覆盖\n reset.forEach(item => {\n let { k, v } = item;\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n // 背景图\n temp = style.backgroundImage;\n if(temp !== undefined) {\n if(!temp) {\n res[BACKGROUND_IMAGE] = [null];\n }\n else if(Array.isArray(temp)) {\n res[BACKGROUND_IMAGE] = temp.map(item => {\n if(!item) {\n return null;\n }\n if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n if(reg.img.test(item)) {\n return reg.img.exec(item)[2];\n }\n return null;\n });\n }\n // 区分是渐变色还是图\n else if(reg.gradient.test(temp)) {\n res[BACKGROUND_IMAGE] = [gradient.parseGradient(temp)];\n }\n else if(reg.img.test(temp)) {\n res[BACKGROUND_IMAGE] = [reg.img.exec(temp)[2]];\n }\n else {\n res[BACKGROUND_IMAGE] = [null];\n }\n }\n temp = style.backgroundColor;\n if(temp !== undefined) {\n temp = temp || 'transparent';\n // 先赋值默认透明,后续操作有合法值覆盖\n let bgc = /^#[0-9a-f]{3,8}/i.exec(temp);\n if(bgc && [4, 7, 9].indexOf(bgc[0].length) > -1) {\n res[BACKGROUND_COLOR] = [rgba2int(bgc[0]), RGBA];\n }\n else {\n bgc = /rgba?\\s*\\(.+\\)/i.exec(temp);\n res[BACKGROUND_COLOR] = [rgba2int(bgc ? bgc[0] : [0, 0, 0, 0]), RGBA];\n }\n }\n ['backgroundPositionX', 'backgroundPositionY'].forEach((k, i) => {\n temp = style[k];\n if(temp !== undefined) {\n temp = temp || 0;\n k = i ? BACKGROUND_POSITION_Y : BACKGROUND_POSITION_X;\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[k] = temp.map(item => {\n if(/^[-+]?[\\d.]/.test(item)) {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item] || 0,\n PERCENT,\n ];\n }\n });\n }\n });\n // 背景尺寸\n temp = style.backgroundSize;\n if(temp !== undefined) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[BACKGROUND_SIZE] = temp.map(item => {\n if(!item) {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n let match = item.toString().match(/\\b(?:([-+]?[\\d.]+[pxremvwhina%]*)|(contain|cover|auto))/ig);\n if(match) {\n if(match.length === 1) {\n if(match[0] === 'contain' || match[0] === 'cover') {\n match[1] = match[0];\n }\n else {\n match[1] = 'auto';\n }\n }\n let v = [];\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n v.push(n);\n }\n else if(item === 'contain' || item === 'cover') {\n v.push([item, STRING]);\n }\n else {\n v.push([0, AUTO]);\n }\n }\n return v;\n }\n else {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n });\n }\n // border-color\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k + 'Color';\n let v = style[k];\n if(v !== undefined) {\n res[STYLE_KEY[style2Upper(k)]] = [rgba2int(v || 'transparent'), RGBA];\n }\n });\n // border-radius\n ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'].forEach(k => {\n k = 'border' + k + 'Radius';\n let v = style[k];\n if(v !== undefined) {\n v = v || 0;\n let arr = v.toString().split(/\\s+/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = arr[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n if(n[0] < 0) {\n n[0] = 0;\n }\n arr[i] = n;\n }\n else {\n arr[i] = [0, PX];\n }\n }\n res[STYLE_KEY[style2Upper(k)]] = arr;\n }\n });\n temp = style.transform;\n if(temp === null) {\n res[TRANSFORM] = null;\n }\n else if(temp !== undefined) {\n let transform = res[TRANSFORM] = [];\n let match = (temp || '').toString().match(/\\w+\\(.+?\\)/g);\n if(match) {\n match.forEach(item => {\n let i = item.indexOf('(');\n let k = item.slice(0, i);\n let v = item.slice(i + 1, item.length - 1);\n if(k === 'matrix') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 6) {\n arr = arr.slice(0, 6);\n }\n if(arr.length === 6) {\n transform.push([MATRIX, [\n arr[0], arr[1], 0, 0, arr[2], arr[3], 0, 0, 0, 0, 1, 0, arr[4], arr[5], 0, 1,\n ]]);\n }\n }\n else if(k === 'matrix3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 16) {\n arr = arr.slice(0, 16);\n }\n if(arr.length === 16) {\n transform.push([MATRIX, arr]);\n }\n }\n else if(k === 'perspective') {\n let arr = calUnit(v);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n transform.push([PERSPECTIVE, arr]);\n }\n else if(k === 'rotate3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n transform.push([ROTATE_3D, arr]);\n }\n }\n else if(TRANSFORM_HASH.hasOwnProperty(k)) {\n let k2 = TRANSFORM_HASH[k];\n let arr = calUnit(v);\n compatibleTransform(k2, arr);\n transform.push([k2, arr]);\n }\n else if({ translate: true, scale: true, skew: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale' ? arr[0] : [0];\n }\n if(arr.length === 2) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n }\n }\n else if({ translate3d: true, scale3d: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale3d' ? [1] : [0];\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n if(arr.length === 3) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let k3 = STYLE_KEY[style2Upper(k + 'Z')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n let arr3 = calUnit(arr[2]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n compatibleTransform(k3, arr3);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n transform.push([k3, arr3]);\n }\n }\n });\n }\n }\n temp = style.perspective;\n if(temp !== undefined) {\n let arr = calUnit(temp || 0);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n res[PERSPECTIVE] = arr;\n }\n ['perspectiveOrigin', 'transformOrigin'].forEach(k => {\n temp = style[k];\n if(temp !== undefined) {\n if(temp === null) {\n temp = '';\n }\n let arr = res[STYLE_KEY[style2Upper(k)]] = [];\n let match = temp.toString().match(reg.position);\n if(match) {\n if(match.length === 1) {\n match[1] = match[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n arr.push(n);\n }\n else {\n arr.push([\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item],\n PERCENT,\n ]);\n // 不规范的写法变默认值50%\n if(isNil(arr[i][0])) {\n arr[i][0] = 50;\n }\n }\n }\n }\n else {\n arr.push([50, PERCENT]);\n arr.push([50, PERCENT]);\n }\n }\n });\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate',\n ].forEach(k => {\n let v = style[k];\n if(v === undefined) {\n return;\n }\n if(v === null) {\n if(k.indexOf('scale') === 0) {\n v = 1;\n }\n else {\n v = 0;\n }\n }\n let k2 = TRANSFORM_HASH[k];\n let n = calUnit(v);\n // 没有单位或默认值处理单位\n compatibleTransform(k2, n);\n res[k2] = n;\n });\n temp = style.rotate3d;\n if(temp !== undefined) {\n let arr = (temp || '').toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n }\n res[ROTATE_3D] = arr;\n }\n temp = style.opacity;\n if(temp !== undefined) {\n if(temp === null) {\n temp = 1;\n }\n temp = parseFloat(temp);\n if(!isNaN(temp)) {\n temp = Math.max(temp, 0);\n temp = Math.min(temp, 1);\n res[OPACITY] = temp;\n }\n else {\n res[OPACITY] = 1;\n }\n }\n temp = style.zIndex;\n if(temp !== undefined) {\n res[Z_INDEX] = parseInt(temp) || 0;\n }\n // 转化不同单位值为对象标准化,不写单位的变成number单位转化为px\n [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'width',\n 'height',\n ].forEach(k => {\n let v = style[k];\n if(v === undefined) {\n return;\n }\n if(v === 'auto') {\n v = [0, AUTO];\n }\n else {\n v = calUnit(v || 0);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n let k2 = STYLE_KEY[style2Upper(k)];\n res[k2] = v;\n // 限制padding/border为正数\n if({\n paddingTop: true,\n paddingRight: true,\n paddingBottom: true,\n paddingLeft: true,\n borderTopWidth: true,\n borderRightWidth: true,\n borderBottomWidth: true,\n borderLeftWidth: true,\n width: true,\n height: true,\n }.hasOwnProperty(k) && v[0] < 0) {\n v[0] = 0;\n }\n });\n temp = style.flexBasis;\n if(temp !== undefined) {\n if(temp === 'content') {\n res[FLEX_BASIS] = [temp, STRING];\n }\n else if(/^[\\d.]/.test(temp)) {\n let v = res[FLEX_BASIS] = calUnit(temp);\n v[0] = Math.max(v[0], 0);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n else {\n res[FLEX_BASIS] = [0, AUTO];\n }\n }\n temp = style.order;\n if(temp !== undefined) {\n res[ORDER] = parseInt(temp) || 0;\n }\n temp = style.color;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[COLOR] = [[], INHERIT];\n }\n else {\n res[COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.textStrokeColor;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_COLOR] = [[], INHERIT];\n }\n else {\n res[TEXT_STROKE_COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.fontSize;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // fontSize不能为负数,否则为继承\n if(v < 0) {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[FONT_SIZE] = v;\n }\n }\n }\n temp = style.textStrokeWidth;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // textStrokeWidth不能为负数,否则为继承\n if(v < 0) {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG, PERCENT].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[TEXT_STROKE_WIDTH] = v;\n }\n }\n }\n temp = style.textStrokeOver;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[TEXT_STROKE_OVER] = [0, INHERIT];\n }\n else {\n let v = temp.toString();\n if(v !== 'none' && v !== 'fill') {\n v = 'none';\n }\n res[TEXT_STROKE_OVER] = [v, STRING];\n }\n }\n temp = style.fontWeight;\n if(temp !== undefined) {\n if(temp === 'bold') {\n res[FONT_WEIGHT] = [700, NUMBER];\n }\n else if(temp === 'normal') {\n res[FONT_WEIGHT] = [400, NUMBER];\n }\n else if(temp === 'lighter') {\n res[FONT_WEIGHT] = [200, NUMBER];\n }\n else if(temp === 'inherit') {\n res[FONT_WEIGHT] = [0, INHERIT];\n }\n else {\n res[FONT_WEIGHT] = [Math.max(0, parseInt(temp)) || 400, NUMBER];\n }\n }\n temp = style.fontStyle;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[FONT_STYLE] = [0, INHERIT];\n }\n else {\n res[FONT_STYLE] = [temp, STRING];\n }\n }\n temp = style.fontFamily;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[FONT_FAMILY] = [0, INHERIT];\n }\n else {\n // 统一文字声明格式\n res[FONT_FAMILY] = [temp.toString().toLowerCase().replace(/['\"]/, '').replace(/\\s*,\\s*/g, ','), STRING];\n }\n }\n temp = style.textAlign;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[TEXT_ALIGN] = [0, INHERIT];\n }\n else {\n res[TEXT_ALIGN] = [temp, STRING];\n }\n }\n temp = style.lineHeight;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LINE_HEIGHT] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LINE_HEIGHT] = [0, AUTO];\n }\n // lineHeight默认数字,想要px必须强制带单位\n else if(/^[\\d.]+/i.test(temp)) {\n let v = calUnit(temp);\n if([DEG].indexOf(v[1]) > -1) {\n v[1] = NUMBER;\n }\n res[LINE_HEIGHT] = v;\n }\n else {\n let n = Math.max(0, parseFloat(temp)) || 'normal';\n // 非法数字\n if(n === 'normal') {\n res[LINE_HEIGHT] = [null, AUTO];\n }\n else {\n res[LINE_HEIGHT] = [n, NUMBER];\n }\n }\n }\n temp = style.letterSpacing;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[LETTER_SPACING] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LETTER_SPACING] = [0, PX];\n }\n else if(/^[-+]?[\\d.]/.test(temp)) {\n let v = calUnit(temp);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[LETTER_SPACING] = v;\n }\n else {\n res[LETTER_SPACING] = [parseFloat(temp) || 0, PX];\n }\n }\n temp = style.whiteSpace;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[WHITE_SPACE] = [0, INHERIT];\n }\n else {\n res[WHITE_SPACE] = [temp, STRING];\n }\n }\n temp = style.lineClamp;\n if(temp !== undefined) {\n temp = parseInt(temp) || 0;\n res[LINE_CLAMP] = Math.max(0, temp);\n }\n // fill和stroke为渐变时特殊处理,fillRule无需处理字符串\n temp = style.fill;\n if(temp !== undefined) {\n if(!temp) {\n res[FILL] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[FILL] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[FILL] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[FILL] = [gradient.parseGradient(temp)];\n }\n else {\n res[FILL] = [rgba2int(temp)];\n }\n }\n temp = style.stroke;\n if(temp !== undefined) {\n if(!temp) {\n res[STROKE] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[STROKE] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[STROKE] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[STROKE] = [gradient.parseGradient(temp)];\n }\n else {\n res[STROKE] = [rgba2int(temp)];\n }\n }\n temp = style.strokeWidth;\n if(temp !== undefined) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[STROKE_WIDTH] = temp.map(item => {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n v[0] = Math.max(v[0], 0);\n return v;\n });\n }\n temp = style.strokeDasharray;\n if(temp !== undefined) {\n if(Array.isArray(temp)) {\n res[STROKE_DASHARRAY] = temp.map(item => {\n let match = (item || '').toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n return match;\n }\n return [];\n });\n }\n else {\n let match = (temp || '').toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n res[STROKE_DASHARRAY] = [match];\n }\n else {\n res[STROKE_DASHARRAY] = [[]];\n }\n }\n }\n temp = style.filter;\n if(temp !== undefined) {\n let match = (temp || '').toString().match(/\\b[\\w-]+\\s*\\(\\s*[-+]?[\\d.]+\\s*[pxremvwhdg%]*\\s*\\)\\s*/ig);\n let f = null;\n if(match) {\n f = [];\n match.forEach(item => {\n let m2 = /([\\w-]+)\\s*\\(\\s*([-+]?[\\d.]+\\s*[pxremvwhdg%]*)\\s*\\)\\s*/i.exec(item);\n if(m2) {\n let k = m2[1].toLowerCase(), v = calUnit(m2[2]);\n if(k === 'blur') {\n if(v[0] <= 0 || [DEG, PERCENT].indexOf(v[1]) > -1) {\n return;\n }\n if(v[1] === NUMBER) {\n v[1] = PX;\n }\n f.push([k, v]);\n }\n else if(k === 'hue-rotate') {\n if([NUMBER, DEG].indexOf(v[1]) === -1) {\n return;\n }\n v[1] = DEG;\n f.push([k, v]);\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'grayscale' || k === 'contrast' || k === 'sepia' || k === 'invert') {\n if([NUMBER, PERCENT].indexOf(v[1]) === -1) {\n return;\n }\n v[0] = Math.max(v[0], 0);\n v[1] = PERCENT;\n f.push([k, v]);\n }\n }\n });\n }\n res[FILTER] = f;\n }\n temp = style.visibility;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[VISIBILITY] = [0, INHERIT];\n }\n else {\n res[VISIBILITY] = [temp, STRING];\n }\n }\n temp = style.pointerEvents;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[POINTER_EVENTS] = [0, INHERIT];\n }\n else {\n res[POINTER_EVENTS] = [temp, STRING];\n }\n }\n temp = style.boxShadow;\n if(temp !== undefined) {\n let bs = null;\n let match = (temp || '').match(/([-+]?[\\d.]+[pxremvwhina%]*)\\s*([-+]?[\\d.]+[pxremvwhina%]*)\\s*([-+]?[\\d.]+[pxremvwhina%]*\\s*)?([-+]?[\\d.]+[pxremvwhina%]*\\s*)?(((transparent)|(#[0-9a-f]{3,8})|(rgba?\\(.+?\\)))\\s*)?(inset|outset)?\\s*,?/ig);\n if(match) {\n match.forEach(item => {\n let boxShadow = /([-+]?[\\d.]+[pxremvwhina%]*)\\s*([-+]?[\\d.]+[pxremvwhina%]*)\\s*([-+]?[\\d.]+[pxremvwhina%]*\\s*)?([-+]?[\\d.]+[pxremvwhina%]*\\s*)?(?:((?:transparent)|(?:#[0-9a-f]{3,8})|(?:rgba?\\(.+\\)))\\s*)?(inset|outset)?/i.exec(item);\n if(boxShadow) {\n bs = bs || [];\n let res = [];\n // v,h,blur,spread,color,inset\n for(let i = 0; i < 4; i++) {\n let v = calUnit(boxShadow[i + 1]);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n // x/y可以负,blur和spread不行\n if(i > 1 && v[0] < 0) {\n v = 0;\n }\n res.push(v);\n }\n res.push(rgba2int(boxShadow[5]));\n res.push(boxShadow[6] || 'outset');\n bs.push(res);\n }\n });\n }\n res[BOX_SHADOW] = bs;\n }\n // 直接赋值的string类型\n [\n 'position',\n 'display',\n 'flexDirection',\n 'flexWrap',\n 'justifyContent',\n 'alignItems',\n 'alignSelf',\n 'alignContent',\n 'overflow',\n 'mixBlendMode',\n 'borderTopStyle',\n 'borderRightStyle',\n 'borderBottomStyle',\n 'borderLeftStyle',\n 'backgroundClip',\n 'textOverflow',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[STYLE_KEY[style2Upper(k)]] = style[k];\n }\n });\n // 直接赋值的number类型\n [\n 'flexGrow',\n 'flexShrink',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[STYLE_KEY[style2Upper(k)]] = Math.max(parseFloat(style[k]) || 0, 0);\n }\n });\n temp = style.zIndex;\n if(temp !== undefined) {\n res[Z_INDEX] = parseFloat(temp) || 0;\n }\n // 这些支持多个的用数组表示\n [\n 'backgroundRepeat',\n 'strokeLinecap',\n 'strokeLinejoin',\n 'strokeMiterlimit',\n 'fillRule',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n let v = style[k];\n res[STYLE_KEY[style2Upper(k)]] = Array.isArray(v) ? v : [v];\n }\n });\n GEOM_KEY_SET.forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[k] = style[k];\n }\n });\n return res;\n}\n\n/**\n * 第一次和REFLOW等级下,刷新前首先执行,生成computedStyle\n * 影响文字测量的只有字体和大小和重量,需要提前处理\n * 继承相关的计算\n * @param node 对象节点\n * @param isRoot 是否是根节点,无继承需使用默认值\n */\nfunction computeMeasure(node, isRoot) {\n let { currentStyle, computedStyle, domParent } = node;\n let parentComputedStyle = !isRoot && domParent.computedStyle;\n MEASURE_KEY_SET.forEach(k => {\n let v = currentStyle[k];\n // ff特殊处理\n if(k === FONT_FAMILY) {\n if(v[1] === INHERIT) {\n computedStyle[k] = getFontFamily(isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k]);\n }\n else {\n computedStyle[k] = getFontFamily(v[0]);\n }\n }\n else if(v[1] === INHERIT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k];\n }\n // 只有fontSize会有%\n else if(v[1] === PERCENT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (parentComputedStyle[k] * v[0] * 0.01);\n }\n else if(v[1] === REM) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.computedStyle[FONT_SIZE] * v[0]);\n }\n else if(v[1] === VW) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.width * 0.01 * v[0]);\n }\n else if(v[1] === VH) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.height * 0.01 * v[0]);\n }\n else if(v[1] === VMAX) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (Math.max(node.root.width, node.root.height) * 0.01 * v[0]);\n }\n else if(v[1] === VMIN) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (Math.min(node.root.width, node.root.height) * 0.01 * v[0]);\n }\n else {\n computedStyle[k] = v[0];\n }\n });\n}\n\n/**\n * 每次布局前需要计算的reflow相关的computedStyle\n * @param node 对象节点\n * @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 if(item[1] === VMAX) {\n computedStyle[k] = item[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(item[1] === VMIN) {\n computedStyle[k] = item[0] * Math.min(root.width, root.height) * 0.01;\n }\n else {\n computedStyle[k] = 0;\n }\n });\n [\n POSITION,\n DISPLAY,\n FLEX_DIRECTION,\n JUSTIFY_CONTENT,\n ALIGN_ITEMS,\n ALIGN_SELF,\n FLEX_GROW,\n FLEX_SHRINK,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n let textAlign = currentStyle[TEXT_ALIGN];\n if(textAlign[1] === INHERIT) {\n computedStyle[TEXT_ALIGN] = isRoot ? 'left' : parentComputedStyle[TEXT_ALIGN];\n }\n else {\n computedStyle[TEXT_ALIGN] = textAlign[0];\n }\n let fontSize = computedStyle[FONT_SIZE];\n let lineHeight = currentStyle[LINE_HEIGHT];\n // lineHeight继承很特殊,数字和normal不同于普通单位\n if(lineHeight[1] === INHERIT) {\n if(isRoot) {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n else {\n let p = parent;\n let ph;\n while(p) {\n ph = p.currentStyle[LINE_HEIGHT];\n if(ph[1] !== INHERIT) {\n break;\n }\n p = p.domParent;\n }\n // 到root还是inherit或normal,或者中途遇到了normal,使用normal\n if([AUTO, INHERIT].indexOf(ph[1]) > -1) {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n // 数字继承\n else if(ph[1] === NUMBER) {\n computedStyle[LINE_HEIGHT] = Math.max(ph[0], 0) * fontSize;\n }\n // 单位继承\n else {\n computedStyle[LINE_HEIGHT] = parentComputedStyle[LINE_HEIGHT];\n }\n }\n }\n // 防止为0\n else if(lineHeight[1] === PX) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === PERCENT) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * fontSize * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === REM) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * rem, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VW) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.width * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VH) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.height * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VMAX) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * Math.max(root.width, root.height) * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VMIN) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * Math.min(root.width, root.height) * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === NUMBER) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) * fontSize || calNormalLineHeight(computedStyle);\n }\n // normal或auto\n else {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n let letterSpacing = currentStyle[LETTER_SPACING];\n if(letterSpacing[1] === INHERIT) {\n computedStyle[LETTER_SPACING] = isRoot ? 0 : parentComputedStyle[LETTER_SPACING];\n }\n else if(letterSpacing[1] === PERCENT) {\n computedStyle[LETTER_SPACING] = fontSize * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === REM) {\n computedStyle[LETTER_SPACING] = rem * letterSpacing[0];\n }\n else if(letterSpacing[1] === VW) {\n computedStyle[LETTER_SPACING] = root.width * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === VH) {\n computedStyle[LETTER_SPACING] = root.height * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === VMAX) {\n computedStyle[LETTER_SPACING] = Math.max(root.width, root.height) * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === VMIN) {\n computedStyle[LETTER_SPACING] = Math.min(root.width, root.height) * 0.01 * letterSpacing[0];\n }\n else {\n computedStyle[LETTER_SPACING] = letterSpacing[0];\n }\n //whiteSpace\n let whiteSpace = currentStyle[WHITE_SPACE];\n if(whiteSpace[1] === INHERIT) {\n computedStyle[WHITE_SPACE] = isRoot ? 'normal' : parentComputedStyle[WHITE_SPACE];\n }\n else {\n computedStyle[WHITE_SPACE] = whiteSpace[0];\n }\n}\n\nfunction setFontStyle(style) {\n let fontSize = style[FONT_SIZE] || 0;\n let fontFamily = style[FONT_FAMILY] || 'arial';\n if(/\\s/.test(fontFamily)) {\n fontFamily = '\"' + fontFamily.replace(/\"/g, '\\\\\"') + '\"';\n }\n return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' '\n + fontSize + 'px/' + fontSize + 'px ' + fontFamily;\n}\n\nfunction getFontFamily(str) {\n let ff = str.split(',');\n let f = 'arial';\n for(let i = 0, len = ff.length; i < len; i++) {\n if(font.support(ff[i])) {\n f = ff[i];\n break;\n }\n }\n return f;\n}\n\nfunction getBaseline(style) {\n let fontSize = style[FONT_SIZE];\n let ff = getFontFamily(style[FONT_FAMILY]);\n let normal = fontSize * (font.info[ff] || font.info.arial).lhr;\n return (style[LINE_HEIGHT] - normal) * 0.5 + fontSize * (font.info[ff] || font.info.arial).blr;\n}\n\nfunction calNormalLineHeight(style) {\n let ff = getFontFamily(style[FONT_FAMILY]);\n return style[FONT_SIZE] * (font.info[ff] || font.info.arial).lhr;\n}\n\nfunction calRelativePercent(n, parent, k) {\n n *= 0.01;\n while(parent) {\n let style = parent.currentStyle[k];\n if(style[1] === AUTO) {\n if(k === WIDTH) {\n parent = parent.domParent;\n }\n else {\n break;\n }\n }\n else if(style[1] === PX) {\n return n * style[0];\n }\n else if(style[1] === PERCENT) {\n n *= style[0] * 0.01;\n parent = parent.domParent;\n }\n else if(style[1] === REM) {\n return n * style[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(style[1] === VW) {\n return n * style[0] * parent.root.width * 0.01;\n }\n else if(style[1] === VH) {\n return n * style[0] * parent.root.height * 0.01;\n }\n else if(style[1] === VMAX) {\n return n * style[0] * Math.max(parent.root.width, parent.root.height) * 0.01;\n }\n else if(style[1] === VMIN) {\n return n * style[0] * Math.min(parent.root.width, parent.root.height) * 0.01;\n }\n }\n return n;\n}\n\nfunction calRelative(currentStyle, k, v, parent, isWidth) {\n if(v[1] === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER].indexOf(v[1]) > -1) {\n v = v[0];\n }\n else if(v[1] === PERCENT) {\n if(isWidth) {\n v = calRelativePercent(v[0], parent, WIDTH);\n }\n else {\n v = calRelativePercent(v[0], parent, HEIGHT);\n }\n }\n else if(v[1] === REM) {\n v = v[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * parent.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * parent.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(parent.root.width, parent.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(parent.root.width, parent.root.height) * 0.01;\n }\n return v;\n}\n\nfunction calAbsolute(currentStyle, k, v, size, root) {\n if(v[1] === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER, DEG, RGBA, STRING].indexOf(v[1]) > -1) {\n v = v[0];\n }\n else if(v[1] === PERCENT) {\n v = v[0] * size * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(root.width, root.height) * 0.01;\n }\n return v;\n}\n\nfunction equalStyle(k, a, b, target) {\n if(!a || !b) {\n return a === b;\n }\n if(k === TRANSFORM) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let oa = a[i];\n let ob = b[i];\n if(oa[0] !== ob[0]) {\n return false;\n }\n // translate/matrix等都是数组\n if(!equalArr(oa[1], ob[1])) {\n return false;\n }\n }\n return true;\n }\n if(k === FILTER) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equalArr(a[i], b[i])) {\n return false;\n }\n }\n }\n if(k === BACKGROUND_SIZE) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let aa = a[i], bb = b[i];\n if(aa[0][0] !== bb[0][0] || aa[0][1] !== bb[0][1] || aa[1][0] !== bb[1][0] || aa[1][1] !== bb[1][1]) {\n return false;\n }\n }\n return true;\n }\n if(k === TRANSFORM_ORIGIN || RADIUS_HASH.hasOwnProperty(k)) {\n return a[0][0] === b[0][0] && a[0][1] === b[0][1]\n && a[1][0] === b[1][0] && a[1][1] === b[1][1];\n }\n if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y\n || LENGTH_HASH.hasOwnProperty(k) || EXPAND_HASH.hasOwnProperty(k)) {\n return a[0] === b[0] && a[1] === b[1];\n }\n if(k === BOX_SHADOW) {\n return equalArr(a, b);\n }\n if(COLOR_HASH.hasOwnProperty(k)) {\n return a[1] === b[1] && equalArr(a[0], b[0]);\n }\n if(GRADIENT_HASH.hasOwnProperty(k) && a.k === b.k && GRADIENT_TYPE.hasOwnProperty(a.k)) {\n let av = a.v;\n let bv = b.v;\n if(a.d !== b.d || av.length !== bv.length) {\n return false;\n }\n for(let i = 0, len = av.length; i < len; i++) {\n let ai = av[i];\n let bi = bv[i];\n if(ai.length !== bi.length) {\n return false;\n }\n for(let j = 0; j < 4; j++) {\n if(ai[0][j] !== bi[0][j]) {\n return false;\n }\n }\n if(ai.length > 1) {\n if(ai[1][0] !== bi[1][0] || ai[1][1] !== bi[1][1]) {\n return false;\n }\n }\n }\n return true;\n }\n // multi都是纯值数组,equalArr本身即递归,非multi根据类型判断\n if(isGeom(target.tagName, k) && (target.isMulti || Array.isArray(a) && Array.isArray(b))) {\n return equalArr(a, b);\n }\n return a === b;\n}\n\nfunction isRelativeOrAbsolute(node) {\n let position = node.currentStyle[POSITION];\n return position === 'relative' || position === 'absolute';\n}\n\nconst VALUE = {\n [POSITION]: true,\n [DISPLAY]: true,\n [STYLE_KEY.BACKGROUND_REPEAT]: true,\n [FLEX_DIRECTION]: true,\n [FLEX_GROW]: true,\n [FLEX_SHRINK]: true,\n [FLEX_WRAP]: true,\n [JUSTIFY_CONTENT]: true,\n [ALIGN_ITEMS]: true,\n [ALIGN_SELF]: true,\n [STYLE_KEY.OVERFLOW]: true,\n [STYLE_KEY.MIX_BLEND_MODE]: true,\n [STYLE_KEY.STROKE_LINECAP]: true,\n [STYLE_KEY.STROKE_LINEJOIN]: true,\n [STYLE_KEY.STROKE_MITERLIMIT]: true,\n [STYLE_KEY.FILL_RULE]: true,\n [OPACITY]: true,\n [Z_INDEX]: true,\n [BACKGROUND_CLIP]: true,\n [TEXT_OVERFLOW]: true,\n [LINE_CLAMP]: true,\n};\n// 仅1维数组\nconst ARRAY_0 = {\n [COLOR]: true,\n [TEXT_STROKE_COLOR]: true,\n [BACKGROUND_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_COLOR]: true,\n [STYLE_KEY.BORDER_RIGHT_COLOR]: true,\n [STYLE_KEY.BORDER_BOTTOM_COLOR]: true,\n [STYLE_KEY.BORDER_LEFT_COLOR]: true,\n};\n// 仅2维数组且只有2个值\nconst ARRAY_0_1 = {\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS]: true,\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS]: true,\n [TRANSFORM_ORIGIN]: true,\n [PERSPECTIVE_ORIGIN]: true,\n};\nfunction cloneStyle(style, keys) {\n if(!keys) {\n keys = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n }\n let res = {};\n for(let i = 0, len = keys.length; i < len; i++) {\n let k = keys[i];\n let v = style[k];\n // 渐变特殊处理\n if(k === BACKGROUND_IMAGE) {\n res[k] = v.map(item => {\n // 可能为null\n if(item && item.k) {\n return util.clone(item);\n }\n else {\n return item;\n }\n });\n }\n else if(k === FILL || k === STROKE) {\n res[k] = v.map(item => {\n // 渐变\n // 可能非法为空\n if(item && item.k) {\n return util.clone(item);\n }\n // 颜色\n else {\n return item.slice(0);\n }\n });\n }\n else if(k === TRANSFORM || k === FILTER) {\n if(v) {\n let n = v.slice(0);\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n n[i][1] = n[i][1].slice(0);\n }\n res[k] = n;\n }\n }\n else if(k === BOX_SHADOW) {\n if(v) {\n v = v.map(item => {\n let n = item.slice(0);\n n[4] = n[4].slice(0);\n return n;\n });\n res[k] = v;\n }\n }\n else if(k === TRANSLATE_PATH) {\n if(v) {\n res[k] = v.map(item => item.slice(0));\n }\n }\n // position等直接值类型赋值\n else if(VALUE.hasOwnProperty(k)) {\n res[k] = v;\n }\n // geom自定义属性\n else if(GEOM.hasOwnProperty(k)) {\n res[k] = util.clone(v);\n }\n // 其余皆是数组或空,默认是一维数组只需slice即可\n else if(v) {\n let n = res[k] = v.slice(0);\n // 特殊引用里数组某项再次clone\n if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n }\n }\n else if(k === BACKGROUND_SIZE) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n n[i][0] = n[i][0].slice(0);\n n[i][1] = n[i][1].slice(0);\n }\n }\n else if(ARRAY_0.hasOwnProperty(k)) {\n n[0] = n[0].slice(0);\n }\n else if(ARRAY_0_1.hasOwnProperty(k)) {\n n[0] = n[0].slice(0);\n n[1] = n[1].slice(0);\n }\n else if(k === TRANSFORM) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n }\n }\n else if(k === ROTATE_3D) {\n n[3] = n[3].slice(0);\n }\n }\n }\n return res;\n}\n\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 get isReplaced() {\n return false;\n }\n}\n\nexport default TextBox;\n","import inject from '../util/inject';\n\nlet SIZE = [8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192];\nlet NUMBER = [128, 64, 32, 16, 8, 4, 2, 1, 1, 1, 1];\nlet MAX = SIZE[SIZE.length - 1];\nconst HASH_CANVAS = {};\n\nlet uuid = 0;\n\nclass Page {\n constructor(size, number) {\n this.__size = size;\n this.__number = number;\n this.__free = this.__total = number * number;\n size *= number;\n this.__width = size;\n this.__height = size;\n let offscreen = this.__canvas = inject.getCacheCanvas(size, size, null, number);\n if(offscreen) {\n this.__offscreen = offscreen;\n }\n // 1/0标识n*n个单元格是否空闲可用,一维数组表示\n this.__grid = [];\n for(let i = 0; i < this.__total; i++) {\n this.__grid.push(1);\n }\n this.__uuid = uuid++;\n // webgl贴图缓存使用,一旦更新则标识记录,绑定某号纹理单元查看变化才更新贴图\n this.__update = false;\n this.time = 0;\n }\n\n add() {\n let { number, grid } = this;\n for(let i = 0; i < number; i++) {\n for(let j = 0; j < number; j++) {\n let index = i * number + j;\n if(grid[index]) {\n grid[index] = 0;\n this.__free--;\n return index;\n }\n }\n }\n // 理论不可能进入,除非bug\n throw new Error('Can not find free page');\n }\n\n del(pos) {\n if(!this.grid[pos]) {\n this.grid[pos] = 1;\n this.__free++;\n }\n }\n\n getCoords(pos) {\n let { size, number } = this;\n let x = pos % number;\n let y = Math.floor(pos / number);\n return [x * size, y * size];\n }\n\n get uuid() {\n return this.__uuid;\n }\n\n get size() {\n return this.__size;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get number() {\n return this.__number;\n }\n\n get total() {\n return this.__total;\n }\n\n get free() {\n return this.__free;\n }\n\n get grid() {\n return this.__grid;\n }\n\n get offscreen() {\n return this.__offscreen;\n }\n\n get canvas() {\n return this.offscreen.canvas;\n }\n\n get ctx() {\n return this.offscreen.ctx;\n }\n\n get update() {\n return this.__update;\n }\n\n set update(v) {\n this.__update = v;\n }\n\n static getInstance(size) {\n if(size > MAX) {\n return;\n }\n let s = SIZE[0];\n let n = NUMBER[0];\n // 使用刚好满足的尺寸\n for(let i = 0, len = SIZE.length; i < len; i++) {\n s = SIZE[i];\n n = NUMBER[i];\n if(SIZE[i] >= size) {\n break;\n }\n }\n let list = HASH_CANVAS[s] = HASH_CANVAS[s] || [];\n // 从hash列表中尝试取可用的一页,找不到就生成新的页\n let page;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item.free) {\n page = item;\n break;\n }\n }\n if(!page) {\n page = new Page(s, n);\n if(!page.offscreen) {\n inject.error('Can not create off-screen for page');\n return;\n }\n list.push(page);\n }\n let pos = page.add();\n return { page, pos };\n }\n\n static set CONFIG(v) {\n if(!v || !Array.isArray(v.SIZE) || !Array.isArray(v.NUMBER)) {\n return;\n }\n SIZE = v.SIZE;\n NUMBER = v.NUMBER;\n MAX = SIZE[SIZE.length - 1];\n }\n\n static get CONFIG() {\n return {\n SIZE,\n NUMBER,\n };\n }\n\n static get MAX() {\n return MAX;\n }\n\n static genUuid() {\n return uuid++;\n }\n}\n\nexport default Page;\n","import matrix from './matrix';\nimport geom from './geom';\n\n// 一条边相对于自己开始点的x向量角度,即从x到此边旋转,0~180和-180~0,需要判断象限\nfunction calDeg(x1, y1, x2, y2) {\n let dx = x2 - x1;\n let dy = y2 - y1;\n let atan = Math.atan(Math.abs(dy) / Math.abs(dx));\n // 2象限\n if(dx < 0 && dy >= 0) {\n return Math.PI - atan;\n }\n // 3象限\n if(dx < 0 && dy < 0) {\n return atan - Math.PI;\n }\n // 1象限\n if(dx >= 0 && dy >= 0) {\n return atan;\n }\n // 4象限,顺时针正好\n return -atan;\n}\n\nfunction rotate(theta) {\n let sin = Math.sin(theta);\n let cos = Math.cos(theta);\n let t = matrix.identity();\n t[0] = t[5] = cos;\n t[1] = sin;\n t[4] = -sin;\n return t;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param points\n */\nfunction pointIndex(points) {\n let [x1, y1, x2, y2, x3, y3] = points;\n let index = [0, 1, 2];\n // 将a点放入最左\n if(x2 < x1 && x2 < x3) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n index[0] = 1;\n index[1] = 0;\n }\n else if(x3 < x2 && x3 < x1) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n index[0] = 2;\n index[2] = 0;\n }\n // 有可能出现2个并列的情况,判断取上面那个\n if(x1 === x2) {\n if(y1 > y2) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n let t = index[0];\n index[0] = index[1];\n index[1] = t;\n }\n }\n else if(x1 === x3) {\n if(y1 > y3) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n let t = index[0];\n index[0] = index[2];\n index[2] = t;\n }\n }\n // ab到ac要顺时针旋转,即2个向量夹角为正,用向量叉乘判断正负\n let cross = (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1);\n if(cross < 0) {\n [x2, y2, x3, y3] = [x3, y3, x2, y2];\n let t = index[1];\n index[1] = index[2];\n index[2] = t;\n }\n return [x1, y1, x2, y2, x3, y3, index];\n}\n\n/**\n * 第2个点根据第一个点的交换顺序交换\n * @param points\n * @param index\n * @returns {[]}\n */\nfunction pointByIndex(points, index) {\n let res = [];\n for(let i = 0, len = index.length; i < len; i++) {\n let j = index[i];\n res.push(points[j * 2]);\n res.push(points[j * 2 + 1]);\n }\n return res;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param source 源3个点\n * @param target 目标3个点\n * @returns 交换顺序后的点坐标\n */\nfunction exchangeOrder(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3, index] = pointIndex(source);\n let [tx1, ty1, tx2, ty2, tx3, ty3] = pointByIndex(target, index);\n return [\n [sx1, sy1, sx2, sy2, sx3, sy3],\n [tx1, ty1, tx2, ty2, tx3, ty3]\n ];\n}\n\n/**\n * 存在一种情况,变换结果使得三角形镜像相反了,即顶点a越过bc线,判断是否溢出\n * @param source\n * @param target\n * @returns {boolean}是否溢出\n */\nfunction isOverflow(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n let cross1 = (sx2 - sx1) * (sy3 - sy1) - (sx3 - sx1) * (sy2 - sy1);\n let cross2 = (tx2 - tx1) * (ty3 - ty1) - (tx3 - tx1) * (ty2 - ty1);\n return cross1 > 0 && cross2 < 0 || cross1 < 0 && cross2 > 0;\n}\n\nfunction transform(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n // 记录翻转\n let overflow = isOverflow(source, target);\n // 第0步,将源三角第1个a点移到原点\n let m = matrix.identity();\n m[12] = -sx1;\n m[13] = -sy1;\n let t;\n // 第1步,以第1条边ab为基准,将其贴合x轴上,为后续倾斜不干扰做准备\n let theta = calDeg(sx1, sy1, sx2, sy2);\n if(theta !== 0) {\n t = rotate(-theta);\n m = matrix.multiply(t, m);\n }\n // 第2步,以第1条边AB为基准,缩放x轴ab至目标相同长度,可与4步合并\n let ls = geom.pointsDistance(sx1, sy1, sx2, sy2);\n let lt = geom.pointsDistance(tx1, ty1, tx2, ty2);\n // if(ls !== lt) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[0] = scale;\n // m = matrix.multiply(t, m);\n // }\n // 第3步,缩放y,先将目标三角形旋转到x轴平行,再变换坐标计算\n let n = matrix.identity();\n n[12] = -tx1;\n n[13] = -ty1;\n theta = calDeg(tx1, ty1, tx2, ty2);\n // 记录下这个旋转角度,后面源三角形要反向旋转\n let alpha = theta;\n if(theta !== 0) {\n t = rotate(-theta);\n n = matrix.multiply(t, n);\n }\n // 目标三角反向旋转至x轴后的坐标\n // 源三角目前的第3点坐标y值即为长度,因为a点在原点0无需减去\n let ls2 = Math.abs(matrix.calPoint([sx3, sy3], m)[1]);\n let lt2 = Math.abs(matrix.calPoint([tx3, ty3], n)[1]);\n // 缩放y\n // if(ls2 !== lt2) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[3] = scale;\n // m = matrix.multiply(t, m);\n // }\n if(ls !== lt || ls2 !== lt2) {\n t = matrix.identity();\n if(ls !== lt) {\n t[0] = lt / ls;\n }\n if(ls2 !== lt2) {\n t[5] = lt2 / ls2;\n }\n m = matrix.multiply(t, m);\n }\n // 第4步,x轴倾斜,用余弦定理求目前a和A的夹角\n n = m;\n let [ax1, ay1] = matrix.calPoint([sx1, sy1], n);\n let [ax2, ay2] = matrix.calPoint([sx2, sy2], n);\n let [ax3, ay3] = matrix.calPoint([sx3, sy3], n);\n let ab = geom.pointsDistance(ax1, ay1, ax2, ay2);\n let ac = geom.pointsDistance(ax1, ay1, ax3, ay3);\n let bc = geom.pointsDistance(ax3, ay3, ax2, ay2);\n let AB = geom.pointsDistance(tx1, ty1, tx2, ty2);\n let AC = geom.pointsDistance(tx1, ty1, tx3, ty3);\n let BC = geom.pointsDistance(tx3, ty3, tx2, ty2);\n let a = geom.angleBySide(bc, ab, ac);\n let A = geom.angleBySide(BC, AB, AC);\n // 先至90°,再旋转至目标角,可以合并成tan相加,不知道为什么不能直接tan倾斜差值角度\n if(a !== A) {\n t = matrix.identity();\n t[4] = Math.tan(a - Math.PI * 0.5) + Math.tan(Math.PI * 0.5 - A);\n m = matrix.multiply(t, m);\n }\n // 发生翻转时特殊处理按x轴垂直翻转\n if(overflow) {\n m[1] = -m[1];\n m[5] = -m[5];\n m[13] = -m[13];\n }\n // 第5步,再次旋转,角度为目标旋转到x轴的负值,可与下步合并\n if(alpha !== 0) {\n t = rotate(alpha);\n // m = matrix.multiply(t, m);\n }\n else {\n t = matrix.identity();\n }\n // 第6步,移动第一个点的差值\n // t = matrix.identity();\n t[12] = tx1;\n t[13] = ty1;\n return matrix.multiply(t, m);\n}\n\nexport default {\n exchangeOrder,\n isOverflow,\n transform,\n};\n","/**\n * martinez v0.7.1\n * Martinez polygon clipping algorithm, does boolean operation on polygons (multipolygons, polygons with holes etc): intersection, union, difference, xor\n *\n * @author Alex Milevski \n * @license MIT\n * @preserve\n */\n\nfunction DEFAULT_COMPARE (a, b) { return a > b ? 1 : a < b ? -1 : 0; }\n\nvar SplayTree = function SplayTree(compare, noDuplicates) {\n if ( compare === void 0 ) compare = DEFAULT_COMPARE;\n if ( noDuplicates === void 0 ) noDuplicates = false;\n\n this._compare = compare;\n this._root = null;\n this._size = 0;\n this._noDuplicates = !!noDuplicates;\n};\n\nvar prototypeAccessors = { size: { configurable: true } };\n\n\nSplayTree.prototype.rotateLeft = function rotateLeft (x) {\n var y = x.right;\n if (y) {\n x.right = y.left;\n if (y.left) { y.left.parent = x; }\n y.parent = x.parent;\n }\n\n if (!x.parent) { this._root = y; }\n else if (x === x.parent.left) { x.parent.left = y; }\n else { x.parent.right = y; }\n if (y) { y.left = x; }\n x.parent = y;\n};\n\n\nSplayTree.prototype.rotateRight = function rotateRight (x) {\n var y = x.left;\n if (y) {\n x.left = y.right;\n if (y.right) { y.right.parent = x; }\n y.parent = x.parent;\n }\n\n if (!x.parent) { this._root = y; }\n else if(x === x.parent.left) { x.parent.left = y; }\n else { x.parent.right = y; }\n if (y) { y.right = x; }\n x.parent = y;\n};\n\n\nSplayTree.prototype._splay = function _splay (x) {\n while (x.parent) {\n var p = x.parent;\n if (!p.parent) {\n if (p.left === x) { this.rotateRight(p); }\n else { this.rotateLeft(p); }\n } else if (p.left === x && p.parent.left === p) {\n this.rotateRight(p.parent);\n this.rotateRight(p);\n } else if (p.right === x && p.parent.right === p) {\n this.rotateLeft(p.parent);\n this.rotateLeft(p);\n } else if (p.left === x && p.parent.right === p) {\n this.rotateRight(p);\n this.rotateLeft(p);\n } else {\n this.rotateLeft(p);\n this.rotateRight(p);\n }\n }\n};\n\n\nSplayTree.prototype.splay = function splay (x) {\n var p, gp, ggp, l, r;\n\n while (x.parent) {\n p = x.parent;\n gp = p.parent;\n\n if (gp && gp.parent) {\n ggp = gp.parent;\n if (ggp.left === gp) { ggp.left= x; }\n else { ggp.right = x; }\n x.parent = ggp;\n } else {\n x.parent = null;\n this._root = x;\n }\n\n l = x.left; r = x.right;\n\n if (x === p.left) { // left\n if (gp) {\n if (gp.left === p) {\n /* zig-zig */\n if (p.right) {\n gp.left = p.right;\n gp.left.parent = gp;\n } else { gp.left = null; }\n\n p.right = gp;\n gp.parent = p;\n } else {\n /* zig-zag */\n if (l) {\n gp.right = l;\n l.parent = gp;\n } else { gp.right = null; }\n\n x.left = gp;\n gp.parent = x;\n }\n }\n if (r) {\n p.left = r;\n r.parent = p;\n } else { p.left = null; }\n\n x.right= p;\n p.parent = x;\n } else { // right\n if (gp) {\n if (gp.right === p) {\n /* zig-zig */\n if (p.left) {\n gp.right = p.left;\n gp.right.parent = gp;\n } else { gp.right = null; }\n\n p.left = gp;\n gp.parent = p;\n } else {\n /* zig-zag */\n if (r) {\n gp.left = r;\n r.parent = gp;\n } else { gp.left = null; }\n\n x.right = gp;\n gp.parent = x;\n }\n }\n if (l) {\n p.right = l;\n l.parent = p;\n } else { p.right = null; }\n\n x.left = p;\n p.parent = x;\n }\n }\n};\n\n\nSplayTree.prototype.replace = function replace (u, v) {\n if (!u.parent) { this._root = v; }\n else if (u === u.parent.left) { u.parent.left = v; }\n else { u.parent.right = v; }\n if (v) { v.parent = u.parent; }\n};\n\n\nSplayTree.prototype.minNode = function minNode (u) {\n if ( u === void 0 ) u = this._root;\n\n if (u) { while (u.left) { u = u.left; } }\n return u;\n};\n\n\nSplayTree.prototype.maxNode = function maxNode (u) {\n if ( u === void 0 ) u = this._root;\n\n if (u) { while (u.right) { u = u.right; } }\n return u;\n};\n\n\nSplayTree.prototype.insert = function insert (key, data) {\n var z = this._root;\n var p = null;\n var comp = this._compare;\n var cmp;\n\n if (this._noDuplicates) {\n while (z) {\n p = z;\n cmp = comp(z.key, key);\n if (cmp === 0) { return; }\n else if (comp(z.key, key) < 0) { z = z.right; }\n else { z = z.left; }\n }\n } else {\n while (z) {\n p = z;\n if (comp(z.key, key) < 0) { z = z.right; }\n else { z = z.left; }\n }\n }\n\n z = { key: key, data: data, left: null, right: null, parent: p };\n\n if (!p) { this._root = z; }\n else if (comp(p.key, z.key) < 0) { p.right = z; }\n else { p.left= z; }\n\n this.splay(z);\n this._size++;\n return z;\n};\n\n\nSplayTree.prototype.find = function find (key) {\n var z = this._root;\n var comp = this._compare;\n while (z) {\n var cmp = comp(z.key, key);\n if (cmp < 0) { z = z.right; }\n else if (cmp > 0) { z = z.left; }\n else { return z; }\n }\n return null;\n};\n\n/**\n * Whether the tree contains a node with the given key\n * @param{Key} key\n * @return {boolean} true/false\n */\nSplayTree.prototype.contains = function contains (key) {\n var node = this._root;\n var comparator = this._compare;\n while (node){\n var cmp = comparator(key, node.key);\n if (cmp === 0) { return true; }\n else if (cmp < 0) { node = node.left; }\n else { node = node.right; }\n }\n\n return false;\n};\n\n\nSplayTree.prototype.remove = function remove (key) {\n var z = this.find(key);\n\n if (!z) { return false; }\n\n this.splay(z);\n\n if (!z.left) { this.replace(z, z.right); }\n else if (!z.right) { this.replace(z, z.left); }\n else {\n var y = this.minNode(z.right);\n if (y.parent !== z) {\n this.replace(y, y.right);\n y.right = z.right;\n y.right.parent = y;\n }\n this.replace(z, y);\n y.left = z.left;\n y.left.parent = y;\n }\n\n this._size--;\n return true;\n};\n\n\nSplayTree.prototype.removeNode = function removeNode (z) {\n if (!z) { return false; }\n\n this.splay(z);\n\n if (!z.left) { this.replace(z, z.right); }\n else if (!z.right) { this.replace(z, z.left); }\n else {\n var y = this.minNode(z.right);\n if (y.parent !== z) {\n this.replace(y, y.right);\n y.right = z.right;\n y.right.parent = y;\n }\n this.replace(z, y);\n y.left = z.left;\n y.left.parent = y;\n }\n\n this._size--;\n return true;\n};\n\n\nSplayTree.prototype.erase = function erase (key) {\n var z = this.find(key);\n if (!z) { return; }\n\n this.splay(z);\n\n var s = z.left;\n var t = z.right;\n\n var sMax = null;\n if (s) {\n s.parent = null;\n sMax = this.maxNode(s);\n this.splay(sMax);\n this._root = sMax;\n }\n if (t) {\n if (s) { sMax.right = t; }\n else { this._root = t; }\n t.parent = sMax;\n }\n\n this._size--;\n};\n\n/**\n * Removes and returns the node with smallest key\n * @return {?Node}\n */\nSplayTree.prototype.pop = function pop () {\n var node = this._root, returnValue = null;\n if (node) {\n while (node.left) { node = node.left; }\n returnValue = { key: node.key, data: node.data };\n this.remove(node.key);\n }\n return returnValue;\n};\n\n\n/* eslint-disable class-methods-use-this */\n\n/**\n * Successor node\n * @param{Node} node\n * @return {?Node}\n */\nSplayTree.prototype.next = function next (node) {\n var successor = node;\n if (successor) {\n if (successor.right) {\n successor = successor.right;\n while (successor && successor.left) { successor = successor.left; }\n } else {\n successor = node.parent;\n while (successor && successor.right === node) {\n node = successor; successor = successor.parent;\n }\n }\n }\n return successor;\n};\n\n\n/**\n * Predecessor node\n * @param{Node} node\n * @return {?Node}\n */\nSplayTree.prototype.prev = function prev (node) {\n var predecessor = node;\n if (predecessor) {\n if (predecessor.left) {\n predecessor = predecessor.left;\n while (predecessor && predecessor.right) { predecessor = predecessor.right; }\n } else {\n predecessor = node.parent;\n while (predecessor && predecessor.left === node) {\n node = predecessor;\n predecessor = predecessor.parent;\n }\n }\n }\n return predecessor;\n};\n/* eslint-enable class-methods-use-this */\n\n\n/**\n * @param{forEachCallback} callback\n * @return {SplayTree}\n */\nSplayTree.prototype.forEach = function forEach (callback) {\n var current = this._root;\n var s = [], done = false, i = 0;\n\n while (!done) {\n // Reach the left most Node of the current Node\n if (current) {\n // Place pointer to a tree node on the stack\n // before traversing the node's left subtree\n s.push(current);\n current = current.left;\n } else {\n // BackTrack from the empty subtree and visit the Node\n // at the top of the stack; however, if the stack is\n // empty you are done\n if (s.length > 0) {\n current = s.pop();\n callback(current, i++);\n\n // We have visited the node and its left\n // subtree. Now, it's right subtree's turn\n current = current.right;\n } else { done = true; }\n }\n }\n return this;\n};\n\n\n/**\n * Walk key range from `low` to `high`. Stops if `fn` returns a value.\n * @param{Key} low\n * @param{Key} high\n * @param{Function} fn\n * @param{*?} ctx\n * @return {SplayTree}\n */\nSplayTree.prototype.range = function range (low, high, fn, ctx) {\n var Q = [];\n var compare = this._compare;\n var node = this._root, cmp;\n\n while (Q.length !== 0 || node) {\n if (node) {\n Q.push(node);\n node = node.left;\n } else {\n node = Q.pop();\n cmp = compare(node.key, high);\n if (cmp > 0) {\n break;\n } else if (compare(node.key, low) >= 0) {\n if (fn.call(ctx, node)) { return this; } // stop if smth is returned\n }\n node = node.right;\n }\n }\n return this;\n};\n\n/**\n * Returns all keys in order\n * @return {Array}\n */\nSplayTree.prototype.keys = function keys () {\n var current = this._root;\n var s = [], r = [], done = false;\n\n while (!done) {\n if (current) {\n s.push(current);\n current = current.left;\n } else {\n if (s.length > 0) {\n current = s.pop();\n r.push(current.key);\n current = current.right;\n } else { done = true; }\n }\n }\n return r;\n};\n\n\n/**\n * Returns `data` fields of all nodes in order.\n * @return {Array}\n */\nSplayTree.prototype.values = function values () {\n var current = this._root;\n var s = [], r = [], done = false;\n\n while (!done) {\n if (current) {\n s.push(current);\n current = current.left;\n } else {\n if (s.length > 0) {\n current = s.pop();\n r.push(current.data);\n current = current.right;\n } else { done = true; }\n }\n }\n return r;\n};\n\n\n/**\n * Returns node at given index\n * @param{number} index\n * @return {?Node}\n */\nSplayTree.prototype.at = function at (index) {\n // removed after a consideration, more misleading than useful\n // index = index % this.size;\n // if (index < 0) index = this.size - index;\n\n var current = this._root;\n var s = [], done = false, i = 0;\n\n while (!done) {\n if (current) {\n s.push(current);\n current = current.left;\n } else {\n if (s.length > 0) {\n current = s.pop();\n if (i === index) { return current; }\n i++;\n current = current.right;\n } else { done = true; }\n }\n }\n return null;\n};\n\n/**\n * Bulk-load items. Both array have to be same size\n * @param{Array} keys\n * @param{Array}[values]\n * @param{Boolean} [presort=false] Pre-sort keys and values, using\n * tree's comparator. Sorting is done\n * in-place\n * @return {AVLTree}\n */\nSplayTree.prototype.load = function load (keys, values, presort) {\n if ( keys === void 0 ) keys = [];\n if ( values === void 0 ) values = [];\n if ( presort === void 0 ) presort = false;\n\n if (this._size !== 0) { throw new Error('bulk-load: tree is not empty'); }\n var size = keys.length;\n if (presort) { sort(keys, values, 0, size - 1, this._compare); }\n this._root = loadRecursive(null, keys, values, 0, size);\n this._size = size;\n return this;\n};\n\n\nSplayTree.prototype.min = function min () {\n var node = this.minNode(this._root);\n if (node) { return node.key; }\n else { return null; }\n};\n\n\nSplayTree.prototype.max = function max () {\n var node = this.maxNode(this._root);\n if (node) { return node.key; }\n else { return null; }\n};\n\nSplayTree.prototype.isEmpty = function isEmpty () { return this._root === null; };\nprototypeAccessors.size.get = function () { return this._size; };\n\n\n/**\n * Create a tree and load it with items\n * @param{Array} keys\n * @param{Array?} [values]\n\n * @param{Function?} [comparator]\n * @param{Boolean?} [presort=false] Pre-sort keys and values, using\n * tree's comparator. Sorting is done\n * in-place\n * @param{Boolean?} [noDuplicates=false] Allow duplicates\n * @return {SplayTree}\n */\nSplayTree.createTree = function createTree (keys, values, comparator, presort, noDuplicates) {\n return new SplayTree(comparator, noDuplicates).load(keys, values, presort);\n};\n\nObject.defineProperties( SplayTree.prototype, prototypeAccessors );\n\n\nfunction loadRecursive (parent, keys, values, start, end) {\n var size = end - start;\n if (size > 0) {\n var middle = start + Math.floor(size / 2);\n var key = keys[middle];\n var data = values[middle];\n var node = { key: key, data: data, parent: parent };\n node.left = loadRecursive(node, keys, values, start, middle);\n node.right = loadRecursive(node, keys, values, middle + 1, end);\n return node;\n }\n return null;\n}\n\n\nfunction sort(keys, values, left, right, compare) {\n if (left >= right) { return; }\n\n var pivot = keys[(left + right) >> 1];\n var i = left - 1;\n var j = right + 1;\n\n while (true) {\n do { i++; } while (compare(keys[i], pivot) < 0);\n do { j--; } while (compare(keys[j], pivot) > 0);\n if (i >= j) { break; }\n\n var tmp = keys[i];\n keys[i] = keys[j];\n keys[j] = tmp;\n\n tmp = values[i];\n values[i] = values[j];\n values[j] = tmp;\n }\n\n sort(keys, values, left, j, compare);\n sort(keys, values, j + 1, right, compare);\n}\n\nvar NORMAL = 0;\nvar NON_CONTRIBUTING = 1;\nvar SAME_TRANSITION = 2;\nvar DIFFERENT_TRANSITION = 3;\n\nvar INTERSECTION = 0;\nvar UNION = 1;\nvar DIFFERENCE = 2;\nvar XOR = 3;\n\n/**\n * @param {SweepEvent} event\n * @param {SweepEvent} prev\n * @param {Operation} operation\n */\nfunction computeFields (event, prev, operation) {\n // compute inOut and otherInOut fields\n if (prev === null) {\n event.inOut = false;\n event.otherInOut = true;\n\n // previous line segment in sweepline belongs to the same polygon\n } else {\n if (event.isSubject === prev.isSubject) {\n event.inOut = !prev.inOut;\n event.otherInOut = prev.otherInOut;\n\n // previous line segment in sweepline belongs to the clipping polygon\n } else {\n event.inOut = !prev.otherInOut;\n event.otherInOut = prev.isVertical() ? !prev.inOut : prev.inOut;\n }\n\n // compute prevInResult field\n if (prev) {\n event.prevInResult = (!inResult(prev, operation) || prev.isVertical())\n ? prev.prevInResult : prev;\n }\n }\n\n // check if the line segment belongs to the Boolean operation\n var isInResult = inResult(event, operation);\n if (isInResult) {\n event.resultTransition = determineResultTransition(event, operation);\n } else {\n event.resultTransition = 0;\n }\n}\n\n\n/* eslint-disable indent */\nfunction inResult(event, operation) {\n switch (event.type) {\n case NORMAL:\n switch (operation) {\n case INTERSECTION:\n return !event.otherInOut;\n case UNION:\n return event.otherInOut;\n case DIFFERENCE:\n // return (event.isSubject && !event.otherInOut) ||\n // (!event.isSubject && event.otherInOut);\n return (event.isSubject && event.otherInOut) ||\n (!event.isSubject && !event.otherInOut);\n case XOR:\n return true;\n }\n break;\n case SAME_TRANSITION:\n return operation === INTERSECTION || operation === UNION;\n case DIFFERENT_TRANSITION:\n return operation === DIFFERENCE;\n case NON_CONTRIBUTING:\n return false;\n }\n return false;\n}\n/* eslint-enable indent */\n\n\nfunction determineResultTransition(event, operation) {\n var thisIn = !event.inOut;\n var thatIn = !event.otherInOut;\n\n var isIn;\n switch (operation) {\n case INTERSECTION:\n isIn = thisIn && thatIn; break;\n case UNION:\n isIn = thisIn || thatIn; break;\n case XOR:\n isIn = thisIn ^ thatIn; break;\n case DIFFERENCE:\n if (event.isSubject) {\n isIn = thisIn && !thatIn;\n } else {\n isIn = thatIn && !thisIn;\n }\n break;\n }\n return isIn ? +1 : -1;\n}\n\nvar SweepEvent = function SweepEvent (point, left, otherEvent, isSubject, edgeType) {\n\n /**\n * Is left endpoint?\n * @type {Boolean}\n */\n this.left = left;\n\n /**\n * @type {Array.}\n */\n this.point = point;\n\n /**\n * Other edge reference\n * @type {SweepEvent}\n */\n this.otherEvent = otherEvent;\n\n /**\n * Belongs to source or clipping polygon\n * @type {Boolean}\n */\n this.isSubject = isSubject;\n\n /**\n * Edge contribution type\n * @type {Number}\n */\n this.type = edgeType || NORMAL;\n\n\n /**\n * In-out transition for the sweepline crossing polygon\n * @type {Boolean}\n */\n this.inOut = false;\n\n\n /**\n * @type {Boolean}\n */\n this.otherInOut = false;\n\n /**\n * Previous event in result?\n * @type {SweepEvent}\n */\n this.prevInResult = null;\n\n /**\n * Type of result transition (0 = not in result, +1 = out-in, -1, in-out)\n * @type {Number}\n */\n this.resultTransition = 0;\n\n // connection step\n\n /**\n * @type {Number}\n */\n this.otherPos = -1;\n\n /**\n * @type {Number}\n */\n this.outputContourId = -1;\n\n this.isExteriorRing = true; // TODO: Looks unused, remove?\n};\n\nvar prototypeAccessors$1 = { inResult: { configurable: true } };\n\n\n/**\n * @param{Array.}p\n * @return {Boolean}\n */\nSweepEvent.prototype.isBelow = function isBelow (p) {\n var p0 = this.point, p1 = this.otherEvent.point;\n return this.left\n ? (p0[0] - p[0]) * (p1[1] - p[1]) - (p1[0] - p[0]) * (p0[1] - p[1]) > 0\n // signedArea(this.point, this.otherEvent.point, p) > 0 :\n : (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0;\n //signedArea(this.otherEvent.point, this.point, p) > 0;\n};\n\n\n/**\n * @param{Array.}p\n * @return {Boolean}\n */\nSweepEvent.prototype.isAbove = function isAbove (p) {\n return !this.isBelow(p);\n};\n\n\n/**\n * @return {Boolean}\n */\nSweepEvent.prototype.isVertical = function isVertical () {\n return this.point[0] === this.otherEvent.point[0];\n};\n\n\n/**\n * Does event belong to result?\n * @return {Boolean}\n */\nprototypeAccessors$1.inResult.get = function () {\n return this.resultTransition !== 0;\n};\n\n\nSweepEvent.prototype.clone = function clone () {\n var copy = new SweepEvent(\n this.point, this.left, this.otherEvent, this.isSubject, this.type);\n\n copy.contourId = this.contourId;\n copy.resultTransition = this.resultTransition;\n copy.prevInResult = this.prevInResult;\n copy.isExteriorRing = this.isExteriorRing;\n copy.inOut = this.inOut;\n copy.otherInOut = this.otherInOut;\n\n return copy;\n};\n\nObject.defineProperties( SweepEvent.prototype, prototypeAccessors$1 );\n\nfunction equals(p1, p2) {\n if (p1[0] === p2[0]) {\n if (p1[1] === p2[1]) {\n return true;\n } else {\n return false;\n }\n }\n return false;\n}\n\n// const EPSILON = 1e-9;\n// const abs = Math.abs;\n// TODO https://github.com/w8r/martinez/issues/6#issuecomment-262847164\n// Precision problem.\n//\n// module.exports = function equals(p1, p2) {\n// return abs(p1[0] - p2[0]) <= EPSILON && abs(p1[1] - p2[1]) <= EPSILON;\n// };\n\nvar epsilon = 1.1102230246251565e-16;\nvar splitter = 134217729;\nvar resulterrbound = (3 + 8 * epsilon) * epsilon;\n\n// fast_expansion_sum_zeroelim routine from oritinal code\nfunction sum(elen, e, flen, f, h) {\n var Q, Qnew, hh, bvirt;\n var enow = e[0];\n var fnow = f[0];\n var eindex = 0;\n var findex = 0;\n if ((fnow > enow) === (fnow > -enow)) {\n Q = enow;\n enow = e[++eindex];\n } else {\n Q = fnow;\n fnow = f[++findex];\n }\n var hindex = 0;\n if (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = enow + Q;\n hh = Q - (Qnew - enow);\n enow = e[++eindex];\n } else {\n Qnew = fnow + Q;\n hh = Q - (Qnew - fnow);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n while (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n } else {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n }\n while (eindex < elen) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n while (findex < flen) {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nfunction estimate(elen, e) {\n var Q = e[0];\n for (var i = 1; i < elen; i++) { Q += e[i]; }\n return Q;\n}\n\nfunction vec(n) {\n return new Float64Array(n);\n}\n\nvar ccwerrboundA = (3 + 16 * epsilon) * epsilon;\nvar ccwerrboundB = (2 + 12 * epsilon) * epsilon;\nvar ccwerrboundC = (9 + 64 * epsilon) * epsilon * epsilon;\n\nvar B = vec(4);\nvar C1 = vec(8);\nvar C2 = vec(12);\nvar D = vec(16);\nvar u = vec(4);\n\nfunction orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {\n var acxtail, acytail, bcxtail, bcytail;\n var bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n var acx = ax - cx;\n var bcx = bx - cx;\n var acy = ay - cy;\n var bcy = by - cy;\n\n s1 = acx * bcy;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcx;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n B[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n B[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n B[2] = _j - (u3 - bvirt) + (_i - bvirt);\n B[3] = u3;\n\n var det = estimate(4, B);\n var errbound = ccwerrboundB * detsum;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - acx;\n acxtail = ax - (acx + bvirt) + (bvirt - cx);\n bvirt = bx - bcx;\n bcxtail = bx - (bcx + bvirt) + (bvirt - cx);\n bvirt = ay - acy;\n acytail = ay - (acy + bvirt) + (bvirt - cy);\n bvirt = by - bcy;\n bcytail = by - (bcy + bvirt) + (bvirt - cy);\n\n if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) {\n return det;\n }\n\n errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det);\n det += (acx * bcytail + bcy * acxtail) - (acy * bcxtail + bcx * acytail);\n if (det >= errbound || -det >= errbound) { return det; }\n\n s1 = acxtail * bcy;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcx;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n var C1len = sum(4, B, 4, u, C1);\n\n s1 = acx * bcytail;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcxtail;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n var C2len = sum(C1len, C1, 4, u, C2);\n\n s1 = acxtail * bcytail;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcxtail;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n var Dlen = sum(C2len, C2, 4, u, D);\n\n return D[Dlen - 1];\n}\n\nfunction orient2d(ax, ay, bx, by, cx, cy) {\n var detleft = (ay - cy) * (bx - cx);\n var detright = (ax - cx) * (by - cy);\n var det = detleft - detright;\n\n if (detleft === 0 || detright === 0 || (detleft > 0) !== (detright > 0)) { return det; }\n\n var detsum = Math.abs(detleft + detright);\n if (Math.abs(det) >= ccwerrboundA * detsum) { return det; }\n\n return -orient2dadapt(ax, ay, bx, by, cx, cy, detsum);\n}\n\n/**\n * Signed area of the triangle (p0, p1, p2)\n * @param {Array.} p0\n * @param {Array.} p1\n * @param {Array.} p2\n * @return {Number}\n */\nfunction signedArea(p0, p1, p2) {\n var res = orient2d(p0[0], p0[1], p1[0], p1[1], p2[0], p2[1]);\n if (res > 0) { return -1; }\n if (res < 0) { return 1; }\n return 0;\n}\n\n/**\n * @param {SweepEvent} e1\n * @param {SweepEvent} e2\n * @return {Number}\n */\nfunction compareEvents(e1, e2) {\n var p1 = e1.point;\n var p2 = e2.point;\n\n // Different x-coordinate\n if (p1[0] > p2[0]) { return 1; }\n if (p1[0] < p2[0]) { return -1; }\n\n // Different points, but same x-coordinate\n // Event with lower y-coordinate is processed first\n if (p1[1] !== p2[1]) { return p1[1] > p2[1] ? 1 : -1; }\n\n return specialCases(e1, e2, p1);\n}\n\n\n/* eslint-disable no-unused-vars */\nfunction specialCases(e1, e2, p1, p2) {\n // Same coordinates, but one is a left endpoint and the other is\n // a right endpoint. The right endpoint is processed first\n if (e1.left !== e2.left)\n { return e1.left ? 1 : -1; }\n\n // const p2 = e1.otherEvent.point, p3 = e2.otherEvent.point;\n // const sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1])\n // Same coordinates, both events\n // are left endpoints or right endpoints.\n // not collinear\n if (signedArea(p1, e1.otherEvent.point, e2.otherEvent.point) !== 0) {\n // the event associate to the bottom segment is processed first\n return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1;\n }\n\n return (!e1.isSubject && e2.isSubject) ? 1 : -1;\n}\n/* eslint-enable no-unused-vars */\n\n/**\n * @param {SweepEvent} se\n * @param {Array.} p\n * @param {Queue} queue\n * @return {Queue}\n */\nfunction divideSegment(se, p, queue) {\n var r = new SweepEvent(p, false, se, se.isSubject);\n var l = new SweepEvent(p, true, se.otherEvent, se.isSubject);\n\n /* eslint-disable no-console */\n if (equals(se.point, se.otherEvent.point)) {\n console.warn('what is that, a collapsed segment?', se);\n }\n /* eslint-enable no-console */\n\n r.contourId = l.contourId = se.contourId;\n\n // avoid a rounding error. The left event would be processed after the right event\n if (compareEvents(l, se.otherEvent) > 0) {\n se.otherEvent.left = true;\n l.left = false;\n }\n\n // avoid a rounding error. The left event would be processed after the right event\n // if (compareEvents(se, r) > 0) {}\n\n se.otherEvent.otherEvent = l;\n se.otherEvent = r;\n\n queue.push(l);\n queue.push(r);\n\n return queue;\n}\n\n//const EPS = 1e-9;\n\n/**\n * Finds the magnitude of the cross product of two vectors (if we pretend\n * they're in three dimensions)\n *\n * @param {Object} a First vector\n * @param {Object} b Second vector\n * @private\n * @returns {Number} The magnitude of the cross product\n */\nfunction crossProduct(a, b) {\n return (a[0] * b[1]) - (a[1] * b[0]);\n}\n\n/**\n * Finds the dot product of two vectors.\n *\n * @param {Object} a First vector\n * @param {Object} b Second vector\n * @private\n * @returns {Number} The dot product\n */\nfunction dotProduct(a, b) {\n return (a[0] * b[0]) + (a[1] * b[1]);\n}\n\n/**\n * Finds the intersection (if any) between two line segments a and b, given the\n * line segments' end points a1, a2 and b1, b2.\n *\n * This algorithm is based on Schneider and Eberly.\n * http://www.cimec.org.ar/~ncalvo/Schneider_Eberly.pdf\n * Page 244.\n *\n * @param {Array.} a1 point of first line\n * @param {Array.} a2 point of first line\n * @param {Array.} b1 point of second line\n * @param {Array.} b2 point of second line\n * @param {Boolean=} noEndpointTouch whether to skip single touchpoints\n * (meaning connected segments) as\n * intersections\n * @returns {Array.>|Null} If the lines intersect, the point of\n * intersection. If they overlap, the two end points of the overlapping segment.\n * Otherwise, null.\n */\nfunction intersection (a1, a2, b1, b2, noEndpointTouch) {\n // The algorithm expects our lines in the form P + sd, where P is a point,\n // s is on the interval [0, 1], and d is a vector.\n // We are passed two points. P can be the first point of each pair. The\n // vector, then, could be thought of as the distance (in x and y components)\n // from the first point to the second point.\n // So first, let's make our vectors:\n var va = [a2[0] - a1[0], a2[1] - a1[1]];\n var vb = [b2[0] - b1[0], b2[1] - b1[1]];\n // We also define a function to convert back to regular point form:\n\n /* eslint-disable arrow-body-style */\n\n function toPoint(p, s, d) {\n return [\n p[0] + s * d[0],\n p[1] + s * d[1]\n ];\n }\n\n /* eslint-enable arrow-body-style */\n\n // The rest is pretty much a straight port of the algorithm.\n var e = [b1[0] - a1[0], b1[1] - a1[1]];\n var kross = crossProduct(va, vb);\n var sqrKross = kross * kross;\n var sqrLenA = dotProduct(va, va);\n //const sqrLenB = dotProduct(vb, vb);\n\n // Check for line intersection. This works because of the properties of the\n // cross product -- specifically, two vectors are parallel if and only if the\n // cross product is the 0 vector. The full calculation involves relative error\n // to account for possible very small line segments. See Schneider & Eberly\n // for details.\n if (sqrKross > 0/* EPS * sqrLenB * sqLenA */) {\n // If they're not parallel, then (because these are line segments) they\n // still might not actually intersect. This code checks that the\n // intersection point of the lines is actually on both line segments.\n var s = crossProduct(e, vb) / kross;\n if (s < 0 || s > 1) {\n // not on line segment a\n return null;\n }\n var t = crossProduct(e, va) / kross;\n if (t < 0 || t > 1) {\n // not on line segment b\n return null;\n }\n if (s === 0 || s === 1) {\n // on an endpoint of line segment a\n return noEndpointTouch ? null : [toPoint(a1, s, va)];\n }\n if (t === 0 || t === 1) {\n // on an endpoint of line segment b\n return noEndpointTouch ? null : [toPoint(b1, t, vb)];\n }\n return [toPoint(a1, s, va)];\n }\n\n // If we've reached this point, then the lines are either parallel or the\n // same, but the segments could overlap partially or fully, or not at all.\n // So we need to find the overlap, if any. To do that, we can use e, which is\n // the (vector) difference between the two initial points. If this is parallel\n // with the line itself, then the two lines are the same line, and there will\n // be overlap.\n //const sqrLenE = dotProduct(e, e);\n kross = crossProduct(e, va);\n sqrKross = kross * kross;\n\n if (sqrKross > 0 /* EPS * sqLenB * sqLenE */) {\n // Lines are just parallel, not the same. No overlap.\n return null;\n }\n\n var sa = dotProduct(va, e) / sqrLenA;\n var sb = sa + dotProduct(va, vb) / sqrLenA;\n var smin = Math.min(sa, sb);\n var smax = Math.max(sa, sb);\n\n // this is, essentially, the FindIntersection acting on floats from\n // Schneider & Eberly, just inlined into this function.\n if (smin <= 1 && smax >= 0) {\n\n // overlap on an end point\n if (smin === 1) {\n return noEndpointTouch ? null : [toPoint(a1, smin > 0 ? smin : 0, va)];\n }\n\n if (smax === 0) {\n return noEndpointTouch ? null : [toPoint(a1, smax < 1 ? smax : 1, va)];\n }\n\n if (noEndpointTouch && smin === 0 && smax === 1) { return null; }\n\n // There's overlap on a segment -- two points of intersection. Return both.\n return [\n toPoint(a1, smin > 0 ? smin : 0, va),\n toPoint(a1, smax < 1 ? smax : 1, va)\n ];\n }\n\n return null;\n}\n\n/**\n * @param {SweepEvent} se1\n * @param {SweepEvent} se2\n * @param {Queue} queue\n * @return {Number}\n */\nfunction possibleIntersection (se1, se2, queue) {\n // that disallows self-intersecting polygons,\n // did cost us half a day, so I'll leave it\n // out of respect\n // if (se1.isSubject === se2.isSubject) return;\n var inter = intersection(\n se1.point, se1.otherEvent.point,\n se2.point, se2.otherEvent.point\n );\n\n var nintersections = inter ? inter.length : 0;\n if (nintersections === 0) { return 0; } // no intersection\n\n // the line segments intersect at an endpoint of both line segments\n if ((nintersections === 1) &&\n (equals(se1.point, se2.point) ||\n equals(se1.otherEvent.point, se2.otherEvent.point))) {\n return 0;\n }\n\n if (nintersections === 2 && se1.isSubject === se2.isSubject) {\n // if(se1.contourId === se2.contourId){\n // console.warn('Edges of the same polygon overlap',\n // se1.point, se1.otherEvent.point, se2.point, se2.otherEvent.point);\n // }\n //throw new Error('Edges of the same polygon overlap');\n return 0;\n }\n\n // The line segments associated to se1 and se2 intersect\n if (nintersections === 1) {\n\n // if the intersection point is not an endpoint of se1\n if (!equals(se1.point, inter[0]) && !equals(se1.otherEvent.point, inter[0])) {\n divideSegment(se1, inter[0], queue);\n }\n\n // if the intersection point is not an endpoint of se2\n if (!equals(se2.point, inter[0]) && !equals(se2.otherEvent.point, inter[0])) {\n divideSegment(se2, inter[0], queue);\n }\n return 1;\n }\n\n // The line segments associated to se1 and se2 overlap\n var events = [];\n var leftCoincide = false;\n var rightCoincide = false;\n\n if (equals(se1.point, se2.point)) {\n leftCoincide = true; // linked\n } else if (compareEvents(se1, se2) === 1) {\n events.push(se2, se1);\n } else {\n events.push(se1, se2);\n }\n\n if (equals(se1.otherEvent.point, se2.otherEvent.point)) {\n rightCoincide = true;\n } else if (compareEvents(se1.otherEvent, se2.otherEvent) === 1) {\n events.push(se2.otherEvent, se1.otherEvent);\n } else {\n events.push(se1.otherEvent, se2.otherEvent);\n }\n\n if ((leftCoincide && rightCoincide) || leftCoincide) {\n // both line segments are equal or share the left endpoint\n se2.type = NON_CONTRIBUTING;\n se1.type = (se2.inOut === se1.inOut)\n ? SAME_TRANSITION : DIFFERENT_TRANSITION;\n\n if (leftCoincide && !rightCoincide) {\n // honestly no idea, but changing events selection from [2, 1]\n // to [0, 1] fixes the overlapping self-intersecting polygons issue\n divideSegment(events[1].otherEvent, events[0].point, queue);\n }\n return 2;\n }\n\n // the line segments share the right endpoint\n if (rightCoincide) {\n divideSegment(events[0], events[1].point, queue);\n return 3;\n }\n\n // no line segment includes totally the other one\n if (events[0] !== events[3].otherEvent) {\n divideSegment(events[0], events[1].point, queue);\n divideSegment(events[1], events[2].point, queue);\n return 3;\n }\n\n // one line segment includes the other one\n divideSegment(events[0], events[1].point, queue);\n divideSegment(events[3].otherEvent, events[2].point, queue);\n\n return 3;\n}\n\n/**\n * @param {SweepEvent} le1\n * @param {SweepEvent} le2\n * @return {Number}\n */\nfunction compareSegments(le1, le2) {\n if (le1 === le2) { return 0; }\n\n // Segments are not collinear\n if (signedArea(le1.point, le1.otherEvent.point, le2.point) !== 0 ||\n signedArea(le1.point, le1.otherEvent.point, le2.otherEvent.point) !== 0) {\n\n // If they share their left endpoint use the right endpoint to sort\n if (equals(le1.point, le2.point)) { return le1.isBelow(le2.otherEvent.point) ? -1 : 1; }\n\n // Different left endpoint: use the left endpoint to sort\n if (le1.point[0] === le2.point[0]) { return le1.point[1] < le2.point[1] ? -1 : 1; }\n\n // has the line segment associated to e1 been inserted\n // into S after the line segment associated to e2 ?\n if (compareEvents(le1, le2) === 1) { return le2.isAbove(le1.point) ? -1 : 1; }\n\n // The line segment associated to e2 has been inserted\n // into S after the line segment associated to e1\n return le1.isBelow(le2.point) ? -1 : 1;\n }\n\n if (le1.isSubject === le2.isSubject) { // same polygon\n var p1 = le1.point, p2 = le2.point;\n if (p1[0] === p2[0] && p1[1] === p2[1]/*equals(le1.point, le2.point)*/) {\n p1 = le1.otherEvent.point; p2 = le2.otherEvent.point;\n if (p1[0] === p2[0] && p1[1] === p2[1]) { return 0; }\n else { return le1.contourId > le2.contourId ? 1 : -1; }\n }\n } else { // Segments are collinear, but belong to separate polygons\n return le1.isSubject ? -1 : 1;\n }\n\n return compareEvents(le1, le2) === 1 ? 1 : -1;\n}\n\nfunction subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation) {\n var sweepLine = new SplayTree(compareSegments);\n var sortedEvents = [];\n\n var rightbound = Math.min(sbbox[2], cbbox[2]);\n\n var prev, next, begin;\n\n while (eventQueue.length !== 0) {\n var event = eventQueue.pop();\n sortedEvents.push(event);\n\n // optimization by bboxes for intersection and difference goes here\n if ((operation === INTERSECTION && event.point[0] > rightbound) ||\n (operation === DIFFERENCE && event.point[0] > sbbox[2])) {\n break;\n }\n\n if (event.left) {\n next = prev = sweepLine.insert(event);\n begin = sweepLine.minNode();\n\n if (prev !== begin) { prev = sweepLine.prev(prev); }\n else { prev = null; }\n\n next = sweepLine.next(next);\n\n var prevEvent = prev ? prev.key : null;\n var prevprevEvent = (void 0);\n computeFields(event, prevEvent, operation);\n if (next) {\n if (possibleIntersection(event, next.key, eventQueue) === 2) {\n computeFields(event, prevEvent, operation);\n computeFields(event, next.key, operation);\n }\n }\n\n if (prev) {\n if (possibleIntersection(prev.key, event, eventQueue) === 2) {\n var prevprev = prev;\n if (prevprev !== begin) { prevprev = sweepLine.prev(prevprev); }\n else { prevprev = null; }\n\n prevprevEvent = prevprev ? prevprev.key : null;\n computeFields(prevEvent, prevprevEvent, operation);\n computeFields(event, prevEvent, operation);\n }\n }\n } else {\n event = event.otherEvent;\n next = prev = sweepLine.find(event);\n\n if (prev && next) {\n\n if (prev !== begin) { prev = sweepLine.prev(prev); }\n else { prev = null; }\n\n next = sweepLine.next(next);\n sweepLine.remove(event);\n\n if (next && prev) {\n possibleIntersection(prev.key, next.key, eventQueue);\n }\n }\n }\n }\n return sortedEvents;\n}\n\nvar Contour = function Contour() {\n this.points = [];\n this.holeIds = [];\n this.holeOf = null;\n this.depth = null;\n};\n\nContour.prototype.isExterior = function isExterior () {\n return this.holeOf == null;\n};\n\n/**\n * @param {Array.} sortedEvents\n * @return {Array.}\n */\nfunction orderEvents(sortedEvents) {\n var event, i, len, tmp;\n var resultEvents = [];\n for (i = 0, len = sortedEvents.length; i < len; i++) {\n event = sortedEvents[i];\n if ((event.left && event.inResult) ||\n (!event.left && event.otherEvent.inResult)) {\n resultEvents.push(event);\n }\n }\n // Due to overlapping edges the resultEvents array can be not wholly sorted\n var sorted = false;\n while (!sorted) {\n sorted = true;\n for (i = 0, len = resultEvents.length; i < len; i++) {\n if ((i + 1) < len &&\n compareEvents(resultEvents[i], resultEvents[i + 1]) === 1) {\n tmp = resultEvents[i];\n resultEvents[i] = resultEvents[i + 1];\n resultEvents[i + 1] = tmp;\n sorted = false;\n }\n }\n }\n\n\n for (i = 0, len = resultEvents.length; i < len; i++) {\n event = resultEvents[i];\n event.otherPos = i;\n }\n\n // imagine, the right event is found in the beginning of the queue,\n // when his left counterpart is not marked yet\n for (i = 0, len = resultEvents.length; i < len; i++) {\n event = resultEvents[i];\n if (!event.left) {\n tmp = event.otherPos;\n event.otherPos = event.otherEvent.otherPos;\n event.otherEvent.otherPos = tmp;\n }\n }\n\n return resultEvents;\n}\n\n\n/**\n * @param {Number} pos\n * @param {Array.} resultEvents\n * @param {Object>} processed\n * @return {Number}\n */\nfunction nextPos(pos, resultEvents, processed, origPos) {\n var newPos = pos + 1,\n p = resultEvents[pos].point,\n p1;\n var length = resultEvents.length;\n\n if (newPos < length)\n { p1 = resultEvents[newPos].point; }\n\n while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) {\n if (!processed[newPos]) {\n return newPos;\n } else {\n newPos++;\n }\n p1 = resultEvents[newPos].point;\n }\n\n newPos = pos - 1;\n\n while (processed[newPos] && newPos > origPos) {\n newPos--;\n }\n\n return newPos;\n}\n\n\nfunction initializeContourFromContext(event, contours, contourId) {\n var contour = new Contour();\n if (event.prevInResult != null) {\n var prevInResult = event.prevInResult;\n // Note that it is valid to query the \"previous in result\" for its output contour id,\n // because we must have already processed it (i.e., assigned an output contour id)\n // in an earlier iteration, otherwise it wouldn't be possible that it is \"previous in\n // result\".\n var lowerContourId = prevInResult.outputContourId;\n var lowerResultTransition = prevInResult.resultTransition;\n if (lowerResultTransition > 0) {\n // We are inside. Now we have to check if the thing below us is another hole or\n // an exterior contour.\n var lowerContour = contours[lowerContourId];\n if (lowerContour.holeOf != null) {\n // The lower contour is a hole => Connect the new contour as a hole to its parent,\n // and use same depth.\n var parentContourId = lowerContour.holeOf;\n contours[parentContourId].holeIds.push(contourId);\n contour.holeOf = parentContourId;\n contour.depth = contours[lowerContourId].depth;\n } else {\n // The lower contour is an exterior contour => Connect the new contour as a hole,\n // and increment depth.\n contours[lowerContourId].holeIds.push(contourId);\n contour.holeOf = lowerContourId;\n contour.depth = contours[lowerContourId].depth + 1;\n }\n } else {\n // We are outside => this contour is an exterior contour of same depth.\n contour.holeOf = null;\n contour.depth = contours[lowerContourId].depth;\n }\n } else {\n // There is no lower/previous contour => this contour is an exterior contour of depth 0.\n contour.holeOf = null;\n contour.depth = 0;\n }\n return contour;\n}\n\n/**\n * @param {Array.} sortedEvents\n * @return {Array.<*>} polygons\n */\nfunction connectEdges(sortedEvents) {\n var i, len;\n var resultEvents = orderEvents(sortedEvents);\n\n // \"false\"-filled array\n var processed = {};\n var contours = [];\n\n var loop = function ( ) {\n\n if (processed[i]) {\n return;\n }\n\n var contourId = contours.length;\n var contour = initializeContourFromContext(resultEvents[i], contours, contourId);\n\n // Helper function that combines marking an event as processed with assigning its output contour ID\n var markAsProcessed = function (pos) {\n processed[pos] = true;\n resultEvents[pos].outputContourId = contourId;\n };\n\n var pos = i;\n var origPos = i;\n\n var initial = resultEvents[i].point;\n contour.points.push(initial);\n\n /* eslint no-constant-condition: \"off\" */\n while (true) {\n markAsProcessed(pos);\n\n pos = resultEvents[pos].otherPos;\n\n markAsProcessed(pos);\n contour.points.push(resultEvents[pos].point);\n\n pos = nextPos(pos, resultEvents, processed, origPos);\n\n if (pos == origPos) {\n break;\n }\n }\n\n contours.push(contour);\n };\n\n for (i = 0, len = resultEvents.length; i < len; i++) loop( );\n\n return contours;\n}\n\nvar _tinyqueue_1_2_3_tinyqueue = TinyQueue;\nvar default_1 = TinyQueue;\n\nfunction TinyQueue(data, compare) {\n if (!(this instanceof TinyQueue)) { return new TinyQueue(data, compare); }\n\n this.data = data || [];\n this.length = this.data.length;\n this.compare = compare || defaultCompare;\n\n if (this.length > 0) {\n for (var i = (this.length >> 1) - 1; i >= 0; i--) { this._down(i); }\n }\n}\n\nfunction defaultCompare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\nTinyQueue.prototype = {\n\n push: function (item) {\n this.data.push(item);\n this.length++;\n this._up(this.length - 1);\n },\n\n pop: function () {\n if (this.length === 0) { return undefined; }\n\n var top = this.data[0];\n this.length--;\n\n if (this.length > 0) {\n this.data[0] = this.data[this.length];\n this._down(0);\n }\n this.data.pop();\n\n return top;\n },\n\n peek: function () {\n return this.data[0];\n },\n\n _up: function (pos) {\n var data = this.data;\n var compare = this.compare;\n var item = data[pos];\n\n while (pos > 0) {\n var parent = (pos - 1) >> 1;\n var current = data[parent];\n if (compare(item, current) >= 0) { break; }\n data[pos] = current;\n pos = parent;\n }\n\n data[pos] = item;\n },\n\n _down: function (pos) {\n var data = this.data;\n var compare = this.compare;\n var halfLength = this.length >> 1;\n var item = data[pos];\n\n while (pos < halfLength) {\n var left = (pos << 1) + 1;\n var right = left + 1;\n var best = data[left];\n\n if (right < this.length && compare(data[right], best) < 0) {\n left = right;\n best = data[right];\n }\n if (compare(best, item) >= 0) { break; }\n\n data[pos] = best;\n pos = left;\n }\n\n data[pos] = item;\n }\n};\n_tinyqueue_1_2_3_tinyqueue.default = default_1;\n\nvar max = Math.max;\nvar min = Math.min;\n\nvar contourId = 0;\n\n\nfunction processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) {\n var i, len, s1, s2, e1, e2;\n for (i = 0, len = contourOrHole.length - 1; i < len; i++) {\n s1 = contourOrHole[i];\n s2 = contourOrHole[i + 1];\n e1 = new SweepEvent(s1, false, undefined, isSubject);\n e2 = new SweepEvent(s2, false, e1, isSubject);\n e1.otherEvent = e2;\n\n if (s1[0] === s2[0] && s1[1] === s2[1]) {\n continue; // skip collapsed edges, or it breaks\n }\n\n e1.contourId = e2.contourId = depth;\n if (!isExteriorRing) {\n e1.isExteriorRing = false;\n e2.isExteriorRing = false;\n }\n if (compareEvents(e1, e2) > 0) {\n e2.left = true;\n } else {\n e1.left = true;\n }\n\n var x = s1[0], y = s1[1];\n bbox[0] = min(bbox[0], x);\n bbox[1] = min(bbox[1], y);\n bbox[2] = max(bbox[2], x);\n bbox[3] = max(bbox[3], y);\n\n // Pushing it so the queue is sorted from left to right,\n // with object on the left having the highest priority.\n Q.push(e1);\n Q.push(e2);\n }\n}\n\n\nfunction fillQueue(subject, clipping, sbbox, cbbox, operation) {\n var eventQueue = new _tinyqueue_1_2_3_tinyqueue(null, compareEvents);\n var polygonSet, isExteriorRing, i, ii, j, jj; //, k, kk;\n\n for (i = 0, ii = subject.length; i < ii; i++) {\n polygonSet = subject[i];\n for (j = 0, jj = polygonSet.length; j < jj; j++) {\n isExteriorRing = j === 0;\n if (isExteriorRing) { contourId++; }\n processPolygon(polygonSet[j], true, contourId, eventQueue, sbbox, isExteriorRing);\n }\n }\n\n for (i = 0, ii = clipping.length; i < ii; i++) {\n polygonSet = clipping[i];\n for (j = 0, jj = polygonSet.length; j < jj; j++) {\n isExteriorRing = j === 0;\n if (operation === DIFFERENCE) { isExteriorRing = false; }\n if (isExteriorRing) { contourId++; }\n processPolygon(polygonSet[j], false, contourId, eventQueue, cbbox, isExteriorRing);\n }\n }\n\n return eventQueue;\n}\n\nvar EMPTY = [];\n\n\nfunction trivialOperation(subject, clipping, operation) {\n var result = null;\n if (subject.length * clipping.length === 0) {\n if (operation === INTERSECTION) {\n result = EMPTY;\n } else if (operation === DIFFERENCE) {\n result = subject;\n } else if (operation === UNION ||\n operation === XOR) {\n result = (subject.length === 0) ? clipping : subject;\n }\n }\n return result;\n}\n\n\nfunction compareBBoxes(subject, clipping, sbbox, cbbox, operation) {\n var result = null;\n if (sbbox[0] > cbbox[2] ||\n cbbox[0] > sbbox[2] ||\n sbbox[1] > cbbox[3] ||\n cbbox[1] > sbbox[3]) {\n if (operation === INTERSECTION) {\n result = EMPTY;\n } else if (operation === DIFFERENCE) {\n result = subject;\n } else if (operation === UNION ||\n operation === XOR) {\n result = subject.concat(clipping);\n }\n }\n return result;\n}\n\n\nfunction boolean(subject, clipping, operation) {\n if (typeof subject[0][0][0] === 'number') {\n subject = [subject];\n }\n if (typeof clipping[0][0][0] === 'number') {\n clipping = [clipping];\n }\n var trivial = trivialOperation(subject, clipping, operation);\n if (trivial) {\n return trivial === EMPTY ? null : trivial;\n }\n var sbbox = [Infinity, Infinity, -Infinity, -Infinity];\n var cbbox = [Infinity, Infinity, -Infinity, -Infinity];\n\n // console.time('fill queue');\n var eventQueue = fillQueue(subject, clipping, sbbox, cbbox, operation);\n //console.timeEnd('fill queue');\n\n trivial = compareBBoxes(subject, clipping, sbbox, cbbox, operation);\n if (trivial) {\n return trivial === EMPTY ? null : trivial;\n }\n // console.time('subdivide edges');\n var sortedEvents = subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation);\n //console.timeEnd('subdivide edges');\n\n // console.time('connect vertices');\n var contours = connectEdges(sortedEvents);\n //console.timeEnd('connect vertices');\n\n // Convert contours to polygons\n var polygons = [];\n for (var i = 0; i < contours.length; i++) {\n var contour = contours[i];\n if (contour.isExterior()) {\n // The exterior ring goes first\n var rings = [contour.points];\n // Followed by holes if any\n for (var j = 0; j < contour.holeIds.length; j++) {\n var holeId = contour.holeIds[j];\n rings.push(contours[holeId].points);\n }\n polygons.push(rings);\n }\n }\n\n return polygons;\n}\n\nfunction union (subject, clipping) {\n return boolean(subject, clipping, UNION);\n}\n\nfunction diff (subject, clipping) {\n return boolean(subject, clipping, DIFFERENCE);\n}\n\nfunction xor (subject, clipping) {\n return boolean(subject, clipping, XOR);\n}\n\nfunction intersection$1 (subject, clipping) {\n return boolean(subject, clipping, INTERSECTION);\n}\n\n/**\n * @enum {Number}\n */\nvar operations = { UNION: UNION, DIFFERENCE: DIFFERENCE, INTERSECTION: INTERSECTION, XOR: XOR };\n\nexport { diff, intersection$1 as intersection, operations, union, xor };\n//# sourceMappingURL=martinez.es.js.map\n","import matrix from './matrix';\nimport tar from './tar';\nimport vector from './vector';\nimport geom from './geom';\nimport { union, diff, intersection, xor } from './martinez';\n\nexport default {\n matrix,\n tar,\n vector,\n geom,\n booleanOperations: {\n union,\n diff,\n intersection,\n xor,\n },\n};\n","import unit from '../style/unit';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport math from '../math/index';\n\nconst { STYLE_KEY: {\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n SKEW_X,\n SKEW_Y,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n ROTATE_3D,\n PERSPECTIVE,\n MATRIX,\n FONT_SIZE,\n}} = enums;\nconst { PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit;\nconst { matrix, geom } = math;\nconst { identity, multiply, isE } = matrix;\nconst { d2r } = geom;\n\nfunction calSingle(t, k, v) {\n if(k === TRANSLATE_X) {\n t[12] = v;\n }\n else if(k === TRANSLATE_Y) {\n t[13] = v;\n }\n else if(k === TRANSLATE_Z) {\n t[14] = v;\n }\n else if(k === SCALE_X) {\n t[0] = v;\n }\n else if(k === SCALE_Y) {\n t[5] = v;\n }\n else if(k === SCALE_Z) {\n t[10] = v;\n }\n else if(k === SKEW_X) {\n v = d2r(v);\n t[4] = Math.tan(v);\n }\n else if(k === SKEW_Y) {\n v = d2r(v);\n t[1] = Math.tan(v);\n }\n else if(k === ROTATE_X) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[5] = t[10] = cos;\n t[6] = sin;\n t[9] = -sin;\n }\n else if(k === ROTATE_Y) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[10] = cos;\n t[8] = sin;\n t[2] = -sin;\n }\n else if(k === ROTATE_Z) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[5] = cos;\n t[1] = sin;\n t[4] = -sin;\n }\n else if(k === ROTATE_3D) {\n let [x, y, z, r] = v;\n r = d2r(r[0]);\n let s = Math.sin(r);\n let c = Math.cos(r);\n if(x && !y && !z) {\n if(x < 0) {\n s = -s;\n }\n t[5] = c;\n t[9] = -s;\n t[6] = s;\n t[10] = c;\n }\n else if(y && !x && !z) {\n if(y < 0) {\n s = -s;\n }\n t[0] = c;\n t[8] = s;\n t[2] = -s;\n t[10] = c;\n }\n else if(z && !x && !y) {\n if(z < 0) {\n s = -s;\n }\n t[0] = c;\n t[4] = -s;\n t[1] = s;\n t[5] = c;\n }\n else {\n let len = Math.sqrt(x * x + y * y + z * z);\n if(len !== 1) {\n let rlen = 1 / len;\n x *= rlen;\n y *= rlen;\n z *= rlen;\n }\n let nc = 1 - c;\n let xy = x * y;\n let yz = y * z;\n let zx = z * x;\n let xs = x * s;\n let ys = y * s;\n let zs = z * s;\n\n t[0] = x * x * nc + c;\n t[1] = xy * nc + zs;\n t[2] = zx * nc - ys;\n t[3] = 0;\n\n t[4] = xy * nc - zs;\n t[5] = y * y * nc + c;\n t[6] = yz * nc + xs;\n t[7] = 0;\n\n t[8] = zx * nc + ys;\n t[9] = yz * nc - xs;\n t[10] = z * z * nc + c;\n t[11] = 0;\n\n t[12] = 0;\n t[13] = 0;\n t[14] = 0;\n t[15] = 1;\n }\n }\n else if(k === PERSPECTIVE && v > 0) {\n v = Math.max(v, 1);\n t[11] = -1 / v;\n }\n else if(k === MATRIX) {\n util.assignMatrix(t, v);\n }\n}\n\nfunction calMatrix(transform, ow, oh, root) {\n let list = normalize(transform, ow, oh, root);\n let m = identity();\n list.forEach(item => {\n let [k, v] = item;\n let t = identity();\n calSingle(t, k, v);\n m = multiply(m, t);\n });\n return m;\n}\n\n// 已有计算好的变换矩阵,根据tfo原点计算最终的matrix\nfunction calMatrixByOrigin(m, transformOrigin) {\n let [ox, oy] = transformOrigin;\n let res = m.slice(0);\n if(ox === 0 && oy === 0 || isE(m)) {\n return res;\n }\n res = multiply([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ox, oy, 0, 1], res);\n res = multiply(res, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -ox, -oy, 0, 1]);\n return res;\n}\n\n// img缩放svg下专用,无rem\nfunction calMatrixWithOrigin(transform, transformOrigin, ow, oh) {\n let m = calMatrix(transform, ow, oh);\n return calMatrixByOrigin(m, transformOrigin);\n}\n\nfunction normalizeSingle(k, v, ow, oh, root) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n if(v[1] === PERCENT) {\n return v[0] * ow * 0.01;\n }\n else if(v[1] === REM) {\n return v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n return v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n return v[0] * root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n return v[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n return v[0] * Math.min(root.width, root.height) * 0.01;\n }\n }\n else if(k === TRANSLATE_Y) {\n if(v[1] === PERCENT) {\n return v[0] * oh * 0.01;\n }\n else if(v[1] === REM) {\n return v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n return v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n return v[0] * root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n return v[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n return v[0] * Math.min(root.width, root.height) * 0.01;\n }\n }\n else if(k === MATRIX) {\n return v;\n }\n else if(k === ROTATE_3D) {\n return v;\n }\n return v[0];\n}\n\nfunction normalize(transform, ow, oh, root) {\n let res = [];\n transform.forEach(item => {\n let [k, v] = item;\n res.push([k, normalizeSingle(k, v, ow, oh, root)]);\n });\n return res;\n}\n\nfunction calOrigin(transformOrigin, w, h, root) {\n let tfo = [];\n transformOrigin.forEach((item, i) => {\n if(item[1] === PX) {\n tfo.push(item[0]);\n }\n else if(item[1] === PERCENT) {\n tfo.push(item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n tfo.push(item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n tfo.push(item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n tfo.push(item[0] * root.height * 0.01);\n }\n else if(item[1] === VMAX) {\n tfo.push(item[0] * Math.max(root.width, root.height) * 0.01);\n }\n else if(item[1] === VMIN) {\n tfo.push(item[0] * Math.min(root.width, root.height) * 0.01);\n }\n });\n return tfo;\n}\n\nfunction calMatrixByPerspective(m, pm) {\n if(!isE(pm)) {\n m = multiply(pm, m);\n }\n return m;\n}\n\nfunction calPerspectiveMatrix(ppt, po) {\n if(ppt && ppt > 0) {\n let res = identity();\n ppt = Math.max(ppt, 1);\n res[11] = -1 / ppt;\n let [ox, oy] = po;\n if(ox || oy) {\n res = multiply([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ox, oy, 0, 1], res);\n res = multiply(res, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -ox, -oy, 0, 1]);\n }\n return res;\n }\n}\n\n// 是否有透视矩阵应用\nfunction isPerspectiveMatrix(m) {\n if(!m) {\n return;\n }\n return !!(m[3] || m[7] || m[11]);\n}\n\nexport default {\n calMatrix,\n calOrigin,\n calMatrixByPerspective,\n calPerspectiveMatrix,\n calMatrixByOrigin,\n calMatrixWithOrigin,\n isPerspectiveMatrix,\n};\n","/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据模糊参数sigma求卷积核尺寸\n * @param sigma\n * @returns {number}\n */\nfunction kernelSize(sigma) {\n if(sigma <= 0) {\n return 0;\n }\n let d = Math.floor(sigma * 3 * Math.sqrt(2 * Math.PI) / 4 + 0.5);\n if(d < 2) {\n d = 2;\n }\n if(d % 2 === 0) {\n d++;\n }\n return d;\n}\n\n/**\n * 根据sigma求模糊扩展尺寸,卷积核求得后为d,再求半径/2,然后因为算法要执行3次,所以*3\n * 比如本来d为5,半径2.5算上自身像素点则各方向扩展2,*3则扩展6\n * @param sigma\n * @returns {number}\n */\nfunction outerSize(sigma) {\n let d = kernelSize(sigma);\n return outerSizeByD(d);\n}\n\nfunction outerSizeByD(d) {\n return Math.floor(d * 0.5) * 3;\n}\n\n/**\n * 一维高斯正态分布,根据标准差和卷积核尺寸返回一维权重数组\n * @param sigma\n * @param d\n */\nfunction gaussianWeight(sigma, d) {\n let list = [];\n let len = Math.floor(d * 0.5);\n let total = 0;\n for(let i = len; i >= 0; i--) {\n let n = Math.pow(Math.E, -Math.pow(i, 2) / (2 * Math.pow(sigma, 2)))\n / (sigma * Math.sqrt(2 * Math.PI));\n list.push(n);\n total += n;\n }\n for(let i = 1; i <= len; i++) {\n let n = Math.pow(Math.E, -Math.pow(i, 2) / (2 * Math.pow(sigma, 2)))\n / (sigma * Math.sqrt(2 * Math.PI));\n list.push(n);\n total += n;\n }\n if(total !== 1) {\n for(let i = 0; i < d; i++) {\n list[i] /= total;\n }\n }\n return list;\n}\n\nexport default {\n kernelSize,\n outerSize,\n outerSizeByD,\n gaussianWeight,\n};\n","import Page from './Page';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport enums from '../util/enums';\nimport painter from '../util/painter';\nimport debug from '../util/debug';\nimport tf from '../style/transform';\nimport mx from '../math/matrix';\nimport blur from '../math/blur';\n\nconst {\n STYLE_KEY: {\n TRANSFORM_ORIGIN,\n TRANSFORM,\n },\n} = enums;\n\n// 根据一个共享cache的信息,生成一个独立的离屏canvas,一般是filter,mask用\nfunction genSingle(cache, message) {\n let { size, sx1, sy1, width, height, bbox } = cache;\n let offscreen = inject.getCacheCanvas(width, height, null, message);\n offscreen.x = 0;\n offscreen.y = 0;\n offscreen.bbox = bbox;\n offscreen.size = size;\n offscreen.sx1 = sx1;\n offscreen.sy1 = sy1;\n offscreen.dx = cache.dx;\n offscreen.dy = cache.dy;\n offscreen.dbx = cache.dbx;\n offscreen.dby = cache.dby;\n offscreen.width = width;\n offscreen.height = height;\n return offscreen;\n}\n\nclass Cache {\n constructor(w, h, bbox, page, pos, x1, y1) {\n this.__init(w, h, bbox, page, pos, x1, y1);\n }\n\n __init(w, h, bbox, page, pos, x1, y1) {\n this.__width = w;\n this.__height = h;\n this.__bbox = bbox;\n this.__page = page;\n this.__pos = pos;\n let [x, y] = page.getCoords(pos);\n this.__x = x;\n this.__y = y;\n this.__appendData(x1, y1);\n this.__isNew = true;\n if(page.canvas) {\n this.__enabled = true;\n let ctx = page.ctx;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n if(debug.flag) {\n page.canvas.setAttribute && page.canvas.setAttribute('size', page.size);\n }\n }\n }\n\n __appendData(sx1, sy1) {\n this.sx1 = sx1; // 去除margin的左上角原点坐标\n this.sy1 = sy1;\n let bbox = this.bbox;\n this.dx = this.x - bbox[0]; // cache坐标和box原点的差值\n this.dy = this.y - bbox[1];\n this.dbx = sx1 - bbox[0]; // 原始x1/y1和box原点的差值\n this.dby = sy1 - bbox[1];\n this.update();\n }\n\n update() {\n this.page.update = true;\n }\n\n clear() {\n if(this.available) {\n let ctx = this.ctx;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n let size = this.page.size;\n ctx.clearRect(this.x, this.y, size, size);\n this.__available = false;\n this.__isNew = true;\n }\n }\n\n release() {\n if(this.enabled) {\n this.clear();\n this.page.del(this.pos);\n this.__page = null;\n this.__enabled = false;\n }\n }\n\n reset(bbox, x1, y1) {\n // 尺寸没变复用之前的并清空\n if(util.equalArr(this.bbox, bbox) && this.enabled) {\n this.clear();\n return;\n }\n this.release();\n let w = Math.ceil(bbox[2] - bbox[0]);\n let h = Math.ceil(bbox[3] - bbox[1]);\n let res = Page.getInstance(Math.max(w, h));\n if(!res) {\n this.__enabled = false;\n return;\n }\n let { page, pos } = res;\n this.__init(w, h, bbox, page, pos, x1, y1);\n }\n\n // 是否功能可用,生成离屏canvas及尺寸超限\n get enabled() {\n return this.__enabled;\n }\n\n // 是否有可用缓存内容\n get available() {\n return this.enabled && this.__available;\n }\n\n get bbox() {\n return this.__bbox;\n }\n\n get page() {\n return this.__page;\n }\n\n get canvas() {\n return this.page.canvas;\n }\n\n get ctx() {\n return this.page.ctx;\n }\n\n get size() {\n return this.page.size;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get pos() {\n return this.__pos;\n }\n\n get isNew() {\n return this.__isNew;\n }\n\n static get MAX() {\n return Page.MAX;\n }\n\n static getInstance(bbox, x1, y1) {\n let w = Math.ceil(bbox[2] - bbox[0]);\n let h = Math.ceil(bbox[3] - bbox[1]);\n let res = Page.getInstance(Math.max(w, h));\n if(!res) {\n return;\n }\n let { page, pos } = res;\n return new Cache(w, h, bbox, page, pos, x1, y1);\n }\n\n /**\n * 复制cache的一块出来单独作为cacheFilter,尺寸边距保持一致,用浏览器原生ctx.filter滤镜\n * @param cache\n * @param filter\n * @returns {{canvas: *, ctx: *, release(): void, available: boolean, draw()}}\n */\n static genFilter(cache, filter) {\n let d = 0;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n d = blur.outerSize(v);\n }\n });\n let { x, y, size, canvas, sx1, sy1, width, height, bbox } = cache;\n bbox = bbox.slice(0);\n bbox[0] -= d;\n bbox[1] -= d;\n bbox[2] += d;\n bbox[3] += d;\n let offscreen = inject.getCacheCanvas(width + d * 2, height + d * 2, null, 'filter');\n offscreen.ctx.filter = painter.canvasFilter(filter);\n offscreen.ctx.drawImage(canvas, x, y, width, height, d, d, width, height);\n offscreen.ctx.filter = 'none';\n offscreen.draw();\n offscreen.bbox = bbox;\n offscreen.x = 0;\n offscreen.y = 0;\n offscreen.size = size;\n offscreen.sx1 = sx1 - d;\n offscreen.sy1 = sy1 - d;\n offscreen.dx = cache.dx;\n offscreen.dy = cache.dy;\n offscreen.dbx = cache.dbx;\n offscreen.dby = cache.dby;\n offscreen.width = width + d * 2;\n offscreen.height = height + d * 2;\n return offscreen;\n }\n\n static genMask(target, node, cb) {\n let cacheMask = genSingle(target, 'mask1');\n let list = [];\n let { [TRANSFORM]: transform, [TRANSFORM_ORIGIN]: tfo } = node.computedStyle;\n let next = node.next;\n let isClip = next.isClip;\n while(next && next.isMask) {\n list.push(next);\n next = next.next;\n }\n let { x, y, ctx, dbx, dby } = cacheMask;\n tfo[0] += x + dbx + node.__sx1 - target.sx1;\n tfo[1] += y + dby + node.__sy1 - target.sy1;\n let inverse = tf.calMatrixByOrigin(transform, tfo);\n // 先将mask本身绘制到cache上,再设置模式绘制dom本身,因为都是img所以1个就够了\n list.forEach(item => {\n cb(item, cacheMask, inverse);\n });\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n ctx.globalCompositeOperation = isClip ? 'source-out' : 'source-in';\n Cache.drawCache(target, cacheMask);\n ctx.globalCompositeOperation = 'source-over';\n cacheMask.draw(ctx);\n return cacheMask;\n }\n\n /**\n * 如果不超过bbox,直接用已有的total/filter/mask,否则生成一个新的\n */\n static genOverflow(target, node) {\n let { bbox } = target;\n let { sx, sy, outerWidth, outerHeight } = node;\n let xe = sx + outerWidth;\n let ye = sy + outerHeight;\n if(bbox[0] < sx || bbox[1] < sy || bbox[2] > xe || bbox[3] > ye) {\n let cacheOverflow = genSingle(target, 'overflow');\n let ctx = cacheOverflow.ctx;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n Cache.drawCache(target, cacheOverflow);\n cacheOverflow.draw(ctx);\n ctx.globalCompositeOperation = 'destination-in';\n ctx.fillStyle = '#FFF';\n ctx.beginPath();\n ctx.rect(sx - bbox[0], sy - bbox[1], outerWidth, outerHeight);\n ctx.fill();\n ctx.closePath();\n ctx.globalCompositeOperation = 'source-over';\n return cacheOverflow;\n }\n }\n\n /**\n * bbox变化时直接用老的cache内容重设bbox\n * @param cache\n * @param bbox\n */\n static updateCache(cache, bbox) {\n let old = cache.bbox;\n if(!util.equalArr(bbox, old)) {\n let dx = old[0] - bbox[0];\n let dy = old[1] - bbox[1];\n let newCache = Cache.getInstance(bbox);\n if(newCache && newCache.enabled) {\n let { x: ox, y: oy, canvas, width, height } = cache;\n let { x: nx, y: ny } = newCache;\n newCache.sx1 = cache.sx1;\n newCache.sy1 = cache.sy1;\n newCache.dx = cache.dx + dx;\n newCache.dy = cache.dy + dy;\n newCache.dbx = cache.dbx + dx;\n newCache.dby = cache.dby + dy;\n newCache.ctx.drawImage(canvas, ox, oy, width, height, dx + nx, dy + ny, width, height);\n newCache.__available = true;\n cache.release();\n return newCache;\n }\n }\n else {\n return cache;\n }\n }\n\n static drawCache(source, target, transform, matrix, tfo, parentMatrix, inverse) {\n let { x: tx, y: ty, sx1, sy1, ctx, dbx, dby } = target;\n let { x, y, canvas, sx1: sx2, sy1: sy2, dbx: dbx2, dby: dby2, width, height } = source;\n let ox = tx + sx2 - sx1 + dbx - dbx2;\n let oy = ty + sy2 - sy1 + dby - dby2;\n if(transform && matrix && tfo) {\n tfo[0] += ox;\n tfo[1] += oy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n matrix = mx.multiply(matrix, m);\n if(!mx.isE(parentMatrix)) {\n matrix = mx.multiply(parentMatrix, matrix);\n }\n if(inverse) {\n // 很多情况mask和target相同matrix,可简化计算\n if(util.equalArr(matrix, inverse)) {\n matrix = mx.identity();\n }\n else {\n inverse = mx.inverse(inverse);\n matrix = mx.multiply(inverse, matrix);\n }\n }\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n }\n ctx.drawImage(canvas, x, y, width, height, ox, oy, width, height);\n }\n\n static draw(ctx, opacity, matrix, cache) {\n ctx.globalAlpha = opacity;\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n let { x, y, canvas, sx1, sy1, dbx, dby, width, height } = cache;\n ctx.drawImage(canvas, x, y, width, height, sx1 - dbx, sy1 - dby, width, height);\n }\n\n static getCache(list) {\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item && item.available) {\n return item;\n }\n }\n }\n\n static NA = 0; // 无缓存模式\n static LOCAL = 1; // 局部根节点\n static CHILD = 2; // 其子节点\n static SELF = 3; // webgl专用\n}\n\nexport default Cache;\n","import change from './change';\nimport enums from '../util/enums';\n\nconst { STYLE_KEY, STYLE_KEY: {\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n OPACITY,\n FILTER,\n PERSPECTIVE,\n PERSPECTIVE_ORIGIN,\n} } = enums;\n\nconst ENUM = {\n // 低位表示 0;\n },\n /**\n * 得出等级\n * @param k\n * @returns {number|*}\n */\n getLevel(k) {\n if(change.isIgnore(k)) {\n return ENUM.NONE;\n }\n if(k === TRANSLATE_X) {\n return ENUM.TRANSLATE_X;\n }\n else if(k === TRANSLATE_Y) {\n return ENUM.TRANSLATE_Y;\n }\n else if(k === TRANSLATE_Z) {\n return ENUM.TRANSLATE_Z;\n }\n else if(TRANSFORMS.hasOwnProperty(k)) {\n return ENUM.TRANSFORM;\n }\n else if(k === OPACITY) {\n return ENUM.OPACITY;\n }\n else if(k === FILTER) {\n return ENUM.FILTER;\n }\n else if(k === PERSPECTIVE || k === PERSPECTIVE_ORIGIN) {\n return ENUM.PERSPECTIVE;\n }\n else if(change.isRepaint(k)) {\n return ENUM.REPAINT;\n }\n return ENUM.REFLOW;\n },\n isReflow(lv) {\n return !this.isRepaint(lv);\n },\n isRepaint(lv) {\n return lv < ENUM.REFLOW;\n },\n isRebuild(lv) {\n return lv >= ENUM.REBUILD;\n },\n}, ENUM);\no.TRANSFORMS = TRANSFORMS;\n\nexport default o;\n","import Node from './Node';\nimport TextBox from './TextBox';\nimport mode from './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 POSITION,\n },\n NODE_KEY: {\n NODE_CACHE,\n NODE_LIMIT_CACHE,\n NODE_DOM_PARENT,\n NODE_MATRIX_EVENT,\n NODE_OPACITY,\n NODE_VIRTUAL_DOM,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_MEASURE,\n UPDATE_FOCUS,\n UPDATE_CONFIG,\n },\n} = enums;\n\nconst ELLIPSIS = textCache.ELLIPSIS;\nconst { AUTO, REM, VW, VH, VMAX, VMIN } = unit;\n\nclass Text extends Node {\n constructor(content) {\n super();\n this.__content = util.isNil(content) ? '' : content.toString();\n this.__textBoxes = [];\n this.__charWidthList = [];\n this.__charWidth = 0;\n this.__textWidth = 0;\n }\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' && bp.currentStyle[POSITION] !== 'absolute') {\n let p = bp.domParent;\n if(p.currentStyle[DISPLAY] === 'flex') {\n break;\n }\n bp = p;\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.__sx = this.__sx1 = x;\n this.__y = this.__sy = 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 && i < length - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n let textBox;\n // 特殊情况,恰好最后一行最后一个排满,此时查看末尾mpb,要防止i为0的情况首个字符特殊不回退,无需看开头mpb\n if(i === length - 1 && count > w - endSpace && i) {\n count -= charWidthList[i--];\n }\n i++;\n if(!lineCount) {\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, count);\n }\n // 必须先添加再设置y,当有diff的lineHeight时,第一个换行不影响,再换行时第2个换行即第3行会被第1行影响\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null; // 换行后连续字符reduce不生效重新计数\n }\n // 奇怪的精度问题,暂时不用相等判断,而是为原本w宽度加一点点冗余1e-10\n else if(count > w + (1e-10)) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n // 普通非多行文本阶段逻辑\n let width;\n // 宽度不足时无法跳出循环,至少也要塞个字符形成一行,无需判断第1行,因为是否放得下逻辑在dom中做过了,\n // 如果第1行放不下,一定会另起一行,此时作为开头再放不下才会进这里,这个if只有0或1个字符的情况\n if(i <= begin) {\n width = count;\n }\n // 超过2个字符回退1个\n else {\n width = count - charWidthList[i--];\n }\n i++;\n // 根据是否第一行分开处理行首空白\n let textBox;\n if(!lineCount) {\n maxW = width - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, width);\n }\n // 必须先添加再设置y,同上\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null;\n }\n else {\n i++;\n }\n }\n // 换行后Text的x重设为lx\n if(lineCount) {\n this.__x = this.__sx1 = lx;\n }\n // 最后一行,只有一行未满时也进这里,需查看末尾mpb,排不下回退一个字符\n // 声明了lineClamp时特殊考虑,这里一定是最后一行,要对比行数不能超过,超过忽略掉这些文本\n if(begin < length && (!lineClamp || lineCount + lineClampCount < lineClamp)) {\n let textBox;\n if(!lineCount) {\n let needBack;\n // 防止开头第一个begin=0时回退,这在inline有padding且是第一个child时会发生\n if(begin && count > w - endSpace) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n else {\n let needBack;\n // 防止begin在结尾时回退,必须要有个字符,这在最后一行1个字符排不下时会出现\n if(count > w - endSpace && begin < length - 1) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n maxW = Math.max(maxW, count);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n }\n }\n this.__width = maxW;\n this.__height = y - data.y;\n this.__baseline = css.getBaseline(computedStyle);\n return lineCount;\n }\n\n // 末尾行因ellipsis的缘故向前回退字符生成textBox,可能会因不满足宽度导致无法生成,此时向前继续回退TextBox\n __lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount, lineHeight, lx, x, y, maxW,\n textBoxes, content, charWidthList, lineBoxManager) {\n for(; i >= begin; i--) {\n count -= charWidthList[i] + letterSpacing;\n if(count + ew + endSpace <= w) {\n // 至少1个字符不用回退,到0也没找到需要回退\n if(i) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n break;\n }\n }\n }\n // 最后也没找到,看是否要查找前一个inline节点,还是本身是行首兜底首字母\n if(i < 0) {\n let lineBox = lineBoxManager.lineBox;\n // lineBox为空是行首,至少放1个字符\n if(!lineBox || !lineBox.size) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.charAt(begin), charWidthList.slice(begin, begin + 1));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n }\n // 向前查找inline节点,可能会有前面inline嵌套,因此直接用lineBox,不会出现inlineBlock,\n // 这里和css不同,ib强制超限换行不会同行\n else {\n let list = lineBox.list;\n outer:\n for(let j = list.length - 1; j >= 0; j--) {\n let tb = list[j];\n let { content, wList, width } = tb;\n // 整体减去可以说明可能在这个tb中,只要最后发现不是空文本节点就行,否则继续;第0个强制进入保证1字符\n if(count - width + ew <= w || !j) {\n // 找到可以跳出outer循环,找不到继续,注意第0个且1个字符判断\n for(let k = wList.length - 1; k >= 0; k--) {\n if(!k && !j || count + ew <= w) {\n tb.__content = content;\n tb.__width = width;\n tb.parent.__ellipsis = true;\n break outer;\n }\n else {\n let w2 = wList[k];\n tb.__endY -= w2;\n width -= w2;\n content = content.slice(0, k);\n count -= w2;\n wList.pop();\n }\n }\n }\n // 不够则看前一个tb并且删掉这个\n else {\n count -= width;\n }\n list.pop();\n tb.parent.textBoxes.pop();\n }\n }\n }\n return [y, maxW];\n }\n\n __offsetX(diff, isLayout) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetX(diff);\n });\n }\n this.__sx1 += diff;\n }\n\n __offsetY(diff, isLayout) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetY(diff);\n });\n }\n this.__sy1 += diff;\n }\n\n __tryLayInline(w) {\n return w - this.charWidthList[0];\n }\n\n __inlineSize() {\n let minX, maxX;\n this.textBoxes.forEach((item, i) => {\n if(i) {\n minX = Math.min(minX, item.x);\n maxX = Math.max(maxX, item.x + item.width);\n }\n else {\n minX = item.x;\n maxX = item.x + item.width;\n }\n });\n this.__x = minX;\n this.__sx = this.__sx1 = minX + this.ox;\n this.__sy = this.__sy1;\n this.__width = maxX - minX;\n }\n\n __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 { __sx1: sx, __sy1: sy, width, height, root, currentStyle: { [TEXT_STROKE_WIDTH]: textStrokeWidth } } = this;\n let half = 0;\n if(textStrokeWidth[1] === REM) {\n half = Math.max(textStrokeWidth[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(textStrokeWidth[1] === VW) {\n half = Math.max(textStrokeWidth[0] * root.width, half);\n }\n else if(textStrokeWidth[1] === VH) {\n half = Math.max(textStrokeWidth[0] * root.height, half);\n }\n else if(textStrokeWidth[1] === VMAX) {\n half = Math.max(textStrokeWidth[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(textStrokeWidth[1] === VMIN) {\n half = Math.max(textStrokeWidth[0] * Math.min(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(textStrokeWidth[0], half);\n }\n return [sx - half, sy - half, sx + width + half, sy + height + half];\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get matrix() {\n return this.domParent.matrix;\n }\n\n get matrixEvent() {\n return this.domParent.matrixEvent;\n }\n}\n\nText.prototype.__renderByMask = Text.prototype.render;\n\nexport default Text;\n","import util from './util';\nimport $$type from './$$type';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\n/**\n * 2. 打平children中的数组,变成一维\n * 3. 合并相连的Text节点,即string内容\n */\nfunction flattenJson(parent) {\n if(Array.isArray(parent)) {\n return parent.map(item => flattenJson(item));\n }\n else if(!parent || [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) {\n return parent;\n }\n let list = [];\n traverseJson(list, parent.children, {\n lastText: null,\n });\n parent.children = list;\n return parent;\n}\n\nfunction traverseJson(list, children, options) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n traverseJson(list, item, options);\n });\n }\n else if(children && (children.$$type === TYPE_VD || children.$$type === TYPE_GM)) {\n if(['canvas', 'svg', 'webgl'].indexOf(children.tagName) > -1) {\n throw new Error('Can not nest canvas/svg/webgl');\n }\n if(children.$$type === TYPE_VD) {\n flattenJson(children);\n }\n list.push(children);\n options.lastText = null;\n }\n else if(children && children.$$type === TYPE_CP) {\n list.push(children);\n // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做\n options.lastText = null;\n }\n // 排除掉空的文本,连续的text合并\n else if(!util.isNil(children) && children !== '') {\n if(options.lastText !== null) {\n list[list.length - 1] = options.lastText += children;\n }\n else {\n list.push(children);\n }\n }\n}\n\nexport default flattenJson;\n","import Text from '../node/Text';\nimport util from './util';\nimport $$type from './$$type';\nimport enums from './enums';\nimport flatten from './flatten';\n\nconst { NODE_KEY: {\n NODE_DOM_PARENT,\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n} } = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nfunction initRoot(cd, root) {\n let c = flatten({\n tagName: root.tagName,\n props: {},\n children: cd,\n $$type: TYPE_VD,\n });\n root.__json = c;\n root.__host = root;\n let children = build(c.children, root, root);\n return relation(root, children);\n}\n\nfunction initDom(json, root, host, parent) {\n let vd = build(json, root, host);\n return relation(parent, vd);\n}\n\nfunction initCp(json, root, host) {\n if(util.isObject(json)) {\n // cp的flatten在__init中自己做\n return build(json, root, host);\n }\n // text的relation会由上层如Root设置\n else {\n return new Text(json);\n }\n}\n\nfunction initCp2(json, root, host, parent) {\n let vd = new json.klass(json.props);\n vd.__tagName = json.tagName || vd.__tagName;\n vd.__root = root;\n vd.__host = host;\n vd.__json = json;\n vd.__init();\n return relation(parent, vd);\n}\n\n/**\n * 将初始json文件生成virtualDom\n * @param json\n * @param root\n * @param host\n * @param hasP 出现过p标签\n * @returns vd\n */\nfunction build(json, root, host, hasP) {\n if(Array.isArray(json)) {\n return json.map(item => build(item, root, host, hasP));\n }\n let vd;\n if(util.isObject(json) && json.$$type) {\n let { tagName, props, children, klass, $$type, __inheritAnimate, __animateRecords } = json;\n // 更新过程中无变化的cp直接使用原来生成的\n if($$type === TYPE_CP && json.__placeholder) {\n return json.__placeholder;\n }\n if($$type === TYPE_VD) {\n if(tagName === 'img') {\n vd = new Img(tagName, props);\n if(Array.isArray(children) && children.length) {\n throw new Error('Img can not contain children');\n }\n }\n else {\n vd = new Dom(tagName, props);\n }\n // 检查p不能包含div\n if(tagName === 'p') {\n hasP = true;\n }\n else if(tagName === 'div' && hasP) {\n throw new Error('Markup p can not contain div');\n }\n if(Array.isArray(children)) {\n children = relation(vd, build(children, root, host, hasP));\n }\n else {\n children = [];\n }\n vd.__children = children;\n }\n else if($$type === TYPE_GM) {\n if(util.isString(tagName)) {\n let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\n }\n else if(tagName) {\n vd = new tagName('$', props);\n }\n }\n else if($$type === TYPE_CP) {\n vd = new klass(props);\n vd.__tagName = tagName || vd.__tagName;\n }\n else {\n return new Text(json);\n }\n // 根parse需要用到真正的vd引用,然后vd也要引用json,用以做domApi\n json.vd = vd;\n vd.__json = json;\n // 递归parse中的动画记录需特殊处理,将target改为真正的vd引用\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n __animateRecords.list.forEach(item => {\n item.target = item.target.vd;\n });\n delete json.__animateRecords;\n }\n // 更新过程中key相同或者普通相同的vd继承动画\n if(__inheritAnimate) {\n util.extendAnimate(__inheritAnimate, vd);\n delete json.__inheritAnimate;\n }\n vd.__root = root;\n vd.__host = host;\n if($$type === TYPE_CP) {\n vd.__init();\n }\n let ref = props.ref;\n if(util.isString(ref) && ref || util.isNumber(ref)) {\n host.ref[ref] = vd;\n }\n else if(util.isFunction(ref)) {\n ref(vd);\n }\n return vd;\n }\n return new Text(json);\n}\n\n/**\n * 设置关系,父子和兄弟\n * @param parent\n * @param children\n * @param options\n * @returns {Xom|Text|Component}\n */\nfunction relation(parent, children, options = {}) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n relation(parent, item, options);\n });\n }\n else if(children instanceof Xom || children instanceof Component || children instanceof Text) {\n children.__parent = parent;\n children.__domParent = parent;\n // 极为恶心,为了v8的性能优化,text复用parent的__config部分,但domParent重设\n if(children instanceof Text) {\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n if(children.__config) {\n children.__config[NODE_DOM_PARENT] = parent;\n }\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n // 文字视作为父节点的直接文字子节点\n if(children instanceof Component) {\n let sr = children.shadowRoot;\n if(sr instanceof Text) {\n sr.__parent = parent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n sr.__domParent = parent;\n if(sr.__config) {\n sr.__config[NODE_DOM_PARENT] = parent;\n }\n }\n }\n return children;\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n initRoot,\n initDom,\n initCp,\n initCp2,\n relation,\n};\n","import util from './util';\n\nconst { isFunction } = util;\n\nclass Event {\n constructor() {\n this.__eHash = {};\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.on(id[i], handle);\n }\n }\n else {\n if(!self.__eHash.hasOwnProperty(id)) {\n self.__eHash[id] = [];\n }\n // 遍历防止此handle被侦听过了\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n if(item[i] === handle) {\n return self;\n }\n }\n self.__eHash[id].push(handle);\n }\n return self;\n }\n\n once(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n function cb(...data) {\n handle.apply(self, data);\n self.off(id, cb);\n }\n\n cb.__karasEventCb = handle;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.once(id[i], handle);\n }\n }\n else if(handle) {\n self.on(id, cb);\n }\n return this;\n }\n\n off(id, handle) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.off(id[i], handle);\n }\n }\n else if(self.__eHash.hasOwnProperty(id)) {\n if(handle) {\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n // 需考虑once包裹的引用对比\n if(item[i] === handle || item[i].__karasEventCb === handle) {\n item.splice(i, 1);\n break;\n }\n }\n }\n // 未定义为全部清除\n else {\n delete self.__eHash[id];\n }\n }\n return this;\n }\n\n emit(id, ...data) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.emit(id[i], data);\n }\n }\n else {\n if(self.__eHash.hasOwnProperty(id)) {\n let list = self.__eHash[id];\n if(list.length) {\n list = list.slice();\n for(let i = 0, len = list.length; i < len; i++) {\n let cb = list[i];\n if(isFunction(cb)) {\n cb.apply(self, data);\n }\n }\n }\n }\n }\n return this;\n }\n\n static mix(...obj) {\n for(let i = obj.length - 1; i >= 0; i--) {\n let o = obj[i];\n let event = new Event();\n o.__eHash = {};\n let fns = ['on', 'once', 'off', 'emit'];\n for(let j = fns.length - 1; j >= 0; j--) {\n let fn = fns[j];\n o[fn] = event[fn];\n }\n }\n }\n\n static REFRESH = 'refresh';\n static PAUSE = 'pause';\n static PLAY = 'play';\n static FRAME = 'frame';\n static FINISH = 'finish';\n static CANCEL = 'cancel';\n static BEGIN = 'begin';\n static END = 'end';\n}\n\nexport default Event;\n","import Node from './Node';\nimport Text from './Text';\nimport builder from '../util/builder';\nimport Event from '../util/Event';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport flatten from '../util/flatten';\nimport css from '../style/css';\nimport change from '../refresh/change';\n\nconst { isNil, isFunction, clone, extend } = util;\n\nconst REGISTER = {};\n\n/**\n * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归\n * 在check时树递归会用到,判断是否需要查找cp更新\n * @param cp\n */\nfunction setUpdateFlag(cp) {\n // 去重\n if(cp.__hasCpUpdate) {\n return;\n }\n cp.__hasCpUpdate = true;\n let host = cp.host;\n if(host) {\n setUpdateFlag(host);\n }\n}\n\nclass Component extends Event {\n constructor(props = {}) {\n super();\n this.__tagName = /(?:function|class)\\s+([\\w$]+)/.exec(this.constructor.toString())[1];\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__parent = null;\n this.__host = null;\n this.__ref = {};\n this.state = {};\n this.__isMounted = false;\n this.__taskList = [];\n }\n\n setState(n, cb) {\n let self = this;\n if(isNil(n)) {\n n = {};\n }\n else if(isFunction(n)) {\n return;\n }\n else {\n if(Object.keys(n).length === 0) {\n if(isFunction(cb)) {\n cb.call(self);\n }\n return;\n }\n let state = clone(self.state);\n n = extend(state, n);\n }\n let root = self.root;\n if(root && self.__isMounted) {\n // 一帧之内多次调用,需合并\n if(self.__nextState) {\n Object.assign(self.__nextState, n);\n self.__taskList.push(cb);\n }\n else {\n self.__nextState = n;\n self.__taskList = [cb];\n // 回调更新列表,before执行时splice出来供after执行,防止中途产生的后续setState干扰\n let list = [];\n let t = self.__task = {\n __before: () => {\n list = self.__taskList.splice(0);\n // 标识更新\n setUpdateFlag(this);\n },\n __after: () => {\n // self.__nextState = null; 由updater.js每次refresh前同步执行清空,这里不能异步清除,否则frame动画会乱序\n list.forEach(cb => {\n if(isFunction(cb)) {\n cb.call(self);\n }\n });\n },\n };\n root.addRefreshCp(t);\n }\n }\n // 构造函数中调用还未render,\n else if(isFunction(cb)) {\n self.state = n;\n cb.call(self);\n }\n }\n\n /**\n * build中调用初始化,json有值时是update过程才有,且处理过flatten\n * @param json\n * @private\n */\n __init(json) {\n this.__ref = {};\n let root = this.root;\n let cd = json || flatten(this.render());\n let sr = builder.initCp(cd, root, this);\n this.__cd = cd;\n if(sr instanceof Text) {\n // 文字视作为父节点的直接文字子节点,在builder里做\n }\n else if(sr instanceof Node) {\n let style = css.normalize(this.props.style);\n let keys = Object.keys(style);\n extend(sr.style, style, keys);\n extend(sr.currentStyle, style, keys);\n // 事件添加到sr\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n });\n }\n else if(!(sr instanceof Component)) {\n // 本身build是递归的,子cp已经初始化了\n throw new Error('Component render() must return a dom/text: ' + this);\n }\n // 自定义事件无视返回强制添加\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n k = k.slice(3);\n this.on(k, v);\n }\n });\n // shadow指向直接renderRoot,shadowRoot考虑到返回Component的递归即hoc高阶组件\n // host是直接所属,hostRoot同考虑到高阶组件\n this.__shadow = sr;\n sr.__host = this;\n // 递归下去,多层级时执行顺序由里到外,最终会被最上层执行替换\n while(sr instanceof Component) {\n sr.__hostRoot = this;\n sr.shadow.__host = sr;\n sr = sr.shadow;\n }\n this.__shadowRoot = sr;\n sr.__hostRoot = this;\n if(!this.__isMounted) {\n this.__isMounted = true;\n if(isFunction(this.componentDidMount)) {\n root.once(Event.REFRESH, () => {\n this.componentDidMount();\n });\n }\n }\n }\n\n render() {\n inject.warn('Component must implement render()');\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.__isDestroyed = true;\n this.__isMounted = false;\n if(isFunction(this.componentWillUnmount)) {\n this.componentWillUnmount();\n }\n this.root.delRefreshTask(this.__task);\n if(this.shadowRoot) {\n this.shadowRoot.__destroy();\n }\n this.__parent = null;\n }\n\n __emitEvent(e, force) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n return;\n }\n let res = sr.__emitEvent(e, force);\n if(res) {\n e.target = this;\n return true;\n }\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get shadow() {\n return this.__shadow;\n }\n\n get shadowRoot() {\n return this.__shadowRoot;\n }\n\n get root() {\n return this.__root;\n }\n\n get host() {\n return this.__host;\n }\n\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n get state() {\n return this.__state;\n }\n\n set state(v) {\n this.__state = v;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)) {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Component has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)\n || !obj.prototype || !(obj.prototype instanceof Component)) {\n throw new Error('Invalid param: Component register');\n }\n if(Component.hasRegister(name)) {\n throw new Error(`Component has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Component.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nObject.keys(change.GEOM).concat([\n 'x',\n 'y',\n 'ox',\n 'oy',\n 'sx',\n 'sy',\n // '__sx1',\n // '__sx2',\n // '__sx3',\n // '__sx4',\n // '__sx5',\n // '__sx6',\n // '__sy1',\n // '__sy2',\n // '__sy3',\n // '__sy4',\n // '__sy5',\n // '__sy6',\n 'width',\n 'height',\n 'outerWidth',\n 'outerHeight',\n 'clientWidth',\n 'clientHeight',\n 'offsetWidth',\n 'offsetHeight',\n 'style',\n 'animationList',\n 'animateStyle',\n 'currentStyle',\n 'computedStyle',\n 'currentProps',\n 'baseline',\n 'virtualDom',\n 'mask',\n 'maskId',\n 'textWidth',\n 'content',\n 'lineBoxes',\n 'charWidthList',\n 'charWidth',\n '__layoutData',\n 'availableAnimating',\n 'effectiveAnimating',\n 'displayAnimating',\n 'visibilityAnimating',\n 'bbox',\n '__config',\n 'contentBoxList',\n 'listener',\n 'matrix',\n 'matrixEvent',\n]).forEach(fn => {\n Object.defineProperty(Component.prototype, fn, {\n get() {\n let sr = this.shadowRoot;\n if(sr) {\n return sr[fn];\n }\n },\n });\n});\n\n[\n '__layout',\n '__layoutAbs',\n '__layoutNone',\n '__tryLayInline',\n '__offsetX',\n '__offsetY',\n '__calAutoBasis',\n '__calMp',\n '__calAbs',\n '__renderAsMask',\n '__renderByMask',\n '__mp',\n 'animate',\n 'removeAnimate',\n 'clearAnimate',\n 'updateStyle',\n 'getBoundingClientRect',\n 'getComputedStyle',\n '__deepScan',\n 'clearCache',\n '__structure',\n '__modifyStruct',\n '__updateStruct',\n 'flowChildren',\n 'absChildren',\n '__isRealInline',\n '__calBasis',\n '__calMinMax',\n '__computeMeasure',\n 'appendChild',\n 'prependChild',\n 'insertBefore',\n 'insertAfter',\n 'removeChild',\n 'remove',\n].forEach(fn => {\n Component.prototype[fn] = function() {\n let sr = this.shadowRoot;\n if(sr && isFunction(sr[fn])) {\n return sr[fn].apply(sr, arguments);\n }\n };\n});\n\nexport default Component;\n","import unit from './unit';\nimport transform from './transform';\nimport enums from '../util/enums';\n\nconst { STYLE_KEY: { SCALE_X, SCALE_Y } } = enums;\nconst { PERCENT, NUMBER } = unit;\n\nfunction matrixResize(imgWidth, imgHeight, targetWidth, targetHeight, x, y, w, h) {\n if(imgWidth === targetWidth && imgHeight === targetHeight) {\n return;\n }\n let list = [\n [SCALE_X, [targetWidth / imgWidth, NUMBER]],\n [SCALE_Y, [targetHeight / imgHeight, NUMBER]],\n ];\n let tfo = transform.calOrigin([[0, PERCENT], [0, PERCENT]], w, h);\n tfo[0] += x;\n tfo[1] += y;\n return transform.calMatrixWithOrigin(list, tfo, w, h);\n}\n\nexport default {\n matrixResize,\n};\n","import border from './border';\nimport transform from './transform';\nimport mx from '../math/matrix';\nimport mode from '../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, VMAX, VMIN } = unit;\n\nfunction renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bbrr, bblr,\n method = 'fill', isInline = false, dx = 0, dy = 0) {\n // radial渐变ellipse形状会有matrix,用以从圆缩放到椭圆\n let matrix, cx, cy;\n if(Array.isArray(color)) {\n matrix = color[1];\n cx = color[2];\n cy = color[3];\n color = color[0];\n }\n // border-radius使用三次贝塞尔曲线模拟1/4圆角,误差在[0, 0.000273]之间\n list = list || border.calRadius(x, y, w, h, btlr, btrr, bbrr, bblr);\n if(!list) {\n list = [\n [x, y],\n [x + w, y],\n [x + w, y + h],\n [x, y + h],\n [x, y],\n ];\n }\n // 椭圆有matrix,用逆矩阵变化点来完成\n if(matrix) {\n let tfo = [cx, cy];\n matrix = transform.calMatrixByOrigin(matrix, tfo);\n let t = mx.inverse(matrix);\n list = list.map(item => {\n if(!item || !item.length) {\n return null;\n }\n let arr = [];\n for(let i = 0, len = item.length; i < len; i += 2) {\n let p = mx.calPoint([item[i], item[i + 1]], t);\n arr.push(p[0]);\n arr.push(p[1]);\n }\n return arr;\n });\n }\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(matrix) {\n ctx.save();\n let me = xom.matrixEvent;\n matrix = mx.multiply(me, matrix);\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n }\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n canvasPolygon(ctx, list, dx, dy);\n ctx[method]();\n ctx.closePath();\n if(matrix) {\n ctx.restore();\n }\n }\n else if(renderMode === mode.SVG) {\n let d = svgPolygon(list);\n if(isInline) {\n let v = {\n tagName: 'symbol',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', color],\n ],\n },\n ],\n };\n xom.__config[NODE_DEFS_CACHE].push(v);\n return ctx.add(v);\n }\n else {\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', color],\n ],\n });\n // 椭圆渐变独有\n if(matrix) {\n let bb = xom.virtualDom.bb;\n bb[bb.length - 1].props.push(['transform', `matrix(${joinArr(mx.m2m6(matrix), ',')})`]);\n }\n }\n }\n}\n\nfunction calBackgroundSize(value, w, h, root) {\n let res = [];\n value.forEach((item, i) => {\n if(item[1] === PX) {\n res.push(item[0]);\n }\n else if(item[1] === PERCENT) {\n res.push(item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n res.push(item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n res.push(item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n res.push(item[0] * root.height * 0.01);\n }\n else if(item[1] === VMAX) {\n res.push(item[0] * Math.max(root.width, root.height) * 0.01);\n }\n else if(item[1] === VMIN) {\n res.push(item[0] * Math.min(root.width, root.height) * 0.01);\n }\n else if(item[1] === AUTO) {\n res.push(-1);\n }\n else if(item[1] === STRING) {\n res.push(item[0] === 'contain' ? -2 : -3);\n }\n });\n return res;\n}\n\nfunction calBackgroundPosition(position, container, size, root) {\n if(Array.isArray(position)) {\n if(position[1] === PX) {\n return position[0];\n }\n else if(position[1] === PERCENT) {\n return (container - size) * position[0] * 0.01;\n }\n else if(position[1] === REM) {\n return position[0] * root.computedStyle[FONT_SIZE];\n }\n else if(position[1] === VW) {\n return position[0] * root.width * 0.01;\n }\n else if(position[1] === VH) {\n return position[0] * root.height * 0.01;\n }\n else if(position[1] === VMAX) {\n return position[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(position[1] === VMIN) {\n return position[0] * Math.min(root.width, root.height) * 0.01;\n }\n }\n return 0;\n}\n\nfunction renderImage(xom, renderMode, ctx, loadBgi,\n bx1, by1, bx2, by2, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, isInline,\n dx = 0, dy = 0) {\n let source = loadBgi.source;\n // 无source不绘制,可能错误或加载中\n if(source) {\n bx1 += dx;\n by1 += dy;\n bx2 += dx;\n by2 += dy;\n let bgW = bx2 - bx1;\n let bgH = by2 - by1;\n let { width, height } = loadBgi;\n let [w, h] = backgroundSize[i] || [];\n // -1为auto,-2为contain,-3为cover\n if(w === -1 && h === -1) {\n w = width;\n h = height;\n }\n else if(w === -2) {\n if(width > bgW && height > bgH) {\n w = width / bgW;\n h = height / bgH;\n if(w >= h) {\n w = bgW;\n h = w * height / width;\n }\n else {\n h = bgH;\n w = h * width / height;\n }\n }\n else if(width > bgW) {\n w = bgW;\n h = w * height / width;\n }\n else if(height > bgH) {\n h = bgH;\n w = h * width / height;\n }\n else {\n w = width;\n h = height;\n }\n }\n else if(w === -3) {\n if(bgW > width && bgH > height) {\n w = width / bgW;\n h = height / bgH;\n if(w <= h) {\n w = bgW;\n h = w * height / width;\n }\n else {\n h = bgH;\n w = h * width / height;\n }\n }\n else if(bgW > width) {\n w = bgW;\n h = w * height / width;\n }\n else if(bgH > height) {\n h = bgH;\n w = h * width / height;\n }\n else {\n w = width / bgW;\n h = height / bgH;\n if(w <= h) {\n w = bgW;\n h = w * height / width;\n }\n else {\n h = bgH;\n w = h * width / height;\n }\n }\n }\n else if(w === -1) {\n w = h * width / height;\n }\n else if(h === -1) {\n h = w * height / width;\n }\n let bgX = bx1 + calBackgroundPosition(currentStyle[BACKGROUND_POSITION_X][i], bgW, w, xom.root);\n let bgY = by1 + calBackgroundPosition(currentStyle[BACKGROUND_POSITION_Y][i], bgH, h, xom.root);\n // 超出尺寸模拟mask截取\n let needMask = bgX < bx1 || bgY < by1 || (bgX + w) > (bx1 + bgW) || (bgY + h) > (by1 + bgH);\n // 计算因为repeat,需要向4个方向扩展渲染几个数量图片\n let xnl = 0;\n let xnr = 0;\n let ynt = 0;\n let ynb = 0;\n // repeat-x\n if(['repeat-x', 'repeatX', 'repeat'].indexOf(backgroundRepeat[i]) > -1) {\n let diff = bgX - bx1;\n if(diff > 0) {\n xnl = Math.ceil(diff / w);\n }\n diff = bx1 + bgW - bgX - w;\n if(diff > 0) {\n xnr = Math.ceil(diff / w);\n }\n }\n // repeat-y\n if(['repeat-y', 'repeatY', 'repeat'].indexOf(backgroundRepeat[i]) > -1) {\n let diff = bgY - by1;\n if(diff > 0) {\n ynt = Math.ceil(diff / h);\n }\n diff = by1 + bgH - bgY - h;\n if(diff > 0) {\n ynb = Math.ceil(diff / h);\n }\n }\n // 分同行列和4个角分别判断,先看同行同列,再看4个角的象限\n let repeat = [];\n if(xnl > 0) {\n for(let i = 0; i < xnl; i++) {\n let x = bgX - (i + 1) * w;\n repeat.push([x, bgY]);\n // 看最左边超过没有\n if(!needMask && i === 0 && x < bx1) {\n needMask = true;\n }\n }\n }\n if(xnr > 0) {\n for(let i = 0; i < xnr; i++) {\n let x = bgX + (i + 1) * w;\n repeat.push([x, bgY]);\n // 看最右边超过没有\n if(!needMask && i === xnr - 1 && x + w > bx1 + bgW) {\n needMask = true;\n }\n }\n }\n if(ynt > 0) {\n for(let i = 0; i < ynt; i++) {\n let y = bgY - (i + 1) * h;\n repeat.push([bgX, y]);\n // 看最上边超过没有\n if(!needMask && i === 0 && y < by1) {\n needMask = true;\n }\n }\n }\n if(ynb > 0) {\n for(let i = 0; i < ynb; i++) {\n let y = bgY + (i + 1) * h;\n repeat.push([bgX, y]);\n // 看最下边超过没有\n if(!needMask && i === ynb - 1 && y + w > by1 + bgH) {\n needMask = true;\n }\n }\n }\n // 原点和同行列十字画完,看4个角的情况\n if(xnl > 0 && ynt > 0) {\n for(let i = 0; i < xnl; i++) {\n for(let j = 0; j < ynt; j++) {\n repeat.push([bgX - (i + 1) * w, bgY - (j + 1) * h]);\n }\n }\n }\n if(xnr > 0 && ynt > 0) {\n for(let i = 0; i < xnr; i++) {\n for(let j = 0; j < ynt; j++) {\n repeat.push([bgX + (i + 1) * w, bgY - (j + 1) * h]);\n }\n }\n }\n if(xnl > 0 && ynb > 0) {\n for(let i = 0; i < xnl; i++) {\n for(let j = 0; j < ynb; j++) {\n repeat.push([bgX - (i + 1) * w, bgY + (j + 1) * h]);\n }\n }\n }\n if(xnr > 0 && ynb > 0) {\n for(let i = 0; i < xnr; i++) {\n for(let j = 0; j < ynb; j++) {\n repeat.push([bgX + (i + 1) * w, bgY + (j + 1) * h]);\n }\n }\n }\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(needMask) {\n ctx.save();\n renderBgc(this, renderMode, ctx, '#FFF', null,\n bx1, by1, bgW, bgH, btlr, btrr, bbrr, bblr, 'clip');\n }\n // 先画不考虑repeat的中心声明的\n ctx.drawImage(source, bgX, bgY, w, h);\n // 再画重复的十字和4角象限\n repeat.forEach(item => {\n ctx.drawImage(source, item[0], item[1], w, h);\n });\n if(needMask) {\n ctx.restore();\n }\n }\n else if(renderMode === mode.SVG) {\n let matrix = image.matrixResize(width, height, w, h, bgX, bgY, bgW, bgH);\n let props = [\n ['xlink:href', loadBgi.url],\n ['x', bgX],\n ['y', bgY],\n ['width', width],\n ['height', height],\n ];\n let needResize;\n if(matrix && !mx.isE(matrix)) {\n needResize = true;\n props.push(['transform', 'matrix(' + joinArr(mx.m2m6(matrix), ',') + ')']);\n }\n if(needMask) {\n let p1 = [bx1, by1];\n let p2 = [bx2, by2];\n if(needResize) {\n let inverse = mx.inverse(matrix);\n p1 = mx.calPoint(p1, inverse);\n p2 = mx.calPoint(p2, inverse);\n }\n let v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', `M${p1[0]},${p1[1]}L${p2[0]},${p1[1]}L${p2[0]},${p2[1]}L${p1[0]},${p2[1]}L${p1[0]},${p1[1]}`],\n ['fill', '#FFF'],\n ],\n }],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n props.push(['clip-path', 'url(#' + id + ')']);\n }\n if(isInline) {\n let v = {\n tagName: 'symbol',\n props: [],\n children: [\n {\n type: 'img',\n tagName: 'image',\n props,\n }\n ],\n };\n xom.__config[NODE_DEFS_CACHE].push(v);\n repeat.forEach(item => {\n let copy = clone(props);\n if(needResize) {\n let matrix = image.matrixResize(width, height, w, h, item[0], item[1], bgW, bgH);\n if(matrix && !mx.isE(matrix)) {\n copy[5][1] = 'matrix(' + joinArr(mx.m2m6(matrix), ',') + ')';\n }\n }\n copy[1][1] = item[0];\n copy[2][1] = item[1];\n v.children.push({\n type: 'img',\n tagName: 'image',\n props: copy,\n });\n });\n return ctx.add(v);\n }\n else {\n // 先画不考虑repeat的中心声明的\n xom.virtualDom.bb.push({\n type: 'img',\n tagName: 'image',\n props,\n });\n // 再画重复的十字和4角象限\n repeat.forEach(item => {\n let copy = clone(props);\n if(needResize) {\n let matrix = image.matrixResize(width, height, w, h, item[0], item[1], bgW, bgH);\n if(matrix && !mx.isE(matrix)) {\n copy[5][1] = 'matrix(' + joinArr(mx.m2m6(matrix), ',') + ')';\n }\n }\n copy[1][1] = item[0];\n copy[2][1] = item[1];\n xom.virtualDom.bb.push({\n type: 'img',\n tagName: 'image',\n props: copy,\n });\n });\n }\n }\n }\n}\n\nexport default {\n renderBgc,\n renderImage,\n calBackgroundSize,\n};\n","import inject from '../util/inject';\nimport util from '../util/util';\n\nconst { isFunction } = util;\n\nfunction traversal(list, length, diff, after) {\n if(after) {\n for(let i = 0; i < length; i++) {\n let item = list[i];\n if(item[1]) {\n item[1](diff);\n }\n else {\n item.__after && item.__after(diff);\n }\n }\n }\n else {\n for(let i = 0; i < length; i++) {\n let item = list[i];\n if(item[0]) {\n item[0](diff);\n }\n else {\n item.__before && item.__before(diff);\n }\n }\n }\n}\n\nlet isPause;\n\nclass Frame {\n constructor() {\n this.__hookTask = []; // 动画刷新后,每个root注册的刷新回调执行\n this.__task = [];\n this.__taskCp = []; // 区别于task,component专用,和animate等其它不同流水线,在最后执行,防止混了 #122\n this.__now = null;\n }\n\n __init() {\n let self = this;\n let { task, taskCp } = self;\n inject.cancelAnimationFrame(self.id);\n let last = self.__now = inject.now();\n function cb() {\n // 必须清除,可能会发生重复,当动画finish回调中gotoAndPlay(0),下方结束判断发现aTask还有值会继续,新的init也会进入再次执行\n inject.cancelAnimationFrame(self.id);\n self.id = inject.requestAnimationFrame(function() {\n if(isPause || (!task.length && !taskCp.length)) {\n return;\n }\n let now = self.__now = inject.now();\n let diff = now - last;\n diff = Math.max(diff, 0);\n // let delta = diff * 0.06; // 比例是除以1/60s,等同于*0.06\n last = now;\n // 优先动画计算\n let clone = task.slice(0);\n let cloneCp = taskCp.splice(0); // task要常驻,taskCp只1次直接splice清空\n let length = clone.length;\n let lengthCp = cloneCp.length;\n traversal(clone, length, diff, false);\n traversal(cloneCp, lengthCp, diff, false);\n // 执行动画造成的每个Root的刷新并清空\n let list = self.__hookTask.splice(0);\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n item && item();\n }\n // 普通的before/after\n traversal(clone, length, diff, true);\n traversal(cloneCp, lengthCp, diff, true);\n // 还有则继续,没有则停止节省性能\n if(task.length || taskCp.length) {\n cb();\n }\n });\n }\n cb();\n }\n\n onFrame(handle) {\n if(!handle) {\n return;\n }\n let { task } = this;\n if(!task.length) {\n this.__init();\n }\n if(isFunction(handle)) {\n handle = {\n __after: handle,\n __karasFramecb: handle,\n };\n }\n task.push(handle);\n }\n\n offFrame(handle) {\n if(!handle) {\n return;\n }\n let { task } = this;\n for(let i = 0, len = task.length; i < len; i++) {\n let item = task[i];\n // 需考虑nextFrame包裹的引用对比\n if(item === handle || item.__karasFramecb === handle) {\n task.splice(i, 1);\n break;\n }\n }\n if(!task.length) {\n inject.cancelAnimationFrame(this.id);\n this.__now = null;\n }\n }\n\n nextFrame(handle) {\n if(!handle) {\n return;\n }\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n let cb = isFunction(handle) ? {\n __after: diff => {\n handle(diff);\n this.offFrame(cb);\n },\n } : {\n __before: handle.__before,\n __after: diff => {\n handle.__after && handle.__after(diff);\n this.offFrame(cb);\n },\n };\n cb.__karasFramecb = handle;\n this.onFrame(cb);\n }\n\n __nextFrameCp(handle) {\n let { task, taskCp } = this;\n if(!task.length && !taskCp.length) {\n this.__init();\n }\n taskCp.push(handle);\n }\n\n pause() {\n isPause = true;\n }\n\n resume() {\n if(isPause) {\n this.__init();\n isPause = false;\n }\n }\n\n get task() {\n return this.__task;\n }\n\n get taskCp() {\n return this.__taskCp;\n }\n}\n\nexport default new Frame();\n","/**\n * https://github.com/gre/bezier-easing\n * BezierEasing - use bezier curve for transition easing function\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\n */\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nlet NEWTON_ITERATIONS = 4;\nlet NEWTON_MIN_SLOPE = 0.001;\nlet SUBDIVISION_PRECISION = 0.0000001;\nlet SUBDIVISION_MAX_ITERATIONS = 10;\n\nlet kSplineTableSize = 11;\nlet kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nlet float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A(aA1, aA2) {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n}\n\nfunction B(aA1, aA2) {\n return 3.0 * aA2 - 6.0 * aA1;\n}\n\nfunction C(aA1) {\n return 3.0 * aA1;\n}\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n}\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope(aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n}\n\nfunction binarySubdivide(aX, aA, aB, mX1, mX2) {\n let currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if(currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while(Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n}\n\nfunction newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {\n for(let i = 0; i < NEWTON_ITERATIONS; ++i) {\n let currentSlope = getSlope(aGuessT, mX1, mX2);\n if(currentSlope === 0.0) {\n return aGuessT;\n }\n let currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\n\nfunction LinearEasing(x) {\n return x;\n}\n\nfunction bezier(mX1, mY1, mX2, mY2) {\n if(!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n throw new Error('bezier x values must be in [0, 1] range');\n }\n\n if(mX1 === mY1 && mX2 === mY2) {\n return LinearEasing;\n }\n\n // Precompute samples table\n let sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n for(let i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n\n function getTForX(aX) {\n let intervalStart = 0.0;\n let currentSample = 1;\n let lastSample = kSplineTableSize - 1;\n\n for(; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n let dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n let guessForT = intervalStart + dist * kSampleStepSize;\n\n let initialSlope = getSlope(guessForT, mX1, mX2);\n if(initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if(initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing(x) {\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if(x === 0 || x === 1) {\n return x;\n }\n return calcBezier(getTForX(x), mY1, mY2);\n };\n}\n\nlet easing = {\n linear: bezier(1, 1, 0, 0),\n easeIn: bezier(0.42, 0, 1, 1),\n easeOut: bezier(0, 0, 0.58, 1),\n ease: bezier(0.25, 0.1, 0.25, 1),\n easeInOut: bezier(0.42, 0, 0.58, 1),\n cubicBezier: bezier,\n getEasing(v, v1, v2, v3) {\n if(arguments.length === 4) {\n return bezier(v, v1, v2, v3);\n }\n else if(Array.isArray(v) && v.length === 4) {\n return bezier(v[0], v[1], v[2], v[3]);\n }\n else if(v) {\n v = v.toString();\n let timingFunction;\n if(/^\\s*(?:cubic-bezier\\s*)?\\(\\s*[\\d.]+\\s*,\\s*[-\\d.]+\\s*,\\s*[\\d.]+\\s*,\\s*[-\\d.]+\\s*\\)\\s*$/i.test(v)) {\n v = v.match(/[\\d.]+/g);\n timingFunction = bezier(v[0], v[1], v[2], v[3]);\n }\n else if(v !== 'getEasing') {\n timingFunction = this[v];\n }\n return timingFunction;\n }\n },\n};\n\neasing['ease-in'] = easing.easeIn;\neasing['ease-out'] = easing.easeOut;\neasing['ease-in-out'] = easing.easeInOut;\n\nexport default easing;\n","import css from '../style/css';\nimport unit from '../style/unit';\nimport tf from '../style/transform';\nimport abbr from '../style/abbr';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport Event from '../util/Event';\nimport inject from '../util/inject';\nimport frame from './frame';\nimport easing from './easing';\nimport change from '../refresh/change';\nimport key from './key';\nimport mx from '../math/matrix';\n\nconst {\n STYLE_KEY: {\n FILTER,\n TRANSFORM_ORIGIN,\n PERSPECTIVE_ORIGIN,\n BACKGROUND_CLIP,\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n BOX_SHADOW,\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n BACKGROUND_SIZE,\n FONT_SIZE,\n FLEX_BASIS,\n FLEX_DIRECTION,\n WIDTH,\n HEIGHT,\n TOP,\n BOTTOM,\n LINE_HEIGHT,\n OPACITY,\n Z_INDEX,\n TRANSFORM,\n COLOR,\n FONT_WEIGHT,\n FONT_STYLE,\n FONT_FAMILY,\n TEXT_ALIGN,\n MATRIX,\n ROTATE_3D,\n TRANSLATE_PATH,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_OVER,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_STYLE,\n UPDATE_KEYS,\n UPDATE_CONFIG,\n },\n KEY_FRAME_KEY: {\n FRAME_STYLE,\n FRAME_TIME,\n FRAME_EASING,\n FRAME_TRANSITION,\n },\n ANIMATE_KEY: {\n I_ASSIGNING,\n I_IN_FPS,\n I_IS_DELAY,\n I_BEGIN,\n I_END,\n I_FINISHED,\n I_NEXT_END,\n I_FIRST_PLAY,\n I_PLAY_CB,\n I_TARGET,\n I_ROOT,\n I_FRAMES,\n I_FRAMES_R,\n I_CURRENT_TIME,\n I_NEXT_TIME,\n I_STYLE,\n I_DURATION,\n I_ITERATIONS,\n I_FILL,\n I_PLAYBACK_RATE,\n I_PLAY_COUNT,\n I_PLAY_STATE,\n I_DESTROYED,\n I_START_TIME,\n I_FPS_TIME,\n I_EASING,\n I_ENTER_FRAME,\n I_DELAY,\n I_END_DELAY,\n I_KEYS,\n I_ORIGIN_STYLE,\n I_CURRENT_FRAMES,\n I_CURRENT_FRAME,\n I_SPF_LIMIT,\n I_FPS,\n I_DIRECTION,\n I_FIRST_ENTER,\n I_STAY_BEGIN,\n I_STAY_END,\n I_IS2,\n I_END_TIME,\n I_NODE_CONFIG,\n I_ROOT_CONFIG,\n I_OUT_BEGIN_DELAY,\n I_TIME_STAMP,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, INHERIT, RGBA, STRING, NUMBER, REM, VW, VH, VMAX, VMIN, calUnit } = unit;\nconst { isNil, isFunction, isNumber, isObject, isString, clone, equalArr } = util;\nconst { linear } = easing;\nconst { cloneStyle } = css;\nconst { isGeom, GEOM } = change;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nconst NUM_CAL_HASH = {\n};\nObject.assign(NUM_CAL_HASH, LENGTH_HASH);\nObject.assign(NUM_CAL_HASH, EXPAND_HASH);\n\nfunction unify(frames, target) {\n let hash = {};\n let keys = [];\n // 获取所有关键帧的属性\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n Object.keys(style).forEach(k => {\n let v = style[k];\n // 未定义的过滤掉,null空有意义\n if(v !== undefined && !hash.hasOwnProperty(k)) {\n hash[k] = true;\n // geom为属性字符串,style都为枚举int\n if(!GEOM.hasOwnProperty(k)) {\n k = parseInt(k);\n }\n // path动画要转为translateXY,所以手动添加,使2帧之间存在过渡,有可能之前已存在这个动画,可忽视\n if(k === TRANSLATE_PATH) {\n if(!hash.hasOwnProperty(TRANSLATE_X)) {\n keys.push(TRANSLATE_X);\n }\n if(!hash.hasOwnProperty(TRANSLATE_Y)) {\n keys.push(TRANSLATE_Y);\n }\n hash[TRANSLATE_X] = hash[TRANSLATE_Y] = true;\n }\n keys.push(k);\n }\n });\n });\n // 添补没有声明完全的关键帧属性为节点当前值\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n keys.forEach(k => {\n if(!style.hasOwnProperty(k) || isNil(style[k])) {\n if(GEOM.hasOwnProperty(k)) {\n style[k] = target.getProps(k);\n }\n else {\n style[k] = target.currentStyle[k];\n }\n }\n });\n });\n return keys;\n}\n\n// 每次初始化时处理继承值,以及转换transform为单matrix矩阵\nfunction inherit(frames, keys, target) {\n let computedStyle = target.computedStyle;\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n keys.forEach(k => {\n let v = style[k];\n // geom的属性可能在帧中没有\n if(isNil(v)) {\n return;\n }\n if(k === TRANSFORM) {\n let ow = target.outerWidth;\n let oh = target.outerHeight;\n let m = tf.calMatrix(v, ow, oh);\n style[k] = [[MATRIX, m]];\n }\n else if(v[1] === INHERIT) {\n if(k === COLOR || k === TEXT_STROKE_COLOR) {\n style[k] = [util.rgba2int(computedStyle[k]), RGBA];\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n style[k] = [computedStyle[k], PX];\n }\n else if(k === FONT_WEIGHT) {\n style[k] = [computedStyle[k], NUMBER];\n }\n else if(k === FONT_STYLE || k === FONT_FAMILY || k === TEXT_ALIGN || k === TEXT_STROKE_OVER) {\n style[k] = [computedStyle[k], STRING];\n }\n }\n });\n });\n}\n\n/**\n * 通知root更新当前动画,需要根据frame的状态来决定是否是同步插入\n * 在异步时,因为动画本身是异步,需要addRefreshTask\n * 而如果此时frame在执行before过程中,说明帧动画本身是在before计算的,需要同步插入\n * @param style\n * @param keys 样式所有的key\n * @param __config\n * @param root\n * @param node\n */\nfunction genBeforeRefresh(style, keys, __config, root, node) {\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = keys;\n res[UPDATE_CONFIG] = __config[I_NODE_CONFIG];\n root.__addUpdate(node, __config[I_NODE_CONFIG], root, __config[I_ROOT_CONFIG], res);\n __config[I_STYLE] = style;\n __config[I_ASSIGNING] = true;\n // frame每帧回调时,下方先执行计算好变更的样式,这里特殊插入一个hook,让root增加一个刷新操作\n // 多个动画调用因为相同root也只会插入一个,这样在所有动画执行完毕后frame里检查同步进行刷新,解决单异步问题\n root.__frameHook();\n}\n\n/**\n * 将每帧的样式格式化,提取出offset属性并转化为时间,提取出缓动曲线easing\n * @param style 关键帧样式\n * @param duration 动画时间长度\n * @param es options的easing曲线控制,frame没有自定义则使用全局的\n * @returns {{style: *, time: number, easing: *, transition: []}}\n */\nfunction framing(style, duration, es) {\n let { offset, easing } = style;\n // 这两个特殊值提出来存储不干扰style\n delete style.offset;\n delete style.easing;\n // translatePath特殊对待,ae的曲线运动动画\n let translatePath = style.translatePath;\n style = css.normalize(style);\n if(Array.isArray(translatePath) && [6, 8].indexOf(translatePath.length) > -1) {\n style[TRANSLATE_PATH] = translatePath.map(item => calUnit(item));\n }\n let res = [];\n res[FRAME_STYLE] = style;\n res[FRAME_TIME] = offset * duration;\n res[FRAME_EASING] = easing || es;\n res[FRAME_TRANSITION] = [];\n return res;\n}\n\nfunction calByUnit(p, n, container, root) {\n if(p[1] === PX) {\n if(n[1] === PERCENT) {\n return n[0] * 0.01 * container - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width * 0.01 - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height * 0.01 - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) * 0.01 - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) * 0.01 - p[0];\n }\n }\n else if(p[1] === PERCENT) {\n if(n[1] === PX) {\n return n[0] * 100 / container - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * root.computedStyle[FONT_SIZE] * 100 / container - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / container - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / container - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) / container - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) / container - p[0];\n }\n }\n else if(p[1] === REM) {\n if(n[1] === PX) {\n return n[0] / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * 0.01 * container / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n }\n else if(p[1] === VW) {\n if(n[1] === PX) {\n return n[0] * 100 / root.width - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / root.width - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / root.width - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / root.width - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) / root.width - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) / root.width - p[0];\n }\n }\n else if(p[1] === VH) {\n if(n[1] === PX) {\n return n[0] * 100 / root.height - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / root.height - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / root.height - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / root.height - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) / root.height - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) / root.height - p[0];\n }\n }\n else if(p[1] === VMAX) {\n if(n[1] === PX) {\n return n[0] * 100 / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) / Math.max(root.width, root.height) - p[0];\n }\n }\n else if(p[1] === VMIN) {\n if(n[1] === PX) {\n return n[0] * 100 / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) / Math.min(root.width, root.height) - p[0];\n }\n }\n}\n\n/**\n * 计算两帧之间的差,单位不同的以后面为准,返回的v表示差值\n * 没有变化返回空\n * auto等无法比较的不参与计算,不返回来标识无过度效果\n * @param prev 上一帧样式\n * @param next 下一帧样式\n * @param k 比较的样式名\n * @param target dom对象\n * @param tagName dom名\n * @returns {{k: *, v: *}}\n */\nfunction calDiff(prev, next, k, target, tagName) {\n let res = [k];\n let p = prev[k];\n let n = next[k];\n if(k === TRANSFORM) {\n // transform因默认值null很特殊,不存在时需给默认矩阵\n if(!p && !n) {\n return;\n }\n let pm, nm;\n if(p) {\n pm = p[0][1];\n }\n else {\n pm = mx.identity();\n }\n if(n) {\n nm = n[0][1];\n }\n else {\n nm = mx.identity();\n }\n // transform特殊被初始化转成matrix矩阵,直接计算差值\n if(equalArr(pm, nm)) {\n return;\n }\n res[1] = [\n nm[0] - pm[0],\n nm[1] - pm[1],\n nm[2] - pm[2],\n nm[3] - pm[3],\n nm[4] - pm[4],\n nm[5] - pm[5],\n nm[6] - pm[6],\n nm[7] - pm[7],\n nm[8] - pm[8],\n nm[9] - pm[9],\n nm[10] - pm[10],\n nm[11] - pm[11],\n nm[12] - pm[12],\n nm[13] - pm[13],\n nm[14] - pm[14],\n nm[15] - pm[15],\n ];\n return res;\n }\n else if(k === ROTATE_3D) {\n if(equalArr(p, n)) {\n return;\n }\n res[1] = [n[0] - n[0], n[1] - p[1], n[2] - p[2], [n[3][0] - p[3][0], n[3][1]]];\n }\n else if(k === FILTER) {\n // filter很特殊,里面有多个滤镜,忽视顺序按hash计算,为空视为默认值,如blur默认0,brightness默认1\n let pHash = {}, nHash = {}, keyHash = {};\n if(p) {\n p.forEach(item => {\n keyHash[item[0]] = true;\n pHash[item[0]] = item[1];\n });\n }\n if(n) {\n n.forEach(item => {\n keyHash[item[0]] = true;\n nHash[item[0]] = item[1];\n })\n }\n let v = {}, hasChange;\n // 只有blur支持px/rem/vw/vh/vmax/vmin,其余都是特殊固定单位\n Object.keys(keyHash).forEach(k => {\n if(k === 'blur') {\n if(!pHash[k]) {\n v[k] = nHash[k].slice(0);\n hasChange = true;\n }\n else if(!nHash[k]) {\n v[k] = [-pHash[k][0], pHash[k][1]];\n hasChange = true;\n }\n else {\n let v2 = calByUnit(pHash[k], nHash[k], 0, target.root);\n v[k] = [v2, pHash[k][1]];\n hasChange = true;\n }\n }\n else if(k === 'hue-rotate') {\n let nv = isNil(nHash[k]) ? 0 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 0 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'contrast' || k === 'sepia' || k === 'invert') {\n let nv = isNil(nHash[k]) ? 100 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 100 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n else if(k === 'grayscale') {\n let nv = isNil(nHash[k]) ? 0 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 0 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n });\n if(!hasChange) {\n return;\n }\n res[1] = v;\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n res[1] = [];\n for(let i = 0; i < 2; i++) {\n let pi = p[i];\n let ni = n[i];\n if(pi[1] === ni[1]) {\n res[1].push(ni[0] - pi[0]);\n }\n else {\n let v = calByUnit(pi, ni, target[i ? 'outerHeight' : 'outerWidth'], target.root);\n res[1].push(v || 0);\n }\n }\n if(equalArr(res[1], [0, 0])) {\n return;\n }\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n res[1] = [];\n let length = Math.min(p.length, n.length);\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni) {\n res[1].push(null);\n continue;\n }\n if(pi[1] === ni[1]) {\n let v = ni[0] - pi[0];\n if(!v) {\n res[1].push(null);\n return;\n }\n res[1].push(v);\n }\n else {\n let k2 = k === BACKGROUND_POSITION_X ? 'offsetWidth' : 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = k === BACKGROUND_POSITION_X ? 'clientWidth' : 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = k === BACKGROUND_POSITION_X ? 'width' : 'height';\n }\n let v = calByUnit(pi, ni, target[k2], target.root);\n if(!v) {\n res[1].push(null);\n return;\n }\n res[1].push(v);\n }\n }\n }\n else if(k === BOX_SHADOW) {\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let a = p[i];\n let b = n[i];\n let v = [];\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n v.push(b[j] - a[j]);\n }\n // rgba\n let c = [];\n for(let j = 0; j < 4; j++) {\n c.push(b[4][j] - a[4][j]);\n }\n v.push(c);\n res[1].push(v);\n }\n }\n else if(EXPAND_HASH.hasOwnProperty(k)) {\n if(p[1] === n[1]) {\n let v = n[0] - p[0];\n if(v === 0) {\n return;\n }\n res[1] = v;\n }\n else {\n let v = calByUnit(p, n, target[k === TRANSLATE_X || k === TRANSLATE_Z ? 'outerWidth' : 'outerHeight'], target.root);\n if(!v) {\n return;\n }\n res[1] = v;\n }\n }\n else if(k === BACKGROUND_SIZE) {\n res[1] = [];\n let length = Math.min(p.length, n.length);\n let has;\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni) {\n res[1].push(null);\n continue;\n }\n let temp = [];\n for(let j = 0; j < 2; j++) {\n let pp = pi[j], nn = ni[j];\n if(pp[1] === nn[1]) {\n temp.push(nn[0] - pp[0]);\n }\n else {\n let k2 = i ? 'offsetWidth' : 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = i ? 'clientWidth' : 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = i ? 'width' : 'height';\n }\n let v = calByUnit(pp, nn, target[k2], target.root);\n temp.push(v || 0);\n }\n }\n if(equalArr(temp, [0, 0])) {\n res[1].push(null);\n }\n else {\n res[1].push(temp);\n has = true;\n }\n }\n if(!has) {\n return;\n }\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n // backgroundImage发生了渐变色和图片的变化,fill发生渐变色和纯色的变化等\n res[1] = [];\n let length = Math.min(p.length, n.length);\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni || isString(pi) || isString(ni)) {\n res[1].push(null);\n continue;\n }\n if(pi.k !== ni.k) {\n res[1].push(null);\n continue;\n }\n let temp = [];\n // 渐变\n if(pi.k === 'linear' || pi.k === 'radial' || pi.k === 'conic') {\n let pv = pi.v;\n let nv = ni.v;\n temp[0] = [];\n let { clientWidth } = target;\n let eq = equalArr(pv, nv);\n for(let i = 0, len = Math.min(pv.length, nv.length); i < len; i++) {\n let a = pv[i];\n let b = nv[i];\n let t = [];\n t.push([\n b[0][0] - a[0][0],\n b[0][1] - a[0][1],\n b[0][2] - a[0][2],\n b[0][3] - a[0][3],\n ]);\n if(a[1] && b[1]) {\n if(a[1][1] === b[1][1]) {\n t.push(b[1][0] - a[1][0]);\n }\n else {\n let v = calByUnit(a[1], b[1], clientWidth, target.root);\n t.push(v || 0);\n }\n }\n temp[0].push(t);\n }\n // 线性渐变有角度差值变化\n if(pi.k === 'linear') {\n let isArrP = Array.isArray(pi.d);\n let isArrN = Array.isArray(ni.d);\n if(isArrN !== isArrP) {\n res[1].push(null);\n continue;\n }\n if(isArrP) {\n let v = [ni.d[0] - pi.d[0], ni.d[1] - pi.d[1], ni.d[2] - pi.d[2], ni.d[3] - pi.d[3]];\n if(eq && equalArr(v, [0, 0, 0, 0])) {\n res[1].push(null);\n continue;\n }\n temp[1] = v;\n }\n else {\n let v = ni.d - pi.d;\n if(eq && v === 0) {\n res[1].push(null);\n continue;\n }\n temp[1] = v;\n }\n }\n // 径向渐变的位置\n else if(pi.k === 'radial') {\n let isArrP = Array.isArray(pi.z);\n let isArrN = Array.isArray(ni.z);\n if(isArrN !== isArrP) {\n res[1].push(null);\n continue;\n }\n if(isArrP) {\n temp[2] = [];\n for(let i = 0; i < 5; i++) {\n let pz = pi.z[i];\n // 半径比例省略为1\n if(pz === undefined) {\n pz = 1;\n }\n let nz = ni.z[i];\n if(nz === undefined) {\n nz = 1;\n }\n temp[2].push(nz - pz);\n }\n if(eq && equalArr(res[4], [0, 0, 0, 0, 0])) {\n res[1].push(null);\n }\n }\n else {\n temp[2] = [];\n for(let i = 0; i < 2; i++) {\n let pp = pi.p[i];\n let np = ni.p[i];\n if(pp[1] === np[1]) {\n temp[2].push(np[0] - pp[0]);\n }\n else {\n let v = calByUnit(pp, np, target[i ? 'clientWidth' : 'clientHeight'], target.root);\n temp[2].push(v || 0);\n }\n }\n if(eq && equalArr(res[3], [0, 0])) {\n res[1].push(null);\n }\n }\n }\n else if(pi.k === 'conic') {\n temp[1].push(n.d - p.d);\n temp[2] = [];\n for(let i = 0; i < 2; i++) {\n let pp = p.p[i];\n let np = n.p[i];\n if(pp[1] === np[1]) {\n temp[2].push(np[0] - pp[0]);\n }\n else {\n let v = calByUnit(pp, np, target[i ? 'clientWidth' : 'clientHeight'], target.root);\n temp[2].push(v || 0);\n }\n }\n if(eq && res[2] !== 0 && equalArr(res[3], [0, 0])) {\n res[1].push(null);\n }\n }\n }\n // 纯色\n else {\n if(equalArr(n, pi)) {\n res[1].push(null);\n }\n temp[0] = [\n ni[0] - pi[0],\n ni[1] - pi[1],\n ni[2] - pi[2],\n ni[3] - pi[3]\n ];\n }\n res[1].push(temp);\n }\n }\n else if(COLOR_HASH.hasOwnProperty(k)) {\n n = n[0];\n p = p[0];\n if(equalArr(n, p) || n[3] === 0 && p[3] === 0) {\n return;\n }\n res[1] = [\n n[0] - p[0],\n n[1] - p[1],\n n[2] - p[2],\n n[3] - p[3]\n ];\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n // x/y都相等无需\n if(n[0][0] === p[0][0] && n[0][1] === p[0][1]\n && n[1][0] === p[1][0] && n[1][1] === p[1][1]) {\n return;\n }\n res[1] = [];\n for(let i = 0; i < 2; i++) {\n if(n[i][1] === p[i][1]) {\n res[1].push(n[i][0] - p[i][0]);\n }\n else {\n let v = calByUnit(p[i], n[i], target[i ? 'outerHeight' : 'outerWidth'], target.root);\n res[1].push(v || 0);\n }\n }\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n // auto不做动画\n if(p[1] === AUTO || n[1] === AUTO) {\n return;\n }\n let computedStyle = target.computedStyle;\n let parentComputedStyle = (target.domParent || target).computedStyle;\n let diff = 0;\n if(p[1] === n[1]) {\n diff = n[0] - p[0];\n }\n // lineHeight奇怪的单位变化,%相对于fontSize\n else if(k === LINE_HEIGHT) {\n diff = calByUnit(p, n, computedStyle[FONT_SIZE], target.root);\n }\n // fontSize的%相对于parent的\n else if(k === FONT_SIZE) {\n diff = calByUnit(p, n, parentComputedStyle[FONT_SIZE], target.root);\n }\n // 相对于父height的特殊属性\n else if(k === FLEX_BASIS\n && ['column', 'column-reverse', 'columnReverse'].indexOf(computedStyle[FLEX_DIRECTION]) > -1\n || [HEIGHT, TOP, BOTTOM].indexOf(k) > -1) {\n if(p[1] !== AUTO && n[1] !== AUTO) {\n diff = calByUnit(p, n, parentComputedStyle[HEIGHT], target.root);\n }\n }\n // 其余都是相对于父width的\n else {\n if(p[1] !== AUTO && n[1] !== AUTO) {\n diff = calByUnit(p, n, parentComputedStyle[WIDTH], target.root);\n }\n }\n // 兜底NaN非法\n if(diff === 0 || isNaN(diff)) {\n return;\n }\n res[1] = diff;\n }\n else if(GEOM.hasOwnProperty(k)) {\n if(isNil(p)) {\n return;\n }\n else if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calDiff)) {\n let fn = GEOM[k][tagName].calDiff;\n if(target.isMulti) {\n let arr = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n arr.push(fn(p[i], n[i]));\n }\n return arr;\n }\n else {\n res[1] = fn(p, n);\n }\n }\n // 特殊处理multi\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.min(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(null);\n }\n else {\n let v3 = [];\n for(let k = 0, len3 = Math.max(pv2.length, nv2.length); k < len3; k++) {\n let pv3 = pv2[k];\n let nv3 = nv2[k];\n // control由4点变2点\n if(isNil(pv3) || isNil(nv3)) {\n v3.push(0);\n }\n else {\n v3.push(nv3 - pv3);\n }\n }\n v2.push(v3);\n }\n }\n res[1].push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n res[1].push([\n nv[0] - pv[0],\n nv[1] - pv[1],\n ]);\n }\n }\n }\n else {\n if(n === p || equalArr(n, p) || k === 'edge' || k === 'closure' || k === 'booleanOperations') {\n return;\n }\n let v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n v.push(0);\n }\n v.push(nv - pv);\n }\n res[1] = v;\n }\n }\n // 非multi特殊处理这几类数组类型数据\n else if(k === 'points' || k === 'controls') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.max(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n // control由4点变2点\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(0);\n }\n else {\n v2.push(nv2 - pv2);\n }\n }\n res[1].push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [\n n[0] - p[0],\n n[1] - p[1],\n ];\n }\n // 其它简单数据,除了edge/closure/booleanOperations没有增量\n else {\n if(n === p || k === 'edge' || k === 'closure' || k === 'booleanOperations') {\n return;\n }\n else {\n res[1] = n - p;\n }\n }\n }\n else if(k === OPACITY || k === Z_INDEX) {\n if(n === p) {\n return;\n }\n res[1] = n - p;\n }\n // 特殊的path,不存在style中但在动画某帧中,不会统一化所以可能反向计算frameR时后一帧没有\n else if(k === TRANSLATE_PATH && p) {\n let k1 = 'offsetWidth', k2 = 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k1 = 'clientWidth';\n k2 = 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k1 = 'width';\n k2 = 'height';\n }\n res[1] = p.map((item, i) => {\n let [v, u] = item;\n if(u === PERCENT) {\n if(i % 2 === 0) {\n return [(parseFloat(v) || 0) * 0.01 * target[k1], PX];\n }\n else {\n return [(parseFloat(v) || 0) * 0.01 * target[k2], PX];\n }\n }\n else if(u === REM) {\n return [(parseFloat(v) || 0) * root.computedStyle[FONT_SIZE] * 100, PX];\n }\n else if(u === VW) {\n return [(parseFloat(v) || 0) * 0.01 * root.width, PX];\n }\n else if(u === VH) {\n return [(parseFloat(v) || 0) * 0.01 * root.height, PX];\n }\n else if(u === VMAX) {\n return [(parseFloat(v) || 0) * 0.01 * Math.max(root.width, root.height), PX];\n }\n else if(u === VMIN) {\n return [(parseFloat(v) || 0) * 0.01 * Math.min(root.width, root.height), PX];\n }\n else {\n return [parseFloat(v) || 0, PX];\n }\n });\n }\n // display等不能有增量过程的\n else {\n return;\n }\n return res;\n}\n\n// 计算两帧之间不相同的变化,存入transition,相同的忽略\nfunction calFrame(prev, next, keys, target, tagName) {\n keys.forEach(k => {\n let ts = calDiff(prev[FRAME_STYLE], next[FRAME_STYLE], k, target, tagName);\n // 可以形成过渡的才会产生结果返回\n if(ts) {\n prev[FRAME_TRANSITION].push(ts);\n }\n });\n return next;\n}\n\nfunction binarySearch(i, j, time, frames) {\n if(i === j) {\n let frame = frames[i];\n if(frame[FRAME_TIME] > time) {\n return i - 1;\n }\n return i;\n }\n else {\n let middle = i + ((j - i) >> 1);\n let frame = frames[middle];\n if(frame[FRAME_TIME] === time) {\n return middle;\n }\n else if(frame[FRAME_TIME] > time) {\n return binarySearch(i, Math.max(middle - 1, i), time, frames);\n }\n else {\n return binarySearch(Math.min(middle + 1, j), j, time, frames);\n }\n }\n}\n\nfunction getEasing(ea) {\n let timingFunction;\n if(ea) {\n if((timingFunction = /^\\s*steps\\s*\\(\\s*(\\d+)(?:\\s*,\\s*(\\w+))?\\s*\\)/i.exec(ea))) {\n let steps = parseInt(timingFunction[1]);\n let stepsD = timingFunction[2];\n timingFunction = function(percent) {\n // steps有效定义正整数\n if(steps && steps > 0) {\n let per = 1 / steps;\n let n = stepsD === 'start' ? Math.ceil(percent / per) : Math.floor(percent / per);\n return n / steps;\n }\n return percent;\n };\n }\n else {\n timingFunction = easing.getEasing(ea);\n }\n }\n return timingFunction;\n}\n\n/**\n * 根据百分比和缓动函数计算中间态样式\n * 当easing定义为steps时,优先计算\n * @param frame 当前帧\n * @param keys 所有样式key\n * @param percent 到下一帧时间的百分比\n * @param target vd\n * @returns {*}\n */\nfunction calIntermediateStyle(frame, keys, percent, target) {\n let style = cloneStyle(frame[FRAME_STYLE], keys);\n let timingFunction = getEasing(frame[FRAME_EASING]);\n if(timingFunction && timingFunction !== linear) {\n percent = timingFunction(percent);\n }\n let transition = frame[FRAME_TRANSITION];\n for(let i = 0, len = transition.length; i < len; i++) {\n let [k, v] = transition[i];\n let st = style[k];\n // transform特殊处理,只有1个matrix,有可能不存在,需给默认矩阵\n if(k === TRANSFORM) {\n if(!st) {\n st = style[k] = [[MATRIX, mx.identity()]];\n }\n for(let i = 0; i < 16; i++) {\n st[0][1][i] += v[i] * percent;\n }\n }\n // 特殊的曲线运动计算,转换为translateXY,出现在最后一定会覆盖原本的translate防重\n else if(k === TRANSLATE_PATH) {\n let t = 1 - percent;\n if(v.length === 8) {\n style[TRANSLATE_X] = [\n v[0][0] * t * t * t\n + 3 * v[2][0] * percent * t * t\n + 3 * v[4][0] * percent * percent * t\n + v[6][0] * percent * percent * percent,\n PX,\n ];\n style[TRANSLATE_Y] = [\n v[1][0] * t * t * t\n + 3 * v[3][0] * percent * t * t\n + 3 * v[5][0] * percent * percent * t\n + v[7][0] * percent * percent * percent,\n PX,\n ];\n }\n else if(v.length === 6) {\n style[TRANSLATE_X] = [\n v[0][0] * t * t\n + 2 * v[2][0] * percent * t\n + v[4][0] * percent * percent,\n PX,\n ];\n style[TRANSLATE_Y] = [\n v[1][0] * t * t\n + 3 * v[3][0] * percent * t\n + v[5][0] * percent * percent,\n PX,\n ];\n }\n }\n else if(k === ROTATE_3D) {\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3][0] += v[3][0] * percent;\n }\n else if(NUM_CAL_HASH.hasOwnProperty(k)) {\n if(v) {\n st[0] += v * percent;\n }\n }\n else if(k === FILTER) {\n // 只有1个样式声明了filter另外一个为空,会造成无样式,需初始化数组并在下面计算出样式存入\n if(!st) {\n st = style[k] = [];\n }\n // 将已有的样式按key存入引用来操作\n let hash = {};\n st.forEach(item => {\n hash[item[0]] = item[1];\n });\n Object.keys(v).forEach(k => {\n if(hash.hasOwnProperty(k)) {\n hash[k][0] += v[k][0] * percent;\n }\n else {\n // 2个关键帧中有1个未声明,需新建样式存入\n if(k === 'blur' || k === 'hue-rotate' || k === 'grayscale') {\n let n = v[k].slice(0);\n n[0] *= percent;\n st.push([k, n]);\n }\n // 默认值是1而非0\n else if(k === 'saturate' || k === 'brightness' || k === 'contrast' || k === 'sepia' || k === 'invert') {\n let n = v[k].slice(0);\n n[0] = 100 + n[0] * percent;\n st.push([k, n]);\n }\n }\n });\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n for(let i = 0; i < 2; i++) {\n st[i][0] += v[i] * percent;\n }\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n if(v[0] !== 0) {\n st[0][0] += v[0] * percent;\n }\n if(v[1] !== 0) {\n st[1][0] += v[1] * percent;\n }\n }\n else if(k === BOX_SHADOW) {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n st[i][j] += v[i][j] * percent;\n }\n // rgba\n for(let j = 0; j < 4; j++) {\n st[i][4][j] += v[i][4][j] * percent;\n }\n }\n }\n else if(k === BACKGROUND_SIZE) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0][0] += v[i][0] * percent;\n item[1][0] += v[i][1] * percent;\n }\n });\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0] += v[i] * percent;\n }\n });\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n st.forEach((st2, i) => {\n let v2 = v[i];\n if(!v2) {\n return;\n }\n let [c, d, p, z] = v2;\n if(GRADIENT_TYPE.hasOwnProperty(st2.k)) {\n for(let i = 0, len = Math.min(st2.v.length, c.length); i < len; i++) {\n let a = st2.v[i];\n let b = c[i];\n a[0][0] += b[0][0] * percent;\n a[0][1] += b[0][1] * percent;\n a[0][2] += b[0][2] * percent;\n a[0][3] += b[0][3] * percent;\n if(a[1] && b[1]) {\n a[1][0] += b[1] * percent;\n }\n }\n if(st2.k === 'linear' && st2.d !== undefined && d !== undefined) {\n if(Array.isArray(d)) {\n st2.d[0] += d[0] * percent;\n st2.d[1] += d[1] * percent;\n st2.d[2] += d[2] * percent;\n st2.d[3] += d[3] * percent;\n }\n else {\n st2.d += d * percent;\n }\n }\n if(st2.k === 'radial') {\n if(st2.z !== undefined && z !== undefined) {\n st2.z[0] += z[0] * percent;\n st2.z[1] += z[1] * percent;\n st2.z[2] += z[2] * percent;\n st2.z[3] += z[3] * percent;\n st2.z[4] += z[4] * percent;\n }\n else if(st2.p !== undefined && p !== undefined) {\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n else if(st2.k === 'conic' && st2.d !== undefined && d !== undefined) {\n st2.d += d * percent;\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n // fill纯色\n else {\n st2[0] += c[0] * percent;\n st2[1] += c[1] * percent;\n st2[2] += c[2] * percent;\n st2[3] += c[3] * percent;\n }\n });\n }\n // color可能超限[0,255],但浏览器已经做了限制,无需关心\n else if(COLOR_HASH.hasOwnProperty(k)) {\n st = st[0];\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n else if(GEOM.hasOwnProperty(k)) {\n let st = style[k];\n let tagName = target.tagName;\n if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calIncrease)) {\n let fn = GEOM[k][tagName].calIncrease;\n if(target.isMulti) {\n style[k] = st.map((item, i) => {\n return fn(item, v[i], percent);\n });\n }\n else {\n style[k] = fn(st, v, percent);\n }\n }\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n let o2 = o[j];\n let n2 = n[j];\n if(!isNil(o2) && !isNil(n2)) {\n for(let k = 0, len3 = Math.min(o2.length, n2.length); k < len3; k++) {\n if(!isNil(o2[k]) && !isNil(n2[k])) {\n o2[k] += n2[k] * percent;\n }\n }\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n v.forEach((item, i) => {\n let st2 = st[i];\n if(!isNil(item) && !isNil(st2)) {\n for(let i = 0, len = Math.min(st2.length, item.length); i < len; i++) {\n let o = st2[i];\n let n = item[i];\n if(!isNil(o) && !isNil(n)) {\n st2[i] += n * percent;\n }\n }\n }\n });\n }\n else {\n v.forEach((item, i) => {\n if(!isNil(item) && !isNil(st[i])) {\n st[i] += item * percent;\n }\n });\n }\n }\n else {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n if(!isNil(o[j]) && !isNil(n[j])) {\n o[j] += n[j] * percent;\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(!isNil(st[0]) && !isNil(v[0])) {\n st[0] += v[0] * percent;\n }\n if(!isNil(st[1]) && !isNil(v[1])) {\n st[1] += v[1] * percent;\n }\n }\n else {\n if(!isNil(st) && !isNil(v)) {\n style[k] += v * percent;\n }\n }\n }\n }\n else if(k === OPACITY || k === Z_INDEX) {\n style[k] += v * percent;\n // 精度问题可能会超过[0,1]区间\n if(k === OPACITY) {\n if(style[k] < 0) {\n style[k] = 0;\n }\n else if(style[k] > 1) {\n style[k] = 1;\n }\n }\n }\n }\n return style;\n}\n\nfunction gotoOverload(options, cb) {\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n return [options || {}, cb];\n}\n\nfunction calDiffTime(__config, diff) {\n let playbackRate = __config[I_PLAYBACK_RATE];\n let spfLimit = __config[I_SPF_LIMIT];\n let fps = __config[I_FPS];\n let v = __config[I_CURRENT_TIME] = __config[I_NEXT_TIME];\n // 定帧限制每帧时间间隔最大为spf\n if(spfLimit) {\n if(spfLimit === true) {\n diff = Math.min(diff, 1000 / fps);\n }\n else if(spfLimit > 0) {\n diff = Math.min(diff, spfLimit);\n }\n }\n // 播放时间累加,并且考虑播放速度加成\n if(playbackRate !== 1 && playbackRate > 0) {\n diff *= playbackRate;\n }\n __config[I_NEXT_TIME] += diff;\n return [v, diff];\n}\n\nfunction frameCb(self, __config, diff, isDelay) {\n self.emit(Event.FRAME, diff, isDelay);\n if(__config[I_FIRST_PLAY]) {\n __config[I_FIRST_PLAY] = false;\n self.emit(Event.PLAY);\n }\n let cb = __config[I_PLAY_CB];\n if(isFunction(cb)) {\n cb.call(self, diff, isDelay);\n // 清理要检查,gotoAndStop()这种cb回调中直接再次调用goto的话cb会不一致不能删除\n if(__config[I_PLAY_CB] === cb) {\n __config[I_PLAY_CB] = null;\n }\n }\n}\n\nlet uuid = 0;\n\nclass Animation extends Event {\n constructor(target, list, options) {\n super();\n this.__id = uuid++;\n list = clone(list || []);\n if(Array.isArray(list)) {\n list = list.filter(item => item && isObject(item));\n }\n // 动画过程另外一种形式,object描述k-v形式\n else if(list && isObject(list)) {\n let nl = [];\n Object.keys(list).forEach(k => {\n let v = list[k];\n if(Array.isArray(v)) {\n for(let i = 0, len = v.length; i < len; i++) {\n let o = nl[i] = nl[i] || {\n offset: i / (len - 1),\n };\n o[k] = v[i];\n }\n }\n });\n list = nl;\n }\n else {\n list = [];\n }\n if(isNumber(options)) {\n this.__options = {\n duration: options,\n };\n options = this.__options;\n }\n let op = this.__options = options || {\n duration: 0,\n };\n let root = target.root;\n let config = this.__config = [\n false, // assigning\n false, // inFps\n false, // isDelay\n false, // begin\n false, // end\n false, // finished\n false, // nextBegin\n true, // firstPlay\n null, // playCb\n target,\n root,\n null, // frames\n null, // framesR\n 0, // currentTime\n 0, // nextTime\n {}, // style\n 0, // duration\n 1, // iterations\n 'none', // fill\n 1, // playbackRate\n 0, // playCount\n 'idle',\n false, // destroy\n 0, // startTime\n 0, // fpsTime\n op.easing,\n false, // enterFrame\n 0, // delay\n 0, // endDelay\n null, // keys,\n null, // originStyle,\n null, // currentFrames\n null, // currentFrame\n false, // spfLimit\n 60, // fps\n 'normal', // direction\n true, // firstEnter,\n false, // stayBegin\n false, // stayEnd\n false, // is2\n 0, // endTime\n target.__config, // nodeConfig\n root && root.__config, // rootConfig,destroy后root可能为空\n false, // outBeginDelay\n ];\n let iterations = this.iterations = op.iterations;\n let duration = this.duration = op.duration;\n let [frames, framesR, keys, originStyle] = this.__init(list, iterations, duration, op.easing, target);\n config[I_FRAMES] = frames;\n config[I_FRAMES_R] = framesR;\n config[I_KEYS] = keys;\n config[I_ORIGIN_STYLE] = originStyle;\n if(frames.length === 2) {\n config[I_IS2] = true;\n config[I_END_TIME] = frames[1][FRAME_TIME];\n }\n let fps = parseInt(op.fps) || 0;\n if(fps <= 0) {\n fps = 60;\n }\n this.fps = fps;\n this.spfLimit = op.spfLimit;\n this.delay = op.delay;\n this.endDelay = op.endDelay;\n this.playbackRate = op.playbackRate;\n this.fill = op.fill;\n this.iterations = op.iterations;\n this.direction = op.direction;\n config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(op.direction) ? framesR : frames;\n // 时间戳\n config[I_TIME_STAMP] = frame.__now;\n // 性能优化访问\n this[0] = this.__before;\n this[1] = this.__after;\n }\n\n __init(list, iterations, duration, easing, target) {\n if(list.length < 1) {\n return [[], [], [], {}];\n }\n // 过滤时间非法的,过滤后续offset<=前面的\n let offset = -1;\n let tagName = target.tagName;\n for(let i = 0, len = list.length; i < len; i++) {\n let current = list[i];\n if(current.hasOwnProperty('offset')) {\n current.offset = parseFloat(current.offset) || 0;\n current.offset = Math.max(0, current.offset);\n current.offset = Math.min(1, current.offset);\n // 超过区间[0,1]\n if(isNaN(current.offset) || current.offset < 0 || current.offset > 1) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n // <=前面的\n else if(current.offset <= offset) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n }\n // 缩写处理\n Object.keys(current).forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(current, k);\n }\n });\n // 检查key合法性\n Object.keys(current).forEach(k => {\n if(k !== 'easing' && k !== 'offset' && !change.isValid(tagName, k)) {\n delete current[k];\n }\n });\n }\n // 只有1帧复制出来变成2帧方便运行\n if(list.length === 1) {\n list[0] = clone(list[0]);\n if(list[0].offset === 1) {\n list.unshift({\n offset: 0,\n });\n }\n else {\n let copy = clone(list[0]);\n copy.offset = 1;\n list.push(copy);\n }\n }\n // 强制clone防止同引用\n else {\n list.forEach((item, i) => {\n list[i] = clone(item);\n });\n }\n // 首尾时间偏移强制为[0, 1],不是的话前后加空帧\n let first = list[0];\n if(first.hasOwnProperty('offset') && first.offset > 0) {\n first = {\n offset: 0,\n };\n list.unshift(first);\n }\n else {\n first.offset = 0;\n }\n let last = list[list.length - 1];\n if(last.hasOwnProperty('offset') && last.offset < 1) {\n last = {\n offset: 1,\n };\n list.push(last);\n }\n else {\n last.offset = 1;\n }\n // 计算没有设置offset的时间\n for(let i = 1, len = list.length; i < len; i++) {\n let start = list[i];\n // 从i=1开始offset一定>0,找到下一个有offset的,均分中间无声明的\n if(!start.hasOwnProperty('offset')) {\n let end;\n let j = i + 1;\n for(; j < len; j++) {\n end = list[j];\n if(end.hasOwnProperty('offset')) {\n break;\n }\n }\n let num = j - i + 1;\n start = list[i - 1];\n let per = (end.offset - start.offset) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.offset = start.offset + per * (k + 1 - i);\n }\n i = j;\n }\n }\n let frames = [];\n // 换算每一关键帧样式标准化\n list.forEach(item => {\n frames.push(framing(item, duration, easing));\n });\n // 为方便两帧之间计算变化,强制统一所有帧的css属性相同,没有写的为节点的当前样式currentStyle\n let keys = unify(frames, target);\n inherit(frames, keys, target);\n let framesR = clone(frames).reverse();\n // 存储原本样式以便恢复用\n let { style, props } = target;\n let originStyle = {};\n keys.forEach(k => {\n if(isGeom(tagName, k)) {\n originStyle[k] = props[k];\n }\n originStyle[k] = style[k];\n });\n // 再计算两帧之间的变化,存入transition属性\n let length = frames.length;\n let prev = frames[0];\n for(let i = 1; i < length; i++) {\n let next = frames[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n // 反向存储帧的倒排结果\n framesR.forEach(item => {\n item[FRAME_TIME] = duration - item[FRAME_TIME];\n item[FRAME_TRANSITION] = [];\n });\n prev = framesR[0];\n for(let i = 1; i < length; i++) {\n let next = framesR[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n return [frames, framesR, keys, originStyle];\n }\n\n __clean(isFinish) {\n let __config = this.__config;\n this.__cancelTask();\n __config[I_NEXT_TIME] = 0;\n let restore;\n let style = __config[I_STYLE];\n let keys = __config[I_KEYS];\n let target = __config[I_TARGET];\n if(isFinish) {\n // gotoAndStop到一个很大的时间的话,也需要防止超过\n __config[I_CURRENT_TIME] = __config[I_DELAY] + __config[I_DURATION] * __config[I_ITERATIONS] + __config[I_END_DELAY];\n if(__config[I_PLAY_STATE] === 'finish') {\n return;\n }\n __config[I_PLAY_STATE] = 'finish';\n // cancel需要清除finish根据情况保留\n if(!__config[I_STAY_END]) {\n __config[I_STYLE] = {};\n restore = true;\n }\n }\n else {\n __config[I_PLAY_COUNT] = __config[I_CURRENT_TIME] = 0;\n if(__config[I_PLAY_STATE] === 'idle') {\n return;\n }\n __config[I_PLAY_STATE] = 'idle';\n __config[I_STYLE] = {};\n restore = true;\n }\n // 动画取消结束不停留在最后一帧需要还原target原本的样式,需要对比目前是否是由本动画赋值的\n if(restore) {\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n if(target.__currentProps[k] === style[k]) {\n target.__currentProps[k] = target.props[k];\n }\n }\n else {\n if(target.__currentStyle[k] === style[k]) {\n target.__currentStyle[k] = target.style[k];\n }\n }\n });\n }\n }\n\n play(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n if(playState === 'running') {\n return this;\n }\n this.__cancelTask();\n __config[I_PLAY_CB] = cb;\n __config[I_PLAY_STATE] = 'running';\n // 每次play调用标识第一次运行,需响应play事件和回调\n __config[I_FIRST_PLAY] = true;\n // 防止finish/cancel事件重复触发,每次播放重置\n this.__hasFin = false;\n this.__hasCancel = false;\n // 只有第一次调用会进初始化,另外finish/cancel视为销毁也会重新初始化\n if(!__config[I_ENTER_FRAME]) {\n __config[I_ENTER_FRAME] = true;\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n // 初始化根据方向确定帧序列\n __config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction) ? framesR : frames;\n __config[I_CURRENT_TIME] = __config[I_NEXT_TIME] = __config[I_FPS_TIME] = 0;\n }\n // 添加每帧回调且立刻执行,本次执行调用refreshTask也是下一帧再渲染,frame的每帧都是下一帧\n // frame.offFrame(this);\n frame.onFrame(this);\n __config[I_START_TIME] = frame.__now;\n __config[I_END] = false;\n return this;\n }\n\n __before(diff) {\n let __config = this.__config;\n __config[I_TIME_STAMP] = frame.__now;\n let target = __config[I_TARGET];\n let fps = __config[I_FPS];\n let playCount = 0;\n let currentFrames = __config[I_CURRENT_FRAMES];\n let iterations = __config[I_ITERATIONS];\n let stayBegin = __config[I_STAY_BEGIN];\n let stayEnd = __config[I_STAY_END];\n let delay = __config[I_DELAY];\n let root = __config[I_ROOT];\n let is2 = __config[I_IS2];\n let endTime = __config[I_END_TIME];\n let duration = __config[I_DURATION];\n let endDelay = __config[I_END_DELAY];\n let length = currentFrames.length;\n // 用本帧和上帧时间差,计算累加运行时间currentTime,以便定位当前应该处于哪个时刻\n let [currentTime, d] = calDiffTime(__config, diff);\n diff = d;\n // 增加的fps功能,当<60时计算跳帧,每帧运行依旧累加时间,达到fps时重置,第一帧强制不跳\n if(!__config[I_FIRST_ENTER] && fps < 60) {\n diff = __config[I_FPS_TIME] += diff;\n if(diff < 1000 / fps) {\n __config[I_IN_FPS] = true;\n return;\n }\n __config[I_FPS_TIME] = 0;\n }\n __config[I_FIRST_ENTER] = false;\n // delay仅第一次生效等待\n if(currentTime < delay) {\n if(stayBegin) {\n let currentFrame = __config[I_CURRENT_FRAME] = currentFrames[0];\n let current = currentFrame[FRAME_STYLE];\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n }\n // 即便不刷新,依旧执行帧回调,同时标明让后续第一帧响应begin\n __config[I_OUT_BEGIN_DELAY] = true;\n __config[I_IS_DELAY] = true;\n return;\n }\n // 减去delay,计算在哪一帧\n currentTime -= delay;\n if(currentTime === 0 || __config[I_OUT_BEGIN_DELAY]) {\n __config[I_OUT_BEGIN_DELAY] = false;\n __config[I_BEGIN] = true;\n }\n // 超过duration非尾轮需处理回到开头,触发新一轮动画事件,这里可能时间间隔非常大直接跳过几轮\n let round;\n while(currentTime >= duration && playCount < iterations - 1) {\n currentTime -= duration;\n playCount++;\n }\n if(__config[I_PLAY_COUNT] < playCount) {\n __config[I_BEGIN] = true;\n round = true;\n }\n __config[I_PLAY_COUNT] = playCount;\n // 如果发生轮换,需重新确定正反向\n if(round) {\n let direction = __config[I_DIRECTION];\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let isAlternate = {\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction);\n // 有正反向播放需要重设帧序列\n if(isAlternate) {\n let isEven = playCount % 2 === 0;\n if(direction === 'alternate') {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n }\n let isLastCount = playCount >= iterations - 1;\n // 只有2帧可优化,否则2分查找当前帧\n let i, frameTime;\n if(is2) {\n i = currentTime < endTime ? 0 : 1;\n frameTime = endTime;\n }\n else {\n i = binarySearch(0, length - 1, currentTime, currentFrames);\n frameTime = currentFrames[i][FRAME_TIME];\n }\n // 最后一帧结束动画,仅最后一轮才会进入,需处理endDelay\n let isLastFrame = isLastCount && i === length - 1;\n let percent = 0;\n if(isLastFrame) {\n // 无需任何处理\n }\n // 否则根据目前到下一帧的时间差,计算百分比,再反馈到变化数值上\n else if(is2) {\n percent = currentTime / duration;\n }\n else {\n let total = currentFrames[i + 1][FRAME_TIME] - frameTime;\n percent = (currentTime - frameTime) / total;\n }\n let inEndDelay, currentFrame = currentFrames[i], current;\n __config[I_CURRENT_FRAME] = currentFrame;\n /** 这里要考虑全几种场景:\n * 1. 单次播放无endDelay且fill不停留(有/无差异,下同)\n * 2. 单次播放无endDelay且fill停留\n * 3. 单次播放有endDelay且fill不停留\n * 4. 单次播放有endDelay且fill停留\n * 5. 多次播放无endDelay且fill不停留(尾次/非尾次,下同)\n * 6. 多次播放无endDelay且fill停留\n * 7. 多次播放有endDelay且fill不停留\n * 8. 多次播放有endDelay且fill停留\n */\n let needClean;\n if(isLastFrame) {\n inEndDelay = currentTime < duration + endDelay;\n // 停留对比最后一帧,endDelay可能会多次进入这里,第二次进入样式相等不再重绘\n if(stayEnd) {\n current = cloneStyle(currentFrame[FRAME_STYLE], __config[I_KEYS]);\n }\n // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里\n else {\n current = cloneStyle(__config[I_ORIGIN_STYLE], __config[I_KEYS]);\n }\n // 进入endDelay或结束阶段触发end事件,注意只触发一次,防重在触发的地方做\n __config[I_NEXT_END] = true;\n if(!inEndDelay) {\n __config[I_PLAY_COUNT]++;\n __config[I_FINISHED] = true;\n frame.offFrame(this);\n needClean = true;\n __config[I_NEXT_TIME] = 0;\n }\n }\n else {\n current = calIntermediateStyle(currentFrame, __config[I_KEYS], percent, target);\n }\n // 无论两帧之间是否有变化,都生成计算结果赋给style,去重在root做\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n if(needClean) {\n let playCb = __config[I_PLAY_CB];\n this.__clean(true);\n // 丑陋的做法,防止gotoAndStop()这样的cb被clean()掉\n if(playCb) {\n __config[I_PLAY_CB] = playCb;\n }\n }\n }\n\n __after(diff) {\n let __config = this.__config;\n __config[I_ASSIGNING] = false;\n if(__config[I_IN_FPS]) {\n __config[I_IN_FPS] = false;\n return;\n }\n frameCb(this, __config, diff, __config[I_IS_DELAY]);\n __config[I_IS_DELAY] = false;\n if(__config[I_BEGIN]) {\n __config[I_BEGIN] = false;\n this.emit(Event.BEGIN, __config[I_PLAY_COUNT]);\n }\n // end事件只触发一次,末轮进入endDelay或直接结束时\n if(__config[I_NEXT_END] && !__config[I_END]) {\n __config[I_END] = true;\n this.emit(Event.END, __config[I_PLAY_COUNT] - 1);\n }\n if(__config[I_FINISHED]) {\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n __config[I_PLAY_STATE] = 'finished';\n this.emit(Event.FINISH);\n }\n }\n\n pause(silence) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let { pending } = this;\n if(isDestroyed || duration <= 0 || pending) {\n return this;\n }\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(!silence) {\n this.emit(Event.PAUSE);\n }\n return this;\n }\n\n resume(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n if(isDestroyed || duration <= 0 || playState !== 'paused') {\n return this;\n }\n return this.play(cb);\n }\n\n finish(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1 || playState === 'finished' || playState === 'idle') {\n return self;\n }\n // 先清除所有回调任务,多次调用finish也会清除只留最后一次\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n let current;\n // 停留在最后一帧\n if(__config[I_STAY_END]) {\n __config[I_CURRENT_FRAME] = frames[frames.length - 1];\n current = frames[frames.length - 1][FRAME_STYLE];\n }\n else {\n current = originStyle;\n }\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(current, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean(true);\n },\n __after(diff) {\n if(!self.__hasFin) {\n self.__hasFin = true;\n __config[I_ASSIGNING] = false;\n frameCb(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.FINISH);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n cancel(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || playState === 'idle' || frames.length < 1) {\n return self;\n }\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(originStyle, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean();\n },\n __after(diff) {\n if(!self.__hasCancel) {\n self.__hasCancel = true;\n __config[I_ASSIGNING] = false;\n frameCb(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.CANCEL);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n gotoAndPlay(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n // 计算出时间点直接累加播放\n this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n return this.play(cb);\n }\n\n gotoAndStop(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n v = this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n // 先play一帧,回调里模拟暂停\n return this.play(diff => {\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isFunction(cb)) {\n cb.call(this, diff);\n }\n });\n }\n\n // 同步赋予,用在extendAnimate\n assignCurrentStyle() {\n let __config = this.__config;\n let style = __config[I_STYLE];\n let target = __config[I_TARGET];\n let keys = __config[I_KEYS];\n keys.forEach(i => {\n if(style.hasOwnProperty(i)) {\n let v = style[i];\n // geom的属性变化\n if(GEOM.hasOwnProperty(i)) {\n target.currentProps[i] = v;\n }\n // 样式\n else {\n // 将动画样式直接赋给currentStyle\n target.currentStyle[i] = v;\n }\n }\n });\n }\n\n // 返回不包含delay且去除多轮的时间\n __goto(v, isFrame, excludeDelay) {\n let __config = this.__config;\n let iterations = __config[I_ITERATIONS];\n let duration = __config[I_DURATION];\n __config[I_PLAY_STATE] = 'paused';\n // this.__cancelTask(); // 应该不需要,gotoAndXxx都会调用play(),里面有\n if(isNaN(v) || v < 0) {\n throw new Error('Param of gotoAnd(Play/Stop) is illegal: ' + v);\n }\n if(isFrame) {\n v = (v - 1) / this.spf;\n }\n if(excludeDelay) {\n v += __config[I_DELAY];\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n __config[I_NEXT_TIME] = v;\n v -= __config[I_DELAY];\n // 超过时间长度需要累加次数,这里可以超过iterations,因为设定也许会非常大\n let playCount = 0;\n while(v >= duration && playCount < iterations - 1) {\n playCount++;\n v -= duration;\n }\n __config[I_PLAY_COUNT] = playCount;\n // 防止play()重置时间和当前帧组,提前计算好\n __config[I_ENTER_FRAME] = true;\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n if({\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction)) {\n let isEven = playCount % 2 === 0;\n if(direction === 'alternate') {\n __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n return v;\n }\n\n addControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.add(this);\n }\n }\n\n removeControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.remove(this);\n }\n }\n\n __stayBegin() {\n return {\n backwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __stayEnd() {\n return {\n forwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __setTarget(target) {\n this.__target = target;\n this.__config[I_TARGET] = target;\n this.__config[I_NODE_CONFIG] = target.__config;\n }\n\n __cancelTask() {\n frame.offFrame(this);\n this.__config[I_PLAY_CB] = null;\n }\n\n __destroy(sync) {\n let self = this;\n let __config = self.__config;\n if(__config[I_DESTROYED]) {\n return;\n }\n self.removeControl();\n // clean异步执行,因为里面的样式还原需要等到下一帧,否则同步执行清除后,紧接着的新同步动画获取不到currentStyle\n if(sync) {\n self.__clean();\n __config[I_TARGET] = null;\n }\n else {\n frame.nextFrame({\n __before() {\n self.__clean();\n __config[I_TARGET] = null;\n },\n });\n }\n __config[I_START_TIME] = 0;\n __config[I_DESTROYED] = true;\n }\n\n __checkModify() {\n let __config = this.__config;\n if(__config[I_PLAY_STATE] !== 'idle' && __config[I_PLAY_STATE] !== 'finished') {\n inject.warn('Modification will not come into effect when animation is running');\n }\n }\n\n get id() {\n return this.__id;\n }\n\n get target() {\n return this.__config[I_TARGET];\n }\n\n get root() {\n return this.__config[I_ROOT];\n }\n\n get keys() {\n return this.__config[I_KEYS];\n }\n\n get style() {\n return this.__config[I_STYLE];\n }\n\n get options() {\n return this.__options;\n }\n\n get duration() {\n return this.__config[I_DURATION];\n }\n\n set duration(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DURATION] !== v) {\n __config[I_DURATION] = v;\n __config[I_END_TIME] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get delay() {\n return this.__config[I_DELAY];\n }\n\n set delay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DELAY] !== v) {\n __config[I_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get endDelay() {\n return this.__config[I_END_DELAY];\n }\n\n set endDelay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_END_DELAY] !== v) {\n __config[I_END_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get fps() {\n return this.__config[I_FPS];\n }\n\n set fps(v) {\n v = parseInt(v) || 60;\n let __config = this.__config;\n if(__config[I_FPS] !== v) {\n if(v <= 0) {\n v = 60;\n }\n __config[I_FPS] = v;\n }\n return v;\n }\n\n get spf() {\n return 1 / this.fps;\n }\n\n get iterations() {\n return this.__config[I_ITERATIONS];\n }\n\n set iterations(v) {\n if(v === Infinity || util.isString(v) && v.toLowerCase() === 'infinity') {\n v = Infinity;\n }\n else {\n v = parseInt(v);\n if(isNaN(v) || v < 0) {\n v = 1;\n }\n }\n let __config = this.__config;\n if(__config[I_ITERATIONS] !== v) {\n __config[I_ITERATIONS] = v;\n }\n return v;\n }\n\n get fill() {\n return this.__config[I_FILL];\n }\n\n set fill(v) {\n v = v || 'none';\n let __config = this.__config;\n if(__config[I_FILL] !== v) {\n __config[I_FILL] = v;\n this.__checkModify();\n }\n __config[I_STAY_BEGIN] = {\n backwards: true,\n both: true,\n }.hasOwnProperty(v);\n __config[I_STAY_END] = {\n forwards: true,\n both: true,\n }.hasOwnProperty(v);\n return v;\n }\n\n get direction() {\n return this.__config[I_DIRECTION];\n }\n\n set direction(v) {\n v = v || 'normal';\n let __config = this.__config;\n if(__config[I_DIRECTION] !== v) {\n __config[I_DIRECTION] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get frames() {\n return this.__config[I_FRAMES];\n }\n\n get framesR() {\n return this.__config[I_FRAMES_R];\n }\n\n get playbackRate() {\n return this.__config[I_PLAYBACK_RATE];\n }\n\n set playbackRate(v) {\n v = parseFloat(v) || 1;\n if(v <= 0) {\n v = 1;\n }\n let __config = this.__config;\n if(__config[I_PLAYBACK_RATE] !== v) {\n __config[I_PLAYBACK_RATE] = v;\n }\n return v;\n }\n\n get easing() {\n return this.__config[I_EASING];\n }\n\n get startTime() {\n return this.__config[I_START_TIME];\n }\n\n get currentTime() {\n return this.__config[I_CURRENT_TIME];\n }\n\n set currentTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_CURRENT_TIME] !== v) {\n __config[I_CURRENT_TIME] = v;\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get nextTime() {\n return this.__config[I_NEXT_TIME];\n }\n\n set nextTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_NEXT_TIME] !== v) {\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get timestamp() {\n return this.__config[I_TIME_STAMP];\n }\n\n get pending() {\n return this.__config[I_PLAY_STATE] !== 'running';\n }\n\n get finished() {\n return this.__config[I_PLAY_STATE] === 'finished';\n }\n\n get playState() {\n return this.__config[I_PLAY_STATE];\n }\n\n get playCount() {\n return this.__config[I_PLAY_COUNT];\n }\n\n set playCount(v) {\n v = Math.max(0, parseInt(v) || 0);\n let __config = this.__config;\n if(__config[I_PLAY_COUNT] !== v) {\n __config[I_PLAY_COUNT] = v;\n }\n return v;\n }\n\n get isDestroyed() {\n return this.__config[I_DESTROYED];\n }\n\n get animating() {\n let __config = this.__config;\n let playState = __config[I_PLAY_STATE];\n if(playState === 'idle') {\n return false;\n }\n return playState !== 'finished' || __config[I_STAY_END] || __config[I_STAY_BEGIN];\n }\n\n get spfLimit() {\n let __config = this.__config;\n return __config[I_SPF_LIMIT];\n }\n\n set spfLimit(v) {\n if(util.isNumber(v) || /^\\d/.test(v)) {\n v = Math.max(0, parseInt(v) || 0);\n }\n else {\n v = !!v;\n }\n let __config = this.__config;\n if(__config[I_SPF_LIMIT] !== v) {\n __config[I_SPF_LIMIT] = v;\n }\n return v;\n }\n\n get assigning() {\n return this.__config[I_ASSIGNING];\n }\n}\n\nexport default Animation;\n","import mode from '../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, dx = 0, dy = 0) {\n x1 += dx;\n y1 += dy;\n x2 += dx;\n y2 += dy;\n let [x, y, sigma, spread, color, inset] = data;\n let c = int2rgba(color);\n let n = Math.abs(sigma) * 2 + Math.abs(spread) * 2 + Math.abs(x) * 2 + Math.abs(y) * 2;\n // box本身坐标顺时针\n let box = [\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1, y2],\n [x1, y1],\n ];\n // 算上各种偏移/扩散的最外层坐标,且逆时针\n let outer = [\n [x1 - n, y1 - n],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n ];\n if(color[3] > 0 && (sigma > 0 || spread > 0)) {\n if(renderMode === mode.CANVAS | renderMode === mode.WEBGL) {\n ctx.save();\n ctx.beginPath();\n // inset裁剪box外面\n if(inset === 'inset') {\n let xa = x1 + x + spread;\n let ya = y1 + y + spread;\n let xb = x2 + x - spread;\n let yb = y2 + y - spread;\n let spreadBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n // 是否相交判断需要绘制\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]);\n if(!cross) {\n return;\n }\n cross = [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ];\n // 扩散区域类似边框填充\n if(spread) {\n canvasPolygon(ctx, cross);\n canvasPolygon(ctx, box.slice(0).reverse());\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== c) {\n ctx.fillStyle = c;\n }\n canvasPolygon(ctx, box);\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, cross);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowColor = c;\n ctx.shadowBlur = sigma;\n // 画在外围的空心矩形,宽度要比blur大,n考虑了这一情况取了最大值\n canvasPolygon(ctx, [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [x1 - n, yb],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, yb],\n [xa, yb],\n [xa, ya],\n ]);\n }\n else {\n canvasPolygon(ctx, box);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowOffsetX = x;\n ctx.shadowOffsetY = y;\n ctx.shadowColor = c;\n ctx.shadowBlur = sigma;\n canvasPolygon(ctx, [\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1 - n, y2],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, y2],\n [x1, y2],\n [x1, y1],\n ]);\n }\n }\n // outset需裁减掉box本身的内容,clip()非零环绕显示box外的阴影内容,fill()绘制在内无效\n else {\n let xa = x1 + x - spread;\n let ya = y1 + y - spread;\n let xb = x2 + x + spread;\n let yb = y2 + y + spread;\n let blurBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]);\n // 分为是否有spread,因模糊成本spread区域将没有模糊\n if(spread) {\n // 扩散区域类似边框填充\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, blurBox.slice(0).reverse());\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== c) {\n ctx.fillStyle = c;\n }\n canvasPolygon(ctx, blurBox);\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n ctx.save();\n ctx.beginPath();\n // 阴影部分看相交情况裁剪,有相交时逆时针绘制相交区域即可排除之\n if(cross) {\n canvasPolygon(ctx, [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ].reverse());\n }\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, blurBox);\n canvasPolygon(ctx, outer);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowColor = c;\n ctx.shadowBlur = sigma;\n canvasPolygon(ctx, blurBox);\n }\n else {\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, outer);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowOffsetX = x;\n ctx.shadowOffsetY = y;\n ctx.shadowColor = c;\n ctx.shadowBlur = sigma;\n canvasPolygon(ctx, box);\n }\n }\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n }\n else if(renderMode === mode.SVG) {\n let d = blur.outerSize(sigma);\n if(inset === 'inset') {\n let xa = x1 + x + spread;\n let ya = y1 + y + spread;\n let xb = x2 + x - spread;\n let yb = y2 + y - spread;\n let spreadBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]);\n if(!cross) {\n return;\n }\n cross = [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ];\n if(spread) {\n let v = {\n tagName: 'filter',\n props: [\n ['x', -d / w],\n ['y', -d / h],\n ['width', 1 + d * 2 / w],\n ['height', 1 + d * 2 / h],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', 0],\n ['dy', 0],\n ['stdDeviation', sigma * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n }\n xom.__config[NODE_DEFS_CACHE].push(v);\n let filter = ctx.add(v);\n let v2 = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(cross) + svgPolygon(box.slice(0).reverse())],\n ['fill', '#FFF'],\n ],\n }],\n };\n let clip = ctx.add(v2);\n xom.__config[NODE_DEFS_CACHE].push(v2);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', c],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(cross)],\n ['fill', '#FFF'],\n ],\n }],\n };\n clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon([\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [x1 - n, yb],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, yb],\n [xa, yb],\n [xa, ya],\n ])],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n else {\n let v = {\n tagName: 'filter',\n props: [\n ['x', -d / w],\n ['y', -d / h],\n ['width', 1 + d * 2 / w],\n ['height', 1 + d * 2 / h],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', x],\n ['dy', y],\n ['stdDeviation', sigma * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n }\n let filter = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', '#FFF'],\n ],\n }],\n };\n let clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon([\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1 - n, y2],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, y2],\n [x1, y2],\n [x1, y1],\n ])],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n }\n else {\n let xa = x1 + x - spread;\n let ya = y1 + y - spread;\n let xb = x2 + x + spread;\n let yb = y2 + y + spread;\n let blurBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]);\n if(spread) {\n let v = {\n tagName: 'filter',\n props: [\n ['x', -d / w],\n ['y', -d / h],\n ['width', 1 + d * 2 / w],\n ['height', 1 + d * 2 / h],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', 0],\n ['dy', 0],\n ['stdDeviation', sigma * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n };\n let filter = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box) + svgPolygon(blurBox.slice(0).reverse())],\n ['fill', '#FFF'],\n ],\n }],\n };\n let clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(blurBox)],\n ['fill', c],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', (cross ? svgPolygon([\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ].reverse()) : '')\n + svgPolygon(box) + svgPolygon(blurBox) + svgPolygon(outer)],\n ['fill', '#FFF'],\n ],\n }],\n };\n clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(blurBox)],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n else {\n let v = {\n tagName: 'filter',\n props: [\n ['x', -d / w],\n ['y', -d / h],\n ['width', 1 + d * 2 / w],\n ['height', 1 + d * 2 / h],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', x],\n ['dy', y],\n ['stdDeviation', sigma * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n };\n let filter = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box) + svgPolygon(outer)],\n ['fill', '#FFF'],\n ],\n }],\n };\n let clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n }\n }\n }\n}\n\nexport default {\n renderBoxShadow,\n};\n","const MBM_HASH = {\n multiply: true,\n screen: true,\n overlay: true,\n darken: true,\n lighten: true,\n 'color-dodge': true,\n 'color-burn': true,\n 'hard-light': true,\n 'soft-light': true,\n difference: true,\n exclusion: true,\n hue: true,\n saturation: true,\n color: true,\n luminosity: true,\n};\n\nfunction mbmName(v) {\n if(v) {\n return v.replace(/[A-Z]/, function($0) {\n return '-' + $0.toLowerCase();\n });\n }\n}\n\nfunction isValidMbm(v) {\n return MBM_HASH.hasOwnProperty(mbmName(v));\n}\n\nexport default {\n mbmName,\n isValidMbm,\n};\n","import TextBox from './TextBox';\nimport enums from '../util/enums';\n\nconst {\n STYLE_KEY: {\n MARGIN_LEFT,\n MARGIN_RIGHT,\n PADDING_LEFT,\n PADDING_RIGHT,\n BORDER_LEFT_WIDTH,\n BORDER_RIGHT_WIDTH,\n },\n} = enums;\n\n/**\n * 获取inline的每一行内容的矩形坐标4个点,同时附带上border的矩形,比前面4个点尺寸大或相等(有无border/padding)\n * @param xom\n * @param contentBoxList\n * @param start\n * @param end\n * @param lineBox\n * @param baseline\n * @param lineHeight\n * @param diffL\n * @param isStart\n * @param isEnd\n * @param backgroundClip\n * @param paddingTop\n * @param paddingRight\n * @param paddingBottom\n * @param paddingLeft\n * @param borderTopWidth\n * @param borderRightWidth\n * @param borderBottomWidth\n * @param borderLeftWidth\n * @returns {(*|number)[]}\n */\nfunction getInlineBox(xom, contentBoxList, start, end, lineBox, baseline, lineHeight, diffL, isStart, isEnd,\n backgroundClip, paddingTop, paddingRight, paddingBottom, paddingLeft,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth) {\n // 根据bgClip确定y伸展范围,inline渲染bg扩展到pb的位置不影响布局\n let eyt = 0, eyb = 0;\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n eyt = paddingTop;\n eyb = paddingBottom;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n eyt = paddingTop + borderTopWidth;\n eyb = paddingBottom + borderBottomWidth;\n }\n // 同y的border伸展范围,其影响border渲染\n let pbt = paddingTop + borderTopWidth;\n let pbb = paddingBottom + borderBottomWidth;\n // inline的baseline和lineBox的差值\n let diff = lineBox.baseline - baseline;\n // x坐标取首尾contentBox的左右2侧,clip布局时已算好;y是根据lineHeight和lineBox的高度以及baseline对齐后计算的\n let x1 = start.x;\n let dom = start instanceof TextBox ? start.parent.domParent : start.domParent;\n while(dom !== xom) {\n let list = dom.contentBoxList;\n if(start === list[0]) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = dom.computedStyle;\n x1 -= marginLeft + paddingLeft + borderLeftWidth;\n }\n dom = dom.domParent;\n }\n let bx1 = x1;\n if(isStart) {\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n x1 -= paddingLeft;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n x1 -= paddingLeft + borderLeftWidth;\n }\n bx1 -= paddingLeft + borderLeftWidth;\n }\n let y1 = lineBox.y + diff - eyt;\n let by1 = lineBox.y + diff - pbt;\n let x2 = end.x + end.outerWidth;\n // TextBox的parent是Text,再是Dom,这里一定是inline,无嵌套就是xom本身,有则包含若干层最上层还是xom\n dom = end instanceof TextBox ? end.parent.domParent : end.domParent;\n // 从end开始,向上获取dom节点的尾部mpb进行累加,直到xom跳出\n while(dom !== xom) {\n let list = dom.contentBoxList;\n if(end === list[list.length - 1]) {\n let {\n [MARGIN_RIGHT]: marginRight,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } = dom.computedStyle;\n x2 += marginRight + paddingRight + borderRightWidth;\n }\n dom = dom.domParent;\n }\n let bx2 = x2;\n if(isEnd) {\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n x2 += paddingRight;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n x2 += paddingRight + borderRightWidth;\n }\n bx2 += paddingRight + borderRightWidth;\n }\n let y2 = lineBox.y + diff + lineHeight - diffL + eyb;\n let by2 = lineBox.y + diff + lineHeight - diffL + pbb;\n // x要考虑xom的ox值\n x1 += xom.ox;\n x2 += xom.ox;\n bx1 += xom.ox;\n bx2 += xom.ox;\n y1 += xom.oy;\n y2 += xom.oy;\n by1 += xom.oy;\n by2 += xom.oy;\n return [x1, y1, x2, y2, bx1, by1, bx2, by2];\n}\n\n/**\n * 统计inline的所有contentBox排成一行时的总宽度,考虑嵌套的mpb\n * @param xom\n * @param contentBoxList\n * @returns {number}\n */\nfunction getInlineWidth(xom, contentBoxList) {\n let sum = 0;\n let length = contentBoxList.length;\n for(let i = 0; i < length; i++) {\n let contentBox = contentBoxList[i];\n sum += contentBox.width;\n // 嵌套时,首尾box考虑mpb\n let dom = contentBox instanceof TextBox ? contentBox.parent.domParent : contentBox.domParent;\n while(dom !== xom) {\n let list = dom.contentBoxList;\n if(contentBox === list[0]) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = dom.computedStyle;\n sum += marginLeft + paddingLeft + borderLeftWidth;\n }\n if(contentBox === list[list.length - 1]) {\n let {\n [MARGIN_RIGHT]: marginRight,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } = dom.computedStyle;\n sum += marginRight + paddingRight + borderRightWidth;\n }\n dom = dom.domParent;\n }\n }\n return sum;\n}\n\nexport default {\n getInlineBox,\n getInlineWidth,\n};\n","import Node from './Node';\nimport 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;\nconst { LOCAL } = Cache;\n\nconst {\n STYLE_KEY,\n STYLE_RV_KEY,\n style2Upper,\n STYLE_KEY: {\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n PADDING_LEFT,\n PADDING_RIGHT,\n PADDING_TOP,\n PADDING_BOTTOM,\n MARGIN_LEFT,\n MARGIN_TOP,\n MARGIN_BOTTOM,\n MARGIN_RIGHT,\n BORDER_LEFT_WIDTH,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_RIGHT_WIDTH,\n TOP,\n RIGHT,\n BOTTOM,\n LEFT,\n POSITION,\n DISPLAY,\n WIDTH,\n HEIGHT,\n MATRIX,\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n TRANSFORM,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n SKEW_X,\n SKEW_Y,\n PERSPECTIVE,\n PERSPECTIVE_ORIGIN,\n ROTATE_3D,\n TRANSFORM_ORIGIN,\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n BACKGROUND_SIZE,\n BACKGROUND_COLOR,\n BACKGROUND_IMAGE,\n BACKGROUND_REPEAT,\n BOX_SHADOW,\n OPACITY,\n Z_INDEX,\n BORDER_TOP_STYLE,\n BORDER_RIGHT_STYLE,\n BORDER_BOTTOM_STYLE,\n BORDER_LEFT_STYLE,\n FILTER,\n OVERFLOW,\n MIX_BLEND_MODE,\n TEXT_OVERFLOW,\n BORDER_TOP_COLOR,\n BORDER_BOTTOM_COLOR,\n BORDER_LEFT_COLOR,\n BORDER_RIGHT_COLOR,\n FONT_STYLE,\n COLOR,\n VISIBILITY,\n POINTER_EVENTS,\n BORDER_TOP,\n BORDER_RIGHT,\n BORDER_BOTTOM,\n BORDER_LEFT,\n BACKGROUND_CLIP,\n FONT_SIZE,\n FONT_FAMILY,\n LINE_HEIGHT,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_WIDTH,\n TEXT_STROKE_OVER,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_STYLE,\n UPDATE_OVERWRITE,\n UPDATE_KEYS,\n UPDATE_CONFIG,\n UPDATE_REMOVE_DOM,\n },\n STRUCT_KEY: {\n STRUCT_HAS_MASK,\n },\n NODE_KEY: {\n NODE_TAG_NAME,\n NODE_CACHE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_STYLE,\n NODE_STRUCT,\n NODE_OPACITY,\n NODE_MATRIX_EVENT,\n NODE_MATRIX,\n NODE_LIMIT_CACHE,\n NODE_HAS_CONTENT,\n NODE_REFRESH_LV,\n NODE_CACHE,\n NODE_CACHE_TOTAL,\n NODE_CACHE_FILTER,\n NODE_CACHE_MASK,\n NODE_CACHE_OVERFLOW,\n NODE_IS_DESTROYED,\n NODE_DEFS_CACHE,\n NODE_DOM_PARENT,\n NODE_IS_INLINE,\n NODE_PERSPECTIVE_MATRIX,\n NODE_IS_MASK,\n NODE_VIRTUAL_DOM,\n NODE_CACHE_AS_BITMAP,\n }\n} = enums;\nconst { AUTO, PX, PERCENT, INHERIT, NUMBER, REM, VW, VH, VMAX, VMIN, DEG } = unit;\nconst { int2rgba, rgba2int, joinArr, isNil, isFunction } = util;\nconst { calRelative } = css;\nconst { GEOM } = change;\nconst { mbmName, isValidMbm } = mbm;\nconst { point2d } = mx;\n\nconst {\n contain,\n NONE,\n TRANSFORM: TF,\n REFLOW,\n REPAINT,\n TRANSLATE_X: TX,\n TRANSLATE_Y: TY,\n TRANSLATE_Z: TZ,\n} = level;\n\nfunction getFirstEmptyInlineWidth(xom) {\n let n = 0;\n let flowChildren = xom.flowChildren;\n let length = flowChildren.length;\n for(let i = 0; i < length; i++) {\n let child = flowChildren[i];\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.flowChildren.length) {\n n += getFirstEmptyInlineWidth(child);\n break;\n }\n else if(child.__config[NODE_IS_INLINE]) {\n n += child.outerWidth;\n }\n }\n else {\n break;\n }\n }\n return n;\n}\n\nfunction getLastEmptyInlineWidth(xom) {\n let n = 0;\n let flowChildren = xom.flowChildren;\n let length = flowChildren.length;\n for(let i = length - 1; i >= 0; i--) {\n let child = flowChildren[i];\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.flowChildren.length) {\n n += getLastEmptyInlineWidth(child);\n break;\n }\n else {\n n += child.outerWidth;\n }\n }\n else {\n break;\n }\n }\n return n;\n}\n\nclass Xom extends Node {\n constructor(tagName, props = {}) {\n super();\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__tagName = tagName;\n this.__style = this.props.style || {}; // style被解析后的k-v形式\n this.__currentStyle = {}; // 动画过程中绘制一开始会merge动画样式\n this.__computedStyle = {}; // 类似getComputedStyle()将currentStyle计算好数值赋给\n this.__listener = {};\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n this.listener[k] = v;\n }\n });\n this.__animationList = [];\n this.__loadBgi = {\n // 刷新回调函数,用以destroy取消用\n cb: function() {\n },\n };\n this.__cacheStyle = {}; // 是否缓存重新计算computedStyle的样式key\n this.__cacheDefs = []; // svg专用,缓存渲染时使用已有的defs,diff过程用,否则会defs被清空\n let isClip = this.__isClip = !!this.props.clip;\n let isMask = this.__isMask = isClip || !!this.props.mask;\n let config = this.__config;\n config[NODE_TAG_NAME] = tagName;\n config[NODE_CACHE_STYLE] = this.__cacheStyle;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_COMPUTED_STYLE] = this.__computedStyle;\n config[NODE_REFRESH_LV] = REFLOW;\n config[NODE_STYLE] = this.__style;\n config[NODE_MATRIX] = [];\n config[NODE_MATRIX_EVENT] = [];\n config[NODE_DEFS_CACHE] = this.__cacheDefs;\n config[NODE_IS_MASK] = isMask;\n this.__frameAnimateList = [];\n this.__contentBoxList = []; // inline存储内容用\n // this.__json domApi需要获取生成时的json引用,builder过程添加,如appendChild时json也需要跟着变更\n config[NODE_CACHE_AS_BITMAP] = this.__cacheAsBitmap = !!this.props.cacheAsBitmap;\n }\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 else if(mp[1] === VMAX) {\n return mp[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(mp[1] === VMIN) {\n return mp[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return 0;\n }\n\n // dom常用的几种尺寸赋值\n __ioSize(w, h) {\n let computedStyle = this.computedStyle;\n 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 else if(v[1] === VMAX) {\n n += v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n n += v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return n;\n }\n\n // 为basis的b/min/max添加mpb,只有当b未显示指定等于w/content时才加,同时返回mpb值\n __addMp(isDirectionRow, w, currentStyle, res, res2, 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 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 else if(borderLeftWidth[1] === VMAX) {\n mp += borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderLeftWidth[1] === VMIN) {\n mp += borderLeftWidth[0] * Math.min(this.root.width, 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 else if(borderRightWidth[1] === VMAX) {\n mp += borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderRightWidth[1] === VMIN) {\n mp += borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n res2 = res2.map(item => item + mp);\n if(isDirectionRow) {\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 else if(borderTopWidth[1] === VMAX) {\n mp += borderTopWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderTopWidth[1] === VMIN) {\n mp += borderTopWidth[0] * Math.min(this.root.width, 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 else if(borderBottomWidth[1] === VMAX) {\n mp += borderBottomWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderBottomWidth[1] === VMIN) {\n mp += borderBottomWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n res = res.map(item => item + mp);\n }\n return [res, res2];\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 case VMAX:\n w = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n break;\n case VMIN:\n w = width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n break;\n }\n }\n }\n let lineClampCount = 0;\n // 4种布局,默认block,inlineBlock基本可以复用inline逻辑,除了尺寸\n if(display === 'flex') {\n this.__layoutFlex(data, 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 case VMAX:\n w = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n break;\n case VMIN:\n w = width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n break;\n }\n }\n if(h2 !== undefined) {\n fixedHeight = true;\n h = h2;\n }\n else if(h3 !== undefined) {\n // fixedHeight = true;\n // TODO: 暂时解决问题,当column的flex排版时,计算的高度不能视作fixedHeight,另其child的mbp未参与basis计算\n h = h3;\n }\n else if(height[1] !== AUTO) {\n fixedHeight = true;\n switch(height[1]) {\n case PX:\n h = height[0];\n break;\n case PERCENT:\n h *= height[0] * 0.01;\n break;\n case REM:\n h = height[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n h = height[0] * this.root.width * 0.01;\n break;\n case VH:\n h = height[0] * this.root.height * 0.01;\n break;\n case VMAX:\n h = height[0] * Math.max(this.root.width, this.root.height) * 0.01;\n break;\n case VMIN:\n h = height[0] * Math.min(this.root.width, this.root.height) * 0.01;\n break;\n }\n }\n // margin/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.isReplaced) && marginLeft[1] === AUTO && marginRight[1] === AUTO) {\n let ow = this.outerWidth;\n if(ow < data.w) {\n this.__offsetX((data.w - ow) * 0.5, true);\n }\n }\n }\n\n __calMatrix(lv, __cacheStyle, currentStyle, computedStyle, __config, sx1, sy1, offsetWidth, offsetHeight) {\n if(__config[NODE_IS_INLINE]) {\n computedStyle[TRANSFORM_ORIGIN] = [sx1, sy1];\n return __cacheStyle[MATRIX] = mx.identity();\n }\n let matrixCache = __cacheStyle[MATRIX];\n // tx/ty变化特殊优化\n if(matrixCache && lv < REFLOW && !contain(lv, TF)) {\n let x = 0, y = 0, z = 0;\n if(contain(lv, TX)) {\n let v = currentStyle[TRANSLATE_X];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n v = v[0];\n }\n x = v - (computedStyle[TRANSLATE_X] || 0);\n computedStyle[TRANSLATE_X] = v;\n computedStyle[TRANSFORM][12] += x;\n matrixCache[12] += x;\n }\n if(contain(lv, TY)) {\n let v = currentStyle[TRANSLATE_Y];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetHeight * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n v = v[0];\n }\n y = v - (computedStyle[TRANSLATE_Y] || 0);\n computedStyle[TRANSLATE_Y] = v;\n computedStyle[TRANSFORM][13] += y;\n matrixCache[13] += y;\n }\n if(contain(lv, TZ)) {\n let v = currentStyle[TRANSLATE_Z];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n v = v[0];\n }\n z = v - (computedStyle[TRANSLATE_Z] || 0);\n computedStyle[TRANSLATE_Z] = v;\n computedStyle[TRANSFORM][14] += z;\n matrixCache[14] += z;\n }\n __cacheStyle[MATRIX] = matrixCache;\n }\n // 先根据cache计算需要重新计算的computedStyle\n else {\n if(sx1 === undefined) {\n sx1 = this.__sx1;\n sy1 = this.__sy1;\n offsetWidth = this.offsetWidth;\n offsetHeight = this.offsetHeight;\n }\n if(__cacheStyle[TRANSFORM_ORIGIN] === undefined) {\n __cacheStyle[TRANSFORM_ORIGIN] = true;\n matrixCache = null;\n computedStyle[TRANSFORM_ORIGIN] = tf.calOrigin(currentStyle[TRANSFORM_ORIGIN], offsetWidth, offsetHeight, this.root);\n }\n if(__cacheStyle[TRANSFORM] === undefined\n || __cacheStyle[TRANSLATE_X] === undefined\n || __cacheStyle[TRANSLATE_Y] === undefined\n || __cacheStyle[TRANSLATE_Z] === undefined\n || __cacheStyle[ROTATE_X] === undefined\n || __cacheStyle[ROTATE_Y] === undefined\n || __cacheStyle[ROTATE_Z] === undefined\n || __cacheStyle[ROTATE_3D] === undefined\n || __cacheStyle[SCALE_X] === undefined\n || __cacheStyle[SCALE_Y] === undefined\n || __cacheStyle[SCALE_Z] === undefined\n || __cacheStyle[SKEW_X] === undefined\n || __cacheStyle[SKEW_Y] === undefined) {\n __cacheStyle[TRANSFORM]\n = __cacheStyle[TRANSLATE_X]\n = __cacheStyle[TRANSLATE_Y]\n = __cacheStyle[TRANSLATE_Z]\n = __cacheStyle[ROTATE_X]\n = __cacheStyle[ROTATE_Y]\n = __cacheStyle[ROTATE_Z]\n = __cacheStyle[SCALE_X]\n = __cacheStyle[SCALE_Y]\n = __cacheStyle[SCALE_Z]\n = __cacheStyle[SKEW_X]\n = __cacheStyle[SKEW_Y]\n = true;\n matrixCache = null;\n let matrix;\n // transform相对于自身\n if(currentStyle[TRANSFORM]) {\n matrix = tf.calMatrix(currentStyle[TRANSFORM], offsetWidth, offsetHeight, this.root);\n }\n // 没有transform则看是否有扩展的css独立变换属性\n else {\n let temp = [];\n [\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n ROTATE_3D,\n SKEW_X,\n SKEW_Y,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n ].forEach(k => {\n // 删除之前遗留的\n delete computedStyle[k];\n let v = currentStyle[k];\n if(isNil(v)) {\n return;\n }\n if(k === ROTATE_3D) {\n computedStyle[k] = [v[0], v[1], v[2], v[3][0]];\n if(v[3][0] === 0) {\n return;\n }\n temp.push([k, v]);\n return;\n }\n computedStyle[k] = v[0];\n // scale为1和其它为0避免计算浪费\n let isScale = k === SCALE_X || k === SCALE_Y || k === SCALE_Z;\n if(v[0] === 1 && isScale || !isScale && v[0] === 0) {\n return;\n }\n if(v[1] === PERCENT) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * offsetWidth * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * offsetHeight * 0.01;\n }\n }\n else if(v[1] === REM) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n }\n else if(v[1] === VW) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.width * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.width * 0.01;\n }\n }\n else if(v[1] === VH) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.height * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.height * 0.01;\n }\n }\n else if(v[1] === VMAX) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n }\n else if(v[1] === VMIN) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n temp.push([k, v]);\n });\n if(temp.length) {\n matrix = tf.calMatrix(temp, offsetWidth, offsetHeight, this.root);\n }\n }\n computedStyle[TRANSFORM] = matrix || mx.identity();\n }\n if(!matrixCache) {\n let m = computedStyle[TRANSFORM];\n let tfo = computedStyle[TRANSFORM_ORIGIN].slice(0);\n tfo[0] += sx1 || 0;\n tfo[1] += sy1 || 0;\n matrixCache = __cacheStyle[MATRIX] = tf.calMatrixByOrigin(m, tfo);\n }\n }\n return matrixCache;\n }\n\n /**\n * 将currentStyle计算为computedStyle,同时存入cacheStyle可缓存的结果防止无变更重复计算\n * @param renderMode\n * @param ctx\n * @param parent\n * @param __cacheStyle\n * @param currentStyle\n * @param computedStyle\n * @param clientWidth\n * @param clientHeight\n * @param offsetWidth\n * @param offsetHeight\n * @param borderTopWidth\n * @param borderRightWidth\n * @param borderBottomWidth\n * @param borderLeftWidth\n * @param paddingTop\n * @param paddingRight\n * @param paddingBottom\n * @param paddingLeft\n * @param x1\n * @param x2\n * @param x3\n * @param x4\n * @param x5\n * @param x6\n * @param y1\n * @param y2\n * @param y3\n * @param y4\n * @param y5\n * @param y6\n * @returns {*[]}\n * @private\n */\n __calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6) {\n let bx1 = x1, by1 = y1, bx2 = x6, by2 = y6;\n let backgroundClip = computedStyle[BACKGROUND_CLIP] = currentStyle[BACKGROUND_CLIP];\n // 默认border-box\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n bx1 = x2;\n by1 = y2;\n bx2 = x5;\n by2 = y5;\n }\n else if(backgroundClip === 'contentBox' || backgroundClip === 'content-box') {\n bx1 = x3;\n by1 = y3;\n bx2 = x4;\n by2 = y4;\n }\n let isInline = this.__config[NODE_IS_INLINE];\n if(isInline && !this.contentBoxList.length) {\n isInline = false;\n }\n // 这些直接赋值的不需要再算缓存\n [\n OPACITY,\n Z_INDEX,\n BORDER_TOP_STYLE,\n BORDER_RIGHT_STYLE,\n BORDER_BOTTOM_STYLE,\n BORDER_LEFT_STYLE,\n BACKGROUND_REPEAT,\n OVERFLOW,\n MIX_BLEND_MODE,\n TEXT_OVERFLOW,\n BACKGROUND_CLIP,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n if(isNil(__cacheStyle[FILTER])) {\n __cacheStyle[FILTER] = true;\n this.__calFilter(currentStyle, computedStyle);\n }\n if(isNil(__cacheStyle[BACKGROUND_POSITION_X])) {\n __cacheStyle[BACKGROUND_POSITION_X] = true;\n let {\n [BACKGROUND_POSITION_X]: bgX,\n } = currentStyle;\n computedStyle[BACKGROUND_POSITION_X] = (bgX || []).map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n if(item[1] === VMAX) {\n return item[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n if(item[1] === VMIN) {\n return item[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(item[1] === PERCENT) {\n return item[0] + '%';\n }\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_POSITION_Y])) {\n __cacheStyle[BACKGROUND_POSITION_Y] = true;\n let {\n [BACKGROUND_POSITION_Y]: bgY,\n } = currentStyle;\n computedStyle[BACKGROUND_POSITION_Y] = (bgY || []).map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n if(item[1] === VMAX) {\n return item[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n if(item[1] === VMIN) {\n return item[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(item[1] === PERCENT) {\n return item[0] + '%';\n }\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_SIZE])) {\n __cacheStyle[BACKGROUND_SIZE] = true;\n computedStyle[BACKGROUND_SIZE] = (currentStyle[BACKGROUND_SIZE] || []).map(item => {\n return bg.calBackgroundSize(item, bx2 - bx1, by2 - by1, this.root);\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_IMAGE])) {\n let bgI = computedStyle[BACKGROUND_IMAGE] = currentStyle[BACKGROUND_IMAGE].slice(0);\n __cacheStyle[BACKGROUND_IMAGE] = bgI.map((bgi, i) => {\n if(!bgi) {\n return null;\n }\n // 防止隐藏不加载背景图\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i] = this.__loadBgi[i] || {};\n let cache = inject.IMG[BACKGROUND_IMAGE];\n if(cache && cache.state === inject.LOADED) {\n loadBgi.url = BACKGROUND_IMAGE;\n loadBgi.source = cache.source;\n loadBgi.width = cache.width;\n loadBgi.height = cache.height;\n }\n else if(loadBgi.url !== bgi) {\n // 可能改变导致多次加载,每次清空,成功后还要比对url是否相同\n loadBgi.url = bgi;\n loadBgi.source = null;\n let node = this;\n let root = node.root;\n inject.measureImg(bgi, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败不绘制bgi\n if(data.success && data.url === loadBgi.url && !this.isDestroyed) {\n loadBgi.source = data.source;\n loadBgi.width = data.width;\n loadBgi.height = data.height;\n root.delRefreshTask(loadBgi.cb);\n root.addRefreshTask(loadBgi.cb = {\n __before() {\n __cacheStyle[BACKGROUND_IMAGE] = undefined;\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_FOCUS] = REPAINT;\n res[UPDATE_CONFIG] = node.__config;\n root.__addUpdate(node, node.__config, root, root.__config, res);\n },\n });\n }\n }, {\n ctx,\n root,\n width: bx2 - bx1,\n height: by2 - by1,\n });\n }\n return true;\n }\n else if(!isInline && bgi.k) {\n // gradient在渲染时才生成\n return true;\n }\n });\n }\n if(isNil(__cacheStyle[BOX_SHADOW])) {\n __cacheStyle[BOX_SHADOW] = true;\n computedStyle[BOX_SHADOW] = (currentStyle[BOX_SHADOW] || []).map(item => {\n return item.map((item2, i) => {\n if(i > 3) {\n return item2;\n }\n let v = item2[0];\n if(item2[1] === PERCENT) {\n if(i % 2 === 0) {\n v *= 0.01 * (bx2 - bx1);\n }\n else {\n v *= 0.01 * (by2 - by1);\n }\n }\n else if(item2[1] === REM) {\n v = v * this.root.computedStyle[FONT_SIZE];\n }\n else if(item2[1] === VW) {\n v = v * this.root.width * 0.01;\n }\n else if(item2[1] === VH) {\n v = v * this.root.height * 0.01;\n }\n else if(item2[1] === VMAX) {\n v = v * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(item2[1] === VMIN) {\n v = v * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return v;\n });\n });\n }\n [\n BACKGROUND_COLOR,\n BORDER_TOP_COLOR,\n BORDER_RIGHT_COLOR,\n BORDER_BOTTOM_COLOR,\n BORDER_LEFT_COLOR,\n ].forEach(k => {\n if(isNil(__cacheStyle[k])) {\n __cacheStyle[k] = int2rgba(computedStyle[k] = currentStyle[k][0]);\n }\n });\n // 圆角边计算\n if(isNil(__cacheStyle[BORDER_TOP_LEFT_RADIUS])\n || isNil(__cacheStyle[BORDER_TOP_RIGHT_RADIUS])\n || isNil(__cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS])\n || isNil(__cacheStyle[BORDER_BOTTOM_LEFT_RADIUS])) {\n __cacheStyle[BORDER_TOP_LEFT_RADIUS]\n = __cacheStyle[BORDER_TOP_RIGHT_RADIUS]\n = __cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS]\n = __cacheStyle[BORDER_BOTTOM_LEFT_RADIUS]\n = true;\n // 非替代的inline计算看contentBox首尾\n if(isInline) {\n border.calBorderRadiusInline(this.contentBoxList, currentStyle, computedStyle, this.root);\n }\n // 普通block整体计算\n else {\n border.calBorderRadius(offsetWidth, offsetHeight, currentStyle, computedStyle, this.root);\n }\n }\n // width/style/radius影响border,color不影响渲染缓存\n let btlr = computedStyle[BORDER_TOP_LEFT_RADIUS];\n let btrr = computedStyle[BORDER_TOP_RIGHT_RADIUS];\n let bbrr = computedStyle[BORDER_BOTTOM_RIGHT_RADIUS];\n let bblr = computedStyle[BORDER_BOTTOM_LEFT_RADIUS];\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k;\n let k2 = STYLE_KEY[style2Upper(k)];\n let kw = STYLE_KEY[style2Upper(k + 'Width')];\n let ks = STYLE_KEY[style2Upper(k + 'Style')];\n // width/style变更影响border重新计算\n if(isNil(__cacheStyle[kw])) {\n __cacheStyle[kw] = true;\n __cacheStyle[k2] = undefined;\n }\n if(isNil(__cacheStyle[ks])) {\n __cacheStyle[ks] = true;\n __cacheStyle[k2] = undefined;\n }\n if(isNil(__cacheStyle[k2])) {\n if(k2 === BORDER_TOP) {\n if(borderTopWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderTopWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 0, btlr, btrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_RIGHT) {\n if(borderRightWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderRightWidth / borderTopWidth);\n let deg2 = Math.atan(borderRightWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderRightWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 1, btrr, bbrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_BOTTOM) {\n if(borderBottomWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderBottomWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 2, bblr, bbrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_LEFT) {\n if(borderLeftWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderLeftWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 3, btlr, bblr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n }\n });\n // 强制计算继承性的\n let parentComputedStyle = parent && parent.computedStyle;\n if(currentStyle[FONT_STYLE][1] === INHERIT) {\n computedStyle[FONT_STYLE] = parent ? parentComputedStyle[FONT_STYLE] : 'normal';\n }\n else if(isNil(__cacheStyle[FONT_STYLE])) {\n computedStyle[FONT_STYLE] = currentStyle[FONT_STYLE][0];\n }\n __cacheStyle[FONT_STYLE] = computedStyle[FONT_STYLE];\n if(currentStyle[COLOR][1] === INHERIT) {\n computedStyle[COLOR] = parent ? parentComputedStyle[COLOR] : [0, 0, 0, 1];\n __cacheStyle[COLOR] = int2rgba(computedStyle[COLOR]);\n }\n else if(isNil(__cacheStyle[COLOR])) {\n computedStyle[COLOR] = rgba2int(currentStyle[COLOR][0]);\n __cacheStyle[COLOR] = int2rgba(computedStyle[COLOR]);\n }\n if(currentStyle[TEXT_STROKE_COLOR][1] === INHERIT) {\n computedStyle[TEXT_STROKE_COLOR] = parent ? parentComputedStyle[TEXT_STROKE_COLOR] : [0, 0, 0, 1];\n __cacheStyle[TEXT_STROKE_COLOR] = int2rgba(computedStyle[TEXT_STROKE_COLOR]);\n }\n else if(isNil(__cacheStyle[TEXT_STROKE_COLOR])) {\n computedStyle[TEXT_STROKE_COLOR] = rgba2int(currentStyle[TEXT_STROKE_COLOR][0]);\n __cacheStyle[TEXT_STROKE_COLOR] = int2rgba(computedStyle[TEXT_STROKE_COLOR]);\n }\n if(currentStyle[TEXT_STROKE_WIDTH][1] === INHERIT) {\n computedStyle[TEXT_STROKE_WIDTH] = parent ? parentComputedStyle[TEXT_STROKE_WIDTH] : 0;\n __cacheStyle[TEXT_STROKE_WIDTH] = true;\n }\n else if(isNil(__cacheStyle[TEXT_STROKE_WIDTH])) {\n let v = currentStyle[TEXT_STROKE_WIDTH];\n if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n v = v[0];\n }\n computedStyle[TEXT_STROKE_WIDTH] = v;\n __cacheStyle[TEXT_STROKE_WIDTH] = true;\n }\n if(currentStyle[TEXT_STROKE_OVER][1] === INHERIT) {\n __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = parent ? parentComputedStyle[TEXT_STROKE_OVER] : 'none';\n }\n else {\n __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = currentStyle[TEXT_STROKE_OVER][0];\n }\n if(currentStyle[VISIBILITY][1] === INHERIT) {\n computedStyle[VISIBILITY] = parent ? parentComputedStyle[VISIBILITY] : 'visible';\n }\n else if(isNil(__cacheStyle[VISIBILITY])) {\n computedStyle[VISIBILITY] = currentStyle[VISIBILITY][0];\n }\n __cacheStyle[VISIBILITY] = computedStyle[VISIBILITY];\n if(currentStyle[POINTER_EVENTS][1] === INHERIT) {\n computedStyle[POINTER_EVENTS] = parent ? parentComputedStyle[POINTER_EVENTS] : 'auto';\n }\n else if(isNil(__cacheStyle[POINTER_EVENTS])) {\n computedStyle[POINTER_EVENTS] = currentStyle[POINTER_EVENTS][0];\n }\n __cacheStyle[POINTER_EVENTS] = computedStyle[POINTER_EVENTS];\n this.__bx1 = bx1;\n this.__bx2 = bx2;\n this.__by1 = by1;\n this.__by2 = by2;\n return [bx1, by1, bx2, by2];\n }\n\n __calPerspective(__cacheStyle, currentStyle, computedStyle, __config, sx1, sy1) {\n let rebuild;\n if(isNil(__cacheStyle[PERSPECTIVE])) {\n __cacheStyle[PERSPECTIVE] = true;\n rebuild = true;\n let v = currentStyle[PERSPECTIVE];\n let ppt = 0;\n if(v[1] === REM) {\n ppt = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n ppt = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n ppt = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n ppt = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n ppt = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n ppt = v[0];\n }\n computedStyle[PERSPECTIVE] = ppt;\n }\n if(isNil(__cacheStyle[PERSPECTIVE_ORIGIN])) {\n __cacheStyle[PERSPECTIVE_ORIGIN] = true;\n rebuild = true;\n computedStyle[PERSPECTIVE_ORIGIN] = tf.calOrigin(currentStyle[PERSPECTIVE_ORIGIN], this.offsetWidth, this.offsetHeight, this.root);\n }\n if(rebuild) {\n if(sx1 === undefined) {\n sx1 = this.__sx1;\n sy1 = this.__sy1;\n }\n let po = computedStyle[PERSPECTIVE_ORIGIN].slice(0);\n po[0] += sx1 || 0;\n po[1] += sy1 || 0;\n __config[NODE_PERSPECTIVE_MATRIX] = tf.calPerspectiveMatrix(computedStyle[PERSPECTIVE], po);\n }\n }\n\n __calFilter(currentStyle, computedStyle) {\n return computedStyle[FILTER] = (currentStyle[FILTER] || []).map(item => {\n let [k, v] = item;\n // 部分%单位的滤镜强制使用数字\n if(v[1] === PX || v[1] === DEG || v[1] === PERCENT || v[1] === NUMBER) {\n v = v[0];\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return [k, v];\n });\n }\n\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n if(renderMode === CANVAS || renderMode === WEBGL) {\n if(lv < REPAINT) {\n return this.__hasContent;\n }\n let visibility = currentStyle[VISIBILITY];\n if(visibility !== 'hidden') {\n let bgI = currentStyle[BACKGROUND_IMAGE];\n if(Array.isArray(bgI)) {\n for(let i = 0, len = bgI.length; i < len; i++) {\n if(bgI[i]) {\n return true;\n }\n }\n }\n if(currentStyle[BACKGROUND_COLOR][0][3] > 0) {\n let width = computedStyle[WIDTH], height = computedStyle[HEIGHT],\n paddingTop = computedStyle[PADDING_TOP], paddingRight = computedStyle[PADDING_RIGHT],\n paddingBottom = computedStyle[PADDING_BOTTOM], paddingLeft = computedStyle[PADDING_LEFT];\n if(width && height || paddingTop || paddingRight || paddingBottom || paddingLeft) {\n return true;\n }\n }\n for(let list = ['Top', 'Right', 'Bottom', 'Left'], i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n if(computedStyle[STYLE_KEY[style2Upper('border' + k + 'Width')]] > 0\n && currentStyle[STYLE_KEY[style2Upper('border' + k + 'Color')]][0][3] > 0) {\n return true;\n }\n }\n let bs = currentStyle[BOX_SHADOW];\n if(Array.isArray(bs)) {\n for(let i = 0, len = bs.length; i < len; i++) {\n let item = bs[i];\n if(item && (item[2] > 0 || item[3] > 0)) {\n return true;\n }\n }\n }\n }\n }\n return false;\n }\n\n /**\n * 渲染基础方法,Dom/Geom公用\n * @param renderMode\n * @see node/mode\n * @param lv\n * @see refresh/level\n * @param ctx canvas/svg/webgl共用\n * @param cache 是否是局部根节点缓存模式下的绘制\n * @see refresh/Cache.NA\n * @param dx cache时偏移x\n * @param dy cache时偏移y\n * @return Object\n * x1/x2/x3/x4/y1/y2/y3/y4 坐标\n * break svg判断无变化提前跳出\n * cacheError 离屏申请失败,仅canvas\n * offscreenBlend 无cache时的离屏canvas,仅canvas\n * offscreenFilter 无cache时的离屏canvas,仅canvas\n * offscreenOverflow 无cache时的离屏canvas,仅canvas\n * offscreenMask 无cache时的离屏canvas,仅canvas\n */\n render(renderMode, lv, ctx, cache, dx = 0, dy = 0) {\n let {\n isDestroyed,\n root,\n __config,\n } = this;\n let __cache = __config[NODE_CACHE];\n let __cacheStyle = __config[NODE_CACHE_STYLE];\n let currentStyle = __config[NODE_CURRENT_STYLE];\n let computedStyle = __config[NODE_COMPUTED_STYLE];\n // 渲染完认为完全无变更,等布局/动画/更新重置\n __config[NODE_REFRESH_LV] = NONE;\n // >=REPAINT清空bbox\n if(lv >= REPAINT) {\n this.__bbox = null;\n }\n if(isDestroyed) {\n return { isDestroyed, break: true };\n }\n let virtualDom;\n // svg设置vd上的lv属性标明lineHeight的话,另外特殊字体如arial拥有lineGap也会产生间隙,背景色不绘制这个间隙\n * x轴根据contentBox的范围坐标,y则固定和font/lineHeight相关\n * 圆角发生在首尾lineBox处,中间不会有,bgi则产生类似bgc作为mask的效果\n * 另外要注意多个时的顺序,必须依次渲染,后面的bb可能会覆盖前面行的\n */\n if(isRealInline) {\n let contentBoxList = this.contentBoxList;\n let length = contentBoxList.length;\n let hasBgi = backgroundImage.some(item => item);\n if(length) {\n let {\n [FONT_SIZE]: fontSize,\n [FONT_FAMILY]: fontFamily,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let iw = 0, ih = 0;\n let offscreen, svgBgSymbol = [];\n // bgi视作inline排满一行绘制,然后按分行拆开给每行\n if(hasBgi) {\n iw = inline.getInlineWidth(this, contentBoxList);\n ih = lineHeight;\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n iw += paddingLeft + paddingRight;\n ih += paddingTop + paddingBottom;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n iw += paddingLeft + paddingRight + borderLeftWidth + borderRightWidth;\n ih += paddingTop + paddingBottom + borderTopWidth + borderBottomWidth;\n }\n if(renderMode === CANVAS || renderMode === WEBGL) {\n offscreen = inject.getCacheCanvas(iw, ih, '__$$INLINE_BGI$$__');\n }\n let length = backgroundImage.length;\n backgroundImage.slice(0).reverse().forEach((bgi, i) => {\n if(!bgi) {\n return;\n }\n i = length - 1 - i;\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i];\n if(loadBgi.url === backgroundImage[i]) {\n let uuid = bg.renderImage(this, renderMode, offscreen && offscreen.ctx || ctx, loadBgi,\n 0, 0, iw, ih, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, true, dx, dy);\n if(renderMode === SVG && uuid) {\n svgBgSymbol.push(uuid);\n }\n }\n }\n else if(bgi.k) {\n let gd = this.__gradient(renderMode, ctx, 0, 0, iw, ih, bgi, dx, dy);\n if(gd) {\n if(gd.k === 'conic') {\n let uuid = gradient.renderConic(this, renderMode, offscreen && offscreen.ctx || ctx, gd.v, 0, 0, iw, lineHeight,\n btlr, btrr, bbrr, bblr, true);\n if(renderMode === SVG && uuid) {\n svgBgSymbol.push(uuid);\n }\n }\n else {\n let uuid = bg.renderBgc(this, renderMode, offscreen && offscreen.ctx || ctx, gd.v, null,\n 0, 0, iw, ih, btlr, btrr, bbrr, bblr, 'fill', true);\n if(renderMode === SVG && uuid) {\n svgBgSymbol.push(uuid);\n }\n }\n }\n }\n });\n }\n // 获取当前dom的baseline,再减去lineBox的baseline得出差值,这样渲染范围y就是lineBox的y+差值为起始,lineHeight为高\n let ff = css.getFontFamily(fontFamily);\n let baseline = css.getBaseline(computedStyle);\n // lineGap,一般为0,某些字体如arial有,渲染高度需减去它,最终是lineHeight - diffL\n let diffL = fontSize * (font.info[ff].lgr || 0);\n // 注意只有1个的时候特殊情况,圆角只在首尾行出现\n let isFirst = true;\n let lastContentBox = contentBoxList[0], lastLineBox = lastContentBox.parentLineBox;\n // bgi需统计宽度累计值,将当前行所处理想单行的x范围位置计算出来,并进行bgi贴图绘制,svg还需统计第几行\n let count = 0, countW = 0;\n for(let i = 0; i < length; i++) {\n let contentBox = contentBoxList[i];\n if(contentBox.parentLineBox !== lastLineBox) {\n // 上一行\n let [ix1, iy1, ix2, iy2, bx1, by1, bx2, by2] = inline.getInlineBox(this, contentBoxList,\n lastContentBox, contentBoxList[i - 1], lastLineBox, baseline, lineHeight, diffL, isFirst, false,\n backgroundClip, paddingTop, paddingRight, paddingBottom, paddingLeft,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth);\n // 要算上开头空白inline,可能有多个和递归嵌套\n if(isFirst) {\n let n = getFirstEmptyInlineWidth(this);\n ix1 -= n;\n bx1 -= n;\n }\n if(backgroundColor[3] > 0) {\n bg.renderBgc(this, renderMode, ctx, __cacheStyle[BACKGROUND_COLOR], null,\n ix1, iy1, ix2 - ix1, iy2 - iy1, btlr, [0, 0], [0, 0], bblr, 'fill', false, dx, dy);\n }\n let w = ix2 - ix1;\n // canvas的bg位图裁剪\n if((renderMode === CANVAS || renderMode === WEBGL) && offscreen) {\n ctx.drawImage(offscreen.canvas, countW, 0, w, ih, ix1 + dx, iy1 + dy, w, ih);\n }\n //svg则特殊判断\n else if(renderMode === SVG && svgBgSymbol.length) {\n svgBgSymbol.forEach(symbol => {\n if(symbol) {\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n tagName: 'path',\n props: [\n ['d', `M${countW},${0}L${w+countW},${0}L${w+countW},${ih}L${countW},${ih},L${countW},${0}`],\n ],\n }\n ],\n };\n let clip = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.bb.push({\n type: 'item',\n tagName: 'use',\n props: [\n ['xlink:href', '#' + symbol],\n ['x', ix1 - countW],\n ['y', iy1],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n });\n }\n countW += w;\n if(boxShadow) {\n boxShadow.forEach(item => {\n bs.renderBoxShadow(this, renderMode, ctx, item, bx1, by1, bx2, by2, bx2 - bx1, by2 - by1, dx, dy);\n });\n }\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n let list = border.calPoints(borderTopWidth, computedStyle[BORDER_TOP_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 0, isFirst ? btlr : [0, 0], [0, 0]);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_TOP_COLOR], dx, dy);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n let list = border.calPoints(borderBottomWidth, computedStyle[BORDER_BOTTOM_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 2, isFirst ? btlr : [0, 0], [0, 0]);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_BOTTOM_COLOR], dx, dy);\n }\n if(isFirst && borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n let list = border.calPoints(borderLeftWidth, computedStyle[BORDER_LEFT_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 3, btlr, btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_LEFT_COLOR], dx, dy);\n }\n isFirst = false;\n lastContentBox = contentBox;\n lastLineBox = contentBox.parentLineBox;\n count++;\n }\n // 最后一个特殊判断\n if(i === length - 1) {\n let [ix1, iy1, ix2, iy2, bx1, by1, bx2, by2] = inline.getInlineBox(this, contentBoxList,\n lastContentBox, contentBoxList[i], lastLineBox, baseline, lineHeight, diffL, isFirst, true,\n backgroundClip, paddingTop, paddingRight, paddingBottom, paddingLeft,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth);\n // 要算上开头空白inline,可能有多个和递归嵌套\n if(isFirst) {\n let n = getFirstEmptyInlineWidth(this);\n ix1 -= n;\n bx1 -= n;\n }\n // 要算上末尾空白inline,可能有多个和递归嵌套\n let n = getLastEmptyInlineWidth(this);\n ix2 += n;\n bx2 += n;\n if(backgroundColor[3] > 0) {\n bg.renderBgc(this, renderMode, ctx, __cacheStyle[BACKGROUND_COLOR], null,\n ix1, iy1, ix2 - ix1, iy2 - iy1, isFirst ? btlr : [0, 0], btrr, bbrr, isFirst ? bblr : [0, 0],\n 'fill', false, dx, dy);\n }\n let w = ix2 - ix1;\n // canvas的bg位图裁剪\n if((renderMode === CANVAS || renderMode === WEBGL) && offscreen) {\n ctx.drawImage(offscreen.canvas, countW, 0, w, ih, ix1 + dx, iy1 + dy, w, ih);\n }\n //svg则特殊判断\n else if(renderMode === SVG && svgBgSymbol.length) {\n svgBgSymbol.forEach(symbol => {\n if(symbol) {\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n tagName: 'path',\n props: [\n ['d', `M${countW},${0}L${w+countW},${0}L${w+countW},${ih}L${countW},${ih},L${countW},${0}`],\n ],\n }\n ],\n };\n let clip = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.bb.push({\n type: 'item',\n tagName: 'use',\n props: [\n ['xlink:href', '#' + symbol],\n ['x', ix1 - countW],\n ['y', iy1],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n });\n }\n if(boxShadow) {\n boxShadow.forEach(item => {\n bs.renderBoxShadow(this, renderMode, ctx, item, bx1, by1, bx2, by2, bx2 - bx1, by2 - by1, dx, dy);\n });\n }\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n let list = border.calPoints(borderTopWidth, computedStyle[BORDER_TOP_STYLE], deg1, deg2,\n bx1, bx1, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 0, isFirst ? btlr : [0, 0], btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_TOP_COLOR], dx, dy);\n }\n if(borderRightWidth > 0 && borderRightColor[3] > 0) {\n let deg1 = Math.atan(borderRightWidth / borderTopWidth);\n let deg2 = Math.atan(borderRightWidth / borderBottomWidth);\n let list = border.calPoints(borderRightWidth, computedStyle[BORDER_RIGHT_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 1, btlr, btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_RIGHT_COLOR], dx, dy);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n let list = border.calPoints(borderBottomWidth, computedStyle[BORDER_BOTTOM_STYLE], deg1, deg2,\n bx1, bx1, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 2, isFirst ? btlr : [0, 0], btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_BOTTOM_COLOR], dx, dy);\n }\n if(isFirst && borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n let list = border.calPoints(borderLeftWidth, computedStyle[BORDER_LEFT_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 3, btlr, btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_LEFT_COLOR], dx, dy);\n }\n }\n }\n if(offscreen) {\n offscreen.ctx.clearRect(0, 0, iw, ih);\n }\n return res;\n }\n // 无内容且无尺寸的无需渲染\n else if(bx1 === bx2 || by1 === by2) {\n return res;\n }\n }\n // block渲染,bgc垫底\n if(backgroundColor[3] > 0) {\n bg.renderBgc(this, renderMode, ctx, __cacheStyle[BACKGROUND_COLOR], borderList,\n bx1, by1, bx2 - bx1, by2 - by1, btlr, btrr, bbrr, bblr, 'fill', false, dx, dy);\n }\n // 渐变或图片叠加\n if(backgroundImage) {\n let length = backgroundImage.length;\n backgroundImage.slice(0).reverse().forEach((bgi, i) => {\n if(!bgi) {\n return;\n }\n i = length - 1 - i;\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i];\n if(loadBgi.url === backgroundImage[i]) {\n bg.renderImage(this, renderMode, ctx, loadBgi,\n bx1, by1, bx2, by2, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, false, dx, dy);\n }\n }\n else if(bgi.k) {\n let gd = this.__gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi, dx, dy);\n if(gd) {\n if(gd.k === 'conic') {\n gradient.renderConic(this, renderMode, ctx, gd.v, bx1, by1, bx2 - bx1, by2 - by1,\n btlr, btrr, bbrr, bblr);\n }\n else {\n bg.renderBgc(this, renderMode, ctx, gd.v, borderList,\n bx1, by1, bx2 - bx1, by2 - by1, btlr, btrr, bbrr, bblr, 'fill', false, dx, dy);\n }\n }\n }\n });\n }\n // boxShadow可能会有多个\n if(boxShadow) {\n boxShadow.forEach(item => {\n bs.renderBoxShadow(this, renderMode, ctx, item, x1, y1, x6, y6, x6 - x1, y6 - y1, dx, dy);\n });\n }\n // 边框需考虑尖角,两条相交边平分45°夹角\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_TOP], __cacheStyle[BORDER_TOP_COLOR], dx, dy);\n }\n if(borderRightWidth > 0 && borderRightColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_RIGHT], __cacheStyle[BORDER_RIGHT_COLOR], dx, dy);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_BOTTOM], __cacheStyle[BORDER_BOTTOM_COLOR], dx, dy);\n }\n if(borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_LEFT], __cacheStyle[BORDER_LEFT_COLOR], dx, dy);\n }\n return res;\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n super.__destroy();\n let { root } = this;\n this.clearAnimate();\n this.clearFrameAnimate();\n // root在没有初始化到真实dom渲染的情况下没有\n root && root.delRefreshTask(this.__loadBgi.cb);\n root && root.delRefreshTask(this.__task);\n this.__task = null;\n this.__root = null;\n this.clearCache();\n }\n\n // 先查找到注册了事件的节点,再捕获冒泡判断增加性能\n __emitEvent(e, force) {\n let { isDestroyed, computedStyle, isMask } = this;\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || e.__stopPropagation || isMask) {\n return;\n }\n let { event: { type } } = e;\n let { listener, __hasMask } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // touchmove之类强制的直接由Root通知即可\n if(force) {\n if(computedStyle[POINTER_EVENTS] !== 'none' && isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n // 非force的判断事件坐标是否在节点内\n if(this.willResponseEvent(e)) {\n // 如果有mask,点在mask上才行,点在clip外才行\n if(__hasMask) {\n let next = this.next;\n let isClip = next.isClip;\n let hasEmitMask;\n while(next && next.isMask) {\n if(next.willResponseEvent(e, true)) {\n hasEmitMask = true;\n break;\n }\n next = next.next;\n }\n if(!isClip && !hasEmitMask) {\n return;\n }\n }\n if(isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n\n willResponseEvent(e, ignore) {\n let { x, y } = e;\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent, computedStyle } = this;\n if(computedStyle[POINTER_EVENTS] === 'none') {\n return;\n }\n let inThis = geom.pointInQuadrilateral(\n x, y,\n __sx1, __sy1,\n __sx1 + offsetWidth, __sy1,\n __sx1 + offsetWidth, __sy1 + offsetHeight,\n __sx1, __sy1 + offsetHeight,\n matrixEvent\n );\n if(inThis) {\n if(!e.target && !ignore) {\n e.target = this;\n // 缓存target给move用\n if(e.event.type === 'touchstart') {\n this.root && (this.root.__touchstartTarget = this);\n }\n }\n return true;\n }\n }\n\n __gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi, dx = 0, dy = 0) {\n let iw = bx2 - bx1;\n let ih = by2 - by1;\n // 无尺寸无需创建渐变\n if(!iw || !ih) {\n return;\n }\n let { k, v, d, s, z, p } = bgi;\n let cx = bx1 + iw * 0.5;\n let cy = by1 + ih * 0.5;\n let res = { k };\n if(k === 'linear') {\n let gd = gradient.getLinear(v, d, bx1, by1, cx, cy, iw, ih, this.root, dx, dy);\n res.v = this.__getLg(renderMode, ctx, gd);\n }\n else if(k === 'radial') {\n let gd = gradient.getRadial(v, s, z, p, bx1, by1, bx2, by2, this.root, dx, dy);\n if(gd) {\n res.v = this.__getRg(renderMode, ctx, gd)\n if(gd.matrix) {\n res.v = [res.v, gd.matrix, gd.cx, gd.cy];\n }\n }\n }\n else if(k === 'conic') {\n let bbox = this.bbox;\n let m1 = Math.max(Math.abs(bbox[2] - bbox[0]), Math.abs(bbox[3] - bbox[1]));\n let m2 = Math.max(Math.abs(iw), Math.abs(ih));\n let gd = gradient.getConic(v, d, p, bx1, by1, bx2, by2, m1 / m2, this.root, dx, dy);\n res.v = this.__getCg(renderMode, ctx, gd);\n }\n return res;\n }\n\n __getLg(renderMode, ctx, gd) {\n if(renderMode === CANVAS || renderMode === WEBGL) {\n let lg = ctx.createLinearGradient(gd.x1, gd.y1, gd.x2, gd.y2);\n gd.stop.forEach(item => {\n lg.addColorStop(item[1], int2rgba(item[0]));\n });\n return lg;\n }\n else if(renderMode === SVG) {\n let v = {\n tagName: 'linearGradient',\n props: [\n ['x1', gd.x1],\n ['y1', gd.y1],\n ['x2', gd.x2],\n ['y2', gd.y2],\n ],\n children: gd.stop.map(item => {\n return {\n tagName: 'stop',\n props: [\n ['stop-color', int2rgba(item[0])],\n ['offset', item[1] * 100 + '%'],\n ],\n };\n }),\n };\n let uuid = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n return 'url(#' + uuid + ')';\n }\n }\n\n __getRg(renderMode, ctx, gd) {\n if(renderMode === CANVAS || renderMode === WEBGL) {\n let rg = ctx.createRadialGradient(gd.cx, gd.cy, 0, gd.tx, gd.ty, gd.r);\n gd.stop.forEach(item => {\n rg.addColorStop(item[1], int2rgba(item[0]));\n });\n return rg;\n }\n else if(renderMode === SVG) {\n let v = {\n tagName: 'radialGradient',\n props: [\n ['cx', gd.tx],\n ['cy', gd.ty],\n ['r', gd.r],\n ],\n children: gd.stop.map(item => {\n return {\n tagName: 'stop',\n props: [\n ['stop-color', int2rgba(item[0])],\n ['offset', item[1] * 100 + '%'],\n ],\n };\n }),\n };\n if(gd.tx !== gd.cx) {\n v.props.push(['fx', gd.cx]);\n }\n if(gd.ty !== gd.cy) {\n v.props.push(['fy', gd.cy]);\n }\n let uuid = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n return 'url(#' + uuid + ')';\n }\n }\n\n __getCg(renderMode, ctx, gd) {\n let { cx, cy, r, deg, stop } = gd;\n let len = stop.length - 1;\n if(stop[len][1] < 1) {\n stop.push([stop[len][0].slice(0), 1]);\n }\n if(stop[0][1] > 0) {\n stop.unshift([stop[0][0].slice(0), 0]);\n }\n // canvas采用点色值计算法,svg则分360度画块\n let res = [];\n if(renderMode === CANVAS || renderMode === WEBGL) {\n return gd;\n }\n else if(renderMode === SVG) {\n let offset = 0.5;\n let prev;\n // 根据2个stop之间的百分比得角度差划分块数,每0.5°一块,不足也算\n let list = [];\n for(let i = 0, len = stop.length; i < len - 1; i++) {\n let begin = stop[i][1] * 360;\n let end = stop[i + 1][1] * 360;\n let diff = end - begin;\n let n = Math.ceil(diff);\n let per = diff / n;\n // 计算每块的2个弧端点\n let bc = stop[i][0];\n let ec = stop[i + 1][0];\n let dc = [ec[0] - bc[0], ec[1] - bc[1], ec[2] - bc[2], ec[3] - bc[3]];\n let pc = [dc[0] / n, dc[1] / n, dc[2] / n, dc[3] / n];\n for(let j = 0; j < n; j++) {\n let [x1, y1] = geom.pointOnCircle(cx, cy, r, begin + per * j + deg - offset);\n let [x2, y2] = geom.pointOnCircle(cx, cy, r, begin + per * j + deg + offset);\n list.push([\n x1, y1,\n x2, y2,\n Math.round(bc[0] + pc[0] * j),\n Math.round(bc[1] + pc[1] * j),\n Math.round(bc[2] + pc[2] * j),\n Math.round(bc[3] + pc[3] * j),\n ]);\n }\n }\n // 最后一段补自己末尾颜色特殊处理\n let end = list[0].slice(0);\n let [x2, y2] = geom.pointOnCircle(cx, cy, r, deg);\n end[2] = x2;\n end[3] = y2;\n let s = stop[stop.length - 1][0];\n end[4] = s[0];\n end[5] = s[1];\n end[6] = s[2];\n end[7] = s[3];\n list.push(end);\n for(let i = 0, len = list.length; i < len; i++) {\n let cur = list[i];\n if(prev) {\n let v = {\n tagName: 'linearGradient',\n props: [\n ['x1', prev[0]],\n ['y1', prev[1]],\n ['x2', cur[2]],\n ['y2', cur[3]],\n ],\n children: [\n {\n tagName: 'stop',\n props: [\n ['stop-color', int2rgba([prev[4], prev[5], prev[6], prev[7]])],\n ['offset', '0%'],\n ],\n },\n {\n tagName: 'stop',\n props: [\n ['stop-color', int2rgba([cur[4], cur[5], cur[6], cur[7]])],\n ['offset', '100%'],\n ],\n },\n ],\n };\n let uuid = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n res.push([[[cx, cy], [prev[0], prev[1]], [cur[2], cur[3]]], 'url(#' + uuid + ')']);\n }\n prev = cur;\n }\n }\n return res;\n }\n\n // canvas清空自身cache,cacheTotal在Root的自底向上逻辑做,svg仅有cacheTotal\n clearCache(onlyTotal) {\n let __config = this.__config;\n let __cacheTotal = __config[NODE_CACHE_TOTAL];\n let __cacheFilter = __config[NODE_CACHE_FILTER];\n let __cacheMask = __config[NODE_CACHE_MASK];\n let __cacheOverflow = __config[NODE_CACHE_OVERFLOW];\n if(!onlyTotal) {\n __config[NODE_CACHE_STYLE] = this.__cacheStyle = {};\n let __cache = __config[NODE_CACHE];\n if(__cache) {\n __cache.release();\n }\n }\n if(__cacheTotal) {\n __cacheTotal.release();\n }\n if(__cacheFilter) {\n __cacheFilter.release();\n }\n if(__cacheMask) {\n __cacheMask.release();\n }\n if(__cacheOverflow) {\n __cacheOverflow.release();\n }\n }\n\n updateStyle(style, cb) {\n let node = this;\n let { root, __config } = node;\n let formatStyle = css.normalize(style);\n // 有root说明被添加渲染过了\n if(root) {\n root.addRefreshTask(node.__task = {\n __before() {\n node.__task = null;\n if(__config[NODE_IS_DESTROYED]) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = formatStyle;\n res[UPDATE_OVERWRITE] = style; // 标识盖原有style样式不仅仅是修改currentStyle,不同于animate\n res[UPDATE_KEYS] = Object.keys(formatStyle).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n res[UPDATE_CONFIG] = __config;\n root.__addUpdate(node, __config, root, root.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, formatStyle);\n if(isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n // 传入格式化好key/value的样式\n updateFormatStyle(style, cb) {\n let node = this;\n let { root, __config } = node;\n if(root) {\n root.addRefreshTask(node.__task = {\n __before() {\n node.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(__config[NODE_IS_DESTROYED]) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n res[UPDATE_CONFIG] = __config;\n root.__addUpdate(node, __config, root, root.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, style);\n if(isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n animate(list, options = {}) {\n let animation = new Animation(this, list, options);\n if(this.isDestroyed) {\n animation.__destroy(true);\n return animation;\n }\n this.animationList.push(animation);\n if(options.autoPlay === false) {\n return animation;\n }\n return animation.play();\n }\n\n removeAnimate(o) {\n if(o instanceof Animation) {\n let i = this.animationList.indexOf(o);\n if(i > -1) {\n o.cancel();\n o.__destroy();\n this.animationList.splice(i, 1);\n }\n }\n }\n\n clearAnimate() {\n this.animationList.splice(0).forEach(o => {\n o.cancel();\n o.__destroy();\n });\n }\n\n frameAnimate(cb) {\n if(isFunction(cb)) {\n let list = this.__frameAnimateList;\n // 防止重复\n for(let i = 0, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n return cb;\n }\n }\n let enter = {\n __after(diff) {\n cb(diff);\n },\n __karasFramecb: cb,\n };\n list.push(enter);\n frame.onFrame(enter);\n return cb;\n }\n }\n\n removeFrameAnimate(cb) {\n for(let i = 0, list = this.__frameAnimateList, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n list.splice(i, 1);\n frame.offFrame(cb);\n return;\n }\n }\n }\n\n clearFrameAnimate() {\n this.__frameAnimateList.splice(0).forEach(o => {\n frame.offFrame(o);\n });\n }\n\n __computeMeasure(renderMode, ctx, cb) {\n css.computeMeasure(this);\n if(isFunction(cb)) {\n cb(this);\n }\n }\n\n __deepScan(cb, options) {\n return cb(this, options);\n }\n\n // isLayout为false时,为relative/margin/flex/vertical等\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.__layoutData.x += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sx1 += diff;\n this.__sx2 += diff;\n this.__sx3 += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.__layoutData.y += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sy1 += diff;\n this.__sy2 += diff;\n this.__sy3 += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n }\n\n __resizeX(diff, lv) {\n this.computedStyle.width = this.__width += diff;\n this.__clientWidth += diff;\n this.__offsetWidth += diff;\n this.__outerWidth += diff;\n this.__layoutData.w += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __resizeY(diff, lv) {\n this.computedStyle.height = this.__height += diff;\n this.__clientHeight += diff;\n this.__offsetHeight += diff;\n this.__outerHeight += diff;\n this.__layoutData.h += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __spreadBbox(boxShadow, filter) {\n let x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n let xl = [], yt = [], xr = [], yb = [];\n if(Array.isArray(boxShadow)) {\n boxShadow.forEach(item => {\n let [x, y, sigma, spread, , inset] = item;\n x1 = x2 = x;\n y1 = y2 = y;\n if(inset !== 'inset') {\n let d = blur.outerSize(sigma);\n d += spread;\n xl.push(x - d);\n xr.push(x + d);\n yt.push(y - d);\n yb.push(y + d);\n }\n });\n }\n if(Array.isArray(filter)) {\n filter.forEach(item => {\n let [k, v] = item;\n let sigma = v[0];\n if(k === 'blur' && sigma > 0) {\n let d = blur.kernelSize(sigma);\n let spread = blur.outerSizeByD(d);\n if(spread) {\n xl.push(-spread);\n xr.push(spread);\n yt.push(-spread);\n yb.push(spread);\n }\n }\n });\n }\n xl.forEach(n => x1 = Math.min(x1, n));\n xr.forEach(n => x2 = Math.max(x2, n));\n yt.forEach(n => y1 = Math.min(y1, n));\n yb.forEach(n => y2 = Math.max(y2, n));\n return [x1, y1, x2, y2];\n }\n\n __releaseWhenEmpty(__cache) {\n if(__cache && __cache.available) {\n __cache.release();\n }\n return true;\n }\n\n getComputedStyle(key) {\n let computedStyle = this.computedStyle;\n let res = {};\n let keys;\n if(key) {\n if(Array.isArray(key)) {\n keys = key;\n }\n else {\n keys = [key];\n }\n keys = keys.map(s => {\n return STYLE_KEY[style2Upper(s)];\n });\n }\n else {\n keys = Object.keys(computedStyle);\n }\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n res[k] = computedStyle[k];\n }\n else {\n res[STYLE_RV_KEY[k]] = computedStyle[k];\n }\n });\n return res;\n }\n\n getBoundingClientRect(includeBbox) {\n let box = [];\n if(includeBbox) {\n box = this.bbox;\n }\n else {\n let { __sx1, __sy1, offsetWidth, offsetHeight } = this;\n box = [__sx1, __sy1, __sx1 + offsetWidth, __sy1 + offsetHeight];\n }\n let matrixEvent = this.matrixEvent;\n let p1 = point2d(mx.calPoint([box[0], box[1]], matrixEvent));\n let p2 = point2d(mx.calPoint([box[2], box[1]], matrixEvent));\n let p3 = point2d(mx.calPoint([box[2], box[3]], matrixEvent));\n let p4 = point2d(mx.calPoint([box[0], box[3]], matrixEvent));\n return {\n left: Math.min(p1[0], Math.min(p2[0], Math.min(p3[0], p4[0]))),\n top: Math.min(p1[1], Math.min(p2[1], Math.min(p3[1], p4[1]))),\n right: Math.max(p1[0], Math.max(p2[0], Math.max(p3[0], p4[0]))),\n bottom: Math.max(p1[1], Math.max(p2[1], Math.max(p3[1], p4[1]))),\n points: [p1, p2, p3, p4],\n };\n }\n\n // img和geom返回false,在inline布局时判断是否是真的inline\n __isRealInline() {\n return true;\n }\n\n remove(cb) {\n let self = this;\n if(self.isDestroyed) {\n inject.warn('Remove target is destroyed.');\n if(isFunction(cb)) {\n cb();\n }\n return;\n }\n let { root, domParent } = self;\n let target = self.isShadowRoot ? self.hostRoot : self;\n // 特殊情况连续append/remove时候,还未被添加进来找不到所以无需删除\n if(domParent.children.indexOf(target) === -1) {\n if(isFunction(cb)) {\n cb();\n }\n return;\n }\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n let pJson = domParent.__json;\n let i = pJson.children.indexOf(self.isShadowRoot ? self.hostRoot.__json : self.__json);\n let zChildren = domParent.zIndexChildren;\n let j = zChildren.indexOf(self.isShadowRoot ? self.hostRoot : self);\n if(i === -1 || j === -1) {\n throw new Error('Remove index Exception.')\n }\n pJson.children.splice(i, 1);\n domParent.children.splice(i, 1);\n zChildren.splice(j, 1);\n if(self.__prev) {\n self.__prev.__next = self.__next;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = REFLOW;\n res[UPDATE_REMOVE_DOM] = true;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after(diff) {\n self.isShadowRoot ? self.hostRoot.__destroy() : self.__destroy();\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get sx() {\n return this.__sx;\n }\n\n get sy() {\n return this.__sy;\n }\n\n get clientWidth() {\n return this.__clientWidth || 0;\n }\n\n get clientHeight() {\n return this.__clientHeight || 0;\n }\n\n get offsetWidth() {\n return this.__offsetWidth || 0;\n }\n\n get offsetHeight() {\n return this.__offsetHeight || 0;\n }\n\n get outerWidth() {\n return this.__outerWidth || 0;\n }\n\n get outerHeight() {\n return this.__outerHeight || 0;\n }\n\n // 不考虑margin的范围,>=REPAINT渲染或个别有影响的渲染改变(如blur)清空缓存\n get bbox() {\n if(!this.__bbox) {\n let {\n __sx1, __sy1, offsetWidth, offsetHeight,\n currentStyle: {\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n },\n } = this;\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n this.__bbox = [__sx1 + x1, __sy1 + y1, __sx1 + offsetWidth + x2, __sy1 + offsetHeight + y2];\n }\n return this.__bbox;\n }\n\n get listener() {\n return this.__listener;\n }\n\n get matrix() {\n return this.__config[NODE_MATRIX];\n }\n\n get matrixEvent() {\n return this.__config[NODE_MATRIX_EVENT];\n }\n\n get perspectiveMatrix() {\n return this.__config[NODE_PERSPECTIVE_MATRIX];\n }\n\n get style() {\n return this.__style;\n }\n\n get computedStyle() {\n return this.__computedStyle;\n }\n\n get animationList() {\n return this.__animationList;\n }\n\n get currentStyle() {\n return this.__currentStyle;\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get contentBoxList() {\n return this.__contentBoxList;\n }\n\n get baseline() {\n return this.offsetHeight;\n }\n\n get firstBaseline() {\n return this.offsetHeight;\n }\n\n get isMask() {\n return this.__isMask;\n }\n\n get isClip() {\n return this.__isClip;\n }\n\n get cacheAsBitmap() {\n return this.__cacheAsBitmap;\n }\n\n set cacheAsBitmap(v) {\n this.__config[NODE_CACHE_AS_BITMAP] = this.__cacheAsBitmap = !!v;\n }\n}\n\nexport default Xom;\n","import enums from '../util/enums';\nimport TextBox from './TextBox';\n\nconst { STYLE_KEY: {\n DISPLAY,\n MARGIN_LEFT,\n BORDER_LEFT_WIDTH,\n PADDING_LEFT,\n PADDING_RIGHT,\n BORDER_RIGHT_WIDTH,\n MARGIN_RIGHT,\n} } = enums;\n\n/**\n * css中常见的概念,一行内容,里面可能有若干不同的内容,仅在布局阶段出现,不参与渲染逻辑\n * 本类是个抽象逻辑概念,会包含Text的内容TextBox和inlineBlock等节点,而内容TextBox则属于Text\n * 一个Text可能因为换行产生多个TextBox,从而形成不同行的内容就属于不同的LineBox\n * 本类属于block(包含flex和inlineBlock,下同)节点下,一个dom会有个专门列表,\n * 包含若干个LineBox保存着若干行文本内容TextBox,不直接关联Text,\n * inline则不会有此对象和列表,其复用最近block父层的,这样解决嵌套问题,\n * block在布局时将列表向孩子传递下去,每遇到block会重新生成\n * 每当发生换行时,专门列表中会新生成一个LineBox,让后续内容继续跟随新的LB\n * LB内部要进行垂直对齐,Text内容较简单x字符底部为baseline,inlineBlock等节点按最后一行baseline\n */\nclass LineBox {\n constructor(x, y, lineHeight, baseline) {\n this.__list = [];\n this.__x = x;\n this.__y = y;\n this.__lineHeight = lineHeight; // 可能出现空的inline,因此一个inline进入布局时先设置当前lineBox的最小lineHeight/baseline\n this.__baseline = baseline;\n }\n\n add(item) {\n this.list.push(item);\n item.__parentLineBox = this;\n }\n\n verticalAlign() {\n let baseline = this.baseline;\n let lineHeight = this.lineHeight;\n let increasedHeight = lineHeight;\n let hasReplaced;\n // 只有1个也需要对齐,因为可能内嵌了空inline使得baseline发生变化\n if(this.list.length) {\n this.list.forEach(item => {\n if(item.isReplaced) {\n hasReplaced = true;\n }\n let n = item.baseline;\n if(n !== baseline) {\n let d = baseline - n;\n item.__offsetY(d);\n // text的话对齐下移可能影响整体高度,在同行有img这样的替换元素下,需记录最大偏移导致的高度\n // 比如一个字符和img,字符下调y即字符的baseline和图片底部对齐,导致高度增加lineHeight和baseline的差值\n if(d > 0) {\n increasedHeight = Math.max(increasedHeight, item.height + d);\n }\n }\n });\n }\n let diff = 0;\n // 特殊情况,只有1个img这样的替换元素时,或者只有img没有直接text时,也要进行检查,\n // 因为此时img要参与这一行和baseline的对齐扩充\n if(hasReplaced) {\n diff = this.__lineHeight - this.__baseline;\n }\n // 增加过的高度比最大还大时需要调整\n if(increasedHeight > lineHeight) {\n diff = Math.max(increasedHeight - lineHeight);\n }\n return diff;\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff, isVerticalAlign) {\n this.__y += diff;\n // vertical-align情况特殊对齐,可能替换元素img和text导致偏移,需触发整体和text偏移\n if(isVerticalAlign) {\n this.list.forEach(item => {\n // 是text的第一个的box的话,text也需要偏移\n if (item instanceof TextBox) {\n let text = item.parent;\n if (text.textBoxes[0] === item) {\n text.__offsetY(diff);\n }\n } else {\n item.__offsetY(diff);\n }\n });\n }\n }\n\n /**\n * 防止非行首空inline,每当遇到inline就设置当前lineBox的lineHeight/baseline,这样有最小值兜底\n * @param l\n * @param b\n * @private\n */\n __setLB(l, b) {\n this.__lineHeight = Math.max(l, this.__lineHeight);\n this.__baseline = Math.max(b, this.__baseline);\n }\n\n get list() {\n return this.__list;\n }\n\n get size() {\n return this.__list.length;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endY() {\n return this.y + this.height;\n }\n\n get width() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let first = list[0];\n let last = list[length - 1];\n let x1 = first.x;\n let dom = first instanceof TextBox ? first.parent.domParent : first.domParent;\n // 因为inline可以嵌套inline,所以一直向上查找到非inline为止,每层inline如果是首个则减去左侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [PADDING_LEFT]: paddingLeft,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[0]) {\n x1 -= marginLeft + borderLeftWidth + paddingLeft;\n }\n dom = dom.domParent;\n }\n let x2 = last.x + last.outerWidth;\n dom = last instanceof TextBox ? last.parent.domParent : last.domParent;\n // 同向上查非inline,每层inline如果是最后一个则加上右侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_RIGHT]: paddingRight,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[list.length - 1]) {\n x2 += marginRight + borderRightWidth + paddingRight;\n }\n dom = dom.domParent;\n }\n return x2 - x1;\n }\n return 0;\n }\n\n get height() {\n return this.lineHeight;\n }\n\n get baseline() {\n let baseline = this.__baseline;\n // 只有TextBox和InlineBlock或replaced\n this.list.forEach(item => {\n baseline = Math.max(baseline, item.baseline);\n });\n return baseline;\n }\n\n get lineHeight() {\n let lineHeight = this.__lineHeight;\n // 只有TextBox和InlineBlock或replaced\n this.list.forEach(item => {\n lineHeight = Math.max(lineHeight, item.outerHeight);\n });\n return lineHeight;\n }\n}\n\nexport default LineBox;\n","import LineBox from './LineBox';\n\n/**\n * 维护一个上下文的LineBox,向LineBox中添加Item以及新增下一行的LineBox,多个LineBox组成一个区域\n * 一个block/inlineBlock拥有一个本类对象,上下文即对应这个dom流,而inline则复用最近非inline父元素的\n * 同时LineBox可能连续也可能不连续,不连续的是中间有block之类的隔离开来\n */\nclass LineBoxManager {\n constructor(x, y, lineHeight, baseline) {\n this.__x = this.__lastX = x; // last存储目前最后一行LineBox的结尾位置,供后续inline使用\n this.__y = this.__lastY = y;\n this.__maxX = x;\n this.__domList = [];\n this.__domStack = [];\n this.__list = []; // 包含若干LineBox\n this.__isNewLine = true; // 区域内是否是新行,容器dom(block)开头肯定是\n this.__lineHeight = lineHeight;\n this.__baseline = baseline;\n this.__isEnd = true; // 在dom中是否一个区域处在结尾,外部控制\n this.__spreadYList = []; // verticalAlign时每个区域增加的y高度\n }\n\n /**\n * 每次换行时重新生成LineBox存入列表,同时由于flow流当前一定是流(dom)的结尾,设置isEnd\n * @returns {LineBox}\n */\n genLineBox(x, y) {\n let lineBox = new LineBox(x, y, this.__lineHeight, this.__baseline);\n this.list.push(lineBox);\n this.__isEnd = true;\n return lineBox;\n }\n\n /**\n * inline的特殊调用,防止空内容但有mbp的inline不占位,放入一个有lineHeight的空lineBox\n * 只有新行开头时需要,后面的无论是否有内容都会影响lineHeight\n * @param x\n * @param y\n * @param l\n * @param b\n * @returns {LineBox}\n */\n genLineBoxByInlineIfNewLine(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseline = Math.max(this.__baseline, b);\n if(this.__isNewLine) {\n let lineBox = new LineBox(x, y, lineHeight, baseline);\n this.list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n }\n\n setLbOrGenLineBoxByInline(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseline = Math.max(this.__baseline, b);\n let lineBox;\n let list = this.list;\n if(this.__isNewLine) {\n lineBox = new LineBox(x, y, lineHeight, baseline);\n list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n else {\n let length = list.length;\n lineBox = list[length - 1];\n lineBox.__setLB(l, b);\n }\n }\n\n /**\n * 外部设置为结尾,如一个LineBox后出现一个block,此时会被隔断,不再作为流的末尾\n */\n setNotEnd() {\n this.__isEnd = false;\n }\n\n /**\n * 外部设置新行,下次新生成LineBox\n */\n setNewLine() {\n this.__isNewLine = true;\n }\n\n /**\n * 当前LineBox放入一个新项,当新行时(如第一行)产生一个新的LineBox并存入列表\n * 是否新区域和新行都是可以被外部控制,默认第一行是新\n * 当被隔断后会被外部重置新行,这样会生成新的来作为新加项的LineBox\n * 当换行时外部也会调用新行,这样再次添加Item时会自动生成新的LineBox而不是用之前的\n * @param o TextBox/Inline/InlineBlock\n * @param nextNewLine 是否设置newLine,标明下次添加新生成LineBox\n * @returns {LineBox}\n */\n addItem(o, nextNewLine) {\n let lineBox;\n if(this.__isNewLine) {\n this.__isNewLine = false;\n lineBox = this.genLineBox(o.x, o.y);\n }\n else {\n let list = this.list;\n let length = list.length;\n lineBox = list[length - 1];\n }\n // inline递归过程中所有inline父子顺序列表,每个dom都需要对当前内容保存\n this.__domStack.forEach(item => {\n item.__contentBoxList.push(o);\n });\n lineBox.add(o);\n // 设置结束x的位置给next的inline标记用,o可能是TextBox或inlineBlock,当next新行时注意位置\n if(nextNewLine) {\n this.__isNewLine = true;\n this.__lastX = o.x;\n this.__lastY = o.y + o.outerHeight;\n }\n else {\n this.__lastX = o.x + o.outerWidth;\n this.__lastY = o.y;\n }\n this.__maxX = Math.max(this.__maxX, o.x + o.outerWidth);\n return lineBox;\n }\n\n horizonAlign(w, textAlign) {\n this.list.forEach(lineBox => {\n let diff = w - lineBox.width;\n if(diff > 0) {\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n lineBox.__offsetX(diff);\n lineBox.list.forEach(item => {\n item.__offsetX(diff, true);\n });\n }\n });\n }\n\n /**\n * 垂直对齐过程中,如果遇到占位元素如img,可能会导致每行lineBox高度增加,需返回增加量,\n * next行也需要y偏移\n * @returns {number}\n */\n verticalAlign() {\n let syl = this.__spreadYList;\n syl.splice(0);\n let spread = 0;\n this.list.forEach(lineBox => {\n if(spread) {\n lineBox.__offsetY(spread, true);\n }\n spread += lineBox.verticalAlign();\n syl.push(spread);\n });\n return spread;\n }\n\n addX(n) {\n this.__lastX += n;\n }\n\n /**\n * inline递归过程中布局调用,不断出入栈dom对象,获取当前行状态下有哪些dom还在\n * @param dom\n */\n pushContentBoxList(dom) {\n this.__domList.push(dom);\n this.__domStack.push(dom);\n }\n\n popContentBoxList() {\n this.__domStack.pop();\n }\n\n __offsetX(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetX(diff);\n });\n }\n\n __offsetY(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetY(diff);\n });\n }\n\n /**\n * inline的特殊调用,非行首无论是否有内容都设置lineBox的lineHeight\n * @param l\n * @param b\n * @private\n */\n setLbByInlineIfNotNewLine(l, b) {\n let length = this.list.length;\n if(length && !this.isNewLine) {\n this.list[length - 1].__setLB(l, b);\n }\n }\n\n get size() {\n return this.list.length;\n }\n\n get lastX() {\n return this.__lastX;\n }\n\n get lastY() {\n return this.__lastY;\n }\n\n get endY() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[length - 1].endY;\n }\n return this.__y;\n }\n\n get isEnd() {\n return this.__isEnd;\n }\n\n get isNewLine() {\n return this.__isNewLine;\n }\n\n get breakLine() {\n return this.list.length > 1;\n }\n\n get domList() {\n return this.__domList;\n }\n\n get baseline() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let n = 0;\n for(let i = 0; i < length - 1; i++) {\n n += list[i].height;\n }\n return n + list[length - 1].baseline;\n }\n return 0;\n }\n\n get firstBaseline() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[0].baseline;\n }\n return 0;\n }\n\n get lineHeight() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1].lineHeight;\n }\n return 0;\n }\n\n get lineBox() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1];\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get width() {\n let w = 0;\n this.list.forEach(item => {\n w = Math.max(w, item.width);\n });\n return w;\n }\n\n get spreadYList() {\n return this.__spreadYList;\n }\n}\n\nexport default LineBoxManager;\n","const TAG_NAME = {\n 'div': true,\n 'p': true,\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst INLINE = {\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst BOLD = {\n 'b': true,\n 'strong': true,\n}\n\nexport default {\n TAG_NAME,\n INLINE,\n BOLD,\n};\n","import enums from '../util/enums';\nimport unit from '../style/unit';\nimport level from './level';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n TOP,\n BOTTOM,\n POSITION,\n HEIGHT,\n },\n} = enums;\nconst { AUTO, PX, PERCENT } = unit;\nconst { REFLOW } = level;\n\nfunction offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) {\n if(dy) {\n let last;\n do {\n // component的sr没有next兄弟,视为component的next\n while(node.isShadowRoot) {\n node = node.host;\n }\n last = node;\n let isContainer, parent = node.domParent;\n if(parent) {\n let cs = parent.computedStyle;\n let ps = cs[POSITION];\n isContainer = parent === root || parent.isShadowRoot || ps === 'relative' || ps === 'absolute';\n }\n // 先偏移next,忽略有定位的absolute,本身非container也忽略\n let next = node.next;\n let container;\n while(next) {\n if(next.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, VMAX, VMIN } = 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 if(width[1] === VMAX) {\n w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n for(let i = 0; i < flowChildren.length; i++) {\n // 当放不下时直接返回,无需继续多余的尝试计算\n if(w < 0) {\n return w;\n }\n let item = flowChildren[i];\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Xom) {\n w = item.__tryLayInline(w, total);\n }\n // text强制一行,否则非头就是放不下,需从头开始\n else {\n w -= item.textWidth;\n }\n }\n }\n // ib要减去末尾mpb\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n else if(marginRight[1] === VMAX) {\n w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginRight[1] === VMIN) {\n w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n else if(paddingRight[1] === VMAX) {\n w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingRight[1] === VMIN) {\n w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n else if(borderRightWidth[1] === VMAX) {\n w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderRightWidth[1] === VMIN) {\n w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // 还要减去开头的mpb\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n else if(marginLeft[1] === VMAX) {\n w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginLeft[1] === VMIN) {\n w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n else if(paddingLeft[1] === VMAX) {\n w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingLeft[1] === VMIN) {\n w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n else if(borderLeftWidth[1] === VMAX) {\n w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderLeftWidth[1] === VMIN) {\n w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return w;\n }\n\n // 设置y偏移值,递归包括children,此举在justify-content/margin-auto等对齐用\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n // 记得偏移LineBox\n if(isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) {\n this.lineBoxManager.__offsetX(diff);\n }\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetX(diff, isLayout, lv);\n }\n });\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n if(isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) {\n this.lineBoxManager.__offsetY(diff);\n }\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetY(diff, isLayout, lv);\n }\n });\n }\n\n // 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 let length = flowChildren.length;\n let hasLayout;\n let columnCrossCount = 0, columnCrossMax = 0;\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 if(main[1] === VMAX) {\n min = max = main[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(main[1] === VMIN) {\n min = max = main[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n hasLayout = true;\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], [columnCrossMax2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n columnCrossMax += columnCrossMax2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n columnCrossMax += columnCrossMax2;\n }\n else {\n min += min2;\n max += max2;\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n columnCrossMax += item.width;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n columnCrossMax = Math.max(columnCrossMax, item.width);\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 columnCrossMax += item.width;\n }\n else {\n min += item.height;\n max += item.height;\n columnCrossMax = Math.max(columnCrossMax, item.width);\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 flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [[min2, max2], [columnCrossMax2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n let display = item.currentStyle[DISPLAY];\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n // row看块级最大尺寸和连续行级最大尺寸的宽\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n countMin = countMax = columnCrossCount = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n columnCrossCount += columnCrossMax2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n columnCrossMax = Math.max(columnCrossMax, columnCrossCount);\n }\n }\n // column看块级高度和连续行级最大尺寸高度的和\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n columnCrossMax += columnCrossCount;\n countMin = countMax = columnCrossCount = 0;\n // 本身的\n min += min2;\n max += max2;\n columnCrossMax += columnCrossMax2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n columnCrossCount = Math.max(columnCrossCount, columnCrossMax2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n columnCrossMax += columnCrossCount;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n columnCrossCount += item.width;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n columnCrossMax = Math.max(columnCrossMax, columnCrossCount);\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 columnCrossCount = Math.max(columnCrossCount, item.width);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n columnCrossMax += columnCrossCount;\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], [columnCrossMax2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n if(isDirectionRow) {\n min += min2;\n max += max2;\n columnCrossMax += columnCrossMax2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n }\n }\n else if(isDirectionRow) {\n min += item.charWidth;\n max += item.textWidth;\n columnCrossMax += item.width;\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 columnCrossMax = Math.max(columnCrossMax, item.width);\n }\n });\n }\n }\n // column且isContent需要计算合适的最大宽度返回,上面有可能计算过了\n if(!isDirectionRow) {\n if(width[1] !== AUTO) {\n if(width[1] === PX) {\n columnCrossMax = width[0];\n }\n else if(width[1] === PERCENT) {\n columnCrossMax = width[0] * 0.01 * w;\n }\n else if(width[1] === REM) {\n columnCrossMax = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n columnCrossMax = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n columnCrossMax = width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n columnCrossMax = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n columnCrossMax = width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n else if(!hasLayout) {\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 [, [columnCrossMax2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n columnCrossMax += columnCrossMax2;\n }\n else {\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n }\n }\n else {\n if(isRow) {\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n }\n else {\n columnCrossMax += columnCrossMax2;\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n columnCrossMax += item.width;\n }\n else {\n columnCrossMax = Math.max(columnCrossMax, item.width);\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 columnCrossMax = Math.max(columnCrossMax, item.width);\n }\n else {\n columnCrossMax += item.width;\n }\n }\n });\n }\n else if(display === 'block') {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseline(computedStyle));\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [, [columnCrossMax2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n let display = item.currentStyle[DISPLAY];\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n // row看块级最大尺寸和连续行级最大尺寸的宽\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n columnCrossCount = 0;\n }\n else {\n columnCrossCount += columnCrossMax2;\n columnCrossMax = Math.max(columnCrossMax, columnCrossCount);\n }\n }\n // column看块级高度和连续行级最大尺寸高度的和\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n columnCrossMax += columnCrossCount;\n columnCrossCount = 0;\n // 本身的\n columnCrossMax += columnCrossMax2;\n }\n else {\n // 行内取极值,最后一个记得应用\n columnCrossCount = Math.max(columnCrossCount, columnCrossMax2);\n if(i === length - 1) {\n columnCrossMax += columnCrossCount;\n }\n }\n }\n }\n else if(isDirectionRow) {\n columnCrossCount += item.width;\n columnCrossMax = Math.max(columnCrossMax, columnCrossCount);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n columnCrossCount = Math.max(columnCrossCount, item.width);\n if(i === length - 1) {\n columnCrossMax += columnCrossCount;\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 [, [columnCrossMax2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n if(isDirectionRow) {\n columnCrossMax += columnCrossMax2;\n }\n else {\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n }\n }\n else if(isDirectionRow) {\n columnCrossMax += item.width;\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n columnCrossMax = Math.max(columnCrossMax, item.width);\n }\n });\n }\n }\n }\n return this.__addMp(isDirectionRow, w, currentStyle, [min, max], [columnCrossMax]);\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 * 当为column方向时,还需返回每个节点的cross即宽度,真实布局传入,除非stretch模式按100%宽度\n * @param isDirectionRow\n * @param data\n * @private\n */\n __calBasis(isDirectionRow, data) {\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, VMAX, VMIN].indexOf(flexBasis[1]) > -1;\n let isContent = !isAuto && !isFixed;\n let fixedSize;\n // flex的item固定basis计算\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = fixedSize = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = fixedSize = (isDirectionRow ? w : h) * flexBasis[0] * 0.01;\n }\n else if(flexBasis[1] === REM) {\n b = fixedSize = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = fixedSize = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = fixedSize = flexBasis[0] * this.root.height * 0.01;\n }\n else if(flexBasis[1] === VMAX) {\n b = fixedSize = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(flexBasis[1] === VMIN) {\n b = fixedSize = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // 已声明主轴尺寸的,当basis是auto时为值\n else if(([PX, PERCENT, REM, VW, VH, VMAX, VMIN].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 else if(main[1] === VMAX) {\n b = fixedSize = main[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(main[1] === VMIN) {\n b = fixedSize = main[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // 非固定尺寸的basis为auto时降级为content\n else if(isAuto) {\n isContent = true;\n }\n let countMin = 0, countMax = 0;\n let columnCrossCount = 0, columnCrossMax = 0;\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], [columnCrossMax2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n columnCrossMax += columnCrossMax2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n columnCrossMax += columnCrossMax2;\n }\n else {\n min += min2;\n max += max2;\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n columnCrossMax += item.width;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n columnCrossMax = Math.max(columnCrossMax, item.width);\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 columnCrossMax += item.width;\n }\n else {\n min += item.height;\n max += item.height;\n columnCrossMax = Math.max(columnCrossMax, item.width);\n }\n }\n });\n }\n // flex的item是block/inline时,inline也会变成block统一对待\n else {\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseline(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [[min2, max2], [columnCrossMax2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n let display = item.currentStyle[DISPLAY];\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n // row看块级最大尺寸和连续行级最大尺寸的宽\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n countMin = countMax = columnCrossCount = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n columnCrossCount += columnCrossMax2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n columnCrossMax = Math.max(columnCrossMax, columnCrossCount);\n }\n }\n // column看块级高度和连续行级最大尺寸高度的和\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n columnCrossMax += columnCrossCount;\n countMin = countMax = columnCrossCount = 0;\n // 本身的\n min += min2;\n max += max2;\n columnCrossMax += columnCrossMax2;\n }\n else {\n // 行内取极值,最后一个记得应用因为后面没有循环去累加了\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n columnCrossCount = Math.max(columnCrossCount, columnCrossMax2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n columnCrossMax += columnCrossCount;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n columnCrossCount += item.width;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n columnCrossMax = Math.max(columnCrossMax, columnCrossCount);\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 columnCrossCount = Math.max(columnCrossCount, item.width);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n columnCrossMax += columnCrossCount;\n }\n }\n });\n }\n if(fixedSize) {\n max = Math.max(fixedSize, max);\n }\n if(isContent) {\n b = max;\n }\n if(!isDirectionRow && width[1] !== AUTO) {\n if(width[1] === PX) {\n columnCrossMax = width[0];\n }\n else if(width[1] === PERCENT) {\n columnCrossMax = width[0] * 0.01 * w;\n }\n else if(width[1] === REM) {\n columnCrossMax = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n columnCrossMax = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n columnCrossMax = width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n columnCrossMax = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n columnCrossMax = width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // 直接item的mpb影响basis\n return this.__addMp(isDirectionRow, w, currentStyle, [b, min, max], [columnCrossMax], 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 isReplaced = item.isReplaced;\n // 每次循环开始前,这次不是block的话,看之前遗留待合并margin,并重置\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n if(isXom) {\n // inline和inlineBlock的细节不同之处,ib除了w/h之外,更想像block一样占据一行\n // 比如2个inline前面占一半后面比一半多但还是会从一半开始然后第2行换行继续,但ib放不下则重开一行\n // inline和ib能互相嵌套,形成的LineBox中则是TextBox和节点混合\n if(isInlineBlock || isInline) {\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || isInline && whiteSpace === 'nowrap') {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager, // ib内部新生成会内部判断,这里不管统一传入\n lineClamp,\n lineClampCount,\n }, 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 || isReplaced) && 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 || isReplaced) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, 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 || isReplaced) && 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 // 不管是否虚拟,都需要垂直对齐,因为img这种占位元素会影响lineBox高度\n let spread = lineBoxManager.verticalAlign();\n if(spread) {\n if(!fixedHeight) {\n this.__resizeY(spread);\n }\n /**\n * parent以及parent的next无需处理,因为深度遍历后面还会进行,\n * 但自己的block需处理,因为对齐只处理了inline元素,忽略了block,\n * 同时由于block和inline区域可能不连续,每个增加的y不一样,\n * 需要按照每个不同区域来判断,区域是按索引次序依次增大的\n */\n let count = 0, syl = lineBoxManager.spreadYList;\n let isLastBlock = false;\n flowChildren.forEach(item => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isBlock = isXom && item.currentStyle[DISPLAY] === 'block';\n if(isBlock) {\n isLastBlock = true;\n item.__offsetY(syl[count], true);\n }\n else {\n if(isLastBlock) {\n count++;\n }\n isLastBlock = false;\n }\n });\n }\n // 非abs提前的虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐\n if(!isVirtual) {\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 columnCrossList = []; // column时特殊求每个子节点的宽度,布局时传入,不能按stretch拉满\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], [columnCross]] = item.__calBasis(isVirtual ? true : isDirectionRow, { x, y, w, h });\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 columnCrossList.push(columnCross);\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 columnCrossList.push(item.width);\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 hh = item.height;\n basisList.push(hh);\n maxList.push(hh);\n minList.push(hh);\n columnCrossList.push(item.width);\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,\n orderChildren.slice(offset, end), item, textAlign,\n growList.slice(offset, end), shrinkList.slice(offset, end), basisList.slice(offset, end),\n hypotheticalList.slice(offset, end), minList.slice(offset, end), columnCrossList.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,\n orderChildren, flexLine, textAlign,\n growList, shrinkList, basisList, hypotheticalList, minList, columnCrossList) {\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 // 特殊的地方,column子元素的宽度限制为非stretch时,否则还是满宽\n let alignSelf = item.currentStyle[ALIGN_SELF];\n let w3;\n if(alignItems === 'stretch') {\n if(alignSelf !== 'auto' && alignSelf !== 'stretch') {\n w3 = columnCrossList[i];\n }\n }\n else {\n if(alignSelf !== 'stretch') {\n w3 = columnCrossList[i];\n }\n }\n item.__layout({\n x,\n y,\n w,\n w3,\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 : columnCrossList[i],\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 if(width[1] === VMAX) {\n w2 = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w2 = width[0] * Math.min(this.root.width, 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 if(width[1] === VMAX) {\n w2 = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w2 = width[0] * Math.min(this.root.width, 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 if(width[1] === VMAX) {\n w2 = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w2 = width[0] * Math.min(this.root.width, 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 if(height[1] === VMAX) {\n h2 = height[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(height[1] === VMIN) {\n h2 = height[0] * Math.min(this.root.width, 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 if(height[1] === VMAX) {\n h2 = height[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(height[1] === VMIN) {\n h2 = height[0] * Math.min(this.root.width, 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] === VMAX) {\n h2 = height[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(height[1] === VMIN) {\n h2 = height[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n // 特殊必须声明防止AUTO\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, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(renderMode === mode.SVG) {\n this.virtualDom.type = 'dom';\n }\n return res;\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.children.forEach(child => {\n // 有可能为空,因为diff过程中相同的cp被移到新的vd中,老的防止destroy设null\n if(child) {\n child.__destroy();\n }\n });\n super.__destroy();\n }\n\n __emitEvent(e, force) {\n if(force) {\n return super.__emitEvent(e, force);\n }\n let { isDestroyed, computedStyle, isMask } = this;\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || e.__stopPropagation || isMask) {\n return;\n }\n // 检查perspective嵌套状态,自身有perspective则设置10位,自身有transform的p矩阵则设置01位\n // if(computedStyle[PERSPECTIVE]) {\n // perspectiveNest++;\n // }\n // if(tf.isPerspectiveMatrix(computedStyle[TRANSFORM])) {\n // perspectiveTfNest++;\n // }\n // overflow:hidden时还需要判断是否超出范围外,如果是则无效\n if(computedStyle[OVERFLOW] === 'hidden' && !this.willResponseEvent(e, true)) {\n return;\n }\n // 找到对应的callback\n let { event: { type } } = e;\n let { listener, zIndexChildren } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // child触发则parent一定触发\n for(let i = zIndexChildren.length - 1; i >=0; i--) {\n let child = zIndexChildren[i];\n if(child instanceof Xom\n || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.__emitEvent(e)) {\n // 孩子阻止冒泡\n if(e.__stopPropagation) {\n return;\n }\n if(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 enums from '../util/enums';\nimport unit from '../style/unit';\nimport image from '../style/image';\nimport border from '../style/border';\nimport level from '../refresh/level';\nimport mx from '../math/matrix';\nimport geom from '../math/geom';\nimport css from '../style/css';\n\nconst {\n STYLE_KEY: {\n WIDTH,\n HEIGHT,\n DISPLAY,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n VISIBILITY,\n BACKGROUND_IMAGE,\n BACKGROUND_COLOR,\n BOX_SHADOW,\n MIX_BLEND_MODE,\n MARGIN_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, VMAX, VMIN, 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, dx = 0, dy = 0) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(renderMode === mode.WEBGL) {\n dx = res.dx;\n dy = res.dy;\n }\n let {\n offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow,\n } = res;\n let {\n width, height, isDestroyed,\n props: {\n placeholder,\n },\n computedStyle,\n computedStyle: {\n [DISPLAY]: display,\n [BORDER_TOP_LEFT_RADIUS]: borderTopLeftRadius,\n [BORDER_TOP_RIGHT_RADIUS]: borderTopRightRadius,\n [BORDER_BOTTOM_RIGHT_RADIUS]: borderBottomRightRadius,\n [BORDER_BOTTOM_LEFT_RADIUS]: borderBottomLeftRadius,\n [VISIBILITY]: visibility,\n },\n virtualDom,\n __config,\n __loadImg: loadImg,\n root,\n } = this;\n if(offscreenBlend) {\n ctx = offscreenBlend.target.ctx;\n }\n if(offscreenMask) {\n ctx = offscreenMask.target.ctx;\n }\n if(offscreenFilter) {\n ctx = offscreenFilter.target.ctx;\n }\n if(offscreenOverflow) {\n ctx = offscreenOverflow.target.ctx;\n }\n // 没source且不error时加载图片\n if(!loadImg.source && !loadImg.error && !loadImg.loading) {\n this.__loadAndRefresh(loadImg, root, ctx, placeholder, computedStyle, width, height);\n }\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return res;\n }\n let __cache = __config[NODE_CACHE];\n if(cache && __cache && __cache.enabled) {\n ctx = __cache.ctx;\n }\n let originX, originY;\n originX = res.x3 + dx;\n originY = res.y3 + dy;\n // 根据配置以及占位图显示error\n let source = loadImg.source;\n if(loadImg.error && !placeholder && Img.showError) {\n let strokeWidth = Math.min(width, height) * 0.02;\n let stroke = '#CCC';\n let fill = '#DDD';\n let cx = originX + width * 0.7;\n let cy = originY + height * 0.3;\n let r = strokeWidth * 5;\n let pts = [\n [originX + width * 0.15, originY + height * 0.7],\n [originX + width * 0.3, originY + height * 0.4],\n [originX + width * 0.5, originY + height * 0.6],\n [originX + width * 0.6, originY + height * 0.5],\n [originX + width * 0.9, originY + height * 0.8],\n [originX + width * 0.15, originY + height * 0.8]\n ];\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.fillStyle = fill;\n ctx.beginPath();\n ctx.moveTo(originX, originY);\n ctx.lineTo(originX + width, originY);\n ctx.lineTo(originX + width, originY + height);\n ctx.lineTo(originX, originY + height);\n ctx.lineTo(originX, originY);\n ctx.stroke();\n ctx.closePath();\n ctx.beginPath();\n let points = geom.ellipsePoints(cx, cy, r, r);\n painter.canvasPolygon(ctx, points, 0, 0);\n ctx.fill();\n ctx.closePath();\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for(let i = 1, len = pts.length; i < len; i++) {\n let point = pts[i];\n ctx.lineTo(point[0], point[1]);\n }\n ctx.lineTo(pts[0][0], pts[0][1]);\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n this.__addGeom('rect', [\n ['x', originX],\n ['y', originY],\n ['width', width],\n ['height', height],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ['fill', 'rgba(0,0,0,0)']\n ]);\n this.__addGeom('circle', [\n ['cx', cx],\n ['cy', cy],\n ['r', r],\n ['fill', fill],\n ]);\n let s = '';\n for(let i = 0, len = pts.length; i < len; i++) {\n let point = pts[i];\n if(i) {\n s += ' ';\n }\n s += point[0] + ',' + point[1];\n }\n this.__addGeom('polygon', [\n ['points', s],\n ['fill', fill]\n ]);\n }\n }\n else if(source) {\n // 圆角需要生成一个mask\n let list = border.calRadius(originX, originY, width, height,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n // 有border-radius需模拟遮罩裁剪\n if(list) {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list, dx, dy);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(source, originX, originY, width, height);\n ctx.restore();\n }\n else {\n ctx.drawImage(source, originX, originY, width, height);\n }\n }\n else if(renderMode === mode.SVG) {\n // img没有变化无需diff,直接用上次的vd\n if(loadImg.cache) {\n loadImg.cache.cache = true;\n virtualDom.children = [loadImg.cache];\n // 但是还是要校验是否有borderRadius变化,引发img的圆角遮罩\n if(!virtualDom.cache && list) {\n let d = svgPolygon(list);\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF'],\n ],\n }\n ],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.conClip = 'url(#' + id + ')';\n }\n return;\n }\n // 缩放图片,无需考虑原先矩阵,xom里对父层已经变换过了\n let matrix;\n if(width !== loadImg.width || height !== loadImg.height) {\n matrix = image.matrixResize(loadImg.width, loadImg.height, width, height, originX, originY, width, height);\n }\n let props = [\n ['xlink:href', loadImg.error ? placeholder : loadImg.src],\n ['x', originX],\n ['y', originY],\n ['width', loadImg.width],\n ['height', loadImg.height]\n ];\n if(list) {\n let d = svgPolygon(list);\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF']\n ],\n }\n ],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.conClip = 'url(#' + id + ')';\n delete virtualDom.cache;\n }\n if(matrix && !mx.isE(matrix)) {\n props.push(['transform', 'matrix(' + util.joinArr(mx.m2m6(matrix), ',') + ')']);\n }\n let vd = {\n type: 'img',\n tagName: 'image',\n props,\n };\n virtualDom.children = [vd];\n loadImg.cache = vd;\n }\n }\n return res;\n }\n\n // img没加载时,清空,这样Xom就认为没内容不生成cache,防止img先绘制cache再绘制主屏,重复\n __releaseWhenEmpty(__cache) {\n if(!this.__loadImg.error && !this.__loadImg.source) {\n return super.__releaseWhenEmpty(__cache);\n }\n }\n\n __isRealInline() {\n return false;\n }\n\n // overwrite\n __tryLayInline(w, total) {\n let { currentStyle: {\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n let loadImg = this.__loadImg;\n // 加载成功计算缩放后的宽度\n if(loadImg.source) {\n if(height[1] === PX) {\n w -= loadImg.width * height[0] / loadImg.height;\n }\n else if(height[1] === PERCENT) {\n w -= loadImg.width * height[0] * total * 0.01 / loadImg.height;\n }\n else if(height[1] === REM) {\n w -= loadImg.width * height[0] * this.root.computedStyle[FONT_SIZE] / loadImg.height;\n }\n else if(height[1] === VW) {\n w -= loadImg.width * height[0] * this.root.width * 0.01 / loadImg.height;\n }\n else if(height[1] === VH) {\n w -= loadImg.width * height[0] * this.root.height * 0.01 / loadImg.height;\n }\n else if(height[1] === VMAX) {\n w -= height[0] * Math.max(this.root.width, this.root.height) * 0.01 / loadImg.height;\n }\n else if(height[1] === VMIN) {\n w -= height[0] * Math.min(this.root.width, this.root.height) * 0.01 / loadImg.height;\n }\n else {\n w -= loadImg.width;\n }\n }\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n else if(marginLeft[1] === VMAX) {\n w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginLeft[1] === VMIN) {\n w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n else if(paddingLeft[1] === VMAX) {\n w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingLeft[1] === VMIN) {\n w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n else if(borderLeftWidth[1] === VMAX) {\n w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderLeftWidth[1] === VMIN) {\n w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n else if(marginRight[1] === VMAX) {\n w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginRight[1] === VMIN) {\n w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n else if(paddingRight[1] === VMAX) {\n w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingRight[1] === VMIN) {\n w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n else if(borderRightWidth[1] === VMAX) {\n w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderRightWidth[1] === VMIN) {\n w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return w;\n }\n\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this, this.isShadowRoot);\n return this.__calBasis(isDirectionRow, data);\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, VMAX, VMIN].indexOf(flexBasis[1]) > -1;\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = max = min = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = max = min = flexBasis[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(flexBasis[1] === REM) {\n b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = max = min = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = max = min = flexBasis[0] * this.root.height * 0.01;\n }\n else if(flexBasis[1] === VMAX) {\n b = max = min = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(flexBasis[1] === VMIN) {\n b = max = min = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n else if(([PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(main[1]) > -1)) {\n if(main[1] === PX) {\n b = max = min = main[0];\n }\n else if(main[1] === PERCENT) {\n b = max = min = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = max = min = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = max = min = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = max = min = main[0] * this.root.height * 0.01;\n }\n else if(main[1] === VMAX) {\n b = max = min = main[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(main[1] === VMIN) {\n b = max = min = main[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // auto和content固定尺寸比例计算\n else if(__loadImg.source || __loadImg.error) {\n let res = this.__preLayout(data);\n if(cross[1] !== AUTO) {\n if(cross[1] === PX) {\n cross = cross[0];\n }\n else if(cross[1] === PERCENT) {\n cross = cross[0] * 0.01 * (isDirectionRow ? h : w);\n }\n else if(cross[1] === REM) {\n cross = cross[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(cross[1] === VW) {\n cross = cross[0] * this.root.width * 0.01;\n }\n else if(cross[1] === VH) {\n cross = cross[0] * this.root.height * 0.01;\n }\n else if(cross[1] === VMAX) {\n cross = cross[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(cross[1] === VMIN) {\n cross = cross[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n let ratio = res.w / res.h;\n b = max = min = isDirectionRow ? cross * ratio : cross / ratio;\n }\n else {\n b = max = min = isDirectionRow ? res.w : res.h;\n }\n }\n // 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 let columnCrossMax = 0;\n if(width[1] === PX) {\n columnCrossMax = width[0];\n }\n else if(width[1] === PERCENT) {\n columnCrossMax = width[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(width[1] === REM) {\n columnCrossMax = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n columnCrossMax = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n columnCrossMax = width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n columnCrossMax = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n columnCrossMax = width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else if(__loadImg.source || __loadImg.error) {\n let res = this.__preLayout(data);\n columnCrossMax = res.w;\n }\n columnCrossMax += this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w)\n + borderLeftWidth[0] + borderRightWidth[0];\n return [[b, min, max], [columnCrossMax]];\n }\n\n __loadAndRefresh(loadImg, root, ctx, placeholder, computedStyle, width, height, cb) {\n let self = this;\n // 先清空之前可能的\n if(loadImg.source || loadImg.error) {\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n });\n loadImg.source = null;\n }\n loadImg.loading = true;\n // 再测量,可能瞬间完成替换掉上面的\n inject.measureImg(loadImg.src, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败走error绘制\n if(data.url === loadImg.src && !self.isDestroyed) {\n loadImg.cache && (loadImg.cache.cache = false);\n loadImg.loading = false;\n function reload() {\n let { currentStyle: { [WIDTH]: width, [HEIGHT]: height } } = self;\n root.delRefreshTask(self.__task);\n if(width[1] !== AUTO && height[1] !== AUTO) {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REPAINT;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n else {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n }\n if(data.success) {\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n }\n else if(placeholder) {\n inject.measureImg(placeholder, data => {\n if(data.success) {\n loadImg.error = true;\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n reload();\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n return;\n }\n else {\n loadImg.error = true;\n }\n // 可见状态进行刷新操作,visibility某些情况需要刷新,可能宽高未定义要重新布局\n if(computedStyle[DISPLAY] !== 'none') {\n reload();\n }\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n }\n\n updateSrc(v, cb) {\n let self = this;\n let loadImg = self.__loadImg;\n let root = this.root;\n // 相等或空且当前error直接返回\n if(v === loadImg.src || !v && loadImg.error) {\n if(isFunction(cb)) {\n cb(-1);\n }\n }\n else if(v) {\n loadImg.src = v;\n self.__loadAndRefresh(loadImg, root, root.ctx, self.props.placeholder, self.computedStyle, self.width, self.height, cb);\n }\n else {\n loadImg.src = v;\n loadImg.source = null;\n loadImg.error = true;\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, self.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb(diff);\n }\n },\n });\n }\n }\n\n appendChild() {\n inject.error('Img can not appendChild.');\n }\n\n get src() {\n return this.__loadImg.src;\n }\n\n get isReplaced() {\n return true;\n }\n\n static showError = true;\n}\n\nexport default Img;\n","class Defs {\n constructor(uuid) {\n this.id = uuid;\n this.count = 0;\n this.list = [];\n this.cacheHash = {}; // 每次svg渲染前重置,存储前次渲染不变的缓存id\n }\n add(data) {\n let uuid = this.count;\n let hash = this.cacheHash;\n while(hash.hasOwnProperty(uuid)) {\n uuid++;\n }\n this.count = uuid + 1;\n data.id = uuid;\n data.uuid = 'karas-defs-' + this.id + '-' + uuid;\n data.index = this.list.length;\n this.list.push(data);\n return data.uuid;\n }\n addCache(data) {\n data.index = this.list.length;\n this.list.push(data);\n this.cacheHash[data.id] = true;\n return data.uuid;\n }\n clear() {\n this.list = [];\n this.count = 0;\n this.cacheHash = {};\n }\n removeCache(data) {\n let list = this.list;\n let i = data.index;\n // 一般情况index即位置,但每次渲染过程中,可能会删掉一些,此时位置会往前,但index不变,因此遍历\n for(; i >= 0; i--) {\n if(list[i] === data) {\n list.splice(i, 1);\n return;\n }\n }\n }\n\n get value() {\n return this.list;\n }\n\n static getInstance(uuid) {\n return new Defs(uuid);\n }\n}\n\nexport default Defs;\n","import Xom from '../Xom';\nimport reset from '../../style/reset';\nimport css from '../../style/css';\nimport unit from '../../style/unit';\nimport enums from '../../util/enums';\nimport mode from '../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 NODE_CACHE,\n }\n} = enums;\nconst { PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit;\nconst { int2rgba, isNil, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { WEBGL } = mode;\n\nconst REGISTER = {};\n\nclass Geom extends Xom {\n constructor(tagName, props) {\n super(tagName, props);\n this.__isMulti = !!this.props.multi;\n this.__style = css.normalize(this.style, reset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET));\n this.__currentStyle = util.extend({}, this.__style);\n this.__currentProps = util.clone(this.props);\n let config = this.__config;\n config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n config[NODE_CURRENT_PROPS] = this.__currentProps;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_STYLE] = this.__style;\n }\n\n __tryLayInline(w, total) {\n // 无children,直接以style的width为宽度,不定义则为0\n let { currentStyle: {\n [WIDTH]: width,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n else if(marginLeft[1] === VMAX) {\n w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginLeft[1] === VMIN) {\n w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n else if(paddingLeft[1] === VMAX) {\n w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingLeft[1] === VMIN) {\n w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n else if(borderLeftWidth[1] === VMAX) {\n w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderLeftWidth[1] === VMIN) {\n w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n else if(marginRight[1] === VMAX) {\n w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginRight[1] === VMIN) {\n w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n else if(paddingRight[1] === VMAX) {\n w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingRight[1] === VMIN) {\n w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n else if(borderRightWidth[1] === VMAX) {\n w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderRightWidth[1] === VMIN) {\n w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return w;\n }\n\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this, this.isShadowRoot);\n return this.__calBasis(isDirectionRow, data);\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, VMAX, VMIN].indexOf(flexBasis[1]) > -1;\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = max = min = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = max = min = flexBasis[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(flexBasis[1] === REM) {\n b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = max = min = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = max = min = flexBasis[0] * this.root.height * 0.01;\n }\n else if(flexBasis[1] === VMAX) {\n b = max = min = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(flexBasis[1] === VMIN) {\n b = max = min = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n else if(([PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(main[1]) > -1)) {\n if(main[1] === PX) {\n b = max = min = main[0];\n }\n else if(main[1] === PERCENT) {\n b = max = min = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = max = min = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = max = min = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = max = min = main[0] * this.root.height * 0.01;\n }\n else if(main[1] === VMAX) {\n b = max = min = main[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(main[1] === VMIN) {\n b = max = min = main[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // 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 let columnCrossMax = 0;\n if(width[1] === PX) {\n columnCrossMax = width[0];\n }\n else if(width[1] === PERCENT) {\n columnCrossMax = width[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(width[1] === REM) {\n columnCrossMax = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n columnCrossMax = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n columnCrossMax = width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n columnCrossMax = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n columnCrossMax = width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n columnCrossMax += this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w)\n + borderLeftWidth[0] + borderRightWidth[0];\n return [[b, min, max], [columnCrossMax]];\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 if(item[1] === VMAX) {\n return item[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(item[1] === VMIN) {\n return item[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n return 0;\n }\n });\n }\n if(isNil(__cacheStyle[STROKE_DASHARRAY])) {\n __cacheStyle[STROKE_DASHARRAY] = true;\n computedStyle[STROKE_DASHARRAY] = currentStyle[STROKE_DASHARRAY] || [];\n __cacheStyle[STROKE_DASHARRAY_STR] = computedStyle[STROKE_DASHARRAY].map(item => joinArr(item, ','));\n }\n // 直接赋值的\n [\n STROKE_LINECAP,\n STROKE_LINEJOIN,\n STROKE_MITERLIMIT,\n FILL_RULE,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n // stroke/fll移至render里处理,因为cache涉及渐变坐标偏移\n [STROKE, FILL].forEach(k => {\n if(isNil(__cacheStyle[k])) {\n let v = currentStyle[k];\n computedStyle[k] = v;\n let res = [];\n if(Array.isArray(v)) {\n v.forEach(item => {\n if(item && (item.k === 'linear' || item.k === 'radial' || item.k === 'conic')) {\n if(renderMode === WEBGL) {\n let cache = this.__config[NODE_CACHE];\n x3 += cache.dx;\n x4 += cache.dx;\n y3 += cache.dy;\n y4 += cache.dy;\n }\n res.push(this.__gradient(renderMode, ctx, x3, y3, x4, y4, item));\n }\n else if(item[3] > 0) {\n res.push(int2rgba(item));\n }\n else {\n res.push('none');\n }\n });\n }\n __cacheStyle[k] = res;\n }\n });\n return res;\n }\n\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n // Geom强制有内容\n return computedStyle[VISIBILITY] !== 'hidden';\n }\n\n __preSet(res) {\n let { width, height, __cacheStyle, computedStyle } = this;\n let cx = res.sx3 + width * 0.5;\n let cy = res.sy3 + height * 0.5;\n let {\n [FILL]: fill,\n [STROKE]: stroke,\n [STROKE_DASHARRAY_STR]: strokeDasharrayStr,\n } = __cacheStyle;\n let {\n [STROKE_WIDTH]: strokeWidth,\n [STROKE_LINECAP]: strokeLinecap,\n [STROKE_LINEJOIN]: strokeLinejoin,\n [STROKE_MITERLIMIT]: strokeMiterlimit,\n [STROKE_DASHARRAY]: strokeDasharray,\n [FILL_RULE]: fillRule,\n } = computedStyle;\n return {\n cx,\n cy,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n fillRule,\n };\n }\n\n __preSetCanvas(renderMode, ctx, res) {\n let {\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n } = res;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(fill) {\n if(fill.k === 'linear') {\n ctx.fillStyle = fill.v;\n }\n else if(fill.k === 'radial' && !Array.isArray(fill.v)) {\n ctx.fillStyle = fill.v;\n }\n else if(fill.k === 'conic') {\n //\n }\n else if(!fill.k && ctx.fillStyle !== fill) {\n ctx.fillStyle = fill;\n }\n }\n if(stroke) {\n if(stroke.k === 'linear') {\n ctx.strokeStyle = stroke.v;\n }\n else if(stroke.k === 'radial' && !Array.isArray(stroke.v)) {\n ctx.strokeStyle = stroke.v;\n }\n else if(stroke.k === 'conic') {\n //\n }\n else if(!stroke.k && ctx.strokeStyle !== stroke) {\n ctx.strokeStyle = stroke;\n }\n }\n if(strokeWidth !== undefined && ctx.lineWidth !== strokeWidth) {\n ctx.lineWidth = strokeWidth;\n }\n if(strokeLinecap !== undefined && ctx.lineCap !== strokeLinecap) {\n ctx.lineCap = strokeLinecap;\n }\n if(strokeLinejoin !== undefined && ctx.lineJoin !== strokeLinejoin) {\n ctx.lineJoin = strokeLinejoin;\n }\n if(strokeMiterlimit !== undefined && ctx.miterLimit !== strokeMiterlimit) {\n ctx.miterLimit = strokeMiterlimit;\n }\n // 小程序没这个方法\n if(util.isFunction(ctx.getLineDash)) {\n if(strokeDasharray && !util.equalArr(ctx.getLineDash(), strokeDasharray)) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n else if(strokeDasharray) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(renderMode === mode.SVG) {\n this.virtualDom.type = 'geom';\n }\n // 无论canvas/svg,break可提前跳出省略计算\n if(res.break) {\n return res;\n }\n // data在无cache时没有提前设置\n let preData = this.__preSet(res);\n return Object.assign(res, preData);\n }\n\n __renderPolygon(renderMode, ctx, res) {\n let {\n fill: fills,\n fillRule: fillRules,\n stroke: strokes,\n strokeWidth: strokeWidths,\n strokeDasharray: strokeDasharrays,\n strokeDasharrayStr: strokeDasharrayStrs,\n strokeLinecap: strokeLinecaps,\n strokeLinejoin: strokeLinejoins,\n strokeMiterlimit: strokeMiterlimits,\n dx,\n dy,\n } = res;\n let { __cacheProps: { list }, isMulti, bbox } = this;\n // 普通情况下只有1个,按普通情况走\n if(fills.length <= 1 && strokes.length <= 1) {\n let o = {\n fill: fills[0],\n fillRule: fillRules[0],\n stroke: strokes[0],\n strokeWidth: strokeWidths[0],\n strokeDasharray: strokeDasharrays[0],\n strokeDasharrayStr: strokeDasharrayStrs[0],\n strokeLinecap: strokeLinecaps[0],\n strokeLinejoin: strokeLinejoins[0],\n strokeMiterlimit: strokeMiterlimits[0],\n dx,\n dy,\n bbox,\n };\n this.__renderOnePolygon(renderMode, ctx, isMulti, list, o);\n }\n // 多个需要fill在下面,stroke在上面,依次循环\n else {\n for(let i = 0, len = fills.length; i < len; i++) {\n let fill = fills[i];\n if(fill) {\n let o = {\n fill,\n fillRule: fillRules[i],\n dx,\n dy,\n bbox,\n };\n this.__renderOnePolygon(renderMode, ctx, isMulti, list, o);\n }\n }\n for(let i = 0, len = strokes.length; i < len; i++) {\n let stroke = strokes[i];\n if(stroke) {\n let o = {\n stroke,\n strokeWidth: strokeWidths[i],\n strokeDasharray: strokeDasharrays[i],\n strokeDasharrayStr: strokeDasharrayStrs[i],\n strokeLinecap: strokeLinecaps[i],\n strokeLinejoin: strokeLinejoins[i],\n strokeMiterlimit: strokeMiterlimits[i],\n dx,\n dy,\n bbox,\n };\n this.__renderOnePolygon(renderMode, ctx, isMulti, list, o);\n }\n }\n }\n }\n\n __renderOnePolygon(renderMode, ctx, isMulti, list, res) {\n let {\n fill,\n stroke,\n strokeWidth,\n } = res;\n let isFillCE = fill && fill.k === 'conic';\n let isStrokeCE = stroke && stroke.k === 'conic';\n // 椭圆是array\n let isFillRE = fill && fill.k === 'radial' && Array.isArray(fill.v);\n let isStrokeRE = strokeWidth && strokeWidth > 0 && stroke && stroke.k === 'radial' && Array.isArray(stroke.v);\n if(isFillCE || isStrokeCE) {\n if(isFillCE) {\n this.__conicGradient(renderMode, ctx, list, isMulti, res);\n }\n else if(fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true);\n }\n if(strokeWidth && strokeWidth > 0 && isStrokeCE) {\n inject.warn('Stroke style can not use conic-gradient');\n }\n else if(strokeWidth && strokeWidth > 0 && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, false, true);\n }\n }\n else if(isFillRE || isStrokeRE) {\n if(isFillRE) {\n this.__radialEllipse(renderMode, ctx, list, isMulti, res, 'fill');\n }\n else if(fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true);\n }\n // stroke椭圆渐变matrix会变形,降级为圆\n if(strokeWidth && strokeWidth > 0 && isStrokeRE) {\n inject.warn('Stroke style can not use radial-gradient for ellipse');\n res.stroke.v = res.stroke.v[0];\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, false, true);\n }\n else if(strokeWidth && strokeWidth > 0 && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, false, true);\n }\n }\n else {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true, true);\n }\n }\n\n __drawPolygon(renderMode, ctx, isMulti, list, res, isFill, isStroke) {\n let {\n fill,\n stroke,\n strokeWidth,\n fillRule,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n dx,\n dy,\n } = res;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n this.__preSetCanvas(renderMode, ctx, res);\n ctx.beginPath();\n if(isMulti) {\n list.forEach(item => canvasPolygon(ctx, item, dx, dy));\n }\n else {\n canvasPolygon(ctx, list, dx, dy);\n }\n if(isFill && fill && fill !== 'none') {\n ctx.fill(fillRule);\n }\n if(isStroke && stroke && stroke !== 'none' && strokeWidth && strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n list.forEach(item => d += svgPolygon(item));\n }\n else {\n d = svgPolygon(list);\n }\n let props = [\n ['d', d],\n ];\n // 2个都没有常出现在多fill/stroke时,也有可能特殊单个故意这样写的\n if((!fill || fill === 'none') && (!stroke || stroke === 'none')) {\n return;\n }\n if(isFill && fill && fill !== 'none') {\n props.push(['fill', fill.v || fill]);\n if(fillRule && fillRule !== 'nonzero') {\n props.push(['fill-rule', fillRule]);\n }\n }\n else {\n props.push(['fill', 'none']);\n }\n if(isStroke && stroke && stroke !== 'none' && strokeWidth && strokeWidth > 0) {\n props.push(['stroke', stroke.v || stroke]);\n props.push(['stroke-width', strokeWidth]);\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n }\n else {\n props.push(['stroke-width', 0]);\n }\n this.addGeom('path', props);\n }\n }\n\n __inversePtList(list, isMulti, t) {\n if(isMulti) {\n return list.map(item => {\n if(!item || !item.length) {\n return null;\n }\n return item.map(item => {\n if(!item || !item.length) {\n return null;\n }\n let arr = [];\n for(let i = 0, len = item.length; i < len; i += 2) {\n let p = mx.calPoint([item[i], item[i + 1]], t);\n arr.push(p[0]);\n arr.push(p[1]);\n }\n return arr;\n });\n });\n }\n else {\n return list.map(item => {\n if(!item || !item.length) {\n return null;\n }\n let arr = [];\n for(let i = 0, len = item.length; i < len; i += 2) {\n let p = mx.calPoint([item[i], item[i + 1]], t);\n arr.push(p[0]);\n arr.push(p[1]);\n }\n return arr;\n });\n }\n }\n\n __radialEllipse(renderMode, ctx, list, isMulti, res, method) {\n let {\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n dx,\n dy,\n } = res;\n let [color, matrix, cx, cy] = res[method].v;\n // 椭圆渐变的转换,顶点逆矩阵变换\n let tfo = [cx, cy];\n matrix = transform.calMatrixByOrigin(matrix, tfo);\n let t = mx.inverse(matrix);\n list = this.__inversePtList(list, isMulti, t);\n // 用正向matrix渲染\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(matrix) {\n ctx.save();\n let me = this.matrixEvent;\n matrix = mx.multiply(me, matrix);\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n }\n ctx.beginPath();\n if(ctx[method + 'Style'] !== color) {\n ctx[method + 'Style'] = color;\n }\n if(isMulti) {\n list.forEach(item => painter.canvasPolygon(ctx, item, dx, dy));\n }\n else {\n canvasPolygon(ctx, list, dx, dy);\n }\n ctx[method]();\n ctx.closePath();\n if(matrix) {\n ctx.restore();\n }\n }\n else if(renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n list.forEach(item => d += svgPolygon(item));\n }\n else {\n d = svgPolygon(list);\n }\n let props = [\n ['d', d],\n ];\n if(method === 'fill') {\n props.push(['fill', color]);\n props.push(['strokeWidth', 0]);\n }\n else if(method === 'stroke') {\n props.push(['fill', 'none']);\n props.push(['stroke', color]);\n props.push(['stroke-width', strokeWidth]);\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n }\n props.push(['transform', `matrix(${joinArr(mx.m2m6(matrix), ',')})`]);\n this.addGeom('path', props);\n }\n }\n\n __conicGradient(renderMode, ctx, list, isMulti, res) {\n let {\n fill,\n bbox,\n dx = 0,\n dy = 0,\n } = res;\n let color = fill.v;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n let [x1, y1, x2, y2] = bbox;\n let w = x2 - x1, h = y2 - y1;\n let offscreen = inject.getCacheCanvas(w, h, '__$$CONIC_GRADIENT$$__');\n let imgData = offscreen.ctx.getImageData(0,0, w, h);\n gradient.getConicGradientImage(w * 0.5, h * 0.5, w, h, fill.v.stop, imgData.data);\n offscreen.ctx.putImageData(imgData, 0, 0);\n if(isMulti) {\n list.forEach(item => {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, item, dx, dy);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(offscreen.canvas, x1 + dx, y1 + dy);\n ctx.restore();\n });\n }\n else {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list, dx, dy);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(offscreen.canvas, x1 + dx, y1 + dy);\n ctx.restore();\n }\n offscreen.ctx.clearRect(0, 0, w, h);\n }\n else if(renderMode === mode.SVG) {\n if(isMulti) {\n list.forEach(item => {\n let v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(item)],\n ],\n }],\n };\n let clip = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n color.forEach(item => {\n this.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(item[0])],\n ['fill', item[1]],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n });\n });\n }\n else {\n let v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(list)],\n ],\n }],\n };\n let clip = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n color.forEach(item => {\n this.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(item[0])],\n ['fill', item[1]],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n });\n }\n }\n }\n\n __propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit) {\n if(strokeDasharrayStr) {\n props.push(['stroke-dasharray', strokeDasharrayStr]);\n }\n if(strokeLinecap && strokeLinecap !== 'butt') {\n props.push(['stroke-linecap', strokeLinecap]);\n }\n if(strokeLinejoin && strokeLinejoin !== 'miter') {\n props.push(['stroke-linejoin', strokeLinejoin]);\n }\n if(strokeMiterlimit && strokeMiterlimit !== 4) {\n props.push(['stroke-miterlimit', strokeMiterlimit]);\n }\n }\n\n // geom的cache无内容也不清除,因为子类不清楚内容,除非看不见\n __releaseWhenEmpty(cache, computedStyle) {\n return computedStyle[VISIBILITY] === 'hidden';\n }\n\n // offset/resize时要多一步清空props上记录的缓存\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeX(diff, lv) {\n super.__resizeX(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeY(diff, lv) {\n super.__resizeY(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n getProps(k) {\n let v = this.currentProps[k];\n if(!isNil(v)) {\n return v;\n }\n return this['__' + k];\n }\n\n __isRealInline() {\n return false;\n }\n\n get isMulti() {\n return this.__isMulti;\n }\n\n get currentProps() {\n return this.__currentProps;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$') {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Geom has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$'\n || !obj.prototype || !(obj.prototype instanceof Geom)) {\n throw new Error('Invalid param');\n }\n if(Geom.hasRegister(name)) {\n throw new Error(`Geom has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Geom.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nexport default Geom;\n","import Xom from '../node/Xom';\nimport Dom from '../node/Dom';\nimport Component from '../node/Component';\nimport util from './util';\nimport inject from './inject';\nimport flatten from './flatten';\nimport $$type from './$$type';\nimport enums from './enums';\n\nconst {\n NODE_KEY: {\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_DOM_PARENT,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n NODE_STRUCT,\n },\n} = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet updateList = [];\nlet removeList = [];\n\nconst KEY_FLAG = {};\n\n/**\n * setState后刷新前先根遍历检查组件开始进行shouldComponentUpdate判断\n */\nfunction check(vd) {\n if(vd instanceof Dom) {\n vd.children.forEach(child => {\n if(child instanceof Dom) {\n check(child);\n }\n // 当组件有setState更新时,从叶子到根链路会标识__hasCpUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasCpUpdate) {\n child.__hasCpUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n // 高阶组件会进入此分支,被父组件调用\n else if(vd instanceof Component && vd.__hasCpUpdate) {\n vd.__hasCpUpdate = false;\n checkCp(vd, vd.props);\n }\n}\n\n/**\n * 检查cp是否有state变更,注意递归检查时需要看shadow不能看shadowRoot,\n * 否则高阶组件会被跳过,其更新无法触发update生命周期\n * @param cp\n * @param nextProps\n * @param forceCheckUpdate,被render()后的json的二级组件,发现props有变更强制检查更新,否则可以跳过\n */\nfunction checkCp(cp, nextProps, forceCheckUpdate) {\n if(cp.__nextState || forceCheckUpdate) {\n let shouldUpdate;\n if(util.isFunction(cp.shouldComponentUpdate)) {\n shouldUpdate = cp.shouldComponentUpdate(nextProps, cp.__nextState || cp.state);\n }\n else {\n // 没有默认更新\n shouldUpdate = true;\n }\n if(shouldUpdate) {\n updateCp(cp, nextProps, cp.__nextState || cp.state);\n }\n // 不更新则递归检查子tree的cp\n else {\n cp.props = nextProps;\n cp.state = cp.__nextState || cp.state;\n check(cp.shadow);\n }\n }\n else {\n check(cp.shadow);\n }\n}\n\n/**\n * 更新组件的props和state,清空__nextState\n * @param cp\n * @param props\n * @param state\n */\nfunction updateCp(cp, props, state) {\n cp.props = props;\n cp.state = state;\n cp.__nextState = null; // 同步在refresh前清除component的新state标识,这样frame动画在after回调中可以新设\n let oldS = cp.shadow;\n let oldSr = cp.shadowRoot;\n let oldJson = cp.__cd;\n let json = flatten(cp.render());\n // 对比新老render()返回的内容,更新后重新生成sr\n diffSr(oldS, oldJson, json);\n cp.__init(json);\n // 为了局部dom布局需要知道老的css信息\n let sr = cp.shadowRoot;\n if(sr instanceof Xom) {\n [\n '__outerWidth',\n '__outerHeight',\n '__sx',\n '__sy',\n '__sx2',\n '__sx3',\n '__sx4',\n '__sx5',\n '__sx6',\n '__sy2',\n '__sy3',\n '__sy4',\n '__sy5',\n '__sy6',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__computedStyle = sr.__config[NODE_COMPUTED_STYLE] = oldSr.computedStyle;\n }\n else {\n let domParent = cp.domParent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n sr.__config[k] = domParent.__config[k];\n });\n }\n [\n '__x',\n '__y',\n '__width',\n '__height',\n '__sx1', // text和xom\n '__sy1',\n '__layoutData',\n '__parent',\n '__domParent',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__config[NODE_DOM_PARENT] = oldSr.domParent;\n sr.__config[NODE_STRUCT] = oldSr.__config[NODE_STRUCT];\n updateList.push(cp);\n // 老的需回收,diff会生成新的dom,唯一列外是cp直接返回一个没变化的cp\n if(!util.isObject(json) || !json.__placeholder) {\n removeList.push(oldS);\n }\n // 子组件使用老的json时标识,更新后删除,render()返回空会没json对象\n if(json && json.__placeholder) {\n delete json.__placeholder;\n }\n if(json && json.__inheritAnimate) {\n delete json.__inheritAnimate;\n }\n if(json && json.__animateRecords) {\n delete json.__animateRecords;\n }\n // 高阶组件时需判断,子组件更新后生成新的sr,父组件的sr/host需要同时更新引用\n let host = cp.host;\n while(host) {\n if(host.shadow === cp) {\n host.__shadowRoot = sr;\n sr.__hostRoot = host;\n cp = host;\n host = host.host;\n }\n else {\n break;\n }\n }\n}\n\n/**\n * 非一级组件sr进行对比,key相同的无需重新生成且继承动画\n * @param vd\n * @param oj oldJson\n * @param nj\n */\nfunction diffSr(vd, oj, nj) {\n // 先遍历检查key相同的,将没有变化的key暂存下来,深度优先,这样叶子节点出现在前面,当key的叶子也有key时,确保叶子先对比\n let ojk = getKeyHash(oj, {}, vd);\n let njk = getKeyHash(nj, {});\n let keyList = [];\n let cpList = [];\n // 先对比key对应的节点,如果新老有一方对不上则落空\n Object.keys(ojk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n if(!n) {\n o.json.key = KEY_FLAG;\n }\n });\n Object.keys(njk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n // 有可能老的没有这个key,新key落空\n if(!o) {\n n.json.key = KEY_FLAG;\n return;\n }\n let oj = o.json;\n let nj = n.json;\n let vd = o.vd;\n // 相同class的组件进行对比替换\n if(oj.$$type === TYPE_CP && nj.$$type === TYPE_CP) {\n if(oj.klass === nj.klass) {\n // 对比props和children看是否全等,是则直接替换新json类型为占位符,引用老vd,否则强制更新\n diffCp(oj, nj, vd);\n // 标识对比过了\n oj.key = nj.key = KEY_FLAG;\n // 老的sr里需删除这个vd,因为老sr会回收\n cpList.push(vd);\n }\n }\n // 相同类型的vd进行对比继承动画\n else if(oj.$$type === nj.$$type && oj.tagName === nj.tagName) {\n // 需判断矢量标签mutil是否相等\n if(nj.$$type !== TYPE_GM || oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n oj.key = nj.key = KEY_FLAG;\n // key相同的dom暂存下来\n if(nj.$$type === TYPE_VD) {\n keyList.push({\n vd,\n oj,\n nj,\n });\n }\n }\n });\n // key相同的dom对比children,下面非key逻辑就不做了\n keyList.forEach(item => {\n diffChildren(item.vd, item.oj, item.nj);\n });\n // 整体tree进行对比\n diffChild(vd, oj, nj);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的\n cpList.forEach(vd => {\n removeCpFromOldTree(vd);\n });\n}\n\n/**\n * 递归检查dom的children,相同的无需重新生成,用PL类型占位符代替直接返回老vd\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChild(vd, oj, nj) {\n if(util.isObject(nj)) {\n if(nj.$$type === TYPE_CP) {\n // key对比过了忽略\n if(nj.key === KEY_FLAG) {\n return;\n }\n // 相同class的组件处理\n if(oj && oj.$$type === nj.$$type && oj.klass === nj.klass) {\n diffCp(oj, nj, vd);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收\n removeCpFromOldTree(vd);\n }\n }\n else if(nj.$$type === TYPE_GM && oj && oj.$$type === TYPE_GM) {\n // $geom的multi必须一致\n if(oj.tagName === nj.tagName && oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n }\n // dom类型递归children\n else if(nj.$$type === TYPE_VD && oj && oj.$$type === TYPE_VD) {\n if(oj.tagName === nj.tagName) {\n nj.__inheritAnimate = vd;\n }\n diffChildren(vd, oj, nj);\n }\n }\n}\n\n/**\n * dom类型的vd对比children\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChildren(vd, oj, nj) {\n let oc = oj.children;\n let nc = nj.children;\n let ol = oc.length;\n let nl = nc.length;\n let children = vd.children;\n for(let i = 0, of = 0, nf = 0, len = Math.min(ol, nl); i < len; i++) {\n let o = oc[i + of];\n let n = nc[i + nf];\n // 新老都是key直接跳过\n if(o.key === KEY_FLAG && n.key === KEY_FLAG) {\n }\n // 其中一个是key对比过了调整索引和长度\n else if(o.key === KEY_FLAG) {\n of++;\n i--;\n ol--;\n len = Math.min(ol, nl);\n }\n else if(n.key === KEY_FLAG) {\n nf++;\n i--;\n nl--;\n len = Math.min(ol, nl);\n }\n else {\n diffChild(children[i + of], o, n);\n }\n }\n // 长度不同增减的无需关注,新json创建cp有didMount,老vd会调用cp的destroy\n}\n\n/**\n * 根据json对比看cp如何更新,被render()后的json的二级组件对比才会出现\n * @param oj\n * @param nj\n * @param vd\n */\nfunction diffCp(oj, nj, vd) {\n // props全等,直接替换新json类型为占位符,引用老vd内容,无需重新创建,暂时存在json的placeholder上\n // 否则需要强制触发组件更新,包含setState内容\n nj.__placeholder = vd;\n let sr = vd.shadowRoot;\n // 对比需忽略on开头的事件,直接改老的引用到新的上,这样只变了on的话无需更新\n let exist = {};\n Object.keys(oj.props).forEach(k => {\n let v = oj.props[k];\n exist[k] = v;\n });\n Object.keys(nj.props).forEach(k => {\n let v = nj.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n vd.off(k, exist[k]);\n vd.on(k, v);\n }\n delete exist[k];\n }\n else {\n k = k.slice(2).toLowerCase();\n vd.on(k, v);\n }\n }\n });\n // 新的少的事件取消\n Object.keys(exist).forEach(k => {\n let v = exist[k];\n if(/^on[a-zA-Z]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n delete sr.listener[k];\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n vd.off(k, v);\n }\n });\n checkCp(vd, nj.props, !util.equal(oj.props, nj.props));\n}\n\n/**\n * 深度优先遍历json,将有key的记录在hash中,如果传入根vd,同步递归保存对应位置的vd\n * @param json\n * @param hash\n * @param vd\n * @returns {*}\n */\nfunction getKeyHash(json, hash, vd) {\n if(Array.isArray(json)) {\n json.forEach((item, i) => getKeyHash(item, hash, vd && vd[i]));\n }\n else if(util.isObject(json)) {\n if(json.$$type === TYPE_VD || json.$$type === TYPE_GM || json.$$type === TYPE_CP) {\n // 深度优先\n if(json.$$type === TYPE_VD) {\n getKeyHash(json.children, hash, vd && vd.children);\n }\n let key = json.props.key;\n if(!util.isNil(key) && key !== '') {\n // 重复key错误警告\n if(hash.hasOwnProperty(key)) {\n inject.warn('Component ' + vd.tagName + ' has duplicate key: ' + key);\n }\n hash[key] = {\n json,\n vd,\n };\n }\n }\n }\n return hash;\n}\n\n/**\n * 非一级组件diff发生更新时,其需要从sr的tree中移除,因为sr会销毁\n */\nfunction removeCpFromOldTree(vd) {\n // root下的一级组件不会发生回收情况,忽略\n if(!vd.host) {\n return;\n }\n let parent = vd.parent;\n if(parent) {\n let i = parent.children.indexOf(vd);\n if(i > -1) {\n parent.children[i] = null;\n }\n else {\n throw new Error('Can not find child: ' + vd.tagName);\n }\n }\n}\n\n/**\n * 执行componentDidUpdate/destroy\n */\nfunction did() {\n updateList.forEach(item => {\n if(util.isFunction(item.componentDidUpdate)) {\n item.componentDidUpdate();\n }\n });\n updateList.splice(0);\n removeList.forEach(item => {\n item.__destroy();\n });\n removeList = [];\n}\n\nexport default {\n updateList,\n check,\n did,\n};\n","import util from './util';\nimport level from '../refresh/level';\n\nconst { joinVd, joinDef } = util;\nconst { contain, NONE, TRANSFORM_ALL, OPACITY, FILTER, MIX_BLEND_MODE } = level;\n\nfunction diff(elem, ovd, nvd) {\n let cns = elem.childNodes;\n diffDefs(cns[0], ovd.defs, nvd.defs);\n // = i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinDef(nd[i]));\n }\n }\n}\n\nfunction diffDef(elem, od, nd) {\n if(od.tagName !== nd.tagName) {\n insertAdjacentHTML(elem, 'beforebegin', joinDef(nd));\n // elem.insertAdjacentHTML('beforebegin', joinDef(nd));\n elem.parentNode.removeChild(elem);\n }\n else {\n if(od.uuid !== nd.uuid) {\n elem.setAttribute('id', nd.uuid);\n }\n let op = {};\n for(let i = 0, len = (od.props || []).length; i < len; i++) {\n let prop = od.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nd.props || []).length; i < len; i++) {\n let prop = nd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n let cns = elem.childNodes;\n let ol = od.children.length;\n let nl = nd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, od.children[i], nd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nd.children[i]));\n }\n }\n }\n}\n\nfunction diffChild(elem, ovd, nvd) {\n if(ovd.type === 'dom') {\n if(nvd.type === 'dom') {\n diffD2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffD2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'text') {\n if(nvd.type === 'text') {\n diffT2T(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'geom') {\n if(nvd.type === 'dom') {\n diffG2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffG2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'img') {\n if(nvd.type === 'img') {\n diffItemSelf(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n // 特殊情况,当有连续2个img,后面1个发生error时,其children内容不是type为img的图片,而是矢量图item,会进入此分支\n else if(ovd.type === 'item' && nvd.type === 'item') {\n diffItemSelf(elem, ovd, nvd);\n }\n}\n\nfunction diffX2X(elem, ovd, nvd) {\n let { transform, opacity, visibility, mask, overflow, filter, mixBlendMode, conClip } = nvd;\n if(ovd.transform !== transform) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(ovd.opacity !== opacity) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(ovd.visibility !== visibility) {\n elem.setAttribute('visibility', visibility);\n }\n if(ovd.mask !== mask) {\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n }\n if(ovd.filter !== filter || ovd.mixBlendMode !== mixBlendMode) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('filter');\n }\n }\n // if(ovd.filter !== filter) {\n // if(filter) {\n // elem.setAttribute('filter', filter);\n // }\n // else {\n // elem.removeAttribute('filter');\n // }\n // }\n if(ovd.overflow !== overflow) {\n if(overflow) {\n elem.setAttribute('clipPath', overflow);\n }\n else {\n elem.removeAttribute('overflow');\n }\n }\n if(ovd.conClip !== conClip) {\n if(conClip) {\n elem.childNodes[1].setAttribute('clip-path', conClip);\n }\n else {\n elem.childNodes[1].removeAttribute('clip-path');\n }\n }\n}\n\nfunction diffByLessLv(elem, ovd, nvd, lv) {\n let { transform, opacity, mask, filter, mixBlendMode } = nvd;\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n if(lv === NONE) {\n return;\n }\n if(contain(lv, TRANSFORM_ALL)) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(contain(lv, OPACITY)) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(contain(lv, FILTER) || contain(lv, MIX_BLEND_MODE)) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('style');\n }\n }\n}\n\nfunction diffD2D(elem, ovd, nvd, root) {\n // cache表明children无变化缓存,一定是REPAINT以下的,只需看自身的lv以及mask\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffD2G(elem, ovd, nvd) {\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n replaceWith(cns[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffT2T(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, ovd.children[i], nvd.children[i], true);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffG2D(elem, ovd, nvd) {\n diffD2G(elem, ovd, nvd);\n}\n\nfunction diffG2G(elem, ovd, nvd) {\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n }\n}\n\nfunction diffBb(elem, obb, nbb) {\n let ol = obb.length;\n let nl = nbb.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, obb[i], nbb[i]);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nbb[i]));\n }\n }\n}\n\nfunction diffItem(elem, i, ovd, nvd, isText) {\n let cns = elem.childNodes;\n if(ovd.tagName !== nvd.tagName) {\n replaceWith(cns[i], nvd);\n }\n else {\n diffItemSelf(cns[i], ovd, nvd);\n if(isText && ovd.content !== nvd.content) {\n cns[i].innerHTML = nvd.content;\n }\n }\n}\n\nfunction diffItemSelf(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let op = {};\n for(let i = 0, len = (ovd.props || []).length; i < len; i++) {\n let prop = ovd.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nvd.props || []).length; i < len; i++) {\n let prop = nvd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n}\n\nfunction replaceWith(elem, vd) {\n let res;\n if(Array.isArray(vd)) {\n res = '';\n vd.forEach(item => {\n res += joinVd(item);\n });\n }\n else {\n res = joinVd(vd);\n }\n insertAdjacentHTML(elem, 'beforebegin', res);\n // elem.insertAdjacentHTML('beforebegin', res);\n elem.parentNode.removeChild(elem);\n}\n\nfunction insertAt(elem, cns, index, html) {\n if(index >= cns.length) {\n insertAdjacentHTML(elem, 'beforeend', html);\n // elem.insertAdjacentHTML('beforeend', html);\n }\n else {\n insertAdjacentHTML(cns[index], 'beforebegin', html);\n // cns[index].insertAdjacentHTML('beforebegin', html);\n }\n}\n\nfunction removeAt(elem, cns, index) {\n if(cns[index]) {\n elem.removeChild(cns[index]);\n }\n}\n\nlet svg;\nfunction insertAdjacentHTML(elem, where, content) {\n if(elem.insertAdjacentHTML) {\n elem.insertAdjacentHTML(where, content);\n }\n else {\n switch(where) {\n case 'beforeend':\n elem.innerHTML += content;\n break;\n case 'beforebegin':\n svg = svg || document.createElement('svg');\n svg.innerHTML = content;\n elem.parentNode.insertBefore(svg.childNodes[0], elem);\n break;\n }\n }\n}\n\nexport default diff;\n","import util from '../util/util';\n\nconst { isFunction } = util;\n\nclass Controller {\n constructor() {\n this.__records = []; // 默认记录和自动记录\n this.__records2 = []; // 非自动播放的动画记录\n this.__list = [] // 默认初始化播放列表,自动播放也存这里\n this.__list2 = []; // json中autoPlay为false的初始化存入这里\n this.__onList = []; // list中已存在的侦听事件,list2初始化时也需要增加上\n this.__lastTime = {}; // 每个类型的上次触发时间,防止重复emit\n }\n\n add(v, list = this.list) {\n if(list.indexOf(v) === -1) {\n list.push(v);\n }\n }\n\n remove(v) {\n let i = this.list.indexOf(v);\n if(i > -1) {\n this.list.splice(i, 1);\n }\n }\n\n __destroy() {\n this.__records = [];\n this.__records2 = [];\n this.__list = [];\n this.__list2 = [];\n }\n\n __action(k, args) {\n this.list.forEach(item => {\n item[k].apply(item, args);\n });\n }\n\n init(records = this.__records, list = this.list) {\n // 检查尚未初始化的record,并初始化,后面才能调用各种控制方法\n if(records.length) {\n // 清除防止重复调用,并且新的json还会进入整体逻辑\n records.splice(0).forEach(item => {\n let { target, animate } = item;\n if(target.isDestroyed) {\n return;\n }\n if(Array.isArray(animate)) {\n animate.forEach(animate => {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n });\n }\n else {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n }\n });\n }\n // 非自动播放后初始化需检测事件,给非自动播放添加上,并清空本次\n if(records === this.__records2) {\n let onList = this.__onList;\n let list2 = this.list2;\n if(list2.length && onList.length) {\n list2.forEach(item => {\n onList.forEach(arr => {\n item.off(arr[0], arr[1]);\n item.on(arr[0], arr[1]);\n });\n });\n }\n }\n }\n\n __playAuto() {\n this.init();\n this.__action('play');\n }\n\n play(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('play', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n pause() {\n this.__action('pause');\n }\n\n resume(cb) {\n let once = true;\n this.__action('resume', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n __mergeAuto() {\n this.init();\n this.init(this.__records2);\n if(this.__list2.length) {\n this.__list = this.__list.concat(this.__list2);\n this.__list2 = [];\n }\n }\n\n cancel(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('cancel', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n finish(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('finish', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndStop(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n let once = true;\n this.__action('gotoAndStop', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndPlay(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n let once = true;\n this.__action('gotoAndPlay', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.__on(id[i], handle);\n }\n this.__onList.push([id, handle]);\n }\n else {\n this.__on(id, handle);\n this.__onList.push([id, handle]);\n }\n }\n\n __on(id, handle) {\n this.list.forEach(item => {\n let cb = () => {\n let time = item.timestamp;\n if(time !== this.__lastTime[id]) {\n this.__lastTime[id] = time;\n handle();\n }\n };\n cb.__karasEventCb = handle;\n item.on(id, cb);\n });\n }\n\n off(id, handle) {\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.off(id[i], handle);\n }\n }\n else {\n this.list.forEach(item => {\n item.off(id, handle);\n });\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get list2() {\n return this.__list2;\n }\n\n __set(key, value) {\n this.list.forEach(item => {\n item[key] = value;\n });\n }\n\n set playbackRate(v) {\n this.__set('playbackRate', v);\n }\n\n set iterations(v) {\n this.__set('iterations', v);\n }\n\n set playCount(v) {\n this.__set('playCount', v);\n }\n\n set fps(v) {\n this.__set('fps', v);\n }\n\n set currentTime(v) {\n this.__set('currentTime', v);\n }\n\n set spfLimit(v) {\n this.__set('spfLimit', v);\n }\n\n set delay(v) {\n this.__set('delay', v);\n }\n\n set endDelay(v) {\n this.__set('endDelay', v);\n }\n\n set fill(v) {\n this.__set('fill', v);\n }\n\n set direction(v) {\n this.__set('direction', v);\n }\n}\n\nexport default Controller;\n","import inject from '../util/inject';\nimport painter from '../util/painter';\n\nconst { canvasPolygon } = painter;\n\n// 无cache时应用离屏时的优先级,从小到大,OFFSCREEN_MASK2是个特殊的\nconst OFFSCREEN_OVERFLOW = 0;\nconst OFFSCREEN_FILTER = 1;\nconst OFFSCREEN_MASK = 2;\nconst OFFSCREEN_BLEND = 3;\nconst OFFSCREEN_MASK2 = 4;\n\nfunction applyOffscreen(ctx, list, width, height) {\n list.sort(function(a, b) {\n if(a[1] === b[1]) {\n if(a[0] === b[0]) {\n return a[2] - b[2];\n }\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n list.forEach(item => {\n let [, , type, offscreen] = item;\n if(type === OFFSCREEN_OVERFLOW) {\n let { matrix, target, ctx: origin, x, y, offsetWidth, offsetHeight, list } = offscreen;\n ctx.globalCompositeOperation = 'destination-in';\n ctx.globalAlpha = 1;\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n ctx.fillStyle = '#FFF';\n ctx.beginPath();\n if(list) {\n canvasPolygon(ctx, list);\n }\n else {\n ctx.rect(x, y, offsetWidth, offsetHeight);\n }\n ctx.fill();\n ctx.closePath();\n ctx.globalCompositeOperation = 'source-over';\n target.draw();\n ctx = origin;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n 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, 'filter');\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\nexport default {\n OFFSCREEN_OVERFLOW,\n OFFSCREEN_FILTER,\n OFFSCREEN_MASK,\n OFFSCREEN_BLEND,\n OFFSCREEN_MASK2,\n applyOffscreen,\n};\n","import Page from '../refresh/Page';\nimport inject from '../util/inject';\n\nclass MockPage {\n constructor(texture, width, height) {\n this.uuid = Page.genUuid();\n this.time = inject.now();\n this.texture = texture;\n this.width = width;\n this.height = height;\n }\n}\n\nexport default MockPage;\n","import MockPage from './MockPage';\n\n/**\n * 一个fbo离屏纹理,mock成cache,当webgl需要局部根节点汇总时生成,即cacheTotal,\n * 基于此纹理进行filter、mask等后处理渲染\n */\nclass MockCache {\n constructor(gl, texture, sx1, sy1, width, height, bbox) {\n this.gl = gl;\n this.x = 0;\n this.y = 0;\n this.sx1 = sx1;\n this.sy1 = sy1;\n this.width = width;\n this.height = height;\n this.bbox = bbox;\n this.available = true;\n this.__page = new MockPage(texture, width, height);\n this.dx = -bbox[0];\n this.dy = -bbox[1];\n this.dbx = sx1 - bbox[0];\n this.dby = sy1 - bbox[1];\n }\n\n release() {\n this.available = false;\n this.gl.deleteTexture(this.page.texture);\n }\n\n get page() {\n return this.__page;\n }\n}\n\nexport default MockCache;\n","import Cache from './Cache';\nimport offscreen from './offscreen';\nimport Text from '../node/Text';\nimport Dom from '../node/Dom';\nimport Img from '../node/Img';\nimport mode from '../node/mode';\nimport mx from '../math/matrix';\nimport geom from '../math/geom';\nimport level from './level';\nimport painter from '../util/painter';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport tf from '../style/transform';\nimport mbm from '../style/mbm';\nimport enums from '../util/enums';\nimport webgl from '../gl/webgl';\nimport MockCache from '../gl/MockCache';\nimport blur from '../math/blur';\nimport vertexBlur from '../gl/filter/blur.vert';\nimport fragmentBlur from '../gl/filter/blur.frag';\nimport vertexMbm from '../gl/mbm/mbm.vert';\nimport fragmentMultiply from '../gl/mbm/multiply.frag';\nimport fragmentScreen from '../gl/mbm/screen.frag';\nimport fragmentOverlay from '../gl/mbm/overlay.frag';\nimport fragmentDarken from '../gl/mbm/darken.frag';\nimport fragmentLighten from '../gl/mbm/lighten.frag';\nimport fragmentColorDodge from '../gl/mbm/color-dodge.frag';\nimport fragmentColorBurn from '../gl/mbm/color-burn.frag';\nimport fragmentHardLight from '../gl/mbm/hard-light.frag';\nimport fragmentSoftLight from '../gl/mbm/soft-light.frag';\nimport fragmentDifference from '../gl/mbm/difference.frag';\nimport fragmentExclusion from '../gl/mbm/exclusion.frag';\nimport fragmentHue from '../gl/mbm/hue.frag';\nimport fragmentSaturation from '../gl/mbm/saturation.frag';\nimport fragmentColor from '../gl/mbm/color.frag';\nimport fragmentLuminosity from '../gl/mbm/luminosity.frag';\n\nconst { NA, LOCAL, CHILD, SELF, getCache } = Cache;\nconst {\n OFFSCREEN_OVERFLOW,\n OFFSCREEN_FILTER,\n OFFSCREEN_MASK,\n OFFSCREEN_BLEND,\n OFFSCREEN_MASK2,\n applyOffscreen,\n} = offscreen;\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n OPACITY,\n VISIBILITY,\n FILTER,\n OVERFLOW,\n MIX_BLEND_MODE,\n FILL,\n TRANSFORM,\n TRANSFORM_ORIGIN,\n PERSPECTIVE,\n PERSPECTIVE_ORIGIN,\n PADDING_LEFT,\n PADDING_RIGHT,\n PADDING_TOP,\n PADDING_BOTTOM,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n MATRIX,\n },\n NODE_KEY: {\n NODE_CACHE,\n NODE_CACHE_TOTAL,\n NODE_CACHE_OVERFLOW,\n NODE_CACHE_MASK,\n NODE_CACHE_FILTER,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n NODE_OPACITY,\n NODE_COMPUTED_STYLE,\n NODE_CURRENT_STYLE,\n NODE_LIMIT_CACHE,\n NODE_REFRESH_LV,\n NODE_CACHE_STYLE,\n NODE_DEFS_CACHE,\n NODE_IS_MASK,\n NODE_DOM_PARENT,\n NODE_PERSPECTIVE_MATRIX,\n NODE_VIRTUAL_DOM,\n NODE_CACHE_AS_BITMAP,\n NODE_STRUCT,\n },\n STRUCT_KEY: {\n STRUCT_NODE,\n STRUCT_INDEX,\n STRUCT_TOTAL,\n STRUCT_HAS_MASK,\n STRUCT_LV,\n },\n} = enums;\nconst {\n NONE,\n TRANSFORM_ALL,\n OPACITY: OP,\n FILTER: FT,\n REPAINT,\n contain,\n MIX_BLEND_MODE: MBM,\n PERSPECTIVE: PPT,\n} = level;\nconst { isE, inverse, multiply } = mx;\nconst { mbmName, isValidMbm } = mbm;\nconst { assignMatrix, transformBbox } = util;\n\n/**\n * 生成一个节点及其子节点所包含的矩形范围盒,canvas和webgl的最大尺寸限制不一样,由外部传入\n * 如果某个子节点超限,则视为整个超限,超限返回空\n * @param node\n * @param __structs\n * @param index\n * @param total\n * @param parentIndexHash\n * @param opacityHash\n * @param MAX\n * @param includeLimitCache webgl时即便超限也要强制生成total,所以标识不能跳出\n * @returns {*}\n */\nfunction genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHash, MAX, includeLimitCache) {\n let { __sx1: sx1, __sy1: sy1, __config } = node;\n let {\n [NODE_CACHE]: cache,\n [NODE_COMPUTED_STYLE]: {\n [FILTER]: filter,\n [PERSPECTIVE]: perspective,\n [PERSPECTIVE_ORIGIN]: perspectiveOrigin,\n },\n } = __config;\n // 先将局部根节点的bbox算好,可能没内容是空\n let bboxTotal;\n if(cache && cache.available) {\n bboxTotal = cache.bbox.slice(0);\n }\n else {\n bboxTotal = node.bbox.slice(0);\n }\n // 局部根节点如有perspective,则计算pm,这里不会出现嵌套,因为每个出现都会生成局部根节点\n let pm;\n if(perspective) {\n pm = tf.calPerspectiveMatrix(perspective, perspectiveOrigin);\n }\n // 广度遍历,不断一层层循环下去,用2个hash暂存每层的父matrix和opacity,blur只需记住顶层,因为子的如果有一定是cacheFilter\n let list = [index];\n let d = 0;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n d = blur.outerSize(v);\n }\n });\n opacityHash[index] = 1;\n // opacity可以保存下来层级相乘结果供外部使用,但matrix不可以,因为这里按画布原点为坐标系计算,外部合并局部根节点以bbox左上角为原点\n let matrixHash = {};\n while(list.length) {\n let arr = list.splice(0);\n for(let i = 0, len = arr.length; i < len; i++) {\n let parentIndex = arr[i];\n let total = __structs[parentIndex][STRUCT_TOTAL] || 0;\n for(let i = parentIndex + 1, len = parentIndex + total + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node2,\n [STRUCT_TOTAL]: total,\n } = __structs[i];\n // mask也不占bbox位置\n if(node2.isMask) {\n continue;\n }\n let {\n __sx1,\n __sy1,\n __config: {\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [OPACITY]: opacity,\n },\n },\n } = node2;\n // webgl不能跳过超限\n if(limitCache && !includeLimitCache) {\n return;\n }\n // display:none跳过整个节点树,visibility只跳过自身\n if(display === 'none') {\n i += total || 0;\n continue;\n }\n if(visibility === 'hidden') {\n continue;\n }\n parentIndexHash[i] = parentIndex;\n opacityHash[i] = opacityHash[parentIndex] * opacity;\n // 防止text的情况,其一定属于某个node,其bbox被计算过,text不应该计算\n if(node2 instanceof Text) {\n continue;\n }\n let bbox, dx = 0, dy = 0, hasTotal;\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n bbox = target.bbox.slice(0);\n dx = target.dbx;\n dy = target.dby;\n i += total || 0;\n hasTotal = true;\n }\n else if(__cache && __cache.available) {\n bbox = __cache.bbox.slice(0);\n dx = __cache.dbx;\n dy = __cache.dby;\n }\n else {\n bbox = node2.bbox.slice(0);\n }\n // 可能Xom没有内容\n if(bbox) {\n bbox[0] -= sx1;\n bbox[1] -= sy1;\n bbox[2] -= sx1;\n bbox[3] -= sy1;\n let matrix = matrixHash[parentIndex];\n // 父级matrix初始化E为null,自身不为E时才运算,可以加速\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n tfo[0] += __sx1 - sx1 + dx;\n tfo[1] += __sy1 - sy1 + dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(pm) {\n matrix = multiply(pm, matrix);\n }\n bbox = transformBbox(bbox, matrix, d, d);\n // 有孩子才继续存入下层级广度运算\n if(total && !hasTotal) {\n list.push(i);\n }\n mergeBbox(bboxTotal, bbox, sx1, sy1);\n }\n }\n }\n }\n return [bboxTotal, pm];\n}\n\nfunction mergeBbox(bbox, t, sx1, sy1) {\n bbox[0] = Math.min(bbox[0], sx1 + t[0]);\n bbox[1] = Math.min(bbox[1], sy1 + t[1]);\n bbox[2] = Math.max(bbox[2], sx1 + t[2]);\n bbox[3] = Math.max(bbox[3], sy1 + t[3]);\n}\n\n/**\n * 生成局部根节点离屏缓存,超限时除外\n * cache是每个节点自身的缓存,且共享离屏canvas\n * cacheTotal是基础\n * cacheFilter基于total\n * cacheOverflow基于filter\n * cacheMask基于overflow\n * cacheBlend基于mask\n * @param renderMode\n * @param node\n * @param config\n * @param index\n * @param lv\n * @param total\n * @param __structs\n * @param hasMask\n * @param width\n * @param height\n * @returns {{enabled}|Cache|*}\n */\nfunction genTotal(renderMode, node, config, index, lv, total, __structs, hasMask, width, height) {\n let {\n [NODE_CACHE_TOTAL]: cacheTotal,\n [NODE_CACHE_FILTER]: cacheFilter,\n [NODE_CACHE_MASK]: cacheMask,\n [NODE_CACHE_OVERFLOW]: cacheOverflow,\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = config;\n let needGen;\n // 先绘制形成基础的total,有可能已经存在无变化,就可省略\n if(!cacheTotal || !cacheTotal.available) {\n needGen = true; // total重新生成了,其它基于的也一定需要重新生成\n let bboxTotal, baseMatrix;\n let { __sx1: sx1, __sy1: sy1 } = node;\n // 栈代替递归,存父节点的matrix/opacity,matrix为E时存null省略计算\n let matrixList = [];\n let parentMatrix;\n let opacityList = [];\n let parentOpacity = 1;\n let lastConfig;\n let lastLv = lv;\n // 先遍历每个节点,以局部根节点左上角为原点,求得所占的总的bbox,即合并所有bbox\n for(let i = index, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // 排除Text\n if(node instanceof Text) {\n continue;\n }\n let __config = node.__config;\n let {\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_IS_MASK]: isMask,\n } = __config;\n // 跳过display:none元素和它的所有子节点和mask\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // mask不占bbox,本身除外\n if(i !== index && isMask) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,根节点是第一个特殊处理\n if(i === index) {}\n else if(lv > lastLv) {\n parentMatrix = lastConfig[NODE_MATRIX_EVENT];\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n parentOpacity = lastConfig[NODE_OPACITY];\n opacityList.push(parentOpacity);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n opacityList.splice(-diff);\n parentOpacity = opacityList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastConfig = __config;\n lastLv = lv;\n let {\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_CACHE_STYLE]: __cacheStyle,\n } = __config;\n let matrix, opacity;\n /**\n * lv=REPAINT重新渲染,bbox重新生成,matrix重新生成,filter重新生成\n */\n else {\n node.__bbox = null;\n if(i === index) {\n node.__calFilter(currentStyle, computedStyle);\n }\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n opacity = computedStyle[OPACITY] = currentStyle[OPACITY];\n }\n // opacity可临时赋值下面循环渲染用,matrixEvent可能需重新计算,因为局部根节点为E没考虑继承,这里仅计算bbox用\n if(i === index) {\n opacity = 1;\n baseMatrix = matrix;\n matrix = mx.identity();\n }\n else if(!isE(parentMatrix)) {\n matrix = multiply(parentMatrix, matrix);\n }\n assignMatrix(__config[NODE_MATRIX_EVENT], matrix);\n __config[NODE_OPACITY] = parentOpacity * opacity;\n let bbox;\n // 子元素有cacheTotal优先使用,一定是子元素,局部根节点available为false不会进\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n bbox = target.bbox;\n }\n else {\n bbox = node.bbox;\n }\n // 老的不变,新的会各自重新生成,根据matrixEvent合并bboxTotal\n bbox = transformBbox(bbox, matrix, 0, 0);\n if(i === index) {\n bboxTotal = bbox.slice(0);\n }\n else {\n mergeBbox(bboxTotal, bbox, 0, 0);\n }\n }\n // 生成cacheTotal,获取偏移dx/dy\n config[NODE_CACHE_TOTAL] = cacheTotal = Cache.getInstance(bboxTotal, sx1, sy1);\n if(!cacheTotal || !cacheTotal.enabled) {\n return;\n }\n cacheTotal.__available = true;\n let { dx, dy, dbx, dby, x: tx, y: ty } = cacheTotal;\n let ctxTotal = cacheTotal.ctx;\n /**\n * 再次遍历每个节点,以局部根节点左上角为基准原点,将所有节点绘制上去\n * 每个子节点的opacity有父继承计算在上面循环已经做好了,直接获取\n * 但matrixEvent可能需要重算,因为原点不一定是根节点的原点,影响tfo\n * 另外每个节点的refreshLevel需要设置REPAINT\n * 这样cacheTotal取消时子节点需确保重新计算一次matrix/opacity/filter,保证下次和父元素继承正确\n */\n parentMatrix = null;\n let lastMatrix;\n lastLv = lv;\n // 和外面没cache的类似,mask生成hash记录\n let maskStartHash = {};\n let offscreenHash = {};\n for(let i = index, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // 排除Text\n if(node instanceof Text) {\n node.render(renderMode, REPAINT, ctxTotal, CHILD, dx, dy);\n if(offscreenHash.hasOwnProperty(i)) {\n ctxTotal = applyOffscreen(ctxTotal, offscreenHash[i], width, height);\n }\n }\n else {\n let __config = node.__config;\n let {\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = __config;\n if(maskStartHash.hasOwnProperty(i)) {\n let [idx, n, offscreenMask] = maskStartHash[i];\n let target = inject.getCacheCanvas(width, height, null, 'mask2');\n offscreenMask.mask = target; // 应用mask用到\n offscreenMask.isClip = node.isClip;\n // 定位到最后一个mask元素上的末尾\n let j = i + (total || 0) + 1;\n while(--n) {\n let { [STRUCT_TOTAL]: total } = __structs[j];\n j += (total || 0) + 1;\n }\n j--;\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([idx, lv, OFFSCREEN_MASK, offscreenMask]);\n list.push([j, lv, OFFSCREEN_MASK2, {\n ctx: ctxTotal, // 保存等待OFFSCREEN_MASK2时还原\n target,\n }]);\n ctxTotal = target.ctx;\n }\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,根节点是第一个特殊处理\n if(i === index) {}\n else if(lv > lastLv) {\n parentMatrix = lastMatrix;\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n let {\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: tfo,\n [DISPLAY]: display,\n } = computedStyle;\n // 特殊渲染的matrix,局部根节点为原点考虑,当需要计算时再计算\n let m;\n if(i !== index && (!isE(parentMatrix) || !isE(transform))) {\n tfo = tfo.slice(0);\n tfo[0] += dbx + node.__sx1 - sx1 + tx;\n tfo[1] += dby + node.__sy1 - sy1 + ty;\n m = tf.calMatrixByOrigin(transform, tfo);\n if(!isE(parentMatrix)) {\n m = multiply(parentMatrix, m);\n }\n }\n else {\n m = null;\n }\n if(m) {\n ctxTotal.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]);\n }\n else {\n ctxTotal.setTransform(1, 0, 0, 1, 0, 0);\n }\n lastLv = lv;\n lastMatrix = m;\n // 子元素有cacheTotal优先使用,也一定是子元素,局部根节点不会进\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(i !== index && target) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n // 跳过display:none元素和它的所有子节点\n if(display === 'none') {\n continue;\n }\n let mixBlendMode = computedStyle[MIX_BLEND_MODE];\n if(isValidMbm(mixBlendMode)) {\n ctxTotal.globalCompositeOperation = mbmName(mixBlendMode);\n }\n else {\n ctxTotal.globalCompositeOperation = 'source-over';\n }\n ctxTotal.globalAlpha = __config[NODE_OPACITY];\n Cache.drawCache(target, cacheTotal);\n ctxTotal.globalCompositeOperation = 'source-over';\n }\n else {\n if(refreshLevel >= REPAINT) {\n // 手动计算cacheStyle和根据border-box的坐标再渲染\n node.__calCache(renderMode, ctxTotal, __config[NODE_DOM_PARENT],\n __config[NODE_CACHE_STYLE], __config[NODE_CURRENT_STYLE], computedStyle,\n node.clientWidth, node.clientHeight, node.offsetWidth, node.offsetHeight,\n computedStyle[BORDER_TOP_WIDTH], computedStyle[BORDER_RIGHT_WIDTH],\n computedStyle[BORDER_BOTTOM_WIDTH], computedStyle[BORDER_LEFT_WIDTH],\n computedStyle[PADDING_TOP], computedStyle[PADDING_RIGHT],\n computedStyle[PADDING_BOTTOM], computedStyle[PADDING_LEFT],\n node.__sx1, node.__sx2, node.__sx3, node.__sx4, node.__sx5, node.__sx6,\n node.__sy1, node.__sy2, node.__sy3, node.__sy4, node.__sy5, node.__sy6);\n }\n let res = node.render(renderMode, refreshLevel, ctxTotal, i === index ? LOCAL : CHILD, dx, dy);\n __config[NODE_REFRESH_LV] = REPAINT;\n let { offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow } = res || {};\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_BLEND, offscreenBlend]);\n ctxTotal = offscreenBlend.target.ctx;\n }\n // 被遮罩的节点要为第一个遮罩和最后一个遮罩的索引打标,被遮罩的本身在一个离屏canvas,遮罩的元素在另外一个\n // 最后一个遮罩索引因数量不好计算,放在maskStartHash做\n if(offscreenMask) {\n let j = i + (total || 0);\n maskStartHash[j + 1] = [i, hasMask, offscreenMask];\n ctxTotal = offscreenMask.target.ctx;\n }\n // filter造成的离屏,需要将后续一段孩子节点区域的ctx替换,并在结束后应用结果,再替换回来\n if(offscreenFilter) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_FILTER, offscreenFilter]);\n ctxTotal = offscreenFilter.target.ctx;\n }\n // overflow:hidden的离屏,最后孩子进行截取\n if(offscreenOverflow) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_OVERFLOW, offscreenOverflow]);\n ctxTotal = offscreenOverflow.target.ctx;\n }\n // 离屏应用,按照lv从大到小即子节点在前先应用,同一个节点多个效果按offscreen优先级从小到大来,\n // 由于mask特殊索引影响,所有离屏都在最后一个mask索引判断,此时mask本身优先结算,以index序大到小判断\n if(offscreenHash.hasOwnProperty(i)) {\n ctxTotal = applyOffscreen(ctxTotal, offscreenHash[i], width, height);\n }\n // render后判断可见状态,此时computedStyle才有值\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n // 恢复,且局部根节点设置NONE\n assignMatrix(config[NODE_MATRIX_EVENT], baseMatrix);\n config[NODE_REFRESH_LV] = NONE;\n }\n // cacheTotal仍在说明 lastLv) {\n parentMatrix = lastMatrix;\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n parentOpacity = lastOpacity;\n opacityList.push(parentOpacity);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n opacityList.splice(-diff);\n parentOpacity = opacityList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastLv = lv;\n // 计算临时的matrix\n let {\n [DISPLAY]: display,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: tfo,\n } = computedStyle;\n // 特殊渲染的matrix,局部根节点为原点考虑,本节点需inverse反向\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n // 跳过display:none元素和它的所有子节点\n if(display === 'none') {\n continue;\n }\n let mixBlendMode = computedStyle[MIX_BLEND_MODE];\n if(isValidMbm(mixBlendMode)) {\n ctx.globalCompositeOperation = mbmName(mixBlendMode);\n }\n else {\n ctx.globalCompositeOperation = 'source-over';\n }\n ctx.globalAlpha = __config[NODE_OPACITY];\n Cache.drawCache(target, cacheMask, transform, mx.identity(), tfo.slice(0), parentMatrix, inverse);\n ctx.globalCompositeOperation = 'source-over';\n }\n // 等于将外面bbox计算和渲染合一的过程,但不需要bbox本身的内容\n else {\n let {\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_CACHE_STYLE]: __cacheStyle,\n } = __config;\n let matrix, opacity;\n if(refreshLevel < REPAINT) {\n if(contain(refreshLevel, TRANSFORM_ALL)) {\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n if(contain(refreshLevel, OP)) {\n computedStyle[OPACITY] = currentStyle[OPACITY];\n }\n opacity = computedStyle[OPACITY];\n if(contain(refreshLevel, FT)) {\n node.__bbox = null;\n node.__calFilter(currentStyle, computedStyle);\n }\n matrix = __config[NODE_MATRIX];\n if(contain(refreshLevel, MBM)) {\n computedStyle[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE];\n }\n }\n else {\n node.__bbox = null;\n if(i === index) {\n node.__calFilter(currentStyle, computedStyle);\n }\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n opacity = computedStyle[OPACITY] = currentStyle[OPACITY];\n }\n // opacity可临时赋值下面循环渲染用,matrixEvent可能需重新计算,因为局部根节点为E没考虑继承,这里仅计算bbox用\n if(i === index) {\n opacity = 1;\n matrix = mx.identity();\n }\n else if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n assignMatrix(__config[NODE_MATRIX_EVENT], matrix);\n lastOpacity = __config[NODE_OPACITY] = parentOpacity * opacity;\n // 特殊渲染的matrix,局部根节点为原点考虑,当需要计算时再计算\n let m;\n if(i !== index && (!isE(parentMatrix) || !isE(transform))) {\n tfo = tfo.slice(0);\n tfo[0] += dbx + node.__sx1 - sx1 + tx;\n tfo[1] += dby + node.__sy1 - sy1 + ty;\n m = tf.calMatrixByOrigin(transform, tfo);\n if(!isE(parentMatrix)) {\n m = multiply(parentMatrix, m);\n }\n }\n else {\n m = null;\n }\n lastMatrix = m;\n if(m) {\n // 很多情况mask和target相同matrix,可简化计算\n if(util.equalArr(m, inverse)) {\n m = mx.identity();\n }\n else {\n inverse = mx.inverse(inverse);\n m = mx.multiply(inverse, m);\n }\n }\n if(m) {\n ctx.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]);\n }\n else {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n }\n if(refreshLevel >= REPAINT) {\n // 手动计算cacheStyle和根据border-box的坐标再渲染\n node.__calCache(renderMode, ctx, __config[NODE_DOM_PARENT],\n __config[NODE_CACHE_STYLE], __config[NODE_CURRENT_STYLE], computedStyle,\n node.clientWidth, node.clientHeight, node.offsetWidth, node.offsetHeight,\n computedStyle[BORDER_TOP_WIDTH], computedStyle[BORDER_RIGHT_WIDTH],\n computedStyle[BORDER_BOTTOM_WIDTH], computedStyle[BORDER_LEFT_WIDTH],\n computedStyle[PADDING_TOP], computedStyle[PADDING_RIGHT],\n computedStyle[PADDING_BOTTOM], computedStyle[PADDING_LEFT],\n node.__sx1, node.__sx2, node.__sx3, node.__sx4, node.__sx5, node.__sx6,\n node.__sy1, node.__sy2, node.__sy3, node.__sy4, node.__sy5, node.__sy6);\n }\n let res = node.render(renderMode, refreshLevel, ctx, CHILD, dx, dy);\n __config[NODE_REFRESH_LV] = REPAINT;\n let { offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow } = res || {};\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_BLEND, offscreenBlend]);\n ctx = offscreenBlend.target.ctx;\n }\n // 被遮罩的节点要为第一个遮罩和最后一个遮罩的索引打标,被遮罩的本身在一个离屏canvas,遮罩的元素在另外一个\n // 最后一个遮罩索引因数量不好计算,放在maskStartHash做\n if(offscreenMask) {\n let j = i + (total || 0);\n maskStartHash[j + 1] = [i, hasMask, offscreenMask];\n ctx = offscreenMask.target.ctx;\n }\n // filter造成的离屏,需要将后续一段孩子节点区域的ctx替换,并在结束后应用结果,再替换回来\n if(offscreenFilter) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_FILTER, offscreenFilter]);\n ctx = offscreenFilter.target.ctx;\n }\n // overflow:hidden的离屏,最后孩子进行截取\n if(offscreenOverflow) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_OVERFLOW, offscreenOverflow]);\n ctx = offscreenOverflow.target.ctx;\n }\n // 离屏应用,按照lv从大到小即子节点在前先应用,同一个节点多个效果按offscreen优先级从小到大来,\n // 由于mask特殊索引影响,所有离屏都在最后一个mask索引判断,此时mask本身优先结算,以index序大到小判断\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n // render后判断可见状态,此时computedStyle才有值\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n });\n }\n }\n}\n\nfunction genFilter(node, cache, v) {\n return Cache.genFilter(cache, v);\n}\n\nfunction genMask(node, cache, cb) {\n return Cache.genMask(cache, node, cb);\n}\n\nfunction genOverflow(node, cache) {\n let sbox = node.bbox;\n let bbox = cache.bbox;\n // 没超过无需生成\n if(bbox[0] >= sbox[0] && bbox[1] >= sbox[1] && bbox[2] <= sbox[2] && bbox[3] <= sbox[3]) {\n return;\n }\n return Cache.genOverflow(cache, node);\n}\n\nfunction resetMatrixCacheTotal(__structs, index, total, lv, matrixEvent) {\n let matrixList = [];\n let parentMatrix;\n let lastMatrix = matrixEvent;\n let lastLv = lv;\n for(let i = index + 1, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // 排除Text\n if(node instanceof Text) {\n continue;\n }\n let __config = node.__config;\n let {\n [NODE_MATRIX_EVENT]: old,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_CACHE_STYLE]: cacheStyle,\n } = __config;\n // 跳过display:none元素和它的所有子节点和mask\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树\n if(lv > lastLv) {\n parentMatrix = lastMatrix;\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastLv = lv;\n old = old.slice(0);\n // 计算真正的相对于root原点的matrix\n cacheStyle[MATRIX] = null;\n let matrix = node.__calMatrix(REPAINT, cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n if(!isE(parentMatrix)) {\n matrix = multiply(parentMatrix, matrix);\n }\n assignMatrix(__config[NODE_MATRIX_EVENT], matrix);\n lastMatrix = matrix;\n // 深度遍历递归进行\n if(__cacheTotal && __cacheTotal.available) {\n let needReset = __cacheTotal.isNew;\n if(!needReset && !util.equalArr(old, matrix)) {\n needReset = true;\n }\n if(needReset) {\n resetMatrixCacheTotal(__structs, i, total || 0, lv, matrix);\n }\n __cacheTotal.__isNew = false;\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n}\n\n/**\n * canvas/webgl支持任意节点为mask,不像svg仅单节点\n * hasMask的num是指遮罩对象后面的兄弟节点数,需要换算成包含子节点的总数\n * @param __structs\n * @param start\n * @param hasMask\n */\nfunction countMaskNum(__structs, start, hasMask) {\n let count = 0;\n while(hasMask--) {\n let {\n [STRUCT_TOTAL]: total,\n } = __structs[start];\n count += total || 0;\n start += total || 0;\n // total不算自身,所以还得+1\n count++;\n start++;\n }\n return count;\n}\n\n// webgl不太一样,使用fbo离屏绘制到一个纹理上进行汇总\nfunction genFrameBufferWithTexture(gl, texCache, width, height) {\n let n = texCache.lockOneChannel();\n let texture = webgl.createTexture(gl, null, n, width, height);\n let frameBuffer = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n let check = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\n if(check !== gl.FRAMEBUFFER_COMPLETE) {\n inject.error('Framebuffer object is incomplete: ' + check.toString());\n }\n // 离屏窗口0开始\n gl.viewport(0, 0, width, height);\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n return [n, frameBuffer, texture];\n}\n\n/**\n * 局部根节点复合图层生成,汇总所有子节点到一颗局部树上的位图缓存,包含超限特殊情况\n * 即便只有自己一个也要返回,因为webgl生成total的原因是有类似filter/mask等必须离屏处理的东西\n * @param gl\n * @param texCache\n * @param node\n * @param __config\n * @param index\n * @param total\n * @param __structs\n * @param cache\n * @param limitCache\n * @param hasMbm\n * @param W\n * @param H\n * @returns {*}\n */\nfunction genTotalWebgl(gl, texCache, node, __config, index, total, __structs, cache, limitCache, hasMbm, W, H) {\n // 存每层父亲的matrix和opacity和index,bbox计算过程中生成,缓存给下面渲染过程用\n let parentIndexHash = {};\n let opacityHash = {};\n let [bboxTotal, parentPm] = genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHash,\n gl.getParameter(gl.MAX_TEXTURE_SIZE), limitCache);\n // 可能局部根节点合成过程中发现整体超限\n let totalLimitCache;\n if(!bboxTotal) {\n totalLimitCache = true;\n }\n // 超限情况生成画布大小的特殊纹理\n if(limitCache || totalLimitCache) {\n bboxTotal = [0, 0, W, H];\n }\n let width = bboxTotal[2] - bboxTotal[0];\n let height = bboxTotal[3] - bboxTotal[1];\n let [n, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 以bboxTotal的左上角为原点生成离屏texture\n let { __sx1: sx1, __sy1: sy1 } = node;\n let cx = width * 0.5, cy = height * 0.5;\n let dx = -bboxTotal[0], dy = -bboxTotal[1];\n let dbx = sx1 - bboxTotal[0], dby = sy1 - bboxTotal[1];\n // 先绘制自己的cache,起点所以matrix视作E为空,opacity固定1\n if(cache && cache.available) {\n texCache.addTexAndDrawWhenLimit(gl, cache, 1, null, cx, cy, dx, dy, false);\n }\n // limitCache无cache需先绘制到统一的离屏画布上\n else if(limitCache) {\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(mode.WEBGL, 0, gl, NA, 0, 0);\n let j = texCache.lockOneChannel();\n let texture = webgl.createTexture(gl, c.canvas, j);\n let mockCache = new MockCache(gl, texture, 0, 0, width, height, [0, 0, width, height]);\n texCache.addTexAndDrawWhenLimit(gl, mockCache, 1, null, cx, cy, 0, 0, false);\n texCache.refresh(gl, cx, cy);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n // 因为cacheTotal不总是以左上角原点为开始,所以必须每个节点重算matrix,合并box时计算的无法用到\n let matrixHash = {};\n // 先序遍历汇总到total\n for(let i = index + 1, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n let parentIndex = parentIndexHash[i];\n let matrix = matrixHash[parentIndex]; // 父节点的在每个节点计算后保存,第一个为top的默认为E(空)\n let opacity = opacityHash[i]; // opacity在合并box时已经计算可以直接用\n // 先看text,visibility会在内部判断,display会被parent判断\n if(node instanceof Text) {\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n texCache.addTexAndDrawWhenLimit(gl, __config[NODE_CACHE], opacity, matrix, cx, cy, dx, dy, false);\n }\n // 再看total缓存/cache,都没有的是无内容的Xom节点\n else {\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_IS_MASK]: isMask,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // mask和不可见不能被汇总到top上\n if((visibility === 'hidden' || isMask) && !node.hookGlRender) {\n continue;\n }\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n if(__cache && __cache.available) {\n tfo[0] += __cache.sx1;\n tfo[1] += __cache.sy1;\n }\n else {\n tfo[0] += node.__sx1;\n tfo[1] += node.__sy1;\n }\n let dx = -sx1 + dbx;\n let dy = -sy1 + dby;\n tfo[0] += dx;\n tfo[1] += dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n if(target) {\n // 局部的mbm和主画布一样,先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成\n if(isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy, false);\n texCache.refresh(gl, cx, cy);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前fbo作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy, false);\n }\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n // webgl特殊的外部钩子,比如粒子组件自定义渲染时调用\n if(node.hookGlRender) {\n node.hookGlRender(gl, opacity, matrix, cx, cy, dx, dy, false);\n }\n }\n }\n if(node.hookGlRender) {\n node.hookGlRender(gl, 1, null, cx, cy, dx, dy, false);\n }\n // 绘制到fbo的纹理对象上并删除fbo恢复\n texCache.refresh(gl, cx, cy);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 生成的纹理对象本身已绑定一个纹理单元了,释放lock的同时可以给texCache的channel缓存,避免重复上传\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bboxTotal);\n texCache.releaseLockChannel(n, mockCache.page);\n return [limitCache || totalLimitCache, mockCache];\n}\n\nfunction genFilterWebgl(gl, texCache, node, cache, filter, W, H) {\n let { sx1, sy1, width, height, bbox } = cache;\n let mockCache = cache;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n let res = genBlurWebgl(gl, texCache, mockCache, v, width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'hue-rotate') {\n let rotation = geom.d2r(v % 360);\n let cosR = Math.cos(rotation);\n let sinR = Math.sin(rotation);\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + cosR * 0.787 - sinR * 0.213, 0.715 - cosR * 0.715 - sinR * 0.715, 0.072 - cosR * 0.072 + sinR * 0.928, 0, 0,\n 0.213 - cosR * 0.213 + sinR * 0.143, 0.715 + cosR * 0.285 + sinR * 0.140, 0.072 - cosR * 0.072 - sinR * 0.283, 0, 0,\n 0.213 - cosR * 0.213 - sinR * 0.787, 0.715 - cosR * 0.715 + sinR * 0.715, 0.072 + cosR * 0.928 + sinR * 0.072, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'saturate' && v !== 100) {\n let amount = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + 0.787 * amount, 0.715 - 0.715 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 + 0.285 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 - 0.715 * amount, 0.072 + 0.928 * amount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'brightness' && v !== 100) {\n let b = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'grayscale' && v > 0) {\n v = Math.min(v, 100);\n let oneMinusAmount = 1 - v * 0.01;\n if(oneMinusAmount < 0) {\n oneMinusAmount = 0;\n }\n else if(oneMinusAmount > 1) {\n oneMinusAmount = 1;\n }\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.2126 + 0.7874 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 + 0.2848 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 + 0.9278 * oneMinusAmount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'contrast' && v !== 100) {\n let amount = v * 0.01;\n let o = -0.5 * amount + 0.5;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n amount, 0, 0, 0, o,\n 0, amount, 0, 0, o,\n 0, 0, amount, 0, o,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'sepia' && v > 0) {\n v = Math.min(v, 100);\n let oneMinusAmount = 1 - v * 0.01;\n if(oneMinusAmount < 0) {\n oneMinusAmount = 0;\n }\n else if(oneMinusAmount > 1) {\n oneMinusAmount = 1;\n }\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.393 + 0.607 * oneMinusAmount, 0.769 - 0.769 * oneMinusAmount, 0.189 - 0.189 * oneMinusAmount, 0, 0,\n 0.349 - 0.349 * oneMinusAmount, 0.686 + 0.314 * oneMinusAmount, 0.168 - 0.168 * oneMinusAmount, 0, 0,\n 0.272 - 0.272 * oneMinusAmount, 0.534 - 0.534 * oneMinusAmount, 0.131 + 0.869 * oneMinusAmount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'invert' && v > 0) {\n v = Math.min(v, 100);\n let o = v * 0.01;\n let amount = 1 - 2 * o;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n amount, 0, 0, 0, o,\n 0, amount, 0, 0, o,\n 0, 0, amount, 0, o,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n });\n // 切换回主程序\n gl.useProgram(gl.program);\n gl.viewport(0, 0, W, H);\n return mockCache;\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核d扩大3倍性能慢\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * 先动态生成gl程序,默认3核源码示例已注释,根据sigma获得d(一定奇数),再计算权重\n * 然后将d尺寸和权重拼接成真正程序并编译成program,再开始绘制\n */\nfunction genBlurWebgl(gl, texCache, cache, sigma, width, height, sx1, sy1, bbox) {\n let d = blur.kernelSize(sigma);\n let max = Math.max(15, gl.getParameter(gl.MAX_VARYING_VECTORS));\n while(d > max) {\n d -= 2;\n }\n let spread = blur.outerSizeByD(d);\n width += spread * 2;\n height += spread * 2;\n // 防止超限,webgl最大纹理尺寸限制\n let limit = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n if(width > limit || height > limit) {\n return;\n }\n bbox = bbox.slice(0);\n bbox[0] -= spread;\n bbox[1] -= spread;\n bbox[2] += spread;\n bbox[3] += spread;\n let cx = width * 0.5, cy = height * 0.5;\n let weights = blur.gaussianWeight(sigma, d);\n let vert = '';\n let frag = '';\n let r = Math.floor(d * 0.5);\n for(let i = 0; i < r; i++) {\n let c = (r - i) * 0.01;\n vert += `v_texCoordsBlur[${i}] = a_texCoords + vec2(-${c}, -${c}) * u_direction;`;\n frag += `gl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i}]) * ${weights[i]};`;\n }\n vert += `v_texCoordsBlur[${r}] = a_texCoords;`;\n frag += `gl_FragColor += texture2D(u_texture, v_texCoordsBlur[${r}]) * ${weights[r]};`;\n for(let i = 0; i < r; i++) {\n let c = (i + 1) * 0.01;\n vert += `v_texCoordsBlur[${i + r + 1}] = a_texCoords + vec2(${c}, ${c}) * u_direction;`;\n frag += `gl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i + r + 1}]) * ${weights[i + r + 1]};`;\n }\n vert = vertexBlur.replace('[3]', '[' + d + ']').replace(/}$/, vert + '}');\n frag = fragmentBlur.replace('[3]', '[' + d + ']').replace(/}$/, frag + '}');\n let program = webgl.initShaders(gl, vert, frag);\n gl.useProgram(program);\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n texture = webgl.drawBlur(gl, program, frameBuffer, texCache, texture, cache.page.texture, i, j,\n width, height, cx, cy, spread, d, sigma);\n // 销毁这个临时program\n gl.deleteShader(program.vertexShader);\n gl.deleteShader(program.fragmentShader);\n gl.deleteProgram(program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n texCache.releaseLockChannel(j);\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox);\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genColorMatrixWebgl(gl, texCache, cache, m, width, height, sx1, sy1, bbox) {\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n gl.useProgram(gl.programCm);\n webgl.drawCm(gl, gl.programCm, j, m);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox.slice(0));\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genOverflowWebgl(gl, texCache, node, cache, W, H) {\n let sbox = node.bbox.slice(0);\n let bbox = cache.bbox;\n // 没超过无需生成\n if(bbox[0] >= sbox[0] && bbox[1] >= sbox[1] && bbox[2] <= sbox[2] && bbox[3] <= sbox[3]) {\n return;\n }\n let width = sbox[2] - sbox[0], height = sbox[3] - sbox[1];\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n // 绘制,根据坐标裁剪使用原本纹理的一部分\n gl.useProgram(gl.programOverflow);\n webgl.drawOverflow(gl, j, sbox[0] - bbox[0], sbox[1] - bbox[1], width, height, cache.width, cache.height);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let overflowCache = new MockCache(gl, texture, cache.sx1, cache.sy1, width, height, sbox);\n texCache.releaseLockChannel(i, overflowCache.page);\n return overflowCache;\n}\n\nfunction genMaskWebgl(gl, texCache, node, __config, cache, W, H, lv, __structs) {\n let { sx1, sy1, width, height, bbox, dx, dy } = cache;\n // cache一定是mockCache,可能是total/filter/overflow一种\n let cx = width * 0.5, cy = height * 0.5;\n // 先求得被遮罩的matrix,用作inverse给mask计算\n let {\n [NODE_COMPUTED_STYLE]: {\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n },\n } = __config;\n let inverse;\n if(isE(transform)) {\n inverse = mx.identity();\n }\n else {\n let tfo = transformOrigin.slice(0);\n tfo[0] += sx1 + dx;\n tfo[1] += sy1 + dy;\n inverse = tf.calMatrixByOrigin(transform, tfo);\n }\n inverse = mx.inverse(inverse);\n // 将所有mask绘入一个单独纹理中,尺寸和原点与被遮罩total相同,才能做到顶点坐标一致\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n let next = node.next;\n let isClip = next.isClip;\n let list = [];\n while(next && next.isMask && next.isClip === isClip) {\n list.push(next);\n next = next.next;\n }\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n let matrixList = [];\n let parentMatrix;\n let lastMatrix;\n let opacityList = [];\n let parentOpacity = 1;\n let lastOpacity;\n let lastLv = lv;\n let {\n [STRUCT_INDEX]: index,\n [STRUCT_TOTAL]: total,\n } = item.__config[NODE_STRUCT];\n // 可以忽略mbm,因为只有透明遮罩\n for(let i = index, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n let {\n [NODE_CACHE]: __cache,\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_LIMIT_CACHE]: limitCache,\n } = __config;\n // 跳过display:none元素和它的所有子节点和mask\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n if(node instanceof Text) {\n if(__cache && __cache.available) {\n // text用父级的matrixEvent,在之前texCache添加到末尾了\n texCache.addTexAndDrawWhenLimit(gl, __cache, parentOpacity, texCache.last[2], cx, cy, 0, 0,true);\n }\n else if(limitCache) {\n return;\n }\n }\n else {\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_COMPUTED_STYLE]: {\n [OPACITY]: opacity,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n },\n } = __config;\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,根节点是第一个特殊处理\n if(i === index) {}\n else if(lv > lastLv) {\n parentMatrix = lastMatrix;\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n parentOpacity = lastOpacity;\n opacityList.push(parentOpacity);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n opacityList.splice(-diff);\n parentOpacity = opacityList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastLv = lv;\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n // total和自身cache的尝试,visibility不可见时没有cache\n if(target) {\n let m;\n if(isE(transform)) {\n m = mx.identity();\n }\n else {\n let tfo = transformOrigin.slice(0);\n tfo[0] += target.bbox[0] + dx;\n tfo[1] += target.bbox[1] + dy;\n m = tf.calMatrixByOrigin(transform, tfo);\n }\n m = mx.multiply(inverse, m);\n let tfo = transformOrigin.slice(0);\n tfo[0] += target.bbox[0] + dx;\n tfo[1] += target.bbox[1] + dy;\n lastMatrix = tf.calMatrixByOrigin(transform, tfo);\n if(!isE(parentMatrix)) {\n lastMatrix = multiply(parentMatrix, lastMatrix);\n }\n lastOpacity = parentOpacity * opacity;\n texCache.addTexAndDrawWhenLimit(gl, target, lastOpacity, m, cx, cy, dx, dy, true);\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n else if(limitCache) {\n return;\n }\n }\n }\n }\n texCache.refresh(gl, cx, cy);\n gl.deleteFramebuffer(frameBuffer);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况mask变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n // 生成最终纹理,汇总total和maskCache\n let [n, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n let program;\n if(isClip) {\n program = gl.programClip;\n }\n else {\n program = gl.programMask;\n }\n gl.useProgram(program);\n webgl.drawMask(gl, i, j, program);\n gl.deleteTexture(texture);\n texCache.releaseLockChannel(i);\n texCache.releaseLockChannel(j);\n // 切换回主程序\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer2);\n // 同total一样生成一个mockCache\n let maskCache = new MockCache(gl, texture2, sx1, sy1, width, height, bbox);\n texCache.releaseLockChannel(n, maskCache.page);\n return maskCache;\n}\n\n/**\n * 生成blendMode混合fbo纹理结果,原本是所有元素向一个fbo记A进行绘制,当出现mbm时,进入到这里,\n * 先生成一个新的fbo记B,将A和待混合节点进行对应的mbm模式混合,结果绘制到B中,然后返回B来替换A,包括纹理单元\n * @param gl\n * @param texCache\n * @param i 之前已有的fbo和纹理单元\n * @param j 当前节点绘制的fbo和纹理单元\n * @param mbm\n * @param fbo 之前舞台绑定的fbo和纹理\n * @param tex\n * @param W\n * @param H\n * @returns {number|*}\n */\nfunction genMbmWebgl(gl, texCache, i, j, fbo, tex, mbm, W, H) {\n let frag;\n mbm = mbmName(mbm);\n if(mbm === 'multiply') {\n frag = fragmentMultiply;\n }\n else if(mbm === 'screen') {\n frag = fragmentScreen;\n }\n else if(mbm === 'overlay') {\n frag = fragmentOverlay;\n }\n else if(mbm === 'darken') {\n frag = fragmentDarken;\n }\n else if(mbm === 'lighten') {\n frag = fragmentLighten;\n }\n else if(mbm === 'color-dodge') {\n frag = fragmentColorDodge;\n }\n else if(mbm === 'color-burn') {\n frag = fragmentColorBurn;\n }\n else if(mbm === 'hard-light') {\n frag = fragmentHardLight;\n }\n else if(mbm === 'soft-light') {\n frag = fragmentSoftLight;\n }\n else if(mbm === 'difference') {\n frag = fragmentDifference;\n }\n else if(mbm === 'exclusion') {\n frag = fragmentExclusion;\n }\n else if(mbm === 'hue') {\n frag = fragmentHue;\n }\n else if(mbm === 'saturation') {\n frag = fragmentSaturation;\n }\n else if(mbm === 'color') {\n frag = fragmentColor;\n }\n else if(mbm === 'luminosity') {\n frag = fragmentLuminosity;\n }\n let program = webgl.initShaders(gl, vertexMbm, frag);\n gl.useProgram(program);\n // 生成新的fbo,将混合结果绘入\n let [n, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, W, H);\n webgl.drawMbm(gl, program, i, j, W, H);\n // 切换回主程序并销毁这个临时program\n gl.useProgram(gl.program);\n gl.deleteShader(program.vertexShader);\n gl.deleteShader(program.fragmentShader);\n gl.deleteProgram(program);\n gl.deleteFramebuffer(fbo);\n gl.deleteTexture(tex);\n texCache.releaseLockChannel(i);\n texCache.releaseLockChannel(j);\n return [n, frameBuffer, texture];\n}\n\nfunction renderSvg(renderMode, ctx, root, isFirst) {\n let { __structs, width, height } = root;\n // mask节点很特殊,本身有matrix会影响,本身没改变但对象节点有改变也需要计算逆矩阵应用顶点\n let maskEffectHash = {};\n if(!isFirst) {\n // 先遍历一遍收集完全不变的defs,缓存起来id,随后再执行遍历渲染生成新的,避免掉重复的id\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let {\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_DEFS_CACHE]: defsCache,\n } = node.__config;\n // 只要涉及到matrix和opacity就影响mask\n let hasEffectMask = hasMask && (refreshLevel >= REPAINT || contain(refreshLevel, TRANSFORM_ALL | OP));\n if(hasEffectMask) {\n let start = i + (total || 0) + 1;\n let end = start + hasMask;\n // mask索引遍历时处理,暂存遮罩对象的刷新lv\n maskEffectHash[end - 1] = refreshLevel;\n }\n // >=REPAINT重绘生成走render()跳过这里\n if(refreshLevel < REPAINT) {\n // 特殊的mask判断,遮罩对象影响这个mask了,除去filter、遮罩对象无TRANSFORM变化外都可缓存\n if(maskEffectHash.hasOwnProperty(i)) {\n let v = maskEffectHash[i];\n if(!contain(refreshLevel, TRANSFORM_ALL) && v < REPAINT && !contain(v, TRANSFORM_ALL)) {\n defsCache.forEach(item => {\n ctx.addCache(item);\n });\n }\n }\n // 去除特殊的filter,普通节点或不影响的mask在 {\n ctx.addCache(item);\n });\n }\n }\n }\n }\n let maskHash = {};\n // 栈代替递归,存父节点的matrix/opacity,matrix为E时存null省略计算\n let matrixList = [];\n let parentMatrix;\n let vdList = [];\n let parentVd;\n let lastLv = 0;\n let lastConfig;\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n [STRUCT_LV]: lv,\n } = __structs[i];\n let __config = node.__config;\n let {\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_DEFS_CACHE]: defsCache,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = __config;\n let display = computedStyle[DISPLAY];\n // 将随后的若干个mask节点范围存下来\n if(hasMask && display !== 'none') {\n let start = i + (total || 0) + 1;\n let end = start + hasMask;\n // svg限制了只能Geom单节点,不可能是Dom,所以end只有唯一\n maskHash[end - 1] = {\n index: i,\n start,\n end,\n isClip: __structs[start][STRUCT_NODE].isClip, // 第一个节点是clip为准\n };\n }\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,Root节点第一个特殊处理\n if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n vdList.splice(-diff);\n parentVd = vdList[lv - 1];\n }\n else if(lv > lastLv) {\n matrixList.push(lastConfig[NODE_MATRIX]);\n let vd = lastConfig[NODE_VIRTUAL_DOM];\n vdList.push(vd);\n parentVd = vd;\n }\n lastConfig = __config;\n let virtualDom;\n // svg小刷新等级时直接修改vd,这样Geom不再感知\n if(refreshLevel < REPAINT && !(node instanceof Text)) {\n __config[NODE_REFRESH_LV] = NONE;\n virtualDom = __config[NODE_VIRTUAL_DOM];\n // total可以跳过所有孩子节点省略循环\n if(__cacheTotal && __cacheTotal.available) {\n i += (total || 0);\n virtualDom.cache = true;\n }\n else {\n __cacheTotal && (__cacheTotal.available = true);\n virtualDom = __config[NODE_VIRTUAL_DOM] = node.__virtualDom = util.extend({}, virtualDom);\n // dom要清除children缓存,geom和img无需\n if(node instanceof Dom && !(node instanceof Img)) {\n virtualDom.children = [];\n }\n // 还得判断,和img加载混在一起时,触发刷新如果display:none,则还有cacheTotal\n if(display === 'none') {\n i += (total || 0);\n if(hasMask) {\n i += hasMask;\n }\n }\n else {\n delete virtualDom.cache;\n }\n }\n let {\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_CACHE_STYLE]: __cacheStyle,\n } = __config;\n if(contain(refreshLevel, TRANSFORM_ALL)) {\n let matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n assignMatrix(m, matrix);\n if(!matrix || isE(matrix)) {\n delete virtualDom.transform;\n }\n else {\n virtualDom.transform = 'matrix(' + util.joinArr(mx.m2m6(matrix), ',') + ')';\n }\n if(parentMatrix && matrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n m = __config[NODE_MATRIX_EVENT];\n assignMatrix(m, matrix);\n }\n if(contain(refreshLevel, OP)) {\n let opacity = computedStyle[OPACITY] = currentStyle[OPACITY];\n if(opacity === 1) {\n delete virtualDom.opacity;\n }\n else {\n virtualDom.opacity = opacity;\n }\n }\n if(contain(refreshLevel, FT)) {\n let filter = node.__calFilter(currentStyle, computedStyle);\n let s = painter.svgFilter(filter);\n if(s) {\n virtualDom.filter = s;\n }\n else {\n delete virtualDom.filter;\n }\n }\n if(contain(refreshLevel, MBM)) {\n let mixBlendMode = computedStyle[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE];\n if(isValidMbm(mixBlendMode)) {\n virtualDom.mixBlendMode = mbmName(mixBlendMode);\n }\n else {\n delete virtualDom.mixBlendMode;\n }\n }\n virtualDom.lv = refreshLevel;\n }\n else {\n // >=REPAINT会调用render,重新生成defsCache,text没有这个东西\n __config[NODE_DEFS_CACHE] && __config[NODE_DEFS_CACHE].splice(0);\n node.render(renderMode, refreshLevel, ctx, NA, 0, 0);\n virtualDom = __config[NODE_VIRTUAL_DOM];\n // 渲染后更新取值\n display = computedStyle[DISPLAY];\n if(display === 'none') {\n i += (total || 0);\n if(hasMask) {\n i += hasMask;\n }\n }\n }\n /**\n * mask会在join时过滤掉,这里将假设正常渲染的vd的内容获取出来组成defs的mask内容\n * 另外最初遍历时记录了会影响的mask,在=REPAINT始终重新设置\n * 本身有matrix也需要重设\n */\n if(maskHash.hasOwnProperty(i) && (maskEffectHash.hasOwnProperty(i) || refreshLevel >= REPAINT || contain(refreshLevel, TRANSFORM_ALL | OP))) {\n let { index, start, end, isClip } = maskHash[i];\n let target = __structs[index];\n let dom = target[STRUCT_NODE];\n let mChildren = [];\n // clip模式时,先添加兜底整个白色使得全部都可见,mask本身变反色(黑色)\n if(isClip) {\n mChildren.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', `M0,0L${width},0L${width},${height}L0,${height}L0,0`],\n ['fill', 'rgba(255,255,255,1)'],\n ['stroke-width', 0],\n ],\n });\n }\n for(let j = start; j < end; j++) {\n let node = __structs[j][STRUCT_NODE];\n let { computedStyle: { [DISPLAY]: display, [VISIBILITY]: visibility, [FILL]: fill },\n virtualDom: { children, opacity } } = node;\n if(display !== 'none' && visibility !== 'hidden') {\n // 引用相同无法diff,需要clone\n children = util.clone(children);\n mChildren = mChildren.concat(children);\n for(let k = 0, len = children.length; k < len; k++) {\n let { tagName, props } = children[k];\n if(tagName === 'path') {\n if(isClip) {\n for(let j = 0, len = props.length; j < len; j++) {\n let item = props[j];\n if(item[0] === 'fill') {\n item[1] = util.int2invert(fill[0]);\n }\n }\n }\n let matrix = node.matrix;\n let ivs = inverse(dom.matrix);\n matrix = multiply(ivs, matrix);\n // path没有transform属性,在vd上,需要弥补\n props.push(['transform', `matrix(${util.joinArr(mx.m2m6(matrix), ',')})`]);\n // path没有opacity属性,在vd上,需要弥补\n if(!util.isNil(opacity) && opacity !== 1) {\n props.push(['opacity', opacity]);\n }\n }\n // img可能有matrix属性,需判断\n else if(tagName === 'image') {\n let hasTransform = -1;\n for(let m = 0, len = props.length; m < len; m++) {\n if(props[m][0] === 'transform') {\n hasTransform = m;\n break;\n }\n }\n if(hasTransform === -1) {\n let ivs = inverse(dom.matrix);\n if(!isE(ivs)) {\n props.push(['transform', `matrix(${util.joinArr(mx.m2m6(ivs), ',')})`]);\n }\n }\n else {\n let matrix = props[hasTransform][1].match(/[\\d.]+/g).map(i => parseFloat(i));\n let ivs = inverse(dom.matrix);\n matrix = multiply(ivs, matrix);\n props[hasTransform][1] = `matrix(${util.joinArr(mx.m2m6(matrix), ',')})`;\n }\n }\n }\n }\n }\n // 清掉上次的\n for(let i = defsCache.length - 1; i >= 0; i--) {\n let item = defsCache[i];\n if(item.tagName === 'mask') {\n defsCache.splice(i, 1);\n }\n }\n let o = {\n tagName: 'mask',\n props: [],\n children: mChildren,\n };\n let id = ctx.add(o);\n defsCache.push(o);\n id = 'url(#' + id + ')';\n dom.virtualDom.mask = id;\n }\n // mask不入children\n if(parentVd && !node.isMask) {\n parentVd.children.push(virtualDom);\n }\n if(i === 0) {\n parentMatrix = __config[NODE_MATRIX];\n parentVd = virtualDom;\n }\n lastLv = lv;\n }\n}\n\nfunction renderWebgl(renderMode, gl, root) {\n let { __structs, width, height, texCache } = root;\n let cx = width * 0.5, cy = height * 0.5;\n // 栈代替递归,存父节点的matrix/opacity,matrix为E时存null省略计算\n let matrixList = [];\n let parentMatrix;\n let opacityList = [];\n let parentOpacity = 1;\n let pmList = [];\n let parentPm;\n let lastRefreshLevel;\n let lastConfig;\n let lastLv = 0;\n let mergeList = [];\n let hasMbm; // 是否有混合模式出现\n /**\n * 先一遍先序遍历每个节点绘制到自己__cache上,排除Text和已有的缓存以及局部根缓存,\n * 根据refreshLevel进行等级区分,可能是=REPAINT,REFLOW布局已前置处理完。\n * 首次绘制没有catchTotal等,后续则可能会有,在= REPAINT) {\n node.render(renderMode, REPAINT, gl, SELF, 0, 0);\n }\n continue;\n }\n let __config = node.__config;\n let refreshLevel = __config[NODE_REFRESH_LV];\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,Root节点是第一个特殊处理\n if(i === 0) {}\n else if(lv > lastLv) {\n parentMatrix = lastConfig[NODE_MATRIX_EVENT];\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n parentOpacity = lastConfig[NODE_OPACITY];\n opacityList.push(parentOpacity);\n parentPm = lastConfig[NODE_PERSPECTIVE_MATRIX];\n if(isE(parentPm)) {\n parentPm = null;\n }\n pmList.push(parentPm);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n opacityList.splice(-diff);\n parentOpacity = opacityList[lv - 1];\n pmList.splice(-diff);\n parentPm = pmList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastRefreshLevel = refreshLevel;\n lastConfig = __config;\n lastLv = lv;\n let {\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = __config;\n // 跳过display:none元素和它的所有子节点\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0);\n // 只跳过自身不能跳过后面的mask,mask要渲染自身并进行缓存cache,以备对象切换display用\n continue;\n }\n let hasRecordAsMask;\n /**\n * lv=REPAINT那里,小变化不动\n * 当有遮罩时,如果被遮罩节点本身无变更,需要检查其next的遮罩节点有无变更,\n * 但其实不用检查,因为next变更一定会清空cacheMask,只要检查cacheMask即可\n * 如果没有或无效,直接添加,无视节点本身变化,后面防重即可\n */\n if(refreshLevel < REPAINT) {\n __config[NODE_REFRESH_LV] = NONE;\n if(hasMask) {\n let cacheMask = __config[NODE_CACHE_MASK];\n if(!cacheMask || !cacheMask.available) {\n hasRecordAsMask = [i, lv, total, node, __config, null, hasMask];\n mergeList.push(hasRecordAsMask);\n }\n }\n let {\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_CACHE_STYLE]: __cacheStyle,\n [NODE_MATRIX_EVENT]: matrixEvent,\n } = __config;\n if(contain(refreshLevel, PPT)) {\n node.__calPerspective(__cacheStyle, currentStyle, computedStyle, __config);\n }\n // transform变化,父元素的perspective变化也会在Root特殊处理重新计算\n let matrix;\n if(contain(refreshLevel, TRANSFORM_ALL)) {\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n // node本身有或者父有perspective都认为需要生成3d渲染上下文\n if(tf.isPerspectiveMatrix(matrix) || parentPm) {\n if(hasRecordAsMask) {\n hasRecordAsMask[9] = true;\n }\n else {\n hasRecordAsMask = [i, lv, total, node, __config, null, null, null, null, true];\n }\n }\n // 先左乘perspective的矩阵,再左乘父级的总矩阵\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n assignMatrix(matrixEvent, matrix);\n let opacity;\n if(contain(refreshLevel, OP)) {\n opacity = computedStyle[OPACITY] = currentStyle[OPACITY];\n }\n else {\n opacity = computedStyle[OPACITY];\n }\n __config[NODE_OPACITY] = parentOpacity * opacity;\n // filter会改变bbox范围\n if(contain(refreshLevel, FT)) {\n node.__bbox = null;\n let filter = node.__calFilter(currentStyle, computedStyle);\n // 防重\n if(hasRecordAsMask) {\n hasRecordAsMask[7] = filter;\n }\n else {\n // 强制存hasMask,因为filter改变影响mask\n hasRecordAsMask = [i, lv, total, node, __config, null, hasMask, filter];\n mergeList.push(hasRecordAsMask);\n }\n }\n if(contain(refreshLevel, MBM)) {\n computedStyle[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE];\n }\n // total可以跳过所有孩子节点省略循环,filter/mask等的强制前提是有total\n if(__cacheTotal && __cacheTotal.available) {\n i += (total || 0);\n continue;\n }\n }\n /**\n * >=REPAINT重新渲染,并根据结果判断是否离屏限制错误\n * Geom没有子节点无需汇总局部根,Dom中Img也是,它们的局部根等于自身的cache,其它符合条件的Dom需要生成\n */\n else {\n let res = node.render(renderMode, refreshLevel, gl, SELF, 0, 0);\n // geom可返回texture纹理,替代原有xom的__cache纹理\n if(res && inject.isWebGLTexture(res.texture)) {\n let { __sx1: sx1, __sy1: sy1, offsetWidth: w, offsetHeight: h, bbox } = node;\n __config[NODE_CACHE] = new MockCache(gl, res.texture, sx1, sy1, w, h, bbox);\n gl.viewport(0, 0, width, height);\n gl.useProgram(gl.program);\n }\n }\n // 每个元素检查cacheTotal生成,已有的上面会continue跳过\n let {\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE_AS_BITMAP]: cacheAsBitmap,\n } = __config;\n let {\n [OVERFLOW]: overflow,\n [FILTER]: filter,\n [MIX_BLEND_MODE]: mixBlendMode,\n [TRANSFORM]: transform,\n } = computedStyle;\n let validMbm = isValidMbm(mixBlendMode);\n // 3d渲染上下文\n let isPerspective = tf.isPerspectiveMatrix(transform) || parentPm;\n if(cacheAsBitmap || hasMask || filter.length || (overflow === 'hidden' && total) || validMbm || isPerspective) {\n if(validMbm) {\n hasMbm = true;\n }\n if(hasRecordAsMask) {\n hasRecordAsMask[5] = limitCache;\n hasRecordAsMask[7] = filter;\n hasRecordAsMask[8] = overflow;\n hasRecordAsMask[9] = isPerspective;\n hasRecordAsMask[10] = cacheAsBitmap;\n }\n else {\n mergeList.push([i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective, cacheAsBitmap]);\n }\n }\n }\n let limitHash = {};\n // 根据收集的需要合并局部根的索引,尝试合并,按照层级从大到小,索引从大到小的顺序,\n // 这样保证子节点在前,后节点在前,后节点是为了mask先应用自身如filter之后再进行遮罩\n if(mergeList.length) {\n mergeList.sort(function(a, b) {\n if(a[1] === b[1]) {\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n // ppt只有嵌套才需要生成,最下面的孩子节点的ppt无需,因此记录一个hash存index,\n // 同时因为是后序遍历,孩子先存所有父亲的index即可保证父亲才能生成cacheTotal\n let pptHash = {};\n mergeList.forEach(item => {\n let [i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective, cacheAsBitmap] = item;\n // 有ppt的,向上查找所有父亲index记录,可能出现重复记得提前跳出\n if(isPerspective) {\n let parent = __config[NODE_DOM_PARENT];\n while(parent) {\n let config = parent.__config;\n let idx = config[NODE_STRUCT][STRUCT_INDEX];\n if(pptHash[idx]) {\n break;\n }\n if(tf.isPerspectiveMatrix(config[NODE_MATRIX]) || config[NODE_PERSPECTIVE_MATRIX]) {\n pptHash[idx] = true;\n }\n parent = config[NODE_DOM_PARENT];\n }\n if(!pptHash[i] && !hasMask && !filter.length && overflow !== 'hidden' && !cacheAsBitmap) {\n return;\n }\n }\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n } = __config;\n let needGen;\n // 可能没变化,比如被遮罩节点、filter变更等\n if(!__cacheTotal || !__cacheTotal.available) {\n let [limit, res] = genTotalWebgl(gl, texCache, node, __config, i, total || 0, __structs, __cache, limitCache, hasMbm, width, height);\n __cacheTotal = res;\n needGen = true;\n limitCache = limit;\n // 返回的limit包含各种情况超限,一旦超限,只能生成临时cacheTotal不能保存\n if(!limitCache) {\n __config[NODE_CACHE_TOTAL] = res;\n }\n }\n // 即使超限,也有total结果\n let target = __cacheTotal;\n if(overflow === 'hidden') {\n if(!__cacheOverflow || !__cacheOverflow.available || needGen) {\n let temp = genOverflowWebgl(gl, texCache, node, target, width, height);\n if(temp) {\n target = temp;\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n }\n if(filter.length) {\n if(!__cacheFilter || !__cacheFilter.available || needGen) {\n let old = target;\n target = genFilterWebgl(gl, texCache, node, target, filter, width, height);\n if(target !== old) {\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n }\n if(hasMask && (!__cacheMask || !__cacheMask.available || needGen)) {\n target = genMaskWebgl(gl, texCache, node, __config, target, width, height, lv, __structs);\n if(!limitCache) {\n __config[NODE_CACHE_MASK] = target;\n }\n }\n // 保存临时的局部根节点\n if(limitCache) {\n limitHash[i] = target;\n }\n });\n }\n /**\n * 最后先序遍历一次应用__cacheTotal即可,没有的用__cache,以及剩下的超尺寸的和Text\n * 由于mixBlendMode的存在,需先申请个fbo纹理,所有绘制默认向该纹理绘制,最后fbo纹理再进入主画布\n * 前面循环时有记录是否出现mbm,只有出现才申请,否则不浪费直接输出到主画布\n * 超尺寸的要走无cache逻辑render,和canvas很像,除了离屏canvas超限,汇总total也会纹理超限\n */\n let n, frameBuffer, texture;\n if(hasMbm) {\n [n, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n }\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n // text如果display不可见,parent会直接跳过,不会走到这里,这里一定是直接绘制到root的,visibility在其内部判断\n if(node instanceof Text) {\n // text特殊之处,__config部分是复用parent的\n let {\n [NODE_CACHE]: __cache,\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_DOM_PARENT]: {\n __config: {\n [NODE_MATRIX_EVENT]: matrixEvent,\n [NODE_OPACITY]: opacity,\n },\n },\n } = __config;\n if(__cache && __cache.available) {\n texCache.addTexAndDrawWhenLimit(gl, __cache, opacity, matrixEvent, cx, cy, 0, 0,true);\n }\n // 超限特殊处理,先生成画布尺寸大小的纹理然后原始位置绘制\n else if(limitCache) {\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(renderMode, 0, gl, NA, 0, 0);\n let j = texCache.lockOneChannel();\n let texture = webgl.createTexture(gl, c.canvas, j);\n let mockCache = new MockCache(gl, texture, 0, 0, width, height, [0, 0, width, height]);\n texCache.addTexAndDrawWhenLimit(gl, mockCache, opacity, matrixEvent, cx, cy, 0, 0, true);\n texCache.refresh(gl, cx, cy, true);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n }\n else {\n let {\n [NODE_OPACITY]: opacity,\n [NODE_MATRIX_EVENT]: matrixEvent,\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // 有total的可以直接绘制并跳过子节点索引,忽略total本身,其独占用纹理单元,注意特殊不取cacheTotal,\n // 这种情况发生在只有overflow:hidden声明但无效没有生成__cacheOverflow的情况,\n // 因为webgl纹理单元缓存原因,所以不用cacheTotal防止切换性能损耗\n // 已取消,因为perspective需要进行独立上下文渲染\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n // total和自身cache的尝试,visibility不可见时没有cache\n if(target) {\n // 有mbm先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成\n if(hasMbm && isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy, true);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrixEvent, cx, cy, 0, 0, true);\n texCache.refresh(gl, cx, cy, true);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前画布作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrixEvent, cx, cy, 0, 0, true);\n }\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n else if(limitHash.hasOwnProperty(i)) {\n let target = limitHash[i];\n if(hasMbm && isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy, true);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrixEvent, cx, cy, 0, 0, true);\n texCache.refresh(gl, cx, cy, true);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前画布作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrixEvent, cx, cy, 0, 0, true);\n }\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n // 超限的情况,这里是普通单节点超限,没有合成total后再合成特殊cache如filter/mask/mbm之类的,\n // 直接按原始位置绘制到离屏canvas,再作为纹理绘制即可,特殊的在total那做过降级了\n else if(limitCache && display !== 'none' && visibility !== 'hidden') {\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(renderMode, refreshLevel, gl, NA, 0, 0);\n let j = texCache.lockOneChannel();\n let texture = webgl.createTexture(gl, c.canvas, j);\n let mockCache = new MockCache(gl, texture, 0, 0, width, height, [0, 0, width, height]);\n texCache.addTexAndDrawWhenLimit(gl, mockCache, opacity, matrixEvent, cx, cy, 0, 0, true);\n texCache.refresh(gl, cx, cy, true);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n // webgl特殊的外部钩子,比如粒子组件自定义渲染时调用\n if(node.hookGlRender) {\n node.hookGlRender(gl, opacity, matrixEvent, cx, cy, 0, 0, true);\n }\n }\n }\n texCache.refresh(gl, cx, cy, true);\n // 有mbm时将汇总的fbo绘入主画布,否则本身就是到主画布无需多余操作\n if(hasMbm) {\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n texCache.releaseLockChannel(n);\n gl.deleteFramebuffer(frameBuffer);\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // opacity buffer\n let opacityBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, opacityBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 1, 1, 1, 1]), gl.STATIC_DRAW);\n let a_opacity = gl.getAttribLocation(gl.program, 'a_opacity');\n gl.vertexAttribPointer(a_opacity, 1, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_opacity);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.program, 'u_texture');\n gl.uniform1i(u_texture, n);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.deleteBuffer(opacityBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n gl.deleteTexture(texture);\n }\n}\n\nfunction renderCanvas(renderMode, ctx, root) {\n let { __structs, width, height } = root;\n let mergeList = [];\n /**\n * 先一遍先序遍历收集cacheAsBitmap的节点,说明这棵子树需要缓存,可能出现嵌套,高层级优先\n * 可能遇到已有缓存没变化的,这时候不要收集忽略掉,没有缓存的走后面遍历普通渲染\n */\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // 排除Text,要么根节点直接绘制,要么被局部根节点汇总,自身并不缓存(fillText比位图更快)\n if(node instanceof Text) {\n continue;\n }\n let __config = node.__config;\n let {\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_CACHE_AS_BITMAP]: cacheAsBitmap,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = __config;\n if(refreshLevel >= REPAINT) {\n node.__calCache(renderMode, ctx, __config[NODE_DOM_PARENT],\n __config[NODE_CACHE_STYLE], __config[NODE_CURRENT_STYLE], computedStyle,\n node.clientWidth, node.clientHeight, node.offsetWidth, node.offsetHeight,\n computedStyle[BORDER_TOP_WIDTH], computedStyle[BORDER_RIGHT_WIDTH],\n computedStyle[BORDER_BOTTOM_WIDTH], computedStyle[BORDER_LEFT_WIDTH],\n computedStyle[PADDING_TOP], computedStyle[PADDING_RIGHT],\n computedStyle[PADDING_BOTTOM], computedStyle[PADDING_LEFT],\n node.__sx1, node.__sx2, node.__sx3, node.__sx4, node.__sx5, node.__sx6,\n node.__sy1, node.__sy2, node.__sy3, node.__sy4, node.__sy5, node.__sy6);\n }\n if(cacheAsBitmap) {\n // 跳过display:none元素和它的所有子节点\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n mergeList.push([i, lv, total, node, __config, hasMask]);\n }\n }\n /**\n * 根据收集的需要合并局部根的索引,尝试合并,按照层级从大到小,索引从大到小的顺序,\n * 这样保证子节点在前,后节点在前(mask在后面),渲染顺序正确\n */\n if(mergeList.length) {\n mergeList.sort(function(a, b) {\n if(a[1] === b[1]) {\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n mergeList.forEach(item => {\n let [i, lv, total, node, __config, hasMask] = item;\n genTotal(renderMode, node, __config, i, lv, total || 0, __structs, hasMask, width, height);\n });\n }\n /**\n * 最后先序遍历一次并应用__cacheTotal即可,没有的普通绘制,以及剩下的超尺寸的和Text\n * 特殊离屏和cacheAsBitmap的离屏都已经产生了cacheTotal,除非超限\n * 离屏功能的数据结构和算法逻辑非常复杂,需用到下面2个hash,来完成一些filter、mask等离屏才能完成的绘制\n * 其中overflow、filter、mix-blend-mode是对自身及子节点,mask则是对自身和后续next遮罩节点\n * 一个节点在Xom渲染中申请离屏canvas,是按照一定顺序来的,且多个离屏后面的有前面的ctx引用,第一个则引用最初非离屏的ctx\n * 这个顺序在应用离屏时以反向顺序开始,这样最后ctx被还原到最初的ctx\n * mask是个十分特殊的离屏,因为除了自身外,next节点也需要汇总到另外一个离屏上,为了逻辑一致性\n * 所有离屏应用的索引都以最后一个节点的索引为准,即有mask时以最后一个mask,无mask则以自身节点的最后一个(+total)为索引\n * 由于存在普通非cache绘制,所以依然要用到栈代替递归计算matrix\n */\n let maskStartHash = {};\n let offscreenHash = {};\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // text如果display不可见,parent会直接跳过,不会走到这里,这里一定是直接绘制到root的,visibility在其内部判断\n if(node instanceof Text) {\n node.render(renderMode, REPAINT, ctx, NA, 0, 0);\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n }\n else {\n let __config = node.__config;\n let {\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [MIX_BLEND_MODE]: mixBlendMode,\n [OPACITY]: opacity,\n },\n } = __config;\n // 遮罩对象申请了个离屏,其第一个mask申请另外一个离屏mask2,开始聚集所有mask元素的绘制,\n // 这是一个十分特殊的逻辑,保存的index是最后一个节点的索引,OFFSCREEN_MASK2是最低优先级,\n // 这样当mask本身有filter时优先自身,然后才是OFFSCREEN_MASK2\n if(maskStartHash.hasOwnProperty(i)) {\n let [idx, n, offscreenMask] = maskStartHash[i];\n let target = inject.getCacheCanvas(width, height, null, 'mask2');\n offscreenMask.mask = target; // 应用mask用到\n offscreenMask.isClip = node.isClip;\n // 定位到最后一个mask元素上的末尾\n let j = i + (total || 0) + 1;\n while(--n) {\n let { [STRUCT_TOTAL]: total } = __structs[j];\n j += (total || 0) + 1;\n }\n j--;\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([idx, lv, OFFSCREEN_MASK, offscreenMask]);\n list.push([j, lv, OFFSCREEN_MASK2, {\n ctx, // 保存等待OFFSCREEN_MASK2时还原\n target,\n }]);\n ctx = target.ctx;\n }\n // 有cache声明从而有total的可以直接绘制并跳过子节点索,total生成可能会因超限而失败\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n let j = i;\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n // total的none直接跳过\n if(display === 'none') {\n continue;\n }\n if(isValidMbm(mixBlendMode)) {\n ctx.globalCompositeOperation = mbmName(mixBlendMode);\n }\n else {\n ctx.globalCompositeOperation = 'source-over';\n }\n // cache需要计算matrixEvent,因为局部根节点临时视为E,根据refreshLevel决定\n let matrix = __config[NODE_MATRIX], matrixEvent = __config[NODE_MATRIX_EVENT];\n let old = matrixEvent.slice(0);\n let parentMatrix = __config[NODE_DOM_PARENT].matrixEvent;\n if(parentMatrix && !isE(parentMatrix)) {\n matrix = multiply(parentMatrix, matrix);\n }\n util.assignMatrix(matrixEvent, matrix);\n Cache.draw(ctx, opacity, matrixEvent, target);\n // total应用后记得设置回来\n ctx.globalCompositeOperation = 'source-over';\n // 父超限但子有total的时候,i此时已经增加到了末尾,也需要检查\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n // 有cache的可以跳过子节点,但如果matrixEvent变化还是需要遍历计算一下的,虽然跳过了渲染\n // 如果cache是新的,则需要完整遍历设置一次\n // 如果isNew为false,则计算下局部根节点再对比下看是否有变化,无变化可省略\n let needReset = __cacheTotal.isNew;\n if(!needReset && !util.equalArr(old, matrixEvent)) {\n needReset = true;\n }\n if(needReset) {\n resetMatrixCacheTotal(__structs, j, total || 0, lv, matrixEvent);\n }\n __cacheTotal.__isNew = false;\n }\n // 没有cacheTotal是普通节点绘制\n else {\n let res = node.render(renderMode, refreshLevel, ctx, NA, 0, 0);\n let { offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow } = res || {};\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_BLEND, offscreenBlend]);\n ctx = offscreenBlend.target.ctx;\n }\n // 被遮罩的节点要为第一个遮罩和最后一个遮罩的索引打标,被遮罩的本身在一个离屏canvas,遮罩的元素在另外一个\n // 最后一个遮罩索引因数量不好计算,放在maskStartHash做\n if(offscreenMask) {\n let j = i + (total || 0);\n maskStartHash[j + 1] = [i, hasMask, offscreenMask];\n ctx = offscreenMask.target.ctx;\n }\n // filter造成的离屏,需要将后续一段孩子节点区域的ctx替换,并在结束后应用结果,再替换回来\n if(offscreenFilter) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_FILTER, offscreenFilter]);\n ctx = offscreenFilter.target.ctx;\n }\n // overflow:hidden的离屏,最后孩子进行截取\n if(offscreenOverflow) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_OVERFLOW, offscreenOverflow]);\n ctx = offscreenOverflow.target.ctx;\n }\n // 离屏应用,按照lv从大到小即子节点在前先应用,同一个节点多个效果按offscreen优先级从小到大来,\n // 由于mask特殊索引影响,所有离屏都在最后一个mask索引判断,此时mask本身优先结算,以index序大到小判断\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n // render后判断可见状态,此时computedStyle才有值\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n}\n\nexport default {\n renderCanvas,\n renderSvg,\n renderWebgl,\n};\n\n","import webgl from './webgl';\nimport MockPage from './MockPage';\nimport inject from '../util/inject';\n\nclass TexCache {\n constructor(units) {\n this.__units = units; // 通道数量限制,8~16\n this.__pages = []; // 存当前page列表,通道数量8~16,缓存收留尽可能多的page\n this.__list = []; // 本次渲染暂存的数据,[cache, opacity, matrix, dx, dy]\n this.__channels = []; // 每个纹理通道记录还是个数组,下标即纹理单元,内容为Page\n this.__locks = []; // 锁定纹理单元列表,下标即纹理单元,内容true为锁定\n this.__lockUnits = 0;\n }\n\n /**\n * webgl每次绘制为添加纹理并绘制,此处尝试尽可能收集所有纹理贴图,以达到尽可能多的共享纹理,再一次性绘制\n * 收集的是Page对象(从cache中取得),里面包含了若干个节点的贴图,canvas本身是2的幂次方大小\n * webgl最少有8个纹理单元最多16个,因此存了一个列表来放这些Page的canvas,刷新后清空,但纹理通道映射记录保留\n * 当8个纹理单元全部满了,进行绘制并清空这个队列,外部主循环结束时也会检查队列是否还有余留并绘制\n * 初始调用队列为空,存入Page对象,后续调用先查看是否存在以便复用,再决定是否存入Page,直到8个满了\n * Page上存有update表示是否更新,每次cache绘制时会变true,以此表示是否有贴图更新,删除可以忽视\n * 还需要一个记录上次纹理通道使用哪个Page的canvas的地方,即映射,清空后队列再次添加时,如果Page之前被添加过,\n * 此次又被添加且没有变更update,可以直接复用上次的纹理单元号且无需再次上传纹理,节省性能\n * 后续接入局部纹理更新也是复用单元号,如果update变更可以选择局部上传纹理而非整个重新上传\n * 判断上传的逻辑在收集满8个后绘制前进行,因为添加队列过程中可能会变更Page及其update\n * @param gl\n * @param cache\n * @param opacity\n * @param matrix\n * @param cx\n * @param cy\n * @param dx\n * @param dy\n * @param revertY\n */\n addTexAndDrawWhenLimit(gl, cache, opacity, matrix, cx, cy, dx = 0, dy = 0, revertY) {\n let pages = this.__pages;\n let list = this.__list;\n let page = cache.page;\n let i = pages.indexOf(page);\n // 找到说明已有page在此索引的通道中,记录下来info\n if(i > -1) {\n list.push([cache, opacity, matrix, dx, dy]);\n }\n // 找不到说明是新的纹理贴图,此时看是否超过纹理单元限制,超过则刷新绘制并清空,然后/否则 存入纹理列表\n else {\n i = pages.length;\n if(i >= this.__units - this.__lockUnits) {\n // 绘制且清空,队列索引重新为0\n this.refresh(gl, cx, cy, revertY);\n }\n pages.push(page);\n list.push([cache, opacity, matrix, dx, dy]);\n }\n }\n\n /**\n * 刷新\n * @param gl\n * @param cx\n * @param cy\n * @param revertY\n */\n refresh(gl, cx, cy, revertY) {\n let pages = this.__pages;\n let list = this.__list;\n // 防止空调用刷新,struct循环结尾会强制调用一次防止有未渲染的\n if(pages.length) {\n let channels = this.channels;\n let locks = this.locks;\n // 先将上次渲染的纹理单元使用的Page形成一个hash,键为page的uuid,值为纹理单元\n let lastHash = {};\n channels.forEach((item, i) => {\n if(item) {\n let uuid = item.uuid;\n lastHash[uuid] = i;\n }\n });\n let units = this.__units;\n // 再遍历,查找相同的Page并保持其使用的纹理单元不变,存入相同索引下标oldList,不同的按顺序收集放newList\n let oldList = new Array(units), newList = [];\n pages.forEach(page => {\n let uuid = page.uuid;\n if(lastHash.hasOwnProperty(uuid)) {\n let index = lastHash[uuid];\n oldList[index] = page;\n }\n else {\n newList.push(page);\n }\n });\n /**\n * 以oldList为基准,将newList依次存入oldList中\n * 优先使用未用过的纹理单元,以便用过的可能下次用到无需重新上传\n * 找不到未用过的后,尝试NRU算法,优先淘汰最近未使用的Page,相等则尺寸小的\n */\n if(newList.length) {\n // 先循环找空的,oldList空且channels空且locks空\n for(let i = 0; i < units; i++) {\n if(!oldList[i] && !channels[i] &&!locks[i]) {\n oldList[i] = newList.shift();\n if(!newList.length) {\n break;\n }\n }\n }\n let len = newList.length;\n if(len) {\n // 按时间排序已使用channel且未被当前占用的,以便淘汰最久未使用的\n let cl = [];\n for(let i = 0; i < units; i++) {\n if(!oldList[i] && !locks[i]) {\n cl.push([i, channels[i]]);\n }\n }\n cl.sort(function(a, b) {\n if(a[1].time !== b[1].time) {\n return (a[1].time || 0) - (b[1].time || 0);\n }\n if(a[1].fullSize !== b[1].fullSize) {\n return a[1].fullSize - b[1].fullSize;\n }\n return a[0] - b[0];\n });\n // cl靠前是时间小尺寸小的,优先使用替换\n for(let i = 0; i < len; i++) {\n oldList[cl[i][0]] = newList[i];\n }\n }\n }\n /**\n * 对比上帧渲染的和这次纹理单元情况,Page相同且!update可以省略更新,其它均重新赋值纹理\n * 后续局部更新Page相同但有update,会出现没有上帧的情况如初始渲染,此时先创建纹理单元再更新\n * 将新的数据赋给老的,可能新的一帧使用的少于上一帧,老的没用到的需继续保留\n */\n let hash = {};\n for(let i = 0, len = oldList.length; i < len; i++) {\n let page = oldList[i];\n // 可能为空,不满的情况下前面单元保留老tex先用的后面的单元\n if(!page) {\n continue;\n }\n let last = channels[i];\n if(!last || last !== page || page.update) {\n // page可能为一个已有fbo纹理,或者贴图\n if(page instanceof MockPage) {\n webgl.bindTexture(gl, page.texture, i);\n }\n else {\n // 可能老的先删除,注意只删Page,MockPage是fbo生成的texture即total缓存不能自动清除\n if(last && !(last instanceof MockPage)) {\n gl.deleteTexture(last.texture);\n }\n page.texture = webgl.createTexture(gl, page.canvas, i);\n }\n channels[i] = page;\n }\n hash[page.uuid] = i;\n // 标识没有更新,以及最后使用时间\n page.update = false;\n page.time = inject.now();\n }\n // 再次遍历开始本次渲染并清空\n webgl.drawTextureCache(gl, list, hash, cx, cy, revertY);\n pages.splice(0);\n list.splice(0);\n }\n }\n\n findExistTexChannel(page) {\n return this.channels.indexOf(page);\n }\n\n /**\n * 获取并锁定一个纹理单元优先使用空的,其次最久未使用的\n * @returns {number|*}\n */\n lockOneChannel() {\n // 优先返回空单元\n let channels = this.channels;\n let locks = this.locks;\n for(let i = 0; i < this.__units; i++) {\n if(!channels[i] && !locks[i]) {\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n }\n // 根据NRU返回最久未使用的\n let units = this.__units;\n let cl = [];\n for(let i = 0; i < units; i++) {\n if(!locks[i]) {\n cl.push([i, channels[i]]);\n }\n }\n if(cl.length) {\n cl.sort(function(a, b) {\n if(a[1].time !== b[1].time) {\n return (a[1].time || 0) - (b[1].time || 0);\n }\n if(a[1].fullSize !== b[1].fullSize) {\n return a[1].fullSize - b[1].fullSize;\n }\n return a[0] - b[0];\n });\n let i = cl[0][0];\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n throw new Error('No free texture unit');\n }\n\n /**\n * 释放掉i单元,并且设置内容到缓存channel中\n * @param i\n * @param setToChannel\n */\n releaseLockChannel(i, setToChannel) {\n if(this.locks[i]) {\n this.locks[i] = false;\n this.__lockUnits--;\n if(setToChannel) {\n this.channels[i] = setToChannel;\n }\n }\n }\n\n // 指定锁定一个单元\n lockChannel(i) {\n let channels = this.channels;\n let locks = this.locks;\n if(!locks[i]) {\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n }\n }\n\n /**\n * 释放纹理单元\n * @param gl\n */\n release(gl) {\n this.channels.forEach(item => {\n if(item) {\n gl.deleteTexture(item.texture);\n }\n });\n }\n\n get channels() {\n return this.__channels;\n }\n\n get locks() {\n return this.__locks;\n }\n\n get last() {\n let list = this.__list, len = list.length;\n if(len) {\n return list[len - 1];\n }\n }\n}\n\nexport default TexCache;\n","import Dom from './Dom';\nimport Text from './Text';\nimport Xom from './Xom';\nimport Component from './Component';\nimport Defs from './Defs';\nimport 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 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 let params = Object.assign({}, ca, this.props.contextAttributes);\n // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d', params);\n this.__renderMode = mode.CANVAS;\n }\n else if(this.tagName === 'svg') {\n this.__renderMode = mode.SVG;\n }\n else if(this.tagName === 'webgl') {\n let gl = this.__ctx = this.__dom.getContext('webgl', params);\n this.__renderMode = mode.WEBGL;\n gl.program = webgl.initShaders(gl, vertex, fragment);\n gl.programMask = webgl.initShaders(gl, vertexMask, fragmentMask);\n gl.programClip = webgl.initShaders(gl, vertexMask, fragmentClip);\n gl.programOverflow = webgl.initShaders(gl, vertexMask, fragmentOverflow);\n gl.programCm = webgl.initShaders(gl, vertexCm, fragmentCm);\n gl.useProgram(gl.program);\n // 第一次渲染生成纹理缓存管理对象,收集渲染过程中生成的纹理并在gl纹理单元满了时进行绘制和清空,减少texImage2d耗时问题\n const MAX_TEXTURE_IMAGE_UNITS = Math.min(16, gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));\n this.__texCache = new TexCache(MAX_TEXTURE_IMAGE_UNITS);\n }\n this.refresh(null, true);\n // 第一次节点没有__root,渲染一次就有了才能diff\n if(this.dom.__root && this.dom.__root instanceof Root) {\n this.dom.__root.destroy();\n }\n this.__eventCbList = initEvent(this.dom, Root);\n this.dom.__root = this;\n }\n\n refresh(cb, isFirst) {\n this.__hookTask = null;\n let { isDestroyed, renderMode, ctx, defs, width, height } = this;\n if(isDestroyed) {\n return;\n }\n defs.clear();\n // 首次递归测量整树的继承,后续更改各自更新机制做,防止每次整树遍历;root检查首次直接做,后续在checkUpdate()中插入\n if(isFirst) {\n this.__checkRoot(renderMode, width, height);\n this.__computeMeasure(renderMode, ctx);\n }\n // 非首次刷新如果没有更新则无需继续\n else if(!this.__checkUpdate(renderMode, ctx, width, height)) {\n return;\n }\n // 获取所有字体和大小测量,仅svg需要,canvas直接做\n inject.measureText();\n this.__checkReflow(width, height);\n if(renderMode === mode.CANVAS && !this.props.noRender) {\n this.__clear(ctx, renderMode);\n struct.renderCanvas(renderMode, ctx, this);\n }\n // svg的特殊diff需要\n else if(renderMode === mode.SVG && !this.props.noRender) {\n struct.renderSvg(renderMode, defs, this, isFirst);\n let nvd = this.virtualDom;\n nvd.defs = defs.value;\n if(this.dom.__vd) {\n // console.log(this.dom.__vd);\n // console.log(nvd);\n domDiff(this.dom, this.dom.__vd, nvd);\n }\n else {\n this.dom.innerHTML = util.joinVirtualDom(nvd);\n }\n this.dom.__vd = nvd;\n this.dom.__defs = defs;\n }\n else if(renderMode === mode.WEBGL && !this.props.noRender) {\n this.__clear(ctx, renderMode);\n struct.renderWebgl(renderMode, ctx, this);\n }\n // 特殊cb,供小程序绘制完回调使用\n if(isFunction(cb)) {\n cb();\n }\n this.emit(Event.REFRESH, this.__rlv);\n this.__rlv = NONE;\n }\n\n destroy() {\n this.__destroy();\n this.animateController.__destroy();\n let n = this.dom;\n if(n) {\n removeEvent(n, this.__eventCbList || []);\n n.__root = null;\n }\n let gl = this.ctx;\n if(this.__texCache && gl) {\n this.__texCache.release(gl);\n if(gl.program) {\n gl.deleteShader(gl.program.vertexShader);\n gl.deleteShader(gl.program.fragmentShader);\n gl.deleteProgram(gl.program);\n }\n if(gl.programMask) {\n gl.deleteShader(gl.programMask.vertexShader);\n gl.deleteShader(gl.programMask.fragmentShader);\n gl.deleteProgram(gl.programMask);\n }\n if(gl.programOverflow) {\n gl.deleteShader(gl.programOverflow.vertexShader);\n gl.deleteShader(gl.programOverflow.fragmentShader);\n gl.deleteProgram(gl.programOverflow);\n }\n }\n }\n\n scale(x = 1, y = x) {\n this.__scx = x;\n this.__scy = y;\n }\n\n resize(w, h, cb) {\n let self = this;\n if(w !== self.width || h !== self.height) {\n self.__width = w;\n self.__height = h;\n self.updateStyle({\n width: w,\n height: h,\n }, cb);\n }\n else if(isFunction(cb)) {\n cb(-1);\n }\n }\n\n addRefreshTask(cb) {\n let { taskUp, isDestroyed } = this;\n if(isDestroyed) {\n return;\n }\n // 第一个添加延迟侦听,后续放队列等待一并执行\n if(!taskUp.length) {\n let clone;\n frame.nextFrame({\n __before: diff => {\n if(this.isDestroyed) {\n return;\n }\n clone = taskUp.splice(0);\n // 前置一般是动画计算此帧样式应用,然后刷新后出发frame事件,图片加载等同\n if(clone.length) {\n clone.forEach((item, i) => {\n if(isObject(item) && isFunction(item.__before)) {\n item.__before(diff);\n }\n });\n }\n },\n __after: diff => {\n if(this.isDestroyed) {\n return;\n }\n clone.forEach(item => {\n if(isObject(item) && isFunction(item.__after)) {\n item.__after(diff);\n }\n else if(isFunction(item)) {\n item(diff);\n }\n });\n }\n });\n this.__frameHook();\n }\n if(taskUp.indexOf(cb) === -1) {\n taskUp.push(cb);\n }\n }\n\n addForceRefreshTask(cb) {\n this.__hasRootUpdate = true;\n this.addRefreshTask(cb);\n }\n\n delRefreshTask(cb) {\n if(!cb) {\n return;\n }\n let { taskUp } = this;\n for(let i = 0, len = taskUp.length; i < len; i++) {\n if(taskUp[i] === cb) {\n taskUp.splice(i, 1);\n break;\n }\n }\n }\n\n /**\n * 为component的setState更新专门开辟个独立的流水线,root/frame中以taskCp存储更新列表\n * 普通的动画、img加载等都走普通的refresh的task,component走这里,frame中的结构同样\n * 在frame的每帧调用中,先执行普通的动画task,再执行component的task\n * 这样动画执行完后,某个cp的sr及子节点依旧先进行了动画变更,进入__addUpdate()环节\n * 然后此cp再更新sr及子节点,这样会被__addUpdate()添加到尾部,依赖目前浏览器默认实现\n * 上一行cp更新过程中是updater.check()进行的,如果有新老交换且有动画,动画的assigning是true,进行继承\n * root刷新parseUpdate()时,老的sr及子节点先进行,随后新的sr后进行且有component标识,sr子节点不会有更新\n * @param cb\n */\n addRefreshCp(cb) {\n let { taskCp, isDestroyed } = this;\n if(isDestroyed) {\n return;\n }\n // 每次只执行1次\n if(!taskCp.length) {\n let clone;\n frame.__nextFrameCp({\n __before: diff => {\n if(this.isDestroyed) {\n return;\n }\n clone = taskCp.splice(0);\n if(clone.length) {\n clone.forEach(item => {\n item.__before(diff);\n });\n updater.check(this);\n let len = updater.updateList.length;\n if(len) {\n updater.updateList.forEach(cp => {\n let root = cp.root; // 多个root并存时可能cp的引用不相同,需分别获取\n let sr = cp.shadowRoot;\n // 可能返回text,需视为其parentNode\n if(sr instanceof Text) {\n sr = sr.domParent;\n }\n let res = {};\n res[UPDATE_NODE] = sr;\n res[UPDATE_STYLE] = sr.currentStyle;\n res[UPDATE_FOCUS] = REFLOW;\n res[UPDATE_MEASURE] = true;\n res[UPDATE_COMPONENT] = cp;\n res[UPDATE_CONFIG] = sr.__config;\n this.__addUpdate(sr, sr.__config, root, root.__config, res);\n });\n }\n }\n },\n __after: diff => {\n if(this.isDestroyed) {\n return;\n }\n clone.forEach(item => {\n item.__after(diff);\n });\n // 触发didUpdate\n updater.did();\n },\n });\n this.__frameHook();\n }\n if(taskCp.indexOf(cb) === -1) {\n taskCp.push(cb);\n }\n }\n\n getTargetAtPoint(x, y, includeIgnore) {\n function scan(vd, x, y, path, zPath) {\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent, children, zIndexChildren,\n computedStyle: { [DISPLAY]: display, [POINTER_EVENTS]: pointerEvents } } = vd;\n if(!includeIgnore && display === 'none') {\n return;\n }\n if(Array.isArray(zIndexChildren)) {\n for(let i = 0, len = children.length; i < len; i++) {\n children[i].__index__ = i;\n }\n for(let i = zIndexChildren.length - 1; i >= 0; i--) {\n let item = zIndexChildren[i];\n if(item instanceof karas.Text) {\n continue;\n }\n let path2 = path.slice();\n path2.push(item.__index__);\n let zPath2 = zPath.slice();\n zPath2.push(i);\n let res = scan(item, x, y, path2, zPath2);\n if(res) {\n return res;\n }\n }\n }\n if(!includeIgnore && pointerEvents === 'none') {\n return;\n }\n let inThis = geom.pointInQuadrilateral(\n x, y,\n __sx1, __sy1,\n __sx1 + offsetWidth, __sy1,\n __sx1 + offsetWidth, __sy1 + offsetHeight,\n __sx1, __sy1 + offsetHeight,\n matrixEvent\n );\n if(inThis) {\n return {\n target: vd,\n path,\n zPath,\n };\n }\n }\n return scan(this, x, y, [], []);\n }\n\n /**\n * 每次刷新前检查root节点的样式,有些固定的修改无效,有些继承的作为根初始化\n * @param renderMode\n * @param width\n * @param height\n * @private\n */\n __checkRoot(renderMode, width, height) {\n let { dom, currentStyle, computedStyle } = this;\n // canvas/svg作为根节点一定是block或flex,不会是inline\n if(['flex', 'block'].indexOf(currentStyle[DISPLAY]) === -1) {\n computedStyle[DISPLAY] = currentStyle[DISPLAY] = 'block';\n }\n // 同理position不能为absolute\n if(currentStyle[POSITION] === 'absolute') {\n computedStyle[POSITION] = currentStyle[POSITION] = 'static';\n }\n // 根节点满宽高\n currentStyle[WIDTH] = [width, PX];\n currentStyle[HEIGHT] = [height, PX];\n computedStyle[WIDTH] = width;\n computedStyle[HEIGHT] = height;\n // 可能调用resize()导致变更,要重设,canvas无论离屏与否都可使用直接赋值,svg则按dom属性api\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(dom.width !== width) {\n dom.width = width;\n }\n if(dom.height !== height) {\n dom.height = height;\n }\n }\n else if(renderMode === mode.SVG) {\n dom.setAttribute('width', width);\n dom.setAttribute('height', height);\n }\n }\n\n /**\n * 添加更新入口,按节点汇总更新信息\n * @private\n */\n __addUpdate(node, nodeConfig, root, rootConfig, o) {\n let updateHash = rootConfig[NODE_UPDATE_HASH];\n // root特殊处理,检查变更时优先看继承信息\n if(node === root) {\n updateHash = root.__updateRoot;\n if(updateHash) {\n if(o[UPDATE_FOCUS]) {\n updateHash[UPDATE_FOCUS] |= o[UPDATE_FOCUS];\n }\n if(o[UPDATE_MEASURE]) {\n updateHash[UPDATE_MEASURE] = true;\n }\n // 后续存在新建list上,需增加遍历逻辑\n if(o[UPDATE_STYLE]) {\n let list = updateHash[UPDATE_LIST] = updateHash[UPDATE_LIST] || [];\n list.push({\n [UPDATE_STYLE]: o[UPDATE_STYLE],\n [UPDATE_OVERWRITE]: o[UPDATE_OVERWRITE],\n [UPDATE_KEYS]: o[UPDATE_KEYS],\n });\n }\n }\n else {\n root.__updateRoot = o;\n }\n }\n else if(!nodeConfig.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n nodeConfig[NODE_UNIQUE_UPDATE_ID] = uniqueUpdateId;\n // 大多数情况节点都只有一次更新,所以优化首次直接存在style上,后续存在list\n updateHash[uniqueUpdateId++] = o;\n }\n else if(updateHash.hasOwnProperty(nodeConfig[NODE_UNIQUE_UPDATE_ID])) {\n let target = updateHash[nodeConfig[NODE_UNIQUE_UPDATE_ID]];\n if(o[UPDATE_FOCUS]) {\n target[UPDATE_FOCUS] |= o[UPDATE_FOCUS];\n }\n if(o[UPDATE_MEASURE]) {\n target[UPDATE_MEASURE] = true;\n }\n // 后续存在新建list上,需增加遍历逻辑\n if(o[UPDATE_STYLE]) {\n let list = target[UPDATE_LIST] = target[UPDATE_LIST] || [];\n list.push({\n [UPDATE_STYLE]: o[UPDATE_STYLE],\n [UPDATE_OVERWRITE]: o[UPDATE_OVERWRITE],\n [UPDATE_KEYS]: o[UPDATE_KEYS],\n });\n }\n }\n else {\n inject.error('Update process miss uniqueUpdateId');\n }\n }\n\n /**\n * 除首次外每次刷新前检查更新列表,计算样式变化,以及测量信息\n * @private\n */\n __checkUpdate(renderMode, ctx, width, height) {\n let root = this;\n let measureList = [];\n let reflowList = [];\n let cacheHash = {};\n let cacheList = [];\n let zHash = {};\n let zList = [];\n let updateRoot = root.__updateRoot;\n let updateHash = root.__updateHash;\n // 给个方式使得外部可以强制刷新\n let hasUpdate = root.__hasRootUpdate;\n root.__hasRootUpdate = false;\n // root更新特殊提前,因为有继承因素\n if(updateRoot) {\n root.__updateRoot = null;\n hasUpdate = parseUpdate(renderMode, root, updateRoot,\n reflowList, measureList, cacheHash, cacheList);\n // 此时做root检查,防止root出现继承等无效样式,或者发生resize()\n if(hasUpdate) {\n root.__checkRoot(renderMode, width, height);\n }\n }\n // 汇总处理每个节点,k是递增数字直接循环遍历\n let keys = Object.keys(updateHash);\n for(let i = 0, len = keys.length; i < len; i++) {\n let t = parseUpdate(renderMode, root, updateHash[keys[i]],\n reflowList, measureList, cacheHash, cacheList, zHash, zList);\n hasUpdate = hasUpdate || t;\n }\n // 先做一部分reset避免下面measureList干扰,cacheList的是专门收集新增的额外节点\n root.__reflowList = reflowList;\n uniqueUpdateId = 0;\n root.__updateHash = root.__config[NODE_UPDATE_HASH] = {};\n cacheList.forEach(__config => {\n delete __config[NODE_UNIQUE_UPDATE_ID];\n });\n // zIndex改变的汇总修改,防止重复操作\n zList.forEach(item => {\n if(item.hasOwnProperty('__uniqueZId')) {\n delete item.__uniqueZId;\n item.__updateStruct(root.__structs);\n }\n });\n /**\n * 遍历每项节点,计算测量信息,节点向上向下查找继承信息,如果parent也是继承,先计算parent的\n * 过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n */\n let measureHash = {};\n measureList.forEach(node => {\n let { __config:{ [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId, [NODE_DOM_PARENT]: parent } } = node;\n // 在root下的component变更时root会进入,但其没有__uniqueUpdateId\n if(node !== root) {\n if(measureHash.hasOwnProperty(__uniqueUpdateId)) {\n return;\n }\n measureHash[__uniqueUpdateId] = true;\n }\n let last = node;\n // 检查measure的属性是否是inherit,在root下的component变更时root会进入,但其没有__uniqueUpdateId\n // 另外dom标识表明有dom变更强制进入\n let isInherit = node !== root\n && (updateHash[__uniqueUpdateId][UPDATE_ADD_DOM]\n || change.isMeasureInherit(updateHash[__uniqueUpdateId][UPDATE_STYLE]));\n // 是inherit,需要向上查找,从顶部向下递归计算继承信息\n if(isInherit) {\n while(parent && parent !== root) {\n let { __config: {\n [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId,\n }, currentStyle } = parent;\n let isInherit;\n if(parent.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n let style = updateHash[__uniqueUpdateId][UPDATE_STYLE];\n measureHash[__uniqueUpdateId] = true;\n let temp = change.measureInheritList(style);\n isInherit = !!temp.length;\n }\n else {\n isInherit = change.isMeasureInherit(currentStyle);\n }\n // 如果parent有inherit存入列表且继续向上,否则跳出循环\n if(isInherit) {\n last = parent;\n }\n else {\n break;\n }\n // 考虑component下的继续往上继承\n parent = parent.domParent;\n }\n }\n // 自顶向下查找inherit的,利用已有的方法+回调,当递归包含重复时标记防止重复\n last.__computeMeasure(renderMode, ctx, function(target) {\n if(target.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n measureHash[target.__config[NODE_UNIQUE_UPDATE_ID]] = true;\n }\n });\n });\n // 做完清空留待下次刷新重来\n for(let i = 0, len = keys.length; i < len; i++) {\n delete updateHash[keys[i]][UPDATE_CONFIG][NODE_UNIQUE_UPDATE_ID];\n }\n return hasUpdate;\n }\n\n /**\n * 除首次外每次刷新前检查reflow列表,计算需要reflow的节点局部重新布局\n * 当一个元素absolute不变时,其变化不会影响父元素和兄弟元素,直接自己重新局部LAYOUT包含子节点\n * 当absolute发生改变时,其变化会影响父和兄弟,视作父重新布局\n * 当inline变化时,视为其最近block/flex父变化\n * 当block变化时,往上查找最上层flex视为其变化,如不是则影响后面兄弟offset和父resize\n * 当flex变化时,往上查找最上层flex视为其变化,如不是则影响所有递归子节点layout和父resize\n * 以上3种情况向上查找时遇到absolute父均提前跳出,并标记absolute父LAYOUT\n * 上面所有情况即便结束还得额外看是否处于absolute中,是还是标记absolute重新布局\n * 当relative只变化left/top/right/bottom时,自己重新layout\n * 检测节点时记录影响的所有节点,最终形成一棵或n棵局部树\n * 需要重新布局的记作LAYOUT,被兄弟影响只需偏移的记作OFFSET,OFFSET可能会重复变为LAYOUT\n * 上述情况倘若发生包含重复,去掉子树,因子树视为被包含的重新布局\n * 如果有从root开始的,直接重新布局像首次那样即可\n * 如果非root,所有树根按先根顺序记录下来,依次执行局部布局\n * =========================\n * addDom比较特殊,是向已有节点中添加新的节点,检查影响与普通domDiff变化不同\n * @private\n */\n __checkReflow(width, height) {\n let { __reflowList: reflowList } = this;\n if(!reflowList.length) {\n return;\n }\n let root = this;\n let uniqueList = [];\n let hasRoot;\n __uniqueReflowId = 0;\n let reflowHash = {};\n // 遍历检查发生布局改变的节点列表,此时computedStyle还是老的,currentStyle是新的\n for(let i = 0, len = reflowList.length; i < len; i++) {\n let item = reflowList[i];\n let { node, component, addDom, removeDom } = item;\n // root提前跳出,完全重新布局\n if(node === this) {\n hasRoot = true;\n break;\n }\n // 添加时如果是cp则node取sr来布局\n if(addDom && node instanceof Component) {\n node = node.shadowRoot;\n }\n // 每个节点生成唯一的布局识别id存入hash防止重复\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n reflowHash[__uniqueReflowId++] = item;\n }\n // 每个节点都向上检查影响,以及是否从root开始完全重新,remove特殊对待,影响父节点视为普通父节点relay\n if(checkInfluence(root, reflowHash, node, component, addDom)) {\n hasRoot = true;\n if(addDom) {\n this.__zIndexChildren = null;\n }\n break;\n }\n // remove的要特殊对待,因为提前删除了父子兄弟关系,下面deepScan不会出现\n else if(removeDom) {\n uniqueList.push(item);\n }\n }\n __uniqueReflowId = 0;\n this.__reflowList = [];\n // 有root提前跳出\n if(hasRoot) {\n reflow.clearUniqueReflowId(reflowHash);\n // 布局分为两步,普通流和定位流,互相递归\n this.__layout({\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\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 FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction reBuild(target, origin, base, isMulti) {\n if(isMulti) {\n return target.map(item => origin + item * base);\n }\n else {\n return origin + target * base;\n }\n}\n\nfunction reBuildC(target, originX, originY, width, height, isMulti) {\n if(isMulti) {\n if(target) {\n return target.map(item => reBuildC(item, originX, originY, width, height));\n }\n }\n else {\n if(target && target.length >= 2) {\n return [\n originX + target[0] * width,\n originY + target[1] * height,\n ];\n }\n }\n return [];\n}\n\nfunction curveNum(controlA, controlB) {\n let num = 0;\n if(controlA && controlA.length >= 2) {\n num++;\n }\n if(controlB && controlB.length >= 2) {\n num += 2;\n }\n return num;\n}\n\nfunction getNewPoint(x1, y1, x2, y2, controlA, controlB, num, start = 0, end = 1) {\n if(start === 0 && end === 1) {\n return [x1, y1, x2, y2, controlA, controlB];\n }\n if(start === end) {\n return [];\n }\n if(start > end) {\n [start, end] = [end, start];\n }\n start = Math.max(0, start);\n end = Math.min(1, end);\n if(num === 3) {\n [[x1, y1], controlA, controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, controlB, [x2, y2]], start, end);\n }\n else if(num === 2) {\n [[x1, y1], controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlB, [x2, y2]], start, end);\n }\n else if(num === 1) {\n [[x1, y1], controlA, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, [x2, y2]], start, end);\n }\n else {\n let a = x2 - x1;\n let b = y2 - y1;\n x1 += a * start;\n y1 += b * start;\n x2 += a * (1 - end);\n y2 += b * (1 - end);\n }\n return [x1, y1, x2, y2, controlA, controlB];\n}\n\nclass Line extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // x1,y1和x2,y2表明线段的首尾坐标,control表明控制点坐标\n if(this.isMulti) {\n this.__x1 = [0];\n this.__y1 = [0];\n this.__x2 = [1];\n this.__y2 = [1];\n this.__controlA = [[]];\n this.__controlB = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.x1)) {\n this.__x1 = props.x1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x1)) {\n this.__x1 = [parseFloat(props.x1) || 0];\n }\n if(Array.isArray(props.y1)) {\n this.__y1 = props.y1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y1)) {\n this.__y1 = [parseFloat(props.y1) || 0];\n }\n if(Array.isArray(props.x2)) {\n this.__x2 = props.x2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x2)) {\n this.__x2 = [parseFloat(props.x2) || 0];\n }\n if(Array.isArray(props.y2)) {\n this.__y2 = props.y2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y2)) {\n this.__y2 = [parseFloat(props.y2) || 0];\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => parseFloat(i) || 0);\n for(let i = this.__start.length; i < this.__x1.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = parseFloat(props.start) || 0;\n this.__start = this.__x1.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n });\n for(let i = this.__end.length; i < this.__x1.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = v;\n this.__end = this.__x1.map(() => v);\n }\n }\n else {\n this.__x1 = this.__y1 = this.__start = 0;\n this.__x2 = this.__y2 = this.__end = 1;\n this.__controlA = [];\n this.__controlB = [];\n if(!isNil(props.x1)) {\n this.__x1 = parseFloat(props.x1) || 0;\n }\n if(!isNil(props.y1)) {\n this.__y1 = parseFloat(props.y1) || 0;\n }\n if(!isNil(props.x2)) {\n this.__x2 = parseFloat(props.x2) || 0;\n }\n if(!isNil(props.y2)) {\n this.__y2 = parseFloat(props.y2) || 0;\n }\n if(!isNil(props.start)) {\n this.__start = parseFloat(props.start) || 0;\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = v;\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA;\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB;\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, __cacheProps, isMulti } = this;\n let rebuild;\n ['x1', 'x2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originX, width, isMulti);\n }\n });\n ['y1', 'y2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originY, height, isMulti);\n }\n });\n ['controlA', 'controlB'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuildC(this[k], originX, originY, width, height, isMulti);\n }\n });\n ['start', 'end'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = this[k];\n }\n });\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, dx2, dy2) {\n let res = super.render(renderMode, lv, ctx, cache, dx2, dy2);\n if(res.break) {\n return res;\n }\n ctx = res.ctx;\n let {\n sx3,\n sy3,\n stroke: strokes,\n strokeWidth: strokeWidths,\n strokeDasharray: strokeDasharrays,\n strokeDasharrayStr: strokeDasharrayStrs,\n strokeLinecap: strokeLinecaps,\n strokeLinejoin: strokeLinejoins,\n strokeMiterlimit: strokeMiterlimits,\n dx,\n dy,\n } = res;\n let { __cacheProps, isMulti } = this;\n let rebuild = this.buildCache(sx3, sy3);\n if(rebuild && renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n __cacheProps.x1.forEach((xa, i) => {\n let xb = __cacheProps.x2[i];\n let ya = __cacheProps.y1[i];\n let yb = __cacheProps.y2[i];\n let ca = __cacheProps.controlA[i];\n let cb = __cacheProps.controlB[i];\n let start = __cacheProps.start[i];\n let end = __cacheProps.end[i];\n let curve = curveNum(ca, cb);\n if(start !== 0 || end !== 1) {\n [xa, ya, xb, ya, ca, cb] = getNewPoint(xa, ya, xb, ya, ca, cb, curve, start, end, __cacheProps.len);\n }\n d += painter.svgLine(xa, ya, xb, yb, ca, cb, curve);\n });\n }\n else {\n let curve = curveNum(__cacheProps.controlA, __cacheProps.controlB);\n let { x1, y1, x2, y2, controlA, controlB, start, end } = __cacheProps;\n if(start !== 0 || end !== 1) {\n [x1, y1, x2, y2, controlA, controlB] = getNewPoint(x1, y1, x2, y2, controlA, controlB, curve, start, end, __cacheProps.len);\n }\n d = painter.svgLine(x1, y1, x2, y2, controlA, controlB, curve);\n }\n __cacheProps.d = d;\n }\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n strokes.forEach((stroke, i) => {\n let strokeWidth = strokeWidths[i];\n let isStrokeRE = strokeWidth > 0 && stroke.k === 'radial' && Array.isArray(stroke.v);\n if(strokeWidth > 0 && stroke !== 'none') {\n this.__preSetCanvas(renderMode, ctx, {\n stroke,\n strokeWidth,\n strokeDasharray: strokeDasharrays[i],\n strokeLinecap: strokeLinecaps[i],\n strokeLinejoin: strokeLinejoins[i],\n strokeMiterlimit: strokeMiterlimits[i],\n });\n if(isStrokeRE) {\n ctx.strokeStyle = stroke.v[0];\n }\n ctx.beginPath();\n if(isMulti) {\n __cacheProps.x1.forEach((xa, i) => {\n let xb = __cacheProps.x2[i];\n let ya = __cacheProps.y1[i];\n let yb = __cacheProps.y2[i];\n let ca = __cacheProps.controlA[i];\n let cb = __cacheProps.controlB[i];\n let start = __cacheProps.start[i];\n let end = __cacheProps.end[i];\n let curve = curveNum(ca, cb);\n if(start !== 0 || end !== 1) {\n [xa, ya, xb, ya, ca, cb] = getNewPoint(xa, ya, xb, ya, ca, cb, curve, start, end, __cacheProps.len);\n }\n painter.canvasLine(ctx, xa, ya, xb, yb, ca, cb, curve, dx, dy);\n });\n }\n else {\n let curve = curveNum(__cacheProps.controlA, __cacheProps.controlB);\n let { x1, y1, x2, y2, controlA, controlB, start, end } = __cacheProps;\n if(start !== 0 || end !== 1) {\n [x1, y1, x2, y2, controlA, controlB] = getNewPoint(x1, y1, x2, y2, controlA, controlB, curve, start, end, __cacheProps.len);\n }\n painter.canvasLine(ctx, x1, y1, x2, y2, controlA, controlB, curve, dx, dy);\n }\n ctx.stroke();\n ctx.closePath();\n }\n });\n }\n else if(renderMode === mode.SVG) {\n strokes.forEach((stroke, i) => {\n let strokeWidth = strokeWidths[i];\n let isStrokeRE = strokeWidth > 0 && stroke.k === 'radial' && Array.isArray(stroke.v);\n let props = [\n ['d', __cacheProps.d],\n ['fill', 'none'],\n ['stroke', isStrokeRE ? stroke.v[0] : (stroke.v || stroke)],\n ['stroke-width', strokeWidth]\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStrs[i], strokeLinecaps[i], strokeLinejoins[i], strokeMiterlimits[i]);\n this.addGeom('path', props);\n });\n }\n return res;\n }\n\n get x1() {\n return this.getProps('x1');\n }\n\n get y1() {\n return this.getProps('y1');\n }\n\n get x2() {\n return this.getProps('x2');\n }\n\n get y2() {\n return this.getProps('y2');\n }\n\n get controlA() {\n return this.getProps('controlA');\n }\n\n get controlB() {\n return this.getProps('controlB');\n }\n\n get start() {\n return this.getProps('start');\n }\n\n get end() {\n return this.getProps('end');\n }\n\n get bbox() {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n },\n } = this;\n this.buildCache(originX, originY);\n let { x1, y1, x2, y2, controlA, controlB } = __cacheProps;\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1s, y1s, x2s, y2s] = this.__spreadBbox(boxShadow, filter);\n x1s -= half;\n y1s -= half;\n x2s += half;\n y2s += half;\n if(!isMulti) {\n x1 = [x1];\n x2 = [x2];\n y1 = [y1];\n y2 = [y2];\n controlA = [controlA];\n controlB = [controlB];\n }\n x1.forEach((xa, i) => {\n let ya = y1[i];\n let xb = x2[i];\n let yb = y2[i];\n let ca = controlA[i];\n let cb = controlB[i];\n if((isNil(ca) || ca.length < 2) && (isNil(cb) || cb.length < 2)) {\n bbox[0] = Math.min(bbox[0], xa + x1s);\n bbox[0] = Math.min(bbox[0], xb + x1s);\n bbox[1] = Math.min(bbox[1], ya + y1s);\n bbox[1] = Math.min(bbox[1], yb + y1s);\n bbox[2] = Math.max(bbox[2], xa + x2s);\n bbox[2] = Math.max(bbox[2], xb + x2s);\n bbox[3] = Math.max(bbox[3], ya + y2s);\n bbox[3] = Math.max(bbox[3], yb + y2s);\n }\n else if(isNil(ca) || ca.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1s);\n bbox[0] = Math.min(bbox[0], bezierBox[2] + x1s);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1s);\n bbox[1] = Math.min(bbox[1], bezierBox[3] + y1s);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + x2s);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2s);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + y2s);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2s);\n }\n else if(isNil(cb) || cb.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1s);\n bbox[0] = Math.min(bbox[0], bezierBox[2] + x1s);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1s);\n bbox[1] = Math.min(bbox[1], bezierBox[3] + y1s);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + x2s);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2s);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + y2s);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2s);\n }\n else {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1s);\n bbox[0] = Math.min(bbox[0], bezierBox[2] + x1s);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1s);\n bbox[1] = Math.min(bbox[1], bezierBox[3] + y1s);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + x2s);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2s);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + y2s);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2s);\n }\n });\n return bbox;\n }\n}\n\nexport default Line;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction concatPointAndControl(point, control) {\n if(Array.isArray(control) && (control.length === 2 || control.length === 4)\n && Array.isArray(point) && point.length === 2) {\n return control.concat(point);\n }\n return point;\n}\n\nfunction getLength(list, isMulti) {\n let res = [];\n let total = 0;\n let increase = [];\n if(isMulti) {\n total = [];\n list.forEach(list => {\n let temp = getLength(list);\n res.push(temp.list);\n total.push(temp.total);\n increase.push([0].concat(temp.increase));\n });\n }\n else if(Array.isArray(list)) {\n total = 0;\n increase.push(0);\n let start = 0;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item)) {\n start = i;\n break;\n }\n }\n let prev = list[start];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n let a = Math.abs(item[0] - prev[0]);\n let b = Math.abs(item[1] - prev[1]);\n let c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n res.push(c);\n total += c;\n increase.push(total);\n prev = item;\n }\n else if(item.length === 4) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]]], 2);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[2], item[3]];\n }\n else if(item.length === 6) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]], [item[4], item[5]]], 3);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[4], item[5]];\n }\n }\n }\n return {\n list: res,\n total,\n increase,\n };\n}\n\nfunction getIndex(list, t, i, j) {\n if(i === j) {\n if(list[i] > t) {\n return i - 1;\n }\n return i;\n }\n let middle = i + ((j - i) >> 1);\n if(list[middle] === t) {\n return middle;\n }\n else if(list[middle] > t) {\n return getIndex(list, t, i, Math.max(middle - 1, i));\n }\n else {\n return getIndex(list, t, Math.min(middle + 1, j), j);\n }\n}\n\nfunction getNewList(list, len, start = 0, end = 1) {\n if(start === 0 && end === 1) {\n return list;\n }\n if(start === end) {\n return [];\n }\n if(start > end) {\n [start, end] = [end, start];\n }\n // start和end只能相差<=1,如果>1则校正\n while(end - start > 1) {\n end--;\n }\n // 将start和end统一至最接近0的正值\n while(end < 0 || start < 0) {\n end++;\n start++;\n }\n while(end >= 1 && start >= 1) {\n end--;\n start--;\n }\n // clone出原本顶点列表,防止干扰\n let length = list.length;\n list = util.clone(list);\n let res = [];\n let start2 = start > 1 ? (start - 1) : start;\n let end2 = end > 1 ? (end - 1) : end;\n let i = getIndex(len.increase, start2 * len.total, 0, length - 1);\n let j = getIndex(len.increase, end2 * len.total, 0, length - 1);\n // start<0或者end>1或者普通情况,一共3种,start和end不可能同时超限\n let isStartLt0 = start < 0;\n let isEndGt1 = end > 1;\n end2 *= len.total;\n let prePercent = 1;\n let endPoint;\n if(end2 > len.increase[j]) {\n let prev = list[j].slice(list[j].length - 2); // 最后2个点是x,y,前面是control\n let current = list[j + 1];\n let l = len.list[j];\n let diff = end2 - len.increase[j];\n let t = diff / l;\n prePercent = t;\n if(current.length === 2) {\n let a = current[0] - prev[0];\n let b = current[1] - prev[1];\n if(isEndGt1) {\n endPoint = [prev[0] + t * a, prev[1] + t * b];\n }\n else {\n t = 1 - t;\n endPoint = [current[0] - t * a, current[1] - t * b];\n }\n }\n else if(current.length === 4) {\n let r = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t);\n endPoint = [r[1][0], r[1][1], r[2][0], r[2][1]];\n }\n else if(current.length === 6) {\n let r = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t);\n endPoint = [r[1][0], r[1][1], r[2][0], r[2][1], r[3][0], r[3][1]];\n }\n }\n start2 *= len.total;\n if(start2 > len.increase[i]) {\n let current;\n let prev = list[i].slice(list[i].length - 2);\n let l = len.list[i];\n // 同一条线段时如果有end裁剪,会影响start长度,这里还要防止头尾绕了一圈的情况\n if(i === j && !isStartLt0 && !isEndGt1 && prePercent !== 1) {\n l *= prePercent;\n if(endPoint) {\n current = endPoint;\n }\n }\n if(!current) {\n current = list[i + 1];\n }\n let diff = start2 - len.increase[i];\n let t = diff / l;\n if(current.length === 2) {\n let a = current[0] - prev[0];\n let b = current[1] - prev[1];\n if(isStartLt0) {\n t = 1 - t;\n res.push([current[0] - t * a, current[1] - t * b]);\n }\n else {\n res.push([prev[0] + t * a, prev[1] + t * b]);\n }\n res.push(current);\n }\n else if(current.length === 4) {\n let r = geom.sliceBezier([[current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n res.push(r[0]);\n res.push([r[1][0], r[1][1], r[2][0], r[2][1]]);\n // 同一条线段上去除end冲突\n if(i === j && !isStartLt0 && !isEndGt1) {\n endPoint = null;\n }\n }\n else if(current.length === 6) {\n let r = geom.sliceBezier([[current[4], current[5]], [current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n res.push(r[0])\n res.push([r[1][0], r[1][1], r[2][0], r[2][1], current[4], current[5]]);\n if(i === j && !isStartLt0 && !isEndGt1) {\n endPoint = null;\n }\n }\n }\n // start和end之间的线段,注意头尾饶了一圈的情况,以及起始点被上方考虑过了\n for(let k = i + 2; k <= j + (!isStartLt0 && !isEndGt1 ? 0 : length); k++) {\n res.push(list[k % length]);\n }\n if(endPoint) {\n res.push(endPoint);\n }\n return res;\n}\n\nclass Polyline extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 所有点的列表\n if(this.isMulti) {\n this.__points = [[]];\n this.__controls = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => parseFloat(i) || 0);\n for(let i = this.__start.length; i < this.__points.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = parseFloat(props.start) || 0;\n this.__start = this.__points.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n });\n for(let i = this.__end.length; i < this.__points.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = this.__points.map(() => v);\n }\n }\n else {\n this.__points = [];\n // 控制点\n this.__controls = [];\n this.__start = 0;\n this.__end = 1;\n if(!isNil(props.start)) {\n this.__start = parseFloat(props.start) || 0;\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = v;\n }\n }\n if(Array.isArray(props.controls)) {\n this.__controls = props.controls;\n }\n if(Array.isArray(props.points)) {\n this.__points = props.points;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n return points.map((item, i) => {\n if(!Array.isArray(item)) {\n return;\n }\n let len = item.length;\n if(isControl) {\n if(len !== 0 && len !== 2 && len !== 4) {\n return;\n }\n }\n else {\n if(len !== 0 && len !== 2) {\n return;\n }\n }\n let res = [];\n for(let i = 0; i < len; i++) {\n if(i % 2 === 0) {\n res.push(originX + item[i] * width);\n }\n else {\n res.push(originY + item[i] * height);\n }\n }\n return res;\n });\n }\n\n // 供polygon覆盖,后处理booleanOperations\n __reprocessing(list) {\n return list;\n }\n\n // 同polygon覆盖,booleanOperations改变时需刷新缓冲顶点坐标\n __needRebuildSE() {}\n\n buildCache(originX, originY) {\n let { width, height, points, controls, start, end, __cacheProps, isMulti } = this;\n let rebuild, rebuildSE;\n if(isNil(__cacheProps.points)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.points = points.map(item => {\n if(Array.isArray(item)) {\n return this.__getPoints(originX, originY, width, height, item);\n }\n });\n }\n else {\n __cacheProps.points = this.__getPoints(originX, originY, width, height, points);\n }\n }\n if(isNil(__cacheProps.controls)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.controls = controls.map(item => {\n if(Array.isArray(item)) {\n return this.__getPoints(originX, originY, width, height, item, true);\n }\n return item;\n });\n }\n else {\n __cacheProps.controls = this.__getPoints(originX, originY, width, height, controls, true);\n }\n }\n if(isNil(__cacheProps.start)) {\n rebuildSE = true;\n __cacheProps.start = start;\n }\n if(isNil(__cacheProps.end)) {\n rebuildSE = true;\n __cacheProps.end = end;\n }\n // polygon会覆盖检查booleanOperations缓存\n if(this.__needRebuildSE(__cacheProps)) {\n rebuildSE = true;\n }\n // points/controls有变化就需要重建顶点\n if(rebuild) {\n let { points, controls } = __cacheProps;\n if(isMulti) {\n __cacheProps.list2 = points.map((item, i) => {\n let cl = controls[i];\n if(Array.isArray(item)) {\n return item.map((point, j) => {\n if(j) {\n return concatPointAndControl(point, cl && cl[j - 1]);\n }\n return point;\n });\n }\n });\n __cacheProps.len = getLength(__cacheProps.list2, isMulti);\n }\n else {\n __cacheProps.list2 = points.map((point, i) => {\n if(i) {\n return concatPointAndControl(point, controls[i - 1]);\n }\n return point;\n });\n __cacheProps.len = getLength(__cacheProps.list2, isMulti);\n }\n }\n if(rebuild || rebuildSE) {\n if(isMulti) {\n __cacheProps.list = __cacheProps.list2.map((item, i) => {\n if(Array.isArray(item)) {\n let len = __cacheProps.len;\n return getNewList(item, {\n list: len.list[i],\n total: len.total[i],\n increase: len.increase[i],\n }, __cacheProps.start[i], __cacheProps.end[i]);\n }\n });\n }\n else {\n __cacheProps.list = getNewList(__cacheProps.list2, __cacheProps.len, __cacheProps.start, __cacheProps.end);\n }\n // 后处理一次,让polygon支持布尔运算\n __cacheProps.list = this.__reprocessing(__cacheProps.list, isMulti);\n }\n return rebuild || rebuildSE;\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(res.break) {\n return res;\n }\n this.buildCache(res.sx3, res.sy3);\n ctx = res.ctx;\n this.__renderPolygon(renderMode, ctx, res);\n return res;\n }\n\n get points() {\n return this.getProps('points');\n }\n\n get controls() {\n return this.getProps('controls');\n }\n\n get start() {\n return this.getProps('start');\n }\n\n get end() {\n return this.getProps('end');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n },\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n let { points, controls } = __cacheProps;\n if(!isMulti) {\n points = [points];\n controls = [controls];\n }\n points.forEach((pointList, i) => {\n if(!pointList || pointList.length < 2 || !pointList[0] || !pointList[1]\n || pointList[0].length < 2 || pointList[1].length < 2) {\n return;\n }\n let controlList = controls[i] || [];\n let [xa, ya] = pointList[0];\n for(let i = 1, len = pointList.length; i < len; i++) {\n let [xb, yb] = pointList[i];\n let c = controlList[i - 1];\n if(c && c.length === 4) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], c[2], c[3], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2);\n }\n else if(c && c.length === 2) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2);\n }\n else {\n bbox[0] = Math.min(bbox[0], xa + x1);\n bbox[1] = Math.min(bbox[1], ya + y1);\n bbox[2] = Math.max(bbox[2], xa + x2);\n bbox[3] = Math.max(bbox[3], ya + y2);\n }\n xa = xb;\n ya = yb;\n }\n });\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Polyline;\n","import Polyline from './Polyline';\nimport util from '../../util/util';\nimport { union, diff, intersection, xor } from '../../math/martinez';\n\nclass Polygon extends Polyline {\n constructor(tagName, props) {\n super(tagName, props);\n if(props.booleanOperations) {\n this.__booleanOperations = props.booleanOperations;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n let res = super.__getPoints(originX, originY, width, height, points, isControl);\n if(!isControl) {\n res.push(res[0]);\n }\n return res;\n }\n\n // 布尔运算覆盖,仅multi才发生,因为需要多个多边形数据\n __reprocessing(list, isMulti) {\n if(!isMulti) {\n return list;\n }\n let bo = this.booleanOperations, len = list.length;\n if(!Array.isArray(bo) && bo) {\n let old = bo;\n bo = [bo];\n for(let i = 1; i < len - 1; i++) {\n bo.push(old);\n }\n }\n if(Array.isArray(bo) && bo.length) {\n let res = [];\n let last;\n for(let i = 0; i < len - 1; i++) {\n let a = list[i], b = list[i + 1];\n switch(bo[i]) {\n case 'intersection':\n if(!a || !a.length || !b || !b.length) {\n res.push(null);\n }\n else {\n intersection([a], [b]).forEach(item => {\n res.push(item[0]);\n });\n }\n last = true;\n break;\n case 'union':\n if((!a || !a.length) && (!b || !b.length)) {\n res.push(null);\n }\n else if(!a || !a.length) {\n res.push(b);\n }\n else if(!b || !b.length) {\n res.push(a);\n }\n else {\n union([a], [b]).forEach(item => {\n res.push(item[0]);\n });\n }\n last = true;\n break;\n case 'diff':\n if(!a || !a.length) {\n res.push(null);\n }\n else if(!b || !b.length) {\n res.push(a);\n }\n else {\n diff([a], [b]).forEach(item => {\n res.push(item[0]);\n });\n }\n last = true;\n break;\n case 'xor':\n if((!a || !a.length) && (!b || !b.length)) {\n res.push(null);\n }\n else if(!a || !a.length) {\n res.push(b);\n }\n else if(!b || !b.length) {\n res.push(a);\n }\n else {\n xor([a], [b]).forEach(item => {\n res.push(item[0]);\n });\n }\n last = true;\n break;\n default:\n res.push(list[i]);\n last = false;\n break;\n }\n }\n // 最后一个没参与布尔运算,原封不动装载\n if(!last) {\n res.push(list[len - 1]);\n }\n return res;\n }\n return list;\n }\n\n // 覆盖,当booleanOperations动画改变时刷新顶点缓存\n __needRebuildSE(__cacheProps) {\n if(util.isNil(__cacheProps.booleanOperations)) {\n __cacheProps.booleanOperations = true;\n return true;\n }\n }\n\n get booleanOperations() {\n return this.getProps('booleanOperations');\n }\n}\n\nexport default Polygon;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport inject from '../../util/inject';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { sectorPoints } = geom;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction getR(v, dft) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = dft;\n }\n return v;\n}\n\nclass Sector extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 角度\n if(this.isMulti) {\n this.__begin = [0];\n this.__end = [0];\n this.__r = [1];\n if(Array.isArray(props.begin)) {\n this.__begin = props.begin.map(i => getR(i, 0));\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => getR(i, 0));\n }\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i, 1));\n }\n if(Array.isArray(props.edge)) {\n this.__edge = props.edge.map(i => !!i);\n }\n if(Array.isArray(props.closure)) {\n this.__closure = props.closure.map(i => !!i);\n }\n }\n else {\n this.__begin = this.__end = 0;\n // 半径[0, ∞),默认1\n this.__r = 1;\n // 扇形两侧是否有边\n this.__edge = false;\n // 扇形大于180°时,是否闭合两端\n this.__closure = false;\n if(!isNil(props.begin)) {\n this.__begin = getR(props.begin, 0);\n }\n if(!isNil(props.end)) {\n this.__end = getR(props.end, 0);\n }\n if(!isNil(props.r)) {\n this.__r = getR(props.r, 1);\n }\n if(!isNil(props.edge)) {\n this.__edge = !!props.edge;\n }\n if(!isNil(props.closure)) {\n this.__closure = !!props.closure;\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, begin, end, r, edge, closure, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.begin) || focus) {\n rebuild = true;\n __cacheProps.begin = (begin || 0) % 360;\n }\n if(isNil(__cacheProps.end) || focus) {\n rebuild = true;\n __cacheProps.end = (end || 0) % 360;\n }\n if(isNil(__cacheProps.r) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.r = r.map(r => r * width * 0.5);\n }\n else {\n __cacheProps.r = r * width * 0.5;\n }\n }\n r = __cacheProps.r;\n if(isNil(__cacheProps.edge) || focus) {\n rebuild = true;\n __cacheProps.edge = edge;\n }\n if(isNil(__cacheProps.closure) || focus) {\n rebuild = true;\n __cacheProps.closure = closure;\n }\n if(rebuild) {\n if(isMulti) {\n __cacheProps.list = [];\n __cacheProps.sList = [];\n begin.forEach((begin, i) => {\n let r2 = isNil(r[i]) ? width * 0.5 : r[i];\n let list = sectorPoints(cx, cy, r2, parseFloat(begin || 0) % 360, parseFloat(end[i] || 0) % 360);\n let sList = list.slice(0);\n if(closure[i]) {\n list.push(list[0].slice(0));\n if(edge) {\n sList.push(sList[0].slice(0));\n }\n }\n else {\n list.unshift([cx, cy]);\n list.push([cx, cy]);\n if(edge) {\n sList.unshift([cx, cy]);\n sList.push([cx, cy]);\n }\n }\n __cacheProps.list.push(list);\n __cacheProps.sList.push(sList);\n });\n }\n else {\n let list = sectorPoints(cx, cy, r, parseFloat(begin || 0), parseFloat(end || 0));\n let sList = list.slice(0);\n if(closure) {\n list.push(list[0].slice(0));\n if(edge) {\n sList.push(sList[0].slice(0));\n }\n }\n else {\n list.unshift([cx, cy]);\n list.push([cx, cy]);\n if(edge) {\n sList.unshift([cx, cy]);\n sList.push([cx, cy]);\n }\n }\n __cacheProps.list = list;\n __cacheProps.sList = sList;\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, dx2, dy2) {\n let res = super.render(renderMode, lv, ctx, cache, dx2, dy2);\n if(res.break) {\n return res;\n }\n this.buildCache(res.cx, res.cy);\n ctx = res.ctx;\n let {\n fill: fills,\n fillRule: fillRules,\n stroke: strokes,\n strokeWidth: strokeWidths,\n strokeDasharray: strokeDasharrays,\n strokeDasharrayStr: strokeDasharrayStrs,\n strokeLinecap: strokeLinecaps,\n strokeLinejoin: strokeLinejoins,\n strokeMiterlimit: strokeMiterlimits,\n dx,\n dy,\n } = res;\n let { __cacheProps: { list, sList }, isMulti } = this;\n // 普通情况下只有1个,按普通情况走\n if(fills.length <= 1 && strokes.length <= 1) {\n let o = {\n fill: fills[0],\n fillRule: fillRules[0],\n stroke: strokes[0],\n strokeWidth: strokeWidths[0],\n strokeDasharray: strokeDasharrays[0],\n strokeDasharrayStr: strokeDasharrayStrs[0],\n strokeLinecap: strokeLinecaps[0],\n strokeLinejoin: strokeLinejoins[0],\n strokeMiterlimit: strokeMiterlimits[0],\n dx,\n dy,\n };\n this.__renderOneSector(renderMode, ctx, isMulti, list, sList, o);\n }\n // 多个需要fill在下面,stroke在上面,依次循环\n else {\n for(let i = 0, len = fills.length; i < len; i++) {\n let fill = fills[i];\n if(fill) {\n let o = {\n fill,\n fillRule: fillRules[i],\n dx,\n dy,\n };\n this.__renderOneSector(renderMode, ctx, isMulti, list, sList, o);\n }\n }\n for(let i = 0, len = strokes.length; i < len; i++) {\n let stroke = strokes[i];\n if(stroke) {\n let o = {\n stroke,\n strokeWidth: strokeWidths[i],\n strokeDasharray: strokeDasharrays[i],\n strokeDasharrayStr: strokeDasharrayStrs[i],\n strokeLinecap: strokeLinecaps[i],\n strokeLinejoin: strokeLinejoins[i],\n strokeMiterlimit: strokeMiterlimits[i],\n dx,\n dy,\n };\n this.__renderOnePolygon(renderMode, ctx, isMulti, list, sList, o);\n }\n }\n }\n return res;\n }\n\n __renderOneSector(renderMode, ctx, isMulti, list, sList, res) {\n let {\n fill,\n stroke,\n strokeWidth,\n } = res;\n let isFillCE = fill.k === 'conic';\n let isStrokeCE = stroke.k === 'conic';\n let isFillRE = fill.k === 'radial' && Array.isArray(fill.v);\n let isStrokeRE = strokeWidth > 0 && stroke.k === 'radial' && Array.isArray(stroke.v);\n if(isFillCE || isStrokeCE) {\n if(isFillCE) {\n this.__conicGradient(renderMode, ctx, list, isMulti, res);\n }\n else if(fill && fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true);\n }\n if(strokeWidth > 0 && isStrokeCE) {\n inject.warn('Stroke style can not use conic-gradient');\n }\n else if(strokeWidth > 0 && stroke && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, sList, res, false, true);\n }\n }\n else if(isFillRE || isStrokeRE) {\n if(isFillRE) {\n this.__radialEllipse(renderMode, ctx, list, isMulti, res, 'fill');\n }\n else if(fill && fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true);\n }\n // stroke椭圆渐变matrix会变形,降级为圆\n if(strokeWidth > 0 && isStrokeRE) {\n inject.warn('Stroke style can not use radial-gradient for ellipse');\n res.stroke = res.stroke.v[0];\n this.__drawPolygon(renderMode, ctx, isMulti, sList, res, false, true);\n }\n else if(strokeWidth > 0 && stroke && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, sList, res, false, true);\n }\n }\n else {\n if(fill && fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true, false);\n }\n if(strokeWidth > 0 && stroke && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, sList, res, false, true);\n }\n }\n }\n\n __genSector(edge, d, fill, stroke, strokeWidth, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit) {\n if(edge) {\n let props = [\n ['d', d[0]],\n ['fill', fill.v || fill],\n ['stroke', stroke.v || stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n else {\n this.addGeom('path', [\n ['d', d[0]],\n ['fill', fill.v || fill],\n ]);\n if(strokeWidth > 0) {\n let props = [\n ['d', d[1]],\n ['fill', 'none'],\n ['stroke', stroke.v || stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n }\n }\n\n get begin() {\n return this.getProps('begin');\n }\n\n get end() {\n return this.getProps('end');\n }\n\n get r() {\n return this.getProps('r');\n }\n\n get edge() {\n return this.getProps('edge');\n }\n\n // >180°时是否链接端点\n get closure() {\n return this.getProps('closure');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY, width, height,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n let xa = cx - r + x1;\n let xb = cx + r + x2;\n let ya = cy - r + y1;\n let yb = cy + r + y2;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Sector;\n","import Geom from './Geom';\nimport util from \"../../util/util\";\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction genVertex(x, y, width, height, rx = 0, ry = 0) {\n if(rx === 0 || ry === 0) {\n return [\n [x, y],\n [x + width, y],\n [x + width, y + height],\n [x, y + height],\n [x, y],\n ];\n }\n let ox = rx * geom.H;\n let oy = ry * geom.H;\n return [\n [x + rx, y],\n [x + width - rx, y],\n [x + width + ox - rx, y, x + width, y + ry - oy, x + width, y + ry],\n [x + width, y + height - ry],\n [x + width, y + height + oy - ry, x + width + ox - rx, y + height, x + width - rx, y + height],\n [x + rx, y + height],\n [x + rx - ox, y + height, x, y + height + oy - ry, x, y + height - ry],\n [x, y + ry],\n [x, y + ry - oy, x + rx - ox, y, x + rx, y]\n ];\n}\n\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 0;\n }\n return v;\n}\n\nclass Rect extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 圆角\n if(this.isMulti) {\n this.__rx = [0];\n this.__ry = [0];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n }\n else {\n this.__rx = this.__ry = 0;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(rx => Math.min(rx, 0.5) * width);\n }\n else {\n __cacheProps.rx = Math.min(rx, 0.5) * width;\n }\n }\n if(isNil(__cacheProps.ry) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = rx.map(ry => Math.min(ry, 0.5) * height);\n }\n else {\n __cacheProps.ry = Math.min(ry, 0.5) * height;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => genVertex(originX, originY, width, height, rx, ry[i]));\n }\n else {\n __cacheProps.list = genVertex(originX, originY, width, height, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(res.break) {\n return res;\n }\n this.buildCache(res.sx3, res.sy3);\n ctx = res.ctx;\n this.__renderPolygon(renderMode, ctx, res);\n return res;\n }\n\n get rx() {\n return this.getProps('rx');\n }\n\n get ry() {\n return this.getProps('ry');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n root,\n __sx3: originX, __sy3: originY, width, height,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n }\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n bbox[0] = Math.min(bbox[0], originX + x1);\n bbox[1] = Math.min(bbox[1], originY + y1);\n bbox[2] = Math.max(bbox[2], originX + width + x2);\n bbox[3] = Math.max(bbox[3], originY + height + y2);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Rect;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Circle extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__r = [1];\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i));\n }\n else if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n else {\n this.__r = 1;\n if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, r, __cacheProps, isMulti } = this;\n if(isNil(__cacheProps.r) || focus) {\n if(isMulti) {\n __cacheProps.r = r.map(i => i * width * 0.5);\n __cacheProps.list = __cacheProps.r.map(r => geom.ellipsePoints(cx, cy, r, r));\n }\n else {\n __cacheProps.r = r * width * 0.5;\n __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r, __cacheProps.r);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(res.break) {\n return res;\n }\n this.buildCache(res.cx, res.cy);\n ctx = res.ctx;\n this.__renderPolygon(renderMode, ctx, res);\n return res;\n }\n\n get r() {\n return this.getProps('r');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY, width, height,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n let xa = cx - r + x1;\n let xb = cx + r + x2;\n let ya = cy - r + y1;\n let yb = cy + r + y2;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Circle;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Ellipse extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__rx = [1];\n this.__ry = [1];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n else if(!isNil(props.rx)) {\n this.__rx = [getR(props.rx)];\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n else if(!isNil(props.ry)) {\n this.__ry = [getR(props.ry)];\n }\n }\n else {\n this.__rx = 1;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n this.__ry = 1;\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(i => i * width * 0.5);\n }\n else {\n __cacheProps.rx = rx * width * 0.5;\n }\n }\n if(isNil(__cacheProps.ry) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = ry.map(i => i * height * 0.5);\n }\n else {\n __cacheProps.ry = ry * height * 0.5;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => geom.ellipsePoints(cx, cy, rx, ry[i]));\n }\n else {\n __cacheProps.list = geom.ellipsePoints(cx, cy, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(res.break) {\n return res;\n }\n this.buildCache(res.cx, res.cy);\n ctx = res.ctx;\n this.__renderPolygon(renderMode, ctx, res);\n return res;\n }\n\n get rx() {\n return this.getProps('rx');\n }\n\n get ry() {\n return this.getProps('ry');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY, width, height,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let rx = 0, ry = 0;\n if(isMulti) {\n let mx = 0, my = 0;\n __cacheProps.rx.forEach((rx, i) => {\n mx = Math.max(rx, mx);\n my = Math.max(ry, __cacheProps.ry[i]);\n });\n rx = mx;\n ry = my;\n }\n else {\n rx = __cacheProps.rx;\n ry = __cacheProps.ry;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n let xa = cx - rx + x1;\n let xb = cx + rx + x2;\n let ya = cy - ry + y1;\n let yb = cy + ry + y2;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Ellipse;\n","import reset from '../style/reset';\n\nlet fullCssProperty = {\n skewX: 'kx',\n skewY: 'ky',\n transform: 'tf',\n fontSize: 'fz',\n offset: 'os',\n easing: 'e',\n filter: 'ft',\n boxShadow: 'bd',\n overflow: 'of',\n backgroundClip: 'bp',\n textOverflow: 'tof',\n flexWrap: 'fp',\n perspective: 'ppt',\n rotate3d: 'r3',\n};\n\nlet abbrCssProperty = {\n os: 'offset', // 非css属性不会被下面反向遍历插入,手动\n e: 'easing',\n};\n\nlet fullAnimate = {\n value: 'v',\n options: 'o',\n};\n\nlet abbrAnimate = {};\n\nlet fullAnimateOption = {\n duration: 'dt',\n delay: 'd',\n endDelay: 'ed',\n iterations: 'i',\n direction: 'dc',\n fill: 'f',\n fps: 'fp',\n playbackRate: 'p',\n spfLimit: 'sl',\n};\n\nlet abbrAnimateOption = {};\n\nreset.DOM_KEY_SET.concat(reset.GEOM_KEY_SET).forEach(k => {\n if(fullCssProperty.hasOwnProperty(k)) {\n abbrCssProperty[fullCssProperty[k]] = k;\n return;\n }\n let v = k.charAt(0) + k.replace(/[a-z]/g, '').toLowerCase();\n fullCssProperty[k] = v;\n abbrCssProperty[v] = k;\n});\n\nObject.keys(fullAnimate).forEach(k => {\n abbrAnimate[fullAnimate[k]] = k;\n});\n\nObject.keys(fullAnimateOption).forEach(k => {\n abbrAnimateOption[fullAnimateOption[k]] = k;\n});\n\nexport default {\n fullCssProperty,\n abbrCssProperty,\n fullAnimate,\n abbrAnimate,\n fullAnimateOption,\n abbrAnimateOption,\n};\n","import abbr from './abbr';\nimport Node from '../node/Node';\nimport Component from '../node/Component';\nimport $$type from '../util/$$type';\nimport util from '../util/util';\nimport inject from '../util/inject';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet { isNil, isFunction, isPrimitive, clone, extend } = util;\nlet { abbrCssProperty, abbrAnimateOption, abbrAnimate } = abbr;\n\n/**\n * 还原缩写到全称,涉及样式和动画属性\n * @param target 还原的对象\n * @param hash 缩写映射\n */\nfunction abbr2full(target, hash) {\n // 也许节点没写样式\n if(target) {\n Object.keys(target).forEach(k => {\n // var-attr格式特殊考虑,仅映射attr部分,var-还要保留\n if(k.indexOf('var-') === 0) {\n let k2 = k.slice(4);\n if(hash.hasOwnProperty(k2)) {\n let fk = hash[k2];\n target['var-' + fk] = target[k];\n // delete target[k];\n }\n }\n // 普通样式缩写还原\n else if(hash.hasOwnProperty(k)) {\n let fk = hash[k];\n target[fk] = target[k];\n // 删除以免二次解析\n delete target[k];\n }\n });\n }\n}\n\nfunction replaceVars(json, vars) {\n if(json && vars) {\n // 新版vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // 排除特殊的library\n if(Array.isArray(member) && member.length && member[0] !== 'library' && vars.hasOwnProperty(id)) {\n let target = json;\n for(let i = 0, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // undefined和null意义不同\n if(v === undefined) {\n return;\n }\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n target[k] = v;\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Slot miss ' + k);\n return;\n }\n }\n }\n });\n }\n }\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-') === 0) {\n let v = json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(4);\n // 有id且变量里面传入了替换的值,值可为null,因为某些情况下空为自动\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n // undefined和null意义不同\n if(value === undefined) {\n return;\n }\n let target = json;\n // 如果有.则特殊处理子属性\n if(k2.indexOf('.') > -1) {\n let list = k2.split('.');\n let len = list.length;\n for(let i = 0; i < len - 1; i++) {\n k2 = list[i];\n // 避免异常\n if(target[k2]) {\n target = target[k2];\n }\n else {\n inject.warn('parseJson vars is not exist: ' + v.id + ', ' + k + ', ' + list.slice(0, i).join('.'));\n return;\n }\n }\n k2 = list[len - 1];\n }\n // 支持函数模式和值模式\n if(isFunction(value)) {\n value = value(v);\n }\n target[k2] = value;\n }\n }\n });\n }\n }\n}\n\nfunction replaceAnimateOptions(options, opt) {\n ['iterations', 'fill', 'duration', 'direction', 'easing', 'fps', 'delay', 'endDelay', 'playbackRate', 'spfLimit'].forEach(k => {\n if(opt.hasOwnProperty(k)) {\n options[k] = opt[k];\n }\n });\n}\n\nfunction replaceLibraryVars(json, hash, vars) {\n if(vars) {\n // 新版同级vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // library.xxx,需要>=2的长度\n if(Array.isArray(member) && member.length > 1 && vars.hasOwnProperty(id)) {\n if(member[0] === 'library') {\n let target = hash;\n for(let i = 1, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n let old = target[k];\n // 直接替换library的子对象,需补充id和tagName\n if(i === 1) {\n target[k] = Object.assign({ id: old.id, tagName: old.tagName }, v);\n }\n // 替换library中子对象的一个属性直接赋值\n else {\n target[k] = v;\n }\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Library slot miss ' + k);\n return;\n }\n }\n }\n }\n });\n }\n }\n // 兼容老版var-\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-library.') === 0) {\n let v = json[k];\n // 直接移除library插槽,防止下面调用replaceVars(json, vars)时报错\n delete json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(12);\n // 有id且变量里面传入了替换的值\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n if(isFunction(value)) {\n value = value(v);\n }\n // 替换图层的值必须是一个有tagName的对象\n if(!value || !value.tagName) {\n return;\n }\n // library对象也要加上id,与正常的library保持一致\n hash[k2] = Object.assign({ id: k2 }, value);\n }\n }\n });\n }\n }\n}\n\n/**\n * 遍历一遍library的一级,将一级的id存到hash上,无需递归二级,\n * 因为顺序前提要求排好且无循环依赖,所以被用到的一定在前面出现,\n * 一般是无children的元件在前,包含children的div在后\n * 即便library中的元素有children或library,在linkChild时将其link过去,parse递归会继续处理\n * @param item:library的一级孩子\n * @param hash:存放library的key/value引用\n */\nfunction linkLibrary(item, hash) {\n let id = item.id;\n // library中一定有id,因为是一级,二级+特殊需求才会出现放开\n if(isNil(id)) {\n throw new Error('Library item miss id: ' + JSON.stringify(item));\n }\n else {\n hash[id] = item;\n }\n}\n\n/**\n * 链接child到library文件,\n * props需要是clone的,因为防止多个child使用同一个库文件\n * children则直接引用,无需担心多个使用同一个\n * library也需要带上,在library直接子元素还包含library时会用到\n * @param child\n * @param libraryItem\n */\nfunction linkChild(child, libraryItem) {\n // 规定图层child只有init和动画,属性和子图层来自库\n child.tagName = libraryItem.tagName;\n child.props = clone(libraryItem.props);\n child.children = libraryItem.children;\n child.library = libraryItem.library;\n // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况\n Object.keys(libraryItem).forEach(k => {\n if(k.indexOf('var-') === 0 && !child.hasOwnProperty(k)) {\n child[k] = libraryItem[k];\n }\n });\n // 删除以免二次解析\n child.libraryId = null;\n // 规定图层实例化的属性和样式在init上,优先使用init,然后才取原型链的props\n let { init } = child;\n if(init) {\n let props = child.props = child.props || {};\n let style = props.style;\n extend(props, init);\n // style特殊处理,防止被上面覆盖丢失原始值\n if(style) {\n extend(style, init.style);\n props.style = style;\n }\n // 删除以免二次解析\n child.init = null;\n }\n}\n\nfunction parse(karas, json, animateRecords, opt, hash = {}) {\n if(isPrimitive(json) || json instanceof Node || json instanceof Component) {\n return json;\n }\n if(Array.isArray(json)) {\n return json.map(item => {\n return parse(karas, item, animateRecords, opt, hash);\n });\n }\n // 先判断是否是个链接到库的节点,是则进行链接操作\n let libraryId = json.libraryId;\n if(!isNil(libraryId)) {\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,tagName和属性和子图层来自库\n if(libraryItem) {\n linkChild(json, libraryItem);\n }\n else {\n throw new Error('Link library miss id: ' + libraryId);\n }\n json.libraryId = null;\n }\n // 再判断是否有library形成一个新的作用域,会出现library下的library使得一个链接节点链接后出现library的情况\n let library = json.library;\n if(Array.isArray(library)) {\n hash = {};\n library.forEach(item => {\n linkLibrary(item, hash);\n });\n // 替换library插槽\n replaceLibraryVars(json, hash, opt.vars);\n json.library = null;\n }\n let { tagName, props = {}, children = [], animate = [] } = json;\n if(!tagName) {\n throw new Error('Dom must have a tagName: ' + JSON.stringify(json));\n }\n let style = props.style;\n (opt.abbr !== false) && abbr2full(style, abbrCssProperty);\n // 先替换style的\n replaceVars(style, opt.vars);\n // 再替换静态属性,style也作为属性的一种,目前尚未被设计为被替换\n replaceVars(props, opt.vars);\n // 替换children里的内容,如文字,无法直接替换tagName/props/children/animate本身,因为下方用的还是原引用\n replaceVars(json, opt.vars);\n if(!Array.isArray(children)) {\n throw new Error('children must be an array');\n }\n let vd;\n if(tagName.charAt(0) === '$') {\n vd = karas.createGm(tagName, props);\n }\n else if(/^[A-Z]/.test(tagName)) {\n let cp = Component.getRegister(tagName);\n vd = karas.createCp(cp, props, children.map(item => {\n if(item && [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(item.$$type) > -1) {\n return item;\n }\n return parse(karas, item, animateRecords, opt, hash);\n }));\n }\n else {\n vd = karas.createVd(tagName, props, children.map(item => {\n if(item && [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(item.$$type) > -1) {\n return item;\n }\n return parse(karas, item, animateRecords, opt, hash);\n }));\n }\n if(animate) {\n if(!Array.isArray(animate)) {\n animate = [animate];\n }\n let has;\n animate.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrAnimate);\n let { value, options } = item;\n // 忽略空动画\n if(Array.isArray(value) && value.length) {\n has = true;\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n replaceAnimateOptions(options, opt);\n }\n });\n // 产生实际动画运行才存入列表供root调用执行\n if(has) {\n animateRecords.push({\n animate,\n target: vd,\n });\n }\n }\n return vd;\n}\n\nexport default parse;\n","import parse from './parse';\nimport abbr from './abbr';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport font from '../style/font';\nimport Controller from '../animate/Controller';\n\nlet o = {\n parse(karas, json, dom, options = {}) {\n if(!json) {\n return;\n }\n // 特殊单例声明无需clone加速解析\n if(!options.singleton && !json.singleton) {\n json = util.clone(json);\n }\n // 根节点的fonts字段定义字体信息\n let fonts = json.fonts;\n if(fonts) {\n if(!Array.isArray(fonts)) {\n fonts = [fonts];\n }\n fonts.forEach(item => {\n let { fontFamily, data } = item;\n if(fontFamily && data) {\n font.register(fontFamily, data);\n }\n });\n }\n // json中定义无abbr\n if(json.abbr === false) {\n options.abbr = false;\n }\n if(options.abbr !== false) {\n inject.warn('Abbr in json is deprecated');\n }\n // 重载,在确定dom传入选择器字符串或html节点对象时作为渲染功能,否则仅创建vd返回\n if(!inject.isDom(dom)) {\n options = dom || {};\n dom = null;\n }\n // 暂存所有动画声明,等root的生成后开始执行\n let animateRecords = [];\n let vd = parse(karas, json, animateRecords, options);\n // 有dom时parse作为根方法渲染\n if(dom) {\n let { tagName } = json;\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) === -1) {\n throw new Error('Parse dom must be canvas/svg');\n }\n // parse直接(非递归)的动画记录\n let ac = options.controller instanceof Controller ? options.controller : vd.animateController;\n // 第一次render,收集递归json里面的animateRecords,它在xom的__layout最后生成\n karas.render(vd, dom);\n // 由于vd首先生成的都是json,根parse要特殊处理将target指向真正的vd引用,json的vd在builder中赋值\n animateRecords.forEach(item => {\n item.target = item.target.vd;\n });\n // 直接的json里的animateRecords,再加上递归的parse的json的(第一次render布局时处理)动画一并播放\n if(options.autoPlay !== false) {\n ac.__records = ac.__records.concat(animateRecords);\n ac.__playAuto();\n }\n // 不自动播放进入记录列表,初始化并等待手动调用\n else {\n ac.__records2 = ac.__records2.concat(animateRecords);\n ac.init(ac.__records2, ac.list2);\n }\n }\n // 递归的parse,如果有动画,此时还没root,先暂存下来,等上面的root的render第一次布局时收集\n else {\n if(animateRecords.length) {\n vd.__animateRecords = {\n options,\n list: animateRecords,\n controller: options.controller instanceof Controller ? options.controller : null,\n };\n }\n }\n return vd;\n },\n loadAndParse(karas, json, dom, options) {\n let { fonts, components, imgs } = json;\n let list1 = [];\n let list2 = [];\n let list3 = [];\n if(fonts) {\n if(!Array.isArray(fonts)) {\n fonts = [fonts];\n }\n fonts.forEach(item => {\n let url = item.url;\n if(url) {\n list1.push(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';\nimport transform from './transform';\n\nexport default {\n css,\n reset,\n unit,\n font,\n abbr,\n transform,\n};\n","import Animation from './Animation';\nimport Controller from './Controller';\nimport easing from './easing';\nimport frame from './frame';\n\nexport default {\n Animation,\n Controller,\n easing,\n frame,\n};\n","import level from './level';\nimport change from './change';\nimport Page from './Page';\nimport Cache from './Cache';\n\nexport default {\n level,\n change,\n Page,\n Cache,\n};\n","import Node from './node/Node';\nimport Text from './node/Text';\nimport Xom from './node/Xom';\nimport Dom from './node/Dom';\nimport Img from './node/Img';\nimport Root from './node/Root';\nimport tag from './node/tag';\nimport mode from './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 // 特殊的$匿名类\n if(tagName instanceof Geom) {\n return this.createGm(tagName, props);\n }\n return this.createCp(tagName, props, children);\n }\n },\n createVd(tagName, props, children = []) {\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n if(tag.TAG_NAME.hasOwnProperty(tagName)) {\n return {\n tagName,\n props,\n children,\n $$type: $$type.TYPE_VD,\n };\n }\n throw new Error(`Can not use <${tagName}>`);\n },\n createGm(tagName, props) {\n return {\n tagName,\n props,\n $$type: $$type.TYPE_GM,\n };\n },\n createCp(klass, props, children = []) {\n props.children = children;\n return {\n klass,\n props,\n $$type: $$type.TYPE_CP,\n };\n },\n parse(json, dom, options) {\n return parser.parse(this, json, dom, options);\n },\n loadAndParse(json, dom, options) {\n return parser.loadAndParse(this, json, dom, options);\n },\n mode,\n Component,\n Node,\n Text,\n Geom,\n Xom,\n Dom,\n Img,\n Root,\n Event,\n util,\n inject,\n style,\n parser,\n animate,\n math,\n builder,\n updater,\n refresh,\n enums,\n set debug(v) {\n debug.flag = !!v;\n },\n};\n\nbuilder.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\n\nif(typeof window !== 'undefined') {\n window.karas = karas;\n}\nelse if(typeof self !== 'undefined') {\n self.karas = karas;\n}\n\nexport default karas;\n"],"names":["STYLE_KEY","POSITION","DISPLAY","TOP","RIGHT","BOTTOM","LEFT","MARGIN_TOP","MARGIN_RIGHT","MARGIN_BOTTOM","MARGIN_LEFT","PADDING_TOP","PADDING_RIGHT","PADDING_BOTTOM","PADDING_LEFT","FONT_SIZE","FONT_FAMILY","COLOR","FONT_STYLE","FONT_WEIGHT","LINE_HEIGHT","BACKGROUND_IMAGE","BACKGROUND_COLOR","BACKGROUND_SIZE","BACKGROUND_REPEAT","BACKGROUND_POSITION_X","BACKGROUND_POSITION_Y","BORDER_TOP_WIDTH","BORDER_RIGHT_WIDTH","BORDER_BOTTOM_WIDTH","BORDER_LEFT_WIDTH","BORDER_TOP_COLOR","BORDER_RIGHT_COLOR","BORDER_BOTTOM_COLOR","BORDER_LEFT_COLOR","BORDER_TOP_STYLE","BORDER_RIGHT_STYLE","BORDER_BOTTOM_STYLE","BORDER_LEFT_STYLE","BORDER_TOP_LEFT_RADIUS","BORDER_TOP_RIGHT_RADIUS","BORDER_BOTTOM_RIGHT_RADIUS","BORDER_BOTTOM_LEFT_RADIUS","WIDTH","HEIGHT","FLEX_GROW","FLEX_SHRINK","FLEX_BASIS","FLEX_DIRECTION","JUSTIFY_CONTENT","ALIGN_ITEMS","ALIGN_SELF","TEXT_ALIGN","TRANSFORM_ORIGIN","VISIBILITY","OPACITY","Z_INDEX","TRANSFORM","TRANSLATE_X","TRANSLATE_Y","TRANSLATE_Z","SCALE_X","SCALE_Y","SCALE_Z","SKEW_X","SKEW_Y","ROTATE_X","ROTATE_Y","ROTATE_Z","ROTATE_3D","PERSPECTIVE","PERSPECTIVE_ORIGIN","FILTER","BOX_SHADOW","POINTER_EVENTS","OVERFLOW","MIX_BLEND_MODE","BACKGROUND_CLIP","WHITE_SPACE","TEXT_OVERFLOW","LETTER_SPACING","LINE_CLAMP","ORDER","FLEX_WRAP","ALIGN_CONTENT","TEXT_STROKE_WIDTH","TEXT_STROKE_COLOR","TEXT_STROKE_OVER","FILL","STROKE","STROKE_WIDTH","STROKE_DASHARRAY","STROKE_DASHARRAY_STR","STROKE_LINECAP","STROKE_LINEJOIN","STROKE_MITERLIMIT","FILL_RULE","MATRIX","BORDER_TOP","BORDER_RIGHT","BORDER_BOTTOM","BORDER_LEFT","TRANSLATE_PATH","STYLE2LOWER_MAP","style2Lower","s","toLowerCase","replace","$0","$1","toUpperCase","STYLE2UPPER_MAP","style2Upper","$2","STYLE_R_KEY","STYLE_RV_KEY","STYLE_V_KEY","Object","keys","forEach","k","k2","l","UPDATE_KEY","UPDATE_NODE","UPDATE_STYLE","UPDATE_FOCUS","UPDATE_MEASURE","UPDATE_COMPONENT","UPDATE_OVERWRITE","UPDATE_KEYS","UPDATE_LIST","UPDATE_CONFIG","UPDATE_ADD_DOM","UPDATE_REMOVE_DOM","KEY_FRAME_KEY","FRAME_STYLE","FRAME_TIME","FRAME_EASING","FRAME_TRANSITION","NODE_KEY","NODE_DOM_PARENT","NODE_OPACITY","NODE_MATRIX","NODE_MATRIX_EVENT","NODE_CACHE","NODE_CACHE_TOTAL","NODE_CACHE_FILTER","NODE_CACHE_MASK","NODE_CACHE_OVERFLOW","NODE_STRUCT","NODE_TAG_NAME","NODE_CURRENT_STYLE","NODE_CURRENT_PROPS","NODE_COMPUTED_STYLE","NODE_CACHE_STYLE","NODE_CACHE_PROPS","NODE_LIMIT_CACHE","NODE_IS_MASK","NODE_IS_INLINE","NODE_HAS_CONTENT","NODE_REFRESH_LV","NODE_IS_DESTROYED","NODE_STYLE","NODE_UPDATE_HASH","NODE_UNIQUE_UPDATE_ID","NODE_DEFS_CACHE","NODE_PERSPECTIVE_MATRIX","NODE_VIRTUAL_DOM","NODE_CACHE_AS_BITMAP","STRUCT_KEY","STRUCT_NODE","STRUCT_INDEX","STRUCT_CHILD_INDEX","STRUCT_LV","STRUCT_NUM","STRUCT_TOTAL","STRUCT_HAS_MASK","ANIMATE_KEY","I_ASSIGNING","I_IN_FPS","I_IS_DELAY","I_BEGIN","I_END","I_FINISHED","I_NEXT_END","I_FIRST_PLAY","I_PLAY_CB","I_TARGET","I_ROOT","I_FRAMES","I_FRAMES_R","I_CURRENT_TIME","I_NEXT_TIME","I_STYLE","I_DURATION","I_ITERATIONS","I_FILL","I_PLAYBACK_RATE","I_PLAY_COUNT","I_PLAY_STATE","I_DESTROYED","I_START_TIME","I_FPS_TIME","I_EASING","I_ENTER_FRAME","I_DELAY","I_END_DELAY","I_KEYS","I_ORIGIN_STYLE","I_CURRENT_FRAMES","I_CURRENT_FRAME","I_SPF_LIMIT","I_FPS","I_DIRECTION","I_FIRST_ENTER","I_STAY_BEGIN","I_STAY_END","I_IS2","I_END_TIME","I_NODE_CONFIG","I_ROOT_CONFIG","I_OUT_BEGIN_DELAY","I_TIME_STAMP","enums","Node","__x","__y","__ox","__oy","__sx","__sy","__width","__height","__baseline","__config","__prev","__next","__parent","__domParent","__root","__host","i","lv","j","root","struct","diff","isLayout","x","ox","y","oy","__hostRoot","__virtualDom","CANVAS","SVG","WEBGL","o","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","REM","EM","VW","VH","VMAX","VMIN","calUnit","v","n","parseFloat","test","info","arial","lhr","blr","lgr","padding","f","helvetica","verdana","tahoma","S","T","Z","c","t","georgia","simsun","support","fontFamily","hasOwnProperty","register","name","emSquare","ascent","descent","lineGap","addPadding","assign","position","gradient","img","identity","multiply","a","b","isE","a0","a1","a2","a3","calPoint","point","m","z","w","undefined","length","b1","c1","d1","b2","c2","d2","b3","c3","d3","a4","b4","c4","d4","d","e","inverse","inverse4","divisor","inv","det","m2m6","point2d","slice","dotProduct","x1","y1","x2","y2","crossProduct","H","Math","sqrt","vector","mx","h","deg","cos","sin","pointInPolygon","vertexes","xmax","ymax","xmin","ymin","len","max","min","pointInQuadrilateral","x4","y4","x3","y3","matrix","w1","w2","w3","w4","angleBySide","theta","pow","acos","sideByAngle","alpha","pointsDistance","triangleIncentre","ellipsePoints","sectorPoints","r","begin","end","list","floor","h2","d2r","abs","atan","rx","ry","p1","p2","p4","p3","push","concat","temp","res","getRectsIntersection","isRectsOverlap","ax1","ay1","ax4","ay4","bx1","by1","bx4","by4","isRectsInside","calCoordsInNode","px","py","node","computedStyle","width","height","calPercentInNode","ds","Infinity","PI","dt","r2d","bboxBezier2","x0","y0","minX","minY","maxX","maxY","tx","ty","sx","sy","qx","qy","bboxBezier3","cx","cy","bx","by","ax","ay","hx","hy","q","bboxBezier","arguments","norm","order","sum","reduce","simpson38","derivativeFunc","middleL","middleR","adaptiveSimpson38","eps","mid","st","sl","sr","ans","bezierLength","points","startT","endT","at","at3","p0","at2","bezierOrder","derivativeOrder","pointAtBezier","percent","maxIteration","pointAtBezierWithLength","targetLen","approachLen","approachT","preApproachT","derivative1","derivative2","numerator","denominator","sliceBezier","x12","y12","x23","y23","x123","y123","x34","y34","x234","y234","x1234","y1234","sliceBezier2Both","start","reverse","pointOnCircle","getConicGradientImage","originX","originY","stop","data","Error","getAngle","dx","dy","increasingList","map","item","color","angle","factor","idx","canvasPolygon","ctx","Array","isArray","moveTo","lineTo","quadraticCurveTo","bezierCurveTo","svgPolygon","canvasLine","controlA","controlB","num","svgLine","canvasFilter","filter","svgFilter","geom","unit","painter","calFitDashed","total","bs","be","smin","smax","dmin","dmax","ps","pd","outer","per","free","mo","calDashed","style","m1","m2","m3","m4","bw","calPoints","borderWidth","borderStyle","deg1","deg2","direction","beginRadius","endRadius","indexOf","isLast","main1","main2","cross1","cross2","tan","calTopRadiusPoints","calRightRadiusPoints","calBottomRadiusPoints","calLeftRadiusPoints","pointsList","brx","bry","erx","ery","oxl","oxr","beginList","centerList","endList","ya","yb","beginLength","needInner","crossDeg","rx1","ry1","sx1","oyl","rx2","ry2","sx2","xa","xb","ca","calBezierTopLeft","cb","controls1","controls2","limit","pop","endLength","oyr","calBezierTopRight","isStart","crossDx","p1x","p1y","p2x","p2y","dx1","dsx1","dx2","dsx2","cpx2","cpy2","cpx1","cpy1","crossDsx","beta","tanBetaDiv2Sqrt","tanAlphaHalf","degTg","degTg1","cdx1","cdy1","cx1","cy1","degTg2","cdx2","cdy2","cx2","cy2","isEnd","oyt","oyb","oxt","calBezierRightTop","oxb","calBezierRightBottom","calBezierBottomLeft","calBezierBottomRight","calBezierLeftTop","calBezierLeftBottom","calRadius","btlr","btrr","bbrr","bblr","need","btlx","btly","btrx","btry","bbrx","bbry","bblx","bbly","BR_KS","calBorderRadius","currentStyle","noRadius","target","prev","next","half","calBorderRadiusInline","contentBoxList","first","last","outerWidth","outerHeight","renderBorder","xom","renderMode","mode","beginPath","fillStyle","fill","closePath","virtualDom","bb","type","tagName","props","TYPE_VD","Symbol","TYPE_GM","TYPE_CP","toString","isType","obj","call","isObject","isString","isFunction","isNumber","isBoolean","isDate","hasOwn","fnToString","ObjectFunctionString","isNil","joinSourceArray","arr","stringify","encodeHtml","prop","joinVirtualDom","vd","defs","joinDef","joinVd","conClip","children","isMask","content","opacity","transform","visibility","mask","overflow","mixBlendMode","def","uuid","joinItem","rgba2int","charAt","parseInt","match","int2rgba","joinArr","int2invert","arr2hash","hash","hash2arr","clone","$$type","util","Date","isPlainObject","equalArr","ai","bi","isArrayA","isArrayB","equal","getTime","extend","source","split","extendAnimate","ovd","nvd","__animationList","animationList","splice","__setTarget","assigning","finished","__stayEnd","assignCurrentStyle","__frameAnimateList","transformBbox","bbox","proto","getPrototypeOf","Ctor","constructor","assignMatrix","isPrimitive","isAuto","flag","charWidth","ELLIPSIS","antialias","premultipliedAlpha","preserveDrawingBuffer","initShaders","gl","vshader","fshader","program","createProgram","enable","BLEND","blendFunc","ONE","ONE_MINUS_SRC_ALPHA","vertexShader","loadShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","attachShader","linkProgram","linked","getProgramParameter","LINK_STATUS","error","getProgramInfoLog","deleteProgram","deleteShader","shader","createShader","shaderSource","compileShader","compiled","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","convertCoords2Gl","revertY","createTexture","tex","texture","bindTexture","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","texImage2D","TEXTURE_2D","UNSIGNED_BYTE","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","LINEAR","TEXTURE_MAG_FILTER","activeTexture","drawTextureCache","vtPoint","vtTex","vtOpacity","lastChannel","record","stack","cache","channel","page","tx1","ty1","tx2","ty2","pointBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","Float32Array","STATIC_DRAW","a_position","getAttribLocation","vertexAttribPointer","FLOAT","enableVertexAttribArray","texBuffer","a_texCoords","opacityBuffer","a_opacity","u_texture","getUniformLocation","count","uniform1i","drawArrays","TRIANGLES","deleteBuffer","disableVertexAttribArray","drawBlur","frameBuffer","texCache","tex1","tex2","spread","sigma","u_direction","uniform2f","ratio","recycle","tex3","framebufferTexture2D","FRAMEBUFFER","COLOR_ATTACHMENT0","tex4","deleteTexture","drawCm","u_m","uniform1fv","drawOverflow","programOverflow","drawMask","u_texture1","u_texture2","drawMbm","W","SPF","CANVAS_LIST","WEBGL_LIST","SUPPORT_OFFSCREEN_CANVAS","OffscreenCanvas","prototype","getContext","defaultFontFamilyData","key","message","debug","document","createElement","setAttribute","body","appendChild","canvas","draw","enabled","available","release","cacheCanvas","cacheWebgl","IMG","INIT","LOADING","LOADED","FONT","COMPONENT","inject","measureText","textCache","html","lengths","chars","ff","fs","fw","inline","char","div","left","top","innerHTML","cns","childNodes","index","css","window","getComputedStyle","text","__measureCb","removeChild","measureTextSync","measureImg","url","state","success","task","Image","onload","onerror","substr","host","exec","location","hostname","crossOrigin","src","warn","console","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","id","clearTimeout","now","performance","hasCacheCanvas","getCacheCanvas","releaseCacheCanvas","delCacheCanvas","hasCacheWebgl","getCacheWebgl","releaseCacheWebgl","delCacheWebgl","isDom","Element","self","getElementsByTagName","isWebGLTexture","WebGLTexture","checkSupportFontFamily","font","checked","context","textAlign","textBaseline","clearRect","fillText","getImageData","loadFont","FontFace","load","then","loadComponent","script","async","head","getLinearDeg","getRadialPosition","center","right","bottom","getColorStop","firstColor","p","dr","dg","db","da","unshift","calLinearCoords","calCircleCentre","iw","ih","positionX","positionY","calRadialRadius","shape","size","xl","yl","asin","parseGradient","reg","i5","i6","i7","getLinear","coords","l1","l2","l3","l4","r1","getRadial","scx","scy","getConic","calConicRadius","renderConic","isInline","border","offscreen","imgData","putImageData","save","clip","drawImage","restore","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","DEFAULT_COMPARE","SplayTree","compare","noDuplicates","_compare","_root","_size","_noDuplicates","prototypeAccessors","configurable","rotateLeft","rotateRight","_splay","splay","gp","ggp","u","minNode","maxNode","insert","comp","cmp","find","contains","comparator","remove","removeNode","erase","sMax","returnValue","successor","predecessor","callback","current","done","range","low","high","fn","Q","values","presort","sort","loadRecursive","get","createTree","defineProperties","middle","pivot","tmp","NORMAL","NON_CONTRIBUTING","SAME_TRANSITION","DIFFERENT_TRANSITION","INTERSECTION","UNION","DIFFERENCE","XOR","computeFields","event","operation","inOut","otherInOut","isSubject","isVertical","prevInResult","inResult","isInResult","resultTransition","determineResultTransition","thisIn","thatIn","isIn","SweepEvent","otherEvent","edgeType","otherPos","outputContourId","isExteriorRing","prototypeAccessors$1","isBelow","isAbove","copy","contourId","equals","epsilon","splitter","resulterrbound","elen","flen","Qnew","hh","bvirt","enow","fnow","eindex","findex","hindex","estimate","vec","Float64Array","ccwerrboundA","ccwerrboundB","ccwerrboundC","B","C1","C2","D","orient2dadapt","detsum","acxtail","acytail","bcxtail","bcytail","ahi","alo","bhi","blo","_i","_j","_0","s1","s0","t1","t0","u3","acx","bcx","acy","bcy","errbound","C1len","C2len","Dlen","orient2d","detleft","detright","signedArea","compareEvents","e1","e2","specialCases","divideSegment","se","queue","intersection","noEndpointTouch","va","vb","toPoint","kross","sqrKross","sqrLenA","sa","sb","possibleIntersection","se1","se2","inter","nintersections","events","leftCoincide","rightCoincide","compareSegments","le1","le2","subdivide","eventQueue","subject","clipping","sbbox","cbbox","sweepLine","sortedEvents","rightbound","prevEvent","prevprevEvent","prevprev","Contour","holeIds","holeOf","depth","isExterior","orderEvents","resultEvents","sorted","nextPos","processed","origPos","newPos","initializeContourFromContext","contours","contour","lowerContourId","lowerResultTransition","lowerContour","parentContourId","connectEdges","loop","markAsProcessed","initial","_tinyqueue_1_2_3_tinyqueue","TinyQueue","default_1","defaultCompare","_down","_up","peek","halfLength","best","processPolygon","contourOrHole","s2","fillQueue","polygonSet","ii","jj","EMPTY","trivialOperation","result","compareBBoxes","boolean","trivial","polygons","rings","holeId","union","xor","intersection$1","tar","booleanOperations","math","calSingle","rlen","nc","xy","yz","zx","xs","ys","zs","calMatrix","ow","oh","calMatrixByOrigin","calMatrixWithOrigin","normalizeSingle","calOrigin","tfo","calMatrixByPerspective","pm","calPerspectiveMatrix","ppt","po","isPerspectiveMatrix","kernelSize","outerSize","outerSizeByD","gaussianWeight","E","genSingle","dbx","dby","Cache","__init","__bbox","__page","__pos","getCoords","__appendData","__isNew","__enabled","setTransform","globalAlpha","update","__available","clear","del","ceil","getInstance","blur","cacheMask","isClip","__sx1","__sy1","tf","globalCompositeOperation","drawCache","xe","ye","cacheOverflow","rect","old","newCache","nx","ny","parentMatrix","dbx2","dby2","ENUM","NONE","TRANSFORM_ALL","REFLOW","REBUILD","TRANSFORMS","contain","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","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","fns","REGISTER","setUpdateFlag","cp","__hasCpUpdate","__ref","__isMounted","__taskList","__nextState","addRefreshCp","builder","__cd","listener","__shadow","shadow","__shadowRoot","componentDidMount","REFRESH","__isDestroyed","componentWillUnmount","__destroy","force","__emitEvent","__state","hasRegister","defineProperty","matrixResize","imgWidth","imgHeight","targetWidth","targetHeight","renderBgc","method","me","calBackgroundSize","calBackgroundPosition","container","renderImage","loadBgi","bx2","by2","bgW","bgH","bgX","bgY","needMask","xnl","xnr","ynt","ynb","image","needResize","traversal","after","isPause","Frame","__hookTask","__taskCp","__now","taskCp","cloneCp","lengthCp","__karasFramecb","offFrame","onFrame","NEWTON_ITERATIONS","NEWTON_MIN_SLOPE","SUBDIVISION_PRECISION","SUBDIVISION_MAX_ITERATIONS","kSplineTableSize","kSampleStepSize","float32ArraySupported","aA1","aA2","C","calcBezier","aT","getSlope","binarySubdivide","aX","aA","aB","mX1","mX2","currentX","currentT","newtonRaphsonIterate","aGuessT","currentSlope","LinearEasing","bezier","mY1","mY2","sampleValues","getTForX","intervalStart","currentSample","lastSample","dist","guessForT","initialSlope","BezierEasing","easing","easeIn","easeOut","ease","easeInOut","cubicBezier","getEasing","v1","v3","timingFunction","NUM_CAL_HASH","unify","frames","getProps","inherit","genBeforeRefresh","__frameHook","framing","duration","es","offset","translatePath","calByUnit","calDiff","nm","pHash","nHash","keyHash","hasChange","nv","pv","pi","ni","has","pp","nn","clientWidth","eq","isArrP","isArrN","pz","nz","np","len2","pv2","nv2","len3","pv3","nv3","calFrame","ts","binarySearch","frame","ea","steps","stepsD","calIntermediateStyle","transition","st2","calIncrease","o2","n2","gotoOverload","calDiffTime","playbackRate","spfLimit","fps","frameCb","isDelay","FRAME","PLAY","Animation","__id","nl","__options","op","config","iterations","framesR","originStyle","delay","endDelay","isFinish","__cancelTask","__currentProps","__currentStyle","playState","__hasFin","__hasCancel","playCount","currentFrames","stayBegin","stayEnd","is2","endTime","currentTime","currentFrame","round","isAlternate","alternate","isEven","isLastCount","frameTime","isLastFrame","inEndDelay","needClean","playCb","__clean","BEGIN","END","FINISH","silence","pending","PAUSE","play","CANCEL","__goto","isFrame","excludeDelay","finish","currentProps","spf","animateController","backwards","both","forwards","__target","sync","removeControl","nextFrame","__checkModify","renderBoxShadow","inset","box","spreadBox","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","blurBox","MBM_HASH","screen","overlay","darken","lighten","difference","exclusion","hue","saturation","luminosity","mbmName","isValidMbm","getInlineBox","diffL","eyt","eyb","pbt","pbb","dom","getInlineWidth","contentBox","LOCAL","mbm","TF","TX","TY","TZ","getFirstEmptyInlineWidth","flowChildren","child","getLastEmptyInlineWidth","__computedStyle","__listener","__loadBgi","__cacheDefs","__isClip","__isMask","__contentBoxList","__cacheAsBitmap","cacheAsBitmap","__hasMask","__mpWidth","mp","__clientWidth","__clientHeight","__offsetWidth","__offsetHeight","__outerWidth","__outerHeight","onlyFixedValue","isDirectionRow","res2","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","isReplaced","offsetWidth","offsetHeight","matrixCache","isScale","clientHeight","x5","x6","y5","y6","__calFilter","bg","bgI","item2","kw","__bx1","__bx2","__by1","__by2","rebuild","__hasContent","isRealInline","sx4","sx5","sx6","sy4","sy5","sy6","__calPerspective","__calMatrix","hasContent","__calContent","__releaseWhenEmpty","limitCache","__calCache","perspectiveMatrix","offscreenBlend","offscreenMask","hasFilter","offscreenFilter","offscreenOverflow","borderList","hasBgi","some","svgBgSymbol","__gradient","isFirst","lastContentBox","lastLineBox","parentLineBox","countW","ix1","iy1","ix2","iy2","symbol","clearAnimate","clearFrameAnimate","__stopPropagation","__stopImmediatePropagation","willResponseEvent","hasEmitMask","ignore","inThis","__touchstartTarget","__getLg","__getRg","__getCg","lg","createLinearGradient","addColorStop","rg","createRadialGradient","ec","dc","pc","cur","onlyTotal","__cacheTotal","__cacheFilter","__cacheMask","__cacheOverflow","formatStyle","animation","cancel","enter","yt","xr","includeBbox","hostRoot","pJson","zChildren","zIndexChildren","__spreadBbox","LineBox","__list","__lineHeight","increasedHeight","hasReplaced","isVerticalAlign","LineBoxManager","__lastX","__lastY","__maxX","__domList","__domStack","__isNewLine","__isEnd","__spreadYList","__setLB","nextNewLine","genLineBox","syl","verticalAlign","isNewLine","TAG_NAME","INLINE","BOLD","offsetAndResizeByNodeOnY","reflowHash","inDirectAbsList","isContainer","cs","__layoutAbs","isAbs","__resizeY","clearUniqueReflowId","__uniqueReflowId","getMergeMarginTB","topList","bottomList","genZIndexChildren","hasMc","mcHash","lastMaskIndex","__iIndex","__zIndex","__aIndex","genOrderChildren","__order","block","inlineBlock","none","tag","__flexLine","__zIndexChildren","__structure","nss","__structs","structs","needSort","__tryLayInline","firstCharWidth","main","hasLayout","columnCrossCount","columnCrossMax","isRow","__calMinMax","min2","max2","columnCrossMax2","countMin","countMax","setNotEnd","__addMp","isFixed","isContent","fixedSize","__lineBoxManager","__preLayout","__ioSize","mergeMarginBottomList","mergeMarginTopList","isXom","isInlineBlock","reflow","__isIbFull","lastX","lastY","isNone","isEmptyBlock","tw","th","spreadYList","isLastBlock","isBlock","horizonAlign","__inlineSize","domList","__marginAuto","growList","shrinkList","basisList","maxList","minList","columnCrossList","orderChildren","__calBasis","columnCross","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","__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","OFFSCREEN_OVERFLOW","OFFSCREEN_FILTER","OFFSCREEN_MASK","OFFSCREEN_BLEND","OFFSCREEN_MASK2","applyOffscreen","origin","MockPage","genUuid","MockCache","NA","CHILD","SELF","getCache","OP","FT","MBM","PPT","genBboxTotal","parentIndexHash","opacityHash","includeLimitCache","bboxTotal","matrixHash","parentIndex","node2","hasTotal","mergeBbox","genTotal","hasMask","cacheTotal","cacheFilter","needGen","baseMatrix","matrixList","opacityList","parentOpacity","lastConfig","lastLv","refreshLevel","countMaskNum","ctxTotal","lastMatrix","maskStartHash","offscreenHash","genOverflow","genFilter","genMask","lastOpacity","sbox","resetMatrixCacheTotal","isNew","genFrameBufferWithTexture","lockOneChannel","webgl","createFramebuffer","bindFramebuffer","checkFramebufferStatus","FRAMEBUFFER_COMPLETE","viewport","clearColor","COLOR_BUFFER_BIT","genTotalWebgl","hasMbm","getParameter","MAX_TEXTURE_SIZE","parentPm","totalLimitCache","addTexAndDrawWhenLimit","mockCache","refresh","releaseLockChannel","hookGlRender","frameBuffer2","texture2","genMbmWebgl","deleteFramebuffer","genFilterWebgl","genBlurWebgl","rotation","cosR","sinR","genColorMatrixWebgl","amount","oneMinusAmount","useProgram","MAX_VARYING_VECTORS","weights","vert","frag","vertexBlur","fragmentBlur","findExistTexChannel","lockChannel","programCm","genOverflowWebgl","overflowCache","genMaskWebgl","programClip","programMask","maskCache","fbo","fragmentMultiply","fragmentScreen","fragmentOverlay","fragmentDarken","fragmentLighten","fragmentColorDodge","fragmentColorBurn","fragmentHardLight","fragmentSoftLight","fragmentDifference","fragmentExclusion","fragmentHue","fragmentSaturation","fragmentColor","fragmentLuminosity","vertexMbm","renderSvg","maskEffectHash","defsCache","hasEffectMask","addCache","maskHash","vdList","parentVd","mChildren","ivs","hasTransform","renderWebgl","pmList","lastRefreshLevel","mergeList","hasRecordAsMask","validMbm","isPerspective","limitHash","pptHash","renderCanvas","TexCache","units","__units","__pages","__channels","__locks","__lockUnits","pages","channels","locks","lastHash","oldList","newList","shift","cl","fullSize","setToChannel","DIRECTION_HASH","ROOT_DOM_NAME","getDom","querySelector","renderProp","EVENT_LIST","initEvent","Root","__wrapEvent","__cb","addEventListener","removeEvent","removeEventListener","isFixedWidthOrHeight","isFixedSize","includeParentFlex","isLAYOUT","setLAYOUT","component","addDom","checkInfluence","topFlex","isSiblingBlock","uniqueUpdateId","parseUpdate","reflowList","measureList","cacheList","zHash","zList","overwrite","focus","measure","removeDom","style2","keys2","hasMeasure","hasZ","hasVisibility","hasColor","hasDisplay","__struct","isRp","cleanSvgCache","__uniqueZId","__rlv","__dom","__mw","__mh","__taskUp","__reflowList","__animateController","mix","__updateHash","domName","__scx","__scy","getBoundingClientRect","touches","clientX","clientY","stopPropagation","stopImmediatePropagation","preventDefault","__hasEmitted","__initProps","nodeName","__genHtml","__defs","getPropertyValue","params","contextAttributes","__ctx","__renderMode","vertex","fragment","vertexMask","fragmentMask","fragmentClip","fragmentOverflow","vertexCm","fragmentCm","MAX_TEXTURE_IMAGE_UNITS","__texCache","destroy","__eventCbList","__checkRoot","__checkUpdate","__checkReflow","noRender","__clear","__vd","domDiff","updateStyle","taskUp","__hasRootUpdate","__nextFrameCp","updater","includeIgnore","scan","path","zPath","__index__","karas","path2","zPath2","nodeConfig","rootConfig","updateHash","__updateRoot","updateRoot","hasUpdate","__updateStruct","measureHash","__uniqueUpdateId","isInherit","uniqueList","hasRoot","diffList","diffI","mergeOffsetList","__uniqueMergeOffsetId","cps","cts","isLastAbs","isNowAbs","isLastNone","isNowNone","hasFlowPrev","__modifyStruct","startIndex","startNode","oldH","nowH","lastIndex","ns","reBuild","base","reBuildC","curveNum","getNewPoint","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","__start","__end","dy2","buildCache","curve","x1s","y1s","x2s","y2s","bezierBox","concatPointAndControl","control","getLength","increase","getIndex","getNewList","start2","end2","isStartLt0","isEndGt1","prePercent","endPoint","Polyline","__points","__controls","controls","isControl","rebuildSE","__getPoints","__needRebuildSE","__reprocessing","__renderPolygon","pointList","controlList","Polygon","__booleanOperations","bo","getR","dft","Sector","__begin","__r","edge","__edge","closure","__closure","sList","r2","__renderOneSector","genVertex","Rect","__rx","__ry","Circle","Ellipse","my","fullCssProperty","abbrCssProperty","os","fullAnimate","abbrAnimate","fullAnimateOption","abbrAnimateOption","abbr2full","fk","replaceVars","vars","slot","member","replaceAnimateOptions","opt","replaceLibraryVars","linkLibrary","JSON","linkChild","libraryItem","library","libraryId","parse","animateRecords","createGm","createCp","createVd","singleton","fonts","loadAndParse","components","imgs","list1","list3","version","appendTo","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,SAAS,GAAG;AAChBC,EAAAA,QAAQ,EAAE,CADM;AAEhBC,EAAAA,OAAO,EAAE,CAFO;AAGhBC,EAAAA,GAAG,EAAE,CAHW;AAIhBC,EAAAA,KAAK,EAAE,CAJS;AAKhBC,EAAAA,MAAM,EAAE,CALQ;AAMhBC,EAAAA,IAAI,EAAE,CANU;AAOhBC,EAAAA,UAAU,EAAE,CAPI;AAQhBC,EAAAA,YAAY,EAAE,CARE;AAShBC,EAAAA,aAAa,EA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EAAAA,MAAM,EAANA,MA/EU;AAgFV3X,EAAAA,KAAK,EAALA,KAhFU;AAiFVmuE,EAAAA,MAAM,EAANA,GAjFU;AAkFVnZ,EAAAA,OAAO,EAAPA,OAlFU;AAmFVl3B,EAAAA,IAAI,EAAJA,IAnFU;AAoFViM,EAAAA,OAAO,EAAPA,OApFU;AAqFVq7B,EAAAA,OAAO,EAAPA,OArFU;AAsFVvL,EAAAA,OAAO,EAAPA,OAtFU;AAuFVlvE,EAAAA,KAAK,EAALA,KAvFU;;AAwFV,MAAI6rB,KAAJ,CAAU3oB,CAAV,EAAa;AACX2oB,IAAAA,KAAK,CAACrI,IAAN,GAAa,CAAC,CAACtgB,CAAf;AACD;;AA1FS,CAAZ;AA6FAk8C,OAAO,CAACrB,GAAR,CAAY;AACVvB,EAAAA,GAAG,EAAHA,KADU;AAEVC,EAAAA,GAAG,EAAHA,KAFU;AAGVC,EAAAA,GAAG,EAAHA,KAHU;AAIVC,EAAAA,IAAI,EAAJA,MAJU;AAKVC,EAAAA,SAAS,EAATA;AALU,CAAZ;;AAQA,IAAG,OAAOzuB,MAAP,KAAkB,WAArB,EAAkC;AAChCA,EAAAA,MAAM,CAAC4sD,KAAP,GAAeA,OAAf;AACD,CAFD,MAGK,IAAG,OAAOnqD,IAAP,KAAgB,WAAnB,EAAgC;AACnCA,EAAAA,IAAI,CAACmqD,KAAL,GAAaA,OAAb;AACD;;;;"} \ No newline at end of file +{"version":3,"file":"index.es.js","sources":["src/util/enums.js","src/node/Node.js","src/refresh/mode.js","src/style/unit.js","src/style/font.js","src/style/reg.js","src/math/matrix.js","src/math/vector.js","src/math/geom.js","src/math/gradient.js","src/util/painter.js","src/style/border.js","src/util/$$type.js","src/util/util.js","src/util/debug.js","src/node/textCache.js","src/gl/ca.js","src/gl/webgl.js","src/util/inject.js","src/style/gradient.js","src/style/reset.js","src/style/abbr.js","src/animate/key.js","src/refresh/change.js","src/style/css.js","src/node/TextBox.js","src/refresh/Page.js","src/math/tar.js","src/math/martinez.js","src/math/index.js","src/style/transform.js","src/math/blur.js","src/refresh/Cache.js","src/refresh/level.js","src/node/Text.js","src/util/flatten.js","src/util/builder.js","src/util/Event.js","src/node/Component.js","src/style/image.js","src/style/bg.js","src/animate/frame.js","src/animate/easing.js","src/animate/Animation.js","src/style/bs.js","src/style/mbm.js","src/node/inline.js","src/node/Xom.js","src/node/LineBox.js","src/node/LineBoxManager.js","src/node/tag.js","src/refresh/reflow.js","src/node/Dom.js","src/node/Img.js","src/node/Defs.js","src/node/geom/Geom.js","src/util/updater.js","src/util/diff.js","src/animate/Controller.js","src/refresh/offscreen.js","src/gl/MockPage.js","src/gl/MockCache.js","src/refresh/struct.js","src/gl/TexCache.js","src/node/Root.js","src/node/geom/Line.js","src/node/geom/Polyline.js","src/node/geom/Polygon.js","src/node/geom/Sector.js","src/node/geom/Rect.js","src/node/geom/Circle.js","src/node/geom/Ellipse.js","src/parser/abbr.js","src/parser/parse.js","src/parser/index.js","src/style/index.js","src/animate/index.js","src/refresh/index.js","src/index.js"],"sourcesContent":["const STYLE_KEY = {\n POSITION: 0,\n DISPLAY: 1,\n TOP: 2,\n RIGHT: 3,\n BOTTOM: 4,\n LEFT: 5,\n MARGIN_TOP: 6,\n MARGIN_RIGHT: 7,\n MARGIN_BOTTOM: 8,\n MARGIN_LEFT: 9,\n PADDING_TOP: 10,\n PADDING_RIGHT: 11,\n PADDING_BOTTOM: 12,\n PADDING_LEFT: 13,\n FONT_SIZE: 14,\n FONT_FAMILY: 15,\n COLOR: 16,\n FONT_STYLE: 17,\n FONT_WEIGHT: 18,\n LINE_HEIGHT: 19,\n BACKGROUND_IMAGE: 20,\n BACKGROUND_COLOR: 21,\n BACKGROUND_SIZE: 22,\n BACKGROUND_REPEAT: 23,\n BACKGROUND_POSITION_X: 24,\n BACKGROUND_POSITION_Y: 25,\n BORDER_TOP_WIDTH: 26,\n BORDER_RIGHT_WIDTH: 27,\n BORDER_BOTTOM_WIDTH: 28,\n BORDER_LEFT_WIDTH: 29,\n BORDER_TOP_COLOR: 30,\n BORDER_RIGHT_COLOR: 31,\n BORDER_BOTTOM_COLOR: 32,\n BORDER_LEFT_COLOR: 33,\n BORDER_TOP_STYLE: 34,\n BORDER_RIGHT_STYLE: 35,\n BORDER_BOTTOM_STYLE: 36,\n BORDER_LEFT_STYLE: 37,\n BORDER_TOP_LEFT_RADIUS: 38,\n BORDER_TOP_RIGHT_RADIUS: 39,\n BORDER_BOTTOM_RIGHT_RADIUS: 40,\n BORDER_BOTTOM_LEFT_RADIUS: 41,\n WIDTH: 42,\n HEIGHT: 43,\n FLEX_GROW: 44,\n FLEX_SHRINK: 45,\n FLEX_BASIS: 46,\n FLEX_DIRECTION: 47,\n JUSTIFY_CONTENT: 48,\n ALIGN_ITEMS: 49,\n ALIGN_SELF: 50,\n TEXT_ALIGN: 51,\n TRANSFORM_ORIGIN: 52,\n VISIBILITY: 53,\n OPACITY: 54,\n Z_INDEX: 55,\n TRANSFORM: 56,\n TRANSLATE_X: 57,\n TRANSLATE_Y: 58,\n TRANSLATE_Z: 59,\n SCALE_X: 60,\n SCALE_Y: 61,\n SCALE_Z: 62,\n SKEW_X: 63,\n SKEW_Y: 64,\n ROTATE_X: 65,\n ROTATE_Y: 66,\n ROTATE_Z: 67,\n ROTATE_3D: 68,\n PERSPECTIVE: 69,\n PERSPECTIVE_ORIGIN: 70,\n FILTER: 71,\n BOX_SHADOW: 72,\n POINTER_EVENTS: 73,\n OVERFLOW: 74,\n MIX_BLEND_MODE: 75,\n BACKGROUND_CLIP: 76,\n WHITE_SPACE: 77,\n TEXT_OVERFLOW: 78,\n LETTER_SPACING: 79,\n LINE_CLAMP: 80,\n ORDER: 81,\n FLEX_WRAP: 82,\n ALIGN_CONTENT: 83,\n TEXT_STROKE_WIDTH: 84,\n TEXT_STROKE_COLOR: 85,\n TEXT_STROKE_OVER: 86,\n // GEOM\n FILL: 87,\n STROKE: 88,\n STROKE_WIDTH: 89,\n STROKE_DASHARRAY: 90,\n STROKE_DASHARRAY_STR: 91,\n STROKE_LINECAP: 92,\n STROKE_LINEJOIN: 93,\n STROKE_MITERLIMIT: 94,\n FILL_RULE: 95,\n // 无此样式,仅cache或特殊情况需要\n MATRIX: 96,\n BORDER_TOP: 97,\n BORDER_RIGHT: 98,\n BORDER_BOTTOM: 99,\n BORDER_LEFT: 100,\n TRANSLATE_PATH: 101,\n};\n\nconst STYLE2LOWER_MAP = {};\nfunction style2Lower(s) {\n STYLE2LOWER_MAP[s] = STYLE2LOWER_MAP[s] || s.toLowerCase().replace(/_([a-z])/g, function($0, $1) {\n return $1.toUpperCase();\n });\n\n return STYLE2LOWER_MAP[s];\n}\n\nconst STYLE2UPPER_MAP = {};\nfunction style2Upper(s) {\n STYLE2UPPER_MAP[s] = STYLE2UPPER_MAP[s] || s.replace(/([a-z\\d_])([A-Z])/g, function($0, $1, $2) {\n return $1 + '_' + $2;\n }).toUpperCase();\n\n return STYLE2UPPER_MAP[s];\n}\n\nconst STYLE_R_KEY = {};\nconst STYLE_RV_KEY = {};\nconst STYLE_V_KEY = {};\nObject.keys(STYLE_KEY).forEach(k => {\n let k2 = STYLE_KEY[k];\n STYLE_R_KEY[k2] = k;\n let l = style2Lower(k);\n STYLE_RV_KEY[k2] = l;\n STYLE_V_KEY[l] = k2;\n});\n\n// Root的update过程使用\nconst UPDATE_KEY = {\n UPDATE_NODE: 0,\n UPDATE_STYLE: 1,\n UPDATE_FOCUS: 2,\n UPDATE_MEASURE: 3,\n UPDATE_COMPONENT: 4,\n UPDATE_OVERWRITE: 5,\n UPDATE_KEYS: 6,\n UPDATE_LIST: 7,\n UPDATE_CONFIG: 8,\n UPDATE_ADD_DOM: 9,\n UPDATE_REMOVE_DOM: 10,\n};\n\n// animation计算每帧使用\nconst KEY_FRAME_KEY = {\n FRAME_STYLE: 0,\n FRAME_TIME: 1,\n FRAME_EASING: 2,\n FRAME_TRANSITION: 3,\n};\n\n// 节点使用\nconst NODE_KEY = {\n NODE_DOM_PARENT: 0,\n NODE_OPACITY: 1,\n NODE_MATRIX: 2,\n NODE_MATRIX_EVENT: 3,\n NODE_CACHE: 4,\n NODE_CACHE_TOTAL: 5,\n NODE_CACHE_FILTER: 6,\n NODE_CACHE_MASK: 7,\n NODE_CACHE_OVERFLOW: 8,\n NODE_STRUCT: 9,\n NODE_TAG_NAME: 10,\n NODE_CURRENT_STYLE: 11,\n NODE_CURRENT_PROPS: 12,\n NODE_COMPUTED_STYLE: 13,\n NODE_CACHE_STYLE: 14,\n NODE_CACHE_PROPS: 15,\n NODE_LIMIT_CACHE: 16,\n NODE_IS_MASK: 17,\n NODE_IS_INLINE: 18,\n NODE_HAS_CONTENT: 19,\n NODE_REFRESH_LV: 20,\n NODE_IS_DESTROYED: 21,\n NODE_STYLE: 22,\n NODE_UPDATE_HASH: 23,\n NODE_UNIQUE_UPDATE_ID: 24,\n NODE_DEFS_CACHE: 25,\n NODE_PERSPECTIVE_MATRIX: 26,\n NODE_VIRTUAL_DOM: 27,\n NODE_CACHE_AS_BITMAP: 28,\n};\n\n// struct用\nconst STRUCT_KEY = {\n STRUCT_NODE: 0,\n STRUCT_INDEX: 1,\n STRUCT_CHILD_INDEX: 2,\n STRUCT_LV: 3,\n STRUCT_NUM: 4,\n STRUCT_TOTAL: 5,\n STRUCT_HAS_MASK: 6,\n};\n\nconst ANIMATE_KEY = {\n I_ASSIGNING: 0,\n I_IN_FPS: 1,\n I_IS_DELAY: 2,\n I_BEGIN: 3,\n I_END: 4,\n I_FINISHED: 5,\n I_NEXT_END: 6,\n I_FIRST_PLAY: 7,\n I_PLAY_CB: 8,\n I_TARGET: 9,\n I_ROOT: 10,\n I_FRAMES: 11,\n I_FRAMES_R: 12,\n I_CURRENT_TIME: 13,\n I_NEXT_TIME: 14,\n I_STYLE: 15,\n I_DURATION: 16,\n I_ITERATIONS: 17,\n I_FILL: 18,\n I_PLAYBACK_RATE: 19,\n I_PLAY_COUNT: 20,\n I_PLAY_STATE: 21,\n I_DESTROYED: 22,\n I_START_TIME: 23,\n I_FPS_TIME: 24,\n I_EASING: 25,\n I_ENTER_FRAME: 26,\n I_DELAY: 27,\n I_END_DELAY: 28,\n I_KEYS: 29,\n I_ORIGIN_STYLE: 30,\n I_CURRENT_FRAMES: 31,\n I_CURRENT_FRAME: 32,\n I_SPF_LIMIT: 33,\n I_FPS: 34,\n I_DIRECTION: 35,\n I_FIRST_ENTER: 36,\n I_STAY_BEGIN: 37,\n I_STAY_END: 38,\n I_IS2: 39,\n I_END_TIME: 40,\n I_NODE_CONFIG: 41,\n I_ROOT_CONFIG: 42,\n I_OUT_BEGIN_DELAY: 43,\n I_TIME_STAMP: 44,\n};\n\nexport default {\n STYLE_KEY, // 大写常量为k,数字为值\n STYLE_R_KEY, // 数字为k,大写常量为值\n STYLE_RV_KEY, // 数字为k,小写为值\n STYLE_V_KEY, // 小写为k,数字为值\n style2Lower,\n style2Upper,\n UPDATE_KEY,\n KEY_FRAME_KEY,\n NODE_KEY,\n STRUCT_KEY,\n ANIMATE_KEY,\n};\n","import enums from '../util/enums';\n\nconst {\n STRUCT_KEY: {\n STRUCT_NODE,\n STRUCT_INDEX,\n STRUCT_CHILD_INDEX,\n STRUCT_LV,\n },\n NODE_KEY: {\n NODE_IS_DESTROYED,\n NODE_STRUCT,\n },\n} = enums;\n\nclass Node {\n constructor() {\n this.__x = 0;\n this.__y = 0;\n this.__ox = 0; // relative造成的偏移量\n this.__oy = 0;\n this.__sx = 0;\n this.__sy = 0;\n this.__width = 0;\n this.__height = 0;\n this.__baseline = 0;\n this.__config = {};\n this.__prev = null;\n this.__next = null;\n this.__parent = null;\n this.__domParent = null;\n this.__root = null;\n this.__host = null;\n }\n\n __structure(i, lv, j) {\n return this.__config[NODE_STRUCT] = {\n [STRUCT_NODE]: this,\n [STRUCT_INDEX]: i,\n [STRUCT_CHILD_INDEX]: j,\n [STRUCT_LV]: lv,\n };\n }\n\n __modifyStruct(root, offset = 0) {\n let struct = this.__config[NODE_STRUCT];\n return [struct, 0];\n }\n\n __offsetX(diff, isLayout) {\n if(isLayout) {\n this.__x += diff;\n }\n else {\n this.__ox += diff;\n }\n this.__sx += diff;\n }\n\n __offsetY(diff, isLayout) {\n if(isLayout) {\n this.__y += diff;\n }\n else {\n this.__oy += diff;\n }\n this.__sy += diff;\n }\n\n __destroy() {\n this.__config[NODE_IS_DESTROYED] = true;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get ox() {\n return this.__ox;\n }\n\n get oy() {\n return this.__oy;\n }\n\n get sx() {\n return this.x + this.ox;\n }\n\n get sy() {\n return this.y + this.oy;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n // canvas/svg根节点\n get root() {\n return this.__root;\n }\n\n // component根节点\n get host() {\n return this.__host;\n }\n\n // 考虑高阶组件在内的component根节点\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get baseline() {\n return this.__baseline;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get isDestroyed() {\n return this.__config[NODE_IS_DESTROYED];\n }\n\n get isReplaced() {\n return false;\n }\n}\n\nexport default Node;\n","export default {\n CANVAS: 0,\n SVG: 1,\n WEBGL: 2,\n};\n","let o = {\n AUTO: 0,\n PX: 1,\n PERCENT: 2,\n NUMBER: 3,\n INHERIT: 4,\n DEG: 5,\n STRING: 6,\n RGBA: 7,\n REM: 8,\n EM: 9,\n VW: 10,\n VH: 11,\n VMAX: 12,\n VMIN: 13,\n /**\n * 通用的格式化计算数值单位的方法,百分比/像素/REM/VW/auto和纯数字\n * @param v value\n * @returns 格式化好的[number, unit]\n */\n calUnit(v) {\n let n = parseFloat(v) || 0;\n if(/%$/.test(v)) {\n return [n, o.PERCENT];\n }\n else if(/px$/i.test(v)) {\n return [n, o.PX];\n }\n else if(/deg$/i.test(v)) {\n return [n, o.DEG];\n }\n else if(/rem$/i.test(v)) {\n return [n, o.REM];\n }\n else if(/vw$/i.test(v)) {\n return [n, o.VW];\n }\n else if(/vh$/i.test(v)) {\n return [n, o.VH];\n }\n else if(/em$/i.test(v)) {\n return [n, o.EM];\n }\n else if(/vw$/i.test(v)) {\n return [n, o.VW];\n }\n else if(/vh$/i.test(v)) {\n return [n, o.VH];\n }\n else if(/vmax$/i.test(v)) {\n return [n, o.VMAX];\n }\n else if(/vmin$/i.test(v)) {\n return [n, o.VMIN];\n }\n return [n, o.NUMBER];\n },\n};\n\nexport default o;\n","'use strict';\n\nlet o = {\n info: {\n arial: {\n lhr: 1.14990234375, // 默认line-height ratio,(67+1854+434)/2048\n // car: 1.1171875, // content-area ratio,(1854+434)/2048\n blr: 0.9052734375, // base-line ratio,1854/2048\n // mdr: 0.64599609375, // middle ratio,(1854-1062/2)/2048\n lgr: 0.03271484375, // line-gap ratio,67/2048,默认0\n // 个别字符误差,初次之外误差还有根据经验得的比例系数,https://github.com/karasjs/karas/issues/145\n padding: {\n 1: 1,\n f: 0.9,\n },\n },\n helvetica: {\n lhr: 1.14990234375, // (8+1900+447)/2048\n blr: 0.927734375, // 1900/2048\n lgr: 0.00390625, // 8/2048\n },\n verdana: {\n lhr: 1.21533203125, // (0+2059+430)/2048\n blr: 1.00537109375, // 2059/2048\n },\n tahoma: {\n lhr: 1.20703125, // (0+2049+423)/2048\n blr: 1.00048828125, // 2049/2048\n padding: {\n S: 1,\n T: 1,\n Z: 1,\n c: 1,\n f: 0.7,\n i: 1,\n l: 1,\n t: 0.9,\n },\n },\n georgia: {\n lhr: 1.13623046875, // (0+1878+449)/2048\n blr: 0.9169921875, // 1878/2048\n },\n 'courier new': {\n lhr: 1.1328125, // (0+1705+615)/2048\n blr: 0.83251953125, // 1705/2048\n },\n 'pingfang sc': {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06, // 1060/1000\n padding: {\n f: 0.5,\n },\n },\n simsun: {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06,\n padding: {\n f: 0.5,\n },\n },\n },\n support(fontFamily) {\n return this.info.hasOwnProperty(fontFamily);\n },\n register(name, info) {\n let { emSquare = 2048, ascent = 1854, descent = 434, lineGap = 0, padding = {} } = info || {};\n this.info[name.toLowerCase()] = {\n lhr: (ascent + descent + lineGap) / emSquare,\n blr: ascent / emSquare,\n padding,\n };\n },\n addPadding(name, padding) {\n Object.assign(this.info[name.toLowerCase()].padding, padding);\n },\n};\n\no.info['宋体'] = o.info.simsun;\no.info['pingfang'] = o.info['pingfang sc'];\n\nexport default o;\n","export default {\n position: /(([-+]?[\\d.]+[pxremvwhina%]*)|(left|top|right|bottom|center)){1,2}/ig,\n // tfo: /((-?[\\d.]+(px|%)?)|(left|top|right|bottom|center)){1,2}/ig,\n gradient: /\\b(\\w+)-?gradient\\((.+)\\)/i,\n img: /(?:\\burl\\((['\"]?)(.*?)\\1\\))|(?:\\b((data:)))/i,\n};\n","// 生成4*4单位矩阵\nfunction identity() {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n}\n\n// 矩阵a*b,固定两个matrix都是长度16\nfunction multiply(a, b) {\n if(isE(a)) {\n return b;\n }\n if(isE(b)) {\n return a;\n }\n let c = [];\n for(let i = 0; i < 4; i++) {\n let a0 = a[i] || 0;\n let a1 = a[i + 4] || 0;\n let a2 = a[i + 8] || 0;\n let a3 = a[i + 12] || 0;\n c[i] = a0 * b[0] + a1 * b[1] + a2 * b[2] + a3 * b[3];\n c[i + 4] = a0 * b[4] + a1 * b[5] + a2 * b[6] + a3 * b[7];\n c[i + 8] = a0 * b[8] + a1 * b[9] + a2 * b[10] + a3 * b[11];\n c[i + 12] = a0 * b[12] + a1 * b[13] + a2 * b[14] + a3 * b[15];\n }\n return c;\n}\n\nfunction calPoint(point, m) {\n let [x, y, z, w] = point;\n if(w === undefined) {\n w = 1;\n }\n if(m && !isE(m)) {\n if(m.length === 16) {\n z = z || 0;\n let [a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4] = m;\n w *= x * d1 + y * d2 + z * d3 + d4;\n return [\n (x * a1 + y * a2 + z * a3 + a4),\n (x * b1 + y * b2 + z * b3 + b4),\n (x * c1 + y * c2 + z * c3 + c4),\n w\n ];\n }\n // 6位类型\n let [a, b, c, d, e, f] = m;\n return [a * x + c * y + e, b * x + d * y + f];\n }\n return [x, y, z, w];\n}\n\n/**\n * 初等行变换求3*3特定css的matrix方阵,一维6长度\n * https://blog.csdn.net/iloveas2014/article/details/82930946\n * @param m\n * @returns {number[]|*}\n */\nfunction inverse(m) {\n if(m.length === 16) {\n return inverse4(m);\n }\n let [a, b, c, d, e, f] = m;\n if(a === 1 && b === 0 && c === 0 && d === 1 && e === 0 && f === 0) {\n return m;\n }\n let divisor = a * d - b * c;\n if(divisor === 0) {\n return m;\n }\n return [d / divisor, -b / divisor, -c / divisor, a / divisor,\n (c * f - d * e) / divisor, (b * e - a * f) / divisor];\n}\n\n// 16位或者6位单位矩阵判断,空也认为是\nfunction isE(m) {\n if(!m || !m.length) {\n return true;\n }\n if(m.length === 16) {\n return m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 0\n && m[4] === 0 && m[5] === 1 && m[6] === 0 && m[7] === 0\n && m[8] === 0 && m[9] === 0 && m[10] === 1 && m[11] === 0\n && m[12] === 0 && m[13] === 0 && m[14] === 0 && m[15] === 1;\n }\n return m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 1 && m[4] === 0 && m[5] === 0;\n}\n\n/**\n * 求任意4*4矩阵的逆矩阵,行列式为 0 则返回单位矩阵兜底\n * 格式:matrix3d(a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4)\n * 参见: https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix3d()\n * 对应:\n * [\n * a1,a2,a3,a4,\n * b1,b2,b3,b4,\n * c1,c2,c3,c4,\n * d1,d2,d3,d4,\n * ]\n *\n * 根据公式 A* = |A|A^-1 来计算\n * A* 表示矩阵 A 的伴随矩阵,A^-1 表示矩阵 A 的逆矩阵,|A| 表示行列式的值\n *\n * @returns {number[]}\n */\n\nfunction inverse4(s) {\n let inv = [];\n\n inv[0] = s[5] * s[10] * s[15] - s[5] * s[11] * s[14] - s[9] * s[6] * s[15]\n + s[9] * s[7] * s[14] + s[13] * s[6] * s[11] - s[13] * s[7] * s[10];\n inv[4] = -s[4] * s[10] * s[15] + s[4] * s[11] * s[14] + s[8] * s[6] * s[15]\n - s[8] * s[7] * s[14] - s[12] * s[6] * s[11] + s[12] * s[7] * s[10];\n inv[8] = s[4] * s[9] * s[15] - s[4] * s[11] * s[13] - s[8] * s[5] * s[15]\n + s[8] * s[7] * s[13] + s[12] * s[5] * s[11] - s[12] * s[7] * s[9];\n inv[12] = -s[4] * s[9] * s[14] + s[4] * s[10] * s[13] + s[8] * s[5] * s[14]\n - s[8] * s[6] * s[13] - s[12] * s[5] * s[10] + s[12] * s[6] * s[9];\n\n inv[1] = -s[1] * s[10] * s[15] + s[1] * s[11] * s[14] + s[9] * s[2] * s[15]\n - s[9] * s[3] * s[14] - s[13] * s[2] * s[11] + s[13] * s[3] * s[10];\n inv[5] = s[0] * s[10] * s[15] - s[0] * s[11] * s[14] - s[8] * s[2] * s[15]\n + s[8] * s[3] * s[14] + s[12] * s[2] * s[11] - s[12] * s[3] * s[10];\n inv[9] = -s[0] * s[9] * s[15] + s[0] * s[11] * s[13] + s[8] * s[1] * s[15]\n - s[8] * s[3] * s[13] - s[12] * s[1] * s[11] + s[12] * s[3] * s[9];\n inv[13] = s[0] * s[9] * s[14] - s[0] * s[10] * s[13] - s[8] * s[1] * s[14]\n + s[8] * s[2] * s[13] + s[12] * s[1] * s[10] - s[12] * s[2] * s[9];\n\n inv[2] = s[1] * s[6] * s[15] - s[1] * s[7] * s[14] - s[5] * s[2] * s[15]\n + s[5] * s[3] * s[14] + s[13] * s[2] * s[7] - s[13] * s[3] * s[6];\n inv[6] = -s[0] * s[6] * s[15] + s[0] * s[7] * s[14] + s[4] * s[2] * s[15]\n - s[4] * s[3] * s[14] - s[12] * s[2] * s[7] + s[12] * s[3] * s[6];\n inv[10] = s[0] * s[5] * s[15] - s[0] * s[7] * s[13] - s[4] * s[1] * s[15]\n + s[4] * s[3] * s[13] + s[12] * s[1] * s[7] - s[12] * s[3] * s[5];\n inv[14] = -s[0] * s[5] * s[14] + s[0] * s[6] * s[13] + s[4] * s[1] * s[14]\n - s[4] * s[2] * s[13] - s[12] * s[1] * s[6] + s[12] * s[2] * s[5];\n\n inv[3] = -s[1] * s[6] * s[11] + s[1] * s[7] * s[10] + s[5] * s[2] * s[11]\n - s[5] * s[3] * s[10] - s[9] * s[2] * s[7] + s[9] * s[3] * s[6];\n inv[7] = s[0] * s[6] * s[11] - s[0] * s[7] * s[10] - s[4] * s[2] * s[11]\n + s[4] * s[3] * s[10] + s[8] * s[2] * s[7] - s[8] * s[3] * s[6];\n inv[11] = -s[0] * s[5] * s[11] + s[0] * s[7] * s[9] + s[4] * s[1] * s[11]\n - s[4] * s[3] * s[9] - s[8] * s[1] * s[7] + s[8] * s[3] * s[5];\n inv[15] = s[0] * s[5] * s[10] - s[0] * s[6] * s[9] - s[4] * s[1] * s[10]\n + s[4] * s[2] * s[9] + s[8] * s[1] * s[6] - s[8] * s[2] * s[5];\n\n let det = s[0] * inv[0] + s[1] * inv[4] + s[2] * inv[8] + s[3] * inv[12];\n if (det === 0) {\n return identity();\n }\n\n det = 1 / det;\n let d = [];\n for (let i = 0; i < 16; i++) {\n d[i] = inv[i] * det;\n }\n return d;\n}\n\n// 将4*4的16长度矩阵转成css/canvas的6位标准使用,忽略transform3d\nfunction m2m6(m) {\n return [\n m[0],\n m[1],\n m[4],\n m[5],\n m[12],\n m[13],\n ];\n}\n\nfunction point2d(point) {\n let w = point[3];\n if(w && w !== 1) {\n point = point.slice(0, 2);\n point[0] /= w;\n point[1] /= w;\n }\n return point;\n}\n\nexport default {\n identity,\n multiply,\n calPoint,\n point2d,\n inverse,\n isE,\n m2m6,\n};\n","// 向量点乘积\nfunction dotProduct(x1, y1, x2, y2) {\n return x1 * x2 + y1 * y2;\n}\n\n// 向量叉乘积\nfunction crossProduct(x1, y1, x2, y2) {\n return x1 * y2 - x2 * y1;\n}\n\nexport default {\n dotProduct,\n crossProduct,\n};\n","import mx from './matrix';\nimport vector from './vector';\nimport enums from '../util/enums';\n\nconst H = 4 * (Math.sqrt(2) - 1) / 3;\nconst { crossProduct } = vector;\nconst { calPoint, isE } = mx;\nconst { STYLE_KEY: {\n WIDTH,\n HEIGHT,\n TRANSFORM_ORIGIN,\n} } = enums;\n\n/**\n * 圆弧拟合公式,根据角度求得3阶贝塞尔控制点比例长度,一般<=90,超过拆分\n * @param deg\n * @returns {number}\n */\nfunction h(deg) {\n deg *= 0.5;\n return 4 * ((1 - Math.cos(deg)) / Math.sin(deg)) / 3;\n}\n\n/**\n * 判断点是否在多边形内\n * @param x 点坐标\n * @param y\n * @param vertexes 多边形顶点坐标\n * @returns {boolean}\n */\nfunction pointInPolygon(x, y, vertexes) {\n // 先取最大最小值得一个外围矩形,在外边可快速判断false\n let [xmax, ymax] = vertexes[0];\n let [xmin, ymin] = vertexes[0];\n let len = vertexes.length;\n for(let i = 1; i < len; i++) {\n let [x, y] = vertexes[i];\n xmax = Math.max(xmax, x);\n ymax = Math.max(ymax, y);\n xmin = Math.min(xmin, x);\n ymin = Math.min(ymin, y);\n }\n if(x < xmin || y < ymin || x > xmax || y > ymax) {\n return false;\n }\n // 所有向量积均为非负数说明在多边形内或边上\n for(let i = 0, len = vertexes.length; i < len; i++) {\n let [x1, y1] = vertexes[i];\n let [x2, y2] = vertexes[(i + 1) % len];\n if(crossProduct(x2 - x1, y2 - y1, x - x1, y - y1) < 0) {\n return false;\n }\n }\n return true;\n}\n\n// 判断点是否在一个4边形内,比如事件发生是否在节点上\nfunction pointInQuadrilateral(x, y, x1, y1, x2, y2, x4, y4, x3, y3, matrix) {\n if(matrix && !isE(matrix)) {\n let w1, w2, w3, w4;\n [x1, y1,, w1] = calPoint([x1, y1], matrix);\n [x2, y2,, w2] = calPoint([x2, y2], matrix);\n [x3, y3,, w3] = calPoint([x3, y3], matrix);\n [x4, y4,, w4] = calPoint([x4, y4], matrix);\n if(w1 && w1 !== 1) {\n x1 /= w1;\n y1 /= w1;\n }\n if(w2 && w2 !== 1) {\n x2 /= w2;\n y2 /= w2;\n }\n if(w3 && w3 !== 1) {\n x3 /= w3;\n y3 /= w3;\n }\n if(w4 && w4 !== 1) {\n x4 /= w4;\n y4 /= w4;\n }\n return pointInPolygon(x, y, [\n [x1, y1],\n [x2, y2],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n return x >= x1 && y >= y1 && x <= x4 && y <= y4;\n }\n}\n\n/**\n * 余弦定理3边长求夹角\n * @param a\n * @param b\n * @param c\n */\nfunction angleBySide(a, b, c) {\n let theta = (Math.pow(b, 2) + Math.pow(c, 2) - Math.pow(a, 2)) / (2 * b * c);\n return Math.acos(theta);\n}\n\n/**\n * 余弦定理2边长和夹角求3边\n * @param alpha 弧度\n * @param a\n * @param b\n */\nfunction sideByAngle(alpha, a, b) {\n let cos = Math.cos(alpha);\n return Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2) - 2 * a * b * cos);\n}\n\n/**\n * 两点距离\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n */\nfunction pointsDistance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n}\n\n/**\n * 三角形内心\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param x3\n * @param y3\n */\nfunction triangleIncentre(x1, y1, x2, y2, x3, y3) {\n let a = pointsDistance(x2, y2, x3, y3);\n let b = pointsDistance(x1, y1, x3, y3);\n let c = pointsDistance(x1, y1, x2, y2);\n return [\n (a * x1 + b * x2 + c * x3) / (a + b + c),\n (a * y1 + b * y2 + c * y3) / (a + b + c),\n ];\n}\n\n/**\n * 椭圆圆心和长短轴生成4个端点和控制点\n */\nfunction ellipsePoints(x, y, a, b = a) {\n let ox = a * H;\n let oy = b === a ? ox : b * H;\n return [\n [x - a, y],\n [x - a, y - oy, x - ox, y - b, x, y - b],\n [x + ox, y - b, x + a, y - oy, x + a, y],\n [x + a, y + oy, x + ox, y + b, x, y + b],\n [x - ox, y + b, x - a, y + oy, x - a, y],\n ];\n}\n\n/**\n * 扇形圆心和半径起始角度生成4个端点和控制点\n * 分为4个象限进行拟合,0、1、2、3\n */\nfunction sectorPoints(x, y, r, begin, end) {\n if(begin > end) {\n [begin, end] = [end, begin];\n }\n if(begin === end) {\n return [];\n }\n let list = [];\n let b = Math.floor(begin / 90);\n let e = Math.floor(end / 90);\n // 同象限直接算\n if(b === e || (e - b) === 1 && end % 90 === 0) {\n let h2 = h(d2r(Math.abs(begin - end)));\n let d = h2 * r;\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let alpha = Math.atan(d / r);\n if(b < 90) {\n // 第1个交点\n let rx = Math.sin(d2r(begin)) * r;\n let ry = Math.cos(d2r(begin)) * r;\n let p1 = [x + rx, y - ry];\n // 第1个控制点\n let deg = alpha + d2r(begin);\n rx = Math.sin(deg) * c;\n ry = Math.cos(deg) * c;\n let p2 = [x + rx, y - ry];\n // 第2个交点\n rx = Math.sin(d2r(end)) * r;\n ry = Math.cos(d2r(end)) * r;\n let p4 = [x + rx, y - ry];\n // 第2个控制点\n deg = d2r(end) - alpha;\n rx = Math.sin(deg) * c;\n ry = Math.cos(deg) * c;\n let p3 = [x + rx, y - ry];\n list.push(p1);\n list.push(p2.concat(p3).concat(p4));\n }\n else if(b < 180) {\n // 第1个交点\n let rx = Math.cos(d2r(begin - 90)) * r;\n let ry = Math.sin(d2r(begin - 90)) * r;\n let p1 = [x + rx, y + ry];\n // 第1个控制点\n let deg = alpha + d2r(begin - 90);\n rx = Math.cos(deg) * c;\n ry = Math.sin(deg) * c;\n let p2 = [x + rx, y + ry];\n // 第2个交点\n rx = Math.cos(d2r(end - 90)) * r;\n ry = Math.sin(d2r(end - 90)) * r;\n let p4 = [x + rx, y + ry];\n // 第2个控制点\n deg = d2r(end - 90) - alpha;\n rx = Math.cos(deg) * c;\n ry = Math.sin(deg) * c;\n let p3 = [x + rx, y + ry];\n list.push(p1);\n list.push(p2.concat(p3).concat(p4));\n }\n else if(b < 270) {\n // 第1个交点\n let rx = Math.sin(d2r(begin - 180)) * r;\n let ry = Math.cos(d2r(begin - 180)) * r;\n let p1 = [x - rx, y + ry];\n // 第1个控制点\n let deg = alpha + d2r(begin - 180);\n rx = Math.sin(deg) * c;\n ry = Math.cos(deg) * c;\n let p2 = [x - rx, y + ry];\n // 第2个交点\n rx = Math.sin(d2r(end - 180)) * r;\n ry = Math.cos(d2r(end - 180)) * r;\n let p4 = [x - rx, y + ry];\n // 第2个控制点\n deg = d2r(end - 180) - alpha;\n rx = Math.sin(deg) * c;\n ry = Math.cos(deg) * c;\n let p3 = [x - rx, y + ry];\n list.push(p1);\n list.push(p2.concat(p3).concat(p4));\n }\n else {\n // 第1个交点\n let rx = Math.cos(d2r(begin - 270)) * r;\n let ry = Math.sin(d2r(begin - 270)) * r;\n let p1 = [x - rx, y + ry];\n // 第1个控制点\n let deg = alpha + d2r(begin - 270);\n rx = Math.cos(deg) * c;\n ry = Math.sin(deg) * c;\n let p2 = [x - rx, y + ry];\n // 第2个交点\n rx = Math.cos(d2r(end - 270)) * r;\n ry = Math.sin(d2r(end - 270)) * r;\n let p4 = [x - rx, y + ry];\n // 第2个控制点\n deg = d2r(end - 270) - alpha;\n rx = Math.cos(deg) * c;\n ry = Math.sin(deg) * c;\n let p3 = [x - rx, y + ry];\n list.push(p1);\n list.push(p2.concat(p3).concat(p4));\n }\n }\n // 跨象限循环算\n else {\n let i = b;\n let temp = [];\n for(; i <= e; i++) {\n if(i === 0) {\n let res = sectorPoints(x, y, r, begin, 90);\n temp.push(res);\n }\n else if(i === 1) {\n // 防止90~90这种情况,但如果begin和end都是90时又要显示\n if(b === i || end > 90) {\n let res = sectorPoints(x, y, r, begin < 90 ? 90 : begin, end > 180 ? 180 : end);\n temp.push(res);\n }\n }\n else if(i === 2) {\n // 防止180~180这种情况,但如果begin和end都是90时又要显示\n if(b === i || end > 180) {\n let res = sectorPoints(x, y, r, begin < 180 ? 180 : begin, end > 270 ? 270 : end);\n temp.push(res);\n }\n }\n else if(i === 3) {\n // 防止180~180这种情况,但如果begin和end都是90时又要显示\n if(b === i || end > 270) {\n let res = sectorPoints(x, y, r, begin < 270 ? 270 : begin, end);\n temp.push(res);\n }\n }\n }\n // 去掉重复的首尾扇弧点\n list = temp[0];\n for(let i = 1, len = temp.length; i < len; i++) {\n list.push(temp[i][1]);\n }\n }\n return list;\n}\n\n/**\n * 获取2个矩形重叠区域,如不重叠返回null\n * @param a\n * @param b\n */\nfunction getRectsIntersection(a, b) {\n if(!isRectsOverlap(a, b)) {\n return null;\n }\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n return [\n Math.max(ax1, bx1),\n Math.max(ay1, by1),\n Math.min(ax4, bx4),\n Math.min(ay4, by4),\n ];\n}\n\n/**\n * 2个矩形是否重叠\n * @param a\n * @param b\n */\nfunction isRectsOverlap(a, b) {\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n if(ax1 >= bx4 || ay1 >= by4 || bx1 >= ax4 || by1 >= ay4) {\n return false;\n }\n return true;\n}\n\n/**\n * 2个矩形是否包含,a包含b\n * @param a\n * @param b\n */\nfunction isRectsInside(a, b) {\n let [ax1, ay1, ax4, ay4] = a;\n let [bx1, by1, bx4, by4] = b;\n if(ax1 <= bx1 && ay1 <= by1 && ax4 >= bx4 && ay4 >= by4) {\n return true;\n }\n return false;\n}\n\nfunction calCoordsInNode(px, py, node) {\n let { matrix = [1, 0, 0, 1, 0, 0], computedStyle = {} } = node;\n let { [WIDTH]: width, [HEIGHT]: height, [TRANSFORM_ORIGIN]: [ox, oy] = [width * 0.5, height * 0.5] } = computedStyle;\n [px, py] = calPoint([px * width - ox, py * height - oy], matrix);\n return [px + ox, py + oy];\n}\n\nfunction calPercentInNode(x, y, node) {\n let { computedStyle: { [WIDTH]: width, [HEIGHT]: height, [TRANSFORM_ORIGIN]: [ox, oy] } } = node;\n // 先求无旋转时右下角相对于原点的角度ds\n let ds = Math.atan((height - oy) / (width - ox));\n let [x1, y1] = calCoordsInNode(1, 1, node);\n let d1;\n let deg;\n // 根据旋转后的坐标,分4个象限,求旋转后的右下角相对于原点的角度d1,得出偏移角度deg,分顺逆时针[-180, 180]\n if(x1 >= ox && y1 >= oy) {\n if(ox === x1) {\n d1 = -Math.atan(Infinity);\n }\n else {\n d1 = Math.atan((y1 - oy) / (x1 - ox));\n }\n deg = d1 - ds;\n }\n else if(x1 >= ox && y1 < oy) {\n if(ox === x1) {\n d1 = -Math.atan(Infinity);\n }\n else {\n d1 = Math.atan((oy - y1) / (x1 - ox));\n }\n deg = d1 + ds;\n }\n else if(x1 < ox && y1 >= oy) {\n d1 = Math.atan((y1 - oy) / (ox - x1));\n deg = d1 - ds;\n }\n else if(x1 < ox && y1 < oy) {\n d1 = Math.atan((y1 - oy) / (x1 - ox));\n if(ds >= d1) {\n deg = d1 + Math.PI - ds;\n }\n else {\n deg = Math.PI - d1 + ds;\n deg = -deg;\n }\n }\n else {\n deg = 0;\n }\n // 目标点到原点的边长不会变\n let dt = Math.sqrt(Math.pow(x - ox, 2) + Math.pow(y - oy, 2));\n // 分4个象限,先求目标点到原点的角度d2,再偏移deg后求得原始坐标\n let d2;\n if(x >= ox && y >= oy) {\n if(ox === x) {\n d2 = -Math.atan(Infinity);\n }\n else {\n d2 = Math.atan((y - oy) / (x - ox));\n }\n }\n else if(x >= ox && y < oy) {\n if(ox === x) {\n d2 = -Math.atan(Infinity);\n }\n else {\n d2 = -Math.atan((y - oy) / (ox - x));\n }\n }\n else if(x < ox && y >= oy) {\n d2 = Math.PI - Math.atan((y - oy) / (ox - x));\n }\n else {\n d2 = Math.atan((y - oy) / (x - ox)) - Math.PI;\n }\n d2 -= deg;\n if(d2 > Math.PI) {\n d2 -= Math.PI;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 > Math.PI * 0.5) {\n d2 = Math.PI - d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= 0) {\n return [\n (ox + dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= -Math.PI * 0.5) {\n d2 = -d2;\n return [\n (ox + dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n if(d2 >= -Math.PI) {\n d2 = Math.PI + d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy - dt * Math.sin(d2)) / height,\n ];\n }\n d2 = -Math.PI - d2;\n return [\n (ox - dt * Math.cos(d2)) / width,\n (oy + dt * Math.sin(d2)) / height,\n ];\n}\n\nfunction d2r(n) {\n return n * Math.PI / 180;\n}\n\nfunction r2d(n) {\n return n * 180 / Math.PI;\n}\n\n/**\n * 二阶贝塞尔曲线范围框\n * @param x0\n * @param y0\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @returns {number[]}\n * https://www.iquilezles.org/www/articles/bezierbbox/bezierbbox.htm\n */\nfunction bboxBezier2(x0, y0, x1, y1, x2, y2) {\n let minX = Math.min(x0, x2);\n let minY = Math.min(y0, y2);\n let maxX = Math.max(x0, x2);\n let maxY = Math.max(y0, y2);\n // 控制点位于边界内部时,边界就是范围框,否则计算导数获取极值\n if(x1 < minX || y1 < minY || x1 > maxX || y1 > maxY) {\n let tx = (x0 - x1) / (x0 - 2 * x1 + x2);\n let ty = (y0 - y1) / (y0 - 2 * y1 + y2);\n let sx = 1 - tx;\n let sy = 1 - ty;\n let qx = sx * sx * x0 + 2 * sx * tx * x1 + tx * tx * x2;\n let qy = sy * sy * y0 + 2 * sy * ty * y1 + ty * ty * y2;\n minX = Math.min(minX, qx);\n minY = Math.min(minY, qy);\n maxX = Math.min(maxX, qx);\n maxY = Math.min(maxY, qy);\n }\n return [minX, minY, maxX, maxY];\n}\n\n/**\n * 同上三阶的\n */\nfunction bboxBezier3(x0, y0, x1, y1, x2, y2, x3, y3) {\n let minX = Math.min(x0, x3);\n let minY = Math.min(y0, y3);\n let maxX = Math.max(x0, x3);\n let maxY = Math.max(y0, y3);\n if(x1 < minX || y1 < minY || x1 > maxX || y1 > maxY || x2 < minX || y2 < minY || x2 > maxX || y2 > maxY) {\n let cx = -x0 + x1;\n let cy = -y0 + y1;\n let bx = x0 - 2 * x1 + x2;\n let by = y0 - 2 * y1 + y2;\n let ax = -x0 + 3 * x1 - 3 * x2 + x3;\n let ay = -y0 + 3 * y1 - 3 * y2 + y3;\n let hx = bx * bx - ax * cx;\n let hy = by * by - ay * cy;\n if(hx > 0) {\n hx = Math.sqrt(hx);\n let t = (-bx - hx) / ax;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * x0 + 3 * s * s * t * x1 + 3 * s * t * t * x2 + t * t * t * x3;\n minX = Math.min(minX, q);\n maxX = Math.max(maxX, q);\n }\n t = (-bx + hx) / ax;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * x0 + 3 * s * s * t * x1 + 3 * s * t * t * x2 + t * t * t * x3;\n minX = Math.min(minX, q);\n maxX = Math.max(maxX, q);\n }\n }\n if(hy > 0) {\n hy = Math.sqrt(hy);\n let t = (-by - hy) / ay;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * y0 + 3 * s * s * t * y1 + 3 * s * t * t * y2 + t * t * t * y3;\n minY = Math.min(minY, q);\n maxY = Math.max(maxY, q);\n }\n t = (-by + hy) / ay;\n if(t > 0 && t < 1) {\n let s = 1 - t;\n let q = s * s * s * y0 + 3 * s * s * t * y1 + 3 * s * t * t * y2 + t * t * t * y3;\n minY = Math.min(minY, q);\n maxY = Math.max(maxY, q);\n }\n }\n }\n return [minX, minY, maxX, maxY];\n}\n\nfunction bboxBezier(x0, y0, x1, y1, x2, y2, x3, y3) {\n if(arguments.length === 4) {\n return [x0, y0, x1, y1];\n }\n if(arguments.length === 6) {\n return bboxBezier2(x0, y0, x1, y1, x2, y2);\n }\n if(arguments.length === 8) {\n return bboxBezier3(x0, y0, x1, y1, x2, y2, x3, y3);\n }\n}\n\n/**\n * 范数 or 模\n */\nfunction norm(v) {\n let order = v.length;\n let sum = v.reduce((a, b) => Math.pow(a, order) + Math.pow(b, order));\n return Math.pow(sum, 1 / order);\n}\n\nfunction simpson38(derivativeFunc, l, r) {\n let f = derivativeFunc;\n let middleL = (2 * l + r) / 3;\n let middleR = (l + 2 * r) / 3;\n return (f(l) + 3 * f(middleL) + 3 * f(middleR) + f(r)) * (r - l) / 8;\n}\n\n/**\n * bezier 曲线的长度\n * @param derivativeFunc 微分函数\n * @param l 左点\n * @param r 右点\n * @param eps 精度\n * @return {*} number\n */\nfunction adaptiveSimpson38(derivativeFunc, l, r, eps = 0.001) {\n let f = derivativeFunc;\n let mid = (l + r) / 2;\n let st = simpson38(f, l, r);\n let sl = simpson38(f, l, mid);\n let sr = simpson38(f, mid, r);\n let ans = sl + sr - st;\n if(Math.abs(ans) <= 15 * eps) {\n return sl + sr + ans / 15;\n }\n return adaptiveSimpson38(f, l, mid, eps / 2) + adaptiveSimpson38(f, mid, r, eps / 2);\n}\n\n/**\n * bezier 曲线的长度\n * @param points 曲线的起止点 和 控制点\n * @param order 阶次, 2 和 3\n * @param startT 计算长度的起点,满足 0 <= startT <= endT <= 1\n * @param endT 计算长度的终点\n * @return {*} number\n */\nfunction bezierLength(points, order, startT = 0, endT = 1) {\n let derivativeFunc = t => norm(at(t, points, order));\n return adaptiveSimpson38(derivativeFunc, startT, endT);\n}\n\n/**\n * 3 阶 bezier 曲线的 order 阶导数在 t 位置时候的 (x, y) 的值\n */\nfunction at3(t, points, order = 1) {\n let [p0, p1, p2, p3] = points;\n let [x0, y0] = p0;\n let [x1, y1] = p1;\n let [x2, y2] = p2;\n let [x3, y3] = p3;\n let x = 0;\n let y = 0;\n if(order === 0) {\n x = Math.pow((1 - t), 3) * x0 + 3 * t * Math.pow((1 - t), 2) * x1 + 3 * (1 - t) * Math.pow(t, 2) * x2 + Math.pow(t, 3) * x3;\n y = Math.pow((1 - t), 3) * y0 + 3 * t * Math.pow((1 - t), 2) * y1 + 3 * (1 - t) * Math.pow(t, 2) * y2 + Math.pow(t, 3) * y3;\n }\n else if(order === 1) {\n x = 3 * ((1 - t) * (1 - t) * (x1 - x0) + 2 * (1 - t) * t * (x2 - x1) + t * t * (x3 - x2));\n y = 3 * ((1 - t) * (1 - t) * (y1 - y0) + 2 * (1 - t) * t * (y2 - y1) + t * t * (y3 - y2));\n }\n else if(order === 2) {\n x = 6 * (x2 - 2 * x1 + x0) * (1 - t) + 6 * (x3 - 2 * x2 + x1) * t;\n y = 6 * (y2 - 2 * y1 + y0) * (1 - t) + 6 * (y3 - 2 * y2 + y1) * t;\n }\n else if(order === 3) {\n x = 6 * (x3 - 3 * x2 + 3 * x1 - x0);\n y = 6 * (y3 - 3 * y2 + 3 * y1 - y0);\n }\n else {\n // 3阶导数就是常数了,大于3阶的都是0\n x = 0;\n y = 0;\n }\n return [x, y];\n}\n\n/**\n * 2 阶 bezier 曲线的 order 阶导数在 t 位置时候的 (x, y) 的值\n */\nfunction at2(t, points, order = 1) {\n let [p0, p1, p2] = points;\n let [x0, y0] = p0;\n let [x1, y1] = p1;\n let [x2, y2] = p2;\n let x = 0;\n let y = 0;\n if(order === 0) {\n x = Math.pow((1 - t), 2) * x0 + 2 * t * (1 - t) * x1 + Math.pow(t, 2) * x2;\n y = Math.pow((1 - t), 2) * y0 + 2 * t * (1 - t) * y1 + Math.pow(t, 2) * y2;\n }\n else if(order === 1) {\n x = 2 * (1 - t) * (x1 - x0) + 2 * t * (x2 - x1);\n y = 2 * (1 - t) * (y1 - y0) + 2 * t * (y2 - y1);\n }\n else if(order === 2) {\n x = 2 * (x2 - 2 * x1 + x0);\n y = 2 * (y2 - 2 * y1 + y0);\n }\n else {\n x = 0;\n y = 0;\n }\n return [x, y];\n}\n\nfunction at(t, points, bezierOrder, derivativeOrder = 1) {\n if(bezierOrder === 2) {\n return at2(t, points, derivativeOrder);\n }\n else if(bezierOrder === 3) {\n return at3(t, points, derivativeOrder);\n }\n}\n\nfunction pointAtBezier(points, order, percent, maxIteration, eps) {\n let length = bezierLength(points, order, 0, 1);\n return pointAtBezierWithLength(points, order, length, percent, maxIteration, eps);\n}\n\nfunction pointAtBezierWithLength(points, order, length, percent = 1, maxIteration = 20, eps = 0.001) {\n let derivativeFunc = t => norm(at(t, points, order));\n let targetLen = length * percent;\n let approachLen = length;\n let approachT = percent;\n let preApproachT = approachT;\n for(let i = 0; i < maxIteration; i++) {\n approachLen = simpson38(derivativeFunc, 0, approachT);\n let d = approachLen - targetLen;\n if(Math.abs(d) < eps) {\n break;\n }\n // Newton 法\n let derivative1 = norm(at(approachT, points, order, 1)); // 1 阶导数\n let derivative2 = norm(at(approachT, points, order, 2)); // 2 阶导数\n let numerator = d * derivative1;\n let denominator = d * derivative2 + derivative1 * derivative1;\n approachT = approachT - numerator / denominator;\n if(Math.abs(approachT - preApproachT) < eps) {\n break;\n }\n else {\n preApproachT = approachT;\n }\n }\n return at(approachT, points, order, 0);\n}\n\nfunction sliceBezier(points, t) {\n let [[x1, y1], [x2, y2], [x3, y3], p4] = points;\n let x12 = (x2 - x1) * t + x1;\n let y12 = (y2 - y1) * t + y1;\n let x23 = (x3 - x2) * t + x2;\n let y23 = (y3 - y2) * t + y2;\n let x123 = (x23 - x12) * t + x12;\n let y123 = (y23 - y12) * t + y12;\n if(points.length === 4) {\n let [x4, y4] = p4;\n let x34 = (x4 - x3) * t + x3;\n let y34 = (y4 - y3) * t + y3;\n let x234 = (x34 - x23) * t + x23;\n let y234 = (y34 - y23) * t + y23;\n let x1234 = (x234 - x123) * t + x123;\n let y1234 = (y234 - y123) * t + y123;\n return [[x1, y1], [x12, y12], [x123, y123], [x1234, y1234]];\n }\n else if(points.length === 3) {\n return [[x1, y1], [x12, y12], [x123, y123]];\n }\n}\n\nfunction sliceBezier2Both(points, start = 0, end = 1) {\n start = Math.max(start, 0);\n end = Math.min(end, 1);\n if(start === 0 && end === 1) {\n return points;\n }\n if(end < 1) {\n points = sliceBezier(points, end);\n }\n if(start > 0) {\n if(end < 1) {\n start = start / end;\n }\n points = sliceBezier(points.reverse(), (1 - start)).reverse();\n }\n return points;\n}\n\nfunction pointOnCircle(x, y, r, deg) {\n if(deg >= 270) {\n deg -= 270;\n deg = d2r(deg);\n return [\n x - Math.cos(deg) * r,\n y - Math.sin(deg) * r,\n ];\n }\n else if(deg >= 180) {\n deg -= 180;\n deg = d2r(deg);\n return [\n x - Math.sin(deg) * r,\n y + Math.cos(deg) * r,\n ];\n }\n else if(deg >= 90) {\n deg -= 90;\n deg = d2r(deg);\n return [\n x + Math.cos(deg) * r,\n y + Math.sin(deg) * r,\n ];\n }\n else {\n deg = d2r(deg);\n return [\n x + Math.sin(deg) * r,\n y - Math.cos(deg) * r,\n ];\n }\n}\n\nexport default {\n pointInPolygon,\n pointInQuadrilateral,\n d2r,\n r2d,\n // 贝塞尔曲线模拟1/4圆弧比例\n H,\n // <90任意角度贝塞尔曲线拟合圆弧的比例公式\n h,\n angleBySide,\n sideByAngle,\n pointsDistance,\n triangleIncentre,\n ellipsePoints,\n sectorPoints,\n getRectsIntersection,\n isRectsOverlap,\n isRectsInside,\n calCoordsInNode,\n calPercentInNode,\n bboxBezier,\n bezierLength,\n pointAtBezier,\n pointAtBezierWithLength,\n sliceBezier,\n sliceBezier2Both,\n pointOnCircle,\n};\n","/**\n * @typedef {Object} gradientStatement\n * @property {Array} color - 颜色rgba,0~255,如 [0, 255, 0, 255]\n * @property {number} angle - 角度,0~2 * Math.PI,(originX, originY) 为原点,垂直向上为0\n */\n\n/**\n * 获取渐变图像像素数组\n * @param {number} originX - 渐变中心x坐标(相对图片左上角(0,0)的值,可在图片外,下同)\n * @param {number} originY - 渐变中心y坐标\n * @param {number} width - 图片宽度\n * @param {number} height - 图片高度\n * @param {Array} stop - 渐变声明列表\n * @param data - canvas的imgData.data\n * @returns {Array} 图像像素数组,每4个元素(rgba)构成一个像素点\n * @example\n // 矩形宽度为200*200,此时坐标为0~199,渐变中心为中点时,应传入99.5,可消除零点问题\n // 若渐变中心在某一整数轴上,就会引入零点问题,此时零点取y轴正半轴的色值,要消除这个问题,可以对渐变中心增加一个偏移量,使其不为整数\n let w = 200;\n let h = 200;\n let ctx = document.getElementById('example').getContext('2d');\n let imgData = ctx.getImageData(0,0, w, h);\n let data = getConicGradientImage(99.5, 99.5, w, h, [{\n color: [0,0,0,255],\n angle: 0,\n } ,{\n color: [255,0,0,255],\n angle: 2 * Math.PI,\n }]);\n for (let i = 0; i < imgData.data.length; i++) {\n imgData.data[i] = data[i];\n }\n ctx.putImageData(imgData, 0, 0);\n */\nfunction getConicGradientImage(\n originX,\n originY,\n width,\n height,\n stop,\n data\n) {\n if(stop.length < 2) {\n throw new Error(\n 'Conic gradient should recieve at least 2 gradient statements (start line and end line).'\n );\n }\n\n width = Math.floor(width);\n height = Math.floor(height);\n\n /**\n * 根据坐标获取角度\n * @param {number} x - x坐标,左上角为原点\n * @param {number} y - y坐标,左上角为原点\n * @returns {number} angle - 角度,0~2 * Math.PI,(originX, originY) 为原点,垂直向上为0\n */\n let getAngle = (x, y) => {\n // 此函数注释内的x、y轴基于 (originX, originY)\n // 计算相对 (originX, originY) 的坐标(dx, dy)\n let dx = x - originX;\n let dy = originY - y;\n // 在y轴上\n if(dx === 0) {\n return dy < 0\n ? // y轴负半轴,\n 1 * Math.PI\n : // y轴正半轴,因此,(originX, originY) 的angle视作0\n 0;\n }\n // 在x轴上\n if(dy === 0) {\n return dx < 0\n ? // x轴负半轴\n 1.5 * Math.PI\n : // x轴正半轴\n 0.5 * Math.PI;\n }\n let atan = Math.atan(dy / dx);\n /**\n * 2 | 1\n * -----|-----\n * 3 | 4\n */\n // 第一象限,atan > 0\n // 第四象限,atan < 0\n if(dx > 0) {\n return 0.5 * Math.PI - atan;\n }\n // 第二象限,atan < 0\n // 第三象限,atan > 0\n if(dx < 0) {\n return 1.5 * Math.PI - atan;\n }\n };\n\n let increasingList = stop.map(item => ({\n color: item[0],\n angle: item[1] * Math.PI * 2,\n }));\n\n for(let y = 0; y < height; y++) {\n for(let x = 0; x < width; x++) {\n // step 1. 找到当前点坐标相对 (originX, originY) 的角度\n let angle = getAngle(x, y);\n // step 2. 找到当前点坐标对应的渐变区间\n let j;\n for(j = 0; j < increasingList.length && increasingList[j].angle <= angle; j++) {\n }\n let start = increasingList[j - 1];\n let end = increasingList[j];\n if(!(start && end)) {\n // step 2-1. 不在渐变区间里\n continue;\n }\n // step 3. 计算色值并填充\n let factor = (angle - start.angle) / (end.angle - start.angle);\n let color = end.color.map(\n (v, idx) => factor * (v - start.color[idx]) + start.color[idx]\n );\n let i = (x + y * width) * 4;\n data[i] = color[0];\n data[i+1] = color[1];\n data[i+2] = color[2];\n data[i+3] = Math.min(255, color[3] * 255);\n }\n }\n return data;\n}\n\nexport default {\n getConicGradientImage,\n};\n","function canvasPolygon(ctx, list, dx = 0, dy = 0) {\n if(!list || !list.length) {\n return;\n }\n let start = -1;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item) && item.length) {\n start = i;\n break;\n }\n }\n if(start === -1) {\n return;\n }\n ctx.moveTo(list[start][0] + dx, list[start][1] + dy);\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n ctx.lineTo(item[0] + dx, item[1] + dy);\n }\n else if(item.length === 4) {\n ctx.quadraticCurveTo(item[0] + dx, item[1] + dy, item[2] + dx, item[3] + dy);\n }\n else if(item.length === 6) {\n ctx.bezierCurveTo(item[0] + dx, item[1] + dy, item[2] + dx, item[3] + dy, item[4] + dx, item[5] + dy);\n }\n }\n}\n\nfunction svgPolygon(list) {\n if(!list || !list.length) {\n return '';\n }\n let start = -1;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item) && item.length) {\n start = i;\n break;\n }\n }\n if(start === -1) {\n return '';\n }\n let s = 'M' + list[start][0] + ',' + list[start][1];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n s += 'L' + item[0] + ',' + item[1];\n }\n else if(item.length === 4) {\n s += 'Q' + item[0] + ',' + item[1] + ' ' + item[2] + ',' + item[3];\n }\n else if(item.length === 6) {\n s += 'C' + item[0] + ',' + item[1] + ' ' + item[2] + ',' + item[3] + ' ' + item[4] + ',' + item[5];\n }\n }\n return s;\n}\n\nfunction canvasLine(ctx, x1, y1, x2, y2, controlA, controlB, num, dx = 0, dy = 0) {\n ctx.moveTo(x1 + dx, y1 + dy);\n if(num === 3) {\n ctx.bezierCurveTo(controlA[0] + dx, controlA[1] + dy, controlB[0] + dx, controlB[1], x2 + dx, y2 + dy);\n return 2;\n }\n else if(num === 2) {\n ctx.quadraticCurveTo(controlB[0] + dx, controlB[1] + dy, x2 + dx, y2 + dy);\n return 2;\n }\n else if(num === 1) {\n ctx.quadraticCurveTo(controlA[0] + dx, controlA[1] + dy, x2 + dx, y2 + dy);\n return 2;\n }\n else {\n ctx.lineTo(x2 + dx, y2 + dy);\n return 1;\n }\n}\n\nfunction svgLine(x1, y1, x2, y2, controlA, controlB, num) {\n if(num === 3) {\n return 'M' + x1 + ',' + y1\n + 'C' + controlA[0] + ',' + controlA[1] + ' ' + controlB[0] + ',' + controlB[1]\n + ' ' + x2 + ',' + y2;\n }\n else if(num === 2) {\n return 'M' + x1 + ',' + y1\n + 'Q' + controlB[0] + ',' + controlB[1]\n + ' ' + x2 + ',' + y2;\n }\n else if(num === 1) {\n return 'M' + x1 + ',' + y1\n + 'Q' + controlA[0] + ',' + controlA[1]\n + ' ' + x2 + ',' + y2;\n }\n else {\n return 'M' + x1 + ',' + y1 + 'L' + x2 + ',' + y2;\n }\n}\n\nfunction canvasFilter(filter) {\n let s = '';\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n s += `blur(${v}px)`;\n }\n else if(k === 'hue-rotate') {\n s += `hue-rotate(${v}deg)`;\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'grayscale' || k === 'contrast' || k === 'sepia' || k === 'invert') {\n s += `${k}(${v}%)`;\n }\n });\n return s;\n}\n\nexport default {\n canvasPolygon,\n svgPolygon,\n canvasLine,\n svgLine,\n canvasFilter,\n svgFilter: canvasFilter,\n};\n","import geom from '../math/geom';\nimport mode from '../refresh/mode';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\nimport unit from './unit';\n\nconst { H } = geom;\nconst { PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\nconst {\n STYLE_KEY: {\n BORDER_LEFT_WIDTH,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n PADDING_LEFT,\n PADDING_BOTTOM,\n PADDING_TOP,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n FONT_SIZE,\n },\n} = enums;\n\n/* 获取合适的虚线实体空白宽度ps/pd和数量n\n * 总长total,start边长bs,end边长be,内容长w,\n * 实体长范围[smin,smax],空白长范围[dmin,dmax]\n */\nfunction calFitDashed(total, bs, be, w, smin, smax, dmin, dmax) {\n let n = 1;\n let ps = 1;\n let pd = 1;\n // 从最大实体空白长开始尝试\n outer:\n for(let i = smax; i >= smin; i--) {\n for(let j = dmax; j >= dmin; j--) {\n // 已知实体空白长度,n实体和n-1空白组成total,计算获取n数量\n let per = i + j;\n let num = Math.floor((total + j) / per);\n let k = j;\n // 可能除不尽,此时扩展空白长\n if(num * per < j + total) {\n let free = total - num * i;\n k = free / (num - 1);\n if(k > dmax) {\n continue;\n }\n }\n per = i + k;\n // bs比实体大才有效,因为小的话必定和第一个实体完整相连\n if(bs > 1 && bs > i) {\n let mo = bs % per;\n if(mo > i) {\n continue;\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n if(num > 0) {\n n = num;\n ps = i;\n pd = k;\n }\n break outer;\n }\n }\n return {\n n,\n ps,\n pd,\n };\n}\n\n// dashed时n个实线和n-1虚线默认以3:1宽度组成,dotted则是n和n以1:1组成\nfunction calDashed(style, m1, m2, m3, m4, bw) {\n let total = m4 - m1;\n let w = m3 - m2;\n let bs = m2 - m1;\n let be = m4 - m3;\n if(style === 'dotted') {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n else {\n let { n, ps, pd } = calFitDashed(total, bs, be, w, bw, bw * 3, Math.max(1, bw * 0.25), bw * 2);\n if(n === 1) {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n // 降级为dotted\n return { n, ps, pd };\n }\n}\n\n// 获取边框分割为几块的坐标,虚线分割为若干四边形、三边型、五边形\n// 三边形重复内外边交点形成四边形,五边形进行切割形成2个四边形\n// direction为上右下左0123\nfunction calPoints(borderWidth, borderStyle, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, direction, beginRadius, endRadius) {\n let points = [];\n if(borderStyle === 'none') {\n return points;\n }\n if(['dashed', 'dotted'].indexOf(borderStyle) > -1) {\n // 寻找一个合适的虚线线段长度和之间空白边距长度\n let { n, ps, pd } = (direction === 0 || direction === 2)\n ? calDashed(borderStyle, x1, x2, x3, x4, borderWidth)\n : calDashed(borderStyle, y1, y2, y3, y4, borderWidth);\n if(n > 1) {\n for(let i = 0; i < n; i++) {\n // 最后一个可能没有到底,延长之\n let isLast = i === n - 1;\n let main1;\n let main2;\n let cross1;\n let cross2;\n if(direction === 0 || direction === 2) {\n main1 = i ? (x1 + ps * i + pd * i) : x1;\n }\n else {\n main1 = i ? (y1 + ps * i + pd * i) : y1;\n }\n main2 = main1 + ps;\n if(direction === 0) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x4, y1],\n [x3, y2],\n [x2, y2]\n ]);\n }\n else {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n cross2 = y1 + (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y1 + (x4 - main1) * Math.tan(deg2);\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x4, y1],\n [main1, cross1]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross1]\n ]);\n if(isLast) {\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x2, y2]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross2],\n [x3, y2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y1],\n [main2, y1],\n [main2, y2],\n [x2, y2]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y1 + (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross2]\n ]);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y1],\n [x3, y1],\n [x3, y2],\n [main1, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x3, y2],\n [main1, y2]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, y2],\n [main1, y2]\n ]);\n }\n }\n }\n }\n else if(direction === 1) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n cross1 = x4 - (main1 - y1) * Math.tan(deg1);\n cross2 = x4 - (main2 - y1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2],\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x3 + (main1 - y3) * Math.tan(deg2);\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x3 + (main2 - y3) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross2, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, x4],\n [x4, x4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n }\n else if(direction === 2) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x3, y3],\n [x4, y4]\n ]);\n }\n else {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n cross2 = y4 - (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y4 - (x4 - main1) * Math.tan(deg2);\n cross2 = y4 - (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, cross1],\n [x4, y4],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y4 - (main2 - x3) * Math.tan(deg2);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [main2, cross2],\n [main2, y4],\n [x3, y4]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y3],\n [main2, y3],\n [main2, y4],\n [x2, y4]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y4 - (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y4 - (main1 - x3) * Math.tan(deg1);\n points.push([\n [main1, cross2],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y3],\n [x3, y3],\n [x3, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y3],\n [x3, y3],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, y3],\n [main2, y3],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n }\n }\n else if(direction === 3) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x2, y2],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n cross2 = x1 + (main2 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x1 + (y4 - main1) * Math.tan(deg2);\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [x1, main1],\n [cross1, main1],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [x2, y2],\n [x1, y2]\n ]);\n if(isLast) {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4],\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x1 + (y4 - main2) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross2, main1],\n [x2, y2],\n [x1, y1]\n ]);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n }\n }\n if(direction === 0) {\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n }\n }\n // 兜底返回实线\n if(direction === 0) {\n if(x2 > x1) {\n points.push([\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1, y1]\n ]);\n }\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n if(y2 > y1) {\n points.push([\n [x4, y1],\n [x4, y1],\n [x4, y2],\n [x3, y2]\n ]);\n }\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n if(x2 > x1) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x2, y4],\n [x1, y4]\n ]);\n }\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n if(y2 > y1) {\n points.push([\n [x1, y1],\n [x1, y1],\n [x2, y2],\n [x1, y2]\n ]);\n }\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n}\n\nfunction calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[1][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[0][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[1][0] > oxr && points[0][0] < oxl) {\n let ya = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, ya],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y1],\n [oxr, y1],\n [oxr, y2],\n [oxl, y2],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y1],\n [x3, y1],\n [x3, y2],\n [oxl, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [oxr, y1],\n [oxr, y2],\n [x2, y2],\n ]);\n }\n else {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n }\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, yb]\n ]);\n }\n // 跨越右圆角\n else if(points[1][0] > oxr) {\n let y = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n centerList.push([\n points[0],\n [oxr, y1],\n [oxr, y],\n points[3]\n ]);\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, y]\n ]);\n }\n // 跨越左圆角\n else if(points[0][0] < oxl) {\n let y = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, y],\n points[3]\n ]);\n centerList.push([\n [oxl, y1],\n points[1],\n points[2],\n [oxl, y],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y1 + bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierTopLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopLeft(points[0], points[1], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopLeft(points[3], points[2], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 0);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 0);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y1 + ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierTopRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopRight(points[0], points[1], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopRight(points[3], points[2], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 1);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 1);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierTopLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(p1x, p1y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(p2x, p2y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierTopRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (oy - p1y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy - Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy - Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (oy - p2y));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy - Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[2][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[1][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[2][1] > oyb && points[1][1] < oyt) {\n let xa = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n let xb = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [xa, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x3, oyt],\n [x4, oyt],\n [x4, oyb],\n [x3, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, oyb],\n [x3, oyb],\n ]);\n }\n else {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n }\n endList.push([\n [xb, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[2][1] > oyb) {\n let x = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n centerList.push([\n points[0],\n points[1],\n [x4, oyb],\n [x, oyb]\n ]);\n endList.push([\n [x, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [x, oyt]\n ]);\n centerList.push([\n [x, oyt],\n [x4, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x4 - brx;\n let rx2 = brx - (x4 - x3);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightTop(beginList[0][1], beginList[0][2], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierRightTop(beginList[0][0], beginList[0][3], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightTop(points[1], points[2], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightTop(points[0], points[3], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 2);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 2);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x4 - erx;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierRightBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightBottom(points[1], points[2], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightBottom(points[0], points[3], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 3);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 3);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierRightTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox + Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox + Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox + Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierRightBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[2][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[3][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[2][0] > oxr && points[3][0] < oxl) {\n let ya = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n beginList.push([\n points[0],\n [oxl, ya],\n [oxl, y4],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y3],\n [oxr, y3],\n [oxr, y4],\n [oxl, y4],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y3],\n [x3, y3],\n [x3, y4],\n [oxl, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [oxr, y3],\n [oxr, y4],\n [x2, y4],\n ]);\n }\n else {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n }\n endList.push([\n [oxr, yb],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越右圆角\n else if(points[2][0] > oxr) {\n let y = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n centerList.push([\n points[0],\n [oxr, y],\n [oxr, y4],\n points[3]\n ]);\n endList.push([\n [oxr, y],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越左圆角\n else if(points[3][0] < oxl) {\n let y = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y3;\n beginList.push([\n points[0],\n [oxl, y],\n [oxl, y4],\n points[3]\n ]);\n centerList.push([\n [oxl, y],\n points[1],\n points[2],\n [oxl, y4],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y4 - bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierBottomLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomLeft(points[3], points[2], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomLeft(points[0], points[1], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 4);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 4);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y4 - ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierBottomRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomRight(points[3], points[2], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomRight(points[0], points[1], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 5);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 5);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierBottomLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (p2y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy + Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy + Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (p1y - oy));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy + Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierBottomRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[3][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[0][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[3][1] > oyb && points[0][1] < oyt) {\n let xa = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n let xb = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n beginList.push([\n points[0],\n points[1],\n [xa, oyt],\n [x1, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, oyb],\n [x1, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, oyb],\n [x1, oyb],\n ]);\n }\n else {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n }\n endList.push([\n [x1, oyb],\n [xb, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[3][1] > oyb) {\n let x = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n centerList.push([\n points[0],\n points[1],\n [x, oyb],\n [x1, oyb]\n ]);\n endList.push([\n [x1, oyb],\n [x, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n beginList.push([\n points[0],\n points[1],\n [x, oyt],\n [x1, oyt]\n ]);\n centerList.push([\n [x1, oyt],\n [x, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x1 + brx;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftTop(beginList[0][0], beginList[0][3], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierLeftTop(beginList[0][1], beginList[0][2], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftTop(points[0], points[3], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftTop(points[1], points[2], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 6);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 6);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x1 + erx;\n let rx2 = erx - (x2 - x1);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierLeftBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftBottom(points[0], points[3], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftBottom(points[1], points[2], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 7);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 7);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierLeftTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierLeftBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox - Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox - Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox - Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\n/**\n * 简单计算椭圆的圆化坐标控制点,视作重合位置,外面判断backgroundClip并调整坐标\n * @param x 起始x\n * @param y 起始y\n * @param w 宽\n * @param h 高\n * @param btlr borderTopLeftRadius\n * @param btrr borderTopRightRadius\n * @param bbrr borderBottomRightRadius\n * @param bblr borderBottomLeftRadius\n * @returns {[]} 多边形的顶点和曲线控制点\n */\nfunction calRadius(x, y, w, h, btlr, btrr, bbrr, bblr) {\n let need;\n let [btlx, btly] = btlr;\n let [btrx, btry] = btrr;\n let [bbrx, bbry] = bbrr;\n let [bblx, bbly] = bblr;\n btlx = Math.max(btlx, 0);\n btly = Math.max(btly, 0);\n btrx = Math.max(btrx, 0);\n btry = Math.max(btry, 0);\n bbrx = Math.max(bbrx, 0);\n bbry = Math.max(bbry, 0);\n bblx = Math.max(bblx, 0);\n bbly = Math.max(bbly, 0);\n // 圆角必须x/y都>0才有效,否则视为不绘制\n if(btlx > 0 && btly > 0 || btrx > 0 && btry > 0 || bbrx > 0 && bbry > 0 || bblx > 0 && bbly > 0) {\n need = true;\n }\n if(need) {\n let list = [];\n if(btlx > 0 && btly > 0) {\n list.push([x, y + btly]);\n list.push([x, y + (btly) * (1 - H), x + btlx * (1 - H), y, x + btlx, y]);\n }\n else {\n list.push([x, y]);\n }\n if(btrx > 0 && btry > 0) {\n list.push([x + w - btrx, y]);\n list.push([x + w - btrx * (1 - H), y, x + w, y + btry * (1 - H), x + w, y + btry]);\n }\n else {\n list.push([x + w, y]);\n }\n if(bbrx > 0 && bbry > 0) {\n list.push([x + w, y + h - bbry]);\n list.push([x + w, y + h - bbry * (1 - H), x + w - bbrx * (1 - H), y + h, x + w - bbrx, y + h]);\n }\n else {\n list.push([x + w, y + h]);\n }\n if(bblx > 0 && bbly > 0) {\n list.push([x + bblx, y + h]);\n list.push([x + bblx * (1 - H), y + h, x, y + h - bbly * (1 - H), x, y + h - bbly]);\n }\n else {\n list.push([x, y + h]);\n }\n return list;\n }\n}\n\nfunction limit(points, x, y, direction) {\n if(direction === 0) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 1) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 2) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 3) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 4) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 5) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 6) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 7) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n}\n\nconst BR_KS = [BORDER_TOP_LEFT_RADIUS, BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS];\nfunction calBorderRadius(w, h, currentStyle, computedStyle, root) {\n let noRadius = true;\n BR_KS.forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n if(item[0] > 0) {\n noRadius = false;\n }\n else {\n return 0;\n }\n if(item[1] === PX) {\n return Math.max(0, item[0]);\n }\n else if(item[1] === PERCENT) {\n return Math.max(0, item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n return Math.max(0, item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n return Math.max(0, item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n return Math.max(0, item[0] * root.height * 0.01);\n }\n else if(item[1] === VMAX) {\n return Math.max(0, item[0] * Math.max(root.width, root.height) * 0.01);\n }\n else if(item[1] === VMIN) {\n return Math.max(0, item[0] * Math.min(root.width, root.height) * 0.01);\n }\n return 0;\n });\n });\n // 优化提前跳出\n if(noRadius) {\n return;\n }\n // radius限制,相交的2个之和不能超过边长,如果2个都超过中点取中点,只有1个超过取交点,这包含了单个不能超过总长的逻辑\n BR_KS.forEach((k, i) => {\n let j = i % 2 === 0 ? 0 : 1;\n let target = j ? h : w;\n let prev = computedStyle[k];\n let next = computedStyle[BR_KS[(i + 1) % 4]];\n // 相加超过边长则是相交\n if(prev[j] + next[j] > target) {\n let half = target * 0.5;\n // 都超过一半中点取中点\n if(prev[j] >= half && next[j] >= half) {\n prev[j] = next[j] = half;\n }\n // 仅1个超过中点,因相交用总长减去另一方即可\n else if(prev[j] > half) {\n prev[j] = target - next[j];\n }\n else if(next[j] > half) {\n next[j] = target - prev[j];\n }\n }\n });\n}\n\nfunction calBorderRadiusInline(contentBoxList, currentStyle, computedStyle) {\n let first, last;\n if(contentBoxList.length) {\n first = contentBoxList[0];\n last = contentBoxList[contentBoxList.length - 1]\n }\n // 先看first的左侧\n let w = first ? first.outerWidth : 0, h = first ? first.outerHeight : 0;\n w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT];\n h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH]\n + computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM];\n [BORDER_TOP_LEFT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS].forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n let v;\n if(item[1] === PX) {\n v = Math.max(0, item[0]);\n v = Math.min(i ? h : w, v);\n }\n else {\n v = Math.max(0, item[0] * (i ? h : w) * 0.01);\n v = Math.min(i ? h : w, v);\n }\n return v;\n });\n });\n // 再看end的右侧\n w = last ? last.outerWidth : 0;\n h = last ? last.outerHeight : 0;\n [BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS].forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n let v;\n if(item[1] === PX) {\n v = Math.max(0, item[0]);\n v = Math.min(i ? h : w, v);\n }\n else {\n v = Math.max(0, item[0] * (i ? h : w) * 0.01);\n v = Math.min(i ? h : w, v);\n }\n return v;\n });\n });\n}\n\nfunction renderBorder(xom, renderMode, ctx, points, color, dx, dy) {\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n points.forEach(point => {\n canvasPolygon(ctx, point, dx, dy);\n });\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let s = '';\n points.forEach(point => {\n s += svgPolygon(point);\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', s],\n ['fill', color],\n ],\n });\n }\n}\n\nexport default {\n calPoints,\n calRadius,\n calBorderRadius,\n calBorderRadiusInline,\n renderBorder,\n};\n","// 类型为引用防止json仿造\nconst TYPE_VD = Symbol('Dom');\nconst TYPE_GM = Symbol('Geom');\nconst TYPE_CP = Symbol('Component');\n\nexport default {\n TYPE_VD,\n TYPE_GM,\n TYPE_CP,\n};\n","import $$type from './$$type';\nimport mx from '../math/matrix';\n\nlet toString = {}.toString;\nfunction isType(type) {\n return function(obj) {\n return toString.call(obj) === '[object ' + type + ']';\n }\n}\n\nlet isObject = isType('Object');\nlet isString = isType('String');\nlet isFunction = isType('Function');\nlet isNumber = isType('Number');\nlet isBoolean = isType('Boolean');\nlet isDate = isType('Date');\n\nlet hasOwn = {}.hasOwnProperty;\nlet fnToString = hasOwn.toString;\nlet ObjectFunctionString = fnToString.call(Object);\n\nfunction isNil(v) {\n return v === undefined || v === null;\n}\n\nfunction joinSourceArray(arr) {\n let res = '';\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n res += joinSourceArray(item);\n }\n else {\n res += stringify(item);\n }\n }\n return res;\n}\n\nfunction stringify(s) {\n if(isNil(s)) {\n return '';\n }\n return s.toString();\n}\n\nfunction encodeHtml(s, prop) {\n if(prop) {\n return s.replace(/\"/g, '"');\n }\n return s.replace(/&/g, '&').replace(/ {\n 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(typeof location === 'undefined' || location.hostname !== host[1]) {\n img.crossOrigin = 'anonymous';\n }\n }\n }\n img.src = url;\n if(debug.flag && typeof document !== 'undefined') {\n document.body.appendChild(img);\n }\n }\n },\n warn(s) {\n console.warn(s);\n },\n error(s) {\n console.error(s);\n },\n requestAnimationFrame(cb) {\n if(!cb) {\n return;\n }\n let res;\n if(typeof requestAnimationFrame !== 'undefined') {\n inject.requestAnimationFrame = requestAnimationFrame.bind(window);\n res = requestAnimationFrame(cb);\n }\n else {\n res = setTimeout(cb, SPF);\n inject.requestAnimationFrame = function(cb) {\n return setTimeout(cb, SPF);\n };\n }\n return res;\n },\n cancelAnimationFrame(id) {\n let res;\n if(typeof cancelAnimationFrame !== 'undefined') {\n inject.cancelAnimationFrame = cancelAnimationFrame.bind(window);\n res = cancelAnimationFrame(id);\n }\n else {\n res = clearTimeout(id);\n inject.cancelAnimationFrame = function(id) {\n return clearTimeout(id);\n };\n }\n return res;\n },\n now() {\n if(typeof performance !== 'undefined') {\n inject.now = function() {\n return Math.floor(performance.now());\n };\n return Math.floor(performance.now());\n }\n inject.now = Date.now.bind(Date);\n return Date.now();\n },\n hasCacheCanvas(key) {\n return key && CANVAS.hasOwnProperty(key);\n },\n getCacheCanvas(width, height, key, message) {\n return cacheCanvas(key, width, height, message);\n },\n releaseCacheCanvas(o) {\n CANVAS_LIST.push(o);\n },\n delCacheCanvas(key) {\n key && delete CANVAS[key];\n },\n hasCacheWebgl(key) {\n return key && WEBGL.hasOwnProperty(key);\n },\n getCacheWebgl(width, height, key, message) {\n return cacheWebgl(key, width, height, message);\n },\n releaseCacheWebgl(o) {\n WEBGL_LIST.push(o);\n },\n delCacheWebgl(key) {\n key && delete WEBGL[key];\n },\n isDom(o) {\n if(o) {\n if(util.isString(o)) {\n return true;\n }\n if(typeof window !== 'undefined' && window.Element && (o instanceof window.Element)) {\n return true;\n }\n if(typeof window !== 'undefined' && window.OffscreenCanvas && (o instanceof window.OffscreenCanvas)) {\n return true;\n }\n // worker\n if(typeof self !== 'undefined' && self.OffscreenCanvas && (o instanceof self.OffscreenCanvas)) {\n return true;\n }\n if(util.isFunction(o.getElementsByTagName)) {\n return true;\n }\n }\n return false;\n },\n isWebGLTexture(o) {\n if(o && typeof WebGLTexture !== 'undefined') {\n return o instanceof WebGLTexture;\n }\n },\n checkSupportFontFamily(ff) {\n ff = ff.toLowerCase();\n // 强制arial兜底\n if(ff === 'arial' || ff === 'serif' || ff === 'sans-serif' || ff === 'sansserif') {\n return true;\n }\n if(!font.info.hasOwnProperty(ff)) {\n return false;\n }\n if(font.info[ff].hasOwnProperty('checked')) {\n return font.info[ff].checked;\n }\n let canvas = inject.getCacheCanvas(16, 16, '__$$CHECK_SUPPORT_FONT_FAMILY$$__');\n let context = canvas.ctx;\n context.textAlign = 'center';\n context.fillStyle = '#000';\n context.textBaseline = 'middle';\n if(!defaultFontFamilyData) {\n context.clearRect(0, 0, 16, 16);\n context.font = '16px arial';\n context.fillText('a', 8, 8);\n canvas.draw();\n defaultFontFamilyData = context.getImageData(0, 0, 16, 16).data;\n }\n context.clearRect(0, 0, 16, 16);\n context.font = '16px ' + ff;\n context.fillText('a', 8, 8);\n canvas.draw();\n let data = context.getImageData(0, 0, 16, 16).data;\n for(let i = 0, len = data.length; i < len; i++) {\n if(defaultFontFamilyData[i] !== data[i]) {\n return font.info[ff].checked = true;\n }\n }\n return font.info[ff].checked = false;\n },\n loadFont(fontFamily, url, cb) {\n if(util.isFunction(url)) {\n cb = url;\n url = fontFamily;\n }\n if(Array.isArray(url)) {\n if(!url.length) {\n return cb();\n }\n let count = 0;\n let len = url.length;\n let list = [];\n url.forEach((item, i) => {\n inject.loadFont(item.fontFamily, item.url, function(cache) {\n list[i] = cache;\n if(++count === len) {\n cb(list);\n }\n });\n });\n return;\n }\n else if(!url || !util.isString(url)) {\n inject.error('Load font invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\n }\n if(!fontFamily) {\n fontFamily = url;\n }\n let cache = FONT[url] = FONT[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb && cb(cache);\n }\n else if(cache.state === LOADING) {\n cb && cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cb && cache.task.push(cb);\n if(!/url\\(/.test(url)) {\n url = `url(${url})`;\n }\n let f = new FontFace(fontFamily, url);\n f.load().then(function() {\n document.fonts.add(f);\n cache.state = LOADED;\n cache.success = true;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n }).catch(function() {\n cache.state = LOADED;\n cache.success = false;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n });\n }\n },\n loadComponent(url, cb) {\n if(Array.isArray(url)) {\n if(!url.length) {\n return cb();\n }\n let count = 0;\n let len = url.length;\n let list = [];\n url.forEach((item, i) => {\n inject.loadComponent(item, function(cache) {\n list[i] = cache;\n if(++count === len) {\n cb(list);\n }\n });\n });\n return;\n }\n else if(!url || !util.isString(url)) {\n inject.error('Load component invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\n }\n let cache = COMPONENT[url] = COMPONENT[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb && cb(cache);\n }\n else if(cache.state === LOADING) {\n cb && cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cb && cache.task.push(cb);\n let script = document.createElement('script');\n script.src = url;\n script.async = true;\n script.onload = function() {\n cache.state = LOADED;\n cache.success = true;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n document.head.removeChild(script);\n };\n script.onerror = function() {\n cache.state = LOADED;\n cache.success = false;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n document.head.removeChild(script);\n };\n document.head.appendChild(script);\n }\n },\n};\n\nexport default inject;\n","import unit from './unit';\nimport reg from './reg';\nimport geom from '../math/geom';\nimport vector from '../math/vector';\nimport mx from '../math/matrix';\nimport gradient from '../math/gradient';\nimport border from './border';\nimport mode from '../refresh/mode';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\nimport inject from '../util/inject';\n\nconst { rgba2int, isNil } = util;\nconst { PX, PERCENT, DEG, NUMBER, REM, VW, VH, VMAX, VMIN, calUnit } = unit;\nconst { d2r } = geom;\nconst { canvasPolygon, svgPolygon } = painter;\nconst {\n STYLE_KEY: {\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\n\nfunction getLinearDeg(v) {\n let deg = 180;\n if(v === 'to top') {\n deg = 0;\n }\n else if(v === 'to top right') {\n deg = 45;\n }\n else if(v === 'to right') {\n deg = 90;\n }\n else if(v === 'to bottom right') {\n deg = 135;\n }\n else if(v === 'to bottom') {\n }\n else if(v === 'to bottom left') {\n deg = 225;\n }\n else if(v === 'to left') {\n deg = 270;\n }\n else if(v === 'to top left') {\n deg = 315;\n }\n // 数字角度,没有的话取默认角度\n else {\n let match = /([-+]?[\\d.]+)deg/.exec(v);\n if(match) {\n deg = parseFloat(match[1]);\n }\n }\n return deg % 360;\n}\n\nfunction getRadialPosition(data) {\n if(/^[-+]?[\\d.]/.test(data)) {\n let v = calUnit(data);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[data] || 50,\n PERCENT,\n ];\n }\n}\n\n// 获取color-stop区间范围,去除无用值\nfunction getColorStop(v, length, root) {\n let list = [];\n let firstColor = v[0][0];\n // 先把已经声明距离的换算成[0,1]以数组形式存入,未声明的原样存入\n for(let i = 0, len = v.length; i < len; i++) {\n let item = v[i];\n // 考虑是否声明了位置\n if(item.length > 1) {\n let p = item[1];\n if(p[1] === PERCENT) {\n list.push([item[0], p[0] * 0.01]);\n }\n else if(p[1] === REM) {\n list.push([item[0], p[0] * root.computedStyle[FONT_SIZE] / length]);\n }\n else if(p[1] === VW) {\n list.push([item[0], p[0] * root.width / length]);\n }\n else if(p[1] === VH) {\n list.push([item[0], p[0] * root.height / length]);\n }\n else if(p[1] === VMAX) {\n list.push([item[0], p[0] * Math.max(root.width, root.height) / length]);\n }\n else if(p[1] === VMIN) {\n list.push([item[0], p[0] * Math.min(root.width, root.height) / length]);\n }\n else {\n list.push([item[0], p[0] / length]);\n }\n }\n else {\n list.push([item[0]]);\n }\n }\n if(list.length === 1) {\n list.push(util.clone(list[0]));\n }\n // 首尾不声明默认为[0, 1]\n if(list[0].length === 1) {\n list[0].push(0);\n }\n if(list.length > 1) {\n let i = list.length - 1;\n if(list[i].length === 1) {\n list[i].push(1);\n }\n }\n // 找到未声明位置的,需区间计算,找到连续的未声明的,前后的区间平分\n let start = list[0][1];\n for(let i = 1, len = list.length; i < len - 1; i++) {\n let item = list[i];\n if(item.length > 1) {\n start = item[1];\n }\n else {\n let j = i + 1;\n let end = list[list.length - 1][1];\n for(; j < len - 1; j++) {\n let item = list[j];\n if(item.length > 1) {\n end = item[1];\n break;\n }\n }\n let num = j - i + 1;\n let per = (end - start) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.push(start + per * (k + 1 - i));\n }\n i = j;\n }\n }\n // 每个不能小于前面的,canvas/svg不能兼容这种情况,需处理\n for(let i = 1, len = list.length; i < len; i++) {\n let item = list[i];\n let prev = list[i - 1];\n if(item[1] < prev[1]) {\n item[1] = prev[1];\n }\n }\n // 0之前的和1之后的要过滤掉\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item[1] > 1) {\n list.splice(i);\n let prev = list[i - 1];\n if(prev && prev[1] < 1) {\n let dr = item[0][0] - prev[0][0];\n let dg = item[0][1] - prev[0][1];\n let db = item[0][2] - prev[0][2];\n let da = item[0][3] - prev[0][3];\n let p = (1 - prev[1]) / (item[1] - prev[1]);\n list.push([\n [\n item[0][0] + dr * p,\n item[0][1] + dg * p,\n item[0][2] + db * p,\n item[0][3] + da * p,\n ],\n 1],\n );\n }\n break;\n }\n }\n for(let i = list.length - 1; i >= 0; i--) {\n let item = list[i];\n if(item[1] < 0) {\n list.splice(0, i + 1);\n let next = list[i];\n if(next && next[1] > 0) {\n let dr = next[0][0] - item[0][0];\n let dg = next[0][1] - item[0][1];\n let db = next[0][2] - item[0][2];\n let da = next[0][3] - item[0][3];\n let p = (-item[1]) / (next[1] - item[1]);\n list.unshift([\n [\n item[0][0] + dr * p,\n item[0][1] + dg * p,\n item[0][2] + db * p,\n item[0][3] + da * p,\n ],\n 0],\n );\n }\n break;\n }\n }\n // 可能存在超限情况,如在使用px单位超过len或 {\n // item[0] = int2rgba(item[0]);\n if(item[1] < 0) {\n item[1] = 0;\n }\n else if(item[1] > 1) {\n item[1] = 1;\n }\n });\n // 都超限时,第一个颜色兜底\n if(!list.length) {\n list.push([firstColor, 0]);\n }\n return list;\n}\n\n// 根据角度和圆心获取渐变的4个点坐标\nfunction calLinearCoords(deg, length, cx, cy) {\n let x0;\n let y0;\n let x1;\n let y1;\n if(deg >= 270) {\n let r = d2r(360 - deg);\n x0 = cx + Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n else if(deg >= 180) {\n let r = d2r(deg - 180);\n x0 = cx + Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else if(deg >= 90) {\n let r = d2r(180 - deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else {\n let r = d2r(deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n return [x0, y0, x1, y1];\n}\n\nfunction calCircleCentre(position, x1, y1, iw, ih, root) {\n let cx, cy;\n let positionX = position[0], positionY = position[1];\n if(positionX[1] === PERCENT) {\n cx = x1 + positionX[0] * iw * 0.01;\n }\n else if(positionX[1] === REM) {\n cx = x1 + positionX[0] * root.computedStyle[FONT_SIZE];\n }\n else if(positionX[1] === VW) {\n cx = x1 + positionX[0] * root.width * 0.01;\n }\n else if(positionX[1] === VH) {\n cx = x1 + positionX[0] * root.height * 0.01;\n }\n else if(positionX[1] === VMAX) {\n cx = x1 + positionX[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(positionX[1] === VMIN) {\n cx = x1 + positionX[0] * Math.min(root.width, root.height) * 0.01;\n }\n else {\n cx = x1 + positionX[0];\n }\n if(positionY[1] === PERCENT) {\n cy = y1 + positionY[0] * ih * 0.01;\n }\n else if(positionY[1] === REM) {\n cy = y1 + positionY[0] * root.computedStyle[FONT_SIZE];\n }\n else if(positionY[1] === VW) {\n cy = y1 + positionY[0] * root.width * 0.01;\n }\n else if(positionY[1] === VH) {\n cy = y1 + positionY[0] * root.height * 0.01;\n }\n else if(positionY[1] === VH) {\n cy = y1 + positionY[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(positionY[1] === VH) {\n cy = y1 + positionY[0] * Math.min(root.width, root.height) * 0.01;\n }\n else {\n cy = y1 + positionY[0];\n }\n return [cx, cy];\n}\n\n// 获取径向渐变圆心半径\nfunction calRadialRadius(shape, size, position, iw, ih, x1, y1, x2, y2, root) {\n let cx, cy, xl, yl, r, tx, ty, d = 0;\n // 扩展的from to ratio格式,圆心、长轴坐标、短轴缩放比\n if(Array.isArray(size)) {\n cx = x1 + size[0] * iw;\n cy = y1 + size[1] * ih;\n tx = x1 + size[4] * iw;\n ty = y1 + size[5] * ih;\n if(size[6] <= 0) {\n r = Math.min(Math.abs(cx - x1), Math.min(Math.abs(cy - y1), Math.min(Math.abs(cy - y2), Math.min(Math.abs(cx - y2)))));\n }\n else {\n xl = Math.sqrt(Math.pow((size[2] - size[0]) * iw, 2) + Math.pow((size[3] - size[1]) * ih, 2));\n yl = xl * size[6];\n r = Math.max(xl, yl);\n // 看旋转\n if(xl !== yl) {\n if(size[2] >= size[0]) {\n if(size[3] >= size[1]) {\n d = Math.asin((size[3] - size[1]) * ih / xl);\n }\n else {\n d = -Math.asin((size[1] - size[3]) * ih / xl);\n }\n }\n else {\n if(size[3] >= size[1]) {\n d = d2r(180) - Math.asin((size[3] - size[1]) * ih / xl);\n }\n else {\n d = Math.asin((size[1] - size[3]) * ih / xl) - d2r(180);\n }\n }\n }\n }\n }\n else {\n // 默认椭圆a是水平轴,b是垂直轴\n [cx, cy] = calCircleCentre(position, x1, y1, iw, ih, root);\n tx = cx;\n ty = cy;\n let ratio = 1;\n if(size === 'closest-corner' && shape === 'circle') {\n if(cx <= x1 || cx >= x2 || cy <= y1 || cy >= y2) {\n r = Math.min(Math.abs(cx - x1), Math.min(Math.abs(cy - y1), Math.min(Math.abs(cy - y2), Math.min(Math.abs(cx - y2)))));\n }\n else {\n if(cx < x1 + iw * 0.5) {\n xl = cx - x1;\n }\n else {\n xl = x2 - cx;\n }\n if(cy < y1 + ih * 0.5) {\n yl = cy - y1;\n }\n else {\n yl = y2 - cy;\n }\n r = Math.sqrt(Math.pow(xl, 2) + Math.pow(yl, 2));\n }\n }\n else if(size === 'closest-side' || size === 'closest-corner') {\n // 在边外特殊情况只有end颜色填充\n if(cx <= x1 || cx >= x2 || cy <= y1 || cy >= y2) {\n r = Math.min(Math.abs(cx - x1), Math.min(Math.abs(cy - y1), Math.min(Math.abs(cy - y2), Math.min(Math.abs(cx - y2)))));\n }\n else {\n let ratio = 1;\n if(cx < x1 + iw * 0.5) {\n xl = cx - x1;\n }\n else {\n xl = x2 - cx;\n }\n if(cy < y1 + ih * 0.5) {\n yl = cy - y1;\n }\n else {\n yl = y2 - cy;\n }\n r = Math.min(xl, yl);\n // css的角和边有对应关系,即边扩展倍数,计算为固定值\n if(size === 'closest-corner') {\n ratio = Math.sqrt(2);\n }\n xl *= ratio;\n yl *= ratio;\n r *= ratio;\n }\n }\n else {\n if(cx <= x1) {\n xl = x1 - cx + iw;\n }\n else if(cx >= x2) {\n xl = cx - x2 + iw;\n }\n else if(cx < x1 + iw * 0.5) {\n xl = x2 - cx;\n }\n else {\n xl = cx - x1;\n }\n if(cy <= y1) {\n yl = y1 - cy + ih;\n }\n else if(cy >= y2) {\n yl = cy - y2 + ih;\n }\n else if(cy < y1 + ih * 0.5) {\n yl = y2 - cy;\n }\n else {\n yl = cy - y1;\n }\n r = Math.max(xl, yl);\n if(size !== 'farthest-side') {\n ratio = Math.sqrt(2);\n }\n xl *= ratio;\n yl *= ratio;\n r *= ratio;\n }\n }\n if(shape === 'circle') {\n xl = yl = r;\n }\n return [cx, cy, r, xl, yl, tx, ty, d];\n}\n\nfunction parseGradient(s) {\n let gradient = reg.gradient.exec(s);\n if(gradient) {\n let o = {\n k: gradient[1],\n };\n if(o.k === 'linear') {\n let deg = /([-+]?[\\d.]+deg)|(to\\s+[toprighbml]+)/i.exec(gradient[2]);\n if(deg) {\n o.d = getLinearDeg(deg[0].toLowerCase());\n }\n // 扩展支持从a点到b点相对坐标,而不是css角度,sketch等ui软件中用此格式\n else {\n let points = /([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)/.exec(gradient[2]);\n if(points) {\n o.d = [parseFloat(points[1]), parseFloat(points[2]), parseFloat(points[3]), parseFloat(points[4])];\n }\n else {\n o.d = 180;\n }\n }\n }\n else if(o.k === 'radial') {\n o.s = gradient[2].indexOf('circle') > -1 ? 'circle' : 'ellipse';\n let size = /(closest|farthest)-(side|corner)/i.exec(gradient[2]);\n if(size) {\n o.z = size[0].toLowerCase();\n }\n // 扩展支持从a点到b点相对坐标,而不是size,sketch等ui软件中用此格式\n else {\n let points = /([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)\\s+([-+]?[\\d.]+)(?:\\s+([-+]?[\\d.]+))?(?:\\s+([-+]?[\\d.]+))?(?:\\s+([-+]?[\\d.]+))?/.exec(gradient[2]);\n if(points) {\n o.z = [parseFloat(points[1]), parseFloat(points[2]), parseFloat(points[3]), parseFloat(points[4])];\n let i5 = !isNil(points[5]), i6 = !isNil(points[6]), i7 = !isNil(points[7]);\n // 重载,567是偏移x/y和ratio,都可省略即不偏移和半径1,只有5是ratio,只有56是x/y\n if(i5 && i6 && i7) {\n o.z.push(parseFloat(points[5]));\n o.z.push(parseFloat(points[6]));\n o.z.push(parseFloat(points[7]));\n }\n else if(i5 && i6) {\n o.z.push(parseFloat(points[5]));\n o.z.push(parseFloat(points[6]));\n o.z.push(1);\n }\n else if(i5) {\n o.z.push(o.z[0]);\n o.z.push(o.z[1]);\n o.z.push(parseFloat(points[5]));\n }\n else {\n o.z.push(o.z[0]);\n o.z.push(o.z[1])\n o.z.push(1);\n }\n }\n else {\n o.z = 'farthest-corner';\n }\n }\n let position = /at\\s+((?:[-+]?[\\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]);\n if(position) {\n let x = getRadialPosition(position[1]);\n let y = position[2] ? getRadialPosition(position[2]) : x;\n o.p = [x, y];\n }\n else {\n o.p = [[50, PERCENT], [50, PERCENT]];\n }\n }\n else if(o.k === 'conic') {\n let deg = /([-+]?[\\d.]+deg)/i.exec(gradient[2]);\n if(deg) {\n o.d = parseFloat(deg[0]) % 360;\n }\n else {\n o.d = 0;\n }\n let position = /at\\s+((?:[-+]?[\\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]);\n if(position) {\n let x = getRadialPosition(position[1]);\n let y = position[2] ? getRadialPosition(position[2]) : x;\n o.p = [x, y];\n }\n else {\n o.p = [[50, PERCENT], [50, PERCENT]];\n }\n }\n let v = gradient[2].match(/(([-+]?[\\d.]+[pxremvwhina%]+)?\\s*((#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))\\s*([-+]?[\\d.]+[pxremvwhina%]+)?)|(transparent)/ig) || [];\n o.v = v.map(item => {\n let color = /(?:#[0-9a-f]{3,8})|(?:rgba?\\s*\\(.+?\\))|(?:transparent)/i.exec(item);\n let arr = [rgba2int(color[0])];\n let percent = /[-+]?[\\d.]+[pxremvwhina%]+/.exec(item);\n if(percent) {\n let v = calUnit(percent[0]);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n arr[1] = v;\n }\n return arr;\n });\n return o;\n }\n}\n\nfunction getLinear(v, d, ox, oy, cx, cy, w, h, root, dx = 0, dy = 0) {\n ox += dx;\n oy += dy;\n cx += dx;\n cy += dy;\n // d为数组是2个坐标点,数字是css标准角度\n let x1, y1, x2, y2, stop;\n if(Array.isArray(d)) {\n x1 = ox + d[0] * w;\n y1 = oy + d[1] * h;\n x2 = ox + d[2] * w;\n y2 = oy + d[3] * h;\n let total = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n stop = getColorStop(v, total);\n }\n else {\n while(d >= 360) {\n d -= 360;\n }\n while(d < 0) {\n d += 360;\n }\n // 根据角度求直线上2点,设置半径为长宽最大值,这样一定在矩形外,看做一个向量A\n let len = Math.max(w, h);\n let coords = calLinearCoords(d, len, cx, cy, w, h);\n len *= 2;\n // start和4个顶点的向量在A上的投影长度\n let l1 = vector.dotProduct(ox - coords[0], oy - coords[1], coords[2] - coords[0], coords[3] - coords[1]) / len;\n let l2 = vector.dotProduct(ox + w - coords[0], oy - coords[1], coords[2] - coords[0], coords[3] - coords[1]) / len;\n let l3 = vector.dotProduct(ox + w - coords[0], oy + h - coords[1], coords[2] - coords[0], coords[3] - coords[1]) / len;\n let l4 = vector.dotProduct(ox - coords[0], oy + h - coords[1], coords[2] - coords[0], coords[3] - coords[1]) / len;\n // 最小和最大值为0~100%\n let min = l1, max = l1;\n min = Math.min(min, Math.min(l2, Math.min(l3, l4)));\n max = Math.max(max, Math.max(l2, Math.max(l3, l4)));\n // 求得0和100%的长度和坐标\n let total = max - min;\n let r1 = min / len;\n let dx = coords[2] - coords[0];\n let dy = coords[3] - coords[1];\n x1 = coords[0] + dx * r1;\n y1 = coords[1] + dy * r1;\n x2 = coords[2] - dx * r1;\n y2 = coords[3] - dy * r1;\n stop = getColorStop(v, total, root);\n }\n return {\n x1,\n y1,\n x2,\n y2,\n stop,\n };\n}\n\nfunction getRadial(v, shape, size, position, x1, y1, x2, y2, root) {\n let w = x2 - x1;\n let h = y2 - y1;\n let [cx, cy, r, xl, yl, tx, ty, d] = calRadialRadius(shape, size, position, w, h, x1, y1, x2, y2, root);\n // 圆形取最小值,椭圆根据最小圆进行transform,椭圆其中一边轴和r一样,另一边则大小缩放可能\n let matrix, scx = 1, scy = 1;\n if(xl !== yl || d) {\n matrix = [1, 0, 0, 1, 0, 0];\n if(d) {\n let sin = Math.sin(d);\n let cos = Math.cos(d);\n matrix = [cos, sin, 0, 0, -sin, cos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n }\n if(xl !== r) {\n scx = xl / r;\n let m = [scx, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n matrix = mx.multiply(matrix, m);\n }\n if(yl !== r) {\n scy = yl / r;\n let m = [1, 0, 0, 0, 0, scy, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n matrix = mx.multiply(matrix, m);\n }\n }\n let stop = getColorStop(v, r, root);\n return {\n cx,\n cy,\n tx,\n ty,\n r,\n stop,\n scx,\n scy,\n matrix,\n d,\n };\n}\n\nfunction getConic(v, d, p, x1, y1, x2, y2, ratio, root) {\n let [cx, cy, r, deg] = calConicRadius(v, d, p, x1, y1, x2, y2, root);\n let stop = getColorStop(v, 1, root);\n r <<= 1; // 锥形半径*2,这样分割画圆时保证一定会填满原有矩形\n r *= ratio; // 矢量图形比较特殊,有可能超限,传入个倍数扩大半径\n return {\n cx,\n cy,\n w: x2 - x1,\n h: y2 - y1,\n r,\n deg,\n stop,\n };\n}\n\nfunction calConicRadius(v, deg, position, x1, y1, x2, y2, root) {\n let iw = x2 - x1;\n let ih = y2 - y1;\n let [cx, cy] = calCircleCentre(position, x1, y1, iw, ih, root);\n let r, a, b;\n if(cx >= x1 + iw * 0.5) {\n a = cx - x1;\n }\n else {\n a = x2 - cx;\n }\n if(cy >= y1 + ih * 0.5) {\n b = cy - y1;\n }\n else {\n b = y2 - cy;\n }\n r = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n return [cx, cy, r, deg];\n}\n\nfunction renderConic(xom, renderMode, ctx, res, x, y, w, h, btlr, btrr, bbrr, bblr, isInline) {\n // border-radius使用三次贝塞尔曲线模拟1/4圆角,误差在[0, 0.000273]之间\n let list = border.calRadius(x, y, w, h, btlr, btrr, bbrr, bblr);\n if(!list) {\n list = [\n [x, y],\n [x + w, y],\n [x + w, y + h],\n [x, y + h],\n [x, y],\n ];\n }\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n let offscreen = inject.getCacheCanvas(w, h, '__$$CONIC_GRADIENT$$__');\n let imgData = offscreen.ctx.getImageData(0,0, w, h);\n gradient.getConicGradientImage(res.cx - x, res.cy - y, res.w, res.h, res.stop, imgData.data);\n offscreen.ctx.putImageData(imgData, 0, 0);\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(offscreen.canvas, x, y);\n ctx.restore();\n offscreen.ctx.clearRect(0, 0, w, h);\n }\n else if(renderMode === mode.SVG) {\n if(isInline) {\n let v = {\n tagName: 'symbol',\n props: [],\n children: [],\n };\n xom.__config[NODE_DEFS_CACHE].push(v);\n res.forEach(item => {\n v.children.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(item[0])],\n ['fill', item[1]],\n ],\n });\n });\n return ctx.add(v);\n }\n else {\n let v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(list)],\n ],\n }],\n };\n xom.__config[NODE_DEFS_CACHE].push(v);\n let clip = ctx.add(v);\n res.forEach(item => {\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(item[0])],\n ['fill', item[1]],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n });\n }\n }\n}\n\nexport default {\n parseGradient,\n getLinear,\n getRadial,\n getConic,\n renderConic,\n};\n","const DOM = {\n position: 'static',\n display: 'block',\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto',\n marginTop: 0,\n marginRight: 0,\n marginBottom: 0,\n marginLeft: 0,\n paddingTop: 0,\n paddingRight: 0,\n paddingBottom: 0,\n paddingLeft: 0,\n fontSize: 'inherit',\n fontFamily: 'inherit',\n color: 'inherit',\n fontStyle: 'inherit',\n fontWeight: 'inherit',\n lineHeight: 'inherit',\n backgroundImage: null,\n backgroundColor: 'transparent',\n backgroundSize: 'auto',\n backgroundRepeat: 'repeat',\n backgroundPositionX: 0,\n backgroundPositionY: 0,\n backgroundClip: 'borderBox',\n borderTopWidth: 0,\n borderRightWidth: 0,\n borderBottomWidth: 0,\n borderLeftWidth: 0,\n borderTopColor: 'transparent',\n borderRightColor: 'transparent',\n borderBottomColor: 'transparent',\n borderLeftColor: 'transparent',\n borderTopStyle: 'none',\n borderRightStyle: 'none',\n borderBottomStyle: 'none',\n borderLeftStyle: 'none',\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomLeftRadius: 0,\n width: 'auto',\n height: 'auto',\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto',\n flexDirection: 'row',\n flexWrap: 'nowrap',\n order: 0,\n justifyContent: 'flexStart',\n alignItems: 'stretch',\n alignSelf: 'auto',\n alignContent: 'stretch',\n textAlign: 'inherit',\n letterSpacing: 'inherit',\n transformOrigin: 'center',\n visibility: 'inherit',\n opacity: 1,\n zIndex: 0,\n transform: null,\n translateX: 0,\n translateY: 0,\n translateZ: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n skewX: 0,\n skewY: 0,\n rotateX: 0,\n rotateY: 0,\n rotateZ: 0,\n rotate3d: '0, 0, 0, 0',\n perspective: 0,\n perspectiveOrigin: 'center',\n filter: null,\n boxShadow: null,\n pointerEvents: 'inherit',\n overflow: 'visible',\n mixBlendMode: 'normal',\n whiteSpace: 'inherit',\n textOverflow: 'clip',\n lineClamp: 0,\n textStrokeWidth: 'inherit',\n textStrokeColor: 'inherit',\n textStrokeOver: 'inherit',\n};\n\nconst GEOM = {\n fill: 'transparent',\n stroke: '#000',\n strokeWidth: 1,\n strokeDasharray: '',\n strokeLinecap: 'butt',\n strokeLinejoin: 'miter',\n strokeMiterlimit: 4,\n fillRule: 'nonzero',\n};\n\nlet DOM_ENTRY_SET = [];\nlet DOM_KEY_SET = [];\nObject.keys(DOM).forEach(k => {\n DOM_KEY_SET.push(k);\n let v = DOM[k];\n DOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet GEOM_ENTRY_SET = [];\nlet GEOM_KEY_SET = [];\nObject.keys(GEOM).forEach(k => {\n GEOM_KEY_SET.push(k);\n let v = GEOM[k];\n GEOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet INHERIT = {\n fontFamily: 'arial',\n fontSize: 16,\n fontWeight: 400,\n fontStyle: 'normal',\n color: '#000',\n textAlign: 'left',\n visibility: 'visible',\n pointerEvents: 'auto',\n textStrokeColor: '#000',\n textStrokeWidth: 1,\n textStrokeOver: 'none',\n};\n\nlet INHERIT_KEY_SET = [];\nObject.keys(INHERIT).forEach(k => {\n INHERIT_KEY_SET.push(k);\n});\n\nexport default {\n DOM,\n GEOM,\n isValid(i) {\n return DOM.hasOwnProperty(i) || GEOM.hasOwnProperty(i);\n },\n DOM_KEY_SET,\n GEOM_KEY_SET,\n DOM_ENTRY_SET,\n GEOM_ENTRY_SET,\n INHERIT,\n INHERIT_KEY_SET,\n};\n","import reg from './reg';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction parseFlex(style, grow, shrink, basis) {\n if(isNil(style.flexGrow)) {\n style.flexGrow = grow || 0;\n }\n if(isNil(style.flexShrink)) {\n style.flexShrink = shrink || 0;\n }\n if(isNil(style.flexBasis)) {\n style.flexBasis = basis || 0;\n }\n}\n\nfunction parseMarginPadding(style, key, list) {\n let temp = style[key];\n if(!isNil(temp)) {\n let match = temp.toString().match(/([-+]?[\\d.]+[pxremvwhina%]*)|(auto)/ig);\n if(match) {\n if(match.length === 1) {\n match[3] = match[2] = match[1] = match[0];\n }\n else if(match.length === 2) {\n match[2] = match[0];\n match[3] = match[1];\n }\n else if(match.length === 3) {\n match[3] = match[1];\n }\n list.forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = match[i];\n }\n });\n }\n }\n}\n\nfunction parseOneBorder(style, k) {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n // 后面会统一格式化处理\n if(isNil(style[k + 'Width'])) {\n let w = /\\b[\\d.]+[pxremvwhina%]*\\b/i.exec(v);\n style[k + 'Width'] = w ? w[0] : 0;\n }\n if(isNil(style[k + 'Style'])) {\n let s = /\\b(solid|dashed|dotted)\\b/i.exec(v);\n style[k + 'Style'] = s ? s[1] : 'solid';\n }\n if(isNil(style[k + 'Color'])) {\n let c = /#[0-9a-f]{3,8}/i.exec(v);\n if(c && [4, 7, 9].indexOf(c[0].length) > -1) {\n style[k + 'Color'] = c[0];\n }\n else if(/\\btransparent\\b/i.test(v)) {\n style[k + 'Color'] = 'transparent';\n }\n else {\n c = /rgba?\\s*\\(.+\\)/i.exec(v);\n style[k + 'Color'] = c ? c[0] : 'transparent';\n }\n }\n}\n\nexport default {\n margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'],\n padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n border: ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'],\n borderTop: ['borderTopWidth', 'borderTopStyle', 'borderTopColor'],\n borderRight: ['borderRightWidth', 'borderRightStyle', 'borderRightColor'],\n borderBottom: ['borderBottomWidth', 'borderBottomStyle', 'borderBottomColor'],\n borderLeft: ['borderLeftWidth', 'borderLeftStyle', 'borderLeftColor'],\n borderWidth: ['borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth'],\n borderColor: ['borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor'],\n borderStyle: ['borderTopStyle', 'borderRightStyle', 'borderBottomStyle', 'borderLeftStyle'],\n borderRadius: ['borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'],\n background: ['backgroundColor', 'backgroundImage', 'backgroundRepeat', 'backgroundPosition'],\n backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n flex: ['flexGrow', 'flexShrink', 'flexBasis'],\n translate: ['translateX', 'translateY'],\n translate3d: ['translateX', 'translateY', 'translateY'],\n scale: ['scaleX', 'scaleY'],\n scale3d: ['scaleX', 'scaleY', 'scaleZ'],\n rotate: ['rotateZ'],\n skew: ['skewX', 'skewY'],\n textStroke: ['textStrokeWidth', 'textStrokeColor', 'textStrokeOver'],\n\n toFull(style, k) {\n let v = style[k];\n if(k === 'background') {\n // bg缩写多个时有color则必须是最后一个\n if(Array.isArray(v)) {\n let length = v.length;\n if(isNil(style.backgroundColor)) {\n let bgc = /^\\s*((transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))/i.exec(v[length - 1]);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.slice(0, length - 1);\n }\n }\n let bgi = [];\n let bgr = [];\n let bgp = [];\n v.forEach(item => {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(item);\n if(gd) {\n bgi.push(gd[0]);\n item = item.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n bgi.push(img[0]);\n item = item.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-?)?repeat(-?[xy])?/i.exec(item);\n if(repeat) {\n bgr.push(repeat[0].toLowerCase());\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = item.match(reg.position);\n if(position) {\n bgp.push(position.join(' '));\n }\n }\n });\n if(bgi.length) {\n style.backgroundImage = bgi;\n }\n if(bgr.length) {\n style.backgroundRepeat = bgr;\n }\n if(bgp.length) {\n style.backgroundPosition = bgp;\n this.toFull(style, 'backgroundPosition');\n }\n }\n else {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(v);\n if(gd) {\n style.backgroundImage = gd[0];\n v = v.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n style.backgroundImage = img[0];\n v = v.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-?)?repeat(-?[xy])?/i.exec(v);\n if(repeat) {\n style.backgroundRepeat = repeat[0].toLowerCase();\n }\n }\n if(isNil(style.backgroundColor)) {\n let bgc = /^(transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\))/i.exec(v);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.replace(bgc[0], '');\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = v.match(reg.position);\n if(position) {\n style.backgroundPosition = position.join(' ');\n this.toFull(style, 'backgroundPosition');\n }\n }\n }\n }\n else if(k === 'flex') {\n if(v === 'none') {\n parseFlex(style, 0, 0, 'auto');\n }\n else if(v === 'auto') {\n parseFlex(style, 1, 1, 'auto');\n }\n else if(/^[\\d.]+\\s+[\\d.]+\\s+(auto|none|content)/.test(v)) {\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.]+[pxremvwhina%]*/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]);\n }\n else if(/^[\\d.]+\\s+[\\d.]+$/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), 0);\n }\n else if(/^[\\d.]+\\s+[\\d.]+[pxremvwhina%]+/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), 1, arr[1]);\n }\n else if(/^[\\d.]+$/.test(v)) {\n parseFlex(style, parseFloat(v), 1, 0);\n }\n else if(/^[\\d.]+[pxremvwhina%]+/i.test(v)) {\n parseFlex(style, 1, 1, v);\n }\n else {\n parseFlex(style, 0, 1, 'auto');\n }\n }\n else if(k === 'flexFlow') {\n v = v.toString().split(/\\s+/);\n if(v.length) {\n if(isNil(style.flexDirection)) {\n }\n style.flexDirection = v[0];\n if(v.length > 1) {\n style.flexWrap = v[1];\n }\n }\n }\n else if(k === 'borderRadius') {\n // borderRadius缩写很特殊,/分隔x/y,然后上右下左4个\n v = v.toString().split('/');\n if(v.length === 1) {\n v[1] = v[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = v[i].toString().split(/\\s+/);\n if(item.length === 0) {\n v[i] = [0, 0, 0, 0];\n }\n else if(item.length === 1) {\n v[i] = [item[0], item[0], item[0], item[0]];\n }\n else if(item.length === 2) {\n v[i] = [item[0], item[1], item[0], item[1]];\n }\n else if(item.length === 3) {\n v[i] = [item[0], item[1], item[2], item[1]];\n }\n else {\n v[i] = item.slice(0, 4);\n }\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = v[0][i] + ' ' + v[1][i];\n }\n });\n }\n else if(k === 'backgroundPosition') {\n if(!Array.isArray(v)) {\n v = [v];\n }\n let isEmpty = this[k].map(k2 => isNil(style[k2]));\n v.forEach(v2 => {\n v2 = v2.toString().split(/\\s+/);\n if(v2.length === 1) {\n v2[1] = '50%';\n }\n this[k].forEach((k2, i) => {\n if(isEmpty[i]) {\n style[k2] = style[k2] || [];\n style[k2].push(v2[i]);\n }\n });\n });\n }\n else if(['translate', 'scale', 'skew'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(['translate3d', 'scale3d'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[2] = arr[1] = arr[0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? 1 : 0;\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(k === 'margin' || k === 'padding') {\n parseMarginPadding(style, k, this[k]);\n }\n else if(/^border((Top)|(Right)|(Bottom)|(Left))$/.test(k)) {\n parseOneBorder(style, k);\n }\n else if(k === 'textStroke') {\n let w = /(?:^|\\s)([-+]?[\\d.]+[pxremvwhina%]*)/.exec(v);\n if(w) {\n style.textStrokeWidth = w[1];\n }\n let c = /(transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\))/i.exec(v);\n if(c) {\n style.textStrokeColor = c[0];\n }\n if(/\\bfill\\b/i.test(v)) {\n style.textStrokeOver = 'fill';\n }\n else {\n style.textStrokeOver = 'none';\n }\n }\n else if(this[k]) {\n this[k].forEach(k => {\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n }\n return style;\n }\n};\n","import enums from '../util/enums';\n\nconst { STYLE_KEY } = enums;\n\nconst KEY_COLOR = [\n [STYLE_KEY.BACKGROUND_COLOR],\n [STYLE_KEY.BORDER_BOTTOM_COLOR],\n [STYLE_KEY.BORDER_LEFT_COLOR],\n [STYLE_KEY.BORDER_RIGHT_COLOR],\n [STYLE_KEY.BORDER_TOP_COLOR],\n [STYLE_KEY.COLOR],\n [STYLE_KEY.TEXT_STROKE_COLOR],\n];\n\nconst KEY_LENGTH = [\n [STYLE_KEY.FONT_SIZE],\n [STYLE_KEY.BORDER_BOTTOM_WIDTH],\n [STYLE_KEY.BORDER_LEFT_WIDTH],\n [STYLE_KEY.BORDER_RIGHT_WIDTH],\n [STYLE_KEY.BORDER_TOP_WIDTH],\n [STYLE_KEY.LEFT],\n [STYLE_KEY.TOP],\n [STYLE_KEY.RIGHT],\n [STYLE_KEY.BOTTOM],\n [STYLE_KEY.FLEX_BASIS],\n [STYLE_KEY.WIDTH],\n [STYLE_KEY.HEIGHT],\n [STYLE_KEY.LINE_HEIGHT],\n [STYLE_KEY.MARGIN_BOTTOM],\n [STYLE_KEY.MARGIN_LEFT],\n [STYLE_KEY.MARGIN_TOP],\n [STYLE_KEY.MARGIN_RIGHT],\n [STYLE_KEY.PADDING_TOP],\n [STYLE_KEY.PADDING_RIGHT],\n [STYLE_KEY.PADDING_BOTTOM],\n [STYLE_KEY.PADDING_LEFT],\n [STYLE_KEY.STROKE_WIDTH],\n [STYLE_KEY.STROKE_MITERLIMIT],\n [STYLE_KEY.LETTER_SPACING],\n [STYLE_KEY.PERSPECTIVE],\n [STYLE_KEY.TEXT_STROKE_WIDTH],\n];\n\nconst KEY_GRADIENT = [\n [STYLE_KEY.BACKGROUND_IMAGE],\n [STYLE_KEY.FILL],\n [STYLE_KEY.STROKE],\n];\n\nconst KEY_RADIUS = [\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS],\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS],\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS],\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS],\n];\n\nconst COLOR_HASH = {};\nKEY_COLOR.forEach(k => {\n COLOR_HASH[k] = true;\n});\n\nconst LENGTH_HASH = {};\nKEY_LENGTH.forEach(k => {\n LENGTH_HASH[k] = true;\n});\n\nconst RADIUS_HASH = {};\nKEY_RADIUS.forEach(k => {\n RADIUS_HASH[k] = true;\n});\n\nconst GRADIENT_HASH = {};\nKEY_GRADIENT.forEach(k => {\n GRADIENT_HASH[k] = true;\n});\n\nconst GRADIENT_TYPE = {\n linear: true,\n radial: true,\n conic: true,\n};\n\nconst KEY_EXPAND = [\n [STYLE_KEY.TRANSLATE_X],\n [STYLE_KEY.TRANSLATE_Y],\n [STYLE_KEY.TRANSLATE_Z],\n [STYLE_KEY.SKEW_X],\n [STYLE_KEY.SKEW_Y],\n [STYLE_KEY.SCALE_X],\n [STYLE_KEY.SCALE_Y],\n [STYLE_KEY.SCALE_Z],\n [STYLE_KEY.ROTATE_X],\n [STYLE_KEY.ROTATE_Y],\n [STYLE_KEY.ROTATE_Z],\n];\n\nconst EXPAND_HASH = {};\nKEY_EXPAND.forEach(k => {\n EXPAND_HASH[k] = true;\n});\n\nexport default {\n KEY_COLOR,\n KEY_EXPAND,\n KEY_GRADIENT,\n KEY_LENGTH,\n KEY_RADIUS,\n COLOR_HASH,\n EXPAND_HASH,\n GRADIENT_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_TYPE,\n};\n","import reset from '../style/reset';\nimport unit from '../style/unit';\nimport enums from '../util/enums';\n\nconst { DOM: RESET_DOM, GEOM: RESET_GEOM } = reset;\nconst { INHERIT } = unit;\nconst { STYLE_KEY } = enums;\n\nconst GEOM = {};\nconst GEOM_KEY_SET = [];\nconst IGNORE = {\n [STYLE_KEY.POINTER_EVENTS]: true,\n};\nconst REPAINT = {\n [STYLE_KEY.TRANSFORM]: true,\n [STYLE_KEY.TRANSLATE_X]: true,\n [STYLE_KEY.TRANSLATE_Y]: true,\n [STYLE_KEY.SKEW_X]: true,\n [STYLE_KEY.SKEW_Y]: true,\n [STYLE_KEY.SCALE_X]: true,\n [STYLE_KEY.SCALE_Y]: true,\n [STYLE_KEY.ROTATE_Z]: true,\n [STYLE_KEY.COLOR]: true,\n [STYLE_KEY.FONT_STYLE]: true,\n [STYLE_KEY.STROKE_WIDTH]: true,\n [STYLE_KEY.FILL]: true,\n [STYLE_KEY.STROKE_DASHARRAY]: true,\n [STYLE_KEY.STROKE_LINECAP]: true,\n [STYLE_KEY.STROKE_LINEJOIN]: true,\n [STYLE_KEY.STROKE_MITERLIMIT]: true,\n [STYLE_KEY.BACKGROUND_COLOR]: true,\n [STYLE_KEY.BACKGROUND_IMAGE]: true,\n [STYLE_KEY.BACKGROUND_POSITION_X]: true,\n [STYLE_KEY.BACKGROUND_POSITION_Y]: true,\n [STYLE_KEY.BACKGROUND_REPEAT]: true,\n [STYLE_KEY.BACKGROUND_SIZE]: true,\n [STYLE_KEY.STROKE]: true,\n [STYLE_KEY.BORDER_BOTTOM_COLOR]: true,\n [STYLE_KEY.BORDER_LEFT_COLOR]: true,\n [STYLE_KEY.BORDER_RIGHT_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS]: true,\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS]: true,\n [STYLE_KEY.VISIBILITY]: true,\n [STYLE_KEY.OPACITY]: true,\n [STYLE_KEY.Z_INDEX]: true,\n [STYLE_KEY.FILTER]: true,\n [STYLE_KEY.BOX_SHADOW]: true,\n [STYLE_KEY.OVERFLOW]: true,\n [STYLE_KEY.BACKGROUND_CLIP]: true,\n [STYLE_KEY.TEXT_STROKE_WIDTH]: true,\n [STYLE_KEY.TEXT_STROKE_COLOR]: true,\n [STYLE_KEY.TEXT_STROKE_OVER]: true,\n};\nconst MEASURE = {\n [STYLE_KEY.FONT_SIZE]: true,\n [STYLE_KEY.FONT_WEIGHT]: true,\n [STYLE_KEY.FONT_FAMILY]: true,\n};\n\nlet o = {\n GEOM,\n GEOM_KEY_SET,\n IGNORE,\n REPAINT,\n MEASURE,\n addGeom(tagName, ks, cb) {\n if(Array.isArray(ks)) {\n ks.forEach(k => {\n o.addGeom(tagName, k, cb);\n });\n }\n else if(ks) {\n if(!GEOM.hasOwnProperty(ks)) {\n GEOM_KEY_SET.push(ks);\n }\n let hash = GEOM[ks] = GEOM[ks] || {};\n hash[tagName] = cb || true;\n }\n },\n isIgnore(k) {\n return IGNORE.hasOwnProperty(k);\n },\n isGeom(tagName, k) {\n return tagName && k && GEOM.hasOwnProperty(k) && GEOM[k].hasOwnProperty(tagName);\n },\n isRepaint(k, tagName) {\n return REPAINT.hasOwnProperty(k) || o.isGeom(tagName, k);\n },\n isMeasure(k) {\n return MEASURE.hasOwnProperty(k);\n },\n isValid(tagName, k) {\n if(!k) {\n return false;\n }\n if(RESET_DOM.hasOwnProperty(k)) {\n return true;\n }\n // geom的fill等矢量才有的样式\n if(tagName.charAt(0) === '$' && RESET_GEOM.hasOwnProperty(k)) {\n return true;\n }\n if(GEOM.hasOwnProperty(k)) {\n return GEOM[k].hasOwnProperty(tagName);\n }\n if(k === 'translatePath') {\n return true;\n }\n return false;\n },\n};\n\nlet MEASURE_KEY_SET = o.MEASURE_KEY_SET = Object.keys(MEASURE).map(i => parseInt(i));\nlet len = MEASURE_KEY_SET.length;\no.isMeasureInherit = function(target) {\n if(target) {\n for(let i = 0; i < len; i++) {\n let k = MEASURE_KEY_SET[i];\n if(target.hasOwnProperty(k) && target[k][1] === INHERIT) {\n return true;\n }\n }\n }\n return false;\n};\no.measureInheritList = function(target) {\n let list = [];\n for(let i = 0; i < len; i++) {\n let k = MEASURE_KEY_SET[i];\n if(target.hasOwnProperty(k) && target[k][1] === INHERIT) {\n list.push(k);\n }\n }\n return list;\n};\n\no.addGeom('$line', ['x1', 'y1', 'x2', 'y2', 'controlA', 'controlB', 'start', 'end']);\no.addGeom('$circle', ['r']);\no.addGeom('$ellipse', ['rx', 'ry']);\no.addGeom('$rect', ['rx', 'ry']);\no.addGeom('$sector', ['begin', 'end', 'edge', 'closure']);\no.addGeom('$polyline', ['points', 'controls', 'start', 'end']);\no.addGeom('$polygon', ['points', 'controls', 'start', 'end', 'booleanOperations']);\n\nexport default o;\n","import unit from './unit';\nimport font from './font';\nimport gradient from './gradient';\nimport reg from './reg';\nimport reset from './reset';\nimport abbr from './abbr';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport key from '../animate/key';\nimport change from '../refresh/change';\n\nconst { STYLE_KEY, STYLE_RV_KEY, style2Upper, STYLE_KEY: {\n POSITION,\n WIDTH,\n HEIGHT,\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n SKEW_X,\n SKEW_Y,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n ROTATE_3D,\n PERSPECTIVE,\n PERSPECTIVE_ORIGIN,\n TRANSFORM,\n TRANSFORM_ORIGIN,\n BACKGROUND_IMAGE,\n BACKGROUND_COLOR,\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n BACKGROUND_SIZE,\n OPACITY,\n Z_INDEX,\n COLOR,\n FONT_SIZE,\n FONT_FAMILY,\n FONT_WEIGHT,\n FONT_STYLE,\n LINE_HEIGHT,\n TEXT_ALIGN,\n FILTER,\n VISIBILITY,\n BOX_SHADOW,\n POINTER_EVENTS,\n FILL,\n STROKE,\n STROKE_WIDTH,\n STROKE_DASHARRAY,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n DISPLAY,\n FLEX_DIRECTION,\n FLEX_GROW,\n FLEX_SHRINK,\n FLEX_BASIS,\n JUSTIFY_CONTENT,\n ALIGN_SELF,\n ALIGN_ITEMS,\n MATRIX,\n LETTER_SPACING,\n BACKGROUND_CLIP,\n WHITE_SPACE,\n TEXT_OVERFLOW,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n TRANSLATE_PATH,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_WIDTH,\n TEXT_STROKE_OVER,\n} } = enums;\nconst { AUTO, PX, PERCENT, NUMBER, INHERIT, DEG, RGBA, STRING, REM, VW, VH, VMAX, VMIN, calUnit } = unit;\nconst { isNil, rgba2int, equalArr } = util;\nconst { MEASURE_KEY_SET, isGeom, GEOM, GEOM_KEY_SET } = change;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nconst TRANSFORM_HASH = {\n translateX: TRANSLATE_X,\n translateY: TRANSLATE_Y,\n translateZ: TRANSLATE_Z,\n scaleX: SCALE_X,\n scaleY: SCALE_Y,\n scaleZ: SCALE_Z,\n skewX: SKEW_X,\n skewY: SKEW_Y,\n rotateX: ROTATE_X,\n rotateY: ROTATE_Y,\n rotateZ: ROTATE_Z,\n rotate: ROTATE_Z,\n};\n\nfunction compatibleTransform(k, arr) {\n if(k === SCALE_X || k === SCALE_Y || k === SCALE_Z) {\n arr[1] = NUMBER;\n }\n else if(k === TRANSLATE_X || k === TRANSLATE_Y || k === TRANSLATE_Z) {\n if(arr[1] === NUMBER) {\n arr[1] = PX;\n }\n }\n else if(k === PERSPECTIVE) {\n if([NUMBER, PERCENT, DEG].indexOf(arr[1]) > -1) {\n arr[1] = PX;\n }\n }\n else {\n if(arr[1] === NUMBER) {\n arr[1] = DEG;\n }\n }\n}\n\n/**\n * 将传入的手写style标准化,并且用reset默认值覆盖其中为空的\n * @param style 手写的style样式\n * @param reset 默认样式,可选\n * @returns Object 标准化的枚举数组结构样式\n */\nfunction normalize(style, reset = []) {\n if(!util.isObject(style)) {\n return {};\n }\n let res = {};\n // style只有单层无需深度clone\n style = util.extend({}, style);\n // 缩写提前处理,因为reset里没有缩写\n let temp = style.border;\n if(temp) {\n abbr.toFull(style, 'border');\n }\n ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'].forEach(k => {\n abbr.toFull(style, k);\n });\n temp = style.borderWidth;\n if(temp) {\n abbr.toFull(style, 'borderWidth');\n }\n temp = style.borderColor;\n if(temp) {\n abbr.toFull(style, 'borderColor');\n }\n temp = style.borderStyle;\n if(temp) {\n abbr.toFull(style, 'borderStyle');\n }\n temp = style.borderRadius;\n if(temp) {\n abbr.toFull(style, 'borderRadius');\n }\n temp = style.background;\n // 处理渐变背景缩写\n if(temp) {\n abbr.toFull(style, 'background');\n }\n // 背景位置\n temp = style.backgroundPosition;\n if(!isNil(temp)) {\n abbr.toFull(style, 'backgroundPosition');\n }\n // flex\n temp = style.flex;\n if(temp) {\n abbr.toFull(style, 'flex');\n }\n // flex-flow\n temp = style.flexFlow;\n if(temp) {\n abbr.toFull(style, 'flexFlow');\n }\n temp = style.margin;\n if(!isNil(temp)) {\n abbr.toFull(style, 'margin');\n }\n temp = style.padding;\n if(!isNil(temp)) {\n abbr.toFull(style, 'padding');\n }\n temp = style.textStroke;\n if(temp) {\n abbr.toFull(style, 'textStroke');\n }\n temp = style.rotate3d;\n if(temp) {\n abbr.toFull(style, 'rotate3d');\n }\n // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform\n ['translate', 'scale', 'skew', 'translate3d', 'scale3d', 'rotate'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n abbr.toFull(style, k);\n }\n });\n // 扩展的不能和transform混用,给出警告\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate3d',\n ].forEach(k => {\n let v = style[k];\n if(v !== undefined && style.transform) {\n inject.warn(`Can not use expand style \"${k}\" with transform`);\n }\n });\n // 默认reset,根据传入不同,当style为空时覆盖\n reset.forEach(item => {\n let { k, v } = item;\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n // 背景图\n temp = style.backgroundImage;\n if(temp !== undefined) {\n if(!temp) {\n res[BACKGROUND_IMAGE] = [null];\n }\n else if(Array.isArray(temp)) {\n res[BACKGROUND_IMAGE] = temp.map(item => {\n if(!item) {\n return null;\n }\n if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n if(reg.img.test(item)) {\n return reg.img.exec(item)[2];\n }\n return null;\n });\n }\n // 区分是渐变色还是图\n else if(reg.gradient.test(temp)) {\n res[BACKGROUND_IMAGE] = [gradient.parseGradient(temp)];\n }\n else if(reg.img.test(temp)) {\n res[BACKGROUND_IMAGE] = [reg.img.exec(temp)[2]];\n }\n else {\n res[BACKGROUND_IMAGE] = [null];\n }\n }\n temp = style.backgroundColor;\n if(temp !== undefined) {\n temp = temp || 'transparent';\n // 先赋值默认透明,后续操作有合法值覆盖\n let bgc = /^#[0-9a-f]{3,8}/i.exec(temp);\n if(bgc && [4, 7, 9].indexOf(bgc[0].length) > -1) {\n res[BACKGROUND_COLOR] = [rgba2int(bgc[0]), RGBA];\n }\n else {\n bgc = /rgba?\\s*\\(.+\\)/i.exec(temp);\n res[BACKGROUND_COLOR] = [rgba2int(bgc ? bgc[0] : [0, 0, 0, 0]), RGBA];\n }\n }\n ['backgroundPositionX', 'backgroundPositionY'].forEach((k, i) => {\n temp = style[k];\n if(temp !== undefined) {\n temp = temp || 0;\n k = i ? BACKGROUND_POSITION_Y : BACKGROUND_POSITION_X;\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[k] = temp.map(item => {\n if(/^[-+]?[\\d.]/.test(item)) {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item] || 0,\n PERCENT,\n ];\n }\n });\n }\n });\n // 背景尺寸\n temp = style.backgroundSize;\n if(temp !== undefined) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[BACKGROUND_SIZE] = temp.map(item => {\n if(!item) {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n let match = item.toString().match(/\\b(?:([-+]?[\\d.]+[pxremvwhina%]*)|(contain|cover|auto))/ig);\n if(match) {\n if(match.length === 1) {\n if(match[0] === 'contain' || match[0] === 'cover') {\n match[1] = match[0];\n }\n else {\n match[1] = 'auto';\n }\n }\n let v = [];\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n v.push(n);\n }\n else if(item === 'contain' || item === 'cover') {\n v.push([item, STRING]);\n }\n else {\n v.push([0, AUTO]);\n }\n }\n return v;\n }\n else {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n });\n }\n // border-color\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k + 'Color';\n let v = style[k];\n if(v !== undefined) {\n res[STYLE_KEY[style2Upper(k)]] = [rgba2int(v || 'transparent'), RGBA];\n }\n });\n // border-radius\n ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'].forEach(k => {\n k = 'border' + k + 'Radius';\n let v = style[k];\n if(v !== undefined) {\n v = v || 0;\n let arr = v.toString().split(/\\s+/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = arr[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n if(n[0] < 0) {\n n[0] = 0;\n }\n arr[i] = n;\n }\n else {\n arr[i] = [0, PX];\n }\n }\n res[STYLE_KEY[style2Upper(k)]] = arr;\n }\n });\n temp = style.transform;\n if(temp === null) {\n res[TRANSFORM] = null;\n }\n else if(temp !== undefined) {\n let transform = res[TRANSFORM] = [];\n let match = (temp || '').toString().match(/\\w+\\(.+?\\)/g);\n if(match) {\n match.forEach(item => {\n let i = item.indexOf('(');\n let k = item.slice(0, i);\n let v = item.slice(i + 1, item.length - 1);\n if(k === 'matrix') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 6) {\n arr = arr.slice(0, 6);\n }\n if(arr.length === 6) {\n transform.push([MATRIX, [\n arr[0], arr[1], 0, 0, arr[2], arr[3], 0, 0, 0, 0, 1, 0, arr[4], arr[5], 0, 1,\n ]]);\n }\n }\n else if(k === 'matrix3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 16) {\n arr = arr.slice(0, 16);\n }\n if(arr.length === 16) {\n transform.push([MATRIX, arr]);\n }\n }\n else if(k === 'perspective') {\n let arr = calUnit(v);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n transform.push([PERSPECTIVE, arr]);\n }\n else if(k === 'rotate3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n transform.push([ROTATE_3D, arr]);\n }\n }\n else if(TRANSFORM_HASH.hasOwnProperty(k)) {\n let k2 = TRANSFORM_HASH[k];\n let arr = calUnit(v);\n compatibleTransform(k2, arr);\n transform.push([k2, arr]);\n }\n else if({ translate: true, scale: true, skew: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale' ? arr[0] : [0];\n }\n if(arr.length === 2) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n }\n }\n else if({ translate3d: true, scale3d: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale3d' ? [1] : [0];\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n if(arr.length === 3) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let k3 = STYLE_KEY[style2Upper(k + 'Z')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n let arr3 = calUnit(arr[2]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n compatibleTransform(k3, arr3);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n transform.push([k3, arr3]);\n }\n }\n });\n }\n }\n temp = style.perspective;\n if(temp !== undefined) {\n let arr = calUnit(temp || 0);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n res[PERSPECTIVE] = arr;\n }\n ['perspectiveOrigin', 'transformOrigin'].forEach(k => {\n temp = style[k];\n if(temp !== undefined) {\n if(temp === null) {\n temp = '';\n }\n let arr = res[STYLE_KEY[style2Upper(k)]] = [];\n let match = temp.toString().match(reg.position);\n if(match) {\n if(match.length === 1) {\n match[1] = match[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n arr.push(n);\n }\n else {\n arr.push([\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item],\n PERCENT,\n ]);\n // 不规范的写法变默认值50%\n if(isNil(arr[i][0])) {\n arr[i][0] = 50;\n }\n }\n }\n }\n else {\n arr.push([50, PERCENT]);\n arr.push([50, PERCENT]);\n }\n }\n });\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate',\n ].forEach(k => {\n let v = style[k];\n if(v === undefined) {\n return;\n }\n if(v === null) {\n if(k.indexOf('scale') === 0) {\n v = 1;\n }\n else {\n v = 0;\n }\n }\n let k2 = TRANSFORM_HASH[k];\n let n = calUnit(v);\n // 没有单位或默认值处理单位\n compatibleTransform(k2, n);\n res[k2] = n;\n });\n temp = style.rotate3d;\n if(temp !== undefined) {\n let arr = (temp || '').toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n }\n res[ROTATE_3D] = arr;\n }\n temp = style.opacity;\n if(temp !== undefined) {\n if(temp === null) {\n temp = 1;\n }\n temp = parseFloat(temp);\n if(!isNaN(temp)) {\n temp = Math.max(temp, 0);\n temp = Math.min(temp, 1);\n res[OPACITY] = temp;\n }\n else {\n res[OPACITY] = 1;\n }\n }\n temp = style.zIndex;\n if(temp !== undefined) {\n res[Z_INDEX] = parseInt(temp) || 0;\n }\n // 转化不同单位值为对象标准化,不写单位的变成number单位转化为px\n [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'width',\n 'height',\n ].forEach(k => {\n let v = style[k];\n if(v === undefined) {\n return;\n }\n if(v === 'auto') {\n v = [0, AUTO];\n }\n else {\n v = calUnit(v || 0);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n let k2 = STYLE_KEY[style2Upper(k)];\n res[k2] = v;\n // 限制padding/border为正数\n if({\n paddingTop: true,\n paddingRight: true,\n paddingBottom: true,\n paddingLeft: true,\n borderTopWidth: true,\n borderRightWidth: true,\n borderBottomWidth: true,\n borderLeftWidth: true,\n width: true,\n height: true,\n }.hasOwnProperty(k) && v[0] < 0) {\n v[0] = 0;\n }\n });\n temp = style.flexBasis;\n if(temp !== undefined) {\n if(temp === 'content') {\n res[FLEX_BASIS] = [temp, STRING];\n }\n else if(/^[\\d.]/.test(temp)) {\n let v = res[FLEX_BASIS] = calUnit(temp);\n v[0] = Math.max(v[0], 0);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n else {\n res[FLEX_BASIS] = [0, AUTO];\n }\n }\n temp = style.order;\n if(temp !== undefined) {\n res[ORDER] = parseInt(temp) || 0;\n }\n temp = style.color;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[COLOR] = [[], INHERIT];\n }\n else {\n res[COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.textStrokeColor;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_COLOR] = [[], INHERIT];\n }\n else {\n res[TEXT_STROKE_COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.fontSize;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // fontSize不能为负数,否则为继承\n if(v < 0) {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[FONT_SIZE] = v;\n }\n }\n }\n temp = style.textStrokeWidth;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // textStrokeWidth不能为负数,否则为继承\n if(v < 0) {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG, PERCENT].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[TEXT_STROKE_WIDTH] = v;\n }\n }\n }\n temp = style.textStrokeOver;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[TEXT_STROKE_OVER] = [0, INHERIT];\n }\n else {\n let v = temp.toString();\n if(v !== 'none' && v !== 'fill') {\n v = 'none';\n }\n res[TEXT_STROKE_OVER] = [v, STRING];\n }\n }\n temp = style.fontWeight;\n if(temp !== undefined) {\n if(temp === 'bold') {\n res[FONT_WEIGHT] = [700, NUMBER];\n }\n else if(temp === 'normal') {\n res[FONT_WEIGHT] = [400, NUMBER];\n }\n else if(temp === 'lighter') {\n res[FONT_WEIGHT] = [200, NUMBER];\n }\n else if(temp === 'inherit') {\n res[FONT_WEIGHT] = [0, INHERIT];\n }\n else {\n res[FONT_WEIGHT] = [Math.max(0, parseInt(temp)) || 400, NUMBER];\n }\n }\n temp = style.fontStyle;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[FONT_STYLE] = [0, INHERIT];\n }\n else {\n res[FONT_STYLE] = [temp, STRING];\n }\n }\n temp = style.fontFamily;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[FONT_FAMILY] = [0, INHERIT];\n }\n else {\n // 统一文字声明格式\n res[FONT_FAMILY] = [temp.toString().toLowerCase().replace(/['\"]/, '').replace(/\\s*,\\s*/g, ','), STRING];\n }\n }\n temp = style.textAlign;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[TEXT_ALIGN] = [0, INHERIT];\n }\n else {\n res[TEXT_ALIGN] = [temp, STRING];\n }\n }\n temp = style.lineHeight;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LINE_HEIGHT] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LINE_HEIGHT] = [0, AUTO];\n }\n // lineHeight默认数字,想要px必须强制带单位\n else if(/^[\\d.]+/i.test(temp)) {\n let v = calUnit(temp);\n if([DEG].indexOf(v[1]) > -1) {\n v[1] = NUMBER;\n }\n res[LINE_HEIGHT] = v;\n }\n else {\n let n = Math.max(0, parseFloat(temp)) || 'normal';\n // 非法数字\n if(n === 'normal') {\n res[LINE_HEIGHT] = [null, AUTO];\n }\n else {\n res[LINE_HEIGHT] = [n, NUMBER];\n }\n }\n }\n temp = style.letterSpacing;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[LETTER_SPACING] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LETTER_SPACING] = [0, PX];\n }\n else if(/^[-+]?[\\d.]/.test(temp)) {\n let v = calUnit(temp);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[LETTER_SPACING] = v;\n }\n else {\n res[LETTER_SPACING] = [parseFloat(temp) || 0, PX];\n }\n }\n temp = style.whiteSpace;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[WHITE_SPACE] = [0, INHERIT];\n }\n else {\n res[WHITE_SPACE] = [temp, STRING];\n }\n }\n temp = style.lineClamp;\n if(temp !== undefined) {\n temp = parseInt(temp) || 0;\n res[LINE_CLAMP] = Math.max(0, temp);\n }\n // fill和stroke为渐变时特殊处理,fillRule无需处理字符串\n temp = style.fill;\n if(temp !== undefined) {\n if(!temp) {\n res[FILL] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[FILL] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[FILL] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[FILL] = [gradient.parseGradient(temp)];\n }\n else {\n res[FILL] = [rgba2int(temp)];\n }\n }\n temp = style.stroke;\n if(temp !== undefined) {\n if(!temp) {\n res[STROKE] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[STROKE] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[STROKE] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[STROKE] = [gradient.parseGradient(temp)];\n }\n else {\n res[STROKE] = [rgba2int(temp)];\n }\n }\n temp = style.strokeWidth;\n if(temp !== undefined) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[STROKE_WIDTH] = temp.map(item => {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n v[0] = Math.max(v[0], 0);\n return v;\n });\n }\n temp = style.strokeDasharray;\n if(temp !== undefined) {\n if(Array.isArray(temp)) {\n res[STROKE_DASHARRAY] = temp.map(item => {\n let match = (item || '').toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n return match;\n }\n return [];\n });\n }\n else {\n let match = (temp || '').toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n res[STROKE_DASHARRAY] = [match];\n }\n else {\n res[STROKE_DASHARRAY] = [[]];\n }\n }\n }\n temp = style.filter;\n if(temp !== undefined) {\n let match = (temp || '').toString().match(/\\b[\\w-]+\\s*\\(\\s*[-+]?[\\d.]+\\s*[pxremvwhdg%]*\\s*\\)\\s*/ig);\n let f = null;\n if(match) {\n f = [];\n match.forEach(item => {\n let m2 = /([\\w-]+)\\s*\\(\\s*([-+]?[\\d.]+\\s*[pxremvwhdg%]*)\\s*\\)\\s*/i.exec(item);\n if(m2) {\n let k = m2[1].toLowerCase(), v = calUnit(m2[2]);\n if(k === 'blur') {\n if(v[0] <= 0 || [DEG, PERCENT].indexOf(v[1]) > -1) {\n return;\n }\n if(v[1] === NUMBER) {\n v[1] = PX;\n }\n f.push([k, v]);\n }\n else if(k === 'hue-rotate') {\n if([NUMBER, DEG].indexOf(v[1]) === -1) {\n return;\n }\n v[1] = DEG;\n f.push([k, v]);\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'grayscale' || k === 'contrast' || k === 'sepia' || k === 'invert') {\n if([NUMBER, PERCENT].indexOf(v[1]) === -1) {\n return;\n }\n v[0] = Math.max(v[0], 0);\n v[1] = PERCENT;\n f.push([k, v]);\n }\n }\n });\n }\n res[FILTER] = f;\n }\n temp = style.visibility;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[VISIBILITY] = [0, INHERIT];\n }\n else {\n res[VISIBILITY] = [temp, STRING];\n }\n }\n temp = style.pointerEvents;\n if(temp !== undefined) {\n if(temp === null || temp === 'inherit') {\n res[POINTER_EVENTS] = [0, INHERIT];\n }\n else {\n res[POINTER_EVENTS] = [temp, STRING];\n }\n }\n temp = style.boxShadow;\n if(temp !== undefined) {\n let bs = null;\n let match = (temp || '').match(/([-+]?[\\d.]+[pxremvwhina%]*)\\s*([-+]?[\\d.]+[pxremvwhina%]*)\\s*([-+]?[\\d.]+[pxremvwhina%]*\\s*)?([-+]?[\\d.]+[pxremvwhina%]*\\s*)?(((transparent)|(#[0-9a-f]{3,8})|(rgba?\\(.+?\\)))\\s*)?(inset|outset)?\\s*,?/ig);\n if(match) {\n match.forEach(item => {\n let boxShadow = /([-+]?[\\d.]+[pxremvwhina%]*)\\s*([-+]?[\\d.]+[pxremvwhina%]*)\\s*([-+]?[\\d.]+[pxremvwhina%]*\\s*)?([-+]?[\\d.]+[pxremvwhina%]*\\s*)?(?:((?:transparent)|(?:#[0-9a-f]{3,8})|(?:rgba?\\(.+\\)))\\s*)?(inset|outset)?/i.exec(item);\n if(boxShadow) {\n bs = bs || [];\n let res = [];\n // v,h,blur,spread,color,inset\n for(let i = 0; i < 4; i++) {\n let v = calUnit(boxShadow[i + 1]);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n // x/y可以负,blur和spread不行\n if(i > 1 && v[0] < 0) {\n v = 0;\n }\n res.push(v);\n }\n res.push(rgba2int(boxShadow[5]));\n res.push(boxShadow[6] || 'outset');\n bs.push(res);\n }\n });\n }\n res[BOX_SHADOW] = bs;\n }\n // 直接赋值的string类型\n [\n 'position',\n 'display',\n 'flexDirection',\n 'flexWrap',\n 'justifyContent',\n 'alignItems',\n 'alignSelf',\n 'alignContent',\n 'overflow',\n 'mixBlendMode',\n 'borderTopStyle',\n 'borderRightStyle',\n 'borderBottomStyle',\n 'borderLeftStyle',\n 'backgroundClip',\n 'textOverflow',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[STYLE_KEY[style2Upper(k)]] = style[k];\n }\n });\n // 直接赋值的number类型\n [\n 'flexGrow',\n 'flexShrink',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[STYLE_KEY[style2Upper(k)]] = Math.max(parseFloat(style[k]) || 0, 0);\n }\n });\n temp = style.zIndex;\n if(temp !== undefined) {\n res[Z_INDEX] = parseFloat(temp) || 0;\n }\n // 这些支持多个的用数组表示\n [\n 'backgroundRepeat',\n 'strokeLinecap',\n 'strokeLinejoin',\n 'strokeMiterlimit',\n 'fillRule',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n let v = style[k];\n res[STYLE_KEY[style2Upper(k)]] = Array.isArray(v) ? v : [v];\n }\n });\n GEOM_KEY_SET.forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[k] = style[k];\n }\n });\n return res;\n}\n\n/**\n * 第一次和REFLOW等级下,刷新前首先执行,生成computedStyle\n * 影响文字测量的只有字体和大小和重量,需要提前处理\n * 继承相关的计算\n * @param node 对象节点\n * @param isRoot 是否是根节点,无继承需使用默认值\n */\nfunction computeMeasure(node, isRoot) {\n let { currentStyle, computedStyle, domParent } = node;\n let parentComputedStyle = !isRoot && domParent.computedStyle;\n MEASURE_KEY_SET.forEach(k => {\n let v = currentStyle[k];\n // ff特殊处理\n if(k === FONT_FAMILY) {\n if(v[1] === INHERIT) {\n computedStyle[k] = getFontFamily(isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k]);\n }\n else {\n computedStyle[k] = getFontFamily(v[0]);\n }\n }\n else if(v[1] === INHERIT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k];\n }\n // 只有fontSize会有%\n else if(v[1] === PERCENT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (parentComputedStyle[k] * v[0] * 0.01);\n }\n else if(v[1] === REM) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.computedStyle[FONT_SIZE] * v[0]);\n }\n else if(v[1] === VW) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.width * 0.01 * v[0]);\n }\n else if(v[1] === VH) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.height * 0.01 * v[0]);\n }\n else if(v[1] === VMAX) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (Math.max(node.root.width, node.root.height) * 0.01 * v[0]);\n }\n else if(v[1] === VMIN) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (Math.min(node.root.width, node.root.height) * 0.01 * v[0]);\n }\n else {\n computedStyle[k] = v[0];\n }\n });\n}\n\n/**\n * 每次布局前需要计算的reflow相关的computedStyle\n * @param node 对象节点\n */\nfunction computeReflow(node) {\n let { currentStyle, computedStyle, domParent: parent, root } = node;\n let rem = root.computedStyle[FONT_SIZE];\n let isRoot = !parent;\n let parentComputedStyle = parent && parent.computedStyle;\n [\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n ].forEach(k => {\n // border-width不支持百分比\n let item = currentStyle[k];\n if(item[1] === PX) {\n computedStyle[k] = item[0];\n }\n else if(item[1] === REM) {\n computedStyle[k] = item[0] * rem;\n }\n else if(item[1] === VW) {\n computedStyle[k] = item[0] * root.width * 0.01;\n }\n else if(item[1] === VH) {\n computedStyle[k] = item[0] * root.height * 0.01;\n }\n else if(item[1] === VMAX) {\n computedStyle[k] = item[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(item[1] === VMIN) {\n computedStyle[k] = item[0] * Math.min(root.width, root.height) * 0.01;\n }\n else {\n computedStyle[k] = 0;\n }\n });\n [\n POSITION,\n DISPLAY,\n FLEX_DIRECTION,\n JUSTIFY_CONTENT,\n ALIGN_ITEMS,\n ALIGN_SELF,\n FLEX_GROW,\n FLEX_SHRINK,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n // 匿名块对象\n if(computedStyle[POSITION] === 'absolute' || parentComputedStyle && parentComputedStyle[DISPLAY] === 'flex') {\n if(['block', 'flex'].indexOf(computedStyle[DISPLAY]) === -1) {\n computedStyle[DISPLAY] = 'block';\n }\n }\n let textAlign = currentStyle[TEXT_ALIGN];\n if(textAlign[1] === INHERIT) {\n computedStyle[TEXT_ALIGN] = isRoot ? 'left' : parentComputedStyle[TEXT_ALIGN];\n }\n else {\n computedStyle[TEXT_ALIGN] = textAlign[0];\n }\n let fontSize = computedStyle[FONT_SIZE];\n let lineHeight = currentStyle[LINE_HEIGHT];\n // lineHeight继承很特殊,数字和normal不同于普通单位\n if(lineHeight[1] === INHERIT) {\n if(isRoot) {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n else {\n let p = parent;\n let ph;\n while(p) {\n ph = p.currentStyle[LINE_HEIGHT];\n if(ph[1] !== INHERIT) {\n break;\n }\n p = p.domParent;\n }\n // 到root还是inherit或normal,或者中途遇到了normal,使用normal\n if([AUTO, INHERIT].indexOf(ph[1]) > -1) {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n // 数字继承\n else if(ph[1] === NUMBER) {\n computedStyle[LINE_HEIGHT] = Math.max(ph[0], 0) * fontSize;\n }\n // 单位继承\n else {\n computedStyle[LINE_HEIGHT] = parentComputedStyle[LINE_HEIGHT];\n }\n }\n }\n // 防止为0\n else if(lineHeight[1] === PX) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === PERCENT) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * fontSize * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === REM) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * rem, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VW) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.width * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VH) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.height * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VMAX) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * Math.max(root.width, root.height) * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VMIN) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * Math.min(root.width, root.height) * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === NUMBER) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) * fontSize || calNormalLineHeight(computedStyle);\n }\n // normal或auto\n else {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n let letterSpacing = currentStyle[LETTER_SPACING];\n if(letterSpacing[1] === INHERIT) {\n computedStyle[LETTER_SPACING] = isRoot ? 0 : parentComputedStyle[LETTER_SPACING];\n }\n else if(letterSpacing[1] === PERCENT) {\n computedStyle[LETTER_SPACING] = fontSize * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === REM) {\n computedStyle[LETTER_SPACING] = rem * letterSpacing[0];\n }\n else if(letterSpacing[1] === VW) {\n computedStyle[LETTER_SPACING] = root.width * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === VH) {\n computedStyle[LETTER_SPACING] = root.height * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === VMAX) {\n computedStyle[LETTER_SPACING] = Math.max(root.width, root.height) * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === VMIN) {\n computedStyle[LETTER_SPACING] = Math.min(root.width, root.height) * 0.01 * letterSpacing[0];\n }\n else {\n computedStyle[LETTER_SPACING] = letterSpacing[0];\n }\n //whiteSpace\n let whiteSpace = currentStyle[WHITE_SPACE];\n if(whiteSpace[1] === INHERIT) {\n computedStyle[WHITE_SPACE] = isRoot ? 'normal' : parentComputedStyle[WHITE_SPACE];\n }\n else {\n computedStyle[WHITE_SPACE] = whiteSpace[0];\n }\n}\n\nfunction setFontStyle(style) {\n let fontSize = style[FONT_SIZE] || 0;\n let fontFamily = style[FONT_FAMILY] || 'arial';\n if(/\\s/.test(fontFamily)) {\n fontFamily = '\"' + fontFamily.replace(/\"/g, '\\\\\"') + '\"';\n }\n return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' '\n + fontSize + 'px/' + fontSize + 'px ' + fontFamily;\n}\n\nfunction getFontFamily(str) {\n let ff = str.split(',');\n let f = 'arial';\n for(let i = 0, len = ff.length; i < len; i++) {\n if(font.support(ff[i])) {\n f = ff[i];\n break;\n }\n }\n return f;\n}\n\nfunction getBaseline(style) {\n let fontSize = style[FONT_SIZE];\n let ff = getFontFamily(style[FONT_FAMILY]);\n let normal = fontSize * (font.info[ff] || font.info.arial).lhr;\n return (style[LINE_HEIGHT] - normal) * 0.5 + fontSize * (font.info[ff] || font.info.arial).blr;\n}\n\nfunction calNormalLineHeight(style) {\n let ff = getFontFamily(style[FONT_FAMILY]);\n return style[FONT_SIZE] * (font.info[ff] || font.info.arial).lhr;\n}\n\nfunction calRelativePercent(n, parent, k) {\n n *= 0.01;\n while(parent) {\n let style = parent.currentStyle[k];\n if(style[1] === AUTO) {\n if(k === WIDTH) {\n parent = parent.domParent;\n }\n else {\n break;\n }\n }\n else if(style[1] === PX) {\n return n * style[0];\n }\n else if(style[1] === PERCENT) {\n n *= style[0] * 0.01;\n parent = parent.domParent;\n }\n else if(style[1] === REM) {\n return n * style[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(style[1] === VW) {\n return n * style[0] * parent.root.width * 0.01;\n }\n else if(style[1] === VH) {\n return n * style[0] * parent.root.height * 0.01;\n }\n else if(style[1] === VMAX) {\n return n * style[0] * Math.max(parent.root.width, parent.root.height) * 0.01;\n }\n else if(style[1] === VMIN) {\n return n * style[0] * Math.min(parent.root.width, parent.root.height) * 0.01;\n }\n }\n return n;\n}\n\nfunction calRelative(currentStyle, k, v, parent, isWidth) {\n if(v[1] === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER].indexOf(v[1]) > -1) {\n v = v[0];\n }\n else if(v[1] === PERCENT) {\n if(isWidth) {\n v = calRelativePercent(v[0], parent, WIDTH);\n }\n else {\n v = calRelativePercent(v[0], parent, HEIGHT);\n }\n }\n else if(v[1] === REM) {\n v = v[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * parent.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * parent.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(parent.root.width, parent.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(parent.root.width, parent.root.height) * 0.01;\n }\n return v;\n}\n\nfunction calAbsolute(currentStyle, k, v, size, root) {\n if(v[1] === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER, DEG, RGBA, STRING].indexOf(v[1]) > -1) {\n v = v[0];\n }\n else if(v[1] === PERCENT) {\n v = v[0] * size * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(root.width, root.height) * 0.01;\n }\n return v;\n}\n\nfunction equalStyle(k, a, b, target) {\n if(!a || !b) {\n return a === b;\n }\n if(k === TRANSFORM) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let oa = a[i];\n let ob = b[i];\n if(oa[0] !== ob[0]) {\n return false;\n }\n // translate/matrix等都是数组\n if(!equalArr(oa[1], ob[1])) {\n return false;\n }\n }\n return true;\n }\n if(k === FILTER) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equalArr(a[i], b[i])) {\n return false;\n }\n }\n }\n if(k === BACKGROUND_SIZE) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let aa = a[i], bb = b[i];\n if(aa[0][0] !== bb[0][0] || aa[0][1] !== bb[0][1] || aa[1][0] !== bb[1][0] || aa[1][1] !== bb[1][1]) {\n return false;\n }\n }\n return true;\n }\n if(k === TRANSFORM_ORIGIN || RADIUS_HASH.hasOwnProperty(k)) {\n return a[0][0] === b[0][0] && a[0][1] === b[0][1]\n && a[1][0] === b[1][0] && a[1][1] === b[1][1];\n }\n if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y\n || LENGTH_HASH.hasOwnProperty(k) || EXPAND_HASH.hasOwnProperty(k)) {\n return a[0] === b[0] && a[1] === b[1];\n }\n if(k === BOX_SHADOW) {\n return equalArr(a, b);\n }\n if(COLOR_HASH.hasOwnProperty(k)) {\n return a[1] === b[1] && equalArr(a[0], b[0]);\n }\n if(GRADIENT_HASH.hasOwnProperty(k) && a.k === b.k && GRADIENT_TYPE.hasOwnProperty(a.k)) {\n let av = a.v;\n let bv = b.v;\n if(a.d !== b.d || av.length !== bv.length) {\n return false;\n }\n for(let i = 0, len = av.length; i < len; i++) {\n let ai = av[i];\n let bi = bv[i];\n if(ai.length !== bi.length) {\n return false;\n }\n for(let j = 0; j < 4; j++) {\n if(ai[0][j] !== bi[0][j]) {\n return false;\n }\n }\n if(ai.length > 1) {\n if(ai[1][0] !== bi[1][0] || ai[1][1] !== bi[1][1]) {\n return false;\n }\n }\n }\n return true;\n }\n // multi都是纯值数组,equalArr本身即递归,非multi根据类型判断\n if(isGeom(target.tagName, k) && (target.isMulti || Array.isArray(a) && Array.isArray(b))) {\n return equalArr(a, b);\n }\n return a === b;\n}\n\nfunction isRelativeOrAbsolute(node) {\n let position = node.currentStyle[POSITION];\n return position === 'relative' || position === 'absolute';\n}\n\nconst VALUE = {\n [POSITION]: true,\n [DISPLAY]: true,\n [STYLE_KEY.BACKGROUND_REPEAT]: true,\n [FLEX_DIRECTION]: true,\n [FLEX_GROW]: true,\n [FLEX_SHRINK]: true,\n [FLEX_WRAP]: true,\n [JUSTIFY_CONTENT]: true,\n [ALIGN_ITEMS]: true,\n [ALIGN_SELF]: true,\n [STYLE_KEY.OVERFLOW]: true,\n [STYLE_KEY.MIX_BLEND_MODE]: true,\n [STYLE_KEY.STROKE_LINECAP]: true,\n [STYLE_KEY.STROKE_LINEJOIN]: true,\n [STYLE_KEY.STROKE_MITERLIMIT]: true,\n [STYLE_KEY.FILL_RULE]: true,\n [OPACITY]: true,\n [Z_INDEX]: true,\n [BACKGROUND_CLIP]: true,\n [TEXT_OVERFLOW]: true,\n [LINE_CLAMP]: true,\n};\n// 仅1维数组\nconst ARRAY_0 = {\n [COLOR]: true,\n [TEXT_STROKE_COLOR]: true,\n [BACKGROUND_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_COLOR]: true,\n [STYLE_KEY.BORDER_RIGHT_COLOR]: true,\n [STYLE_KEY.BORDER_BOTTOM_COLOR]: true,\n [STYLE_KEY.BORDER_LEFT_COLOR]: true,\n};\n// 仅2维数组且只有2个值\nconst ARRAY_0_1 = {\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS]: true,\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS]: true,\n [TRANSFORM_ORIGIN]: true,\n [PERSPECTIVE_ORIGIN]: true,\n};\nfunction cloneStyle(style, keys) {\n if(!keys) {\n keys = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n }\n let res = {};\n for(let i = 0, len = keys.length; i < len; i++) {\n let k = keys[i];\n let v = style[k];\n // 渐变特殊处理\n if(k === BACKGROUND_IMAGE) {\n res[k] = v.map(item => {\n // 可能为null\n if(item && item.k) {\n return util.clone(item);\n }\n else {\n return item;\n }\n });\n }\n else if(k === FILL || k === STROKE) {\n res[k] = v.map(item => {\n // 渐变\n // 可能非法为空\n if(item && item.k) {\n return util.clone(item);\n }\n // 颜色\n else {\n return item.slice(0);\n }\n });\n }\n else if(k === TRANSFORM || k === FILTER) {\n if(v) {\n let n = v.slice(0);\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n n[i][1] = n[i][1].slice(0);\n }\n res[k] = n;\n }\n }\n else if(k === BOX_SHADOW) {\n if(v) {\n v = v.map(item => {\n let n = item.slice(0);\n n[4] = n[4].slice(0);\n return n;\n });\n res[k] = v;\n }\n }\n else if(k === TRANSLATE_PATH) {\n if(v) {\n res[k] = v.map(item => item.slice(0));\n }\n }\n // position等直接值类型赋值\n else if(VALUE.hasOwnProperty(k)) {\n res[k] = v;\n }\n // geom自定义属性\n else if(GEOM.hasOwnProperty(k)) {\n res[k] = util.clone(v);\n }\n // 其余皆是数组或空,默认是一维数组只需slice即可\n else if(v) {\n let n = res[k] = v.slice(0);\n // 特殊引用里数组某项再次clone\n if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n }\n }\n else if(k === BACKGROUND_SIZE) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n n[i][0] = n[i][0].slice(0);\n n[i][1] = n[i][1].slice(0);\n }\n }\n else if(ARRAY_0.hasOwnProperty(k)) {\n n[0] = n[0].slice(0);\n }\n else if(ARRAY_0_1.hasOwnProperty(k)) {\n n[0] = n[0].slice(0);\n n[1] = n[1].slice(0);\n }\n else if(k === TRANSFORM) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n }\n }\n else if(k === ROTATE_3D) {\n n[3] = n[3].slice(0);\n }\n }\n }\n return res;\n}\n\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 '../refresh/mode';\nimport css from '../style/css';\nimport enums from '../util/enums';\nimport util from '../util/util';\n\nconst { STYLE_KEY: {\n COLOR,\n FONT_WEIGHT,\n FONT_FAMILY,\n FONT_SIZE,\n FONT_STYLE,\n LETTER_SPACING,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_WIDTH,\n TEXT_STROKE_OVER,\n} } = enums;\n\n/**\n * 表示一行文本的类,保存它的位置、内容、从属信息,在布局阶段生成,并在渲染阶段被Text调用render()\n * 关系上直属于Text类,一个Text类可能因为换行原因导致有多个TextBox,一行内容中也可能有不同Text从而不同TextBox\n * 另外本类还会被LineBoxManager添加到LineBox里,LineBox为一行中的inline/文本组合,之间需要进行垂直对齐\n * 在textOverflow为ellipsis时,可能会收到后面节点的向前回退(后面不足放下…),使得省略号发生在本节点\n */\nclass TextBox {\n constructor(parent, index, x, y, w, h, content, wList) {\n this.__parent = parent;\n this.__index = index;\n this.__x = x;\n this.__y = y;\n this.__width = w;\n this.__height = h;\n this.__content = content;\n this.__wList = wList;\n this.__virtualDom = {};\n }\n\n /**\n * 渲染阶段被Text类调用,多行Text会有多个TextBox,内容被分拆开\n * @param renderMode\n * @param ctx\n * @param computedStyle\n * @param cacheStyle Text父节点Dom的缓存样式,相比computedStyle可以直接用,比如color被缓存为style字符串\n * @param dx\n * @param dy\n */\n render(renderMode, ctx, computedStyle, cacheStyle, dx, dy) {\n let { content, x, y, parent, wList, width } = this;\n let { ox, oy } = parent;\n y += css.getBaseline(computedStyle);\n x += ox + dx;\n y += oy + dy;\n this.__endX = x + width;\n this.__endY = y;\n let {\n [LETTER_SPACING]: letterSpacing,\n [TEXT_STROKE_WIDTH]: textStrokeWidth,\n [TEXT_STROKE_COLOR]: textStrokeColor,\n } = computedStyle;\n let i = 0, length = content.length;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n let overFill = computedStyle[TEXT_STROKE_OVER] === 'fill';\n if(letterSpacing) {\n for(; i < length; i++) {\n if(overFill) {\n ctx.fillText(content.charAt(i), x, y);\n }\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n ctx.strokeText(content.charAt(i), x, y);\n }\n if(!overFill) {\n ctx.fillText(content.charAt(i), x, y);\n }\n x += wList[i] + letterSpacing;\n }\n }\n else {\n if(overFill) {\n ctx.fillText(content, x, y);\n }\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n ctx.strokeText(content, x, y);\n }\n if(!overFill) {\n ctx.fillText(content, x, y);\n }\n }\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['x', x],\n ['y', y],\n ['fill', cacheStyle[COLOR]],\n ['font-family', computedStyle[FONT_FAMILY]],\n ['font-weight', computedStyle[FONT_WEIGHT]],\n ['font-style', computedStyle[FONT_STYLE]],\n ['font-size', computedStyle[FONT_SIZE] + 'px'],\n ];\n // svg无法定义stroke的over\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n props.push(['stroke', cacheStyle[TEXT_STROKE_COLOR]]);\n props.push(['stroke-width', computedStyle[TEXT_STROKE_WIDTH]]);\n }\n if(letterSpacing) {\n props.push(['letter-spacing', letterSpacing]);\n }\n this.__virtualDom = {\n type: 'item',\n tagName: 'text',\n props,\n content: util.encodeHtml(content),\n };\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endX() {\n return this.__endX;\n }\n\n get endY() {\n return this.__endY;\n }\n\n get width() {\n return this.__width;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get content() {\n return this.__content;\n }\n\n get baseline() {\n return this.parent.baseline;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get parentLineBox() {\n return this.__parentLineBox;\n }\n\n get wList() {\n return this.__wList;\n }\n\n get isReplaced() {\n return false;\n }\n}\n\nexport default TextBox;\n","import inject from '../util/inject';\n\nlet SIZE = [8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192];\nlet NUMBER = [128, 64, 32, 16, 8, 4, 2, 1, 1, 1, 1];\nlet MAX = SIZE[SIZE.length - 1];\nconst HASH_CANVAS = {};\n\nlet uuid = 0;\n\nclass Page {\n constructor(size, number) {\n this.__size = size;\n this.__number = number;\n this.__free = this.__total = number * number;\n size *= number;\n this.__width = size;\n this.__height = size;\n let offscreen = this.__canvas = inject.getCacheCanvas(size, size, null, number);\n if(offscreen) {\n this.__offscreen = offscreen;\n }\n // 1/0标识n*n个单元格是否空闲可用,一维数组表示\n this.__grid = [];\n for(let i = 0; i < this.__total; i++) {\n this.__grid.push(1);\n }\n this.__uuid = uuid++;\n // webgl贴图缓存使用,一旦更新则标识记录,绑定某号纹理单元查看变化才更新贴图\n this.__update = false;\n this.time = 0;\n }\n\n add() {\n let { number, grid } = this;\n for(let i = 0; i < number; i++) {\n for(let j = 0; j < number; j++) {\n let index = i * number + j;\n if(grid[index]) {\n grid[index] = 0;\n this.__free--;\n return index;\n }\n }\n }\n // 理论不可能进入,除非bug\n throw new Error('Can not find free page');\n }\n\n del(pos) {\n if(!this.grid[pos]) {\n this.grid[pos] = 1;\n this.__free++;\n }\n }\n\n getCoords(pos) {\n let { size, number } = this;\n let x = pos % number;\n let y = Math.floor(pos / number);\n return [x * size, y * size];\n }\n\n get uuid() {\n return this.__uuid;\n }\n\n get size() {\n return this.__size;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get number() {\n return this.__number;\n }\n\n get total() {\n return this.__total;\n }\n\n get free() {\n return this.__free;\n }\n\n get grid() {\n return this.__grid;\n }\n\n get offscreen() {\n return this.__offscreen;\n }\n\n get canvas() {\n return this.offscreen.canvas;\n }\n\n get ctx() {\n return this.offscreen.ctx;\n }\n\n get update() {\n return this.__update;\n }\n\n set update(v) {\n this.__update = v;\n }\n\n static getInstance(size) {\n if(size > MAX) {\n return;\n }\n let s = SIZE[0];\n let n = NUMBER[0];\n // 使用刚好满足的尺寸\n for(let i = 0, len = SIZE.length; i < len; i++) {\n s = SIZE[i];\n n = NUMBER[i];\n if(SIZE[i] >= size) {\n break;\n }\n }\n let list = HASH_CANVAS[s] = HASH_CANVAS[s] || [];\n // 从hash列表中尝试取可用的一页,找不到就生成新的页\n let page;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item.free) {\n page = item;\n break;\n }\n }\n if(!page) {\n page = new Page(s, n);\n if(!page.offscreen) {\n inject.error('Can not create off-screen for page');\n return;\n }\n list.push(page);\n }\n let pos = page.add();\n return { page, pos };\n }\n\n static set CONFIG(v) {\n if(!v || !Array.isArray(v.SIZE) || !Array.isArray(v.NUMBER)) {\n return;\n }\n SIZE = v.SIZE;\n NUMBER = v.NUMBER;\n MAX = SIZE[SIZE.length - 1];\n }\n\n static get CONFIG() {\n return {\n SIZE,\n NUMBER,\n };\n }\n\n static get MAX() {\n return MAX;\n }\n\n static genUuid() {\n return uuid++;\n }\n}\n\nexport default Page;\n","import matrix from './matrix';\nimport geom from './geom';\n\n// 一条边相对于自己开始点的x向量角度,即从x到此边旋转,0~180和-180~0,需要判断象限\nfunction calDeg(x1, y1, x2, y2) {\n let dx = x2 - x1;\n let dy = y2 - y1;\n let atan = Math.atan(Math.abs(dy) / Math.abs(dx));\n // 2象限\n if(dx < 0 && dy >= 0) {\n return Math.PI - atan;\n }\n // 3象限\n if(dx < 0 && dy < 0) {\n return atan - Math.PI;\n }\n // 1象限\n if(dx >= 0 && dy >= 0) {\n return atan;\n }\n // 4象限,顺时针正好\n return -atan;\n}\n\nfunction rotate(theta) {\n let sin = Math.sin(theta);\n let cos = Math.cos(theta);\n let t = matrix.identity();\n t[0] = t[5] = cos;\n t[1] = sin;\n t[4] = -sin;\n return t;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param points\n */\nfunction pointIndex(points) {\n let [x1, y1, x2, y2, x3, y3] = points;\n let index = [0, 1, 2];\n // 将a点放入最左\n if(x2 < x1 && x2 < x3) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n index[0] = 1;\n index[1] = 0;\n }\n else if(x3 < x2 && x3 < x1) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n index[0] = 2;\n index[2] = 0;\n }\n // 有可能出现2个并列的情况,判断取上面那个\n if(x1 === x2) {\n if(y1 > y2) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n let t = index[0];\n index[0] = index[1];\n index[1] = t;\n }\n }\n else if(x1 === x3) {\n if(y1 > y3) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n let t = index[0];\n index[0] = index[2];\n index[2] = t;\n }\n }\n // ab到ac要顺时针旋转,即2个向量夹角为正,用向量叉乘判断正负\n let cross = (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1);\n if(cross < 0) {\n [x2, y2, x3, y3] = [x3, y3, x2, y2];\n let t = index[1];\n index[1] = index[2];\n index[2] = t;\n }\n return [x1, y1, x2, y2, x3, y3, index];\n}\n\n/**\n * 第2个点根据第一个点的交换顺序交换\n * @param points\n * @param index\n * @returns {[]}\n */\nfunction pointByIndex(points, index) {\n let res = [];\n for(let i = 0, len = index.length; i < len; i++) {\n let j = index[i];\n res.push(points[j * 2]);\n res.push(points[j * 2 + 1]);\n }\n return res;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param source 源3个点\n * @param target 目标3个点\n * @returns 交换顺序后的点坐标\n */\nfunction exchangeOrder(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3, index] = pointIndex(source);\n let [tx1, ty1, tx2, ty2, tx3, ty3] = pointByIndex(target, index);\n return [\n [sx1, sy1, sx2, sy2, sx3, sy3],\n [tx1, ty1, tx2, ty2, tx3, ty3]\n ];\n}\n\n/**\n * 存在一种情况,变换结果使得三角形镜像相反了,即顶点a越过bc线,判断是否溢出\n * @param source\n * @param target\n * @returns {boolean}是否溢出\n */\nfunction isOverflow(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n let cross1 = (sx2 - sx1) * (sy3 - sy1) - (sx3 - sx1) * (sy2 - sy1);\n let cross2 = (tx2 - tx1) * (ty3 - ty1) - (tx3 - tx1) * (ty2 - ty1);\n return cross1 > 0 && cross2 < 0 || cross1 < 0 && cross2 > 0;\n}\n\nfunction transform(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n // 记录翻转\n let overflow = isOverflow(source, target);\n // 第0步,将源三角第1个a点移到原点\n let m = matrix.identity();\n m[12] = -sx1;\n m[13] = -sy1;\n let t;\n // 第1步,以第1条边ab为基准,将其贴合x轴上,为后续倾斜不干扰做准备\n let theta = calDeg(sx1, sy1, sx2, sy2);\n if(theta !== 0) {\n t = rotate(-theta);\n m = matrix.multiply(t, m);\n }\n // 第2步,以第1条边AB为基准,缩放x轴ab至目标相同长度,可与4步合并\n let ls = geom.pointsDistance(sx1, sy1, sx2, sy2);\n let lt = geom.pointsDistance(tx1, ty1, tx2, ty2);\n // if(ls !== lt) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[0] = scale;\n // m = matrix.multiply(t, m);\n // }\n // 第3步,缩放y,先将目标三角形旋转到x轴平行,再变换坐标计算\n let n = matrix.identity();\n n[12] = -tx1;\n n[13] = -ty1;\n theta = calDeg(tx1, ty1, tx2, ty2);\n // 记录下这个旋转角度,后面源三角形要反向旋转\n let alpha = theta;\n if(theta !== 0) {\n t = rotate(-theta);\n n = matrix.multiply(t, n);\n }\n // 目标三角反向旋转至x轴后的坐标\n // 源三角目前的第3点坐标y值即为长度,因为a点在原点0无需减去\n let ls2 = Math.abs(matrix.calPoint([sx3, sy3], m)[1]);\n let lt2 = Math.abs(matrix.calPoint([tx3, ty3], n)[1]);\n // 缩放y\n // if(ls2 !== lt2) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[3] = scale;\n // m = matrix.multiply(t, m);\n // }\n if(ls !== lt || ls2 !== lt2) {\n t = matrix.identity();\n if(ls !== lt) {\n t[0] = lt / ls;\n }\n if(ls2 !== lt2) {\n t[5] = lt2 / ls2;\n }\n m = matrix.multiply(t, m);\n }\n // 第4步,x轴倾斜,用余弦定理求目前a和A的夹角\n n = m;\n let [ax1, ay1] = matrix.calPoint([sx1, sy1], n);\n let [ax2, ay2] = matrix.calPoint([sx2, sy2], n);\n let [ax3, ay3] = matrix.calPoint([sx3, sy3], n);\n let ab = geom.pointsDistance(ax1, ay1, ax2, ay2);\n let ac = geom.pointsDistance(ax1, ay1, ax3, ay3);\n let bc = geom.pointsDistance(ax3, ay3, ax2, ay2);\n let AB = geom.pointsDistance(tx1, ty1, tx2, ty2);\n let AC = geom.pointsDistance(tx1, ty1, tx3, ty3);\n let BC = geom.pointsDistance(tx3, ty3, tx2, ty2);\n let a = geom.angleBySide(bc, ab, ac);\n let A = geom.angleBySide(BC, AB, AC);\n // 先至90°,再旋转至目标角,可以合并成tan相加,不知道为什么不能直接tan倾斜差值角度\n if(a !== A) {\n t = matrix.identity();\n t[4] = Math.tan(a - Math.PI * 0.5) + Math.tan(Math.PI * 0.5 - A);\n m = matrix.multiply(t, m);\n }\n // 发生翻转时特殊处理按x轴垂直翻转\n if(overflow) {\n m[1] = -m[1];\n m[5] = -m[5];\n m[13] = -m[13];\n }\n // 第5步,再次旋转,角度为目标旋转到x轴的负值,可与下步合并\n if(alpha !== 0) {\n t = rotate(alpha);\n // m = matrix.multiply(t, m);\n }\n else {\n t = matrix.identity();\n }\n // 第6步,移动第一个点的差值\n // t = matrix.identity();\n t[12] = tx1;\n t[13] = ty1;\n return matrix.multiply(t, m);\n}\n\nexport default {\n exchangeOrder,\n isOverflow,\n transform,\n};\n","/**\n * martinez v0.7.1\n * Martinez polygon clipping algorithm, does boolean operation on polygons (multipolygons, polygons with holes etc): intersection, union, difference, xor\n *\n * @author Alex Milevski \n * @license MIT\n * @preserve\n */\n\nfunction DEFAULT_COMPARE (a, b) { return a > b ? 1 : a < b ? -1 : 0; }\n\nvar SplayTree = function SplayTree(compare, noDuplicates) {\n if ( compare === void 0 ) compare = DEFAULT_COMPARE;\n if ( noDuplicates === void 0 ) noDuplicates = false;\n\n this._compare = compare;\n this._root = null;\n this._size = 0;\n this._noDuplicates = !!noDuplicates;\n};\n\nvar prototypeAccessors = { size: { configurable: true } };\n\n\nSplayTree.prototype.rotateLeft = function rotateLeft (x) {\n var y = x.right;\n if (y) {\n x.right = y.left;\n if (y.left) { y.left.parent = x; }\n y.parent = x.parent;\n }\n\n if (!x.parent) { this._root = y; }\n else if (x === x.parent.left) { x.parent.left = y; }\n else { x.parent.right = y; }\n if (y) { y.left = x; }\n x.parent = y;\n};\n\n\nSplayTree.prototype.rotateRight = function rotateRight (x) {\n var y = x.left;\n if (y) {\n x.left = y.right;\n if (y.right) { y.right.parent = x; }\n y.parent = x.parent;\n }\n\n if (!x.parent) { this._root = y; }\n else if(x === x.parent.left) { x.parent.left = y; }\n else { x.parent.right = y; }\n if (y) { y.right = x; }\n x.parent = y;\n};\n\n\nSplayTree.prototype._splay = function _splay (x) {\n while (x.parent) {\n var p = x.parent;\n if (!p.parent) {\n if (p.left === x) { this.rotateRight(p); }\n else { this.rotateLeft(p); }\n } else if (p.left === x && p.parent.left === p) {\n this.rotateRight(p.parent);\n this.rotateRight(p);\n } else if (p.right === x && p.parent.right === p) {\n this.rotateLeft(p.parent);\n this.rotateLeft(p);\n } else if (p.left === x && p.parent.right === p) {\n this.rotateRight(p);\n this.rotateLeft(p);\n } else {\n this.rotateLeft(p);\n this.rotateRight(p);\n }\n }\n};\n\n\nSplayTree.prototype.splay = function splay (x) {\n var p, gp, ggp, l, r;\n\n while (x.parent) {\n p = x.parent;\n gp = p.parent;\n\n if (gp && gp.parent) {\n ggp = gp.parent;\n if (ggp.left === gp) { ggp.left= x; }\n else { ggp.right = x; }\n x.parent = ggp;\n } else {\n x.parent = null;\n this._root = x;\n }\n\n l = x.left; r = x.right;\n\n if (x === p.left) { // left\n if (gp) {\n if (gp.left === p) {\n /* zig-zig */\n if (p.right) {\n gp.left = p.right;\n gp.left.parent = gp;\n } else { gp.left = null; }\n\n p.right = gp;\n gp.parent = p;\n } else {\n /* zig-zag */\n if (l) {\n gp.right = l;\n l.parent = gp;\n } else { gp.right = null; }\n\n x.left = gp;\n gp.parent = x;\n }\n }\n if (r) {\n p.left = r;\n r.parent = p;\n } else { p.left = null; }\n\n x.right= p;\n p.parent = x;\n } else { // right\n if (gp) {\n if (gp.right === p) {\n /* zig-zig */\n if (p.left) {\n gp.right = p.left;\n gp.right.parent = gp;\n } else { gp.right = null; }\n\n p.left = gp;\n gp.parent = p;\n } else {\n /* zig-zag */\n if (r) {\n gp.left = r;\n r.parent = gp;\n } else { gp.left = null; }\n\n x.right = gp;\n gp.parent = x;\n }\n }\n if (l) {\n p.right = l;\n l.parent = p;\n } else { p.right = null; }\n\n x.left = p;\n p.parent = x;\n }\n }\n};\n\n\nSplayTree.prototype.replace = function replace (u, v) {\n if (!u.parent) { this._root = v; }\n else if (u === u.parent.left) { u.parent.left = v; }\n else { u.parent.right = v; }\n if (v) { v.parent = u.parent; }\n};\n\n\nSplayTree.prototype.minNode = function minNode (u) {\n if ( u === void 0 ) u = this._root;\n\n if (u) { while (u.left) { u = u.left; } }\n return u;\n};\n\n\nSplayTree.prototype.maxNode = function maxNode (u) {\n if ( u === void 0 ) u = this._root;\n\n if (u) { while (u.right) { u = u.right; } }\n return u;\n};\n\n\nSplayTree.prototype.insert = function insert (key, data) {\n var z = this._root;\n var p = null;\n var comp = this._compare;\n var cmp;\n\n if (this._noDuplicates) {\n while (z) {\n p = z;\n cmp = comp(z.key, key);\n if (cmp === 0) { return; }\n else if (comp(z.key, key) < 0) { z = z.right; }\n else { z = z.left; }\n }\n } else {\n while (z) {\n p = z;\n if (comp(z.key, key) < 0) { z = z.right; }\n else { z = z.left; }\n }\n }\n\n z = { key: key, data: data, left: null, right: null, parent: p };\n\n if (!p) { this._root = z; }\n else if (comp(p.key, z.key) < 0) { p.right = z; }\n else { p.left= z; }\n\n this.splay(z);\n this._size++;\n return z;\n};\n\n\nSplayTree.prototype.find = function find (key) {\n var z = this._root;\n var comp = this._compare;\n while (z) {\n var cmp = comp(z.key, key);\n if (cmp < 0) { z = z.right; }\n else if (cmp > 0) { z = z.left; }\n else { return z; }\n }\n return null;\n};\n\n/**\n * Whether the tree contains a node with the given key\n * @param{Key} key\n * @return {boolean} true/false\n */\nSplayTree.prototype.contains = function contains (key) {\n var node = this._root;\n var comparator = this._compare;\n while (node){\n var cmp = comparator(key, node.key);\n if (cmp === 0) { return true; }\n else if (cmp < 0) { node = node.left; }\n else { node = node.right; }\n }\n\n return false;\n};\n\n\nSplayTree.prototype.remove = function remove (key) {\n var z = this.find(key);\n\n if (!z) { return false; }\n\n this.splay(z);\n\n if (!z.left) { this.replace(z, z.right); }\n else if (!z.right) { this.replace(z, z.left); }\n else {\n var y = this.minNode(z.right);\n if (y.parent !== z) {\n this.replace(y, y.right);\n y.right = z.right;\n y.right.parent = y;\n }\n this.replace(z, y);\n y.left = z.left;\n y.left.parent = y;\n }\n\n this._size--;\n return true;\n};\n\n\nSplayTree.prototype.removeNode = function removeNode (z) {\n if (!z) { return false; }\n\n this.splay(z);\n\n if (!z.left) { this.replace(z, z.right); }\n else if (!z.right) { this.replace(z, z.left); }\n else {\n var y = this.minNode(z.right);\n if (y.parent !== z) {\n this.replace(y, y.right);\n y.right = z.right;\n y.right.parent = y;\n }\n this.replace(z, y);\n y.left = z.left;\n y.left.parent = y;\n }\n\n this._size--;\n return true;\n};\n\n\nSplayTree.prototype.erase = function erase (key) {\n var z = this.find(key);\n if (!z) { return; }\n\n this.splay(z);\n\n var s = z.left;\n var t = z.right;\n\n var sMax = null;\n if (s) {\n s.parent = null;\n sMax = this.maxNode(s);\n this.splay(sMax);\n this._root = sMax;\n }\n if (t) {\n if (s) { sMax.right = t; }\n else { this._root = t; }\n t.parent = sMax;\n }\n\n this._size--;\n};\n\n/**\n * Removes and returns the node with smallest key\n * @return {?Node}\n */\nSplayTree.prototype.pop = function pop () {\n var node = this._root, returnValue = null;\n if (node) {\n while (node.left) { node = node.left; }\n returnValue = { key: node.key, data: node.data };\n this.remove(node.key);\n }\n return returnValue;\n};\n\n\n/* eslint-disable class-methods-use-this */\n\n/**\n * Successor node\n * @param{Node} node\n * @return {?Node}\n */\nSplayTree.prototype.next = function next (node) {\n var successor = node;\n if (successor) {\n if (successor.right) {\n successor = successor.right;\n while (successor && successor.left) { successor = successor.left; }\n } else {\n successor = node.parent;\n while (successor && successor.right === node) {\n node = successor; successor = successor.parent;\n }\n }\n }\n return successor;\n};\n\n\n/**\n * Predecessor node\n * @param{Node} node\n * @return {?Node}\n */\nSplayTree.prototype.prev = function prev (node) {\n var predecessor = node;\n if (predecessor) {\n if (predecessor.left) {\n predecessor = predecessor.left;\n while (predecessor && predecessor.right) { predecessor = predecessor.right; }\n } else {\n predecessor = node.parent;\n while (predecessor && predecessor.left === node) {\n node = predecessor;\n predecessor = predecessor.parent;\n }\n }\n }\n return predecessor;\n};\n/* eslint-enable class-methods-use-this */\n\n\n/**\n * @param{forEachCallback} callback\n * @return {SplayTree}\n */\nSplayTree.prototype.forEach = function forEach (callback) {\n var current = this._root;\n var s = [], done = false, i = 0;\n\n while (!done) {\n // Reach the left most Node of the current Node\n if (current) {\n // Place pointer to a tree node on the stack\n // before traversing the node's left subtree\n s.push(current);\n current = current.left;\n } else {\n // BackTrack from the empty subtree and visit the Node\n // at the top of the stack; however, if the stack is\n // empty you are done\n if (s.length > 0) {\n current = s.pop();\n callback(current, i++);\n\n // We have visited the node and its left\n // subtree. Now, it's right subtree's turn\n current = current.right;\n } else { done = true; }\n }\n }\n return this;\n};\n\n\n/**\n * Walk key range from `low` to `high`. Stops if `fn` returns a value.\n * @param{Key} low\n * @param{Key} high\n * @param{Function} fn\n * @param{*?} ctx\n * @return {SplayTree}\n */\nSplayTree.prototype.range = function range (low, high, fn, ctx) {\n var Q = [];\n var compare = this._compare;\n var node = this._root, cmp;\n\n while (Q.length !== 0 || node) {\n if (node) {\n Q.push(node);\n node = node.left;\n } else {\n node = Q.pop();\n cmp = compare(node.key, high);\n if (cmp > 0) {\n break;\n } else if (compare(node.key, low) >= 0) {\n if (fn.call(ctx, node)) { return this; } // stop if smth is returned\n }\n node = node.right;\n }\n }\n return this;\n};\n\n/**\n * Returns all keys in order\n * @return {Array}\n */\nSplayTree.prototype.keys = function keys () {\n var current = this._root;\n var s = [], r = [], done = false;\n\n while (!done) {\n if (current) {\n s.push(current);\n current = current.left;\n } else {\n if (s.length > 0) {\n current = s.pop();\n r.push(current.key);\n current = current.right;\n } else { done = true; }\n }\n }\n return r;\n};\n\n\n/**\n * Returns `data` fields of all nodes in order.\n * @return {Array}\n */\nSplayTree.prototype.values = function values () {\n var current = this._root;\n var s = [], r = [], done = false;\n\n while (!done) {\n if (current) {\n s.push(current);\n current = current.left;\n } else {\n if (s.length > 0) {\n current = s.pop();\n r.push(current.data);\n current = current.right;\n } else { done = true; }\n }\n }\n return r;\n};\n\n\n/**\n * Returns node at given index\n * @param{number} index\n * @return {?Node}\n */\nSplayTree.prototype.at = function at (index) {\n // removed after a consideration, more misleading than useful\n // index = index % this.size;\n // if (index < 0) index = this.size - index;\n\n var current = this._root;\n var s = [], done = false, i = 0;\n\n while (!done) {\n if (current) {\n s.push(current);\n current = current.left;\n } else {\n if (s.length > 0) {\n current = s.pop();\n if (i === index) { return current; }\n i++;\n current = current.right;\n } else { done = true; }\n }\n }\n return null;\n};\n\n/**\n * Bulk-load items. Both array have to be same size\n * @param{Array} keys\n * @param{Array}[values]\n * @param{Boolean} [presort=false] Pre-sort keys and values, using\n * tree's comparator. Sorting is done\n * in-place\n * @return {AVLTree}\n */\nSplayTree.prototype.load = function load (keys, values, presort) {\n if ( keys === void 0 ) keys = [];\n if ( values === void 0 ) values = [];\n if ( presort === void 0 ) presort = false;\n\n if (this._size !== 0) { throw new Error('bulk-load: tree is not empty'); }\n var size = keys.length;\n if (presort) { sort(keys, values, 0, size - 1, this._compare); }\n this._root = loadRecursive(null, keys, values, 0, size);\n this._size = size;\n return this;\n};\n\n\nSplayTree.prototype.min = function min () {\n var node = this.minNode(this._root);\n if (node) { return node.key; }\n else { return null; }\n};\n\n\nSplayTree.prototype.max = function max () {\n var node = this.maxNode(this._root);\n if (node) { return node.key; }\n else { return null; }\n};\n\nSplayTree.prototype.isEmpty = function isEmpty () { return this._root === null; };\nprototypeAccessors.size.get = function () { return this._size; };\n\n\n/**\n * Create a tree and load it with items\n * @param{Array} keys\n * @param{Array?} [values]\n\n * @param{Function?} [comparator]\n * @param{Boolean?} [presort=false] Pre-sort keys and values, using\n * tree's comparator. Sorting is done\n * in-place\n * @param{Boolean?} [noDuplicates=false] Allow duplicates\n * @return {SplayTree}\n */\nSplayTree.createTree = function createTree (keys, values, comparator, presort, noDuplicates) {\n return new SplayTree(comparator, noDuplicates).load(keys, values, presort);\n};\n\nObject.defineProperties( SplayTree.prototype, prototypeAccessors );\n\n\nfunction loadRecursive (parent, keys, values, start, end) {\n var size = end - start;\n if (size > 0) {\n var middle = start + Math.floor(size / 2);\n var key = keys[middle];\n var data = values[middle];\n var node = { key: key, data: data, parent: parent };\n node.left = loadRecursive(node, keys, values, start, middle);\n node.right = loadRecursive(node, keys, values, middle + 1, end);\n return node;\n }\n return null;\n}\n\n\nfunction sort(keys, values, left, right, compare) {\n if (left >= right) { return; }\n\n var pivot = keys[(left + right) >> 1];\n var i = left - 1;\n var j = right + 1;\n\n while (true) {\n do { i++; } while (compare(keys[i], pivot) < 0);\n do { j--; } while (compare(keys[j], pivot) > 0);\n if (i >= j) { break; }\n\n var tmp = keys[i];\n keys[i] = keys[j];\n keys[j] = tmp;\n\n tmp = values[i];\n values[i] = values[j];\n values[j] = tmp;\n }\n\n sort(keys, values, left, j, compare);\n sort(keys, values, j + 1, right, compare);\n}\n\nvar NORMAL = 0;\nvar NON_CONTRIBUTING = 1;\nvar SAME_TRANSITION = 2;\nvar DIFFERENT_TRANSITION = 3;\n\nvar INTERSECTION = 0;\nvar UNION = 1;\nvar DIFFERENCE = 2;\nvar XOR = 3;\n\n/**\n * @param {SweepEvent} event\n * @param {SweepEvent} prev\n * @param {Operation} operation\n */\nfunction computeFields (event, prev, operation) {\n // compute inOut and otherInOut fields\n if (prev === null) {\n event.inOut = false;\n event.otherInOut = true;\n\n // previous line segment in sweepline belongs to the same polygon\n } else {\n if (event.isSubject === prev.isSubject) {\n event.inOut = !prev.inOut;\n event.otherInOut = prev.otherInOut;\n\n // previous line segment in sweepline belongs to the clipping polygon\n } else {\n event.inOut = !prev.otherInOut;\n event.otherInOut = prev.isVertical() ? !prev.inOut : prev.inOut;\n }\n\n // compute prevInResult field\n if (prev) {\n event.prevInResult = (!inResult(prev, operation) || prev.isVertical())\n ? prev.prevInResult : prev;\n }\n }\n\n // check if the line segment belongs to the Boolean operation\n var isInResult = inResult(event, operation);\n if (isInResult) {\n event.resultTransition = determineResultTransition(event, operation);\n } else {\n event.resultTransition = 0;\n }\n}\n\n\n/* eslint-disable indent */\nfunction inResult(event, operation) {\n switch (event.type) {\n case NORMAL:\n switch (operation) {\n case INTERSECTION:\n return !event.otherInOut;\n case UNION:\n return event.otherInOut;\n case DIFFERENCE:\n // return (event.isSubject && !event.otherInOut) ||\n // (!event.isSubject && event.otherInOut);\n return (event.isSubject && event.otherInOut) ||\n (!event.isSubject && !event.otherInOut);\n case XOR:\n return true;\n }\n break;\n case SAME_TRANSITION:\n return operation === INTERSECTION || operation === UNION;\n case DIFFERENT_TRANSITION:\n return operation === DIFFERENCE;\n case NON_CONTRIBUTING:\n return false;\n }\n return false;\n}\n/* eslint-enable indent */\n\n\nfunction determineResultTransition(event, operation) {\n var thisIn = !event.inOut;\n var thatIn = !event.otherInOut;\n\n var isIn;\n switch (operation) {\n case INTERSECTION:\n isIn = thisIn && thatIn; break;\n case UNION:\n isIn = thisIn || thatIn; break;\n case XOR:\n isIn = thisIn ^ thatIn; break;\n case DIFFERENCE:\n if (event.isSubject) {\n isIn = thisIn && !thatIn;\n } else {\n isIn = thatIn && !thisIn;\n }\n break;\n }\n return isIn ? +1 : -1;\n}\n\nvar SweepEvent = function SweepEvent (point, left, otherEvent, isSubject, edgeType) {\n\n /**\n * Is left endpoint?\n * @type {Boolean}\n */\n this.left = left;\n\n /**\n * @type {Array.}\n */\n this.point = point;\n\n /**\n * Other edge reference\n * @type {SweepEvent}\n */\n this.otherEvent = otherEvent;\n\n /**\n * Belongs to source or clipping polygon\n * @type {Boolean}\n */\n this.isSubject = isSubject;\n\n /**\n * Edge contribution type\n * @type {Number}\n */\n this.type = edgeType || NORMAL;\n\n\n /**\n * In-out transition for the sweepline crossing polygon\n * @type {Boolean}\n */\n this.inOut = false;\n\n\n /**\n * @type {Boolean}\n */\n this.otherInOut = false;\n\n /**\n * Previous event in result?\n * @type {SweepEvent}\n */\n this.prevInResult = null;\n\n /**\n * Type of result transition (0 = not in result, +1 = out-in, -1, in-out)\n * @type {Number}\n */\n this.resultTransition = 0;\n\n // connection step\n\n /**\n * @type {Number}\n */\n this.otherPos = -1;\n\n /**\n * @type {Number}\n */\n this.outputContourId = -1;\n\n this.isExteriorRing = true; // TODO: Looks unused, remove?\n};\n\nvar prototypeAccessors$1 = { inResult: { configurable: true } };\n\n\n/**\n * @param{Array.}p\n * @return {Boolean}\n */\nSweepEvent.prototype.isBelow = function isBelow (p) {\n var p0 = this.point, p1 = this.otherEvent.point;\n return this.left\n ? (p0[0] - p[0]) * (p1[1] - p[1]) - (p1[0] - p[0]) * (p0[1] - p[1]) > 0\n // signedArea(this.point, this.otherEvent.point, p) > 0 :\n : (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0;\n //signedArea(this.otherEvent.point, this.point, p) > 0;\n};\n\n\n/**\n * @param{Array.}p\n * @return {Boolean}\n */\nSweepEvent.prototype.isAbove = function isAbove (p) {\n return !this.isBelow(p);\n};\n\n\n/**\n * @return {Boolean}\n */\nSweepEvent.prototype.isVertical = function isVertical () {\n return this.point[0] === this.otherEvent.point[0];\n};\n\n\n/**\n * Does event belong to result?\n * @return {Boolean}\n */\nprototypeAccessors$1.inResult.get = function () {\n return this.resultTransition !== 0;\n};\n\n\nSweepEvent.prototype.clone = function clone () {\n var copy = new SweepEvent(\n this.point, this.left, this.otherEvent, this.isSubject, this.type);\n\n copy.contourId = this.contourId;\n copy.resultTransition = this.resultTransition;\n copy.prevInResult = this.prevInResult;\n copy.isExteriorRing = this.isExteriorRing;\n copy.inOut = this.inOut;\n copy.otherInOut = this.otherInOut;\n\n return copy;\n};\n\nObject.defineProperties( SweepEvent.prototype, prototypeAccessors$1 );\n\nfunction equals(p1, p2) {\n if (p1[0] === p2[0]) {\n if (p1[1] === p2[1]) {\n return true;\n } else {\n return false;\n }\n }\n return false;\n}\n\n// const EPSILON = 1e-9;\n// const abs = Math.abs;\n// TODO https://github.com/w8r/martinez/issues/6#issuecomment-262847164\n// Precision problem.\n//\n// module.exports = function equals(p1, p2) {\n// return abs(p1[0] - p2[0]) <= EPSILON && abs(p1[1] - p2[1]) <= EPSILON;\n// };\n\nvar epsilon = 1.1102230246251565e-16;\nvar splitter = 134217729;\nvar resulterrbound = (3 + 8 * epsilon) * epsilon;\n\n// fast_expansion_sum_zeroelim routine from oritinal code\nfunction sum(elen, e, flen, f, h) {\n var Q, Qnew, hh, bvirt;\n var enow = e[0];\n var fnow = f[0];\n var eindex = 0;\n var findex = 0;\n if ((fnow > enow) === (fnow > -enow)) {\n Q = enow;\n enow = e[++eindex];\n } else {\n Q = fnow;\n fnow = f[++findex];\n }\n var hindex = 0;\n if (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = enow + Q;\n hh = Q - (Qnew - enow);\n enow = e[++eindex];\n } else {\n Qnew = fnow + Q;\n hh = Q - (Qnew - fnow);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n while (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n } else {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n }\n while (eindex < elen) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n while (findex < flen) {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nfunction estimate(elen, e) {\n var Q = e[0];\n for (var i = 1; i < elen; i++) { Q += e[i]; }\n return Q;\n}\n\nfunction vec(n) {\n return new Float64Array(n);\n}\n\nvar ccwerrboundA = (3 + 16 * epsilon) * epsilon;\nvar ccwerrboundB = (2 + 12 * epsilon) * epsilon;\nvar ccwerrboundC = (9 + 64 * epsilon) * epsilon * epsilon;\n\nvar B = vec(4);\nvar C1 = vec(8);\nvar C2 = vec(12);\nvar D = vec(16);\nvar u = vec(4);\n\nfunction orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {\n var acxtail, acytail, bcxtail, bcytail;\n var bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n var acx = ax - cx;\n var bcx = bx - cx;\n var acy = ay - cy;\n var bcy = by - cy;\n\n s1 = acx * bcy;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcx;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n B[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n B[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n B[2] = _j - (u3 - bvirt) + (_i - bvirt);\n B[3] = u3;\n\n var det = estimate(4, B);\n var errbound = ccwerrboundB * detsum;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - acx;\n acxtail = ax - (acx + bvirt) + (bvirt - cx);\n bvirt = bx - bcx;\n bcxtail = bx - (bcx + bvirt) + (bvirt - cx);\n bvirt = ay - acy;\n acytail = ay - (acy + bvirt) + (bvirt - cy);\n bvirt = by - bcy;\n bcytail = by - (bcy + bvirt) + (bvirt - cy);\n\n if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) {\n return det;\n }\n\n errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det);\n det += (acx * bcytail + bcy * acxtail) - (acy * bcxtail + bcx * acytail);\n if (det >= errbound || -det >= errbound) { return det; }\n\n s1 = acxtail * bcy;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcx;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n var C1len = sum(4, B, 4, u, C1);\n\n s1 = acx * bcytail;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcxtail;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n var C2len = sum(C1len, C1, 4, u, C2);\n\n s1 = acxtail * bcytail;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcxtail;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n var Dlen = sum(C2len, C2, 4, u, D);\n\n return D[Dlen - 1];\n}\n\nfunction orient2d(ax, ay, bx, by, cx, cy) {\n var detleft = (ay - cy) * (bx - cx);\n var detright = (ax - cx) * (by - cy);\n var det = detleft - detright;\n\n if (detleft === 0 || detright === 0 || (detleft > 0) !== (detright > 0)) { return det; }\n\n var detsum = Math.abs(detleft + detright);\n if (Math.abs(det) >= ccwerrboundA * detsum) { return det; }\n\n return -orient2dadapt(ax, ay, bx, by, cx, cy, detsum);\n}\n\n/**\n * Signed area of the triangle (p0, p1, p2)\n * @param {Array.} p0\n * @param {Array.} p1\n * @param {Array.} p2\n * @return {Number}\n */\nfunction signedArea(p0, p1, p2) {\n var res = orient2d(p0[0], p0[1], p1[0], p1[1], p2[0], p2[1]);\n if (res > 0) { return -1; }\n if (res < 0) { return 1; }\n return 0;\n}\n\n/**\n * @param {SweepEvent} e1\n * @param {SweepEvent} e2\n * @return {Number}\n */\nfunction compareEvents(e1, e2) {\n var p1 = e1.point;\n var p2 = e2.point;\n\n // Different x-coordinate\n if (p1[0] > p2[0]) { return 1; }\n if (p1[0] < p2[0]) { return -1; }\n\n // Different points, but same x-coordinate\n // Event with lower y-coordinate is processed first\n if (p1[1] !== p2[1]) { return p1[1] > p2[1] ? 1 : -1; }\n\n return specialCases(e1, e2, p1);\n}\n\n\n/* eslint-disable no-unused-vars */\nfunction specialCases(e1, e2, p1, p2) {\n // Same coordinates, but one is a left endpoint and the other is\n // a right endpoint. The right endpoint is processed first\n if (e1.left !== e2.left)\n { return e1.left ? 1 : -1; }\n\n // const p2 = e1.otherEvent.point, p3 = e2.otherEvent.point;\n // const sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1])\n // Same coordinates, both events\n // are left endpoints or right endpoints.\n // not collinear\n if (signedArea(p1, e1.otherEvent.point, e2.otherEvent.point) !== 0) {\n // the event associate to the bottom segment is processed first\n return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1;\n }\n\n return (!e1.isSubject && e2.isSubject) ? 1 : -1;\n}\n/* eslint-enable no-unused-vars */\n\n/**\n * @param {SweepEvent} se\n * @param {Array.} p\n * @param {Queue} queue\n * @return {Queue}\n */\nfunction divideSegment(se, p, queue) {\n var r = new SweepEvent(p, false, se, se.isSubject);\n var l = new SweepEvent(p, true, se.otherEvent, se.isSubject);\n\n /* eslint-disable no-console */\n if (equals(se.point, se.otherEvent.point)) {\n console.warn('what is that, a collapsed segment?', se);\n }\n /* eslint-enable no-console */\n\n r.contourId = l.contourId = se.contourId;\n\n // avoid a rounding error. The left event would be processed after the right event\n if (compareEvents(l, se.otherEvent) > 0) {\n se.otherEvent.left = true;\n l.left = false;\n }\n\n // avoid a rounding error. The left event would be processed after the right event\n // if (compareEvents(se, r) > 0) {}\n\n se.otherEvent.otherEvent = l;\n se.otherEvent = r;\n\n queue.push(l);\n queue.push(r);\n\n return queue;\n}\n\n//const EPS = 1e-9;\n\n/**\n * Finds the magnitude of the cross product of two vectors (if we pretend\n * they're in three dimensions)\n *\n * @param {Object} a First vector\n * @param {Object} b Second vector\n * @private\n * @returns {Number} The magnitude of the cross product\n */\nfunction crossProduct(a, b) {\n return (a[0] * b[1]) - (a[1] * b[0]);\n}\n\n/**\n * Finds the dot product of two vectors.\n *\n * @param {Object} a First vector\n * @param {Object} b Second vector\n * @private\n * @returns {Number} The dot product\n */\nfunction dotProduct(a, b) {\n return (a[0] * b[0]) + (a[1] * b[1]);\n}\n\n/**\n * Finds the intersection (if any) between two line segments a and b, given the\n * line segments' end points a1, a2 and b1, b2.\n *\n * This algorithm is based on Schneider and Eberly.\n * http://www.cimec.org.ar/~ncalvo/Schneider_Eberly.pdf\n * Page 244.\n *\n * @param {Array.} a1 point of first line\n * @param {Array.} a2 point of first line\n * @param {Array.} b1 point of second line\n * @param {Array.} b2 point of second line\n * @param {Boolean=} noEndpointTouch whether to skip single touchpoints\n * (meaning connected segments) as\n * intersections\n * @returns {Array.>|Null} If the lines intersect, the point of\n * intersection. If they overlap, the two end points of the overlapping segment.\n * Otherwise, null.\n */\nfunction intersection (a1, a2, b1, b2, noEndpointTouch) {\n // The algorithm expects our lines in the form P + sd, where P is a point,\n // s is on the interval [0, 1], and d is a vector.\n // We are passed two points. P can be the first point of each pair. The\n // vector, then, could be thought of as the distance (in x and y components)\n // from the first point to the second point.\n // So first, let's make our vectors:\n var va = [a2[0] - a1[0], a2[1] - a1[1]];\n var vb = [b2[0] - b1[0], b2[1] - b1[1]];\n // We also define a function to convert back to regular point form:\n\n /* eslint-disable arrow-body-style */\n\n function toPoint(p, s, d) {\n return [\n p[0] + s * d[0],\n p[1] + s * d[1]\n ];\n }\n\n /* eslint-enable arrow-body-style */\n\n // The rest is pretty much a straight port of the algorithm.\n var e = [b1[0] - a1[0], b1[1] - a1[1]];\n var kross = crossProduct(va, vb);\n var sqrKross = kross * kross;\n var sqrLenA = dotProduct(va, va);\n //const sqrLenB = dotProduct(vb, vb);\n\n // Check for line intersection. This works because of the properties of the\n // cross product -- specifically, two vectors are parallel if and only if the\n // cross product is the 0 vector. The full calculation involves relative error\n // to account for possible very small line segments. See Schneider & Eberly\n // for details.\n if (sqrKross > 0/* EPS * sqrLenB * sqLenA */) {\n // If they're not parallel, then (because these are line segments) they\n // still might not actually intersect. This code checks that the\n // intersection point of the lines is actually on both line segments.\n var s = crossProduct(e, vb) / kross;\n if (s < 0 || s > 1) {\n // not on line segment a\n return null;\n }\n var t = crossProduct(e, va) / kross;\n if (t < 0 || t > 1) {\n // not on line segment b\n return null;\n }\n if (s === 0 || s === 1) {\n // on an endpoint of line segment a\n return noEndpointTouch ? null : [toPoint(a1, s, va)];\n }\n if (t === 0 || t === 1) {\n // on an endpoint of line segment b\n return noEndpointTouch ? null : [toPoint(b1, t, vb)];\n }\n return [toPoint(a1, s, va)];\n }\n\n // If we've reached this point, then the lines are either parallel or the\n // same, but the segments could overlap partially or fully, or not at all.\n // So we need to find the overlap, if any. To do that, we can use e, which is\n // the (vector) difference between the two initial points. If this is parallel\n // with the line itself, then the two lines are the same line, and there will\n // be overlap.\n //const sqrLenE = dotProduct(e, e);\n kross = crossProduct(e, va);\n sqrKross = kross * kross;\n\n if (sqrKross > 0 /* EPS * sqLenB * sqLenE */) {\n // Lines are just parallel, not the same. No overlap.\n return null;\n }\n\n var sa = dotProduct(va, e) / sqrLenA;\n var sb = sa + dotProduct(va, vb) / sqrLenA;\n var smin = Math.min(sa, sb);\n var smax = Math.max(sa, sb);\n\n // this is, essentially, the FindIntersection acting on floats from\n // Schneider & Eberly, just inlined into this function.\n if (smin <= 1 && smax >= 0) {\n\n // overlap on an end point\n if (smin === 1) {\n return noEndpointTouch ? null : [toPoint(a1, smin > 0 ? smin : 0, va)];\n }\n\n if (smax === 0) {\n return noEndpointTouch ? null : [toPoint(a1, smax < 1 ? smax : 1, va)];\n }\n\n if (noEndpointTouch && smin === 0 && smax === 1) { return null; }\n\n // There's overlap on a segment -- two points of intersection. Return both.\n return [\n toPoint(a1, smin > 0 ? smin : 0, va),\n toPoint(a1, smax < 1 ? smax : 1, va)\n ];\n }\n\n return null;\n}\n\n/**\n * @param {SweepEvent} se1\n * @param {SweepEvent} se2\n * @param {Queue} queue\n * @return {Number}\n */\nfunction possibleIntersection (se1, se2, queue) {\n // that disallows self-intersecting polygons,\n // did cost us half a day, so I'll leave it\n // out of respect\n // if (se1.isSubject === se2.isSubject) return;\n var inter = intersection(\n se1.point, se1.otherEvent.point,\n se2.point, se2.otherEvent.point\n );\n\n var nintersections = inter ? inter.length : 0;\n if (nintersections === 0) { return 0; } // no intersection\n\n // the line segments intersect at an endpoint of both line segments\n if ((nintersections === 1) &&\n (equals(se1.point, se2.point) ||\n equals(se1.otherEvent.point, se2.otherEvent.point))) {\n return 0;\n }\n\n if (nintersections === 2 && se1.isSubject === se2.isSubject) {\n // if(se1.contourId === se2.contourId){\n // console.warn('Edges of the same polygon overlap',\n // se1.point, se1.otherEvent.point, se2.point, se2.otherEvent.point);\n // }\n //throw new Error('Edges of the same polygon overlap');\n return 0;\n }\n\n // The line segments associated to se1 and se2 intersect\n if (nintersections === 1) {\n\n // if the intersection point is not an endpoint of se1\n if (!equals(se1.point, inter[0]) && !equals(se1.otherEvent.point, inter[0])) {\n divideSegment(se1, inter[0], queue);\n }\n\n // if the intersection point is not an endpoint of se2\n if (!equals(se2.point, inter[0]) && !equals(se2.otherEvent.point, inter[0])) {\n divideSegment(se2, inter[0], queue);\n }\n return 1;\n }\n\n // The line segments associated to se1 and se2 overlap\n var events = [];\n var leftCoincide = false;\n var rightCoincide = false;\n\n if (equals(se1.point, se2.point)) {\n leftCoincide = true; // linked\n } else if (compareEvents(se1, se2) === 1) {\n events.push(se2, se1);\n } else {\n events.push(se1, se2);\n }\n\n if (equals(se1.otherEvent.point, se2.otherEvent.point)) {\n rightCoincide = true;\n } else if (compareEvents(se1.otherEvent, se2.otherEvent) === 1) {\n events.push(se2.otherEvent, se1.otherEvent);\n } else {\n events.push(se1.otherEvent, se2.otherEvent);\n }\n\n if ((leftCoincide && rightCoincide) || leftCoincide) {\n // both line segments are equal or share the left endpoint\n se2.type = NON_CONTRIBUTING;\n se1.type = (se2.inOut === se1.inOut)\n ? SAME_TRANSITION : DIFFERENT_TRANSITION;\n\n if (leftCoincide && !rightCoincide) {\n // honestly no idea, but changing events selection from [2, 1]\n // to [0, 1] fixes the overlapping self-intersecting polygons issue\n divideSegment(events[1].otherEvent, events[0].point, queue);\n }\n return 2;\n }\n\n // the line segments share the right endpoint\n if (rightCoincide) {\n divideSegment(events[0], events[1].point, queue);\n return 3;\n }\n\n // no line segment includes totally the other one\n if (events[0] !== events[3].otherEvent) {\n divideSegment(events[0], events[1].point, queue);\n divideSegment(events[1], events[2].point, queue);\n return 3;\n }\n\n // one line segment includes the other one\n divideSegment(events[0], events[1].point, queue);\n divideSegment(events[3].otherEvent, events[2].point, queue);\n\n return 3;\n}\n\n/**\n * @param {SweepEvent} le1\n * @param {SweepEvent} le2\n * @return {Number}\n */\nfunction compareSegments(le1, le2) {\n if (le1 === le2) { return 0; }\n\n // Segments are not collinear\n if (signedArea(le1.point, le1.otherEvent.point, le2.point) !== 0 ||\n signedArea(le1.point, le1.otherEvent.point, le2.otherEvent.point) !== 0) {\n\n // If they share their left endpoint use the right endpoint to sort\n if (equals(le1.point, le2.point)) { return le1.isBelow(le2.otherEvent.point) ? -1 : 1; }\n\n // Different left endpoint: use the left endpoint to sort\n if (le1.point[0] === le2.point[0]) { return le1.point[1] < le2.point[1] ? -1 : 1; }\n\n // has the line segment associated to e1 been inserted\n // into S after the line segment associated to e2 ?\n if (compareEvents(le1, le2) === 1) { return le2.isAbove(le1.point) ? -1 : 1; }\n\n // The line segment associated to e2 has been inserted\n // into S after the line segment associated to e1\n return le1.isBelow(le2.point) ? -1 : 1;\n }\n\n if (le1.isSubject === le2.isSubject) { // same polygon\n var p1 = le1.point, p2 = le2.point;\n if (p1[0] === p2[0] && p1[1] === p2[1]/*equals(le1.point, le2.point)*/) {\n p1 = le1.otherEvent.point; p2 = le2.otherEvent.point;\n if (p1[0] === p2[0] && p1[1] === p2[1]) { return 0; }\n else { return le1.contourId > le2.contourId ? 1 : -1; }\n }\n } else { // Segments are collinear, but belong to separate polygons\n return le1.isSubject ? -1 : 1;\n }\n\n return compareEvents(le1, le2) === 1 ? 1 : -1;\n}\n\nfunction subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation) {\n var sweepLine = new SplayTree(compareSegments);\n var sortedEvents = [];\n\n var rightbound = Math.min(sbbox[2], cbbox[2]);\n\n var prev, next, begin;\n\n while (eventQueue.length !== 0) {\n var event = eventQueue.pop();\n sortedEvents.push(event);\n\n // optimization by bboxes for intersection and difference goes here\n if ((operation === INTERSECTION && event.point[0] > rightbound) ||\n (operation === DIFFERENCE && event.point[0] > sbbox[2])) {\n break;\n }\n\n if (event.left) {\n next = prev = sweepLine.insert(event);\n begin = sweepLine.minNode();\n\n if (prev !== begin) { prev = sweepLine.prev(prev); }\n else { prev = null; }\n\n next = sweepLine.next(next);\n\n var prevEvent = prev ? prev.key : null;\n var prevprevEvent = (void 0);\n computeFields(event, prevEvent, operation);\n if (next) {\n if (possibleIntersection(event, next.key, eventQueue) === 2) {\n computeFields(event, prevEvent, operation);\n computeFields(event, next.key, operation);\n }\n }\n\n if (prev) {\n if (possibleIntersection(prev.key, event, eventQueue) === 2) {\n var prevprev = prev;\n if (prevprev !== begin) { prevprev = sweepLine.prev(prevprev); }\n else { prevprev = null; }\n\n prevprevEvent = prevprev ? prevprev.key : null;\n computeFields(prevEvent, prevprevEvent, operation);\n computeFields(event, prevEvent, operation);\n }\n }\n } else {\n event = event.otherEvent;\n next = prev = sweepLine.find(event);\n\n if (prev && next) {\n\n if (prev !== begin) { prev = sweepLine.prev(prev); }\n else { prev = null; }\n\n next = sweepLine.next(next);\n sweepLine.remove(event);\n\n if (next && prev) {\n possibleIntersection(prev.key, next.key, eventQueue);\n }\n }\n }\n }\n return sortedEvents;\n}\n\nvar Contour = function Contour() {\n this.points = [];\n this.holeIds = [];\n this.holeOf = null;\n this.depth = null;\n};\n\nContour.prototype.isExterior = function isExterior () {\n return this.holeOf == null;\n};\n\n/**\n * @param {Array.} sortedEvents\n * @return {Array.}\n */\nfunction orderEvents(sortedEvents) {\n var event, i, len, tmp;\n var resultEvents = [];\n for (i = 0, len = sortedEvents.length; i < len; i++) {\n event = sortedEvents[i];\n if ((event.left && event.inResult) ||\n (!event.left && event.otherEvent.inResult)) {\n resultEvents.push(event);\n }\n }\n // Due to overlapping edges the resultEvents array can be not wholly sorted\n var sorted = false;\n while (!sorted) {\n sorted = true;\n for (i = 0, len = resultEvents.length; i < len; i++) {\n if ((i + 1) < len &&\n compareEvents(resultEvents[i], resultEvents[i + 1]) === 1) {\n tmp = resultEvents[i];\n resultEvents[i] = resultEvents[i + 1];\n resultEvents[i + 1] = tmp;\n sorted = false;\n }\n }\n }\n\n\n for (i = 0, len = resultEvents.length; i < len; i++) {\n event = resultEvents[i];\n event.otherPos = i;\n }\n\n // imagine, the right event is found in the beginning of the queue,\n // when his left counterpart is not marked yet\n for (i = 0, len = resultEvents.length; i < len; i++) {\n event = resultEvents[i];\n if (!event.left) {\n tmp = event.otherPos;\n event.otherPos = event.otherEvent.otherPos;\n event.otherEvent.otherPos = tmp;\n }\n }\n\n return resultEvents;\n}\n\n\n/**\n * @param {Number} pos\n * @param {Array.} resultEvents\n * @param {Object>} processed\n * @return {Number}\n */\nfunction nextPos(pos, resultEvents, processed, origPos) {\n var newPos = pos + 1,\n p = resultEvents[pos].point,\n p1;\n var length = resultEvents.length;\n\n if (newPos < length)\n { p1 = resultEvents[newPos].point; }\n\n while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) {\n if (!processed[newPos]) {\n return newPos;\n } else {\n newPos++;\n }\n p1 = resultEvents[newPos].point;\n }\n\n newPos = pos - 1;\n\n while (processed[newPos] && newPos > origPos) {\n newPos--;\n }\n\n return newPos;\n}\n\n\nfunction initializeContourFromContext(event, contours, contourId) {\n var contour = new Contour();\n if (event.prevInResult != null) {\n var prevInResult = event.prevInResult;\n // Note that it is valid to query the \"previous in result\" for its output contour id,\n // because we must have already processed it (i.e., assigned an output contour id)\n // in an earlier iteration, otherwise it wouldn't be possible that it is \"previous in\n // result\".\n var lowerContourId = prevInResult.outputContourId;\n var lowerResultTransition = prevInResult.resultTransition;\n if (lowerResultTransition > 0) {\n // We are inside. Now we have to check if the thing below us is another hole or\n // an exterior contour.\n var lowerContour = contours[lowerContourId];\n if (lowerContour.holeOf != null) {\n // The lower contour is a hole => Connect the new contour as a hole to its parent,\n // and use same depth.\n var parentContourId = lowerContour.holeOf;\n contours[parentContourId].holeIds.push(contourId);\n contour.holeOf = parentContourId;\n contour.depth = contours[lowerContourId].depth;\n } else {\n // The lower contour is an exterior contour => Connect the new contour as a hole,\n // and increment depth.\n contours[lowerContourId].holeIds.push(contourId);\n contour.holeOf = lowerContourId;\n contour.depth = contours[lowerContourId].depth + 1;\n }\n } else {\n // We are outside => this contour is an exterior contour of same depth.\n contour.holeOf = null;\n contour.depth = contours[lowerContourId].depth;\n }\n } else {\n // There is no lower/previous contour => this contour is an exterior contour of depth 0.\n contour.holeOf = null;\n contour.depth = 0;\n }\n return contour;\n}\n\n/**\n * @param {Array.} sortedEvents\n * @return {Array.<*>} polygons\n */\nfunction connectEdges(sortedEvents) {\n var i, len;\n var resultEvents = orderEvents(sortedEvents);\n\n // \"false\"-filled array\n var processed = {};\n var contours = [];\n\n var loop = function ( ) {\n\n if (processed[i]) {\n return;\n }\n\n var contourId = contours.length;\n var contour = initializeContourFromContext(resultEvents[i], contours, contourId);\n\n // Helper function that combines marking an event as processed with assigning its output contour ID\n var markAsProcessed = function (pos) {\n processed[pos] = true;\n resultEvents[pos].outputContourId = contourId;\n };\n\n var pos = i;\n var origPos = i;\n\n var initial = resultEvents[i].point;\n contour.points.push(initial);\n\n /* eslint no-constant-condition: \"off\" */\n while (true) {\n markAsProcessed(pos);\n\n pos = resultEvents[pos].otherPos;\n\n markAsProcessed(pos);\n contour.points.push(resultEvents[pos].point);\n\n pos = nextPos(pos, resultEvents, processed, origPos);\n\n if (pos == origPos) {\n break;\n }\n }\n\n contours.push(contour);\n };\n\n for (i = 0, len = resultEvents.length; i < len; i++) loop( );\n\n return contours;\n}\n\nvar _tinyqueue_1_2_3_tinyqueue = TinyQueue;\nvar default_1 = TinyQueue;\n\nfunction TinyQueue(data, compare) {\n if (!(this instanceof TinyQueue)) { return new TinyQueue(data, compare); }\n\n this.data = data || [];\n this.length = this.data.length;\n this.compare = compare || defaultCompare;\n\n if (this.length > 0) {\n for (var i = (this.length >> 1) - 1; i >= 0; i--) { this._down(i); }\n }\n}\n\nfunction defaultCompare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\nTinyQueue.prototype = {\n\n push: function (item) {\n this.data.push(item);\n this.length++;\n this._up(this.length - 1);\n },\n\n pop: function () {\n if (this.length === 0) { return undefined; }\n\n var top = this.data[0];\n this.length--;\n\n if (this.length > 0) {\n this.data[0] = this.data[this.length];\n this._down(0);\n }\n this.data.pop();\n\n return top;\n },\n\n peek: function () {\n return this.data[0];\n },\n\n _up: function (pos) {\n var data = this.data;\n var compare = this.compare;\n var item = data[pos];\n\n while (pos > 0) {\n var parent = (pos - 1) >> 1;\n var current = data[parent];\n if (compare(item, current) >= 0) { break; }\n data[pos] = current;\n pos = parent;\n }\n\n data[pos] = item;\n },\n\n _down: function (pos) {\n var data = this.data;\n var compare = this.compare;\n var halfLength = this.length >> 1;\n var item = data[pos];\n\n while (pos < halfLength) {\n var left = (pos << 1) + 1;\n var right = left + 1;\n var best = data[left];\n\n if (right < this.length && compare(data[right], best) < 0) {\n left = right;\n best = data[right];\n }\n if (compare(best, item) >= 0) { break; }\n\n data[pos] = best;\n pos = left;\n }\n\n data[pos] = item;\n }\n};\n_tinyqueue_1_2_3_tinyqueue.default = default_1;\n\nvar max = Math.max;\nvar min = Math.min;\n\nvar contourId = 0;\n\n\nfunction processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) {\n var i, len, s1, s2, e1, e2;\n for (i = 0, len = contourOrHole.length - 1; i < len; i++) {\n s1 = contourOrHole[i];\n s2 = contourOrHole[i + 1];\n e1 = new SweepEvent(s1, false, undefined, isSubject);\n e2 = new SweepEvent(s2, false, e1, isSubject);\n e1.otherEvent = e2;\n\n if (s1[0] === s2[0] && s1[1] === s2[1]) {\n continue; // skip collapsed edges, or it breaks\n }\n\n e1.contourId = e2.contourId = depth;\n if (!isExteriorRing) {\n e1.isExteriorRing = false;\n e2.isExteriorRing = false;\n }\n if (compareEvents(e1, e2) > 0) {\n e2.left = true;\n } else {\n e1.left = true;\n }\n\n var x = s1[0], y = s1[1];\n bbox[0] = min(bbox[0], x);\n bbox[1] = min(bbox[1], y);\n bbox[2] = max(bbox[2], x);\n bbox[3] = max(bbox[3], y);\n\n // Pushing it so the queue is sorted from left to right,\n // with object on the left having the highest priority.\n Q.push(e1);\n Q.push(e2);\n }\n}\n\n\nfunction fillQueue(subject, clipping, sbbox, cbbox, operation) {\n var eventQueue = new _tinyqueue_1_2_3_tinyqueue(null, compareEvents);\n var polygonSet, isExteriorRing, i, ii, j, jj; //, k, kk;\n\n for (i = 0, ii = subject.length; i < ii; i++) {\n polygonSet = subject[i];\n for (j = 0, jj = polygonSet.length; j < jj; j++) {\n isExteriorRing = j === 0;\n if (isExteriorRing) { contourId++; }\n processPolygon(polygonSet[j], true, contourId, eventQueue, sbbox, isExteriorRing);\n }\n }\n\n for (i = 0, ii = clipping.length; i < ii; i++) {\n polygonSet = clipping[i];\n for (j = 0, jj = polygonSet.length; j < jj; j++) {\n isExteriorRing = j === 0;\n if (operation === DIFFERENCE) { isExteriorRing = false; }\n if (isExteriorRing) { contourId++; }\n processPolygon(polygonSet[j], false, contourId, eventQueue, cbbox, isExteriorRing);\n }\n }\n\n return eventQueue;\n}\n\nvar EMPTY = [];\n\n\nfunction trivialOperation(subject, clipping, operation) {\n var result = null;\n if (subject.length * clipping.length === 0) {\n if (operation === INTERSECTION) {\n result = EMPTY;\n } else if (operation === DIFFERENCE) {\n result = subject;\n } else if (operation === UNION ||\n operation === XOR) {\n result = (subject.length === 0) ? clipping : subject;\n }\n }\n return result;\n}\n\n\nfunction compareBBoxes(subject, clipping, sbbox, cbbox, operation) {\n var result = null;\n if (sbbox[0] > cbbox[2] ||\n cbbox[0] > sbbox[2] ||\n sbbox[1] > cbbox[3] ||\n cbbox[1] > sbbox[3]) {\n if (operation === INTERSECTION) {\n result = EMPTY;\n } else if (operation === DIFFERENCE) {\n result = subject;\n } else if (operation === UNION ||\n operation === XOR) {\n result = subject.concat(clipping);\n }\n }\n return result;\n}\n\n\nfunction boolean(subject, clipping, operation) {\n if (typeof subject[0][0][0] === 'number') {\n subject = [subject];\n }\n if (typeof clipping[0][0][0] === 'number') {\n clipping = [clipping];\n }\n var trivial = trivialOperation(subject, clipping, operation);\n if (trivial) {\n return trivial === EMPTY ? null : trivial;\n }\n var sbbox = [Infinity, Infinity, -Infinity, -Infinity];\n var cbbox = [Infinity, Infinity, -Infinity, -Infinity];\n\n // console.time('fill queue');\n var eventQueue = fillQueue(subject, clipping, sbbox, cbbox, operation);\n //console.timeEnd('fill queue');\n\n trivial = compareBBoxes(subject, clipping, sbbox, cbbox, operation);\n if (trivial) {\n return trivial === EMPTY ? null : trivial;\n }\n // console.time('subdivide edges');\n var sortedEvents = subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation);\n //console.timeEnd('subdivide edges');\n\n // console.time('connect vertices');\n var contours = connectEdges(sortedEvents);\n //console.timeEnd('connect vertices');\n\n // Convert contours to polygons\n var polygons = [];\n for (var i = 0; i < contours.length; i++) {\n var contour = contours[i];\n if (contour.isExterior()) {\n // The exterior ring goes first\n var rings = [contour.points];\n // Followed by holes if any\n for (var j = 0; j < contour.holeIds.length; j++) {\n var holeId = contour.holeIds[j];\n rings.push(contours[holeId].points);\n }\n polygons.push(rings);\n }\n }\n\n return polygons;\n}\n\nfunction union (subject, clipping) {\n return boolean(subject, clipping, UNION);\n}\n\nfunction diff (subject, clipping) {\n return boolean(subject, clipping, DIFFERENCE);\n}\n\nfunction xor (subject, clipping) {\n return boolean(subject, clipping, XOR);\n}\n\nfunction intersection$1 (subject, clipping) {\n return boolean(subject, clipping, INTERSECTION);\n}\n\n/**\n * @enum {Number}\n */\nvar operations = { UNION: UNION, DIFFERENCE: DIFFERENCE, INTERSECTION: INTERSECTION, XOR: XOR };\n\nexport { diff, intersection$1 as intersection, operations, union, xor };\n//# sourceMappingURL=martinez.es.js.map\n","import matrix from './matrix';\nimport tar from './tar';\nimport vector from './vector';\nimport geom from './geom';\nimport { union, diff, intersection, xor } from './martinez';\n\nexport default {\n matrix,\n tar,\n vector,\n geom,\n booleanOperations: {\n union,\n diff,\n intersection,\n xor,\n },\n};\n","import unit from '../style/unit';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport math from '../math/index';\n\nconst { STYLE_KEY: {\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n SKEW_X,\n SKEW_Y,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n ROTATE_3D,\n PERSPECTIVE,\n MATRIX,\n FONT_SIZE,\n}} = enums;\nconst { PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit;\nconst { matrix, geom } = math;\nconst { identity, multiply, isE } = matrix;\nconst { d2r } = geom;\n\nfunction calSingle(t, k, v) {\n if(k === TRANSLATE_X) {\n t[12] = v;\n }\n else if(k === TRANSLATE_Y) {\n t[13] = v;\n }\n else if(k === TRANSLATE_Z) {\n t[14] = v;\n }\n else if(k === SCALE_X) {\n t[0] = v;\n }\n else if(k === SCALE_Y) {\n t[5] = v;\n }\n else if(k === SCALE_Z) {\n t[10] = v;\n }\n else if(k === SKEW_X) {\n v = d2r(v);\n t[4] = Math.tan(v);\n }\n else if(k === SKEW_Y) {\n v = d2r(v);\n t[1] = Math.tan(v);\n }\n else if(k === ROTATE_X) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[5] = t[10] = cos;\n t[6] = sin;\n t[9] = -sin;\n }\n else if(k === ROTATE_Y) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[10] = cos;\n t[8] = sin;\n t[2] = -sin;\n }\n else if(k === ROTATE_Z) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[5] = cos;\n t[1] = sin;\n t[4] = -sin;\n }\n else if(k === ROTATE_3D) {\n let [x, y, z, r] = v;\n r = d2r(r[0]);\n let s = Math.sin(r);\n let c = Math.cos(r);\n if(x && !y && !z) {\n if(x < 0) {\n s = -s;\n }\n t[5] = c;\n t[9] = -s;\n t[6] = s;\n t[10] = c;\n }\n else if(y && !x && !z) {\n if(y < 0) {\n s = -s;\n }\n t[0] = c;\n t[8] = s;\n t[2] = -s;\n t[10] = c;\n }\n else if(z && !x && !y) {\n if(z < 0) {\n s = -s;\n }\n t[0] = c;\n t[4] = -s;\n t[1] = s;\n t[5] = c;\n }\n else {\n let len = Math.sqrt(x * x + y * y + z * z);\n if(len !== 1) {\n let rlen = 1 / len;\n x *= rlen;\n y *= rlen;\n z *= rlen;\n }\n let nc = 1 - c;\n let xy = x * y;\n let yz = y * z;\n let zx = z * x;\n let xs = x * s;\n let ys = y * s;\n let zs = z * s;\n\n t[0] = x * x * nc + c;\n t[1] = xy * nc + zs;\n t[2] = zx * nc - ys;\n t[3] = 0;\n\n t[4] = xy * nc - zs;\n t[5] = y * y * nc + c;\n t[6] = yz * nc + xs;\n t[7] = 0;\n\n t[8] = zx * nc + ys;\n t[9] = yz * nc - xs;\n t[10] = z * z * nc + c;\n t[11] = 0;\n\n t[12] = 0;\n t[13] = 0;\n t[14] = 0;\n t[15] = 1;\n }\n }\n else if(k === PERSPECTIVE && v > 0) {\n v = Math.max(v, 1);\n t[11] = -1 / v;\n }\n else if(k === MATRIX) {\n util.assignMatrix(t, v);\n }\n}\n\nfunction calMatrix(transform, ow, oh, root) {\n let list = normalize(transform, ow, oh, root);\n let m = identity();\n list.forEach(item => {\n let [k, v] = item;\n let t = identity();\n calSingle(t, k, v);\n m = multiply(m, t);\n });\n return m;\n}\n\n// 已有计算好的变换矩阵,根据tfo原点计算最终的matrix\nfunction calMatrixByOrigin(m, transformOrigin) {\n let [ox, oy] = transformOrigin;\n let res = m.slice(0);\n if(ox === 0 && oy === 0 || isE(m)) {\n return res;\n }\n res = multiply([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ox, oy, 0, 1], res);\n res = multiply(res, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -ox, -oy, 0, 1]);\n return res;\n}\n\n// img缩放svg下专用,无rem\nfunction calMatrixWithOrigin(transform, transformOrigin, ow, oh) {\n let m = calMatrix(transform, ow, oh);\n return calMatrixByOrigin(m, transformOrigin);\n}\n\nfunction normalizeSingle(k, v, ow, oh, root) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n if(v[1] === PERCENT) {\n return v[0] * ow * 0.01;\n }\n else if(v[1] === REM) {\n return v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n return v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n return v[0] * root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n return v[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n return v[0] * Math.min(root.width, root.height) * 0.01;\n }\n }\n else if(k === TRANSLATE_Y) {\n if(v[1] === PERCENT) {\n return v[0] * oh * 0.01;\n }\n else if(v[1] === REM) {\n return v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n return v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n return v[0] * root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n return v[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n return v[0] * Math.min(root.width, root.height) * 0.01;\n }\n }\n else if(k === MATRIX) {\n return v;\n }\n else if(k === ROTATE_3D) {\n return v;\n }\n return v[0];\n}\n\nfunction normalize(transform, ow, oh, root) {\n let res = [];\n transform.forEach(item => {\n let [k, v] = item;\n res.push([k, normalizeSingle(k, v, ow, oh, root)]);\n });\n return res;\n}\n\nfunction calOrigin(transformOrigin, w, h, root) {\n let tfo = [];\n transformOrigin.forEach((item, i) => {\n if(item[1] === PX) {\n tfo.push(item[0]);\n }\n else if(item[1] === PERCENT) {\n tfo.push(item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n tfo.push(item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n tfo.push(item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n tfo.push(item[0] * root.height * 0.01);\n }\n else if(item[1] === VMAX) {\n tfo.push(item[0] * Math.max(root.width, root.height) * 0.01);\n }\n else if(item[1] === VMIN) {\n tfo.push(item[0] * Math.min(root.width, root.height) * 0.01);\n }\n });\n return tfo;\n}\n\nfunction calMatrixByPerspective(m, pm) {\n if(!isE(pm)) {\n m = multiply(pm, m);\n }\n return m;\n}\n\nfunction calPerspectiveMatrix(ppt, po) {\n if(ppt && ppt > 0) {\n let res = identity();\n ppt = Math.max(ppt, 1);\n res[11] = -1 / ppt;\n let [ox, oy] = po;\n if(ox || oy) {\n res = multiply([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ox, oy, 0, 1], res);\n res = multiply(res, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -ox, -oy, 0, 1]);\n }\n return res;\n }\n}\n\n// 是否有透视矩阵应用\nfunction isPerspectiveMatrix(m) {\n if(!m) {\n return;\n }\n return !!(m[3] || m[7] || m[11]);\n}\n\nexport default {\n calMatrix,\n calOrigin,\n calMatrixByPerspective,\n calPerspectiveMatrix,\n calMatrixByOrigin,\n calMatrixWithOrigin,\n isPerspectiveMatrix,\n};\n","/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据模糊参数sigma求卷积核尺寸\n * @param sigma\n * @returns {number}\n */\nfunction kernelSize(sigma) {\n if(sigma <= 0) {\n return 0;\n }\n let d = Math.floor(sigma * 3 * Math.sqrt(2 * Math.PI) / 4 + 0.5);\n if(d < 2) {\n d = 2;\n }\n if(d % 2 === 0) {\n d++;\n }\n return d;\n}\n\n/**\n * 根据sigma求模糊扩展尺寸,卷积核求得后为d,再求半径/2,然后因为算法要执行3次,所以*3\n * 比如本来d为5,半径2.5算上自身像素点则各方向扩展2,*3则扩展6\n * @param sigma\n * @returns {number}\n */\nfunction outerSize(sigma) {\n let d = kernelSize(sigma);\n return outerSizeByD(d);\n}\n\nfunction outerSizeByD(d) {\n return Math.floor(d * 0.5) * 3;\n}\n\n/**\n * 一维高斯正态分布,根据标准差和卷积核尺寸返回一维权重数组\n * @param sigma\n * @param d\n */\nfunction gaussianWeight(sigma, d) {\n let list = [];\n let len = Math.floor(d * 0.5);\n let total = 0;\n for(let i = len; i >= 0; i--) {\n let n = Math.pow(Math.E, -Math.pow(i, 2) / (2 * Math.pow(sigma, 2)))\n / (sigma * Math.sqrt(2 * Math.PI));\n list.push(n);\n total += n;\n }\n for(let i = 1; i <= len; i++) {\n let n = Math.pow(Math.E, -Math.pow(i, 2) / (2 * Math.pow(sigma, 2)))\n / (sigma * Math.sqrt(2 * Math.PI));\n list.push(n);\n total += n;\n }\n if(total !== 1) {\n for(let i = 0; i < d; i++) {\n list[i] /= total;\n }\n }\n return list;\n}\n\nexport default {\n kernelSize,\n outerSize,\n outerSizeByD,\n gaussianWeight,\n};\n","import Page from './Page';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport enums from '../util/enums';\nimport painter from '../util/painter';\nimport debug from '../util/debug';\nimport tf from '../style/transform';\nimport mx from '../math/matrix';\nimport blur from '../math/blur';\n\nconst {\n STYLE_KEY: {\n TRANSFORM_ORIGIN,\n TRANSFORM,\n },\n} = enums;\n\n// 根据一个共享cache的信息,生成一个独立的离屏canvas,一般是filter,mask用\nfunction genSingle(cache, message) {\n let { size, sx1, sy1, width, height, bbox } = cache;\n let offscreen = inject.getCacheCanvas(width, height, null, message);\n offscreen.x = 0;\n offscreen.y = 0;\n offscreen.bbox = bbox;\n offscreen.size = size;\n offscreen.sx1 = sx1;\n offscreen.sy1 = sy1;\n offscreen.dx = cache.dx;\n offscreen.dy = cache.dy;\n offscreen.dbx = cache.dbx;\n offscreen.dby = cache.dby;\n offscreen.width = width;\n offscreen.height = height;\n return offscreen;\n}\n\nclass Cache {\n constructor(w, h, bbox, page, pos, x1, y1) {\n this.__init(w, h, bbox, page, pos, x1, y1);\n }\n\n __init(w, h, bbox, page, pos, x1, y1) {\n this.__width = w;\n this.__height = h;\n this.__bbox = bbox;\n this.__page = page;\n this.__pos = pos;\n let [x, y] = page.getCoords(pos);\n this.__x = x;\n this.__y = y;\n this.__appendData(x1, y1);\n this.__isNew = true;\n if(page.canvas) {\n this.__enabled = true;\n let ctx = page.ctx;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n if(debug.flag) {\n page.canvas.setAttribute && page.canvas.setAttribute('size', page.size);\n }\n }\n }\n\n __appendData(sx1, sy1) {\n this.sx1 = sx1; // 去除margin的左上角原点坐标\n this.sy1 = sy1;\n let bbox = this.bbox;\n this.dx = this.x - bbox[0]; // cache坐标和box原点的差值\n this.dy = this.y - bbox[1];\n this.dbx = sx1 - bbox[0]; // 原始x1/y1和box原点的差值\n this.dby = sy1 - bbox[1];\n this.update();\n }\n\n update() {\n this.page.update = true;\n }\n\n clear() {\n if(this.available) {\n let ctx = this.ctx;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n let size = this.page.size;\n ctx.clearRect(this.x, this.y, size, size);\n this.__available = false;\n this.__isNew = true;\n }\n }\n\n release() {\n if(this.enabled) {\n this.clear();\n this.page.del(this.pos);\n this.__page = null;\n this.__enabled = false;\n }\n }\n\n reset(bbox, x1, y1) {\n // 尺寸没变复用之前的并清空\n if(util.equalArr(this.bbox, bbox) && this.enabled) {\n this.clear();\n return;\n }\n this.release();\n let w = Math.ceil(bbox[2] - bbox[0]);\n let h = Math.ceil(bbox[3] - bbox[1]);\n let res = Page.getInstance(Math.max(w, h));\n if(!res) {\n this.__enabled = false;\n return;\n }\n let { page, pos } = res;\n this.__init(w, h, bbox, page, pos, x1, y1);\n }\n\n // 是否功能可用,生成离屏canvas及尺寸超限\n get enabled() {\n return this.__enabled;\n }\n\n // 是否有可用缓存内容\n get available() {\n return this.enabled && this.__available;\n }\n\n get bbox() {\n return this.__bbox;\n }\n\n get page() {\n return this.__page;\n }\n\n get canvas() {\n return this.page.canvas;\n }\n\n get ctx() {\n return this.page.ctx;\n }\n\n get size() {\n return this.page.size;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get pos() {\n return this.__pos;\n }\n\n get isNew() {\n return this.__isNew;\n }\n\n static get MAX() {\n return Page.MAX;\n }\n\n static getInstance(bbox, x1, y1) {\n let w = Math.ceil(bbox[2] - bbox[0]);\n let h = Math.ceil(bbox[3] - bbox[1]);\n let res = Page.getInstance(Math.max(w, h));\n if(!res) {\n return;\n }\n let { page, pos } = res;\n return new Cache(w, h, bbox, page, pos, x1, y1);\n }\n\n /**\n * 复制cache的一块出来单独作为cacheFilter,尺寸边距保持一致,用浏览器原生ctx.filter滤镜\n * @param cache\n * @param filter\n * @returns {{canvas: *, ctx: *, release(): void, available: boolean, draw()}}\n */\n static genFilter(cache, filter) {\n let d = 0;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n d = blur.outerSize(v);\n }\n });\n let { x, y, size, canvas, sx1, sy1, width, height, bbox } = cache;\n bbox = bbox.slice(0);\n bbox[0] -= d;\n bbox[1] -= d;\n bbox[2] += d;\n bbox[3] += d;\n let offscreen = inject.getCacheCanvas(width + d * 2, height + d * 2, null, 'filter');\n offscreen.ctx.filter = painter.canvasFilter(filter);\n offscreen.ctx.drawImage(canvas, x, y, width, height, d, d, width, height);\n offscreen.ctx.filter = 'none';\n offscreen.draw();\n offscreen.bbox = bbox;\n offscreen.x = 0;\n offscreen.y = 0;\n offscreen.size = size;\n offscreen.sx1 = sx1 - d;\n offscreen.sy1 = sy1 - d;\n offscreen.dx = cache.dx;\n offscreen.dy = cache.dy;\n offscreen.dbx = cache.dbx;\n offscreen.dby = cache.dby;\n offscreen.width = width + d * 2;\n offscreen.height = height + d * 2;\n return offscreen;\n }\n\n static genMask(target, node, cb) {\n let cacheMask = genSingle(target, 'mask1');\n let list = [];\n let { [TRANSFORM]: transform, [TRANSFORM_ORIGIN]: tfo } = node.computedStyle;\n let next = node.next;\n let isClip = next.isClip;\n while(next && next.isMask) {\n list.push(next);\n next = next.next;\n }\n let { x, y, ctx, dbx, dby } = cacheMask;\n tfo[0] += x + dbx + node.__sx1 - target.sx1;\n tfo[1] += y + dby + node.__sy1 - target.sy1;\n let inverse = tf.calMatrixByOrigin(transform, tfo);\n // 先将mask本身绘制到cache上,再设置模式绘制dom本身,因为都是img所以1个就够了\n list.forEach(item => {\n cb(item, cacheMask, inverse);\n });\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n ctx.globalCompositeOperation = isClip ? 'source-out' : 'source-in';\n Cache.drawCache(target, cacheMask);\n ctx.globalCompositeOperation = 'source-over';\n cacheMask.draw(ctx);\n return cacheMask;\n }\n\n /**\n * 如果不超过bbox,直接用已有的total/filter/mask,否则生成一个新的\n */\n static genOverflow(target, node) {\n let { bbox } = target;\n let { sx, sy, outerWidth, outerHeight } = node;\n let xe = sx + outerWidth;\n let ye = sy + outerHeight;\n if(bbox[0] < sx || bbox[1] < sy || bbox[2] > xe || bbox[3] > ye) {\n let cacheOverflow = genSingle(target, 'overflow');\n let ctx = cacheOverflow.ctx;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n Cache.drawCache(target, cacheOverflow);\n cacheOverflow.draw(ctx);\n ctx.globalCompositeOperation = 'destination-in';\n ctx.fillStyle = '#FFF';\n ctx.beginPath();\n ctx.rect(sx - bbox[0], sy - bbox[1], outerWidth, outerHeight);\n ctx.fill();\n ctx.closePath();\n ctx.globalCompositeOperation = 'source-over';\n return cacheOverflow;\n }\n }\n\n /**\n * bbox变化时直接用老的cache内容重设bbox\n * @param cache\n * @param bbox\n */\n static updateCache(cache, bbox) {\n let old = cache.bbox;\n if(!util.equalArr(bbox, old)) {\n let dx = old[0] - bbox[0];\n let dy = old[1] - bbox[1];\n let newCache = Cache.getInstance(bbox);\n if(newCache && newCache.enabled) {\n let { x: ox, y: oy, canvas, width, height } = cache;\n let { x: nx, y: ny } = newCache;\n newCache.sx1 = cache.sx1;\n newCache.sy1 = cache.sy1;\n newCache.dx = cache.dx + dx;\n newCache.dy = cache.dy + dy;\n newCache.dbx = cache.dbx + dx;\n newCache.dby = cache.dby + dy;\n newCache.ctx.drawImage(canvas, ox, oy, width, height, dx + nx, dy + ny, width, height);\n newCache.__available = true;\n cache.release();\n return newCache;\n }\n }\n else {\n return cache;\n }\n }\n\n static drawCache(source, target, transform, matrix, tfo, parentMatrix, inverse) {\n let { x: tx, y: ty, sx1, sy1, ctx, dbx, dby } = target;\n let { x, y, canvas, sx1: sx2, sy1: sy2, dbx: dbx2, dby: dby2, width, height } = source;\n let ox = tx + sx2 - sx1 + dbx - dbx2;\n let oy = ty + sy2 - sy1 + dby - dby2;\n if(transform && matrix && tfo) {\n tfo[0] += ox;\n tfo[1] += oy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n matrix = mx.multiply(matrix, m);\n if(!mx.isE(parentMatrix)) {\n matrix = mx.multiply(parentMatrix, matrix);\n }\n if(inverse) {\n // 很多情况mask和target相同matrix,可简化计算\n if(util.equalArr(matrix, inverse)) {\n matrix = mx.identity();\n }\n else {\n inverse = mx.inverse(inverse);\n matrix = mx.multiply(inverse, matrix);\n }\n }\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n }\n ctx.drawImage(canvas, x, y, width, height, ox, oy, width, height);\n }\n\n static draw(ctx, opacity, matrix, cache) {\n ctx.globalAlpha = opacity;\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n let { x, y, canvas, sx1, sy1, dbx, dby, width, height } = cache;\n ctx.drawImage(canvas, x, y, width, height, sx1 - dbx, sy1 - dby, width, height);\n }\n\n static getCache(list) {\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item && item.available) {\n return item;\n }\n }\n }\n\n static NA = 0; // 无缓存模式\n static LOCAL = 1; // 局部根节点\n static CHILD = 2; // 其子节点\n static SELF = 3; // webgl专用\n}\n\nexport default Cache;\n","import change from './change';\nimport enums from '../util/enums';\n\nconst { STYLE_KEY, STYLE_KEY: {\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n OPACITY,\n FILTER,\n PERSPECTIVE,\n PERSPECTIVE_ORIGIN,\n} } = enums;\n\nconst ENUM = {\n // 低位表示 0;\n },\n /**\n * 得出等级\n * @param k\n * @returns {number|*}\n */\n getLevel(k) {\n if(change.isIgnore(k)) {\n return ENUM.NONE;\n }\n if(k === TRANSLATE_X) {\n return ENUM.TRANSLATE_X;\n }\n else if(k === TRANSLATE_Y) {\n return ENUM.TRANSLATE_Y;\n }\n else if(k === TRANSLATE_Z) {\n return ENUM.TRANSLATE_Z;\n }\n else if(TRANSFORMS.hasOwnProperty(k)) {\n return ENUM.TRANSFORM;\n }\n else if(k === OPACITY) {\n return ENUM.OPACITY;\n }\n else if(k === FILTER) {\n return ENUM.FILTER;\n }\n else if(k === PERSPECTIVE || k === PERSPECTIVE_ORIGIN) {\n return ENUM.PERSPECTIVE;\n }\n else if(change.isRepaint(k)) {\n return ENUM.REPAINT;\n }\n return ENUM.REFLOW;\n },\n isReflow(lv) {\n return !this.isRepaint(lv);\n },\n isRepaint(lv) {\n return lv < ENUM.REFLOW;\n },\n isRebuild(lv) {\n return lv >= ENUM.REBUILD;\n },\n}, ENUM);\no.TRANSFORMS = TRANSFORMS;\n\nexport default o;\n","import Node from './Node';\nimport TextBox from './TextBox';\nimport mode from '../refresh/mode';\nimport css from '../style/css';\nimport font from '../style/font';\nimport unit from '../style/unit';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport textCache from './textCache';\nimport inject from '../util/inject';\nimport Cache from '../refresh/Cache';\nimport level from '../refresh/level';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n LINE_HEIGHT,\n FONT_SIZE,\n FONT_FAMILY,\n FONT_STYLE,\n FONT_WEIGHT,\n COLOR,\n VISIBILITY,\n LETTER_SPACING,\n OVERFLOW,\n WHITE_SPACE,\n TEXT_OVERFLOW,\n WIDTH,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_WIDTH,\n POSITION,\n },\n NODE_KEY: {\n NODE_CACHE,\n NODE_LIMIT_CACHE,\n NODE_DOM_PARENT,\n NODE_MATRIX_EVENT,\n NODE_OPACITY,\n NODE_VIRTUAL_DOM,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_MEASURE,\n UPDATE_FOCUS,\n UPDATE_CONFIG,\n },\n} = enums;\n\nconst ELLIPSIS = textCache.ELLIPSIS;\nconst { AUTO, REM, VW, VH, VMAX, VMIN } = unit;\n\nclass Text extends Node {\n constructor(content) {\n super();\n this.__content = util.isNil(content) ? '' : content.toString();\n this.__textBoxes = [];\n this.__charWidthList = [];\n this.__charWidth = 0;\n this.__textWidth = 0;\n }\n\n /**\n * 预先计算每个字的宽度,在每次布局渲染前做\n * @param renderMode\n * @param ctx\n * @private\n */\n __computeMeasure(renderMode, ctx) {\n let { content, computedStyle, charWidthList } = this;\n // 每次都要清空重新计算,计算会有缓存\n charWidthList.splice(0);\n let ffs = computedStyle[FONT_FAMILY].split(',');\n let ff = 'arial';\n for(let i = 0, len = ffs.length; i < len; i++) {\n if(inject.checkSupportFontFamily(ffs[i])) {\n ff = ffs[i];\n break;\n }\n }\n this.__ff = ff;\n let fs = computedStyle[FONT_SIZE];\n let fw = computedStyle[FONT_WEIGHT];\n let key = this.__key = computedStyle[FONT_SIZE] + ',' + ff + ',' + fw;\n let wait = textCache.data[key] = textCache.data[key] || {\n ff,\n fs,\n fw,\n hash: {},\n s: '',\n };\n let cache = textCache.charWidth[key] = textCache.charWidth[key] || {};\n let sum = 0;\n let needMeasure = false;\n let parentComputedStyle = this.domParent.computedStyle;\n let pff = 'arial';\n for(let i = 0, pffs = parentComputedStyle[FONT_FAMILY].split(','), len = pffs.length; i < len; i++) {\n if(inject.checkSupportFontFamily(pffs[i])) {\n ff = ffs[i];\n break;\n }\n }\n let pfs = parentComputedStyle[FONT_SIZE];\n let pfw = parentComputedStyle[FONT_WEIGHT];\n let pKey = this.__pKey = pfs + ',' + pff + ',' + pfw;\n let parentCache = textCache.charWidth[pKey] = textCache.charWidth[pKey] || {};\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(renderMode === mode.WEBGL) {\n ctx = inject.getCacheCanvas(16, 16, '__$$CHECK_SUPPORT_FONT_FAMILY$$__').ctx;\n }\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n ctx.font = css.setFontStyle(parentComputedStyle);\n parentCache[ELLIPSIS] = ctx.measureText(ELLIPSIS).width;\n }\n ctx.font = css.setFontStyle(computedStyle);\n }\n else if(renderMode === mode.SVG) {\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n parentCache[ELLIPSIS] = 0;\n let wait = textCache.data[pKey] = textCache.data[pKey] || {\n ff: pff,\n fs: pfs,\n fw: pfw,\n hash: {},\n s: '',\n };\n wait.s += ELLIPSIS;\n needMeasure = true;\n }\n }\n // 逐字测量,canvas可瞬间得到信息,svg先预存统一进行\n for(let i = 0, length = content.length; i < length; i++) {\n let char = content.charAt(i);\n let mw;\n if(cache.hasOwnProperty(char)) {\n mw = cache[char];\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n mw = cache[char] = ctx.measureText(char).width;\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else {\n if(!wait.hash.hasOwnProperty(char)) {\n wait.s += char;\n }\n wait.hash[char] = true;\n // 先预存标识位-1,测量完后替换它\n charWidthList.push(-1);\n needMeasure = true;\n }\n }\n this.__textWidth = sum;\n if(needMeasure) {\n textCache.list.push(this);\n }\n }\n\n __measureCb() {\n let { content, charWidthList } = this;\n let key = this.__key;\n let cache = textCache.charWidth[key];\n let sum = 0;\n for(let i = 0, len = charWidthList.length; i < len; i++) {\n if(charWidthList[i] < 0) {\n let mw = charWidthList[i] = cache[content.charAt(i)];\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n }\n this.__textWidth = sum;\n }\n\n /**\n * text在virtual时和普通一样,无需特殊处理\n * endSpace由外界inline布局控制,末尾最后一行的空白mpb,包含递归情况,递归为多个嵌套末尾节点的空白mpb之和\n * 即便宽度不足,每行还是强制渲染一个字符,换行依据lx开始,因为x可能是从中间开始的,非inline则两个相等\n * 最后一个字符排版时要考虑末尾mpb,排不下的话回退删掉这个字符,如果最后一个字符另起开头,排不下也强制排,每行至少1个字符\n * 在textOverflow时很特殊,多个inline同行,回退可能到前一个inline节点,这个通过x和lx判断是否行首,决定至少1个字符规则\n * @param data\n * @private\n */\n __layout(data) {\n let __cache = this.__config[NODE_CACHE];\n if(__cache) {\n __cache.release();\n }\n let { x, y, w, lx = x, lineBoxManager, endSpace = 0, lineClamp = 0, lineClampCount = 0 } = data;\n this.__x = this.__sx = this.__sx1 = x;\n this.__y = this.__sy = this.__sy1 = y;\n let { isDestroyed, content, computedStyle, textBoxes, charWidthList, root, __ff, __key } = this;\n textBoxes.splice(0);\n let __config = this.__config;\n __config[NODE_LIMIT_CACHE] = false;\n // 空内容w/h都为0可以提前跳出\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || !content) {\n return lineClampCount;\n }\n this.__ox = this.__oy = 0;\n // 顺序尝试分割字符串为TextBox,形成多行,begin为每行起始索引,i是当前字符索引\n let begin = 0;\n let i = 0;\n let beginSpace = x - lx; // x>=lx,当第一行非起始处时前面被prev节点占据,这个差值可认为是count宽度\n let count = beginSpace;\n let length = content.length;\n let maxW = 0;\n let {\n [LINE_HEIGHT]: lineHeight,\n [LETTER_SPACING]: letterSpacing,\n [WHITE_SPACE]: whiteSpace,\n [FONT_SIZE]: fontSize,\n [FONT_WEIGHT]: fontWeight,\n } = computedStyle;\n // 特殊字体中特殊字符连续时需减少一定的padding量\n let padding = font.info[__ff].padding;\n let needReduce = !!padding;\n let lastChar;\n let ew = textCache.charWidth[this.__pKey][ELLIPSIS];\n // block的overflow:hidden和textOverflow:clip/ellipsis才生效,inline要看最近非inline父元素\n let bp = this.domParent;\n while(bp.computedStyle[DISPLAY] === 'inline') {\n let p = bp.domParent;\n if(p.computedStyle[DISPLAY] === 'flex') {\n break;\n }\n bp = p;\n }\n this.__bp = bp;\n let lineCount = 0;\n // 不换行特殊对待,同时考虑overflow和textOverflow\n if(whiteSpace === 'nowrap') {\n let isTextOverflow;\n let {\n [DISPLAY]: display,\n [OVERFLOW]: overflow,\n [WIDTH]: width,\n [TEXT_OVERFLOW]: textOverflow,\n } = bp.currentStyle;\n // 只要是overflow隐藏,不管textOverflow如何(默认是clip等同于overflow:hidden的功能)都截取\n if(overflow === 'hidden') {\n while(i < length) {\n count += charWidthList[i] + letterSpacing;\n if(count > w) {\n // block/flex无需宽度,inline-block需要设置宽度才生效\n if(display === 'block' || display === 'flex') {\n isTextOverflow = true;\n }\n else if(width[1] !== AUTO) {\n isTextOverflow = true;\n }\n break;\n }\n i++;\n }\n }\n else {\n while(i < length) {\n count += charWidthList[i++] + letterSpacing;\n }\n }\n // ellipsis生效情况,本节点开始向前回退查找,尝试放下一部分字符\n if(isTextOverflow && textOverflow === 'ellipsis') {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n }\n // 默认clip跟随overflow:hidden,无需感知\n else {\n let textBox = new TextBox(this, textBoxes.length, x, y, count - beginSpace, lineHeight,\n content, charWidthList);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n maxW = count - beginSpace;\n y += lineHeight;\n }\n }\n // 普通换行,注意x和lx的区别,可能相同(block起始处)可能不同(非起始处),第1行从x开始,第2行及以后都从lx开始\n // 然后第一次换行还有特殊之处,可能同一行前半部行高很大,此时y增加并非自身的lineHeight,而是整体LineBox的\n else {\n while(i < length) {\n let cw = charWidthList[i] + letterSpacing;\n count += cw;\n // 连续字符减少padding,除了连续还需判断char是否在padding的hash中\n if(needReduce) {\n let char = content[i];\n if(char === lastChar && padding.hasOwnProperty(char) && padding[char]) {\n let hasCache, p = textCache.padding[__key] = textCache.padding[__key] || {};\n if(textCache.padding.hasOwnProperty(__key)) {\n if(p.hasOwnProperty(char)) {\n hasCache = true;\n count -= p[char];\n }\n }\n if(!hasCache) {\n let n = 0;\n if(root.renderMode === mode.CANVAS) {\n root.ctx.font = css.setFontStyle(computedStyle);\n let w1 = root.ctx.measureText(char).width;\n let w2 = root.ctx.measureText(char + char).width;\n n = w1 * 2 - w2;\n n *= padding[char];\n }\n else if(root.renderMode === mode.SVG) {\n n = inject.measureTextSync(__key, __ff, fontSize, fontWeight, char);\n n *= padding[char];\n }\n count -= n;\n p[char] = n;\n }\n }\n lastChar = char;\n }\n // 忽略零宽字符\n if(cw === 0) {\n i++;\n continue;\n }\n // 换行都要判断i不是0的时候,第1个字符强制不换行\n if(count === w) {\n // 多行文本截断,这里肯定需要回退,注意防止恰好是最后一个字符,此时无需截取\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1 && i < length - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n let textBox;\n // 特殊情况,恰好最后一行最后一个排满,此时查看末尾mpb,要防止i为0的情况首个字符特殊不回退,无需看开头mpb\n if(i === length - 1 && count > w - endSpace && i) {\n count -= charWidthList[i--];\n }\n i++;\n if(!lineCount) {\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, count);\n }\n // 必须先添加再设置y,当有diff的lineHeight时,第一个换行不影响,再换行时第2个换行即第3行会被第1行影响\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null; // 换行后连续字符reduce不生效重新计数\n }\n // 奇怪的精度问题,暂时不用相等判断,而是为原本w宽度加一点点冗余1e-10\n else if(count > w + (1e-10)) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n // 普通非多行文本阶段逻辑\n let width;\n // 宽度不足时无法跳出循环,至少也要塞个字符形成一行,无需判断第1行,因为是否放得下逻辑在dom中做过了,\n // 如果第1行放不下,一定会另起一行,此时作为开头再放不下才会进这里,这个if只有0或1个字符的情况\n if(i <= begin) {\n width = count;\n }\n // 超过2个字符回退1个\n else {\n width = count - charWidthList[i--];\n }\n i++;\n // 根据是否第一行分开处理行首空白\n let textBox;\n if(!lineCount) {\n maxW = width - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, width);\n }\n // 必须先添加再设置y,同上\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null;\n }\n else {\n i++;\n }\n }\n // 换行后Text的x重设为lx\n if(lineCount) {\n this.__x = this.__sx1 = lx;\n }\n // 最后一行,只有一行未满时也进这里,需查看末尾mpb,排不下回退一个字符\n // 声明了lineClamp时特殊考虑,这里一定是最后一行,要对比行数不能超过,超过忽略掉这些文本\n if(begin < length && (!lineClamp || lineCount + lineClampCount < lineClamp)) {\n let textBox;\n if(!lineCount) {\n let needBack;\n // 防止开头第一个begin=0时回退,这在inline有padding且是第一个child时会发生\n if(begin && count > w - endSpace) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n else {\n let needBack;\n // 防止begin在结尾时回退,必须要有个字符,这在最后一行1个字符排不下时会出现\n if(count > w - endSpace && begin < length - 1) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n maxW = Math.max(maxW, count);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n }\n }\n this.__width = maxW;\n this.__height = y - data.y;\n this.__baseline = css.getBaseline(computedStyle);\n return lineCount;\n }\n\n // 末尾行因ellipsis的缘故向前回退字符生成textBox,可能会因不满足宽度导致无法生成,此时向前继续回退TextBox\n __lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount, lineHeight, lx, x, y, maxW,\n textBoxes, content, charWidthList, lineBoxManager) {\n for(; i >= begin; i--) {\n count -= charWidthList[i] + letterSpacing;\n if(count + ew + endSpace <= w) {\n // 至少1个字符不用回退,到0也没找到需要回退\n if(i) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n break;\n }\n }\n }\n // 最后也没找到,看是否要查找前一个inline节点,还是本身是行首兜底首字母\n if(i < 0) {\n let lineBox = lineBoxManager.lineBox;\n // lineBox为空是行首,至少放1个字符\n if(!lineBox || !lineBox.size) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.charAt(begin), charWidthList.slice(begin, begin + 1));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n }\n // 向前查找inline节点,可能会有前面inline嵌套,因此直接用lineBox,不会出现inlineBlock,\n // 这里和css不同,ib强制超限换行不会同行\n else {\n let list = lineBox.list;\n outer:\n for(let j = list.length - 1; j >= 0; j--) {\n let tb = list[j];\n let { content, wList, width } = tb;\n // 整体减去可以说明可能在这个tb中,只要最后发现不是空文本节点就行,否则继续;第0个强制进入保证1字符\n if(count - width + ew <= w || !j) {\n // 找到可以跳出outer循环,找不到继续,注意第0个且1个字符判断\n for(let k = wList.length - 1; k >= 0; k--) {\n if(!k && !j || count + ew <= w) {\n tb.__content = content;\n tb.__width = width;\n tb.parent.__ellipsis = true;\n break outer;\n }\n else {\n let w2 = wList[k];\n tb.__endY -= w2;\n width -= w2;\n content = content.slice(0, k);\n count -= w2;\n wList.pop();\n }\n }\n }\n // 不够则看前一个tb并且删掉这个\n else {\n count -= width;\n }\n list.pop();\n tb.parent.textBoxes.pop();\n }\n }\n }\n return [y, maxW];\n }\n\n __offsetX(diff, isLayout) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetX(diff);\n });\n }\n this.__sx1 += diff;\n }\n\n __offsetY(diff, isLayout) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetY(diff);\n });\n }\n this.__sy1 += diff;\n }\n\n __tryLayInline(w) {\n return w - this.charWidthList[0];\n }\n\n __inlineSize() {\n let minX, maxX;\n this.textBoxes.forEach((item, i) => {\n if(i) {\n minX = Math.min(minX, item.x);\n maxX = Math.max(maxX, item.x + item.width);\n }\n else {\n minX = item.x;\n maxX = item.x + item.width;\n }\n });\n this.__x = minX;\n this.__sx = this.__sx1 = minX + this.ox;\n this.__sy = this.__sy1;\n this.__width = maxX - minX;\n }\n\n __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 render(renderMode, lv, ctx, cache, dx = 0, dy = 0) {\n let { isDestroyed, computedStyle, textBoxes, cacheStyle, __ellipsis, __bp, __config } = this;\n if(renderMode === mode.SVG) {\n __config[NODE_VIRTUAL_DOM] = this.__virtualDom = {\n type: 'text',\n children: [],\n };\n }\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || computedStyle[VISIBILITY] === 'hidden'\n || !textBoxes.length) {\n return;\n }\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n // webgl借用离屏canvas绘制文本,cache标识为true是普通绘制,否则是超限降级情况\n if(renderMode === mode.WEBGL) {\n if(cache) {\n let { sx, sy, bbox } = this;\n let __cache = __config[NODE_CACHE];\n if(__cache) {\n __cache.reset(bbox, sx, sy);\n }\n else {\n __cache = Cache.getInstance(bbox, sx, sy);\n }\n if(__cache && __cache.enabled) {\n __config[NODE_CACHE] = __cache;\n __cache.__available = true;\n ctx = __cache.ctx;\n dx += __cache.dx;\n dy += __cache.dy;\n __config[NODE_LIMIT_CACHE] = false;\n }\n else {\n __config[NODE_LIMIT_CACHE] = true;\n return;\n }\n }\n else {\n let root = this.root;\n let c = inject.getCacheCanvas(root.width, root.height, '__$$OVERSIZE$$__');\n ctx = c.ctx;\n let {\n [NODE_DOM_PARENT]: {\n __config: {\n [NODE_MATRIX_EVENT]: m,\n [NODE_OPACITY]: opacity,\n },\n },\n } = __config;\n ctx.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]);\n ctx.globalAlpha = opacity;\n }\n }\n let font = css.setFontStyle(computedStyle);\n if(ctx.font !== font) {\n ctx.font = font;\n }\n let color = cacheStyle[COLOR];\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n let strokeWidth = computedStyle[TEXT_STROKE_WIDTH];\n if(ctx.lineWidth !== strokeWidth) {\n ctx.lineWidth = strokeWidth;\n }\n let strokeColor = cacheStyle[TEXT_STROKE_COLOR];\n if(ctx.strokeStyle !== strokeColor) {\n ctx.strokeStyle = strokeColor;\n }\n }\n // 可能为空,整个是个ellipsis\n textBoxes.forEach(item => {\n item.render(renderMode, ctx, computedStyle, cacheStyle, dx, dy);\n });\n if(renderMode === mode.SVG) {\n this.virtualDom.children = textBoxes.map(textBox => textBox.virtualDom);\n }\n // textOverflow的省略号font使用最近非inline的父节点\n if(__ellipsis) {\n let last = textBoxes[textBoxes.length - 1];\n let { endX, endY } = last;\n let computedStyle = __bp.computedStyle;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n let font = css.setFontStyle(computedStyle);\n if(ctx.font !== font) {\n ctx.font = font;\n }\n let color = __bp.__cacheStyle[COLOR];\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n ctx.fillText(ELLIPSIS, endX, endY);\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['x', endX],\n ['y', endY],\n ['fill', __bp.__cacheStyle[COLOR]],\n ['font-family', computedStyle[FONT_FAMILY]],\n ['font-weight', computedStyle[FONT_WEIGHT]],\n ['font-style', computedStyle[FONT_STYLE]],\n ['font-size', computedStyle[FONT_SIZE] + 'px'],\n ];\n this.virtualDom.children.push({\n type: 'item',\n tagName: 'text',\n props,\n content: ELLIPSIS,\n });\n }\n }\n }\n\n __deepScan(cb) {\n cb(this);\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n super.__destroy();\n let __cache = this.__config[NODE_CACHE];\n if(__cache) {\n __cache.release();\n }\n }\n\n getComputedStyle(key) {\n return this.domParent.getComputedStyle(key);\n }\n\n updateContent(s, cb) {\n let self = this;\n if(s === self.__content) {\n if(util.isFunction(cb)) {\n cb(-1);\n }\n return;\n }\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__content = s;\n let res = {};\n let vd = self.domParent;\n res[UPDATE_NODE] = vd;\n res[UPDATE_MEASURE] = true;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_CONFIG] = vd.__config;\n let root = vd.root;\n root.__addUpdate(vd, vd.__config, root, root.__config, res);\n },\n __after(diff) {\n if(util.isFunction(cb)) {\n cb(diff);\n }\n },\n });\n }\n\n get content() {\n return this.__content;\n }\n\n set content(v) {\n this.__content = v;\n }\n\n get textBoxes() {\n return this.__textBoxes;\n }\n\n get charWidthList() {\n return this.__charWidthList;\n }\n\n get charWidth() {\n return this.__charWidth;\n }\n\n get firstCharWidth() {\n return this.charWidthList[0] || 0;\n }\n\n get textWidth() {\n return this.__textWidth;\n }\n\n get baseline() {\n return this.__baseline;\n }\n\n get root() {\n return this.domParent.root;\n }\n\n get currentStyle() {\n return this.domParent.currentStyle;\n }\n\n get style() {\n return this.__style;\n }\n\n get computedStyle() {\n return this.domParent.computedStyle;\n }\n\n get cacheStyle() {\n return this.domParent.__cacheStyle;\n }\n\n get bbox() {\n let { __sx1: sx, __sy1: sy, width, height, root, currentStyle: { [TEXT_STROKE_WIDTH]: textStrokeWidth } } = this;\n let half = 0;\n if(textStrokeWidth[1] === REM) {\n half = Math.max(textStrokeWidth[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(textStrokeWidth[1] === VW) {\n half = Math.max(textStrokeWidth[0] * root.width, half);\n }\n else if(textStrokeWidth[1] === VH) {\n half = Math.max(textStrokeWidth[0] * root.height, half);\n }\n else if(textStrokeWidth[1] === VMAX) {\n half = Math.max(textStrokeWidth[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(textStrokeWidth[1] === VMIN) {\n half = Math.max(textStrokeWidth[0] * Math.min(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(textStrokeWidth[0], half);\n }\n return [sx - half, sy - half, sx + width + half, sy + height + half];\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get matrix() {\n return this.domParent.matrix;\n }\n\n get matrixEvent() {\n return this.domParent.matrixEvent;\n }\n}\n\nText.prototype.__renderByMask = Text.prototype.render;\n\nexport default Text;\n","import util from './util';\nimport $$type from './$$type';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\n/**\n * 2. 打平children中的数组,变成一维\n * 3. 合并相连的Text节点,即string内容\n */\nfunction flattenJson(parent) {\n if(Array.isArray(parent)) {\n return parent.map(item => flattenJson(item));\n }\n else if(!parent || [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) {\n return parent;\n }\n let list = [];\n traverseJson(list, parent.children, {\n lastText: null,\n });\n parent.children = list;\n return parent;\n}\n\nfunction traverseJson(list, children, options) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n traverseJson(list, item, options);\n });\n }\n else if(children && (children.$$type === TYPE_VD || children.$$type === TYPE_GM)) {\n if(['canvas', 'svg', 'webgl'].indexOf(children.tagName) > -1) {\n throw new Error('Can not nest canvas/svg/webgl');\n }\n if(children.$$type === TYPE_VD) {\n flattenJson(children);\n }\n list.push(children);\n options.lastText = null;\n }\n else if(children && children.$$type === TYPE_CP) {\n list.push(children);\n // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做\n options.lastText = null;\n }\n // 排除掉空的文本,连续的text合并\n else if(!util.isNil(children) && children !== '') {\n if(options.lastText !== null) {\n list[list.length - 1] = options.lastText += children;\n }\n else {\n list.push(children);\n }\n }\n}\n\nexport default flattenJson;\n","import Text from '../node/Text';\nimport util from './util';\nimport $$type from './$$type';\nimport enums from './enums';\nimport flatten from './flatten';\n\nconst { NODE_KEY: {\n NODE_DOM_PARENT,\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n} } = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nfunction initRoot(cd, root) {\n let c = flatten({\n tagName: root.tagName,\n props: {},\n children: cd,\n $$type: TYPE_VD,\n });\n root.__json = c;\n root.__host = root;\n let children = build(c.children, root, root);\n return relation(root, children);\n}\n\nfunction initDom(json, root, host, parent) {\n let vd = build(json, root, host);\n return relation(parent, vd);\n}\n\nfunction initCp(json, root, host) {\n if(util.isObject(json)) {\n // cp的flatten在__init中自己做\n return build(json, root, host);\n }\n // text的relation会由上层如Root设置\n else {\n return new Text(json);\n }\n}\n\nfunction initCp2(json, root, host, parent) {\n let vd = new json.klass(json.props);\n vd.__tagName = json.tagName || vd.__tagName;\n vd.__root = root;\n vd.__host = host;\n vd.__json = json;\n vd.__init();\n return relation(parent, vd);\n}\n\n/**\n * 将初始json文件生成virtualDom\n * @param json\n * @param root\n * @param host\n * @param hasP 出现过p标签\n * @returns vd\n */\nfunction build(json, root, host, hasP) {\n if(Array.isArray(json)) {\n return json.map(item => build(item, root, host, hasP));\n }\n let vd;\n if(util.isObject(json) && json.$$type) {\n let { tagName, props, children, klass, $$type, __inheritAnimate, __animateRecords } = json;\n // 更新过程中无变化的cp直接使用原来生成的\n if($$type === TYPE_CP && json.__placeholder) {\n return json.__placeholder;\n }\n if($$type === TYPE_VD) {\n if(tagName === 'img') {\n vd = new Img(tagName, props);\n if(Array.isArray(children) && children.length) {\n throw new Error('Img can not contain children');\n }\n }\n else {\n vd = new Dom(tagName, props);\n }\n // 检查p不能包含div\n if(tagName === 'p') {\n hasP = true;\n }\n else if(tagName === 'div' && hasP) {\n throw new Error('Markup p can not contain div');\n }\n if(Array.isArray(children)) {\n children = relation(vd, build(children, root, host, hasP));\n }\n else {\n children = [];\n }\n vd.__children = children;\n }\n else if($$type === TYPE_GM) {\n if(util.isString(tagName)) {\n let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\n }\n else if(tagName) {\n vd = new tagName('$', props);\n }\n }\n else if($$type === TYPE_CP) {\n vd = new klass(props);\n vd.__tagName = tagName || vd.__tagName;\n }\n else {\n return new Text(json);\n }\n // 根parse需要用到真正的vd引用,然后vd也要引用json,用以做domApi\n json.vd = vd;\n vd.__json = json;\n // 递归parse中的动画记录需特殊处理,将target改为真正的vd引用\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n __animateRecords.list.forEach(item => {\n item.target = item.target.vd;\n });\n delete json.__animateRecords;\n }\n // 更新过程中key相同或者普通相同的vd继承动画\n if(__inheritAnimate) {\n util.extendAnimate(__inheritAnimate, vd);\n delete json.__inheritAnimate;\n }\n vd.__root = root;\n vd.__host = host;\n if($$type === TYPE_CP) {\n vd.__init();\n }\n let ref = props.ref;\n if(util.isString(ref) && ref || util.isNumber(ref)) {\n host.ref[ref] = vd;\n }\n else if(util.isFunction(ref)) {\n ref(vd);\n }\n return vd;\n }\n return new Text(json);\n}\n\n/**\n * 设置关系,父子和兄弟\n * @param parent\n * @param children\n * @param options\n * @returns {Xom|Text|Component}\n */\nfunction relation(parent, children, options = {}) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n relation(parent, item, options);\n });\n }\n else if(children instanceof Xom || children instanceof Component || children instanceof Text) {\n children.__parent = parent;\n children.__domParent = parent;\n // 极为恶心,为了v8的性能优化,text复用parent的__config部分,但domParent重设\n if(children instanceof Text) {\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n if(children.__config) {\n children.__config[NODE_DOM_PARENT] = parent;\n }\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n // 文字视作为父节点的直接文字子节点\n if(children instanceof Component) {\n let sr = children.shadowRoot;\n if(sr instanceof Text) {\n sr.__parent = parent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n sr.__domParent = parent;\n if(sr.__config) {\n sr.__config[NODE_DOM_PARENT] = parent;\n }\n }\n }\n return children;\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n initRoot,\n initDom,\n initCp,\n initCp2,\n relation,\n};\n","import util from './util';\n\nconst { isFunction } = util;\n\nclass Event {\n constructor() {\n this.__eHash = {};\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.on(id[i], handle);\n }\n }\n else {\n if(!self.__eHash.hasOwnProperty(id)) {\n self.__eHash[id] = [];\n }\n // 遍历防止此handle被侦听过了\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n if(item[i] === handle) {\n return self;\n }\n }\n self.__eHash[id].push(handle);\n }\n return self;\n }\n\n once(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n function cb(...data) {\n handle.apply(self, data);\n self.off(id, cb);\n }\n\n cb.__karasEventCb = handle;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.once(id[i], handle);\n }\n }\n else if(handle) {\n self.on(id, cb);\n }\n return this;\n }\n\n off(id, handle) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.off(id[i], handle);\n }\n }\n else if(self.__eHash.hasOwnProperty(id)) {\n if(handle) {\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n // 需考虑once包裹的引用对比\n if(item[i] === handle || item[i].__karasEventCb === handle) {\n item.splice(i, 1);\n break;\n }\n }\n }\n // 未定义为全部清除\n else {\n delete self.__eHash[id];\n }\n }\n return this;\n }\n\n emit(id, ...data) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.emit(id[i], data);\n }\n }\n else {\n if(self.__eHash.hasOwnProperty(id)) {\n let list = self.__eHash[id];\n if(list.length) {\n list = list.slice();\n for(let i = 0, len = list.length; i < len; i++) {\n let cb = list[i];\n if(isFunction(cb)) {\n cb.apply(self, data);\n }\n }\n }\n }\n }\n return this;\n }\n\n static mix(...obj) {\n for(let i = obj.length - 1; i >= 0; i--) {\n let o = obj[i];\n let event = new Event();\n o.__eHash = {};\n let fns = ['on', 'once', 'off', 'emit'];\n for(let j = fns.length - 1; j >= 0; j--) {\n let fn = fns[j];\n o[fn] = event[fn];\n }\n }\n }\n\n static REFRESH = 'refresh';\n static PAUSE = 'pause';\n static PLAY = 'play';\n static FRAME = 'frame';\n static FINISH = 'finish';\n static CANCEL = 'cancel';\n static BEGIN = 'begin';\n static END = 'end';\n}\n\nexport default Event;\n","import Node from './Node';\nimport Text from './Text';\nimport builder from '../util/builder';\nimport Event from '../util/Event';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport flatten from '../util/flatten';\nimport css from '../style/css';\nimport change from '../refresh/change';\n\nconst { isNil, isFunction, clone, extend } = util;\n\nconst REGISTER = {};\n\n/**\n * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归\n * 在check时树递归会用到,判断是否需要查找cp更新\n * @param cp\n */\nfunction setUpdateFlag(cp) {\n // 去重\n if(cp.__hasCpUpdate) {\n return;\n }\n cp.__hasCpUpdate = true;\n let host = cp.host;\n if(host) {\n setUpdateFlag(host);\n }\n}\n\nclass Component extends Event {\n constructor(props = {}) {\n super();\n this.__tagName = /(?:function|class)\\s+([\\w$]+)/.exec(this.constructor.toString())[1];\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__parent = null;\n this.__host = null;\n this.__ref = {};\n this.state = {};\n this.__isMounted = false;\n this.__taskList = [];\n }\n\n setState(n, cb) {\n let self = this;\n if(isNil(n)) {\n n = {};\n }\n else if(isFunction(n)) {\n return;\n }\n else {\n if(Object.keys(n).length === 0) {\n if(isFunction(cb)) {\n cb.call(self);\n }\n return;\n }\n let state = clone(self.state);\n n = extend(state, n);\n }\n let root = self.root;\n if(root && self.__isMounted) {\n // 一帧之内多次调用,需合并\n if(self.__nextState) {\n Object.assign(self.__nextState, n);\n self.__taskList.push(cb);\n }\n else {\n self.__nextState = n;\n self.__taskList = [cb];\n // 回调更新列表,before执行时splice出来供after执行,防止中途产生的后续setState干扰\n let list = [];\n let t = self.__task = {\n __before: () => {\n list = self.__taskList.splice(0);\n // 标识更新\n setUpdateFlag(this);\n },\n __after: () => {\n // self.__nextState = null; 由updater.js每次refresh前同步执行清空,这里不能异步清除,否则frame动画会乱序\n list.forEach(cb => {\n if(isFunction(cb)) {\n cb.call(self);\n }\n });\n },\n };\n root.addRefreshCp(t);\n }\n }\n // 构造函数中调用还未render,\n else if(isFunction(cb)) {\n self.state = n;\n cb.call(self);\n }\n }\n\n /**\n * build中调用初始化,json有值时是update过程才有,且处理过flatten\n * @param json\n * @private\n */\n __init(json) {\n this.__ref = {};\n let root = this.root;\n let cd = json || flatten(this.render());\n let sr = builder.initCp(cd, root, this);\n this.__cd = cd;\n if(sr instanceof Text) {\n // 文字视作为父节点的直接文字子节点,在builder里做\n }\n else if(sr instanceof Node) {\n let style = css.normalize(this.props.style);\n let keys = Object.keys(style);\n extend(sr.style, style, keys);\n extend(sr.currentStyle, style, keys);\n // 事件添加到sr\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n });\n }\n else if(!(sr instanceof Component)) {\n // 本身build是递归的,子cp已经初始化了\n throw new Error('Component render() must return a dom/text: ' + this);\n }\n // 自定义事件无视返回强制添加\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n k = k.slice(3);\n this.on(k, v);\n }\n });\n // shadow指向直接renderRoot,shadowRoot考虑到返回Component的递归即hoc高阶组件\n // host是直接所属,hostRoot同考虑到高阶组件\n this.__shadow = sr;\n sr.__host = this;\n // 递归下去,多层级时执行顺序由里到外,最终会被最上层执行替换\n while(sr instanceof Component) {\n sr.__hostRoot = this;\n sr.shadow.__host = sr;\n sr = sr.shadow;\n }\n this.__shadowRoot = sr;\n sr.__hostRoot = this;\n if(!this.__isMounted) {\n this.__isMounted = true;\n if(isFunction(this.componentDidMount)) {\n root.once(Event.REFRESH, () => {\n this.componentDidMount();\n });\n }\n }\n }\n\n render() {\n inject.warn('Component must implement render()');\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.__isDestroyed = true;\n this.__isMounted = false;\n if(isFunction(this.componentWillUnmount)) {\n this.componentWillUnmount();\n }\n this.root.delRefreshTask(this.__task);\n if(this.shadowRoot) {\n this.shadowRoot.__destroy();\n }\n this.__parent = null;\n }\n\n __emitEvent(e, force) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n return;\n }\n let res = sr.__emitEvent(e, force);\n if(res) {\n e.target = this;\n return true;\n }\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get shadow() {\n return this.__shadow;\n }\n\n get shadowRoot() {\n return this.__shadowRoot;\n }\n\n get root() {\n return this.__root;\n }\n\n get host() {\n return this.__host;\n }\n\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n get state() {\n return this.__state;\n }\n\n set state(v) {\n this.__state = v;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)) {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Component has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)\n || !obj.prototype || !(obj.prototype instanceof Component)) {\n throw new Error('Invalid param: Component register');\n }\n if(Component.hasRegister(name)) {\n throw new Error(`Component has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Component.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nObject.keys(change.GEOM).concat([\n 'x',\n 'y',\n 'ox',\n 'oy',\n 'sx',\n 'sy',\n // '__sx1',\n // '__sx2',\n // '__sx3',\n // '__sx4',\n // '__sx5',\n // '__sx6',\n // '__sy1',\n // '__sy2',\n // '__sy3',\n // '__sy4',\n // '__sy5',\n // '__sy6',\n 'width',\n 'height',\n 'outerWidth',\n 'outerHeight',\n 'clientWidth',\n 'clientHeight',\n 'offsetWidth',\n 'offsetHeight',\n 'style',\n 'animationList',\n 'animateStyle',\n 'currentStyle',\n 'computedStyle',\n 'currentProps',\n 'baseline',\n 'virtualDom',\n 'mask',\n 'maskId',\n 'textWidth',\n 'content',\n 'lineBoxes',\n 'charWidthList',\n 'charWidth',\n '__layoutData',\n 'availableAnimating',\n 'effectiveAnimating',\n 'displayAnimating',\n 'visibilityAnimating',\n 'bbox',\n '__config',\n 'contentBoxList',\n 'listener',\n 'matrix',\n 'matrixEvent',\n]).forEach(fn => {\n Object.defineProperty(Component.prototype, fn, {\n get() {\n let sr = this.shadowRoot;\n if(sr) {\n return sr[fn];\n }\n },\n });\n});\n\n[\n '__layout',\n '__layoutAbs',\n '__layoutNone',\n '__tryLayInline',\n '__offsetX',\n '__offsetY',\n '__calAutoBasis',\n '__calMp',\n '__calAbs',\n '__renderAsMask',\n '__renderByMask',\n '__mp',\n 'animate',\n 'removeAnimate',\n 'clearAnimate',\n 'updateStyle',\n 'getBoundingClientRect',\n 'getComputedStyle',\n '__deepScan',\n 'clearCache',\n '__structure',\n '__modifyStruct',\n '__updateStruct',\n 'flowChildren',\n 'absChildren',\n '__isRealInline',\n '__calBasis',\n '__calMinMax',\n '__computeMeasure',\n 'appendChild',\n 'prependChild',\n 'insertBefore',\n 'insertAfter',\n 'removeChild',\n 'remove',\n].forEach(fn => {\n Component.prototype[fn] = function() {\n let sr = this.shadowRoot;\n if(sr && isFunction(sr[fn])) {\n return sr[fn].apply(sr, arguments);\n }\n };\n});\n\nexport default Component;\n","import unit from './unit';\nimport transform from './transform';\nimport enums from '../util/enums';\n\nconst { STYLE_KEY: { SCALE_X, SCALE_Y } } = enums;\nconst { PERCENT, NUMBER } = unit;\n\nfunction matrixResize(imgWidth, imgHeight, targetWidth, targetHeight, x, y, w, h) {\n if(imgWidth === targetWidth && imgHeight === targetHeight) {\n return;\n }\n let list = [\n [SCALE_X, [targetWidth / imgWidth, NUMBER]],\n [SCALE_Y, [targetHeight / imgHeight, NUMBER]],\n ];\n let tfo = transform.calOrigin([[0, PERCENT], [0, PERCENT]], w, h);\n tfo[0] += x;\n tfo[1] += y;\n return transform.calMatrixWithOrigin(list, tfo, w, h);\n}\n\nexport default {\n matrixResize,\n};\n","import border from './border';\nimport transform from './transform';\nimport mx from '../math/matrix';\nimport mode from '../refresh/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\nimport unit from './unit';\nimport enums from '../util/enums';\nimport image from './image';\n\nconst {\n STYLE_KEY: {\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\nconst { clone, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { AUTO, PX, PERCENT, STRING, REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bbrr, bblr,\n method = 'fill', isInline = false, dx = 0, dy = 0) {\n // radial渐变ellipse形状会有matrix,用以从圆缩放到椭圆\n let matrix, cx, cy;\n if(Array.isArray(color)) {\n matrix = color[1];\n cx = color[2];\n cy = color[3];\n color = color[0];\n }\n // border-radius使用三次贝塞尔曲线模拟1/4圆角,误差在[0, 0.000273]之间\n list = list || border.calRadius(x, y, w, h, btlr, btrr, bbrr, bblr);\n if(!list) {\n list = [\n [x, y],\n [x + w, y],\n [x + w, y + h],\n [x, y + h],\n [x, y],\n ];\n }\n // 椭圆有matrix,用逆矩阵变化点来完成\n if(matrix) {\n let tfo = [cx, cy];\n matrix = transform.calMatrixByOrigin(matrix, tfo);\n let t = mx.inverse(matrix);\n list = list.map(item => {\n if(!item || !item.length) {\n return null;\n }\n let arr = [];\n for(let i = 0, len = item.length; i < len; i += 2) {\n let p = mx.calPoint([item[i], item[i + 1]], t);\n arr.push(p[0]);\n arr.push(p[1]);\n }\n return arr;\n });\n }\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(matrix) {\n ctx.save();\n let me = xom.matrixEvent;\n matrix = mx.multiply(me, matrix);\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n }\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n canvasPolygon(ctx, list, dx, dy);\n ctx[method]();\n ctx.closePath();\n if(matrix) {\n ctx.restore();\n }\n }\n else if(renderMode === mode.SVG) {\n let d = svgPolygon(list);\n if(isInline) {\n let v = {\n tagName: 'symbol',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', color],\n ],\n },\n ],\n };\n xom.__config[NODE_DEFS_CACHE].push(v);\n return ctx.add(v);\n }\n else {\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', color],\n ],\n });\n // 椭圆渐变独有\n if(matrix) {\n let bb = xom.virtualDom.bb;\n bb[bb.length - 1].props.push(['transform', `matrix(${joinArr(mx.m2m6(matrix), ',')})`]);\n }\n }\n }\n}\n\nfunction calBackgroundSize(value, w, h, root) {\n let res = [];\n value.forEach((item, i) => {\n if(item[1] === PX) {\n res.push(item[0]);\n }\n else if(item[1] === PERCENT) {\n res.push(item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n res.push(item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n res.push(item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n res.push(item[0] * root.height * 0.01);\n }\n else if(item[1] === VMAX) {\n res.push(item[0] * Math.max(root.width, root.height) * 0.01);\n }\n else if(item[1] === VMIN) {\n res.push(item[0] * Math.min(root.width, root.height) * 0.01);\n }\n else if(item[1] === AUTO) {\n res.push(-1);\n }\n else if(item[1] === STRING) {\n res.push(item[0] === 'contain' ? -2 : -3);\n }\n });\n return res;\n}\n\nfunction calBackgroundPosition(position, container, size, root) {\n if(Array.isArray(position)) {\n if(position[1] === PX) {\n return position[0];\n }\n else if(position[1] === PERCENT) {\n return (container - size) * position[0] * 0.01;\n }\n else if(position[1] === REM) {\n return position[0] * root.computedStyle[FONT_SIZE];\n }\n else if(position[1] === VW) {\n return position[0] * root.width * 0.01;\n }\n else if(position[1] === VH) {\n return position[0] * root.height * 0.01;\n }\n else if(position[1] === VMAX) {\n return position[0] * Math.max(root.width, root.height) * 0.01;\n }\n else if(position[1] === VMIN) {\n return position[0] * Math.min(root.width, root.height) * 0.01;\n }\n }\n return 0;\n}\n\nfunction renderImage(xom, renderMode, ctx, loadBgi,\n bx1, by1, bx2, by2, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, isInline,\n dx = 0, dy = 0) {\n let source = loadBgi.source;\n // 无source不绘制,可能错误或加载中\n if(source) {\n bx1 += dx;\n by1 += dy;\n bx2 += dx;\n by2 += dy;\n let bgW = bx2 - bx1;\n let bgH = by2 - by1;\n let { width, height } = loadBgi;\n let [w, h] = backgroundSize[i] || [];\n // -1为auto,-2为contain,-3为cover\n if(w === -1 && h === -1) {\n w = width;\n h = height;\n }\n else if(w === -2) {\n if(width > bgW && height > bgH) {\n w = width / bgW;\n h = height / bgH;\n if(w >= h) {\n w = bgW;\n h = w * height / width;\n }\n else {\n h = bgH;\n w = h * width / height;\n }\n }\n else if(width > bgW) {\n w = bgW;\n h = w * height / width;\n }\n else if(height > bgH) {\n h = bgH;\n w = h * width / height;\n }\n else {\n w = width;\n h = height;\n }\n }\n else if(w === -3) {\n if(bgW > width && bgH > height) {\n w = width / bgW;\n h = height / bgH;\n if(w <= h) {\n w = bgW;\n h = w * height / width;\n }\n else {\n h = bgH;\n w = h * width / height;\n }\n }\n else if(bgW > width) {\n w = bgW;\n h = w * height / width;\n }\n else if(bgH > height) {\n h = bgH;\n w = h * width / height;\n }\n else {\n w = width / bgW;\n h = height / bgH;\n if(w <= h) {\n w = bgW;\n h = w * height / width;\n }\n else {\n h = bgH;\n w = h * width / height;\n }\n }\n }\n else if(w === -1) {\n w = h * width / height;\n }\n else if(h === -1) {\n h = w * height / width;\n }\n let bgX = bx1 + calBackgroundPosition(currentStyle[BACKGROUND_POSITION_X][i], bgW, w, xom.root);\n let bgY = by1 + calBackgroundPosition(currentStyle[BACKGROUND_POSITION_Y][i], bgH, h, xom.root);\n // 超出尺寸模拟mask截取\n let needMask = bgX < bx1 || bgY < by1 || (bgX + w) > (bx1 + bgW) || (bgY + h) > (by1 + bgH);\n // 计算因为repeat,需要向4个方向扩展渲染几个数量图片\n let xnl = 0;\n let xnr = 0;\n let ynt = 0;\n let ynb = 0;\n // repeat-x\n if(['repeat-x', 'repeatX', 'repeat'].indexOf(backgroundRepeat[i]) > -1) {\n let diff = bgX - bx1;\n if(diff > 0) {\n xnl = Math.ceil(diff / w);\n }\n diff = bx1 + bgW - bgX - w;\n if(diff > 0) {\n xnr = Math.ceil(diff / w);\n }\n }\n // repeat-y\n if(['repeat-y', 'repeatY', 'repeat'].indexOf(backgroundRepeat[i]) > -1) {\n let diff = bgY - by1;\n if(diff > 0) {\n ynt = Math.ceil(diff / h);\n }\n diff = by1 + bgH - bgY - h;\n if(diff > 0) {\n ynb = Math.ceil(diff / h);\n }\n }\n // 分同行列和4个角分别判断,先看同行同列,再看4个角的象限\n let repeat = [];\n if(xnl > 0) {\n for(let i = 0; i < xnl; i++) {\n let x = bgX - (i + 1) * w;\n repeat.push([x, bgY]);\n // 看最左边超过没有\n if(!needMask && i === 0 && x < bx1) {\n needMask = true;\n }\n }\n }\n if(xnr > 0) {\n for(let i = 0; i < xnr; i++) {\n let x = bgX + (i + 1) * w;\n repeat.push([x, bgY]);\n // 看最右边超过没有\n if(!needMask && i === xnr - 1 && x + w > bx1 + bgW) {\n needMask = true;\n }\n }\n }\n if(ynt > 0) {\n for(let i = 0; i < ynt; i++) {\n let y = bgY - (i + 1) * h;\n repeat.push([bgX, y]);\n // 看最上边超过没有\n if(!needMask && i === 0 && y < by1) {\n needMask = true;\n }\n }\n }\n if(ynb > 0) {\n for(let i = 0; i < ynb; i++) {\n let y = bgY + (i + 1) * h;\n repeat.push([bgX, y]);\n // 看最下边超过没有\n if(!needMask && i === ynb - 1 && y + w > by1 + bgH) {\n needMask = true;\n }\n }\n }\n // 原点和同行列十字画完,看4个角的情况\n if(xnl > 0 && ynt > 0) {\n for(let i = 0; i < xnl; i++) {\n for(let j = 0; j < ynt; j++) {\n repeat.push([bgX - (i + 1) * w, bgY - (j + 1) * h]);\n }\n }\n }\n if(xnr > 0 && ynt > 0) {\n for(let i = 0; i < xnr; i++) {\n for(let j = 0; j < ynt; j++) {\n repeat.push([bgX + (i + 1) * w, bgY - (j + 1) * h]);\n }\n }\n }\n if(xnl > 0 && ynb > 0) {\n for(let i = 0; i < xnl; i++) {\n for(let j = 0; j < ynb; j++) {\n repeat.push([bgX - (i + 1) * w, bgY + (j + 1) * h]);\n }\n }\n }\n if(xnr > 0 && ynb > 0) {\n for(let i = 0; i < xnr; i++) {\n for(let j = 0; j < ynb; j++) {\n repeat.push([bgX + (i + 1) * w, bgY + (j + 1) * h]);\n }\n }\n }\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(needMask) {\n ctx.save();\n renderBgc(this, renderMode, ctx, '#FFF', null,\n bx1, by1, bgW, bgH, btlr, btrr, bbrr, bblr, 'clip');\n }\n // 先画不考虑repeat的中心声明的\n ctx.drawImage(source, bgX, bgY, w, h);\n // 再画重复的十字和4角象限\n repeat.forEach(item => {\n ctx.drawImage(source, item[0], item[1], w, h);\n });\n if(needMask) {\n ctx.restore();\n }\n }\n else if(renderMode === mode.SVG) {\n let matrix = image.matrixResize(width, height, w, h, bgX, bgY, bgW, bgH);\n let props = [\n ['xlink:href', loadBgi.url],\n ['x', bgX],\n ['y', bgY],\n ['width', width],\n ['height', height],\n ];\n let needResize;\n if(matrix && !mx.isE(matrix)) {\n needResize = true;\n props.push(['transform', 'matrix(' + joinArr(mx.m2m6(matrix), ',') + ')']);\n }\n if(needMask) {\n let p1 = [bx1, by1];\n let p2 = [bx2, by2];\n if(needResize) {\n let inverse = mx.inverse(matrix);\n p1 = mx.calPoint(p1, inverse);\n p2 = mx.calPoint(p2, inverse);\n }\n let v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', `M${p1[0]},${p1[1]}L${p2[0]},${p1[1]}L${p2[0]},${p2[1]}L${p1[0]},${p2[1]}L${p1[0]},${p1[1]}`],\n ['fill', '#FFF'],\n ],\n }],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n props.push(['clip-path', 'url(#' + id + ')']);\n }\n if(isInline) {\n let v = {\n tagName: 'symbol',\n props: [],\n children: [\n {\n type: 'img',\n tagName: 'image',\n props,\n }\n ],\n };\n xom.__config[NODE_DEFS_CACHE].push(v);\n repeat.forEach(item => {\n let copy = clone(props);\n if(needResize) {\n let matrix = image.matrixResize(width, height, w, h, item[0], item[1], bgW, bgH);\n if(matrix && !mx.isE(matrix)) {\n copy[5][1] = 'matrix(' + joinArr(mx.m2m6(matrix), ',') + ')';\n }\n }\n copy[1][1] = item[0];\n copy[2][1] = item[1];\n v.children.push({\n type: 'img',\n tagName: 'image',\n props: copy,\n });\n });\n return ctx.add(v);\n }\n else {\n // 先画不考虑repeat的中心声明的\n xom.virtualDom.bb.push({\n type: 'img',\n tagName: 'image',\n props,\n });\n // 再画重复的十字和4角象限\n repeat.forEach(item => {\n let copy = clone(props);\n if(needResize) {\n let matrix = image.matrixResize(width, height, w, h, item[0], item[1], bgW, bgH);\n if(matrix && !mx.isE(matrix)) {\n copy[5][1] = 'matrix(' + joinArr(mx.m2m6(matrix), ',') + ')';\n }\n }\n copy[1][1] = item[0];\n copy[2][1] = item[1];\n xom.virtualDom.bb.push({\n type: 'img',\n tagName: 'image',\n props: copy,\n });\n });\n }\n }\n }\n}\n\nexport default {\n renderBgc,\n renderImage,\n calBackgroundSize,\n};\n","import inject from '../util/inject';\nimport util from '../util/util';\n\nconst { isFunction } = util;\n\nfunction traversal(list, length, diff, after) {\n if(after) {\n for(let i = 0; i < length; i++) {\n let item = list[i];\n if(item[1]) {\n item[1](diff);\n }\n else {\n item.__after && item.__after(diff);\n }\n }\n }\n else {\n for(let i = 0; i < length; i++) {\n let item = list[i];\n if(item[0]) {\n item[0](diff);\n }\n else {\n item.__before && item.__before(diff);\n }\n }\n }\n}\n\nlet isPause;\n\nclass Frame {\n constructor() {\n this.__hookTask = []; // 动画刷新后,每个root注册的刷新回调执行\n this.__task = [];\n this.__taskCp = []; // 区别于task,component专用,和animate等其它不同流水线,在最后执行,防止混了 #122\n this.__now = null;\n }\n\n __init() {\n let self = this;\n let { task, taskCp } = self;\n inject.cancelAnimationFrame(self.id);\n let last = self.__now = inject.now();\n function cb() {\n // 必须清除,可能会发生重复,当动画finish回调中gotoAndPlay(0),下方结束判断发现aTask还有值会继续,新的init也会进入再次执行\n inject.cancelAnimationFrame(self.id);\n self.id = inject.requestAnimationFrame(function() {\n if(isPause || (!task.length && !taskCp.length)) {\n return;\n }\n let now = self.__now = inject.now();\n let diff = now - last;\n diff = Math.max(diff, 0);\n // let delta = diff * 0.06; // 比例是除以1/60s,等同于*0.06\n last = now;\n // 优先动画计算\n let clone = task.slice(0);\n let cloneCp = taskCp.splice(0); // task要常驻,taskCp只1次直接splice清空\n let length = clone.length;\n let lengthCp = cloneCp.length;\n traversal(clone, length, diff, false);\n traversal(cloneCp, lengthCp, diff, false);\n // 执行动画造成的每个Root的刷新并清空\n let list = self.__hookTask.splice(0);\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n item && item();\n }\n // 普通的before/after\n traversal(clone, length, diff, true);\n traversal(cloneCp, lengthCp, diff, true);\n // 还有则继续,没有则停止节省性能\n if(task.length || taskCp.length) {\n cb();\n }\n });\n }\n cb();\n }\n\n onFrame(handle) {\n if(!handle) {\n return;\n }\n let { task } = this;\n if(!task.length) {\n this.__init();\n }\n if(isFunction(handle)) {\n handle = {\n __after: handle,\n __karasFramecb: handle,\n };\n }\n task.push(handle);\n }\n\n offFrame(handle) {\n if(!handle) {\n return;\n }\n let { task } = this;\n for(let i = 0, len = task.length; i < len; i++) {\n let item = task[i];\n // 需考虑nextFrame包裹的引用对比\n if(item === handle || item.__karasFramecb === handle) {\n task.splice(i, 1);\n break;\n }\n }\n if(!task.length) {\n inject.cancelAnimationFrame(this.id);\n this.__now = null;\n }\n }\n\n nextFrame(handle) {\n if(!handle) {\n return;\n }\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n let cb = isFunction(handle) ? {\n __after: diff => {\n handle(diff);\n this.offFrame(cb);\n },\n } : {\n __before: handle.__before,\n __after: diff => {\n handle.__after && handle.__after(diff);\n this.offFrame(cb);\n },\n };\n cb.__karasFramecb = handle;\n this.onFrame(cb);\n }\n\n __nextFrameCp(handle) {\n let { task, taskCp } = this;\n if(!task.length && !taskCp.length) {\n this.__init();\n }\n taskCp.push(handle);\n }\n\n pause() {\n isPause = true;\n }\n\n resume() {\n if(isPause) {\n this.__init();\n isPause = false;\n }\n }\n\n get task() {\n return this.__task;\n }\n\n get taskCp() {\n return this.__taskCp;\n }\n}\n\nexport default new Frame();\n","/**\n * https://github.com/gre/bezier-easing\n * BezierEasing - use bezier curve for transition easing function\n * by Gaëtan Renaudeau 2014 - 2015 – MIT License\n */\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nlet NEWTON_ITERATIONS = 4;\nlet NEWTON_MIN_SLOPE = 0.001;\nlet SUBDIVISION_PRECISION = 0.0000001;\nlet SUBDIVISION_MAX_ITERATIONS = 10;\n\nlet kSplineTableSize = 11;\nlet kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nlet float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A(aA1, aA2) {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n}\n\nfunction B(aA1, aA2) {\n return 3.0 * aA2 - 6.0 * aA1;\n}\n\nfunction C(aA1) {\n return 3.0 * aA1;\n}\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n}\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope(aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n}\n\nfunction binarySubdivide(aX, aA, aB, mX1, mX2) {\n let currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if(currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while(Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n}\n\nfunction newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {\n for(let i = 0; i < NEWTON_ITERATIONS; ++i) {\n let currentSlope = getSlope(aGuessT, mX1, mX2);\n if(currentSlope === 0.0) {\n return aGuessT;\n }\n let currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\n\nfunction LinearEasing(x) {\n return x;\n}\n\nfunction bezier(mX1, mY1, mX2, mY2) {\n if(!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {\n throw new Error('bezier x values must be in [0, 1] range');\n }\n\n if(mX1 === mY1 && mX2 === mY2) {\n return LinearEasing;\n }\n\n // Precompute samples table\n let sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n for(let i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n\n function getTForX(aX) {\n let intervalStart = 0.0;\n let currentSample = 1;\n let lastSample = kSplineTableSize - 1;\n\n for(; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n let dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n let guessForT = intervalStart + dist * kSampleStepSize;\n\n let initialSlope = getSlope(guessForT, mX1, mX2);\n if(initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if(initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n }\n\n return function BezierEasing(x) {\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if(x === 0 || x === 1) {\n return x;\n }\n return calcBezier(getTForX(x), mY1, mY2);\n };\n}\n\nlet easing = {\n linear: bezier(1, 1, 0, 0),\n easeIn: bezier(0.42, 0, 1, 1),\n easeOut: bezier(0, 0, 0.58, 1),\n ease: bezier(0.25, 0.1, 0.25, 1),\n easeInOut: bezier(0.42, 0, 0.58, 1),\n cubicBezier: bezier,\n getEasing(v, v1, v2, v3) {\n if(arguments.length === 4) {\n return bezier(v, v1, v2, v3);\n }\n else if(Array.isArray(v) && v.length === 4) {\n return bezier(v[0], v[1], v[2], v[3]);\n }\n else if(v) {\n v = v.toString();\n let timingFunction;\n if(/^\\s*(?:cubic-bezier\\s*)?\\(\\s*[\\d.]+\\s*,\\s*[-\\d.]+\\s*,\\s*[\\d.]+\\s*,\\s*[-\\d.]+\\s*\\)\\s*$/i.test(v)) {\n v = v.match(/[\\d.]+/g);\n timingFunction = bezier(v[0], v[1], v[2], v[3]);\n }\n else if(v !== 'getEasing') {\n timingFunction = this[v];\n }\n return timingFunction;\n }\n },\n};\n\neasing['ease-in'] = easing.easeIn;\neasing['ease-out'] = easing.easeOut;\neasing['ease-in-out'] = easing.easeInOut;\n\nexport default easing;\n","import css from '../style/css';\nimport unit from '../style/unit';\nimport tf from '../style/transform';\nimport abbr from '../style/abbr';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport Event from '../util/Event';\nimport inject from '../util/inject';\nimport frame from './frame';\nimport easing from './easing';\nimport change from '../refresh/change';\nimport key from './key';\nimport mx from '../math/matrix';\n\nconst {\n STYLE_KEY: {\n FILTER,\n TRANSFORM_ORIGIN,\n PERSPECTIVE_ORIGIN,\n BACKGROUND_CLIP,\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n BOX_SHADOW,\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n BACKGROUND_SIZE,\n FONT_SIZE,\n FLEX_BASIS,\n FLEX_DIRECTION,\n WIDTH,\n HEIGHT,\n TOP,\n BOTTOM,\n LINE_HEIGHT,\n OPACITY,\n Z_INDEX,\n TRANSFORM,\n COLOR,\n FONT_WEIGHT,\n FONT_STYLE,\n FONT_FAMILY,\n TEXT_ALIGN,\n MATRIX,\n ROTATE_3D,\n TRANSLATE_PATH,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_OVER,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_STYLE,\n UPDATE_KEYS,\n UPDATE_CONFIG,\n },\n KEY_FRAME_KEY: {\n FRAME_STYLE,\n FRAME_TIME,\n FRAME_EASING,\n FRAME_TRANSITION,\n },\n ANIMATE_KEY: {\n I_ASSIGNING,\n I_IN_FPS,\n I_IS_DELAY,\n I_BEGIN,\n I_END,\n I_FINISHED,\n I_NEXT_END,\n I_FIRST_PLAY,\n I_PLAY_CB,\n I_TARGET,\n I_ROOT,\n I_FRAMES,\n I_FRAMES_R,\n I_CURRENT_TIME,\n I_NEXT_TIME,\n I_STYLE,\n I_DURATION,\n I_ITERATIONS,\n I_FILL,\n I_PLAYBACK_RATE,\n I_PLAY_COUNT,\n I_PLAY_STATE,\n I_DESTROYED,\n I_START_TIME,\n I_FPS_TIME,\n I_EASING,\n I_ENTER_FRAME,\n I_DELAY,\n I_END_DELAY,\n I_KEYS,\n I_ORIGIN_STYLE,\n I_CURRENT_FRAMES,\n I_CURRENT_FRAME,\n I_SPF_LIMIT,\n I_FPS,\n I_DIRECTION,\n I_FIRST_ENTER,\n I_STAY_BEGIN,\n I_STAY_END,\n I_IS2,\n I_END_TIME,\n I_NODE_CONFIG,\n I_ROOT_CONFIG,\n I_OUT_BEGIN_DELAY,\n I_TIME_STAMP,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, INHERIT, RGBA, STRING, NUMBER, REM, VW, VH, VMAX, VMIN, calUnit } = unit;\nconst { isNil, isFunction, isNumber, isObject, isString, clone, equalArr } = util;\nconst { linear } = easing;\nconst { cloneStyle } = css;\nconst { isGeom, GEOM } = change;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nconst NUM_CAL_HASH = {\n};\nObject.assign(NUM_CAL_HASH, LENGTH_HASH);\nObject.assign(NUM_CAL_HASH, EXPAND_HASH);\n\nfunction unify(frames, target) {\n let hash = {};\n let keys = [];\n // 获取所有关键帧的属性\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n Object.keys(style).forEach(k => {\n let v = style[k];\n // 未定义的过滤掉,null空有意义\n if(v !== undefined && !hash.hasOwnProperty(k)) {\n hash[k] = true;\n // geom为属性字符串,style都为枚举int\n if(!GEOM.hasOwnProperty(k)) {\n k = parseInt(k);\n }\n // path动画要转为translateXY,所以手动添加,使2帧之间存在过渡,有可能之前已存在这个动画,可忽视\n if(k === TRANSLATE_PATH) {\n if(!hash.hasOwnProperty(TRANSLATE_X)) {\n keys.push(TRANSLATE_X);\n }\n if(!hash.hasOwnProperty(TRANSLATE_Y)) {\n keys.push(TRANSLATE_Y);\n }\n hash[TRANSLATE_X] = hash[TRANSLATE_Y] = true;\n }\n keys.push(k);\n }\n });\n });\n // 添补没有声明完全的关键帧属性为节点当前值\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n keys.forEach(k => {\n if(!style.hasOwnProperty(k) || isNil(style[k])) {\n if(GEOM.hasOwnProperty(k)) {\n style[k] = target.getProps(k);\n }\n else {\n style[k] = target.currentStyle[k];\n }\n }\n });\n });\n return keys;\n}\n\n// 每次初始化时处理继承值,以及转换transform为单matrix矩阵\nfunction inherit(frames, keys, target) {\n let computedStyle = target.computedStyle;\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n keys.forEach(k => {\n let v = style[k];\n // geom的属性可能在帧中没有\n if(isNil(v)) {\n return;\n }\n if(k === TRANSFORM) {\n let ow = target.outerWidth;\n let oh = target.outerHeight;\n let m = tf.calMatrix(v, ow, oh);\n style[k] = [[MATRIX, m]];\n }\n else if(v[1] === INHERIT) {\n if(k === COLOR || k === TEXT_STROKE_COLOR) {\n style[k] = [util.rgba2int(computedStyle[k]), RGBA];\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n style[k] = [computedStyle[k], PX];\n }\n else if(k === FONT_WEIGHT) {\n style[k] = [computedStyle[k], NUMBER];\n }\n else if(k === FONT_STYLE || k === FONT_FAMILY || k === TEXT_ALIGN || k === TEXT_STROKE_OVER) {\n style[k] = [computedStyle[k], STRING];\n }\n }\n });\n });\n}\n\n/**\n * 通知root更新当前动画,需要根据frame的状态来决定是否是同步插入\n * 在异步时,因为动画本身是异步,需要addRefreshTask\n * 而如果此时frame在执行before过程中,说明帧动画本身是在before计算的,需要同步插入\n * @param style\n * @param keys 样式所有的key\n * @param __config\n * @param root\n * @param node\n */\nfunction genBeforeRefresh(style, keys, __config, root, node) {\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = keys;\n res[UPDATE_CONFIG] = __config[I_NODE_CONFIG];\n root.__addUpdate(node, __config[I_NODE_CONFIG], root, __config[I_ROOT_CONFIG], res);\n __config[I_STYLE] = style;\n __config[I_ASSIGNING] = true;\n // frame每帧回调时,下方先执行计算好变更的样式,这里特殊插入一个hook,让root增加一个刷新操作\n // 多个动画调用因为相同root也只会插入一个,这样在所有动画执行完毕后frame里检查同步进行刷新,解决单异步问题\n root.__frameHook();\n}\n\n/**\n * 将每帧的样式格式化,提取出offset属性并转化为时间,提取出缓动曲线easing\n * @param style 关键帧样式\n * @param duration 动画时间长度\n * @param es options的easing曲线控制,frame没有自定义则使用全局的\n * @returns {{style: *, time: number, easing: *, transition: []}}\n */\nfunction framing(style, duration, es) {\n let { offset, easing } = style;\n // 这两个特殊值提出来存储不干扰style\n delete style.offset;\n delete style.easing;\n // translatePath特殊对待,ae的曲线运动动画\n let translatePath = style.translatePath;\n style = css.normalize(style);\n if(Array.isArray(translatePath) && [6, 8].indexOf(translatePath.length) > -1) {\n style[TRANSLATE_PATH] = translatePath.map(item => calUnit(item));\n }\n let res = [];\n res[FRAME_STYLE] = style;\n res[FRAME_TIME] = offset * duration;\n res[FRAME_EASING] = easing || es;\n res[FRAME_TRANSITION] = [];\n return res;\n}\n\nfunction calByUnit(p, n, container, root) {\n if(p[1] === PX) {\n if(n[1] === PERCENT) {\n return n[0] * 0.01 * container - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width * 0.01 - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height * 0.01 - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) * 0.01 - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) * 0.01 - p[0];\n }\n }\n else if(p[1] === PERCENT) {\n if(n[1] === PX) {\n return n[0] * 100 / container - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * root.computedStyle[FONT_SIZE] * 100 / container - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / container - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / container - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) / container - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) / container - p[0];\n }\n }\n else if(p[1] === REM) {\n if(n[1] === PX) {\n return n[0] / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * 0.01 * container / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n }\n else if(p[1] === VW) {\n if(n[1] === PX) {\n return n[0] * 100 / root.width - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / root.width - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / root.width - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / root.width - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) / root.width - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) / root.width - p[0];\n }\n }\n else if(p[1] === VH) {\n if(n[1] === PX) {\n return n[0] * 100 / root.height - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / root.height - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / root.height - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / root.height - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) / root.height - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) / root.height - p[0];\n }\n }\n else if(p[1] === VMAX) {\n if(n[1] === PX) {\n return n[0] * 100 / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / Math.max(root.width, root.height) - p[0];\n }\n else if(n[1] === VMIN) {\n return n[0] * Math.min(root.width, root.height) / Math.max(root.width, root.height) - p[0];\n }\n }\n else if(p[1] === VMIN) {\n if(n[1] === PX) {\n return n[0] * 100 / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / Math.min(root.width, root.height) - p[0];\n }\n else if(n[1] === VMAX) {\n return n[0] * Math.max(root.width, root.height) / Math.min(root.width, root.height) - p[0];\n }\n }\n}\n\n/**\n * 计算两帧之间的差,单位不同的以后面为准,返回的v表示差值\n * 没有变化返回空\n * auto等无法比较的不参与计算,不返回来标识无过度效果\n * @param prev 上一帧样式\n * @param next 下一帧样式\n * @param k 比较的样式名\n * @param target dom对象\n * @param tagName dom名\n * @returns {{k: *, v: *}}\n */\nfunction calDiff(prev, next, k, target, tagName) {\n let res = [k];\n let p = prev[k];\n let n = next[k];\n if(k === TRANSFORM) {\n // transform因默认值null很特殊,不存在时需给默认矩阵\n if(!p && !n) {\n return;\n }\n let pm, nm;\n if(p) {\n pm = p[0][1];\n }\n else {\n pm = mx.identity();\n }\n if(n) {\n nm = n[0][1];\n }\n else {\n nm = mx.identity();\n }\n // transform特殊被初始化转成matrix矩阵,直接计算差值\n if(equalArr(pm, nm)) {\n return;\n }\n res[1] = [\n nm[0] - pm[0],\n nm[1] - pm[1],\n nm[2] - pm[2],\n nm[3] - pm[3],\n nm[4] - pm[4],\n nm[5] - pm[5],\n nm[6] - pm[6],\n nm[7] - pm[7],\n nm[8] - pm[8],\n nm[9] - pm[9],\n nm[10] - pm[10],\n nm[11] - pm[11],\n nm[12] - pm[12],\n nm[13] - pm[13],\n nm[14] - pm[14],\n nm[15] - pm[15],\n ];\n return res;\n }\n else if(k === ROTATE_3D) {\n if(equalArr(p, n)) {\n return;\n }\n res[1] = [n[0] - n[0], n[1] - p[1], n[2] - p[2], [n[3][0] - p[3][0], n[3][1]]];\n }\n else if(k === FILTER) {\n // filter很特殊,里面有多个滤镜,忽视顺序按hash计算,为空视为默认值,如blur默认0,brightness默认1\n let pHash = {}, nHash = {}, keyHash = {};\n if(p) {\n p.forEach(item => {\n keyHash[item[0]] = true;\n pHash[item[0]] = item[1];\n });\n }\n if(n) {\n n.forEach(item => {\n keyHash[item[0]] = true;\n nHash[item[0]] = item[1];\n })\n }\n let v = {}, hasChange;\n // 只有blur支持px/rem/vw/vh/vmax/vmin,其余都是特殊固定单位\n Object.keys(keyHash).forEach(k => {\n if(k === 'blur') {\n if(!pHash[k]) {\n v[k] = nHash[k].slice(0);\n hasChange = true;\n }\n else if(!nHash[k]) {\n v[k] = [-pHash[k][0], pHash[k][1]];\n hasChange = true;\n }\n else {\n let v2 = calByUnit(pHash[k], nHash[k], 0, target.root);\n v[k] = [v2, pHash[k][1]];\n hasChange = true;\n }\n }\n else if(k === 'hue-rotate') {\n let nv = isNil(nHash[k]) ? 0 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 0 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'contrast' || k === 'sepia' || k === 'invert') {\n let nv = isNil(nHash[k]) ? 100 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 100 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n else if(k === 'grayscale') {\n let nv = isNil(nHash[k]) ? 0 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 0 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n });\n if(!hasChange) {\n return;\n }\n res[1] = v;\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n res[1] = [];\n for(let i = 0; i < 2; i++) {\n let pi = p[i];\n let ni = n[i];\n if(pi[1] === ni[1]) {\n res[1].push(ni[0] - pi[0]);\n }\n else {\n let v = calByUnit(pi, ni, target[i ? 'outerHeight' : 'outerWidth'], target.root);\n res[1].push(v || 0);\n }\n }\n if(equalArr(res[1], [0, 0])) {\n return;\n }\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n res[1] = [];\n let length = Math.min(p.length, n.length);\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni) {\n res[1].push(null);\n continue;\n }\n if(pi[1] === ni[1]) {\n let v = ni[0] - pi[0];\n if(!v) {\n res[1].push(null);\n return;\n }\n res[1].push(v);\n }\n else {\n let k2 = k === BACKGROUND_POSITION_X ? 'offsetWidth' : 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = k === BACKGROUND_POSITION_X ? 'clientWidth' : 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = k === BACKGROUND_POSITION_X ? 'width' : 'height';\n }\n let v = calByUnit(pi, ni, target[k2], target.root);\n if(!v) {\n res[1].push(null);\n return;\n }\n res[1].push(v);\n }\n }\n }\n else if(k === BOX_SHADOW) {\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let a = p[i];\n let b = n[i];\n let v = [];\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n v.push(b[j] - a[j]);\n }\n // rgba\n let c = [];\n for(let j = 0; j < 4; j++) {\n c.push(b[4][j] - a[4][j]);\n }\n v.push(c);\n res[1].push(v);\n }\n }\n else if(EXPAND_HASH.hasOwnProperty(k)) {\n if(p[1] === n[1]) {\n let v = n[0] - p[0];\n if(v === 0) {\n return;\n }\n res[1] = v;\n }\n else {\n let v = calByUnit(p, n, target[k === TRANSLATE_X || k === TRANSLATE_Z ? 'outerWidth' : 'outerHeight'], target.root);\n if(!v) {\n return;\n }\n res[1] = v;\n }\n }\n else if(k === BACKGROUND_SIZE) {\n res[1] = [];\n let length = Math.min(p.length, n.length);\n let has;\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni) {\n res[1].push(null);\n continue;\n }\n let temp = [];\n for(let j = 0; j < 2; j++) {\n let pp = pi[j], nn = ni[j];\n if(pp[1] === nn[1]) {\n temp.push(nn[0] - pp[0]);\n }\n else {\n let k2 = i ? 'offsetWidth' : 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = i ? 'clientWidth' : 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = i ? 'width' : 'height';\n }\n let v = calByUnit(pp, nn, target[k2], target.root);\n temp.push(v || 0);\n }\n }\n if(equalArr(temp, [0, 0])) {\n res[1].push(null);\n }\n else {\n res[1].push(temp);\n has = true;\n }\n }\n if(!has) {\n return;\n }\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n // backgroundImage发生了渐变色和图片的变化,fill发生渐变色和纯色的变化等\n res[1] = [];\n let length = Math.min(p.length, n.length);\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni || isString(pi) || isString(ni)) {\n res[1].push(null);\n continue;\n }\n if(pi.k !== ni.k) {\n res[1].push(null);\n continue;\n }\n let temp = [];\n // 渐变\n if(pi.k === 'linear' || pi.k === 'radial' || pi.k === 'conic') {\n let pv = pi.v;\n let nv = ni.v;\n temp[0] = [];\n let { clientWidth } = target;\n let eq = equalArr(pv, nv);\n for(let i = 0, len = Math.min(pv.length, nv.length); i < len; i++) {\n let a = pv[i];\n let b = nv[i];\n let t = [];\n t.push([\n b[0][0] - a[0][0],\n b[0][1] - a[0][1],\n b[0][2] - a[0][2],\n b[0][3] - a[0][3],\n ]);\n if(a[1] && b[1]) {\n if(a[1][1] === b[1][1]) {\n t.push(b[1][0] - a[1][0]);\n }\n else {\n let v = calByUnit(a[1], b[1], clientWidth, target.root);\n t.push(v || 0);\n }\n }\n temp[0].push(t);\n }\n // 线性渐变有角度差值变化\n if(pi.k === 'linear') {\n let isArrP = Array.isArray(pi.d);\n let isArrN = Array.isArray(ni.d);\n if(isArrN !== isArrP) {\n res[1].push(null);\n continue;\n }\n if(isArrP) {\n let v = [ni.d[0] - pi.d[0], ni.d[1] - pi.d[1], ni.d[2] - pi.d[2], ni.d[3] - pi.d[3]];\n if(eq && equalArr(v, [0, 0, 0, 0])) {\n res[1].push(null);\n continue;\n }\n temp[1] = v;\n }\n else {\n let v = ni.d - pi.d;\n if(eq && v === 0) {\n res[1].push(null);\n continue;\n }\n temp[1] = v;\n }\n }\n // 径向渐变的位置\n else if(pi.k === 'radial') {\n let isArrP = Array.isArray(pi.z);\n let isArrN = Array.isArray(ni.z);\n if(isArrN !== isArrP) {\n res[1].push(null);\n continue;\n }\n if(isArrP) {\n temp[2] = [];\n for(let i = 0; i < 5; i++) {\n let pz = pi.z[i];\n // 半径比例省略为1\n if(pz === undefined) {\n pz = 1;\n }\n let nz = ni.z[i];\n if(nz === undefined) {\n nz = 1;\n }\n temp[2].push(nz - pz);\n }\n if(eq && equalArr(res[4], [0, 0, 0, 0, 0])) {\n res[1].push(null);\n }\n }\n else {\n temp[2] = [];\n for(let i = 0; i < 2; i++) {\n let pp = pi.p[i];\n let np = ni.p[i];\n if(pp[1] === np[1]) {\n temp[2].push(np[0] - pp[0]);\n }\n else {\n let v = calByUnit(pp, np, target[i ? 'clientWidth' : 'clientHeight'], target.root);\n temp[2].push(v || 0);\n }\n }\n if(eq && equalArr(res[3], [0, 0])) {\n res[1].push(null);\n }\n }\n }\n else if(pi.k === 'conic') {\n temp[1].push(n.d - p.d);\n temp[2] = [];\n for(let i = 0; i < 2; i++) {\n let pp = p.p[i];\n let np = n.p[i];\n if(pp[1] === np[1]) {\n temp[2].push(np[0] - pp[0]);\n }\n else {\n let v = calByUnit(pp, np, target[i ? 'clientWidth' : 'clientHeight'], target.root);\n temp[2].push(v || 0);\n }\n }\n if(eq && res[2] !== 0 && equalArr(res[3], [0, 0])) {\n res[1].push(null);\n }\n }\n }\n // 纯色\n else {\n if(equalArr(n, pi)) {\n res[1].push(null);\n }\n temp[0] = [\n ni[0] - pi[0],\n ni[1] - pi[1],\n ni[2] - pi[2],\n ni[3] - pi[3]\n ];\n }\n res[1].push(temp);\n }\n }\n else if(COLOR_HASH.hasOwnProperty(k)) {\n n = n[0];\n p = p[0];\n if(equalArr(n, p) || n[3] === 0 && p[3] === 0) {\n return;\n }\n res[1] = [\n n[0] - p[0],\n n[1] - p[1],\n n[2] - p[2],\n n[3] - p[3]\n ];\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n // x/y都相等无需\n if(n[0][0] === p[0][0] && n[0][1] === p[0][1]\n && n[1][0] === p[1][0] && n[1][1] === p[1][1]) {\n return;\n }\n res[1] = [];\n for(let i = 0; i < 2; i++) {\n if(n[i][1] === p[i][1]) {\n res[1].push(n[i][0] - p[i][0]);\n }\n else {\n let v = calByUnit(p[i], n[i], target[i ? 'outerHeight' : 'outerWidth'], target.root);\n res[1].push(v || 0);\n }\n }\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n // auto不做动画\n if(p[1] === AUTO || n[1] === AUTO) {\n return;\n }\n let computedStyle = target.computedStyle;\n let parentComputedStyle = (target.domParent || target).computedStyle;\n let diff = 0;\n if(p[1] === n[1]) {\n diff = n[0] - p[0];\n }\n // lineHeight奇怪的单位变化,%相对于fontSize\n else if(k === LINE_HEIGHT) {\n diff = calByUnit(p, n, computedStyle[FONT_SIZE], target.root);\n }\n // fontSize的%相对于parent的\n else if(k === FONT_SIZE) {\n diff = calByUnit(p, n, parentComputedStyle[FONT_SIZE], target.root);\n }\n // 相对于父height的特殊属性\n else if(k === FLEX_BASIS\n && ['column', 'column-reverse', 'columnReverse'].indexOf(computedStyle[FLEX_DIRECTION]) > -1\n || [HEIGHT, TOP, BOTTOM].indexOf(k) > -1) {\n if(p[1] !== AUTO && n[1] !== AUTO) {\n diff = calByUnit(p, n, parentComputedStyle[HEIGHT], target.root);\n }\n }\n // 其余都是相对于父width的\n else {\n if(p[1] !== AUTO && n[1] !== AUTO) {\n diff = calByUnit(p, n, parentComputedStyle[WIDTH], target.root);\n }\n }\n // 兜底NaN非法\n if(diff === 0 || isNaN(diff)) {\n return;\n }\n res[1] = diff;\n }\n else if(GEOM.hasOwnProperty(k)) {\n if(isNil(p)) {\n return;\n }\n else if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calDiff)) {\n let fn = GEOM[k][tagName].calDiff;\n if(target.isMulti) {\n let arr = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n arr.push(fn(p[i], n[i]));\n }\n return arr;\n }\n else {\n res[1] = fn(p, n);\n }\n }\n // 特殊处理multi\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.min(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(null);\n }\n else {\n let v3 = [];\n for(let k = 0, len3 = Math.max(pv2.length, nv2.length); k < len3; k++) {\n let pv3 = pv2[k];\n let nv3 = nv2[k];\n // control由4点变2点\n if(isNil(pv3) || isNil(nv3)) {\n v3.push(0);\n }\n else {\n v3.push(nv3 - pv3);\n }\n }\n v2.push(v3);\n }\n }\n res[1].push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n res[1].push([\n nv[0] - pv[0],\n nv[1] - pv[1],\n ]);\n }\n }\n }\n else {\n if(n === p || equalArr(n, p) || k === 'edge' || k === 'closure' || k === 'booleanOperations') {\n return;\n }\n let v = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || isNil(nv)) {\n v.push(0);\n }\n v.push(nv - pv);\n }\n res[1] = v;\n }\n }\n // 非multi特殊处理这几类数组类型数据\n else if(k === 'points' || k === 'controls') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.max(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n // control由4点变2点\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(0);\n }\n else {\n v2.push(nv2 - pv2);\n }\n }\n res[1].push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [\n n[0] - p[0],\n n[1] - p[1],\n ];\n }\n // 其它简单数据,除了edge/closure/booleanOperations没有增量\n else {\n if(n === p || k === 'edge' || k === 'closure' || k === 'booleanOperations') {\n return;\n }\n else {\n res[1] = n - p;\n }\n }\n }\n else if(k === OPACITY || k === Z_INDEX) {\n if(n === p) {\n return;\n }\n res[1] = n - p;\n }\n // 特殊的path,不存在style中但在动画某帧中,不会统一化所以可能反向计算frameR时后一帧没有\n else if(k === TRANSLATE_PATH && p) {\n let k1 = 'offsetWidth', k2 = 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k1 = 'clientWidth';\n k2 = 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k1 = 'width';\n k2 = 'height';\n }\n res[1] = p.map((item, i) => {\n let [v, u] = item;\n if(u === PERCENT) {\n if(i % 2 === 0) {\n return [(parseFloat(v) || 0) * 0.01 * target[k1], PX];\n }\n else {\n return [(parseFloat(v) || 0) * 0.01 * target[k2], PX];\n }\n }\n else if(u === REM) {\n return [(parseFloat(v) || 0) * root.computedStyle[FONT_SIZE] * 100, PX];\n }\n else if(u === VW) {\n return [(parseFloat(v) || 0) * 0.01 * root.width, PX];\n }\n else if(u === VH) {\n return [(parseFloat(v) || 0) * 0.01 * root.height, PX];\n }\n else if(u === VMAX) {\n return [(parseFloat(v) || 0) * 0.01 * Math.max(root.width, root.height), PX];\n }\n else if(u === VMIN) {\n return [(parseFloat(v) || 0) * 0.01 * Math.min(root.width, root.height), PX];\n }\n else {\n return [parseFloat(v) || 0, PX];\n }\n });\n }\n // display等不能有增量过程的\n else {\n return;\n }\n return res;\n}\n\n// 计算两帧之间不相同的变化,存入transition,相同的忽略\nfunction calFrame(prev, next, keys, target, tagName) {\n keys.forEach(k => {\n let ts = calDiff(prev[FRAME_STYLE], next[FRAME_STYLE], k, target, tagName);\n // 可以形成过渡的才会产生结果返回\n if(ts) {\n prev[FRAME_TRANSITION].push(ts);\n }\n });\n return next;\n}\n\nfunction binarySearch(i, j, time, frames) {\n if(i === j) {\n let frame = frames[i];\n if(frame[FRAME_TIME] > time) {\n return i - 1;\n }\n return i;\n }\n else {\n let middle = i + ((j - i) >> 1);\n let frame = frames[middle];\n if(frame[FRAME_TIME] === time) {\n return middle;\n }\n else if(frame[FRAME_TIME] > time) {\n return binarySearch(i, Math.max(middle - 1, i), time, frames);\n }\n else {\n return binarySearch(Math.min(middle + 1, j), j, time, frames);\n }\n }\n}\n\nfunction getEasing(ea) {\n let timingFunction;\n if(ea) {\n if((timingFunction = /^\\s*steps\\s*\\(\\s*(\\d+)(?:\\s*,\\s*(\\w+))?\\s*\\)/i.exec(ea))) {\n let steps = parseInt(timingFunction[1]);\n let stepsD = timingFunction[2];\n timingFunction = function(percent) {\n // steps有效定义正整数\n if(steps && steps > 0) {\n let per = 1 / steps;\n let n = stepsD === 'start' ? Math.ceil(percent / per) : Math.floor(percent / per);\n return n / steps;\n }\n return percent;\n };\n }\n else {\n timingFunction = easing.getEasing(ea);\n }\n }\n return timingFunction;\n}\n\n/**\n * 根据百分比和缓动函数计算中间态样式\n * 当easing定义为steps时,优先计算\n * @param frame 当前帧\n * @param keys 所有样式key\n * @param percent 到下一帧时间的百分比\n * @param target vd\n * @returns {*}\n */\nfunction calIntermediateStyle(frame, keys, percent, target) {\n let style = cloneStyle(frame[FRAME_STYLE], keys);\n let timingFunction = getEasing(frame[FRAME_EASING]);\n if(timingFunction && timingFunction !== linear) {\n percent = timingFunction(percent);\n }\n let transition = frame[FRAME_TRANSITION];\n for(let i = 0, len = transition.length; i < len; i++) {\n let [k, v] = transition[i];\n let st = style[k];\n // transform特殊处理,只有1个matrix,有可能不存在,需给默认矩阵\n if(k === TRANSFORM) {\n if(!st) {\n st = style[k] = [[MATRIX, mx.identity()]];\n }\n for(let i = 0; i < 16; i++) {\n st[0][1][i] += v[i] * percent;\n }\n }\n // 特殊的曲线运动计算,转换为translateXY,出现在最后一定会覆盖原本的translate防重\n else if(k === TRANSLATE_PATH) {\n let t = 1 - percent;\n if(v.length === 8) {\n style[TRANSLATE_X] = [\n v[0][0] * t * t * t\n + 3 * v[2][0] * percent * t * t\n + 3 * v[4][0] * percent * percent * t\n + v[6][0] * percent * percent * percent,\n PX,\n ];\n style[TRANSLATE_Y] = [\n v[1][0] * t * t * t\n + 3 * v[3][0] * percent * t * t\n + 3 * v[5][0] * percent * percent * t\n + v[7][0] * percent * percent * percent,\n PX,\n ];\n }\n else if(v.length === 6) {\n style[TRANSLATE_X] = [\n v[0][0] * t * t\n + 2 * v[2][0] * percent * t\n + v[4][0] * percent * percent,\n PX,\n ];\n style[TRANSLATE_Y] = [\n v[1][0] * t * t\n + 3 * v[3][0] * percent * t\n + v[5][0] * percent * percent,\n PX,\n ];\n }\n }\n else if(k === ROTATE_3D) {\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3][0] += v[3][0] * percent;\n }\n else if(NUM_CAL_HASH.hasOwnProperty(k)) {\n if(v) {\n st[0] += v * percent;\n }\n }\n else if(k === FILTER) {\n // 只有1个样式声明了filter另外一个为空,会造成无样式,需初始化数组并在下面计算出样式存入\n if(!st) {\n st = style[k] = [];\n }\n // 将已有的样式按key存入引用来操作\n let hash = {};\n st.forEach(item => {\n hash[item[0]] = item[1];\n });\n Object.keys(v).forEach(k => {\n if(hash.hasOwnProperty(k)) {\n hash[k][0] += v[k][0] * percent;\n }\n else {\n // 2个关键帧中有1个未声明,需新建样式存入\n if(k === 'blur' || k === 'hue-rotate' || k === 'grayscale') {\n let n = v[k].slice(0);\n n[0] *= percent;\n st.push([k, n]);\n }\n // 默认值是1而非0\n else if(k === 'saturate' || k === 'brightness' || k === 'contrast' || k === 'sepia' || k === 'invert') {\n let n = v[k].slice(0);\n n[0] = 100 + n[0] * percent;\n st.push([k, n]);\n }\n }\n });\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n for(let i = 0; i < 2; i++) {\n st[i][0] += v[i] * percent;\n }\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n if(v[0] !== 0) {\n st[0][0] += v[0] * percent;\n }\n if(v[1] !== 0) {\n st[1][0] += v[1] * percent;\n }\n }\n else if(k === BOX_SHADOW) {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n st[i][j] += v[i][j] * percent;\n }\n // rgba\n for(let j = 0; j < 4; j++) {\n st[i][4][j] += v[i][4][j] * percent;\n }\n }\n }\n else if(k === BACKGROUND_SIZE) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0][0] += v[i][0] * percent;\n item[1][0] += v[i][1] * percent;\n }\n });\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0] += v[i] * percent;\n }\n });\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n st.forEach((st2, i) => {\n let v2 = v[i];\n if(!v2) {\n return;\n }\n let [c, d, p, z] = v2;\n if(GRADIENT_TYPE.hasOwnProperty(st2.k)) {\n for(let i = 0, len = Math.min(st2.v.length, c.length); i < len; i++) {\n let a = st2.v[i];\n let b = c[i];\n a[0][0] += b[0][0] * percent;\n a[0][1] += b[0][1] * percent;\n a[0][2] += b[0][2] * percent;\n a[0][3] += b[0][3] * percent;\n if(a[1] && b[1]) {\n a[1][0] += b[1] * percent;\n }\n }\n if(st2.k === 'linear' && st2.d !== undefined && d !== undefined) {\n if(Array.isArray(d)) {\n st2.d[0] += d[0] * percent;\n st2.d[1] += d[1] * percent;\n st2.d[2] += d[2] * percent;\n st2.d[3] += d[3] * percent;\n }\n else {\n st2.d += d * percent;\n }\n }\n if(st2.k === 'radial') {\n if(st2.z !== undefined && z !== undefined) {\n st2.z[0] += z[0] * percent;\n st2.z[1] += z[1] * percent;\n st2.z[2] += z[2] * percent;\n st2.z[3] += z[3] * percent;\n st2.z[4] += z[4] * percent;\n }\n else if(st2.p !== undefined && p !== undefined) {\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n else if(st2.k === 'conic' && st2.d !== undefined && d !== undefined) {\n st2.d += d * percent;\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n // fill纯色\n else {\n st2[0] += c[0] * percent;\n st2[1] += c[1] * percent;\n st2[2] += c[2] * percent;\n st2[3] += c[3] * percent;\n }\n });\n }\n // color可能超限[0,255],但浏览器已经做了限制,无需关心\n else if(COLOR_HASH.hasOwnProperty(k)) {\n st = st[0];\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n else if(GEOM.hasOwnProperty(k)) {\n let st = style[k];\n let tagName = target.tagName;\n if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calIncrease)) {\n let fn = GEOM[k][tagName].calIncrease;\n if(target.isMulti) {\n style[k] = st.map((item, i) => {\n return fn(item, v[i], percent);\n });\n }\n else {\n style[k] = fn(st, v, percent);\n }\n }\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n let o2 = o[j];\n let n2 = n[j];\n if(!isNil(o2) && !isNil(n2)) {\n for(let k = 0, len3 = Math.min(o2.length, n2.length); k < len3; k++) {\n if(!isNil(o2[k]) && !isNil(n2[k])) {\n o2[k] += n2[k] * percent;\n }\n }\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n v.forEach((item, i) => {\n let st2 = st[i];\n if(!isNil(item) && !isNil(st2)) {\n for(let i = 0, len = Math.min(st2.length, item.length); i < len; i++) {\n let o = st2[i];\n let n = item[i];\n if(!isNil(o) && !isNil(n)) {\n st2[i] += n * percent;\n }\n }\n }\n });\n }\n else {\n v.forEach((item, i) => {\n if(!isNil(item) && !isNil(st[i])) {\n st[i] += item * percent;\n }\n });\n }\n }\n else {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n if(!isNil(o[j]) && !isNil(n[j])) {\n o[j] += n[j] * percent;\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(!isNil(st[0]) && !isNil(v[0])) {\n st[0] += v[0] * percent;\n }\n if(!isNil(st[1]) && !isNil(v[1])) {\n st[1] += v[1] * percent;\n }\n }\n else {\n if(!isNil(st) && !isNil(v)) {\n style[k] += v * percent;\n }\n }\n }\n }\n else if(k === OPACITY || k === Z_INDEX) {\n style[k] += v * percent;\n // 精度问题可能会超过[0,1]区间\n if(k === OPACITY) {\n if(style[k] < 0) {\n style[k] = 0;\n }\n else if(style[k] > 1) {\n style[k] = 1;\n }\n }\n }\n }\n return style;\n}\n\nfunction gotoOverload(options, cb) {\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n return [options || {}, cb];\n}\n\nfunction calDiffTime(__config, diff) {\n let playbackRate = __config[I_PLAYBACK_RATE];\n let spfLimit = __config[I_SPF_LIMIT];\n let fps = __config[I_FPS];\n let v = __config[I_CURRENT_TIME] = __config[I_NEXT_TIME];\n // 定帧限制每帧时间间隔最大为spf\n if(spfLimit) {\n if(spfLimit === true) {\n diff = Math.min(diff, 1000 / fps);\n }\n else if(spfLimit > 0) {\n diff = Math.min(diff, spfLimit);\n }\n }\n // 播放时间累加,并且考虑播放速度加成\n if(playbackRate !== 1 && playbackRate > 0) {\n diff *= playbackRate;\n }\n __config[I_NEXT_TIME] += diff;\n return [v, diff];\n}\n\nfunction frameCb(self, __config, diff, isDelay) {\n self.emit(Event.FRAME, diff, isDelay);\n if(__config[I_FIRST_PLAY]) {\n __config[I_FIRST_PLAY] = false;\n self.emit(Event.PLAY);\n }\n let cb = __config[I_PLAY_CB];\n if(isFunction(cb)) {\n cb.call(self, diff, isDelay);\n // 清理要检查,gotoAndStop()这种cb回调中直接再次调用goto的话cb会不一致不能删除\n if(__config[I_PLAY_CB] === cb) {\n __config[I_PLAY_CB] = null;\n }\n }\n}\n\nlet uuid = 0;\n\nclass Animation extends Event {\n constructor(target, list, options) {\n super();\n this.__id = uuid++;\n list = clone(list || []);\n if(Array.isArray(list)) {\n list = list.filter(item => item && isObject(item));\n }\n // 动画过程另外一种形式,object描述k-v形式\n else if(list && isObject(list)) {\n let nl = [];\n Object.keys(list).forEach(k => {\n let v = list[k];\n if(Array.isArray(v)) {\n for(let i = 0, len = v.length; i < len; i++) {\n let o = nl[i] = nl[i] || {\n offset: i / (len - 1),\n };\n o[k] = v[i];\n }\n }\n });\n list = nl;\n }\n else {\n list = [];\n }\n if(isNumber(options)) {\n this.__options = {\n duration: options,\n };\n options = this.__options;\n }\n let op = this.__options = options || {\n duration: 0,\n };\n let root = target.root;\n let config = this.__config = [\n false, // assigning\n false, // inFps\n false, // isDelay\n false, // begin\n false, // end\n false, // finished\n false, // nextBegin\n true, // firstPlay\n null, // playCb\n target,\n root,\n null, // frames\n null, // framesR\n 0, // currentTime\n 0, // nextTime\n {}, // style\n 0, // duration\n 1, // iterations\n 'none', // fill\n 1, // playbackRate\n 0, // playCount\n 'idle',\n false, // destroy\n 0, // startTime\n 0, // fpsTime\n op.easing,\n false, // enterFrame\n 0, // delay\n 0, // endDelay\n null, // keys,\n null, // originStyle,\n null, // currentFrames\n null, // currentFrame\n false, // spfLimit\n 60, // fps\n 'normal', // direction\n true, // firstEnter,\n false, // stayBegin\n false, // stayEnd\n false, // is2\n 0, // endTime\n target.__config, // nodeConfig\n root && root.__config, // rootConfig,destroy后root可能为空\n false, // outBeginDelay\n ];\n let iterations = this.iterations = op.iterations;\n let duration = this.duration = op.duration;\n let [frames, framesR, keys, originStyle] = this.__init(list, iterations, duration, op.easing, target);\n config[I_FRAMES] = frames;\n config[I_FRAMES_R] = framesR;\n config[I_KEYS] = keys;\n config[I_ORIGIN_STYLE] = originStyle;\n if(frames.length === 2) {\n config[I_IS2] = true;\n config[I_END_TIME] = frames[1][FRAME_TIME];\n }\n let fps = parseInt(op.fps) || 0;\n if(fps <= 0) {\n fps = 60;\n }\n this.fps = fps;\n this.spfLimit = op.spfLimit;\n this.delay = op.delay;\n this.endDelay = op.endDelay;\n this.playbackRate = op.playbackRate;\n this.fill = op.fill;\n this.iterations = op.iterations;\n this.direction = op.direction;\n config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(op.direction) ? framesR : frames;\n // 时间戳\n config[I_TIME_STAMP] = frame.__now;\n // 性能优化访问\n this[0] = this.__before;\n this[1] = this.__after;\n }\n\n __init(list, iterations, duration, easing, target) {\n if(list.length < 1) {\n return [[], [], [], {}];\n }\n // 过滤时间非法的,过滤后续offset<=前面的\n let offset = -1;\n let tagName = target.tagName;\n for(let i = 0, len = list.length; i < len; i++) {\n let current = list[i];\n if(current.hasOwnProperty('offset')) {\n current.offset = parseFloat(current.offset) || 0;\n current.offset = Math.max(0, current.offset);\n current.offset = Math.min(1, current.offset);\n // 超过区间[0,1]\n if(isNaN(current.offset) || current.offset < 0 || current.offset > 1) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n // <=前面的\n else if(current.offset <= offset) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n }\n // 缩写处理\n Object.keys(current).forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(current, k);\n }\n });\n // 检查key合法性\n Object.keys(current).forEach(k => {\n if(k !== 'easing' && k !== 'offset' && !change.isValid(tagName, k)) {\n delete current[k];\n }\n });\n }\n // 只有1帧复制出来变成2帧方便运行\n if(list.length === 1) {\n list[0] = clone(list[0]);\n if(list[0].offset === 1) {\n list.unshift({\n offset: 0,\n });\n }\n else {\n let copy = clone(list[0]);\n copy.offset = 1;\n list.push(copy);\n }\n }\n // 强制clone防止同引用\n else {\n list.forEach((item, i) => {\n list[i] = clone(item);\n });\n }\n // 首尾时间偏移强制为[0, 1],不是的话前后加空帧\n let first = list[0];\n if(first.hasOwnProperty('offset') && first.offset > 0) {\n first = {\n offset: 0,\n };\n list.unshift(first);\n }\n else {\n first.offset = 0;\n }\n let last = list[list.length - 1];\n if(last.hasOwnProperty('offset') && last.offset < 1) {\n last = {\n offset: 1,\n };\n list.push(last);\n }\n else {\n last.offset = 1;\n }\n // 计算没有设置offset的时间\n for(let i = 1, len = list.length; i < len; i++) {\n let start = list[i];\n // 从i=1开始offset一定>0,找到下一个有offset的,均分中间无声明的\n if(!start.hasOwnProperty('offset')) {\n let end;\n let j = i + 1;\n for(; j < len; j++) {\n end = list[j];\n if(end.hasOwnProperty('offset')) {\n break;\n }\n }\n let num = j - i + 1;\n start = list[i - 1];\n let per = (end.offset - start.offset) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.offset = start.offset + per * (k + 1 - i);\n }\n i = j;\n }\n }\n let frames = [];\n // 换算每一关键帧样式标准化\n list.forEach(item => {\n frames.push(framing(item, duration, easing));\n });\n // 为方便两帧之间计算变化,强制统一所有帧的css属性相同,没有写的为节点的当前样式currentStyle\n let keys = unify(frames, target);\n inherit(frames, keys, target);\n let framesR = clone(frames).reverse();\n // 存储原本样式以便恢复用\n let { style, props } = target;\n let originStyle = {};\n keys.forEach(k => {\n if(isGeom(tagName, k)) {\n originStyle[k] = props[k];\n }\n originStyle[k] = style[k];\n });\n // 再计算两帧之间的变化,存入transition属性\n let length = frames.length;\n let prev = frames[0];\n for(let i = 1; i < length; i++) {\n let next = frames[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n // 反向存储帧的倒排结果\n framesR.forEach(item => {\n item[FRAME_TIME] = duration - item[FRAME_TIME];\n item[FRAME_TRANSITION] = [];\n });\n prev = framesR[0];\n for(let i = 1; i < length; i++) {\n let next = framesR[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n return [frames, framesR, keys, originStyle];\n }\n\n __clean(isFinish) {\n let __config = this.__config;\n this.__cancelTask();\n __config[I_NEXT_TIME] = 0;\n let restore;\n let style = __config[I_STYLE];\n let keys = __config[I_KEYS];\n let target = __config[I_TARGET];\n if(isFinish) {\n // gotoAndStop到一个很大的时间的话,也需要防止超过\n __config[I_CURRENT_TIME] = __config[I_DELAY] + __config[I_DURATION] * __config[I_ITERATIONS] + __config[I_END_DELAY];\n if(__config[I_PLAY_STATE] === 'finish') {\n return;\n }\n __config[I_PLAY_STATE] = 'finish';\n // cancel需要清除finish根据情况保留\n if(!__config[I_STAY_END]) {\n __config[I_STYLE] = {};\n restore = true;\n }\n }\n else {\n __config[I_PLAY_COUNT] = __config[I_CURRENT_TIME] = 0;\n if(__config[I_PLAY_STATE] === 'idle') {\n return;\n }\n __config[I_PLAY_STATE] = 'idle';\n __config[I_STYLE] = {};\n restore = true;\n }\n // 动画取消结束不停留在最后一帧需要还原target原本的样式,需要对比目前是否是由本动画赋值的\n if(restore) {\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n if(target.__currentProps[k] === style[k]) {\n target.__currentProps[k] = target.props[k];\n }\n }\n else {\n if(target.__currentStyle[k] === style[k]) {\n target.__currentStyle[k] = target.style[k];\n }\n }\n });\n }\n }\n\n play(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n if(playState === 'running') {\n return this;\n }\n this.__cancelTask();\n __config[I_PLAY_CB] = cb;\n __config[I_PLAY_STATE] = 'running';\n // 每次play调用标识第一次运行,需响应play事件和回调\n __config[I_FIRST_PLAY] = true;\n // 防止finish/cancel事件重复触发,每次播放重置\n this.__hasFin = false;\n this.__hasCancel = false;\n // 只有第一次调用会进初始化,另外finish/cancel视为销毁也会重新初始化\n if(!__config[I_ENTER_FRAME]) {\n __config[I_ENTER_FRAME] = true;\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n // 初始化根据方向确定帧序列\n __config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction) ? framesR : frames;\n __config[I_CURRENT_TIME] = __config[I_NEXT_TIME] = __config[I_FPS_TIME] = 0;\n }\n // 添加每帧回调且立刻执行,本次执行调用refreshTask也是下一帧再渲染,frame的每帧都是下一帧\n // frame.offFrame(this);\n frame.onFrame(this);\n __config[I_START_TIME] = frame.__now;\n __config[I_END] = false;\n return this;\n }\n\n __before(diff) {\n let __config = this.__config;\n __config[I_TIME_STAMP] = frame.__now;\n let target = __config[I_TARGET];\n let fps = __config[I_FPS];\n let playCount = 0;\n let currentFrames = __config[I_CURRENT_FRAMES];\n let iterations = __config[I_ITERATIONS];\n let stayBegin = __config[I_STAY_BEGIN];\n let stayEnd = __config[I_STAY_END];\n let delay = __config[I_DELAY];\n let root = __config[I_ROOT];\n let is2 = __config[I_IS2];\n let endTime = __config[I_END_TIME];\n let duration = __config[I_DURATION];\n let endDelay = __config[I_END_DELAY];\n let length = currentFrames.length;\n // 用本帧和上帧时间差,计算累加运行时间currentTime,以便定位当前应该处于哪个时刻\n let [currentTime, d] = calDiffTime(__config, diff);\n diff = d;\n // 增加的fps功能,当<60时计算跳帧,每帧运行依旧累加时间,达到fps时重置,第一帧强制不跳\n if(!__config[I_FIRST_ENTER] && fps < 60) {\n diff = __config[I_FPS_TIME] += diff;\n if(diff < 1000 / fps) {\n __config[I_IN_FPS] = true;\n return;\n }\n __config[I_FPS_TIME] = 0;\n }\n __config[I_FIRST_ENTER] = false;\n // delay仅第一次生效等待\n if(currentTime < delay) {\n if(stayBegin) {\n let currentFrame = __config[I_CURRENT_FRAME] = currentFrames[0];\n let current = currentFrame[FRAME_STYLE];\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n }\n // 即便不刷新,依旧执行帧回调,同时标明让后续第一帧响应begin\n __config[I_OUT_BEGIN_DELAY] = true;\n __config[I_IS_DELAY] = true;\n return;\n }\n // 减去delay,计算在哪一帧\n currentTime -= delay;\n if(currentTime === 0 || __config[I_OUT_BEGIN_DELAY]) {\n __config[I_OUT_BEGIN_DELAY] = false;\n __config[I_BEGIN] = true;\n }\n // 超过duration非尾轮需处理回到开头,触发新一轮动画事件,这里可能时间间隔非常大直接跳过几轮\n let round;\n while(currentTime >= duration && playCount < iterations - 1) {\n currentTime -= duration;\n playCount++;\n }\n if(__config[I_PLAY_COUNT] < playCount) {\n __config[I_BEGIN] = true;\n round = true;\n }\n __config[I_PLAY_COUNT] = playCount;\n // 如果发生轮换,需重新确定正反向\n if(round) {\n let direction = __config[I_DIRECTION];\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let isAlternate = {\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction);\n // 有正反向播放需要重设帧序列\n if(isAlternate) {\n let isEven = playCount % 2 === 0;\n if(direction === 'alternate') {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n }\n let isLastCount = playCount >= iterations - 1;\n // 只有2帧可优化,否则2分查找当前帧\n let i, frameTime;\n if(is2) {\n i = currentTime < endTime ? 0 : 1;\n frameTime = endTime;\n }\n else {\n i = binarySearch(0, length - 1, currentTime, currentFrames);\n frameTime = currentFrames[i][FRAME_TIME];\n }\n // 最后一帧结束动画,仅最后一轮才会进入,需处理endDelay\n let isLastFrame = isLastCount && i === length - 1;\n let percent = 0;\n if(isLastFrame) {\n // 无需任何处理\n }\n // 否则根据目前到下一帧的时间差,计算百分比,再反馈到变化数值上\n else if(is2) {\n percent = currentTime / duration;\n }\n else {\n let total = currentFrames[i + 1][FRAME_TIME] - frameTime;\n percent = (currentTime - frameTime) / total;\n }\n let inEndDelay, currentFrame = currentFrames[i], current;\n __config[I_CURRENT_FRAME] = currentFrame;\n /** 这里要考虑全几种场景:\n * 1. 单次播放无endDelay且fill不停留(有/无差异,下同)\n * 2. 单次播放无endDelay且fill停留\n * 3. 单次播放有endDelay且fill不停留\n * 4. 单次播放有endDelay且fill停留\n * 5. 多次播放无endDelay且fill不停留(尾次/非尾次,下同)\n * 6. 多次播放无endDelay且fill停留\n * 7. 多次播放有endDelay且fill不停留\n * 8. 多次播放有endDelay且fill停留\n */\n let needClean;\n if(isLastFrame) {\n inEndDelay = currentTime < duration + endDelay;\n // 停留对比最后一帧,endDelay可能会多次进入这里,第二次进入样式相等不再重绘\n if(stayEnd) {\n current = cloneStyle(currentFrame[FRAME_STYLE], __config[I_KEYS]);\n }\n // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里\n else {\n current = cloneStyle(__config[I_ORIGIN_STYLE], __config[I_KEYS]);\n }\n // 进入endDelay或结束阶段触发end事件,注意只触发一次,防重在触发的地方做\n __config[I_NEXT_END] = true;\n if(!inEndDelay) {\n __config[I_PLAY_COUNT]++;\n __config[I_FINISHED] = true;\n frame.offFrame(this);\n needClean = true;\n __config[I_NEXT_TIME] = 0;\n }\n }\n else {\n current = calIntermediateStyle(currentFrame, __config[I_KEYS], percent, target);\n }\n // 无论两帧之间是否有变化,都生成计算结果赋给style,去重在root做\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n if(needClean) {\n let playCb = __config[I_PLAY_CB];\n this.__clean(true);\n // 丑陋的做法,防止gotoAndStop()这样的cb被clean()掉\n if(playCb) {\n __config[I_PLAY_CB] = playCb;\n }\n }\n }\n\n __after(diff) {\n let __config = this.__config;\n __config[I_ASSIGNING] = false;\n if(__config[I_IN_FPS]) {\n __config[I_IN_FPS] = false;\n return;\n }\n frameCb(this, __config, diff, __config[I_IS_DELAY]);\n __config[I_IS_DELAY] = false;\n if(__config[I_BEGIN]) {\n __config[I_BEGIN] = false;\n this.emit(Event.BEGIN, __config[I_PLAY_COUNT]);\n }\n // end事件只触发一次,末轮进入endDelay或直接结束时\n if(__config[I_NEXT_END] && !__config[I_END]) {\n __config[I_END] = true;\n this.emit(Event.END, __config[I_PLAY_COUNT] - 1);\n }\n if(__config[I_FINISHED]) {\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n __config[I_PLAY_STATE] = 'finished';\n this.emit(Event.FINISH);\n }\n }\n\n pause(silence) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let { pending } = this;\n if(isDestroyed || duration <= 0 || pending) {\n return this;\n }\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(!silence) {\n this.emit(Event.PAUSE);\n }\n return this;\n }\n\n resume(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n if(isDestroyed || duration <= 0 || playState !== 'paused') {\n return this;\n }\n return this.play(cb);\n }\n\n finish(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1 || playState === 'finished' || playState === 'idle') {\n return self;\n }\n // 先清除所有回调任务,多次调用finish也会清除只留最后一次\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n let current;\n // 停留在最后一帧\n if(__config[I_STAY_END]) {\n __config[I_CURRENT_FRAME] = frames[frames.length - 1];\n current = frames[frames.length - 1][FRAME_STYLE];\n }\n else {\n current = originStyle;\n }\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(current, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean(true);\n },\n __after(diff) {\n if(!self.__hasFin) {\n self.__hasFin = true;\n __config[I_ASSIGNING] = false;\n frameCb(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.FINISH);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n cancel(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || playState === 'idle' || frames.length < 1) {\n return self;\n }\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(originStyle, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean();\n },\n __after(diff) {\n if(!self.__hasCancel) {\n self.__hasCancel = true;\n __config[I_ASSIGNING] = false;\n frameCb(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.CANCEL);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n gotoAndPlay(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n // 计算出时间点直接累加播放\n this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n return this.play(cb);\n }\n\n gotoAndStop(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n v = this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n // 先play一帧,回调里模拟暂停\n return this.play(diff => {\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isFunction(cb)) {\n cb.call(this, diff);\n }\n });\n }\n\n // 同步赋予,用在extendAnimate\n assignCurrentStyle() {\n let __config = this.__config;\n let style = __config[I_STYLE];\n let target = __config[I_TARGET];\n let keys = __config[I_KEYS];\n keys.forEach(i => {\n if(style.hasOwnProperty(i)) {\n let v = style[i];\n // geom的属性变化\n if(GEOM.hasOwnProperty(i)) {\n target.currentProps[i] = v;\n }\n // 样式\n else {\n // 将动画样式直接赋给currentStyle\n target.currentStyle[i] = v;\n }\n }\n });\n }\n\n // 返回不包含delay且去除多轮的时间\n __goto(v, isFrame, excludeDelay) {\n let __config = this.__config;\n let iterations = __config[I_ITERATIONS];\n let duration = __config[I_DURATION];\n __config[I_PLAY_STATE] = 'paused';\n // this.__cancelTask(); // 应该不需要,gotoAndXxx都会调用play(),里面有\n if(isNaN(v) || v < 0) {\n throw new Error('Param of gotoAnd(Play/Stop) is illegal: ' + v);\n }\n if(isFrame) {\n v = (v - 1) / this.spf;\n }\n if(excludeDelay) {\n v += __config[I_DELAY];\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n __config[I_NEXT_TIME] = v;\n v -= __config[I_DELAY];\n // 超过时间长度需要累加次数,这里可以超过iterations,因为设定也许会非常大\n let playCount = 0;\n while(v >= duration && playCount < iterations - 1) {\n playCount++;\n v -= duration;\n }\n __config[I_PLAY_COUNT] = playCount;\n // 防止play()重置时间和当前帧组,提前计算好\n __config[I_ENTER_FRAME] = true;\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n if({\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction)) {\n let isEven = playCount % 2 === 0;\n if(direction === 'alternate') {\n __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n return v;\n }\n\n addControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.add(this);\n }\n }\n\n removeControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.remove(this);\n }\n }\n\n __stayBegin() {\n return {\n backwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __stayEnd() {\n return {\n forwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __setTarget(target) {\n this.__target = target;\n this.__config[I_TARGET] = target;\n this.__config[I_NODE_CONFIG] = target.__config;\n }\n\n __cancelTask() {\n frame.offFrame(this);\n this.__config[I_PLAY_CB] = null;\n }\n\n __destroy(sync) {\n let self = this;\n let __config = self.__config;\n if(__config[I_DESTROYED]) {\n return;\n }\n self.removeControl();\n // clean异步执行,因为里面的样式还原需要等到下一帧,否则同步执行清除后,紧接着的新同步动画获取不到currentStyle\n if(sync) {\n self.__clean();\n __config[I_TARGET] = null;\n }\n else {\n frame.nextFrame({\n __before() {\n self.__clean();\n __config[I_TARGET] = null;\n },\n });\n }\n __config[I_START_TIME] = 0;\n __config[I_DESTROYED] = true;\n }\n\n __checkModify() {\n let __config = this.__config;\n if(__config[I_PLAY_STATE] !== 'idle' && __config[I_PLAY_STATE] !== 'finished') {\n inject.warn('Modification will not come into effect when animation is running');\n }\n }\n\n get id() {\n return this.__id;\n }\n\n get target() {\n return this.__config[I_TARGET];\n }\n\n get root() {\n return this.__config[I_ROOT];\n }\n\n get keys() {\n return this.__config[I_KEYS];\n }\n\n get style() {\n return this.__config[I_STYLE];\n }\n\n get options() {\n return this.__options;\n }\n\n get duration() {\n return this.__config[I_DURATION];\n }\n\n set duration(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DURATION] !== v) {\n __config[I_DURATION] = v;\n __config[I_END_TIME] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get delay() {\n return this.__config[I_DELAY];\n }\n\n set delay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DELAY] !== v) {\n __config[I_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get endDelay() {\n return this.__config[I_END_DELAY];\n }\n\n set endDelay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_END_DELAY] !== v) {\n __config[I_END_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get fps() {\n return this.__config[I_FPS];\n }\n\n set fps(v) {\n v = parseInt(v) || 60;\n let __config = this.__config;\n if(__config[I_FPS] !== v) {\n if(v <= 0) {\n v = 60;\n }\n __config[I_FPS] = v;\n }\n return v;\n }\n\n get spf() {\n return 1 / this.fps;\n }\n\n get iterations() {\n return this.__config[I_ITERATIONS];\n }\n\n set iterations(v) {\n if(v === Infinity || util.isString(v) && v.toLowerCase() === 'infinity') {\n v = Infinity;\n }\n else {\n v = parseInt(v);\n if(isNaN(v) || v < 0) {\n v = 1;\n }\n }\n let __config = this.__config;\n if(__config[I_ITERATIONS] !== v) {\n __config[I_ITERATIONS] = v;\n }\n return v;\n }\n\n get fill() {\n return this.__config[I_FILL];\n }\n\n set fill(v) {\n v = v || 'none';\n let __config = this.__config;\n if(__config[I_FILL] !== v) {\n __config[I_FILL] = v;\n this.__checkModify();\n }\n __config[I_STAY_BEGIN] = {\n backwards: true,\n both: true,\n }.hasOwnProperty(v);\n __config[I_STAY_END] = {\n forwards: true,\n both: true,\n }.hasOwnProperty(v);\n return v;\n }\n\n get direction() {\n return this.__config[I_DIRECTION];\n }\n\n set direction(v) {\n v = v || 'normal';\n let __config = this.__config;\n if(__config[I_DIRECTION] !== v) {\n __config[I_DIRECTION] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get frames() {\n return this.__config[I_FRAMES];\n }\n\n get framesR() {\n return this.__config[I_FRAMES_R];\n }\n\n get playbackRate() {\n return this.__config[I_PLAYBACK_RATE];\n }\n\n set playbackRate(v) {\n v = parseFloat(v) || 1;\n if(v <= 0) {\n v = 1;\n }\n let __config = this.__config;\n if(__config[I_PLAYBACK_RATE] !== v) {\n __config[I_PLAYBACK_RATE] = v;\n }\n return v;\n }\n\n get easing() {\n return this.__config[I_EASING];\n }\n\n get startTime() {\n return this.__config[I_START_TIME];\n }\n\n get currentTime() {\n return this.__config[I_CURRENT_TIME];\n }\n\n set currentTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_CURRENT_TIME] !== v) {\n __config[I_CURRENT_TIME] = v;\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get nextTime() {\n return this.__config[I_NEXT_TIME];\n }\n\n set nextTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_NEXT_TIME] !== v) {\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get timestamp() {\n return this.__config[I_TIME_STAMP];\n }\n\n get pending() {\n return this.__config[I_PLAY_STATE] !== 'running';\n }\n\n get finished() {\n return this.__config[I_PLAY_STATE] === 'finished';\n }\n\n get playState() {\n return this.__config[I_PLAY_STATE];\n }\n\n get playCount() {\n return this.__config[I_PLAY_COUNT];\n }\n\n set playCount(v) {\n v = Math.max(0, parseInt(v) || 0);\n let __config = this.__config;\n if(__config[I_PLAY_COUNT] !== v) {\n __config[I_PLAY_COUNT] = v;\n }\n return v;\n }\n\n get isDestroyed() {\n return this.__config[I_DESTROYED];\n }\n\n get animating() {\n let __config = this.__config;\n let playState = __config[I_PLAY_STATE];\n if(playState === 'idle') {\n return false;\n }\n return playState !== 'finished' || __config[I_STAY_END] || __config[I_STAY_BEGIN];\n }\n\n get spfLimit() {\n let __config = this.__config;\n return __config[I_SPF_LIMIT];\n }\n\n set spfLimit(v) {\n if(util.isNumber(v) || /^\\d/.test(v)) {\n v = Math.max(0, parseInt(v) || 0);\n }\n else {\n v = !!v;\n }\n let __config = this.__config;\n if(__config[I_SPF_LIMIT] !== v) {\n __config[I_SPF_LIMIT] = v;\n }\n return v;\n }\n\n get assigning() {\n return this.__config[I_ASSIGNING];\n }\n}\n\nexport default Animation;\n","import mode from '../refresh/mode';\nimport geom from '../math/geom';\nimport blur from '../math/blur';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\n\nconst {\n NODE_KEY: {\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { int2rgba } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nfunction renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h, dx = 0, dy = 0) {\n x1 += dx;\n y1 += dy;\n x2 += dx;\n y2 += dy;\n let [x, y, sigma, spread, color, inset] = data;\n let c = int2rgba(color);\n let n = Math.abs(sigma) * 2 + Math.abs(spread) * 2 + Math.abs(x) * 2 + Math.abs(y) * 2;\n // box本身坐标顺时针\n let box = [\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1, y2],\n [x1, y1],\n ];\n // 算上各种偏移/扩散的最外层坐标,且逆时针\n let outer = [\n [x1 - n, y1 - n],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n ];\n if(color[3] > 0 && (sigma > 0 || spread > 0)) {\n if(renderMode === mode.CANVAS | renderMode === mode.WEBGL) {\n ctx.save();\n ctx.beginPath();\n // inset裁剪box外面\n if(inset === 'inset') {\n let xa = x1 + x + spread;\n let ya = y1 + y + spread;\n let xb = x2 + x - spread;\n let yb = y2 + y - spread;\n let spreadBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n // 是否相交判断需要绘制\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]);\n if(!cross) {\n return;\n }\n cross = [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ];\n // 扩散区域类似边框填充\n if(spread) {\n canvasPolygon(ctx, cross);\n canvasPolygon(ctx, box.slice(0).reverse());\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== c) {\n ctx.fillStyle = c;\n }\n canvasPolygon(ctx, box);\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, cross);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowColor = c;\n ctx.shadowBlur = sigma;\n // 画在外围的空心矩形,宽度要比blur大,n考虑了这一情况取了最大值\n canvasPolygon(ctx, [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [x1 - n, yb],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, yb],\n [xa, yb],\n [xa, ya],\n ]);\n }\n else {\n canvasPolygon(ctx, box);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowOffsetX = x;\n ctx.shadowOffsetY = y;\n ctx.shadowColor = c;\n ctx.shadowBlur = sigma;\n canvasPolygon(ctx, [\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1 - n, y2],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, y2],\n [x1, y2],\n [x1, y1],\n ]);\n }\n }\n // outset需裁减掉box本身的内容,clip()非零环绕显示box外的阴影内容,fill()绘制在内无效\n else {\n let xa = x1 + x - spread;\n let ya = y1 + y - spread;\n let xb = x2 + x + spread;\n let yb = y2 + y + spread;\n let blurBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]);\n // 分为是否有spread,因模糊成本spread区域将没有模糊\n if(spread) {\n // 扩散区域类似边框填充\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, blurBox.slice(0).reverse());\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== c) {\n ctx.fillStyle = c;\n }\n canvasPolygon(ctx, blurBox);\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n ctx.save();\n ctx.beginPath();\n // 阴影部分看相交情况裁剪,有相交时逆时针绘制相交区域即可排除之\n if(cross) {\n canvasPolygon(ctx, [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ].reverse());\n }\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, blurBox);\n canvasPolygon(ctx, outer);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowColor = c;\n ctx.shadowBlur = sigma;\n canvasPolygon(ctx, blurBox);\n }\n else {\n canvasPolygon(ctx, box);\n canvasPolygon(ctx, outer);\n ctx.clip();\n ctx.closePath();\n ctx.beginPath();\n if(ctx.fillStyle !== '#FFF') {\n ctx.fillStyle = '#FFF';\n }\n ctx.shadowOffsetX = x;\n ctx.shadowOffsetY = y;\n ctx.shadowColor = c;\n ctx.shadowBlur = sigma;\n canvasPolygon(ctx, box);\n }\n }\n ctx.fill();\n ctx.closePath();\n ctx.restore();\n }\n else if(renderMode === mode.SVG) {\n let d = blur.outerSize(sigma);\n if(inset === 'inset') {\n let xa = x1 + x + spread;\n let ya = y1 + y + spread;\n let xb = x2 + x - spread;\n let yb = y2 + y - spread;\n let spreadBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [spreadBox[0][0], spreadBox[0][1], spreadBox[2][0], spreadBox[2][1]]);\n if(!cross) {\n return;\n }\n cross = [\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ];\n if(spread) {\n let v = {\n tagName: 'filter',\n props: [\n ['x', -d / w],\n ['y', -d / h],\n ['width', 1 + d * 2 / w],\n ['height', 1 + d * 2 / h],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', 0],\n ['dy', 0],\n ['stdDeviation', sigma * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n }\n xom.__config[NODE_DEFS_CACHE].push(v);\n let filter = ctx.add(v);\n let v2 = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(cross) + svgPolygon(box.slice(0).reverse())],\n ['fill', '#FFF'],\n ],\n }],\n };\n let clip = ctx.add(v2);\n xom.__config[NODE_DEFS_CACHE].push(v2);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', c],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(cross)],\n ['fill', '#FFF'],\n ],\n }],\n };\n clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon([\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [x1 - n, yb],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, yb],\n [xa, yb],\n [xa, ya],\n ])],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n else {\n let v = {\n tagName: 'filter',\n props: [\n ['x', -d / w],\n ['y', -d / h],\n ['width', 1 + d * 2 / w],\n ['height', 1 + d * 2 / h],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', x],\n ['dy', y],\n ['stdDeviation', sigma * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n }\n let filter = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', '#FFF'],\n ],\n }],\n };\n let clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon([\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1 - n, y2],\n [x1 - n, y2 + n],\n [x2 + n, y2 + n],\n [x2 + n, y1 - n],\n [x1 - n, y1 - n],\n [x1 - n, y2],\n [x1, y2],\n [x1, y1],\n ])],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n }\n else {\n let xa = x1 + x - spread;\n let ya = y1 + y - spread;\n let xb = x2 + x + spread;\n let yb = y2 + y + spread;\n let blurBox = [\n [xa, ya],\n [xb, ya],\n [xb, yb],\n [xa, yb],\n ];\n let cross = geom.getRectsIntersection(\n [box[0][0], box[0][1], box[2][0], box[2][1]],\n [blurBox[0][0], blurBox[0][1], blurBox[2][0], blurBox[2][1]]);\n if(spread) {\n let v = {\n tagName: 'filter',\n props: [\n ['x', -d / w],\n ['y', -d / h],\n ['width', 1 + d * 2 / w],\n ['height', 1 + d * 2 / h],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', 0],\n ['dy', 0],\n ['stdDeviation', sigma * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n };\n let filter = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box) + svgPolygon(blurBox.slice(0).reverse())],\n ['fill', '#FFF'],\n ],\n }],\n };\n let clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(blurBox)],\n ['fill', c],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', (cross ? svgPolygon([\n [cross[0], cross[1]],\n [cross[2], cross[1]],\n [cross[2], cross[3]],\n [cross[0], cross[3]],\n [cross[0], cross[1]],\n ].reverse()) : '')\n + svgPolygon(box) + svgPolygon(blurBox) + svgPolygon(outer)],\n ['fill', '#FFF'],\n ],\n }],\n };\n clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(blurBox)],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n else {\n let v = {\n tagName: 'filter',\n props: [\n ['x', -d / w],\n ['y', -d / h],\n ['width', 1 + d * 2 / w],\n ['height', 1 + d * 2 / h],\n ],\n children: [\n {\n tagName: 'feDropShadow',\n props: [\n ['dx', x],\n ['dy', y],\n ['stdDeviation', sigma * 0.5],\n ['flood-color', c],\n ],\n },\n ],\n };\n let filter = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(box) + svgPolygon(outer)],\n ['fill', '#FFF'],\n ],\n }],\n };\n let clip = ctx.add(v);\n xom.__config[NODE_DEFS_CACHE].push(v);\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(box)],\n ['fill', '#FFF'],\n ['filter', 'url(#' + filter + ')'],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n }\n }\n }\n}\n\nexport default {\n renderBoxShadow,\n};\n","const MBM_HASH = {\n multiply: true,\n screen: true,\n overlay: true,\n darken: true,\n lighten: true,\n 'color-dodge': true,\n 'color-burn': true,\n 'hard-light': true,\n 'soft-light': true,\n difference: true,\n exclusion: true,\n hue: true,\n saturation: true,\n color: true,\n luminosity: true,\n};\n\nfunction mbmName(v) {\n if(v) {\n return v.replace(/[A-Z]/, function($0) {\n return '-' + $0.toLowerCase();\n });\n }\n}\n\nfunction isValidMbm(v) {\n return MBM_HASH.hasOwnProperty(mbmName(v));\n}\n\nexport default {\n mbmName,\n isValidMbm,\n};\n","import TextBox from './TextBox';\nimport enums from '../util/enums';\n\nconst {\n STYLE_KEY: {\n MARGIN_LEFT,\n MARGIN_RIGHT,\n PADDING_LEFT,\n PADDING_RIGHT,\n BORDER_LEFT_WIDTH,\n BORDER_RIGHT_WIDTH,\n },\n} = enums;\n\n/**\n * 获取inline的每一行内容的矩形坐标4个点,同时附带上border的矩形,比前面4个点尺寸大或相等(有无border/padding)\n * @param xom\n * @param contentBoxList\n * @param start\n * @param end\n * @param lineBox\n * @param baseline\n * @param lineHeight\n * @param diffL\n * @param isStart\n * @param isEnd\n * @param backgroundClip\n * @param paddingTop\n * @param paddingRight\n * @param paddingBottom\n * @param paddingLeft\n * @param borderTopWidth\n * @param borderRightWidth\n * @param borderBottomWidth\n * @param borderLeftWidth\n * @returns {(*|number)[]}\n */\nfunction getInlineBox(xom, contentBoxList, start, end, lineBox, baseline, lineHeight, diffL, isStart, isEnd,\n backgroundClip, paddingTop, paddingRight, paddingBottom, paddingLeft,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth) {\n // 根据bgClip确定y伸展范围,inline渲染bg扩展到pb的位置不影响布局\n let eyt = 0, eyb = 0;\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n eyt = paddingTop;\n eyb = paddingBottom;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n eyt = paddingTop + borderTopWidth;\n eyb = paddingBottom + borderBottomWidth;\n }\n // 同y的border伸展范围,其影响border渲染\n let pbt = paddingTop + borderTopWidth;\n let pbb = paddingBottom + borderBottomWidth;\n // inline的baseline和lineBox的差值\n let diff = lineBox.baseline - baseline;\n // x坐标取首尾contentBox的左右2侧,clip布局时已算好;y是根据lineHeight和lineBox的高度以及baseline对齐后计算的\n let x1 = start.x;\n let dom = start instanceof TextBox ? start.parent.domParent : start.domParent;\n while(dom !== xom) {\n let list = dom.contentBoxList;\n if(start === list[0]) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = dom.computedStyle;\n x1 -= marginLeft + paddingLeft + borderLeftWidth;\n }\n dom = dom.domParent;\n }\n let bx1 = x1;\n if(isStart) {\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n x1 -= paddingLeft;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n x1 -= paddingLeft + borderLeftWidth;\n }\n bx1 -= paddingLeft + borderLeftWidth;\n }\n let y1 = lineBox.y + diff - eyt;\n let by1 = lineBox.y + diff - pbt;\n let x2 = end.x + end.outerWidth;\n // TextBox的parent是Text,再是Dom,这里一定是inline,无嵌套就是xom本身,有则包含若干层最上层还是xom\n dom = end instanceof TextBox ? end.parent.domParent : end.domParent;\n // 从end开始,向上获取dom节点的尾部mpb进行累加,直到xom跳出\n while(dom !== xom) {\n let list = dom.contentBoxList;\n if(end === list[list.length - 1]) {\n let {\n [MARGIN_RIGHT]: marginRight,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } = dom.computedStyle;\n x2 += marginRight + paddingRight + borderRightWidth;\n }\n dom = dom.domParent;\n }\n let bx2 = x2;\n if(isEnd) {\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n x2 += paddingRight;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n x2 += paddingRight + borderRightWidth;\n }\n bx2 += paddingRight + borderRightWidth;\n }\n let y2 = lineBox.y + diff + lineHeight - diffL + eyb;\n let by2 = lineBox.y + diff + lineHeight - diffL + pbb;\n // x要考虑xom的ox值\n x1 += xom.ox;\n x2 += xom.ox;\n bx1 += xom.ox;\n bx2 += xom.ox;\n y1 += xom.oy;\n y2 += xom.oy;\n by1 += xom.oy;\n by2 += xom.oy;\n return [x1, y1, x2, y2, bx1, by1, bx2, by2];\n}\n\n/**\n * 统计inline的所有contentBox排成一行时的总宽度,考虑嵌套的mpb\n * @param xom\n * @param contentBoxList\n * @returns {number}\n */\nfunction getInlineWidth(xom, contentBoxList) {\n let sum = 0;\n let length = contentBoxList.length;\n for(let i = 0; i < length; i++) {\n let contentBox = contentBoxList[i];\n sum += contentBox.width;\n // 嵌套时,首尾box考虑mpb\n let dom = contentBox instanceof TextBox ? contentBox.parent.domParent : contentBox.domParent;\n while(dom !== xom) {\n let list = dom.contentBoxList;\n if(contentBox === list[0]) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = dom.computedStyle;\n sum += marginLeft + paddingLeft + borderLeftWidth;\n }\n if(contentBox === list[list.length - 1]) {\n let {\n [MARGIN_RIGHT]: marginRight,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } = dom.computedStyle;\n sum += marginRight + paddingRight + borderRightWidth;\n }\n dom = dom.domParent;\n }\n }\n return sum;\n}\n\nexport default {\n getInlineBox,\n getInlineWidth,\n};\n","import Node from './Node';\nimport mode from '../refresh/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;\nconst { LOCAL } = Cache;\n\nconst {\n STYLE_KEY,\n STYLE_RV_KEY,\n style2Upper,\n STYLE_KEY: {\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n PADDING_LEFT,\n PADDING_RIGHT,\n PADDING_TOP,\n PADDING_BOTTOM,\n MARGIN_LEFT,\n MARGIN_TOP,\n MARGIN_BOTTOM,\n MARGIN_RIGHT,\n BORDER_LEFT_WIDTH,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_RIGHT_WIDTH,\n TOP,\n RIGHT,\n BOTTOM,\n LEFT,\n POSITION,\n DISPLAY,\n WIDTH,\n HEIGHT,\n MATRIX,\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n TRANSFORM,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n SKEW_X,\n SKEW_Y,\n PERSPECTIVE,\n PERSPECTIVE_ORIGIN,\n ROTATE_3D,\n TRANSFORM_ORIGIN,\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n BACKGROUND_SIZE,\n BACKGROUND_COLOR,\n BACKGROUND_IMAGE,\n BACKGROUND_REPEAT,\n BOX_SHADOW,\n OPACITY,\n Z_INDEX,\n BORDER_TOP_STYLE,\n BORDER_RIGHT_STYLE,\n BORDER_BOTTOM_STYLE,\n BORDER_LEFT_STYLE,\n FILTER,\n OVERFLOW,\n MIX_BLEND_MODE,\n TEXT_OVERFLOW,\n BORDER_TOP_COLOR,\n BORDER_BOTTOM_COLOR,\n BORDER_LEFT_COLOR,\n BORDER_RIGHT_COLOR,\n FONT_STYLE,\n COLOR,\n VISIBILITY,\n POINTER_EVENTS,\n BORDER_TOP,\n BORDER_RIGHT,\n BORDER_BOTTOM,\n BORDER_LEFT,\n BACKGROUND_CLIP,\n FONT_SIZE,\n FONT_FAMILY,\n LINE_HEIGHT,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_WIDTH,\n TEXT_STROKE_OVER,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_STYLE,\n UPDATE_OVERWRITE,\n UPDATE_KEYS,\n UPDATE_CONFIG,\n UPDATE_REMOVE_DOM,\n },\n STRUCT_KEY: {\n STRUCT_HAS_MASK,\n },\n NODE_KEY: {\n NODE_TAG_NAME,\n NODE_CACHE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_STYLE,\n NODE_STRUCT,\n NODE_OPACITY,\n NODE_MATRIX_EVENT,\n NODE_MATRIX,\n NODE_LIMIT_CACHE,\n NODE_HAS_CONTENT,\n NODE_REFRESH_LV,\n NODE_CACHE,\n NODE_CACHE_TOTAL,\n NODE_CACHE_FILTER,\n NODE_CACHE_MASK,\n NODE_CACHE_OVERFLOW,\n NODE_IS_DESTROYED,\n NODE_DEFS_CACHE,\n NODE_DOM_PARENT,\n NODE_IS_INLINE,\n NODE_PERSPECTIVE_MATRIX,\n NODE_IS_MASK,\n NODE_VIRTUAL_DOM,\n NODE_CACHE_AS_BITMAP,\n }\n} = enums;\nconst { AUTO, PX, PERCENT, INHERIT, NUMBER, REM, VW, VH, VMAX, VMIN, DEG } = unit;\nconst { int2rgba, rgba2int, joinArr, isNil, isFunction } = util;\nconst { calRelative } = css;\nconst { GEOM } = change;\nconst { mbmName, isValidMbm } = mbm;\nconst { point2d } = mx;\n\nconst {\n contain,\n NONE,\n TRANSFORM: TF,\n REFLOW,\n REPAINT,\n TRANSLATE_X: TX,\n TRANSLATE_Y: TY,\n TRANSLATE_Z: TZ,\n} = level;\n\nfunction getFirstEmptyInlineWidth(xom) {\n let n = 0;\n let flowChildren = xom.flowChildren;\n let length = flowChildren.length;\n for(let i = 0; i < length; i++) {\n let child = flowChildren[i];\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.flowChildren.length) {\n n += getFirstEmptyInlineWidth(child);\n break;\n }\n else if(child.__config[NODE_IS_INLINE]) {\n n += child.outerWidth;\n }\n }\n else {\n break;\n }\n }\n return n;\n}\n\nfunction getLastEmptyInlineWidth(xom) {\n let n = 0;\n let flowChildren = xom.flowChildren;\n let length = flowChildren.length;\n for(let i = length - 1; i >= 0; i--) {\n let child = flowChildren[i];\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.flowChildren.length) {\n n += getLastEmptyInlineWidth(child);\n break;\n }\n else {\n n += child.outerWidth;\n }\n }\n else {\n break;\n }\n }\n return n;\n}\n\nclass Xom extends Node {\n constructor(tagName, props = {}) {\n super();\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__tagName = tagName;\n this.__style = this.props.style || {}; // style被解析后的k-v形式\n this.__currentStyle = {}; // 动画过程中绘制一开始会merge动画样式\n this.__computedStyle = {}; // 类似getComputedStyle()将currentStyle计算好数值赋给\n this.__listener = {};\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n this.listener[k] = v;\n }\n });\n this.__animationList = [];\n this.__loadBgi = {\n // 刷新回调函数,用以destroy取消用\n cb: function() {\n },\n };\n this.__cacheStyle = {}; // 是否缓存重新计算computedStyle的样式key\n this.__cacheDefs = []; // svg专用,缓存渲染时使用已有的defs,diff过程用,否则会defs被清空\n let isClip = this.__isClip = !!this.props.clip;\n let isMask = this.__isMask = isClip || !!this.props.mask;\n let config = this.__config;\n config[NODE_TAG_NAME] = tagName;\n config[NODE_CACHE_STYLE] = this.__cacheStyle;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_COMPUTED_STYLE] = this.__computedStyle;\n config[NODE_REFRESH_LV] = REFLOW;\n config[NODE_STYLE] = this.__style;\n config[NODE_MATRIX] = [];\n config[NODE_MATRIX_EVENT] = [];\n config[NODE_DEFS_CACHE] = this.__cacheDefs;\n config[NODE_IS_MASK] = isMask;\n this.__frameAnimateList = [];\n this.__contentBoxList = []; // inline存储内容用\n // this.__json domApi需要获取生成时的json引用,builder过程添加,如appendChild时json也需要跟着变更\n config[NODE_CACHE_AS_BITMAP] = this.__cacheAsBitmap = !!this.props.cacheAsBitmap;\n }\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 else if(mp[1] === VMAX) {\n return mp[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(mp[1] === VMIN) {\n return mp[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return 0;\n }\n\n // dom常用的几种尺寸赋值\n __ioSize(w, h) {\n let computedStyle = this.computedStyle;\n 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 else if(v[1] === VMAX) {\n n += v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n n += v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return n;\n }\n\n // 为basis的b/min/max添加mpb,只有当b未显示指定等于w/content时才加,同时返回mpb值\n __addMBP(isDirectionRow, w, currentStyle, res, res2, 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 let mbp = this.__calMp(marginLeft, w, !isDirectItem)\n + this.__calMp(marginRight, w, !isDirectItem)\n + this.__calMp(paddingLeft, w, !isDirectItem)\n + this.__calMp(paddingRight, w, !isDirectItem)\n + this.__calBorder(borderLeftWidth)\n + this.__calBorder(borderRightWidth);\n res2 = res2.map(item => item + mbp);\n if(isDirectionRow) {\n res = res.map(item => item + mbp);\n }\n else {\n let mbp = this.__calMp(marginTop, w, !isDirectItem)\n + this.__calMp(marginBottom, w, !isDirectItem)\n + this.__calMp(paddingTop, w, !isDirectItem)\n + this.__calMp(paddingBottom, w, !isDirectItem)\n + this.__calBorder(borderTopWidth)\n + this.__calBorder(borderBottomWidth);\n res = res.map(item => item + mbp);\n }\n return [res, res2];\n }\n\n __calBorder(data) {\n let n = 0;\n if(data[1] === PX) {\n n = data[0];\n }\n else if(data[1] === REM) {\n n = data[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(data[1] === VW) {\n n = data[0] * this.root.width * 0.01;\n }\n else if(data[1] === VH) {\n n = data[0] * this.root.height * 0.01;\n }\n else if(data[1] === VMAX) {\n n = data[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(data[1] === VMIN) {\n n = data[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return n;\n }\n\n // absolute且无尺寸时,isVirtual标明先假布局一次计算尺寸,还有flex列计算时\n // fromAbs为absolute节点特有省略计算标识,本节点是abs时真正布局传入\n __layout(data, isVirtual, fromAbs) {\n css.computeReflow(this);\n let { w } = data;\n let { isDestroyed, currentStyle, computedStyle, __config } = this;\n let {\n [DISPLAY]: display,\n } = computedStyle;\n let {\n [WIDTH]: width,\n [POSITION]: position,\n } = currentStyle;\n this.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() && computedStyle[DISPLAY] === 'inline') {\n width[0] = 0;\n width[1] = AUTO;\n }\n else {\n switch(width[1]) {\n case PX:\n w = width[0];\n break;\n case PERCENT:\n w *= width[0] * 0.01;\n break;\n case REM:\n w = width[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n w = width[0] * this.root.width * 0.01;\n break;\n case VH:\n w = width[0] * this.root.height * 0.01;\n break;\n case VMAX:\n w = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n break;\n case VMIN:\n w = width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n break;\n }\n }\n }\n let lineClampCount = 0;\n // 4种布局,默认block,inlineBlock基本可以复用inline逻辑,除了尺寸\n if(display === 'flex') {\n this.__layoutFlex(data, 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[BORDER_TOP_WIDTH]\n = computedStyle[BORDER_RIGHT_WIDTH]\n = computedStyle[BORDER_BOTTOM_WIDTH]\n = computedStyle[BORDER_LEFT_WIDTH]\n = computedStyle[PADDING_TOP]\n = computedStyle[PADDING_RIGHT]\n = computedStyle[PADDING_BOTTOM]\n = computedStyle[PADDING_LEFT]\n = computedStyle[WIDTH]\n = computedStyle[HEIGHT]\n = this.__width\n = this.__height\n = 0;\n }\n\n // 预先计算是否是固定宽高,布局点位和尺寸考虑margin/border/padding\n __preLayout(data, isInline) {\n let { x, y, w, h, w2, h2, w3, h3, lx, nowrap, lineBoxManager, endSpace = 0 } = data;\n this.__x = x;\n this.__y = y;\n let { currentStyle, computedStyle } = this;\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n // 除了auto外都是固定宽高度\n let fixedWidth;\n let fixedHeight;\n // 绝对定位是left+right这种其实等于定义了width,但不能修改原始style,存入特殊变量标识\n if(w2 !== undefined) {\n fixedWidth = true;\n w = w2;\n }\n // flex时也会用到,子级得出目标主尺寸后按这个来\n else if(w3 !== undefined) {\n fixedWidth = true;\n w = w3;\n }\n else if(width[1] !== AUTO) {\n fixedWidth = true;\n switch(width[1]) {\n case PX:\n w = width[0];\n break;\n case PERCENT:\n w *= width[0] * 0.01;\n break;\n case REM:\n w = width[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n w = width[0] * this.root.width * 0.01;\n break;\n case VH:\n w = width[0] * this.root.height * 0.01;\n break;\n case VMAX:\n w = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n break;\n case VMIN:\n w = width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n break;\n }\n }\n if(h2 !== undefined) {\n fixedHeight = true;\n h = h2;\n }\n else if(h3 !== undefined) {\n fixedHeight = true;\n h = h3;\n }\n else if(height[1] !== AUTO) {\n fixedHeight = true;\n switch(height[1]) {\n case PX:\n h = height[0];\n break;\n case PERCENT:\n h *= height[0] * 0.01;\n break;\n case REM:\n h = height[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n h = height[0] * this.root.width * 0.01;\n break;\n case VH:\n h = height[0] * this.root.height * 0.01;\n break;\n case VMAX:\n h = height[0] * Math.max(this.root.width, this.root.height) * 0.01;\n break;\n case VMIN:\n h = height[0] * Math.min(this.root.width, this.root.height) * 0.01;\n break;\n }\n }\n // margin/border/padding影响x和y和尺寸,注意inline的y不受mpb影响\n x += borderLeftWidth + marginLeft + paddingLeft;\n data.x = x;\n if(!isInline) {\n y += borderTopWidth + marginTop + paddingTop;\n }\n data.y = y;\n // inline的w/h很特殊,需不考虑inline自身水平的mpb以便换行,因为mpb只在首尾行生效,所以首尾需特殊处理中间忽略\n // 当嵌套inline时更加复杂,假如inline有尾部mpb,最后一行需考虑,如果此inline是父的最后一个且父有mpb需叠加\n let selfEndSpace = 0;\n if(isInline) {\n selfEndSpace = paddingRight + borderRightWidth + marginRight;\n }\n // 传入w3/h3时,flex的item已知目标主尺寸,需减去mbp,其一定是block,和inline互斥\n if(!isInline) {\n if(width[1] === AUTO || w3 !== undefined) {\n w -= borderLeftWidth + borderRightWidth + marginLeft + marginRight + paddingLeft + paddingRight;\n }\n if(height[1] === AUTO || h3 !== undefined) {\n h -= borderTopWidth + borderBottomWidth + marginTop + marginBottom + paddingTop + paddingBottom;\n }\n }\n return {\n fixedWidth,\n fixedHeight,\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n nowrap,\n endSpace,\n selfEndSpace,\n };\n }\n\n // 处理margin:xx auto居中对齐或右对齐\n __marginAuto(style, data) {\n let {\n [POSITION]: position,\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [WIDTH]: width,\n } = style;\n if(position !== 'absolute' && (display === 'block' || display === 'flex')\n && (width[1] !== AUTO || this.isReplaced) && marginLeft[1] === AUTO && marginRight[1] === AUTO) {\n let ow = this.outerWidth;\n if(ow < data.w) {\n this.__offsetX((data.w - ow) * 0.5, true);\n }\n }\n }\n\n __calMatrix(lv, __cacheStyle, currentStyle, computedStyle, __config, sx1, sy1, offsetWidth, offsetHeight) {\n if(__config[NODE_IS_INLINE]) {\n computedStyle[TRANSFORM_ORIGIN] = [sx1, sy1];\n return __cacheStyle[MATRIX] = mx.identity();\n }\n let matrixCache = __cacheStyle[MATRIX];\n // tx/ty变化特殊优化\n if(matrixCache && lv < REFLOW && !contain(lv, TF)) {\n let x = 0, y = 0, z = 0;\n if(contain(lv, TX)) {\n let v = currentStyle[TRANSLATE_X];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n v = v[0];\n }\n x = v - (computedStyle[TRANSLATE_X] || 0);\n computedStyle[TRANSLATE_X] = v;\n computedStyle[TRANSFORM][12] += x;\n matrixCache[12] += x;\n }\n if(contain(lv, TY)) {\n let v = currentStyle[TRANSLATE_Y];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetHeight * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n v = v[0];\n }\n y = v - (computedStyle[TRANSLATE_Y] || 0);\n computedStyle[TRANSLATE_Y] = v;\n computedStyle[TRANSFORM][13] += y;\n matrixCache[13] += y;\n }\n if(contain(lv, TZ)) {\n let v = currentStyle[TRANSLATE_Z];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n v = v[0];\n }\n z = v - (computedStyle[TRANSLATE_Z] || 0);\n computedStyle[TRANSLATE_Z] = v;\n computedStyle[TRANSFORM][14] += z;\n matrixCache[14] += z;\n }\n __cacheStyle[MATRIX] = matrixCache;\n }\n // 先根据cache计算需要重新计算的computedStyle\n else {\n if(sx1 === undefined) {\n sx1 = this.__sx1;\n sy1 = this.__sy1;\n offsetWidth = this.offsetWidth;\n offsetHeight = this.offsetHeight;\n }\n if(__cacheStyle[TRANSFORM_ORIGIN] === undefined) {\n __cacheStyle[TRANSFORM_ORIGIN] = true;\n matrixCache = null;\n computedStyle[TRANSFORM_ORIGIN] = tf.calOrigin(currentStyle[TRANSFORM_ORIGIN], offsetWidth, offsetHeight, this.root);\n }\n if(__cacheStyle[TRANSFORM] === undefined\n || __cacheStyle[TRANSLATE_X] === undefined\n || __cacheStyle[TRANSLATE_Y] === undefined\n || __cacheStyle[TRANSLATE_Z] === undefined\n || __cacheStyle[ROTATE_X] === undefined\n || __cacheStyle[ROTATE_Y] === undefined\n || __cacheStyle[ROTATE_Z] === undefined\n || __cacheStyle[ROTATE_3D] === undefined\n || __cacheStyle[SCALE_X] === undefined\n || __cacheStyle[SCALE_Y] === undefined\n || __cacheStyle[SCALE_Z] === undefined\n || __cacheStyle[SKEW_X] === undefined\n || __cacheStyle[SKEW_Y] === undefined) {\n __cacheStyle[TRANSFORM]\n = __cacheStyle[TRANSLATE_X]\n = __cacheStyle[TRANSLATE_Y]\n = __cacheStyle[TRANSLATE_Z]\n = __cacheStyle[ROTATE_X]\n = __cacheStyle[ROTATE_Y]\n = __cacheStyle[ROTATE_Z]\n = __cacheStyle[SCALE_X]\n = __cacheStyle[SCALE_Y]\n = __cacheStyle[SCALE_Z]\n = __cacheStyle[SKEW_X]\n = __cacheStyle[SKEW_Y]\n = true;\n matrixCache = null;\n let matrix;\n // transform相对于自身\n if(currentStyle[TRANSFORM]) {\n matrix = tf.calMatrix(currentStyle[TRANSFORM], offsetWidth, offsetHeight, this.root);\n }\n // 没有transform则看是否有扩展的css独立变换属性\n else {\n let temp = [];\n [\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n ROTATE_3D,\n SKEW_X,\n SKEW_Y,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n ].forEach(k => {\n // 删除之前遗留的\n delete computedStyle[k];\n let v = currentStyle[k];\n if(isNil(v)) {\n return;\n }\n if(k === ROTATE_3D) {\n computedStyle[k] = [v[0], v[1], v[2], v[3][0]];\n if(v[3][0] === 0) {\n return;\n }\n temp.push([k, v]);\n return;\n }\n computedStyle[k] = v[0];\n // scale为1和其它为0避免计算浪费\n let isScale = k === SCALE_X || k === SCALE_Y || k === SCALE_Z;\n if(v[0] === 1 && isScale || !isScale && v[0] === 0) {\n return;\n }\n if(v[1] === PERCENT) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * offsetWidth * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * offsetHeight * 0.01;\n }\n }\n else if(v[1] === REM) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n }\n else if(v[1] === VW) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.width * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.width * 0.01;\n }\n }\n else if(v[1] === VH) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.height * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.height * 0.01;\n }\n }\n else if(v[1] === VMAX) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n }\n else if(v[1] === VMIN) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n temp.push([k, v]);\n });\n if(temp.length) {\n matrix = tf.calMatrix(temp, offsetWidth, offsetHeight, this.root);\n }\n }\n computedStyle[TRANSFORM] = matrix || mx.identity();\n }\n if(!matrixCache) {\n let m = computedStyle[TRANSFORM];\n let tfo = computedStyle[TRANSFORM_ORIGIN].slice(0);\n tfo[0] += sx1 || 0;\n tfo[1] += sy1 || 0;\n matrixCache = __cacheStyle[MATRIX] = tf.calMatrixByOrigin(m, tfo);\n }\n }\n return matrixCache;\n }\n\n /**\n * 将currentStyle计算为computedStyle,同时存入cacheStyle可缓存的结果防止无变更重复计算\n * @param renderMode\n * @param ctx\n * @param parent\n * @param __cacheStyle\n * @param currentStyle\n * @param computedStyle\n * @param clientWidth\n * @param clientHeight\n * @param offsetWidth\n * @param offsetHeight\n * @param borderTopWidth\n * @param borderRightWidth\n * @param borderBottomWidth\n * @param borderLeftWidth\n * @param paddingTop\n * @param paddingRight\n * @param paddingBottom\n * @param paddingLeft\n * @param x1\n * @param x2\n * @param x3\n * @param x4\n * @param x5\n * @param x6\n * @param y1\n * @param y2\n * @param y3\n * @param y4\n * @param y5\n * @param y6\n * @returns {*[]}\n * @private\n */\n __calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6) {\n let bx1 = x1, by1 = y1, bx2 = x6, by2 = y6;\n let backgroundClip = computedStyle[BACKGROUND_CLIP] = currentStyle[BACKGROUND_CLIP];\n // 默认border-box\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n bx1 = x2;\n by1 = y2;\n bx2 = x5;\n by2 = y5;\n }\n else if(backgroundClip === 'contentBox' || backgroundClip === 'content-box') {\n bx1 = x3;\n by1 = y3;\n bx2 = x4;\n by2 = y4;\n }\n let isInline = this.__config[NODE_IS_INLINE];\n if(isInline && !this.contentBoxList.length) {\n isInline = false;\n }\n // 这些直接赋值的不需要再算缓存\n [\n OPACITY,\n Z_INDEX,\n BORDER_TOP_STYLE,\n BORDER_RIGHT_STYLE,\n BORDER_BOTTOM_STYLE,\n BORDER_LEFT_STYLE,\n BACKGROUND_REPEAT,\n OVERFLOW,\n MIX_BLEND_MODE,\n TEXT_OVERFLOW,\n BACKGROUND_CLIP,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n if(isNil(__cacheStyle[FILTER])) {\n __cacheStyle[FILTER] = true;\n this.__calFilter(currentStyle, computedStyle);\n }\n if(isNil(__cacheStyle[BACKGROUND_POSITION_X])) {\n __cacheStyle[BACKGROUND_POSITION_X] = true;\n let {\n [BACKGROUND_POSITION_X]: bgX,\n } = currentStyle;\n computedStyle[BACKGROUND_POSITION_X] = (bgX || []).map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n if(item[1] === VMAX) {\n return item[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n if(item[1] === VMIN) {\n return item[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(item[1] === PERCENT) {\n return item[0] + '%';\n }\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_POSITION_Y])) {\n __cacheStyle[BACKGROUND_POSITION_Y] = true;\n let {\n [BACKGROUND_POSITION_Y]: bgY,\n } = currentStyle;\n computedStyle[BACKGROUND_POSITION_Y] = (bgY || []).map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n if(item[1] === VMAX) {\n return item[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n if(item[1] === VMIN) {\n return item[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(item[1] === PERCENT) {\n return item[0] + '%';\n }\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_SIZE])) {\n __cacheStyle[BACKGROUND_SIZE] = true;\n computedStyle[BACKGROUND_SIZE] = (currentStyle[BACKGROUND_SIZE] || []).map(item => {\n return bg.calBackgroundSize(item, bx2 - bx1, by2 - by1, this.root);\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_IMAGE])) {\n let bgI = computedStyle[BACKGROUND_IMAGE] = currentStyle[BACKGROUND_IMAGE].slice(0);\n __cacheStyle[BACKGROUND_IMAGE] = bgI.map((bgi, i) => {\n if(!bgi) {\n return null;\n }\n // 防止隐藏不加载背景图\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i] = this.__loadBgi[i] || {};\n let cache = inject.IMG[BACKGROUND_IMAGE];\n if(cache && cache.state === inject.LOADED) {\n loadBgi.url = BACKGROUND_IMAGE;\n loadBgi.source = cache.source;\n loadBgi.width = cache.width;\n loadBgi.height = cache.height;\n }\n else if(loadBgi.url !== bgi) {\n // 可能改变导致多次加载,每次清空,成功后还要比对url是否相同\n loadBgi.url = bgi;\n loadBgi.source = null;\n let node = this;\n let root = node.root;\n inject.measureImg(bgi, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败不绘制bgi\n if(data.success && data.url === loadBgi.url && !this.isDestroyed) {\n loadBgi.source = data.source;\n loadBgi.width = data.width;\n loadBgi.height = data.height;\n root.delRefreshTask(loadBgi.cb);\n root.addRefreshTask(loadBgi.cb = {\n __before() {\n __cacheStyle[BACKGROUND_IMAGE] = undefined;\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_FOCUS] = REPAINT;\n res[UPDATE_CONFIG] = node.__config;\n root.__addUpdate(node, node.__config, root, root.__config, res);\n },\n });\n }\n }, {\n ctx,\n root,\n width: bx2 - bx1,\n height: by2 - by1,\n });\n }\n return true;\n }\n else if(!isInline && bgi.k) {\n // gradient在渲染时才生成\n return true;\n }\n });\n }\n if(isNil(__cacheStyle[BOX_SHADOW])) {\n __cacheStyle[BOX_SHADOW] = true;\n computedStyle[BOX_SHADOW] = (currentStyle[BOX_SHADOW] || []).map(item => {\n return item.map((item2, i) => {\n if(i > 3) {\n return item2;\n }\n let v = item2[0];\n if(item2[1] === PERCENT) {\n if(i % 2 === 0) {\n v *= 0.01 * (bx2 - bx1);\n }\n else {\n v *= 0.01 * (by2 - by1);\n }\n }\n else if(item2[1] === REM) {\n v = v * this.root.computedStyle[FONT_SIZE];\n }\n else if(item2[1] === VW) {\n v = v * this.root.width * 0.01;\n }\n else if(item2[1] === VH) {\n v = v * this.root.height * 0.01;\n }\n else if(item2[1] === VMAX) {\n v = v * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(item2[1] === VMIN) {\n v = v * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return v;\n });\n });\n }\n [\n BACKGROUND_COLOR,\n BORDER_TOP_COLOR,\n BORDER_RIGHT_COLOR,\n BORDER_BOTTOM_COLOR,\n BORDER_LEFT_COLOR,\n ].forEach(k => {\n if(isNil(__cacheStyle[k])) {\n __cacheStyle[k] = int2rgba(computedStyle[k] = currentStyle[k][0]);\n }\n });\n // 圆角边计算\n if(isNil(__cacheStyle[BORDER_TOP_LEFT_RADIUS])\n || isNil(__cacheStyle[BORDER_TOP_RIGHT_RADIUS])\n || isNil(__cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS])\n || isNil(__cacheStyle[BORDER_BOTTOM_LEFT_RADIUS])) {\n __cacheStyle[BORDER_TOP_LEFT_RADIUS]\n = __cacheStyle[BORDER_TOP_RIGHT_RADIUS]\n = __cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS]\n = __cacheStyle[BORDER_BOTTOM_LEFT_RADIUS]\n = true;\n // 非替代的inline计算看contentBox首尾\n if(isInline) {\n border.calBorderRadiusInline(this.contentBoxList, currentStyle, computedStyle, this.root);\n }\n // 普通block整体计算\n else {\n border.calBorderRadius(offsetWidth, offsetHeight, currentStyle, computedStyle, this.root);\n }\n }\n // width/style/radius影响border,color不影响渲染缓存\n let btlr = computedStyle[BORDER_TOP_LEFT_RADIUS];\n let btrr = computedStyle[BORDER_TOP_RIGHT_RADIUS];\n let bbrr = computedStyle[BORDER_BOTTOM_RIGHT_RADIUS];\n let bblr = computedStyle[BORDER_BOTTOM_LEFT_RADIUS];\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k;\n let k2 = STYLE_KEY[style2Upper(k)];\n let kw = STYLE_KEY[style2Upper(k + 'Width')];\n let ks = STYLE_KEY[style2Upper(k + 'Style')];\n // width/style变更影响border重新计算\n if(isNil(__cacheStyle[kw])) {\n __cacheStyle[kw] = true;\n __cacheStyle[k2] = undefined;\n }\n if(isNil(__cacheStyle[ks])) {\n __cacheStyle[ks] = true;\n __cacheStyle[k2] = undefined;\n }\n if(isNil(__cacheStyle[k2])) {\n if(k2 === BORDER_TOP) {\n if(borderTopWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderTopWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 0, btlr, btrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_RIGHT) {\n if(borderRightWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderRightWidth / borderTopWidth);\n let deg2 = Math.atan(borderRightWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderRightWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 1, btrr, bbrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_BOTTOM) {\n if(borderBottomWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderBottomWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 2, bblr, bbrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_LEFT) {\n if(borderLeftWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderLeftWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 3, btlr, bblr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n }\n });\n // 强制计算继承性的\n let parentComputedStyle = parent && parent.computedStyle;\n if(currentStyle[FONT_STYLE][1] === INHERIT) {\n computedStyle[FONT_STYLE] = parent ? parentComputedStyle[FONT_STYLE] : 'normal';\n }\n else if(isNil(__cacheStyle[FONT_STYLE])) {\n computedStyle[FONT_STYLE] = currentStyle[FONT_STYLE][0];\n }\n __cacheStyle[FONT_STYLE] = computedStyle[FONT_STYLE];\n if(currentStyle[COLOR][1] === INHERIT) {\n computedStyle[COLOR] = parent ? parentComputedStyle[COLOR] : [0, 0, 0, 1];\n __cacheStyle[COLOR] = int2rgba(computedStyle[COLOR]);\n }\n else if(isNil(__cacheStyle[COLOR])) {\n computedStyle[COLOR] = rgba2int(currentStyle[COLOR][0]);\n __cacheStyle[COLOR] = int2rgba(computedStyle[COLOR]);\n }\n if(currentStyle[TEXT_STROKE_COLOR][1] === INHERIT) {\n computedStyle[TEXT_STROKE_COLOR] = parent ? parentComputedStyle[TEXT_STROKE_COLOR] : [0, 0, 0, 1];\n __cacheStyle[TEXT_STROKE_COLOR] = int2rgba(computedStyle[TEXT_STROKE_COLOR]);\n }\n else if(isNil(__cacheStyle[TEXT_STROKE_COLOR])) {\n computedStyle[TEXT_STROKE_COLOR] = rgba2int(currentStyle[TEXT_STROKE_COLOR][0]);\n __cacheStyle[TEXT_STROKE_COLOR] = int2rgba(computedStyle[TEXT_STROKE_COLOR]);\n }\n if(currentStyle[TEXT_STROKE_WIDTH][1] === INHERIT) {\n computedStyle[TEXT_STROKE_WIDTH] = parent ? parentComputedStyle[TEXT_STROKE_WIDTH] : 0;\n __cacheStyle[TEXT_STROKE_WIDTH] = true;\n }\n else if(isNil(__cacheStyle[TEXT_STROKE_WIDTH])) {\n let v = currentStyle[TEXT_STROKE_WIDTH];\n if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n v = v[0];\n }\n computedStyle[TEXT_STROKE_WIDTH] = v;\n __cacheStyle[TEXT_STROKE_WIDTH] = true;\n }\n if(currentStyle[TEXT_STROKE_OVER][1] === INHERIT) {\n __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = parent ? parentComputedStyle[TEXT_STROKE_OVER] : 'none';\n }\n else {\n __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = currentStyle[TEXT_STROKE_OVER][0];\n }\n if(currentStyle[VISIBILITY][1] === INHERIT) {\n computedStyle[VISIBILITY] = parent ? parentComputedStyle[VISIBILITY] : 'visible';\n }\n else if(isNil(__cacheStyle[VISIBILITY])) {\n computedStyle[VISIBILITY] = currentStyle[VISIBILITY][0];\n }\n __cacheStyle[VISIBILITY] = computedStyle[VISIBILITY];\n if(currentStyle[POINTER_EVENTS][1] === INHERIT) {\n computedStyle[POINTER_EVENTS] = parent ? parentComputedStyle[POINTER_EVENTS] : 'auto';\n }\n else if(isNil(__cacheStyle[POINTER_EVENTS])) {\n computedStyle[POINTER_EVENTS] = currentStyle[POINTER_EVENTS][0];\n }\n __cacheStyle[POINTER_EVENTS] = computedStyle[POINTER_EVENTS];\n this.__bx1 = bx1;\n this.__bx2 = bx2;\n this.__by1 = by1;\n this.__by2 = by2;\n return [bx1, by1, bx2, by2];\n }\n\n __calPerspective(__cacheStyle, currentStyle, computedStyle, __config, sx1, sy1) {\n let rebuild;\n if(isNil(__cacheStyle[PERSPECTIVE])) {\n __cacheStyle[PERSPECTIVE] = true;\n rebuild = true;\n let v = currentStyle[PERSPECTIVE];\n let ppt = 0;\n if(v[1] === REM) {\n ppt = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n ppt = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n ppt = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n ppt = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n ppt = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n ppt = v[0];\n }\n computedStyle[PERSPECTIVE] = ppt;\n }\n if(isNil(__cacheStyle[PERSPECTIVE_ORIGIN])) {\n __cacheStyle[PERSPECTIVE_ORIGIN] = true;\n rebuild = true;\n computedStyle[PERSPECTIVE_ORIGIN] = tf.calOrigin(currentStyle[PERSPECTIVE_ORIGIN], this.offsetWidth, this.offsetHeight, this.root);\n }\n if(rebuild) {\n if(sx1 === undefined) {\n sx1 = this.__sx1;\n sy1 = this.__sy1;\n }\n let po = computedStyle[PERSPECTIVE_ORIGIN].slice(0);\n po[0] += sx1 || 0;\n po[1] += sy1 || 0;\n __config[NODE_PERSPECTIVE_MATRIX] = tf.calPerspectiveMatrix(computedStyle[PERSPECTIVE], po);\n }\n }\n\n __calFilter(currentStyle, computedStyle) {\n return computedStyle[FILTER] = (currentStyle[FILTER] || []).map(item => {\n let [k, v] = item;\n // 部分%单位的滤镜强制使用数字\n if(v[1] === PX || v[1] === DEG || v[1] === PERCENT || v[1] === NUMBER) {\n v = v[0];\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else if(v[1] === VMAX) {\n v = v[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(v[1] === VMIN) {\n v = v[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return [k, v];\n });\n }\n\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n if(renderMode === CANVAS || renderMode === WEBGL) {\n if(lv < REPAINT) {\n return this.__hasContent;\n }\n let visibility = currentStyle[VISIBILITY];\n if(visibility !== 'hidden') {\n let bgI = currentStyle[BACKGROUND_IMAGE];\n if(Array.isArray(bgI)) {\n for(let i = 0, len = bgI.length; i < len; i++) {\n if(bgI[i]) {\n return true;\n }\n }\n }\n if(currentStyle[BACKGROUND_COLOR][0][3] > 0) {\n let width = computedStyle[WIDTH], height = computedStyle[HEIGHT],\n paddingTop = computedStyle[PADDING_TOP], paddingRight = computedStyle[PADDING_RIGHT],\n paddingBottom = computedStyle[PADDING_BOTTOM], paddingLeft = computedStyle[PADDING_LEFT];\n if(width && height || paddingTop || paddingRight || paddingBottom || paddingLeft) {\n return true;\n }\n }\n for(let list = ['Top', 'Right', 'Bottom', 'Left'], i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n if(computedStyle[STYLE_KEY[style2Upper('border' + k + 'Width')]] > 0\n && currentStyle[STYLE_KEY[style2Upper('border' + k + 'Color')]][0][3] > 0) {\n return true;\n }\n }\n let bs = currentStyle[BOX_SHADOW];\n if(Array.isArray(bs)) {\n for(let i = 0, len = bs.length; i < len; i++) {\n let item = bs[i];\n if(item && (item[2] > 0 || item[3] > 0)) {\n return true;\n }\n }\n }\n }\n }\n return false;\n }\n\n /**\n * 渲染基础方法,Dom/Geom公用\n * @param renderMode\n * @see node/mode\n * @param lv\n * @see refresh/level\n * @param ctx canvas/svg/webgl共用\n * @param cache 是否是局部根节点缓存模式下的绘制\n * @see refresh/Cache.NA\n * @param dx cache时偏移x\n * @param dy cache时偏移y\n * @return Object\n * x1/x2/x3/x4/y1/y2/y3/y4 坐标\n * break svg判断无变化提前跳出\n * cacheError 离屏申请失败,仅canvas\n * offscreenBlend 无cache时的离屏canvas,仅canvas\n * offscreenFilter 无cache时的离屏canvas,仅canvas\n * offscreenOverflow 无cache时的离屏canvas,仅canvas\n * offscreenMask 无cache时的离屏canvas,仅canvas\n */\n render(renderMode, lv, ctx, cache, dx = 0, dy = 0) {\n let {\n isDestroyed,\n root,\n __config,\n } = this;\n let __cache = __config[NODE_CACHE];\n let __cacheStyle = __config[NODE_CACHE_STYLE];\n let currentStyle = __config[NODE_CURRENT_STYLE];\n let computedStyle = __config[NODE_COMPUTED_STYLE];\n // 渲染完认为完全无变更,等布局/动画/更新重置\n __config[NODE_REFRESH_LV] = NONE;\n // >=REPAINT清空bbox\n if(lv >= REPAINT) {\n this.__bbox = null;\n }\n if(isDestroyed) {\n return { isDestroyed, break: true };\n }\n let virtualDom;\n // svg设置vd上的lv属性标明lineHeight的话,另外特殊字体如arial拥有lineGap也会产生间隙,背景色不绘制这个间隙\n * x轴根据contentBox的范围坐标,y则固定和font/lineHeight相关\n * 圆角发生在首尾lineBox处,中间不会有,bgi则产生类似bgc作为mask的效果\n * 另外要注意多个时的顺序,必须依次渲染,后面的bb可能会覆盖前面行的\n */\n if(isRealInline) {\n let contentBoxList = this.contentBoxList;\n let length = contentBoxList.length;\n let hasBgi = backgroundImage.some(item => item);\n if(length) {\n let {\n [FONT_SIZE]: fontSize,\n [FONT_FAMILY]: fontFamily,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let iw = 0, ih = 0;\n let offscreen, svgBgSymbol = [];\n // bgi视作inline排满一行绘制,然后按分行拆开给每行\n if(hasBgi) {\n iw = inline.getInlineWidth(this, contentBoxList);\n ih = lineHeight;\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n iw += paddingLeft + paddingRight;\n ih += paddingTop + paddingBottom;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n iw += paddingLeft + paddingRight + borderLeftWidth + borderRightWidth;\n ih += paddingTop + paddingBottom + borderTopWidth + borderBottomWidth;\n }\n if(renderMode === CANVAS || renderMode === WEBGL) {\n offscreen = inject.getCacheCanvas(iw, ih, '__$$INLINE_BGI$$__');\n }\n let length = backgroundImage.length;\n backgroundImage.slice(0).reverse().forEach((bgi, i) => {\n if(!bgi) {\n return;\n }\n i = length - 1 - i;\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i];\n if(loadBgi.url === backgroundImage[i]) {\n let uuid = bg.renderImage(this, renderMode, offscreen && offscreen.ctx || ctx, loadBgi,\n 0, 0, iw, ih, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, true, dx, dy);\n if(renderMode === SVG && uuid) {\n svgBgSymbol.push(uuid);\n }\n }\n }\n else if(bgi.k) {\n let gd = this.__gradient(renderMode, ctx, 0, 0, iw, ih, bgi, dx, dy);\n if(gd) {\n if(gd.k === 'conic') {\n let uuid = gradient.renderConic(this, renderMode, offscreen && offscreen.ctx || ctx, gd.v, 0, 0, iw, lineHeight,\n btlr, btrr, bbrr, bblr, true);\n if(renderMode === SVG && uuid) {\n svgBgSymbol.push(uuid);\n }\n }\n else {\n let uuid = bg.renderBgc(this, renderMode, offscreen && offscreen.ctx || ctx, gd.v, null,\n 0, 0, iw, ih, btlr, btrr, bbrr, bblr, 'fill', true);\n if(renderMode === SVG && uuid) {\n svgBgSymbol.push(uuid);\n }\n }\n }\n }\n });\n }\n // 获取当前dom的baseline,再减去lineBox的baseline得出差值,这样渲染范围y就是lineBox的y+差值为起始,lineHeight为高\n let ff = css.getFontFamily(fontFamily);\n let baseline = css.getBaseline(computedStyle);\n // lineGap,一般为0,某些字体如arial有,渲染高度需减去它,最终是lineHeight - diffL\n let diffL = fontSize * (font.info[ff].lgr || 0);\n // 注意只有1个的时候特殊情况,圆角只在首尾行出现\n let isFirst = true;\n let lastContentBox = contentBoxList[0], lastLineBox = lastContentBox.parentLineBox;\n // bgi需统计宽度累计值,将当前行所处理想单行的x范围位置计算出来,并进行bgi贴图绘制,svg还需统计第几行\n let count = 0, countW = 0;\n for(let i = 0; i < length; i++) {\n let contentBox = contentBoxList[i];\n if(contentBox.parentLineBox !== lastLineBox) {\n // 上一行\n let [ix1, iy1, ix2, iy2, bx1, by1, bx2, by2] = inline.getInlineBox(this, contentBoxList,\n lastContentBox, contentBoxList[i - 1], lastLineBox, baseline, lineHeight, diffL, isFirst, false,\n backgroundClip, paddingTop, paddingRight, paddingBottom, paddingLeft,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth);\n // 要算上开头空白inline,可能有多个和递归嵌套\n if(isFirst) {\n let n = getFirstEmptyInlineWidth(this);\n ix1 -= n;\n bx1 -= n;\n }\n if(backgroundColor[3] > 0) {\n bg.renderBgc(this, renderMode, ctx, __cacheStyle[BACKGROUND_COLOR], null,\n ix1, iy1, ix2 - ix1, iy2 - iy1, btlr, [0, 0], [0, 0], bblr, 'fill', false, dx, dy);\n }\n let w = ix2 - ix1;\n // canvas的bg位图裁剪\n if((renderMode === CANVAS || renderMode === WEBGL) && offscreen) {\n ctx.drawImage(offscreen.canvas, countW, 0, w, ih, ix1 + dx, iy1 + dy, w, ih);\n }\n //svg则特殊判断\n else if(renderMode === SVG && svgBgSymbol.length) {\n svgBgSymbol.forEach(symbol => {\n if(symbol) {\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n tagName: 'path',\n props: [\n ['d', `M${countW},${0}L${w+countW},${0}L${w+countW},${ih}L${countW},${ih},L${countW},${0}`],\n ],\n }\n ],\n };\n let clip = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.bb.push({\n type: 'item',\n tagName: 'use',\n props: [\n ['xlink:href', '#' + symbol],\n ['x', ix1 - countW],\n ['y', iy1],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n });\n }\n countW += w;\n if(boxShadow) {\n boxShadow.forEach(item => {\n bs.renderBoxShadow(this, renderMode, ctx, item, bx1, by1, bx2, by2, bx2 - bx1, by2 - by1, dx, dy);\n });\n }\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n let list = border.calPoints(borderTopWidth, computedStyle[BORDER_TOP_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 0, isFirst ? btlr : [0, 0], [0, 0]);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_TOP_COLOR], dx, dy);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n let list = border.calPoints(borderBottomWidth, computedStyle[BORDER_BOTTOM_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 2, isFirst ? btlr : [0, 0], [0, 0]);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_BOTTOM_COLOR], dx, dy);\n }\n if(isFirst && borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n let list = border.calPoints(borderLeftWidth, computedStyle[BORDER_LEFT_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 3, btlr, btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_LEFT_COLOR], dx, dy);\n }\n isFirst = false;\n lastContentBox = contentBox;\n lastLineBox = contentBox.parentLineBox;\n count++;\n }\n // 最后一个特殊判断\n if(i === length - 1) {\n let [ix1, iy1, ix2, iy2, bx1, by1, bx2, by2] = inline.getInlineBox(this, contentBoxList,\n lastContentBox, contentBoxList[i], lastLineBox, baseline, lineHeight, diffL, isFirst, true,\n backgroundClip, paddingTop, paddingRight, paddingBottom, paddingLeft,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth);\n // 要算上开头空白inline,可能有多个和递归嵌套\n if(isFirst) {\n let n = getFirstEmptyInlineWidth(this);\n ix1 -= n;\n bx1 -= n;\n }\n // 要算上末尾空白inline,可能有多个和递归嵌套\n let n = getLastEmptyInlineWidth(this);\n ix2 += n;\n bx2 += n;\n if(backgroundColor[3] > 0) {\n bg.renderBgc(this, renderMode, ctx, __cacheStyle[BACKGROUND_COLOR], null,\n ix1, iy1, ix2 - ix1, iy2 - iy1, isFirst ? btlr : [0, 0], btrr, bbrr, isFirst ? bblr : [0, 0],\n 'fill', false, dx, dy);\n }\n let w = ix2 - ix1;\n // canvas的bg位图裁剪\n if((renderMode === CANVAS || renderMode === WEBGL) && offscreen) {\n ctx.drawImage(offscreen.canvas, countW, 0, w, ih, ix1 + dx, iy1 + dy, w, ih);\n }\n //svg则特殊判断\n else if(renderMode === SVG && svgBgSymbol.length) {\n svgBgSymbol.forEach(symbol => {\n if(symbol) {\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n tagName: 'path',\n props: [\n ['d', `M${countW},${0}L${w+countW},${0}L${w+countW},${ih}L${countW},${ih},L${countW},${0}`],\n ],\n }\n ],\n };\n let clip = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.bb.push({\n type: 'item',\n tagName: 'use',\n props: [\n ['xlink:href', '#' + symbol],\n ['x', ix1 - countW],\n ['y', iy1],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n }\n });\n }\n if(boxShadow) {\n boxShadow.forEach(item => {\n bs.renderBoxShadow(this, renderMode, ctx, item, bx1, by1, bx2, by2, bx2 - bx1, by2 - by1, dx, dy);\n });\n }\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n let list = border.calPoints(borderTopWidth, computedStyle[BORDER_TOP_STYLE], deg1, deg2,\n bx1, bx1, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 0, isFirst ? btlr : [0, 0], btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_TOP_COLOR], dx, dy);\n }\n if(borderRightWidth > 0 && borderRightColor[3] > 0) {\n let deg1 = Math.atan(borderRightWidth / borderTopWidth);\n let deg2 = Math.atan(borderRightWidth / borderBottomWidth);\n let list = border.calPoints(borderRightWidth, computedStyle[BORDER_RIGHT_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 1, btlr, btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_RIGHT_COLOR], dx, dy);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n let list = border.calPoints(borderBottomWidth, computedStyle[BORDER_BOTTOM_STYLE], deg1, deg2,\n bx1, bx1, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 2, isFirst ? btlr : [0, 0], btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_BOTTOM_COLOR], dx, dy);\n }\n if(isFirst && borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n let list = border.calPoints(borderLeftWidth, computedStyle[BORDER_LEFT_STYLE], deg1, deg2,\n bx1, bx1 + borderLeftWidth, bx2 - borderRightWidth, bx2,\n by1, by1 + borderTopWidth, by2 - borderBottomWidth, by2, 3, btlr, btrr);\n border.renderBorder(this, renderMode, ctx, list, __cacheStyle[BORDER_LEFT_COLOR], dx, dy);\n }\n }\n }\n if(offscreen) {\n offscreen.ctx.clearRect(0, 0, iw, ih);\n }\n return res;\n }\n // 无内容且无尺寸的无需渲染\n else if(bx1 === bx2 || by1 === by2) {\n return res;\n }\n }\n // block渲染,bgc垫底\n if(backgroundColor[3] > 0) {\n bg.renderBgc(this, renderMode, ctx, __cacheStyle[BACKGROUND_COLOR], borderList,\n bx1, by1, bx2 - bx1, by2 - by1, btlr, btrr, bbrr, bblr, 'fill', false, dx, dy);\n }\n // 渐变或图片叠加\n if(backgroundImage) {\n let length = backgroundImage.length;\n backgroundImage.slice(0).reverse().forEach((bgi, i) => {\n if(!bgi) {\n return;\n }\n i = length - 1 - i;\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i];\n if(loadBgi.url === backgroundImage[i]) {\n bg.renderImage(this, renderMode, ctx, loadBgi,\n bx1, by1, bx2, by2, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, false, dx, dy);\n }\n }\n else if(bgi.k) {\n let gd = this.__gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi, dx, dy);\n if(gd) {\n if(gd.k === 'conic') {\n gradient.renderConic(this, renderMode, ctx, gd.v, bx1, by1, bx2 - bx1, by2 - by1,\n btlr, btrr, bbrr, bblr);\n }\n else {\n bg.renderBgc(this, renderMode, ctx, gd.v, borderList,\n bx1, by1, bx2 - bx1, by2 - by1, btlr, btrr, bbrr, bblr, 'fill', false, dx, dy);\n }\n }\n }\n });\n }\n // boxShadow可能会有多个\n if(boxShadow) {\n boxShadow.forEach(item => {\n bs.renderBoxShadow(this, renderMode, ctx, item, x1, y1, x6, y6, x6 - x1, y6 - y1, dx, dy);\n });\n }\n // 边框需考虑尖角,两条相交边平分45°夹角\n if(borderTopWidth > 0 && borderTopColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_TOP], __cacheStyle[BORDER_TOP_COLOR], dx, dy);\n }\n if(borderRightWidth > 0 && borderRightColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_RIGHT], __cacheStyle[BORDER_RIGHT_COLOR], dx, dy);\n }\n if(borderBottomWidth > 0 && borderBottomColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_BOTTOM], __cacheStyle[BORDER_BOTTOM_COLOR], dx, dy);\n }\n if(borderLeftWidth > 0 && borderLeftColor[3] > 0) {\n border.renderBorder(this, renderMode, ctx, __cacheStyle[BORDER_LEFT], __cacheStyle[BORDER_LEFT_COLOR], dx, dy);\n }\n return res;\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n super.__destroy();\n let { root } = this;\n this.clearAnimate();\n this.clearFrameAnimate();\n // root在没有初始化到真实dom渲染的情况下没有\n root && root.delRefreshTask(this.__loadBgi.cb);\n root && root.delRefreshTask(this.__task);\n this.__task = null;\n this.__root = null;\n this.clearCache();\n }\n\n // 先查找到注册了事件的节点,再捕获冒泡判断增加性能\n __emitEvent(e, force) {\n let { isDestroyed, computedStyle, isMask } = this;\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || e.__stopPropagation || isMask) {\n return;\n }\n let { event: { type } } = e;\n let { listener, __hasMask } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // touchmove之类强制的直接由Root通知即可\n if(force) {\n if(computedStyle[POINTER_EVENTS] !== 'none' && isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n // 非force的判断事件坐标是否在节点内\n if(this.willResponseEvent(e)) {\n // 如果有mask,点在mask上才行,点在clip外才行\n if(__hasMask) {\n let next = this.next;\n let isClip = next.isClip;\n let hasEmitMask;\n while(next && next.isMask) {\n if(next.willResponseEvent(e, true)) {\n hasEmitMask = true;\n break;\n }\n next = next.next;\n }\n if(!isClip && !hasEmitMask) {\n return;\n }\n }\n if(isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n\n willResponseEvent(e, ignore) {\n let { x, y } = e;\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent, computedStyle } = this;\n if(computedStyle[POINTER_EVENTS] === 'none') {\n return;\n }\n let inThis = geom.pointInQuadrilateral(\n x, y,\n __sx1, __sy1,\n __sx1 + offsetWidth, __sy1,\n __sx1 + offsetWidth, __sy1 + offsetHeight,\n __sx1, __sy1 + offsetHeight,\n matrixEvent\n );\n if(inThis) {\n if(!e.target && !ignore) {\n e.target = this;\n // 缓存target给move用\n if(e.event.type === 'touchstart') {\n this.root && (this.root.__touchstartTarget = this);\n }\n }\n return true;\n }\n }\n\n __gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi, dx = 0, dy = 0) {\n let iw = bx2 - bx1;\n let ih = by2 - by1;\n // 无尺寸无需创建渐变\n if(!iw || !ih) {\n return;\n }\n let { k, v, d, s, z, p } = bgi;\n let cx = bx1 + iw * 0.5;\n let cy = by1 + ih * 0.5;\n let res = { k };\n if(k === 'linear') {\n let gd = gradient.getLinear(v, d, bx1, by1, cx, cy, iw, ih, this.root, dx, dy);\n res.v = this.__getLg(renderMode, ctx, gd);\n }\n else if(k === 'radial') {\n let gd = gradient.getRadial(v, s, z, p, bx1, by1, bx2, by2, this.root, dx, dy);\n if(gd) {\n res.v = this.__getRg(renderMode, ctx, gd)\n if(gd.matrix) {\n res.v = [res.v, gd.matrix, gd.cx, gd.cy];\n }\n }\n }\n else if(k === 'conic') {\n let bbox = this.bbox;\n let m1 = Math.max(Math.abs(bbox[2] - bbox[0]), Math.abs(bbox[3] - bbox[1]));\n let m2 = Math.max(Math.abs(iw), Math.abs(ih));\n let gd = gradient.getConic(v, d, p, bx1, by1, bx2, by2, m1 / m2, this.root, dx, dy);\n res.v = this.__getCg(renderMode, ctx, gd);\n }\n return res;\n }\n\n __getLg(renderMode, ctx, gd) {\n if(renderMode === CANVAS || renderMode === WEBGL) {\n let lg = ctx.createLinearGradient(gd.x1, gd.y1, gd.x2, gd.y2);\n gd.stop.forEach(item => {\n lg.addColorStop(item[1], int2rgba(item[0]));\n });\n return lg;\n }\n else if(renderMode === SVG) {\n let v = {\n tagName: 'linearGradient',\n props: [\n ['x1', gd.x1],\n ['y1', gd.y1],\n ['x2', gd.x2],\n ['y2', gd.y2],\n ],\n children: gd.stop.map(item => {\n return {\n tagName: 'stop',\n props: [\n ['stop-color', int2rgba(item[0])],\n ['offset', item[1] * 100 + '%'],\n ],\n };\n }),\n };\n let uuid = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n return 'url(#' + uuid + ')';\n }\n }\n\n __getRg(renderMode, ctx, gd) {\n if(renderMode === CANVAS || renderMode === WEBGL) {\n let rg = ctx.createRadialGradient(gd.cx, gd.cy, 0, gd.tx, gd.ty, gd.r);\n gd.stop.forEach(item => {\n rg.addColorStop(item[1], int2rgba(item[0]));\n });\n return rg;\n }\n else if(renderMode === SVG) {\n let v = {\n tagName: 'radialGradient',\n props: [\n ['cx', gd.tx],\n ['cy', gd.ty],\n ['r', gd.r],\n ],\n children: gd.stop.map(item => {\n return {\n tagName: 'stop',\n props: [\n ['stop-color', int2rgba(item[0])],\n ['offset', item[1] * 100 + '%'],\n ],\n };\n }),\n };\n if(gd.tx !== gd.cx) {\n v.props.push(['fx', gd.cx]);\n }\n if(gd.ty !== gd.cy) {\n v.props.push(['fy', gd.cy]);\n }\n let uuid = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n return 'url(#' + uuid + ')';\n }\n }\n\n __getCg(renderMode, ctx, gd) {\n let { cx, cy, r, deg, stop } = gd;\n let len = stop.length - 1;\n if(stop[len][1] < 1) {\n stop.push([stop[len][0].slice(0), 1]);\n }\n if(stop[0][1] > 0) {\n stop.unshift([stop[0][0].slice(0), 0]);\n }\n // canvas采用点色值计算法,svg则分360度画块\n let res = [];\n if(renderMode === CANVAS || renderMode === WEBGL) {\n return gd;\n }\n else if(renderMode === SVG) {\n let offset = 0.5;\n let prev;\n // 根据2个stop之间的百分比得角度差划分块数,每0.5°一块,不足也算\n let list = [];\n for(let i = 0, len = stop.length; i < len - 1; i++) {\n let begin = stop[i][1] * 360;\n let end = stop[i + 1][1] * 360;\n let diff = end - begin;\n let n = Math.ceil(diff);\n let per = diff / n;\n // 计算每块的2个弧端点\n let bc = stop[i][0];\n let ec = stop[i + 1][0];\n let dc = [ec[0] - bc[0], ec[1] - bc[1], ec[2] - bc[2], ec[3] - bc[3]];\n let pc = [dc[0] / n, dc[1] / n, dc[2] / n, dc[3] / n];\n for(let j = 0; j < n; j++) {\n let [x1, y1] = geom.pointOnCircle(cx, cy, r, begin + per * j + deg - offset);\n let [x2, y2] = geom.pointOnCircle(cx, cy, r, begin + per * j + deg + offset);\n list.push([\n x1, y1,\n x2, y2,\n Math.round(bc[0] + pc[0] * j),\n Math.round(bc[1] + pc[1] * j),\n Math.round(bc[2] + pc[2] * j),\n Math.round(bc[3] + pc[3] * j),\n ]);\n }\n }\n // 最后一段补自己末尾颜色特殊处理\n let end = list[0].slice(0);\n let [x2, y2] = geom.pointOnCircle(cx, cy, r, deg);\n end[2] = x2;\n end[3] = y2;\n let s = stop[stop.length - 1][0];\n end[4] = s[0];\n end[5] = s[1];\n end[6] = s[2];\n end[7] = s[3];\n list.push(end);\n for(let i = 0, len = list.length; i < len; i++) {\n let cur = list[i];\n if(prev) {\n let v = {\n tagName: 'linearGradient',\n props: [\n ['x1', prev[0]],\n ['y1', prev[1]],\n ['x2', cur[2]],\n ['y2', cur[3]],\n ],\n children: [\n {\n tagName: 'stop',\n props: [\n ['stop-color', int2rgba([prev[4], prev[5], prev[6], prev[7]])],\n ['offset', '0%'],\n ],\n },\n {\n tagName: 'stop',\n props: [\n ['stop-color', int2rgba([cur[4], cur[5], cur[6], cur[7]])],\n ['offset', '100%'],\n ],\n },\n ],\n };\n let uuid = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n res.push([[[cx, cy], [prev[0], prev[1]], [cur[2], cur[3]]], 'url(#' + uuid + ')']);\n }\n prev = cur;\n }\n }\n return res;\n }\n\n // canvas清空自身cache,cacheTotal在Root的自底向上逻辑做,svg仅有cacheTotal\n clearCache(onlyTotal) {\n let __config = this.__config;\n let __cacheTotal = __config[NODE_CACHE_TOTAL];\n let __cacheFilter = __config[NODE_CACHE_FILTER];\n let __cacheMask = __config[NODE_CACHE_MASK];\n let __cacheOverflow = __config[NODE_CACHE_OVERFLOW];\n if(!onlyTotal) {\n __config[NODE_CACHE_STYLE] = this.__cacheStyle = {};\n let __cache = __config[NODE_CACHE];\n if(__cache) {\n __cache.release();\n }\n }\n if(__cacheTotal) {\n __cacheTotal.release();\n }\n if(__cacheFilter) {\n __cacheFilter.release();\n }\n if(__cacheMask) {\n __cacheMask.release();\n }\n if(__cacheOverflow) {\n __cacheOverflow.release();\n }\n }\n\n updateStyle(style, cb) {\n let node = this;\n let { root, __config } = node;\n let formatStyle = css.normalize(style);\n // 有root说明被添加渲染过了\n if(root) {\n root.addRefreshTask(node.__task = {\n __before() {\n node.__task = null;\n if(__config[NODE_IS_DESTROYED]) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = formatStyle;\n res[UPDATE_OVERWRITE] = style; // 标识盖原有style样式不仅仅是修改currentStyle,不同于animate\n res[UPDATE_KEYS] = Object.keys(formatStyle).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n res[UPDATE_CONFIG] = __config;\n root.__addUpdate(node, __config, root, root.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, formatStyle);\n if(isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n // 传入格式化好key/value的样式\n updateFormatStyle(style, cb) {\n let node = this;\n let { root, __config } = node;\n if(root) {\n root.addRefreshTask(node.__task = {\n __before() {\n node.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(__config[NODE_IS_DESTROYED]) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n res[UPDATE_CONFIG] = __config;\n root.__addUpdate(node, __config, root, root.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, style);\n if(isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n animate(list, options = {}) {\n let animation = new Animation(this, list, options);\n if(this.isDestroyed) {\n animation.__destroy(true);\n return animation;\n }\n this.animationList.push(animation);\n if(options.autoPlay === false) {\n return animation;\n }\n return animation.play();\n }\n\n removeAnimate(o) {\n if(o instanceof Animation) {\n let i = this.animationList.indexOf(o);\n if(i > -1) {\n o.cancel();\n o.__destroy();\n this.animationList.splice(i, 1);\n }\n }\n }\n\n clearAnimate() {\n this.animationList.splice(0).forEach(o => {\n o.cancel();\n o.__destroy();\n });\n }\n\n frameAnimate(cb) {\n if(isFunction(cb)) {\n let list = this.__frameAnimateList;\n // 防止重复\n for(let i = 0, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n return cb;\n }\n }\n let enter = {\n __after(diff) {\n cb(diff);\n },\n __karasFramecb: cb,\n };\n list.push(enter);\n frame.onFrame(enter);\n return cb;\n }\n }\n\n removeFrameAnimate(cb) {\n for(let i = 0, list = this.__frameAnimateList, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n list.splice(i, 1);\n frame.offFrame(cb);\n return;\n }\n }\n }\n\n clearFrameAnimate() {\n this.__frameAnimateList.splice(0).forEach(o => {\n frame.offFrame(o);\n });\n }\n\n __computeMeasure(renderMode, ctx, cb) {\n css.computeMeasure(this);\n if(isFunction(cb)) {\n cb(this);\n }\n }\n\n __deepScan(cb, options) {\n return cb(this, options);\n }\n\n // isLayout为false时,为relative/margin/flex/vertical等\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.__layoutData.x += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sx1 += diff;\n this.__sx2 += diff;\n this.__sx3 += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.__layoutData.y += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sy1 += diff;\n this.__sy2 += diff;\n this.__sy3 += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n }\n\n __resizeX(diff, lv) {\n this.computedStyle.width = this.__width += diff;\n this.__clientWidth += diff;\n this.__offsetWidth += diff;\n this.__outerWidth += diff;\n this.__layoutData.w += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __resizeY(diff, lv) {\n this.computedStyle.height = this.__height += diff;\n this.__clientHeight += diff;\n this.__offsetHeight += diff;\n this.__outerHeight += diff;\n this.__layoutData.h += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __spreadBbox(boxShadow, filter) {\n let x1 = 0, y1 = 0, x2 = 0, y2 = 0;\n let xl = [], yt = [], xr = [], yb = [];\n if(Array.isArray(boxShadow)) {\n boxShadow.forEach(item => {\n let [x, y, sigma, spread, , inset] = item;\n x1 = x2 = x;\n y1 = y2 = y;\n if(inset !== 'inset') {\n let d = blur.outerSize(sigma);\n d += spread;\n xl.push(x - d);\n xr.push(x + d);\n yt.push(y - d);\n yb.push(y + d);\n }\n });\n }\n if(Array.isArray(filter)) {\n filter.forEach(item => {\n let [k, v] = item;\n let sigma = v[0];\n if(k === 'blur' && sigma > 0) {\n let d = blur.kernelSize(sigma);\n let spread = blur.outerSizeByD(d);\n if(spread) {\n xl.push(-spread);\n xr.push(spread);\n yt.push(-spread);\n yb.push(spread);\n }\n }\n });\n }\n xl.forEach(n => x1 = Math.min(x1, n));\n xr.forEach(n => x2 = Math.max(x2, n));\n yt.forEach(n => y1 = Math.min(y1, n));\n yb.forEach(n => y2 = Math.max(y2, n));\n return [x1, y1, x2, y2];\n }\n\n __releaseWhenEmpty(__cache) {\n if(__cache && __cache.available) {\n __cache.release();\n }\n return true;\n }\n\n getComputedStyle(key) {\n let computedStyle = this.computedStyle;\n let res = {};\n let keys;\n if(key) {\n if(Array.isArray(key)) {\n keys = key;\n }\n else {\n keys = [key];\n }\n keys = keys.map(s => {\n return STYLE_KEY[style2Upper(s)];\n });\n }\n else {\n keys = Object.keys(computedStyle);\n }\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n res[k] = computedStyle[k];\n }\n else {\n res[STYLE_RV_KEY[k]] = computedStyle[k];\n }\n });\n return res;\n }\n\n getBoundingClientRect(includeBbox) {\n let box = [];\n if(includeBbox) {\n box = this.bbox;\n }\n else {\n let { __sx1, __sy1, offsetWidth, offsetHeight } = this;\n box = [__sx1, __sy1, __sx1 + offsetWidth, __sy1 + offsetHeight];\n }\n let matrixEvent = this.matrixEvent;\n let p1 = point2d(mx.calPoint([box[0], box[1]], matrixEvent));\n let p2 = point2d(mx.calPoint([box[2], box[1]], matrixEvent));\n let p3 = point2d(mx.calPoint([box[2], box[3]], matrixEvent));\n let p4 = point2d(mx.calPoint([box[0], box[3]], matrixEvent));\n return {\n left: Math.min(p1[0], Math.min(p2[0], Math.min(p3[0], p4[0]))),\n top: Math.min(p1[1], Math.min(p2[1], Math.min(p3[1], p4[1]))),\n right: Math.max(p1[0], Math.max(p2[0], Math.max(p3[0], p4[0]))),\n bottom: Math.max(p1[1], Math.max(p2[1], Math.max(p3[1], p4[1]))),\n points: [p1, p2, p3, p4],\n };\n }\n\n // img和geom返回false,在inline布局时判断是否是真的inline\n __isRealInline() {\n return true;\n }\n\n remove(cb) {\n let self = this;\n if(self.isDestroyed) {\n inject.warn('Remove target is destroyed.');\n if(isFunction(cb)) {\n cb();\n }\n return;\n }\n let { root, domParent } = self;\n let target = self.isShadowRoot ? self.hostRoot : self;\n // 特殊情况连续append/remove时候,还未被添加进来找不到所以无需删除\n if(domParent.children.indexOf(target) === -1) {\n if(isFunction(cb)) {\n cb();\n }\n return;\n }\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n let pJson = domParent.__json;\n let i = pJson.children.indexOf(self.isShadowRoot ? self.hostRoot.__json : self.__json);\n let zChildren = domParent.zIndexChildren;\n let j = zChildren.indexOf(self.isShadowRoot ? self.hostRoot : self);\n if(i === -1 || j === -1) {\n throw new Error('Remove index Exception.')\n }\n pJson.children.splice(i, 1);\n domParent.children.splice(i, 1);\n zChildren.splice(j, 1);\n if(self.__prev) {\n self.__prev.__next = self.__next;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = REFLOW;\n res[UPDATE_REMOVE_DOM] = true;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after(diff) {\n self.isShadowRoot ? self.hostRoot.__destroy() : self.__destroy();\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get sx() {\n return this.__sx;\n }\n\n get sy() {\n return this.__sy;\n }\n\n get clientWidth() {\n return this.__clientWidth || 0;\n }\n\n get clientHeight() {\n return this.__clientHeight || 0;\n }\n\n get offsetWidth() {\n return this.__offsetWidth || 0;\n }\n\n get offsetHeight() {\n return this.__offsetHeight || 0;\n }\n\n get outerWidth() {\n return this.__outerWidth || 0;\n }\n\n get outerHeight() {\n return this.__outerHeight || 0;\n }\n\n // 不考虑margin的范围,>=REPAINT渲染或个别有影响的渲染改变(如blur)清空缓存\n get bbox() {\n if(!this.__bbox) {\n let {\n __sx1, __sy1, offsetWidth, offsetHeight,\n currentStyle: {\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n },\n } = this;\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n this.__bbox = [__sx1 + x1, __sy1 + y1, __sx1 + offsetWidth + x2, __sy1 + offsetHeight + y2];\n }\n return this.__bbox;\n }\n\n get listener() {\n return this.__listener;\n }\n\n get matrix() {\n return this.__config[NODE_MATRIX];\n }\n\n get matrixEvent() {\n return this.__config[NODE_MATRIX_EVENT];\n }\n\n get perspectiveMatrix() {\n return this.__config[NODE_PERSPECTIVE_MATRIX];\n }\n\n get style() {\n return this.__style;\n }\n\n get computedStyle() {\n return this.__computedStyle;\n }\n\n get animationList() {\n return this.__animationList;\n }\n\n get currentStyle() {\n return this.__currentStyle;\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get contentBoxList() {\n return this.__contentBoxList;\n }\n\n get baseline() {\n return this.offsetHeight;\n }\n\n get firstBaseline() {\n return this.offsetHeight;\n }\n\n get isMask() {\n return this.__isMask;\n }\n\n get isClip() {\n return this.__isClip;\n }\n\n get cacheAsBitmap() {\n return this.__cacheAsBitmap;\n }\n\n set cacheAsBitmap(v) {\n this.__config[NODE_CACHE_AS_BITMAP] = this.__cacheAsBitmap = !!v;\n }\n}\n\nexport default Xom;\n","import enums from '../util/enums';\nimport TextBox from './TextBox';\n\nconst { STYLE_KEY: {\n DISPLAY,\n MARGIN_LEFT,\n BORDER_LEFT_WIDTH,\n PADDING_LEFT,\n PADDING_RIGHT,\n BORDER_RIGHT_WIDTH,\n MARGIN_RIGHT,\n} } = enums;\n\n/**\n * css中常见的概念,一行内容,里面可能有若干不同的内容,仅在布局阶段出现,不参与渲染逻辑\n * 本类是个抽象逻辑概念,会包含Text的内容TextBox和inlineBlock等节点,而内容TextBox则属于Text\n * 一个Text可能因为换行产生多个TextBox,从而形成不同行的内容就属于不同的LineBox\n * 本类属于block(包含flex和inlineBlock,下同)节点下,一个dom会有个专门列表,\n * 包含若干个LineBox保存着若干行文本内容TextBox,不直接关联Text,\n * inline则不会有此对象和列表,其复用最近block父层的,这样解决嵌套问题,\n * block在布局时将列表向孩子传递下去,每遇到block会重新生成\n * 每当发生换行时,专门列表中会新生成一个LineBox,让后续内容继续跟随新的LB\n * LB内部要进行垂直对齐,Text内容较简单x字符底部为baseline,inlineBlock等节点按最后一行baseline\n */\nclass LineBox {\n constructor(x, y, lineHeight, baseline) {\n this.__list = [];\n this.__x = x;\n this.__y = y;\n this.__lineHeight = lineHeight; // 可能出现空的inline,因此一个inline进入布局时先设置当前lineBox的最小lineHeight/baseline\n this.__baseline = baseline;\n }\n\n add(item) {\n this.list.push(item);\n item.__parentLineBox = this;\n }\n\n verticalAlign() {\n let baseline = this.baseline;\n let lineHeight = this.lineHeight;\n let increasedHeight = lineHeight;\n let hasReplaced;\n // 只有1个也需要对齐,因为可能内嵌了空inline使得baseline发生变化\n if(this.list.length) {\n this.list.forEach(item => {\n if(item.isReplaced) {\n hasReplaced = true;\n }\n let n = item.baseline;\n if(n !== baseline) {\n let d = baseline - n;\n item.__offsetY(d);\n // text的话对齐下移可能影响整体高度,在同行有img这样的替换元素下,需记录最大偏移导致的高度\n // 比如一个字符和img,字符下调y即字符的baseline和图片底部对齐,导致高度增加lineHeight和baseline的差值\n if(d > 0) {\n increasedHeight = Math.max(increasedHeight, item.height + d);\n }\n }\n });\n }\n let diff = 0;\n // 特殊情况,只有1个img这样的替换元素时,或者只有img没有直接text时,也要进行检查,\n // 因为此时img要参与这一行和baseline的对齐扩充\n if(hasReplaced) {\n diff = this.__lineHeight - this.__baseline;\n }\n // 增加过的高度比最大还大时需要调整\n if(increasedHeight > lineHeight) {\n diff = Math.max(increasedHeight - lineHeight);\n }\n return diff;\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff, isVerticalAlign) {\n this.__y += diff;\n // vertical-align情况特殊对齐,可能替换元素img和text导致偏移,需触发整体和text偏移\n if(isVerticalAlign) {\n this.list.forEach(item => {\n // 是text的第一个的box的话,text也需要偏移\n if (item instanceof TextBox) {\n let text = item.parent;\n if (text.textBoxes[0] === item) {\n text.__offsetY(diff);\n }\n } else {\n item.__offsetY(diff);\n }\n });\n }\n }\n\n /**\n * 防止非行首空inline,每当遇到inline就设置当前lineBox的lineHeight/baseline,这样有最小值兜底\n * @param l\n * @param b\n * @private\n */\n __setLB(l, b) {\n this.__lineHeight = Math.max(l, this.__lineHeight);\n this.__baseline = Math.max(b, this.__baseline);\n }\n\n get list() {\n return this.__list;\n }\n\n get size() {\n return this.__list.length;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endY() {\n return this.y + this.height;\n }\n\n get width() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let first = list[0];\n let last = list[length - 1];\n let x1 = first.x;\n let dom = first instanceof TextBox ? first.parent.domParent : first.domParent;\n // 因为inline可以嵌套inline,所以一直向上查找到非inline为止,每层inline如果是首个则减去左侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [PADDING_LEFT]: paddingLeft,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[0]) {\n x1 -= marginLeft + borderLeftWidth + paddingLeft;\n }\n dom = dom.domParent;\n }\n let x2 = last.x + last.outerWidth;\n dom = last instanceof TextBox ? last.parent.domParent : last.domParent;\n // 同向上查非inline,每层inline如果是最后一个则加上右侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_RIGHT]: paddingRight,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[list.length - 1]) {\n x2 += marginRight + borderRightWidth + paddingRight;\n }\n dom = dom.domParent;\n }\n return x2 - x1;\n }\n return 0;\n }\n\n get height() {\n return this.lineHeight;\n }\n\n get baseline() {\n let baseline = this.__baseline;\n // 只有TextBox和InlineBlock或replaced\n this.list.forEach(item => {\n baseline = Math.max(baseline, item.baseline);\n });\n return baseline;\n }\n\n get lineHeight() {\n let lineHeight = this.__lineHeight;\n // 只有TextBox和InlineBlock或replaced\n this.list.forEach(item => {\n lineHeight = Math.max(lineHeight, item.outerHeight);\n });\n return lineHeight;\n }\n}\n\nexport default LineBox;\n","import LineBox from './LineBox';\n\n/**\n * 维护一个上下文的LineBox,向LineBox中添加Item以及新增下一行的LineBox,多个LineBox组成一个区域\n * 一个block/inlineBlock拥有一个本类对象,上下文即对应这个dom流,而inline则复用最近非inline父元素的\n * 同时LineBox可能连续也可能不连续,不连续的是中间有block之类的隔离开来\n */\nclass LineBoxManager {\n constructor(x, y, lineHeight, baseline) {\n this.__x = this.__lastX = x; // last存储目前最后一行LineBox的结尾位置,供后续inline使用\n this.__y = this.__lastY = y;\n this.__maxX = x;\n this.__domList = [];\n this.__domStack = [];\n this.__list = []; // 包含若干LineBox\n this.__isNewLine = true; // 区域内是否是新行,容器dom(block)开头肯定是\n this.__lineHeight = lineHeight;\n this.__baseline = baseline;\n this.__isEnd = true; // 在dom中是否一个区域处在结尾,外部控制\n this.__spreadYList = []; // verticalAlign时每个区域增加的y高度\n }\n\n /**\n * 每次换行时重新生成LineBox存入列表,同时由于flow流当前一定是流(dom)的结尾,设置isEnd\n * @returns {LineBox}\n */\n genLineBox(x, y) {\n let lineBox = new LineBox(x, y, this.__lineHeight, this.__baseline);\n this.list.push(lineBox);\n this.__isEnd = true;\n return lineBox;\n }\n\n /**\n * inline的特殊调用,防止空内容但有mbp的inline不占位,放入一个有lineHeight的空lineBox\n * 只有新行开头时需要,后面的无论是否有内容都会影响lineHeight\n * @param x\n * @param y\n * @param l\n * @param b\n * @returns {LineBox}\n */\n genLineBoxByInlineIfNewLine(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseline = Math.max(this.__baseline, b);\n if(this.__isNewLine) {\n let lineBox = new LineBox(x, y, lineHeight, baseline);\n this.list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n }\n\n setLbOrGenLineBoxByInline(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseline = Math.max(this.__baseline, b);\n let lineBox;\n let list = this.list;\n if(this.__isNewLine) {\n lineBox = new LineBox(x, y, lineHeight, baseline);\n list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n else {\n let length = list.length;\n lineBox = list[length - 1];\n lineBox.__setLB(l, b);\n }\n }\n\n /**\n * 外部设置为结尾,如一个LineBox后出现一个block,此时会被隔断,不再作为流的末尾\n */\n setNotEnd() {\n this.__isEnd = false;\n }\n\n /**\n * 外部设置新行,下次新生成LineBox\n */\n setNewLine() {\n this.__isNewLine = true;\n }\n\n /**\n * 当前LineBox放入一个新项,当新行时(如第一行)产生一个新的LineBox并存入列表\n * 是否新区域和新行都是可以被外部控制,默认第一行是新\n * 当被隔断后会被外部重置新行,这样会生成新的来作为新加项的LineBox\n * 当换行时外部也会调用新行,这样再次添加Item时会自动生成新的LineBox而不是用之前的\n * @param o TextBox/Inline/InlineBlock\n * @param nextNewLine 是否设置newLine,标明下次添加新生成LineBox\n * @returns {LineBox}\n */\n addItem(o, nextNewLine) {\n let lineBox;\n if(this.__isNewLine) {\n this.__isNewLine = false;\n lineBox = this.genLineBox(o.x, o.y);\n }\n else {\n let list = this.list;\n let length = list.length;\n lineBox = list[length - 1];\n }\n // inline递归过程中所有inline父子顺序列表,每个dom都需要对当前内容保存\n this.__domStack.forEach(item => {\n item.__contentBoxList.push(o);\n });\n lineBox.add(o);\n // 设置结束x的位置给next的inline标记用,o可能是TextBox或inlineBlock,当next新行时注意位置\n if(nextNewLine) {\n this.__isNewLine = true;\n this.__lastX = o.x;\n this.__lastY = o.y + o.outerHeight;\n }\n else {\n this.__lastX = o.x + o.outerWidth;\n this.__lastY = o.y;\n }\n this.__maxX = Math.max(this.__maxX, o.x + o.outerWidth);\n return lineBox;\n }\n\n horizonAlign(w, textAlign) {\n this.list.forEach(lineBox => {\n let diff = w - lineBox.width;\n if(diff > 0) {\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n lineBox.__offsetX(diff);\n lineBox.list.forEach(item => {\n item.__offsetX(diff, true);\n });\n }\n });\n }\n\n /**\n * 垂直对齐过程中,如果遇到占位元素如img,可能会导致每行lineBox高度增加,需返回增加量,\n * next行也需要y偏移\n * @returns {number}\n */\n verticalAlign() {\n let syl = this.__spreadYList;\n syl.splice(0);\n let spread = 0;\n this.list.forEach(lineBox => {\n if(spread) {\n lineBox.__offsetY(spread, true);\n }\n spread += lineBox.verticalAlign();\n syl.push(spread);\n });\n return spread;\n }\n\n addX(n) {\n this.__lastX += n;\n }\n\n /**\n * inline递归过程中布局调用,不断出入栈dom对象,获取当前行状态下有哪些dom还在\n * @param dom\n */\n pushContentBoxList(dom) {\n this.__domList.push(dom);\n this.__domStack.push(dom);\n }\n\n popContentBoxList() {\n this.__domStack.pop();\n }\n\n __offsetX(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetX(diff);\n });\n }\n\n __offsetY(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetY(diff);\n });\n }\n\n /**\n * inline的特殊调用,非行首无论是否有内容都设置lineBox的lineHeight\n * @param l\n * @param b\n * @private\n */\n setLbByInlineIfNotNewLine(l, b) {\n let length = this.list.length;\n if(length && !this.isNewLine) {\n this.list[length - 1].__setLB(l, b);\n }\n }\n\n get size() {\n return this.list.length;\n }\n\n get lastX() {\n return this.__lastX;\n }\n\n get lastY() {\n return this.__lastY;\n }\n\n get endY() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[length - 1].endY;\n }\n return this.__y;\n }\n\n get isEnd() {\n return this.__isEnd;\n }\n\n get isNewLine() {\n return this.__isNewLine;\n }\n\n get breakLine() {\n return this.list.length > 1;\n }\n\n get domList() {\n return this.__domList;\n }\n\n get baseline() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let n = 0;\n for(let i = 0; i < length - 1; i++) {\n n += list[i].height;\n }\n return n + list[length - 1].baseline;\n }\n return 0;\n }\n\n get firstBaseline() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[0].baseline;\n }\n return 0;\n }\n\n get lineHeight() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1].lineHeight;\n }\n return 0;\n }\n\n get lineBox() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1];\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get width() {\n let w = 0;\n this.list.forEach(item => {\n w = Math.max(w, item.width);\n });\n return w;\n }\n\n get spreadYList() {\n return this.__spreadYList;\n }\n}\n\nexport default LineBoxManager;\n","const TAG_NAME = {\n 'div': true,\n 'p': true,\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst INLINE = {\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst BOLD = {\n 'b': true,\n 'strong': true,\n}\n\nexport default {\n TAG_NAME,\n INLINE,\n BOLD,\n};\n","import enums from '../util/enums';\nimport unit from '../style/unit';\nimport level from './level';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n TOP,\n BOTTOM,\n POSITION,\n HEIGHT,\n },\n} = enums;\nconst { AUTO, PX, PERCENT } = unit;\nconst { REFLOW } = level;\n\nfunction offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) {\n if(dy) {\n let last;\n do {\n // component的sr没有next兄弟,视为component的next\n while(node.isShadowRoot) {\n node = node.host;\n }\n last = node;\n let isContainer, parent = node.domParent;\n if(parent) {\n let cs = parent.computedStyle;\n let ps = cs[POSITION];\n isContainer = parent === root || parent.isShadowRoot || ps === 'relative' || ps === 'absolute';\n }\n // 先偏移next,忽略有定位的absolute,本身非container也忽略\n let next = node.next;\n let container;\n while(next) {\n if(next.computedStyle[DISPLAY] !== 'none') {\n if(next.currentStyle[POSITION] === 'absolute') {\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = next.currentStyle;\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO || bottom[1] === PX) {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n }\n else if(top[1] === PERCENT) {\n let v = top[0] * 0.01 * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, 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 '../refresh/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, VMAX, VMIN } = 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 if(width[1] === VMAX) {\n w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n for(let i = 0; i < flowChildren.length; i++) {\n // 当放不下时直接返回,无需继续多余的尝试计算\n if(w < 0) {\n return w;\n }\n let item = flowChildren[i];\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Xom) {\n w = item.__tryLayInline(w, total);\n }\n // text强制一行,否则非头就是放不下,需从头开始\n else {\n w -= item.textWidth;\n }\n }\n }\n // ib要减去末尾mpb\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n else if(marginRight[1] === VMAX) {\n w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginRight[1] === VMIN) {\n w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n else if(paddingRight[1] === VMAX) {\n w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingRight[1] === VMIN) {\n w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n else if(borderRightWidth[1] === VMAX) {\n w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderRightWidth[1] === VMIN) {\n w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // 还要减去开头的mpb\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n else if(marginLeft[1] === VMAX) {\n w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginLeft[1] === VMIN) {\n w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n else if(paddingLeft[1] === VMAX) {\n w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingLeft[1] === VMIN) {\n w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n else if(borderLeftWidth[1] === VMAX) {\n w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderLeftWidth[1] === VMIN) {\n w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return w;\n }\n\n // 设置y偏移值,递归包括children,此举在justify-content/margin-auto等对齐用\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n // 记得偏移LineBox\n if(isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) {\n this.lineBoxManager.__offsetX(diff);\n }\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetX(diff, isLayout, lv);\n }\n });\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n if(isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) {\n this.lineBoxManager.__offsetY(diff);\n }\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetY(diff, isLayout, lv);\n }\n });\n }\n\n // item的递归子节点求min/max,只考虑固定值单位,忽略百分比,同时按方向和display\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this);\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 [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let {\n [DISPLAY]: display,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n let length = flowChildren.length;\n let hasLayout;\n let columnCrossCount = 0, columnCrossMax = 0;\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 if(main[1] === VMAX) {\n min = max = main[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(main[1] === VMIN) {\n min = max = main[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n hasLayout = true;\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 computedStyle[DISPLAY] = 'block';\n }\n let [[min2, max2], [columnCrossMax2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n columnCrossMax += columnCrossMax2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n columnCrossMax += columnCrossMax2;\n }\n else {\n min += min2;\n max += max2;\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n columnCrossMax += item.width;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n columnCrossMax = Math.max(columnCrossMax, item.width);\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 columnCrossMax += item.width;\n }\n else {\n min += item.height;\n max += item.height;\n columnCrossMax = Math.max(columnCrossMax, item.width);\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 flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [[min2, max2], [columnCrossMax2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n let display = item.currentStyle[DISPLAY];\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n // row看块级最大尺寸和连续行级最大尺寸的宽\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n countMin = countMax = columnCrossCount = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n columnCrossCount += columnCrossMax2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n columnCrossMax = Math.max(columnCrossMax, columnCrossCount);\n }\n }\n // column看块级高度和连续行级最大尺寸高度的和\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n columnCrossMax += columnCrossCount;\n countMin = countMax = columnCrossCount = 0;\n // 本身的\n min += min2;\n max += max2;\n columnCrossMax += columnCrossMax2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n columnCrossCount = Math.max(columnCrossCount, columnCrossMax2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n columnCrossMax += columnCrossCount;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n columnCrossCount += item.width;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n columnCrossMax = Math.max(columnCrossMax, columnCrossCount);\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 columnCrossCount = Math.max(columnCrossCount, item.width);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n columnCrossMax += columnCrossCount;\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], [columnCrossMax2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n if(isDirectionRow) {\n min += min2;\n max += max2;\n columnCrossMax += columnCrossMax2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n }\n }\n else if(isDirectionRow) {\n min += item.charWidth;\n max += item.textWidth;\n columnCrossMax += item.width;\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 columnCrossMax = Math.max(columnCrossMax, item.width);\n }\n });\n }\n }\n // column且isContent需要计算合适的最大宽度返回,上面有可能计算过了\n if(!isDirectionRow) {\n if(width[1] !== AUTO) {\n if(width[1] === PX) {\n columnCrossMax = width[0];\n }\n else if(width[1] === PERCENT) {\n columnCrossMax = width[0] * 0.01 * w;\n }\n else if(width[1] === REM) {\n columnCrossMax = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n columnCrossMax = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n columnCrossMax = width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n columnCrossMax = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n columnCrossMax = width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n else if(!hasLayout) {\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 computedStyle[DISPLAY] = 'block';\n }\n let [, [columnCrossMax2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n columnCrossMax += columnCrossMax2;\n }\n else {\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n }\n }\n else {\n if(isRow) {\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n }\n else {\n columnCrossMax += columnCrossMax2;\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n columnCrossMax += item.width;\n }\n else {\n columnCrossMax = Math.max(columnCrossMax, item.width);\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 columnCrossMax = Math.max(columnCrossMax, item.width);\n }\n else {\n columnCrossMax += item.width;\n }\n }\n });\n }\n else if(display === 'block') {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseline(computedStyle));\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [, [columnCrossMax2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n let display = item.currentStyle[DISPLAY];\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n // row看块级最大尺寸和连续行级最大尺寸的宽\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n columnCrossCount = 0;\n }\n else {\n columnCrossCount += columnCrossMax2;\n columnCrossMax = Math.max(columnCrossMax, columnCrossCount);\n }\n }\n // column看块级高度和连续行级最大尺寸高度的和\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n columnCrossMax += columnCrossCount;\n columnCrossCount = 0;\n // 本身的\n columnCrossMax += columnCrossMax2;\n }\n else {\n // 行内取极值,最后一个记得应用\n columnCrossCount = Math.max(columnCrossCount, columnCrossMax2);\n if(i === length - 1) {\n columnCrossMax += columnCrossCount;\n }\n }\n }\n }\n else if(isDirectionRow) {\n columnCrossCount += item.width;\n columnCrossMax = Math.max(columnCrossMax, columnCrossCount);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n columnCrossCount = Math.max(columnCrossCount, item.width);\n if(i === length - 1) {\n columnCrossMax += columnCrossCount;\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 [, [columnCrossMax2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n if(isDirectionRow) {\n columnCrossMax += columnCrossMax2;\n }\n else {\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n }\n }\n else if(isDirectionRow) {\n columnCrossMax += item.width;\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n columnCrossMax = Math.max(columnCrossMax, item.width);\n }\n });\n }\n }\n }\n return this.__addMBP(isDirectionRow, w, currentStyle, [min, max], [columnCrossMax]);\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 * 当为column方向时,还需返回每个节点的cross即宽度,真实布局传入,除非stretch模式按100%宽度\n * @param isDirectionRow\n * @param data\n * @private\n */\n __calBasis(isDirectionRow, data) {\n css.computeReflow(this);\n let b = 0;\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n [FLEX_BASIS]: flexBasis,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n [DISPLAY]: display,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content\n let isAuto = flexBasis[1] === AUTO;\n let isFixed = [PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(flexBasis[1]) > -1;\n let isContent = !isAuto && !isFixed;\n let fixedSize;\n // flex的item固定basis计算\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = fixedSize = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = fixedSize = (isDirectionRow ? w : h) * flexBasis[0] * 0.01;\n }\n else if(flexBasis[1] === REM) {\n b = fixedSize = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = fixedSize = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = fixedSize = flexBasis[0] * this.root.height * 0.01;\n }\n else if(flexBasis[1] === VMAX) {\n b = fixedSize = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(flexBasis[1] === VMIN) {\n b = fixedSize = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // 已声明主轴尺寸的,当basis是auto时为值\n else if(([PX, PERCENT, REM, VW, VH, VMAX, VMIN].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 else if(main[1] === VMAX) {\n b = fixedSize = main[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(main[1] === VMIN) {\n b = fixedSize = main[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // 非固定尺寸的basis为auto时降级为content\n else if(isAuto) {\n isContent = true;\n }\n let countMin = 0, countMax = 0;\n let columnCrossCount = 0, columnCrossMax = 0;\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 computedStyle[DISPLAY] = 'block';\n }\n let [[min2, max2], [columnCrossMax2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n columnCrossMax += columnCrossMax2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n columnCrossMax += columnCrossMax2;\n }\n else {\n min += min2;\n max += max2;\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n columnCrossMax += item.width;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n columnCrossMax = Math.max(columnCrossMax, item.width);\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 columnCrossMax += item.width;\n }\n else {\n min += item.height;\n max += item.height;\n columnCrossMax = Math.max(columnCrossMax, item.width);\n }\n }\n });\n }\n // flex的item是block/inline时,inline也会变成block统一对待\n else {\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseline(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [[min2, max2], [columnCrossMax2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n let display = item.currentStyle[DISPLAY];\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n // row看块级最大尺寸和连续行级最大尺寸的宽\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n columnCrossMax = Math.max(columnCrossMax, columnCrossMax2);\n countMin = countMax = columnCrossCount = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n columnCrossCount += columnCrossMax2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n columnCrossMax = Math.max(columnCrossMax, columnCrossCount);\n }\n }\n // column看块级高度和连续行级最大尺寸高度的和\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n columnCrossMax += columnCrossCount;\n countMin = countMax = columnCrossCount = 0;\n // 本身的\n min += min2;\n max += max2;\n columnCrossMax += columnCrossMax2;\n }\n else {\n // 行内取极值,最后一个记得应用因为后面没有循环去累加了\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n columnCrossCount = Math.max(columnCrossCount, columnCrossMax2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n columnCrossMax += columnCrossCount;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n columnCrossCount += item.width;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n columnCrossMax = Math.max(columnCrossMax, columnCrossCount);\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 columnCrossCount = Math.max(columnCrossCount, item.width);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n columnCrossMax += columnCrossCount;\n }\n }\n });\n }\n if(fixedSize) {\n max = Math.max(fixedSize, max);\n }\n if(isContent) {\n b = max;\n }\n if(!isDirectionRow && width[1] !== AUTO) {\n if(width[1] === PX) {\n columnCrossMax = width[0];\n }\n else if(width[1] === PERCENT) {\n columnCrossMax = width[0] * 0.01 * w;\n }\n else if(width[1] === REM) {\n columnCrossMax = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n columnCrossMax = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n columnCrossMax = width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n columnCrossMax = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n columnCrossMax = width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // 直接item的mpb影响basis\n return this.__addMBP(isDirectionRow, w, currentStyle, [b, min, max], [columnCrossMax], 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 isReplaced = item.isReplaced;\n // 每次循环开始前,这次不是block的话,看之前遗留待合并margin,并重置\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n if(isXom) {\n // inline和inlineBlock的细节不同之处,ib除了w/h之外,更想像block一样占据一行\n // 比如2个inline前面占一半后面比一半多但还是会从一半开始然后第2行换行继续,但ib放不下则重开一行\n // inline和ib能互相嵌套,形成的LineBox中则是TextBox和节点混合\n if(isInlineBlock || isInline) {\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || isInline && whiteSpace === 'nowrap') {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager, // ib内部新生成会内部判断,这里不管统一传入\n lineClamp,\n lineClampCount,\n }, 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 || isReplaced) && 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 || isReplaced) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, 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 || isReplaced) && 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.computedStyle[DISPLAY] === 'none';\n // 自身无内容\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n y += item.outerHeight;\n lineBoxManager.__lastY = y;\n // absolute/flex前置虚拟计算\n if(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 // 不管是否虚拟,都需要垂直对齐,因为img这种占位元素会影响lineBox高度\n let spread = lineBoxManager.verticalAlign();\n if(spread) {\n if(!fixedHeight) {\n this.__resizeY(spread);\n }\n /**\n * parent以及parent的next无需处理,因为深度遍历后面还会进行,\n * 但自己的block需处理,因为对齐只处理了inline元素,忽略了block,\n * 同时由于block和inline区域可能不连续,每个增加的y不一样,\n * 需要按照每个不同区域来判断,区域是按索引次序依次增大的\n */\n let count = 0, syl = lineBoxManager.spreadYList;\n let isLastBlock = false;\n flowChildren.forEach(item => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isBlock = isXom && item.computedStyle[DISPLAY] === 'block';\n if(isBlock) {\n isLastBlock = true;\n item.__offsetY(syl[count], true);\n }\n else {\n if(isLastBlock) {\n count++;\n }\n isLastBlock = false;\n }\n });\n }\n // 非abs提前的虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐\n if(!isVirtual) {\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 columnCrossList = []; // column时特殊求每个子节点的宽度,布局时传入,不能按stretch拉满\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 computedStyle[DISPLAY] = 'block';\n }\n // abs虚拟布局计算时纵向也是看横向宽度\n let [[b, min, max], [columnCross]] = item.__calBasis(isVirtual ? true : isDirectionRow, { x, y, w, h });\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 columnCrossList.push(columnCross);\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 columnCrossList.push(item.width);\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 hh = item.height;\n basisList.push(hh);\n maxList.push(hh);\n minList.push(hh);\n columnCrossList.push(item.width);\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,\n orderChildren.slice(offset, end), item, textAlign,\n growList.slice(offset, end), shrinkList.slice(offset, end), basisList.slice(offset, end),\n hypotheticalList.slice(offset, end), minList.slice(offset, end), columnCrossList.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,\n orderChildren, flexLine, textAlign,\n growList, shrinkList, basisList, hypotheticalList, minList, columnCrossList) {\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 // 特殊的地方,column子元素的宽度限制为非stretch时,否则还是满宽\n let alignSelf = item.currentStyle[ALIGN_SELF];\n let w3;\n if(alignItems === 'stretch') {\n if(alignSelf !== 'auto' && alignSelf !== 'stretch') {\n w3 = columnCrossList[i];\n }\n }\n else {\n if(alignSelf !== 'stretch') {\n w3 = columnCrossList[i];\n }\n }\n item.__layout({\n x,\n y,\n w,\n w3,\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 : columnCrossList[i],\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,匿名块对象特殊处理,此时没有computedStyle\n item.__mp(currentStyle, computedStyle, clientWidth);\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n computedStyle[DISPLAY] = 'block';\n }\n else {\n computedStyle[DISPLAY] = currentStyle[DISPLAY];\n }\n let { [LEFT]: left, [TOP]: top, [RIGHT]: right,\n [BOTTOM]: bottom, [WIDTH]: width, [HEIGHT]: height,\n [FLEX_DIRECTION]: flexDirection } = currentStyle;\n let display = computedStyle[DISPLAY];\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 if(width[1] === VMAX) {\n w2 = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w2 = width[0] * Math.min(this.root.width, 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 if(width[1] === VMAX) {\n w2 = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w2 = width[0] * Math.min(this.root.width, 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 if(width[1] === VMAX) {\n w2 = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w2 = width[0] * Math.min(this.root.width, 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 if(height[1] === VMAX) {\n h2 = height[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(height[1] === VMIN) {\n h2 = height[0] * Math.min(this.root.width, 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 if(height[1] === VMAX) {\n h2 = height[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(height[1] === VMIN) {\n h2 = height[0] * Math.min(this.root.width, 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] === VMAX) {\n h2 = height[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(height[1] === VMIN) {\n h2 = height[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n // 特殊必须声明防止AUTO\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, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(renderMode === mode.SVG) {\n this.virtualDom.type = 'dom';\n }\n return res;\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.children.forEach(child => {\n // 有可能为空,因为diff过程中相同的cp被移到新的vd中,老的防止destroy设null\n if(child) {\n child.__destroy();\n }\n });\n super.__destroy();\n }\n\n __emitEvent(e, force) {\n if(force) {\n return super.__emitEvent(e, force);\n }\n let { isDestroyed, computedStyle, isMask } = this;\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || e.__stopPropagation || isMask) {\n return;\n }\n // 检查perspective嵌套状态,自身有perspective则设置10位,自身有transform的p矩阵则设置01位\n // if(computedStyle[PERSPECTIVE]) {\n // perspectiveNest++;\n // }\n // if(tf.isPerspectiveMatrix(computedStyle[TRANSFORM])) {\n // perspectiveTfNest++;\n // }\n // overflow:hidden时还需要判断是否超出范围外,如果是则无效\n if(computedStyle[OVERFLOW] === 'hidden' && !this.willResponseEvent(e, true)) {\n return;\n }\n // 找到对应的callback\n let { event: { type } } = e;\n let { listener, zIndexChildren } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // child触发则parent一定触发\n for(let i = zIndexChildren.length - 1; i >=0; i--) {\n let child = zIndexChildren[i];\n if(child instanceof Xom\n || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.__emitEvent(e)) {\n // 孩子阻止冒泡\n if(e.__stopPropagation) {\n return;\n }\n if(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 '../refresh/mode';\nimport painter from '../util/painter';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport enums from '../util/enums';\nimport unit from '../style/unit';\nimport image from '../style/image';\nimport border from '../style/border';\nimport level from '../refresh/level';\nimport mx from '../math/matrix';\nimport geom from '../math/geom';\nimport css from '../style/css';\n\nconst {\n STYLE_KEY: {\n WIDTH,\n HEIGHT,\n DISPLAY,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n VISIBILITY,\n BACKGROUND_IMAGE,\n BACKGROUND_COLOR,\n BOX_SHADOW,\n MIX_BLEND_MODE,\n MARGIN_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, VMAX, VMIN, 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, dx = 0, dy = 0) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(renderMode === mode.WEBGL) {\n dx = res.dx;\n dy = res.dy;\n }\n let {\n offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow,\n } = res;\n let {\n width, height, isDestroyed,\n props: {\n placeholder,\n },\n computedStyle,\n computedStyle: {\n [DISPLAY]: display,\n [BORDER_TOP_LEFT_RADIUS]: borderTopLeftRadius,\n [BORDER_TOP_RIGHT_RADIUS]: borderTopRightRadius,\n [BORDER_BOTTOM_RIGHT_RADIUS]: borderBottomRightRadius,\n [BORDER_BOTTOM_LEFT_RADIUS]: borderBottomLeftRadius,\n [VISIBILITY]: visibility,\n },\n virtualDom,\n __config,\n __loadImg: loadImg,\n root,\n } = this;\n if(offscreenBlend) {\n ctx = offscreenBlend.target.ctx;\n }\n if(offscreenMask) {\n ctx = offscreenMask.target.ctx;\n }\n if(offscreenFilter) {\n ctx = offscreenFilter.target.ctx;\n }\n if(offscreenOverflow) {\n ctx = offscreenOverflow.target.ctx;\n }\n // 没source且不error时加载图片\n if(!loadImg.source && !loadImg.error && !loadImg.loading) {\n this.__loadAndRefresh(loadImg, root, ctx, placeholder, computedStyle, width, height);\n }\n if(isDestroyed || display === 'none' || visibility === 'hidden') {\n return res;\n }\n let __cache = __config[NODE_CACHE];\n if(cache && __cache && __cache.enabled) {\n ctx = __cache.ctx;\n }\n let originX, originY;\n originX = res.x3 + dx;\n originY = res.y3 + dy;\n // 根据配置以及占位图显示error\n let source = loadImg.source;\n if(loadImg.error && !placeholder && Img.showError) {\n let strokeWidth = Math.min(width, height) * 0.02;\n let stroke = '#CCC';\n let fill = '#DDD';\n let cx = originX + width * 0.7;\n let cy = originY + height * 0.3;\n let r = strokeWidth * 5;\n let pts = [\n [originX + width * 0.15, originY + height * 0.7],\n [originX + width * 0.3, originY + height * 0.4],\n [originX + width * 0.5, originY + height * 0.6],\n [originX + width * 0.6, originY + height * 0.5],\n [originX + width * 0.9, originY + height * 0.8],\n [originX + width * 0.15, originY + height * 0.8]\n ];\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.fillStyle = fill;\n ctx.beginPath();\n ctx.moveTo(originX, originY);\n ctx.lineTo(originX + width, originY);\n ctx.lineTo(originX + width, originY + height);\n ctx.lineTo(originX, originY + height);\n ctx.lineTo(originX, originY);\n ctx.stroke();\n ctx.closePath();\n ctx.beginPath();\n let points = geom.ellipsePoints(cx, cy, r, r);\n painter.canvasPolygon(ctx, points, 0, 0);\n ctx.fill();\n ctx.closePath();\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for(let i = 1, len = pts.length; i < len; i++) {\n let point = pts[i];\n ctx.lineTo(point[0], point[1]);\n }\n ctx.lineTo(pts[0][0], pts[0][1]);\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n this.__addGeom('rect', [\n ['x', originX],\n ['y', originY],\n ['width', width],\n ['height', height],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ['fill', 'rgba(0,0,0,0)']\n ]);\n this.__addGeom('circle', [\n ['cx', cx],\n ['cy', cy],\n ['r', r],\n ['fill', fill],\n ]);\n let s = '';\n for(let i = 0, len = pts.length; i < len; i++) {\n let point = pts[i];\n if(i) {\n s += ' ';\n }\n s += point[0] + ',' + point[1];\n }\n this.__addGeom('polygon', [\n ['points', s],\n ['fill', fill]\n ]);\n }\n }\n else if(source) {\n // 圆角需要生成一个mask\n let list = border.calRadius(originX, originY, width, height,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n // 有border-radius需模拟遮罩裁剪\n if(list) {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list, dx, dy);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(source, originX, originY, width, height);\n ctx.restore();\n }\n else {\n ctx.drawImage(source, originX, originY, width, height);\n }\n }\n else if(renderMode === mode.SVG) {\n // img没有变化无需diff,直接用上次的vd\n if(loadImg.cache) {\n loadImg.cache.cache = true;\n virtualDom.children = [loadImg.cache];\n // 但是还是要校验是否有borderRadius变化,引发img的圆角遮罩\n if(!virtualDom.cache && list) {\n let d = svgPolygon(list);\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF'],\n ],\n }\n ],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.conClip = 'url(#' + id + ')';\n }\n return;\n }\n // 缩放图片,无需考虑原先矩阵,xom里对父层已经变换过了\n let matrix;\n if(width !== loadImg.width || height !== loadImg.height) {\n matrix = image.matrixResize(loadImg.width, loadImg.height, width, height, originX, originY, width, height);\n }\n let props = [\n ['xlink:href', loadImg.error ? placeholder : loadImg.src],\n ['x', originX],\n ['y', originY],\n ['width', loadImg.width],\n ['height', loadImg.height]\n ];\n if(list) {\n let d = svgPolygon(list);\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF']\n ],\n }\n ],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.conClip = 'url(#' + id + ')';\n delete virtualDom.cache;\n }\n if(matrix && !mx.isE(matrix)) {\n props.push(['transform', 'matrix(' + util.joinArr(mx.m2m6(matrix), ',') + ')']);\n }\n let vd = {\n type: 'img',\n tagName: 'image',\n props,\n };\n virtualDom.children = [vd];\n loadImg.cache = vd;\n }\n }\n return res;\n }\n\n // img没加载时,清空,这样Xom就认为没内容不生成cache,防止img先绘制cache再绘制主屏,重复\n __releaseWhenEmpty(__cache) {\n if(!this.__loadImg.error && !this.__loadImg.source) {\n return super.__releaseWhenEmpty(__cache);\n }\n }\n\n __isRealInline() {\n return false;\n }\n\n // overwrite\n __tryLayInline(w, total) {\n let { currentStyle: {\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n let loadImg = this.__loadImg;\n // 加载成功计算缩放后的宽度\n if(loadImg.source) {\n if(height[1] === PX) {\n w -= loadImg.width * height[0] / loadImg.height;\n }\n else if(height[1] === PERCENT) {\n w -= loadImg.width * height[0] * total * 0.01 / loadImg.height;\n }\n else if(height[1] === REM) {\n w -= loadImg.width * height[0] * this.root.computedStyle[FONT_SIZE] / loadImg.height;\n }\n else if(height[1] === VW) {\n w -= loadImg.width * height[0] * this.root.width * 0.01 / loadImg.height;\n }\n else if(height[1] === VH) {\n w -= loadImg.width * height[0] * this.root.height * 0.01 / loadImg.height;\n }\n else if(height[1] === VMAX) {\n w -= height[0] * Math.max(this.root.width, this.root.height) * 0.01 / loadImg.height;\n }\n else if(height[1] === VMIN) {\n w -= height[0] * Math.min(this.root.width, this.root.height) * 0.01 / loadImg.height;\n }\n else {\n w -= loadImg.width;\n }\n }\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n else if(marginLeft[1] === VMAX) {\n w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginLeft[1] === VMIN) {\n w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n else if(paddingLeft[1] === VMAX) {\n w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingLeft[1] === VMIN) {\n w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n else if(borderLeftWidth[1] === VMAX) {\n w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderLeftWidth[1] === VMIN) {\n w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n else if(marginRight[1] === VMAX) {\n w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginRight[1] === VMIN) {\n w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n else if(paddingRight[1] === VMAX) {\n w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingRight[1] === VMIN) {\n w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n else if(borderRightWidth[1] === VMAX) {\n w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderRightWidth[1] === VMIN) {\n w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return w;\n }\n\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this);\n return this.__calBasis(isDirectionRow, data);\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, VMAX, VMIN].indexOf(flexBasis[1]) > -1;\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = max = min = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = max = min = flexBasis[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(flexBasis[1] === REM) {\n b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = max = min = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = max = min = flexBasis[0] * this.root.height * 0.01;\n }\n else if(flexBasis[1] === VMAX) {\n b = max = min = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(flexBasis[1] === VMIN) {\n b = max = min = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n else if(([PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(main[1]) > -1)) {\n if(main[1] === PX) {\n b = max = min = main[0];\n }\n else if(main[1] === PERCENT) {\n b = max = min = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = max = min = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = max = min = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = max = min = main[0] * this.root.height * 0.01;\n }\n else if(main[1] === VMAX) {\n b = max = min = main[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(main[1] === VMIN) {\n b = max = min = main[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // auto和content固定尺寸比例计算\n else if(__loadImg.source || __loadImg.error) {\n let res = this.__preLayout(data);\n if(cross[1] !== AUTO) {\n if(cross[1] === PX) {\n cross = cross[0];\n }\n else if(cross[1] === PERCENT) {\n cross = cross[0] * 0.01 * (isDirectionRow ? h : w);\n }\n else if(cross[1] === REM) {\n cross = cross[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(cross[1] === VW) {\n cross = cross[0] * this.root.width * 0.01;\n }\n else if(cross[1] === VH) {\n cross = cross[0] * this.root.height * 0.01;\n }\n else if(cross[1] === VMAX) {\n cross = cross[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(cross[1] === VMIN) {\n cross = cross[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n let ratio = res.w / res.h;\n b = max = min = isDirectionRow ? cross * ratio : cross / ratio;\n }\n else {\n b = max = min = isDirectionRow ? res.w : res.h;\n }\n }\n // 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 let columnCrossMax = 0;\n if(width[1] === PX) {\n columnCrossMax = width[0];\n }\n else if(width[1] === PERCENT) {\n columnCrossMax = width[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(width[1] === REM) {\n columnCrossMax = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n columnCrossMax = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n columnCrossMax = width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n columnCrossMax = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n columnCrossMax = width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else if(__loadImg.source || __loadImg.error) {\n let res = this.__preLayout(data);\n columnCrossMax = res.w;\n }\n columnCrossMax += this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w)\n + borderLeftWidth[0] + borderRightWidth[0];\n return [[b, min, max], [columnCrossMax]];\n }\n\n __loadAndRefresh(loadImg, root, ctx, placeholder, computedStyle, width, height, cb) {\n let self = this;\n // 先清空之前可能的\n if(loadImg.source || loadImg.error) {\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n });\n loadImg.source = null;\n }\n loadImg.loading = true;\n // 再测量,可能瞬间完成替换掉上面的\n inject.measureImg(loadImg.src, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败走error绘制\n if(data.url === loadImg.src && !self.isDestroyed) {\n loadImg.cache && (loadImg.cache.cache = false);\n loadImg.loading = false;\n function reload() {\n let { currentStyle: { [WIDTH]: width, [HEIGHT]: height } } = self;\n root.delRefreshTask(self.__task);\n if(width[1] !== AUTO && height[1] !== AUTO) {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REPAINT;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n else {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n }\n if(data.success) {\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n }\n else if(placeholder) {\n inject.measureImg(placeholder, data => {\n if(data.success) {\n loadImg.error = true;\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n reload();\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n return;\n }\n else {\n loadImg.error = true;\n }\n // 可见状态进行刷新操作,visibility某些情况需要刷新,可能宽高未定义要重新布局\n if(computedStyle[DISPLAY] !== 'none') {\n reload();\n }\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n }\n\n updateSrc(v, cb) {\n let self = this;\n let loadImg = self.__loadImg;\n let root = this.root;\n // 相等或空且当前error直接返回\n if(v === loadImg.src || !v && loadImg.error) {\n if(isFunction(cb)) {\n cb(-1);\n }\n }\n else if(v) {\n loadImg.src = v;\n self.__loadAndRefresh(loadImg, root, root.ctx, self.props.placeholder, self.computedStyle, self.width, self.height, cb);\n }\n else {\n loadImg.src = v;\n loadImg.source = null;\n loadImg.error = true;\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, self.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb(diff);\n }\n },\n });\n }\n }\n\n appendChild() {\n inject.error('Img can not appendChild.');\n }\n\n get src() {\n return this.__loadImg.src;\n }\n\n get isReplaced() {\n return true;\n }\n\n static showError = true;\n}\n\nexport default Img;\n","class Defs {\n constructor(uuid) {\n this.id = uuid;\n this.count = 0;\n this.list = [];\n this.cacheHash = {}; // 每次svg渲染前重置,存储前次渲染不变的缓存id\n }\n add(data) {\n let uuid = this.count;\n let hash = this.cacheHash;\n while(hash.hasOwnProperty(uuid)) {\n uuid++;\n }\n this.count = uuid + 1;\n data.id = uuid;\n data.uuid = 'karas-defs-' + this.id + '-' + uuid;\n data.index = this.list.length;\n this.list.push(data);\n return data.uuid;\n }\n addCache(data) {\n data.index = this.list.length;\n this.list.push(data);\n this.cacheHash[data.id] = true;\n return data.uuid;\n }\n clear() {\n this.list = [];\n this.count = 0;\n this.cacheHash = {};\n }\n removeCache(data) {\n let list = this.list;\n let i = data.index;\n // 一般情况index即位置,但每次渲染过程中,可能会删掉一些,此时位置会往前,但index不变,因此遍历\n for(; i >= 0; i--) {\n if(list[i] === data) {\n list.splice(i, 1);\n return;\n }\n }\n }\n\n get value() {\n return this.list;\n }\n\n static getInstance(uuid) {\n return new Defs(uuid);\n }\n}\n\nexport default Defs;\n","import Xom from '../Xom';\nimport reset from '../../style/reset';\nimport css from '../../style/css';\nimport unit from '../../style/unit';\nimport enums from '../../util/enums';\nimport mode from '../../refresh/mode';\nimport util from '../../util/util';\nimport painter from '../../util/painter';\nimport transform from '../../style/transform';\nimport mx from '../../math/matrix';\nimport inject from '../../util/inject';\nimport gradient from '../../math/gradient';\n\nconst {\n STYLE_KEY: {\n 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 NODE_CACHE,\n }\n} = enums;\nconst { PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit;\nconst { int2rgba, isNil, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { WEBGL } = mode;\n\nconst REGISTER = {};\n\nclass Geom extends Xom {\n constructor(tagName, props) {\n super(tagName, props);\n this.__isMulti = !!this.props.multi;\n this.__style = css.normalize(this.style, reset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET));\n this.__currentStyle = util.extend({}, this.__style);\n this.__currentProps = util.clone(this.props);\n let config = this.__config;\n config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n config[NODE_CURRENT_PROPS] = this.__currentProps;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_STYLE] = this.__style;\n }\n\n __tryLayInline(w, total) {\n // 无children,直接以style的width为宽度,不定义则为0\n let { currentStyle: {\n [WIDTH]: width,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n else if(marginLeft[1] === VMAX) {\n w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginLeft[1] === VMIN) {\n w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n else if(paddingLeft[1] === VMAX) {\n w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingLeft[1] === VMIN) {\n w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n else if(borderLeftWidth[1] === VMAX) {\n w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderLeftWidth[1] === VMIN) {\n w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n else if(marginRight[1] === VMAX) {\n w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginRight[1] === VMIN) {\n w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n else if(paddingRight[1] === VMAX) {\n w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingRight[1] === VMIN) {\n w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n else if(borderRightWidth[1] === VMAX) {\n w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderRightWidth[1] === VMIN) {\n w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return w;\n }\n\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this);\n return this.__calBasis(isDirectionRow, data);\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, VMAX, VMIN].indexOf(flexBasis[1]) > -1;\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = max = min = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = max = min = flexBasis[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(flexBasis[1] === REM) {\n b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = max = min = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = max = min = flexBasis[0] * this.root.height * 0.01;\n }\n else if(flexBasis[1] === VMAX) {\n b = max = min = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(flexBasis[1] === VMIN) {\n b = max = min = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n else if(([PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(main[1]) > -1)) {\n if(main[1] === PX) {\n b = max = min = main[0];\n }\n else if(main[1] === PERCENT) {\n b = max = min = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = max = min = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = max = min = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = max = min = main[0] * this.root.height * 0.01;\n }\n else if(main[1] === VMAX) {\n b = max = min = main[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(main[1] === VMIN) {\n b = max = min = main[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n }\n // 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 let columnCrossMax = 0;\n if(width[1] === PX) {\n columnCrossMax = width[0];\n }\n else if(width[1] === PERCENT) {\n columnCrossMax = width[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(width[1] === REM) {\n columnCrossMax = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n columnCrossMax = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n columnCrossMax = width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n columnCrossMax = width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n columnCrossMax = width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n columnCrossMax += this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w)\n + borderLeftWidth[0] + borderRightWidth[0];\n return [[b, min, max], [columnCrossMax]];\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 if(item[1] === VMAX) {\n return item[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(item[1] === VMIN) {\n return item[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n return 0;\n }\n });\n }\n if(isNil(__cacheStyle[STROKE_DASHARRAY])) {\n __cacheStyle[STROKE_DASHARRAY] = true;\n computedStyle[STROKE_DASHARRAY] = currentStyle[STROKE_DASHARRAY] || [];\n __cacheStyle[STROKE_DASHARRAY_STR] = computedStyle[STROKE_DASHARRAY].map(item => joinArr(item, ','));\n }\n // 直接赋值的\n [\n STROKE_LINECAP,\n STROKE_LINEJOIN,\n STROKE_MITERLIMIT,\n FILL_RULE,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n // stroke/fll移至render里处理,因为cache涉及渐变坐标偏移\n [STROKE, FILL].forEach(k => {\n if(isNil(__cacheStyle[k])) {\n let v = currentStyle[k];\n computedStyle[k] = v;\n let res = [];\n if(Array.isArray(v)) {\n v.forEach(item => {\n if(item && (item.k === 'linear' || item.k === 'radial' || item.k === 'conic')) {\n if(renderMode === WEBGL) {\n let cache = this.__config[NODE_CACHE];\n x3 += cache.dx;\n x4 += cache.dx;\n y3 += cache.dy;\n y4 += cache.dy;\n }\n res.push(this.__gradient(renderMode, ctx, x3, y3, x4, y4, item));\n }\n else if(item[3] > 0) {\n res.push(int2rgba(item));\n }\n else {\n res.push('none');\n }\n });\n }\n __cacheStyle[k] = res;\n }\n });\n return res;\n }\n\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n // Geom强制有内容\n return computedStyle[VISIBILITY] !== 'hidden';\n }\n\n __preSet(res) {\n let { width, height, __cacheStyle, computedStyle } = this;\n let cx = res.sx3 + width * 0.5;\n let cy = res.sy3 + height * 0.5;\n let {\n [FILL]: fill,\n [STROKE]: stroke,\n [STROKE_DASHARRAY_STR]: strokeDasharrayStr,\n } = __cacheStyle;\n let {\n [STROKE_WIDTH]: strokeWidth,\n [STROKE_LINECAP]: strokeLinecap,\n [STROKE_LINEJOIN]: strokeLinejoin,\n [STROKE_MITERLIMIT]: strokeMiterlimit,\n [STROKE_DASHARRAY]: strokeDasharray,\n [FILL_RULE]: fillRule,\n } = computedStyle;\n return {\n cx,\n cy,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n fillRule,\n };\n }\n\n __preSetCanvas(renderMode, ctx, res) {\n let {\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n } = res;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(fill) {\n if(fill.k === 'linear') {\n ctx.fillStyle = fill.v;\n }\n else if(fill.k === 'radial' && !Array.isArray(fill.v)) {\n ctx.fillStyle = fill.v;\n }\n else if(fill.k === 'conic') {\n //\n }\n else if(!fill.k && ctx.fillStyle !== fill) {\n ctx.fillStyle = fill;\n }\n }\n if(stroke) {\n if(stroke.k === 'linear') {\n ctx.strokeStyle = stroke.v;\n }\n else if(stroke.k === 'radial' && !Array.isArray(stroke.v)) {\n ctx.strokeStyle = stroke.v;\n }\n else if(stroke.k === 'conic') {\n //\n }\n else if(!stroke.k && ctx.strokeStyle !== stroke) {\n ctx.strokeStyle = stroke;\n }\n }\n if(strokeWidth !== undefined && ctx.lineWidth !== strokeWidth) {\n ctx.lineWidth = strokeWidth;\n }\n if(strokeLinecap !== undefined && ctx.lineCap !== strokeLinecap) {\n ctx.lineCap = strokeLinecap;\n }\n if(strokeLinejoin !== undefined && ctx.lineJoin !== strokeLinejoin) {\n ctx.lineJoin = strokeLinejoin;\n }\n if(strokeMiterlimit !== undefined && ctx.miterLimit !== strokeMiterlimit) {\n ctx.miterLimit = strokeMiterlimit;\n }\n // 小程序没这个方法\n if(util.isFunction(ctx.getLineDash)) {\n if(strokeDasharray && !util.equalArr(ctx.getLineDash(), strokeDasharray)) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n else if(strokeDasharray) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(renderMode === mode.SVG) {\n this.virtualDom.type = 'geom';\n }\n // 无论canvas/svg,break可提前跳出省略计算\n if(res.break) {\n return res;\n }\n // data在无cache时没有提前设置\n let preData = this.__preSet(res);\n return Object.assign(res, preData);\n }\n\n __renderPolygon(renderMode, ctx, res) {\n let {\n fill: fills,\n fillRule: fillRules,\n stroke: strokes,\n strokeWidth: strokeWidths,\n strokeDasharray: strokeDasharrays,\n strokeDasharrayStr: strokeDasharrayStrs,\n strokeLinecap: strokeLinecaps,\n strokeLinejoin: strokeLinejoins,\n strokeMiterlimit: strokeMiterlimits,\n dx,\n dy,\n } = res;\n let { __cacheProps: { list }, isMulti, bbox } = this;\n // 普通情况下只有1个,按普通情况走\n if(fills.length <= 1 && strokes.length <= 1) {\n let o = {\n fill: fills[0],\n fillRule: fillRules[0],\n stroke: strokes[0],\n strokeWidth: strokeWidths[0],\n strokeDasharray: strokeDasharrays[0],\n strokeDasharrayStr: strokeDasharrayStrs[0],\n strokeLinecap: strokeLinecaps[0],\n strokeLinejoin: strokeLinejoins[0],\n strokeMiterlimit: strokeMiterlimits[0],\n dx,\n dy,\n bbox,\n };\n this.__renderOnePolygon(renderMode, ctx, isMulti, list, o);\n }\n // 多个需要fill在下面,stroke在上面,依次循环\n else {\n for(let i = 0, len = fills.length; i < len; i++) {\n let fill = fills[i];\n if(fill) {\n let o = {\n fill,\n fillRule: fillRules[i],\n dx,\n dy,\n bbox,\n };\n this.__renderOnePolygon(renderMode, ctx, isMulti, list, o);\n }\n }\n for(let i = 0, len = strokes.length; i < len; i++) {\n let stroke = strokes[i];\n if(stroke) {\n let o = {\n stroke,\n strokeWidth: strokeWidths[i],\n strokeDasharray: strokeDasharrays[i],\n strokeDasharrayStr: strokeDasharrayStrs[i],\n strokeLinecap: strokeLinecaps[i],\n strokeLinejoin: strokeLinejoins[i],\n strokeMiterlimit: strokeMiterlimits[i],\n dx,\n dy,\n bbox,\n };\n this.__renderOnePolygon(renderMode, ctx, isMulti, list, o);\n }\n }\n }\n }\n\n __renderOnePolygon(renderMode, ctx, isMulti, list, res) {\n let {\n fill,\n stroke,\n strokeWidth,\n } = res;\n let isFillCE = fill && fill.k === 'conic';\n let isStrokeCE = stroke && stroke.k === 'conic';\n // 椭圆是array\n let isFillRE = fill && fill.k === 'radial' && Array.isArray(fill.v);\n let isStrokeRE = strokeWidth && strokeWidth > 0 && stroke && stroke.k === 'radial' && Array.isArray(stroke.v);\n if(isFillCE || isStrokeCE) {\n if(isFillCE) {\n this.__conicGradient(renderMode, ctx, list, isMulti, res);\n }\n else if(fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true);\n }\n if(strokeWidth && strokeWidth > 0 && isStrokeCE) {\n inject.warn('Stroke style can not use conic-gradient');\n }\n else if(strokeWidth && strokeWidth > 0 && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, false, true);\n }\n }\n else if(isFillRE || isStrokeRE) {\n if(isFillRE) {\n this.__radialEllipse(renderMode, ctx, list, isMulti, res, 'fill');\n }\n else if(fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true);\n }\n // stroke椭圆渐变matrix会变形,降级为圆\n if(strokeWidth && strokeWidth > 0 && isStrokeRE) {\n inject.warn('Stroke style can not use radial-gradient for ellipse');\n res.stroke.v = res.stroke.v[0];\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, false, true);\n }\n else if(strokeWidth && strokeWidth > 0 && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, false, true);\n }\n }\n else {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true, true);\n }\n }\n\n __drawPolygon(renderMode, ctx, isMulti, list, res, isFill, isStroke) {\n let {\n fill,\n stroke,\n strokeWidth,\n fillRule,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n dx,\n dy,\n } = res;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n this.__preSetCanvas(renderMode, ctx, res);\n ctx.beginPath();\n if(isMulti) {\n list.forEach(item => canvasPolygon(ctx, item, dx, dy));\n }\n else {\n canvasPolygon(ctx, list, dx, dy);\n }\n if(isFill && fill && fill !== 'none') {\n ctx.fill(fillRule);\n }\n if(isStroke && stroke && stroke !== 'none' && strokeWidth && strokeWidth > 0) {\n ctx.stroke();\n }\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n list.forEach(item => d += svgPolygon(item));\n }\n else {\n d = svgPolygon(list);\n }\n let props = [\n ['d', d],\n ];\n // 2个都没有常出现在多fill/stroke时,也有可能特殊单个故意这样写的\n if((!fill || fill === 'none') && (!stroke || stroke === 'none')) {\n return;\n }\n if(isFill && fill && fill !== 'none') {\n props.push(['fill', fill.v || fill]);\n if(fillRule && fillRule !== 'nonzero') {\n props.push(['fill-rule', fillRule]);\n }\n }\n else {\n props.push(['fill', 'none']);\n }\n if(isStroke && stroke && stroke !== 'none' && strokeWidth && strokeWidth > 0) {\n props.push(['stroke', stroke.v || stroke]);\n props.push(['stroke-width', strokeWidth]);\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n }\n else {\n props.push(['stroke-width', 0]);\n }\n this.addGeom('path', props);\n }\n }\n\n __inversePtList(list, isMulti, t) {\n if(isMulti) {\n return list.map(item => {\n if(!item || !item.length) {\n return null;\n }\n return item.map(item => {\n if(!item || !item.length) {\n return null;\n }\n let arr = [];\n for(let i = 0, len = item.length; i < len; i += 2) {\n let p = mx.calPoint([item[i], item[i + 1]], t);\n arr.push(p[0]);\n arr.push(p[1]);\n }\n return arr;\n });\n });\n }\n else {\n return list.map(item => {\n if(!item || !item.length) {\n return null;\n }\n let arr = [];\n for(let i = 0, len = item.length; i < len; i += 2) {\n let p = mx.calPoint([item[i], item[i + 1]], t);\n arr.push(p[0]);\n arr.push(p[1]);\n }\n return arr;\n });\n }\n }\n\n __radialEllipse(renderMode, ctx, list, isMulti, res, method) {\n let {\n strokeWidth,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n dx,\n dy,\n } = res;\n let [color, matrix, cx, cy] = res[method].v;\n // 椭圆渐变的转换,顶点逆矩阵变换\n let tfo = [cx, cy];\n matrix = transform.calMatrixByOrigin(matrix, tfo);\n let t = mx.inverse(matrix);\n list = this.__inversePtList(list, isMulti, t);\n // 用正向matrix渲染\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(matrix) {\n ctx.save();\n let me = this.matrixEvent;\n matrix = mx.multiply(me, matrix);\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n }\n ctx.beginPath();\n if(ctx[method + 'Style'] !== color) {\n ctx[method + 'Style'] = color;\n }\n if(isMulti) {\n list.forEach(item => painter.canvasPolygon(ctx, item, dx, dy));\n }\n else {\n canvasPolygon(ctx, list, dx, dy);\n }\n ctx[method]();\n ctx.closePath();\n if(matrix) {\n ctx.restore();\n }\n }\n else if(renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n list.forEach(item => d += svgPolygon(item));\n }\n else {\n d = svgPolygon(list);\n }\n let props = [\n ['d', d],\n ];\n if(method === 'fill') {\n props.push(['fill', color]);\n props.push(['strokeWidth', 0]);\n }\n else if(method === 'stroke') {\n props.push(['fill', 'none']);\n props.push(['stroke', color]);\n props.push(['stroke-width', strokeWidth]);\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n }\n props.push(['transform', `matrix(${joinArr(mx.m2m6(matrix), ',')})`]);\n this.addGeom('path', props);\n }\n }\n\n __conicGradient(renderMode, ctx, list, isMulti, res) {\n let {\n fill,\n bbox,\n dx = 0,\n dy = 0,\n } = res;\n let color = fill.v;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n let [x1, y1, x2, y2] = bbox;\n let w = x2 - x1, h = y2 - y1;\n let offscreen = inject.getCacheCanvas(w, h, '__$$CONIC_GRADIENT$$__');\n let imgData = offscreen.ctx.getImageData(0,0, w, h);\n gradient.getConicGradientImage(w * 0.5, h * 0.5, w, h, fill.v.stop, imgData.data);\n offscreen.ctx.putImageData(imgData, 0, 0);\n if(isMulti) {\n list.forEach(item => {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, item, dx, dy);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(offscreen.canvas, x1 + dx, y1 + dy);\n ctx.restore();\n });\n }\n else {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list, dx, dy);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(offscreen.canvas, x1 + dx, y1 + dy);\n ctx.restore();\n }\n offscreen.ctx.clearRect(0, 0, w, h);\n }\n else if(renderMode === mode.SVG) {\n if(isMulti) {\n list.forEach(item => {\n let v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(item)],\n ],\n }],\n };\n let clip = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n color.forEach(item => {\n this.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(item[0])],\n ['fill', item[1]],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n });\n });\n }\n else {\n let v = {\n tagName: 'clipPath',\n children: [{\n tagName: 'path',\n props: [\n ['d', svgPolygon(list)],\n ],\n }],\n };\n let clip = ctx.add(v);\n this.__config[NODE_DEFS_CACHE].push(v);\n color.forEach(item => {\n this.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', svgPolygon(item[0])],\n ['fill', item[1]],\n ['clip-path', 'url(#' + clip + ')'],\n ],\n });\n });\n }\n }\n }\n\n __propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit) {\n if(strokeDasharrayStr) {\n props.push(['stroke-dasharray', strokeDasharrayStr]);\n }\n if(strokeLinecap && strokeLinecap !== 'butt') {\n props.push(['stroke-linecap', strokeLinecap]);\n }\n if(strokeLinejoin && strokeLinejoin !== 'miter') {\n props.push(['stroke-linejoin', strokeLinejoin]);\n }\n if(strokeMiterlimit && strokeMiterlimit !== 4) {\n props.push(['stroke-miterlimit', strokeMiterlimit]);\n }\n }\n\n // geom的cache无内容也不清除,因为子类不清楚内容,除非看不见\n __releaseWhenEmpty(cache, computedStyle) {\n return computedStyle[VISIBILITY] === 'hidden';\n }\n\n // offset/resize时要多一步清空props上记录的缓存\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeX(diff, lv) {\n super.__resizeX(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeY(diff, lv) {\n super.__resizeY(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n getProps(k) {\n let v = this.currentProps[k];\n if(!isNil(v)) {\n return v;\n }\n return this['__' + k];\n }\n\n __isRealInline() {\n return false;\n }\n\n get isMulti() {\n return this.__isMulti;\n }\n\n get currentProps() {\n return this.__currentProps;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$') {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Geom has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$'\n || !obj.prototype || !(obj.prototype instanceof Geom)) {\n throw new Error('Invalid param');\n }\n if(Geom.hasRegister(name)) {\n throw new Error(`Geom has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Geom.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nexport default Geom;\n","import Xom from '../node/Xom';\nimport Dom from '../node/Dom';\nimport Component from '../node/Component';\nimport util from './util';\nimport inject from './inject';\nimport flatten from './flatten';\nimport $$type from './$$type';\nimport enums from './enums';\n\nconst {\n NODE_KEY: {\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_DOM_PARENT,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n NODE_STRUCT,\n },\n} = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet updateList = [];\nlet removeList = [];\n\nconst KEY_FLAG = {};\n\n/**\n * setState后刷新前先根遍历检查组件开始进行shouldComponentUpdate判断\n */\nfunction check(vd) {\n if(vd instanceof Dom) {\n vd.children.forEach(child => {\n if(child instanceof Dom) {\n check(child);\n }\n // 当组件有setState更新时,从叶子到根链路会标识__hasCpUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasCpUpdate) {\n child.__hasCpUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n // 高阶组件会进入此分支,被父组件调用\n else if(vd instanceof Component && vd.__hasCpUpdate) {\n vd.__hasCpUpdate = false;\n checkCp(vd, vd.props);\n }\n}\n\n/**\n * 检查cp是否有state变更,注意递归检查时需要看shadow不能看shadowRoot,\n * 否则高阶组件会被跳过,其更新无法触发update生命周期\n * @param cp\n * @param nextProps\n * @param forceCheckUpdate,被render()后的json的二级组件,发现props有变更强制检查更新,否则可以跳过\n */\nfunction checkCp(cp, nextProps, forceCheckUpdate) {\n if(cp.__nextState || forceCheckUpdate) {\n let shouldUpdate;\n if(util.isFunction(cp.shouldComponentUpdate)) {\n shouldUpdate = cp.shouldComponentUpdate(nextProps, cp.__nextState || cp.state);\n }\n else {\n // 没有默认更新\n shouldUpdate = true;\n }\n if(shouldUpdate) {\n updateCp(cp, nextProps, cp.__nextState || cp.state);\n }\n // 不更新则递归检查子tree的cp\n else {\n cp.props = nextProps;\n cp.state = cp.__nextState || cp.state;\n check(cp.shadow);\n }\n }\n else {\n check(cp.shadow);\n }\n}\n\n/**\n * 更新组件的props和state,清空__nextState\n * @param cp\n * @param props\n * @param state\n */\nfunction updateCp(cp, props, state) {\n cp.props = props;\n cp.state = state;\n cp.__nextState = null; // 同步在refresh前清除component的新state标识,这样frame动画在after回调中可以新设\n let oldS = cp.shadow;\n let oldSr = cp.shadowRoot;\n let oldJson = cp.__cd;\n let json = flatten(cp.render());\n // 对比新老render()返回的内容,更新后重新生成sr\n diffSr(oldS, oldJson, json);\n cp.__init(json);\n // 为了局部dom布局需要知道老的css信息\n let sr = cp.shadowRoot;\n if(sr instanceof Xom) {\n [\n '__outerWidth',\n '__outerHeight',\n '__sx',\n '__sy',\n '__sx2',\n '__sx3',\n '__sx4',\n '__sx5',\n '__sx6',\n '__sy2',\n '__sy3',\n '__sy4',\n '__sy5',\n '__sy6',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__computedStyle = sr.__config[NODE_COMPUTED_STYLE] = oldSr.computedStyle;\n }\n else {\n let domParent = cp.domParent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n sr.__config[k] = domParent.__config[k];\n });\n }\n [\n '__x',\n '__y',\n '__width',\n '__height',\n '__sx1', // text和xom\n '__sy1',\n '__layoutData',\n '__parent',\n '__domParent',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__config[NODE_DOM_PARENT] = oldSr.domParent;\n sr.__config[NODE_STRUCT] = oldSr.__config[NODE_STRUCT];\n updateList.push(cp);\n // 老的需回收,diff会生成新的dom,唯一列外是cp直接返回一个没变化的cp\n if(!util.isObject(json) || !json.__placeholder) {\n removeList.push(oldS);\n }\n // 子组件使用老的json时标识,更新后删除,render()返回空会没json对象\n if(json && json.__placeholder) {\n delete json.__placeholder;\n }\n if(json && json.__inheritAnimate) {\n delete json.__inheritAnimate;\n }\n if(json && json.__animateRecords) {\n delete json.__animateRecords;\n }\n // 高阶组件时需判断,子组件更新后生成新的sr,父组件的sr/host需要同时更新引用\n let host = cp.host;\n while(host) {\n if(host.shadow === cp) {\n host.__shadowRoot = sr;\n sr.__hostRoot = host;\n cp = host;\n host = host.host;\n }\n else {\n break;\n }\n }\n}\n\n/**\n * 非一级组件sr进行对比,key相同的无需重新生成且继承动画\n * @param vd\n * @param oj oldJson\n * @param nj\n */\nfunction diffSr(vd, oj, nj) {\n // 先遍历检查key相同的,将没有变化的key暂存下来,深度优先,这样叶子节点出现在前面,当key的叶子也有key时,确保叶子先对比\n let ojk = getKeyHash(oj, {}, vd);\n let njk = getKeyHash(nj, {});\n let keyList = [];\n let cpList = [];\n // 先对比key对应的节点,如果新老有一方对不上则落空\n Object.keys(ojk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n if(!n) {\n o.json.key = KEY_FLAG;\n }\n });\n Object.keys(njk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n // 有可能老的没有这个key,新key落空\n if(!o) {\n n.json.key = KEY_FLAG;\n return;\n }\n let oj = o.json;\n let nj = n.json;\n let vd = o.vd;\n // 相同class的组件进行对比替换\n if(oj.$$type === TYPE_CP && nj.$$type === TYPE_CP) {\n if(oj.klass === nj.klass) {\n // 对比props和children看是否全等,是则直接替换新json类型为占位符,引用老vd,否则强制更新\n diffCp(oj, nj, vd);\n // 标识对比过了\n oj.key = nj.key = KEY_FLAG;\n // 老的sr里需删除这个vd,因为老sr会回收\n cpList.push(vd);\n }\n }\n // 相同类型的vd进行对比继承动画\n else if(oj.$$type === nj.$$type && oj.tagName === nj.tagName) {\n // 需判断矢量标签mutil是否相等\n if(nj.$$type !== TYPE_GM || oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n oj.key = nj.key = KEY_FLAG;\n // key相同的dom暂存下来\n if(nj.$$type === TYPE_VD) {\n keyList.push({\n vd,\n oj,\n nj,\n });\n }\n }\n });\n // key相同的dom对比children,下面非key逻辑就不做了\n keyList.forEach(item => {\n diffChildren(item.vd, item.oj, item.nj);\n });\n // 整体tree进行对比\n diffChild(vd, oj, nj);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的\n cpList.forEach(vd => {\n removeCpFromOldTree(vd);\n });\n}\n\n/**\n * 递归检查dom的children,相同的无需重新生成,用PL类型占位符代替直接返回老vd\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChild(vd, oj, nj) {\n if(util.isObject(nj)) {\n if(nj.$$type === TYPE_CP) {\n // key对比过了忽略\n if(nj.key === KEY_FLAG) {\n return;\n }\n // 相同class的组件处理\n if(oj && oj.$$type === nj.$$type && oj.klass === nj.klass) {\n diffCp(oj, nj, vd);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收\n removeCpFromOldTree(vd);\n }\n }\n else if(nj.$$type === TYPE_GM && oj && oj.$$type === TYPE_GM) {\n // $geom的multi必须一致\n if(oj.tagName === nj.tagName && oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n }\n // dom类型递归children\n else if(nj.$$type === TYPE_VD && oj && oj.$$type === TYPE_VD) {\n if(oj.tagName === nj.tagName) {\n nj.__inheritAnimate = vd;\n }\n diffChildren(vd, oj, nj);\n }\n }\n}\n\n/**\n * dom类型的vd对比children\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChildren(vd, oj, nj) {\n let oc = oj.children;\n let nc = nj.children;\n let ol = oc.length;\n let nl = nc.length;\n let children = vd.children;\n for(let i = 0, of = 0, nf = 0, len = Math.min(ol, nl); i < len; i++) {\n let o = oc[i + of];\n let n = nc[i + nf];\n // 新老都是key直接跳过\n if(o.key === KEY_FLAG && n.key === KEY_FLAG) {\n }\n // 其中一个是key对比过了调整索引和长度\n else if(o.key === KEY_FLAG) {\n of++;\n i--;\n ol--;\n len = Math.min(ol, nl);\n }\n else if(n.key === KEY_FLAG) {\n nf++;\n i--;\n nl--;\n len = Math.min(ol, nl);\n }\n else {\n diffChild(children[i + of], o, n);\n }\n }\n // 长度不同增减的无需关注,新json创建cp有didMount,老vd会调用cp的destroy\n}\n\n/**\n * 根据json对比看cp如何更新,被render()后的json的二级组件对比才会出现\n * @param oj\n * @param nj\n * @param vd\n */\nfunction diffCp(oj, nj, vd) {\n // props全等,直接替换新json类型为占位符,引用老vd内容,无需重新创建,暂时存在json的placeholder上\n // 否则需要强制触发组件更新,包含setState内容\n nj.__placeholder = vd;\n let sr = vd.shadowRoot;\n // 对比需忽略on开头的事件,直接改老的引用到新的上,这样只变了on的话无需更新\n let exist = {};\n Object.keys(oj.props).forEach(k => {\n let v = oj.props[k];\n exist[k] = v;\n });\n Object.keys(nj.props).forEach(k => {\n let v = nj.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n vd.off(k, exist[k]);\n vd.on(k, v);\n }\n delete exist[k];\n }\n else {\n k = k.slice(2).toLowerCase();\n vd.on(k, v);\n }\n }\n });\n // 新的少的事件取消\n Object.keys(exist).forEach(k => {\n let v = exist[k];\n if(/^on[a-zA-Z]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n delete sr.listener[k];\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n vd.off(k, v);\n }\n });\n checkCp(vd, nj.props, !util.equal(oj.props, nj.props));\n}\n\n/**\n * 深度优先遍历json,将有key的记录在hash中,如果传入根vd,同步递归保存对应位置的vd\n * @param json\n * @param hash\n * @param vd\n * @returns {*}\n */\nfunction getKeyHash(json, hash, vd) {\n if(Array.isArray(json)) {\n json.forEach((item, i) => getKeyHash(item, hash, vd && vd[i]));\n }\n else if(util.isObject(json)) {\n if(json.$$type === TYPE_VD || json.$$type === TYPE_GM || json.$$type === TYPE_CP) {\n // 深度优先\n if(json.$$type === TYPE_VD) {\n getKeyHash(json.children, hash, vd && vd.children);\n }\n let key = json.props.key;\n if(!util.isNil(key) && key !== '') {\n // 重复key错误警告\n if(hash.hasOwnProperty(key)) {\n inject.warn('Component ' + vd.tagName + ' has duplicate key: ' + key);\n }\n hash[key] = {\n json,\n vd,\n };\n }\n }\n }\n return hash;\n}\n\n/**\n * 非一级组件diff发生更新时,其需要从sr的tree中移除,因为sr会销毁\n */\nfunction removeCpFromOldTree(vd) {\n // root下的一级组件不会发生回收情况,忽略\n if(!vd.host) {\n return;\n }\n let parent = vd.parent;\n if(parent) {\n let i = parent.children.indexOf(vd);\n if(i > -1) {\n parent.children[i] = null;\n }\n else {\n throw new Error('Can not find child: ' + vd.tagName);\n }\n }\n}\n\n/**\n * 执行componentDidUpdate/destroy\n */\nfunction did() {\n updateList.forEach(item => {\n if(util.isFunction(item.componentDidUpdate)) {\n item.componentDidUpdate();\n }\n });\n updateList.splice(0);\n removeList.forEach(item => {\n item.__destroy();\n });\n removeList = [];\n}\n\nexport default {\n updateList,\n check,\n did,\n};\n","import util from './util';\nimport level from '../refresh/level';\n\nconst { joinVd, joinDef } = util;\nconst { contain, NONE, TRANSFORM_ALL, OPACITY, FILTER, MIX_BLEND_MODE } = level;\n\nfunction diff(elem, ovd, nvd) {\n let cns = elem.childNodes;\n diffDefs(cns[0], ovd.defs, nvd.defs);\n // = i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinDef(nd[i]));\n }\n }\n}\n\nfunction diffDef(elem, od, nd) {\n if(od.tagName !== nd.tagName) {\n insertAdjacentHTML(elem, 'beforebegin', joinDef(nd));\n // elem.insertAdjacentHTML('beforebegin', joinDef(nd));\n elem.parentNode.removeChild(elem);\n }\n else {\n if(od.uuid !== nd.uuid) {\n elem.setAttribute('id', nd.uuid);\n }\n let op = {};\n for(let i = 0, len = (od.props || []).length; i < len; i++) {\n let prop = od.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nd.props || []).length; i < len; i++) {\n let prop = nd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n let cns = elem.childNodes;\n let ol = od.children.length;\n let nl = nd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, od.children[i], nd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nd.children[i]));\n }\n }\n }\n}\n\nfunction diffChild(elem, ovd, nvd) {\n if(ovd.type === 'dom') {\n if(nvd.type === 'dom') {\n diffD2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffD2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'text') {\n if(nvd.type === 'text') {\n diffT2T(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'geom') {\n if(nvd.type === 'dom') {\n diffG2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffG2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'img') {\n if(nvd.type === 'img') {\n diffItemSelf(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n // 特殊情况,当有连续2个img,后面1个发生error时,其children内容不是type为img的图片,而是矢量图item,会进入此分支\n else if(ovd.type === 'item' && nvd.type === 'item') {\n diffItemSelf(elem, ovd, nvd);\n }\n}\n\nfunction diffX2X(elem, ovd, nvd) {\n let { transform, opacity, visibility, mask, overflow, filter, mixBlendMode, conClip } = nvd;\n if(ovd.transform !== transform) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(ovd.opacity !== opacity) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(ovd.visibility !== visibility) {\n elem.setAttribute('visibility', visibility);\n }\n if(ovd.mask !== mask) {\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n }\n if(ovd.filter !== filter || ovd.mixBlendMode !== mixBlendMode) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('filter');\n }\n }\n // if(ovd.filter !== filter) {\n // if(filter) {\n // elem.setAttribute('filter', filter);\n // }\n // else {\n // elem.removeAttribute('filter');\n // }\n // }\n if(ovd.overflow !== overflow) {\n if(overflow) {\n elem.setAttribute('clipPath', overflow);\n }\n else {\n elem.removeAttribute('overflow');\n }\n }\n if(ovd.conClip !== conClip) {\n if(conClip) {\n elem.childNodes[1].setAttribute('clip-path', conClip);\n }\n else {\n elem.childNodes[1].removeAttribute('clip-path');\n }\n }\n}\n\nfunction diffByLessLv(elem, ovd, nvd, lv) {\n let { transform, opacity, mask, filter, mixBlendMode } = nvd;\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n if(lv === NONE) {\n return;\n }\n if(contain(lv, TRANSFORM_ALL)) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(contain(lv, OPACITY)) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(contain(lv, FILTER) || contain(lv, MIX_BLEND_MODE)) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('style');\n }\n }\n}\n\nfunction diffD2D(elem, ovd, nvd, root) {\n // cache表明children无变化缓存,一定是REPAINT以下的,只需看自身的lv以及mask\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffD2G(elem, ovd, nvd) {\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n replaceWith(cns[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffT2T(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, ovd.children[i], nvd.children[i], true);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffG2D(elem, ovd, nvd) {\n diffD2G(elem, ovd, nvd);\n}\n\nfunction diffG2G(elem, ovd, nvd) {\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n }\n}\n\nfunction diffBb(elem, obb, nbb) {\n let ol = obb.length;\n let nl = nbb.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, obb[i], nbb[i]);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nbb[i]));\n }\n }\n}\n\nfunction diffItem(elem, i, ovd, nvd, isText) {\n let cns = elem.childNodes;\n if(ovd.tagName !== nvd.tagName) {\n replaceWith(cns[i], nvd);\n }\n else {\n diffItemSelf(cns[i], ovd, nvd);\n if(isText && ovd.content !== nvd.content) {\n cns[i].innerHTML = nvd.content;\n }\n }\n}\n\nfunction diffItemSelf(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let op = {};\n for(let i = 0, len = (ovd.props || []).length; i < len; i++) {\n let prop = ovd.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nvd.props || []).length; i < len; i++) {\n let prop = nvd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n}\n\nfunction replaceWith(elem, vd) {\n let res;\n if(Array.isArray(vd)) {\n res = '';\n vd.forEach(item => {\n res += joinVd(item);\n });\n }\n else {\n res = joinVd(vd);\n }\n insertAdjacentHTML(elem, 'beforebegin', res);\n // elem.insertAdjacentHTML('beforebegin', res);\n elem.parentNode.removeChild(elem);\n}\n\nfunction insertAt(elem, cns, index, html) {\n if(index >= cns.length) {\n insertAdjacentHTML(elem, 'beforeend', html);\n // elem.insertAdjacentHTML('beforeend', html);\n }\n else {\n insertAdjacentHTML(cns[index], 'beforebegin', html);\n // cns[index].insertAdjacentHTML('beforebegin', html);\n }\n}\n\nfunction removeAt(elem, cns, index) {\n if(cns[index]) {\n elem.removeChild(cns[index]);\n }\n}\n\nlet svg;\nfunction insertAdjacentHTML(elem, where, content) {\n if(elem.insertAdjacentHTML) {\n elem.insertAdjacentHTML(where, content);\n }\n else {\n switch(where) {\n case 'beforeend':\n elem.innerHTML += content;\n break;\n case 'beforebegin':\n svg = svg || document.createElement('svg');\n svg.innerHTML = content;\n elem.parentNode.insertBefore(svg.childNodes[0], elem);\n break;\n }\n }\n}\n\nexport default diff;\n","import util from '../util/util';\n\nconst { isFunction } = util;\n\nclass Controller {\n constructor() {\n this.__records = []; // 默认记录和自动记录\n this.__records2 = []; // 非自动播放的动画记录\n this.__list = [] // 默认初始化播放列表,自动播放也存这里\n this.__list2 = []; // json中autoPlay为false的初始化存入这里\n this.__onList = []; // list中已存在的侦听事件,list2初始化时也需要增加上\n this.__lastTime = {}; // 每个类型的上次触发时间,防止重复emit\n }\n\n add(v, list = this.list) {\n if(list.indexOf(v) === -1) {\n list.push(v);\n }\n }\n\n remove(v) {\n let i = this.list.indexOf(v);\n if(i > -1) {\n this.list.splice(i, 1);\n }\n }\n\n __destroy() {\n this.__records = [];\n this.__records2 = [];\n this.__list = [];\n this.__list2 = [];\n }\n\n __action(k, args) {\n this.list.forEach(item => {\n item[k].apply(item, args);\n });\n }\n\n init(records = this.__records, list = this.list) {\n // 检查尚未初始化的record,并初始化,后面才能调用各种控制方法\n if(records.length) {\n // 清除防止重复调用,并且新的json还会进入整体逻辑\n records.splice(0).forEach(item => {\n let { target, animate } = item;\n if(target.isDestroyed) {\n return;\n }\n if(Array.isArray(animate)) {\n animate.forEach(animate => {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n });\n }\n else {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n }\n });\n }\n // 非自动播放后初始化需检测事件,给非自动播放添加上,并清空本次\n if(records === this.__records2) {\n let onList = this.__onList;\n let list2 = this.list2;\n if(list2.length && onList.length) {\n list2.forEach(item => {\n onList.forEach(arr => {\n item.off(arr[0], arr[1]);\n item.on(arr[0], arr[1]);\n });\n });\n }\n }\n }\n\n __playAuto() {\n this.init();\n this.__action('play');\n }\n\n play(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('play', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n pause() {\n this.__action('pause');\n }\n\n resume(cb) {\n let once = true;\n this.__action('resume', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n __mergeAuto() {\n this.init();\n this.init(this.__records2);\n if(this.__list2.length) {\n this.__list = this.__list.concat(this.__list2);\n this.__list2 = [];\n }\n }\n\n cancel(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('cancel', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n finish(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('finish', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndStop(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n let once = true;\n this.__action('gotoAndStop', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndPlay(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n let once = true;\n this.__action('gotoAndPlay', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.__on(id[i], handle);\n }\n this.__onList.push([id, handle]);\n }\n else {\n this.__on(id, handle);\n this.__onList.push([id, handle]);\n }\n }\n\n __on(id, handle) {\n this.list.forEach(item => {\n let cb = () => {\n let time = item.timestamp;\n if(time !== this.__lastTime[id]) {\n this.__lastTime[id] = time;\n handle();\n }\n };\n cb.__karasEventCb = handle;\n item.on(id, cb);\n });\n }\n\n off(id, handle) {\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.off(id[i], handle);\n }\n }\n else {\n this.list.forEach(item => {\n item.off(id, handle);\n });\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get list2() {\n return this.__list2;\n }\n\n __set(key, value) {\n this.list.forEach(item => {\n item[key] = value;\n });\n }\n\n set playbackRate(v) {\n this.__set('playbackRate', v);\n }\n\n set iterations(v) {\n this.__set('iterations', v);\n }\n\n set playCount(v) {\n this.__set('playCount', v);\n }\n\n set fps(v) {\n this.__set('fps', v);\n }\n\n set currentTime(v) {\n this.__set('currentTime', v);\n }\n\n set spfLimit(v) {\n this.__set('spfLimit', v);\n }\n\n set delay(v) {\n this.__set('delay', v);\n }\n\n set endDelay(v) {\n this.__set('endDelay', v);\n }\n\n set fill(v) {\n this.__set('fill', v);\n }\n\n set direction(v) {\n this.__set('direction', v);\n }\n}\n\nexport default Controller;\n","import inject from '../util/inject';\nimport painter from '../util/painter';\n\nconst { canvasPolygon } = painter;\n\n// 无cache时应用离屏时的优先级,从小到大,OFFSCREEN_MASK2是个特殊的\nconst OFFSCREEN_OVERFLOW = 0;\nconst OFFSCREEN_FILTER = 1;\nconst OFFSCREEN_MASK = 2;\nconst OFFSCREEN_BLEND = 3;\nconst OFFSCREEN_MASK2 = 4;\n\nfunction applyOffscreen(ctx, list, width, height) {\n list.sort(function(a, b) {\n if(a[1] === b[1]) {\n if(a[0] === b[0]) {\n return a[2] - b[2];\n }\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n list.forEach(item => {\n let [, , type, offscreen] = item;\n if(type === OFFSCREEN_OVERFLOW) {\n let { matrix, target, ctx: origin, x, y, offsetWidth, offsetHeight, list } = offscreen;\n ctx.globalCompositeOperation = 'destination-in';\n ctx.globalAlpha = 1;\n ctx.setTransform(matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]);\n ctx.fillStyle = '#FFF';\n ctx.beginPath();\n if(list) {\n canvasPolygon(ctx, list);\n }\n else {\n ctx.rect(x, y, offsetWidth, offsetHeight);\n }\n ctx.fill();\n ctx.closePath();\n ctx.globalCompositeOperation = 'source-over';\n target.draw();\n ctx = origin;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.globalAlpha = 1;\n 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, 'filter');\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\nexport default {\n OFFSCREEN_OVERFLOW,\n OFFSCREEN_FILTER,\n OFFSCREEN_MASK,\n OFFSCREEN_BLEND,\n OFFSCREEN_MASK2,\n applyOffscreen,\n};\n","import Page from '../refresh/Page';\nimport inject from '../util/inject';\n\nclass MockPage {\n constructor(texture, width, height) {\n this.uuid = Page.genUuid();\n this.time = inject.now();\n this.texture = texture;\n this.width = width;\n this.height = height;\n }\n}\n\nexport default MockPage;\n","import MockPage from './MockPage';\n\n/**\n * 一个fbo离屏纹理,mock成cache,当webgl需要局部根节点汇总时生成,即cacheTotal,\n * 基于此纹理进行filter、mask等后处理渲染\n */\nclass MockCache {\n constructor(gl, texture, sx1, sy1, width, height, bbox) {\n this.gl = gl;\n this.x = 0;\n this.y = 0;\n this.sx1 = sx1;\n this.sy1 = sy1;\n this.width = width;\n this.height = height;\n this.bbox = bbox;\n this.available = true;\n this.__page = new MockPage(texture, width, height);\n this.dx = -bbox[0];\n this.dy = -bbox[1];\n this.dbx = sx1 - bbox[0];\n this.dby = sy1 - bbox[1];\n }\n\n release() {\n this.available = false;\n this.gl.deleteTexture(this.page.texture);\n }\n\n get page() {\n return this.__page;\n }\n}\n\nexport default MockCache;\n","import Cache from './Cache';\nimport offscreen from './offscreen';\nimport Text from '../node/Text';\nimport Dom from '../node/Dom';\nimport Img from '../node/Img';\nimport mode from './mode';\nimport mx from '../math/matrix';\nimport geom from '../math/geom';\nimport level from './level';\nimport painter from '../util/painter';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport tf from '../style/transform';\nimport mbm from '../style/mbm';\nimport enums from '../util/enums';\nimport webgl from '../gl/webgl';\nimport MockCache from '../gl/MockCache';\nimport blur from '../math/blur';\nimport vertexBlur from '../gl/filter/blur.vert';\nimport fragmentBlur from '../gl/filter/blur.frag';\nimport vertexMbm from '../gl/mbm/mbm.vert';\nimport fragmentMultiply from '../gl/mbm/multiply.frag';\nimport fragmentScreen from '../gl/mbm/screen.frag';\nimport fragmentOverlay from '../gl/mbm/overlay.frag';\nimport fragmentDarken from '../gl/mbm/darken.frag';\nimport fragmentLighten from '../gl/mbm/lighten.frag';\nimport fragmentColorDodge from '../gl/mbm/color-dodge.frag';\nimport fragmentColorBurn from '../gl/mbm/color-burn.frag';\nimport fragmentHardLight from '../gl/mbm/hard-light.frag';\nimport fragmentSoftLight from '../gl/mbm/soft-light.frag';\nimport fragmentDifference from '../gl/mbm/difference.frag';\nimport fragmentExclusion from '../gl/mbm/exclusion.frag';\nimport fragmentHue from '../gl/mbm/hue.frag';\nimport fragmentSaturation from '../gl/mbm/saturation.frag';\nimport fragmentColor from '../gl/mbm/color.frag';\nimport fragmentLuminosity from '../gl/mbm/luminosity.frag';\n\nconst { NA, LOCAL, CHILD, SELF, getCache } = Cache;\nconst {\n OFFSCREEN_OVERFLOW,\n OFFSCREEN_FILTER,\n OFFSCREEN_MASK,\n OFFSCREEN_BLEND,\n OFFSCREEN_MASK2,\n applyOffscreen,\n} = offscreen;\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n OPACITY,\n VISIBILITY,\n FILTER,\n OVERFLOW,\n MIX_BLEND_MODE,\n FILL,\n TRANSFORM,\n TRANSFORM_ORIGIN,\n PERSPECTIVE,\n PERSPECTIVE_ORIGIN,\n PADDING_LEFT,\n PADDING_RIGHT,\n PADDING_TOP,\n PADDING_BOTTOM,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n MATRIX,\n },\n NODE_KEY: {\n NODE_CACHE,\n NODE_CACHE_TOTAL,\n NODE_CACHE_OVERFLOW,\n NODE_CACHE_MASK,\n NODE_CACHE_FILTER,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n NODE_OPACITY,\n NODE_COMPUTED_STYLE,\n NODE_CURRENT_STYLE,\n NODE_LIMIT_CACHE,\n NODE_REFRESH_LV,\n NODE_CACHE_STYLE,\n NODE_DEFS_CACHE,\n NODE_IS_MASK,\n NODE_DOM_PARENT,\n NODE_PERSPECTIVE_MATRIX,\n NODE_VIRTUAL_DOM,\n NODE_CACHE_AS_BITMAP,\n NODE_STRUCT,\n },\n STRUCT_KEY: {\n STRUCT_NODE,\n STRUCT_INDEX,\n STRUCT_TOTAL,\n STRUCT_HAS_MASK,\n STRUCT_LV,\n },\n} = enums;\nconst {\n NONE,\n TRANSFORM_ALL,\n OPACITY: OP,\n FILTER: FT,\n REPAINT,\n contain,\n MIX_BLEND_MODE: MBM,\n PERSPECTIVE: PPT,\n} = level;\nconst { isE, inverse, multiply } = mx;\nconst { mbmName, isValidMbm } = mbm;\nconst { assignMatrix, transformBbox } = util;\n\n/**\n * 生成一个节点及其子节点所包含的矩形范围盒,canvas和webgl的最大尺寸限制不一样,由外部传入\n * 如果某个子节点超限,则视为整个超限,超限返回空\n * @param node\n * @param __structs\n * @param index\n * @param total\n * @param parentIndexHash\n * @param opacityHash\n * @param MAX\n * @param includeLimitCache webgl时即便超限也要强制生成total,所以标识不能跳出\n * @returns {*}\n */\nfunction genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHash, MAX, includeLimitCache) {\n let { __sx1: sx1, __sy1: sy1, __config } = node;\n let {\n [NODE_CACHE]: cache,\n [NODE_COMPUTED_STYLE]: {\n [FILTER]: filter,\n [PERSPECTIVE]: perspective,\n [PERSPECTIVE_ORIGIN]: perspectiveOrigin,\n },\n } = __config;\n // 先将局部根节点的bbox算好,可能没内容是空\n let bboxTotal;\n if(cache && cache.available) {\n bboxTotal = cache.bbox.slice(0);\n }\n else {\n bboxTotal = node.bbox.slice(0);\n }\n // 局部根节点如有perspective,则计算pm,这里不会出现嵌套,因为每个出现都会生成局部根节点\n let pm;\n if(perspective) {\n pm = tf.calPerspectiveMatrix(perspective, perspectiveOrigin);\n }\n // 广度遍历,不断一层层循环下去,用2个hash暂存每层的父matrix和opacity,blur只需记住顶层,因为子的如果有一定是cacheFilter\n let list = [index];\n let d = 0;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n d = blur.outerSize(v);\n }\n });\n opacityHash[index] = 1;\n // opacity可以保存下来层级相乘结果供外部使用,但matrix不可以,因为这里按画布原点为坐标系计算,外部合并局部根节点以bbox左上角为原点\n let matrixHash = {};\n while(list.length) {\n let arr = list.splice(0);\n for(let i = 0, len = arr.length; i < len; i++) {\n let parentIndex = arr[i];\n let total = __structs[parentIndex][STRUCT_TOTAL] || 0;\n for(let i = parentIndex + 1, len = parentIndex + total + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node2,\n [STRUCT_TOTAL]: total,\n } = __structs[i];\n // mask也不占bbox位置\n if(node2.isMask) {\n continue;\n }\n let {\n __sx1,\n __sy1,\n __config: {\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [OPACITY]: opacity,\n },\n },\n } = node2;\n // webgl不能跳过超限\n if(limitCache && !includeLimitCache) {\n return;\n }\n // display:none跳过整个节点树,visibility只跳过自身\n if(display === 'none') {\n i += total || 0;\n continue;\n }\n if(visibility === 'hidden') {\n continue;\n }\n parentIndexHash[i] = parentIndex;\n opacityHash[i] = opacityHash[parentIndex] * opacity;\n // 防止text的情况,其一定属于某个node,其bbox被计算过,text不应该计算\n if(node2 instanceof Text) {\n continue;\n }\n let bbox, dx = 0, dy = 0, hasTotal;\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n bbox = target.bbox.slice(0);\n dx = target.dbx;\n dy = target.dby;\n i += total || 0;\n hasTotal = true;\n }\n else if(__cache && __cache.available) {\n bbox = __cache.bbox.slice(0);\n dx = __cache.dbx;\n dy = __cache.dby;\n }\n else {\n bbox = node2.bbox.slice(0);\n }\n // 可能Xom没有内容\n if(bbox) {\n bbox[0] -= sx1;\n bbox[1] -= sy1;\n bbox[2] -= sx1;\n bbox[3] -= sy1;\n let matrix = matrixHash[parentIndex];\n // 父级matrix初始化E为null,自身不为E时才运算,可以加速\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n tfo[0] += __sx1 - sx1 + dx;\n tfo[1] += __sy1 - sy1 + dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(pm) {\n matrix = multiply(pm, matrix);\n }\n bbox = transformBbox(bbox, matrix, d, d);\n // 有孩子才继续存入下层级广度运算\n if(total && !hasTotal) {\n list.push(i);\n }\n mergeBbox(bboxTotal, bbox, sx1, sy1);\n }\n }\n }\n }\n return [bboxTotal, pm];\n}\n\nfunction mergeBbox(bbox, t, sx1, sy1) {\n bbox[0] = Math.min(bbox[0], sx1 + t[0]);\n bbox[1] = Math.min(bbox[1], sy1 + t[1]);\n bbox[2] = Math.max(bbox[2], sx1 + t[2]);\n bbox[3] = Math.max(bbox[3], sy1 + t[3]);\n}\n\n/**\n * 生成局部根节点离屏缓存,超限时除外\n * cache是每个节点自身的缓存,且共享离屏canvas\n * cacheTotal是基础\n * cacheFilter基于total\n * cacheOverflow基于filter\n * cacheMask基于overflow\n * cacheBlend基于mask\n * @param renderMode\n * @param node\n * @param config\n * @param index\n * @param lv\n * @param total\n * @param __structs\n * @param hasMask\n * @param width\n * @param height\n * @returns {{enabled}|Cache|*}\n */\nfunction genTotal(renderMode, node, config, index, lv, total, __structs, hasMask, width, height) {\n let {\n [NODE_CACHE_TOTAL]: cacheTotal,\n [NODE_CACHE_FILTER]: cacheFilter,\n [NODE_CACHE_MASK]: cacheMask,\n [NODE_CACHE_OVERFLOW]: cacheOverflow,\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = config;\n let needGen;\n // 先绘制形成基础的total,有可能已经存在无变化,就可省略\n if(!cacheTotal || !cacheTotal.available) {\n needGen = true; // total重新生成了,其它基于的也一定需要重新生成\n let bboxTotal, baseMatrix;\n let { __sx1: sx1, __sy1: sy1 } = node;\n // 栈代替递归,存父节点的matrix/opacity,matrix为E时存null省略计算\n let matrixList = [];\n let parentMatrix;\n let opacityList = [];\n let parentOpacity = 1;\n let lastConfig;\n let lastLv = lv;\n // 先遍历每个节点,以局部根节点左上角为原点,求得所占的总的bbox,即合并所有bbox\n for(let i = index, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // 排除Text\n if(node instanceof Text) {\n continue;\n }\n let __config = node.__config;\n let {\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_IS_MASK]: isMask,\n } = __config;\n // 跳过display:none元素和它的所有子节点和mask\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // mask不占bbox,本身除外\n if(i !== index && isMask) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,根节点是第一个特殊处理\n if(i === index) {}\n else if(lv > lastLv) {\n parentMatrix = lastConfig[NODE_MATRIX_EVENT];\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n parentOpacity = lastConfig[NODE_OPACITY];\n opacityList.push(parentOpacity);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n opacityList.splice(-diff);\n parentOpacity = opacityList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastConfig = __config;\n lastLv = lv;\n let {\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_CACHE_STYLE]: __cacheStyle,\n } = __config;\n let matrix, opacity;\n /**\n * lv=REPAINT重新渲染,bbox重新生成,matrix重新生成,filter重新生成\n */\n else {\n node.__bbox = null;\n if(i === index) {\n node.__calFilter(currentStyle, computedStyle);\n }\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n opacity = computedStyle[OPACITY] = currentStyle[OPACITY];\n }\n // opacity可临时赋值下面循环渲染用,matrixEvent可能需重新计算,因为局部根节点为E没考虑继承,这里仅计算bbox用\n if(i === index) {\n opacity = 1;\n baseMatrix = matrix;\n matrix = mx.identity();\n }\n else if(!isE(parentMatrix)) {\n matrix = multiply(parentMatrix, matrix);\n }\n assignMatrix(__config[NODE_MATRIX_EVENT], matrix);\n __config[NODE_OPACITY] = parentOpacity * opacity;\n let bbox;\n // 子元素有cacheTotal优先使用,一定是子元素,局部根节点available为false不会进\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n bbox = target.bbox;\n }\n else {\n bbox = node.bbox;\n }\n // 老的不变,新的会各自重新生成,根据matrixEvent合并bboxTotal\n bbox = transformBbox(bbox, matrix, 0, 0);\n if(i === index) {\n bboxTotal = bbox.slice(0);\n }\n else {\n mergeBbox(bboxTotal, bbox, 0, 0);\n }\n }\n // 生成cacheTotal,获取偏移dx/dy\n config[NODE_CACHE_TOTAL] = cacheTotal = Cache.getInstance(bboxTotal, sx1, sy1);\n if(!cacheTotal || !cacheTotal.enabled) {\n return;\n }\n cacheTotal.__available = true;\n let { dx, dy, dbx, dby, x: tx, y: ty } = cacheTotal;\n let ctxTotal = cacheTotal.ctx;\n /**\n * 再次遍历每个节点,以局部根节点左上角为基准原点,将所有节点绘制上去\n * 每个子节点的opacity有父继承计算在上面循环已经做好了,直接获取\n * 但matrixEvent可能需要重算,因为原点不一定是根节点的原点,影响tfo\n * 另外每个节点的refreshLevel需要设置REPAINT\n * 这样cacheTotal取消时子节点需确保重新计算一次matrix/opacity/filter,保证下次和父元素继承正确\n */\n parentMatrix = null;\n let lastMatrix;\n lastLv = lv;\n // 和外面没cache的类似,mask生成hash记录\n let maskStartHash = {};\n let offscreenHash = {};\n for(let i = index, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // 排除Text\n if(node instanceof Text) {\n node.render(renderMode, REPAINT, ctxTotal, CHILD, dx, dy);\n if(offscreenHash.hasOwnProperty(i)) {\n ctxTotal = applyOffscreen(ctxTotal, offscreenHash[i], width, height);\n }\n }\n else {\n let __config = node.__config;\n let {\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = __config;\n if(maskStartHash.hasOwnProperty(i)) {\n let [idx, n, offscreenMask] = maskStartHash[i];\n let target = inject.getCacheCanvas(width, height, null, 'mask2');\n offscreenMask.mask = target; // 应用mask用到\n offscreenMask.isClip = node.isClip;\n // 定位到最后一个mask元素上的末尾\n let j = i + (total || 0) + 1;\n while(--n) {\n let { [STRUCT_TOTAL]: total } = __structs[j];\n j += (total || 0) + 1;\n }\n j--;\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([idx, lv, OFFSCREEN_MASK, offscreenMask]);\n list.push([j, lv, OFFSCREEN_MASK2, {\n ctx: ctxTotal, // 保存等待OFFSCREEN_MASK2时还原\n target,\n }]);\n ctxTotal = target.ctx;\n }\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,根节点是第一个特殊处理\n if(i === index) {}\n else if(lv > lastLv) {\n parentMatrix = lastMatrix;\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n let {\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: tfo,\n [DISPLAY]: display,\n } = computedStyle;\n // 特殊渲染的matrix,局部根节点为原点考虑,当需要计算时再计算\n let m;\n if(i !== index && (!isE(parentMatrix) || !isE(transform))) {\n tfo = tfo.slice(0);\n tfo[0] += dbx + node.__sx1 - sx1 + tx;\n tfo[1] += dby + node.__sy1 - sy1 + ty;\n m = tf.calMatrixByOrigin(transform, tfo);\n if(!isE(parentMatrix)) {\n m = multiply(parentMatrix, m);\n }\n }\n else {\n m = null;\n }\n if(m) {\n ctxTotal.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]);\n }\n else {\n ctxTotal.setTransform(1, 0, 0, 1, 0, 0);\n }\n lastLv = lv;\n lastMatrix = m;\n // 子元素有cacheTotal优先使用,也一定是子元素,局部根节点不会进\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(i !== index && target) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n // 跳过display:none元素和它的所有子节点\n if(display === 'none') {\n continue;\n }\n let mixBlendMode = computedStyle[MIX_BLEND_MODE];\n if(isValidMbm(mixBlendMode)) {\n ctxTotal.globalCompositeOperation = mbmName(mixBlendMode);\n }\n else {\n ctxTotal.globalCompositeOperation = 'source-over';\n }\n ctxTotal.globalAlpha = __config[NODE_OPACITY];\n Cache.drawCache(target, cacheTotal);\n ctxTotal.globalCompositeOperation = 'source-over';\n }\n else {\n if(refreshLevel >= REPAINT) {\n // 手动计算cacheStyle和根据border-box的坐标再渲染\n node.__calCache(renderMode, ctxTotal, __config[NODE_DOM_PARENT],\n __config[NODE_CACHE_STYLE], __config[NODE_CURRENT_STYLE], computedStyle,\n node.clientWidth, node.clientHeight, node.offsetWidth, node.offsetHeight,\n computedStyle[BORDER_TOP_WIDTH], computedStyle[BORDER_RIGHT_WIDTH],\n computedStyle[BORDER_BOTTOM_WIDTH], computedStyle[BORDER_LEFT_WIDTH],\n computedStyle[PADDING_TOP], computedStyle[PADDING_RIGHT],\n computedStyle[PADDING_BOTTOM], computedStyle[PADDING_LEFT],\n node.__sx1, node.__sx2, node.__sx3, node.__sx4, node.__sx5, node.__sx6,\n node.__sy1, node.__sy2, node.__sy3, node.__sy4, node.__sy5, node.__sy6);\n }\n let res = node.render(renderMode, refreshLevel, ctxTotal, i === index ? LOCAL : CHILD, dx, dy);\n __config[NODE_REFRESH_LV] = REPAINT;\n let { offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow } = res || {};\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_BLEND, offscreenBlend]);\n ctxTotal = offscreenBlend.target.ctx;\n }\n // 被遮罩的节点要为第一个遮罩和最后一个遮罩的索引打标,被遮罩的本身在一个离屏canvas,遮罩的元素在另外一个\n // 最后一个遮罩索引因数量不好计算,放在maskStartHash做\n if(offscreenMask) {\n let j = i + (total || 0);\n maskStartHash[j + 1] = [i, hasMask, offscreenMask];\n ctxTotal = offscreenMask.target.ctx;\n }\n // filter造成的离屏,需要将后续一段孩子节点区域的ctx替换,并在结束后应用结果,再替换回来\n if(offscreenFilter) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_FILTER, offscreenFilter]);\n ctxTotal = offscreenFilter.target.ctx;\n }\n // overflow:hidden的离屏,最后孩子进行截取\n if(offscreenOverflow) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_OVERFLOW, offscreenOverflow]);\n ctxTotal = offscreenOverflow.target.ctx;\n }\n // 离屏应用,按照lv从大到小即子节点在前先应用,同一个节点多个效果按offscreen优先级从小到大来,\n // 由于mask特殊索引影响,所有离屏都在最后一个mask索引判断,此时mask本身优先结算,以index序大到小判断\n if(offscreenHash.hasOwnProperty(i)) {\n ctxTotal = applyOffscreen(ctxTotal, offscreenHash[i], width, height);\n }\n // render后判断可见状态,此时computedStyle才有值\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n // 恢复,且局部根节点设置NONE\n assignMatrix(config[NODE_MATRIX_EVENT], baseMatrix);\n config[NODE_REFRESH_LV] = NONE;\n }\n // cacheTotal仍在说明 lastLv) {\n parentMatrix = lastMatrix;\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n parentOpacity = lastOpacity;\n opacityList.push(parentOpacity);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n opacityList.splice(-diff);\n parentOpacity = opacityList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastLv = lv;\n // 计算临时的matrix\n let {\n [DISPLAY]: display,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: tfo,\n } = computedStyle;\n // 特殊渲染的matrix,局部根节点为原点考虑,本节点需inverse反向\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n // 跳过display:none元素和它的所有子节点\n if(display === 'none') {\n continue;\n }\n let mixBlendMode = computedStyle[MIX_BLEND_MODE];\n if(isValidMbm(mixBlendMode)) {\n ctx.globalCompositeOperation = mbmName(mixBlendMode);\n }\n else {\n ctx.globalCompositeOperation = 'source-over';\n }\n ctx.globalAlpha = __config[NODE_OPACITY];\n Cache.drawCache(target, cacheMask, transform, mx.identity(), tfo.slice(0), parentMatrix, inverse);\n ctx.globalCompositeOperation = 'source-over';\n }\n // 等于将外面bbox计算和渲染合一的过程,但不需要bbox本身的内容\n else {\n let {\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_CACHE_STYLE]: __cacheStyle,\n } = __config;\n let matrix, opacity;\n if(refreshLevel < REPAINT) {\n if(contain(refreshLevel, TRANSFORM_ALL)) {\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n if(contain(refreshLevel, OP)) {\n computedStyle[OPACITY] = currentStyle[OPACITY];\n }\n opacity = computedStyle[OPACITY];\n if(contain(refreshLevel, FT)) {\n node.__bbox = null;\n node.__calFilter(currentStyle, computedStyle);\n }\n matrix = __config[NODE_MATRIX];\n if(contain(refreshLevel, MBM)) {\n computedStyle[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE];\n }\n }\n else {\n node.__bbox = null;\n if(i === index) {\n node.__calFilter(currentStyle, computedStyle);\n }\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n opacity = computedStyle[OPACITY] = currentStyle[OPACITY];\n }\n // opacity可临时赋值下面循环渲染用,matrixEvent可能需重新计算,因为局部根节点为E没考虑继承,这里仅计算bbox用\n if(i === index) {\n opacity = 1;\n matrix = mx.identity();\n }\n else if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n assignMatrix(__config[NODE_MATRIX_EVENT], matrix);\n lastOpacity = __config[NODE_OPACITY] = parentOpacity * opacity;\n // 特殊渲染的matrix,局部根节点为原点考虑,当需要计算时再计算\n let m;\n if(i !== index && (!isE(parentMatrix) || !isE(transform))) {\n tfo = tfo.slice(0);\n tfo[0] += dbx + node.__sx1 - sx1 + tx;\n tfo[1] += dby + node.__sy1 - sy1 + ty;\n m = tf.calMatrixByOrigin(transform, tfo);\n if(!isE(parentMatrix)) {\n m = multiply(parentMatrix, m);\n }\n }\n else {\n m = null;\n }\n lastMatrix = m;\n if(m) {\n // 很多情况mask和target相同matrix,可简化计算\n if(util.equalArr(m, inverse)) {\n m = mx.identity();\n }\n else {\n inverse = mx.inverse(inverse);\n m = mx.multiply(inverse, m);\n }\n }\n if(m) {\n ctx.setTransform(m[0], m[1], m[4], m[5], m[12], m[13]);\n }\n else {\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n }\n if(refreshLevel >= REPAINT) {\n // 手动计算cacheStyle和根据border-box的坐标再渲染\n node.__calCache(renderMode, ctx, __config[NODE_DOM_PARENT],\n __config[NODE_CACHE_STYLE], __config[NODE_CURRENT_STYLE], computedStyle,\n node.clientWidth, node.clientHeight, node.offsetWidth, node.offsetHeight,\n computedStyle[BORDER_TOP_WIDTH], computedStyle[BORDER_RIGHT_WIDTH],\n computedStyle[BORDER_BOTTOM_WIDTH], computedStyle[BORDER_LEFT_WIDTH],\n computedStyle[PADDING_TOP], computedStyle[PADDING_RIGHT],\n computedStyle[PADDING_BOTTOM], computedStyle[PADDING_LEFT],\n node.__sx1, node.__sx2, node.__sx3, node.__sx4, node.__sx5, node.__sx6,\n node.__sy1, node.__sy2, node.__sy3, node.__sy4, node.__sy5, node.__sy6);\n }\n let res = node.render(renderMode, refreshLevel, ctx, CHILD, dx, dy);\n __config[NODE_REFRESH_LV] = REPAINT;\n let { offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow } = res || {};\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_BLEND, offscreenBlend]);\n ctx = offscreenBlend.target.ctx;\n }\n // 被遮罩的节点要为第一个遮罩和最后一个遮罩的索引打标,被遮罩的本身在一个离屏canvas,遮罩的元素在另外一个\n // 最后一个遮罩索引因数量不好计算,放在maskStartHash做\n if(offscreenMask) {\n let j = i + (total || 0);\n maskStartHash[j + 1] = [i, hasMask, offscreenMask];\n ctx = offscreenMask.target.ctx;\n }\n // filter造成的离屏,需要将后续一段孩子节点区域的ctx替换,并在结束后应用结果,再替换回来\n if(offscreenFilter) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_FILTER, offscreenFilter]);\n ctx = offscreenFilter.target.ctx;\n }\n // overflow:hidden的离屏,最后孩子进行截取\n if(offscreenOverflow) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_OVERFLOW, offscreenOverflow]);\n ctx = offscreenOverflow.target.ctx;\n }\n // 离屏应用,按照lv从大到小即子节点在前先应用,同一个节点多个效果按offscreen优先级从小到大来,\n // 由于mask特殊索引影响,所有离屏都在最后一个mask索引判断,此时mask本身优先结算,以index序大到小判断\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n // render后判断可见状态,此时computedStyle才有值\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n });\n }\n }\n}\n\nfunction genFilter(node, cache, v) {\n return Cache.genFilter(cache, v);\n}\n\nfunction genMask(node, cache, cb) {\n return Cache.genMask(cache, node, cb);\n}\n\nfunction genOverflow(node, cache) {\n let sbox = node.bbox;\n let bbox = cache.bbox;\n // 没超过无需生成\n if(bbox[0] >= sbox[0] && bbox[1] >= sbox[1] && bbox[2] <= sbox[2] && bbox[3] <= sbox[3]) {\n return;\n }\n return Cache.genOverflow(cache, node);\n}\n\nfunction resetMatrixCacheTotal(__structs, index, total, lv, matrixEvent) {\n let matrixList = [];\n let parentMatrix;\n let lastMatrix = matrixEvent;\n let lastLv = lv;\n for(let i = index + 1, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // 排除Text\n if(node instanceof Text) {\n continue;\n }\n let __config = node.__config;\n let {\n [NODE_MATRIX_EVENT]: old,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_CACHE_STYLE]: cacheStyle,\n } = __config;\n // 跳过display:none元素和它的所有子节点和mask\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树\n if(lv > lastLv) {\n parentMatrix = lastMatrix;\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastLv = lv;\n old = old.slice(0);\n // 计算真正的相对于root原点的matrix\n cacheStyle[MATRIX] = null;\n let matrix = node.__calMatrix(REPAINT, cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n if(!isE(parentMatrix)) {\n matrix = multiply(parentMatrix, matrix);\n }\n assignMatrix(__config[NODE_MATRIX_EVENT], matrix);\n lastMatrix = matrix;\n // 深度遍历递归进行\n if(__cacheTotal && __cacheTotal.available) {\n let needReset = __cacheTotal.isNew;\n if(!needReset && !util.equalArr(old, matrix)) {\n needReset = true;\n }\n if(needReset) {\n resetMatrixCacheTotal(__structs, i, total || 0, lv, matrix);\n }\n __cacheTotal.__isNew = false;\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n}\n\n/**\n * canvas/webgl支持任意节点为mask,不像svg仅单节点\n * hasMask的num是指遮罩对象后面的兄弟节点数,需要换算成包含子节点的总数\n * @param __structs\n * @param start\n * @param hasMask\n */\nfunction countMaskNum(__structs, start, hasMask) {\n let count = 0;\n while(hasMask--) {\n let {\n [STRUCT_TOTAL]: total,\n } = __structs[start];\n count += total || 0;\n start += total || 0;\n // total不算自身,所以还得+1\n count++;\n start++;\n }\n return count;\n}\n\n// webgl不太一样,使用fbo离屏绘制到一个纹理上进行汇总\nfunction genFrameBufferWithTexture(gl, texCache, width, height) {\n let n = texCache.lockOneChannel();\n let texture = webgl.createTexture(gl, null, n, width, height);\n let frameBuffer = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n let check = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\n if(check !== gl.FRAMEBUFFER_COMPLETE) {\n inject.error('Framebuffer object is incomplete: ' + check.toString());\n }\n // 离屏窗口0开始\n gl.viewport(0, 0, width, height);\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n return [n, frameBuffer, texture];\n}\n\n/**\n * 局部根节点复合图层生成,汇总所有子节点到一颗局部树上的位图缓存,包含超限特殊情况\n * 即便只有自己一个也要返回,因为webgl生成total的原因是有类似filter/mask等必须离屏处理的东西\n * @param gl\n * @param texCache\n * @param node\n * @param __config\n * @param index\n * @param total\n * @param __structs\n * @param cache\n * @param limitCache\n * @param hasMbm\n * @param W\n * @param H\n * @returns {*}\n */\nfunction genTotalWebgl(gl, texCache, node, __config, index, total, __structs, cache, limitCache, hasMbm, W, H) {\n // 存每层父亲的matrix和opacity和index,bbox计算过程中生成,缓存给下面渲染过程用\n let parentIndexHash = {};\n let opacityHash = {};\n let [bboxTotal, parentPm] = genBboxTotal(node, __structs, index, total, parentIndexHash, opacityHash,\n gl.getParameter(gl.MAX_TEXTURE_SIZE), limitCache);\n // 可能局部根节点合成过程中发现整体超限\n let totalLimitCache;\n if(!bboxTotal) {\n totalLimitCache = true;\n }\n // 超限情况生成画布大小的特殊纹理\n if(limitCache || totalLimitCache) {\n bboxTotal = [0, 0, W, H];\n }\n let width = bboxTotal[2] - bboxTotal[0];\n let height = bboxTotal[3] - bboxTotal[1];\n let [n, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 以bboxTotal的左上角为原点生成离屏texture\n let { __sx1: sx1, __sy1: sy1 } = node;\n let cx = width * 0.5, cy = height * 0.5;\n let dx = -bboxTotal[0], dy = -bboxTotal[1];\n let dbx = sx1 - bboxTotal[0], dby = sy1 - bboxTotal[1];\n // 先绘制自己的cache,起点所以matrix视作E为空,opacity固定1\n if(cache && cache.available) {\n texCache.addTexAndDrawWhenLimit(gl, cache, 1, null, cx, cy, dx, dy, false);\n }\n // limitCache无cache需先绘制到统一的离屏画布上\n else if(limitCache) {\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(mode.WEBGL, 0, gl, NA, 0, 0);\n let j = texCache.lockOneChannel();\n let texture = webgl.createTexture(gl, c.canvas, j);\n let mockCache = new MockCache(gl, texture, 0, 0, width, height, [0, 0, width, height]);\n texCache.addTexAndDrawWhenLimit(gl, mockCache, 1, null, cx, cy, 0, 0, false);\n texCache.refresh(gl, cx, cy);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n // 因为cacheTotal不总是以左上角原点为开始,所以必须每个节点重算matrix,合并box时计算的无法用到\n let matrixHash = {};\n // 先序遍历汇总到total\n for(let i = index + 1, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n let parentIndex = parentIndexHash[i];\n let matrix = matrixHash[parentIndex]; // 父节点的在每个节点计算后保存,第一个为top的默认为E(空)\n let opacity = opacityHash[i]; // opacity在合并box时已经计算可以直接用\n // 先看text,visibility会在内部判断,display会被parent判断\n if(node instanceof Text) {\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n texCache.addTexAndDrawWhenLimit(gl, __config[NODE_CACHE], opacity, matrix, cx, cy, dx, dy, false);\n }\n // 再看total缓存/cache,都没有的是无内容的Xom节点\n else {\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_IS_MASK]: isMask,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // mask和不可见不能被汇总到top上\n if((visibility === 'hidden' || isMask) && !node.hookGlRender) {\n continue;\n }\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n if(__cache && __cache.available) {\n tfo[0] += __cache.sx1;\n tfo[1] += __cache.sy1;\n }\n else {\n tfo[0] += node.__sx1;\n tfo[1] += node.__sy1;\n }\n let dx = -sx1 + dbx;\n let dy = -sy1 + dby;\n tfo[0] += dx;\n tfo[1] += dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n if(target) {\n // 局部的mbm和主画布一样,先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成\n if(isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy, false);\n texCache.refresh(gl, cx, cy);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前fbo作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy, false);\n }\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n // webgl特殊的外部钩子,比如粒子组件自定义渲染时调用\n if(node.hookGlRender) {\n node.hookGlRender(gl, opacity, matrix, cx, cy, dx, dy, false);\n }\n }\n }\n if(node.hookGlRender) {\n node.hookGlRender(gl, 1, null, cx, cy, dx, dy, false);\n }\n // 绘制到fbo的纹理对象上并删除fbo恢复\n texCache.refresh(gl, cx, cy);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 生成的纹理对象本身已绑定一个纹理单元了,释放lock的同时可以给texCache的channel缓存,避免重复上传\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bboxTotal);\n texCache.releaseLockChannel(n, mockCache.page);\n return [limitCache || totalLimitCache, mockCache];\n}\n\nfunction genFilterWebgl(gl, texCache, node, cache, filter, W, H) {\n let { sx1, sy1, width, height, bbox } = cache;\n let mockCache = cache;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n let res = genBlurWebgl(gl, texCache, mockCache, v, width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'hue-rotate') {\n let rotation = geom.d2r(v % 360);\n let cosR = Math.cos(rotation);\n let sinR = Math.sin(rotation);\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + cosR * 0.787 - sinR * 0.213, 0.715 - cosR * 0.715 - sinR * 0.715, 0.072 - cosR * 0.072 + sinR * 0.928, 0, 0,\n 0.213 - cosR * 0.213 + sinR * 0.143, 0.715 + cosR * 0.285 + sinR * 0.140, 0.072 - cosR * 0.072 - sinR * 0.283, 0, 0,\n 0.213 - cosR * 0.213 - sinR * 0.787, 0.715 - cosR * 0.715 + sinR * 0.715, 0.072 + cosR * 0.928 + sinR * 0.072, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'saturate' && v !== 100) {\n let amount = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + 0.787 * amount, 0.715 - 0.715 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 + 0.285 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 - 0.715 * amount, 0.072 + 0.928 * amount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'brightness' && v !== 100) {\n let b = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'grayscale' && v > 0) {\n v = Math.min(v, 100);\n let oneMinusAmount = 1 - v * 0.01;\n if(oneMinusAmount < 0) {\n oneMinusAmount = 0;\n }\n else if(oneMinusAmount > 1) {\n oneMinusAmount = 1;\n }\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.2126 + 0.7874 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 + 0.2848 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 + 0.9278 * oneMinusAmount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'contrast' && v !== 100) {\n let amount = v * 0.01;\n let o = -0.5 * amount + 0.5;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n amount, 0, 0, 0, o,\n 0, amount, 0, 0, o,\n 0, 0, amount, 0, o,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'sepia' && v > 0) {\n v = Math.min(v, 100);\n let oneMinusAmount = 1 - v * 0.01;\n if(oneMinusAmount < 0) {\n oneMinusAmount = 0;\n }\n else if(oneMinusAmount > 1) {\n oneMinusAmount = 1;\n }\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.393 + 0.607 * oneMinusAmount, 0.769 - 0.769 * oneMinusAmount, 0.189 - 0.189 * oneMinusAmount, 0, 0,\n 0.349 - 0.349 * oneMinusAmount, 0.686 + 0.314 * oneMinusAmount, 0.168 - 0.168 * oneMinusAmount, 0, 0,\n 0.272 - 0.272 * oneMinusAmount, 0.534 - 0.534 * oneMinusAmount, 0.131 + 0.869 * oneMinusAmount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'invert' && v > 0) {\n v = Math.min(v, 100);\n let o = v * 0.01;\n let amount = 1 - 2 * o;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n amount, 0, 0, 0, o,\n 0, amount, 0, 0, o,\n 0, 0, amount, 0, o,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n });\n // 切换回主程序\n gl.useProgram(gl.program);\n gl.viewport(0, 0, W, H);\n return mockCache;\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核d扩大3倍性能慢\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * 先动态生成gl程序,默认3核源码示例已注释,根据sigma获得d(一定奇数),再计算权重\n * 然后将d尺寸和权重拼接成真正程序并编译成program,再开始绘制\n */\nfunction genBlurWebgl(gl, texCache, cache, sigma, width, height, sx1, sy1, bbox) {\n let d = blur.kernelSize(sigma);\n let max = Math.max(15, gl.getParameter(gl.MAX_VARYING_VECTORS));\n while(d > max) {\n d -= 2;\n }\n let spread = blur.outerSizeByD(d);\n width += spread * 2;\n height += spread * 2;\n // 防止超限,webgl最大纹理尺寸限制\n let limit = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n if(width > limit || height > limit) {\n return;\n }\n bbox = bbox.slice(0);\n bbox[0] -= spread;\n bbox[1] -= spread;\n bbox[2] += spread;\n bbox[3] += spread;\n let cx = width * 0.5, cy = height * 0.5;\n let weights = blur.gaussianWeight(sigma, d);\n let vert = '';\n let frag = '';\n let r = Math.floor(d * 0.5);\n for(let i = 0; i < r; i++) {\n let c = (r - i) * 0.01;\n vert += `v_texCoordsBlur[${i}] = a_texCoords + vec2(-${c}, -${c}) * u_direction;`;\n frag += `gl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i}]) * ${weights[i]};`;\n }\n vert += `v_texCoordsBlur[${r}] = a_texCoords;`;\n frag += `gl_FragColor += texture2D(u_texture, v_texCoordsBlur[${r}]) * ${weights[r]};`;\n for(let i = 0; i < r; i++) {\n let c = (i + 1) * 0.01;\n vert += `v_texCoordsBlur[${i + r + 1}] = a_texCoords + vec2(${c}, ${c}) * u_direction;`;\n frag += `gl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i + r + 1}]) * ${weights[i + r + 1]};`;\n }\n vert = vertexBlur.replace('[3]', '[' + d + ']').replace(/}$/, vert + '}');\n frag = fragmentBlur.replace('[3]', '[' + d + ']').replace(/}$/, frag + '}');\n let program = webgl.initShaders(gl, vert, frag);\n gl.useProgram(program);\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n texture = webgl.drawBlur(gl, program, frameBuffer, texCache, texture, cache.page.texture, i, j,\n width, height, cx, cy, spread, d, sigma);\n // 销毁这个临时program\n gl.deleteShader(program.vertexShader);\n gl.deleteShader(program.fragmentShader);\n gl.deleteProgram(program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n texCache.releaseLockChannel(j);\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox);\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genColorMatrixWebgl(gl, texCache, cache, m, width, height, sx1, sy1, bbox) {\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n gl.useProgram(gl.programCm);\n webgl.drawCm(gl, gl.programCm, j, m);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox.slice(0));\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genOverflowWebgl(gl, texCache, node, cache, W, H) {\n let sbox = node.bbox.slice(0);\n let bbox = cache.bbox;\n // 没超过无需生成\n if(bbox[0] >= sbox[0] && bbox[1] >= sbox[1] && bbox[2] <= sbox[2] && bbox[3] <= sbox[3]) {\n return;\n }\n let width = sbox[2] - sbox[0], height = sbox[3] - sbox[1];\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n // 绘制,根据坐标裁剪使用原本纹理的一部分\n gl.useProgram(gl.programOverflow);\n webgl.drawOverflow(gl, j, sbox[0] - bbox[0], sbox[1] - bbox[1], width, height, cache.width, cache.height);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let overflowCache = new MockCache(gl, texture, cache.sx1, cache.sy1, width, height, sbox);\n texCache.releaseLockChannel(i, overflowCache.page);\n return overflowCache;\n}\n\nfunction genMaskWebgl(gl, texCache, node, __config, cache, W, H, lv, __structs) {\n let { sx1, sy1, width, height, bbox, dx, dy } = cache;\n // cache一定是mockCache,可能是total/filter/overflow一种\n let cx = width * 0.5, cy = height * 0.5;\n // 先求得被遮罩的matrix,用作inverse给mask计算\n let {\n [NODE_COMPUTED_STYLE]: {\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n },\n } = __config;\n let inverse;\n if(isE(transform)) {\n inverse = mx.identity();\n }\n else {\n let tfo = transformOrigin.slice(0);\n tfo[0] += sx1 + dx;\n tfo[1] += sy1 + dy;\n inverse = tf.calMatrixByOrigin(transform, tfo);\n }\n inverse = mx.inverse(inverse);\n // 将所有mask绘入一个单独纹理中,尺寸和原点与被遮罩total相同,才能做到顶点坐标一致\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n let next = node.next;\n let isClip = next.isClip;\n let list = [];\n while(next && next.isMask && next.isClip === isClip) {\n list.push(next);\n next = next.next;\n }\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n let matrixList = [];\n let parentMatrix;\n let lastMatrix;\n let opacityList = [];\n let parentOpacity = 1;\n let lastOpacity;\n let lastLv = lv;\n let {\n [STRUCT_INDEX]: index,\n [STRUCT_TOTAL]: total,\n } = item.__config[NODE_STRUCT];\n // 可以忽略mbm,因为只有透明遮罩\n for(let i = index, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n let {\n [NODE_CACHE]: __cache,\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_LIMIT_CACHE]: limitCache,\n } = __config;\n // 跳过display:none元素和它的所有子节点和mask\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n if(node instanceof Text) {\n if(__cache && __cache.available) {\n // text用父级的matrixEvent,在之前texCache添加到末尾了\n texCache.addTexAndDrawWhenLimit(gl, __cache, parentOpacity, texCache.last[2], cx, cy, 0, 0,true);\n }\n else if(limitCache) {\n return;\n }\n }\n else {\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_COMPUTED_STYLE]: {\n [OPACITY]: opacity,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n },\n } = __config;\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,根节点是第一个特殊处理\n if(i === index) {}\n else if(lv > lastLv) {\n parentMatrix = lastMatrix;\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n parentOpacity = lastOpacity;\n opacityList.push(parentOpacity);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n opacityList.splice(-diff);\n parentOpacity = opacityList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastLv = lv;\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n // total和自身cache的尝试,visibility不可见时没有cache\n if(target) {\n let m;\n if(isE(transform)) {\n m = mx.identity();\n }\n else {\n let tfo = transformOrigin.slice(0);\n tfo[0] += target.bbox[0] + dx;\n tfo[1] += target.bbox[1] + dy;\n m = tf.calMatrixByOrigin(transform, tfo);\n }\n m = mx.multiply(inverse, m);\n let tfo = transformOrigin.slice(0);\n tfo[0] += target.bbox[0] + dx;\n tfo[1] += target.bbox[1] + dy;\n lastMatrix = tf.calMatrixByOrigin(transform, tfo);\n if(!isE(parentMatrix)) {\n lastMatrix = multiply(parentMatrix, lastMatrix);\n }\n lastOpacity = parentOpacity * opacity;\n texCache.addTexAndDrawWhenLimit(gl, target, lastOpacity, m, cx, cy, dx, dy, true);\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n else if(limitCache) {\n return;\n }\n }\n }\n }\n texCache.refresh(gl, cx, cy);\n gl.deleteFramebuffer(frameBuffer);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况mask变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n // 生成最终纹理,汇总total和maskCache\n let [n, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n let program;\n if(isClip) {\n program = gl.programClip;\n }\n else {\n program = gl.programMask;\n }\n gl.useProgram(program);\n webgl.drawMask(gl, i, j, program);\n gl.deleteTexture(texture);\n texCache.releaseLockChannel(i);\n texCache.releaseLockChannel(j);\n // 切换回主程序\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer2);\n // 同total一样生成一个mockCache\n let maskCache = new MockCache(gl, texture2, sx1, sy1, width, height, bbox);\n texCache.releaseLockChannel(n, maskCache.page);\n return maskCache;\n}\n\n/**\n * 生成blendMode混合fbo纹理结果,原本是所有元素向一个fbo记A进行绘制,当出现mbm时,进入到这里,\n * 先生成一个新的fbo记B,将A和待混合节点进行对应的mbm模式混合,结果绘制到B中,然后返回B来替换A,包括纹理单元\n * @param gl\n * @param texCache\n * @param i 之前已有的fbo和纹理单元\n * @param j 当前节点绘制的fbo和纹理单元\n * @param mbm\n * @param fbo 之前舞台绑定的fbo和纹理\n * @param tex\n * @param W\n * @param H\n * @returns {number|*}\n */\nfunction genMbmWebgl(gl, texCache, i, j, fbo, tex, mbm, W, H) {\n let frag;\n mbm = mbmName(mbm);\n if(mbm === 'multiply') {\n frag = fragmentMultiply;\n }\n else if(mbm === 'screen') {\n frag = fragmentScreen;\n }\n else if(mbm === 'overlay') {\n frag = fragmentOverlay;\n }\n else if(mbm === 'darken') {\n frag = fragmentDarken;\n }\n else if(mbm === 'lighten') {\n frag = fragmentLighten;\n }\n else if(mbm === 'color-dodge') {\n frag = fragmentColorDodge;\n }\n else if(mbm === 'color-burn') {\n frag = fragmentColorBurn;\n }\n else if(mbm === 'hard-light') {\n frag = fragmentHardLight;\n }\n else if(mbm === 'soft-light') {\n frag = fragmentSoftLight;\n }\n else if(mbm === 'difference') {\n frag = fragmentDifference;\n }\n else if(mbm === 'exclusion') {\n frag = fragmentExclusion;\n }\n else if(mbm === 'hue') {\n frag = fragmentHue;\n }\n else if(mbm === 'saturation') {\n frag = fragmentSaturation;\n }\n else if(mbm === 'color') {\n frag = fragmentColor;\n }\n else if(mbm === 'luminosity') {\n frag = fragmentLuminosity;\n }\n let program = webgl.initShaders(gl, vertexMbm, frag);\n gl.useProgram(program);\n // 生成新的fbo,将混合结果绘入\n let [n, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, W, H);\n webgl.drawMbm(gl, program, i, j, W, H);\n // 切换回主程序并销毁这个临时program\n gl.useProgram(gl.program);\n gl.deleteShader(program.vertexShader);\n gl.deleteShader(program.fragmentShader);\n gl.deleteProgram(program);\n gl.deleteFramebuffer(fbo);\n gl.deleteTexture(tex);\n texCache.releaseLockChannel(i);\n texCache.releaseLockChannel(j);\n return [n, frameBuffer, texture];\n}\n\nfunction renderSvg(renderMode, ctx, root, isFirst) {\n let { __structs, width, height } = root;\n // mask节点很特殊,本身有matrix会影响,本身没改变但对象节点有改变也需要计算逆矩阵应用顶点\n let maskEffectHash = {};\n if(!isFirst) {\n // 先遍历一遍收集完全不变的defs,缓存起来id,随后再执行遍历渲染生成新的,避免掉重复的id\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let {\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_DEFS_CACHE]: defsCache,\n } = node.__config;\n // 只要涉及到matrix和opacity就影响mask\n let hasEffectMask = hasMask && (refreshLevel >= REPAINT || contain(refreshLevel, TRANSFORM_ALL | OP));\n if(hasEffectMask) {\n let start = i + (total || 0) + 1;\n let end = start + hasMask;\n // mask索引遍历时处理,暂存遮罩对象的刷新lv\n maskEffectHash[end - 1] = refreshLevel;\n }\n // >=REPAINT重绘生成走render()跳过这里\n if(refreshLevel < REPAINT) {\n // 特殊的mask判断,遮罩对象影响这个mask了,除去filter、遮罩对象无TRANSFORM变化外都可缓存\n if(maskEffectHash.hasOwnProperty(i)) {\n let v = maskEffectHash[i];\n if(!contain(refreshLevel, TRANSFORM_ALL) && v < REPAINT && !contain(v, TRANSFORM_ALL)) {\n defsCache.forEach(item => {\n ctx.addCache(item);\n });\n }\n }\n // 去除特殊的filter,普通节点或不影响的mask在 {\n ctx.addCache(item);\n });\n }\n }\n }\n }\n let maskHash = {};\n // 栈代替递归,存父节点的matrix/opacity,matrix为E时存null省略计算\n let matrixList = [];\n let parentMatrix;\n let vdList = [];\n let parentVd;\n let lastLv = 0;\n let lastConfig;\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n [STRUCT_LV]: lv,\n } = __structs[i];\n let __config = node.__config;\n let {\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_DEFS_CACHE]: defsCache,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = __config;\n let display = computedStyle[DISPLAY];\n // 将随后的若干个mask节点范围存下来\n if(hasMask && display !== 'none') {\n let start = i + (total || 0) + 1;\n let end = start + hasMask;\n // svg限制了只能Geom单节点,不可能是Dom,所以end只有唯一\n maskHash[end - 1] = {\n index: i,\n start,\n end,\n isClip: __structs[start][STRUCT_NODE].isClip, // 第一个节点是clip为准\n };\n }\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,Root节点第一个特殊处理\n if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n vdList.splice(-diff);\n parentVd = vdList[lv - 1];\n }\n else if(lv > lastLv) {\n matrixList.push(lastConfig[NODE_MATRIX]);\n let vd = lastConfig[NODE_VIRTUAL_DOM];\n vdList.push(vd);\n parentVd = vd;\n }\n lastConfig = __config;\n let virtualDom;\n // svg小刷新等级时直接修改vd,这样Geom不再感知\n if(refreshLevel < REPAINT && !(node instanceof Text)) {\n __config[NODE_REFRESH_LV] = NONE;\n virtualDom = __config[NODE_VIRTUAL_DOM];\n // total可以跳过所有孩子节点省略循环\n if(__cacheTotal && __cacheTotal.available) {\n i += (total || 0);\n virtualDom.cache = true;\n }\n else {\n __cacheTotal && (__cacheTotal.available = true);\n virtualDom = __config[NODE_VIRTUAL_DOM] = node.__virtualDom = util.extend({}, virtualDom);\n // dom要清除children缓存,geom和img无需\n if(node instanceof Dom && !(node instanceof Img)) {\n virtualDom.children = [];\n }\n // 还得判断,和img加载混在一起时,触发刷新如果display:none,则还有cacheTotal\n if(display === 'none') {\n i += (total || 0);\n if(hasMask) {\n i += hasMask;\n }\n }\n else {\n delete virtualDom.cache;\n }\n }\n let {\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_COMPUTED_STYLE]: computedStyle,\n [NODE_CACHE_STYLE]: __cacheStyle,\n } = __config;\n if(contain(refreshLevel, TRANSFORM_ALL)) {\n let matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n assignMatrix(m, matrix);\n if(!matrix || isE(matrix)) {\n delete virtualDom.transform;\n }\n else {\n virtualDom.transform = 'matrix(' + util.joinArr(mx.m2m6(matrix), ',') + ')';\n }\n if(parentMatrix && matrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n m = __config[NODE_MATRIX_EVENT];\n assignMatrix(m, matrix);\n }\n if(contain(refreshLevel, OP)) {\n let opacity = computedStyle[OPACITY] = currentStyle[OPACITY];\n if(opacity === 1) {\n delete virtualDom.opacity;\n }\n else {\n virtualDom.opacity = opacity;\n }\n }\n if(contain(refreshLevel, FT)) {\n let filter = node.__calFilter(currentStyle, computedStyle);\n let s = painter.svgFilter(filter);\n if(s) {\n virtualDom.filter = s;\n }\n else {\n delete virtualDom.filter;\n }\n }\n if(contain(refreshLevel, MBM)) {\n let mixBlendMode = computedStyle[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE];\n if(isValidMbm(mixBlendMode)) {\n virtualDom.mixBlendMode = mbmName(mixBlendMode);\n }\n else {\n delete virtualDom.mixBlendMode;\n }\n }\n virtualDom.lv = refreshLevel;\n }\n else {\n // >=REPAINT会调用render,重新生成defsCache,text没有这个东西\n __config[NODE_DEFS_CACHE] && __config[NODE_DEFS_CACHE].splice(0);\n node.render(renderMode, refreshLevel, ctx, NA, 0, 0);\n virtualDom = __config[NODE_VIRTUAL_DOM];\n // 渲染后更新取值\n display = computedStyle[DISPLAY];\n if(display === 'none') {\n i += (total || 0);\n if(hasMask) {\n i += hasMask;\n }\n }\n }\n /**\n * mask会在join时过滤掉,这里将假设正常渲染的vd的内容获取出来组成defs的mask内容\n * 另外最初遍历时记录了会影响的mask,在=REPAINT始终重新设置\n * 本身有matrix也需要重设\n */\n if(maskHash.hasOwnProperty(i) && (maskEffectHash.hasOwnProperty(i) || refreshLevel >= REPAINT || contain(refreshLevel, TRANSFORM_ALL | OP))) {\n let { index, start, end, isClip } = maskHash[i];\n let target = __structs[index];\n let dom = target[STRUCT_NODE];\n let mChildren = [];\n // clip模式时,先添加兜底整个白色使得全部都可见,mask本身变反色(黑色)\n if(isClip) {\n mChildren.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', `M0,0L${width},0L${width},${height}L0,${height}L0,0`],\n ['fill', 'rgba(255,255,255,1)'],\n ['stroke-width', 0],\n ],\n });\n }\n for(let j = start; j < end; j++) {\n let node = __structs[j][STRUCT_NODE];\n let { computedStyle: { [DISPLAY]: display, [VISIBILITY]: visibility, [FILL]: fill },\n virtualDom: { children, opacity } } = node;\n if(display !== 'none' && visibility !== 'hidden') {\n // 引用相同无法diff,需要clone\n children = util.clone(children);\n mChildren = mChildren.concat(children);\n for(let k = 0, len = children.length; k < len; k++) {\n let { tagName, props } = children[k];\n if(tagName === 'path') {\n if(isClip) {\n for(let j = 0, len = props.length; j < len; j++) {\n let item = props[j];\n if(item[0] === 'fill') {\n item[1] = util.int2invert(fill[0]);\n }\n }\n }\n let matrix = node.matrix;\n let ivs = inverse(dom.matrix);\n matrix = multiply(ivs, matrix);\n // path没有transform属性,在vd上,需要弥补\n props.push(['transform', `matrix(${util.joinArr(mx.m2m6(matrix), ',')})`]);\n // path没有opacity属性,在vd上,需要弥补\n if(!util.isNil(opacity) && opacity !== 1) {\n props.push(['opacity', opacity]);\n }\n }\n // img可能有matrix属性,需判断\n else if(tagName === 'image') {\n let hasTransform = -1;\n for(let m = 0, len = props.length; m < len; m++) {\n if(props[m][0] === 'transform') {\n hasTransform = m;\n break;\n }\n }\n if(hasTransform === -1) {\n let ivs = inverse(dom.matrix);\n if(!isE(ivs)) {\n props.push(['transform', `matrix(${util.joinArr(mx.m2m6(ivs), ',')})`]);\n }\n }\n else {\n let matrix = props[hasTransform][1].match(/[\\d.]+/g).map(i => parseFloat(i));\n let ivs = inverse(dom.matrix);\n matrix = multiply(ivs, matrix);\n props[hasTransform][1] = `matrix(${util.joinArr(mx.m2m6(matrix), ',')})`;\n }\n }\n }\n }\n }\n // 清掉上次的\n for(let i = defsCache.length - 1; i >= 0; i--) {\n let item = defsCache[i];\n if(item.tagName === 'mask') {\n defsCache.splice(i, 1);\n }\n }\n let o = {\n tagName: 'mask',\n props: [],\n children: mChildren,\n };\n let id = ctx.add(o);\n defsCache.push(o);\n id = 'url(#' + id + ')';\n dom.virtualDom.mask = id;\n }\n // mask不入children\n if(parentVd && !node.isMask) {\n parentVd.children.push(virtualDom);\n }\n if(i === 0) {\n parentMatrix = __config[NODE_MATRIX];\n parentVd = virtualDom;\n }\n lastLv = lv;\n }\n}\n\nfunction renderWebgl(renderMode, gl, root) {\n let { __structs, width, height, texCache } = root;\n let cx = width * 0.5, cy = height * 0.5;\n // 栈代替递归,存父节点的matrix/opacity,matrix为E时存null省略计算\n let matrixList = [];\n let parentMatrix;\n let opacityList = [];\n let parentOpacity = 1;\n let pmList = [];\n let parentPm;\n let lastRefreshLevel;\n let lastConfig;\n let lastLv = 0;\n let mergeList = [];\n let hasMbm; // 是否有混合模式出现\n /**\n * 先一遍先序遍历每个节点绘制到自己__cache上,排除Text和已有的缓存以及局部根缓存,\n * 根据refreshLevel进行等级区分,可能是=REPAINT,REFLOW布局已前置处理完。\n * 首次绘制没有catchTotal等,后续则可能会有,在= REPAINT) {\n node.render(renderMode, REPAINT, gl, SELF, 0, 0);\n }\n continue;\n }\n let __config = node.__config;\n let refreshLevel = __config[NODE_REFRESH_LV];\n // lv变大说明是child,相等是sibling,变小可能是parent或另一棵子树,Root节点是第一个特殊处理\n if(i === 0) {}\n else if(lv > lastLv) {\n parentMatrix = lastConfig[NODE_MATRIX_EVENT];\n if(isE(parentMatrix)) {\n parentMatrix = null;\n }\n matrixList.push(parentMatrix);\n parentOpacity = lastConfig[NODE_OPACITY];\n opacityList.push(parentOpacity);\n parentPm = lastConfig[NODE_PERSPECTIVE_MATRIX];\n if(isE(parentPm)) {\n parentPm = null;\n }\n pmList.push(parentPm);\n }\n // 变小出栈索引需注意,可能不止一层,多层计算diff层级\n else if(lv < lastLv) {\n let diff = lastLv - lv;\n matrixList.splice(-diff);\n parentMatrix = matrixList[lv - 1];\n opacityList.splice(-diff);\n parentOpacity = opacityList[lv - 1];\n pmList.splice(-diff);\n parentPm = pmList[lv - 1];\n }\n // 不变是同级兄弟,无需特殊处理 else {}\n lastRefreshLevel = refreshLevel;\n lastConfig = __config;\n lastLv = lv;\n let {\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = __config;\n // 跳过display:none元素和它的所有子节点\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0);\n // 只跳过自身不能跳过后面的mask,mask要渲染自身并进行缓存cache,以备对象切换display用\n continue;\n }\n let hasRecordAsMask;\n /**\n * lv=REPAINT那里,小变化不动\n * 当有遮罩时,如果被遮罩节点本身无变更,需要检查其next的遮罩节点有无变更,\n * 但其实不用检查,因为next变更一定会清空cacheMask,只要检查cacheMask即可\n * 如果没有或无效,直接添加,无视节点本身变化,后面防重即可\n */\n if(refreshLevel < REPAINT) {\n __config[NODE_REFRESH_LV] = NONE;\n if(hasMask) {\n let cacheMask = __config[NODE_CACHE_MASK];\n if(!cacheMask || !cacheMask.available) {\n hasRecordAsMask = [i, lv, total, node, __config, null, hasMask];\n mergeList.push(hasRecordAsMask);\n }\n }\n let {\n [NODE_CURRENT_STYLE]: currentStyle,\n [NODE_CACHE_STYLE]: __cacheStyle,\n [NODE_MATRIX_EVENT]: matrixEvent,\n } = __config;\n if(contain(refreshLevel, PPT)) {\n node.__calPerspective(__cacheStyle, currentStyle, computedStyle, __config);\n }\n // transform变化,父元素的perspective变化也会在Root特殊处理重新计算\n let matrix;\n if(contain(refreshLevel, TRANSFORM_ALL)) {\n matrix = node.__calMatrix(refreshLevel, __cacheStyle, currentStyle, computedStyle, __config);\n assignMatrix(__config[NODE_MATRIX], matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n // node本身有或者父有perspective都认为需要生成3d渲染上下文\n if(tf.isPerspectiveMatrix(matrix) || parentPm) {\n if(hasRecordAsMask) {\n hasRecordAsMask[9] = true;\n }\n else {\n hasRecordAsMask = [i, lv, total, node, __config, null, null, null, null, true];\n }\n }\n // 先左乘perspective的矩阵,再左乘父级的总矩阵\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n assignMatrix(matrixEvent, matrix);\n let opacity;\n if(contain(refreshLevel, OP)) {\n opacity = computedStyle[OPACITY] = currentStyle[OPACITY];\n }\n else {\n opacity = computedStyle[OPACITY];\n }\n __config[NODE_OPACITY] = parentOpacity * opacity;\n // filter会改变bbox范围\n if(contain(refreshLevel, FT)) {\n node.__bbox = null;\n let filter = node.__calFilter(currentStyle, computedStyle);\n // 防重\n if(hasRecordAsMask) {\n hasRecordAsMask[7] = filter;\n }\n else {\n // 强制存hasMask,因为filter改变影响mask\n hasRecordAsMask = [i, lv, total, node, __config, null, hasMask, filter];\n mergeList.push(hasRecordAsMask);\n }\n }\n if(contain(refreshLevel, MBM)) {\n computedStyle[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE];\n }\n // total可以跳过所有孩子节点省略循环,filter/mask等的强制前提是有total\n if(__cacheTotal && __cacheTotal.available) {\n i += (total || 0);\n continue;\n }\n }\n /**\n * >=REPAINT重新渲染,并根据结果判断是否离屏限制错误\n * Geom没有子节点无需汇总局部根,Dom中Img也是,它们的局部根等于自身的cache,其它符合条件的Dom需要生成\n */\n else {\n let res = node.render(renderMode, refreshLevel, gl, SELF, 0, 0);\n // geom可返回texture纹理,替代原有xom的__cache纹理\n if(res && inject.isWebGLTexture(res.texture)) {\n let { __sx1: sx1, __sy1: sy1, offsetWidth: w, offsetHeight: h, bbox } = node;\n __config[NODE_CACHE] = new MockCache(gl, res.texture, sx1, sy1, w, h, bbox);\n gl.viewport(0, 0, width, height);\n gl.useProgram(gl.program);\n }\n }\n // 每个元素检查cacheTotal生成,已有的上面会continue跳过\n let {\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE_AS_BITMAP]: cacheAsBitmap,\n } = __config;\n let {\n [OVERFLOW]: overflow,\n [FILTER]: filter,\n [MIX_BLEND_MODE]: mixBlendMode,\n [TRANSFORM]: transform,\n } = computedStyle;\n let validMbm = isValidMbm(mixBlendMode);\n // 3d渲染上下文\n let isPerspective = tf.isPerspectiveMatrix(transform) || parentPm;\n if(cacheAsBitmap || hasMask || filter.length || (overflow === 'hidden' && total) || validMbm || isPerspective) {\n if(validMbm) {\n hasMbm = true;\n }\n if(hasRecordAsMask) {\n hasRecordAsMask[5] = limitCache;\n hasRecordAsMask[7] = filter;\n hasRecordAsMask[8] = overflow;\n hasRecordAsMask[9] = isPerspective;\n hasRecordAsMask[10] = cacheAsBitmap;\n }\n else {\n mergeList.push([i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective, cacheAsBitmap]);\n }\n }\n }\n let limitHash = {};\n // 根据收集的需要合并局部根的索引,尝试合并,按照层级从大到小,索引从大到小的顺序,\n // 这样保证子节点在前,后节点在前,后节点是为了mask先应用自身如filter之后再进行遮罩\n if(mergeList.length) {\n mergeList.sort(function(a, b) {\n if(a[1] === b[1]) {\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n // ppt只有嵌套才需要生成,最下面的孩子节点的ppt无需,因此记录一个hash存index,\n // 同时因为是后序遍历,孩子先存所有父亲的index即可保证父亲才能生成cacheTotal\n let pptHash = {};\n mergeList.forEach(item => {\n let [i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective, cacheAsBitmap] = item;\n // 有ppt的,向上查找所有父亲index记录,可能出现重复记得提前跳出\n if(isPerspective) {\n let parent = __config[NODE_DOM_PARENT];\n while(parent) {\n let config = parent.__config;\n let idx = config[NODE_STRUCT][STRUCT_INDEX];\n if(pptHash[idx]) {\n break;\n }\n if(tf.isPerspectiveMatrix(config[NODE_MATRIX]) || config[NODE_PERSPECTIVE_MATRIX]) {\n pptHash[idx] = true;\n }\n parent = config[NODE_DOM_PARENT];\n }\n if(!pptHash[i] && !hasMask && !filter.length && overflow !== 'hidden' && !cacheAsBitmap) {\n return;\n }\n }\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n } = __config;\n let needGen;\n // 可能没变化,比如被遮罩节点、filter变更等\n if(!__cacheTotal || !__cacheTotal.available) {\n let [limit, res] = genTotalWebgl(gl, texCache, node, __config, i, total || 0, __structs, __cache, limitCache, hasMbm, width, height);\n __cacheTotal = res;\n needGen = true;\n limitCache = limit;\n // 返回的limit包含各种情况超限,一旦超限,只能生成临时cacheTotal不能保存\n if(!limitCache) {\n __config[NODE_CACHE_TOTAL] = res;\n }\n }\n // 即使超限,也有total结果\n let target = __cacheTotal;\n if(overflow === 'hidden') {\n if(!__cacheOverflow || !__cacheOverflow.available || needGen) {\n let temp = genOverflowWebgl(gl, texCache, node, target, width, height);\n if(temp) {\n target = temp;\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n }\n if(filter.length) {\n if(!__cacheFilter || !__cacheFilter.available || needGen) {\n let old = target;\n target = genFilterWebgl(gl, texCache, node, target, filter, width, height);\n if(target !== old) {\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n }\n if(hasMask && (!__cacheMask || !__cacheMask.available || needGen)) {\n target = genMaskWebgl(gl, texCache, node, __config, target, width, height, lv, __structs);\n if(!limitCache) {\n __config[NODE_CACHE_MASK] = target;\n }\n }\n // 保存临时的局部根节点\n if(limitCache) {\n limitHash[i] = target;\n }\n });\n }\n /**\n * 最后先序遍历一次应用__cacheTotal即可,没有的用__cache,以及剩下的超尺寸的和Text\n * 由于mixBlendMode的存在,需先申请个fbo纹理,所有绘制默认向该纹理绘制,最后fbo纹理再进入主画布\n * 前面循环时有记录是否出现mbm,只有出现才申请,否则不浪费直接输出到主画布\n * 超尺寸的要走无cache逻辑render,和canvas很像,除了离屏canvas超限,汇总total也会纹理超限\n */\n let n, frameBuffer, texture;\n if(hasMbm) {\n [n, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n }\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n // text如果display不可见,parent会直接跳过,不会走到这里,这里一定是直接绘制到root的,visibility在其内部判断\n if(node instanceof Text) {\n // text特殊之处,__config部分是复用parent的\n let {\n [NODE_CACHE]: __cache,\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_DOM_PARENT]: {\n __config: {\n [NODE_MATRIX_EVENT]: matrixEvent,\n [NODE_OPACITY]: opacity,\n },\n },\n } = __config;\n if(__cache && __cache.available) {\n texCache.addTexAndDrawWhenLimit(gl, __cache, opacity, matrixEvent, cx, cy, 0, 0,true);\n }\n // 超限特殊处理,先生成画布尺寸大小的纹理然后原始位置绘制\n else if(limitCache) {\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(renderMode, 0, gl, NA, 0, 0);\n let j = texCache.lockOneChannel();\n let texture = webgl.createTexture(gl, c.canvas, j);\n let mockCache = new MockCache(gl, texture, 0, 0, width, height, [0, 0, width, height]);\n texCache.addTexAndDrawWhenLimit(gl, mockCache, opacity, matrixEvent, cx, cy, 0, 0, true);\n texCache.refresh(gl, cx, cy, true);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n }\n else {\n let {\n [NODE_OPACITY]: opacity,\n [NODE_MATRIX_EVENT]: matrixEvent,\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // 有total的可以直接绘制并跳过子节点索引,忽略total本身,其独占用纹理单元,注意特殊不取cacheTotal,\n // 这种情况发生在只有overflow:hidden声明但无效没有生成__cacheOverflow的情况,\n // 因为webgl纹理单元缓存原因,所以不用cacheTotal防止切换性能损耗\n // 已取消,因为perspective需要进行独立上下文渲染\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n // total和自身cache的尝试,visibility不可见时没有cache\n if(target) {\n // 有mbm先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成\n if(hasMbm && isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy, true);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrixEvent, cx, cy, 0, 0, true);\n texCache.refresh(gl, cx, cy, true);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前画布作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrixEvent, cx, cy, 0, 0, true);\n }\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n else if(limitHash.hasOwnProperty(i)) {\n let target = limitHash[i];\n if(hasMbm && isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy, true);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrixEvent, cx, cy, 0, 0, true);\n texCache.refresh(gl, cx, cy, true);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前画布作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrixEvent, cx, cy, 0, 0, true);\n }\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n // 超限的情况,这里是普通单节点超限,没有合成total后再合成特殊cache如filter/mask/mbm之类的,\n // 直接按原始位置绘制到离屏canvas,再作为纹理绘制即可,特殊的在total那做过降级了\n else if(limitCache && display !== 'none' && visibility !== 'hidden') {\n let c = inject.getCacheCanvas(width, height, '__$$OVERSIZE$$__');\n node.render(renderMode, refreshLevel, gl, NA, 0, 0);\n let j = texCache.lockOneChannel();\n let texture = webgl.createTexture(gl, c.canvas, j);\n let mockCache = new MockCache(gl, texture, 0, 0, width, height, [0, 0, width, height]);\n texCache.addTexAndDrawWhenLimit(gl, mockCache, opacity, matrixEvent, cx, cy, 0, 0, true);\n texCache.refresh(gl, cx, cy, true);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n // webgl特殊的外部钩子,比如粒子组件自定义渲染时调用\n if(node.hookGlRender) {\n node.hookGlRender(gl, opacity, matrixEvent, cx, cy, 0, 0, true);\n }\n }\n }\n texCache.refresh(gl, cx, cy, true);\n // 有mbm时将汇总的fbo绘入主画布,否则本身就是到主画布无需多余操作\n if(hasMbm) {\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n texCache.releaseLockChannel(n);\n gl.deleteFramebuffer(frameBuffer);\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // opacity buffer\n let opacityBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, opacityBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, 1, 1, 1, 1]), gl.STATIC_DRAW);\n let a_opacity = gl.getAttribLocation(gl.program, 'a_opacity');\n gl.vertexAttribPointer(a_opacity, 1, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_opacity);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.program, 'u_texture');\n gl.uniform1i(u_texture, n);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.deleteBuffer(opacityBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n gl.deleteTexture(texture);\n }\n}\n\nfunction renderCanvas(renderMode, ctx, root) {\n let { __structs, width, height } = root;\n let mergeList = [];\n /**\n * 先一遍先序遍历收集cacheAsBitmap的节点,说明这棵子树需要缓存,可能出现嵌套,高层级优先\n * 可能遇到已有缓存没变化的,这时候不要收集忽略掉,没有缓存的走后面遍历普通渲染\n */\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // 排除Text,要么根节点直接绘制,要么被局部根节点汇总,自身并不缓存(fillText比位图更快)\n if(node instanceof Text) {\n continue;\n }\n let __config = node.__config;\n let {\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_CACHE_AS_BITMAP]: cacheAsBitmap,\n [NODE_COMPUTED_STYLE]: computedStyle,\n } = __config;\n if(refreshLevel >= REPAINT) {\n node.__calCache(renderMode, ctx, __config[NODE_DOM_PARENT],\n __config[NODE_CACHE_STYLE], __config[NODE_CURRENT_STYLE], computedStyle,\n node.clientWidth, node.clientHeight, node.offsetWidth, node.offsetHeight,\n computedStyle[BORDER_TOP_WIDTH], computedStyle[BORDER_RIGHT_WIDTH],\n computedStyle[BORDER_BOTTOM_WIDTH], computedStyle[BORDER_LEFT_WIDTH],\n computedStyle[PADDING_TOP], computedStyle[PADDING_RIGHT],\n computedStyle[PADDING_BOTTOM], computedStyle[PADDING_LEFT],\n node.__sx1, node.__sx2, node.__sx3, node.__sx4, node.__sx5, node.__sx6,\n node.__sy1, node.__sy2, node.__sy3, node.__sy4, node.__sy5, node.__sy6);\n }\n if(cacheAsBitmap) {\n // 跳过display:none元素和它的所有子节点\n if(computedStyle[DISPLAY] === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n mergeList.push([i, lv, total, node, __config, hasMask]);\n }\n }\n /**\n * 根据收集的需要合并局部根的索引,尝试合并,按照层级从大到小,索引从大到小的顺序,\n * 这样保证子节点在前,后节点在前(mask在后面),渲染顺序正确\n */\n if(mergeList.length) {\n mergeList.sort(function(a, b) {\n if(a[1] === b[1]) {\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n mergeList.forEach(item => {\n let [i, lv, total, node, __config, hasMask] = item;\n genTotal(renderMode, node, __config, i, lv, total || 0, __structs, hasMask, width, height);\n });\n }\n /**\n * 最后先序遍历一次并应用__cacheTotal即可,没有的普通绘制,以及剩下的超尺寸的和Text\n * 特殊离屏和cacheAsBitmap的离屏都已经产生了cacheTotal,除非超限\n * 离屏功能的数据结构和算法逻辑非常复杂,需用到下面2个hash,来完成一些filter、mask等离屏才能完成的绘制\n * 其中overflow、filter、mix-blend-mode是对自身及子节点,mask则是对自身和后续next遮罩节点\n * 一个节点在Xom渲染中申请离屏canvas,是按照一定顺序来的,且多个离屏后面的有前面的ctx引用,第一个则引用最初非离屏的ctx\n * 这个顺序在应用离屏时以反向顺序开始,这样最后ctx被还原到最初的ctx\n * mask是个十分特殊的离屏,因为除了自身外,next节点也需要汇总到另外一个离屏上,为了逻辑一致性\n * 所有离屏应用的索引都以最后一个节点的索引为准,即有mask时以最后一个mask,无mask则以自身节点的最后一个(+total)为索引\n * 由于存在普通非cache绘制,所以依然要用到栈代替递归计算matrix\n */\n let maskStartHash = {};\n let offscreenHash = {};\n for(let i = 0, len = __structs.length; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_LV]: lv,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n // text如果display不可见,parent会直接跳过,不会走到这里,这里一定是直接绘制到root的,visibility在其内部判断\n if(node instanceof Text) {\n node.render(renderMode, REPAINT, ctx, NA, 0, 0);\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n }\n else {\n let __config = node.__config;\n let {\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_REFRESH_LV]: refreshLevel,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [MIX_BLEND_MODE]: mixBlendMode,\n [OPACITY]: opacity,\n },\n } = __config;\n // 遮罩对象申请了个离屏,其第一个mask申请另外一个离屏mask2,开始聚集所有mask元素的绘制,\n // 这是一个十分特殊的逻辑,保存的index是最后一个节点的索引,OFFSCREEN_MASK2是最低优先级,\n // 这样当mask本身有filter时优先自身,然后才是OFFSCREEN_MASK2\n if(maskStartHash.hasOwnProperty(i)) {\n let [idx, n, offscreenMask] = maskStartHash[i];\n let target = inject.getCacheCanvas(width, height, null, 'mask2');\n offscreenMask.mask = target; // 应用mask用到\n offscreenMask.isClip = node.isClip;\n // 定位到最后一个mask元素上的末尾\n let j = i + (total || 0) + 1;\n while(--n) {\n let { [STRUCT_TOTAL]: total } = __structs[j];\n j += (total || 0) + 1;\n }\n j--;\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([idx, lv, OFFSCREEN_MASK, offscreenMask]);\n list.push([j, lv, OFFSCREEN_MASK2, {\n ctx, // 保存等待OFFSCREEN_MASK2时还原\n target,\n }]);\n ctx = target.ctx;\n }\n // 有cache声明从而有total的可以直接绘制并跳过子节点索,total生成可能会因超限而失败\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n let j = i;\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n // total的none直接跳过\n if(display === 'none') {\n continue;\n }\n if(isValidMbm(mixBlendMode)) {\n ctx.globalCompositeOperation = mbmName(mixBlendMode);\n }\n else {\n ctx.globalCompositeOperation = 'source-over';\n }\n // cache需要计算matrixEvent,因为局部根节点临时视为E,根据refreshLevel决定\n let matrix = __config[NODE_MATRIX], matrixEvent = __config[NODE_MATRIX_EVENT];\n let old = matrixEvent.slice(0);\n let parentMatrix = __config[NODE_DOM_PARENT].matrixEvent;\n if(parentMatrix && !isE(parentMatrix)) {\n matrix = multiply(parentMatrix, matrix);\n }\n util.assignMatrix(matrixEvent, matrix);\n Cache.draw(ctx, opacity, matrixEvent, target);\n // total应用后记得设置回来\n ctx.globalCompositeOperation = 'source-over';\n // 父超限但子有total的时候,i此时已经增加到了末尾,也需要检查\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n // 有cache的可以跳过子节点,但如果matrixEvent变化还是需要遍历计算一下的,虽然跳过了渲染\n // 如果cache是新的,则需要完整遍历设置一次\n // 如果isNew为false,则计算下局部根节点再对比下看是否有变化,无变化可省略\n let needReset = __cacheTotal.isNew;\n if(!needReset && !util.equalArr(old, matrixEvent)) {\n needReset = true;\n }\n if(needReset) {\n resetMatrixCacheTotal(__structs, j, total || 0, lv, matrixEvent);\n }\n __cacheTotal.__isNew = false;\n }\n // 没有cacheTotal是普通节点绘制\n else {\n let res = node.render(renderMode, refreshLevel, ctx, NA, 0, 0);\n let { offscreenBlend, offscreenMask, offscreenFilter, offscreenOverflow } = res || {};\n // 这里离屏顺序和xom里返回的一致,和下面应用离屏时的list相反\n if(offscreenBlend) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_BLEND, offscreenBlend]);\n ctx = offscreenBlend.target.ctx;\n }\n // 被遮罩的节点要为第一个遮罩和最后一个遮罩的索引打标,被遮罩的本身在一个离屏canvas,遮罩的元素在另外一个\n // 最后一个遮罩索引因数量不好计算,放在maskStartHash做\n if(offscreenMask) {\n let j = i + (total || 0);\n maskStartHash[j + 1] = [i, hasMask, offscreenMask];\n ctx = offscreenMask.target.ctx;\n }\n // filter造成的离屏,需要将后续一段孩子节点区域的ctx替换,并在结束后应用结果,再替换回来\n if(offscreenFilter) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_FILTER, offscreenFilter]);\n ctx = offscreenFilter.target.ctx;\n }\n // overflow:hidden的离屏,最后孩子进行截取\n if(offscreenOverflow) {\n let j = i + (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n let list = offscreenHash[j] = offscreenHash[j] || [];\n list.push([i, lv, OFFSCREEN_OVERFLOW, offscreenOverflow]);\n ctx = offscreenOverflow.target.ctx;\n }\n // 离屏应用,按照lv从大到小即子节点在前先应用,同一个节点多个效果按offscreen优先级从小到大来,\n // 由于mask特殊索引影响,所有离屏都在最后一个mask索引判断,此时mask本身优先结算,以index序大到小判断\n if(offscreenHash.hasOwnProperty(i)) {\n ctx = applyOffscreen(ctx, offscreenHash[i], width, height);\n }\n // render后判断可见状态,此时computedStyle才有值\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n}\n\nexport default {\n renderCanvas,\n renderSvg,\n renderWebgl,\n};\n\n","import webgl from './webgl';\nimport MockPage from './MockPage';\nimport inject from '../util/inject';\n\nclass TexCache {\n constructor(units) {\n this.__units = units; // 通道数量限制,8~16\n this.__pages = []; // 存当前page列表,通道数量8~16,缓存收留尽可能多的page\n this.__list = []; // 本次渲染暂存的数据,[cache, opacity, matrix, dx, dy]\n this.__channels = []; // 每个纹理通道记录还是个数组,下标即纹理单元,内容为Page\n this.__locks = []; // 锁定纹理单元列表,下标即纹理单元,内容true为锁定\n this.__lockUnits = 0;\n }\n\n /**\n * webgl每次绘制为添加纹理并绘制,此处尝试尽可能收集所有纹理贴图,以达到尽可能多的共享纹理,再一次性绘制\n * 收集的是Page对象(从cache中取得),里面包含了若干个节点的贴图,canvas本身是2的幂次方大小\n * webgl最少有8个纹理单元最多16个,因此存了一个列表来放这些Page的canvas,刷新后清空,但纹理通道映射记录保留\n * 当8个纹理单元全部满了,进行绘制并清空这个队列,外部主循环结束时也会检查队列是否还有余留并绘制\n * 初始调用队列为空,存入Page对象,后续调用先查看是否存在以便复用,再决定是否存入Page,直到8个满了\n * Page上存有update表示是否更新,每次cache绘制时会变true,以此表示是否有贴图更新,删除可以忽视\n * 还需要一个记录上次纹理通道使用哪个Page的canvas的地方,即映射,清空后队列再次添加时,如果Page之前被添加过,\n * 此次又被添加且没有变更update,可以直接复用上次的纹理单元号且无需再次上传纹理,节省性能\n * 后续接入局部纹理更新也是复用单元号,如果update变更可以选择局部上传纹理而非整个重新上传\n * 判断上传的逻辑在收集满8个后绘制前进行,因为添加队列过程中可能会变更Page及其update\n * @param gl\n * @param cache\n * @param opacity\n * @param matrix\n * @param cx\n * @param cy\n * @param dx\n * @param dy\n * @param revertY\n */\n addTexAndDrawWhenLimit(gl, cache, opacity, matrix, cx, cy, dx = 0, dy = 0, revertY) {\n let pages = this.__pages;\n let list = this.__list;\n let page = cache.page;\n let i = pages.indexOf(page);\n // 找到说明已有page在此索引的通道中,记录下来info\n if(i > -1) {\n list.push([cache, opacity, matrix, dx, dy]);\n }\n // 找不到说明是新的纹理贴图,此时看是否超过纹理单元限制,超过则刷新绘制并清空,然后/否则 存入纹理列表\n else {\n i = pages.length;\n if(i >= this.__units - this.__lockUnits) {\n // 绘制且清空,队列索引重新为0\n this.refresh(gl, cx, cy, revertY);\n }\n pages.push(page);\n list.push([cache, opacity, matrix, dx, dy]);\n }\n }\n\n /**\n * 刷新\n * @param gl\n * @param cx\n * @param cy\n * @param revertY\n */\n refresh(gl, cx, cy, revertY) {\n let pages = this.__pages;\n let list = this.__list;\n // 防止空调用刷新,struct循环结尾会强制调用一次防止有未渲染的\n if(pages.length) {\n let channels = this.channels;\n let locks = this.locks;\n // 先将上次渲染的纹理单元使用的Page形成一个hash,键为page的uuid,值为纹理单元\n let lastHash = {};\n channels.forEach((item, i) => {\n if(item) {\n let uuid = item.uuid;\n lastHash[uuid] = i;\n }\n });\n let units = this.__units;\n // 再遍历,查找相同的Page并保持其使用的纹理单元不变,存入相同索引下标oldList,不同的按顺序收集放newList\n let oldList = new Array(units), newList = [];\n pages.forEach(page => {\n let uuid = page.uuid;\n if(lastHash.hasOwnProperty(uuid)) {\n let index = lastHash[uuid];\n oldList[index] = page;\n }\n else {\n newList.push(page);\n }\n });\n /**\n * 以oldList为基准,将newList依次存入oldList中\n * 优先使用未用过的纹理单元,以便用过的可能下次用到无需重新上传\n * 找不到未用过的后,尝试NRU算法,优先淘汰最近未使用的Page,相等则尺寸小的\n */\n if(newList.length) {\n // 先循环找空的,oldList空且channels空且locks空\n for(let i = 0; i < units; i++) {\n if(!oldList[i] && !channels[i] &&!locks[i]) {\n oldList[i] = newList.shift();\n if(!newList.length) {\n break;\n }\n }\n }\n let len = newList.length;\n if(len) {\n // 按时间排序已使用channel且未被当前占用的,以便淘汰最久未使用的\n let cl = [];\n for(let i = 0; i < units; i++) {\n if(!oldList[i] && !locks[i]) {\n cl.push([i, channels[i]]);\n }\n }\n cl.sort(function(a, b) {\n if(a[1].time !== b[1].time) {\n return (a[1].time || 0) - (b[1].time || 0);\n }\n if(a[1].fullSize !== b[1].fullSize) {\n return a[1].fullSize - b[1].fullSize;\n }\n return a[0] - b[0];\n });\n // cl靠前是时间小尺寸小的,优先使用替换\n for(let i = 0; i < len; i++) {\n oldList[cl[i][0]] = newList[i];\n }\n }\n }\n /**\n * 对比上帧渲染的和这次纹理单元情况,Page相同且!update可以省略更新,其它均重新赋值纹理\n * 后续局部更新Page相同但有update,会出现没有上帧的情况如初始渲染,此时先创建纹理单元再更新\n * 将新的数据赋给老的,可能新的一帧使用的少于上一帧,老的没用到的需继续保留\n */\n let hash = {};\n for(let i = 0, len = oldList.length; i < len; i++) {\n let page = oldList[i];\n // 可能为空,不满的情况下前面单元保留老tex先用的后面的单元\n if(!page) {\n continue;\n }\n let last = channels[i];\n if(!last || last !== page || page.update) {\n // page可能为一个已有fbo纹理,或者贴图\n if(page instanceof MockPage) {\n webgl.bindTexture(gl, page.texture, i);\n }\n else {\n // 可能老的先删除,注意只删Page,MockPage是fbo生成的texture即total缓存不能自动清除\n if(last && !(last instanceof MockPage)) {\n gl.deleteTexture(last.texture);\n }\n page.texture = webgl.createTexture(gl, page.canvas, i);\n }\n channels[i] = page;\n }\n hash[page.uuid] = i;\n // 标识没有更新,以及最后使用时间\n page.update = false;\n page.time = inject.now();\n }\n // 再次遍历开始本次渲染并清空\n webgl.drawTextureCache(gl, list, hash, cx, cy, revertY);\n pages.splice(0);\n list.splice(0);\n }\n }\n\n findExistTexChannel(page) {\n return this.channels.indexOf(page);\n }\n\n /**\n * 获取并锁定一个纹理单元优先使用空的,其次最久未使用的\n * @returns {number|*}\n */\n lockOneChannel() {\n // 优先返回空单元\n let channels = this.channels;\n let locks = this.locks;\n for(let i = 0; i < this.__units; i++) {\n if(!channels[i] && !locks[i]) {\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n }\n // 根据NRU返回最久未使用的\n let units = this.__units;\n let cl = [];\n for(let i = 0; i < units; i++) {\n if(!locks[i]) {\n cl.push([i, channels[i]]);\n }\n }\n if(cl.length) {\n cl.sort(function(a, b) {\n if(a[1].time !== b[1].time) {\n return (a[1].time || 0) - (b[1].time || 0);\n }\n if(a[1].fullSize !== b[1].fullSize) {\n return a[1].fullSize - b[1].fullSize;\n }\n return a[0] - b[0];\n });\n let i = cl[0][0];\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n throw new Error('No free texture unit');\n }\n\n /**\n * 释放掉i单元,并且设置内容到缓存channel中\n * @param i\n * @param setToChannel\n */\n releaseLockChannel(i, setToChannel) {\n if(this.locks[i]) {\n this.locks[i] = false;\n this.__lockUnits--;\n if(setToChannel) {\n this.channels[i] = setToChannel;\n }\n }\n }\n\n // 指定锁定一个单元\n lockChannel(i) {\n let channels = this.channels;\n let locks = this.locks;\n if(!locks[i]) {\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n }\n }\n\n /**\n * 释放纹理单元\n * @param gl\n */\n release(gl) {\n this.channels.forEach(item => {\n if(item) {\n gl.deleteTexture(item.texture);\n }\n });\n }\n\n get channels() {\n return this.__channels;\n }\n\n get locks() {\n return this.__locks;\n }\n\n get last() {\n let list = this.__list, len = list.length;\n if(len) {\n return list[len - 1];\n }\n }\n}\n\nexport default TexCache;\n","import Dom from './Dom';\nimport Text from './Text';\nimport Xom from './Xom';\nimport Component from './Component';\nimport Defs from './Defs';\nimport mode from '../refresh/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 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 let params = Object.assign({}, ca, this.props.contextAttributes);\n // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d', params);\n this.__renderMode = mode.CANVAS;\n }\n else if(this.tagName === 'svg') {\n this.__renderMode = mode.SVG;\n }\n else if(this.tagName === 'webgl') {\n let gl = this.__ctx = this.__dom.getContext('webgl', params);\n this.__renderMode = mode.WEBGL;\n gl.program = webgl.initShaders(gl, vertex, fragment);\n gl.programMask = webgl.initShaders(gl, vertexMask, fragmentMask);\n gl.programClip = webgl.initShaders(gl, vertexMask, fragmentClip);\n gl.programOverflow = webgl.initShaders(gl, vertexMask, fragmentOverflow);\n gl.programCm = webgl.initShaders(gl, vertexCm, fragmentCm);\n gl.useProgram(gl.program);\n // 第一次渲染生成纹理缓存管理对象,收集渲染过程中生成的纹理并在gl纹理单元满了时进行绘制和清空,减少texImage2d耗时问题\n const MAX_TEXTURE_IMAGE_UNITS = Math.min(16, gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));\n this.__texCache = new TexCache(MAX_TEXTURE_IMAGE_UNITS);\n }\n this.refresh(null, true);\n // 第一次节点没有__root,渲染一次就有了才能diff\n if(this.dom.__root && this.dom.__root instanceof Root) {\n this.dom.__root.destroy();\n }\n this.__eventCbList = initEvent(this.dom, Root);\n this.dom.__root = this;\n }\n\n refresh(cb, isFirst) {\n this.__hookTask = null;\n let { isDestroyed, renderMode, ctx, defs, width, height } = this;\n if(isDestroyed) {\n return;\n }\n defs.clear();\n // 首次递归测量整树的继承,后续更改各自更新机制做,防止每次整树遍历;root检查首次直接做,后续在checkUpdate()中插入\n if(isFirst) {\n this.__checkRoot(renderMode, width, height);\n this.__computeMeasure(renderMode, ctx);\n }\n // 非首次刷新如果没有更新则无需继续\n else if(!this.__checkUpdate(renderMode, ctx, width, height)) {\n return;\n }\n // 获取所有字体和大小测量,仅svg需要,canvas直接做\n inject.measureText();\n this.__checkReflow(width, height);\n if(renderMode === mode.CANVAS && !this.props.noRender) {\n this.__clear(ctx, renderMode);\n struct.renderCanvas(renderMode, ctx, this);\n }\n // svg的特殊diff需要\n else if(renderMode === mode.SVG && !this.props.noRender) {\n struct.renderSvg(renderMode, defs, this, isFirst);\n let nvd = this.virtualDom;\n nvd.defs = defs.value;\n if(this.dom.__vd) {\n // console.log(this.dom.__vd);\n // console.log(nvd);\n domDiff(this.dom, this.dom.__vd, nvd);\n }\n else {\n this.dom.innerHTML = util.joinVirtualDom(nvd);\n }\n this.dom.__vd = nvd;\n this.dom.__defs = defs;\n }\n else if(renderMode === mode.WEBGL && !this.props.noRender) {\n this.__clear(ctx, renderMode);\n struct.renderWebgl(renderMode, ctx, this);\n }\n // 特殊cb,供小程序绘制完回调使用\n if(isFunction(cb)) {\n cb();\n }\n this.emit(Event.REFRESH, this.__rlv);\n this.__rlv = NONE;\n }\n\n destroy() {\n this.__destroy();\n this.animateController.__destroy();\n let n = this.dom;\n if(n) {\n removeEvent(n, this.__eventCbList || []);\n n.__root = null;\n }\n let gl = this.ctx;\n if(this.__texCache && gl) {\n this.__texCache.release(gl);\n if(gl.program) {\n gl.deleteShader(gl.program.vertexShader);\n gl.deleteShader(gl.program.fragmentShader);\n gl.deleteProgram(gl.program);\n }\n if(gl.programMask) {\n gl.deleteShader(gl.programMask.vertexShader);\n gl.deleteShader(gl.programMask.fragmentShader);\n gl.deleteProgram(gl.programMask);\n }\n if(gl.programOverflow) {\n gl.deleteShader(gl.programOverflow.vertexShader);\n gl.deleteShader(gl.programOverflow.fragmentShader);\n gl.deleteProgram(gl.programOverflow);\n }\n }\n }\n\n scale(x = 1, y = x) {\n this.__scx = x;\n this.__scy = y;\n }\n\n resize(w, h, cb) {\n let self = this;\n if(w !== self.width || h !== self.height) {\n self.__width = w;\n self.__height = h;\n self.updateStyle({\n width: w,\n height: h,\n }, cb);\n }\n else if(isFunction(cb)) {\n cb(-1);\n }\n }\n\n addRefreshTask(cb) {\n let { taskUp, isDestroyed } = this;\n if(isDestroyed) {\n return;\n }\n // 第一个添加延迟侦听,后续放队列等待一并执行\n if(!taskUp.length) {\n let clone;\n frame.nextFrame({\n __before: diff => {\n if(this.isDestroyed) {\n return;\n }\n clone = taskUp.splice(0);\n // 前置一般是动画计算此帧样式应用,然后刷新后出发frame事件,图片加载等同\n if(clone.length) {\n clone.forEach((item, i) => {\n if(isObject(item) && isFunction(item.__before)) {\n item.__before(diff);\n }\n });\n }\n },\n __after: diff => {\n if(this.isDestroyed) {\n return;\n }\n clone.forEach(item => {\n if(isObject(item) && isFunction(item.__after)) {\n item.__after(diff);\n }\n else if(isFunction(item)) {\n item(diff);\n }\n });\n }\n });\n this.__frameHook();\n }\n if(taskUp.indexOf(cb) === -1) {\n taskUp.push(cb);\n }\n }\n\n addForceRefreshTask(cb) {\n this.__hasRootUpdate = true;\n this.addRefreshTask(cb);\n }\n\n delRefreshTask(cb) {\n if(!cb) {\n return;\n }\n let { taskUp } = this;\n for(let i = 0, len = taskUp.length; i < len; i++) {\n if(taskUp[i] === cb) {\n taskUp.splice(i, 1);\n break;\n }\n }\n }\n\n /**\n * 为component的setState更新专门开辟个独立的流水线,root/frame中以taskCp存储更新列表\n * 普通的动画、img加载等都走普通的refresh的task,component走这里,frame中的结构同样\n * 在frame的每帧调用中,先执行普通的动画task,再执行component的task\n * 这样动画执行完后,某个cp的sr及子节点依旧先进行了动画变更,进入__addUpdate()环节\n * 然后此cp再更新sr及子节点,这样会被__addUpdate()添加到尾部,依赖目前浏览器默认实现\n * 上一行cp更新过程中是updater.check()进行的,如果有新老交换且有动画,动画的assigning是true,进行继承\n * root刷新parseUpdate()时,老的sr及子节点先进行,随后新的sr后进行且有component标识,sr子节点不会有更新\n * @param cb\n */\n addRefreshCp(cb) {\n let { taskCp, isDestroyed } = this;\n if(isDestroyed) {\n return;\n }\n // 每次只执行1次\n if(!taskCp.length) {\n let clone;\n frame.__nextFrameCp({\n __before: diff => {\n if(this.isDestroyed) {\n return;\n }\n clone = taskCp.splice(0);\n if(clone.length) {\n clone.forEach(item => {\n item.__before(diff);\n });\n updater.check(this);\n let len = updater.updateList.length;\n if(len) {\n updater.updateList.forEach(cp => {\n let root = cp.root; // 多个root并存时可能cp的引用不相同,需分别获取\n let sr = cp.shadowRoot;\n // 可能返回text,需视为其parentNode\n if(sr instanceof Text) {\n sr = sr.domParent;\n }\n let res = {};\n res[UPDATE_NODE] = sr;\n res[UPDATE_STYLE] = sr.currentStyle;\n res[UPDATE_FOCUS] = REFLOW;\n res[UPDATE_MEASURE] = true;\n res[UPDATE_COMPONENT] = cp;\n res[UPDATE_CONFIG] = sr.__config;\n this.__addUpdate(sr, sr.__config, root, root.__config, res);\n });\n }\n }\n },\n __after: diff => {\n if(this.isDestroyed) {\n return;\n }\n clone.forEach(item => {\n item.__after(diff);\n });\n // 触发didUpdate\n updater.did();\n },\n });\n this.__frameHook();\n }\n if(taskCp.indexOf(cb) === -1) {\n taskCp.push(cb);\n }\n }\n\n getTargetAtPoint(x, y, includeIgnore) {\n function scan(vd, x, y, path, zPath) {\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent, children, zIndexChildren,\n computedStyle: { [DISPLAY]: display, [POINTER_EVENTS]: pointerEvents } } = vd;\n if(!includeIgnore && display === 'none') {\n return;\n }\n if(Array.isArray(zIndexChildren)) {\n for(let i = 0, len = children.length; i < len; i++) {\n children[i].__index__ = i;\n }\n for(let i = zIndexChildren.length - 1; i >= 0; i--) {\n let item = zIndexChildren[i];\n if(item instanceof karas.Text) {\n continue;\n }\n let path2 = path.slice();\n path2.push(item.__index__);\n let zPath2 = zPath.slice();\n zPath2.push(i);\n let res = scan(item, x, y, path2, zPath2);\n if(res) {\n return res;\n }\n }\n }\n if(!includeIgnore && pointerEvents === 'none') {\n return;\n }\n let inThis = geom.pointInQuadrilateral(\n x, y,\n __sx1, __sy1,\n __sx1 + offsetWidth, __sy1,\n __sx1 + offsetWidth, __sy1 + offsetHeight,\n __sx1, __sy1 + offsetHeight,\n matrixEvent\n );\n if(inThis) {\n return {\n target: vd,\n path,\n zPath,\n };\n }\n }\n return scan(this, x, y, [], []);\n }\n\n /**\n * 每次刷新前检查root节点的样式,有些固定的修改无效,有些继承的作为根初始化\n * @param renderMode\n * @param width\n * @param height\n * @private\n */\n __checkRoot(renderMode, width, height) {\n let { dom, currentStyle, computedStyle } = this;\n // canvas/svg作为根节点一定是block或flex,不会是inline\n if(['flex', 'block'].indexOf(currentStyle[DISPLAY]) === -1) {\n computedStyle[DISPLAY] = currentStyle[DISPLAY] = 'block';\n }\n // 同理position不能为absolute\n if(currentStyle[POSITION] === 'absolute') {\n computedStyle[POSITION] = currentStyle[POSITION] = 'static';\n }\n // 根节点满宽高\n currentStyle[WIDTH] = [width, PX];\n currentStyle[HEIGHT] = [height, PX];\n computedStyle[WIDTH] = width;\n computedStyle[HEIGHT] = height;\n // 可能调用resize()导致变更,要重设,canvas无论离屏与否都可使用直接赋值,svg则按dom属性api\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(dom.width !== width) {\n dom.width = width;\n }\n if(dom.height !== height) {\n dom.height = height;\n }\n }\n else if(renderMode === mode.SVG) {\n dom.setAttribute('width', width);\n dom.setAttribute('height', height);\n }\n }\n\n /**\n * 添加更新入口,按节点汇总更新信息\n * @private\n */\n __addUpdate(node, nodeConfig, root, rootConfig, o) {\n let updateHash = rootConfig[NODE_UPDATE_HASH];\n // root特殊处理,检查变更时优先看继承信息\n if(node === root) {\n updateHash = root.__updateRoot;\n if(updateHash) {\n if(o[UPDATE_FOCUS]) {\n updateHash[UPDATE_FOCUS] |= o[UPDATE_FOCUS];\n }\n if(o[UPDATE_MEASURE]) {\n updateHash[UPDATE_MEASURE] = true;\n }\n // 后续存在新建list上,需增加遍历逻辑\n if(o[UPDATE_STYLE]) {\n let list = updateHash[UPDATE_LIST] = updateHash[UPDATE_LIST] || [];\n list.push({\n [UPDATE_STYLE]: o[UPDATE_STYLE],\n [UPDATE_OVERWRITE]: o[UPDATE_OVERWRITE],\n [UPDATE_KEYS]: o[UPDATE_KEYS],\n });\n }\n }\n else {\n root.__updateRoot = o;\n }\n }\n else if(!nodeConfig.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n nodeConfig[NODE_UNIQUE_UPDATE_ID] = uniqueUpdateId;\n // 大多数情况节点都只有一次更新,所以优化首次直接存在style上,后续存在list\n updateHash[uniqueUpdateId++] = o;\n }\n else if(updateHash.hasOwnProperty(nodeConfig[NODE_UNIQUE_UPDATE_ID])) {\n let target = updateHash[nodeConfig[NODE_UNIQUE_UPDATE_ID]];\n if(o[UPDATE_FOCUS]) {\n target[UPDATE_FOCUS] |= o[UPDATE_FOCUS];\n }\n if(o[UPDATE_MEASURE]) {\n target[UPDATE_MEASURE] = true;\n }\n // 后续存在新建list上,需增加遍历逻辑\n if(o[UPDATE_STYLE]) {\n let list = target[UPDATE_LIST] = target[UPDATE_LIST] || [];\n list.push({\n [UPDATE_STYLE]: o[UPDATE_STYLE],\n [UPDATE_OVERWRITE]: o[UPDATE_OVERWRITE],\n [UPDATE_KEYS]: o[UPDATE_KEYS],\n });\n }\n }\n else {\n inject.error('Update process miss uniqueUpdateId');\n }\n }\n\n /**\n * 除首次外每次刷新前检查更新列表,计算样式变化,以及测量信息\n * @private\n */\n __checkUpdate(renderMode, ctx, width, height) {\n let root = this;\n let measureList = [];\n let reflowList = [];\n let cacheHash = {};\n let cacheList = [];\n let zHash = {};\n let zList = [];\n let updateRoot = root.__updateRoot;\n let updateHash = root.__updateHash;\n // 给个方式使得外部可以强制刷新\n let hasUpdate = root.__hasRootUpdate;\n root.__hasRootUpdate = false;\n // root更新特殊提前,因为有继承因素\n if(updateRoot) {\n root.__updateRoot = null;\n hasUpdate = parseUpdate(renderMode, root, updateRoot,\n reflowList, measureList, cacheHash, cacheList);\n // 此时做root检查,防止root出现继承等无效样式,或者发生resize()\n if(hasUpdate) {\n root.__checkRoot(renderMode, width, height);\n }\n }\n // 汇总处理每个节点,k是递增数字直接循环遍历\n let keys = Object.keys(updateHash);\n for(let i = 0, len = keys.length; i < len; i++) {\n let t = parseUpdate(renderMode, root, updateHash[keys[i]],\n reflowList, measureList, cacheHash, cacheList, zHash, zList);\n hasUpdate = hasUpdate || t;\n }\n // 先做一部分reset避免下面measureList干扰,cacheList的是专门收集新增的额外节点\n root.__reflowList = reflowList;\n uniqueUpdateId = 0;\n root.__updateHash = root.__config[NODE_UPDATE_HASH] = {};\n cacheList.forEach(__config => {\n delete __config[NODE_UNIQUE_UPDATE_ID];\n });\n // zIndex改变的汇总修改,防止重复操作\n zList.forEach(item => {\n if(item.hasOwnProperty('__uniqueZId')) {\n delete item.__uniqueZId;\n item.__updateStruct(root.__structs);\n }\n });\n /**\n * 遍历每项节点,计算测量信息,节点向上向下查找继承信息,如果parent也是继承,先计算parent的\n * 过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n */\n let measureHash = {};\n measureList.forEach(node => {\n let { __config:{ [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId, [NODE_DOM_PARENT]: parent } } = node;\n // 在root下的component变更时root会进入,但其没有__uniqueUpdateId\n if(node !== root) {\n if(measureHash.hasOwnProperty(__uniqueUpdateId)) {\n return;\n }\n measureHash[__uniqueUpdateId] = true;\n }\n let last = node;\n // 检查measure的属性是否是inherit,在root下的component变更时root会进入,但其没有__uniqueUpdateId\n // 另外dom标识表明有dom变更强制进入\n let isInherit = node !== root\n && (updateHash[__uniqueUpdateId][UPDATE_ADD_DOM]\n || change.isMeasureInherit(updateHash[__uniqueUpdateId][UPDATE_STYLE]));\n // 是inherit,需要向上查找,从顶部向下递归计算继承信息\n if(isInherit) {\n while(parent && parent !== root) {\n let { __config: {\n [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId,\n }, currentStyle } = parent;\n let isInherit;\n if(parent.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n let style = updateHash[__uniqueUpdateId][UPDATE_STYLE];\n measureHash[__uniqueUpdateId] = true;\n let temp = change.measureInheritList(style);\n isInherit = !!temp.length;\n }\n else {\n isInherit = change.isMeasureInherit(currentStyle);\n }\n // 如果parent有inherit存入列表且继续向上,否则跳出循环\n if(isInherit) {\n last = parent;\n }\n else {\n break;\n }\n // 考虑component下的继续往上继承\n parent = parent.domParent;\n }\n }\n // 自顶向下查找inherit的,利用已有的方法+回调,当递归包含重复时标记防止重复\n last.__computeMeasure(renderMode, ctx, function(target) {\n if(target.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n measureHash[target.__config[NODE_UNIQUE_UPDATE_ID]] = true;\n }\n });\n });\n // 做完清空留待下次刷新重来\n for(let i = 0, len = keys.length; i < len; i++) {\n delete updateHash[keys[i]][UPDATE_CONFIG][NODE_UNIQUE_UPDATE_ID];\n }\n return hasUpdate;\n }\n\n /**\n * 除首次外每次刷新前检查reflow列表,计算需要reflow的节点局部重新布局\n * 当一个元素absolute不变时,其变化不会影响父元素和兄弟元素,直接自己重新局部LAYOUT包含子节点\n * 当absolute发生改变时,其变化会影响父和兄弟,视作父重新布局\n * 当inline变化时,视为其最近block/flex父变化\n * 当block变化时,往上查找最上层flex视为其变化,如不是则影响后面兄弟offset和父resize\n * 当flex变化时,往上查找最上层flex视为其变化,如不是则影响所有递归子节点layout和父resize\n * 以上3种情况向上查找时遇到absolute父均提前跳出,并标记absolute父LAYOUT\n * 上面所有情况即便结束还得额外看是否处于absolute中,是还是标记absolute重新布局\n * 当relative只变化left/top/right/bottom时,自己重新layout\n * 检测节点时记录影响的所有节点,最终形成一棵或n棵局部树\n * 需要重新布局的记作LAYOUT,被兄弟影响只需偏移的记作OFFSET,OFFSET可能会重复变为LAYOUT\n * 上述情况倘若发生包含重复,去掉子树,因子树视为被包含的重新布局\n * 如果有从root开始的,直接重新布局像首次那样即可\n * 如果非root,所有树根按先根顺序记录下来,依次执行局部布局\n * =========================\n * addDom比较特殊,是向已有节点中添加新的节点,检查影响与普通domDiff变化不同\n * @private\n */\n __checkReflow(width, height) {\n let { __reflowList: reflowList } = this;\n if(!reflowList.length) {\n return;\n }\n let root = this;\n let uniqueList = [];\n let hasRoot;\n __uniqueReflowId = 0;\n let reflowHash = {};\n // 遍历检查发生布局改变的节点列表,此时computedStyle还是老的,currentStyle是新的\n for(let i = 0, len = reflowList.length; i < len; i++) {\n let item = reflowList[i];\n let { node, component, addDom, removeDom } = item;\n // root提前跳出,完全重新布局\n if(node === this) {\n hasRoot = true;\n break;\n }\n // 添加时如果是cp则node取sr来布局\n if(addDom && node instanceof Component) {\n node = node.shadowRoot;\n }\n // 每个节点生成唯一的布局识别id存入hash防止重复\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n reflowHash[__uniqueReflowId++] = item;\n }\n // 每个节点都向上检查影响,以及是否从root开始完全重新,remove特殊对待,影响父节点视为普通父节点relay\n if(checkInfluence(root, reflowHash, node, component, addDom)) {\n hasRoot = true;\n if(addDom) {\n this.__zIndexChildren = null;\n }\n break;\n }\n // remove的要特殊对待,因为提前删除了父子兄弟关系,下面deepScan不会出现\n else if(removeDom) {\n uniqueList.push(item);\n }\n }\n __uniqueReflowId = 0;\n this.__reflowList = [];\n // 有root提前跳出\n if(hasRoot) {\n reflow.clearUniqueReflowId(reflowHash);\n // 布局分为两步,普通流和定位流,互相递归\n this.__layout({\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\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 '../../refresh/mode';\nimport painter from '../../util/painter';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction reBuild(target, origin, base, isMulti) {\n if(isMulti) {\n return target.map(item => origin + item * base);\n }\n else {\n return origin + target * base;\n }\n}\n\nfunction reBuildC(target, originX, originY, width, height, isMulti) {\n if(isMulti) {\n if(target) {\n return target.map(item => reBuildC(item, originX, originY, width, height));\n }\n }\n else {\n if(target && target.length >= 2) {\n return [\n originX + target[0] * width,\n originY + target[1] * height,\n ];\n }\n }\n return [];\n}\n\nfunction curveNum(controlA, controlB) {\n let num = 0;\n if(controlA && controlA.length >= 2) {\n num++;\n }\n if(controlB && controlB.length >= 2) {\n num += 2;\n }\n return num;\n}\n\nfunction getNewPoint(x1, y1, x2, y2, controlA, controlB, num, start = 0, end = 1) {\n if(start === 0 && end === 1) {\n return [x1, y1, x2, y2, controlA, controlB];\n }\n if(start === end) {\n return [];\n }\n if(start > end) {\n [start, end] = [end, start];\n }\n start = Math.max(0, start);\n end = Math.min(1, end);\n if(num === 3) {\n [[x1, y1], controlA, controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, controlB, [x2, y2]], start, end);\n }\n else if(num === 2) {\n [[x1, y1], controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlB, [x2, y2]], start, end);\n }\n else if(num === 1) {\n [[x1, y1], controlA, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, [x2, y2]], start, end);\n }\n else {\n let a = x2 - x1;\n let b = y2 - y1;\n x1 += a * start;\n y1 += b * start;\n x2 += a * (1 - end);\n y2 += b * (1 - end);\n }\n return [x1, y1, x2, y2, controlA, controlB];\n}\n\nclass Line extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // x1,y1和x2,y2表明线段的首尾坐标,control表明控制点坐标\n if(this.isMulti) {\n this.__x1 = [0];\n this.__y1 = [0];\n this.__x2 = [1];\n this.__y2 = [1];\n this.__controlA = [[]];\n this.__controlB = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.x1)) {\n this.__x1 = props.x1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x1)) {\n this.__x1 = [parseFloat(props.x1) || 0];\n }\n if(Array.isArray(props.y1)) {\n this.__y1 = props.y1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y1)) {\n this.__y1 = [parseFloat(props.y1) || 0];\n }\n if(Array.isArray(props.x2)) {\n this.__x2 = props.x2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x2)) {\n this.__x2 = [parseFloat(props.x2) || 0];\n }\n if(Array.isArray(props.y2)) {\n this.__y2 = props.y2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y2)) {\n this.__y2 = [parseFloat(props.y2) || 0];\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => parseFloat(i) || 0);\n for(let i = this.__start.length; i < this.__x1.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = parseFloat(props.start) || 0;\n this.__start = this.__x1.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n });\n for(let i = this.__end.length; i < this.__x1.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = v;\n this.__end = this.__x1.map(() => v);\n }\n }\n else {\n this.__x1 = this.__y1 = this.__start = 0;\n this.__x2 = this.__y2 = this.__end = 1;\n this.__controlA = [];\n this.__controlB = [];\n if(!isNil(props.x1)) {\n this.__x1 = parseFloat(props.x1) || 0;\n }\n if(!isNil(props.y1)) {\n this.__y1 = parseFloat(props.y1) || 0;\n }\n if(!isNil(props.x2)) {\n this.__x2 = parseFloat(props.x2) || 0;\n }\n if(!isNil(props.y2)) {\n this.__y2 = parseFloat(props.y2) || 0;\n }\n if(!isNil(props.start)) {\n this.__start = parseFloat(props.start) || 0;\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = v;\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA;\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB;\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, __cacheProps, isMulti } = this;\n let rebuild;\n ['x1', 'x2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originX, width, isMulti);\n }\n });\n ['y1', 'y2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originY, height, isMulti);\n }\n });\n ['controlA', 'controlB'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuildC(this[k], originX, originY, width, height, isMulti);\n }\n });\n ['start', 'end'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = this[k];\n }\n });\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, dx2, dy2) {\n let res = super.render(renderMode, lv, ctx, cache, dx2, dy2);\n if(res.break) {\n return res;\n }\n ctx = res.ctx;\n let {\n sx3,\n sy3,\n stroke: strokes,\n strokeWidth: strokeWidths,\n strokeDasharray: strokeDasharrays,\n strokeDasharrayStr: strokeDasharrayStrs,\n strokeLinecap: strokeLinecaps,\n strokeLinejoin: strokeLinejoins,\n strokeMiterlimit: strokeMiterlimits,\n dx,\n dy,\n } = res;\n let { __cacheProps, isMulti } = this;\n let rebuild = this.buildCache(sx3, sy3);\n if(rebuild && renderMode === mode.SVG) {\n let d = '';\n if(isMulti) {\n __cacheProps.x1.forEach((xa, i) => {\n let xb = __cacheProps.x2[i];\n let ya = __cacheProps.y1[i];\n let yb = __cacheProps.y2[i];\n let ca = __cacheProps.controlA[i];\n let cb = __cacheProps.controlB[i];\n let start = __cacheProps.start[i];\n let end = __cacheProps.end[i];\n let curve = curveNum(ca, cb);\n if(start !== 0 || end !== 1) {\n [xa, ya, xb, ya, ca, cb] = getNewPoint(xa, ya, xb, ya, ca, cb, curve, start, end, __cacheProps.len);\n }\n d += painter.svgLine(xa, ya, xb, yb, ca, cb, curve);\n });\n }\n else {\n let curve = curveNum(__cacheProps.controlA, __cacheProps.controlB);\n let { x1, y1, x2, y2, controlA, controlB, start, end } = __cacheProps;\n if(start !== 0 || end !== 1) {\n [x1, y1, x2, y2, controlA, controlB] = getNewPoint(x1, y1, x2, y2, controlA, controlB, curve, start, end, __cacheProps.len);\n }\n d = painter.svgLine(x1, y1, x2, y2, controlA, controlB, curve);\n }\n __cacheProps.d = d;\n }\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n strokes.forEach((stroke, i) => {\n let strokeWidth = strokeWidths[i];\n let isStrokeRE = strokeWidth > 0 && stroke.k === 'radial' && Array.isArray(stroke.v);\n if(strokeWidth > 0 && stroke !== 'none') {\n this.__preSetCanvas(renderMode, ctx, {\n stroke,\n strokeWidth,\n strokeDasharray: strokeDasharrays[i],\n strokeLinecap: strokeLinecaps[i],\n strokeLinejoin: strokeLinejoins[i],\n strokeMiterlimit: strokeMiterlimits[i],\n });\n if(isStrokeRE) {\n ctx.strokeStyle = stroke.v[0];\n }\n ctx.beginPath();\n if(isMulti) {\n __cacheProps.x1.forEach((xa, i) => {\n let xb = __cacheProps.x2[i];\n let ya = __cacheProps.y1[i];\n let yb = __cacheProps.y2[i];\n let ca = __cacheProps.controlA[i];\n let cb = __cacheProps.controlB[i];\n let start = __cacheProps.start[i];\n let end = __cacheProps.end[i];\n let curve = curveNum(ca, cb);\n if(start !== 0 || end !== 1) {\n [xa, ya, xb, ya, ca, cb] = getNewPoint(xa, ya, xb, ya, ca, cb, curve, start, end, __cacheProps.len);\n }\n painter.canvasLine(ctx, xa, ya, xb, yb, ca, cb, curve, dx, dy);\n });\n }\n else {\n let curve = curveNum(__cacheProps.controlA, __cacheProps.controlB);\n let { x1, y1, x2, y2, controlA, controlB, start, end } = __cacheProps;\n if(start !== 0 || end !== 1) {\n [x1, y1, x2, y2, controlA, controlB] = getNewPoint(x1, y1, x2, y2, controlA, controlB, curve, start, end, __cacheProps.len);\n }\n painter.canvasLine(ctx, x1, y1, x2, y2, controlA, controlB, curve, dx, dy);\n }\n ctx.stroke();\n ctx.closePath();\n }\n });\n }\n else if(renderMode === mode.SVG) {\n strokes.forEach((stroke, i) => {\n let strokeWidth = strokeWidths[i];\n let isStrokeRE = strokeWidth > 0 && stroke.k === 'radial' && Array.isArray(stroke.v);\n let props = [\n ['d', __cacheProps.d],\n ['fill', 'none'],\n ['stroke', isStrokeRE ? stroke.v[0] : (stroke.v || stroke)],\n ['stroke-width', strokeWidth]\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStrs[i], strokeLinecaps[i], strokeLinejoins[i], strokeMiterlimits[i]);\n this.addGeom('path', props);\n });\n }\n return res;\n }\n\n get x1() {\n return this.getProps('x1');\n }\n\n get y1() {\n return this.getProps('y1');\n }\n\n get x2() {\n return this.getProps('x2');\n }\n\n get y2() {\n return this.getProps('y2');\n }\n\n get controlA() {\n return this.getProps('controlA');\n }\n\n get controlB() {\n return this.getProps('controlB');\n }\n\n get start() {\n return this.getProps('start');\n }\n\n get end() {\n return this.getProps('end');\n }\n\n get bbox() {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n },\n } = this;\n this.buildCache(originX, originY);\n let { x1, y1, x2, y2, controlA, controlB } = __cacheProps;\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1s, y1s, x2s, y2s] = this.__spreadBbox(boxShadow, filter);\n x1s -= half;\n y1s -= half;\n x2s += half;\n y2s += half;\n if(!isMulti) {\n x1 = [x1];\n x2 = [x2];\n y1 = [y1];\n y2 = [y2];\n controlA = [controlA];\n controlB = [controlB];\n }\n x1.forEach((xa, i) => {\n let ya = y1[i];\n let xb = x2[i];\n let yb = y2[i];\n let ca = controlA[i];\n let cb = controlB[i];\n if((isNil(ca) || ca.length < 2) && (isNil(cb) || cb.length < 2)) {\n bbox[0] = Math.min(bbox[0], xa + x1s);\n bbox[0] = Math.min(bbox[0], xb + x1s);\n bbox[1] = Math.min(bbox[1], ya + y1s);\n bbox[1] = Math.min(bbox[1], yb + y1s);\n bbox[2] = Math.max(bbox[2], xa + x2s);\n bbox[2] = Math.max(bbox[2], xb + x2s);\n bbox[3] = Math.max(bbox[3], ya + y2s);\n bbox[3] = Math.max(bbox[3], yb + y2s);\n }\n else if(isNil(ca) || ca.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1s);\n bbox[0] = Math.min(bbox[0], bezierBox[2] + x1s);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1s);\n bbox[1] = Math.min(bbox[1], bezierBox[3] + y1s);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + x2s);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2s);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + y2s);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2s);\n }\n else if(isNil(cb) || cb.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1s);\n bbox[0] = Math.min(bbox[0], bezierBox[2] + x1s);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1s);\n bbox[1] = Math.min(bbox[1], bezierBox[3] + y1s);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + x2s);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2s);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + y2s);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2s);\n }\n else {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1s);\n bbox[0] = Math.min(bbox[0], bezierBox[2] + x1s);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1s);\n bbox[1] = Math.min(bbox[1], bezierBox[3] + y1s);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + x2s);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2s);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + y2s);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2s);\n }\n });\n return bbox;\n }\n}\n\nexport default Line;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction concatPointAndControl(point, control) {\n if(Array.isArray(control) && (control.length === 2 || control.length === 4)\n && Array.isArray(point) && point.length === 2) {\n return control.concat(point);\n }\n return point;\n}\n\nfunction getLength(list, isMulti) {\n let res = [];\n let total = 0;\n let increase = [];\n if(isMulti) {\n total = [];\n list.forEach(list => {\n let temp = getLength(list);\n res.push(temp.list);\n total.push(temp.total);\n increase.push([0].concat(temp.increase));\n });\n }\n else if(Array.isArray(list)) {\n total = 0;\n increase.push(0);\n let start = 0;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item)) {\n start = i;\n break;\n }\n }\n let prev = list[start];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n let a = Math.abs(item[0] - prev[0]);\n let b = Math.abs(item[1] - prev[1]);\n let c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n res.push(c);\n total += c;\n increase.push(total);\n prev = item;\n }\n else if(item.length === 4) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]]], 2);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[2], item[3]];\n }\n else if(item.length === 6) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]], [item[4], item[5]]], 3);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[4], item[5]];\n }\n }\n }\n return {\n list: res,\n total,\n increase,\n };\n}\n\nfunction getIndex(list, t, i, j) {\n if(i === j) {\n if(list[i] > t) {\n return i - 1;\n }\n return i;\n }\n let middle = i + ((j - i) >> 1);\n if(list[middle] === t) {\n return middle;\n }\n else if(list[middle] > t) {\n return getIndex(list, t, i, Math.max(middle - 1, i));\n }\n else {\n return getIndex(list, t, Math.min(middle + 1, j), j);\n }\n}\n\nfunction getNewList(list, len, start = 0, end = 1) {\n if(start === 0 && end === 1) {\n return list;\n }\n if(start === end) {\n return [];\n }\n if(start > end) {\n [start, end] = [end, start];\n }\n // start和end只能相差<=1,如果>1则校正\n while(end - start > 1) {\n end--;\n }\n // 将start和end统一至最接近0的正值\n while(end < 0 || start < 0) {\n end++;\n start++;\n }\n while(end >= 1 && start >= 1) {\n end--;\n start--;\n }\n // clone出原本顶点列表,防止干扰\n let length = list.length;\n list = util.clone(list);\n let res = [];\n let start2 = start > 1 ? (start - 1) : start;\n let end2 = end > 1 ? (end - 1) : end;\n let i = getIndex(len.increase, start2 * len.total, 0, length - 1);\n let j = getIndex(len.increase, end2 * len.total, 0, length - 1);\n // start<0或者end>1或者普通情况,一共3种,start和end不可能同时超限\n let isStartLt0 = start < 0;\n let isEndGt1 = end > 1;\n end2 *= len.total;\n let prePercent = 1;\n let endPoint;\n if(end2 > len.increase[j]) {\n let prev = list[j].slice(list[j].length - 2); // 最后2个点是x,y,前面是control\n let current = list[j + 1];\n let l = len.list[j];\n let diff = end2 - len.increase[j];\n let t = diff / l;\n prePercent = t;\n if(current.length === 2) {\n let a = current[0] - prev[0];\n let b = current[1] - prev[1];\n if(isEndGt1) {\n endPoint = [prev[0] + t * a, prev[1] + t * b];\n }\n else {\n t = 1 - t;\n endPoint = [current[0] - t * a, current[1] - t * b];\n }\n }\n else if(current.length === 4) {\n let r = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t);\n endPoint = [r[1][0], r[1][1], r[2][0], r[2][1]];\n }\n else if(current.length === 6) {\n let r = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t);\n endPoint = [r[1][0], r[1][1], r[2][0], r[2][1], r[3][0], r[3][1]];\n }\n }\n start2 *= len.total;\n if(start2 > len.increase[i]) {\n let current;\n let prev = list[i].slice(list[i].length - 2);\n let l = len.list[i];\n // 同一条线段时如果有end裁剪,会影响start长度,这里还要防止头尾绕了一圈的情况\n if(i === j && !isStartLt0 && !isEndGt1 && prePercent !== 1) {\n l *= prePercent;\n if(endPoint) {\n current = endPoint;\n }\n }\n if(!current) {\n current = list[i + 1];\n }\n let diff = start2 - len.increase[i];\n let t = diff / l;\n if(current.length === 2) {\n let a = current[0] - prev[0];\n let b = current[1] - prev[1];\n if(isStartLt0) {\n t = 1 - t;\n res.push([current[0] - t * a, current[1] - t * b]);\n }\n else {\n res.push([prev[0] + t * a, prev[1] + t * b]);\n }\n res.push(current);\n }\n else if(current.length === 4) {\n let r = geom.sliceBezier([[current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n res.push(r[0]);\n res.push([r[1][0], r[1][1], r[2][0], r[2][1]]);\n // 同一条线段上去除end冲突\n if(i === j && !isStartLt0 && !isEndGt1) {\n endPoint = null;\n }\n }\n else if(current.length === 6) {\n let r = geom.sliceBezier([[current[4], current[5]], [current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n res.push(r[0])\n res.push([r[1][0], r[1][1], r[2][0], r[2][1], current[4], current[5]]);\n if(i === j && !isStartLt0 && !isEndGt1) {\n endPoint = null;\n }\n }\n }\n // start和end之间的线段,注意头尾饶了一圈的情况,以及起始点被上方考虑过了\n for(let k = i + 2; k <= j + (!isStartLt0 && !isEndGt1 ? 0 : length); k++) {\n res.push(list[k % length]);\n }\n if(endPoint) {\n res.push(endPoint);\n }\n return res;\n}\n\nclass Polyline extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 所有点的列表\n if(this.isMulti) {\n this.__points = [[]];\n this.__controls = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => parseFloat(i) || 0);\n for(let i = this.__start.length; i < this.__points.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = parseFloat(props.start) || 0;\n this.__start = this.__points.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n });\n for(let i = this.__end.length; i < this.__points.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = this.__points.map(() => v);\n }\n }\n else {\n this.__points = [];\n // 控制点\n this.__controls = [];\n this.__start = 0;\n this.__end = 1;\n if(!isNil(props.start)) {\n this.__start = parseFloat(props.start) || 0;\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = v;\n }\n }\n if(Array.isArray(props.controls)) {\n this.__controls = props.controls;\n }\n if(Array.isArray(props.points)) {\n this.__points = props.points;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n return points.map((item, i) => {\n if(!Array.isArray(item)) {\n return;\n }\n let len = item.length;\n if(isControl) {\n if(len !== 0 && len !== 2 && len !== 4) {\n return;\n }\n }\n else {\n if(len !== 0 && len !== 2) {\n return;\n }\n }\n let res = [];\n for(let i = 0; i < len; i++) {\n if(i % 2 === 0) {\n res.push(originX + item[i] * width);\n }\n else {\n res.push(originY + item[i] * height);\n }\n }\n return res;\n });\n }\n\n // 供polygon覆盖,后处理booleanOperations\n __reprocessing(list) {\n return list;\n }\n\n // 同polygon覆盖,booleanOperations改变时需刷新缓冲顶点坐标\n __needRebuildSE() {}\n\n buildCache(originX, originY) {\n let { width, height, points, controls, start, end, __cacheProps, isMulti } = this;\n let rebuild, rebuildSE;\n if(isNil(__cacheProps.points)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.points = points.map(item => {\n if(Array.isArray(item)) {\n return this.__getPoints(originX, originY, width, height, item);\n }\n });\n }\n else {\n __cacheProps.points = this.__getPoints(originX, originY, width, height, points);\n }\n }\n if(isNil(__cacheProps.controls)) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.controls = controls.map(item => {\n if(Array.isArray(item)) {\n return this.__getPoints(originX, originY, width, height, item, true);\n }\n return item;\n });\n }\n else {\n __cacheProps.controls = this.__getPoints(originX, originY, width, height, controls, true);\n }\n }\n if(isNil(__cacheProps.start)) {\n rebuildSE = true;\n __cacheProps.start = start;\n }\n if(isNil(__cacheProps.end)) {\n rebuildSE = true;\n __cacheProps.end = end;\n }\n // polygon会覆盖检查booleanOperations缓存\n if(this.__needRebuildSE(__cacheProps)) {\n rebuildSE = true;\n }\n // points/controls有变化就需要重建顶点\n if(rebuild) {\n let { points, controls } = __cacheProps;\n if(isMulti) {\n __cacheProps.list2 = points.map((item, i) => {\n let cl = controls[i];\n if(Array.isArray(item)) {\n return item.map((point, j) => {\n if(j) {\n return concatPointAndControl(point, cl && cl[j - 1]);\n }\n return point;\n });\n }\n });\n __cacheProps.len = getLength(__cacheProps.list2, isMulti);\n }\n else {\n __cacheProps.list2 = points.map((point, i) => {\n if(i) {\n return concatPointAndControl(point, controls[i - 1]);\n }\n return point;\n });\n __cacheProps.len = getLength(__cacheProps.list2, isMulti);\n }\n }\n if(rebuild || rebuildSE) {\n if(isMulti) {\n __cacheProps.list = __cacheProps.list2.map((item, i) => {\n if(Array.isArray(item)) {\n let len = __cacheProps.len;\n return getNewList(item, {\n list: len.list[i],\n total: len.total[i],\n increase: len.increase[i],\n }, __cacheProps.start[i], __cacheProps.end[i]);\n }\n });\n }\n else {\n __cacheProps.list = getNewList(__cacheProps.list2, __cacheProps.len, __cacheProps.start, __cacheProps.end);\n }\n // 后处理一次,让polygon支持布尔运算\n __cacheProps.list = this.__reprocessing(__cacheProps.list, isMulti);\n }\n return rebuild || rebuildSE;\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(res.break) {\n return res;\n }\n this.buildCache(res.sx3, res.sy3);\n ctx = res.ctx;\n this.__renderPolygon(renderMode, ctx, res);\n return res;\n }\n\n get points() {\n return this.getProps('points');\n }\n\n get controls() {\n return this.getProps('controls');\n }\n\n get start() {\n return this.getProps('start');\n }\n\n get end() {\n return this.getProps('end');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n },\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n let { points, controls } = __cacheProps;\n if(!isMulti) {\n points = [points];\n controls = [controls];\n }\n points.forEach((pointList, i) => {\n if(!pointList || pointList.length < 2 || !pointList[0] || !pointList[1]\n || pointList[0].length < 2 || pointList[1].length < 2) {\n return;\n }\n let controlList = controls[i] || [];\n let [xa, ya] = pointList[0];\n for(let i = 1, len = pointList.length; i < len; i++) {\n let [xb, yb] = pointList[i];\n let c = controlList[i - 1];\n if(c && c.length === 4) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], c[2], c[3], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2);\n }\n else if(c && c.length === 2) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] + x1);\n bbox[1] = Math.min(bbox[1], bezierBox[1] + y1);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + x2);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + y2);\n }\n else {\n bbox[0] = Math.min(bbox[0], xa + x1);\n bbox[1] = Math.min(bbox[1], ya + y1);\n bbox[2] = Math.max(bbox[2], xa + x2);\n bbox[3] = Math.max(bbox[3], ya + y2);\n }\n xa = xb;\n ya = yb;\n }\n });\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Polyline;\n","import Polyline from './Polyline';\nimport util from '../../util/util';\nimport { union, diff, intersection, xor } from '../../math/martinez';\n\nclass Polygon extends Polyline {\n constructor(tagName, props) {\n super(tagName, props);\n if(props.booleanOperations) {\n this.__booleanOperations = props.booleanOperations;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n let res = super.__getPoints(originX, originY, width, height, points, isControl);\n if(!isControl) {\n res.push(res[0]);\n }\n return res;\n }\n\n // 布尔运算覆盖,仅multi才发生,因为需要多个多边形数据\n __reprocessing(list, isMulti) {\n if(!isMulti) {\n return list;\n }\n let bo = this.booleanOperations, len = list.length;\n if(!Array.isArray(bo) && bo) {\n let old = bo;\n bo = [bo];\n for(let i = 1; i < len - 1; i++) {\n bo.push(old);\n }\n }\n if(Array.isArray(bo) && bo.length) {\n let res = [];\n let last;\n for(let i = 0; i < len - 1; i++) {\n let a = list[i], b = list[i + 1];\n switch(bo[i]) {\n case 'intersection':\n if(!a || !a.length || !b || !b.length) {\n res.push(null);\n }\n else {\n intersection([a], [b]).forEach(item => {\n res.push(item[0]);\n });\n }\n last = true;\n break;\n case 'union':\n if((!a || !a.length) && (!b || !b.length)) {\n res.push(null);\n }\n else if(!a || !a.length) {\n res.push(b);\n }\n else if(!b || !b.length) {\n res.push(a);\n }\n else {\n union([a], [b]).forEach(item => {\n res.push(item[0]);\n });\n }\n last = true;\n break;\n case 'diff':\n if(!a || !a.length) {\n res.push(null);\n }\n else if(!b || !b.length) {\n res.push(a);\n }\n else {\n diff([a], [b]).forEach(item => {\n res.push(item[0]);\n });\n }\n last = true;\n break;\n case 'xor':\n if((!a || !a.length) && (!b || !b.length)) {\n res.push(null);\n }\n else if(!a || !a.length) {\n res.push(b);\n }\n else if(!b || !b.length) {\n res.push(a);\n }\n else {\n xor([a], [b]).forEach(item => {\n res.push(item[0]);\n });\n }\n last = true;\n break;\n default:\n res.push(list[i]);\n last = false;\n break;\n }\n }\n // 最后一个没参与布尔运算,原封不动装载\n if(!last) {\n res.push(list[len - 1]);\n }\n return res;\n }\n return list;\n }\n\n // 覆盖,当booleanOperations动画改变时刷新顶点缓存\n __needRebuildSE(__cacheProps) {\n if(util.isNil(__cacheProps.booleanOperations)) {\n __cacheProps.booleanOperations = true;\n return true;\n }\n }\n\n get booleanOperations() {\n return this.getProps('booleanOperations');\n }\n}\n\nexport default Polygon;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport inject from '../../util/inject';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { sectorPoints } = geom;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction getR(v, dft) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = dft;\n }\n return v;\n}\n\nclass Sector extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 角度\n if(this.isMulti) {\n this.__begin = [0];\n this.__end = [0];\n this.__r = [1];\n if(Array.isArray(props.begin)) {\n this.__begin = props.begin.map(i => getR(i, 0));\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => getR(i, 0));\n }\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i, 1));\n }\n if(Array.isArray(props.edge)) {\n this.__edge = props.edge.map(i => !!i);\n }\n if(Array.isArray(props.closure)) {\n this.__closure = props.closure.map(i => !!i);\n }\n }\n else {\n this.__begin = this.__end = 0;\n // 半径[0, ∞),默认1\n this.__r = 1;\n // 扇形两侧是否有边\n this.__edge = false;\n // 扇形大于180°时,是否闭合两端\n this.__closure = false;\n if(!isNil(props.begin)) {\n this.__begin = getR(props.begin, 0);\n }\n if(!isNil(props.end)) {\n this.__end = getR(props.end, 0);\n }\n if(!isNil(props.r)) {\n this.__r = getR(props.r, 1);\n }\n if(!isNil(props.edge)) {\n this.__edge = !!props.edge;\n }\n if(!isNil(props.closure)) {\n this.__closure = !!props.closure;\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, begin, end, r, edge, closure, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.begin) || focus) {\n rebuild = true;\n __cacheProps.begin = (begin || 0) % 360;\n }\n if(isNil(__cacheProps.end) || focus) {\n rebuild = true;\n __cacheProps.end = (end || 0) % 360;\n }\n if(isNil(__cacheProps.r) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.r = r.map(r => r * width * 0.5);\n }\n else {\n __cacheProps.r = r * width * 0.5;\n }\n }\n r = __cacheProps.r;\n if(isNil(__cacheProps.edge) || focus) {\n rebuild = true;\n __cacheProps.edge = edge;\n }\n if(isNil(__cacheProps.closure) || focus) {\n rebuild = true;\n __cacheProps.closure = closure;\n }\n if(rebuild) {\n if(isMulti) {\n __cacheProps.list = [];\n __cacheProps.sList = [];\n begin.forEach((begin, i) => {\n let r2 = isNil(r[i]) ? width * 0.5 : r[i];\n let list = sectorPoints(cx, cy, r2, parseFloat(begin || 0) % 360, parseFloat(end[i] || 0) % 360);\n let sList = list.slice(0);\n if(closure[i]) {\n list.push(list[0].slice(0));\n if(edge) {\n sList.push(sList[0].slice(0));\n }\n }\n else {\n list.unshift([cx, cy]);\n list.push([cx, cy]);\n if(edge) {\n sList.unshift([cx, cy]);\n sList.push([cx, cy]);\n }\n }\n __cacheProps.list.push(list);\n __cacheProps.sList.push(sList);\n });\n }\n else {\n let list = sectorPoints(cx, cy, r, parseFloat(begin || 0), parseFloat(end || 0));\n let sList = list.slice(0);\n if(closure) {\n list.push(list[0].slice(0));\n if(edge) {\n sList.push(sList[0].slice(0));\n }\n }\n else {\n list.unshift([cx, cy]);\n list.push([cx, cy]);\n if(edge) {\n sList.unshift([cx, cy]);\n sList.push([cx, cy]);\n }\n }\n __cacheProps.list = list;\n __cacheProps.sList = sList;\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, dx2, dy2) {\n let res = super.render(renderMode, lv, ctx, cache, dx2, dy2);\n if(res.break) {\n return res;\n }\n this.buildCache(res.cx, res.cy);\n ctx = res.ctx;\n let {\n fill: fills,\n fillRule: fillRules,\n stroke: strokes,\n strokeWidth: strokeWidths,\n strokeDasharray: strokeDasharrays,\n strokeDasharrayStr: strokeDasharrayStrs,\n strokeLinecap: strokeLinecaps,\n strokeLinejoin: strokeLinejoins,\n strokeMiterlimit: strokeMiterlimits,\n dx,\n dy,\n } = res;\n let { __cacheProps: { list, sList }, isMulti } = this;\n // 普通情况下只有1个,按普通情况走\n if(fills.length <= 1 && strokes.length <= 1) {\n let o = {\n fill: fills[0],\n fillRule: fillRules[0],\n stroke: strokes[0],\n strokeWidth: strokeWidths[0],\n strokeDasharray: strokeDasharrays[0],\n strokeDasharrayStr: strokeDasharrayStrs[0],\n strokeLinecap: strokeLinecaps[0],\n strokeLinejoin: strokeLinejoins[0],\n strokeMiterlimit: strokeMiterlimits[0],\n dx,\n dy,\n };\n this.__renderOneSector(renderMode, ctx, isMulti, list, sList, o);\n }\n // 多个需要fill在下面,stroke在上面,依次循环\n else {\n for(let i = 0, len = fills.length; i < len; i++) {\n let fill = fills[i];\n if(fill) {\n let o = {\n fill,\n fillRule: fillRules[i],\n dx,\n dy,\n };\n this.__renderOneSector(renderMode, ctx, isMulti, list, sList, o);\n }\n }\n for(let i = 0, len = strokes.length; i < len; i++) {\n let stroke = strokes[i];\n if(stroke) {\n let o = {\n stroke,\n strokeWidth: strokeWidths[i],\n strokeDasharray: strokeDasharrays[i],\n strokeDasharrayStr: strokeDasharrayStrs[i],\n strokeLinecap: strokeLinecaps[i],\n strokeLinejoin: strokeLinejoins[i],\n strokeMiterlimit: strokeMiterlimits[i],\n dx,\n dy,\n };\n this.__renderOnePolygon(renderMode, ctx, isMulti, list, sList, o);\n }\n }\n }\n return res;\n }\n\n __renderOneSector(renderMode, ctx, isMulti, list, sList, res) {\n let {\n fill,\n stroke,\n strokeWidth,\n } = res;\n let isFillCE = fill.k === 'conic';\n let isStrokeCE = stroke.k === 'conic';\n let isFillRE = fill.k === 'radial' && Array.isArray(fill.v);\n let isStrokeRE = strokeWidth > 0 && stroke.k === 'radial' && Array.isArray(stroke.v);\n if(isFillCE || isStrokeCE) {\n if(isFillCE) {\n this.__conicGradient(renderMode, ctx, list, isMulti, res);\n }\n else if(fill && fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true);\n }\n if(strokeWidth > 0 && isStrokeCE) {\n inject.warn('Stroke style can not use conic-gradient');\n }\n else if(strokeWidth > 0 && stroke && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, sList, res, false, true);\n }\n }\n else if(isFillRE || isStrokeRE) {\n if(isFillRE) {\n this.__radialEllipse(renderMode, ctx, list, isMulti, res, 'fill');\n }\n else if(fill && fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true);\n }\n // stroke椭圆渐变matrix会变形,降级为圆\n if(strokeWidth > 0 && isStrokeRE) {\n inject.warn('Stroke style can not use radial-gradient for ellipse');\n res.stroke = res.stroke.v[0];\n this.__drawPolygon(renderMode, ctx, isMulti, sList, res, false, true);\n }\n else if(strokeWidth > 0 && stroke && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, sList, res, false, true);\n }\n }\n else {\n if(fill && fill !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, list, res, true, false);\n }\n if(strokeWidth > 0 && stroke && stroke !== 'none') {\n this.__drawPolygon(renderMode, ctx, isMulti, sList, res, false, true);\n }\n }\n }\n\n __genSector(edge, d, fill, stroke, strokeWidth, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit) {\n if(edge) {\n let props = [\n ['d', d[0]],\n ['fill', fill.v || fill],\n ['stroke', stroke.v || stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n else {\n this.addGeom('path', [\n ['d', d[0]],\n ['fill', fill.v || fill],\n ]);\n if(strokeWidth > 0) {\n let props = [\n ['d', d[1]],\n ['fill', 'none'],\n ['stroke', stroke.v || stroke],\n ['stroke-width', strokeWidth],\n ];\n this.__propsStrokeStyle(props, strokeDasharrayStr, strokeLinecap, strokeLinejoin, strokeMiterlimit);\n this.addGeom('path', props);\n }\n }\n }\n\n get begin() {\n return this.getProps('begin');\n }\n\n get end() {\n return this.getProps('end');\n }\n\n get r() {\n return this.getProps('r');\n }\n\n get edge() {\n return this.getProps('edge');\n }\n\n // >180°时是否链接端点\n get closure() {\n return this.getProps('closure');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY, width, height,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n let xa = cx - r + x1;\n let xb = cx + r + x2;\n let ya = cy - r + y1;\n let yb = cy + r + y2;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Sector;\n","import Geom from './Geom';\nimport util from \"../../util/util\";\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction genVertex(x, y, width, height, rx = 0, ry = 0) {\n if(rx === 0 || ry === 0) {\n return [\n [x, y],\n [x + width, y],\n [x + width, y + height],\n [x, y + height],\n [x, y],\n ];\n }\n let ox = rx * geom.H;\n let oy = ry * geom.H;\n return [\n [x + rx, y],\n [x + width - rx, y],\n [x + width + ox - rx, y, x + width, y + ry - oy, x + width, y + ry],\n [x + width, y + height - ry],\n [x + width, y + height + oy - ry, x + width + ox - rx, y + height, x + width - rx, y + height],\n [x + rx, y + height],\n [x + rx - ox, y + height, x, y + height + oy - ry, x, y + height - ry],\n [x, y + ry],\n [x, y + ry - oy, x + rx - ox, y, x + rx, y]\n ];\n}\n\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 0;\n }\n return v;\n}\n\nclass Rect extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 圆角\n if(this.isMulti) {\n this.__rx = [0];\n this.__ry = [0];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n }\n else {\n this.__rx = this.__ry = 0;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(rx => Math.min(rx, 0.5) * width);\n }\n else {\n __cacheProps.rx = Math.min(rx, 0.5) * width;\n }\n }\n if(isNil(__cacheProps.ry) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = rx.map(ry => Math.min(ry, 0.5) * height);\n }\n else {\n __cacheProps.ry = Math.min(ry, 0.5) * height;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => genVertex(originX, originY, width, height, rx, ry[i]));\n }\n else {\n __cacheProps.list = genVertex(originX, originY, width, height, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(res.break) {\n return res;\n }\n this.buildCache(res.sx3, res.sy3);\n ctx = res.ctx;\n this.__renderPolygon(renderMode, ctx, res);\n return res;\n }\n\n get rx() {\n return this.getProps('rx');\n }\n\n get ry() {\n return this.getProps('ry');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n root,\n __sx3: originX, __sy3: originY, width, height,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n }\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n bbox[0] = Math.min(bbox[0], originX + x1);\n bbox[1] = Math.min(bbox[1], originY + y1);\n bbox[2] = Math.max(bbox[2], originX + width + x2);\n bbox[3] = Math.max(bbox[3], originY + height + y2);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Rect;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Circle extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__r = [1];\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i));\n }\n else if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n else {\n this.__r = 1;\n if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, r, __cacheProps, isMulti } = this;\n if(isNil(__cacheProps.r) || focus) {\n if(isMulti) {\n __cacheProps.r = r.map(i => i * width * 0.5);\n __cacheProps.list = __cacheProps.r.map(r => geom.ellipsePoints(cx, cy, r, r));\n }\n else {\n __cacheProps.r = r * width * 0.5;\n __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r, __cacheProps.r);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(res.break) {\n return res;\n }\n this.buildCache(res.cx, res.cy);\n ctx = res.ctx;\n this.__renderPolygon(renderMode, ctx, res);\n return res;\n }\n\n get r() {\n return this.getProps('r');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY, width, height,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n let xa = cx - r + x1;\n let xb = cx + r + x2;\n let ya = cy - r + y1;\n let yb = cy + r + y2;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Circle;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n FILTER,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, VMAX, VMIN } = unit;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Ellipse extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__rx = [1];\n this.__ry = [1];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n else if(!isNil(props.rx)) {\n this.__rx = [getR(props.rx)];\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n else if(!isNil(props.ry)) {\n this.__ry = [getR(props.ry)];\n }\n }\n else {\n this.__rx = 1;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n this.__ry = 1;\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(i => i * width * 0.5);\n }\n else {\n __cacheProps.rx = rx * width * 0.5;\n }\n }\n if(isNil(__cacheProps.ry) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = ry.map(i => i * height * 0.5);\n }\n else {\n __cacheProps.ry = ry * height * 0.5;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => geom.ellipsePoints(cx, cy, rx, ry[i]));\n }\n else {\n __cacheProps.list = geom.ellipsePoints(cx, cy, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, dx, dy) {\n let res = super.render(renderMode, lv, ctx, cache, dx, dy);\n if(res.break) {\n return res;\n }\n this.buildCache(res.cx, res.cy);\n ctx = res.ctx;\n this.__renderPolygon(renderMode, ctx, res);\n return res;\n }\n\n get rx() {\n return this.getProps('rx');\n }\n\n get ry() {\n return this.getProps('ry');\n }\n\n get bbox() {\n if(!this.__bbox) {\n let {\n isMulti, __cacheProps, root,\n __sx3: originX, __sy3: originY, width, height,\n currentStyle: {\n [STROKE_WIDTH]: strokeWidth,\n [BOX_SHADOW]: boxShadow,\n [FILTER]: filter,\n }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let rx = 0, ry = 0;\n if(isMulti) {\n let mx = 0, my = 0;\n __cacheProps.rx.forEach((rx, i) => {\n mx = Math.max(rx, mx);\n my = Math.max(ry, __cacheProps.ry[i]);\n });\n rx = mx;\n ry = my;\n }\n else {\n rx = __cacheProps.rx;\n ry = __cacheProps.ry;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE], half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01, half);\n }\n else {\n half = Math.max(item[0], half);\n }\n });\n let [x1, y1, x2, y2] = this.__spreadBbox(boxShadow, filter);\n x1 -= half;\n y1 -= half;\n x2 += half;\n y2 += half;\n let xa = cx - rx + x1;\n let xb = cx + rx + x2;\n let ya = cy - ry + y1;\n let yb = cy + ry + y2;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Ellipse;\n","import reset from '../style/reset';\n\nlet fullCssProperty = {\n skewX: 'kx',\n skewY: 'ky',\n transform: 'tf',\n fontSize: 'fz',\n offset: 'os',\n easing: 'e',\n filter: 'ft',\n boxShadow: 'bd',\n overflow: 'of',\n backgroundClip: 'bp',\n textOverflow: 'tof',\n flexWrap: 'fp',\n perspective: 'ppt',\n rotate3d: 'r3',\n};\n\nlet abbrCssProperty = {\n os: 'offset', // 非css属性不会被下面反向遍历插入,手动\n e: 'easing',\n};\n\nlet fullAnimate = {\n value: 'v',\n options: 'o',\n};\n\nlet abbrAnimate = {};\n\nlet fullAnimateOption = {\n duration: 'dt',\n delay: 'd',\n endDelay: 'ed',\n iterations: 'i',\n direction: 'dc',\n fill: 'f',\n fps: 'fp',\n playbackRate: 'p',\n spfLimit: 'sl',\n};\n\nlet abbrAnimateOption = {};\n\nreset.DOM_KEY_SET.concat(reset.GEOM_KEY_SET).forEach(k => {\n if(fullCssProperty.hasOwnProperty(k)) {\n abbrCssProperty[fullCssProperty[k]] = k;\n return;\n }\n let v = k.charAt(0) + k.replace(/[a-z]/g, '').toLowerCase();\n fullCssProperty[k] = v;\n abbrCssProperty[v] = k;\n});\n\nObject.keys(fullAnimate).forEach(k => {\n abbrAnimate[fullAnimate[k]] = k;\n});\n\nObject.keys(fullAnimateOption).forEach(k => {\n abbrAnimateOption[fullAnimateOption[k]] = k;\n});\n\nexport default {\n fullCssProperty,\n abbrCssProperty,\n fullAnimate,\n abbrAnimate,\n fullAnimateOption,\n abbrAnimateOption,\n};\n","import abbr from './abbr';\nimport Node from '../node/Node';\nimport Component from '../node/Component';\nimport $$type from '../util/$$type';\nimport util from '../util/util';\nimport inject from '../util/inject';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet { isNil, isFunction, isPrimitive, clone, extend } = util;\nlet { abbrCssProperty, abbrAnimateOption, abbrAnimate } = abbr;\n\n/**\n * 还原缩写到全称,涉及样式和动画属性\n * @param target 还原的对象\n * @param hash 缩写映射\n */\nfunction abbr2full(target, hash) {\n // 也许节点没写样式\n if(target) {\n Object.keys(target).forEach(k => {\n // var-attr格式特殊考虑,仅映射attr部分,var-还要保留\n if(k.indexOf('var-') === 0) {\n let k2 = k.slice(4);\n if(hash.hasOwnProperty(k2)) {\n let fk = hash[k2];\n target['var-' + fk] = target[k];\n // delete target[k];\n }\n }\n // 普通样式缩写还原\n else if(hash.hasOwnProperty(k)) {\n let fk = hash[k];\n target[fk] = target[k];\n // 删除以免二次解析\n delete target[k];\n }\n });\n }\n}\n\nfunction replaceVars(json, vars) {\n if(json && vars) {\n // 新版vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // 排除特殊的library\n if(Array.isArray(member) && member.length && member[0] !== 'library' && vars.hasOwnProperty(id)) {\n let target = json;\n for(let i = 0, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // undefined和null意义不同\n if(v === undefined) {\n return;\n }\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n target[k] = v;\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Slot miss ' + k);\n return;\n }\n }\n }\n });\n }\n }\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-') === 0) {\n let v = json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(4);\n // 有id且变量里面传入了替换的值,值可为null,因为某些情况下空为自动\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n // undefined和null意义不同\n if(value === undefined) {\n return;\n }\n let target = json;\n // 如果有.则特殊处理子属性\n if(k2.indexOf('.') > -1) {\n let list = k2.split('.');\n let len = list.length;\n for(let i = 0; i < len - 1; i++) {\n k2 = list[i];\n // 避免异常\n if(target[k2]) {\n target = target[k2];\n }\n else {\n inject.warn('parseJson vars is not exist: ' + v.id + ', ' + k + ', ' + list.slice(0, i).join('.'));\n return;\n }\n }\n k2 = list[len - 1];\n }\n // 支持函数模式和值模式\n if(isFunction(value)) {\n value = value(v);\n }\n target[k2] = value;\n }\n }\n });\n }\n }\n}\n\nfunction replaceAnimateOptions(options, opt) {\n ['iterations', 'fill', 'duration', 'direction', 'easing', 'fps', 'delay', 'endDelay', 'playbackRate', 'spfLimit'].forEach(k => {\n if(opt.hasOwnProperty(k)) {\n options[k] = opt[k];\n }\n });\n}\n\nfunction replaceLibraryVars(json, hash, vars) {\n if(vars) {\n // 新版同级vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // library.xxx,需要>=2的长度\n if(Array.isArray(member) && member.length > 1 && vars.hasOwnProperty(id)) {\n if(member[0] === 'library') {\n let target = hash;\n for(let i = 1, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n let old = target[k];\n // 直接替换library的子对象,需补充id和tagName\n if(i === 1) {\n target[k] = Object.assign({ id: old.id, tagName: old.tagName }, v);\n }\n // 替换library中子对象的一个属性直接赋值\n else {\n target[k] = v;\n }\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Library slot miss ' + k);\n return;\n }\n }\n }\n }\n });\n }\n }\n // 兼容老版var-\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-library.') === 0) {\n let v = json[k];\n // 直接移除library插槽,防止下面调用replaceVars(json, vars)时报错\n delete json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(12);\n // 有id且变量里面传入了替换的值\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n if(isFunction(value)) {\n value = value(v);\n }\n // 替换图层的值必须是一个有tagName的对象\n if(!value || !value.tagName) {\n return;\n }\n // library对象也要加上id,与正常的library保持一致\n hash[k2] = Object.assign({ id: k2 }, value);\n }\n }\n });\n }\n }\n}\n\n/**\n * 遍历一遍library的一级,将一级的id存到hash上,无需递归二级,\n * 因为顺序前提要求排好且无循环依赖,所以被用到的一定在前面出现,\n * 一般是无children的元件在前,包含children的div在后\n * 即便library中的元素有children或library,在linkChild时将其link过去,parse递归会继续处理\n * @param item:library的一级孩子\n * @param hash:存放library的key/value引用\n */\nfunction linkLibrary(item, hash) {\n let id = item.id;\n // library中一定有id,因为是一级,二级+特殊需求才会出现放开\n if(isNil(id)) {\n throw new Error('Library item miss id: ' + JSON.stringify(item));\n }\n else {\n hash[id] = item;\n }\n}\n\n/**\n * 链接child到library文件,\n * props需要是clone的,因为防止多个child使用同一个库文件\n * children则直接引用,无需担心多个使用同一个\n * library也需要带上,在library直接子元素还包含library时会用到\n * @param child\n * @param libraryItem\n */\nfunction linkChild(child, libraryItem) {\n // 规定图层child只有init和动画,属性和子图层来自库\n child.tagName = libraryItem.tagName;\n child.props = clone(libraryItem.props);\n child.children = libraryItem.children;\n child.library = libraryItem.library;\n // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况\n Object.keys(libraryItem).forEach(k => {\n if(k.indexOf('var-') === 0 && !child.hasOwnProperty(k)) {\n child[k] = libraryItem[k];\n }\n });\n // 删除以免二次解析\n child.libraryId = null;\n // 规定图层实例化的属性和样式在init上,优先使用init,然后才取原型链的props\n let { init } = child;\n if(init) {\n let props = child.props = child.props || {};\n let style = props.style;\n extend(props, init);\n // style特殊处理,防止被上面覆盖丢失原始值\n if(style) {\n extend(style, init.style);\n props.style = style;\n }\n // 删除以免二次解析\n child.init = null;\n }\n}\n\nfunction parse(karas, json, animateRecords, opt, hash = {}) {\n if(isPrimitive(json) || json instanceof Node || json instanceof Component) {\n return json;\n }\n if(Array.isArray(json)) {\n return json.map(item => {\n return parse(karas, item, animateRecords, opt, hash);\n });\n }\n // 先判断是否是个链接到库的节点,是则进行链接操作\n let libraryId = json.libraryId;\n if(!isNil(libraryId)) {\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,tagName和属性和子图层来自库\n if(libraryItem) {\n linkChild(json, libraryItem);\n }\n else {\n throw new Error('Link library miss id: ' + libraryId);\n }\n json.libraryId = null;\n }\n // 再判断是否有library形成一个新的作用域,会出现library下的library使得一个链接节点链接后出现library的情况\n let library = json.library;\n if(Array.isArray(library)) {\n hash = {};\n library.forEach(item => {\n linkLibrary(item, hash);\n });\n // 替换library插槽\n replaceLibraryVars(json, hash, opt.vars);\n json.library = null;\n }\n let { tagName, props = {}, children = [], animate = [] } = json;\n if(!tagName) {\n throw new Error('Dom must have a tagName: ' + JSON.stringify(json));\n }\n let style = props.style;\n (opt.abbr !== false) && abbr2full(style, abbrCssProperty);\n // 先替换style的\n replaceVars(style, opt.vars);\n // 再替换静态属性,style也作为属性的一种,目前尚未被设计为被替换\n replaceVars(props, opt.vars);\n // 替换children里的内容,如文字,无法直接替换tagName/props/children/animate本身,因为下方用的还是原引用\n replaceVars(json, opt.vars);\n if(!Array.isArray(children)) {\n throw new Error('children must be an array');\n }\n let vd;\n if(tagName.charAt(0) === '$') {\n vd = karas.createGm(tagName, props);\n }\n else if(/^[A-Z]/.test(tagName)) {\n let cp = Component.getRegister(tagName);\n vd = karas.createCp(cp, props, children.map(item => {\n if(item && [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(item.$$type) > -1) {\n return item;\n }\n return parse(karas, item, animateRecords, opt, hash);\n }));\n }\n else {\n vd = karas.createVd(tagName, props, children.map(item => {\n if(item && [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(item.$$type) > -1) {\n return item;\n }\n return parse(karas, item, animateRecords, opt, hash);\n }));\n }\n if(animate) {\n if(!Array.isArray(animate)) {\n animate = [animate];\n }\n let has;\n animate.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrAnimate);\n let { value, options } = item;\n // 忽略空动画\n if(Array.isArray(value) && value.length) {\n has = true;\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n replaceAnimateOptions(options, opt);\n }\n });\n // 产生实际动画运行才存入列表供root调用执行\n if(has) {\n animateRecords.push({\n animate,\n target: vd,\n });\n }\n }\n return vd;\n}\n\nexport default parse;\n","import parse from './parse';\nimport abbr from './abbr';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport font from '../style/font';\nimport Controller from '../animate/Controller';\n\nlet o = {\n parse(karas, json, dom, options = {}) {\n if(!json) {\n return;\n }\n // 特殊单例声明无需clone加速解析\n if(!options.singleton && !json.singleton) {\n json = util.clone(json);\n }\n // 根节点的fonts字段定义字体信息\n let fonts = json.fonts;\n if(fonts) {\n if(!Array.isArray(fonts)) {\n fonts = [fonts];\n }\n fonts.forEach(item => {\n let { fontFamily, data } = item;\n if(fontFamily && data) {\n font.register(fontFamily, data);\n }\n });\n }\n // json中定义无abbr\n if(json.abbr === false) {\n options.abbr = false;\n }\n if(options.abbr !== false) {\n inject.warn('Abbr in json is deprecated');\n }\n // 重载,在确定dom传入选择器字符串或html节点对象时作为渲染功能,否则仅创建vd返回\n if(!inject.isDom(dom)) {\n options = dom || {};\n dom = null;\n }\n // 暂存所有动画声明,等root的生成后开始执行\n let animateRecords = [];\n let vd = parse(karas, json, animateRecords, options);\n // 有dom时parse作为根方法渲染\n if(dom) {\n let { tagName } = json;\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) === -1) {\n throw new Error('Parse dom must be canvas/svg');\n }\n // parse直接(非递归)的动画记录\n let ac = options.controller instanceof Controller ? options.controller : vd.animateController;\n // 第一次render,收集递归json里面的animateRecords,它在xom的__layout最后生成\n karas.render(vd, dom);\n // 由于vd首先生成的都是json,根parse要特殊处理将target指向真正的vd引用,json的vd在builder中赋值\n animateRecords.forEach(item => {\n item.target = item.target.vd;\n });\n // 直接的json里的animateRecords,再加上递归的parse的json的(第一次render布局时处理)动画一并播放\n if(options.autoPlay !== false) {\n ac.__records = ac.__records.concat(animateRecords);\n ac.__playAuto();\n }\n // 不自动播放进入记录列表,初始化并等待手动调用\n else {\n ac.__records2 = ac.__records2.concat(animateRecords);\n ac.init(ac.__records2, ac.list2);\n }\n }\n // 递归的parse,如果有动画,此时还没root,先暂存下来,等上面的root的render第一次布局时收集\n else {\n if(animateRecords.length) {\n vd.__animateRecords = {\n options,\n list: animateRecords,\n controller: options.controller instanceof Controller ? options.controller : null,\n };\n }\n }\n return vd;\n },\n loadAndParse(karas, json, dom, options) {\n let { fonts, components, imgs } = json;\n let list1 = [];\n let list2 = [];\n let list3 = [];\n if(fonts) {\n if(!Array.isArray(fonts)) {\n fonts = [fonts];\n }\n fonts.forEach(item => {\n let url = item.url;\n if(url) {\n list1.push(item);\n }\n });\n }\n if(components) {\n if(!Array.isArray(components)) {\n components = [components];\n }\n components.forEach(item => {\n let { tagName, url, reload } = item;\n // 如果没申明reload且已经被注册,则无需重复加载\n if(tagName && karas.Component.hasRegister(tagName) && !reload) {\n return;\n }\n // 即便没有tagName也要加载,可能组件内部执行了注册逻辑\n if(url) {\n list2.push(item);\n }\n });\n }\n if(imgs) {\n if(!Array.isArray(imgs)) {\n imgs = [imgs];\n }\n imgs.forEach(item => {\n let url = item.url;\n if(url) {\n list3.push(url);\n }\n });\n }\n let a = list1.length, b = list2.length, c = list3.length;\n if(a || b || c) {\n let count = 0;\n let cb = function() {\n if(count === a + b + c) {\n let res = o.parse(karas, json, dom, options);\n if(options && util.isFunction(options.callback)) {\n options.callback(res);\n }\n }\n };\n karas.inject.loadFont(list1, function() {\n count += a;\n cb();\n });\n karas.inject.loadComponent(list2.map(item => item.url), function() {\n count += b;\n // 默认约定加载的js组件会在全局变量申明同名tagName,已有不覆盖,防止组件代码内部本身有register\n list2.forEach(item => {\n let tagName = item.tagName;\n if(tagName && window[tagName] && !karas.Component.hasRegister(tagName)) {\n karas.Component.register(tagName, window[tagName]);\n }\n });\n cb();\n });\n karas.inject.measureImg(list3, function() {\n count += c;\n cb();\n });\n }\n else {\n let res = o.parse(karas, json, dom, options);\n if(options && util.isFunction(options.callback)) {\n options.callback(res);\n }\n return res;\n }\n },\n abbr,\n};\n\nexport default o;\n","import css from './css';\nimport reset from './reset';\nimport unit from './unit';\nimport font from './font';\nimport abbr from './abbr';\nimport transform from './transform';\n\nexport default {\n css,\n reset,\n unit,\n font,\n abbr,\n transform,\n};\n","import Animation from './Animation';\nimport Controller from './Controller';\nimport easing from './easing';\nimport frame from './frame';\n\nexport default {\n Animation,\n Controller,\n easing,\n frame,\n};\n","import level from './level';\nimport change from './change';\nimport Page from './Page';\nimport Cache from './Cache';\n\nexport default {\n level,\n change,\n Page,\n Cache,\n};\n","import Node from './node/Node';\nimport Text from './node/Text';\nimport Xom from './node/Xom';\nimport Dom from './node/Dom';\nimport Img from './node/Img';\nimport Root from './node/Root';\nimport tag from './node/tag';\nimport mode from './refresh/mode';\nimport Geom from './node/geom/Geom';\nimport Line from './node/geom/Line';\nimport Polyline from './node/geom/Polyline';\nimport Polygon from './node/geom/Polygon';\nimport Sector from './node/geom/Sector';\nimport Rect from './node/geom/Rect';\nimport Circle from './node/geom/Circle';\nimport Ellipse from './node/geom/Ellipse';\nimport Component from './node/Component';\nimport Event from './util/Event';\nimport util from './util/util';\nimport $$type from './util/$$type';\nimport builder from './util/builder';\nimport updater from './util/updater';\nimport inject from './util/inject';\nimport enums from './util/enums';\nimport debug from './util/debug';\nimport parser from './parser/index';\nimport style from './style/index';\nimport animate from './animate/index';\nimport math from './math/index';\nimport refresh from './refresh/index';\nimport { version } from '../package.json';\n\nGeom.register('$line', Line);\nGeom.register('$polyline', Polyline);\nGeom.register('$polygon', Polygon);\nGeom.register('$sector', Sector);\nGeom.register('$rect', Rect);\nGeom.register('$circle', Circle);\nGeom.register('$ellipse', Ellipse);\n\nlet karas = {\n version,\n render(root, dom) {\n if(!(root instanceof Root)) {\n throw new Error('Render dom must be canvas/svg');\n }\n if(dom) {\n root.appendTo(dom);\n }\n return root;\n },\n createElement(tagName, props) {\n props = props || {};\n let children = [];\n for(let i = 2, len = arguments.length; i < len; i++) {\n children.push(arguments[i]);\n }\n if(util.isString(tagName)) {\n if(tagName.charAt(0) === '$') {\n return this.createGm(tagName, props);\n }\n else {\n return this.createVd(tagName, props, children);\n }\n }\n else if(tagName) {\n // 特殊的$匿名类\n if(tagName instanceof Geom) {\n return this.createGm(tagName, props);\n }\n return this.createCp(tagName, props, children);\n }\n },\n createVd(tagName, props, children = []) {\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n if(tag.TAG_NAME.hasOwnProperty(tagName)) {\n return {\n tagName,\n props,\n children,\n $$type: $$type.TYPE_VD,\n };\n }\n throw new Error(`Can not use <${tagName}>`);\n },\n createGm(tagName, props) {\n return {\n tagName,\n props,\n $$type: $$type.TYPE_GM,\n };\n },\n createCp(klass, props, children = []) {\n props.children = children;\n return {\n klass,\n props,\n $$type: $$type.TYPE_CP,\n };\n },\n parse(json, dom, options) {\n return parser.parse(this, json, dom, options);\n },\n loadAndParse(json, dom, options) {\n return parser.loadAndParse(this, json, dom, options);\n },\n mode,\n Component,\n Node,\n Text,\n Geom,\n Xom,\n Dom,\n Img,\n Root,\n Event,\n util,\n inject,\n style,\n parser,\n animate,\n math,\n builder,\n updater,\n refresh,\n enums,\n set debug(v) {\n debug.flag = !!v;\n },\n};\n\nbuilder.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\n\nif(typeof window !== 'undefined') {\n window.karas = karas;\n}\nelse if(typeof self !== 'undefined') {\n self.karas = karas;\n}\n\nexport default karas;\n"],"names":["STYLE_KEY","POSITION","DISPLAY","TOP","RIGHT","BOTTOM","LEFT","MARGIN_TOP","MARGIN_RIGHT","MARGIN_BOTTOM","MARGIN_LEFT","PADDING_TOP","PADDING_RIGHT","PADDING_BOTTOM","PADDING_LEFT","FONT_SIZE","FONT_FAMILY","COLOR","FONT_STYLE","FONT_WEIGHT","LINE_HEIGHT","BACKGROUND_IMAGE","BACKGROUND_COLOR","BACKGROUND_SIZE","BACKGROUND_REPEAT","BACKGROUND_POSITION_X","BACKGROUND_POSITION_Y","BORDER_TOP_WIDTH","BORDER_RIGHT_WIDTH","BORDER_BOTTOM_WIDTH","BORDER_LEFT_WIDTH","BORDER_TOP_COLOR","BORDER_RIGHT_COLOR","BORDER_BOTTOM_COLOR","BORDER_LEFT_COLOR","BORDER_TOP_STYLE","BORDER_RIGHT_STYLE","BORDER_BOTTOM_STYLE","BORDER_LEFT_STYLE","BORDER_TOP_LEFT_RADIUS","BORDER_TOP_RIGHT_RADIUS","BORDER_BOTTOM_RIGHT_RADIUS","BORDER_BOTTOM_LEFT_RADIUS","WIDTH","HEIGHT","FLEX_GROW","FLEX_SHRINK","FLEX_BASIS","FLEX_DIRECTION","JUSTIFY_CONTENT","ALIGN_ITEMS","ALIGN_SELF","TEXT_ALIGN","TRANSFORM_ORIGIN","VISIBILITY","OPACITY","Z_INDEX","TRANSFORM","TRANSLATE_X","TRANSLATE_Y","TRANSLATE_Z","SCALE_X","SCALE_Y","SCALE_Z","SKEW_X","SKEW_Y","ROTATE_X","ROTATE_Y","ROTATE_Z","ROTATE_3D","PERSPECTIVE","PERSPECTIVE_ORIGIN","FILTER","BOX_SHADOW","POINTER_EVENTS","OVERFLOW","MIX_BLEND_MODE","BACKGROUND_CLIP","WHITE_SPACE","TEXT_OVERFLOW","LETTER_SPACING","LINE_CLAMP","ORDER","FLEX_WRAP","ALIGN_CONTENT","TEXT_STROKE_WIDTH","TEXT_STROKE_COLOR","TEXT_STROKE_OVER","FILL","STROKE","STROKE_WIDTH","STROKE_DASHARRAY","STROKE_DASHARRAY_STR","STROKE_LINECAP","STROKE_LINEJOIN","STROKE_MITERLIMIT","FILL_RULE","MATRIX","BORDER_TOP","BORDER_RIGHT","BORDER_BOTTOM","BORDER_LEFT","TRANSLATE_PATH","STYLE2LOWER_MAP","style2Lower","s","toLowerCase","replace","$0","$1","toUpperCase","STYLE2UPPER_MAP","style2Upper","$2","STYLE_R_KEY","STYLE_RV_KEY","STYLE_V_KEY","Object","keys","forEach","k","k2","l","UPDATE_KEY","UPDATE_NODE","UPDATE_STYLE","UPDATE_FOCUS","UPDATE_MEASURE","UPDATE_COMPONENT","UPDATE_OVERWRITE","UPDATE_KEYS","UPDATE_LIST","UPDATE_CONFIG","UPDATE_ADD_DOM","UPDATE_REMOVE_DOM","KEY_FRAME_KEY","FRAME_STYLE","FRAME_TIME","FRAME_EASING","FRAME_TRANSITION","NODE_KEY","NODE_DOM_PARENT","NODE_OPACITY","NODE_MATRIX","NODE_MATRIX_EVENT","NODE_CACHE","NODE_CACHE_TOTAL","NODE_CACHE_FILTER","NODE_CACHE_MASK","NODE_CACHE_OVERFLOW","NODE_STRUCT","NODE_TAG_NAME","NODE_CURRENT_STYLE","NODE_CURRENT_PROPS","NODE_COMPUTED_STYLE","NODE_CACHE_STYLE","NODE_CACHE_PROPS","NODE_LIMIT_CACHE","NODE_IS_MASK","NODE_IS_INLINE","NODE_HAS_CONTENT","NODE_REFRESH_LV","NODE_IS_DESTROYED","NODE_STYLE","NODE_UPDATE_HASH","NODE_UNIQUE_UPDATE_ID","NODE_DEFS_CACHE","NODE_PERSPECTIVE_MATRIX","NODE_VIRTUAL_DOM","NODE_CACHE_AS_BITMAP","STRUCT_KEY","STRUCT_NODE","STRUCT_INDEX","STRUCT_CHILD_INDEX","STRUCT_LV","STRUCT_NUM","STRUCT_TOTAL","STRUCT_HAS_MASK","ANIMATE_KEY","I_ASSIGNING","I_IN_FPS","I_IS_DELAY","I_BEGIN","I_END","I_FINISHED","I_NEXT_END","I_FIRST_PLAY","I_PLAY_CB","I_TARGET","I_ROOT","I_FRAMES","I_FRAMES_R","I_CURRENT_TIME","I_NEXT_TIME","I_STYLE","I_DURATION","I_ITERATIONS","I_FILL","I_PLAYBACK_RATE","I_PLAY_COUNT","I_PLAY_STATE","I_DESTROYED","I_START_TIME","I_FPS_TIME","I_EASING","I_ENTER_FRAME","I_DELAY","I_END_DELAY","I_KEYS","I_ORIGIN_STYLE","I_CURRENT_FRAMES","I_CURRENT_FRAME","I_SPF_LIMIT","I_FPS","I_DIRECTION","I_FIRST_ENTER","I_STAY_BEGIN","I_STAY_END","I_IS2","I_END_TIME","I_NODE_CONFIG","I_ROOT_CONFIG","I_OUT_BEGIN_DELAY","I_TIME_STAMP","enums","Node","__x","__y","__ox","__oy","__sx","__sy","__width","__height","__baseline","__config","__prev","__next","__parent","__domParent","__root","__host","i","lv","j","root","struct","diff","isLayout","x","ox","y","oy","__hostRoot","__virtualDom","CANVAS","SVG","WEBGL","o","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","REM","EM","VW","VH","VMAX","VMIN","calUnit","v","n","parseFloat","test","info","arial","lhr","blr","lgr","padding","f","helvetica","verdana","tahoma","S","T","Z","c","t","georgia","simsun","support","fontFamily","hasOwnProperty","register","name","emSquare","ascent","descent","lineGap","addPadding","assign","position","gradient","img","identity","multiply","a","b","isE","a0","a1","a2","a3","calPoint","point","m","z","w","undefined","length","b1","c1","d1","b2","c2","d2","b3","c3","d3","a4","b4","c4","d4","d","e","inverse","inverse4","divisor","inv","det","m2m6","point2d","slice","dotProduct","x1","y1","x2","y2","crossProduct","H","Math","sqrt","vector","mx","h","deg","cos","sin","pointInPolygon","vertexes","xmax","ymax","xmin","ymin","len","max","min","pointInQuadrilateral","x4","y4","x3","y3","matrix","w1","w2","w3","w4","angleBySide","theta","pow","acos","sideByAngle","alpha","pointsDistance","triangleIncentre","ellipsePoints","sectorPoints","r","begin","end","list","floor","h2","d2r","abs","atan","rx","ry","p1","p2","p4","p3","push","concat","temp","res","getRectsIntersection","isRectsOverlap","ax1","ay1","ax4","ay4","bx1","by1","bx4","by4","isRectsInside","calCoordsInNode","px","py","node","computedStyle","width","height","calPercentInNode","ds","Infinity","PI","dt","r2d","bboxBezier2","x0","y0","minX","minY","maxX","maxY","tx","ty","sx","sy","qx","qy","bboxBezier3","cx","cy","bx","by","ax","ay","hx","hy","q","bboxBezier","arguments","norm","order","sum","reduce","simpson38","derivativeFunc","middleL","middleR","adaptiveSimpson38","eps","mid","st","sl","sr","ans","bezierLength","points","startT","endT","at","at3","p0","at2","bezierOrder","derivativeOrder","pointAtBezier","percent","maxIteration","pointAtBezierWithLength","targetLen","approachLen","approachT","preApproachT","derivative1","derivative2","numerator","denominator","sliceBezier","x12","y12","x23","y23","x123","y123","x34","y34","x234","y234","x1234","y1234","sliceBezier2Both","start","reverse","pointOnCircle","getConicGradientImage","originX","originY","stop","data","Error","getAngle","dx","dy","increasingList","map","item","color","angle","factor","idx","canvasPolygon","ctx","Array","isArray","moveTo","lineTo","quadraticCurveTo","bezierCurveTo","svgPolygon","canvasLine","controlA","controlB","num","svgLine","canvasFilter","filter","svgFilter","geom","unit","painter","calFitDashed","total","bs","be","smin","smax","dmin","dmax","ps","pd","outer","per","free","mo","calDashed","style","m1","m2","m3","m4","bw","calPoints","borderWidth","borderStyle","deg1","deg2","direction","beginRadius","endRadius","indexOf","isLast","main1","main2","cross1","cross2","tan","calTopRadiusPoints","calRightRadiusPoints","calBottomRadiusPoints","calLeftRadiusPoints","pointsList","brx","bry","erx","ery","oxl","oxr","beginList","centerList","endList","ya","yb","beginLength","needInner","crossDeg","rx1","ry1","sx1","oyl","rx2","ry2","sx2","xa","xb","ca","calBezierTopLeft","cb","controls1","controls2","limit","pop","endLength","oyr","calBezierTopRight","isStart","crossDx","p1x","p1y","p2x","p2y","dx1","dsx1","dx2","dsx2","cpx2","cpy2","cpx1","cpy1","crossDsx","beta","tanBetaDiv2Sqrt","tanAlphaHalf","degTg","degTg1","cdx1","cdy1","cx1","cy1","degTg2","cdx2","cdy2","cx2","cy2","isEnd","oyt","oyb","oxt","calBezierRightTop","oxb","calBezierRightBottom","calBezierBottomLeft","calBezierBottomRight","calBezierLeftTop","calBezierLeftBottom","calRadius","btlr","btrr","bbrr","bblr","need","btlx","btly","btrx","btry","bbrx","bbry","bblx","bbly","BR_KS","calBorderRadius","currentStyle","noRadius","target","prev","next","half","calBorderRadiusInline","contentBoxList","first","last","outerWidth","outerHeight","renderBorder","xom","renderMode","mode","beginPath","fillStyle","fill","closePath","virtualDom","bb","type","tagName","props","TYPE_VD","Symbol","TYPE_GM","TYPE_CP","toString","isType","obj","call","isObject","isString","isFunction","isNumber","isBoolean","isDate","hasOwn","fnToString","ObjectFunctionString","isNil","joinSourceArray","arr","stringify","encodeHtml","prop","joinVirtualDom","vd","defs","joinDef","joinVd","conClip","children","isMask","content","opacity","transform","visibility","mask","overflow","mixBlendMode","def","uuid","joinItem","rgba2int","charAt","parseInt","match","int2rgba","joinArr","int2invert","arr2hash","hash","hash2arr","clone","$$type","util","Date","isPlainObject","equalArr","ai","bi","isArrayA","isArrayB","equal","getTime","extend","source","split","extendAnimate","ovd","nvd","__animationList","animationList","splice","__setTarget","assigning","finished","__stayEnd","assignCurrentStyle","__frameAnimateList","transformBbox","bbox","proto","getPrototypeOf","Ctor","constructor","assignMatrix","isPrimitive","isAuto","flag","charWidth","ELLIPSIS","antialias","premultipliedAlpha","preserveDrawingBuffer","initShaders","gl","vshader","fshader","program","createProgram","enable","BLEND","blendFunc","ONE","ONE_MINUS_SRC_ALPHA","vertexShader","loadShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","attachShader","linkProgram","linked","getProgramParameter","LINK_STATUS","error","getProgramInfoLog","deleteProgram","deleteShader","shader","createShader","shaderSource","compileShader","compiled","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","convertCoords2Gl","revertY","createTexture","tex","texture","bindTexture","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","texImage2D","TEXTURE_2D","UNSIGNED_BYTE","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","LINEAR","TEXTURE_MAG_FILTER","activeTexture","drawTextureCache","vtPoint","vtTex","vtOpacity","lastChannel","record","stack","cache","channel","page","tx1","ty1","tx2","ty2","pointBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","Float32Array","STATIC_DRAW","a_position","getAttribLocation","vertexAttribPointer","FLOAT","enableVertexAttribArray","texBuffer","a_texCoords","opacityBuffer","a_opacity","u_texture","getUniformLocation","count","uniform1i","drawArrays","TRIANGLES","deleteBuffer","disableVertexAttribArray","drawBlur","frameBuffer","texCache","tex1","tex2","spread","sigma","u_direction","uniform2f","ratio","recycle","tex3","framebufferTexture2D","FRAMEBUFFER","COLOR_ATTACHMENT0","tex4","deleteTexture","drawCm","u_m","uniform1fv","drawOverflow","programOverflow","drawMask","u_texture1","u_texture2","drawMbm","W","SPF","CANVAS_LIST","WEBGL_LIST","SUPPORT_OFFSCREEN_CANVAS","OffscreenCanvas","prototype","getContext","defaultFontFamilyData","key","message","debug","document","createElement","setAttribute","body","appendChild","canvas","draw","enabled","available","release","cacheCanvas","cacheWebgl","IMG","INIT","LOADING","LOADED","FONT","COMPONENT","inject","measureText","textCache","html","lengths","chars","ff","fs","fw","inline","char","div","left","top","innerHTML","cns","childNodes","index","css","window","getComputedStyle","text","__measureCb","removeChild","measureTextSync","measureImg","url","state","success","task","Image","onload","onerror","substr","host","exec","location","hostname","crossOrigin","src","warn","console","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","id","clearTimeout","now","performance","hasCacheCanvas","getCacheCanvas","releaseCacheCanvas","delCacheCanvas","hasCacheWebgl","getCacheWebgl","releaseCacheWebgl","delCacheWebgl","isDom","Element","self","getElementsByTagName","isWebGLTexture","WebGLTexture","checkSupportFontFamily","font","checked","context","textAlign","textBaseline","clearRect","fillText","getImageData","loadFont","FontFace","load","then","fonts","add","loadComponent","script","async","head","getLinearDeg","getRadialPosition","center","right","bottom","getColorStop","firstColor","p","dr","dg","db","da","unshift","calLinearCoords","calCircleCentre","iw","ih","positionX","positionY","calRadialRadius","shape","size","xl","yl","asin","parseGradient","reg","i5","i6","i7","getLinear","coords","l1","l2","l3","l4","r1","getRadial","scx","scy","getConic","calConicRadius","renderConic","isInline","border","offscreen","imgData","putImageData","save","clip","drawImage","restore","DOM","display","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","fontSize","fontStyle","fontWeight","lineHeight","backgroundImage","backgroundColor","backgroundSize","backgroundRepeat","backgroundPositionX","backgroundPositionY","backgroundClip","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","flexGrow","flexShrink","flexBasis","flexDirection","flexWrap","justifyContent","alignItems","alignSelf","alignContent","letterSpacing","transformOrigin","zIndex","translateX","translateY","translateZ","scaleX","scaleY","scaleZ","skewX","skewY","rotateX","rotateY","rotateZ","rotate3d","perspective","perspectiveOrigin","boxShadow","pointerEvents","whiteSpace","textOverflow","lineClamp","textStrokeWidth","textStrokeColor","textStrokeOver","GEOM","stroke","strokeWidth","strokeDasharray","strokeLinecap","strokeLinejoin","strokeMiterlimit","fillRule","DOM_ENTRY_SET","DOM_KEY_SET","GEOM_ENTRY_SET","GEOM_KEY_SET","INHERIT_KEY_SET","isValid","parseFlex","grow","shrink","basis","parseMarginPadding","parseOneBorder","margin","borderTop","borderRight","borderBottom","borderLeft","borderColor","borderRadius","background","backgroundPosition","flex","translate","translate3d","scale","scale3d","rotate","skew","textStroke","toFull","bgc","bgi","bgr","bgp","gd","repeat","join","isEmpty","v2","KEY_COLOR","KEY_LENGTH","KEY_GRADIENT","KEY_RADIUS","COLOR_HASH","LENGTH_HASH","RADIUS_HASH","GRADIENT_HASH","GRADIENT_TYPE","linear","radial","conic","KEY_EXPAND","EXPAND_HASH","RESET_DOM","reset","RESET_GEOM","IGNORE","REPAINT","MEASURE","addGeom","ks","isIgnore","isGeom","isRepaint","isMeasure","MEASURE_KEY_SET","isMeasureInherit","measureInheritList","change","TRANSFORM_HASH","compatibleTransform","normalize","abbr","flexFlow","k1","arr1","arr2","k3","arr3","isNaN","computeMeasure","isRoot","domParent","parentComputedStyle","getFontFamily","computeReflow","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","DEFAULT_COMPARE","SplayTree","compare","noDuplicates","_compare","_root","_size","_noDuplicates","prototypeAccessors","configurable","rotateLeft","rotateRight","_splay","splay","gp","ggp","u","minNode","maxNode","insert","comp","cmp","find","contains","comparator","remove","removeNode","erase","sMax","returnValue","successor","predecessor","callback","current","done","range","low","high","fn","Q","values","presort","sort","loadRecursive","get","createTree","defineProperties","middle","pivot","tmp","NORMAL","NON_CONTRIBUTING","SAME_TRANSITION","DIFFERENT_TRANSITION","INTERSECTION","UNION","DIFFERENCE","XOR","computeFields","event","operation","inOut","otherInOut","isSubject","isVertical","prevInResult","inResult","isInResult","resultTransition","determineResultTransition","thisIn","thatIn","isIn","SweepEvent","otherEvent","edgeType","otherPos","outputContourId","isExteriorRing","prototypeAccessors$1","isBelow","isAbove","copy","contourId","equals","epsilon","splitter","resulterrbound","elen","flen","Qnew","hh","bvirt","enow","fnow","eindex","findex","hindex","estimate","vec","Float64Array","ccwerrboundA","ccwerrboundB","ccwerrboundC","B","C1","C2","D","orient2dadapt","detsum","acxtail","acytail","bcxtail","bcytail","ahi","alo","bhi","blo","_i","_j","_0","s1","s0","t1","t0","u3","acx","bcx","acy","bcy","errbound","C1len","C2len","Dlen","orient2d","detleft","detright","signedArea","compareEvents","e1","e2","specialCases","divideSegment","se","queue","intersection","noEndpointTouch","va","vb","toPoint","kross","sqrKross","sqrLenA","sa","sb","possibleIntersection","se1","se2","inter","nintersections","events","leftCoincide","rightCoincide","compareSegments","le1","le2","subdivide","eventQueue","subject","clipping","sbbox","cbbox","sweepLine","sortedEvents","rightbound","prevEvent","prevprevEvent","prevprev","Contour","holeIds","holeOf","depth","isExterior","orderEvents","resultEvents","sorted","nextPos","processed","origPos","newPos","initializeContourFromContext","contours","contour","lowerContourId","lowerResultTransition","lowerContour","parentContourId","connectEdges","loop","markAsProcessed","initial","_tinyqueue_1_2_3_tinyqueue","TinyQueue","default_1","defaultCompare","_down","_up","peek","halfLength","best","processPolygon","contourOrHole","s2","fillQueue","polygonSet","ii","jj","EMPTY","trivialOperation","result","compareBBoxes","boolean","trivial","polygons","rings","holeId","union","xor","intersection$1","tar","booleanOperations","math","calSingle","rlen","nc","xy","yz","zx","xs","ys","zs","calMatrix","ow","oh","calMatrixByOrigin","calMatrixWithOrigin","normalizeSingle","calOrigin","tfo","calMatrixByPerspective","pm","calPerspectiveMatrix","ppt","po","isPerspectiveMatrix","kernelSize","outerSize","outerSizeByD","gaussianWeight","E","genSingle","dbx","dby","Cache","__init","__bbox","__page","__pos","getCoords","__appendData","__isNew","__enabled","setTransform","globalAlpha","update","__available","clear","del","ceil","getInstance","blur","cacheMask","isClip","__sx1","__sy1","tf","globalCompositeOperation","drawCache","xe","ye","cacheOverflow","rect","old","newCache","nx","ny","parentMatrix","dbx2","dby2","ENUM","NONE","TRANSFORM_ALL","REFLOW","REBUILD","TRANSFORMS","contain","value","getLevel","isReflow","isRebuild","Text","__textBoxes","__charWidthList","__charWidth","__textWidth","charWidthList","ffs","__ff","__key","wait","needMeasure","pff","pffs","pfs","pfw","pKey","__pKey","parentCache","mw","__cache","lx","lineBoxManager","endSpace","lineClampCount","isDestroyed","textBoxes","beginSpace","maxW","needReduce","lastChar","ew","bp","__bp","lineCount","isTextOverflow","__lineBack","textBox","addItem","cw","hasCache","needBack","setNewLine","__ellipsis","lineBox","tb","__offsetX","__offsetY","textWidth","lineWidth","strokeColor","strokeStyle","render","endX","endY","__cacheStyle","delRefreshTask","__task","addRefreshTask","__before","level","__addUpdate","__after","__style","matrixEvent","__renderByMask","flattenJson","traverseJson","lastText","options","Xom","Dom","Img","Geom","Component","initRoot","cd","flatten","__json","build","relation","initDom","json","initCp","initCp2","klass","__tagName","hasP","__inheritAnimate","__animateRecords","__placeholder","__children","getRegister","ref","shadowRoot","Event","__eHash","handle","on","apply","off","__karasEventCb","once","emit","fns","REGISTER","setUpdateFlag","cp","__hasCpUpdate","__ref","__isMounted","__taskList","__nextState","addRefreshCp","builder","__cd","listener","__shadow","shadow","__shadowRoot","componentDidMount","REFRESH","__isDestroyed","componentWillUnmount","__destroy","force","__emitEvent","__state","hasRegister","defineProperty","matrixResize","imgWidth","imgHeight","targetWidth","targetHeight","renderBgc","method","me","calBackgroundSize","calBackgroundPosition","container","renderImage","loadBgi","bx2","by2","bgW","bgH","bgX","bgY","needMask","xnl","xnr","ynt","ynb","image","needResize","traversal","after","isPause","Frame","__hookTask","__taskCp","__now","taskCp","cloneCp","lengthCp","__karasFramecb","offFrame","onFrame","NEWTON_ITERATIONS","NEWTON_MIN_SLOPE","SUBDIVISION_PRECISION","SUBDIVISION_MAX_ITERATIONS","kSplineTableSize","kSampleStepSize","float32ArraySupported","aA1","aA2","C","calcBezier","aT","getSlope","binarySubdivide","aX","aA","aB","mX1","mX2","currentX","currentT","newtonRaphsonIterate","aGuessT","currentSlope","LinearEasing","bezier","mY1","mY2","sampleValues","getTForX","intervalStart","currentSample","lastSample","dist","guessForT","initialSlope","BezierEasing","easing","easeIn","easeOut","ease","easeInOut","cubicBezier","getEasing","v1","v3","timingFunction","NUM_CAL_HASH","unify","frames","getProps","inherit","genBeforeRefresh","__frameHook","framing","duration","es","offset","translatePath","calByUnit","calDiff","nm","pHash","nHash","keyHash","hasChange","nv","pv","pi","ni","has","pp","nn","clientWidth","eq","isArrP","isArrN","pz","nz","np","len2","pv2","nv2","len3","pv3","nv3","calFrame","ts","binarySearch","frame","ea","steps","stepsD","calIntermediateStyle","transition","st2","calIncrease","o2","n2","gotoOverload","calDiffTime","playbackRate","spfLimit","fps","frameCb","isDelay","FRAME","PLAY","Animation","__id","nl","__options","op","config","iterations","framesR","originStyle","delay","endDelay","isFinish","__cancelTask","__currentProps","__currentStyle","playState","__hasFin","__hasCancel","playCount","currentFrames","stayBegin","stayEnd","is2","endTime","currentTime","currentFrame","round","isAlternate","alternate","isEven","isLastCount","frameTime","isLastFrame","inEndDelay","needClean","playCb","__clean","BEGIN","END","FINISH","silence","pending","PAUSE","play","CANCEL","__goto","isFrame","excludeDelay","finish","currentProps","spf","animateController","backwards","both","forwards","__target","sync","removeControl","nextFrame","__checkModify","renderBoxShadow","inset","box","spreadBox","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","blurBox","MBM_HASH","screen","overlay","darken","lighten","difference","exclusion","hue","saturation","luminosity","mbmName","isValidMbm","getInlineBox","diffL","eyt","eyb","pbt","pbb","dom","getInlineWidth","contentBox","LOCAL","mbm","TF","TX","TY","TZ","getFirstEmptyInlineWidth","flowChildren","child","getLastEmptyInlineWidth","__computedStyle","__listener","__loadBgi","__cacheDefs","__isClip","__isMask","__contentBoxList","__cacheAsBitmap","cacheAsBitmap","__hasMask","__mpWidth","mp","__clientWidth","__clientHeight","__offsetWidth","__offsetHeight","__outerWidth","__outerHeight","onlyFixedValue","isDirectionRow","res2","isDirectItem","mbp","__calMp","__calBorder","isVirtual","fromAbs","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","isReplaced","offsetWidth","offsetHeight","matrixCache","isScale","clientHeight","x5","x6","y5","y6","__calFilter","bg","bgI","item2","kw","__bx1","__bx2","__by1","__by2","rebuild","__hasContent","isRealInline","sx4","sx5","sx6","sy4","sy5","sy6","__calPerspective","__calMatrix","hasContent","__calContent","__releaseWhenEmpty","limitCache","__calCache","perspectiveMatrix","offscreenBlend","offscreenMask","hasFilter","offscreenFilter","offscreenOverflow","borderList","hasBgi","some","svgBgSymbol","__gradient","isFirst","lastContentBox","lastLineBox","parentLineBox","countW","ix1","iy1","ix2","iy2","symbol","clearAnimate","clearFrameAnimate","__stopPropagation","__stopImmediatePropagation","willResponseEvent","hasEmitMask","ignore","inThis","__touchstartTarget","__getLg","__getRg","__getCg","lg","createLinearGradient","addColorStop","rg","createRadialGradient","ec","dc","pc","cur","onlyTotal","__cacheTotal","__cacheFilter","__cacheMask","__cacheOverflow","formatStyle","animation","cancel","enter","yt","xr","includeBbox","isShadowRoot","hostRoot","pJson","zChildren","zIndexChildren","__spreadBbox","LineBox","__list","__lineHeight","increasedHeight","hasReplaced","isVerticalAlign","LineBoxManager","__lastX","__lastY","__maxX","__domList","__domStack","__isNewLine","__isEnd","__spreadYList","__setLB","nextNewLine","genLineBox","syl","verticalAlign","isNewLine","TAG_NAME","INLINE","BOLD","offsetAndResizeByNodeOnY","reflowHash","inDirectAbsList","isContainer","cs","__layoutAbs","isAbs","__resizeY","clearUniqueReflowId","__uniqueReflowId","getMergeMarginTB","topList","bottomList","genZIndexChildren","hasMc","mcHash","lastMaskIndex","__iIndex","__zIndex","__aIndex","genOrderChildren","__order","block","inlineBlock","none","tag","__flexLine","__zIndexChildren","__structure","nss","__structs","structs","needSort","__tryLayInline","firstCharWidth","main","hasLayout","columnCrossCount","columnCrossMax","isRow","__calMinMax","min2","max2","columnCrossMax2","__layout","countMin","countMax","setNotEnd","__addMBP","isFixed","isContent","fixedSize","__lineBoxManager","__preLayout","__ioSize","mergeMarginBottomList","mergeMarginTopList","isXom","isInlineBlock","reflow","__isIbFull","lastX","lastY","isNone","isEmptyBlock","tw","th","spreadYList","isLastBlock","isBlock","horizonAlign","__inlineSize","domList","__marginAuto","growList","shrinkList","basisList","maxList","minList","columnCrossList","orderChildren","__calBasis","columnCross","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","__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","OFFSCREEN_OVERFLOW","OFFSCREEN_FILTER","OFFSCREEN_MASK","OFFSCREEN_BLEND","OFFSCREEN_MASK2","applyOffscreen","origin","MockPage","genUuid","MockCache","NA","CHILD","SELF","getCache","OP","FT","MBM","PPT","genBboxTotal","parentIndexHash","opacityHash","includeLimitCache","bboxTotal","matrixHash","parentIndex","node2","hasTotal","mergeBbox","genTotal","hasMask","cacheTotal","cacheFilter","needGen","baseMatrix","matrixList","opacityList","parentOpacity","lastConfig","lastLv","refreshLevel","countMaskNum","ctxTotal","lastMatrix","maskStartHash","offscreenHash","genOverflow","genFilter","genMask","lastOpacity","sbox","resetMatrixCacheTotal","isNew","genFrameBufferWithTexture","lockOneChannel","webgl","createFramebuffer","bindFramebuffer","checkFramebufferStatus","FRAMEBUFFER_COMPLETE","viewport","clearColor","COLOR_BUFFER_BIT","genTotalWebgl","hasMbm","getParameter","MAX_TEXTURE_SIZE","parentPm","totalLimitCache","addTexAndDrawWhenLimit","mockCache","refresh","releaseLockChannel","hookGlRender","frameBuffer2","texture2","genMbmWebgl","deleteFramebuffer","genFilterWebgl","genBlurWebgl","rotation","cosR","sinR","genColorMatrixWebgl","amount","oneMinusAmount","useProgram","MAX_VARYING_VECTORS","weights","vert","frag","vertexBlur","fragmentBlur","findExistTexChannel","lockChannel","programCm","genOverflowWebgl","overflowCache","genMaskWebgl","programClip","programMask","maskCache","fbo","fragmentMultiply","fragmentScreen","fragmentOverlay","fragmentDarken","fragmentLighten","fragmentColorDodge","fragmentColorBurn","fragmentHardLight","fragmentSoftLight","fragmentDifference","fragmentExclusion","fragmentHue","fragmentSaturation","fragmentColor","fragmentLuminosity","vertexMbm","renderSvg","maskEffectHash","defsCache","hasEffectMask","addCache","maskHash","vdList","parentVd","mChildren","ivs","hasTransform","renderWebgl","pmList","lastRefreshLevel","mergeList","hasRecordAsMask","validMbm","isPerspective","limitHash","pptHash","renderCanvas","TexCache","units","__units","__pages","__channels","__locks","__lockUnits","pages","channels","locks","lastHash","oldList","newList","shift","cl","fullSize","setToChannel","DIRECTION_HASH","ROOT_DOM_NAME","getDom","querySelector","renderProp","EVENT_LIST","initEvent","Root","__wrapEvent","__cb","addEventListener","removeEvent","removeEventListener","isFixedWidthOrHeight","isFixedSize","includeParentFlex","isLAYOUT","setLAYOUT","component","addDom","checkInfluence","topFlex","isSiblingBlock","uniqueUpdateId","parseUpdate","reflowList","measureList","cacheList","zHash","zList","overwrite","focus","measure","removeDom","style2","keys2","hasMeasure","hasZ","hasVisibility","hasColor","hasDisplay","__struct","isRp","cleanSvgCache","__uniqueZId","__rlv","__dom","__mw","__mh","__taskUp","__reflowList","__animateController","mix","__updateHash","domName","__scx","__scy","getBoundingClientRect","touches","clientX","clientY","stopPropagation","stopImmediatePropagation","preventDefault","__hasEmitted","__initProps","nodeName","__genHtml","__defs","getPropertyValue","params","contextAttributes","__ctx","__renderMode","vertex","fragment","vertexMask","fragmentMask","fragmentClip","fragmentOverflow","vertexCm","fragmentCm","MAX_TEXTURE_IMAGE_UNITS","__texCache","destroy","__eventCbList","__checkRoot","__checkUpdate","__checkReflow","noRender","__clear","__vd","domDiff","updateStyle","taskUp","__hasRootUpdate","__nextFrameCp","updater","includeIgnore","scan","path","zPath","__index__","karas","path2","zPath2","nodeConfig","rootConfig","updateHash","__updateRoot","updateRoot","hasUpdate","__updateStruct","measureHash","__uniqueUpdateId","isInherit","uniqueList","hasRoot","diffList","diffI","mergeOffsetList","__uniqueMergeOffsetId","cps","cts","isLastAbs","isNowAbs","isLastNone","isNowNone","hasFlowPrev","__modifyStruct","startIndex","startNode","oldH","nowH","lastIndex","ns","reBuild","base","reBuildC","curveNum","getNewPoint","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","__start","__end","dy2","buildCache","curve","x1s","y1s","x2s","y2s","bezierBox","concatPointAndControl","control","getLength","increase","getIndex","getNewList","start2","end2","isStartLt0","isEndGt1","prePercent","endPoint","Polyline","__points","__controls","controls","isControl","rebuildSE","__getPoints","__needRebuildSE","__reprocessing","__renderPolygon","pointList","controlList","Polygon","__booleanOperations","bo","getR","dft","Sector","__begin","__r","edge","__edge","closure","__closure","sList","r2","__renderOneSector","genVertex","Rect","__rx","__ry","Circle","Ellipse","my","fullCssProperty","abbrCssProperty","os","fullAnimate","abbrAnimate","fullAnimateOption","abbrAnimateOption","abbr2full","fk","replaceVars","vars","slot","member","replaceAnimateOptions","opt","replaceLibraryVars","linkLibrary","JSON","linkChild","libraryItem","library","libraryId","parse","animateRecords","createGm","createCp","createVd","singleton","loadAndParse","components","imgs","list1","list3","version","appendTo","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,SAAS,GAAG;AAChBC,EAAAA,QAAQ,EAAE,CADM;AAEhBC,EAAAA,OAAO,EAAE,CAFO;AAGhBC,EAAAA,GAAG,EAAE,CAHW;AAIhBC,EAAAA,KAAK,EAAE,CAJS;AAKhBC,EAAAA,MAAM,EAAE,CALQ;AAMhBC,EAAAA,IAAI,EAAE,CANU;AAOhBC,EAAAA,UAAU,EAAE,CAPI;AAQhBC,EAAAA,YAAY,EAAE,CARE;AAShBC,EAAAA,aAAa,EAAE,CATC;AAUhBC,EAAAA,WAAW,EAAE,CAVG;AAWhBC,EAAAA,WAAW,EAAE,EAXG;AAYhBC,EAAAA,aAAa,EAAE,EAZC;AAahBC,EAAAA,cAAc,EAAE,EAbA;AAchBC,EAAAA,YAAY,EAAE,EAdE;AAehBC,EAAAA,SAAS,EAAE,EAfK;AAgBhBC,EAAAA,WAAW,EAAE,EAhBG;AAiBhBC,EAAAA,KAAK,EAAE,EAjBS;AAkBhBC,EAAAA,UAAU,EAAE,EAlBI;AAmBhBC,EAAAA,WAAW,EAAE,EAnBG;AAoBhBC,EAAAA,WAAW,EAAE,E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,IAAP,KAAgB,WAAnB,EAAgC;AACnCA,EAAAA,IAAI,CAACqqD,KAAL,GAAaA,OAAb;AACD;;;;"} \ No newline at end of file diff --git a/index.js b/index.js index 0f8a40489..e67041267 100644 --- a/index.js +++ b/index.js @@ -40629,7 +40629,7 @@ Cache: Cache }; - var version = "0.69.9"; + var version = "0.70.0"; Geom$1.register('$line', Line); Geom$1.register('$polyline', Polyline); diff --git a/json.md b/json.md index 065c842a1..3343669f6 100644 --- a/json.md +++ b/json.md @@ -277,13 +277,13 @@ karas.loadAndParse( "fonts": [ { "fontFamily": "DINPro", + "url": "xxx", // 加载的url "data": { "emSquare": 2000, "ascent": 1200, "descent": 800, "lineGap": 60 - }, - "url": "xxx" // 加载的url + } } ], "components": [ diff --git a/package.json b/package.json index 0eef7b121..92f835eec 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "karas", - "version": "0.69.9", + "version": "0.70.0", "description": "A flexible JavaScript framework for RIA on Canvas/Svg/Webgl.", "maintainers": [ {