From f1f82e1fc3c5cc3d626014a9edbf23f9fd5f12ae Mon Sep 17 00:00:00 2001 From: army8735 Date: Mon, 29 Nov 2021 11:32:39 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20json=E7=9A=84singleton=E5=A3=B0?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- json.md | 11 +++++++++++ src/parser/index.js | 5 ++++- src/style/unit.js | 8 ++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/json.md b/json.md index 834ef3b88..065c842a1 100644 --- a/json.md +++ b/json.md @@ -313,3 +313,14 @@ karas.parse({ abbr: false, // 等同于上面的 }); ``` +对于每个json,`parse`的时候都进行复制一份解析,以避免对传入原始数据的修改,这会造成一些性能损失。如果确保只有1个实例且无需保护原有json数据,不进行复制操作,那么json中或者`parse`的第3个`options`参数可声明`singleton`。 +```tsx +karas.parse({ + tagName: 'div', + props: {}, + children: [], + singleton: true, // 等同于下面的 +}, { + singleton: true, // 等同于上面的 +}); +``` diff --git a/src/parser/index.js b/src/parser/index.js index ab4acb210..c60b249c4 100644 --- a/src/parser/index.js +++ b/src/parser/index.js @@ -7,7 +7,10 @@ import Controller from '../animate/Controller'; let o = { parse(karas, json, dom, options = {}) { - json = util.clone(json); + // 特殊单例声明无需clone加速解析 + if(!options.singleton && !json.singleton) { + json = util.clone(json); + } // 根节点的fonts字段定义字体信息 let fonts = json.fonts; if(fonts) { diff --git a/src/style/unit.js b/src/style/unit.js index 137ee3520..a33cf5664 100644 --- a/src/style/unit.js +++ b/src/style/unit.js @@ -11,6 +11,8 @@ let o = { EM: 9, VW: 10, VH: 11, + VMAX: 12, + VMIN: 13, /** * 通用的格式化计算数值单位的方法,百分比/像素/REM/VW/auto和纯数字 * @param v value @@ -45,6 +47,12 @@ let o = { else if(/vh$/i.test(v)) { return [n, o.VH]; } + else if(/vmax$/i.test(v)) { + return [n, o.VMAX]; + } + else if(/vmin$/i.test(v)) { + return [n, o.VMIN]; + } return [n, o.NUMBER]; }, }; From b38ab95b07ed593c74e360abcd644a1eaad0ec09 Mon Sep 17 00:00:00 2001 From: army8735 Date: Mon, 29 Nov 2021 11:35:23 +0800 Subject: [PATCH 2/5] chore: build #194 --- index.js | 13 ++++++++++++- index.js.map | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index c56b45b19..090d0dffc 100644 --- a/index.js +++ b/index.js @@ -702,6 +702,8 @@ EM: 9, VW: 10, VH: 11, + VMAX: 12, + VMIN: 13, /** * 通用的格式化计算数值单位的方法,百分比/像素/REM/VW/auto和纯数字 @@ -729,6 +731,10 @@ return [n, o.VW]; } else if (/vh$/i.test(v)) { return [n, o.VH]; + } else if (/vmax$/i.test(v)) { + return [n, o.VMAX]; + } else if (/vmin$/i.test(v)) { + return [n, o.VMIN]; } return [n, o.NUMBER]; @@ -39295,7 +39301,12 @@ var o$4 = { parse: function parse$1(karas, json, dom) { var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - json = util.clone(json); // 根节点的fonts字段定义字体信息 + + // 特殊单例声明无需clone加速解析 + if (!options.singleton && !json.singleton) { + json = util.clone(json); + } // 根节点的fonts字段定义字体信息 + var fonts = json.fonts; diff --git a/index.js.map b/index.js.map index b967ae090..922371d90 100644 --- a/index.js.map +++ b/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["src/util/enums.js","src/node/Node.js","src/node/mode.js","src/style/unit.js","src/style/font.js","src/style/reg.js","src/math/matrix.js","src/math/vector.js","src/math/geom.js","src/math/gradient.js","src/util/painter.js","src/style/border.js","src/util/$$type.js","src/util/util.js","src/util/debug.js","src/node/textCache.js","src/gl/ca.js","src/gl/webgl.js","src/util/inject.js","src/style/gradient.js","src/style/reset.js","src/style/abbr.js","src/animate/key.js","src/refresh/change.js","src/style/css.js","src/node/TextBox.js","src/refresh/Page.js","src/math/tar.js","src/math/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_FRAME_CB: 8,\n I_PLAY_CB: 9,\n I_TARGET: 10,\n I_ROOT: 11,\n I_FRAMES: 12,\n I_FRAMES_R: 13,\n I_CURRENT_TIME: 14,\n I_NEXT_TIME: 15,\n I_STYLE: 16,\n I_DURATION: 17,\n I_ITERATIONS: 18,\n I_FILL: 19,\n I_PLAYBACK_RATE: 20,\n I_PLAY_COUNT: 21,\n I_PLAY_STATE: 22,\n I_DESTROYED: 23,\n I_START_TIME: 24,\n I_FPS_TIME: 25,\n I_EASING: 26,\n I_ENTER_FRAME: 27,\n I_DELAY: 28,\n I_END_DELAY: 29,\n I_KEYS: 30,\n I_ORIGIN_STYLE: 31,\n I_CURRENT_FRAMES: 32,\n I_CURRENT_FRAME: 33,\n I_SPF_LIMIT: 34,\n I_FPS: 35,\n I_DIRECTION: 36,\n I_CAL_DIFF_TIME: 37,\n I_FIRST_ENTER: 38,\n I_STAY_BEGIN: 39,\n I_STAY_END: 40,\n I_IS2: 41,\n I_END_TIME: 42,\n I_NODE_CONFIG: 43,\n I_ROOT_CONFIG: 44,\n I_OUT_BEGIN_DELAY: 45,\n I_TIME_STAMP: 46,\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.__width = 0;\n this.__height = 0;\n this.__baseLine = 0;\n this.__config = {};\n // 默认undefined\n // this.__prev = undefined;\n // this.__next = undefined;\n // this.__parent = undefined;\n // this.__domParent = undefined;\n // this.__root = undefined;\n // this.__host = undefined;\n }\n\n __structure(i, lv, j) {\n return this.__config[NODE_STRUCT] = {\n [STRUCT_NODE]: this,\n [STRUCT_INDEX]: i,\n [STRUCT_CHILD_INDEX]: j,\n [STRUCT_LV]: lv,\n };\n }\n\n __modifyStruct(root, offset = 0) {\n let struct = this.__config[NODE_STRUCT];\n return [struct, 0];\n }\n\n __offsetX(diff, isLayout) {\n if(isLayout) {\n this.__x += diff;\n }\n else {\n this.__ox += diff;\n }\n this.__sx += diff;\n }\n\n __offsetY(diff, isLayout) {\n if(isLayout) {\n this.__y += diff;\n }\n else {\n this.__oy += diff;\n }\n this.__sy += diff;\n }\n\n __destroy() {\n this.__config[NODE_IS_DESTROYED] = true;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get ox() {\n return this.__ox;\n }\n\n get oy() {\n return this.__oy;\n }\n\n get sx() {\n return this.x + this.ox;\n }\n\n get sy() {\n return this.y + this.oy;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n // canvas/svg根节点\n get root() {\n return this.__root;\n }\n\n // component根节点\n get host() {\n return this.__host;\n }\n\n // 考虑高阶组件在内的component根节点\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get baseLine() {\n return this.__baseLine;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get isDestroyed() {\n return this.__config[NODE_IS_DESTROYED];\n }\n}\n\nexport default Node;\n","export default {\n CANVAS: 0,\n SVG: 1,\n WEBGL: 2,\n};\n","let o = {\n AUTO: 0,\n PX: 1,\n PERCENT: 2,\n NUMBER: 3,\n INHERIT: 4,\n DEG: 5,\n STRING: 6,\n RGBA: 7,\n REM: 8,\n EM: 9,\n VW: 10,\n VH: 11,\n /**\n * 通用的格式化计算数值单位的方法,百分比/像素/REM/VW/auto和纯数字\n * @param v value\n * @returns 格式化好的[number, unit]\n */\n calUnit(v) {\n let n = parseFloat(v) || 0;\n if(/%$/.test(v)) {\n return [n, o.PERCENT];\n }\n else if(/px$/i.test(v)) {\n return [n, o.PX];\n }\n else if(/deg$/i.test(v)) {\n return [n, o.DEG];\n }\n else if(/rem$/i.test(v)) {\n return [n, o.REM];\n }\n else if(/vw$/i.test(v)) {\n return [n, o.VW];\n }\n else if(/vh$/i.test(v)) {\n return [n, o.VH];\n }\n else if(/em$/i.test(v)) {\n return [n, o.EM];\n }\n else if(/vw$/i.test(v)) {\n return [n, o.VW];\n }\n else if(/vh$/i.test(v)) {\n return [n, o.VH];\n }\n return [n, o.NUMBER];\n },\n};\n\nexport default o;\n","'use strict';\n\nlet o = {\n info: {\n arial: {\n lhr: 1.14990234375, // 默认line-height ratio,(67+1854+434)/2048\n // car: 1.1171875, // content-area ratio,(1854+434)/2048\n blr: 0.9052734375, // base-line ratio,1854/2048\n // mdr: 0.64599609375, // middle ratio,(1854-1062/2)/2048\n lgr: 0.03271484375, // line-gap ratio,67/2048,默认0\n // 个别字符误差,初次之外误差还有根据经验得的比例系数,https://github.com/karasjs/karas/issues/145\n padding: {\n 1: 1,\n f: 0.9,\n },\n },\n verdana: {\n lhr: 1.21533203125, // (0+2059+430)/2048\n blr: 1.00537109375, // 2059/2048\n },\n tahoma: {\n lhr: 1.20703125, // (0+2049+423)/2048\n blr: 1.00048828125, // 2049/2048\n padding: {\n S: 1,\n T: 1,\n Z: 1,\n c: 1,\n f: 0.7,\n i: 1,\n l: 1,\n t: 0.9,\n },\n },\n georgia: {\n lhr: 1.13623046875, // (0+1878+449)/2048\n blr: 0.9169921875, // 1878/2048\n },\n 'courier new': {\n lhr: 1.1328125, // (0+1705+615)/2048\n blr: 0.83251953125, // 1705/2048\n },\n 'pingfang sc': {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06, // 1060/1000\n padding: {\n f: 0.5,\n },\n },\n simsun: {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06,\n padding: {\n f: 0.5,\n },\n },\n },\n support(fontFamily) {\n return this.info.hasOwnProperty(fontFamily);\n },\n register(name, info) {\n let { emSquare = 2048, ascent = 1854, descent = 434, lineGap = 67, padding = {} } = info || {};\n this.info[name.toLowerCase()] = {\n lhr: (ascent + descent + lineGap) / emSquare,\n blr: ascent / emSquare,\n padding,\n };\n },\n addPadding(name, padding) {\n Object.assign(this.info[name.toLowerCase()].padding, padding);\n },\n};\n\no.info['宋体'] = o.info.simsun;\n\nexport default o;\n","export default {\n position: /(([-+]?[\\d.]+[pxremvwh%]*)|(left|top|right|bottom|center)){1,2}/ig,\n // tfo: /((-?[\\d.]+(px|%)?)|(left|top|right|bottom|center)){1,2}/ig,\n gradient: /\\b(\\w+)-?gradient\\((.+)\\)/i,\n img: /(?:\\burl\\((['\"]?)(.*?)\\1\\))|(?:\\b((data:)))/i,\n};\n","// 生成4*4单位矩阵\nfunction identity() {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n}\n\n// 矩阵a*b,固定两个matrix都是长度16\nfunction multiply(a, b) {\n if(isE(a)) {\n return b;\n }\n if(isE(b)) {\n return a;\n }\n let c = [];\n for(let i = 0; i < 4; i++) {\n let a0 = a[i] || 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') {\n s += `${k}(${v}%)`;\n }\n });\n return s;\n}\n\nexport default {\n canvasPolygon,\n svgPolygon,\n canvasLine,\n svgLine,\n canvasFilter,\n svgFilter: canvasFilter,\n};\n","import geom from '../math/geom';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\nimport unit from './unit';\n\nconst { H } = geom;\nconst { PX, PERCENT, REM, VW, VH } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\nconst {\n STYLE_KEY: {\n BORDER_LEFT_WIDTH,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n PADDING_LEFT,\n PADDING_BOTTOM,\n PADDING_TOP,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n FONT_SIZE,\n },\n} = enums;\n\n/* 获取合适的虚线实体空白宽度ps/pd和数量n\n * 总长total,start边长bs,end边长be,内容长w,\n * 实体长范围[smin,smax],空白长范围[dmin,dmax]\n */\nfunction calFitDashed(total, bs, be, w, smin, smax, dmin, dmax) {\n let n = 1;\n let ps = 1;\n let pd = 1;\n // 从最大实体空白长开始尝试\n outer:\n for(let i = smax; i >= smin; i--) {\n for(let j = dmax; j >= dmin; j--) {\n // 已知实体空白长度,n实体和n-1空白组成total,计算获取n数量\n let per = i + j;\n let num = Math.floor((total + j) / per);\n let k = j;\n // 可能除不尽,此时扩展空白长\n if(num * per < j + total) {\n let free = total - num * i;\n k = free / (num - 1);\n if(k > dmax) {\n continue;\n }\n }\n per = i + k;\n // bs比实体大才有效,因为小的话必定和第一个实体完整相连\n if(bs > 1 && bs > i) {\n let mo = bs % per;\n if(mo > i) {\n continue;\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n if(num > 0) {\n n = num;\n ps = i;\n pd = k;\n }\n break outer;\n }\n }\n return {\n n,\n ps,\n pd,\n };\n}\n\n// dashed时n个实线和n-1虚线默认以3:1宽度组成,dotted则是n和n以1:1组成\nfunction calDashed(style, m1, m2, m3, m4, bw) {\n let total = m4 - m1;\n let w = m3 - m2;\n let bs = m2 - m1;\n let be = m4 - m3;\n if(style === 'dotted') {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n else {\n let { n, ps, pd } = calFitDashed(total, bs, be, w, bw, bw * 3, Math.max(1, bw * 0.25), bw * 2);\n if(n === 1) {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n // 降级为dotted\n return { n, ps, pd };\n }\n}\n\n// 获取边框分割为几块的坐标,虚线分割为若干四边形、三边型、五边形\n// 三边形重复内外边交点形成四边形,五边形进行切割形成2个四边形\n// direction为上右下左0123\nfunction calPoints(borderWidth, borderStyle, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, direction, beginRadius, endRadius) {\n let points = [];\n if(['dashed', 'dotted'].indexOf(borderStyle) > -1) {\n // 寻找一个合适的虚线线段长度和之间空白边距长度\n let { n, ps, pd } = (direction === 0 || direction === 2)\n ? calDashed(borderStyle, x1, x2, x3, x4, borderWidth)\n : calDashed(borderStyle, y1, y2, y3, y4, borderWidth);\n if(n > 1) {\n for(let i = 0; i < n; i++) {\n // 最后一个可能没有到底,延长之\n let isLast = i === n - 1;\n let main1;\n let main2;\n let cross1;\n let cross2;\n if(direction === 0 || direction === 2) {\n main1 = i ? (x1 + ps * i + pd * i) : x1;\n }\n else {\n main1 = i ? (y1 + ps * i + pd * i) : y1;\n }\n main2 = main1 + ps;\n if(direction === 0) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x4, y1],\n [x3, y2],\n [x2, y2]\n ]);\n }\n else {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n cross2 = y1 + (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y1 + (x4 - main1) * Math.tan(deg2);\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x4, y1],\n [main1, cross1]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross1]\n ]);\n if(isLast) {\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x2, y2]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross2],\n [x3, y2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y1],\n [main2, y1],\n [main2, y2],\n [x2, y2]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y1 + (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross2]\n ]);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y1],\n [x3, y1],\n [x3, y2],\n [main1, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x3, y2],\n [main1, y2]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, y2],\n [main1, y2]\n ]);\n }\n }\n }\n }\n else if(direction === 1) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n cross1 = x4 - (main1 - y1) * Math.tan(deg1);\n cross2 = x4 - (main2 - y1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2],\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x3 + (main1 - y3) * Math.tan(deg2);\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x3 + (main2 - y3) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross2, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, x4],\n [x4, x4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n }\n else if(direction === 2) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x3, y3],\n [x4, y4]\n ]);\n }\n else {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n cross2 = y4 - (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y4 - (x4 - main1) * Math.tan(deg2);\n cross2 = y4 - (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, cross1],\n [x4, y4],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y4 - (main2 - x3) * Math.tan(deg2);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [main2, cross2],\n [main2, y4],\n [x3, y4]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y3],\n [main2, y3],\n [main2, y4],\n [x2, y4]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y4 - (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y4 - (main1 - x3) * Math.tan(deg1);\n points.push([\n [main1, cross2],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y3],\n [x3, y3],\n [x3, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y3],\n [x3, y3],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, y3],\n [main2, y3],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n }\n }\n else if(direction === 3) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x2, y2],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n cross2 = x1 + (main2 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x1 + (y4 - main1) * Math.tan(deg2);\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [x1, main1],\n [cross1, main1],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [x2, y2],\n [x1, y2]\n ]);\n if(isLast) {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4],\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x1 + (y4 - main2) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross2, main1],\n [x2, y2],\n [x1, y1]\n ]);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n }\n }\n if(direction === 0) {\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n }\n }\n // 兜底返回实线\n if(direction === 0) {\n if(x2 > x1) {\n points.push([\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1, y1]\n ]);\n }\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n if(y2 > y1) {\n points.push([\n [x4, y1],\n [x4, y1],\n [x4, y2],\n [x3, y2]\n ]);\n }\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n if(x2 > x1) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x2, y4],\n [x1, y4]\n ]);\n }\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n if(y2 > y1) {\n points.push([\n [x1, y1],\n [x1, y1],\n [x2, y2],\n [x1, y2]\n ]);\n }\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n}\n\nfunction calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[1][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[0][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[1][0] > oxr && points[0][0] < oxl) {\n let ya = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, ya],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y1],\n [oxr, y1],\n [oxr, y2],\n [oxl, y2],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y1],\n [x3, y1],\n [x3, y2],\n [oxl, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [oxr, y1],\n [oxr, y2],\n [x2, y2],\n ]);\n }\n else {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n }\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, yb]\n ]);\n }\n // 跨越右圆角\n else if(points[1][0] > oxr) {\n let y = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n centerList.push([\n points[0],\n [oxr, y1],\n [oxr, y],\n points[3]\n ]);\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, y]\n ]);\n }\n // 跨越左圆角\n else if(points[0][0] < oxl) {\n let y = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, y],\n points[3]\n ]);\n centerList.push([\n [oxl, y1],\n points[1],\n points[2],\n [oxl, y],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y1 + bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierTopLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopLeft(points[0], points[1], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopLeft(points[3], points[2], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 0);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 0);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y1 + ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierTopRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopRight(points[0], points[1], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopRight(points[3], points[2], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 1);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 1);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierTopLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(p1x, p1y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(p2x, p2y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierTopRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (oy - p1y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy - Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy - Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (oy - p2y));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy - Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[2][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[1][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[2][1] > oyb && points[1][1] < oyt) {\n let xa = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n let xb = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [xa, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x3, oyt],\n [x4, oyt],\n [x4, oyb],\n [x3, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, oyb],\n [x3, oyb],\n ]);\n }\n else {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n }\n endList.push([\n [xb, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[2][1] > oyb) {\n let x = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n centerList.push([\n points[0],\n points[1],\n [x4, oyb],\n [x, oyb]\n ]);\n endList.push([\n [x, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [x, oyt]\n ]);\n centerList.push([\n [x, oyt],\n [x4, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x4 - brx;\n let rx2 = brx - (x4 - x3);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightTop(beginList[0][1], beginList[0][2], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierRightTop(beginList[0][0], beginList[0][3], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightTop(points[1], points[2], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightTop(points[0], points[3], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 2);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 2);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x4 - erx;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierRightBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightBottom(points[1], points[2], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightBottom(points[0], points[3], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 3);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 3);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierRightTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox + Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox + Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox + Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierRightBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[2][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[3][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[2][0] > oxr && points[3][0] < oxl) {\n let ya = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n beginList.push([\n points[0],\n [oxl, ya],\n [oxl, y4],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y3],\n [oxr, y3],\n [oxr, y4],\n [oxl, y4],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y3],\n [x3, y3],\n [x3, y4],\n [oxl, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [oxr, y3],\n [oxr, y4],\n [x2, y4],\n ]);\n }\n else {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n }\n endList.push([\n [oxr, yb],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越右圆角\n else if(points[2][0] > oxr) {\n let y = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n centerList.push([\n points[0],\n [oxr, y],\n [oxr, y4],\n points[3]\n ]);\n endList.push([\n [oxr, y],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越左圆角\n else if(points[3][0] < oxl) {\n let y = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y3;\n beginList.push([\n points[0],\n [oxl, y],\n [oxl, y4],\n points[3]\n ]);\n centerList.push([\n [oxl, y],\n points[1],\n points[2],\n [oxl, y4],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y4 - bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierBottomLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomLeft(points[3], points[2], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomLeft(points[0], points[1], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 4);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 4);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y4 - ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierBottomRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomRight(points[3], points[2], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomRight(points[0], points[1], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 5);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 5);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierBottomLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (p2y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy + Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy + Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (p1y - oy));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy + Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierBottomRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[3][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[0][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[3][1] > oyb && points[0][1] < oyt) {\n let xa = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n let xb = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n beginList.push([\n points[0],\n points[1],\n [xa, oyt],\n [x1, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, oyb],\n [x1, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, oyb],\n [x1, oyb],\n ]);\n }\n else {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n }\n endList.push([\n [x1, oyb],\n [xb, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[3][1] > oyb) {\n let x = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n centerList.push([\n points[0],\n points[1],\n [x, oyb],\n [x1, oyb]\n ]);\n endList.push([\n [x1, oyb],\n [x, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n beginList.push([\n points[0],\n points[1],\n [x, oyt],\n [x1, oyt]\n ]);\n centerList.push([\n [x1, oyt],\n [x, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x1 + brx;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftTop(beginList[0][0], beginList[0][3], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierLeftTop(beginList[0][1], beginList[0][2], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftTop(points[0], points[3], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftTop(points[1], points[2], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 6);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 6);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x1 + erx;\n let rx2 = erx - (x2 - x1);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierLeftBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftBottom(points[0], points[3], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftBottom(points[1], points[2], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 7);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 7);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierLeftTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierLeftBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox - Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox - Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox - Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\n/**\n * 简单计算椭圆的圆化坐标控制点,视作重合位置,外面判断backgroundClip并调整坐标\n * @param x 起始x\n * @param y 起始y\n * @param w 宽\n * @param h 高\n * @param btlr borderTopLeftRadius\n * @param btrr borderTopRightRadius\n * @param bbrr borderBottomRightRadius\n * @param bblr borderBottomLeftRadius\n * @returns {[]} 多边形的顶点和曲线控制点\n */\nfunction calRadius(x, y, w, h, btlr, btrr, bbrr, bblr) {\n let need;\n let [btlx, btly] = btlr;\n let [btrx, btry] = btrr;\n let [bbrx, bbry] = bbrr;\n let [bblx, bbly] = bblr;\n btlx = Math.max(btlx, 0);\n btly = Math.max(btly, 0);\n btrx = Math.max(btrx, 0);\n btry = Math.max(btry, 0);\n bbrx = Math.max(bbrx, 0);\n bbry = Math.max(bbry, 0);\n bblx = Math.max(bblx, 0);\n bbly = Math.max(bbly, 0);\n // 圆角必须x/y都>0才有效,否则视为不绘制\n if(btlx > 0 && btly > 0 || btrx > 0 && btry > 0 || bbrx > 0 && bbry > 0 || bblx > 0 && bbly > 0) {\n need = true;\n }\n if(need) {\n let list = [];\n if(btlx > 0 && btly > 0) {\n list.push([x, y + btly]);\n list.push([x, y + (btly) * (1 - H), x + btlx * (1 - H), y, x + btlx, y]);\n }\n else {\n list.push([x, y]);\n }\n if(btrx > 0 && btry > 0) {\n list.push([x + w - btrx, y]);\n list.push([x + w - btrx * (1 - H), y, x + w, y + btry * (1 - H), x + w, y + btry]);\n }\n else {\n list.push([x + w, y]);\n }\n if(bbrx > 0 && bbry > 0) {\n list.push([x + w, y + h - bbry]);\n list.push([x + w, y + h - bbry * (1 - H), x + w - bbrx * (1 - H), y + h, x + w - bbrx, y + h]);\n }\n else {\n list.push([x + w, y + h]);\n }\n if(bblx > 0 && bbly > 0) {\n list.push([x + bblx, y + h]);\n list.push([x + bblx * (1 - H), y + h, x, y + h - bbly * (1 - H), x, y + h - bbly]);\n }\n else {\n list.push([x, y + h]);\n }\n return list;\n }\n}\n\nfunction limit(points, x, y, direction) {\n if(direction === 0) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 1) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 2) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 3) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 4) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 5) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 6) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 7) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n}\n\nconst BR_KS = [BORDER_TOP_LEFT_RADIUS, BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS];\nfunction calBorderRadius(w, h, currentStyle, computedStyle, root) {\n let noRadius = true;\n BR_KS.forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n if(item[0] > 0) {\n noRadius = false;\n }\n else {\n return 0;\n }\n if(item[1] === PX) {\n return Math.max(0, item[0]);\n }\n else if(item[1] === PERCENT) {\n return Math.max(0, item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n return Math.max(0, item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n return Math.max(0, item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n return Math.max(0, item[0] * root.height * 0.01);\n }\n return 0;\n });\n });\n // 优化提前跳出\n if(noRadius) {\n return;\n }\n // radius限制,相交的2个之和不能超过边长,如果2个都超过中点取中点,只有1个超过取交点,这包含了单个不能超过总长的逻辑\n BR_KS.forEach((k, i) => {\n let j = i % 2 === 0 ? 0 : 1;\n let target = j ? h : w;\n let prev = computedStyle[k];\n let next = computedStyle[BR_KS[(i + 1) % 4]];\n // 相加超过边长则是相交\n if(prev[j] + next[j] > target) {\n let half = target * 0.5;\n // 都超过一半中点取中点\n if(prev[j] >= half && next[j] >= half) {\n prev[j] = next[j] = half;\n }\n // 仅1个超过中点,因相交用总长减去另一方即可\n else if(prev[j] > half) {\n prev[j] = target - next[j];\n }\n else if(next[j] > half) {\n next[j] = target - prev[j];\n }\n }\n });\n}\n\nfunction calBorderRadiusInline(contentBoxList, currentStyle, computedStyle) {\n let first, last;\n if(contentBoxList.length) {\n first = contentBoxList[0];\n last = contentBoxList[contentBoxList.length - 1]\n }\n // 先看first的左侧\n let w = first ? first.outerWidth : 0, h = first ? first.outerHeight : 0;\n w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT];\n h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH]\n + computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM];\n [BORDER_TOP_LEFT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS].forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n let v;\n if(item[1] === PX) {\n v = Math.max(0, item[0]);\n v = Math.min(i ? h : w, v);\n }\n else {\n v = Math.max(0, item[0] * (i ? h : w) * 0.01);\n v = Math.min(i ? h : w, v);\n }\n return v;\n });\n });\n // 再看end的右侧\n w = last ? last.outerWidth : 0;\n h = last ? last.outerHeight : 0;\n [BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS].forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n let v;\n if(item[1] === PX) {\n v = Math.max(0, item[0]);\n v = Math.min(i ? h : w, v);\n }\n else {\n v = Math.max(0, item[0] * (i ? h : w) * 0.01);\n v = Math.min(i ? h : w, v);\n }\n return v;\n });\n });\n}\n\nfunction renderBorder(xom, renderMode, ctx, points, color, dx, dy) {\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n points.forEach(point => {\n canvasPolygon(ctx, point, dx, dy);\n });\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let s = '';\n points.forEach(point => {\n s += svgPolygon(point);\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', s],\n ['fill', color],\n ],\n });\n }\n}\n\nexport default {\n calPoints,\n calRadius,\n calBorderRadius,\n calBorderRadiusInline,\n renderBorder,\n};\n","// 类型为引用防止json仿造\nconst TYPE_VD = { _: 1 };\nconst TYPE_GM = { _: 2 };\nconst TYPE_CP = { _: 3 };\n\nexport default {\n TYPE_VD,\n TYPE_GM,\n TYPE_CP,\n};\n","import $$type from './$$type';\nimport mx from '../math/matrix';\n\nlet toString = {}.toString;\nfunction isType(type) {\n return function(obj) {\n return toString.call(obj) === '[object ' + type + ']';\n }\n}\n\nlet isObject = isType('Object');\nlet isString = isType('String');\nlet isFunction = isType('Function');\nlet isNumber = isType('Number');\nlet isBoolean = isType('Boolean');\nlet isDate = isType('Date');\n\nlet hasOwn = {}.hasOwnProperty;\nlet fnToString = hasOwn.toString;\nlet ObjectFunctionString = fnToString.call(Object);\n\nfunction isNil(v) {\n return v === undefined || v === null;\n}\n\nfunction joinSourceArray(arr) {\n let res = '';\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n res += joinSourceArray(item);\n }\n else {\n res += stringify(item);\n }\n }\n return res;\n}\n\nfunction stringify(s) {\n if(isNil(s)) {\n return '';\n }\n return s.toString();\n}\n\nfunction encodeHtml(s, prop) {\n if(prop) {\n return s.replace(/\"/g, '"');\n }\n return s.replace(/&/g, '&').replace(/ {\n s += joinDef(item);\n });\n s += '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n return s;\n}\n\n// 普通元素\nfunction joinVd(vd) {\n if(vd.type === 'item' || vd.type === 'img') {\n let s = '';\n (vd.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n if(vd.tagName === 'text') {\n return '' + vd.content + '';\n }\n return '<' + vd.tagName + s + '/>';\n }\n else if(vd.type === 'text') {\n let s = ``;\n // text有许多lineBox\n (vd.children || []).forEach(item => {\n s += joinVd(item);\n });\n return '' + s + '';\n }\n else if(vd.type === 'dom' || vd.type === 'geom') {\n let s = '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n let { opacity, transform, visibility, mask, overflow, filter, mixBlendMode } = vd;\n return '' + s + '';\n }\n}\n\nfunction joinDef(def) {\n let s = '<' + def.tagName + ' id=\"' + def.uuid + '\"';\n if(def.tagName === 'mask' || def.tagName === 'clipPath') {\n // s += ' maskUnits=\"userSpaceOnUse\"';\n }\n else if(def.tagName === 'filter') {\n // s += ' filterUnits=\"userSpaceOnUse\"';\n }\n else {\n s += ' gradientUnits=\"userSpaceOnUse\"';\n }\n (def.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n (def.children || []).forEach(item => {\n s += joinItem(item);\n });\n s += '';\n return s;\n}\n\nfunction joinItem(item) {\n let s = '<' + item.tagName;\n (item.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n return s;\n}\n\nfunction rgba2int(color) {\n if(Array.isArray(color)) {\n return color;\n }\n let res = [];\n if(!color || color === 'transparent') {\n res = [0, 0, 0, 0];\n }\n else if(color.charAt(0) === '#') {\n color = color.slice(1);\n if(color.length === 3) {\n res.push(parseInt(color.charAt(0) + color.charAt(0), 16));\n res.push(parseInt(color.charAt(1) + color.charAt(1), 16));\n res.push(parseInt(color.charAt(2) + color.charAt(2), 16));\n res[3] = 1;\n }\n else if(color.length === 6) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4), 16));\n res[3] = 1;\n }\n else if(color.length === 8) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4, 6), 16));\n res.push(parseInt(color.slice(6), 16) / 255);\n }\n else {\n res[0] = res[1] = res[2] = 0;\n res[3] = 1;\n }\n }\n else {\n let c = color.match(/rgba?\\s*\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*,\\s*([\\d.]+)(?:\\s*,\\s*([\\d.]+))?\\s*\\)/i);\n if(c) {\n res = [parseInt(c[1]), parseInt(c[2]), parseInt(c[3])];\n if(!isNil(c[4])) {\n res[3] = parseFloat(c[4]);\n }\n else {\n res[3] = 1;\n }\n }\n else {\n res = [0, 0, 0, 0];\n }\n }\n return res;\n}\n\nfunction int2rgba(color) {\n if(Array.isArray(color)) {\n if(color.length === 4) {\n color = color.map((c, i) => i === 3 ? c : Math.floor(Math.max(0, c)));\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n color = color.map(c => Math.floor(c));\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return color || 'rgba(0,0,0,0)';\n}\n\nfunction int2invert(color) {\n if(Array.isArray(color)) {\n color = color.slice(0);\n color[0] = 255 - color[0];\n color[1] = 255 - color[1];\n color[2] = 255 - color[2];\n if(color.length === 4) {\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return 'rgba(0,0,0,0)';\n}\n\nfunction arr2hash(arr) {\n let hash = {};\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n hash[item[0]] = item[1];\n }\n else {\n for(let list = Object.keys(item), j = list.length - 1; j >= 0; j--) {\n let k = list[j];\n hash[k] = item[k];\n }\n }\n }\n return hash;\n}\n\nfunction hash2arr(hash) {\n if(Array.isArray(hash)) {\n return hash;\n }\n let arr = [];\n for(let list = Object.keys(hash), i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n arr.push([k, hash[k]]);\n }\n return arr;\n}\n\nfunction clone(obj) {\n if(isNil(obj) || typeof obj !== 'object') {\n return obj;\n }\n // parse递归会出现内部先返回解析好的json,外部parse不能clone\n if(obj.$$type === $$type.TYPE_VD\n || obj.$$type === $$type.TYPE_GM\n || obj.$$type === $$type.TYPE_CP) {\n return obj;\n }\n if(util.isDate(obj)) {\n return new Date(obj);\n }\n if(!isPlainObject(obj) && !Array.isArray(obj)) {\n return obj;\n }\n let n = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(i => {\n n[i] = clone(obj[i]);\n });\n return n;\n}\n\n/**\n * 简化的arr对比,arr中只有arr和其它类型,其它类型对比值或引用,arr递归\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equalArr(a, b) {\n if(!a || !b) {\n return a === b;\n }\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let ai = a[i];\n let bi = b[i];\n let isArrayA = Array.isArray(ai);\n let isArrayB = Array.isArray(bi);\n if(isArrayA && isArrayB) {\n if(!equalArr(ai, bi)) {\n return false;\n }\n }\n else if(isArrayA || isArrayB) {\n return false;\n }\n else if(ai !== bi) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 深度对比对象\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equal(a, b) {\n if(a === b) {\n return true;\n }\n if(isObject(a) && isObject(b)) {\n let hash = {};\n for(let i = 0, arr = Object.keys(a), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!b.hasOwnProperty(k) || !equal(a[k], b[k])) {\n return false;\n }\n hash[k] = true;\n }\n // a没有b有则false\n for(let i = 0, arr = Object.keys(b), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!hash.hasOwnProperty(k)) {\n return false;\n }\n }\n }\n else if(isDate(a) && isDate(b)) {\n return a.getTime() === b.getTime();\n }\n else if(Array.isArray(a) && Array.isArray(b)) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equal(a[i], b[i])) {\n return false;\n }\n }\n }\n else {\n return a === b;\n }\n return true;\n}\n\nfunction extend(target, source, keys) {\n if(source === null || typeof source !== 'object') {\n return target;\n }\n if(!keys) {\n keys = Object.keys(source);\n }\n let i = 0;\n let len = keys.length;\n while(i < len) {\n let k = keys[i];\n target[k] = source[k];\n i++;\n }\n return target;\n}\n\nfunction joinArr(arr, split) {\n let s = arr.length ? arr[0] : '';\n for(let i = 1, len = arr.length; i < len; i++) {\n s += split + arr[i];\n }\n return s;\n}\n\nfunction extendAnimate(ovd, nvd) {\n let list = nvd.__animationList = ovd.animationList.splice(0);\n list.forEach(item => {\n item.__setTarget(nvd);\n // 事件队列的缘故,可能动画本帧刚执行过,然后再继承,就会缺失,需再次赋值一遍;也有可能停留最后\n if(item.assigning || item.finished && item.__stayEnd()) {\n item.assignCurrentStyle();\n }\n });\n // 帧动画继承\n nvd.__frameAnimateList = ovd.__frameAnimateList.splice(0);\n}\n\nfunction transformBbox(bbox, matrix, dx = 0, dy = 0) {\n if(matrix && !mx.isE(matrix)) {\n let [x1, y1, x2, y2] = bbox;\n // 可能因filter的原因扩展范围\n if(dx) {\n x1 -= dx;\n x2 += dx;\n }\n if(dy) {\n y1 -= dy;\n y2 += dy;\n }\n let list = [x2, y1, x1, y2, x2, y2];\n let w;\n [x1, y1, , w] = mx.calPoint([x1, y1], matrix);\n if(w && w !== 1) {\n x1 /= w;\n y1 /= w;\n }\n let xa = x1, ya = y1, xb = x1, yb = y1;\n for(let i = 0; i < 6; i += 2) {\n let x = list[i], y = list[i + 1];\n [x, y, , w] = mx.calPoint([x, y], matrix);\n if(w && w !== 1) {\n x /= w;\n y /= w;\n }\n xa = Math.min(xa, x);\n xb = Math.max(xb, x);\n ya = Math.min(ya, y);\n yb = Math.max(yb, y);\n }\n bbox = [xa, ya, xb, yb];\n }\n else if(dx || dy) {\n bbox = bbox.slice(0);\n bbox[0] -= dx;\n bbox[1] -= dy;\n bbox[2] += dx;\n bbox[3] += dy;\n }\n return bbox;\n}\n\nfunction isPlainObject(obj) {\n if(!obj || toString.call(obj) !== '[object Object]') {\n return false;\n }\n let proto = Object.getPrototypeOf(obj);\n if(!proto) {\n return true;\n }\n let Ctor = hasOwn.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor === 'function' && fnToString.call(Ctor) === ObjectFunctionString;\n}\n\nfunction assignMatrix(t, v) {\n t[0] = v[0];\n t[1] = v[1];\n t[2] = v[2];\n t[3] = v[3];\n t[4] = v[4];\n t[5] = v[5];\n t[6] = v[6];\n t[7] = v[7];\n t[8] = v[8];\n t[9] = v[9];\n t[10] = v[10];\n t[11] = v[11];\n t[12] = v[12];\n t[13] = v[13];\n t[14] = v[14];\n t[15] = v[15];\n return t;\n}\n\nlet util = {\n isObject,\n isString,\n isFunction,\n isNumber,\n isBoolean,\n isDate,\n isNil,\n isPrimitive(v) {\n return util.isNil(v) || util.isBoolean(v) || util.isString(v) || util.isNumber(v);\n },\n // css中常用undefined/null表示auto本身\n isAuto(v) {\n return isNil(v) || v === 'auto';\n },\n isPlainObject,\n stringify,\n joinSourceArray(arr) {\n return joinSourceArray(arr);\n },\n encodeHtml,\n joinVirtualDom,\n joinVd,\n joinDef,\n rgba2int,\n int2rgba,\n int2invert,\n arr2hash,\n hash2arr,\n clone,\n equalArr,\n equal,\n extend,\n joinArr,\n extendAnimate,\n transformBbox,\n assignMatrix,\n};\n\nexport default util;\n","export default {\n flag: false,\n};\n","export default {\n list: [], // 每次渲染前的更新后,等待测量的文字对象列表\n data: {}, // Text中存入的特殊等待测量的信息,字体+字号+粗细为key\n charWidth: {}, // key的文字宽度hash\n padding: {}, // key的文字宽度偏移,少量字体的少量文字有\n ELLIPSIS: '…',\n};\n","export default {\n alpha: true,\n antialias: true,\n premultipliedAlpha: true,\n preserveDrawingBuffer: true,\n // depth: true,\n // stencil: true,\n};\n","import mx from '../math/matrix';\n\nconst calPoint = mx.calPoint;\n\n/**\n * 初始化 shader\n * @param gl GL context\n * @param vshader vertex shader (string)\n * @param fshader fragment shader (string)\n * @return program, if the program object was created and successfully made current\n */\nfunction initShaders(gl, vshader, fshader) {\n let program = createProgram(gl, vshader, fshader);\n if(!program) {\n throw new Error('Failed to create program');\n }\n\n // 要开启透明度,用以绘制透明的图形\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n return program;\n}\n\n/**\n * Create the linked program object\n * @param gl GL context\n * @param vshader a vertex shader program (string)\n * @param fshader a fragment shader program (string)\n * @return created program object, or null if the creation has failed\n */\nfunction createProgram(gl, vshader, fshader) {\n // Create shader object\n let vertexShader = loadShader(gl, gl.VERTEX_SHADER, vshader);\n let fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fshader);\n if(!vertexShader || !fragmentShader) {\n return null;\n }\n\n // Create a program object\n let program = gl.createProgram();\n if(!program) {\n return null;\n }\n program.vertexShader = vertexShader;\n program.fragmentShader = fragmentShader;\n\n // Attach the shader objects\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n // Link the program object\n gl.linkProgram(program);\n\n // Check the result of linking\n let linked = gl.getProgramParameter(program, gl.LINK_STATUS);\n if(!linked) {\n let error = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n gl.deleteShader(fragmentShader);\n gl.deleteShader(vertexShader);\n throw new Error('Failed to link program: ' + error);\n }\n return program;\n}\n\n/**\n * Create a shader object\n * @param gl GL context\n * @param type the type of the shader object to be created\n * @param source shader program (string)\n * @return created shader object, or null if the creation has failed.\n */\nexport function loadShader(gl, type, source) {\n // Create shader object\n let shader = gl.createShader(type);\n if(shader == null) {\n throw new Error('unable to create shader');\n }\n\n // Set the shader program\n gl.shaderSource(shader, source);\n\n // Compile the shader\n gl.compileShader(shader);\n\n // Check the result of compilation\n let compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if(!compiled) {\n let error = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error('Failed to compile shader: ' + error);\n }\n\n return shader;\n}\n\nfunction convertCoords2Gl([x, y, z, w], cx, cy, revertY) {\n if(z === undefined) {\n z = 0;\n }\n if(w === undefined) {\n w = 1;\n }\n if(w && w !== 1) {\n x /= w;\n y /= w;\n z /= w;\n }\n if(x === cx) {\n x = 0;\n }\n else {\n x = (x - cx) / cx;\n }\n if(y === cy) {\n y = 0;\n }\n else {\n y = (y - cy) / cy;\n if(revertY) {\n y = -y;\n }\n }\n return [x * w, y * w, z * w, w];\n}\n\nfunction createTexture(gl, tex, n, width, height) {\n let texture = gl.createTexture();\n bindTexture(gl, texture, n);\n // gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, -1);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n // 传入高宽时是绑定fbo,且tex一定为null\n if(width && height) {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n // 普通将canvas对象作为纹理\n else {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n return texture;\n}\n\nfunction bindTexture(gl, texture, n) {\n gl.activeTexture(gl['TEXTURE' + n]);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n}\n\n/**\n * texCache集满纹理上传占用最多可用纹理单元后,进行批量顺序绘制\n * 将所有dom的矩形顶点(经过transform变换后的)、贴图坐标、透明度存入3个buffer中,\n * 然后相同纹理单元的形成一批,设置uniform的纹理单元号进行绘制,如此循环\n * @param gl\n * @param list\n * @param hash\n * @param cx\n * @param cy\n * @param revertY\n */\nfunction drawTextureCache(gl, list, hash, cx, cy, revertY) {\n let vtPoint = [], vtTex = [], vtOpacity = [];\n let lastChannel; // 上一个dom的单元号\n let record = [0]; // [num, channel]每一批的数量和单元号记录\n let stack = [record]; // 所有批的数据记录集合\n list.forEach((item, i) => {\n let [cache, opacity, matrix, dx, dy] = item;\n if(i) {\n let channel = hash[cache.page.uuid];\n // 和上一个单元号不同时,生成新的批次记录\n if(lastChannel !== channel) {\n lastChannel = channel;\n record = [0, lastChannel];\n stack.push(record);\n }\n }\n else {\n lastChannel = hash[cache.page.uuid];\n record[1] = lastChannel;\n }\n let { x, y, width, height, page, bbox } = cache;\n // 计算顶点坐标和纹理坐标,转换[0,1]对应关系\n let bx = bbox[0], by = bbox[1];\n let [xa, ya] = [bx + (dx || 0), by + height + (dy || 0)];\n let [xb, yb] = [bx + width + (dx || 0), by + (dy || 0)];\n let [x1, y1, , w1] = calPoint([xa, ya], matrix);\n let [x2, y2, , w2] = calPoint([xb, ya], matrix);\n let [x3, y3, , w3] = calPoint([xb, yb], matrix);\n let [x4, y4, , w4] = calPoint([xa, yb], matrix);\n [x1, y1] = convertCoords2Gl([x1, y1, 0, w1], cx, cy, revertY);\n [x2, y2] = convertCoords2Gl([x2, y2, 0, w2], cx, cy, revertY);\n [x3, y3] = convertCoords2Gl([x3, y3, 0, w3], cx, cy, revertY);\n [x4, y4] = convertCoords2Gl([x4, y4, 0, w4], cx, cy, revertY);\n vtPoint.push(x1, y1, 0, w1, x4, y4, 0, w4, x2, y2, 0, w2, x4, y4, 0, w4, x2, y2, 0, w2, x3, y3, 0, w3);\n let tx1 = x / page.width, ty1 = (y + height) / page.height;\n let tx2 = (x + width) / page.width, ty2 = y / page.height;\n vtTex.push(tx1, ty1, tx1, ty2, tx2, ty1, tx1, ty2, tx2, ty1, tx2, ty2);\n vtOpacity.push(opacity, opacity, opacity, opacity, opacity, opacity);\n record[0]++;\n });\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtPoint), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.program, 'a_position');\n gl.vertexAttribPointer(a_position, 4, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtTex), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // opacity buffer\n let opacityBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, opacityBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtOpacity), gl.STATIC_DRAW);\n let a_opacity = gl.getAttribLocation(gl.program, 'a_opacity');\n gl.vertexAttribPointer(a_opacity, 1, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_opacity);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.program, 'u_texture');\n let count = 0;\n // 循环按批次渲染\n stack.forEach(record => {\n let [num, channel] = record;\n gl.uniform1i(u_texture, channel);\n num *= 6;\n gl.drawArrays(gl.TRIANGLES, count, num);\n count += num;\n });\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.deleteBuffer(opacityBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n gl.disableVertexAttribArray(a_opacity);\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核扩大3倍性能慢\n * x/y方向分开执行,加速性能,计算次数由d*d变为d+d,d为卷积核大小\n * spread由d和sigma计算得出,d由sigma计算得出,sigma即css的blur()参数\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * i和j为total和filter的纹理单元,3次执行(x/y合起来算1次)需互换单元,来回执行源和结果\n * 由total变为filter时cache会各方向上扩展spread的大小到width/height\n * 因此第一次绘制时坐标非1,后面则固定1\n * @param gl\n * @param program\n * @param frameBuffer\n * @param texCache\n * @param tex1 初次绘制目标纹理\n * @param tex2 初次绘制源纹理\n * @param i 初次绘制目标纹理单元\n * @param j 初次绘制源纹理单元\n * @param width\n * @param height\n * @param cx\n * @param cy\n * @param spread\n * @param d\n * @param sigma\n */\nfunction drawBlur(gl, program, frameBuffer, texCache, tex1, tex2, i, j, width, height, cx, cy, spread, d, sigma) {\n // 第一次将total绘制到blur上,此时尺寸存在spread差值,因此不加模糊防止坐标计算问题,仅作为扩展纹理尺寸\n let [x1, y2] = convertCoords2Gl([spread, height - spread], cx, cy);\n let [x2, y1] = convertCoords2Gl([width - spread, spread], cx, cy);\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // direction全0,即无模糊,此时只是进行扩展尺寸操作,还没到模糊所以传0\n let u_direction = gl.getUniformLocation(program, 'u_direction');\n gl.uniform2f(u_direction, 0, 0);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // fbo绑定切换纹理对象和单元索引,同时注意不能向源纹理绘制,因为源是cacheTotal,需要重新生成一个,y方向再来一次\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n /**\n * 反复执行共3次,坐标等均不变,只是切换fbo绑定对象和纹理单元\n * 注意max和ratio的设置,当是100尺寸的正方形时,传给direction的始终为1\n * 当正方形<100时,direction相应地要扩大相对于100的倍数,反之则缩小,如此为了取相邻点坐标时是+-1\n * 当非正方形时,长轴一端为基准值不变,短的要二次扩大比例倍数\n */\n let max = 100 / Math.max(width, height);\n let ratio = width / height;\n let recycle = []; // 3次过程中新生成的中间纹理需要回收\n for(let k = 0; k < 3; k++) {\n let tex3 = createTexture(gl, null, j, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex3, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, max, 0);\n }\n else {\n gl.uniform2f(u_direction, max * ratio, 0);\n }\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n recycle.push(tex1);\n let tex4 = createTexture(gl, null, i, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex4, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, 0, max * ratio);\n }\n else {\n gl.uniform2f(u_direction, 0, max);\n }\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n tex1 = tex4;\n recycle.push(tex3);\n }\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n recycle.forEach(item => gl.deleteTexture(item));\n return tex1;\n}\n\nfunction drawCm(gl, program, i, m) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, i);\n // matrix\n let u_m = gl.getUniformLocation(program, 'u_m');\n gl.uniform1fv(u_m, new Float32Array(m));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\n/**\n * 根据total/filter生成overflow\n * @param gl\n * @param i 输入纹理单元\n * @param dx 二者偏移值\n * @param dy\n * @param width 最终大小\n * @param height\n * @param w 输入纹理大小\n * @param h\n */\nfunction drawOverflow(gl, i, dx, dy, width, height, w, h) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.programOverflow, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer,原本大小width/height,使用其中的w/h\n let x1 = dx / w, y1 = dy / h, x2 = (width + dx) / w, y2 = (height + dy) /h;\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.programOverflow, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.programOverflow, 'u_texture');\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n}\n\nfunction drawMask(gl, i, j, program) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, j);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nfunction drawMbm(gl, program, i, j, W, H) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, i);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nexport default {\n initShaders,\n createTexture,\n bindTexture,\n drawTextureCache,\n drawBlur,\n drawOverflow,\n drawMask,\n drawMbm,\n drawCm,\n};\n","import util from './util';\nimport debug from './debug';\nimport textCache from '../node/textCache';\nimport font from '../style/font';\nimport ca from '../gl/ca';\nimport webgl from '../gl/webgl';\n\nconst SPF = 1000 / 60;\n\nconst CANVAS = {};\nconst WEBGL = {};\nconst CANVAS_LIST = [];\nconst WEBGL_LIST = [];\nconst SUPPORT_OFFSCREEN_CANVAS = typeof OffscreenCanvas === 'function' && util.isFunction(OffscreenCanvas.prototype.getContext);\n\nlet defaultFontFamilyData;\n\nfunction cache(key, width, height, hash, message) {\n let o;\n if(!key) {\n let target = hash === CANVAS ? CANVAS_LIST : WEBGL_LIST;\n if(target.length) {\n o = target.pop();\n }\n else {\n o = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n }\n else if(!hash[key]) {\n o = hash[key] = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n else {\n o = hash[key];\n }\n o.width = width;\n o.height = height;\n if(debug.flag) {\n o.style.width = width + 'px';\n o.style.height = height + 'px';\n o.setAttribute('type', hash === CANVAS ? 'canvas' : 'webgl');\n if(key) {\n o.setAttribute('key', key);\n }\n if(message) {\n o.setAttribute('message', message);\n }\n document.body.appendChild(o);\n }\n let ctx;\n if(hash === CANVAS) {\n ctx = o.getContext('2d');\n }\n else {\n ctx = o.getContext('webgl', ca) || o.getContext('experimental-webgl', ca);\n }\n return {\n canvas: o,\n ctx,\n draw() {\n // 空函数,仅对小程序提供hook特殊处理,flush缓冲\n },\n enabled: true,\n available: true,\n release() {\n if(!key && this.available) {\n if(hash === CANVAS) {\n CANVAS_LIST.push(this.canvas);\n }\n else {\n WEBGL_LIST.push(this.canvas);\n }\n }\n this.available = false;\n },\n };\n}\n\nfunction cacheCanvas(key, width, height, message) {\n return cache(key, width, height, CANVAS, message);\n}\n\nfunction cacheWebgl(key, width, height, message) {\n return cache(key, width, height, WEBGL, message);\n}\n\nconst IMG = {};\nconst INIT = 0;\nconst LOADING = 1;\nconst LOADED = 2;\nconst FONT = {};\nconst COMPONENT = {};\n\nlet inject = {\n measureText() {\n let { list, data } = textCache;\n let html = '';\n let keys = [];\n let lengths = [];\n let chars = [];\n Object.keys(data).forEach(key => {\n let { ff, fs, fw, s } = data[key];\n if(s) {\n keys.push(key);\n lengths.push(s.length);\n let inline = `position:absolute;font-family:${ff};font-size:${fs}px;font-weight:${fw}`;\n for(let i = 0, len = s.length; i < len; i++) {\n let char = s.charAt(i);\n chars.push(char);\n html += `${char.replace(/`;\n }\n data[key].s = '';\n }\n });\n if(!html) {\n return;\n }\n let div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n document.body.appendChild(div);\n div.innerHTML = html;\n let cns = div.childNodes;\n let { charWidth } = textCache;\n let count = 0, index = 0, key;\n for(let i = 0, len = cns.length; i < len; i++) {\n let node = cns[i];\n if(count === 0) {\n key = keys[index];\n }\n if(++count === lengths[index]) {\n index++;\n count = 0;\n }\n let char = chars[i];\n // clientWidth只返回ceil整数,精度必须用getComputedStyle\n let css = window.getComputedStyle(node, null);\n charWidth[key][char] = parseFloat(css.width);\n }\n list.forEach(text => text.__measureCb());\n textCache.list = [];\n textCache.data = {};\n if(!debug.flag) {\n document.body.removeChild(div);\n }\n },\n measureTextSync(key, ff, fs, fw, char) {\n let inline = `position:absolute;font-family:${ff};font-size:${fs}px;font-weight:${fw}`;\n let html = `${char}${char}${char}`;\n let div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n document.body.appendChild(div);\n div.innerHTML = html;\n let cns = div.childNodes;\n let w1 = parseFloat(window.getComputedStyle(cns[0], null).width);\n let w2 = parseFloat(window.getComputedStyle(cns[1], null).width);\n return w1 * 2 - w2;\n },\n IMG,\n INIT,\n LOADED,\n LOADING,\n measureImg(url, cb) {\n if(Array.isArray(url)) {\n if(!url.length) {\n return cb();\n }\n let count = 0;\n let len = url.length;\n let list = [];\n url.forEach((item, i) => {\n inject.measureImg(item, function(cache) {\n list[i] = cache;\n if(++count === len) {\n cb(list);\n }\n });\n });\n return;\n }\n else if(!url || !util.isString(url)) {\n inject.error('Measure img invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\n }\n let cache = IMG[url] = IMG[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb && cb(cache);\n }\n else if(cache.state === LOADING) {\n cb && cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cb && cache.task.push(cb);\n let img = new Image();\n img.onload = function() {\n cache.state = LOADED;\n cache.success = true;\n cache.width = img.width;\n cache.height = img.height;\n cache.source = img;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n img.onerror = function(e) {\n cache.state = LOADED;\n cache.success = false;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n if(url.substr(0, 5) !== 'data:') {\n let host = /^(?:\\w+:)?\\/\\/([^/:]+)/.exec(url);\n if(host) {\n if(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, calUnit } = unit;\nconst { d2r } = geom;\nconst { canvasPolygon, svgPolygon } = painter;\nconst {\n STYLE_KEY: {\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\n\nfunction getLinearDeg(v) {\n let deg = 180;\n if(v === 'to top') {\n deg = 0;\n }\n else if(v === 'to top right') {\n deg = 45;\n }\n else if(v === 'to right') {\n deg = 90;\n }\n else if(v === 'to bottom right') {\n deg = 135;\n }\n else if(v === 'to bottom') {\n }\n else if(v === 'to bottom left') {\n deg = 225;\n }\n else if(v === 'to left') {\n deg = 270;\n }\n else if(v === 'to top left') {\n deg = 315;\n }\n // 数字角度,没有的话取默认角度\n else {\n let match = /([-+]?[\\d.]+)deg/.exec(v);\n if(match) {\n deg = parseFloat(match[1]);\n }\n }\n return deg % 360;\n}\n\nfunction getRadialPosition(data) {\n if(/^[-+]?[\\d.]/.test(data)) {\n let v = calUnit(data);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[data] || 50,\n PERCENT,\n ];\n }\n}\n\n// 获取color-stop区间范围,去除无用值\nfunction getColorStop(v, length, root) {\n let list = [];\n let firstColor = v[0][0];\n // 先把已经声明距离的换算成[0,1]以数组形式存入,未声明的原样存入\n for(let i = 0, len = v.length; i < len; i++) {\n let item = v[i];\n // 考虑是否声明了位置\n if(item.length > 1) {\n let p = item[1];\n if(p[1] === PERCENT) {\n list.push([item[0], p[0] * 0.01]);\n }\n else if(p[1] === REM) {\n list.push([item[0], p[0] * root.computedStyle[FONT_SIZE] / length]);\n }\n else if(p[1] === VW) {\n list.push([item[0], p[0] * root.width / length]);\n }\n else if(p[1] === VH) {\n list.push([item[0], p[0] * root.height / length]);\n }\n else {\n list.push([item[0], p[0] / length]);\n }\n }\n else {\n list.push([item[0]]);\n }\n }\n if(list.length === 1) {\n list.push(util.clone(list[0]));\n }\n // 首尾不声明默认为[0, 1]\n if(list[0].length === 1) {\n list[0].push(0);\n }\n if(list.length > 1) {\n let i = list.length - 1;\n if(list[i].length === 1) {\n list[i].push(1);\n }\n }\n // 找到未声明位置的,需区间计算,找到连续的未声明的,前后的区间平分\n let start = list[0][1];\n for(let i = 1, len = list.length; i < len - 1; i++) {\n let item = list[i];\n if(item.length > 1) {\n start = item[1];\n }\n else {\n let j = i + 1;\n let end = list[list.length - 1][1];\n for(; j < len - 1; j++) {\n let item = list[j];\n if(item.length > 1) {\n end = item[1];\n break;\n }\n }\n let num = j - i + 1;\n let per = (end - start) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.push(start + per * (k + 1 - i));\n }\n i = j;\n }\n }\n // 每个不能小于前面的,canvas/svg不能兼容这种情况,需处理\n for(let i = 1, len = list.length; i < len; i++) {\n let item = list[i];\n let prev = list[i - 1];\n if(item[1] < prev[1]) {\n item[1] = prev[1];\n }\n }\n // 0之前的和1之后的要过滤掉\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item[1] > 1) {\n list.splice(i);\n let prev = list[i - 1];\n if(prev && prev[1] < 1) {\n let dr = item[0][0] - prev[0][0];\n let dg = item[0][1] - prev[0][1];\n let db = item[0][2] - prev[0][2];\n let da = item[0][3] - prev[0][3];\n let p = (1 - prev[1]) / (item[1] - prev[1]);\n list.push([\n [\n item[0][0] + dr * p,\n item[0][1] + dg * p,\n item[0][2] + db * p,\n item[0][3] + da * p,\n ],\n 1],\n );\n }\n break;\n }\n }\n for(let i = list.length - 1; i >= 0; i--) {\n let item = list[i];\n if(item[1] < 0) {\n list.splice(0, i + 1);\n let next = list[i];\n if(next && next[1] > 0) {\n let dr = next[0][0] - item[0][0];\n let dg = next[0][1] - item[0][1];\n let db = next[0][2] - item[0][2];\n let da = next[0][3] - item[0][3];\n let p = (-item[1]) / (next[1] - item[1]);\n list.unshift([\n [\n item[0][0] + dr * p,\n item[0][1] + dg * p,\n item[0][2] + db * p,\n item[0][3] + da * p,\n ],\n 0],\n );\n }\n break;\n }\n }\n // 可能存在超限情况,如在使用px单位超过len或 {\n // item[0] = int2rgba(item[0]);\n if(item[1] < 0) {\n item[1] = 0;\n }\n else if(item[1] > 1) {\n item[1] = 1;\n }\n });\n // 都超限时,第一个颜色兜底\n if(!list.length) {\n list.push([firstColor, 0]);\n }\n return list;\n}\n\n// 根据角度和圆心获取渐变的4个点坐标\nfunction calLinearCoords(deg, length, cx, cy) {\n let x0;\n let y0;\n let x1;\n let y1;\n if(deg >= 270) {\n let r = d2r(360 - deg);\n x0 = cx + Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n else if(deg >= 180) {\n let r = d2r(deg - 180);\n x0 = cx + Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else if(deg >= 90) {\n let r = d2r(180 - deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else {\n let r = d2r(deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n return [x0, y0, x1, y1];\n}\n\nfunction calCircleCentre(position, x1, y1, iw, ih, root) {\n let cx, cy;\n let positionX = position[0], positionY = position[1];\n if(positionX[1] === PERCENT) {\n cx = x1 + positionX[0] * iw * 0.01;\n }\n else if(positionX[1] === REM) {\n cx = x1 + positionX[0] * root.computedStyle[FONT_SIZE];\n }\n else if(positionX[1] === VW) {\n cx = x1 + positionX[0] * root.width * 0.01;\n }\n else if(positionX[1] === VH) {\n cx = x1 + positionX[0] * root.height * 0.01;\n }\n else {\n cx = x1 + positionX[0];\n }\n if(positionY[1] === PERCENT) {\n cy = y1 + positionY[0] * ih * 0.01;\n }\n else if(positionY[1] === REM) {\n cy = y1 + positionY[0] * root.computedStyle[FONT_SIZE];\n }\n else if(positionY[1] === VW) {\n cy = y1 + positionY[0] * root.width * 0.01;\n }\n else if(positionY[1] === VH) {\n cy = y1 + positionY[0] * root.height * 0.01;\n }\n else {\n cy = y1 + positionY[0];\n }\n return [cx, cy];\n}\n\n// 获取径向渐变圆心半径\nfunction calRadialRadius(shape, size, position, iw, ih, x1, y1, x2, y2, root) {\n let cx, cy, xl, yl, r, 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.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]);\n if(position) {\n let x = getRadialPosition(position[1]);\n let y = position[2] ? getRadialPosition(position[2]) : x;\n o.p = [x, y];\n }\n else {\n o.p = [[50, PERCENT], [50, PERCENT]];\n }\n }\n else if(o.k === 'conic') {\n let deg = /([-+]?[\\d.]+deg)/i.exec(gradient[2]);\n if(deg) {\n o.d = parseFloat(deg[0]) % 360;\n }\n else {\n o.d = 0;\n }\n let position = /at\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]);\n if(position) {\n let x = getRadialPosition(position[1]);\n let y = position[2] ? getRadialPosition(position[2]) : x;\n o.p = [x, y];\n }\n else {\n o.p = [[50, PERCENT], [50, PERCENT]];\n }\n }\n let v = gradient[2].match(/([-+]?[\\d.]+[pxremvwh%]+)?\\s*((#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))\\s*([-+]?[\\d.]+[pxremvwh%]+)?/ig) || [];\n o.v = v.map(item => {\n let color = /((?:#[0-9a-f]{3,8})|(?:rgba?\\s*\\(.+?\\)))/i.exec(item);\n let arr = [rgba2int(color[1])];\n let percent = /[-+]?[\\d.]+[pxremvwh%]+/.exec(item);\n if(percent) {\n let v = calUnit(percent[0]);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n arr[1] = v;\n }\n return arr;\n });\n return o;\n }\n}\n\nfunction getLinear(v, d, ox, oy, cx, cy, w, h, root, 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: '#000',\n borderRightColor: '#000',\n borderBottomColor: '#000',\n borderLeftColor: '#000',\n borderTopStyle: 'solid',\n borderRightStyle: 'solid',\n borderBottomStyle: 'solid',\n borderLeftStyle: 'solid',\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomLeftRadius: 0,\n width: 'auto',\n height: 'auto',\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto',\n flexDirection: 'row',\n flexWrap: 'nowrap',\n order: 0,\n justifyContent: 'flexStart',\n alignItems: 'stretch',\n alignSelf: 'auto',\n alignContent: 'stretch',\n textAlign: 'inherit',\n letterSpacing: 'inherit',\n transformOrigin: 'center',\n visibility: 'inherit',\n opacity: 1,\n zIndex: 0,\n transform: null,\n translateX: 0,\n translateY: 0,\n translateZ: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n skewX: 0,\n skewY: 0,\n rotateX: 0,\n rotateY: 0,\n rotateZ: 0,\n rotate3d: '0, 0, 0, 0',\n perspective: 0,\n perspectiveOrigin: 'center',\n filter: null,\n boxShadow: null,\n pointerEvents: 'inherit',\n overflow: 'visible',\n mixBlendMode: 'normal',\n whiteSpace: 'inherit',\n textOverflow: 'clip',\n lineClamp: 0,\n textStrokeWidth: 'inherit',\n textStrokeColor: 'inherit',\n textStrokeOver: 'inherit',\n};\n\nconst GEOM = {\n fill: 'transparent',\n stroke: '#000',\n strokeWidth: 1,\n strokeDasharray: '',\n strokeLinecap: 'butt',\n strokeLinejoin: 'miter',\n strokeMiterlimit: 4,\n fillRule: 'nonzero',\n};\n\nlet DOM_ENTRY_SET = [];\nlet DOM_KEY_SET = [];\nObject.keys(DOM).forEach(k => {\n DOM_KEY_SET.push(k);\n let v = DOM[k];\n DOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet GEOM_ENTRY_SET = [];\nlet GEOM_KEY_SET = [];\nObject.keys(GEOM).forEach(k => {\n GEOM_KEY_SET.push(k);\n let v = GEOM[k];\n GEOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet INHERIT = {\n fontFamily: 'arial',\n fontSize: 16,\n fontWeight: 400,\n fontStyle: 'normal',\n color: '#000',\n textAlign: 'left',\n visibility: 'visible',\n pointerEvents: 'auto',\n textStrokeColor: '#000',\n textStrokeWidth: 1,\n textStrokeOver: 'none',\n};\n\nlet INHERIT_KEY_SET = [];\nObject.keys(INHERIT).forEach(k => {\n INHERIT_KEY_SET.push(k);\n});\n\nexport default {\n DOM,\n GEOM,\n isValid(i) {\n return DOM.hasOwnProperty(i) || GEOM.hasOwnProperty(i);\n },\n DOM_KEY_SET,\n GEOM_KEY_SET,\n DOM_ENTRY_SET,\n GEOM_ENTRY_SET,\n INHERIT,\n INHERIT_KEY_SET,\n};\n","import reg from './reg';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction parseFlex(style, grow, shrink, basis) {\n if(isNil(style.flexGrow)) {\n style.flexGrow = grow || 0;\n }\n if(isNil(style.flexShrink)) {\n style.flexShrink = shrink || 0;\n }\n if(isNil(style.flexBasis)) {\n style.flexBasis = basis || 0;\n }\n}\n\nfunction parseMarginPadding(style, key, list) {\n let temp = style[key];\n if(!isNil(temp)) {\n let match = temp.toString().match(/([-+]?[\\d.]+[pxremvwh%]*)|(auto)/ig);\n if(match) {\n if(match.length === 1) {\n match[3] = match[2] = match[1] = match[0];\n }\n else if(match.length === 2) {\n match[2] = match[0];\n match[3] = match[1];\n }\n else if(match.length === 3) {\n match[3] = match[1];\n }\n list.forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = match[i];\n }\n });\n }\n }\n}\n\nfunction parseOneBorder(style, k) {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n // 后面会统一格式化处理\n if(isNil(style[k + 'Width'])) {\n let w = /\\b[\\d.]+[pxremvwh%]*\\b/i.exec(v);\n style[k + 'Width'] = w ? w[0] : 0;\n }\n if(isNil(style[k + 'Style'])) {\n let s = /\\b(solid|dashed|dotted)\\b/i.exec(v);\n style[k + 'Style'] = s ? s[1] : 'solid';\n }\n if(isNil(style[k + 'Color'])) {\n let c = /#[0-9a-f]{3,8}/i.exec(v);\n if(c && [4, 7, 9].indexOf(c[0].length) > -1) {\n style[k + 'Color'] = c[0];\n }\n else if(/\\btransparent\\b/i.test(v)) {\n style[k + 'Color'] = 'transparent';\n }\n else {\n c = /rgba?\\s*\\(.+\\)/i.exec(v);\n style[k + 'Color'] = c ? c[0] : 'transparent';\n }\n }\n}\n\nexport default {\n margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'],\n padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n border: ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'],\n borderTop: ['borderTopWidth', 'borderTopStyle', 'borderTopColor'],\n borderRight: ['borderRightWidth', 'borderRightStyle', 'borderRightColor'],\n borderBottom: ['borderBottomWidth', 'borderBottomStyle', 'borderBottomColor'],\n borderLeft: ['borderLeftWidth', 'borderLeftStyle', 'borderLeftColor'],\n borderWidth: ['borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth'],\n borderColor: ['borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor'],\n borderStyle: ['borderTopStyle', 'borderRightStyle', 'borderBottomStyle', 'borderLeftStyle'],\n borderRadius: ['borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'],\n background: ['backgroundColor', 'backgroundImage', 'backgroundRepeat', 'backgroundPosition'],\n backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n flex: ['flexGrow', 'flexShrink', 'flexBasis'],\n translate: ['translateX', 'translateY'],\n translate3d: ['translateX', 'translateY', 'translateY'],\n scale: ['scaleX', 'scaleY'],\n scale3d: ['scaleX', 'scaleY', 'scaleZ'],\n rotate: ['rotateZ'],\n skew: ['skewX', 'skewY'],\n textStroke: ['textStrokeWidth', 'textStrokeColor', 'textStrokeOver'],\n\n toFull(style, k) {\n let v = style[k];\n if(k === 'background') {\n // bg缩写多个时有color则必须是最后一个\n if(Array.isArray(v)) {\n let length = v.length;\n if(isNil(style.backgroundColor)) {\n let bgc = /^\\s*((transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))/i.exec(v[length - 1]);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.slice(0, length - 1);\n }\n }\n let bgi = [];\n let bgr = [];\n let bgp = [];\n v.forEach(item => {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(item);\n if(gd) {\n bgi.push(gd[0]);\n item = item.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n bgi.push(img[0]);\n item = item.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-?)?repeat(-?[xy])?/i.exec(item);\n if(repeat) {\n bgr.push(repeat[0].toLowerCase());\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = item.match(reg.position);\n if(position) {\n bgp.push(position.join(' '));\n }\n }\n });\n if(bgi.length) {\n style.backgroundImage = bgi;\n }\n if(bgr.length) {\n style.backgroundRepeat = bgr;\n }\n if(bgp.length) {\n style.backgroundPosition = bgp;\n this.toFull(style, 'backgroundPosition');\n }\n }\n else {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(v);\n if(gd) {\n style.backgroundImage = gd[0];\n v = v.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n style.backgroundImage = img[0];\n v = v.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-?)?repeat(-?[xy])?/i.exec(v);\n if(repeat) {\n style.backgroundRepeat = repeat[0].toLowerCase();\n }\n }\n if(isNil(style.backgroundColor)) {\n let bgc = /^(transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\))/i.exec(v);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.replace(bgc[0], '');\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = v.match(reg.position);\n if(position) {\n style.backgroundPosition = position.join(' ');\n this.toFull(style, 'backgroundPosition');\n }\n }\n }\n }\n else if(k === 'flex') {\n if(v === 'none') {\n parseFlex(style, 0, 0, 'auto');\n }\n else if(v === 'auto') {\n parseFlex(style, 1, 1, 'auto');\n }\n else if(/^[\\d.]+\\s+[\\d.]+\\s+(auto|none|content)/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]);\n }\n else if(/^[\\d.]+\\s+[\\d.]+\\s+[\\d.]+[pxremvwh%]*/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]);\n }\n else if(/^[\\d.]+\\s+[\\d.]+$/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), 0);\n }\n else if(/^[\\d.]+\\s+[\\d.]+[pxremvwh%]+/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), 1, arr[1]);\n }\n else if(/^[\\d.]+$/.test(v)) {\n parseFlex(style, parseFloat(v), 1, 0);\n }\n else if(/^[\\d.]+[pxremvwh%]+/i.test(v)) {\n parseFlex(style, 1, 1, v);\n }\n else {\n parseFlex(style, 0, 1, 'auto');\n }\n }\n else if(k === 'flexFlow') {\n v = v.toString().split(/\\s+/);\n if(v.length) {\n if(isNil(style.flexDirection)) {\n }\n style.flexDirection = v[0];\n if(v.length > 1) {\n style.flexWrap = v[1];\n }\n }\n }\n else if(k === 'borderRadius') {\n // borderRadius缩写很特殊,/分隔x/y,然后上右下左4个\n v = v.toString().split('/');\n if(v.length === 1) {\n v[1] = v[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = v[i].toString().split(/\\s+/);\n if(item.length === 0) {\n v[i] = [0, 0, 0, 0];\n }\n else if(item.length === 1) {\n v[i] = [item[0], item[0], item[0], item[0]];\n }\n else if(item.length === 2) {\n v[i] = [item[0], item[1], item[0], item[1]];\n }\n else if(item.length === 3) {\n v[i] = [item[0], item[1], item[2], item[1]];\n }\n else {\n v[i] = item.slice(0, 4);\n }\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = v[0][i] + ' ' + v[1][i];\n }\n });\n }\n else if(k === 'backgroundPosition') {\n if(!Array.isArray(v)) {\n v = [v];\n }\n let isEmpty = this[k].map(k2 => isNil(style[k2]));\n v.forEach(v2 => {\n v2 = v2.toString().split(/\\s+/);\n if(v2.length === 1) {\n v2[1] = '50%';\n }\n this[k].forEach((k2, i) => {\n if(isEmpty[i]) {\n style[k2] = style[k2] || [];\n style[k2].push(v2[i]);\n }\n });\n });\n }\n else if(['translate', 'scale', 'skew'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(['translate3d', 'scale3d'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[2] = arr[1] = arr[0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? 1 : 0;\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(k === 'margin' || k === 'padding') {\n parseMarginPadding(style, k, this[k]);\n }\n else if(/^border((Top)|(Right)|(Bottom)|(Left))$/.test(k)) {\n parseOneBorder(style, k);\n }\n else if(k === 'textStroke') {\n let w = /(?:^|\\s)([-+]?[\\d.]+[pxremvwh%]*)/.exec(v);\n if(w) {\n style.textStrokeWidth = w[1];\n }\n let c = /(transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\))/i.exec(v);\n if(c) {\n style.textStrokeColor = c[0];\n }\n if(/\\bfill\\b/i.test(v)) {\n style.textStrokeOver = 'fill';\n }\n else {\n style.textStrokeOver = 'none';\n }\n }\n else if(this[k]) {\n this[k].forEach(k => {\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n }\n return style;\n }\n};\n","import enums from '../util/enums';\n\nconst { STYLE_KEY } = enums;\n\nconst KEY_COLOR = [\n [STYLE_KEY.BACKGROUND_COLOR],\n [STYLE_KEY.BORDER_BOTTOM_COLOR],\n [STYLE_KEY.BORDER_LEFT_COLOR],\n [STYLE_KEY.BORDER_RIGHT_COLOR],\n [STYLE_KEY.BORDER_TOP_COLOR],\n [STYLE_KEY.COLOR],\n [STYLE_KEY.TEXT_STROKE_COLOR],\n];\n\nconst KEY_LENGTH = [\n [STYLE_KEY.FONT_SIZE],\n [STYLE_KEY.BORDER_BOTTOM_WIDTH],\n [STYLE_KEY.BORDER_LEFT_WIDTH],\n [STYLE_KEY.BORDER_RIGHT_WIDTH],\n [STYLE_KEY.BORDER_TOP_WIDTH],\n [STYLE_KEY.LEFT],\n [STYLE_KEY.TOP],\n [STYLE_KEY.RIGHT],\n [STYLE_KEY.BOTTOM],\n [STYLE_KEY.FLEX_BASIS],\n [STYLE_KEY.WIDTH],\n [STYLE_KEY.HEIGHT],\n [STYLE_KEY.LINE_HEIGHT],\n [STYLE_KEY.MARGIN_BOTTOM],\n [STYLE_KEY.MARGIN_LEFT],\n [STYLE_KEY.MARGIN_TOP],\n [STYLE_KEY.MARGIN_RIGHT],\n [STYLE_KEY.PADDING_TOP],\n [STYLE_KEY.PADDING_RIGHT],\n [STYLE_KEY.PADDING_BOTTOM],\n [STYLE_KEY.PADDING_LEFT],\n [STYLE_KEY.STROKE_WIDTH],\n [STYLE_KEY.STROKE_MITERLIMIT],\n [STYLE_KEY.LETTER_SPACING],\n [STYLE_KEY.PERSPECTIVE],\n [STYLE_KEY.TEXT_STROKE_WIDTH],\n];\n\nconst KEY_GRADIENT = [\n [STYLE_KEY.BACKGROUND_IMAGE],\n [STYLE_KEY.FILL],\n [STYLE_KEY.STROKE],\n];\n\nconst KEY_RADIUS = [\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS],\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS],\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS],\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS],\n];\n\nconst COLOR_HASH = {};\nKEY_COLOR.forEach(k => {\n COLOR_HASH[k] = true;\n});\n\nconst LENGTH_HASH = {};\nKEY_LENGTH.forEach(k => {\n LENGTH_HASH[k] = true;\n});\n\nconst RADIUS_HASH = {};\nKEY_RADIUS.forEach(k => {\n RADIUS_HASH[k] = true;\n});\n\nconst GRADIENT_HASH = {};\nKEY_GRADIENT.forEach(k => {\n GRADIENT_HASH[k] = true;\n});\n\nconst GRADIENT_TYPE = {\n linear: true,\n radial: true,\n conic: true,\n};\n\nconst KEY_EXPAND = [\n [STYLE_KEY.TRANSLATE_X],\n [STYLE_KEY.TRANSLATE_Y],\n [STYLE_KEY.TRANSLATE_Z],\n [STYLE_KEY.SKEW_X],\n [STYLE_KEY.SKEW_Y],\n [STYLE_KEY.SCALE_X],\n [STYLE_KEY.SCALE_Y],\n [STYLE_KEY.SCALE_Z],\n [STYLE_KEY.ROTATE_X],\n [STYLE_KEY.ROTATE_Y],\n [STYLE_KEY.ROTATE_Z],\n];\n\nconst EXPAND_HASH = {};\nKEY_EXPAND.forEach(k => {\n EXPAND_HASH[k] = true;\n});\n\nexport default {\n KEY_COLOR,\n KEY_EXPAND,\n KEY_GRADIENT,\n KEY_LENGTH,\n KEY_RADIUS,\n COLOR_HASH,\n EXPAND_HASH,\n GRADIENT_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_TYPE,\n};\n","import reset from '../style/reset';\nimport unit from '../style/unit';\nimport enums from '../util/enums';\n\nconst { DOM: RESET_DOM, GEOM: RESET_GEOM } = reset;\nconst { INHERIT } = unit;\nconst { STYLE_KEY } = enums;\n\nconst GEOM = {};\nconst GEOM_KEY_SET = [];\nconst IGNORE = {\n [STYLE_KEY.POINTER_EVENTS]: true,\n};\nconst REPAINT = {\n [STYLE_KEY.TRANSFORM]: true,\n [STYLE_KEY.TRANSLATE_X]: true,\n [STYLE_KEY.TRANSLATE_Y]: true,\n [STYLE_KEY.SKEW_X]: true,\n [STYLE_KEY.SKEW_Y]: true,\n [STYLE_KEY.SCALE_X]: true,\n [STYLE_KEY.SCALE_Y]: true,\n [STYLE_KEY.ROTATE_Z]: true,\n [STYLE_KEY.COLOR]: true,\n [STYLE_KEY.FONT_STYLE]: true,\n [STYLE_KEY.STROKE_WIDTH]: true,\n [STYLE_KEY.FILL]: true,\n [STYLE_KEY.STROKE_DASHARRAY]: true,\n [STYLE_KEY.STROKE_LINECAP]: true,\n [STYLE_KEY.STROKE_LINEJOIN]: true,\n [STYLE_KEY.STROKE_MITERLIMIT]: true,\n [STYLE_KEY.BACKGROUND_COLOR]: true,\n [STYLE_KEY.BACKGROUND_IMAGE]: true,\n [STYLE_KEY.BACKGROUND_POSITION_X]: true,\n [STYLE_KEY.BACKGROUND_POSITION_Y]: true,\n [STYLE_KEY.BACKGROUND_REPEAT]: true,\n [STYLE_KEY.BACKGROUND_SIZE]: true,\n [STYLE_KEY.STROKE]: true,\n [STYLE_KEY.BORDER_BOTTOM_COLOR]: true,\n [STYLE_KEY.BORDER_LEFT_COLOR]: true,\n [STYLE_KEY.BORDER_RIGHT_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS]: true,\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS]: true,\n [STYLE_KEY.VISIBILITY]: true,\n [STYLE_KEY.OPACITY]: true,\n [STYLE_KEY.Z_INDEX]: true,\n [STYLE_KEY.FILTER]: true,\n [STYLE_KEY.BOX_SHADOW]: true,\n [STYLE_KEY.OVERFLOW]: true,\n [STYLE_KEY.BACKGROUND_CLIP]: true,\n [STYLE_KEY.TEXT_STROKE_WIDTH]: true,\n [STYLE_KEY.TEXT_STROKE_COLOR]: true,\n [STYLE_KEY.TEXT_STROKE_OVER]: true,\n};\nconst MEASURE = {\n [STYLE_KEY.FONT_SIZE]: true,\n [STYLE_KEY.FONT_WEIGHT]: true,\n [STYLE_KEY.FONT_FAMILY]: true,\n};\n\nlet o = {\n GEOM,\n GEOM_KEY_SET,\n IGNORE,\n REPAINT,\n MEASURE,\n addGeom(tagName, ks, cb) {\n if(Array.isArray(ks)) {\n ks.forEach(k => {\n o.addGeom(tagName, k, cb);\n });\n }\n else if(ks) {\n if(!GEOM.hasOwnProperty(ks)) {\n GEOM_KEY_SET.push(ks);\n }\n let hash = GEOM[ks] = GEOM[ks] || {};\n hash[tagName] = cb || true;\n }\n },\n 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, calUnit } = unit;\nconst { isNil, rgba2int, equalArr } = util;\nconst { MEASURE_KEY_SET, isGeom, GEOM, GEOM_KEY_SET } = change;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nconst TRANSFORM_HASH = {\n translateX: TRANSLATE_X,\n translateY: TRANSLATE_Y,\n translateZ: TRANSLATE_Z,\n scaleX: SCALE_X,\n scaleY: SCALE_Y,\n scaleZ: SCALE_Z,\n skewX: SKEW_X,\n skewY: SKEW_Y,\n rotateX: ROTATE_X,\n rotateY: ROTATE_Y,\n rotateZ: ROTATE_Z,\n rotate: ROTATE_Z,\n};\n\nfunction compatibleTransform(k, arr) {\n if(k === SCALE_X || k === SCALE_Y || k === SCALE_Z) {\n arr[1] = NUMBER;\n }\n else if(k === TRANSLATE_X || k === TRANSLATE_Y || k === TRANSLATE_Z) {\n if(arr[1] === NUMBER) {\n arr[1] = PX;\n }\n }\n else if(k === PERSPECTIVE) {\n if([NUMBER, PERCENT, DEG].indexOf(arr[1]) > -1) {\n arr[1] = PX;\n }\n }\n else {\n if(arr[1] === NUMBER) {\n arr[1] = DEG;\n }\n }\n}\n\n/**\n * 将传入的手写style标准化,并且用reset默认值覆盖其中为空的\n * @param style 手写的style样式\n * @param reset 默认样式,可选\n * @returns Object 标准化的枚举数组结构样式\n */\nfunction normalize(style, reset = []) {\n if(!util.isObject(style)) {\n return {};\n }\n let res = {};\n // style只有单层无需深度clone\n style = util.extend({}, style);\n // 缩写提前处理,因为reset里没有缩写\n let temp = style.border;\n if(temp) {\n abbr.toFull(style, 'border');\n }\n ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'].forEach(k => {\n abbr.toFull(style, k);\n });\n temp = style.borderWidth;\n if(temp) {\n abbr.toFull(style, 'borderWidth');\n }\n temp = style.borderColor;\n if(temp) {\n abbr.toFull(style, 'borderColor');\n }\n temp = style.borderStyle;\n if(temp) {\n abbr.toFull(style, 'borderStyle');\n }\n temp = style.borderRadius;\n if(temp) {\n abbr.toFull(style, 'borderRadius');\n }\n temp = style.background;\n // 处理渐变背景缩写\n if(temp) {\n abbr.toFull(style, 'background');\n }\n // 背景位置\n temp = style.backgroundPosition;\n if(!isNil(temp)) {\n abbr.toFull(style, 'backgroundPosition');\n }\n // flex\n temp = style.flex;\n if(temp) {\n abbr.toFull(style, 'flex');\n }\n // flex-flow\n temp = style.flexFlow;\n if(temp) {\n abbr.toFull(style, 'flexFlow');\n }\n temp = style.margin;\n if(!isNil(temp)) {\n abbr.toFull(style, 'margin');\n }\n temp = style.padding;\n if(!isNil(temp)) {\n abbr.toFull(style, 'padding');\n }\n temp = style.textStroke;\n if(temp) {\n abbr.toFull(style, 'textStroke');\n }\n // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform\n ['translate', 'scale', 'skew', 'translate3d', 'scale3d', 'rotate'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n abbr.toFull(style, k);\n }\n });\n // 扩展的不能和transform混用,给出警告\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate3d',\n ].forEach(k => {\n let v = style[k];\n if(!isNil(v) && style.transform) {\n inject.warn(`Can not use expand style \"${k}\" with transform`);\n }\n });\n // 默认reset,根据传入不同,当style为空时覆盖\n reset.forEach(item => {\n let { k, v } = item;\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n // 背景图\n temp = style.backgroundImage;\n if(temp !== undefined) {\n if(!temp) {\n res[BACKGROUND_IMAGE] = [null];\n }\n else if(Array.isArray(temp)) {\n res[BACKGROUND_IMAGE] = temp.map(item => {\n if(!item) {\n return null;\n }\n if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n if(reg.img.test(item)) {\n return reg.img.exec(item)[2];\n }\n return null;\n });\n }\n // 区分是渐变色还是图\n else if(reg.gradient.test(temp)) {\n res[BACKGROUND_IMAGE] = [gradient.parseGradient(temp)];\n }\n else if(reg.img.test(temp)) {\n res[BACKGROUND_IMAGE] = [reg.img.exec(temp)[2]];\n }\n else {\n res[BACKGROUND_IMAGE] = [null];\n }\n }\n temp = style.backgroundColor;\n if(temp) {\n // 先赋值默认透明,后续操作有合法值覆盖\n let bgc = /^#[0-9a-f]{3,8}/i.exec(temp);\n if(bgc && [4, 7, 9].indexOf(bgc[0].length) > -1) {\n res[BACKGROUND_COLOR] = [rgba2int(bgc[0]), RGBA];\n }\n else {\n bgc = /rgba?\\s*\\(.+\\)/i.exec(temp);\n res[BACKGROUND_COLOR] = [rgba2int(bgc ? bgc[0] : [0, 0, 0, 0]), RGBA];\n }\n }\n ['backgroundPositionX', 'backgroundPositionY'].forEach((k, i) => {\n temp = style[k];\n if(!isNil(temp)) {\n k = i ? BACKGROUND_POSITION_Y : BACKGROUND_POSITION_X;\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[k] = temp.map(item => {\n if(/^[-+]?[\\d.]/.test(item)) {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item] || 0,\n PERCENT,\n ];\n }\n });\n }\n });\n // 背景尺寸\n temp = style.backgroundSize;\n if(temp) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[BACKGROUND_SIZE] = temp.map(item => {\n if(!item) {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n let match = item.toString().match(/\\b(?:([-+]?[\\d.]+[pxremvwh%]*)|(contain|cover|auto))/ig);\n if(match) {\n if(match.length === 1) {\n if(match[0] === 'contain' || match[0] === 'cover') {\n match[1] = match[0];\n }\n else {\n match[1] = 'auto';\n }\n }\n let v = [];\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n v.push(n);\n }\n else if(item === 'contain' || item === 'cover') {\n v.push([item, STRING]);\n }\n else {\n v.push([0, AUTO]);\n }\n }\n return v;\n }\n else {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n });\n }\n // border-color\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k + 'Color';\n let v = style[k];\n if(!isNil(v)) {\n res[STYLE_KEY[style2Upper(k)]] = [rgba2int(v), RGBA];\n }\n });\n // border-radius\n ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'].forEach(k => {\n k = 'border' + k + 'Radius';\n let v = style[k];\n if(!isNil(v)) {\n let arr = v.toString().split(/\\s+/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = arr[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n if(n[0] < 0) {\n n[0] = 0;\n }\n arr[i] = n;\n }\n else {\n arr[i] = [0, PX];\n }\n }\n res[STYLE_KEY[style2Upper(k)]] = arr;\n }\n });\n temp = style.transform;\n if(temp) {\n let transform = res[TRANSFORM] = [];\n let match = (temp || '').toString().match(/\\w+\\(.+?\\)/g);\n if(match) {\n match.forEach(item => {\n let i = item.indexOf('(');\n let k = item.slice(0, i);\n let v = item.slice(i + 1, item.length - 1);\n if(k === 'matrix') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 6) {\n arr = arr.slice(0, 6);\n }\n if(arr.length === 6) {\n transform.push([MATRIX, [\n arr[0], arr[1], 0, 0, arr[2], arr[3], 0, 0, 0, 0, 1, 0, arr[4], arr[5], 0, 1,\n ]]);\n }\n }\n else if(k === 'matrix3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 16) {\n arr = arr.slice(0, 16);\n }\n if(arr.length === 16) {\n transform.push([MATRIX, arr]);\n }\n }\n else if(k === 'perspective') {\n let arr = calUnit(v);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n transform.push([PERSPECTIVE, arr]);\n }\n else if(k === 'rotate3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n transform.push([ROTATE_3D, arr]);\n }\n }\n else if(TRANSFORM_HASH.hasOwnProperty(k)) {\n let k2 = TRANSFORM_HASH[k];\n let arr = calUnit(v);\n compatibleTransform(k2, arr);\n transform.push([k2, arr]);\n }\n else if({ translate: true, scale: true, skew: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale' ? arr[0] : [0];\n }\n if(arr.length === 2) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n }\n }\n else if({ translate3d: true, scale3d: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale3d' ? [1] : [0];\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n if(arr.length === 3) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let k3 = STYLE_KEY[style2Upper(k + 'Z')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n let arr3 = calUnit(arr[2]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n compatibleTransform(k3, arr3);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n transform.push([k3, arr3]);\n }\n }\n });\n }\n }\n temp = style.perspective;\n if(!isNil(temp)) {\n let arr = calUnit(temp);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n res[PERSPECTIVE] = arr;\n }\n ['perspectiveOrigin', 'transformOrigin'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n let arr = res[STYLE_KEY[style2Upper(k)]] = [];\n let match = temp.toString().match(reg.position);\n if(match) {\n if(match.length === 1) {\n match[1] = match[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n arr.push(n);\n }\n else {\n arr.push([\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item],\n PERCENT,\n ]);\n // 不规范的写法变默认值50%\n if(isNil(arr[i][0])) {\n arr[i][0] = 50;\n }\n }\n }\n }\n else {\n arr.push([50, PERCENT]);\n arr.push([50, PERCENT]);\n }\n }\n });\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n let k2 = TRANSFORM_HASH[k];\n let n = calUnit(v);\n // 没有单位或默认值处理单位\n compatibleTransform(k2, n);\n res[k2] = n;\n });\n temp = style.rotate3d;\n if(temp) {\n let arr = temp.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n res[ROTATE_3D] = arr;\n }\n }\n temp = style.opacity;\n if(!isNil(temp)) {\n temp = parseFloat(temp);\n if(!isNaN(temp)) {\n temp = Math.max(temp, 0);\n temp = Math.min(temp, 1);\n res[OPACITY] = temp;\n }\n else {\n res[OPACITY] = 1;\n }\n }\n temp = style.zIndex;\n if(!isNil(temp)) {\n res[Z_INDEX] = parseInt(temp) || 0;\n }\n // 转化不同单位值为对象标准化,不写单位的变成number单位转化为px\n [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'width',\n 'height',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n if(v === 'auto') {\n v = [0, AUTO];\n }\n else {\n v = calUnit(v);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n let k2 = STYLE_KEY[style2Upper(k)];\n res[k2] = v;\n // 限制padding/border为正数\n if({\n paddingTop: true,\n paddingRight: true,\n paddingBottom: true,\n paddingLeft: true,\n borderTopWidth: true,\n borderRightWidth: true,\n borderBottomWidth: true,\n borderLeftWidth: true,\n width: true,\n height: true,\n }.hasOwnProperty(k) && v[0] < 0) {\n v[0] = 0;\n }\n });\n temp = style.flexBasis;\n if(!isNil(temp)) {\n if(temp === 'content') {\n res[FLEX_BASIS] = [temp, STRING];\n }\n else if(/^[\\d.]/.test(temp)) {\n let v = res[FLEX_BASIS] = calUnit(temp);\n v[0] = Math.max(v[0], 0);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n else {\n res[FLEX_BASIS] = [0, AUTO];\n }\n }\n temp = style.order;\n if(!isNil(temp)) {\n res[ORDER] = parseInt(temp) || 0;\n }\n temp = style.color;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[COLOR] = [[], INHERIT];\n }\n else {\n res[COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.textStrokeColor;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_COLOR] = [[], INHERIT];\n }\n else {\n res[TEXT_STROKE_COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.fontSize;\n if(temp || temp === 0) {\n if(temp === 'inherit') {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // fontSize不能为负数,否则为继承\n if(v < 0) {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[FONT_SIZE] = v;\n }\n }\n }\n temp = style.textStrokeWidth;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // textStrokeWidth不能为负数,否则为继承\n if(v < 0) {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG, PERCENT].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[TEXT_STROKE_WIDTH] = v;\n }\n }\n }\n temp = style.textStrokeOver;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_OVER] = [0, INHERIT];\n }\n else {\n let v = temp.toString();\n if(v !== 'none' && v !== 'fill') {\n v = 'none';\n }\n res[TEXT_STROKE_OVER] = [v, STRING];\n }\n }\n temp = style.fontWeight;\n if(!isNil(temp)) {\n if(temp === 'bold') {\n res[FONT_WEIGHT] = [700, NUMBER];\n }\n else if(temp === 'normal') {\n res[FONT_WEIGHT] = [400, NUMBER];\n }\n else if(temp === 'lighter') {\n res[FONT_WEIGHT] = [200, NUMBER];\n }\n else if(temp === 'inherit') {\n res[FONT_WEIGHT] = [0, INHERIT];\n }\n else {\n res[FONT_WEIGHT] = [Math.max(0, parseInt(temp)) || 400, NUMBER];\n }\n }\n temp = style.fontStyle;\n if(temp) {\n if(temp === 'inherit') {\n res[FONT_STYLE] = [0, INHERIT];\n }\n else {\n res[FONT_STYLE] = [temp, STRING];\n }\n }\n temp = style.fontFamily;\n if(temp) {\n if(temp === 'inherit') {\n res[FONT_FAMILY] = [0, INHERIT];\n }\n else {\n // 统一文字声明格式\n res[FONT_FAMILY] = [temp.toString().toLowerCase().replace(/['\"]/, '').replace(/\\s*,\\s*/g, ','), STRING];\n }\n }\n temp = style.textAlign;\n if(temp) {\n if(temp === 'inherit') {\n res[TEXT_ALIGN] = [0, INHERIT];\n }\n else {\n res[TEXT_ALIGN] = [temp, STRING];\n }\n }\n temp = style.lineHeight;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LINE_HEIGHT] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LINE_HEIGHT] = [0, AUTO];\n }\n // lineHeight默认数字,想要px必须强制带单位\n else if(/^[\\d.]+/i.test(temp)) {\n let v = calUnit(temp);\n if([DEG].indexOf(v[1]) > -1) {\n v[1] = NUMBER;\n }\n res[LINE_HEIGHT] = v;\n }\n else {\n let n = Math.max(0, parseFloat(temp)) || 'normal';\n // 非法数字\n if(n === 'normal') {\n res[LINE_HEIGHT] = [null, AUTO];\n }\n else {\n res[LINE_HEIGHT] = [n, NUMBER];\n }\n }\n }\n temp = style.letterSpacing;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LETTER_SPACING] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LETTER_SPACING] = [0, PX];\n }\n else if(/^[-+]?[\\d.]/.test(temp)) {\n let v = calUnit(temp);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[LETTER_SPACING] = v;\n }\n else {\n res[LETTER_SPACING] = [parseFloat(temp) || 0, PX];\n }\n }\n temp = style.whiteSpace;\n if(temp) {\n if(temp === 'inherit') {\n res[WHITE_SPACE] = [0, INHERIT];\n }\n else {\n res[WHITE_SPACE] = [temp, STRING];\n }\n }\n temp = style.lineClamp;\n if(temp !== undefined) {\n temp = parseInt(temp) || 0;\n res[LINE_CLAMP] = Math.max(0, temp);\n }\n // fill和stroke为渐变时特殊处理,fillRule无需处理字符串\n temp = style.fill;\n if(temp !== undefined) {\n if(!temp) {\n res[FILL] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[FILL] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[FILL] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[FILL] = [gradient.parseGradient(temp)];\n }\n else {\n res[FILL] = [rgba2int(temp)];\n }\n }\n temp = style.stroke;\n if(temp !== undefined) {\n if(!temp) {\n res[STROKE] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[STROKE] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[STROKE] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[STROKE] = [gradient.parseGradient(temp)];\n }\n else {\n res[STROKE] = [rgba2int(temp)];\n }\n }\n temp = style.strokeWidth;\n if(!isNil(temp)) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[STROKE_WIDTH] = temp.map(item => {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n v[0] = Math.max(v[0], 0);\n return v;\n });\n }\n temp = style.strokeDasharray;\n if(!isNil(temp)) {\n if(Array.isArray(temp)) {\n res[STROKE_DASHARRAY] = temp.map(item => {\n let match = item.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n return match;\n }\n return [];\n });\n }\n else {\n let match = temp.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n res[STROKE_DASHARRAY] = [match];\n }\n else {\n res[STROKE_DASHARRAY] = [[]];\n }\n }\n }\n temp = style.filter;\n if(temp !== undefined) {\n let match = (temp || '').toString().match(/\\b[\\w-]+\\s*\\(\\s*[-+]?[\\d.]+\\s*[pxremvwhdg%]*\\s*\\)\\s*/ig);\n let f = null;\n if(match) {\n f = [];\n match.forEach(item => {\n let m2 = /([\\w-]+)\\s*\\(\\s*([-+]?[\\d.]+\\s*[pxremvwhdg%]*)\\s*\\)\\s*/i.exec(item);\n if(m2) {\n let k = m2[1].toLowerCase(), v = calUnit(m2[2]);\n if(k === 'blur') {\n if(v[0] <= 0 || [DEG, PERCENT].indexOf(v[1]) > -1) {\n return;\n }\n if(v[1] === NUMBER) {\n v[1] = PX;\n }\n f.push([k, v]);\n }\n else if(k === 'hue-rotate') {\n if([NUMBER, DEG].indexOf(v[1]) === -1) {\n return;\n }\n v[1] = DEG;\n f.push([k, v]);\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'grayscale' || k === 'contrast') {\n if([NUMBER, PERCENT].indexOf(v[1]) === -1) {\n return;\n }\n v[0] = Math.max(v[0], 0);\n v[1] = PERCENT;\n f.push([k, v]);\n }\n }\n });\n }\n res[FILTER] = f;\n }\n temp = style.visibility;\n if(temp) {\n if(temp === 'inherit') {\n res[VISIBILITY] = [0, INHERIT];\n }\n else {\n res[VISIBILITY] = [temp, STRING];\n }\n }\n temp = style.pointerEvents;\n if(temp) {\n if(temp === 'inherit') {\n res[POINTER_EVENTS] = [0, INHERIT];\n }\n else {\n res[POINTER_EVENTS] = [temp, STRING];\n }\n }\n temp = style.boxShadow;\n if(temp !== undefined) {\n let bs = null;\n let match = (temp || '').match(/([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*\\s*)?([-+]?[\\d.]+[pxremvwh%]*\\s*)?(((transparent)|(#[0-9a-f]{3,8})|(rgba?\\(.+?\\)))\\s*)?(inset|outset)?\\s*,?/ig);\n if(match) {\n match.forEach(item => {\n let boxShadow = /([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*\\s*)?([-+]?[\\d.]+[pxremvwh%]*\\s*)?(?:((?:transparent)|(?:#[0-9a-f]{3,8})|(?:rgba?\\(.+\\)))\\s*)?(inset|outset)?/i.exec(item);\n if(boxShadow) {\n bs = bs || [];\n let res = [];\n // v,h,blur,spread,color,inset\n for(let i = 0; i < 4; i++) {\n let v = calUnit(boxShadow[i + 1]);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n // x/y可以负,blur和spread不行\n if(i > 1 && v[0] < 0) {\n v = 0;\n }\n res.push(v);\n }\n res.push(rgba2int(boxShadow[5]));\n res.push(boxShadow[6] || 'outset');\n bs.push(res);\n }\n });\n }\n res[BOX_SHADOW] = bs;\n }\n // 直接赋值的string类型\n [\n 'position',\n 'display',\n 'flexDirection',\n 'flexWrap',\n 'justifyContent',\n 'alignItems',\n 'alignSelf',\n 'alignContent',\n 'overflow',\n 'mixBlendMode',\n 'borderTopStyle',\n 'borderRightStyle',\n 'borderBottomStyle',\n 'borderLeftStyle',\n 'backgroundClip',\n 'textOverflow',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[STYLE_KEY[style2Upper(k)]] = style[k];\n }\n });\n // 直接赋值的number类型\n [\n 'flexGrow',\n 'flexShrink',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[STYLE_KEY[style2Upper(k)]] = Math.max(parseFloat(style[k]) || 0, 0);\n }\n });\n temp = style.zIndex;\n if(!isNil(temp)) {\n res[Z_INDEX] = parseFloat(temp) || 0;\n }\n // 这些支持多个的用数组表示\n [\n 'backgroundRepeat',\n 'strokeLinecap',\n 'strokeLinejoin',\n 'strokeMiterlimit',\n 'fillRule',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n let v = style[k];\n res[STYLE_KEY[style2Upper(k)]] = Array.isArray(v) ? v : [v];\n }\n });\n GEOM_KEY_SET.forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[k] = style[k];\n }\n });\n return res;\n}\n\n/**\n * 第一次和REFLOW等级下,刷新前首先执行,生成computedStyle\n * 影响文字测量的只有字体和大小和重量,需要提前处理\n * 继承相关的计算\n * @param node 对象节点\n * @param isRoot 是否是根节点,无继承需使用默认值\n */\nfunction computeMeasure(node, isRoot) {\n let { currentStyle, computedStyle, domParent } = node;\n let parentComputedStyle = !isRoot && domParent.computedStyle;\n MEASURE_KEY_SET.forEach(k => {\n let v = currentStyle[k];\n // ff特殊处理\n if(k === FONT_FAMILY) {\n if(v[1] === INHERIT) {\n computedStyle[k] = getFontFamily(isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k]);\n }\n else {\n computedStyle[k] = getFontFamily(v[0]);\n }\n }\n else if(v[1] === INHERIT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k];\n }\n // 只有fontSize会有%\n else if(v[1] === PERCENT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (parentComputedStyle[k] * v[0] * 0.01);\n }\n else if(v[1] === REM) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.computedStyle[FONT_SIZE] * v[0]);\n }\n else if(v[1] === VW) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.width * 0.01 * v[0]);\n }\n else if(v[1] === VH) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.height * 0.01 * v[0]);\n }\n else {\n computedStyle[k] = v[0];\n }\n });\n}\n\n/**\n * 每次布局前需要计算的reflow相关的computedStyle\n * @param node 对象节点\n * @param isHost 是否是根节点或组件节点这种局部根节点,无继承需使用默认值\n */\nfunction computeReflow(node, isHost) {\n let { currentStyle, computedStyle, domParent: parent, root } = node;\n let rem = root.computedStyle[FONT_SIZE];\n let isRoot = !parent;\n let parentComputedStyle = parent && parent.computedStyle;\n [\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n ].forEach(k => {\n // border-width不支持百分比\n let item = currentStyle[k];\n if(item[1] === PX) {\n computedStyle[k] = item[0];\n }\n else if(item[1] === REM) {\n computedStyle[k] = item[0] * rem;\n }\n else if(item[1] === VW) {\n computedStyle[k] = item[0] * root.width * 0.01;\n }\n else if(item[1] === VH) {\n computedStyle[k] = item[0] * root.height * 0.01;\n }\n else {\n computedStyle[k] = 0;\n }\n });\n [\n POSITION,\n DISPLAY,\n FLEX_DIRECTION,\n JUSTIFY_CONTENT,\n ALIGN_ITEMS,\n ALIGN_SELF,\n FLEX_GROW,\n FLEX_SHRINK,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n let textAlign = currentStyle[TEXT_ALIGN];\n if(textAlign[1] === INHERIT) {\n computedStyle[TEXT_ALIGN] = isRoot ? 'left' : parentComputedStyle[TEXT_ALIGN];\n }\n else {\n computedStyle[TEXT_ALIGN] = textAlign[0];\n }\n let fontSize = computedStyle[FONT_SIZE];\n let lineHeight = currentStyle[LINE_HEIGHT];\n // lineHeight继承很特殊,数字和normal不同于普通单位\n if(lineHeight[1] === INHERIT) {\n if(isRoot) {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n else {\n let p = parent;\n let ph;\n while(p) {\n ph = p.currentStyle[LINE_HEIGHT];\n if(ph[1] !== INHERIT) {\n break;\n }\n p = p.domParent;\n }\n // 到root还是inherit或normal,或者中途遇到了normal,使用normal\n if([AUTO, INHERIT].indexOf(ph[1]) > -1) {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n // 数字继承\n else if(ph[1] === NUMBER) {\n computedStyle[LINE_HEIGHT] = Math.max(ph[0], 0) * fontSize;\n }\n // 单位继承\n else {\n computedStyle[LINE_HEIGHT] = parentComputedStyle[LINE_HEIGHT];\n }\n }\n }\n // 防止为0\n else if(lineHeight[1] === PX) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === PERCENT) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * fontSize * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === REM) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * rem, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VW) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.width * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VH) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.height * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === NUMBER) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) * fontSize || calNormalLineHeight(computedStyle);\n }\n // normal或auto\n else {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n let letterSpacing = currentStyle[LETTER_SPACING];\n if(letterSpacing[1] === INHERIT) {\n computedStyle[LETTER_SPACING] = isRoot ? 0 : parentComputedStyle[LETTER_SPACING];\n }\n else if(letterSpacing[1] === PERCENT) {\n computedStyle[LETTER_SPACING] = fontSize * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === REM) {\n computedStyle[LETTER_SPACING] = rem * letterSpacing[0];\n }\n else if(letterSpacing[1] === VW) {\n computedStyle[LETTER_SPACING] = root.width * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === VH) {\n computedStyle[LETTER_SPACING] = root.height * 0.01 * letterSpacing[0];\n }\n else {\n computedStyle[LETTER_SPACING] = letterSpacing[0];\n }\n //whiteSpace\n let whiteSpace = currentStyle[WHITE_SPACE];\n if(whiteSpace[1] === INHERIT) {\n computedStyle[WHITE_SPACE] = isRoot ? 'normal' : parentComputedStyle[WHITE_SPACE];\n }\n else {\n computedStyle[WHITE_SPACE] = whiteSpace[0];\n }\n}\n\nfunction setFontStyle(style) {\n let fontSize = style[FONT_SIZE];\n return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' '\n + fontSize + 'px/' + fontSize + 'px ' + (style[FONT_FAMILY] || 'arial');\n}\n\nfunction getFontFamily(str) {\n let ff = str.split(',');\n let f = 'arial';\n for(let i = 0, len = ff.length; i < len; i++) {\n if(font.support(ff[i])) {\n f = ff[i];\n break;\n }\n }\n return f;\n}\n\nfunction getBaseLine(style) {\n let fontSize = style[FONT_SIZE];\n let ff = getFontFamily(style[FONT_FAMILY]);\n let normal = fontSize * (font.info[ff] || font.info.arial).lhr;\n return (style[LINE_HEIGHT] - normal) * 0.5 + fontSize * (font.info[ff] || font.info.arial).blr;\n}\n\nfunction calNormalLineHeight(style) {\n let ff = getFontFamily(style[FONT_FAMILY]);\n return style[FONT_SIZE] * (font.info[ff] || font.info.arial).lhr;\n}\n\nfunction calRelativePercent(n, parent, k) {\n n *= 0.01;\n while(parent) {\n let style = parent.currentStyle[k];\n if(style[1] === AUTO) {\n if(k === WIDTH) {\n parent = parent.domParent;\n }\n else {\n break;\n }\n }\n else if(style[1] === PX) {\n return n * style[0];\n }\n else if(style[1] === PERCENT) {\n n *= style[0] * 0.01;\n parent = parent.domParent;\n }\n else if(style[1] === REM) {\n return n * style[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(style[1] === VW) {\n return n * style[0] * parent.root.width * 0.01;\n }\n else if(style[1] === VH) {\n return n * style[0] * parent.root.height * 0.01;\n }\n }\n return n;\n}\n\nfunction calRelative(currentStyle, k, v, parent, isWidth) {\n if(v[1] === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER].indexOf(v[1]) > -1) {\n v = v[0];\n }\n else if(v[1] === PERCENT) {\n if(isWidth) {\n v = calRelativePercent(v[0], parent, WIDTH);\n }\n else {\n v = calRelativePercent(v[0], parent, HEIGHT);\n }\n }\n else if(v[1] === REM) {\n v = v[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * parent.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * parent.root.height * 0.01;\n }\n return v;\n}\n\nfunction calAbsolute(currentStyle, k, v, size, root) {\n if(v[1] === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER, DEG, RGBA, STRING].indexOf(v[1]) > -1) {\n v = v[0];\n }\n else if(v[1] === PERCENT) {\n v = v[0] * size * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * root.height * 0.01;\n }\n return v;\n}\n\nfunction equalStyle(k, a, b, target) {\n if(!a || !b) {\n return a === b;\n }\n if(k === TRANSFORM) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let oa = a[i];\n let ob = b[i];\n if(oa[0] !== ob[0]) {\n return false;\n }\n // translate/matrix等都是数组\n if(!equalArr(oa[1], ob[1])) {\n return false;\n }\n }\n return true;\n }\n if(k === FILTER) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equalArr(a[i], b[i])) {\n return false;\n }\n }\n }\n if(k === BACKGROUND_SIZE) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let aa = a[i], bb = b[i];\n if(aa[0][0] !== bb[0][0] || aa[0][1] !== bb[0][1] || aa[1][0] !== bb[1][0] || aa[1][1] !== bb[1][1]) {\n return false;\n }\n }\n return true;\n }\n if(k === TRANSFORM_ORIGIN || RADIUS_HASH.hasOwnProperty(k)) {\n return a[0][0] === b[0][0] && a[0][1] === b[0][1]\n && a[1][0] === b[1][0] && a[1][1] === b[1][1];\n }\n if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y\n || LENGTH_HASH.hasOwnProperty(k) || EXPAND_HASH.hasOwnProperty(k)) {\n return a[0] === b[0] && a[1] === b[1];\n }\n if(k === BOX_SHADOW) {\n return equalArr(a, b);\n }\n if(COLOR_HASH.hasOwnProperty(k)) {\n return a[1] === b[1] && equalArr(a[0], b[0]);\n }\n if(GRADIENT_HASH.hasOwnProperty(k) && a.k === b.k && GRADIENT_TYPE.hasOwnProperty(a.k)) {\n let av = a.v;\n let bv = b.v;\n if(a.d !== b.d || av.length !== bv.length) {\n return false;\n }\n for(let i = 0, len = av.length; i < len; i++) {\n let ai = av[i];\n let bi = bv[i];\n if(ai.length !== bi.length) {\n return false;\n }\n for(let j = 0; j < 4; j++) {\n if(ai[0][j] !== bi[0][j]) {\n return false;\n }\n }\n if(ai.length > 1) {\n if(ai[1][0] !== bi[1][0] || ai[1][1] !== bi[1][1]) {\n return false;\n }\n }\n }\n return true;\n }\n // multi都是纯值数组,equalArr本身即递归,非multi根据类型判断\n if(isGeom(target.tagName, k) && (target.isMulti || Array.isArray(a) && Array.isArray(b))) {\n return equalArr(a, b);\n }\n return a === b;\n}\n\nfunction isRelativeOrAbsolute(node) {\n let position = node.currentStyle[POSITION];\n return position === 'relative' || position === 'absolute';\n}\n\nconst VALUE = {\n [POSITION]: true,\n [DISPLAY]: true,\n [STYLE_KEY.BACKGROUND_REPEAT]: true,\n [FLEX_DIRECTION]: true,\n [FLEX_GROW]: true,\n [FLEX_SHRINK]: true,\n [FLEX_WRAP]: true,\n [JUSTIFY_CONTENT]: true,\n [ALIGN_ITEMS]: true,\n [ALIGN_SELF]: true,\n [STYLE_KEY.OVERFLOW]: true,\n [STYLE_KEY.MIX_BLEND_MODE]: true,\n [STYLE_KEY.STROKE_LINECAP]: true,\n [STYLE_KEY.STROKE_LINEJOIN]: true,\n [STYLE_KEY.STROKE_MITERLIMIT]: true,\n [STYLE_KEY.FILL_RULE]: true,\n [OPACITY]: true,\n [Z_INDEX]: true,\n [BACKGROUND_CLIP]: true,\n [TEXT_OVERFLOW]: true,\n [LINE_CLAMP]: true,\n};\n// 仅1维数组\nconst ARRAY_0 = {\n [COLOR]: true,\n [TEXT_STROKE_COLOR]: true,\n [BACKGROUND_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_COLOR]: true,\n [STYLE_KEY.BORDER_RIGHT_COLOR]: true,\n [STYLE_KEY.BORDER_BOTTOM_COLOR]: true,\n [STYLE_KEY.BORDER_LEFT_COLOR]: true,\n};\n// 仅2维数组且只有2个值\nconst ARRAY_0_1 = {\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS]: true,\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS]: true,\n [TRANSFORM_ORIGIN]: true,\n [PERSPECTIVE_ORIGIN]: true,\n};\nfunction cloneStyle(style, keys) {\n if(!keys) {\n keys = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n }\n let res = {};\n for(let i = 0, len = keys.length; i < len; i++) {\n let k = keys[i];\n let v = style[k];\n // 渐变特殊处理\n if(k === BACKGROUND_IMAGE) {\n res[k] = v.map(item => {\n // 可能为null\n if(item && item.k) {\n return util.clone(item);\n }\n else {\n return item;\n }\n });\n }\n else if(k === FILL || k === STROKE) {\n res[k] = v.map(item => {\n // 渐变\n // 可能非法为空\n if(item && item.k) {\n return util.clone(item);\n }\n // 颜色\n else {\n return item.slice(0);\n }\n });\n }\n else if(k === TRANSFORM || k === FILTER) {\n if(v) {\n let n = v.slice(0);\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n n[i][1] = n[i][1].slice(0);\n }\n res[k] = n;\n }\n }\n else if(k === BOX_SHADOW) {\n if(v) {\n v = v.map(item => {\n let n = item.slice(0);\n n[4] = n[4].slice(0);\n return n;\n });\n res[k] = v;\n }\n }\n else if(k === TRANSLATE_PATH) {\n if(v) {\n res[k] = v.map(item => item.slice(0));\n }\n }\n // position等直接值类型赋值\n else if(VALUE.hasOwnProperty(k)) {\n res[k] = v;\n }\n // geom自定义属性\n else if(GEOM.hasOwnProperty(k)) {\n res[k] = util.clone(v);\n }\n // 其余皆是数组或空,默认是一维数组只需slice即可\n else if(v) {\n let n = res[k] = v.slice(0);\n // 特殊引用里数组某项再次clone\n if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n }\n }\n else if(k === BACKGROUND_SIZE) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n n[i][0] = n[i][0].slice(0);\n n[i][1] = n[i][1].slice(0);\n }\n }\n else if(ARRAY_0.hasOwnProperty(k)) {\n n[0] = n[0].slice(0);\n }\n else if(ARRAY_0_1.hasOwnProperty(k)) {\n n[0] = n[0].slice(0);\n n[1] = n[1].slice(0);\n }\n else if(k === TRANSFORM) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n }\n }\n else if(k === ROTATE_3D) {\n n[3] = n[3].slice(0);\n }\n }\n }\n return res;\n}\n\nexport default {\n normalize,\n computeMeasure,\n computeReflow,\n setFontStyle,\n getFontFamily,\n getBaseLine,\n calRelative,\n calAbsolute,\n equalStyle,\n isRelativeOrAbsolute,\n cloneStyle,\n};\n","import mode from './mode';\nimport css from '../style/css';\nimport enums from '../util/enums';\nimport util from '../util/util';\n\nconst { STYLE_KEY: {\n COLOR,\n FONT_WEIGHT,\n FONT_FAMILY,\n FONT_SIZE,\n FONT_STYLE,\n LETTER_SPACING,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_WIDTH,\n TEXT_STROKE_OVER,\n} } = enums;\n\n/**\n * 表示一行文本的类,保存它的位置、内容、从属信息,在布局阶段生成,并在渲染阶段被Text调用render()\n * 关系上直属于Text类,一个Text类可能因为换行原因导致有多个TextBox,一行内容中也可能有不同Text从而不同TextBox\n * 另外本类还会被LineBoxManager添加到LineBox里,LineBox为一行中的inline/文本组合,之间需要进行垂直对齐\n * 在textOverflow为ellipsis时,可能会收到后面节点的向前回退(后面不足放下…),使得省略号发生在本节点\n */\nclass TextBox {\n constructor(parent, index, x, y, w, h, content, wList) {\n this.__parent = parent;\n this.__index = index;\n this.__x = x;\n this.__y = y;\n this.__width = w;\n this.__height = h;\n this.__content = content;\n this.__wList = wList;\n this.__virtualDom = {};\n }\n\n /**\n * 渲染阶段被Text类调用,多行Text会有多个TextBox,内容被分拆开\n * @param renderMode\n * @param ctx\n * @param computedStyle\n * @param cacheStyle Text父节点Dom的缓存样式,相比computedStyle可以直接用,比如color被缓存为style字符串\n * @param dx\n * @param dy\n */\n render(renderMode, ctx, computedStyle, cacheStyle, dx, dy) {\n let { content, x, y, parent, wList, width } = this;\n let { ox, oy } = parent;\n y += css.getBaseLine(computedStyle);\n x += ox + dx;\n y += oy + dy;\n this.__endX = x + width;\n this.__endY = y;\n let {\n [LETTER_SPACING]: letterSpacing,\n [TEXT_STROKE_WIDTH]: textStrokeWidth,\n [TEXT_STROKE_COLOR]: textStrokeColor,\n } = computedStyle;\n let i = 0, length = content.length;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n let overFill = computedStyle[TEXT_STROKE_OVER] === 'fill';\n if(letterSpacing) {\n for(; i < length; i++) {\n if(overFill) {\n ctx.fillText(content.charAt(i), x, y);\n }\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n ctx.strokeText(content.charAt(i), x, y);\n }\n if(!overFill) {\n ctx.fillText(content.charAt(i), x, y);\n }\n x += wList[i] + letterSpacing;\n }\n }\n else {\n if(overFill) {\n ctx.fillText(content, x, y);\n }\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n ctx.strokeText(content, x, y);\n }\n if(!overFill) {\n ctx.fillText(content, x, y);\n }\n }\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['x', x],\n ['y', y],\n ['fill', cacheStyle[COLOR]],\n ['font-family', computedStyle[FONT_FAMILY]],\n ['font-weight', computedStyle[FONT_WEIGHT]],\n ['font-style', computedStyle[FONT_STYLE]],\n ['font-size', computedStyle[FONT_SIZE] + 'px'],\n ];\n // svg无法定义stroke的over\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n props.push(['stroke', cacheStyle[TEXT_STROKE_COLOR]]);\n props.push(['stroke-width', computedStyle[TEXT_STROKE_WIDTH]]);\n }\n if(letterSpacing) {\n props.push(['letter-spacing', letterSpacing]);\n }\n this.__virtualDom = {\n type: 'item',\n tagName: 'text',\n props,\n content: util.encodeHtml(content),\n };\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endX() {\n return this.__endX;\n }\n\n get endY() {\n return this.__endY;\n }\n\n get width() {\n return this.__width;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get content() {\n return this.__content;\n }\n\n get baseLine() {\n return this.parent.baseLine;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get parentLineBox() {\n return this.__parentLineBox;\n }\n\n get wList() {\n return this.__wList;\n }\n}\n\nexport default TextBox;\n","import inject from '../util/inject';\n\nlet SIZE = [8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192];\nlet NUMBER = [128, 64, 32, 16, 8, 4, 2, 1, 1, 1, 1];\nlet MAX = SIZE[SIZE.length - 1];\nconst HASH_CANVAS = {};\n\nlet uuid = 0;\n\nclass Page {\n constructor(size, number) {\n this.__size = size;\n this.__number = number;\n this.__free = this.__total = number * number;\n size *= number;\n this.__width = size;\n this.__height = size;\n let offscreen = this.__canvas = inject.getCacheCanvas(size, size, null, number);\n if(offscreen) {\n this.__offscreen = offscreen;\n }\n // 1/0标识n*n个单元格是否空闲可用,一维数组表示\n this.__grid = [];\n for(let i = 0; i < this.__total; i++) {\n this.__grid.push(1);\n }\n this.__uuid = uuid++;\n // webgl贴图缓存使用,一旦更新则标识记录,绑定某号纹理单元查看变化才更新贴图\n this.__update = false;\n this.time = 0;\n }\n\n add() {\n let { number, grid } = this;\n for(let i = 0; i < number; i++) {\n for(let j = 0; j < number; j++) {\n let index = i * number + j;\n if(grid[index]) {\n grid[index] = 0;\n this.__free--;\n return index;\n }\n }\n }\n // 理论不可能进入,除非bug\n throw new Error('Can not find free page');\n }\n\n del(pos) {\n if(!this.grid[pos]) {\n this.grid[pos] = 1;\n this.__free++;\n }\n }\n\n getCoords(pos) {\n let { size, number } = this;\n let x = pos % number;\n let y = Math.floor(pos / number);\n return [x * size, y * size];\n }\n\n get uuid() {\n return this.__uuid;\n }\n\n get size() {\n return this.__size;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get number() {\n return this.__number;\n }\n\n get total() {\n return this.__total;\n }\n\n get free() {\n return this.__free;\n }\n\n get grid() {\n return this.__grid;\n }\n\n get offscreen() {\n return this.__offscreen;\n }\n\n get canvas() {\n return this.offscreen.canvas;\n }\n\n get ctx() {\n return this.offscreen.ctx;\n }\n\n get update() {\n return this.__update;\n }\n\n set update(v) {\n this.__update = v;\n }\n\n static getInstance(size) {\n if(size > MAX) {\n return;\n }\n let s = SIZE[0];\n let n = NUMBER[0];\n // 使用刚好满足的尺寸\n for(let i = 0, len = SIZE.length; i < len; i++) {\n s = SIZE[i];\n n = NUMBER[i];\n if(SIZE[i] >= size) {\n break;\n }\n }\n let list = HASH_CANVAS[s] = HASH_CANVAS[s] || [];\n // 从hash列表中尝试取可用的一页,找不到就生成新的页\n let page;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item.free) {\n page = item;\n break;\n }\n }\n if(!page) {\n page = new Page(s, n);\n if(!page.offscreen) {\n inject.error('Can not create off-screen for page');\n return;\n }\n list.push(page);\n }\n let pos = page.add();\n return { page, pos };\n }\n\n static set CONFIG(v) {\n if(!v || !Array.isArray(v.SIZE) || !Array.isArray(v.NUMBER)) {\n return;\n }\n SIZE = v.SIZE;\n NUMBER = v.NUMBER;\n MAX = SIZE[SIZE.length - 1];\n }\n\n static get CONFIG() {\n return {\n SIZE,\n NUMBER,\n };\n }\n\n static get MAX() {\n return MAX;\n }\n\n static genUuid() {\n return uuid++;\n }\n}\n\nexport default Page;\n","import matrix from './matrix';\nimport geom from './geom';\n\n// 一条边相对于自己开始点的x向量角度,即从x到此边旋转,0~180和-180~0,需要判断象限\nfunction calDeg(x1, y1, x2, y2) {\n let dx = x2 - x1;\n let dy = y2 - y1;\n let atan = Math.atan(Math.abs(dy) / Math.abs(dx));\n // 2象限\n if(dx < 0 && dy >= 0) {\n return Math.PI - atan;\n }\n // 3象限\n if(dx < 0 && dy < 0) {\n return atan - Math.PI;\n }\n // 1象限\n if(dx >= 0 && dy >= 0) {\n return atan;\n }\n // 4象限,顺时针正好\n return -atan;\n}\n\nfunction rotate(theta) {\n let sin = Math.sin(theta);\n let cos = Math.cos(theta);\n let t = matrix.identity();\n t[0] = t[5] = cos;\n t[1] = sin;\n t[4] = -sin;\n return t;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param points\n */\nfunction pointIndex(points) {\n let [x1, y1, x2, y2, x3, y3] = points;\n let index = [0, 1, 2];\n // 将a点放入最左\n if(x2 < x1 && x2 < x3) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n index[0] = 1;\n index[1] = 0;\n }\n else if(x3 < x2 && x3 < x1) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n index[0] = 2;\n index[2] = 0;\n }\n // 有可能出现2个并列的情况,判断取上面那个\n if(x1 === x2) {\n if(y1 > y2) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n let t = index[0];\n index[0] = index[1];\n index[1] = t;\n }\n }\n else if(x1 === x3) {\n if(y1 > y3) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n let t = index[0];\n index[0] = index[2];\n index[2] = t;\n }\n }\n // ab到ac要顺时针旋转,即2个向量夹角为正,用向量叉乘判断正负\n let cross = (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1);\n if(cross < 0) {\n [x2, y2, x3, y3] = [x3, y3, x2, y2];\n let t = index[1];\n index[1] = index[2];\n index[2] = t;\n }\n return [x1, y1, x2, y2, x3, y3, index];\n}\n\n/**\n * 第2个点根据第一个点的交换顺序交换\n * @param points\n * @param index\n * @returns {[]}\n */\nfunction pointByIndex(points, index) {\n let res = [];\n for(let i = 0, len = index.length; i < len; i++) {\n let j = index[i];\n res.push(points[j * 2]);\n res.push(points[j * 2 + 1]);\n }\n return res;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param source 源3个点\n * @param target 目标3个点\n * @returns 交换顺序后的点坐标\n */\nfunction exchangeOrder(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3, index] = pointIndex(source);\n let [tx1, ty1, tx2, ty2, tx3, ty3] = pointByIndex(target, index);\n return [\n [sx1, sy1, sx2, sy2, sx3, sy3],\n [tx1, ty1, tx2, ty2, tx3, ty3]\n ];\n}\n\n/**\n * 存在一种情况,变换结果使得三角形镜像相反了,即顶点a越过bc线,判断是否溢出\n * @param source\n * @param target\n * @returns {boolean}是否溢出\n */\nfunction isOverflow(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n let cross1 = (sx2 - sx1) * (sy3 - sy1) - (sx3 - sx1) * (sy2 - sy1);\n let cross2 = (tx2 - tx1) * (ty3 - ty1) - (tx3 - tx1) * (ty2 - ty1);\n return cross1 > 0 && cross2 < 0 || cross1 < 0 && cross2 > 0;\n}\n\nfunction transform(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n // 记录翻转\n let overflow = isOverflow(source, target);\n // 第0步,将源三角第1个a点移到原点\n let m = matrix.identity();\n m[12] = -sx1;\n m[13] = -sy1;\n let t;\n // 第1步,以第1条边ab为基准,将其贴合x轴上,为后续倾斜不干扰做准备\n let theta = calDeg(sx1, sy1, sx2, sy2);\n if(theta !== 0) {\n t = rotate(-theta);\n m = matrix.multiply(t, m);\n }\n // 第2步,以第1条边AB为基准,缩放x轴ab至目标相同长度,可与4步合并\n let ls = geom.pointsDistance(sx1, sy1, sx2, sy2);\n let lt = geom.pointsDistance(tx1, ty1, tx2, ty2);\n // if(ls !== lt) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[0] = scale;\n // m = matrix.multiply(t, m);\n // }\n // 第3步,缩放y,先将目标三角形旋转到x轴平行,再变换坐标计算\n let n = matrix.identity();\n n[12] = -tx1;\n n[13] = -ty1;\n theta = calDeg(tx1, ty1, tx2, ty2);\n // 记录下这个旋转角度,后面源三角形要反向旋转\n let alpha = theta;\n if(theta !== 0) {\n t = rotate(-theta);\n n = matrix.multiply(t, n);\n }\n // 目标三角反向旋转至x轴后的坐标\n // 源三角目前的第3点坐标y值即为长度,因为a点在原点0无需减去\n let ls2 = Math.abs(matrix.calPoint([sx3, sy3], m)[1]);\n let lt2 = Math.abs(matrix.calPoint([tx3, ty3], n)[1]);\n // 缩放y\n // if(ls2 !== lt2) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[3] = scale;\n // m = matrix.multiply(t, m);\n // }\n if(ls !== lt || ls2 !== lt2) {\n t = matrix.identity();\n if(ls !== lt) {\n t[0] = lt / ls;\n }\n if(ls2 !== lt2) {\n t[5] = lt2 / ls2;\n }\n m = matrix.multiply(t, m);\n }\n // 第4步,x轴倾斜,用余弦定理求目前a和A的夹角\n n = m;\n let [ax1, ay1] = matrix.calPoint([sx1, sy1], n);\n let [ax2, ay2] = matrix.calPoint([sx2, sy2], n);\n let [ax3, ay3] = matrix.calPoint([sx3, sy3], n);\n let ab = geom.pointsDistance(ax1, ay1, ax2, ay2);\n let ac = geom.pointsDistance(ax1, ay1, ax3, ay3);\n let bc = geom.pointsDistance(ax3, ay3, ax2, ay2);\n let AB = geom.pointsDistance(tx1, ty1, tx2, ty2);\n let AC = geom.pointsDistance(tx1, ty1, tx3, ty3);\n let BC = geom.pointsDistance(tx3, ty3, tx2, ty2);\n let a = geom.angleBySide(bc, ab, ac);\n let A = geom.angleBySide(BC, AB, AC);\n // 先至90°,再旋转至目标角,可以合并成tan相加,不知道为什么不能直接tan倾斜差值角度\n if(a !== A) {\n t = matrix.identity();\n t[4] = Math.tan(a - Math.PI * 0.5) + Math.tan(Math.PI * 0.5 - A);\n m = matrix.multiply(t, m);\n }\n // 发生翻转时特殊处理按x轴垂直翻转\n if(overflow) {\n m[1] = -m[1];\n m[5] = -m[5];\n m[13] = -m[13];\n }\n // 第5步,再次旋转,角度为目标旋转到x轴的负值,可与下步合并\n if(alpha !== 0) {\n t = rotate(alpha);\n // m = matrix.multiply(t, m);\n }\n else {\n t = matrix.identity();\n }\n // 第6步,移动第一个点的差值\n // t = matrix.identity();\n t[12] = tx1;\n t[13] = ty1;\n return matrix.multiply(t, m);\n}\n\nexport default {\n exchangeOrder,\n isOverflow,\n transform,\n};\n","/**\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 } = unit;\nconst { matrix, geom } = math;\nconst { identity, multiply, isE } = matrix;\nconst { d2r } = geom;\n\nfunction calSingle(t, k, v) {\n if(k === TRANSLATE_X) {\n t[12] = v;\n }\n else if(k === TRANSLATE_Y) {\n t[13] = v;\n }\n else if(k === TRANSLATE_Z) {\n t[14] = v;\n }\n else if(k === SCALE_X) {\n t[0] = v;\n }\n else if(k === SCALE_Y) {\n t[5] = v;\n }\n else if(k === SCALE_Z) {\n t[10] = v;\n }\n else if(k === SKEW_X) {\n v = d2r(v);\n t[4] = Math.tan(v);\n }\n else if(k === SKEW_Y) {\n v = d2r(v);\n t[1] = Math.tan(v);\n }\n else if(k === ROTATE_X) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[5] = t[10] = cos;\n t[6] = sin;\n t[9] = -sin;\n }\n else if(k === ROTATE_Y) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[10] = cos;\n t[8] = sin;\n t[2] = -sin;\n }\n else if(k === ROTATE_Z) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[5] = cos;\n t[1] = sin;\n t[4] = -sin;\n }\n else if(k === ROTATE_3D) {\n let [x, y, z, r] = v;\n r = d2r(r[0]);\n let s = Math.sin(r);\n let c = Math.cos(r);\n if(x && !y && !z) {\n if(x < 0) {\n s = -s;\n }\n t[5] = c;\n t[9] = -s;\n t[6] = s;\n t[10] = c;\n }\n else if(y && !x && !z) {\n if(y < 0) {\n s = -s;\n }\n t[0] = c;\n t[8] = s;\n t[2] = -s;\n t[10] = c;\n }\n else if(z && !x && !y) {\n if(z < 0) {\n s = -s;\n }\n t[0] = c;\n t[4] = -s;\n t[1] = s;\n t[5] = c;\n }\n else {\n let len = Math.sqrt(x * x + y * y + z * z);\n if(len !== 1) {\n let rlen = 1 / len;\n x *= rlen;\n y *= rlen;\n z *= rlen;\n }\n let nc = 1 - c;\n let xy = x * y;\n let yz = y * z;\n let zx = z * x;\n let xs = x * s;\n let ys = y * s;\n let zs = z * s;\n\n t[0] = x * x * nc + c;\n t[1] = xy * nc + zs;\n t[2] = zx * nc - ys;\n t[3] = 0;\n\n t[4] = xy * nc - zs;\n t[5] = y * y * nc + c;\n t[6] = yz * nc + xs;\n t[7] = 0;\n\n t[8] = zx * nc + ys;\n t[9] = yz * nc - xs;\n t[10] = z * z * nc + c;\n t[11] = 0;\n\n t[12] = 0;\n t[13] = 0;\n t[14] = 0;\n t[15] = 1;\n }\n }\n else if(k === PERSPECTIVE && v > 0) {\n v = Math.max(v, 1);\n t[11] = -1 / v;\n }\n else if(k === MATRIX) {\n util.assignMatrix(t, v);\n }\n}\n\nfunction calMatrix(transform, ow, oh, root) {\n let list = normalize(transform, ow, oh, root);\n let m = identity();\n list.forEach(item => {\n let [k, v] = item;\n let t = identity();\n calSingle(t, k, v);\n m = multiply(m, t);\n });\n return m;\n}\n\n// 已有计算好的变换矩阵,根据tfo原点计算最终的matrix\nfunction calMatrixByOrigin(m, transformOrigin) {\n let [ox, oy] = transformOrigin;\n let res = m.slice(0);\n if(ox === 0 && oy === 0 || isE(m)) {\n return res;\n }\n res = multiply([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ox, oy, 0, 1], res);\n res = multiply(res, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -ox, -oy, 0, 1]);\n return res;\n}\n\n// img缩放svg下专用,无rem\nfunction calMatrixWithOrigin(transform, transformOrigin, ow, oh) {\n let m = calMatrix(transform, ow, oh);\n return calMatrixByOrigin(m, transformOrigin);\n}\n\nfunction normalizeSingle(k, v, ow, oh, root) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n if(v[1] === PERCENT) {\n return v[0] * ow * 0.01;\n }\n else if(v[1] === REM) {\n return v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n return v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n return v[0] * root.height * 0.01;\n }\n }\n else if(k === TRANSLATE_Y) {\n if(v[1] === PERCENT) {\n return v[0] * oh * 0.01;\n }\n else if(v[1] === REM) {\n return v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n return v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n return v[0] * root.height * 0.01;\n }\n }\n else if(k === MATRIX) {\n return v;\n }\n else if(k === ROTATE_3D) {\n return v;\n }\n return v[0];\n}\n\nfunction normalize(transform, ow, oh, root) {\n let res = [];\n transform.forEach(item => {\n let [k, v] = item;\n res.push([k, normalizeSingle(k, v, ow, oh, root)]);\n });\n return res;\n}\n\nfunction calOrigin(transformOrigin, w, h, root) {\n let tfo = [];\n transformOrigin.forEach((item, i) => {\n if(item[1] === PX) {\n tfo.push(item[0]);\n }\n else if(item[1] === PERCENT) {\n tfo.push(item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n tfo.push(item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n tfo.push(item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n tfo.push(item[0] * root.height * 0.01);\n }\n });\n return tfo;\n}\n\nfunction calMatrixByPerspective(m, pm) {\n if(!isE(pm)) {\n m = multiply(pm, m);\n }\n return m;\n}\n\nfunction calPerspectiveMatrix(ppt, po) {\n if(ppt && ppt > 0) {\n let res = identity();\n ppt = Math.max(ppt, 1);\n res[11] = -1 / ppt;\n let [ox, oy] = po;\n if(ox || oy) {\n res = multiply([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ox, oy, 0, 1], res);\n res = multiply(res, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -ox, -oy, 0, 1]);\n }\n return res;\n }\n}\n\n// 是否有透视矩阵应用\nfunction isPerspectiveMatrix(m) {\n if(!m) {\n return;\n }\n return !!(m[3] || m[7] || m[11]);\n}\n\nexport default {\n calMatrix,\n calOrigin,\n calMatrixByPerspective,\n calPerspectiveMatrix,\n calMatrixByOrigin,\n calMatrixWithOrigin,\n isPerspectiveMatrix,\n};\n","/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据模糊参数sigma求卷积核尺寸\n * @param sigma\n * @returns {number}\n */\nfunction kernelSize(sigma) {\n if(sigma <= 0) {\n return 0;\n }\n let d = Math.floor(sigma * 3 * Math.sqrt(2 * Math.PI) / 4 + 0.5);\n if(d < 2) {\n d = 2;\n }\n if(d % 2 === 0) {\n d++;\n }\n return d;\n}\n\n/**\n * 根据sigma求模糊扩展尺寸,卷积核求得后为d,再求半径/2,然后因为算法要执行3次,所以*3\n * 比如本来d为5,半径2.5算上自身像素点则各方向扩展2,*3则扩展6\n * @param sigma\n * @returns {number}\n */\nfunction outerSize(sigma) {\n let d = kernelSize(sigma);\n return outerSizeByD(d);\n}\n\nfunction outerSizeByD(d) {\n return Math.floor(d * 0.5) * 3;\n}\n\n/**\n * 一维高斯正态分布,根据标准差和卷积核尺寸返回一维权重数组\n * @param sigma\n * @param d\n */\nfunction gaussianWeight(sigma, d) {\n let list = [];\n let len = Math.floor(d * 0.5);\n let total = 0;\n for(let i = len; i >= 0; i--) {\n let n = Math.pow(Math.E, -Math.pow(i, 2) / (2 * Math.pow(sigma, 2)))\n / (sigma * Math.sqrt(2 * Math.PI));\n list.push(n);\n total += n;\n }\n for(let i = 1; i <= len; i++) {\n let n = Math.pow(Math.E, -Math.pow(i, 2) / (2 * Math.pow(sigma, 2)))\n / (sigma * Math.sqrt(2 * Math.PI));\n list.push(n);\n total += n;\n }\n if(total !== 1) {\n for(let i = 0; i < d; i++) {\n list[i] /= total;\n }\n }\n return list;\n}\n\nexport default {\n kernelSize,\n outerSize,\n outerSizeByD,\n gaussianWeight,\n};\n","import Page from './Page';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport enums from '../util/enums';\nimport painter from '../util/painter';\nimport debug from '../util/debug';\nimport tf from '../style/transform';\nimport mx from '../math/matrix';\nimport blur from '../math/blur';\n\nconst {\n STYLE_KEY: {\n TRANSFORM_ORIGIN,\n TRANSFORM,\n DISPLAY,\n VISIBILITY,\n },\n NODE_KEY: {\n NODE_OPACITY,\n NODE_CACHE_TOTAL,\n NODE_CACHE_FILTER,\n NODE_CACHE_OVERFLOW,\n NODE_HAS_CONTENT,\n NODE_COMPUTED_STYLE,\n },\n} = enums;\n\n// 根据一个共享cache的信息,生成一个独立的离屏canvas,一般是filter,mask用\nfunction genSingle(cache, message) {\n let { size, sx1, sy1, width, height, bbox } = cache;\n let offscreen = inject.getCacheCanvas(width, height, null, message);\n offscreen.x = 0;\n offscreen.y = 0;\n offscreen.bbox = bbox;\n offscreen.size = size;\n offscreen.sx1 = sx1;\n offscreen.sy1 = sy1;\n offscreen.dx = cache.dx;\n offscreen.dy = cache.dy;\n offscreen.dbx = cache.dbx;\n offscreen.dby = cache.dby;\n offscreen.width = width;\n offscreen.height = height;\n return offscreen;\n}\n\nclass Cache {\n constructor(w, h, bbox, page, pos, x1, y1) {\n this.__init(w, h, bbox, page, pos, x1, y1);\n }\n\n __init(w, h, bbox, page, pos, x1, y1) {\n this.__width = w;\n this.__height = h;\n this.__bbox = bbox;\n this.__page = page;\n this.__pos = pos;\n let [x, y] = page.getCoords(pos);\n this.__x = x;\n this.__y = y;\n this.__appendData(x1, y1);\n 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 },\n NODE_KEY: {\n NODE_CACHE,\n NODE_LIMIT_CACHE,\n NODE_DOM_PARENT,\n NODE_MATRIX_EVENT,\n NODE_OPACITY,\n NODE_VIRTUAL_DOM,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_MEASURE,\n UPDATE_FOCUS,\n UPDATE_CONFIG,\n },\n} = enums;\n\nconst ELLIPSIS = textCache.ELLIPSIS;\nconst { AUTO, REM, VW, VH } = unit;\n\nclass Text extends Node {\n constructor(content) {\n super();\n this.__content = util.isNil(content) ? '' : content.toString();\n this.__textBoxes = [];\n this.__charWidthList = [];\n this.__charWidth = 0;\n this.__textWidth = 0;\n }\n\n /**\n * 预先计算每个字的宽度,在每次布局渲染前做\n * @param renderMode\n * @param ctx\n * @private\n */\n __computeMeasure(renderMode, ctx) {\n let { content, computedStyle, charWidthList } = this;\n // 每次都要清空重新计算,计算会有缓存\n charWidthList.splice(0);\n let ffs = computedStyle[FONT_FAMILY].split(',');\n let ff = 'arial';\n for(let i = 0, len = ffs.length; i < len; i++) {\n if(inject.checkSupportFontFamily(ffs[i])) {\n ff = ffs[i];\n break;\n }\n }\n this.__ff = ff;\n let fs = computedStyle[FONT_SIZE];\n let fw = computedStyle[FONT_WEIGHT];\n let key = this.__key = computedStyle[FONT_SIZE] + ',' + ff + ',' + fw;\n let wait = textCache.data[key] = textCache.data[key] || {\n ff,\n fs,\n fw,\n hash: {},\n s: '',\n };\n let cache = textCache.charWidth[key] = textCache.charWidth[key] || {};\n let sum = 0;\n let needMeasure = false;\n // text-overflow:ellipse需要,即便没有也要先测量,其基于最近非inline父节点的字体\n let bp = this.domParent;\n while(bp.currentStyle[DISPLAY] === 'inline') {\n bp = bp.domParent;\n }\n this.__bp = bp;\n let parentComputedStyle = bp.computedStyle;\n let pff = 'arial';\n for(let i = 0, pffs = parentComputedStyle[FONT_FAMILY].split(','), len = pffs.length; i < len; i++) {\n if(inject.checkSupportFontFamily(pffs[i])) {\n ff = ffs[i];\n break;\n }\n }\n let pfs = parentComputedStyle[FONT_SIZE];\n let pfw = parentComputedStyle[FONT_WEIGHT];\n let pKey = this.__pKey = pfs + ',' + pff + ',' + pfw;\n let parentCache = textCache.charWidth[pKey] = textCache.charWidth[pKey] || {};\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(renderMode === mode.WEBGL) {\n ctx = inject.getCacheCanvas(16, 16, '__$$CHECK_SUPPORT_FONT_FAMILY$$__').ctx;\n }\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n ctx.font = css.setFontStyle(parentComputedStyle);\n parentCache[ELLIPSIS] = ctx.measureText(ELLIPSIS).width;\n }\n ctx.font = css.setFontStyle(computedStyle);\n }\n else if(renderMode === mode.SVG) {\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n parentCache[ELLIPSIS] = 0;\n let wait = textCache.data[pKey] = textCache.data[pKey] || {\n ff: pff,\n fs: pfs,\n fw: pfw,\n hash: {},\n s: '',\n };\n wait.s += ELLIPSIS;\n needMeasure = true;\n }\n }\n // 逐字测量,canvas可瞬间得到信息,svg先预存统一进行\n for(let i = 0, length = content.length; i < length; i++) {\n let char = content.charAt(i);\n let mw;\n if(cache.hasOwnProperty(char)) {\n mw = cache[char];\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n mw = cache[char] = ctx.measureText(char).width;\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else {\n if(!wait.hash.hasOwnProperty(char)) {\n wait.s += char;\n }\n wait.hash[char] = true;\n // 先预存标识位-1,测量完后替换它\n charWidthList.push(-1);\n needMeasure = true;\n }\n }\n this.__textWidth = sum;\n if(needMeasure) {\n textCache.list.push(this);\n }\n }\n\n __measureCb() {\n let { content, charWidthList } = this;\n let key = this.__key;\n let cache = textCache.charWidth[key];\n let sum = 0;\n for(let i = 0, len = charWidthList.length; i < len; i++) {\n if(charWidthList[i] < 0) {\n let mw = charWidthList[i] = cache[content.charAt(i)];\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n }\n this.__textWidth = sum;\n }\n\n /**\n * text在virtual时和普通一样,无需特殊处理\n * endSpace由外界inline布局控制,末尾最后一行的空白mpb,包含递归情况,递归为多个嵌套末尾节点的空白mpb之和\n * 即便宽度不足,每行还是强制渲染一个字符,换行依据lx开始,因为x可能是从中间开始的,非inline则两个相等\n * 最后一个字符排版时要考虑末尾mpb,排不下的话回退删掉这个字符,如果最后一个字符另起开头,排不下也强制排,每行至少1个字符\n * 在textOverflow时很特殊,多个inline同行,回退可能到前一个inline节点,这个通过x和lx判断是否行首,决定至少1个字符规则\n * @param data\n * @private\n */\n __layout(data) {\n let __cache = this.__config[NODE_CACHE];\n if(__cache) {\n __cache.release();\n }\n let { x, y, w, lx = x, lineBoxManager, endSpace = 0, lineClamp = 0, lineClampCount = 0 } = data;\n this.__x = this.__sx1 = x;\n this.__y = this.__sy1 = y;\n let { isDestroyed, content, currentStyle, computedStyle, textBoxes, charWidthList, root, __ff, __key } = this;\n textBoxes.splice(0);\n let __config = this.__config;\n __config[NODE_LIMIT_CACHE] = false;\n // 空内容w/h都为0可以提前跳出\n if(isDestroyed || currentStyle[DISPLAY] === 'none' || !content) {\n return lineClampCount;\n }\n this.__ox = this.__oy = 0;\n // 顺序尝试分割字符串为TextBox,形成多行,begin为每行起始索引,i是当前字符索引\n let begin = 0;\n let i = 0;\n let beginSpace = x - lx; // x>=lx,当第一行非起始处时前面被prev节点占据,这个差值可认为是count宽度\n let count = beginSpace;\n let length = content.length;\n let maxW = 0;\n let {\n [LINE_HEIGHT]: lineHeight,\n [LETTER_SPACING]: letterSpacing,\n [WHITE_SPACE]: whiteSpace,\n [FONT_SIZE]: fontSize,\n [FONT_WEIGHT]: fontWeight,\n } = computedStyle;\n // 特殊字体中特殊字符连续时需减少一定的padding量\n let padding = font.info[__ff].padding;\n let needReduce = !!padding;\n let lastChar;\n let ew = textCache.charWidth[this.__pKey][ELLIPSIS];\n let lineCount = 0;\n // 不换行特殊对待,同时考虑overflow和textOverflow\n if(whiteSpace === 'nowrap') {\n let isTextOverflow;\n // block的overflow:hidden和textOverflow:clip/ellipsis才生效,inline要看最近非inline父元素\n let bp = this.__bp;\n let {\n [DISPLAY]: display,\n [OVERFLOW]: overflow,\n [WIDTH]: width,\n [TEXT_OVERFLOW]: textOverflow,\n } = bp.currentStyle;\n // 只要是overflow隐藏,不管textOverflow如何(默认是clip等同于overflow:hidden的功能)都截取\n if(overflow === 'hidden') {\n while(i < length) {\n count += charWidthList[i] + letterSpacing;\n if(count > w) {\n // block/flex无需宽度,inline-block需要设置宽度才生效\n if(display === 'block' || display === 'flex') {\n isTextOverflow = true;\n }\n else if(width[1] !== AUTO) {\n isTextOverflow = true;\n }\n break;\n }\n i++;\n }\n }\n else {\n while(i < length) {\n count += charWidthList[i++] + letterSpacing;\n }\n }\n // ellipsis生效情况,本节点开始向前回退查找,尝试放下一部分字符\n if(isTextOverflow && textOverflow === 'ellipsis') {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n }\n // 默认clip跟随overflow:hidden,无需感知\n else {\n let textBox = new TextBox(this, textBoxes.length, x, y, count - beginSpace, lineHeight,\n content, charWidthList);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n maxW = count - beginSpace;\n y += lineHeight;\n }\n }\n // 普通换行,注意x和lx的区别,可能相同(block起始处)可能不同(非起始处),第1行从x开始,第2行及以后都从lx开始\n // 然后第一次换行还有特殊之处,可能同一行前半部行高很大,此时y增加并非自身的lineHeight,而是整体LineBox的\n else {\n while(i < length) {\n let cw = charWidthList[i] + letterSpacing;\n count += cw;\n // 连续字符减少padding,除了连续还需判断char是否在padding的hash中\n if(needReduce) {\n let char = content[i];\n if(char === lastChar && padding.hasOwnProperty(char) && padding[char]) {\n let hasCache, p = textCache.padding[__key] = textCache.padding[__key] || {};\n if(textCache.padding.hasOwnProperty(__key)) {\n if(p.hasOwnProperty(char)) {\n hasCache = true;\n count -= p[char];\n }\n }\n if(!hasCache) {\n let n = 0;\n if(root.renderMode === mode.CANVAS) {\n root.ctx.font = css.setFontStyle(computedStyle);\n let w1 = root.ctx.measureText(char).width;\n let w2 = root.ctx.measureText(char + char).width;\n n = w1 * 2 - w2;\n n *= padding[char];\n }\n else if(root.renderMode === mode.SVG) {\n n = inject.measureTextSync(__key, __ff, fontSize, fontWeight, char);\n n *= padding[char];\n }\n count -= n;\n p[char] = n;\n }\n }\n lastChar = char;\n }\n // 忽略零宽字符\n if(cw === 0) {\n i++;\n continue;\n }\n // 换行都要判断i不是0的时候,第1个字符强制不换行\n if(count === w) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n let textBox;\n // 特殊情况,恰好最后一行最后一个排满,此时查看末尾mpb,要防止i为0的情况首个字符特殊不回退,无需看开头mpb\n if(i === length - 1 && count > w - endSpace && i) {\n count -= charWidthList[i--];\n }\n i++;\n if(!lineCount) {\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, count);\n }\n // 必须先添加再设置y,当有diff的lineHeight时,第一个换行不影响,再换行时第2个换行即第3行会被第1行影响\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null; // 换行后连续字符reduce不生效重新计数\n }\n // 奇怪的精度问题,暂时不用相等判断,而是为原本w宽度加一点点冗余1e-10\n else if(count > w + (1e-10)) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n // 普通非多行文本阶段逻辑\n let width;\n // 宽度不足时无法跳出循环,至少也要塞个字符形成一行,无需判断第1行,因为是否放得下逻辑在dom中做过了,\n // 如果第1行放不下,一定会另起一行,此时作为开头再放不下才会进这里,这个if只有0或1个字符的情况\n if(i <= begin) {\n width = count;\n }\n // 超过2个字符回退1个\n else {\n width = count - charWidthList[i--];\n }\n i++;\n // 根据是否第一行分开处理行首空白\n let textBox;\n if(!lineCount) {\n maxW = width - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, width);\n }\n // 必须先添加再设置y,同上\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null;\n }\n else {\n i++;\n }\n }\n // 换行后Text的x重设为lx\n if(lineCount) {\n this.__x = this.__sx1 = lx;\n }\n // 最后一行,只有一行未满时也进这里,需查看末尾mpb,排不下回退一个字符\n // 声明了lineClamp时特殊考虑,这里一定是最后一行,要对比行数不能超过,超过忽略掉这些文本\n if(begin < length && (!lineClamp || lineCount + lineClampCount < lineClamp)) {\n let textBox;\n if(!lineCount) {\n let needBack;\n // 防止开头第一个begin=0时回退,这在inline有padding且是第一个child时会发生\n if(begin && count > w - endSpace) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n else {\n let needBack;\n // 防止begin在结尾时回退,必须要有个字符,这在最后一行1个字符排不下时会出现\n if(count > w - endSpace && begin < length - 1) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n maxW = Math.max(maxW, count);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n }\n }\n this.__width = maxW;\n this.__height = y - data.y;\n this.__baseLine = css.getBaseLine(computedStyle);\n return lineCount;\n }\n\n // 末尾行因ellipsis的缘故向前回退字符生成textBox,可能会因不满足宽度导致无法生成,此时向前继续回退TextBox\n __lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount, lineHeight, lx, x, y, maxW,\n textBoxes, content, charWidthList, lineBoxManager) {\n for(; i >= begin; i--) {\n count -= charWidthList[i] + letterSpacing;\n if(count + ew + endSpace <= w) {\n // 至少1个字符不用回退,到0也没找到需要回退\n if(i) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n break;\n }\n }\n }\n // 最后也没找到,看是否要查找前一个inline节点,还是本身是行首兜底首字母\n if(i < 0) {\n let lineBox = lineBoxManager.lineBox;\n // lineBox为空是行首,至少放1个字符\n if(!lineBox.size) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.charAt(begin), charWidthList.slice(begin, begin + 1));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n }\n // 向前查找inline节点,可能会有前面inline嵌套,因此直接用lineBox,不会出现inlineBlock,\n // 这里和css不同,ib强制超限换行不会同行\n else {\n let list = lineBox.list;\n outer:\n for(let j = list.length - 1; j >= 0; j--) {\n let tb = list[j];\n let { content, wList, width } = tb;\n // 整体减去可以说明可能在这个tb中,只要最后发现不是空文本节点就行,否则继续;第0个强制进入保证1字符\n if(count - width + ew <= w || !j) {\n // 找到可以跳出outer循环,找不到继续,注意第0个且1个字符判断\n for(let k = wList.length - 1; k >= 0; k--) {\n if(!k && !j || count + ew <= w) {\n tb.__content = content;\n tb.__width = width;\n tb.parent.__ellipsis = true;\n break outer;\n }\n else {\n let w2 = wList[k];\n tb.__endY -= w2;\n width -= w2;\n content = content.slice(0, k);\n count -= w2;\n wList.pop();\n }\n }\n }\n // 不够则看前一个tb并且删掉这个\n else {\n count -= width;\n }\n list.pop();\n tb.parent.textBoxes.pop();\n }\n }\n }\n return [y, maxW];\n }\n\n __offsetX(diff, isLayout) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetX(diff);\n });\n }\n this.__sx1 += diff;\n }\n\n __offsetY(diff, isLayout) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetY(diff);\n });\n }\n this.__sy1 += diff;\n }\n\n __tryLayInline(w) {\n return w - this.charWidthList[0];\n }\n\n __inlineSize() {\n let minX, maxX;\n this.textBoxes.forEach((item, i) => {\n if(i) {\n minX = Math.min(minX, item.x);\n maxX = Math.max(maxX, item.x + item.width);\n }\n else {\n minX = item.x;\n maxX = item.x + item.width;\n }\n });\n this.__x = minX;\n this.__sx = this.__sx1 = minX + this.ox;console.log(22222)\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] * 0.5, half);\n }\n else if(textStrokeWidth[1] === VW) {\n half = Math.max(textStrokeWidth[0] * root.width * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VH) {\n half = Math.max(textStrokeWidth[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(textStrokeWidth[0] * 0.5, half);\n }\n half += 1;\n return [sx - half, sy - half, sx + width + half, sy + height + half];\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get matrix() {\n return this.domParent.matrix;\n }\n\n get matrixEvent() {\n return this.domParent.matrixEvent;\n }\n}\n\nText.prototype.__renderByMask = Text.prototype.render;\n\nexport default Text;\n","import util from './util';\nimport $$type from './$$type';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\n/**\n * 2. 打平children中的数组,变成一维\n * 3. 合并相连的Text节点,即string内容\n */\nfunction flattenJson(parent) {\n if(Array.isArray(parent)) {\n return parent.map(item => flattenJson(item));\n }\n else if(!parent || [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) {\n return parent;\n }\n let list = [];\n traverseJson(list, parent.children, {\n lastText: null,\n });\n parent.children = list;\n return parent;\n}\n\nfunction traverseJson(list, children, options) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n traverseJson(list, item, options);\n });\n }\n else if(children && (children.$$type === TYPE_VD || children.$$type === TYPE_GM)) {\n if(['canvas', 'svg', 'webgl'].indexOf(children.tagName) > -1) {\n throw new Error('Can not nest canvas/svg/webgl');\n }\n if(children.$$type === TYPE_VD) {\n flattenJson(children);\n }\n list.push(children);\n options.lastText = null;\n }\n else if(children && children.$$type === TYPE_CP) {\n list.push(children);\n // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做\n options.lastText = null;\n }\n // 排除掉空的文本,连续的text合并\n else if(!util.isNil(children) && children !== '') {\n if(options.lastText !== null) {\n list[list.length - 1] = options.lastText += children;\n }\n else {\n list.push(children);\n }\n }\n}\n\nexport default flattenJson;\n","import Text from '../node/Text';\nimport util from './util';\nimport $$type from './$$type';\nimport enums from './enums';\nimport flatten from './flatten';\n\nconst { NODE_KEY: {\n NODE_DOM_PARENT,\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n} } = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nfunction initRoot(cd, root) {\n let c = flatten({\n tagName: root.tagName,\n props: {},\n children: cd,\n $$type: TYPE_VD,\n });\n root.__json = c;\n root.__host = root;\n let children = build(c.children, root, root);\n return relation(root, children);\n}\n\nfunction initDom(json, root, host, parent) {\n let vd = build(json, root, host);\n return relation(parent, vd);\n}\n\nfunction initCp(json, root, host) {\n if(util.isObject(json)) {\n // cp的flatten在__init中自己做\n return build(json, root, host);\n }\n // text的relation会由上层如Root设置\n else {\n return new Text(json);\n }\n}\n\nfunction initCp2(json, root, host, parent) {\n let vd = new json.klass(json.props);\n vd.__tagName = json.tagName || vd.__tagName;\n vd.__root = root;\n vd.__host = host;\n vd.__json = json;\n vd.__init();\n return relation(parent, vd);\n}\n\n/**\n * 将初始json文件生成virtualDom\n * @param json\n * @param root\n * @param host\n * @param hasP 出现过p标签\n * @returns vd\n */\nfunction build(json, root, host, hasP) {\n if(Array.isArray(json)) {\n return json.map(item => build(item, root, host, hasP));\n }\n let vd;\n if(util.isObject(json) && json.$$type) {\n let { tagName, props, children, klass, $$type, __inheritAnimate, __animateRecords } = json;\n // 更新过程中无变化的cp直接使用原来生成的\n if($$type === TYPE_CP && json.__placeholder) {\n return json.__placeholder;\n }\n if($$type === TYPE_VD) {\n if(tagName === 'img') {\n vd = new Img(tagName, props);\n if(Array.isArray(children) && children.length) {\n throw new Error('Img can not contain children');\n }\n }\n else {\n vd = new Dom(tagName, props);\n }\n // 检查p不能包含div\n if(tagName === 'p') {\n hasP = true;\n }\n else if(tagName === 'div' && hasP) {\n throw new Error('Markup p can not contain div');\n }\n if(Array.isArray(children)) {\n children = relation(vd, build(children, root, host, hasP));\n }\n else {\n children = [];\n }\n vd.__children = children;\n }\n else if($$type === TYPE_GM) {\n let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\n }\n else if($$type === TYPE_CP) {\n vd = new klass(props);\n vd.__tagName = tagName || vd.__tagName;\n }\n else {\n return new Text(json);\n }\n // 根parse需要用到真正的vd引用,然后vd也要引用json,用以做domApi\n json.vd = vd;\n vd.__json = json;\n // 递归parse中的动画记录需特殊处理,将target改为真正的vd引用\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n __animateRecords.list.forEach(item => {\n item.target = item.target.vd;\n });\n delete json.__animateRecords;\n }\n // 更新过程中key相同或者普通相同的vd继承动画\n if(__inheritAnimate) {\n util.extendAnimate(__inheritAnimate, vd);\n delete json.__inheritAnimate;\n }\n vd.__root = root;\n vd.__host = host;\n if($$type === TYPE_CP) {\n vd.__init();\n }\n let ref = props.ref;\n if(util.isString(ref) && ref || util.isNumber(ref)) {\n host.ref[ref] = vd;\n }\n else if(util.isFunction(ref)) {\n ref(vd);\n }\n return vd;\n }\n return new Text(json);\n}\n\n/**\n * 设置关系,父子和兄弟\n * @param parent\n * @param children\n * @param options\n * @returns {Xom|Text|Component}\n */\nfunction relation(parent, children, options = {}) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n relation(parent, item, options);\n });\n }\n else if(children instanceof Xom || children instanceof Component || children instanceof Text) {\n children.__parent = parent;\n children.__domParent = parent;\n // 极为恶心,为了v8的性能优化,text复用parent的__config部分,但domParent重设\n if(children instanceof Text) {\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n if(children.__config) {\n children.__config[NODE_DOM_PARENT] = parent;\n }\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n // 文字视作为父节点的直接文字子节点\n if(children instanceof Component) {\n let sr = children.shadowRoot;\n if(sr instanceof Text) {\n sr.__parent = parent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n sr.__domParent = parent;\n if(sr.__config) {\n sr.__config[NODE_DOM_PARENT] = parent;\n }\n }\n }\n return children;\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n initRoot,\n initDom,\n initCp,\n initCp2,\n relation,\n};\n","import util from './util';\n\nconst { isFunction } = util;\n\nclass Event {\n constructor() {\n this.__eHash = {};\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.on(id[i], handle);\n }\n }\n else {\n if(!self.__eHash.hasOwnProperty(id)) {\n self.__eHash[id] = [];\n }\n // 遍历防止此handle被侦听过了\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n if(item[i] === handle) {\n return self;\n }\n }\n self.__eHash[id].push(handle);\n }\n return self;\n }\n\n once(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n function cb(...data) {\n handle.apply(self, data);\n self.off(id, cb);\n }\n\n cb.__karasEventCb = handle;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.once(id[i], handle);\n }\n }\n else if(handle) {\n self.on(id, cb);\n }\n return this;\n }\n\n off(id, handle) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.off(id[i], handle);\n }\n }\n else if(self.__eHash.hasOwnProperty(id)) {\n if(handle) {\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n // 需考虑once包裹的引用对比\n if(item[i] === handle || item[i].__karasEventCb === handle) {\n item.splice(i, 1);\n break;\n }\n }\n }\n // 未定义为全部清除\n else {\n delete self.__eHash[id];\n }\n }\n return this;\n }\n\n emit(id, ...data) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.emit(id[i], data);\n }\n }\n else {\n if(self.__eHash.hasOwnProperty(id)) {\n let list = self.__eHash[id];\n if(list.length) {\n list = list.slice();\n for(let i = 0, len = list.length; i < len; i++) {\n let cb = list[i];\n if(isFunction(cb)) {\n cb.apply(self, data);\n }\n }\n }\n }\n }\n return this;\n }\n\n static mix(...obj) {\n for(let i = obj.length - 1; i >= 0; i--) {\n let o = obj[i];\n let event = new Event();\n o.__eHash = {};\n let fns = ['on', 'once', 'off', 'emit'];\n for(let j = fns.length - 1; j >= 0; j--) {\n let fn = fns[j];\n o[fn] = event[fn];\n }\n }\n }\n\n static REFRESH = 'refresh';\n static PAUSE = 'pause';\n static PLAY = 'play';\n static FRAME = 'frame';\n static FINISH = 'finish';\n static CANCEL = 'cancel';\n static BEGIN = 'begin';\n static END = 'end';\n}\n\nexport default Event;\n","import Node from './Node';\nimport Text from './Text';\nimport builder from '../util/builder';\nimport Event from '../util/Event';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport flatten from '../util/flatten';\nimport css from '../style/css';\nimport change from '../refresh/change';\n\nconst { isNil, isFunction, clone, extend } = util;\n\nconst REGISTER = {};\n\n/**\n * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归\n * 在check时树递归会用到,判断是否需要查找cp更新\n * @param cp\n */\nfunction setUpdateFlag(cp) {\n // 去重\n if(cp.__hasUpdate) {\n return;\n }\n cp.__hasUpdate = true;\n let host = cp.host;\n if(host) {\n setUpdateFlag(host);\n }\n}\n\nclass Component extends Event {\n constructor(props = {}) {\n super();\n this.__tagName = /(?:function|class)\\s+([\\w$]+)/.exec(this.constructor.toString())[1];\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__parent = null;\n this.__host = null;\n this.__ref = {};\n this.state = {};\n this.__isMounted = false;\n this.__taskList = [];\n }\n\n setState(n, cb) {\n let self = this;\n if(isNil(n)) {\n n = {};\n }\n else if(isFunction(n)) {\n return;\n }\n else {\n if(Object.keys(n).length === 0) {\n if(isFunction(cb)) {\n cb.call(self);\n }\n return;\n }\n let state = clone(self.state);\n n = extend(state, n);\n }\n let root = self.root;\n if(root && self.__isMounted) {\n // 一帧之内多次调用,需合并\n if(self.__nextState) {\n Object.assign(self.__nextState, n);\n self.__taskList.push(cb);\n }\n else {\n self.__nextState = n;\n self.__taskList = [cb];\n // 回调更新列表,before执行时splice出来供after执行,防止中途产生的后续setState干扰\n let list = [];\n let t = self.__task = {\n __before: () => {\n list = self.__taskList.splice(0);\n // 标识更新\n setUpdateFlag(this);\n },\n __after: () => {\n // self.__nextState = null; 由updater.js每次refresh前同步执行清空,这里不能异步清除,否则frame动画会乱序\n list.forEach(cb => {\n if(isFunction(cb)) {\n cb.call(self);\n }\n });\n },\n };\n root.addRefreshCp(t);\n }\n }\n // 构造函数中调用还未render,\n else if(isFunction(cb)) {\n self.state = n;\n cb.call(self);\n }\n }\n\n /**\n * build中调用初始化,json有值时是update过程才有,且处理过flatten\n * @param json\n * @private\n */\n __init(json) {\n this.__ref = {};\n let root = this.root;\n let cd = json || flatten(this.render());\n let sr = builder.initCp(cd, root, this);\n this.__cd = cd;\n if(sr instanceof Text) {\n // 文字视作为父节点的直接文字子节点,在builder里做\n }\n else if(sr instanceof Node) {\n let style = css.normalize(this.props.style);\n let keys = Object.keys(style);\n extend(sr.style, style, keys);\n extend(sr.currentStyle, style, keys);\n // 事件添加到sr\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n });\n }\n else if(!(sr instanceof Component)) {\n // 本身build是递归的,子cp已经初始化了\n throw new Error('Component render() must return a dom/text: ' + this);\n }\n // 自定义事件无视返回强制添加\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n k = k.slice(3);\n this.on(k, v);\n }\n });\n // shadow指向直接renderRoot,shadowRoot考虑到返回Component的递归即hoc高阶组件\n // host是直接所属,hostRoot同考虑到高阶组件\n this.__shadow = sr;\n sr.__host = this;\n // 递归下去,多层级时执行顺序由里到外,最终会被最上层执行替换\n while(sr instanceof Component) {\n sr.__hostRoot = this;\n sr.shadow.__host = sr;\n sr = sr.shadow;\n }\n this.__shadowRoot = sr;\n sr.__hostRoot = this;\n if(!this.__isMounted) {\n this.__isMounted = true;\n if(isFunction(this.componentDidMount)) {\n root.once(Event.REFRESH, () => {\n this.componentDidMount();\n });\n }\n }\n }\n\n render() {\n inject.warn('Component must implement render()');\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.__isDestroyed = true;\n this.__isMounted = false;\n if(isFunction(this.componentWillUnmount)) {\n this.componentWillUnmount();\n }\n this.root.delRefreshTask(this.__task);\n if(this.shadowRoot) {\n this.shadowRoot.__destroy();\n }\n this.__parent = null;\n }\n\n __emitEvent(e, force) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n return;\n }\n let res = sr.__emitEvent(e, force);\n if(res) {\n e.target = this;\n return true;\n }\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get shadow() {\n return this.__shadow;\n }\n\n get shadowRoot() {\n return this.__shadowRoot;\n }\n\n get root() {\n return this.__root;\n }\n\n get host() {\n return this.__host;\n }\n\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n get state() {\n return this.__state;\n }\n\n set state(v) {\n this.__state = v;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)) {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Component has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)\n || !obj.prototype || !(obj.prototype instanceof Component)) {\n throw new Error('Invalid param: Component register');\n }\n if(Component.hasRegister(name)) {\n throw new Error(`Component has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Component.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nObject.keys(change.GEOM).concat([\n 'x',\n 'y',\n 'ox',\n 'oy',\n 'sx',\n 'sy',\n // '__sx1',\n // '__sx2',\n // '__sx3',\n // '__sx4',\n // '__sx5',\n // '__sx6',\n // '__sy1',\n // '__sy2',\n // '__sy3',\n // '__sy4',\n // '__sy5',\n // '__sy6',\n 'width',\n 'height',\n 'outerWidth',\n 'outerHeight',\n 'clientWidth',\n 'clientHeight',\n 'offsetWidth',\n 'offsetHeight',\n 'style',\n 'animationList',\n 'animateStyle',\n 'currentStyle',\n 'computedStyle',\n 'currentProps',\n 'baseLine',\n 'virtualDom',\n 'mask',\n 'maskId',\n 'textWidth',\n 'content',\n 'lineBoxes',\n 'charWidthList',\n 'charWidth',\n '__layoutData',\n 'availableAnimating',\n 'effectiveAnimating',\n 'displayAnimating',\n 'visibilityAnimating',\n 'bbox',\n '__config',\n 'contentBoxList',\n 'listener',\n 'matrix',\n 'matrixEvent',\n]).forEach(fn => {\n Object.defineProperty(Component.prototype, fn, {\n get() {\n let sr = this.shadowRoot;\n if(sr) {\n return sr[fn];\n }\n },\n });\n});\n\n[\n '__layout',\n '__layoutAbs',\n '__layoutNone',\n '__tryLayInline',\n '__offsetX',\n '__offsetY',\n '__calAutoBasis',\n '__calMp',\n '__calAbs',\n '__renderAsMask',\n '__renderByMask',\n '__mp',\n 'animate',\n 'removeAnimate',\n 'clearAnimate',\n 'updateStyle',\n 'getBoundingClientRect',\n 'getComputedStyle',\n '__deepScan',\n 'clearCache',\n '__structure',\n '__modifyStruct',\n '__updateStruct',\n 'flowChildren',\n 'absChildren',\n '__isRealInline',\n '__calBasis',\n '__calMinMax',\n '__computeMeasure',\n 'appendChild',\n 'prependChild',\n 'insertBefore',\n 'insertAfter',\n 'removeChild',\n 'remove',\n].forEach(fn => {\n Component.prototype[fn] = function() {\n let sr = this.shadowRoot;\n if(sr && isFunction(sr[fn])) {\n return sr[fn].apply(sr, arguments);\n }\n };\n});\n\nexport default Component;\n","import unit from './unit';\nimport transform from './transform';\nimport enums from '../util/enums';\n\nconst { STYLE_KEY: { SCALE_X, SCALE_Y } } = enums;\nconst { PERCENT, NUMBER } = unit;\n\nfunction matrixResize(imgWidth, imgHeight, targetWidth, targetHeight, x, y, w, h) {\n if(imgWidth === targetWidth && imgHeight === targetHeight) {\n return;\n }\n let list = [\n [SCALE_X, [targetWidth / imgWidth, NUMBER]],\n [SCALE_Y, [targetHeight / imgHeight, NUMBER]],\n ];\n let tfo = transform.calOrigin([[0, PERCENT], [0, PERCENT]], w, h);\n tfo[0] += x;\n tfo[1] += y;\n return transform.calMatrixWithOrigin(list, tfo, w, h);\n}\n\nexport default {\n matrixResize,\n};\n","import border from './border';\nimport transform from './transform';\nimport mx from '../math/matrix';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\nimport unit from './unit';\nimport enums from '../util/enums';\nimport image from './image';\n\nconst {\n STYLE_KEY: {\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\nconst { clone, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { AUTO, PX, PERCENT, STRING, REM, VW, VH } = unit;\n\nfunction renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bbrr, bblr,\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] === AUTO) {\n res.push(-1);\n }\n else if(item[1] === STRING) {\n res.push(item[0] === 'contain' ? -2 : -3);\n }\n });\n return res;\n}\n\nfunction calBackgroundPosition(position, container, size, root) {\n if(Array.isArray(position)) {\n if(position[1] === PX) {\n return position[0];\n }\n else if(position[1] === PERCENT) {\n return (container - size) * position[0] * 0.01;\n }\n else if(position[1] === REM) {\n return position[0] * root.computedStyle[FONT_SIZE];\n }\n else if(position[1] === VW) {\n return position[0] * root.width * 0.01;\n }\n else if(position[1] === VH) {\n return position[0] * root.height * 0.01;\n }\n }\n return 0;\n}\n\nfunction renderImage(xom, renderMode, ctx, loadBgi,\n bx1, by1, bx2, by2, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, isInline,\n 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_FRAME_CB,\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_CAL_DIFF_TIME,\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, calUnit } = unit;\nconst { isNil, isFunction, isNumber, isObject, isString, clone, equalArr } = util;\nconst { linear } = easing;\nconst { cloneStyle } = css;\nconst { isGeom, GEOM } = change;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nconst NUM_CAL_HASH = {\n};\nObject.assign(NUM_CAL_HASH, LENGTH_HASH);\nObject.assign(NUM_CAL_HASH, EXPAND_HASH);\n\nfunction unify(frames, target) {\n let hash = {};\n let keys = [];\n // 获取所有关键帧的属性\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n Object.keys(style).forEach(k => {\n let v = style[k];\n // 未定义的过滤掉,null空有意义\n if(v !== undefined && !hash.hasOwnProperty(k)) {\n hash[k] = true;\n // geom为属性字符串,style都为枚举int\n if(!GEOM.hasOwnProperty(k)) {\n k = parseInt(k);\n }\n // path动画要转为translateXY,所以手动添加,使2帧之间存在过渡,有可能之前已存在这个动画,可忽视\n if(k === TRANSLATE_PATH) {\n if(!hash.hasOwnProperty(TRANSLATE_X)) {\n keys.push(TRANSLATE_X);\n }\n if(!hash.hasOwnProperty(TRANSLATE_Y)) {\n keys.push(TRANSLATE_Y);\n }\n hash[TRANSLATE_X] = hash[TRANSLATE_Y] = true;\n }\n keys.push(k);\n }\n });\n });\n // 添补没有声明完全的关键帧属性为节点当前值\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n keys.forEach(k => {\n if(!style.hasOwnProperty(k) || isNil(style[k])) {\n if(GEOM.hasOwnProperty(k)) {\n style[k] = target.getProps(k);\n }\n else {\n style[k] = target.currentStyle[k];\n }\n }\n });\n });\n return keys;\n}\n\n// 每次初始化时处理继承值,以及转换transform为单matrix矩阵\nfunction inherit(frames, keys, target) {\n let computedStyle = target.computedStyle;\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n keys.forEach(k => {\n let v = style[k];\n // geom的属性可能在帧中没有\n if(isNil(v)) {\n return;\n }\n if(k === TRANSFORM) {\n let ow = target.outerWidth;\n let oh = target.outerHeight;\n let m = tf.calMatrix(v, ow, oh);\n style[k] = [[MATRIX, m]];\n }\n else if(v[1] === INHERIT) {\n if(k === COLOR || k === TEXT_STROKE_COLOR) {\n style[k] = [util.rgba2int(computedStyle[k]), RGBA];\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n style[k] = [computedStyle[k], PX];\n }\n else if(k === FONT_WEIGHT) {\n style[k] = [computedStyle[k], NUMBER];\n }\n else if(k === FONT_STYLE || k === FONT_FAMILY || k === TEXT_ALIGN || k === TEXT_STROKE_OVER) {\n style[k] = [computedStyle[k], STRING];\n }\n }\n });\n });\n}\n\n/**\n * 通知root更新当前动画,需要根据frame的状态来决定是否是同步插入\n * 在异步时,因为动画本身是异步,需要addRefreshTask\n * 而如果此时frame在执行before过程中,说明帧动画本身是在before计算的,需要同步插入\n * @param style\n * @param keys 样式所有的key\n * @param __config\n * @param root\n * @param node\n */\nfunction genBeforeRefresh(style, keys, __config, root, node) {\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = keys;\n res[UPDATE_CONFIG] = __config[I_NODE_CONFIG];\n root.__addUpdate(node, __config[I_NODE_CONFIG], root, __config[I_ROOT_CONFIG], res);\n __config[I_STYLE] = style;\n __config[I_ASSIGNING] = true;\n // frame每帧回调时,下方先执行计算好变更的样式,这里特殊插入一个hook,让root增加一个刷新操作\n // 多个动画调用因为相同root也只会插入一个,这样在所有动画执行完毕后frame里检查同步进行刷新,解决单异步问题\n root.__frameHook();\n}\n\n/**\n * 将每帧的样式格式化,提取出offset属性并转化为时间,提取出缓动曲线easing\n * @param style 关键帧样式\n * @param duration 动画时间长度\n * @param es options的easing曲线控制,frame没有自定义则使用全局的\n * @returns {{style: *, time: number, easing: *, transition: []}}\n */\nfunction framing(style, duration, es) {\n let { offset, easing } = style;\n // 这两个特殊值提出来存储不干扰style\n delete style.offset;\n delete style.easing;\n // translatePath特殊对待,ae的曲线运动动画\n let translatePath = style.translatePath;\n style = css.normalize(style);\n if(Array.isArray(translatePath) && [6, 8].indexOf(translatePath.length) > -1) {\n style[TRANSLATE_PATH] = translatePath.map(item => calUnit(item));\n }\n let res = [];\n res[FRAME_STYLE] = style;\n res[FRAME_TIME] = offset * duration;\n res[FRAME_EASING] = easing || es;\n res[FRAME_TRANSITION] = [];\n return res;\n}\n\nfunction calByUnit(p, n, container, root) {\n if(p[1] === PX) {\n if(n[1] === PERCENT) {\n return n[0] * 0.01 * container - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width * 0.01 - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height * 0.01 - p[0];\n }\n }\n else if(p[1] === PERCENT) {\n if(n[1] === PX) {\n return n[0] * 100 / container - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * root.computedStyle[FONT_SIZE] * 100 / container - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / container - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / container - p[0];\n }\n }\n else if(p[1] === REM) {\n if(n[1] === PX) {\n return n[0] / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * 0.01 * container / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n }\n else if(p[1] === VW) {\n if(n[1] === PX) {\n return n[0] * 100 / root.width - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / root.width - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / root.width - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / root.width - p[0];\n }\n }\n else if(p[1] === VH) {\n if(n[1] === PX) {\n return n[0] * 100 / root.height - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / root.height - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / root.height - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / root.height - p[0];\n }\n }\n}\n\n/**\n * 计算两帧之间的差,单位不同的以后面为准,返回的v表示差值\n * 没有变化返回空\n * auto等无法比较的不参与计算,不返回来标识无过度效果\n * @param prev 上一帧样式\n * @param next 下一帧样式\n * @param k 比较的样式名\n * @param target dom对象\n * @param tagName dom名\n * @returns {{k: *, v: *}}\n */\nfunction calDiff(prev, next, k, target, tagName) {\n let res = [k];\n let p = prev[k];\n let n = next[k];\n if(k === TRANSFORM) {\n // transform因默认值null很特殊,不存在时需给默认矩阵\n if(!p && !n) {\n return;\n }\n let pm, nm;\n if(p) {\n pm = p[0][1];\n }\n else {\n pm = mx.identity();\n }\n if(n) {\n nm = n[0][1];\n }\n else {\n nm = mx.identity();\n }\n // transform特殊被初始化转成matrix矩阵,直接计算差值\n if(equalArr(pm, nm)) {\n return;\n }\n res[1] = [\n nm[0] - pm[0],\n nm[1] - pm[1],\n nm[2] - pm[2],\n nm[3] - pm[3],\n nm[4] - pm[4],\n nm[5] - pm[5],\n nm[6] - pm[6],\n nm[7] - pm[7],\n nm[8] - pm[8],\n nm[9] - pm[9],\n nm[10] - pm[10],\n nm[11] - pm[11],\n nm[12] - pm[12],\n nm[13] - pm[13],\n nm[14] - pm[14],\n nm[15] - pm[15],\n ];\n return res;\n }\n else if(k === ROTATE_3D) {\n if(equalArr(p, n)) {\n return;\n }\n res[1] = [n[0] - n[0], n[1] - p[1], n[2] - p[2], [n[3][0] - p[3][0], n[3][1]]];\n }\n else if(k === FILTER) {\n // filter很特殊,里面有多个滤镜,忽视顺序按hash计算,为空视为默认值,如blur默认0,brightness默认1\n let pHash = {}, nHash = {}, keyHash = {};\n if(p) {\n p.forEach(item => {\n keyHash[item[0]] = true;\n pHash[item[0]] = item[1];\n });\n }\n if(n) {\n n.forEach(item => {\n keyHash[item[0]] = true;\n nHash[item[0]] = item[1];\n })\n }\n let v = {}, hasChange;\n // 只有blur支持px/rem/vw/vh,其余都是特殊固定单位\n Object.keys(keyHash).forEach(k => {\n if(k === 'blur') {\n if(!pHash[k]) {\n v[k] = nHash[k].slice(0);\n hasChange = true;\n }\n else if(!nHash[k]) {\n v[k] = [-pHash[k][0], pHash[k][1]];\n hasChange = true;\n }\n else {\n let v2 = calByUnit(pHash[k], nHash[k], 0, target.root);\n v[k] = [v2, pHash[k][1]];\n hasChange = true;\n }\n }\n else if(k === 'hue-rotate') {\n let nv = isNil(nHash[k]) ? 0 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 0 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'contrast') {\n let nv = isNil(nHash[k]) ? 100 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 100 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n else if(k === 'grayscale') {\n let nv = isNil(nHash[k]) ? 0 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 0 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n });\n if(!hasChange) {\n return;\n }\n res[1] = v;\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n res[1] = [];\n for(let i = 0; i < 2; i++) {\n let pi = p[i];\n let ni = n[i];\n if(pi[1] === ni[1]) {\n res[1].push(ni[0] - pi[0]);\n }\n else {\n let v = calByUnit(pi, ni, target[i ? 'outerHeight' : 'outerWidth'], target.root);\n res[1].push(v || 0);\n }\n }\n if(equalArr(res[1], [0, 0])) {\n return;\n }\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n res[1] = [];\n let length = Math.min(p.length, n.length);\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni) {\n res[1].push(null);\n continue;\n }\n if(pi[1] === ni[1]) {\n let v = ni[0] - pi[0];\n if(!v) {\n res[1].push(null);\n return;\n }\n res[1].push(v);\n }\n else {\n let k2 = k === BACKGROUND_POSITION_X ? 'offsetWidth' : 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = k === BACKGROUND_POSITION_X ? 'clientWidth' : 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = k === BACKGROUND_POSITION_X ? 'width' : 'height';\n }\n let v = calByUnit(pi, ni, target[k2], target.root);\n if(!v) {\n res[1].push(null);\n return;\n }\n res[1].push(v);\n }\n }\n }\n else if(k === BOX_SHADOW) {\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let a = p[i];\n let b = n[i];\n let v = [];\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n v.push(b[j] - a[j]);\n }\n // rgba\n let c = [];\n for(let j = 0; j < 4; j++) {\n c.push(b[4][j] - a[4][j]);\n }\n v.push(c);\n res[1].push(v);\n }\n }\n else if(EXPAND_HASH.hasOwnProperty(k)) {\n if(p[1] === n[1]) {\n let v = n[0] - p[0];\n if(v === 0) {\n return;\n }\n res[1] = v;\n }\n else {\n let v = calByUnit(p, n, target[k === TRANSLATE_X || k === TRANSLATE_Z ? 'outerWidth' : 'outerHeight'], target.root);\n if(!v) {\n return;\n }\n res[1] = v;\n }\n }\n else if(k === BACKGROUND_SIZE) {\n res[1] = [];\n let length = Math.min(p.length, n.length);\n let has;\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni) {\n res[1].push(null);\n continue;\n }\n let temp = [];\n for(let j = 0; j < 2; j++) {\n let pp = pi[j], nn = ni[j];\n if(pp[1] === nn[1]) {\n temp.push(nn[0] - pp[0]);\n }\n else {\n let k2 = i ? 'offsetWidth' : 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = i ? 'clientWidth' : 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = i ? 'width' : 'height';\n }\n let v = calByUnit(pp, nn, target[k2], target.root);\n temp.push(v || 0);\n }\n }\n if(equalArr(temp, [0, 0])) {\n res[1].push(null);\n }\n else {\n res[1].push(temp);\n has = true;\n }\n }\n if(!has) {\n return;\n }\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n // backgroundImage发生了渐变色和图片的变化,fill发生渐变色和纯色的变化等\n res[1] = [];\n let length = Math.min(p.length, n.length);\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni || isString(pi) || isString(ni)) {\n res[1].push(null);\n continue;\n }\n if(pi.k !== ni.k) {\n res[1].push(null);\n continue;\n }\n let temp = [];\n // 渐变\n if(pi.k === 'linear' || pi.k === 'radial' || pi.k === 'conic') {\n let pv = pi.v;\n let nv = ni.v;\n temp[0] = [];\n let { clientWidth } = target;\n let eq = equalArr(pv, nv);\n for(let i = 0, len = Math.min(pv.length, nv.length); i < len; i++) {\n let a = pv[i];\n let b = nv[i];\n let t = [];\n t.push([\n b[0][0] - a[0][0],\n b[0][1] - a[0][1],\n b[0][2] - a[0][2],\n b[0][3] - a[0][3],\n ]);\n if(a[1] && b[1]) {\n if(a[1][1] === b[1][1]) {\n t.push(b[1][0] - a[1][0]);\n }\n else {\n let v = calByUnit(a[1], b[1], clientWidth, target.root);\n t.push(v || 0);\n }\n }\n temp[0].push(t);\n }\n // 线性渐变有角度差值变化\n if(pi.k === 'linear') {\n let isArrP = Array.isArray(pi.d);\n let isArrN = Array.isArray(ni.d);\n if(isArrN !== isArrP) {\n res[1].push(null);\n continue;\n }\n if(isArrP) {\n let v = [ni.d[0] - pi.d[0], ni.d[1] - pi.d[1], ni.d[2] - pi.d[2], ni.d[3] - pi.d[3]];\n if(eq && equalArr(v, [0, 0, 0, 0])) {\n res[1].push(null);\n continue;\n }\n temp[1] = v;\n }\n else {\n let v = ni.d - pi.d;\n if(eq && v === 0) {\n res[1].push(null);\n continue;\n }\n temp[1] = v;\n }\n }\n // 径向渐变的位置\n else if(pi.k === 'radial') {\n let isArrP = Array.isArray(pi.z);\n let isArrN = Array.isArray(ni.z);\n if(isArrN !== isArrP) {\n res[1].push(null);\n continue;\n }\n if(isArrP) {\n temp[2] = [];\n for(let i = 0; i < 5; i++) {\n let pz = pi.z[i];\n // 半径比例省略为1\n if(pz === undefined) {\n pz = 1;\n }\n let nz = ni.z[i];\n if(nz === undefined) {\n nz = 1;\n }\n temp[2].push(nz - pz);\n }\n if(eq && equalArr(res[4], [0, 0, 0, 0, 0])) {\n res[1].push(null);\n }\n }\n else {\n temp[2] = [];\n for(let i = 0; i < 2; i++) {\n let pp = pi.p[i];\n let np = ni.p[i];\n if(pp[1] === np[1]) {\n temp[2].push(np[0] - pp[0]);\n }\n else {\n let v = calByUnit(pp, np, target[i ? 'clientWidth' : 'clientHeight'], target.root);\n temp[2].push(v || 0);\n }\n }\n if(eq && equalArr(res[3], [0, 0])) {\n res[1].push(null);\n }\n }\n }\n else if(pi.k === 'conic') {\n temp[1].push(n.d - p.d);\n temp[2] = [];\n for(let i = 0; i < 2; i++) {\n let pp = p.p[i];\n let np = n.p[i];\n if(pp[1] === np[1]) {\n temp[2].push(np[0] - pp[0]);\n }\n else {\n let v = calByUnit(pp, np, target[i ? 'clientWidth' : 'clientHeight'], target.root);\n temp[2].push(v || 0);\n }\n }\n if(eq && res[2] !== 0 && equalArr(res[3], [0, 0])) {\n res[1].push(null);\n }\n }\n }\n // 纯色\n else {\n if(equalArr(n, pi)) {\n res[1].push(null);\n }\n temp[0] = [\n ni[0] - pi[0],\n ni[1] - pi[1],\n ni[2] - pi[2],\n ni[3] - pi[3]\n ];\n }\n res[1].push(temp);\n }\n }\n else if(COLOR_HASH.hasOwnProperty(k)) {\n n = n[0];\n p = p[0];\n if(equalArr(n, p) || n[3] === 0 && p[3] === 0) {\n return;\n }\n res[1] = [\n n[0] - p[0],\n n[1] - p[1],\n n[2] - p[2],\n n[3] - p[3]\n ];\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n // x/y都相等无需\n if(n[0][0] === p[0][0] && n[0][1] === p[0][1]\n && n[1][0] === p[1][0] && n[1][1] === p[1][1]) {\n return;\n }\n res[1] = [];\n for(let i = 0; i < 2; i++) {\n if(n[i][1] === p[i][1]) {\n res[1].push(n[i][0] - p[i][0]);\n }\n else {\n let v = calByUnit(p[i], n[i], target[i ? 'outerHeight' : 'outerWidth'], target.root);\n res[1].push(v || 0);\n }\n }\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n // auto不做动画\n if(p[1] === AUTO || n[1] === AUTO) {\n return;\n }\n let computedStyle = target.computedStyle;\n let parentComputedStyle = (target.domParent || target).computedStyle;\n let diff = 0;\n if(p[1] === n[1]) {\n diff = n[0] - p[0];\n }\n // lineHeight奇怪的单位变化,%相对于fontSize\n else if(k === LINE_HEIGHT) {\n diff = calByUnit(p, n, computedStyle[FONT_SIZE], target.root);\n }\n // fontSize的%相对于parent的\n else if(k === FONT_SIZE) {\n diff = calByUnit(p, n, parentComputedStyle[FONT_SIZE], target.root);\n }\n // 相对于父height的特殊属性\n else if(k === FLEX_BASIS\n && ['column', 'column-reverse', 'columnReverse'].indexOf(computedStyle[FLEX_DIRECTION]) > -1\n || [HEIGHT, TOP, BOTTOM].indexOf(k) > -1) {\n if(p[1] !== AUTO && n[1] !== AUTO) {\n diff = calByUnit(p, n, parentComputedStyle[HEIGHT], target.root);\n }\n }\n // 其余都是相对于父width的\n else {\n if(p[1] !== AUTO && n[1] !== AUTO) {\n diff = calByUnit(p, n, parentComputedStyle[WIDTH], target.root);\n }\n }\n // 兜底NaN非法\n if(diff === 0 || isNaN(diff)) {\n return;\n }\n res[1] = diff;\n }\n else if(GEOM.hasOwnProperty(k)) {\n if(isNil(p)) {\n return;\n }\n else if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calDiff)) {\n let fn = GEOM[k][tagName].calDiff;\n if(target.isMulti) {\n let arr = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n arr.push(fn(p[i], n[i]));\n }\n return arr;\n }\n else {\n res[1] = fn(p, n);\n }\n }\n // 特殊处理multi\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.min(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(null);\n }\n else {\n let v3 = [];\n for(let k = 0, len3 = Math.max(pv2.length, nv2.length); k < len3; k++) {\n let pv3 = pv2[k];\n let nv3 = nv2[k];\n // control由4点变2点\n if(isNil(pv3) || isNil(nv3)) {\n v3.push(0);\n }\n else {\n v3.push(nv3 - pv3);\n }\n }\n v2.push(v3);\n }\n }\n res[1].push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n res[1].push([\n nv[0] - pv[0],\n nv[1] - pv[1],\n ]);\n }\n }\n }\n else {\n if(n === p || equalArr(n, p) || k === 'edge' || k === 'closure' || 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 {\n return [parseFloat(v) || 0, PX];\n }\n });\n }\n // display等不能有增量过程的\n else {\n return;\n }\n return res;\n}\n\n// 计算两帧之间不相同的变化,存入transition,相同的忽略\nfunction calFrame(prev, next, keys, target, tagName) {\n keys.forEach(k => {\n let ts = calDiff(prev[FRAME_STYLE], next[FRAME_STYLE], k, target, tagName);\n // 可以形成过渡的才会产生结果返回\n if(ts) {\n prev[FRAME_TRANSITION].push(ts);\n }\n });\n return next;\n}\n\nfunction binarySearch(i, j, time, frames) {\n if(i === j) {\n let frame = frames[i];\n if(frame[FRAME_TIME] > time) {\n return i - 1;\n }\n return i;\n }\n else {\n let middle = i + ((j - i) >> 1);\n let frame = frames[middle];\n if(frame[FRAME_TIME] === time) {\n return middle;\n }\n else if(frame[FRAME_TIME] > time) {\n return binarySearch(i, Math.max(middle - 1, i), time, frames);\n }\n else {\n return binarySearch(Math.min(middle + 1, j), j, time, frames);\n }\n }\n}\n\nfunction getEasing(ea) {\n let timingFunction;\n if(ea) {\n if((timingFunction = /^\\s*steps\\s*\\(\\s*(\\d+)(?:\\s*,\\s*(\\w+))?\\s*\\)/i.exec(ea))) {\n let steps = parseInt(timingFunction[1]);\n let stepsD = timingFunction[2];\n timingFunction = function(percent) {\n // steps有效定义正整数\n if(steps && steps > 0) {\n let per = 1 / steps;\n let n = stepsD === 'start' ? Math.ceil(percent / per) : Math.floor(percent / per);\n return n / steps;\n }\n return percent;\n };\n }\n else {\n timingFunction = easing.getEasing(ea);\n }\n }\n return timingFunction;\n}\n\n/**\n * 根据百分比和缓动函数计算中间态样式\n * 当easing定义为steps时,优先计算\n * @param frame 当前帧\n * @param keys 所有样式key\n * @param percent 到下一帧时间的百分比\n * @param target vd\n * @returns {*}\n */\nfunction calIntermediateStyle(frame, keys, percent, target) {\n let style = cloneStyle(frame[FRAME_STYLE], keys);\n let timingFunction = getEasing(frame[FRAME_EASING]);\n if(timingFunction && timingFunction !== linear) {\n percent = timingFunction(percent);\n }\n let transition = frame[FRAME_TRANSITION];\n for(let i = 0, len = transition.length; i < len; i++) {\n let [k, v] = transition[i];\n let st = style[k];\n // transform特殊处理,只有1个matrix,有可能不存在,需给默认矩阵\n if(k === TRANSFORM) {\n if(!st) {\n st = style[k] = [[MATRIX, mx.identity()]];\n }\n for(let i = 0; i < 16; i++) {\n st[0][1][i] += v[i] * percent;\n }\n }\n // 特殊的曲线运动计算,转换为translateXY,出现在最后一定会覆盖原本的translate防重\n else if(k === TRANSLATE_PATH) {\n let t = 1 - percent;\n if(v.length === 8) {\n style[TRANSLATE_X] = [\n v[0][0] * t * t * t\n + 3 * v[2][0] * percent * t * t\n + 3 * v[4][0] * percent * percent * t\n + v[6][0] * percent * percent * percent,\n PX,\n ];\n style[TRANSLATE_Y] = [\n v[1][0] * t * t * t\n + 3 * v[3][0] * percent * t * t\n + 3 * v[5][0] * percent * percent * t\n + v[7][0] * percent * percent * percent,\n PX,\n ];\n }\n else if(v.length === 6) {\n style[TRANSLATE_X] = [\n v[0][0] * t * t\n + 2 * v[2][0] * percent * t\n + v[4][0] * percent * percent,\n PX,\n ];\n style[TRANSLATE_Y] = [\n v[1][0] * t * t\n + 3 * v[3][0] * percent * t\n + v[5][0] * percent * percent,\n PX,\n ];\n }\n }\n else if(k === ROTATE_3D) {\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3][0] += v[3][0] * percent;\n }\n else if(NUM_CAL_HASH.hasOwnProperty(k)) {\n if(v) {\n st[0] += v * percent;\n }\n }\n else if(k === FILTER) {\n // 只有1个样式声明了filter另外一个为空,会造成无样式,需初始化数组并在下面计算出样式存入\n if(!st) {\n st = style[k] = [];\n }\n // 将已有的样式按key存入引用来操作\n let hash = {};\n st.forEach(item => {\n hash[item[0]] = item[1];\n });\n Object.keys(v).forEach(k => {\n if(hash.hasOwnProperty(k)) {\n hash[k][0] += v[k][0] * percent;\n }\n else {\n // 2个关键帧中有1个未声明,需新建样式存入\n if(k === 'blur' || k === 'hue-rotate' || k === 'grayscale') {\n let n = v[k].slice(0);\n n[0] *= percent;\n st.push([k, n]);\n }\n // 默认值是1而非0\n else if(k === 'saturate' || k === 'brightness' || k === 'contrast') {\n let n = v[k].slice(0);\n n[0] = 100 + n[0] * percent;\n st.push([k, n]);\n }\n }\n });\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n for(let i = 0; i < 2; i++) {\n st[i][0] += v[i] * percent;\n }\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n if(v[0] !== 0) {\n st[0][0] += v[0] * percent;\n }\n if(v[1] !== 0) {\n st[1][0] += v[1] * percent;\n }\n }\n else if(k === BOX_SHADOW) {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n st[i][j] += v[i][j] * percent;\n }\n // rgba\n for(let j = 0; j < 4; j++) {\n st[i][4][j] += v[i][4][j] * percent;\n }\n }\n }\n else if(k === BACKGROUND_SIZE) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0][0] += v[i][0] * percent;\n item[1][0] += v[i][1] * percent;\n }\n });\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0] += v[i] * percent;\n }\n });\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n st.forEach((st2, i) => {\n let v2 = v[i];\n if(!v2) {\n return;\n }\n let [c, d, p, z] = v2;\n if(GRADIENT_TYPE.hasOwnProperty(st2.k)) {\n for(let i = 0, len = Math.min(st2.v.length, c.length); i < len; i++) {\n let a = st2.v[i];\n let b = c[i];\n a[0][0] += b[0][0] * percent;\n a[0][1] += b[0][1] * percent;\n a[0][2] += b[0][2] * percent;\n a[0][3] += b[0][3] * percent;\n if(a[1] && b[1]) {\n a[1][0] += b[1] * percent;\n }\n }\n if(st2.k === 'linear' && st2.d !== undefined && d !== undefined) {\n if(Array.isArray(d)) {\n st2.d[0] += d[0] * percent;\n st2.d[1] += d[1] * percent;\n st2.d[2] += d[2] * percent;\n st2.d[3] += d[3] * percent;\n }\n else {\n st2.d += d * percent;\n }\n }\n if(st2.k === 'radial') {\n if(st2.z !== undefined && z !== undefined) {\n st2.z[0] += z[0] * percent;\n st2.z[1] += z[1] * percent;\n st2.z[2] += z[2] * percent;\n st2.z[3] += z[3] * percent;\n st2.z[4] += z[4] * percent;\n }\n else if(st2.p !== undefined && p !== undefined) {\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n else if(st2.k === 'conic' && st2.d !== undefined && d !== undefined) {\n st2.d += d * percent;\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n // fill纯色\n else {\n st2[0] += c[0] * percent;\n st2[1] += c[1] * percent;\n st2[2] += c[2] * percent;\n st2[3] += c[3] * percent;\n }\n });\n }\n // color可能超限[0,255],但浏览器已经做了限制,无需关心\n else if(COLOR_HASH.hasOwnProperty(k)) {\n st = st[0];\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n else if(GEOM.hasOwnProperty(k)) {\n let st = style[k];\n let tagName = target.tagName;\n if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calIncrease)) {\n let fn = GEOM[k][tagName].calIncrease;\n if(target.isMulti) {\n style[k] = st.map((item, i) => {\n return fn(item, v[i], percent);\n });\n }\n else {\n style[k] = fn(st, v, percent);\n }\n }\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n let o2 = o[j];\n let n2 = n[j];\n if(!isNil(o2) && !isNil(n2)) {\n for(let k = 0, len3 = Math.min(o2.length, n2.length); k < len3; k++) {\n if(!isNil(o2[k]) && !isNil(n2[k])) {\n o2[k] += n2[k] * percent;\n }\n }\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n v.forEach((item, i) => {\n let st2 = st[i];\n if(!isNil(item) && !isNil(st2)) {\n for(let i = 0, len = Math.min(st2.length, item.length); i < len; i++) {\n let o = st2[i];\n let n = item[i];\n if(!isNil(o) && !isNil(n)) {\n st2[i] += n * percent;\n }\n }\n }\n });\n }\n else {\n v.forEach((item, i) => {\n if(!isNil(item) && !isNil(st[i])) {\n st[i] += item * percent;\n }\n });\n }\n }\n else {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n if(!isNil(o[j]) && !isNil(n[j])) {\n o[j] += n[j] * percent;\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(!isNil(st[0]) && !isNil(v[0])) {\n st[0] += v[0] * percent;\n }\n if(!isNil(st[1]) && !isNil(v[1])) {\n st[1] += v[1] * percent;\n }\n }\n else {\n if(!isNil(st) && !isNil(v)) {\n style[k] += v * percent;\n }\n }\n }\n }\n else if(k === OPACITY || k === Z_INDEX) {\n style[k] += v * percent;\n // 精度问题可能会超过[0,1]区间\n if(k === OPACITY) {\n if(style[k] < 0) {\n style[k] = 0;\n }\n else if(style[k] > 1) {\n style[k] = 1;\n }\n }\n }\n }\n return style;\n}\n\nfunction gotoOverload(options, cb) {\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n return [options || {}, cb];\n}\n\nlet uuid = 0;\n\nclass Animation extends Event {\n constructor(target, list, options) {\n super();\n this.__id = uuid++;\n list = clone(list || []);\n if(Array.isArray(list)) {\n list = list.filter(item => item && isObject(item));\n }\n // 动画过程另外一种形式,object描述k-v形式\n else if(list && isObject(list)) {\n let nl = [];\n Object.keys(list).forEach(k => {\n let v = list[k];\n if(Array.isArray(v)) {\n for(let i = 0, len = v.length; i < len; i++) {\n let o = nl[i] = nl[i] || {\n offset: i / (len - 1),\n };\n o[k] = v[i];\n }\n }\n });\n list = nl;\n }\n else {\n list = [];\n }\n if(isNumber(options)) {\n this.__options = {\n duration: options,\n };\n options = this.__options;\n }\n let op = this.__options = options || {\n duration: 0,\n };\n let root = target.root;\n let config = this.__config = [\n false, // assigning\n false, // inFps\n false, // isDelay\n false, // begin\n false, // end\n false, // finished\n false, // nextBegin\n true, // firstPlay\n this.__frameCb,\n null, // playCb\n target,\n root,\n null, // frames\n null, // framesR\n 0, // currentTime\n 0, // nextTime\n {}, // style\n 0, // duration\n 1, // iterations\n 'none', // fill\n 1, // playbackRate\n 0, // playCount\n 'idle',\n false, // destroy\n 0, // startTime\n 0, // fpsTime\n op.easing,\n false, // enterFrame\n 0, // delay\n 0, // endDelay\n null, // keys,\n null, // originStyle,\n null, // currentFrames\n null, // currentFrame\n false, // spfLimit\n 60, // fps\n 'normal', // direction\n this.__calDiffTime,\n true, // firstEnter,\n false, // stayBegin\n false, // stayEnd\n false, // is2\n 0, // endTime\n target.__config, // nodeConfig\n root && root.__config, // rootConfig,destroy后root可能为空\n false, // outBeginDelay\n ];\n let iterations = this.iterations = op.iterations;\n let duration = this.duration = op.duration;\n let [frames, framesR, keys, originStyle] = this.__init(list, iterations, duration, op.easing, target);\n config[I_FRAMES] = frames;\n config[I_FRAMES_R] = framesR;\n config[I_KEYS] = keys;\n config[I_ORIGIN_STYLE] = originStyle;\n if(frames.length === 2) {\n config[I_IS2] = true;\n config[I_END_TIME] = frames[1][FRAME_TIME];\n }\n let fps = parseInt(op.fps) || 0;\n if(fps <= 0) {\n fps = 60;\n }\n this.fps = fps;\n this.spfLimit = op.spfLimit;\n this.delay = op.delay;\n this.endDelay = op.endDelay;\n this.playbackRate = op.playbackRate;\n this.fill = op.fill;\n this.iterations = op.iterations;\n this.direction = op.direction;\n config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(op.direction) ? framesR : frames;\n // 时间戳\n config[I_TIME_STAMP] = frame.__now;\n // 性能优化访问\n this[0] = this.__before;\n this[1] = this.__after;\n }\n\n __init(list, iterations, duration, easing, target) {\n if(list.length < 1) {\n return [[], [], [], {}];\n }\n // 过滤时间非法的,过滤后续offset<=前面的\n let offset = -1;\n let tagName = target.tagName;\n for(let i = 0, len = list.length; i < len; i++) {\n let current = list[i];\n if(current.hasOwnProperty('offset')) {\n current.offset = parseFloat(current.offset) || 0;\n current.offset = Math.max(0, current.offset);\n current.offset = Math.min(1, current.offset);\n // 超过区间[0,1]\n if(isNaN(current.offset) || current.offset < 0 || current.offset > 1) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n // <=前面的\n else if(current.offset <= offset) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n }\n // 缩写处理\n Object.keys(current).forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(current, k);\n }\n });\n // 检查key合法性\n Object.keys(current).forEach(k => {\n if(k !== 'easing' && k !== 'offset' && !change.isValid(tagName, k)) {\n delete current[k];\n }\n });\n }\n // 只有1帧复制出来变成2帧方便运行\n if(list.length === 1) {\n list[0] = clone(list[0]);\n if(list[0].offset === 1) {\n list.unshift({\n offset: 0,\n });\n }\n else {\n let copy = clone(list[0]);\n copy.offset = 1;\n list.push(copy);\n }\n }\n // 强制clone防止同引用\n else {\n list.forEach((item, i) => {\n list[i] = clone(item);\n });\n }\n // 首尾时间偏移强制为[0, 1],不是的话前后加空帧\n let first = list[0];\n if(first.hasOwnProperty('offset') && first.offset > 0) {\n first = {\n offset: 0,\n };\n list.unshift(first);\n }\n else {\n first.offset = 0;\n }\n let last = list[list.length - 1];\n if(last.hasOwnProperty('offset') && last.offset < 1) {\n last = {\n offset: 1,\n };\n list.push(last);\n }\n else {\n last.offset = 1;\n }\n // 计算没有设置offset的时间\n for(let i = 1, len = list.length; i < len; i++) {\n let start = list[i];\n // 从i=1开始offset一定>0,找到下一个有offset的,均分中间无声明的\n if(!start.hasOwnProperty('offset')) {\n let end;\n let j = i + 1;\n for(; j < len; j++) {\n end = list[j];\n if(end.hasOwnProperty('offset')) {\n break;\n }\n }\n let num = j - i + 1;\n start = list[i - 1];\n let per = (end.offset - start.offset) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.offset = start.offset + per * (k + 1 - i);\n }\n i = j;\n }\n }\n let frames = [];\n // 换算每一关键帧样式标准化\n list.forEach(item => {\n frames.push(framing(item, duration, easing));\n });\n // 为方便两帧之间计算变化,强制统一所有帧的css属性相同,没有写的为节点的当前样式currentStyle\n let keys = unify(frames, target);\n inherit(frames, keys, target);\n let framesR = clone(frames).reverse();\n // 存储原本样式以便恢复用\n let { style, props } = target;\n let originStyle = {};\n keys.forEach(k => {\n if(isGeom(tagName, k)) {\n originStyle[k] = props[k];\n }\n originStyle[k] = style[k];\n });\n // 再计算两帧之间的变化,存入transition属性\n let length = frames.length;\n let prev = frames[0];\n for(let i = 1; i < length; i++) {\n let next = frames[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n // 反向存储帧的倒排结果\n framesR.forEach(item => {\n item[FRAME_TIME] = duration - item[FRAME_TIME];\n item[FRAME_TRANSITION] = [];\n });\n prev = framesR[0];\n for(let i = 1; i < length; i++) {\n let next = framesR[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n return [frames, framesR, keys, originStyle];\n }\n\n __clean(isFinish) {\n let __config = this.__config;\n this.__cancelTask();\n __config[I_NEXT_TIME] = 0;\n let restore;\n let style = __config[I_STYLE];\n let keys = __config[I_KEYS];\n let target = __config[I_TARGET];\n if(isFinish) {\n __config[I_CURRENT_TIME] = __config[I_DELAY] + __config[I_DURATION] + __config[I_END_DELAY];\n if(__config[I_PLAY_STATE] === 'finish') {\n return;\n }\n __config[I_PLAY_STATE] = 'finish';\n // cancel需要清除finish根据情况保留\n if(!__config[I_STAY_END]) {\n __config[I_STYLE] = {};\n restore = true;\n }\n }\n else {\n __config[I_PLAY_COUNT] = __config[I_CURRENT_TIME] = 0;\n if(__config[I_PLAY_STATE] === 'idle') {\n return;\n }\n __config[I_PLAY_STATE] = 'idle';\n __config[I_STYLE] = {};\n restore = true;\n }\n // 动画取消结束不停留在最后一帧需要还原target原本的样式,需要对比目前是否是由本动画赋值的\n if(restore) {\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n if(target.__currentProps[k] === style[k]) {\n target.__currentProps[k] = target.props[k];\n }\n }\n else {\n if(target.__currentStyle[k] === style[k]) {\n target.__currentStyle[k] = target.style[k];\n }\n }\n });\n }\n }\n\n __frameCb(__config, diff, isDelay) {\n this.emit(Event.FRAME, diff, isDelay);\n if(__config[I_FIRST_PLAY]) {\n __config[I_FIRST_PLAY] = false;\n this.emit(Event.PLAY);\n }\n if(isFunction(__config[I_PLAY_CB])) {\n __config[I_PLAY_CB].call(this, diff, isDelay);\n __config[I_PLAY_CB] = null;\n }\n }\n\n __calDiffTime(__config, diff) {\n let playbackRate = __config[I_PLAYBACK_RATE];\n let spfLimit = __config[I_SPF_LIMIT];\n let fps = __config[I_FPS];\n let v = __config[I_CURRENT_TIME] = __config[I_NEXT_TIME];\n // 定帧限制每帧时间间隔最大为spf\n if(spfLimit) {\n if(spfLimit === true) {\n diff = Math.min(diff, 1000 / fps);\n }\n else if(spfLimit > 0) {\n diff = Math.min(diff, spfLimit);\n }\n }\n // 播放时间累加,并且考虑播放速度加成\n if(playbackRate !== 1 && playbackRate > 0) {\n diff *= playbackRate;\n }\n __config[I_NEXT_TIME] += diff;\n return [v, diff];\n }\n\n play(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n if(playState === 'running') {\n return this;\n }\n this.__cancelTask();\n __config[I_PLAY_CB] = cb;\n __config[I_PLAY_STATE] = 'running';\n // 每次play调用标识第一次运行,需响应play事件和回调\n __config[I_FIRST_PLAY] = true;\n // 防止finish/cancel事件重复触发,每次播放重置\n this.__hasFin = false;\n this.__hasCancel = false;\n // 只有第一次调用会进初始化,另外finish/cancel视为销毁也会重新初始化\n if(!__config[I_ENTER_FRAME]) {\n __config[I_ENTER_FRAME] = true;\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n // 初始化根据方向确定帧序列\n __config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction) ? framesR : frames;\n __config[I_CURRENT_TIME] = __config[I_NEXT_TIME] = __config[I_FPS_TIME] = 0;\n }\n // 添加每帧回调且立刻执行,本次执行调用refreshTask也是下一帧再渲染,frame的每帧都是下一帧\n frame.offFrame(this);\n frame.onFrame(this);\n __config[I_START_TIME] = frame.__now;\n __config[I_END] = false;\n return this;\n }\n\n __before(diff) {\n let __config = this.__config;\n __config[I_TIME_STAMP] = frame.__now;\n let target = __config[I_TARGET];\n let fps = __config[I_FPS];\n let playCount = __config[I_PLAY_COUNT];\n let currentFrames = __config[I_CURRENT_FRAMES];\n let iterations = __config[I_ITERATIONS];\n let stayBegin = __config[I_STAY_BEGIN];\n let stayEnd = __config[I_STAY_END];\n let delay = __config[I_DELAY];\n let root = __config[I_ROOT];\n let is2 = __config[I_IS2];\n let endTime = __config[I_END_TIME];\n let duration = __config[I_DURATION];\n let endDelay = __config[I_END_DELAY];\n let length = currentFrames.length;\n // 用本帧和上帧时间差,计算累加运行时间currentTime,以便定位当前应该处于哪个时刻\n let [currentTime, d] = __config[I_CAL_DIFF_TIME](__config, diff);\n diff = d;\n // 增加的fps功能,当<60时计算跳帧,每帧运行依旧累加时间,达到fps时重置,第一帧强制不跳\n if(!__config[I_FIRST_ENTER] && fps < 60) {\n diff = __config[I_FPS_TIME] += diff;\n if(diff < 1000 / fps) {\n __config[I_IN_FPS] = true;\n return;\n }\n __config[I_FPS_TIME] = 0;\n }\n __config[I_FIRST_ENTER] = false;\n // delay仅第一次生效\n if(playCount === 0 && currentTime < delay) {\n if(stayBegin) {\n let currentFrame = __config[I_CURRENT_FRAME] = currentFrames[0];\n let current = currentFrame[FRAME_STYLE];\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n }\n // 即便不刷新,依旧执行帧回调,同时标明让后续第一帧响应begin\n __config[I_OUT_BEGIN_DELAY] = true;\n __config[I_IS_DELAY] = true;\n return;\n }\n // 减去delay,计算在哪一帧,仅首轮\n if(playCount === 0) {\n currentTime -= delay;\n }\n if(currentTime === 0 || __config[I_OUT_BEGIN_DELAY]) {\n __config[I_OUT_BEGIN_DELAY] = false;\n __config[I_BEGIN] = true;\n }\n // 超过duration非尾轮需处理回到开头,触发新一轮动画事件,这里可能时间间隔非常大直接跳过几轮\n let round;\n while(currentTime >= duration && playCount < iterations - 1) {\n currentTime -= duration;\n __config[I_NEXT_TIME] -= duration;\n playCount = ++__config[I_PLAY_COUNT];\n __config[I_BEGIN] = true;\n round = true;\n }\n // 如果发生轮换,需重新确定正反向\n if(round) {\n let direction = __config[I_DIRECTION];\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let isAlternate = {\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction);\n // 有正反向播放需要重设帧序列\n if(isAlternate) {\n let isEven = playCount % 2 === 0;\n if(direction === 'alternate') {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n }\n let isLastCount = playCount >= iterations - 1;\n // 只有2帧可优化,否则2分查找当前帧\n let i, frameTime;\n if(is2) {\n i = currentTime < endTime ? 0 : 1;\n frameTime = endTime;\n }\n else {\n i = binarySearch(0, length - 1, currentTime, currentFrames);\n frameTime = currentFrames[i][FRAME_TIME];\n }\n // 最后一帧结束动画,仅最后一轮才会进入,需处理endDelay\n let isLastFrame = isLastCount && i === length - 1;\n let percent = 0;\n if(isLastFrame) {\n // 无需任何处理\n }\n // 否则根据目前到下一帧的时间差,计算百分比,再反馈到变化数值上\n else if(is2) {\n percent = currentTime / duration;\n }\n else {\n let total = currentFrames[i + 1][FRAME_TIME] - frameTime;\n percent = (currentTime - frameTime) / total;\n }\n let inEndDelay, currentFrame = currentFrames[i], current;\n __config[I_CURRENT_FRAME] = currentFrame;\n /** 这里要考虑全几种场景:\n * 1. 单次播放无endDelay且fill不停留(有/无差异,下同)\n * 2. 单次播放无endDelay且fill停留\n * 3. 单次播放有endDelay且fill不停留\n * 4. 单次播放有endDelay且fill停留\n * 5. 多次播放无endDelay且fill不停留(尾次/非尾次,下同)\n * 6. 多次播放无endDelay且fill停留\n * 7. 多次播放有endDelay且fill不停留\n * 8. 多次播放有endDelay且fill停留\n */\n let needClean;\n if(isLastFrame) {\n inEndDelay = currentTime < duration + endDelay;\n // 停留对比最后一帧,endDelay可能会多次进入这里,第二次进入样式相等不再重绘\n if(stayEnd) {\n current = cloneStyle(currentFrame[FRAME_STYLE], __config[I_KEYS]);\n }\n // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里\n else {\n current = cloneStyle(__config[I_ORIGIN_STYLE], __config[I_KEYS]);\n }\n // 进入endDelay或结束阶段触发end事件,注意只触发一次,防重在触发的地方做\n __config[I_NEXT_END] = true;\n if(!inEndDelay) {\n __config[I_PLAY_COUNT]++;\n __config[I_FINISHED] = true;\n frame.offFrame(this);\n needClean = true;\n __config[I_NEXT_TIME] = 0;\n }\n }\n else {\n current = calIntermediateStyle(currentFrame, __config[I_KEYS], percent, target);\n }\n // 无论两帧之间是否有变化,都生成计算结果赋给style,去重在root做\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n if(needClean) {\n 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 __config[I_FRAME_CB].call(this, __config, diff, __config[I_IS_DELAY]);\n __config[I_IS_DELAY] = false;\n if(__config[I_BEGIN]) {\n __config[I_BEGIN] = false;\n this.emit(Event.BEGIN, __config[I_PLAY_COUNT]);\n }\n // end事件只触发一次,末轮进入endDelay或直接结束时\n if(__config[I_NEXT_END] && !__config[I_END]) {\n __config[I_END] = true;\n this.emit(Event.END, __config[I_PLAY_COUNT] - 1);\n }\n if(__config[I_FINISHED]) {\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n __config[I_PLAY_STATE] = 'finished';\n this.emit(Event.FINISH);\n }\n }\n\n pause(silence) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let { pending } = this;\n if(isDestroyed || duration <= 0 || pending) {\n return this;\n }\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(!silence) {\n this.emit(Event.PAUSE);\n }\n return this;\n }\n\n resume(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n if(isDestroyed || duration <= 0 || playState !== 'paused') {\n return this;\n }\n return this.play(cb);\n }\n\n finish(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1 || playState === 'finished' || playState === 'idle') {\n return self;\n }\n // 先清除所有回调任务,多次调用finish也会清除只留最后一次\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n let current;\n // 停留在最后一帧\n if(__config[I_STAY_END]) {\n __config[I_CURRENT_FRAME] = frames[frames.length - 1];\n current = frames[frames.length - 1][FRAME_STYLE];\n }\n else {\n current = originStyle;\n }\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(current, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean(true);\n },\n __after(diff) {\n if(!self.__hasFin) {\n self.__hasFin = true;\n __config[I_ASSIGNING] = false;\n __config[I_FRAME_CB].call(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.FINISH);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n cancel(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || playState === 'idle' || frames.length < 1) {\n return self;\n }\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(originStyle, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean();\n },\n __after(diff) {\n if(!self.__hasCancel) {\n self.__hasCancel = true;\n __config[I_ASSIGNING] = false;\n __config[I_FRAME_CB].call(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.CANCEL);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n gotoAndPlay(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n // 计算出时间点直接累加播放\n this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n return this.play(cb);\n }\n\n gotoAndStop(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n v = this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n // 先play一帧,回调里模拟暂停\n return this.play(diff => {\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isFunction(cb)) {\n cb.call(this, diff);\n }\n });\n }\n\n // 同步赋予,用在extendAnimate\n assignCurrentStyle() {\n let __config = this.__config;\n let style = __config[I_STYLE];\n let target = __config[I_TARGET];\n let keys = __config[I_KEYS];\n keys.forEach(i => {\n if(style.hasOwnProperty(i)) {\n let v = style[i];\n // geom的属性变化\n if(GEOM.hasOwnProperty(i)) {\n target.currentProps[i] = v;\n }\n // 样式\n else {\n // 将动画样式直接赋给currentStyle\n target.currentStyle[i] = v;\n }\n }\n });\n }\n\n __goto(v, isFrame, excludeDelay) {\n let __config = this.__config;\n let duration = __config[I_DURATION];\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isNaN(v) || v < 0) {\n throw new Error('Param of gotoAnd(Play/Stop) is illegal: ' + v);\n }\n if(isFrame) {\n v = (v - 1) / this.spf;\n }\n if(excludeDelay) {\n v += __config[I_DELAY];\n }\n // 超过一轮去掉delay\n if(v > duration + __config[I_DELAY]) {\n v -= __config[I_DELAY];\n }\n // 超过时间长度需要累加次数\n __config[I_PLAY_COUNT] = 0;\n while(v > duration && __config[I_PLAY_COUNT] < __config[I_ITERATIONS] - 1) {\n __config[I_PLAY_COUNT]++;\n v -= duration;\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n __config[I_NEXT_TIME] = v;\n // 防止play()重置时间和当前帧组,提前计算好\n __config[I_ENTER_FRAME] = true;\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n if({\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction)) {\n let isEven = __config[I_PLAY_COUNT] % 2 === 0;\n if(direction === 'alternate') {\n __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n return v;\n }\n\n addControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.add(this);\n }\n }\n\n removeControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.remove(this);\n }\n }\n\n __stayBegin() {\n return {\n backwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __stayEnd() {\n return {\n forwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __setTarget(target) {\n this.__target = target;\n this.__config[I_TARGET] = target;\n this.__config[I_NODE_CONFIG] = target.__config;\n }\n\n __cancelTask() {\n frame.offFrame(this);\n this.__config[I_PLAY_CB] = null;\n }\n\n __destroy(sync) {\n let self = this;\n let __config = self.__config;\n if(__config[I_DESTROYED]) {\n return;\n }\n self.removeControl();\n // clean异步执行,因为里面的样式还原需要等到下一帧,否则同步执行清除后,紧接着的新同步动画获取不到currentStyle\n if(sync) {\n self.__clean();\n __config[I_TARGET] = null;\n }\n else {\n frame.nextFrame({\n __before() {\n self.__clean();\n __config[I_TARGET] = null;\n },\n });\n }\n __config[I_START_TIME] = 0;\n __config[I_DESTROYED] = true;\n }\n\n __checkModify() {\n let __config = this.__config;\n if(__config[I_PLAY_STATE] !== 'idle' && __config[I_PLAY_STATE] !== 'finished') {\n inject.warn('Modification will not come into effect when animation is running');\n }\n }\n\n get id() {\n return this.__id;\n }\n\n get target() {\n return this.__config[I_TARGET];\n }\n\n get root() {\n return this.__config[I_ROOT];\n }\n\n get keys() {\n return this.__config[I_KEYS];\n }\n\n get style() {\n return this.__config[I_STYLE];\n }\n\n get options() {\n return this.__options;\n }\n\n get duration() {\n return this.__config[I_DURATION];\n }\n\n set duration(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DURATION] !== v) {\n __config[I_DURATION] = v;\n __config[I_END_TIME] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get delay() {\n return this.__config[I_DELAY];\n }\n\n set delay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DELAY] !== v) {\n __config[I_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get endDelay() {\n return this.__config[I_END_DELAY];\n }\n\n set endDelay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_END_DELAY] !== v) {\n __config[I_END_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get fps() {\n return this.__config[I_FPS];\n }\n\n set fps(v) {\n v = parseInt(v) || 60;\n let __config = this.__config;\n if(__config[I_FPS] !== v) {\n if(v <= 0) {\n v = 60;\n }\n __config[I_FPS] = v;\n }\n return v;\n }\n\n get spf() {\n return 1 / this.fps;\n }\n\n get iterations() {\n return this.__config[I_ITERATIONS];\n }\n\n set iterations(v) {\n if(v === Infinity || util.isString(v) && v.toLowerCase() === 'infinity') {\n v = Infinity;\n }\n else {\n v = parseInt(v);\n if(isNaN(v) || v < 0) {\n v = 1;\n }\n }\n let __config = this.__config;\n if(__config[I_ITERATIONS] !== v) {\n __config[I_ITERATIONS] = v;\n }\n return v;\n }\n\n get fill() {\n return this.__config[I_FILL];\n }\n\n set fill(v) {\n v = v || 'none';\n let __config = this.__config;\n if(__config[I_FILL] !== v) {\n __config[I_FILL] = v;\n this.__checkModify();\n }\n __config[I_STAY_BEGIN] = {\n backwards: true,\n both: true,\n }.hasOwnProperty(v);\n __config[I_STAY_END] = {\n forwards: true,\n both: true,\n }.hasOwnProperty(v);\n return v;\n }\n\n get direction() {\n return this.__config[I_DIRECTION];\n }\n\n set direction(v) {\n v = v || 'normal';\n let __config = this.__config;\n if(__config[I_DIRECTION] !== v) {\n __config[I_DIRECTION] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get frames() {\n return this.__config[I_FRAMES];\n }\n\n get framesR() {\n return this.__config[I_FRAMES_R];\n }\n\n get playbackRate() {\n return this.__config[I_PLAYBACK_RATE];\n }\n\n set playbackRate(v) {\n v = parseFloat(v) || 1;\n if(v <= 0) {\n v = 1;\n }\n let __config = this.__config;\n if(__config[I_PLAYBACK_RATE] !== v) {\n __config[I_PLAYBACK_RATE] = v;\n }\n return v;\n }\n\n get easing() {\n return this.__config[I_EASING];\n }\n\n get startTime() {\n return this.__config[I_START_TIME];\n }\n\n get currentTime() {\n return this.__config[I_CURRENT_TIME];\n }\n\n set currentTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_CURRENT_TIME] !== v) {\n __config[I_CURRENT_TIME] = v;\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get nextTime() {\n return this.__config[I_NEXT_TIME];\n }\n\n set nextTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_NEXT_TIME] !== v) {\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get timestamp() {\n return this.__config[I_TIME_STAMP];\n }\n\n get pending() {\n return this.__config[I_PLAY_STATE] !== 'running';\n }\n\n get finished() {\n return this.__config[I_PLAY_STATE] === 'finished';\n }\n\n get playState() {\n return this.__config[I_PLAY_STATE];\n }\n\n get playCount() {\n return this.__config[I_PLAY_COUNT];\n }\n\n set playCount(v) {\n v = Math.max(0, parseInt(v) || 0);\n let __config = this.__config;\n if(__config[I_PLAY_COUNT] !== v) {\n __config[I_PLAY_COUNT] = v;\n }\n return v;\n }\n\n get isDestroyed() {\n return this.__config[I_DESTROYED];\n }\n\n get animating() {\n let __config = this.__config;\n let playState = __config[I_PLAY_STATE];\n if(playState === 'idle') {\n return false;\n }\n return playState !== 'finished' || __config[I_STAY_END] || __config[I_STAY_BEGIN];\n }\n\n get spfLimit() {\n let __config = this.__config;\n return __config[I_SPF_LIMIT];\n }\n\n set spfLimit(v) {\n if(util.isNumber(v) || /^\\d/.test(v)) {\n v = Math.max(0, parseInt(v) || 0);\n }\n else {\n v = !!v;\n }\n let __config = this.__config;\n if(__config[I_SPF_LIMIT] !== v) {\n __config[I_SPF_LIMIT] = v;\n }\n return v;\n }\n\n get assigning() {\n return this.__config[I_ASSIGNING];\n }\n}\n\nexport default Animation;\n","import mode from '../node/mode';\nimport geom from '../math/geom';\nimport blur from '../math/blur';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\n\nconst {\n NODE_KEY: {\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { int2rgba } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nfunction renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h, 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, DEG } = unit;\nconst { int2rgba, rgba2int, joinArr, isNil } = util;\nconst { calRelative } = css;\nconst { GEOM } = change;\nconst { mbmName, isValidMbm } = mbm;\nconst { point2d } = mx;\n\nconst {\n contain,\n NONE,\n TRANSFORM: TF,\n REFLOW,\n REPAINT,\n TRANSLATE_X: TX,\n TRANSLATE_Y: TY,\n TRANSLATE_Z: TZ,\n} = level;\n\nfunction getFirstEmptyInlineWidth(xom) {\n let n = 0;\n let flowChildren = xom.flowChildren;\n let length = flowChildren.length;\n for(let i = 0; i < length; i++) {\n let child = flowChildren[i];\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.flowChildren.length) {\n n += getFirstEmptyInlineWidth(child);\n break;\n }\n else if(child.__config[NODE_IS_INLINE]) {\n n += child.outerWidth;\n }\n }\n else {\n break;\n }\n }\n return n;\n}\n\nfunction getLastEmptyInlineWidth(xom) {\n let n = 0;\n let flowChildren = xom.flowChildren;\n let length = flowChildren.length;\n for(let i = length - 1; i >= 0; i--) {\n let child = flowChildren[i];\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.flowChildren.length) {\n n += getLastEmptyInlineWidth(child);\n break;\n }\n else {\n n += child.outerWidth;\n }\n }\n else {\n break;\n }\n }\n return n;\n}\n\nclass Xom extends Node {\n constructor(tagName, props = {}) {\n super();\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__tagName = tagName;\n this.__style = this.props.style || {}; // style被解析后的k-v形式\n this.__currentStyle = {}; // 动画过程中绘制一开始会merge动画样式\n this.__computedStyle = {}; // 类似getComputedStyle()将currentStyle计算好数值赋给\n this.__listener = {};\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n this.listener[k] = v;\n }\n });\n this.__animationList = [];\n this.__loadBgi = {\n // 刷新回调函数,用以destroy取消用\n cb: function() {\n },\n };\n this.__cacheStyle = {}; // 是否缓存重新计算computedStyle的样式key\n this.__cacheDefs = []; // svg专用,缓存渲染时使用已有的defs,diff过程用,否则会defs被清空\n let isClip = this.__isClip = !!this.props.clip;\n let isMask = this.__isMask = isClip || !!this.props.mask;\n let config = this.__config;\n config[NODE_TAG_NAME] = tagName;\n config[NODE_CACHE_STYLE] = this.__cacheStyle;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_COMPUTED_STYLE] = this.__computedStyle;\n config[NODE_REFRESH_LV] = REFLOW;\n config[NODE_STYLE] = this.__style;\n config[NODE_MATRIX] = [];\n config[NODE_MATRIX_EVENT] = [];\n config[NODE_DEFS_CACHE] = this.__cacheDefs;\n config[NODE_IS_MASK] = isMask;\n this.__frameAnimateList = [];\n this.__contentBoxList = []; // inline存储内容用\n // this.__json domApi需要获取生成时的json引用,builder过程添加,如appendChild时json也需要跟着变更\n 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 return 0;\n }\n\n // dom常用的几种尺寸赋值\n __ioSize(w, h) {\n let computedStyle = this.computedStyle;\n this.__clientWidth = w += computedStyle[PADDING_LEFT] + computedStyle[PADDING_RIGHT];\n this.__clientHeight = h += computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM];\n this.__offsetWidth = w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[BORDER_RIGHT_WIDTH];\n this.__offsetHeight = h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH];\n this.__outerWidth = w + computedStyle[MARGIN_LEFT] + computedStyle[MARGIN_RIGHT];\n this.__outerHeight = h + computedStyle[MARGIN_TOP] + computedStyle[MARGIN_BOTTOM];\n }\n\n // 换算margin/padding为px单位,onlyFixedValue只考虑绝对值,不考虑百分比等\n __calMp(v, w, onlyFixedValue) {\n let n = 0;\n if(v[1] === PX) {\n n += v[0];\n }\n else if(v[1] === PERCENT && !onlyFixedValue) {\n v[0] *= w * 0.01;\n v[1] = PX;\n n += v[0];\n }\n else if(v[1] === REM) {\n n += v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n n += v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n n += v[0] * this.root.height * 0.01;\n }\n return n;\n }\n\n // 为basis的b/min/max添加mpb,只有当b未显示指定等于w/content时才加,同时返回mpb值\n __addMp(isDirectionRow, w, currentStyle, res, isDirectItem) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w, !isDirectItem)\n + this.__calMp(marginRight, w, !isDirectItem)\n + this.__calMp(paddingLeft, w, !isDirectItem)\n + this.__calMp(paddingRight, w, !isDirectItem);\n if(borderLeftWidth[1] === PX) {\n mp += borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n mp += borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n mp += borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n mp += borderLeftWidth[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n mp += borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n mp += borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n mp += borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n mp += borderRightWidth[0] * this.root.height * 0.01;\n }\n res = res.map(item => item + mp);\n }\n else {\n let mp = this.__calMp(marginTop, w, !isDirectItem)\n + this.__calMp(marginBottom, w, !isDirectItem)\n + this.__calMp(paddingTop, w, !isDirectItem)\n + this.__calMp(paddingBottom, w, !isDirectItem);\n if(borderTopWidth[1] === PX) {\n mp += borderTopWidth[0];\n }\n else if(borderTopWidth[1] === REM) {\n mp += borderTopWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderTopWidth[1] === VW) {\n mp += borderTopWidth[0] * this.root.width * 0.01;\n }\n else if(borderTopWidth[1] === VH) {\n mp += borderTopWidth[0] * this.root.height * 0.01;\n }\n if(borderBottomWidth[1] === PX) {\n mp += borderBottomWidth[0];\n }\n else if(borderBottomWidth[1] === REM) {\n mp += borderBottomWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderBottomWidth[1] === VW) {\n mp += borderBottomWidth[0] * this.root.width * 0.01;\n }\n else if(borderBottomWidth[1] === VH) {\n mp += borderBottomWidth[0] * this.root.height * 0.01;\n }\n res = res.map(item => item + mp);\n }\n return res;\n }\n\n // absolute且无尺寸时,isVirtual标明先假布局一次计算尺寸,还有flex列计算时\n // fromAbs为absolute节点特有省略计算标识,本节点是abs时真正布局传入\n __layout(data, isVirtual, fromAbs) {\n css.computeReflow(this, this.isShadowRoot);\n let { w } = data;\n let { isDestroyed, currentStyle, computedStyle, __config } = this;\n let {\n [DISPLAY]: display,\n } = computedStyle;\n let {\n [WIDTH]: width,\n [POSITION]: position,\n } = currentStyle;\n this.clearCache();\n this.__layoutData = {\n x: data.x,\n y: data.y,\n w: data.w,\n h: data.h,\n lx: data.lx,\n };\n __config[NODE_REFRESH_LV] = REFLOW;\n __config[NODE_LIMIT_CACHE] = false;\n __config[NODE_IS_INLINE] = false;\n // 防止display:none不统计mask,isVirtual忽略,abs布局后续会真正来走一遍\n if(!isVirtual) {\n let { next } = this;\n // mask关系只有布局才会变更,普通渲染关系不会改变,clip也是mask的一种\n if(!this.isMask && next && (next.isMask)) {\n let count = 0;\n while(next) {\n if(next.isMask) {\n count++;\n }\n else {\n break;\n }\n next = next.next;\n }\n this.__hasMask = count;\n }\n }\n this.__ox = this.__oy = 0;\n if(isDestroyed || display === 'none') {\n this.__width = this.__height\n = this.__clientWidth = this.__clientHeight\n = this.__offsetWidth = this.__offsetHeight\n = this.__outerWidth = this.__outerHeight\n = computedStyle[WIDTH] = computedStyle[HEIGHT] = 0;\n this.__x = data.x;\n this.__y = data.y;\n this.__layoutNone();\n return;\n }\n // margin/padding在abs前已经计算过了,无需二次计算\n if(!fromAbs) {\n this.__mp(currentStyle, computedStyle, w);\n }\n // inline的width/height无效,其它有效\n if(width[1] !== AUTO) {\n if(this.__isRealInline() && currentStyle[DISPLAY] === 'inline') {\n width[0] = 0;\n width[1] = AUTO;\n }\n else {\n switch(width[1]) {\n case PX:\n w = width[0];\n break;\n case PERCENT:\n w *= width[0] * 0.01;\n break;\n case REM:\n w = width[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n w = width[0] * this.root.width * 0.01;\n break;\n case VH:\n w = width[0] * this.root.height * 0.01;\n break;\n }\n }\n }\n let lineClampCount = 0;\n // 4种布局,默认block,inlineBlock基本可以复用inline逻辑,除了尺寸\n if(display === 'flex') {\n this.__layoutFlex(data, isVirtual);\n }\n else if(display === 'inlineBlock' || display === 'inline-block') {\n lineClampCount = this.__layoutInline(data, isVirtual);\n }\n else if(display === 'inline') {\n lineClampCount = this.__layoutInline(data, isVirtual, true);\n }\n else {\n this.__layoutBlock(data, isVirtual);\n }\n // relative渲染时做偏移,百分比基于父元素,若父元素没有定高则为0\n if(position === 'relative') {\n let { [TOP]: top, [RIGHT]: right, [BOTTOM]: bottom, [LEFT]: left } = currentStyle;\n let { parent } = this;\n if(top[1] !== AUTO) {\n let n = calRelative(currentStyle, TOP, top, parent);\n this.__offsetY(n);\n computedStyle[TOP] = n;\n computedStyle[BOTTOM] = 'auto';\n }\n else if(bottom[1] !== AUTO) {\n let n = calRelative(currentStyle, BOTTOM, bottom, parent);\n this.__offsetY(-n);\n computedStyle[BOTTOM] = n;\n computedStyle[TOP] = 'auto';\n }\n else {\n computedStyle[TOP] = computedStyle[BOTTOM] = 'auto';\n }\n if(left[1] !== AUTO) {\n let n = calRelative(currentStyle, LEFT, left, parent, true);\n this.__offsetX(n);\n computedStyle[LEFT] = n;\n computedStyle[RIGHT] = 'auto';\n }\n else if(right[1] !== AUTO) {\n let n = calRelative(currentStyle, RIGHT, right, parent, true);\n this.__offsetX(-n);\n computedStyle[RIGHT] = n;\n computedStyle[LEFT] = 'auto';\n }\n else {\n computedStyle[LEFT] = computedStyle[RIGHT] = 'auto';\n }\n }\n else if(position !== 'absolute') {\n computedStyle[TOP] = computedStyle[BOTTOM] = computedStyle[LEFT] = computedStyle[RIGHT] = 'auto';\n }\n // 计算结果存入computedStyle和6个坐标,inline在其inlineSize特殊处理\n let x = this.__sx = this.x + this.ox;\n let y = this.__sy = this.y + this.oy;\n if(!__config[NODE_IS_INLINE]) {\n x = this.__sx1 = x + computedStyle[MARGIN_LEFT];\n x = this.__sx2 = x + computedStyle[BORDER_LEFT_WIDTH];\n x = this.__sx3 = x + computedStyle[PADDING_LEFT];\n x = this.__sx4 = x + this.width;\n x = this.__sx5 = x + computedStyle[PADDING_RIGHT];\n this.__sx6 = x + computedStyle[BORDER_RIGHT_WIDTH];\n y = this.__sy1 = y + computedStyle[MARGIN_TOP];\n y = this.__sy2 = y + computedStyle[BORDER_TOP_WIDTH];\n y = this.__sy3 = y + computedStyle[PADDING_TOP];\n y = this.__sy4 = y + this.height;\n y = this.__sy5 = y + computedStyle[PADDING_BOTTOM];\n this.__sy6 = y + computedStyle[BORDER_BOTTOM_WIDTH];\n }\n computedStyle[WIDTH] = this.width;\n computedStyle[HEIGHT] = this.height;\n // abs布局的不执行,在__layoutAbs末尾做,防止未布局没有尺寸从而动画计算错误\n if(!fromAbs) {\n this.__execAr();\n }\n return lineClampCount;\n }\n\n __execAr() {\n // 动态json引用时动画暂存,第一次布局时处理这些动画到root的animateController上\n let ar = this.__animateRecords;\n if(ar) {\n this.__animateRecords = null;\n // parse没有dom时,animate的target引用都是json,vd后生成需重新赋值\n ar.list.forEach(item => {\n if(item.target.vd instanceof Xom) {\n item.target = item.target.vd;\n }\n });\n let ac = ar.controller || this.root.animateController;\n // 不自动播放进入记录列表,初始化并等待手动调用\n if(ar.options && ar.options.autoPlay === false) {\n ac.__records2 = ac.__records2.concat(ar.list);\n ac.init(ac.__records2, ac.list2);\n }\n else {\n ac.__records = ac.__records.concat(ar.list);\n ac.__playAuto();\n }\n }\n }\n\n __layoutNone() {\n let { computedStyle } = this;\n computedStyle[DISPLAY] = 'none';\n computedStyle[MARGIN_TOP]\n = computedStyle[MARGIN_RIGHT]\n = computedStyle[MARGIN_BOTTOM]\n = computedStyle[MARGIN_LEFT]\n = computedStyle[PADDING_TOP]\n = computedStyle[PADDING_RIGHT]\n = computedStyle[PADDING_BOTTOM]\n = computedStyle[PADDING_LEFT]\n = 0;\n }\n\n // 预先计算是否是固定宽高,布局点位和尺寸考虑margin/border/padding\n __preLayout(data, isInline) {\n let { x, y, w, h, w2, h2, w3, h3, lx, nowrap, lineBoxManager, endSpace = 0 } = data;\n this.__x = x;\n this.__y = y;\n let { currentStyle, computedStyle } = this;\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n // 除了auto外都是固定宽高度\n let fixedWidth;\n let fixedHeight;\n // 绝对定位是left+right这种其实等于定义了width,但不能修改原始style,存入特殊变量标识\n if(w2 !== undefined) {\n fixedWidth = true;\n w = w2;\n }\n // flex时也会用到,子级得出目标主尺寸后按这个来\n else if(w3 !== undefined) {\n fixedWidth = true;\n w = w3;\n }\n else if(width[1] !== AUTO) {\n fixedWidth = true;\n switch(width[1]) {\n case PX:\n w = width[0];\n break;\n case PERCENT:\n w *= width[0] * 0.01;\n break;\n case REM:\n w = width[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n w = width[0] * this.root.width * 0.01;\n break;\n case VH:\n w = width[0] * this.root.height * 0.01;\n break;\n }\n }\n if(h2 !== undefined) {\n fixedHeight = true;\n h = h2;\n }\n else if(h3 !== undefined) {\n fixedHeight = true;\n h = h3;\n }\n else if(height[1] !== AUTO) {\n fixedHeight = true;\n switch(height[1]) {\n case PX:\n h = height[0];\n break;\n case PERCENT:\n h *= height[0] * 0.01;\n break;\n case REM:\n h = height[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n h = height[0] * this.root.width * 0.01;\n break;\n case VH:\n h = height[0] * this.root.height * 0.01;\n break;\n }\n }\n // margin/padding/border影响x和y和尺寸,注意inline的y不受mpb影响\n x += borderLeftWidth + marginLeft + paddingLeft;\n data.x = x;\n if(!isInline) {\n y += borderTopWidth + marginTop + paddingTop;\n }\n data.y = y;\n // inline的w/h很特殊,需不考虑inline自身水平的mpb以便换行,因为mpb只在首尾行生效,所以首尾需特殊处理中间忽略\n // 当嵌套inline时更加复杂,假如inline有尾部mpb,最后一行需考虑,如果此inline是父的最后一个且父有mpb需叠加\n let selfEndSpace = 0;\n if(isInline) {\n selfEndSpace = paddingRight + borderRightWidth + marginRight;\n }\n // 传入w3/h3时,flex的item已知目标主尺寸,需减去mpb,其一定是block和inline互斥\n if(!isInline) {\n if(width[1] === AUTO || w3 !== undefined) {\n w -= borderLeftWidth + borderRightWidth + marginLeft + marginRight + paddingLeft + paddingRight;\n }\n if(height[1] === AUTO || h3 !== undefined) {\n h -= borderTopWidth + borderBottomWidth + marginTop + marginBottom + paddingTop + paddingBottom;\n }\n }\n return {\n fixedWidth,\n fixedHeight,\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n nowrap,\n endSpace,\n selfEndSpace,\n };\n }\n\n // 处理margin:xx auto居中对齐或右对齐\n __marginAuto(style, data) {\n let {\n [POSITION]: position,\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [WIDTH]: width,\n } = style;\n if(position !== 'absolute' && (display === 'block' || display === 'flex')\n && (width[1] !== AUTO || this.tagName === 'img') && marginLeft[1] === AUTO && marginRight[1] === AUTO) {\n let ow = this.outerWidth;\n if(ow < data.w) {\n this.__offsetX((data.w - ow) * 0.5, true);\n }\n }\n }\n\n __calMatrix(lv, __cacheStyle, currentStyle, computedStyle, __config, sx1, sy1, offsetWidth, offsetHeight) {\n if(__config[NODE_IS_INLINE]) {\n computedStyle[TRANSFORM_ORIGIN] = [sx1, sy1];\n return __cacheStyle[MATRIX] = mx.identity();\n }\n let matrixCache = __cacheStyle[MATRIX];\n // tx/ty变化特殊优化\n if(matrixCache && lv < REFLOW && !contain(lv, TF)) {\n let x = 0, y = 0, z = 0;\n if(contain(lv, TX)) {\n let v = currentStyle[TRANSLATE_X];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else {\n v = v[0];\n }\n x = v - (computedStyle[TRANSLATE_X] || 0);\n computedStyle[TRANSLATE_X] = v;\n computedStyle[TRANSFORM][12] += x;\n matrixCache[12] += x;\n }\n if(contain(lv, TY)) {\n let v = currentStyle[TRANSLATE_Y];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetHeight * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else {\n v = v[0];\n }\n y = v - (computedStyle[TRANSLATE_Y] || 0);\n computedStyle[TRANSLATE_Y] = v;\n computedStyle[TRANSFORM][13] += y;\n matrixCache[13] += y;\n }\n if(contain(lv, TZ)) {\n let v = currentStyle[TRANSLATE_Z];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else {\n v = v[0];\n }\n z = v - (computedStyle[TRANSLATE_Z] || 0);\n computedStyle[TRANSLATE_Z] = v;\n computedStyle[TRANSFORM][14] += z;\n matrixCache[14] += z;\n }\n __cacheStyle[MATRIX] = matrixCache;\n }\n // 先根据cache计算需要重新计算的computedStyle\n else {\n if(sx1 === undefined) {\n sx1 = this.__sx1;\n sy1 = this.__sy1;\n offsetWidth = this.offsetWidth;\n offsetHeight = this.offsetHeight;\n }\n if(__cacheStyle[TRANSFORM_ORIGIN] === undefined) {\n __cacheStyle[TRANSFORM_ORIGIN] = true;\n matrixCache = null;\n computedStyle[TRANSFORM_ORIGIN] = tf.calOrigin(currentStyle[TRANSFORM_ORIGIN], offsetWidth, offsetHeight, this.root);\n }\n if(__cacheStyle[TRANSFORM] === undefined\n || __cacheStyle[TRANSLATE_X] === undefined\n || __cacheStyle[TRANSLATE_Y] === undefined\n || __cacheStyle[TRANSLATE_Z] === undefined\n || __cacheStyle[ROTATE_X] === undefined\n || __cacheStyle[ROTATE_Y] === undefined\n || __cacheStyle[ROTATE_Z] === undefined\n || __cacheStyle[ROTATE_3D] === undefined\n || __cacheStyle[SCALE_X] === undefined\n || __cacheStyle[SCALE_Y] === undefined\n || __cacheStyle[SCALE_Z] === undefined\n || __cacheStyle[SKEW_X] === undefined\n || __cacheStyle[SKEW_Y] === undefined) {\n __cacheStyle[TRANSFORM]\n = __cacheStyle[TRANSLATE_X]\n = __cacheStyle[TRANSLATE_Y]\n = __cacheStyle[TRANSLATE_Z]\n = __cacheStyle[ROTATE_X]\n = __cacheStyle[ROTATE_Y]\n = __cacheStyle[ROTATE_Z]\n = __cacheStyle[SCALE_X]\n = __cacheStyle[SCALE_Y]\n = __cacheStyle[SCALE_Z]\n = __cacheStyle[SKEW_X]\n = __cacheStyle[SKEW_Y]\n = true;\n matrixCache = null;\n let matrix;\n // transform相对于自身\n if(currentStyle[TRANSFORM]) {\n matrix = tf.calMatrix(currentStyle[TRANSFORM], offsetWidth, offsetHeight, this.root);\n }\n // 没有transform则看是否有扩展的css独立变换属性\n else {\n let temp = [];\n [\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n ROTATE_3D,\n SKEW_X,\n SKEW_Y,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n ].forEach(k => {\n // 删除之前遗留的\n delete computedStyle[k];\n let v = currentStyle[k];\n if(isNil(v)) {\n return;\n }\n if(k === ROTATE_3D) {\n computedStyle[k] = [v[0], v[1], v[2], v[3][0]];\n if(v[3][0] === 0) {\n return;\n }\n temp.push([k, v]);\n return;\n }\n computedStyle[k] = v[0];\n // scale为1和其它为0避免计算浪费\n let isScale = k === SCALE_X || k === SCALE_Y || k === SCALE_Z;\n if(v[0] === 1 && isScale || !isScale && v[0] === 0) {\n return;\n }\n if(v[1] === PERCENT) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * offsetWidth * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * offsetHeight * 0.01;\n }\n }\n else if(v[1] === REM) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n }\n else if(v[1] === VW) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.width * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.width * 0.01;\n }\n }\n else if(v[1] === VH) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.height * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.height * 0.01;\n }\n }\n temp.push([k, v]);\n });\n if(temp.length) {\n matrix = tf.calMatrix(temp, offsetWidth, offsetHeight, this.root);\n }\n }\n computedStyle[TRANSFORM] = matrix || mx.identity();\n }\n if(!matrixCache) {\n let m = computedStyle[TRANSFORM];\n let tfo = computedStyle[TRANSFORM_ORIGIN].slice(0);\n tfo[0] += sx1 || 0;\n tfo[1] += sy1 || 0;\n matrixCache = __cacheStyle[MATRIX] = tf.calMatrixByOrigin(m, tfo);\n }\n }\n return matrixCache;\n }\n\n /**\n * 将currentStyle计算为computedStyle,同时存入cacheStyle可缓存的结果防止无变更重复计算\n * @param renderMode\n * @param ctx\n * @param parent\n * @param __cacheStyle\n * @param currentStyle\n * @param computedStyle\n * @param clientWidth\n * @param clientHeight\n * @param offsetWidth\n * @param offsetHeight\n * @param borderTopWidth\n * @param borderRightWidth\n * @param borderBottomWidth\n * @param borderLeftWidth\n * @param paddingTop\n * @param paddingRight\n * @param paddingBottom\n * @param paddingLeft\n * @param x1\n * @param x2\n * @param x3\n * @param x4\n * @param x5\n * @param x6\n * @param y1\n * @param y2\n * @param y3\n * @param y4\n * @param y5\n * @param y6\n * @returns {*[]}\n * @private\n */\n __calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6) {\n let bx1 = x1, by1 = y1, bx2 = x6, by2 = y6;\n let backgroundClip = computedStyle[BACKGROUND_CLIP] = currentStyle[BACKGROUND_CLIP];\n // 默认border-box\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n bx1 = x2;\n by1 = y2;\n bx2 = x5;\n by2 = y5;\n }\n else if(backgroundClip === 'contentBox' || backgroundClip === 'content-box') {\n bx1 = x3;\n by1 = y3;\n bx2 = x4;\n by2 = y4;\n }\n let isInline = this.__config[NODE_IS_INLINE];\n if(isInline && !this.contentBoxList.length) {\n isInline = false;\n }\n // 这些直接赋值的不需要再算缓存\n [\n OPACITY,\n Z_INDEX,\n BORDER_TOP_STYLE,\n BORDER_RIGHT_STYLE,\n BORDER_BOTTOM_STYLE,\n BORDER_LEFT_STYLE,\n BACKGROUND_REPEAT,\n OVERFLOW,\n MIX_BLEND_MODE,\n TEXT_OVERFLOW,\n BACKGROUND_CLIP,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n if(isNil(__cacheStyle[FILTER])) {\n __cacheStyle[FILTER] = true;\n this.__calFilter(currentStyle, computedStyle);\n }\n if(isNil(__cacheStyle[BACKGROUND_POSITION_X])) {\n __cacheStyle[BACKGROUND_POSITION_X] = true;\n let {\n [BACKGROUND_POSITION_X]: bgX,\n } = currentStyle;\n computedStyle[BACKGROUND_POSITION_X] = (bgX || []).map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n if(item[1] === PERCENT) {\n return item[0] + '%';\n }\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_POSITION_Y])) {\n __cacheStyle[BACKGROUND_POSITION_Y] = true;\n let {\n [BACKGROUND_POSITION_Y]: bgY,\n } = currentStyle;\n computedStyle[BACKGROUND_POSITION_Y] = (bgY || []).map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n if(item[1] === PERCENT) {\n return item[0] + '%';\n }\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_SIZE])) {\n __cacheStyle[BACKGROUND_SIZE] = true;\n computedStyle[BACKGROUND_SIZE] = (currentStyle[BACKGROUND_SIZE] || []).map(item => {\n return bg.calBackgroundSize(item, bx2 - bx1, by2 - by1, this.root);\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_IMAGE])) {\n let bgI = computedStyle[BACKGROUND_IMAGE] = currentStyle[BACKGROUND_IMAGE].slice(0);\n __cacheStyle[BACKGROUND_IMAGE] = bgI.map((bgi, i) => {\n if(!bgi) {\n return null;\n }\n // 防止隐藏不加载背景图\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i] = this.__loadBgi[i] || {};\n let cache = inject.IMG[BACKGROUND_IMAGE];\n if(cache && cache.state === inject.LOADED) {\n loadBgi.url = BACKGROUND_IMAGE;\n loadBgi.source = cache.source;\n loadBgi.width = cache.width;\n loadBgi.height = cache.height;\n }\n else if(loadBgi.url !== bgi) {\n // 可能改变导致多次加载,每次清空,成功后还要比对url是否相同\n loadBgi.url = bgi;\n loadBgi.source = null;\n let node = this;\n let root = node.root;\n inject.measureImg(bgi, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败不绘制bgi\n if(data.success && data.url === loadBgi.url && !this.isDestroyed) {\n loadBgi.source = data.source;\n loadBgi.width = data.width;\n loadBgi.height = data.height;\n root.delRefreshTask(loadBgi.cb);\n root.addRefreshTask(loadBgi.cb = {\n __before() {\n __cacheStyle[BACKGROUND_IMAGE] = undefined;\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_FOCUS] = REPAINT;\n res[UPDATE_CONFIG] = node.__config;\n root.__addUpdate(node, node.__config, root, root.__config, res);\n },\n });\n }\n }, {\n ctx,\n root,\n width: bx2 - bx1,\n height: by2 - by1,\n });\n }\n return true;\n }\n else if(!isInline && bgi.k) {\n // gradient在渲染时才生成\n return true;\n }\n });\n }\n if(isNil(__cacheStyle[BOX_SHADOW])) {\n __cacheStyle[BOX_SHADOW] = true;\n computedStyle[BOX_SHADOW] = (currentStyle[BOX_SHADOW] || []).map(item => {\n return item.map((item2, i) => {\n if(i > 3) {\n return item2;\n }\n let v = item2[0];\n if(item2[1] === PERCENT) {\n if(i % 2 === 0) {\n v *= 0.01 * (bx2 - bx1);\n }\n else {\n v *= 0.01 * (by2 - by1);\n }\n }\n else if(item2[1] === REM) {\n v = v * this.root.computedStyle[FONT_SIZE];\n }\n else if(item2[1] === VW) {\n v = v * this.root.width * 0.01;\n }\n else if(item2[1] === VH) {\n v = v * this.root.height * 0.01;\n }\n return v;\n });\n });\n }\n [\n BACKGROUND_COLOR,\n BORDER_TOP_COLOR,\n BORDER_RIGHT_COLOR,\n BORDER_BOTTOM_COLOR,\n BORDER_LEFT_COLOR,\n ].forEach(k => {\n if(isNil(__cacheStyle[k])) {\n __cacheStyle[k] = int2rgba(computedStyle[k] = currentStyle[k][0]);\n }\n });\n // 圆角边计算\n if(isNil(__cacheStyle[BORDER_TOP_LEFT_RADIUS])\n || isNil(__cacheStyle[BORDER_TOP_RIGHT_RADIUS])\n || isNil(__cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS])\n || isNil(__cacheStyle[BORDER_BOTTOM_LEFT_RADIUS])) {\n __cacheStyle[BORDER_TOP_LEFT_RADIUS]\n = __cacheStyle[BORDER_TOP_RIGHT_RADIUS]\n = __cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS]\n = __cacheStyle[BORDER_BOTTOM_LEFT_RADIUS]\n = true;\n // 非替代的inline计算看contentBox首尾\n if(isInline) {\n border.calBorderRadiusInline(this.contentBoxList, currentStyle, computedStyle, this.root);\n }\n // 普通block整体计算\n else {\n border.calBorderRadius(offsetWidth, offsetHeight, currentStyle, computedStyle, this.root);\n }\n }\n // width/style/radius影响border,color不影响渲染缓存\n let btlr = computedStyle[BORDER_TOP_LEFT_RADIUS];\n let btrr = computedStyle[BORDER_TOP_RIGHT_RADIUS];\n let bbrr = computedStyle[BORDER_BOTTOM_RIGHT_RADIUS];\n let bblr = computedStyle[BORDER_BOTTOM_LEFT_RADIUS];\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k;\n let k2 = STYLE_KEY[style2Upper(k)];\n let kw = STYLE_KEY[style2Upper(k + 'Width')];\n let ks = STYLE_KEY[style2Upper(k + 'Style')];\n // width/style变更影响border重新计算\n if(isNil(__cacheStyle[kw])) {\n __cacheStyle[kw] = true;\n __cacheStyle[k2] = undefined;\n }\n if(isNil(__cacheStyle[ks])) {\n __cacheStyle[ks] = true;\n __cacheStyle[k2] = undefined;\n }\n if(isNil(__cacheStyle[k2])) {\n if(k2 === BORDER_TOP) {\n if(borderTopWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderTopWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 0, btlr, btrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_RIGHT) {\n if(borderRightWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderRightWidth / borderTopWidth);\n let deg2 = Math.atan(borderRightWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderRightWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 1, btrr, bbrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_BOTTOM) {\n if(borderBottomWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderBottomWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 2, bblr, bbrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_LEFT) {\n if(borderLeftWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderLeftWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 3, btlr, bblr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n }\n });\n // 强制计算继承性的\n let parentComputedStyle = parent && parent.computedStyle;\n if(currentStyle[FONT_STYLE][1] === INHERIT) {\n computedStyle[FONT_STYLE] = parent ? parentComputedStyle[FONT_STYLE] : 'normal';\n }\n else if(isNil(__cacheStyle[FONT_STYLE])) {\n computedStyle[FONT_STYLE] = currentStyle[FONT_STYLE][0];\n }\n __cacheStyle[FONT_STYLE] = computedStyle[FONT_STYLE];\n if(currentStyle[COLOR][1] === INHERIT) {\n computedStyle[COLOR] = parent ? parentComputedStyle[COLOR] : [0, 0, 0, 1];\n __cacheStyle[COLOR] = int2rgba(computedStyle[COLOR]);\n }\n else if(isNil(__cacheStyle[COLOR])) {\n computedStyle[COLOR] = rgba2int(currentStyle[COLOR][0]);\n __cacheStyle[COLOR] = int2rgba(computedStyle[COLOR]);\n }\n if(currentStyle[TEXT_STROKE_COLOR][1] === INHERIT) {\n computedStyle[TEXT_STROKE_COLOR] = parent ? parentComputedStyle[TEXT_STROKE_COLOR] : [0, 0, 0, 1];\n __cacheStyle[TEXT_STROKE_COLOR] = int2rgba(computedStyle[TEXT_STROKE_COLOR]);\n }\n else if(isNil(__cacheStyle[TEXT_STROKE_COLOR])) {\n computedStyle[TEXT_STROKE_COLOR] = rgba2int(currentStyle[TEXT_STROKE_COLOR][0]);\n __cacheStyle[TEXT_STROKE_COLOR] = int2rgba(computedStyle[TEXT_STROKE_COLOR]);\n }\n if(currentStyle[TEXT_STROKE_WIDTH][1] === INHERIT) {\n computedStyle[TEXT_STROKE_WIDTH] = parent ? parentComputedStyle[TEXT_STROKE_WIDTH] : 0;\n __cacheStyle[TEXT_STROKE_WIDTH] = true;\n }\n else if(isNil(__cacheStyle[TEXT_STROKE_WIDTH])) {\n let v = currentStyle[TEXT_STROKE_WIDTH];\n if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else {\n v = v[0];\n }\n computedStyle[TEXT_STROKE_WIDTH] = v;\n __cacheStyle[TEXT_STROKE_WIDTH] = true;\n }\n if(currentStyle[TEXT_STROKE_OVER][1] === INHERIT) {\n __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = parent ? parentComputedStyle[TEXT_STROKE_OVER] : 'none';\n }\n else {\n __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = currentStyle[TEXT_STROKE_OVER][0];\n }\n if(currentStyle[VISIBILITY][1] === INHERIT) {\n computedStyle[VISIBILITY] = parent ? parentComputedStyle[VISIBILITY] : 'visible';\n }\n else if(isNil(__cacheStyle[VISIBILITY])) {\n computedStyle[VISIBILITY] = currentStyle[VISIBILITY][0];\n }\n __cacheStyle[VISIBILITY] = computedStyle[VISIBILITY];\n if(currentStyle[POINTER_EVENTS][1] === INHERIT) {\n computedStyle[POINTER_EVENTS] = parent ? parentComputedStyle[POINTER_EVENTS] : 'auto';\n }\n else if(isNil(__cacheStyle[POINTER_EVENTS])) {\n computedStyle[POINTER_EVENTS] = currentStyle[POINTER_EVENTS][0];\n }\n __cacheStyle[POINTER_EVENTS] = computedStyle[POINTER_EVENTS];\n 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 {\n ppt = v[0];\n }\n computedStyle[PERSPECTIVE] = ppt;\n }\n if(isNil(__cacheStyle[PERSPECTIVE_ORIGIN])) {\n __cacheStyle[PERSPECTIVE_ORIGIN] = true;\n rebuild = true;\n computedStyle[PERSPECTIVE_ORIGIN] = tf.calOrigin(currentStyle[PERSPECTIVE_ORIGIN], this.offsetWidth, this.offsetHeight, this.root);\n }\n if(rebuild) {\n if(sx1 === undefined) {\n sx1 = this.__sx1;\n sy1 = this.__sy1;\n }\n let po = computedStyle[PERSPECTIVE_ORIGIN].slice(0);\n po[0] += sx1 || 0;\n po[1] += sy1 || 0;\n __config[NODE_PERSPECTIVE_MATRIX] = tf.calPerspectiveMatrix(computedStyle[PERSPECTIVE], po);\n }\n }\n\n __calFilter(currentStyle, computedStyle) {\n return computedStyle[FILTER] = (currentStyle[FILTER] || []).map(item => {\n let [k, v] = item;\n // 部分%单位的滤镜强制使用数字\n if(v[1] === PX || v[1] === DEG || v[1] === PERCENT || v[1] === NUMBER) {\n v = v[0];\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n return [k, v];\n });\n }\n\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n if(renderMode === CANVAS || renderMode === WEBGL) {\n if(lv < REPAINT) {\n return this.__hasContent;\n }\n let visibility = currentStyle[VISIBILITY];\n if(visibility !== 'hidden') {\n let bgI = currentStyle[BACKGROUND_IMAGE];\n if(Array.isArray(bgI)) {\n for(let i = 0, len = bgI.length; i < len; i++) {\n if(bgI[i]) {\n return true;\n }\n }\n }\n if(currentStyle[BACKGROUND_COLOR][0][3] > 0) {\n let width = computedStyle[WIDTH], height = computedStyle[HEIGHT],\n paddingTop = computedStyle[PADDING_TOP], paddingRight = computedStyle[PADDING_RIGHT],\n paddingBottom = computedStyle[PADDING_BOTTOM], paddingLeft = computedStyle[PADDING_LEFT];\n if(width && height || paddingTop || paddingRight || paddingBottom || paddingLeft) {\n return true;\n }\n }\n for(let list = ['Top', 'Right', 'Bottom', 'Left'], i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n if(computedStyle[STYLE_KEY[style2Upper('border' + k + 'Width')]] > 0\n && currentStyle[STYLE_KEY[style2Upper('border' + k + 'Color')]][0][3] > 0) {\n return true;\n }\n }\n let bs = currentStyle[BOX_SHADOW];\n if(Array.isArray(bs)) {\n for(let i = 0, len = bs.length; i < len; i++) {\n let item = bs[i];\n if(item && (item[2] > 0 || item[3] > 0)) {\n return true;\n }\n }\n }\n }\n }\n return false;\n }\n\n /**\n * 渲染基础方法,Dom/Geom公用\n * @param renderMode\n * @param lv\n * @param ctx canvas/svg/webgl共用\n * @param cache 是否是局部根节点缓存模式下的绘制\n * @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 this.__bbox = null;\n if(isDestroyed) {\n return { isDestroyed, break: true };\n }\n let virtualDom;\n // svg设置vd上的lv属性标明lineHeight的话,另外特殊字体如arial拥有lineGap也会产生间隙,背景色不绘制这个间隙\n * x轴根据contentBox的范围坐标,y则固定和font/lineHeight相关\n * 圆角发生在首尾lineBox处,中间不会有,bgi则产生类似bgc作为mask的效果\n * 另外要注意多个时的顺序,必须依次渲染,后面的bb可能会覆盖前面行的\n */\n if(isRealInline) {\n let contentBoxList = this.contentBoxList;\n let length = contentBoxList.length;\n let hasBgi = backgroundImage.some(item => item);\n if(length) {\n let {\n [FONT_SIZE]: fontSize,\n [FONT_FAMILY]: fontFamily,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let iw = 0, ih = 0;\n let offscreen, svgBgSymbol = [];\n // bgi视作inline排满一行绘制,然后按分行拆开给每行\n if(hasBgi) {\n iw = inline.getInlineWidth(this, contentBoxList);\n ih = lineHeight;\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n iw += paddingLeft + paddingRight;\n ih += paddingTop + paddingBottom;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n iw += paddingLeft + paddingRight + borderLeftWidth + borderRightWidth;\n ih += paddingTop + paddingBottom + borderTopWidth + borderBottomWidth;\n }\n if(renderMode === CANVAS || renderMode === WEBGL) {\n offscreen = inject.getCacheCanvas(iw, ih, '__$$INLINE_BGI$$__');\n }\n let length = backgroundImage.length;\n backgroundImage.slice(0).reverse().forEach((bgi, i) => {\n if(!bgi) {\n return;\n }\n i = length - 1 - i;\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i];\n if(loadBgi.url === backgroundImage[i]) {\n let uuid = bg.renderImage(this, renderMode, offscreen && offscreen.ctx || ctx, loadBgi,\n 0, 0, iw, ih, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, true, 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.delRefreshTask(this.__loadBgi.cb);\n root.delRefreshTask(this.__task);\n this.__task = null;\n this.__root = null;\n this.clearCache();\n }\n\n // 先查找到注册了事件的节点,再捕获冒泡判断增加性能\n __emitEvent(e, force) {\n let { isDestroyed, computedStyle, isMask } = this;\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || e.__stopPropagation || isMask) {\n return;\n }\n let { event: { type } } = e;\n let { listener, __hasMask } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // touchmove之类强制的直接由Root通知即可\n if(force) {\n if(computedStyle[POINTER_EVENTS] !== 'none' && util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n // 非force的判断事件坐标是否在节点内\n if(this.willResponseEvent(e)) {\n // 如果有mask,点在mask上才行,点在clip外才行\n if(__hasMask) {\n let next = this.next;\n let isClip = next.isClip;\n let hasEmitMask;\n while(next && next.isMask) {\n if(next.willResponseEvent(e, true)) {\n hasEmitMask = true;\n break;\n }\n next = next.next;\n }\n if(!isClip && !hasEmitMask) {\n return;\n }\n }\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n\n willResponseEvent(e, ignore) {\n let { x, y } = e;\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent, computedStyle } = this;\n if(computedStyle[POINTER_EVENTS] === 'none') {\n return;\n }\n let inThis = geom.pointInQuadrilateral(\n x, y,\n __sx1, __sy1,\n __sx1 + offsetWidth, __sy1,\n __sx1 + offsetWidth, __sy1 + offsetHeight,\n __sx1, __sy1 + offsetHeight,\n matrixEvent\n );\n if(inThis) {\n if(!e.target && !ignore) {\n e.target = this;\n // 缓存target给move用\n if(e.event.type === 'touchstart') {\n this.root && (this.root.__touchstartTarget = this);\n }\n }\n return true;\n }\n }\n\n __gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi, 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(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, formatStyle);\n if(util.isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n // 传入格式化好key/value的样式\n updateFormatStyle(style, cb) {\n let node = this;\n let { root, __config } = node;\n if(root) {\n root.addRefreshTask(node.__task = {\n __before() {\n node.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(__config[NODE_IS_DESTROYED]) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n res[UPDATE_CONFIG] = __config;\n root.__addUpdate(node, __config, root, root.__config, res);\n },\n __after(diff) {\n if(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, style);\n if(util.isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n animate(list, options = {}) {\n let animation = new Animation(this, list, options);\n if(this.isDestroyed) {\n animation.__destroy(true);\n return animation;\n }\n this.animationList.push(animation);\n if(options.autoPlay === false) {\n return animation;\n }\n return animation.play();\n }\n\n removeAnimate(o) {\n if(o instanceof Animation) {\n let i = this.animationList.indexOf(o);\n if(i > -1) {\n o.cancel();\n o.__destroy();\n this.animationList.splice(i, 1);\n }\n }\n }\n\n clearAnimate() {\n this.animationList.splice(0).forEach(o => {\n o.cancel();\n o.__destroy();\n });\n }\n\n frameAnimate(cb) {\n if(util.isFunction(cb)) {\n let list = this.__frameAnimateList;\n // 防止重复\n for(let i = 0, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n return cb;\n }\n }\n let enter = {\n __after(diff) {\n cb(diff);\n },\n __karasFramecb: cb,\n };\n list.push(enter);\n frame.onFrame(enter);\n return cb;\n }\n }\n\n removeFrameAnimate(cb) {\n for(let i = 0, list = this.__frameAnimateList, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n list.splice(i, 1);\n frame.offFrame(cb);\n return;\n }\n }\n }\n\n clearFrameAnimate() {\n this.__frameAnimateList.splice(0).forEach(o => {\n frame.offFrame(o);\n });\n }\n\n __computeMeasure(renderMode, ctx, cb) {\n css.computeMeasure(this);\n if(util.isFunction(cb)) {\n cb(this);\n }\n }\n\n __deepScan(cb, options) {\n return cb(this, options);\n }\n\n // isLayout为false时,为relative/margin/flex/vertical等\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.__layoutData.x += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sx1 += diff;\n this.__sx2 += diff;\n this.__sx3 += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.__layoutData.y += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sy1 += diff;\n this.__sy2 += diff;\n this.__sy3 += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n }\n\n __resizeX(diff, lv) {\n this.computedStyle.width = this.__width += diff;\n this.__clientWidth += diff;\n this.__offsetWidth += diff;\n this.__outerWidth += diff;\n this.__layoutData.w += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __resizeY(diff, lv) {\n this.computedStyle.height = this.__height += diff;\n this.__clientHeight += diff;\n this.__offsetHeight += diff;\n this.__outerHeight += diff;\n this.__layoutData.h += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __spreadBbox(boxShadow) {\n let ox = 0, oy = 0;\n if(Array.isArray(boxShadow)) {\n boxShadow.forEach(item => {\n let [x, y, sigma, spread, , inset] = item;\n if(inset !== 'inset') {\n let d = blur.outerSize(sigma);\n d += spread;\n ox = Math.max(ox, x + d);\n oy = Math.max(oy, y + d);\n }\n });\n }\n return [ox, oy];\n }\n\n __releaseWhenEmpty(__cache) {\n if(__cache && __cache.available) {\n __cache.release();\n }\n return true;\n }\n\n getComputedStyle(key) {\n let computedStyle = this.computedStyle;\n let res = {};\n let keys;\n if(key) {\n if(Array.isArray(key)) {\n keys = key;\n }\n else {\n keys = [key];\n }\n keys = keys.map(s => {\n return STYLE_KEY[style2Upper(s)];\n });\n }\n else {\n keys = Object.keys(computedStyle);\n }\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n res[k] = computedStyle[k];\n }\n else {\n res[STYLE_RV_KEY[k]] = computedStyle[k];\n }\n });\n return res;\n }\n\n getBoundingClientRect() {\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent } = this;\n let p1 = point2d(mx.calPoint([__sx1, __sy1], matrixEvent));\n let p2 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1], matrixEvent));\n let p3 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1 + offsetHeight], matrixEvent));\n let p4 = point2d(mx.calPoint([__sx1, __sy1 + offsetHeight], matrixEvent));\n return {\n left: Math.min(p1[0], Math.min(p2[0], Math.min(p3[0], p4[0]))),\n top: Math.min(p1[1], Math.min(p2[1], Math.min(p3[1], p4[1]))),\n right: Math.max(p1[0], Math.max(p2[0], Math.max(p3[0], p4[0]))),\n bottom: Math.max(p1[1], Math.max(p2[1], Math.max(p3[1], p4[1]))),\n points: [p1, p2, p3, p4],\n };\n }\n\n // img和geom返回false,在inline布局时判断是否是真的inline\n __isRealInline() {\n return true;\n }\n\n remove(cb) {\n let self = this;\n if(self.isDestroyed) {\n inject.warn('Remove target is destroyed.');\n if(util.isFunction(cb)) {\n cb();\n }\n return;\n }\n let { root, domParent } = self;\n let target = self.isShadowRoot ? self.hostRoot : self;\n // 特殊情况连续append/remove时候,还未被添加进来找不到所以无需删除\n if(domParent.children.indexOf(target) === -1) {\n if(util.isFunction(cb)) {\n cb();\n }\n return;\n }\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n let pJson = domParent.__json;\n let i = pJson.children.indexOf(self.isShadowRoot ? self.hostRoot.__json : self.__json);\n let zChildren = domParent.zIndexChildren;\n let j = zChildren.indexOf(self.isShadowRoot ? self.hostRoot : self);\n if(i === -1 || j === -1) {\n throw new Error('Remove index Exception.')\n }\n pJson.children.splice(i, 1);\n domParent.children.splice(i, 1);\n zChildren.splice(j, 1);\n if(self.__prev) {\n self.__prev.__next = self.__next;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_REMOVE_DOM] = true;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after(diff) {\n self.isShadowRoot ? self.hostRoot.__destroy() : self.__destroy();\n if(util.isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get sx() {\n return this.__sx;\n }\n\n get sy() {\n return this.__sy;\n }\n\n get clientWidth() {\n return this.__clientWidth || 0;\n }\n\n get clientHeight() {\n return this.__clientHeight || 0;\n }\n\n get offsetWidth() {\n return this.__offsetWidth || 0;\n }\n\n get offsetHeight() {\n return this.__offsetHeight || 0;\n }\n\n get outerWidth() {\n return this.__outerWidth || 0;\n }\n\n get outerHeight() {\n return this.__outerHeight || 0;\n }\n\n // 不考虑margin的范围,>=REPAINT渲染或个别有影响的渲染改变(如blur)清空缓存\n get bbox() {\n if(!this.__bbox) {\n let {\n __sx1, __sy1, clientWidth, clientHeight,\n currentStyle: {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BOX_SHADOW]: boxShadow,\n },\n } = this;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n clientWidth += borderLeftWidth[0] + borderRightWidth[0];\n clientHeight += borderTopWidth[0] + borderBottomWidth[0];\n let half = 1;\n this.__bbox = [__sx1 - ox - half, __sy1 - oy - half, __sx1 + clientWidth + ox + half, __sy1 + clientHeight + oy + half];\n }\n return this.__bbox;\n }\n\n get listener() {\n return this.__listener;\n }\n\n get matrix() {\n return this.__config[NODE_MATRIX];\n }\n\n get matrixEvent() {\n return this.__config[NODE_MATRIX_EVENT];\n }\n\n get perspectiveMatrix() {\n return this.__config[NODE_PERSPECTIVE_MATRIX];\n }\n\n get style() {\n return this.__style;\n }\n\n get computedStyle() {\n return this.__computedStyle;\n }\n\n get animationList() {\n return this.__animationList;\n }\n\n get currentStyle() {\n return this.__currentStyle;\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get contentBoxList() {\n return this.__contentBoxList;\n }\n\n get baseLine() {\n return this.offsetHeight;\n }\n\n get firstBaseLine() {\n return this.offsetHeight;\n }\n\n get isMask() {\n return this.__isMask;\n }\n\n get isClip() {\n return this.__isClip;\n }\n\n 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 n = this.baseLine;\n // 只有1个也需要对齐,因为可能内嵌了空inline使得baseLine发生变化\n if(this.list.length) {\n this.list.forEach(item => {\n let m = item.baseLine;\n if(m !== n) {\n item.__offsetY(n - m);\n }\n });\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n /**\n * 防止非行首空inline,每当遇到inline就设置当前lineBox的lineHeight/baseLine,这样有最小值兜底\n * @param l\n * @param b\n * @private\n */\n __setLB(l, b) {\n this.__lineHeight = Math.max(l, this.__lineHeight);\n this.__baseLine = Math.max(b, this.__baseLine);\n }\n\n get list() {\n return this.__list;\n }\n\n get size() {\n return this.__list.length;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endY() {\n return this.y + this.height;\n }\n\n get width() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let first = list[0];\n let last = list[length - 1];\n let x1 = first.x;\n let dom = first instanceof TextBox ? first.parent.domParent : first.domParent;\n // 因为inline可以嵌套inline,所以一直向上查找到非inline为止,每层inline如果是首个则减去左侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [PADDING_LEFT]: paddingLeft,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[0]) {\n x1 -= marginLeft + borderLeftWidth + paddingLeft;\n }\n dom = dom.domParent;\n }\n let x2 = last.x + last.outerWidth;\n dom = last instanceof TextBox ? last.parent.domParent : last.domParent;\n // 同向上查非inline,每层inline如果是最后一个则加上右侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_RIGHT]: paddingRight,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[list.length - 1]) {\n x2 += marginRight + borderRightWidth + paddingRight;\n }\n dom = dom.domParent;\n }\n return x2 - x1;\n }\n return 0;\n }\n\n get height() {\n return this.lineHeight;\n }\n\n get baseLine() {\n let baseLine = 0;\n this.list.forEach(item => {\n baseLine = Math.max(baseLine, item.baseLine);\n });\n return Math.max(this.__baseLine, baseLine);\n }\n\n get lineHeight() {\n let lineHeight = 0;\n // 只有TextBox和InlineBlock\n this.list.forEach(item => {\n lineHeight = Math.max(lineHeight, item.outerHeight);\n });\n return Math.max(this.__lineHeight, lineHeight);\n }\n}\n\nexport default LineBox;\n","import LineBox from './LineBox';\n\n/**\n * 维护一个上下文的LineBox,向LineBox中添加Item以及新增下一行的LineBox,多个LineBox组成一个区域\n * 一个block/inlineBlock拥有一个本类对象,上下文即对应这个dom流,而inline则复用最近非inline父元素的\n * 同时LineBox可能连续也可能不连续,不连续的是中间有block之类的隔离开来\n */\nclass LineBoxManager {\n constructor(x, y, lineHeight, baseLine) {\n this.__x = this.__lastX = x; // last存储目前最后一行LineBox的结尾位置,供后续inline使用\n this.__y = this.__lastY = y;\n this.__maxX = x;\n this.__domList = [];\n this.__domStack = [];\n this.__list = []; // 包含若干LineBox\n this.__isNewLine = true; // 区域内是否是新行,容器dom(block)开头肯定是\n this.__lineHeight = lineHeight;\n this.__baseLine = baseLine;\n this.__isEnd = true; // 在dom中是否一个区域处在结尾,外部控制\n }\n\n /**\n * 每次换行时重新生成LineBox存入列表,同时由于flow流当前一定是流(dom)的结尾,设置isEnd\n * @returns {LineBox}\n */\n genLineBox(x, y) {\n let lineBox = new LineBox(x, y, this.__lineHeight, this.__baseLine);\n this.list.push(lineBox);\n this.__isEnd = true;\n return lineBox;\n }\n\n /**\n * inline的特殊调用,防止空内容但有mbp的inline不占位,放入一个有lineHeight的空lineBox\n * 只有新行开头时需要,后面的无论是否有内容都会影响lineHeight\n * @param x\n * @param y\n * @param l\n * @param b\n * @returns {LineBox}\n */\n genLineBoxByInlineIfNewLine(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseLine = Math.max(this.__baseLine, b);\n if(this.__isNewLine) {\n let lineBox = new LineBox(x, y, lineHeight, baseLine);\n this.list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n }\n\n setLbOrGenLineBoxByInline(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseLine = Math.max(this.__baseLine, b);\n let lineBox;\n let list = this.list;\n if(this.__isNewLine) {\n lineBox = new LineBox(x, y, lineHeight, baseLine);\n list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n else {\n let length = list.length;\n lineBox = list[length - 1];\n lineBox.__setLB(l, b);\n }\n }\n\n /**\n * 外部设置为结尾,如一个LineBox后出现一个block,此时会被隔断,不再作为流的末尾\n */\n setNotEnd() {\n this.__isEnd = false;\n }\n\n /**\n * 外部设置新行,下次新生成LineBox\n */\n setNewLine() {\n this.__isNewLine = true;\n }\n\n /**\n * 当前LineBox放入一个新项,当新行时(如第一行)产生一个新的LineBox并存入列表\n * 是否新区域和新行都是可以被外部控制,默认第一行是新\n * 当被隔断后会被外部重置新行,这样会生成新的来作为新加项的LineBox\n * 当换行时外部也会调用新行,这样再次添加Item时会自动生成新的LineBox而不是用之前的\n * @param o TextBox/Inline/InlineBlock\n * @param nextNewLine 是否设置newLine,标明下次添加新生成LineBox\n * @returns {LineBox}\n */\n addItem(o, nextNewLine) {\n let lineBox;\n if(this.__isNewLine) {\n this.__isNewLine = false;\n lineBox = this.genLineBox(o.x, o.y);\n }\n else {\n let list = this.list;\n let length = list.length;\n lineBox = list[length - 1];\n }\n // inline递归过程中所有inline父子顺序列表,每个dom都需要对当前内容保存\n this.__domStack.forEach(item => {\n item.__contentBoxList.push(o);\n });\n lineBox.add(o);\n // 设置结束x的位置给next的inline标记用,o可能是TextBox或inlineBlock,当next新行时注意位置\n if(nextNewLine) {\n this.__isNewLine = true;\n this.__lastX = o.x;\n this.__lastY = o.y + o.outerHeight;\n }\n else {\n this.__lastX = o.x + o.outerWidth;\n this.__lastY = o.y;\n }\n this.__maxX = Math.max(this.__maxX, o.x + o.outerWidth);\n return lineBox;\n }\n\n horizonAlign(w, textAlign) {\n this.list.forEach(lineBox => {\n let diff = w - lineBox.width;\n if(diff > 0) {\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n lineBox.__offsetX(diff);\n lineBox.list.forEach(item => {\n item.__offsetX(diff, true);\n });\n }\n });\n }\n\n verticalAlign() {\n this.list.forEach(lineBox => {\n lineBox.verticalAlign();\n });\n }\n\n addX(n) {\n this.__lastX += n;\n }\n\n /**\n * inline递归过程中布局调用,不断出入栈dom对象,获取当前行状态下有哪些dom还在\n * @param dom\n */\n pushContentBoxList(dom) {\n this.__domList.push(dom);\n this.__domStack.push(dom);\n }\n\n popContentBoxList() {\n this.__domStack.pop();\n }\n\n __offsetX(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetX(diff);\n });\n }\n\n __offsetY(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetY(diff);\n });\n }\n\n /**\n * inline的特殊调用,非行首无论是否有内容都设置lineBox的lineHeight\n * @param l\n * @param b\n * @private\n */\n setLbByInlineIfNotNewLine(l, b) {\n let length = this.list.length;\n if(length && !this.isNewLine) {\n this.list[length - 1].__setLB(l, b);\n }\n }\n\n get size() {\n return this.list.length;\n }\n\n get lastX() {\n return this.__lastX;\n }\n\n get lastY() {\n return this.__lastY;\n }\n\n get endY() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[length - 1].endY;\n }\n return this.__y;\n }\n\n get isEnd() {\n return this.__isEnd;\n }\n\n get isNewLine() {\n return this.__isNewLine;\n }\n\n get breakLine() {\n return this.list.length > 1;\n }\n\n get domList() {\n return this.__domList;\n }\n\n get baseLine() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let n = 0;\n for(let i = 0; i < length - 1; i++) {\n n += list[i].height;\n }\n return n + list[length - 1].baseLine;\n }\n return 0;\n }\n\n get firstBaseLine() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[0].baseLine;\n }\n return 0;\n }\n\n get lineHeight() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1].lineHeight;\n }\n return 0;\n }\n\n get lineBox() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1];\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get width() {\n let w = 0;\n this.list.forEach(item => {\n w = Math.max(w, item.width);\n });\n return w;\n }\n}\n\nexport default LineBoxManager;\n","const TAG_NAME = {\n 'div': true,\n 'p': true,\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst INLINE = {\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst BOLD = {\n 'b': true,\n 'strong': true,\n}\n\nexport default {\n TAG_NAME,\n INLINE,\n BOLD,\n};\n","import enums from '../util/enums';\nimport unit from '../style/unit';\nimport level from './level';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n TOP,\n BOTTOM,\n POSITION,\n HEIGHT,\n },\n} = enums;\nconst { AUTO, PX, PERCENT } = unit;\nconst { REFLOW } = level;\n\nfunction offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) {\n if(dy) {\n let last;\n do {\n // component的sr没有next兄弟,视为component的next\n while(node.isShadowRoot) {\n node = node.host;\n }\n last = node;\n let isContainer, parent = node.domParent;\n if(parent) {\n let cs = parent.computedStyle;\n let ps = cs[POSITION];\n isContainer = parent === root || parent.isShadowRoot || ps === 'relative' || ps === 'absolute';\n }\n // 先偏移next,忽略有定位的absolute,本身非container也忽略\n let next = node.next;\n let container;\n while(next) {\n if(next.currentStyle[DISPLAY] !== 'none') {\n if(next.currentStyle[POSITION] === 'absolute') {\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = next.currentStyle;\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO || bottom[1] === PX) {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n }\n else if(top[1] === PERCENT) {\n let v = top[0] * 0.01 * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, null, next);\n }\n else {\n if(!container) {\n container = parent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, next]);\n }\n }\n }\n else {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n }\n next = next.next;\n }\n // root本身没domParent\n if(!parent) {\n break;\n }\n node = parent;\n // parent判断是否要resize\n let { currentStyle } = node;\n let isAbs = currentStyle[POSITION] === 'absolute';\n let need;\n if(isAbs) {\n if(currentStyle[HEIGHT][1] === AUTO\n && (currentStyle[TOP][1] === AUTO || currentStyle[BOTTOM][1] === AUTO)) {\n need = true;\n }\n }\n // height不定则需要\n else if(currentStyle[HEIGHT][1] === AUTO) {\n need = true;\n }\n if(need) {\n node.__resizeY(dy, REFLOW);\n node.clearCache();\n }\n // abs或者高度不需要继续向上调整提前跳出\n else {\n break;\n }\n if(node === root) {\n break;\n }\n }\n while(true);\n // 最后一个递归向上取消总缓存,防止过程中重复next多次无用递归\n while(last) {\n last.clearCache(true);\n last = last.domParent;\n }\n }\n}\n\nfunction clearUniqueReflowId(hash) {\n for(let i in hash) {\n if(hash.hasOwnProperty(i)) {\n let { node } = hash[i];\n delete node.__uniqueReflowId;\n }\n }\n}\n\nfunction getMergeMarginTB(topList, bottomList) {\n let total = 0;\n let max = topList[0];\n let min = topList[0];\n topList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n bottomList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n // 正数取最大,负数取最小,正负则相加\n let diff = 0;\n if(max > 0 && min > 0) {\n diff = Math.max(max, min) - total;\n }\n else if(max < 0 && min < 0) {\n diff = Math.min(max, min) - total;\n }\n else if(max !== 0 || min !== 0) {\n diff = max + min - total;\n }\n return diff;\n}\n\nexport default {\n offsetAndResizeByNodeOnY,\n clearUniqueReflowId,\n getMergeMarginTB,\n};\n","import Xom from './Xom';\nimport Text from './Text';\nimport mode from './mode';\nimport LineBoxManager from './LineBoxManager';\nimport Component from './Component';\nimport tag from './tag';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport $$type from '../util/$$type';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport reflow from '../refresh/reflow';\nimport builder from '../util/builder';\nimport level from '../refresh/level';\n\nconst {\n STYLE_KEY: {\n POSITION,\n DISPLAY,\n FONT_WEIGHT,\n MARGIN_LEFT,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n PADDING_LEFT,\n PADDING_BOTTOM,\n PADDING_RIGHT,\n PADDING_TOP,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n TOP,\n RIGHT,\n BOTTOM,\n LEFT,\n WIDTH,\n HEIGHT,\n TEXT_ALIGN,\n FLEX_DIRECTION,\n FLEX_BASIS,\n FLEX_SHRINK,\n FLEX_GROW,\n ALIGN_SELF,\n ALIGN_ITEMS,\n JUSTIFY_CONTENT,\n Z_INDEX,\n WHITE_SPACE,\n LINE_HEIGHT,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n OVERFLOW,\n FONT_SIZE,\n // PERSPECTIVE,\n // TRANSFORM,\n },\n NODE_KEY: {\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_STRUCT,\n NODE_DOM_PARENT,\n NODE_IS_INLINE,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_ADD_DOM,\n UPDATE_CONFIG,\n UPDATE_MEASURE,\n },\n STRUCT_KEY: {\n STRUCT_NUM,\n STRUCT_LV,\n STRUCT_TOTAL,\n STRUCT_CHILD_INDEX,\n STRUCT_INDEX,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH } = unit;\nconst { calAbsolute, isRelativeOrAbsolute } = css;\n\nfunction genZIndexChildren(dom) {\n let normal = [];\n let hasMc;\n let mcHash = {};\n let lastMaskIndex;\n let children = dom.children;\n children.forEach((item, i) => {\n let child = item;\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n // 遮罩单独保存后特殊排序\n if(item instanceof Xom && item.isMask) {\n // 开头的mc忽略,后续的连续mc以第一次出现为准\n if(lastMaskIndex !== undefined) {\n mcHash[lastMaskIndex].push(item);\n }\n else if(i) {\n lastMaskIndex = i - 1;\n children[lastMaskIndex].__iIndex = lastMaskIndex;\n mcHash[lastMaskIndex] = [item];\n hasMc = true;\n }\n }\n else {\n lastMaskIndex = undefined;\n if(item instanceof Xom) {\n child.__zIndex = item.currentStyle[Z_INDEX];\n if(isRelativeOrAbsolute(item)) {\n // 临时变量为排序使用\n child.__aIndex = true;\n normal.push(child);\n }\n else {\n normal.push(child);\n }\n }\n else {\n child.__zIndex = 0;\n normal.push(child);\n }\n child.__iIndex = i;\n }\n });\n normal.sort(function(a, b) {\n if(a.__zIndex !== b.__zIndex) {\n return a.__zIndex - b.__zIndex;\n }\n // zIndex相等时abs优先flow\n if(a.__aIndex !== b.__aIndex) {\n if(a.__aIndex) {\n return 1;\n }\n return -1;\n }\n // 都相等看索引\n return a.__iIndex - b.__iIndex;\n });\n // 将遮罩插入到对应顺序上\n if(hasMc) {\n for(let i = normal.length - 1; i >= 0; i--) {\n let idx = normal[i].__iIndex;\n if(mcHash.hasOwnProperty(idx)) {\n normal.splice(i + 1, 0, ...mcHash[idx]);\n }\n }\n }\n return normal;\n}\n\n// flex布局阶段顺序,不是渲染也和struct结构无关,可以无视mask\nfunction genOrderChildren(flowChildren) {\n let normal = [];\n flowChildren.forEach((item, i) => {\n let child = item;\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Xom) {\n child.__order = item.currentStyle[ORDER];\n }\n else {\n child.__order = 0;\n }\n normal.push(child);\n child.__iIndex = i;\n });\n normal.sort(function(a, b) {\n if(a.__order !== b.__order) {\n return a.__order - b.__order;\n }\n // order相等时看节点索引\n return a.__iIndex - b.__iIndex;\n });\n return normal;\n}\n\nclass Dom extends Xom {\n constructor(tagName, props, children) {\n super(tagName, props);\n let { style } = this;\n if(!style.display || !{\n flex: true,\n block: true,\n inline: true,\n inlineBlock: true,\n 'inline-block': true,\n none: true,\n }.hasOwnProperty(style.display)) {\n if(tag.INLINE.hasOwnProperty(this.tagName)) {\n style.display = 'inline';\n }\n else {\n style.display = 'block';\n }\n }\n if(!style[FONT_WEIGHT] && tag.BOLD.hasOwnProperty(tagName)) {\n style.fontWeight = 700;\n }\n this.__style = css.normalize(style, reset.DOM_ENTRY_SET);\n // currentStyle/currentProps不深度clone,继承一层即可,动画时也是extend这样只改一层引用不动原始静态style\n this.__currentStyle = util.extend({}, this.__style);\n this.__children = children || [];\n this.__flexLine = []; // flex布局多行模式时存储行\n let config = this.__config;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_STYLE] = this.__style;\n }\n\n __structure(i, lv, j) {\n let res = super.__structure(i++, lv, j);\n let arr = [res];\n let zIndexChildren = this.__zIndexChildren = this.__zIndexChildren || genZIndexChildren(this);\n zIndexChildren.forEach((child, j) => {\n let temp = child.__structure(i, lv + 1, j);\n if(Array.isArray(temp)) {\n i += temp.length;\n arr = arr.concat(temp);\n }\n else {\n i++;\n arr.push(temp);\n }\n });\n let total = arr.length - 1;\n res[STRUCT_NUM] = zIndexChildren.length;\n res[STRUCT_TOTAL] = total;\n return arr;\n }\n\n __modifyStruct(root, offset = 0) {\n let __config = this.__config;\n let struct = __config[NODE_STRUCT];\n let total = struct[STRUCT_TOTAL] || 0;\n // 新生成了struct,引用也变了\n let nss = this.__structure(struct[STRUCT_INDEX], struct[STRUCT_LV], struct[STRUCT_CHILD_INDEX]);\n root.__structs.splice(struct[STRUCT_INDEX] + offset, total + 1, ...nss);\n let d = 0;\n if(this !== root) {\n struct = __config[NODE_STRUCT];\n d = (struct[STRUCT_TOTAL] || 0) - total;\n let ps = __config[NODE_DOM_PARENT].__config[NODE_STRUCT];\n ps[STRUCT_TOTAL] = ps[STRUCT_TOTAL] || 0;\n ps[STRUCT_TOTAL] += d;\n }\n return [struct, d];\n }\n\n /**\n * 因为zIndex/abs的变化造成的更新,只需重排这一段顺序即可\n * 即便包含component造成的dom变化也不影响,component作为子节点reflow会再执行,这里重排老的vd\n * @param structs\n * @private\n */\n __updateStruct(structs) {\n let { [STRUCT_INDEX]: index, [STRUCT_TOTAL]: total = 0 } = this.__config[NODE_STRUCT];\n let zIndexChildren = this.__zIndexChildren = genZIndexChildren(this);\n let length = zIndexChildren.length;\n if(length === 1) {\n return;\n }\n zIndexChildren.forEach((child, i) => {\n child.__config[NODE_STRUCT][STRUCT_CHILD_INDEX] = i;\n });\n // 按直接子节点划分为相同数量的若干段进行排序\n let arr = [];\n let source = [];\n for(let i = index + 1; i <= index + total; i++) {\n let child = structs[i];\n let o = {\n child,\n list: structs.slice(child[STRUCT_INDEX], child[STRUCT_INDEX] + child[STRUCT_TOTAL] + 1),\n };\n arr.push(o);\n source.push(o);\n i += child[STRUCT_TOTAL] || 0;\n }\n arr.sort(function(a, b) {\n return a.child[STRUCT_CHILD_INDEX] - b.child[STRUCT_CHILD_INDEX];\n });\n // 是否有变更,有才进行重新计算\n let needSort;\n for(let i = 0, len = source.length; i < len; i++) {\n if(source[i] !== arr[i]) {\n needSort = true;\n break;\n }\n }\n if(needSort) {\n let list = [];\n arr.forEach(item => {\n list = list.concat(item.list);\n });\n list.forEach((struct, i) => {\n struct[STRUCT_INDEX] = index + i + 1;\n })\n structs.splice(index + 1, total, ...list);\n }\n }\n\n /**\n * 给定父宽度情况下,尝试行内放下后的剩余宽度,为负数即放不下,这里只会出现行内级即inline(Block)\n * 调用前提是非行开头的inline尝试计算是否放得下,开头无需且禁止判断,防止出现永远放不下一个字符卡死\n * 返回非负数就是放得下,这样一些尺寸为0的也算\n * @param w 剩余宽度\n * @param total 容器尺寸\n * @returns {number|*}\n * @private\n */\n __tryLayInline(w, total) {\n let { flowChildren, currentStyle: {\n [DISPLAY]: display,\n [WIDTH]: width,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n // inline没w/h,并且尝试孩子第一个能放下即可,如果是文字就是第一个字符\n if(display === 'inline') {\n if(flowChildren.length) {\n let first = flowChildren[0];\n if(first instanceof Component) {\n first = first.shadowRoot;\n }\n if(first instanceof Xom) {\n w = first.__tryLayInline(w, total);\n }\n else {\n w -= first.firstCharWidth;\n }\n }\n }\n // inlineBlock尝试所有孩子在一行上\n else {\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n else {\n for(let i = 0; i < flowChildren.length; i++) {\n // 当放不下时直接返回,无需继续多余的尝试计算\n if(w < 0) {\n return w;\n }\n let item = flowChildren[i];\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Xom) {\n w = item.__tryLayInline(w, total);\n }\n // text强制一行,否则非头就是放不下,需从头开始\n else {\n w -= item.textWidth;\n }\n }\n }\n // ib要减去末尾mpb\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n }\n // 还要减去开头的mpb\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n return w;\n }\n\n // 设置y偏移值,递归包括children,此举在justify-content/margin-auto等对齐用\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n // 记得偏移LineBox\n if(isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) {\n this.lineBoxManager.__offsetX(diff);\n }\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetX(diff, isLayout, lv);\n }\n });\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n if(isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) {\n this.lineBoxManager.__offsetY(diff);\n }\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetY(diff, isLayout, lv);\n }\n });\n }\n\n // item的递归子节点求min/max,只考虑固定值单位,忽略百分比,同时按方向和display\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this, this.isShadowRoot);\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h, lineBoxManager } = data;\n // 计算需考虑style的属性\n let {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n else {\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n }\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n else if(display === 'block') {\n let countMin = 0, countMax = 0;\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n countMin = countMax = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n }\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n else {\n if(display === 'inlineBlock' || display === 'inline-block') {\n lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n }\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n if(isDirectionRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else if(isDirectionRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n });\n }\n }\n return [display, this.__addMp(isDirectionRow, w, currentStyle, [min, max])];\n }\n\n /**\n * flex布局时,计算basis尺寸,如果有固定声明则以其为标准,content为内容最大尺寸,auto依赖w/h或降级content\n * basis要考虑相加直接item的mpb,非绝对值单位以container为基准,basis为内容时为max值\n * item的孩子为孙子节点需递归,不参与basis计算,只参与min/max,尺寸和mpb均只考虑绝对值\n * 自动计算时影响尺寸的只有换行的text,以及一组inline,均按其中最大尺寸的一个计算\n * auto自动计算递归进行,如果是普通row方向,按最大text的charWidth为准\n * 如果是column方向,则虚拟布局后看text的height\n * 在abs下时进入特殊状态,无论是row/column,都会按row方向尝试最大尺寸,直到舞台边缘或容器声明的w折行\n * 返回b,声明则按css值,否则是auto/content\n * 返回min为最小宽度,遇到字符/inline则单列排版后需要的最大宽度\n * 返回max为最大宽度,理想情况一排最大值,在abs时isVirtual状态参与计算,文本抵达边界才进行换行\n * @param isDirectionRow\n * @param data\n * @param isVirtual abs非固定尺寸时先进行虚拟布局标识\n * @private\n */\n __calBasis(isDirectionRow, data, isVirtual) {\n css.computeReflow(this, this.isShadowRoot);\n let b = 0;\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h } = data;\n // 计算需考虑style的属性\n let {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n [FLEX_BASIS]: flexBasis,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content\n let isAuto = flexBasis[1] === AUTO;\n let isFixed = [PX, PERCENT, REM, VW, VH].indexOf(flexBasis[1]) > -1;\n let isContent = !isAuto && !isFixed;\n let fixedSize;\n // flex的item固定basis计算\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = fixedSize = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = fixedSize = (isDirectionRow ? w : h) * flexBasis[0] * 0.01;\n }\n else if(flexBasis[1] === REM) {\n b = fixedSize = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = fixedSize = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = fixedSize = flexBasis[0] * this.root.height * 0.01;\n }\n }\n // 已声明主轴尺寸的,当basis是auto时为值\n else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1) && isAuto) {\n if(main[1] === PX) {\n b = fixedSize = main[0];\n }\n else if(main[1] === PERCENT) {\n b = fixedSize = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = fixedSize = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = fixedSize = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = fixedSize = main[0] * this.root.height * 0.01;\n }\n }\n // 非固定尺寸的basis为auto时降级为content\n else if(isAuto) {\n isContent = true;\n }\n // flex的item还是flex时\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n }\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n // flex的item是block/inline时,inline也会变成block统一对待\n else {\n let countMin = 0, countMax = 0;\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n countMin = countMax = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n }\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n if(fixedSize) {\n max = Math.max(fixedSize, max);\n }\n if(isContent) {\n b = max;\n }\n // 直接item的mpb影响basis\n return this.__addMp(isDirectionRow, w, currentStyle, [b, min, max], true);\n }\n\n __layoutNone() {\n super.__layoutNone();\n let { children } = this;\n children.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n item.__layoutNone();\n }\n });\n }\n\n /**\n * block布局,本身固定尺寸优先,否则看内容从上往下从左往右flow流排布\n * 内部inline和inlineBlock组成LineBox,通过LineBoxManager来管理混排的现象\n * LineBoxManager只有block和inlineBlock内部生成,inline会复用最近父级的\n * 内部的block在垂直方向要考虑margin合并的问题,强制所有节点为bfc,精简逻辑\n * @param data\n * @param isVirtual abs无尺寸时提前虚拟布局计算尺寸\n * @private\n */\n __layoutBlock(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n // 虚线管理一个block内部的LineBox列表,使得inline的元素可以中途衔接处理折行\n // 内部维护inline结束的各种坐标来达到目的,遇到block时中断并处理换行坐标\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n // 因精度问题,统计宽度均从0开始累加每行,最后取最大值,仅在abs布局时isVirtual生效\n let maxW = 0;\n let cw = 0;\n // 连续block(flex相同,下面都是)的上下margin合并值记录,合并时从列表中取\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isImg = item.tagName === 'img';\n // 每次循环开始前,这次不是block的话,看之前遗留待合并margin,并重置\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n if(isXom) {\n // inline和inlineBlock的细节不同之处,ib除了w/h之外,更想像block一样占据一行\n // 比如2个inline前面占一半后面比一半多但还是会从一半开始然后第2行换行继续,但ib放不下则重开一行\n // inline和ib能互相嵌套,形成的LineBox中则是TextBox和节点混合\n if(isInlineBlock || isInline) {\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || isInline && whiteSpace === 'nowrap') {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager, // ib内部新生成会内部判断,这里不管统一传入\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样\n if(item.__isIbFull) {\n x = data.x;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // abs统计宽度\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下,内部判断了inline/ib,ib要考虑是否有width\n let fw = item.__tryLayInline(w + data.x - x, w);\n // 放得下继续,奇怪的精度问题,加上阈值\n if(fw >= (-1e-10)) {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n x = data.x;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n if(isVirtual) {\n cw += item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n // block/flex先处理之前可能遗留的最后一行LineBox,然后递归时不传lineBoxManager,其内部生成新的\n else {\n // 非开头,说明之前的text未换行,需要增加行数\n if(x !== data.x && flowChildren[i - 1] instanceof Text) {\n lineClampCount++;\n }\n x = data.x;\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n let isNone = item.currentStyle[DISPLAY] === 'none';\n // 自身无内容\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n y += item.outerHeight;\n lineBoxManager.__lastY = y;\n // absolute/flex前置虚拟计算\n if(isVirtual) {\n maxW = Math.max(maxW, item.outerWidth);\n cw = 0;\n }\n // 空block要留下轮循环看,除非是最后一个,此处非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n item.__offsetY(diff, true);\n y += diff;\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n }\n }\n // 文字和inline类似\n else {\n // lineClamp作用域为block下的inline(同LineBox上下文)\n if(lineClamp && lineClampCount >= lineClamp) {\n return;\n }\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.width;\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x);\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, item.width);\n cw = 0;\n }\n }\n if(isVirtual) {\n cw += item.width;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n });\n // 结束后如果是以LineBox结尾,则需要设置y到这里,否则流布局中block会设置\n // 当以block换行时,新行是true,否则是false即结尾\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n }\n let tw = this.__width = (fixedWidth || !isVirtual) ? w : maxW;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // 非abs提前的虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐\n if(!isVirtual) {\n lineBoxManager.verticalAlign();\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // 所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n this.__marginAuto(currentStyle, data);\n }\n }\n\n // 弹性布局时的计算位置\n __layoutFlex(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle, __flexLine } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n // 每次布局情况多行内容\n __flexLine.splice(0);\n let {\n [FLEX_DIRECTION]: flexDirection,\n [JUSTIFY_CONTENT]: justifyContent,\n [ALIGN_ITEMS]: alignItems,\n [LINE_CLAMP]: lineClamp,\n [FLEX_WRAP]: flexWrap,\n [ALIGN_CONTENT]: alignContent,\n [LINE_HEIGHT]: lineHeight,\n [TEXT_ALIGN]: textAlign,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n let maxX = 0;\n let isDirectionRow = ['column', 'column-reverse', 'columnReverse'].indexOf(flexDirection) === -1;\n // 计算伸缩基数\n let growList = [];\n let shrinkList = [];\n let basisList = [];\n let maxList = [];\n let minList = [];\n let orderChildren = genOrderChildren(flowChildren);\n orderChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n // abs虚拟布局计算时纵向也是看横向宽度\n let [b, min, max] = item.__calBasis(isVirtual ? true : isDirectionRow, { x, y, w, h }, isVirtual);\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += max;\n }\n else {\n maxX = Math.max(maxX, max);\n }\n return;\n }\n let { [FLEX_GROW]: flexGrow, [FLEX_SHRINK]: flexShrink } = currentStyle;\n computedStyle[FLEX_BASIS] = b;\n growList.push(flexGrow);\n shrinkList.push(flexShrink);\n // 根据basis不同,计算方式不同\n basisList.push(b);\n maxList.push(max);\n minList.push(min);\n }\n // 文本\n else {\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += item.textWidth;\n }\n else {\n maxX = Math.max(maxX, item.textWidth);\n }\n return;\n }\n growList.push(0);\n shrinkList.push(1);\n if(isDirectionRow) {\n let cw = item.charWidth;\n let tw = item.textWidth;\n basisList.push(tw);\n maxList.push(tw);\n minList.push(cw);\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n });\n let h = item.height;\n basisList.push(h);\n minList.push(h);\n }\n }\n });\n // abs时,只需关注宽度即可,无需真正布局\n if(isVirtual) {\n let tw = this.__width = Math.min(maxX, w);\n this.__ioSize(tw, this.height);\n return;\n }\n let containerSize = isDirectionRow ? w : h;\n let isMultiLine = flexWrap === 'wrap' || ['wrap-reverse', 'wrapReverse'].indexOf(flexWrap) > -1;\n /**\n * 判断是否需要分行,根据假设主尺寸来统计尺寸和计算,假设主尺寸是clamp(min_main_size, flex_base_size, max_main_size)\n * 当多行时,由于每行一定有最小限制,所以每行一般情况都不是shrink状态,\n * 但也有极端情况,比如一行只能放下1个元素时,且此元素比容器小,会是shrink\n */\n let line = [], sum = 0, hypotheticalList = [];\n basisList.forEach((item, i) => {\n let min = minList[i], max = maxList[i];\n let hypothetical;\n if(item < min) {\n hypothetical = min;\n }\n else if(item > max) {\n hypothetical = max;\n }\n else {\n hypothetical = item;\n }\n hypotheticalList.push(hypothetical);\n if(isMultiLine) {\n // 超过尺寸时,要防止sum为0即1个也会超过尺寸\n if(sum + hypothetical > containerSize) {\n if(sum) {\n __flexLine.push(line);\n line = [orderChildren[i]];\n sum = hypothetical;\n }\n else {\n line.push(orderChildren[i]);\n __flexLine.push(line);\n line = [];\n sum = 0;\n }\n }\n else {\n line.push(orderChildren[i]);\n sum += hypothetical;\n }\n }\n else {\n line.push(orderChildren[i]);\n }\n });\n if(line.length) {\n __flexLine.push(line);\n }\n let offset = 0, clone = { x, y, w, h };\n let maxCrossList = [];\n __flexLine.forEach(item => {\n let length = item.length;\n let end = offset + length;\n let [x1, y1, maxCross] = this.__layoutFlexLine(clone, isDirectionRow, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, orderChildren.slice(offset, end), item, textAlign,\n growList.slice(offset, end), shrinkList.slice(offset, end), basisList.slice(offset, end),\n hypotheticalList.slice(offset, end), minList.slice(offset, end));\n // 下一行/列更新坐标\n if(isDirectionRow) {\n clone.y = y1;\n }\n else {\n clone.x = x1;\n }\n x = Math.max(x, x1);\n y = Math.max(y, y1);\n maxCrossList.push(maxCross);\n offset += length;\n });\n let tw = this.__width = w;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // flexDirection当有reverse时交换每line的主轴序\n if(flexDirection === 'row-reverse' || flexDirection === 'rowReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = tw - item.outerWidth - (item.x - data.x) * 2;\n if(diff) {\n item.__offsetX(diff, true);\n }\n });\n });\n }\n else if(flexDirection === 'column-reverse' || flexDirection === 'columnReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = th - item.outerHeight - (item.y - data.y) * 2;\n if(diff) {\n item.__offsetY(diff, true);\n }\n });\n });\n }\n // wrap-reverse且多轴线时交换轴线序,需要2行及以上才行\n let length = __flexLine.length;\n if(['wrapReverse', 'wrap-reverse'].indexOf(flexWrap) > -1 && length > 1) {\n let crossSum = 0, crossSumList = [];\n maxCrossList.forEach(item => {\n crossSumList.push(crossSum);\n crossSum += item;\n });\n let count = 0;\n for(let i = length - 1; i >= 0; i--) {\n let line = __flexLine[i];\n let source = crossSumList[i];\n let diff = count - source;\n if(diff) {\n line.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n count += maxCrossList[i];\n }\n __flexLine.reverse();\n }\n // 侧轴对齐分flexLine做,要考虑整体的alignContent的stretch和每行的alignItems的stretch\n // 先做整体的,得出交叉轴空白再均分给每一行做单行的,整体的只有1行忽略\n let per;\n if(!isVirtual && length > 1 && (fixedHeight && isDirectionRow || !isDirectionRow)) {\n let diff = isDirectionRow ? th - (y - data.y) : tw - (x - data.x);\n // 有空余时才进行对齐\n if(diff > 0) {\n if(alignContent === 'center') {\n let per = diff * 0.5;\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per, true);\n }\n else {\n item.__offsetX(per, true);\n }\n });\n }\n else if(alignContent === 'flex-start' || alignContent === 'flexStart') {}\n else if(alignContent === 'flex-end' || alignContent === 'flexEnd') {\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n else if(alignContent === 'space-between' || alignContent === 'spaceBetween') {\n let between = diff / (length - 1);\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(between, true);\n }\n else {\n item.__offsetX(between, true);\n }\n });\n }\n });\n }\n else if(alignContent === 'space-around' || alignContent === 'spaceAround') {\n let around = diff / (length + 1);\n __flexLine.forEach((item, i) => {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(around * (i + 1), true);\n }\n else {\n item.__offsetX(around * (i + 1), true);\n }\n });\n });\n }\n // 默认stretch\n else {\n per = diff / length;\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per * i, true);\n }\n else {\n item.__offsetX(per * i, true);\n }\n });\n }\n });\n }\n }\n }\n // 每行再进行cross对齐,在alignContent为stretch时计算每行的高度\n if(!isVirtual) {\n if(length > 1) {\n __flexLine.forEach((item, i) => {\n let maxCross = maxCrossList[i];\n if(per) {\n maxCross += per;\n }\n this.__crossAlign(item, alignItems, isDirectionRow, maxCross);\n });\n }\n else if(length) {\n let maxCross = maxCrossList[0];\n if(isDirectionRow) {\n if(fixedHeight) {\n maxCross = h;\n }\n }\n else {\n maxCross = w;\n }\n this.__crossAlign(__flexLine[0], alignItems, isDirectionRow, maxCross);\n }\n }\n this.__marginAuto(currentStyle, data);\n }\n\n /**\n * 计算获取子元素的b/min/max完毕后,尝试进行flex每行布局\n * https://www.w3.org/TR/css-flexbox-1/#layout-algorithm\n * 假想主尺寸,其为clamp(min_main_size, flex_base_size, max_main_size)\n * 随后按算法一步步来 https://zhuanlan.zhihu.com/p/354567655\n * 规范没提到mpb,item的要计算,孙子的只考虑绝对值\n * 先收集basis和假设主尺寸\n */\n __layoutFlexLine(data, isDirectionRow, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, orderChildren, flexLine, textAlign,\n growList, shrinkList, basisList, hypotheticalList, minList) {\n let { x, y, w, h } = data;\n let hypotheticalSum = 0;\n hypotheticalList.forEach(item => {\n hypotheticalSum += item;\n });\n // 根据假设尺寸确定使用grow还是shrink,冻结非弹性项并设置target尺寸,确定剩余未冻结数量\n let isOverflow = hypotheticalSum >= containerSize;\n let targetMainList = [];\n basisList.forEach((item, i) => {\n if(isOverflow) {\n if(!shrinkList[i] || (basisList[i] < hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n else {\n if(!growList[i] || (basisList[i] > hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n });\n // 初始可用空间,冻结使用确定的target尺寸,未冻结使用假想\n let free = 0;\n basisList.forEach((item, i) => {\n if(targetMainList[i] !== undefined) {\n free += targetMainList[i];\n }\n else {\n free += item;\n }\n });\n let total = Infinity;\n if(isDirectionRow) {\n total = w;\n }\n else if(fixedHeight) {\n total = h;\n }\n else {\n total = free;\n }\n free = Math.abs(total - free);\n // 循环,文档算法不够简练,其合并了grow和shrink,实际拆开写更简单\n let factorSum = 0;\n if(isOverflow) {\n // 计算真正的因子占比,同时得出缩小尺寸数值\n // 还需判断每个item收缩不能 {\n if(targetMainList[i] === undefined) {\n let n = item * basisList[i];\n factorSum += n;\n return n;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要收缩的尺寸\n let n = basisList[i] - s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n else {\n let factorList = growList.map((item, i) => {\n if(targetMainList[i] === undefined) {\n factorSum += item;\n return item;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要扩展的尺寸\n let n = basisList[i] + s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n let maxCross = 0;\n let lbmList = [];\n orderChildren.forEach((item, i) => {\n let main = targetMainList[i];\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n if(isDirectionRow) {\n item.__layout({\n x,\n y,\n w: main,\n h,\n w3: main, // w3假设固定宽度,忽略原始style中的设置\n });\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h: main,\n h3: main, // 同w2\n });\n }\n }\n else {\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n lbmList.push(lineBoxManager);\n item.__layout({\n x,\n y,\n w: isDirectionRow ? main : w,\n h: isDirectionRow ? h : main,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n });\n }\n if(isDirectionRow) {\n x += item.outerWidth;\n maxCross = Math.max(maxCross, item.outerHeight);\n }\n else {\n y += item.outerHeight;\n maxCross = Math.max(maxCross, item.outerWidth);\n }\n });\n // 计算主轴剩余时要用真实剩余空间而不能用伸缩剩余空间\n let diff = isDirectionRow ? (w - x + data.x) : (h - y + data.y);\n // 主轴对齐方式\n if(diff > 0) {\n let len = orderChildren.length;\n if(justifyContent === 'flexEnd' || justifyContent === 'flex-end') {\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(diff, true) : child.__offsetY(diff, true);\n }\n }\n else if(justifyContent === 'center') {\n let center = diff * 0.5;\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(center, true) : child.__offsetY(center, true);\n }\n }\n else if(justifyContent === 'spaceBetween' || justifyContent === 'space-between') {\n let between = diff / (len - 1);\n for(let i = 1; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(between * i, true) : child.__offsetY(between * i, true);\n }\n }\n else if(justifyContent === 'spaceAround' || justifyContent === 'space-around') {\n let around = diff / (len + 1);\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(around * (i + 1), true) : child.__offsetY(around * (i + 1), true);\n }\n }\n }\n if(isDirectionRow) {\n y += maxCross;\n }\n else {\n x += maxCross;\n }\n // flex的直接text对齐比较特殊\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lbmList.forEach(item => {\n item.horizonAlign(item.width, textAlign);\n })\n }\n return [x, y, maxCross];\n }\n\n // 每个flexLine的侧轴对齐,单行时就是一行对齐\n __crossAlign(line, alignItems, isDirectionRow, maxCross) {\n let baseLine = 0;\n line.forEach(item => {\n baseLine = Math.max(baseLine, item.firstBaseLine);\n });\n line.forEach(item => {\n let { currentStyle: { [ALIGN_SELF]: alignSelf } } = item;\n if(isDirectionRow) {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [HEIGHT]: height } } = item;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = item.__height = computedStyle[HEIGHT] = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n else if(alignSelf === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [HEIGHT]: height,\n } } = item;\n // row的孩子还是flex且column且不定高时,如果高度<侧轴拉伸高度则重新布局\n if(isDirectionRow && display === 'flex' && flexDirection === 'column' && height[1] === AUTO && item.outerHeight < maxCross) {\n item.__layout(Object.assign(item.__layoutData, { h3: maxCross }));\n }\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n }\n }\n // column\n else {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [WIDTH]: width } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [WIDTH]: width,\n } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n }\n }\n });\n }\n\n /**\n * inline比较特殊,先简单顶部对其,后续还需根据vertical和lineHeight计算y偏移\n * inlineBlock复用逻辑,可以设置w/h,在混排时表现不同,inlineBlock换行限制在规定的矩形内,\n * 且ib会在没设置width且换行的时候撑满上一行,即便内部尺寸没抵达边界\n * 而inline换行则会从父容器start处开始,且首尾可能占用矩形不同\n * 嵌套inline情况十分复杂,尾部mpb空白可能产生叠加情况,因此endSpace表示自身,\n * 然后根据是否在最后一个元素进行叠加父元素的,多层嵌套则多层尾部叠加,均以最后一个元素为依据判断\n * Text获取这个叠加的endSpace值即可,无需感知是否最后一个,外层(此处)进行逻辑封装\n * @param data\n * @param isVirtual\n * @param isInline\n * @private\n */\n __layoutInline(data, isVirtual, isInline) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h, lx,\n lineBoxManager, nowrap, endSpace, selfEndSpace } = this.__preLayout(data, isInline);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n let {\n [WIDTH]: width,\n } = currentStyle;\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n } = computedStyle;\n let lineClampCount = data.lineClampCount || 0;\n if(isInline && !this.__isRealInline()) {\n isInline = false;\n }\n // 只有inline的孩子需要考虑换行后从行首开始,而ib不需要,因此重置行首标识lx为x,末尾空白为0\n // 而inline的LineBoxManager复用最近非inline父dom的,ib需要重新生成,末尾空白叠加\n if(isInline) {\n this.__config[NODE_IS_INLINE] = true;\n this.__lineBoxManager = lineBoxManager;\n let baseLine = css.getBaseLine(computedStyle);\n // 特殊inline调用,有内容的话(如左右mbp),默认生成一个lineBox,即便是空,也要形成占位,只有开头时需要\n if(marginLeft || marginRight\n || paddingLeft || paddingRight\n || borderLeftWidth || borderRightWidth) {\n if(lineBoxManager.isNewLine) {\n lineBoxManager.genLineBoxByInlineIfNewLine(x, y, lineHeight, baseLine);\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseLine);\n }\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseLine);\n }\n lineClamp = data.lineClamp || 0;\n }\n else {\n lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n lx = x;\n endSpace = selfEndSpace = lineClampCount = 0;\n }\n // 存LineBox里的内容列表专用,布局过程中由lineBoxManager存入,递归情况每个inline节点都保存contentBox\n let contentBoxList;\n if(isInline) {\n contentBoxList = this.__contentBoxList = [];\n lineBoxManager.pushContentBoxList(this);\n }\n let isIbFull = false; // ib时不限定w情况下发生折行则撑满行,即便内容没有撑满边界\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline2 = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock2 = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isRealInline = isXom && item.__isRealInline();\n // 最后一个元素会产生最后一行,叠加父元素的尾部mpb\n let isEnd = isInline && (i === length - 1);\n if(isEnd) {\n endSpace += selfEndSpace;\n }\n if(isXom) {\n if(!isInline2 && !isInlineBlock2) {\n item.currentStyle[DISPLAY] = item.computedStyle[DISPLAY] = 'inlineBlock';\n isInlineBlock2 = true;\n inject.warn('Inline can not contain block/flex');\n }\n // x开头,不用考虑是否放得下直接放,i为0强制不换行\n if(x === lx || !i || isInline2 && whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样\n if(item.__isIbFull) {\n isInlineBlock2 && (w[1] === AUTO) && (isIbFull = true);\n lineBoxManager.addItem(item);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中,以计算宽度\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n }\n else {\n // 不换行继续排,换行非开头先尝试是否放得下,结尾要考虑mpb因此减去endSpace\n let fw = (whiteSpace === 'nowrap') ? 0 : item.__tryLayInline(w - x + lx, w - (isEnd ? endSpace : 0));\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n nowrap: whiteSpace === 'nowrap',\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n isInline2 && lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n lineBoxManager.addItem(item);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n }\n }\n }\n // inline里的其它只有文本,可能开始紧跟着之前的x,也可能换行后从lx行头开始\n // 紧跟着x可能出现在前面有节点换行后第2行,此时不一定放得下,因此不能作为判断依据,开头仅有lx\n else {\n let n = lineBoxManager.size;\n // i为0时强制不换行\n if(x === lx || !i || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行,且非定宽\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n }\n else {\n // 非开头先尝试是否放得下,如果放得下再看是否end,加end且只有1个字时放不下要换行,否则可以放,换行由text内部做\n // 第一个Text且父元素声明了nowrap也强制不换行,非第一个则看本身whiteSpace声明\n let focusNoWrap = (!i && nowrap) || whiteSpace === 'nowrap';\n let fw = focusNoWrap ? 0 : item.__tryLayInline(w + lx - x);\n if(!focusNoWrap && fw >= 0 && isEnd && endSpace && item.content.length === 1) {\n let fw2 = fw - endSpace;\n if(fw2 < 0) {\n fw = fw2;\n }\n }\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // 这里ib放得下一定是要么没换行要么固定宽度,所以无需判断isIbFull\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n }\n }\n }\n });\n // 同block结尾,不过这里一定是lineBox结束,无需判断\n y = lineBoxManager.endY;\n // 标识ib情况同block一样占满行\n this.__isIbFull = isIbFull;\n // 元素的width在固定情况或者ibFull情况已被计算出来,否则为最大延展尺寸,inline没有固定尺寸概念\n let tw, th;\n if(isInline) {\n // inline最后的x要算上右侧mpb,为next行元素提供x坐标基准,同时其尺寸计算比较特殊\n if(selfEndSpace) {\n lineBoxManager.addX(selfEndSpace);\n }\n // 如果没有内容,空白还要加上开头即左侧mpb\n if(!flowChildren.length) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = computedStyle;\n lineBoxManager.addX(marginLeft + paddingLeft + borderLeftWidth);\n }\n // 结束出栈contentBox,递归情况结束子inline获取contentBox,父inline继续\n lineBoxManager.popContentBoxList();\n // abs非固定w时预计算,本来是最近非inline父层统一计算,但在abs时不算,\n if(isVirtual) {\n this.__inlineSize();\n }\n }\n else {\n // ib在满时很特殊,取最大值,可能w本身很小不足排下1个字符,此时要用maxW\n let maxW = lineBoxManager.__maxX - data.x;\n tw = this.__width = fixedWidth ? w : (isIbFull ? Math.max(w, maxW) : maxW);\n th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n }\n // 非abs提前虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐,inline会被父级调用这里只看ib\n if(!isVirtual && !isInline) {\n lineBoxManager.verticalAlign();\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // block的所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n }\n // inlineBlock新开上下文,但父级block遇到要处理换行\n return isInline ? lineClampCount : 0;\n }\n\n /**\n * inline的尺寸计算非常特殊,并非一个矩形区域,而是由字体行高结合节点下多个LineBox中的内容决定,\n * 且这个尺寸又并非真实LineBox中的内容直接合并计算而来,比如包含了个更大尺寸的ib却不会计入\n * 具体方法为遍历持有的LineBox下的内容,x取两侧极值,同时首尾要考虑mpb,y值取上下极值,同样首尾考虑mpb\n * 首尾行LineBox可能不是不是占满一行,比如前后都有同行inline的情况,非首尾行则肯定占满\n * 绘制内容(如背景色)的区域也很特殊,每行LineBox根据lineHeight对齐baseLine得来,并非LineBox全部\n * 当LineBox只有直属Text时如果font没有lineGap则等价于全部,如有则需减去\n * 另外其client/offset/outer的w/h尺寸计算也很特殊,皆因首尾x方向的mpb导致\n * @private\n */\n __inlineSize(tw, textAlign) {\n let { contentBoxList, computedStyle, __ox, __oy } = this;\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // x/clientX/offsetX/outerX\n let maxX, maxY, minX, minY, maxCX, maxCY, minCX, minCY, maxFX, maxFY, minFX, minFY, maxOX, maxOY, minOX, minOY;\n let length = contentBoxList.length;\n if(length) {\n // 遍历contentBox,里面存的是LineBox内容,根据父LineBox引用判断是否换行\n contentBoxList.forEach((item, i) => {\n // 非第一个除了minY不用看其它都要,minX是换行导致,而maxX在最后一个要考虑右侧mpb,中间的无需考虑嵌套inline的mpb\n if(i) {\n minX = Math.min(minX, item.x);\n minCX = Math.min(minCX, item.x);\n minFX = Math.min(minFX, item.x);\n minOX = Math.min(minOX, item.x);\n if(i === length - 1) {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n maxY = maxCY = maxFY = maxOY = Math.max(maxY, item.y + item.outerHeight);\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n else {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n }\n }\n // 第一个初始化\n else {\n minX = item.x;\n minY = item.y;\n minCX = minX - paddingLeft;\n minCY = minY - paddingTop;\n minFX = minCX - borderLeftWidth;\n minFY = minCY - borderTopWidth;\n minOX = minFX - marginLeft;\n minOY = minFY - marginTop;\n maxX = maxCX = maxFX = maxOX = item.x + item.outerWidth;\n maxY = maxCY = maxFY = maxOY = item.y + item.outerHeight;\n if(i === length - 1) {\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n }\n });\n this.__x = minOX;\n this.__y = minOY;\n this.__width = computedStyle[WIDTH] = maxX - minX;\n // 防止比自己最小高度lineHeight还小,比如内容是个小字体\n this.__height = computedStyle[HEIGHT] = Math.max(lineHeight, maxY - minY);\n this.__clientWidth = maxCX - minCX;\n this.__clientHeight = maxCY - minCY;\n this.__offsetWidth = maxFX - minFX;\n this.__offsetHeight = maxFY - minFY;\n this.__outerWidth = maxOX - minOX;\n this.__outerHeight = maxOY - minOY;\n this.__sx = minOX + __ox;\n this.__sy = minOY + __oy;\n this.__sx1 = minFX + __ox;\n this.__sy1 = minFY + __oy;\n this.__sx2 = minCX + __ox;\n this.__sy2 = minCY + __oy;\n this.__sx3 = minX + __ox;\n this.__sy3 = minY + __oy;\n this.__sx4 = maxX + __ox;\n this.__sy4 = maxY + __oy;\n this.__sx5 = maxCX + __ox;\n this.__sy5 = maxCY + __oy;\n this.__sx6 = maxFX + __ox;\n this.__sy6 = maxFY + __oy;\n // inline的text整体设置相同\n if(['center', 'right'].indexOf(textAlign) > -1) {\n this.children.forEach(item => {\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n }\n // 如果没有内容,宽度为0高度为lineHeight,对齐也特殊处理,lineBoxManager不会处理\n else {\n if(['center', 'right'].indexOf(textAlign) > -1) {\n let diff = tw;\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n if(diff) {\n this.__offsetX(diff, true);\n }\n }\n this.__width = computedStyle[WIDTH] = 0;\n let th = this.__height = computedStyle[HEIGHT] = lineHeight;\n this.__ioSize(0, th);\n this.__sy -= marginTop + paddingTop + borderTopWidth;\n this.__sx1 = this.sx + marginLeft;\n this.__sy1 = this.sy + marginTop;\n this.__sx2 = this.__sx1 + borderLeftWidth;\n this.__sy2 = this.__sy1 + borderTopWidth;\n this.__sx4 = this.__sx3 = this.__sx2 + paddingLeft;\n this.__sy4 = this.__sy3 = this.__sy2 + paddingTop;\n this.__sx5 = this.__sx4 + paddingRight;\n this.__sy5 = this.__sy4 + th + paddingBottom;\n this.__sx6 = this.__sx5 + borderRightWidth;\n this.__sy6 = this.__sy5 + borderBottomWidth;\n this.__clientWidth = this.__sx5 - this.__sx2;\n this.__clientHeight = this.__sy5 - this.__sy2;\n this.__offsetWidth = this.__sx6 - this.__sx1;\n this.__offsetHeight = this.__sy6 - this.__sy1;\n this.__outerWidth = this.__offsetWidth + marginLeft + marginRight;\n this.__outerHeight = this.__offsetHeight + marginTop + marginBottom;\n }\n }\n\n /**\n * 只针对绝对定位children布局\n * @param container\n * @param data\n * @param target 可选,只针对某个abs的child特定布局,在局部更新时用\n * @private\n */\n __layoutAbs(container, data, target) {\n let { sx: x, sy: y, clientWidth, clientHeight, computedStyle } = container;\n let { isDestroyed, children, absChildren } = this;\n let {\n [DISPLAY]: display,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n } = computedStyle;\n if(isDestroyed || display === 'none') {\n this.__layoutNone();\n return;\n }\n x += marginLeft + borderLeftWidth;\n y += marginTop + borderTopWidth;\n // 对absolute的元素进行相对容器布局\n absChildren.forEach(item => {\n if(target) {\n // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr\n let node = item;\n if(node instanceof Component) {\n node = item.shadowRoot;\n }\n // 所以得2个都对比\n if(target !== node && target !== item) {\n return;\n }\n }\n let { currentStyle, computedStyle } = item;\n if(currentStyle[DISPLAY] === 'none') {\n item.__layoutNone();\n return;\n }\n // 先根据容器宽度计算margin/padding\n item.__mp(currentStyle, computedStyle, clientWidth);\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let { [LEFT]: left, [TOP]: top, [RIGHT]: right,\n [BOTTOM]: bottom, [WIDTH]: width, [HEIGHT]: height, [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection } = currentStyle;\n let x2, y2, w2, h2;\n let onlyRight;\n let onlyBottom;\n let fixedTop;\n let fixedRight;\n let fixedBottom;\n let fixedLeft;\n // 判断何种方式的定位,比如左+宽度,左+右之类\n if(left[1] !== AUTO) {\n fixedLeft = true;\n computedStyle[LEFT] = calAbsolute(currentStyle, 'left', left, clientWidth, this.root);\n }\n else {\n computedStyle[LEFT] = 'auto';\n }\n if(right[1] !== AUTO) {\n fixedRight = true;\n computedStyle[RIGHT] = calAbsolute(currentStyle, 'right', right, clientWidth, this.root);\n }\n else {\n computedStyle[RIGHT] = 'auto';\n }\n if(top[1] !== AUTO) {\n fixedTop = true;\n computedStyle[TOP] = calAbsolute(currentStyle, 'top', top, clientHeight, this.root);\n }\n else {\n computedStyle[TOP] = 'auto';\n }\n if(bottom[1] !== AUTO) {\n fixedBottom = true;\n computedStyle[BOTTOM] = calAbsolute(currentStyle, 'bottom', bottom, clientHeight, this.root);\n }\n else {\n computedStyle[BOTTOM] = 'auto';\n }\n // 优先级最高left+right,其次left+width,再次right+width,再次仅申明单个,最次全部auto\n if(fixedLeft && fixedRight) {\n x2 = x + computedStyle[LEFT];\n w2 = x + clientWidth - computedStyle[RIGHT] - x2;\n }\n else if(fixedLeft) {\n x2 = x + computedStyle[LEFT];\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n }\n else if(fixedRight) {\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n else {\n onlyRight = true;\n }\n x2 = x + clientWidth - computedStyle[RIGHT] - (w2 || 0);\n // 右对齐有尺寸时还需减去margin/border/padding的\n x2 -= computedStyle[MARGIN_LEFT];\n x2 -= computedStyle[MARGIN_RIGHT];\n x2 -= computedStyle[PADDING_LEFT];\n x2 -= computedStyle[PADDING_RIGHT];\n x2 -= currentStyle[BORDER_LEFT_WIDTH][0];\n x2 -= currentStyle[BORDER_RIGHT_WIDTH][0];\n }\n else {\n x2 = x + paddingLeft;\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n }\n // top/bottom/height优先级同上\n if(fixedTop && fixedBottom) {\n y2 = y + computedStyle[TOP];\n h2 = y + clientHeight - computedStyle[BOTTOM] - y2;\n }\n else if(fixedTop) {\n y2 = y + computedStyle[TOP];\n if(height[1] !== AUTO) {\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else {\n h2 = height[0];\n }\n }\n }\n else if(fixedBottom) {\n if(height[1] !== AUTO) {\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else {\n h2 = height[0];\n }\n }\n else {\n onlyBottom = true;\n }\n y2 = y + clientHeight - computedStyle[BOTTOM] - (h2 || 0);\n // 底对齐有尺寸时y值还需减去margin/border/padding的\n y2 -= computedStyle[MARGIN_TOP];\n y2 -= computedStyle[MARGIN_BOTTOM];\n y2 -= computedStyle[PADDING_TOP];\n y2 -= computedStyle[PADDING_BOTTOM];\n y2 -= currentStyle[BORDER_TOP_WIDTH][0];\n y2 -= currentStyle[BORDER_BOTTOM_WIDTH][0];\n }\n // 未声明y的找到之前的流布局child,紧随其下\n else {\n y2 = y + paddingTop;\n let prev = item.prev;\n while(prev) {\n // 目前不考虑margin合并,直接以前面的flow的最近的prev末尾为准\n if(prev instanceof Text || prev.computedStyle[POSITION] !== 'absolute') {\n y2 = prev.y + prev.outerHeight;\n break;\n }\n prev = prev.prev;\n }\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else if(height[1] === PX) {\n h2 = height[0];\n }\n }\n // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局\n let needCalWidth;\n if((display === 'block' || ['inlineBlock', 'inline-block'].indexOf(display) > -1) && w2 === undefined) {\n needCalWidth = true;\n }\n else if(display === 'flex') {\n if(w2 === undefined) {\n needCalWidth = true;\n }\n else if(flexDirection === 'column' && h2 === undefined) {\n needCalWidth = true;\n }\n }\n // onlyRight时做的布局其实是以那个点位为left/top布局然后offset,limit要特殊计算,从本点向左侧为边界\n let wl = onlyRight ? x2 - x : clientWidth + x - x2;\n // onlyBottom相同,正常情况是左上到右下的尺寸限制\n let hl = onlyBottom ? y2 - y : clientHeight + y - y2;\n // 未直接或间接定义尺寸,取孩子宽度最大值\n if(needCalWidth) {\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n }, true, true);\n wl = item.outerWidth;\n }\n // needCalWidth传入,因为自适应尺寸上面已经计算过一次margin/padding了\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n w2, // left+right这种等于有宽度,但不能修改style,继续传入到__preLayout中特殊对待\n h2,\n }, false, true);\n if(onlyRight) {\n item.__offsetX(-item.outerWidth, true);\n }\n if(onlyBottom) {\n item.__offsetY(-item.outerHeight, true);\n }\n });\n // 递归进行,遇到absolute/relative/component的设置新容器\n children.forEach(item => {\n if(target) {\n // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr\n let node = item;\n if(node instanceof Component) {\n node = item.shadowRoot;\n }\n // 所以得2个都对比\n if(target !== node && target !== item) {\n return;\n }\n }\n if(item instanceof Dom) {\n item.__layoutAbs(isRelativeOrAbsolute(item) ? item : container, data);\n }\n else if(item instanceof Component) {\n let sr = item.shadowRoot;\n if(sr instanceof Dom) {\n sr.__layoutAbs(sr, data);\n }\n }\n });\n this.__execAr();\n }\n\n /**\n * 布局前检查继承的样式以及统计字体测量信息\n * 首次检查为整树遍历,后续检查是节点自发局部检查,不再进入\n * @param renderMode\n * @param ctx\n * @param cb\n * @private\n */\n __computeMeasure(renderMode, ctx, cb) {\n super.__computeMeasure(renderMode, ctx, cb);\n // 即便自己不需要计算,但children还要继续递归检查\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx, cb);\n });\n }\n\n render(renderMode, lv, ctx, cache, 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 unit from '../style/unit';\nimport image from '../style/image';\nimport border from '../style/border';\nimport enums from '../util/enums';\nimport level from '../refresh/level';\nimport mx from '../math/matrix';\n\nconst {\n STYLE_KEY: {\n WIDTH,\n HEIGHT,\n DISPLAY,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n VISIBILITY,\n BACKGROUND_IMAGE,\n BACKGROUND_COLOR,\n BOX_SHADOW,\n MIX_BLEND_MODE,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n FONT_SIZE,\n FLEX_BASIS,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_CONFIG,\n },\n NODE_KEY: {\n NODE_CACHE,\n NODE_DEFS_CACHE,\n NODE_IS_MASK,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH, RGBA } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { isFunction } = util;\n\nclass Img extends Dom {\n constructor(tagName, props) {\n super(tagName, props);\n let src = this.props.src;\n let loadImg = this.__loadImg = {\n src,\n };\n // 空url用错误图代替\n if(!src) {\n loadImg.error = true;\n }\n let config = this.__config;\n if(config[NODE_IS_MASK]) {\n let { style, currentStyle } = this;\n style[BACKGROUND_IMAGE] = currentStyle[BACKGROUND_IMAGE] = [null];\n style[BACKGROUND_COLOR] = currentStyle[BACKGROUND_COLOR] = [[0, 0, 0, 0], RGBA];\n style[BORDER_TOP_WIDTH] = currentStyle[BORDER_TOP_WIDTH] = [0, PX];\n style[BORDER_RIGHT_WIDTH] = currentStyle[BORDER_RIGHT_WIDTH] = [0, PX];\n style[BORDER_LEFT_WIDTH] = currentStyle[BORDER_LEFT_WIDTH] = [0, PX];\n style[BORDER_BOTTOM_WIDTH] = currentStyle[BORDER_BOTTOM_WIDTH] = [0, PX];\n style[BOX_SHADOW] = currentStyle[BOX_SHADOW] = null;\n style[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE] = 'normal';\n }\n }\n\n /**\n * 覆盖xom的方法,在__layout3个分支中会首先被调用\n * 当样式中固定宽高时,图片按样式尺寸,加载后重新绘制即可\n * 只固定宽高一个时,加载完要计算缩放比,重新布局绘制\n * 都没有固定,按照图片尺寸,重新布局绘制\n * 这里计算非固定的情况,将其改为固定供布局渲染使用,未加载完成为0\n * @param data\n * @returns {{fixedWidth: boolean, w: *, x: *, h: *, y: *, fixedHeight: boolean}}\n * @private\n */\n __preLayout(data) {\n let res = super.__preLayout(data);\n let loadImg = this.__loadImg;\n // 可能已提前加载好了,或有缓存,为减少刷新直接使用\n if(!loadImg.error) {\n let src = loadImg.src;\n let cache = inject.IMG[src];\n if(cache && cache.state === inject.LOADED) {\n loadImg.source = cache.source;\n loadImg.width = cache.width;\n loadImg.height = cache.height;\n }\n loadImg.cache = false;\n }\n if(res.fixedWidth && res.fixedHeight) {\n return res;\n }\n if(loadImg.error && !this.props.placeholder) {\n if(res.fixedWidth) {\n res.h = res.w;\n }\n else if(res.fixedHeight) {\n res.w = res.h;\n }\n else {\n res.w = res.h = 32;\n }\n }\n else if(loadImg.source) {\n if(res.fixedWidth) {\n res.h = res.w * loadImg.height / loadImg.width;\n }\n else if(res.fixedHeight) {\n res.w = res.h * loadImg.width / loadImg.height;\n }\n else {\n res.w = loadImg.width;\n res.h = loadImg.height;\n }\n }\n else {\n res.w = res.h = 0;\n }\n res.fixedWidth = true;\n res.fixedHeight = true;\n return res;\n }\n\n __addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n __destroy() {\n this.root.delRefreshTask(this.__task);\n super.__destroy();\n this.__task = null;\n }\n\n // img根据加载情况更新__hasContent\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n let res = super.__calContent(renderMode, lv, currentStyle, computedStyle);\n if(!res) {\n let {\n __loadImg: loadImg,\n } = this;\n if(computedStyle[VISIBILITY] !== 'hidden' && (computedStyle[WIDTH] || computedStyle[HEIGHT])\n && loadImg.source) {\n res = true;\n }\n }\n return res;\n }\n\n render(renderMode, lv, ctx, cache, 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 ctx.arc(cx, cy, r, 0, 2 * Math.PI);\n ctx.fill();\n ctx.closePath();\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for(let i = 1, len = pts.length; i < len; i++) {\n let point = pts[i];\n ctx.lineTo(point[0], point[1]);\n }\n ctx.lineTo(pts[0][0], pts[0][1]);\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n this.__addGeom('rect', [\n ['x', originX],\n ['y', originY],\n ['width', width],\n ['height', height],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ['fill', 'rgba(0,0,0,0)']\n ]);\n this.__addGeom('circle', [\n ['cx', cx],\n ['cy', cy],\n ['r', r],\n ['fill', fill],\n ]);\n let s = '';\n for(let i = 0, len = pts.length; i < len; i++) {\n let point = pts[i];\n if(i) {\n s += ' ';\n }\n s += point[0] + ',' + point[1];\n }\n this.__addGeom('polygon', [\n ['points', s],\n ['fill', fill]\n ]);\n }\n }\n else if(source) {\n // 圆角需要生成一个mask\n let list = border.calRadius(originX, originY, width, height,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n // 有border-radius需模拟遮罩裁剪\n if(list) {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list, 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 {\n let loadImg = this.__loadImg;\n // 加载成功计算缩放后的宽度\n if(loadImg.source) {\n if(height[1] === PX) {\n w -= loadImg.width * height[0] / loadImg.height;\n }\n else if(height[1] === PERCENT) {\n w -= loadImg.width * height[0] * total * 0.01 / loadImg.height;\n }\n else if(height[1] === REM) {\n w -= loadImg.width * height[0] * this.root.computedStyle[FONT_SIZE] / loadImg.height;\n }\n else if(height[1] === VW) {\n w -= loadImg.width * height[0] * this.root.width * 0.01 / loadImg.height;\n }\n else if(height[1] === VH) {\n w -= loadImg.width * height[0] * this.root.height * 0.01 / loadImg.height;\n }\n else {\n w -= loadImg.width;\n }\n }\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n return w;\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle, __loadImg } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n let cross = isDirectionRow ? height : width;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH].indexOf(flexBasis[1]) > -1;\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = max = min = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = max = min = flexBasis[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(flexBasis[1] === REM) {\n b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = max = min = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = max = min = flexBasis[0] * this.root.height * 0.01;\n }\n }\n else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1)) {\n if(main[1] === PX) {\n b = max = min = main[0];\n }\n else if(main[1] === PERCENT) {\n b = max = min = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = max = min = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = max = min = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = max = min = main[0] * this.root.height * 0.01;\n }\n }\n // auto和content固定尺寸比例计算\n else if(__loadImg.source || __loadImg.error) {\n if(cross[1] !== AUTO) {\n if(cross[1] === PX) {\n cross = cross[0];\n }\n else if(cross[1] === PERCENT) {\n cross = cross[0] * 0.01 * (isDirectionRow ? h : w);\n }\n else if(cross[1] === REM) {\n cross = cross[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(cross[1] === VW) {\n cross = cross[0] * this.root.width * 0.01;\n }\n else if(cross[1] === VH) {\n cross = cross[0] * this.root.height * 0.01;\n }\n let ratio = __loadImg.width / __loadImg.height;\n b = max = min = isDirectionRow ? cross * ratio : cross / ratio;\n }\n else {\n b = max = min = isDirectionRow ? __loadImg.width : __loadImg.height;\n }\n }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\n }\n\n __loadAndRefresh(loadImg, root, ctx, placeholder, computedStyle, width, height, cb) {\n let self = this;\n // 先清空之前可能的\n if(loadImg.source || loadImg.error) {\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n });\n loadImg.source = null;\n }\n loadImg.loading = true;\n // 再测量,可能瞬间完成替换掉上面的\n inject.measureImg(loadImg.src, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败走error绘制\n if(data.url === loadImg.src && !self.isDestroyed) {\n loadImg.cache && (loadImg.cache.cache = false);\n loadImg.loading = false;\n function reload() {\n let { currentStyle: { [WIDTH]: width, [HEIGHT]: height } } = self;\n root.delRefreshTask(self.__task);\n if(width[1] !== AUTO && height[1] !== AUTO) {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REPAINT;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n else {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n }\n if(data.success) {\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n }\n else if(placeholder) {\n inject.measureImg(placeholder, data => {\n if(data.success) {\n loadImg.error = true;\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n reload();\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n return;\n }\n else {\n loadImg.error = true;\n }\n // 可见状态进行刷新操作,visibility某些情况需要刷新,可能宽高未定义要重新布局\n if(computedStyle[DISPLAY] !== 'none') {\n reload();\n }\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n }\n\n updateSrc(v, cb) {\n let self = this;\n let loadImg = self.__loadImg;\n let root = this.root;\n // 相等或空且当前error直接返回\n if(v === loadImg.src || !v && loadImg.error) {\n if(isFunction(cb)) {\n cb(-1);\n }\n }\n else if(v) {\n loadImg.src = v;\n self.__loadAndRefresh(loadImg, root, root.ctx, self.props.placeholder, self.computedStyle, self.width, self.height, cb);\n }\n else {\n loadImg.src = v;\n loadImg.source = null;\n loadImg.error = true;\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, self.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb(diff);\n }\n },\n });\n }\n }\n\n appendChild() {\n inject.error('Img can not appendChild.');\n }\n\n get src() {\n return this.__loadImg.src;\n }\n\n static showError = true;\n}\n\nexport default Img;\n","class Defs {\n constructor(uuid) {\n this.id = uuid;\n this.count = 0;\n this.list = [];\n this.cacheHash = {}; // 每次svg渲染前重置,存储前次渲染不变的缓存id\n }\n add(data) {\n let uuid = this.count;\n let hash = this.cacheHash;\n while(hash.hasOwnProperty(uuid)) {\n uuid++;\n }\n this.count = uuid + 1;\n data.id = uuid;\n data.uuid = 'karas-defs-' + this.id + '-' + uuid;\n data.index = this.list.length;\n this.list.push(data);\n return data.uuid;\n }\n addCache(data) {\n data.index = this.list.length;\n this.list.push(data);\n this.cacheHash[data.id] = true;\n return data.uuid;\n }\n clear() {\n this.list = [];\n this.count = 0;\n this.cacheHash = {};\n }\n removeCache(data) {\n let list = this.list;\n let i = data.index;\n // 一般情况index即位置,但每次渲染过程中,可能会删掉一些,此时位置会往前,但index不变,因此遍历\n for(; i >= 0; i--) {\n if(list[i] === data) {\n list.splice(i, 1);\n return;\n }\n }\n }\n\n get value() {\n return this.list;\n }\n\n static getInstance(uuid) {\n return new Defs(uuid);\n }\n}\n\nexport default Defs;\n","import Xom from '../Xom';\nimport reset from '../../style/reset';\nimport css from '../../style/css';\nimport unit from '../../style/unit';\nimport enums from '../../util/enums';\nimport mode from '../mode';\nimport util from '../../util/util';\nimport painter from '../../util/painter';\nimport transform from '../../style/transform';\nimport mx from '../../math/matrix';\nimport inject from '../../util/inject';\nimport gradient from '../../math/gradient';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n WIDTH,\n HEIGHT,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n FILL,\n STROKE,\n STROKE_MITERLIMIT,\n STROKE_WIDTH,\n STROKE_LINECAP,\n STROKE_LINEJOIN,\n STROKE_DASHARRAY,\n STROKE_DASHARRAY_STR,\n FILL_RULE,\n VISIBILITY,\n FONT_SIZE,\n FLEX_BASIS,\n },\n NODE_KEY: {\n NODE_CACHE_PROPS,\n NODE_CURRENT_PROPS,\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { PX, PERCENT, REM, VW, VH } = unit;\nconst { int2rgba, isNil, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nconst REGISTER = {};\n\nclass Geom extends Xom {\n constructor(tagName, props) {\n super(tagName, props);\n this.__isMulti = !!this.props.multi;\n this.__style = css.normalize(this.style, reset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET));\n this.__currentStyle = util.extend({}, this.__style);\n this.__currentProps = util.clone(this.props);\n let config = this.__config;\n config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n config[NODE_CURRENT_PROPS] = this.__currentProps;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_STYLE] = this.__style;\n }\n\n __tryLayInline(w, total) {\n // 无children,直接以style的width为宽度,不定义则为0\n let { currentStyle: {\n [WIDTH]: width,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n return w;\n }\n\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this, this.isShadowRoot);\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n // 计算需考虑style的属性\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n [DISPLAY]: display,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n return [display, this.__addMp(isDirectionRow, data.w, currentStyle, [min, max])];\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH].indexOf(flexBasis[1]) > -1;\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = max = min = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = max = min = flexBasis[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(flexBasis[1] === REM) {\n b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = max = min = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = max = min = flexBasis[0] * this.root.height * 0.01;\n }\n }\n else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1)) {\n if(main[1] === PX) {\n b = max = min = main[0];\n }\n else if(main[1] === PERCENT) {\n b = max = min = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = max = min = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = max = min = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = max = min = main[0] * this.root.height * 0.01;\n }\n }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\n }\n\n __layoutBlock(data, isVirtual) {\n let { fixedWidth, fixedHeight, w, h } = this.__preLayout(data);\n this.__height = fixedHeight ? h : 0;\n if(isVirtual) {\n this.__width = fixedWidth ? w : 0;\n return;\n }\n this.__width = w;\n this.__ioSize(w, this.height);\n this.__marginAuto(this.currentStyle, data);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __layoutFlex(data) {\n // 无children所以等同于block\n this.__layoutBlock(data);\n }\n\n __layoutInline(data) {\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // 元素的width不能超过父元素w\n let tw = this.__width = fixedWidth ? w : x - data.x;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6) {\n let res = super.__calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6);\n if(isNil(__cacheStyle[STROKE_WIDTH])) {\n __cacheStyle[STROKE_WIDTH] = true;\n let strokeWidth = currentStyle[STROKE_WIDTH] || [];\n let w = this.width;\n computedStyle[STROKE_WIDTH] = strokeWidth.map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n else if(item[1] === PERCENT) {\n return item[0] * w * 0.01;\n }\n else if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n else if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n else {\n return 0;\n }\n });\n }\n if(isNil(__cacheStyle[STROKE_DASHARRAY])) {\n __cacheStyle[STROKE_DASHARRAY] = true;\n computedStyle[STROKE_DASHARRAY] = currentStyle[STROKE_DASHARRAY] || [];\n __cacheStyle[STROKE_DASHARRAY_STR] = computedStyle[STROKE_DASHARRAY].map(item => joinArr(item, ','));\n }\n // 直接赋值的\n [\n STROKE_LINECAP,\n STROKE_LINEJOIN,\n STROKE_MITERLIMIT,\n FILL_RULE,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n // stroke/fll移至render里处理,因为cache涉及渐变坐标偏移\n [STROKE, FILL].forEach(k => {\n if(isNil(__cacheStyle[k])) {\n let v = currentStyle[k];\n computedStyle[k] = v;\n let res = [];\n if(Array.isArray(v)) {\n v.forEach(item => {\n if(item && (item.k === 'linear' || item.k === 'radial' || item.k === 'conic')) {\n res.push(this.__gradient(renderMode, ctx, x3, y3, x4, y4, item));\n }\n else if(item[3] > 0) {\n res.push(int2rgba(item));\n }\n else {\n res.push('none');\n }\n });\n }\n __cacheStyle[k] = res;\n }\n });\n return res;\n }\n\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n // Geom强制有内容\n return computedStyle[VISIBILITY] !== 'hidden';\n }\n\n __preSet(res) {\n let { width, height, __cacheStyle, computedStyle } = this;\n let cx = res.sx3 + width * 0.5;\n let cy = res.sy3 + height * 0.5;\n let {\n [FILL]: fill,\n [STROKE]: stroke,\n [STROKE_DASHARRAY_STR]: strokeDasharrayStr,\n } = __cacheStyle;\n let {\n [STROKE_WIDTH]: strokeWidth,\n [STROKE_LINECAP]: strokeLinecap,\n [STROKE_LINEJOIN]: strokeLinejoin,\n [STROKE_MITERLIMIT]: strokeMiterlimit,\n [STROKE_DASHARRAY]: strokeDasharray,\n [FILL_RULE]: fillRule,\n } = computedStyle;\n return {\n cx,\n cy,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n fillRule,\n };\n }\n\n __preSetCanvas(renderMode, ctx, res) {\n let {\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n } = res;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(fill) {\n if(fill.k === 'linear') {\n ctx.fillStyle = fill.v;\n }\n else if(fill.k === 'radial' && !Array.isArray(fill.v)) {\n ctx.fillStyle = fill.v;\n }\n else if(fill.k === 'conic') {\n //\n }\n else if(!fill.k && ctx.fillStyle !== fill) {\n ctx.fillStyle = fill;\n }\n }\n if(stroke) {\n if(stroke.k === 'linear') {\n ctx.strokeStyle = stroke.v;\n }\n else if(stroke.k === 'radial' && !Array.isArray(stroke.v)) {\n ctx.strokeStyle = stroke.v;\n }\n else if(stroke.k === 'conic') {\n //\n }\n else if(!stroke.k && ctx.strokeStyle !== stroke) {\n ctx.strokeStyle = stroke;\n }\n }\n if(strokeWidth !== undefined && ctx.lineWidth !== strokeWidth) {\n ctx.lineWidth = strokeWidth;\n }\n if(strokeLinecap !== undefined && ctx.lineCap !== strokeLinecap) {\n ctx.lineCap = strokeLinecap;\n }\n if(strokeLinejoin !== undefined && ctx.lineJoin !== strokeLinejoin) {\n ctx.lineJoin = strokeLinejoin;\n }\n if(strokeMiterlimit !== undefined && ctx.miterLimit !== strokeMiterlimit) {\n ctx.miterLimit = strokeMiterlimit;\n }\n // 小程序没这个方法\n if(util.isFunction(ctx.getLineDash)) {\n if(strokeDasharray && !util.equalArr(ctx.getLineDash(), strokeDasharray)) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n else if(strokeDasharray) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, 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() {}\n\n // offset/resize时要多一步清空props上记录的缓存\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeX(diff, lv) {\n super.__resizeX(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeY(diff, lv) {\n super.__resizeY(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n getProps(k) {\n let v = this.currentProps[k];\n if(!isNil(v)) {\n return v;\n }\n return this['__' + k];\n }\n\n __isRealInline() {\n return false;\n }\n\n get isMulti() {\n return this.__isMulti;\n }\n\n get currentProps() {\n return this.__currentProps;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$') {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Geom has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$'\n || !obj.prototype || !(obj.prototype instanceof Geom)) {\n throw new Error('Invalid param');\n }\n if(Geom.hasRegister(name)) {\n throw new Error(`Geom has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Geom.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nexport default Geom;\n","import Xom from '../node/Xom';\nimport Dom from '../node/Dom';\nimport Component from '../node/Component';\nimport util from './util';\nimport inject from './inject';\nimport flatten from './flatten';\nimport $$type from './$$type';\nimport enums from './enums';\n\nconst {\n NODE_KEY: {\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_DOM_PARENT,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n NODE_STRUCT,\n },\n} = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet updateList = [];\nlet removeList = [];\n\nconst KEY_FLAG = {};\n\n/**\n * setState后刷新前先根遍历检查组件开始进行shouldComponentUpdate判断\n */\nfunction check(vd) {\n if(vd instanceof Dom) {\n vd.children.forEach(child => {\n if(child instanceof Dom) {\n check(child);\n }\n // 当组件有setState更新时,从叶子到根链路会标识__hasUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasUpdate) {\n child.__hasUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n // 高阶组件会进入此分支,被父组件调用\n else if(vd instanceof Component && vd.__hasUpdate) {\n vd.__hasUpdate = false;\n checkCp(vd, vd.props);\n }\n}\n\n/**\n * 检查cp是否有state变更,注意递归检查时需要看shadow不能看shadowRoot,\n * 否则高阶组件会被跳过,其更新无法触发update生命周期\n * @param cp\n * @param nextProps\n * @param forceCheckUpdate,被render()后的json的二级组件,发现props有变更强制检查更新,否则可以跳过\n */\nfunction checkCp(cp, nextProps, forceCheckUpdate) {\n if(cp.__nextState || forceCheckUpdate) {\n let shouldUpdate;\n if(util.isFunction(cp.shouldComponentUpdate)) {\n shouldUpdate = cp.shouldComponentUpdate(nextProps, cp.__nextState || cp.state);\n }\n else {\n // 没有默认更新\n shouldUpdate = true;\n }\n if(shouldUpdate) {\n updateCp(cp, nextProps, cp.__nextState || cp.state);\n }\n // 不更新则递归检查子tree的cp\n else {\n cp.props = nextProps;\n cp.state = cp.__nextState || cp.state;\n check(cp.shadow);\n }\n }\n else {\n check(cp.shadow);\n }\n}\n\n/**\n * 更新组件的props和state,清空__nextState\n * @param cp\n * @param props\n * @param state\n */\nfunction updateCp(cp, props, state) {\n cp.props = props;\n cp.state = state;\n cp.__nextState = null; // 同步在refresh前清除component的新state标识,这样frame动画在after回调中可以新设\n let oldS = cp.shadow;\n let oldSr = cp.shadowRoot;\n let oldJson = cp.__cd;\n let json = flatten(cp.render());\n // 对比新老render()返回的内容,更新后重新生成sr\n diffSr(oldS, oldJson, json);\n cp.__init(json);\n // 为了局部dom布局需要知道老的css信息\n let sr = cp.shadowRoot;\n if(sr instanceof Xom) {\n [\n '__outerWidth',\n '__outerHeight',\n '__sx',\n '__sy',\n '__sx2',\n '__sx3',\n '__sx4',\n '__sx5',\n '__sx6',\n '__sy2',\n '__sy3',\n '__sy4',\n '__sy5',\n '__sy6',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__computedStyle = sr.__config[NODE_COMPUTED_STYLE] = oldSr.computedStyle;\n }\n else {\n let domParent = cp.domParent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n sr.__config[k] = domParent.__config[k];\n });\n }\n [\n '__x',\n '__y',\n '__width',\n '__height',\n '__sx1', // text和xom\n '__sy1',\n '__layoutData',\n '__parent',\n '__domParent',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__config[NODE_DOM_PARENT] = oldSr.domParent;\n sr.__config[NODE_STRUCT] = oldSr.__config[NODE_STRUCT];\n updateList.push(cp);\n // 老的需回收,diff会生成新的dom,唯一列外是cp直接返回一个没变化的cp\n if(!util.isObject(json) || !json.__placeholder) {\n removeList.push(oldS);\n }\n // 子组件使用老的json时标识,更新后删除,render()返回空会没json对象\n if(json && json.__placeholder) {\n delete json.__placeholder;\n }\n if(json && json.__inheritAnimate) {\n delete json.__inheritAnimate;\n }\n if(json && json.__animateRecords) {\n delete json.__animateRecords;\n }\n // 高阶组件时需判断,子组件更新后生成新的sr,父组件的sr/host需要同时更新引用\n let host = cp.host;\n while(host) {\n if(host.shadow === cp) {\n host.__shadowRoot = sr;\n sr.__hostRoot = host;\n cp = host;\n host = host.host;\n }\n else {\n break;\n }\n }\n}\n\n/**\n * 非一级组件sr进行对比,key相同的无需重新生成且继承动画\n * @param vd\n * @param oj oldJson\n * @param nj\n */\nfunction diffSr(vd, oj, nj) {\n // 先遍历检查key相同的,将没有变化的key暂存下来,深度优先,这样叶子节点出现在前面,当key的叶子也有key时,确保叶子先对比\n let ojk = getKeyHash(oj, {}, vd);\n let njk = getKeyHash(nj, {});\n let keyList = [];\n let cpList = [];\n // 先对比key对应的节点,如果新老有一方对不上则落空\n Object.keys(ojk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n if(!n) {\n o.json.key = KEY_FLAG;\n }\n });\n Object.keys(njk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n // 有可能老的没有这个key,新key落空\n if(!o) {\n n.json.key = KEY_FLAG;\n return;\n }\n let oj = o.json;\n let nj = n.json;\n let vd = o.vd;\n // 相同class的组件进行对比替换\n if(oj.$$type === TYPE_CP && nj.$$type === TYPE_CP) {\n if(oj.klass === nj.klass) {\n // 对比props和children看是否全等,是则直接替换新json类型为占位符,引用老vd,否则强制更新\n diffCp(oj, nj, vd);\n // 标识对比过了\n oj.key = nj.key = KEY_FLAG;\n // 老的sr里需删除这个vd,因为老sr会回收\n cpList.push(vd);\n }\n }\n // 相同类型的vd进行对比继承动画\n else if(oj.$$type === nj.$$type && oj.tagName === nj.tagName) {\n // 需判断矢量标签mutil是否相等\n if(nj.$$type !== TYPE_GM || oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n oj.key = nj.key = KEY_FLAG;\n // key相同的dom暂存下来\n if(nj.$$type === TYPE_VD) {\n keyList.push({\n vd,\n oj,\n nj,\n });\n }\n }\n });\n // key相同的dom对比children,下面非key逻辑就不做了\n keyList.forEach(item => {\n diffChildren(item.vd, item.oj, item.nj);\n });\n // 整体tree进行对比\n diffChild(vd, oj, nj);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的\n cpList.forEach(vd => {\n removeCpFromOldTree(vd);\n });\n}\n\n/**\n * 递归检查dom的children,相同的无需重新生成,用PL类型占位符代替直接返回老vd\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChild(vd, oj, nj) {\n if(util.isObject(nj)) {\n if(nj.$$type === TYPE_CP) {\n // key对比过了忽略\n if(nj.key === KEY_FLAG) {\n return;\n }\n // 相同class的组件处理\n if(oj && oj.$$type === nj.$$type && oj.klass === nj.klass) {\n diffCp(oj, nj, vd);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收\n removeCpFromOldTree(vd);\n }\n }\n else if(nj.$$type === TYPE_GM && oj && oj.$$type === TYPE_GM) {\n // $geom的multi必须一致\n if(oj.tagName === nj.tagName && oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n }\n // dom类型递归children\n else if(nj.$$type === TYPE_VD && oj && oj.$$type === TYPE_VD) {\n if(oj.tagName === nj.tagName) {\n nj.__inheritAnimate = vd;\n }\n diffChildren(vd, oj, nj);\n }\n }\n}\n\n/**\n * dom类型的vd对比children\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChildren(vd, oj, nj) {\n let oc = oj.children;\n let nc = nj.children;\n let ol = oc.length;\n let nl = nc.length;\n let children = vd.children;\n for(let i = 0, of = 0, nf = 0, len = Math.min(ol, nl); i < len; i++) {\n let o = oc[i + of];\n let n = nc[i + nf];\n // 新老都是key直接跳过\n if(o.key === KEY_FLAG && n.key === KEY_FLAG) {\n }\n // 其中一个是key对比过了调整索引和长度\n else if(o.key === KEY_FLAG) {\n of++;\n i--;\n ol--;\n len = Math.min(ol, nl);\n }\n else if(n.key === KEY_FLAG) {\n nf++;\n i--;\n nl--;\n len = Math.min(ol, nl);\n }\n else {\n diffChild(children[i + of], o, n);\n }\n }\n // 长度不同增减的无需关注,新json创建cp有didMount,老vd会调用cp的destroy\n}\n\n/**\n * 根据json对比看cp如何更新,被render()后的json的二级组件对比才会出现\n * @param oj\n * @param nj\n * @param vd\n */\nfunction diffCp(oj, nj, vd) {\n // props全等,直接替换新json类型为占位符,引用老vd内容,无需重新创建,暂时存在json的placeholder上\n // 否则需要强制触发组件更新,包含setState内容\n nj.__placeholder = vd;\n let sr = vd.shadowRoot;\n // 对比需忽略on开头的事件,直接改老的引用到新的上,这样只变了on的话无需更新\n let exist = {};\n Object.keys(oj.props).forEach(k => {\n let v = oj.props[k];\n exist[k] = v;\n });\n Object.keys(nj.props).forEach(k => {\n let v = nj.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n vd.off(k, exist[k]);\n vd.on(k, v);\n }\n delete exist[k];\n }\n else {\n k = k.slice(2).toLowerCase();\n vd.on(k, v);\n }\n }\n });\n // 新的少的事件取消\n Object.keys(exist).forEach(k => {\n let v = exist[k];\n if(/^on[a-zA-Z]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n delete sr.listener[k];\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n vd.off(k, v);\n }\n });\n checkCp(vd, nj.props, !util.equal(oj.props, nj.props));\n}\n\n/**\n * 深度优先遍历json,将有key的记录在hash中,如果传入根vd,同步递归保存对应位置的vd\n * @param json\n * @param hash\n * @param vd\n * @returns {*}\n */\nfunction getKeyHash(json, hash, vd) {\n if(Array.isArray(json)) {\n json.forEach((item, i) => getKeyHash(item, hash, vd && vd[i]));\n }\n else if(util.isObject(json)) {\n if(json.$$type === TYPE_VD || json.$$type === TYPE_GM || json.$$type === TYPE_CP) {\n // 深度优先\n if(json.$$type === TYPE_VD) {\n getKeyHash(json.children, hash, vd && vd.children);\n }\n let key = json.props.key;\n if(!util.isNil(key) && key !== '') {\n // 重复key错误警告\n if(hash.hasOwnProperty(key)) {\n inject.warn('Component ' + vd.tagName + ' has duplicate key: ' + key);\n }\n hash[key] = {\n json,\n vd,\n };\n }\n }\n }\n return hash;\n}\n\n/**\n * 非一级组件diff发生更新时,其需要从sr的tree中移除,因为sr会销毁\n */\nfunction removeCpFromOldTree(vd) {\n // root下的一级组件不会发生回收情况,忽略\n if(!vd.host) {\n return;\n }\n let parent = vd.parent;\n if(parent) {\n let i = parent.children.indexOf(vd);\n if(i > -1) {\n parent.children[i] = null;\n }\n else {\n throw new Error('Can not find child: ' + vd.tagName);\n }\n }\n}\n\n/**\n * 执行componentDidUpdate/destroy\n */\nfunction did() {\n updateList.forEach(item => {\n if(util.isFunction(item.componentDidUpdate)) {\n item.componentDidUpdate();\n }\n });\n updateList.splice(0);\n removeList.forEach(item => {\n item.__destroy();\n });\n removeList = [];\n}\n\nexport default {\n updateList,\n check,\n did,\n};\n","import util from './util';\nimport level from '../refresh/level';\n\nconst { joinVd, joinDef } = util;\nconst { contain, NONE, TRANSFORM_ALL, OPACITY, FILTER, MIX_BLEND_MODE } = level;\n\nfunction diff(elem, ovd, nvd) {\n let cns = elem.childNodes;\n diffDefs(cns[0], ovd.defs, nvd.defs);\n // = i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinDef(nd[i]));\n }\n }\n}\n\nfunction diffDef(elem, od, nd) {\n if(od.tagName !== nd.tagName) {\n insertAdjacentHTML(elem, 'beforebegin', joinDef(nd));\n // elem.insertAdjacentHTML('beforebegin', joinDef(nd));\n elem.parentNode.removeChild(elem);\n }\n else {\n if(od.uuid !== nd.uuid) {\n elem.setAttribute('id', nd.uuid);\n }\n let op = {};\n for(let i = 0, len = (od.props || []).length; i < len; i++) {\n let prop = od.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nd.props || []).length; i < len; i++) {\n let prop = nd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n let cns = elem.childNodes;\n let ol = od.children.length;\n let nl = nd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, od.children[i], nd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nd.children[i]));\n }\n }\n }\n}\n\nfunction diffChild(elem, ovd, nvd) {\n if(ovd.type === 'dom') {\n if(nvd.type === 'dom') {\n diffD2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffD2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'text') {\n if(nvd.type === 'text') {\n diffT2T(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'geom') {\n if(nvd.type === 'dom') {\n diffG2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffG2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'img') {\n if(nvd.type === 'img') {\n diffItemSelf(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n}\n\nfunction diffX2X(elem, ovd, nvd) {\n let { transform, opacity, visibility, mask, overflow, filter, mixBlendMode, conClip } = nvd;\n if(ovd.transform !== transform) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(ovd.opacity !== opacity) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(ovd.visibility !== visibility) {\n elem.setAttribute('visibility', visibility);\n }\n if(ovd.mask !== mask) {\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n }\n if(ovd.filter !== filter || ovd.mixBlendMode !== mixBlendMode) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('filter');\n }\n }\n // if(ovd.filter !== filter) {\n // if(filter) {\n // elem.setAttribute('filter', filter);\n // }\n // else {\n // elem.removeAttribute('filter');\n // }\n // }\n if(ovd.overflow !== overflow) {\n if(overflow) {\n elem.setAttribute('clipPath', overflow);\n }\n else {\n elem.removeAttribute('overflow');\n }\n }\n if(ovd.conClip !== conClip) {\n if(conClip) {\n elem.childNodes[1].setAttribute('clip-path', conClip);\n }\n else {\n elem.childNodes[1].removeAttribute('clip-path');\n }\n }\n}\n\nfunction diffByLessLv(elem, ovd, nvd, lv) {\n let { transform, opacity, mask, filter, mixBlendMode } = nvd;\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n if(lv === NONE) {\n return;\n }\n if(contain(lv, TRANSFORM_ALL)) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(contain(lv, OPACITY)) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(contain(lv, FILTER) || contain(lv, MIX_BLEND_MODE)) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('style');\n }\n }\n}\n\nfunction diffD2D(elem, ovd, nvd, root) {\n // cache表明children无变化缓存,一定是REPAINT以下的,只需看自身的lv以及mask\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffD2G(elem, ovd, nvd) {\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n replaceWith(cns[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffT2T(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, ovd.children[i], nvd.children[i], true);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffG2D(elem, ovd, nvd) {\n diffD2G(elem, ovd, nvd);\n}\n\nfunction diffG2G(elem, ovd, nvd) {\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n }\n}\n\nfunction diffBb(elem, obb, nbb) {\n let ol = obb.length;\n let nl = nbb.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, obb[i], nbb[i]);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nbb[i]));\n }\n }\n}\n\nfunction diffItem(elem, i, ovd, nvd, isText) {\n let cns = elem.childNodes;\n if(ovd.tagName !== nvd.tagName) {\n replaceWith(cns[i], nvd);\n }\n else {\n diffItemSelf(cns[i], ovd, nvd);\n if(isText && ovd.content !== nvd.content) {\n cns[i].innerHTML = nvd.content;\n }\n }\n}\n\nfunction diffItemSelf(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let op = {};\n for(let i = 0, len = (ovd.props || []).length; i < len; i++) {\n let prop = ovd.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nvd.props || []).length; i < len; i++) {\n let prop = nvd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n}\n\nfunction replaceWith(elem, vd) {\n let res;\n if(Array.isArray(vd)) {\n res = '';\n vd.forEach(item => {\n res += joinVd(item);\n });\n }\n else {\n res = joinVd(vd);\n }\n insertAdjacentHTML(elem, 'beforebegin', res);\n // elem.insertAdjacentHTML('beforebegin', res);\n elem.parentNode.removeChild(elem);\n}\n\nfunction insertAt(elem, cns, index, html) {\n if(index >= cns.length) {\n insertAdjacentHTML(elem, 'beforeend', html);\n // elem.insertAdjacentHTML('beforeend', html);\n }\n else {\n insertAdjacentHTML(cns[index], 'beforebegin', html);\n // cns[index].insertAdjacentHTML('beforebegin', html);\n }\n}\n\nfunction removeAt(elem, cns, index) {\n if(cns[index]) {\n elem.removeChild(cns[index]);\n }\n}\n\nlet svg;\nfunction insertAdjacentHTML(elem, where, content) {\n if(elem.insertAdjacentHTML) {\n elem.insertAdjacentHTML(where, content);\n }\n else {\n switch(where) {\n case 'beforeend':\n elem.innerHTML += content;\n break;\n case 'beforebegin':\n svg = svg || document.createElement('svg');\n svg.innerHTML = content;\n elem.parentNode.insertBefore(svg.childNodes[0], elem);\n break;\n }\n }\n}\n\nexport default diff;\n","import util from '../util/util';\n\nconst { isFunction } = util;\n\nclass Controller {\n constructor() {\n this.__records = []; // 默认记录和自动记录\n this.__records2 = []; // 非自动播放的动画记录\n this.__list = [] // 默认初始化播放列表,自动播放也存这里\n this.__list2 = []; // json中autoPlay为false的初始化存入这里\n this.__onList = []; // list中已存在的侦听事件,list2初始化时也需要增加上\n this.__lastTime = {}; // 每个类型的上次触发时间,防止重复emit\n }\n\n add(v, list = this.list) {\n if(list.indexOf(v) === -1) {\n list.push(v);\n }\n }\n\n remove(v) {\n let i = this.list.indexOf(v);\n if(i > -1) {\n this.list.splice(i, 1);\n }\n }\n\n __destroy() {\n this.__records = [];\n this.__records2 = [];\n this.__list = [];\n this.__list2 = [];\n }\n\n __action(k, args) {\n this.list.forEach(item => {\n item[k].apply(item, args);\n });\n }\n\n init(records = this.__records, list = this.list) {\n // 检查尚未初始化的record,并初始化,后面才能调用各种控制方法\n if(records.length) {\n // 清除防止重复调用,并且新的json还会进入整体逻辑\n records.splice(0).forEach(item => {\n let { target, animate } = item;\n if(target.isDestroyed) {\n return;\n }\n if(Array.isArray(animate)) {\n animate.forEach(animate => {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n });\n }\n else {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n }\n });\n }\n // 非自动播放后初始化需检测事件,给非自动播放添加上,并清空本次\n if(records === this.__records2) {\n let onList = this.__onList;\n let list2 = this.list2;\n if(list2.length && onList.length) {\n list2.forEach(item => {\n onList.forEach(arr => {\n item.off(arr[0], arr[1]);\n item.on(arr[0], arr[1]);\n });\n });\n }\n }\n }\n\n __playAuto() {\n this.init();\n this.__action('play');\n }\n\n play(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('play', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n pause() {\n this.__action('pause');\n }\n\n resume(cb) {\n let once = true;\n this.__action('resume', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n __mergeAuto() {\n this.init();\n this.init(this.__records2);\n if(this.__list2.length) {\n this.__list = this.__list.concat(this.__list2);\n this.__list2 = [];\n }\n }\n\n cancel(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('cancel', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n finish(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('finish', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndStop(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('gotoAndStop', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndPlay(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('gotoAndPlay', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.__on(id[i], handle);\n }\n this.__onList.push([id, handle]);\n }\n else {\n this.__on(id, handle);\n this.__onList.push([id, handle]);\n }\n }\n\n __on(id, handle) {\n this.list.forEach(item => {\n let cb = () => {\n let time = item.timestamp;\n if(time !== this.__lastTime[id]) {\n this.__lastTime[id] = time;\n handle();\n }\n };\n cb.__karasEventCb = handle;\n item.on(id, cb);\n });\n }\n\n off(id, handle) {\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.off(id[i], handle);\n }\n }\n else {\n this.list.forEach(item => {\n item.off(id, handle);\n });\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get list2() {\n return this.__list2;\n }\n\n __set(key, value) {\n this.list.forEach(item => {\n item[key] = value;\n });\n }\n\n set playbackRate(v) {\n this.__set('playbackRate', v);\n }\n\n set iterations(v) {\n this.__set('iterations', v);\n }\n\n set playCount(v) {\n this.__set('playCount', v);\n }\n\n set fps(v) {\n this.__set('fps', v);\n }\n\n set currentTime(v) {\n this.__set('currentTime', v);\n }\n\n set spfLimit(v) {\n this.__set('spfLimit', v);\n }\n\n set delay(v) {\n this.__set('delay', v);\n }\n\n set endDelay(v) {\n this.__set('endDelay', v);\n }\n\n set fill(v) {\n this.__set('fill', v);\n }\n\n set direction(v) {\n this.__set('direction', v);\n }\n}\n\nexport default Controller;\n","import 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 Geom from '../node/geom/Geom';\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;\n }\n // 局部根节点如有perspective,则计算pm,这里不会出现嵌套,因为每个出现都会生成局部根节点\n let pm;\n if(perspective) {\n pm = tf.calPerspectiveMatrix(perspective, perspectiveOrigin);\n }\n // 广度遍历,不断一层层循环下去,用2个hash暂存每层的父matrix和opacity,blur只需记住顶层,因为子的如果有一定是cacheFilter\n let list = [index];\n let d = 0;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n d = blur.outerSize(v);\n }\n });\n opacityHash[index] = 1;\n // opacity可以保存下来层级相乘结果供外部使用,但matrix不可以,因为这里按画布原点为坐标系计算,外部合并局部根节点以bbox左上角为原点\n let matrixHash = {};\n while(list.length) {\n let arr = list.splice(0);\n for(let i = 0, len = arr.length; i < len; i++) {\n let parentIndex = arr[i];\n let total = __structs[parentIndex][STRUCT_TOTAL] || 0;\n for(let i = parentIndex + 1, len = parentIndex + total + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node2,\n [STRUCT_TOTAL]: total,\n } = __structs[i];\n // mask也不占bbox位置\n if(node2.isMask) {\n continue;\n }\n let {\n __sx1,\n __sy1,\n __config: {\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [OPACITY]: opacity,\n },\n },\n } = node2;\n // webgl不能跳过超限\n if(limitCache && !includeLimitCache) {\n return;\n }\n // display:none跳过整个节点树,visibility只跳过自身\n if(display === 'none') {\n i += total || 0;\n continue;\n }\n if(visibility === 'hidden') {\n continue;\n }\n parentIndexHash[i] = parentIndex;\n opacityHash[i] = opacityHash[parentIndex] * opacity;\n // 防止text的情况,其一定属于某个node,其bbox被计算过,text不应该计算\n if(node2 instanceof Text) {\n continue;\n }\n let bbox, dx = 0, dy = 0, hasTotal;\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n bbox = target.bbox.slice(0);\n dx = target.dbx;\n dy = target.dby;\n i += total || 0;\n hasTotal = true;\n }\n else if(__cache && __cache.available) {\n bbox = __cache.bbox.slice(0);\n dx = __cache.dbx;\n dy = __cache.dby;\n }\n else {\n bbox = node2.bbox;\n }\n // 可能Xom没有内容\n if(bbox) {\n bbox[0] -= sx1;\n bbox[1] -= sy1;\n bbox[2] -= sx1;\n bbox[3] -= sy1;\n let matrix = matrixHash[parentIndex];\n // 父级matrix初始化E为null,自身不为E时才运算,可以加速\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n tfo[0] += __sx1 - sx1 + dx;\n tfo[1] += __sy1 - sy1 + dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(pm) {\n matrix = multiply(pm, matrix);\n }\n bbox = 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);\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);\n texCache.refresh(gl, cx, cy);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n // 因为cacheTotal不总是以左上角原点为开始,所以必须每个节点重算matrix,合并box时计算的无法用到\n let matrixHash = {};\n // 先序遍历汇总到total\n for(let i = index + 1, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n let parentIndex = parentIndexHash[i];\n let matrix = matrixHash[parentIndex]; // 父节点的在每个节点计算后保存,第一个为top的默认为E(空)\n let opacity = opacityHash[i]; // opacity在合并box时已经计算可以直接用\n // 先看text,visibility会在内部判断,display会被parent判断\n if(node instanceof Text) {\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n texCache.addTexAndDrawWhenLimit(gl, __config[NODE_CACHE], opacity, matrix, cx, cy, dx, dy);\n }\n // 再看total缓存/cache,都没有的是无内容的Xom节点\n else {\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_IS_MASK]: isMask,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // mask和不可见不能被汇总到top上\n if(visibility === 'hidden' || isMask) {\n continue;\n }\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n if(__cache && __cache.available) {\n tfo[0] += __cache.sx1;\n tfo[1] += __cache.sy1;\n }\n else {\n tfo[0] += node.__sx1;\n tfo[1] += node.__sy1;\n }\n let dx = -sx1 + dbx;\n let dy = -sy1 + dby;\n tfo[0] += dx;\n tfo[1] += dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n if(target) {\n // 局部的mbm和主画布一样,先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成\n if(isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy);\n texCache.refresh(gl, cx, cy);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前fbo作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy);\n }\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n // 绘制到fbo的纹理对象上并删除fbo恢复\n texCache.refresh(gl, cx, cy);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 生成的纹理对象本身已绑定一个纹理单元了,释放lock的同时可以给texCache的channel缓存,避免重复上传\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bboxTotal);\n texCache.releaseLockChannel(n, mockCache.page);\n return [limitCache || totalLimitCache, mockCache];\n}\n\nfunction genFilterWebgl(gl, texCache, node, cache, filter, W, H) {\n let { sx1, sy1, width, height, bbox } = cache;\n let mockCache = cache;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n let res = genBlurWebgl(gl, texCache, mockCache, v, width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'hue-rotate') {\n let rotation = geom.d2r(v % 360);\n let cosR = Math.cos(rotation);\n let sinR = Math.sin(rotation);\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + cosR * 0.787 - sinR * 0.213, 0.715 - cosR * 0.715 - sinR * 0.715, 0.072 - cosR * 0.072 + sinR * 0.928, 0, 0,\n 0.213 - cosR * 0.213 + sinR * 0.143, 0.715 + cosR * 0.285 + sinR * 0.140, 0.072 - cosR * 0.072 - sinR * 0.283, 0, 0,\n 0.213 - cosR * 0.213 - sinR * 0.787, 0.715 - cosR * 0.715 + sinR * 0.715, 0.072 + cosR * 0.928 + sinR * 0.072, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'saturate' && v !== 100) {\n let amount = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + 0.787 * amount, 0.715 - 0.715 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 + 0.285 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 - 0.715 * amount, 0.072 + 0.928 * amount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'brightness' && v !== 100) {\n let b = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'grayscale' && v > 0) {\n let oneMinusAmount = 1 - v * 0.01;\n if(oneMinusAmount < 0) {\n oneMinusAmount = 0;\n }\n else if(oneMinusAmount > 1) {\n oneMinusAmount = 1;\n }\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.2126 + 0.7874 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 + 0.2848 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 + 0.9278 * oneMinusAmount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'contrast' && v !== 100) {\n let amount = v * 0.01;\n let o = -0.5 * amount;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n amount, 0, 0, 0, o,\n 0, amount, 0, 0, o,\n 0, 0, amount, 0, o,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n });\n // 切换回主程序\n gl.useProgram(gl.program);\n gl.viewport(0, 0, W, H);\n return mockCache;\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核d扩大3倍性能慢\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * 先动态生成gl程序,默认3核源码示例已注释,根据sigma获得d(一定奇数),再计算权重\n * 然后将d尺寸和权重拼接成真正程序并编译成program,再开始绘制\n */\nfunction genBlurWebgl(gl, texCache, cache, sigma, width, height, sx1, sy1, bbox) {\n let d = blur.kernelSize(sigma);\n let max = Math.max(15, gl.getParameter(gl.MAX_VARYING_VECTORS));\n while(d > max) {\n d -= 2;\n }\n let spread = blur.outerSizeByD(d);\n width += spread * 2;\n height += spread * 2;\n // 防止超限,webgl最大纹理尺寸限制\n let limit = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n if(width > limit || height > limit) {\n return;\n }\n bbox = bbox.slice(0);\n bbox[0] -= spread;\n bbox[1] -= spread;\n bbox[2] += spread;\n bbox[3] += spread;\n let cx = width * 0.5, cy = height * 0.5;\n let weights = blur.gaussianWeight(sigma, d);\n let vert = '';\n let frag = '';\n let r = Math.floor(d * 0.5);\n for(let i = 0; i < r; i++) {\n let c = (r - i) * 0.01;\n vert += `\\nv_texCoordsBlur[${i}] = a_texCoords + vec2(-${c}, -${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i}]) * ${weights[i]};`;\n }\n vert += `\\nv_texCoordsBlur[${r}] = a_texCoords;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${r}]) * ${weights[r]};`;\n for(let i = 0; i < r; i++) {\n let c = (i + 1) * 0.01;\n vert += `\\nv_texCoordsBlur[${i + r + 1}] = a_texCoords + vec2(${c}, ${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i + r + 1}]) * ${weights[i + r + 1]};`;\n }\n vert = vertexBlur.replace('[3]', '[' + d + ']').replace(/}$/, vert + '}');\n frag = fragmentBlur.replace('[3]', '[' + d + ']').replace(/}$/, frag + '}');\n let program = webgl.initShaders(gl, vert, frag);\n gl.useProgram(program);\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n texture = webgl.drawBlur(gl, program, frameBuffer, texCache, texture, cache.page.texture, i, j,\n width, height, cx, cy, spread, d, sigma);\n // 销毁这个临时program\n gl.deleteShader(program.vertexShader);\n gl.deleteShader(program.fragmentShader);\n gl.deleteProgram(program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n texCache.releaseLockChannel(j);\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox);\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genColorMatrixWebgl(gl, texCache, cache, m, width, height, sx1, sy1, bbox) {\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n gl.useProgram(gl.programCm);\n webgl.drawCm(gl, gl.programCm, j, m);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox.slice(0));\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genOverflowWebgl(gl, texCache, node, cache, W, H) {\n let sbox = node.bbox.slice(0);\n let bbox = cache.bbox;\n // 没超过无需生成\n if(bbox[0] >= sbox[0] && bbox[1] >= sbox[1] && bbox[2] <= sbox[2] && bbox[3] <= sbox[3]) {\n return;\n }\n let width = sbox[2] - sbox[0], height = sbox[3] - sbox[1];\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n // 绘制,根据坐标裁剪使用原本纹理的一部分\n gl.useProgram(gl.programOverflow);\n webgl.drawOverflow(gl, j, sbox[0] - bbox[0], sbox[1] - bbox[1], width, height, cache.width, cache.height);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let overflowCache = new MockCache(gl, texture, cache.sx1, cache.sy1, width, height, sbox);\n texCache.releaseLockChannel(i, overflowCache.page);\n return overflowCache;\n}\n\nfunction genMaskWebgl(gl, texCache, node, __config, cache, W, H, 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);console.log(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 // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n assignMatrix(m, matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n // node本身有或者父有perspective都认为需要生成3d渲染上下文\n if(tf.isPerspectiveMatrix(matrix) || parentPm) {\n if(hasRecordAsMask) {\n hasRecordAsMask[9] = true;\n }\n else {\n hasRecordAsMask = [i, lv, total, node, __config, null, null, null, null, true];\n }\n }\n // 先左乘perspective的矩阵,再左乘父级的总矩阵\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n 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 }\n else {\n mergeList.push([i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective]);\n }\n }\n }\n let limitHash = {};\n // 根据收集的需要合并局部根的索引,尝试合并,按照层级从大到小,索引从大到小的顺序,\n // 这样保证子节点在前,后节点在前,后节点是为了mask先应用自身如filter之后再进行遮罩\n if(mergeList.length) {\n mergeList.sort(function(a, b) {\n if(a[1] === b[1]) {\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n mergeList.forEach(item => {\n let [i, lv, total, node, __config, limitCache, hasMask, filter, overflow] = item;\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n } = __config;\n let needGen;\n // 可能没变化,比如被遮罩节点、filter变更等\n if(!__cacheTotal || !__cacheTotal.available) {\n let [limit, res] = genTotalWebgl(gl, texCache, node, __config, i, total || 0, __structs, __cache, limitCache, 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 target = genOverflowWebgl(gl, texCache, node, target, width, height);\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n if(filter.length) {\n if(!__cacheFilter || !__cacheFilter.available || needGen) {\n let old = target;\n target = genFilterWebgl(gl, texCache, node, target, filter, width, height);\n if(target !== old) {\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n }\n if(hasMask && (!__cacheMask || !__cacheMask.available || needGen)) {\n target = genMaskWebgl(gl, texCache, node, __config, target, width, height, 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 m = mx.m2Mat4(matrixEvent, cx, cy);\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 }\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[0] !== page || page.update) {\n // page可能为一个已有纹理,或者贴图\n if(page instanceof MockPage) {\n webgl.bindTexture(gl, page.texture, i);\n channels[i] = page;\n }\n else {\n // 可能老的先删除\n if(last) {\n gl.deleteTexture(last.texture);\n }\n page.texture = webgl.createTexture(gl, page.canvas, i);\n channels[i] = page;\n }\n hash[page.uuid] = i;\n }\n else {\n hash[page.uuid] = i;\n }\n // 标识没有更新,以及最后使用时间\n page.update = false;\n page.time = inject.now();\n }\n // 再次遍历开始本次渲染并清空\n webgl.drawTextureCache(gl, list, hash, cx, cy, revertY);\n pages.splice(0);\n list.splice(0);\n }\n }\n\n findExistTexChannel(page) {\n return this.channels.indexOf(page);\n }\n\n /**\n * 获取并锁定一个纹理单元优先使用空的,其次最久未使用的\n * @returns {number|*}\n */\n lockOneChannel() {\n // 优先返回空单元\n let channels = this.channels;\n let locks = this.locks;\n for(let i = 0; i < this.__units; i++) {\n if(!channels[i] && !locks[i]) {\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n }\n // 根据NRU返回最久未使用的\n let units = this.__units;\n let cl = [];\n for(let i = 0; i < units; i++) {\n if(!locks[i]) {\n cl.push([i, channels[i]]);\n }\n }\n if(cl.length) {\n cl.sort(function(a, b) {\n if(a[1].time !== b[1].time) {\n return (a[1].time || 0) - (b[1].time || 0);\n }\n if(a[1].fullSize !== b[1].fullSize) {\n return a[1].fullSize - b[1].fullSize;\n }\n return a[0] - b[0];\n });\n let i = cl[0][0];\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n throw new Error('No free texture unit');\n }\n\n /**\n * 释放掉i单元,并且设置内容到缓存channel中\n * @param i\n * @param setToChannel\n */\n releaseLockChannel(i, setToChannel) {\n if(this.locks[i]) {\n this.locks[i] = false;\n this.__lockUnits--;\n if(setToChannel) {\n this.channels[i] = setToChannel;\n }\n }\n }\n\n // 指定锁定一个单元\n lockChannel(i) {\n let channels = this.channels;\n let locks = this.locks;\n if(!locks[i]) {\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n }\n }\n\n /**\n * 释放纹理单元\n * @param gl\n */\n release(gl) {\n this.channels.forEach(item => {\n if(item) {\n gl.deleteTexture(item.texture);\n }\n });\n }\n\n get channels() {\n return this.__channels;\n }\n\n get locks() {\n return this.__locks;\n }\n\n 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 // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d');\n this.__renderMode = mode.CANVAS;\n }\n else if(this.tagName === 'svg') {\n this.__renderMode = mode.SVG;\n }\n else if(this.tagName === 'webgl') {\n let gl = this.__ctx = this.__dom.getContext('webgl', ca);\n this.__renderMode = mode.WEBGL;\n gl.program = webgl.initShaders(gl, vertex, fragment);\n gl.programMask = webgl.initShaders(gl, vertexMask, fragmentMask);\n gl.programClip = webgl.initShaders(gl, vertexMask, fragmentClip);\n gl.programOverflow = webgl.initShaders(gl, vertexMask, fragmentOverflow);\n gl.programCm = webgl.initShaders(gl, vertexCm, fragmentCm);\n gl.useProgram(gl.program);\n // 第一次渲染生成纹理缓存管理对象,收集渲染过程中生成的纹理并在gl纹理单元满了时进行绘制和清空,减少texImage2d耗时问题\n const MAX_TEXTURE_IMAGE_UNITS = Math.min(16, gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));\n this.__texCache = new TexCache(MAX_TEXTURE_IMAGE_UNITS);\n }\n this.refresh(null, true);\n // 第一次节点没有__root,渲染一次就有了才能diff\n if(this.dom.__root && this.dom.__root instanceof Root) {\n this.dom.__root.destroy();\n }\n this.__eventCbList = initEvent(this.dom, Root);\n this.dom.__root = this;\n }\n\n refresh(cb, isFirst) {\n this.__hookTask = null;\n let { isDestroyed, renderMode, ctx, defs, width, height } = this;\n if(isDestroyed) {\n return;\n }\n defs.clear();\n // 首次递归测量整树的继承,后续更改各自更新机制做,防止每次整树遍历;root检查首次直接做,后续在checkUpdate()中插入\n if(isFirst) {\n this.__checkRoot(renderMode, width, height);\n this.__computeMeasure(renderMode, ctx);\n }\n // 非首次刷新如果没有更新则无需继续\n else if(!this.__checkUpdate(renderMode, ctx, width, height)) {\n return;\n }\n // 获取所有字体和大小测量,仅svg需要,canvas直接做\n inject.measureText();\n this.__checkReflow(width, height);\n if(renderMode === mode.CANVAS && !this.props.noRender) {\n this.__clear(ctx, renderMode);\n 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 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 let hasUpdate;\n // root更新特殊提前,因为有继承因素\n if(updateRoot) {\n root.__updateRoot = null;\n hasUpdate = parseUpdate(renderMode, root, updateRoot,\n reflowList, measureList, cacheHash, cacheList);\n // 此时做root检查,防止root出现继承等无效样式,或者发生resize()\n if(hasUpdate) {\n root.__checkRoot(renderMode, width, height);\n }\n }\n // 汇总处理每个节点,k是递增数字直接循环遍历\n let keys = Object.keys(updateHash);\n for(let i = 0, len = keys.length; i < len; i++) {\n let t = parseUpdate(renderMode, root, updateHash[keys[i]],\n reflowList, measureList, cacheHash, cacheList, zHash, zList);\n hasUpdate = hasUpdate || t;\n }\n // 先做一部分reset避免下面measureList干扰,cacheList的是专门收集新增的额外节点\n root.__reflowList = reflowList;\n uniqueUpdateId = 0;\n root.__updateHash = root.__config[NODE_UPDATE_HASH] = {};\n cacheList.forEach(__config => {\n delete __config[NODE_UNIQUE_UPDATE_ID];\n });\n // zIndex改变的汇总修改,防止重复操作\n zList.forEach(item => {\n if(item.hasOwnProperty('__uniqueZId')) {\n delete item.__uniqueZId;\n item.__updateStruct(root.__structs);\n }\n });\n /**\n * 遍历每项节点,计算测量信息,节点向上向下查找继承信息,如果parent也是继承,先计算parent的\n * 过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n */\n let measureHash = {};\n measureList.forEach(node => {\n let { __config:{ [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId, [NODE_DOM_PARENT]: parent } } = node;\n // 在root下的component变更时root会进入,但其没有__uniqueUpdateId\n if(node !== root) {\n if(measureHash.hasOwnProperty(__uniqueUpdateId)) {\n return;\n }\n measureHash[__uniqueUpdateId] = true;\n }\n let last = node;\n // 检查measure的属性是否是inherit,在root下的component变更时root会进入,但其没有__uniqueUpdateId\n // 另外dom标识表明有dom变更强制进入\n let isInherit = node !== root\n && (updateHash[__uniqueUpdateId][UPDATE_ADD_DOM]\n || change.isMeasureInherit(updateHash[__uniqueUpdateId][UPDATE_STYLE]));\n // 是inherit,需要向上查找,从顶部向下递归计算继承信息\n if(isInherit) {\n while(parent && parent !== root) {\n let { __config: {\n [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId,\n }, currentStyle } = parent;\n let isInherit;\n if(parent.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n let style = updateHash[__uniqueUpdateId][UPDATE_STYLE];\n measureHash[__uniqueUpdateId] = true;\n let temp = change.measureInheritList(style);\n isInherit = !!temp.length;\n }\n else {\n isInherit = change.isMeasureInherit(currentStyle);\n }\n // 如果parent有inherit存入列表且继续向上,否则跳出循环\n if(isInherit) {\n last = parent;\n }\n else {\n break;\n }\n // 考虑component下的继续往上继承\n parent = parent.domParent;\n }\n }\n // 自顶向下查找inherit的,利用已有的方法+回调,当递归包含重复时标记防止重复\n last.__computeMeasure(renderMode, ctx, function(target) {\n if(target.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n measureHash[target.__config[NODE_UNIQUE_UPDATE_ID]] = true;\n }\n });\n });\n // 做完清空留待下次刷新重来\n for(let i = 0, len = keys.length; i < len; i++) {\n delete updateHash[keys[i]][UPDATE_CONFIG][NODE_UNIQUE_UPDATE_ID];\n }\n return hasUpdate;\n }\n\n /**\n * 除首次外每次刷新前检查reflow列表,计算需要reflow的节点局部重新布局\n * 当一个元素absolute不变时,其变化不会影响父元素和兄弟元素,直接自己重新局部LAYOUT包含子节点\n * 当absolute发生改变时,其变化会影响父和兄弟,视作父重新布局\n * 当inline变化时,视为其最近block/flex父变化\n * 当block变化时,往上查找最上层flex视为其变化,如不是则影响后面兄弟offset和父resize\n * 当flex变化时,往上查找最上层flex视为其变化,如不是则影响所有递归子节点layout和父resize\n * 以上3种情况向上查找时遇到absolute父均提前跳出,并标记absolute父LAYOUT\n * 上面所有情况即便结束还得额外看是否处于absolute中,是还是标记absolute重新布局\n * 当relative只变化left/top/right/bottom时,自己重新layout\n * 检测节点时记录影响的所有节点,最终形成一棵或n棵局部树\n * 需要重新布局的记作LAYOUT,被兄弟影响只需偏移的记作OFFSET,OFFSET可能会重复变为LAYOUT\n * 上述情况倘若发生包含重复,去掉子树,因子树视为被包含的重新布局\n * 如果有从root开始的,直接重新布局像首次那样即可\n * 如果非root,所有树根按先根顺序记录下来,依次执行局部布局\n * =========================\n * addDom比较特殊,是向已有节点中添加新的节点,检查影响与普通domDiff变化不同\n * @private\n */\n __checkReflow(width, height) {\n let { __reflowList: reflowList } = this;\n if(!reflowList.length) {\n return;\n }\n let root = this;\n let uniqueList = [];\n let hasRoot;\n __uniqueReflowId = 0;\n let reflowHash = {};\n // 遍历检查发生布局改变的节点列表,此时computedStyle还是老的,currentStyle是新的\n for(let i = 0, len = reflowList.length; i < len; i++) {\n let item = reflowList[i];\n let { node, component, addDom, removeDom } = item;\n // root提前跳出,完全重新布局\n if(node === this) {\n hasRoot = true;\n break;\n }\n // 添加时如果是cp则node取sr来布局\n if(addDom && node instanceof Component) {\n node = node.shadowRoot;\n }\n // 每个节点生成唯一的布局识别id存入hash防止重复\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n reflowHash[__uniqueReflowId++] = item;\n }\n // 每个节点都向上检查影响,以及是否从root开始完全重新,remove特殊对待,影响父节点视为普通父节点relay\n if(checkInfluence(root, reflowHash, node, component, addDom)) {\n hasRoot = true;\n if(addDom) {\n this.__zIndexChildren = null;\n }\n break;\n }\n // remove的要特殊对待,因为提前删除了父子兄弟关系,下面deepScan不会出现\n else if(removeDom) {\n uniqueList.push(item);\n }\n }\n __uniqueReflowId = 0;\n this.__reflowList = [];\n // 有root提前跳出\n if(hasRoot) {\n reflow.clearUniqueReflowId(reflowHash);\n // 布局分为两步,普通流和定位流,互相递归\n this.__layout({\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n // 绝对布局需要从根开始保存相对坐标系的容器引用,并根据relative/absolute情况变更\n this.__layoutAbs(this, {\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n this.__structs = this.__structure(0, 0);\n return true;\n }\n /**\n * 修剪树,自顶向下深度遍历\n * LAYOUT节点作为局部根,其递归子节点无需重复任何操作,直接去重\n * OFFSET节点作为局部根,其递归子节点先执行任何操作,后续根节点再偏移一次\n */\n else {\n this.__deepScan(function(node, options) {\n if(node.hasOwnProperty('__uniqueReflowId')) {\n let o = reflowHash[node.__uniqueReflowId];\n options.uniqueList.push(o);\n // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行\n return true;\n }\n // reflowHash没有记录则无返回继续递归执行\n }, { uniqueList });\n /**\n * 按顺序执行列表即可,上层LAYOUT先执行且停止递归子节点,上层OFFSET后执行等子节点先LAYOUT/OFFSET\n * 同级按先后顺序排列,过程中记录diff在结束后进行structs更新\n * 这里要注意margin合并的逻辑,因为最终都是block(flex等同),需要进行合并\n * 在处理一个block时,先判断是否是空block,同时看后面紧邻的有没有在uniqueList的下一个\n * 单独空block处理、2个相邻的非block处理直接可以进行判断\n * 中间的空block(即非空block的下一个是空block,且下一个不是最后一个),先记录下来list,合并后一并offset\n * 合并margin和Dom的逻辑一样,抽离共有方法\n **/\n let diffList = [];\n let diffI = 0;\n let mergeOffsetList = [];\n let __uniqueMergeOffsetId = 0;\n uniqueList.forEach(item => {\n let { node, component, addDom, removeDom } = item;\n // 重新layout的w/h数据使用之前parent暂存的,x使用parent,y使用prev或者parent的\n let cps = node.computedStyle, cts = node.currentStyle;\n let zIndex = cps[Z_INDEX], position = cps[POSITION], display = cps[DISPLAY];\n let isLastAbs = position === 'absolute';\n let isNowAbs = cts[POSITION] === 'absolute';\n let isLastNone = display === 'none';\n let isNowNone = cts[DISPLAY] === 'none';\n // none不可见布局无效可以无视\n if(isLastNone && isNowNone) {\n return;\n }\n let parent = node.domParent;\n let { __layoutData: { x, y, h }, width, computedStyle } = parent;\n let current = node;\n // cp的shadowRoot要向上到cp本身,考虑高阶组件在内到真正的顶层cp\n if(current.isShadowRoot) {\n current = current.hostRoot;\n }\n // y使用prev或者parent的,首个节点无prev,prev要忽略absolute的和display:none的\n let ref = current.prev;\n let hasFlowPrev;\n while(ref) {\n if(ref instanceof Text\n || (ref.computedStyle[POSITION] !== 'absolute' && ref.computedStyle[DISPLAY] !== 'none')) {\n y = ref.y + ref.outerHeight;\n hasFlowPrev = true;\n break;\n }\n ref = ref.prev;\n }\n // 找不到prev以parent为基准,找到则增加自身,排除remove\n if(!removeDom) {\n if(!hasFlowPrev) {\n y += computedStyle[MARGIN_TOP] + computedStyle[BORDER_TOP_WIDTH] + computedStyle[PADDING_TOP];\n }\n x += computedStyle[MARGIN_LEFT] + computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT];\n }\n // 找到最上层容器,如果是组件的子节点,以sr为container,sr本身往上找\n let container = node;\n // remove的节点本身无需再次布局\n if(!removeDom) {\n if(isNowAbs) {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n if(!container) {\n container = root;\n }\n // 由setState引发的要检查是cp自身还是更上层,如果cp被abs包含,那么node是cp的父亲,否则node是cp的sr\n // 而这种情况下传cp或node都一样,所以最终统一传node\n parent.__layoutAbs(container, null, node);\n // 优先判断dom变更\n if(addDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n return;\n }\n // 前后都是abs无需偏移后面兄弟和parent调整,component变化节点需更新struct\n else if(isLastAbs) {\n if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n }\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n return;\n }\n // 标识flow变abs,可能引发zIndex变更,重设struct和svg\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // 现在是普通流,不管之前是啥直接布局,排除remove删除的\n else {\n node.__layout({\n x,\n y,\n w: width,\n h,\n });\n y += node.outerHeight;\n if(component) {\n container = node;\n }\n else {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n }\n if(!container) {\n container = root;\n }\n // 防止geom\n if(node instanceof Dom) {\n node.__layoutAbs(container, {\n x,\n y,\n w: width,\n h,\n });\n }\n }\n }\n\n // 向上查找最近的parent是relative,需再次累加ox/oy,无需继续向上递归,因为parent已经递归包含了\n // 这样node重新布局后再次设置其使用parent的偏移\n let p = node;\n while(p && p !== root) {\n p = p.domParent;\n computedStyle = p.computedStyle;\n if(computedStyle[POSITION] === 'relative') {\n let { ox, oy } = p;\n ox && node.__offsetX(ox);\n oy && node.__offsetY(oy);\n break;\n }\n }\n\n // 向下调整next的flow位置,遇到重复LAYOUT的跳出等待其调用并处理其next,忽视掉abs,margin和abs在merge中做\n if(node.isShadowRoot) {\n node = node.hostRoot;\n }\n let next = node.next;\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n if(next.computedStyle[POSITION] === 'absolute') {\n next = next.next;\n continue;\n }\n let { y: oy } = next;\n let diff = y - oy;\n if(diff) {\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n let target = next;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let cs = target.computedStyle;\n if(cs[POSITION] !== 'absolute' && cs[DISPLAY] !== 'none') {\n target.__offsetY(diff, true, REPAINT);\n }\n next = next.next;\n }\n }\n break;\n }\n\n // 去重防止abs并记录parent,整个结束后按先序顺序进行margin合并以及偏移,注意忽略有display:none变block同时为absolute的\n if(!parent.hasOwnProperty('__uniqueMergeOffsetId') && !(isNowAbs && isLastNone)) {\n parent.__uniqueMergeOffsetId = __uniqueMergeOffsetId++;\n mergeOffsetList.push(parent);\n }\n\n // add和remove都需父节点重新生成struct,zIndexChildren已在对应api操作的before()侦听做了\n if(addDom || removeDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // component未知dom变化,所以强制重新struct,text则为其父节点,同时防止zIndex变更影响父节点\n else if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n node.domParent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(node.domParent);\n }\n }\n }\n // display有none变化,重置struct和zIndexChildren\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n });\n /**\n * mergeMargin后续调整,记录的是变更节点的父节点,因此每个节点内部直接遍历孩子进行\n * 由于保持先根遍历的顺序,因此会从最上最里的节点开始,先进行margin合并\n * 由于之前忽略掉abs节点,因此再检查直接abs是否要调整\n * 完成后对此父节点的后续兄弟节点进行调整,多次不会干扰影响\n * 然后继续往上循环,直到root结束\n */\n let inDirectAbsList = [];\n mergeOffsetList.forEach(parent => {\n delete parent.__uniqueMergeOffsetId;\n let flowChildren = parent.flowChildren, absChildren = parent.absChildren;\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length, lastChild;\n let isStart, startIndex, startNode;\n // 遍历flow孩子,从开始变化的节点开始,看变化造成的影响,对其后面节点进行偏移,并统计总偏移量\n for(let i = 0; i < length; i++) {\n let item = flowChildren[i];\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n let isXom = item instanceof Xom;\n // 忽略掉前面没有变更的节点,不能合并\n if(!isStart && isXom) {\n if(item.hasOwnProperty('__uniqueReflowId')) {\n isStart = true;\n startIndex = i;\n startNode = item;\n }\n }\n // 开始变更的节点,至少不是第0个\n let cs = isXom && item.currentStyle;\n let isInline = isXom && cs[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(cs[DISPLAY]) > -1;\n lastChild = item;\n // 每次循环开始前,这次不是block的话,看之前遗留的,可能是以空block结束,需要特殊处理,单独一个空block也包含\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length && isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n // 和普通布局类似,只是不用重新布局只需处理合并margin再根据差值偏移\n if(isXom && !isInline) {\n let isNone = isXom && cs[DISPLAY] === 'none';\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n // 空block要留下轮循环看,除非是最后一个,非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n if(isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n // 需要合并的情况,根据记录数和索引向上向下遍历节点设置偏移,同时设置总偏移量供父级使用\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0,最后一个一定有不必判断isStart\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n }\n // 先检查parent的尺寸是否发生了变化,从而决定是否调整next以及向上递归调整\n let cs = parent.currentStyle;\n let height = cs[HEIGHT];\n let isContainer = parent === root || parent.isShadowRoot || cs[POSITION] === 'absolute' || cs[POSITION] === 'relative';\n if(height[1] === AUTO && lastChild) {\n let oldH = parent.height + parent.computedStyle[PADDING_TOP];\n let nowH = lastChild.y + lastChild.outerHeight - parent.y;\n let diff = nowH - oldH;\n // 调整next以及非固定PX的abs,再递归向上\n if(diff) {\n parent.__resizeY(diff, REPAINT);\n let container;\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = item.currentStyle;\n // 是容器,所有的都调整,不是容器,其偏移是上级parent的某一个,根据情况具体不同\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n else if(bottom[1] === PX) {\n item.__offsetY(diff, true, REPAINT);\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n else if(top[1] === PERCENT) {\n if(isContainer) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n // 非容器的特殊处理\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n if(container.currentStyle[HEIGHT][1] !== PX) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, null, item);\n }\n // 不在容器内说明在上级,存入等结束后统一重新布局\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, item]);\n }\n }\n }\n reflow.offsetAndResizeByNodeOnY(parent, root, reflowHash, diff, inDirectAbsList);\n return;\n }\n }\n // 没有diff变化或者固定尺寸,可能内部发生变化,调整AUTO的abs,不递归向上\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom } = item.currentStyle;\n if(top[1] === AUTO && bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n }\n });\n // merge过程中需要重新布局的abs\n inDirectAbsList.forEach(arr => {\n arr[0].__layoutAbs(arr[1], null, arr[2]);\n });\n\n // 调整因reflow造成的原struct数据索引数量偏差,纯zIndex的已经在repaint里面重新生成过了\n // 这里因为和update保持一致的顺序,因此一定是先根顺序且互不包含\n let diff = 0, lastIndex = 0, isFirst = true, structs = root.__structs;\n diffList.forEach(item => {\n let [ns, d] = item;\n // 第一个有变化的,及后面无论有无变化都需更新\n // 第1个变化区域无需更改前面一段\n if(isFirst) {\n isFirst = false;\n lastIndex = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1;\n diff += d;\n }\n // 第2+个变化区域看是否和前面一个相连,有不变的段则先偏移它,然后再偏移自己\n else {\n let j = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1 + diff;\n for(let i = lastIndex; i < j; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n lastIndex = j;\n diff += d;\n }\n });\n // 后面的要根据偏移量校正索引\n if(diff) {\n for(let i = lastIndex, len = structs.length; i < len; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n }\n // 清除id\n reflow.clearUniqueReflowId(reflowHash);\n }\n }\n\n // 特殊覆盖方法,不需要super()计算自己,因为放在每次checkRoot()做过了\n __computeMeasure(renderMode, ctx) {\n css.computeMeasure(this, true);\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx);\n });\n }\n\n // 每个root拥有一个刷新hook,多个root塞到frame的__hookTask里\n // frame在所有的帧刷新逻辑执行后检查hook列表,进行root刷新操作\n __frameHook() {\n if(!this.__hookTask) {\n let r = this.__hookTask = (() => {\n this.refresh();\n });\n frame.__hookTask.push(r);\n }\n }\n\n __clear(ctx, renderMode) {\n if(renderMode === mode.CANVAS) {\n // 可能会调整宽高,所以每次清除用最大值\n this.__mw = Math.max(this.__mw, this.width);\n this.__mh = Math.max(this.__mh, this.height);\n // 清除前得恢复默认matrix,防止每次布局改变了属性\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, this.__mw, this.__mh);\n }\n else if(renderMode === mode.WEBGL) {\n ctx.clearColor(0, 0, 0, 0);\n ctx.clear(ctx.COLOR_BUFFER_BIT);\n }\n }\n\n get dom() {\n return this.__dom;\n }\n\n get uuid() {\n return this.__uuid;\n }\n\n get renderMode() {\n return this.__renderMode;\n }\n\n get ctx() {\n return this.__ctx;\n }\n\n get defs() {\n return this.__defs;\n }\n\n get taskUp() {\n return this.__taskUp;\n }\n\n get taskCp() {\n return this.__taskCp;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get animateController() {\n return this.__animateController;\n }\n\n get texCache() {\n return this.__texCache;\n }\n}\n\nexport default Root;\n","import Geom from './Geom';\nimport mode from '../mode';\nimport painter from '../../util/painter';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction reBuild(target, origin, base, isMulti) {\n if(isMulti) {\n return target.map(item => origin + item * base);\n }\n else {\n return origin + target * base;\n }\n}\n\nfunction reBuildC(target, originX, originY, width, height, isMulti) {\n if(isMulti) {\n if(target) {\n return target.map(item => reBuildC(item, originX, originY, width, height));\n }\n }\n else {\n if(target && target.length >= 2) {\n return [\n originX + target[0] * width,\n originY + target[1] * height,\n ];\n }\n }\n return [];\n}\n\nfunction curveNum(controlA, controlB) {\n let num = 0;\n if(controlA.length >= 2) {\n num++;\n }\n if(controlB.length >= 2) {\n num += 2;\n }\n return num;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getNewPoint(x1, y1, x2, y2, controlA, controlB, num, start = 0, end = 1) {\n if(start > 0 || end < 1) {\n if(num === 3) {\n [[x1, y1], controlA, controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, controlB, [x2, y2]], start, end);\n }\n else if(num === 2) {\n [[x1, y1], controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlB, [x2, y2]], start, end);\n }\n else if(num === 1) {\n [[x1, y1], controlA, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, [x2, y2]], start, end);\n }\n else {\n let a = Math.abs(x1 - x2);\n let b = Math.abs(y1 - y2);\n x1 += a * start;\n y1 += b * start;\n x2 -= a * (1 - end);\n y2 -= b * (1 - end);\n }\n }\n return [x1, y1, x2, y2, controlA, controlB];\n}\n\nclass Line extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // x1,y1和x2,y2表明线段的首尾坐标,control表明控制点坐标\n if(this.isMulti) {\n this.__x1 = [0];\n this.__y1 = [0];\n this.__x2 = [1];\n this.__y2 = [1];\n this.__controlA = [[]];\n this.__controlB = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.x1)) {\n this.__x1 = props.x1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x1)) {\n this.__x1 = [parseFloat(props.x1) || 0];\n }\n if(Array.isArray(props.y1)) {\n this.__y1 = props.y1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y1)) {\n this.__y1 = [parseFloat(props.y1) || 0];\n }\n if(Array.isArray(props.x2)) {\n this.__x2 = props.x2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x2)) {\n this.__x2 = [parseFloat(props.x2) || 0];\n }\n if(Array.isArray(props.y2)) {\n this.__y2 = props.y2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y2)) {\n this.__y2 = [parseFloat(props.y2) || 0];\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__x1.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__x1.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__x1.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__x1.map(() => v);\n }\n }\n else {\n this.__x1 = this.__y1 = this.__start = 0;\n this.__x2 = this.__y2 = this.__end = 1;\n this.__controlA = [];\n this.__controlB = [];\n if(!isNil(props.x1)) {\n this.__x1 = parseFloat(props.x1) || 0;\n }\n if(!isNil(props.y1)) {\n this.__y1 = parseFloat(props.y1) || 0;\n }\n if(!isNil(props.x2)) {\n this.__x2 = parseFloat(props.x2) || 0;\n }\n if(!isNil(props.y2)) {\n this.__y2 = parseFloat(props.y2) || 0;\n }\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA;\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB;\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, __cacheProps, isMulti } = this;\n let rebuild;\n ['x1', 'x2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originX, width, isMulti);\n }\n });\n ['y1', 'y2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originY, height, isMulti);\n }\n });\n ['controlA', 'controlB'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuildC(this[k], originX, originY, width, height, isMulti);\n }\n });\n ['start', 'end'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = this[k];\n }\n });\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 },\n } = this;\n this.buildCache(originX, originY);\n let { x1, y1, x2, y2, controlA, controlB } = __cacheProps;\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n if(!isMulti) {\n x1 = [x1];\n x2 = [x2];\n y1 = [y1];\n y2 = [y2];\n controlA = [controlA];\n controlB = [controlB];\n }\n x1.forEach((xa, i) => {\n let ya = y1[i];\n let xb = x2[i];\n let yb = y2[i];\n let ca = controlA[i];\n let cb = controlB[i];\n if((isNil(ca) || ca.length < 2) && (isNil(cb) || cb.length < 2)) {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[0] = Math.min(bbox[0], xb - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[1] = Math.min(bbox[1], yb - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[2] = Math.max(bbox[2], xb + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n bbox[3] = Math.max(bbox[3], yb + oy);\n }\n else if(isNil(ca) || ca.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(isNil(cb) || cb.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n });\n return bbox;\n }\n}\n\nexport default Line;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction concatPointAndControl(point, control) {\n if(Array.isArray(control) && (control.length === 2 || control.length === 4)\n && Array.isArray(point) && point.length === 2) {\n return control.concat(point);\n }\n return point;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getLength(list, isMulti) {\n let res = [];\n let total = 0;\n let increase = [];\n if(isMulti) {\n total = [];\n list.forEach(list => {\n let temp = getLength(list);\n res.push(temp.list);\n total.push(temp.total);\n increase.push([0].concat(temp.increase));\n });\n }\n else if(Array.isArray(list)) {\n total = 0;\n increase.push(0);\n let start = 0;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item)) {\n start = i;\n break;\n }\n }\n let prev = list[start];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n let a = Math.abs(item[0] - prev[0]);\n let b = Math.abs(item[1] - prev[1]);\n let c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n res.push(c);\n total += c;\n increase.push(total);\n prev = item;\n }\n else if(item.length === 4) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]]], 2);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[2], item[3]];\n }\n else if(item.length === 6) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]], [item[4], item[5]]], 3);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[4], item[5]];\n }\n }\n }\n return {\n list: res,\n total,\n increase,\n };\n}\n\nfunction getIndex(list, t, i, j) {\n if(i === j) {\n if(list[i] > t) {\n return i - 1;\n }\n return i;\n }\n let middle = i + ((j - i) >> 1);\n if(list[middle] === t) {\n return middle;\n }\n else if(list[middle] > t) {\n return getIndex(list, t, i, Math.max(middle - 1, i));\n }\n else {\n return getIndex(list, t, Math.min(middle + 1, j), j);\n }\n}\n\nfunction getNewList(list, len, start = 0, end = 1) {\n if(start === 0 && end === 1) {\n return list;\n }\n if(start >= end) {\n return [];\n }\n let i = 0, j = list.length - 1;\n if(start > 0) {\n i = getIndex(len.increase, start * len.total, i, j);\n }\n if(end < 1) {\n j = getIndex(len.increase, end * len.total, i, j);\n }\n list = util.clone(list);\n end *= len.total;\n let prePercent = 1;\n if(end > len.increase[j]) {\n let prev = list[j].slice(list[j].length - 2); // 最后2个点是x,y,前面是control\n let current = list[j + 1];\n let l = len.list[j];\n let diff = end - len.increase[j];\n let t = diff / l;\n prePercent = t;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[j + 1] = [current[1] - (1 - t) * a, current[1] - (1 - t) * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], res[3][0], res[3][1]];\n }\n }\n start *= len.total;\n if(start > len.increase[i]) {\n let prev = list[i].slice(list[i].length - 2);\n let current = list[i + 1];\n let l = len.list[i];\n // 同一条线段时如果有end裁剪,会影响start长度\n if(i === j && prePercent !== 1) {\n l *= prePercent;\n }\n let diff = start - len.increase[i];\n let t = diff / l;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[i] = [prev[0] + t * a, prev[1] + t * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([[current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([[current[4], current[5]], [current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], current[4], current[5]];\n }\n }\n if(j < list.length - 2) {\n list = list.slice(0, j + 2);\n }\n if(i > 0) {\n list = list.slice(i);\n }\n return list;\n}\n\nclass Polyline extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 所有点的列表\n if(this.isMulti) {\n this.__points = [[]];\n this.__controls = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__points.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__points.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__points.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__points.map(() => v);\n }\n }\n else {\n this.__points = [];\n // 控制点\n this.__controls = [];\n this.__start = 0;\n this.__end = 1;\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n }\n if(Array.isArray(props.controls)) {\n this.__controls = props.controls;\n }\n if(Array.isArray(props.points)) {\n this.__points = props.points;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n return points.map((item, i) => {\n if(!Array.isArray(item)) {\n return;\n }\n let len = item.length;\n if(isControl) {\n if(len !== 0 && len !== 2 && len !== 4) {\n return;\n }\n }\n else {\n if(len !== 0 && len !== 2) {\n return;\n }\n }\n let res = [];\n for(let i = 0; i < len; i++) {\n if(i % 2 === 0) {\n res.push(originX + item[i] * width);\n }\n else {\n res.push(originY + item[i] * height);\n }\n }\n return res;\n });\n }\n\n // 供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 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 },\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let { points, controls } = __cacheProps;\n if(!isMulti) {\n points = [points];\n controls = [controls];\n }\n points.forEach((pointList, i) => {\n if(!pointList || pointList.length < 2 || pointList[0].length < 2 || pointList[1].length < 2) {\n return;\n }\n let controlList = controls[i] || [];\n let [xa, ya] = pointList[0];\n for(let i = 1, len = pointList.length; i < len; i++) {\n let [xb, yb] = pointList[i];\n let c = controlList[i - 1];\n if(c && c.length === 4) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], c[2], c[3], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(c && c.length === 2) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n }\n xa = xb;\n ya = yb;\n }\n });\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Polyline;\n","import Polyline from './Polyline';\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} } = enums;\nconst { isNil } = util;\nconst { sectorPoints } = geom;\nconst { REM, VW, VH } = unit;\n\nfunction getR(v, dft) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = dft;\n }\n return v;\n}\n\nclass Sector extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 角度\n if(this.isMulti) {\n this.__begin = [0];\n this.__end = [0];\n this.__r = [1];\n if(Array.isArray(props.begin)) {\n this.__begin = props.begin.map(i => getR(i, 0));\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => getR(i, 0));\n }\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i, 1));\n }\n if(Array.isArray(props.edge)) {\n this.__edge = props.edge.map(i => !!i);\n }\n if(Array.isArray(props.closure)) {\n this.__closure = props.closure.map(i => !!i);\n }\n }\n else {\n this.__begin = this.__end = 0;\n // 半径[0, ∞),默认1\n this.__r = 1;\n // 扇形两侧是否有边\n this.__edge = false;\n // 扇形大于180°时,是否闭合两端\n this.__closure = false;\n if(!isNil(props.begin)) {\n this.__begin = getR(props.begin, 0);\n }\n if(!isNil(props.end)) {\n this.__end = getR(props.end, 0);\n }\n if(!isNil(props.r)) {\n this.__r = getR(props.r, 1);\n }\n if(!isNil(props.edge)) {\n this.__edge = !!props.edge;\n }\n if(!isNil(props.closure)) {\n this.__closure = !!props.closure;\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, begin, end, r, edge, closure, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.begin) || focus) {\n rebuild = true;\n __cacheProps.begin = (begin || 0) % 360;\n }\n if(isNil(__cacheProps.end) || focus) {\n rebuild = true;\n __cacheProps.end = (end || 0) % 360;\n }\n if(isNil(__cacheProps.r) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.r = r.map(r => r * width * 0.5);\n }\n else {\n __cacheProps.r = r * width * 0.5;\n }\n }\n r = __cacheProps.r;\n if(isNil(__cacheProps.edge) || focus) {\n rebuild = true;\n __cacheProps.edge = edge;\n }\n if(isNil(__cacheProps.closure) || focus) {\n rebuild = true;\n __cacheProps.closure = closure;\n }\n if(rebuild) {\n if(isMulti) {\n __cacheProps.list = [];\n __cacheProps.sList = [];\n begin.forEach((begin, i) => {\n let r2 = isNil(r[i]) ? width * 0.5 : r[i];\n let list = sectorPoints(cx, cy, r2, parseFloat(begin || 0) % 360, parseFloat(end[i] || 0) % 360);\n let sList = list.slice(0);\n if(closure[i]) {\n list.push(list[0].slice(0));\n if(edge) {\n sList.push(sList[0].slice(0));\n }\n }\n else {\n list.unshift([cx, cy]);\n list.push([cx, cy]);\n if(edge) {\n sList.unshift([cx, cy]);\n sList.push([cx, cy]);\n }\n }\n __cacheProps.list.push(list);\n __cacheProps.sList.push(sList);\n });\n }\n else {\n let list = sectorPoints(cx, cy, r, parseFloat(begin || 0), parseFloat(end || 0));\n let sList = list.slice(0);\n if(closure) {\n list.push(list[0].slice(0));\n if(edge) {\n sList.push(sList[0].slice(0));\n }\n }\n else {\n list.unshift([cx, cy]);\n list.push([cx, cy]);\n if(edge) {\n sList.unshift([cx, cy]);\n sList.push([cx, cy]);\n }\n }\n __cacheProps.list = list;\n __cacheProps.sList = sList;\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Sector;\n","import Geom from './Geom';\nimport util from \"../../util/util\";\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction genVertex(x, y, width, height, rx = 0, ry = 0) {\n if(rx === 0 || ry === 0) {\n return [\n [x, y],\n [x + width, y],\n [x + width, y + height],\n [x, y + height],\n [x, y],\n ];\n }\n let ox = rx * geom.H;\n let oy = ry * geom.H;\n return [\n [x + rx, y],\n [x + width - rx, y],\n [x + width + ox - rx, y, x + width, y + ry - oy, x + width, y + ry],\n [x + width, y + height - ry],\n [x + width, y + height + oy - ry, x + width + ox - rx, y + height, x + width - rx, y + height],\n [x + rx, y + height],\n [x + rx - ox, y + height, x, y + height + oy - ry, x, y + height - ry],\n [x, y + ry],\n [x, y + ry - oy, x + rx - ox, y, x + rx, y]\n ];\n}\n\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 0;\n }\n return v;\n}\n\nclass Rect extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 圆角\n if(this.isMulti) {\n this.__rx = [0];\n this.__ry = [0];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n }\n else {\n this.__rx = this.__ry = 0;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(rx => Math.min(rx, 0.5) * width);\n }\n else {\n __cacheProps.rx = Math.min(rx, 0.5) * width;\n }\n }\n if(isNil(__cacheProps.ry) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = rx.map(ry => Math.min(ry, 0.5) * height);\n }\n else {\n __cacheProps.ry = Math.min(ry, 0.5) * height;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => genVertex(originX, originY, width, height, rx, ry[i]));\n }\n else {\n __cacheProps.list = genVertex(originX, originY, width, height, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n bbox[0] = Math.min(bbox[0], originX - ox);\n bbox[1] = Math.min(bbox[1], originY - oy);\n bbox[2] = Math.max(bbox[2], originX + width + ox);\n bbox[3] = Math.max(bbox[3], originY + height + oy);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Rect;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Circle extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__r = [1];\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i));\n }\n else if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n else {\n this.__r = 1;\n if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, r, __cacheProps, isMulti } = this;\n if(isNil(__cacheProps.r) || focus) {\n if(isMulti) {\n __cacheProps.r = r.map(i => i * width * 0.5);\n __cacheProps.list = __cacheProps.r.map(r => geom.ellipsePoints(cx, cy, r));\n }\n else {\n __cacheProps.r = r * width * 0.5;\n __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Circle;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Ellipse extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__rx = [1];\n this.__ry = [1];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n else if(!isNil(props.rx)) {\n this.__rx = [getR(props.rx)];\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n else if(!isNil(props.ry)) {\n this.__ry = [getR(props.ry)];\n }\n }\n else {\n this.__rx = 1;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n this.__ry = 1;\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(i => i * width * 0.5);\n }\n else {\n __cacheProps.rx = rx * width * 0.5;\n }\n }\n if(isNil(__cacheProps.ry) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = ry.map(i => i * height * 0.5);\n }\n else {\n __cacheProps.ry = ry * height * 0.5;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => geom.ellipsePoints(cx, cy, rx, ry[i]));\n }\n else {\n __cacheProps.list = geom.ellipsePoints(cx, cy, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let rx = 0, ry = 0;\n if(isMulti) {\n let mx = 0, my = 0;\n __cacheProps.rx.forEach((rx, i) => {\n mx = Math.max(rx, mx);\n my = Math.max(ry, __cacheProps.ry[i]);\n });\n rx = mx;\n ry = my;\n }\n else {\n rx = __cacheProps.rx;\n ry = __cacheProps.ry;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - rx - ox;\n let xb = cx + rx + ox;\n let ya = cy - ry - oy;\n let yb = cy + ry + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Ellipse;\n","import reset from '../style/reset';\n\nlet fullCssProperty = {\n skewX: 'kx',\n skewY: 'ky',\n transform: 'tf',\n fontSize: 'fz',\n offset: 'os',\n easing: 'e',\n filter: 'ft',\n boxShadow: 'bd',\n overflow: 'of',\n backgroundClip: 'bp',\n textOverflow: 'tof',\n flexWrap: 'fp',\n perspective: 'ppt',\n rotate3d: 'r3',\n};\n\nlet abbrCssProperty = {\n os: 'offset', // 非css属性不会被下面反向遍历插入,手动\n e: 'easing',\n};\n\nlet fullAnimate = {\n value: 'v',\n options: 'o',\n};\n\nlet abbrAnimate = {};\n\nlet fullAnimateOption = {\n duration: 'dt',\n delay: 'd',\n endDelay: 'ed',\n iterations: 'i',\n direction: 'dc',\n fill: 'f',\n fps: 'fp',\n playbackRate: 'p',\n spfLimit: 'sl',\n};\n\nlet abbrAnimateOption = {};\n\nreset.DOM_KEY_SET.concat(reset.GEOM_KEY_SET).forEach(k => {\n if(fullCssProperty.hasOwnProperty(k)) {\n abbrCssProperty[fullCssProperty[k]] = k;\n return;\n }\n let v = k.charAt(0) + k.replace(/[a-z]/g, '').toLowerCase();\n fullCssProperty[k] = v;\n abbrCssProperty[v] = k;\n});\n\nObject.keys(fullAnimate).forEach(k => {\n abbrAnimate[fullAnimate[k]] = k;\n});\n\nObject.keys(fullAnimateOption).forEach(k => {\n abbrAnimateOption[fullAnimateOption[k]] = k;\n});\n\nexport default {\n fullCssProperty,\n abbrCssProperty,\n fullAnimate,\n abbrAnimate,\n fullAnimateOption,\n abbrAnimateOption,\n};\n","import abbr from './abbr';\nimport Node from '../node/Node';\nimport Component from '../node/Component';\nimport $$type from '../util/$$type';\nimport util from '../util/util';\nimport inject from '../util/inject';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet { isNil, isFunction, isPrimitive, clone, extend } = util;\nlet { abbrCssProperty, abbrAnimateOption, abbrAnimate } = abbr;\n\n/**\n * 还原缩写到全称,涉及样式和动画属性\n * @param target 还原的对象\n * @param hash 缩写映射\n */\nfunction abbr2full(target, hash) {\n // 也许节点没写样式\n if(target) {\n Object.keys(target).forEach(k => {\n // var-attr格式特殊考虑,仅映射attr部分,var-还要保留\n if(k.indexOf('var-') === 0) {\n let k2 = k.slice(4);\n if(hash.hasOwnProperty(k2)) {\n let fk = hash[k2];\n target['var-' + fk] = target[k];\n // delete target[k];\n }\n }\n // 普通样式缩写还原\n else if(hash.hasOwnProperty(k)) {\n let fk = hash[k];\n target[fk] = target[k];\n // 删除以免二次解析\n delete target[k];\n }\n });\n }\n}\n\nfunction replaceVars(json, vars) {\n if(json && vars) {\n // 新版vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // 排除特殊的library\n if(Array.isArray(member) && member.length && member[0] !== 'library' && vars.hasOwnProperty(id)) {\n let target = json;\n for(let i = 0, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // undefined和null意义不同\n if(v === undefined) {\n return;\n }\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n target[k] = v;\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Slot miss ' + k);\n return;\n }\n }\n }\n });\n }\n }\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-') === 0) {\n let v = json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(4);\n // 有id且变量里面传入了替换的值,值可为null,因为某些情况下空为自动\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n // undefined和null意义不同\n if(value === undefined) {\n return;\n }\n let target = json;\n // 如果有.则特殊处理子属性\n if(k2.indexOf('.') > -1) {\n let list = k2.split('.');\n let len = list.length;\n for(let i = 0; i < len - 1; i++) {\n k2 = list[i];\n // 避免异常\n if(target[k2]) {\n target = target[k2];\n }\n else {\n inject.warn('parseJson vars is not exist: ' + v.id + ', ' + k + ', ' + list.slice(0, i).join('.'));\n return;\n }\n }\n k2 = list[len - 1];\n }\n // 支持函数模式和值模式\n if(isFunction(value)) {\n value = value(v);\n }\n target[k2] = value;\n }\n }\n });\n }\n }\n}\n\nfunction replaceLibraryVars(json, hash, vars) {\n if(vars) {\n // 新版同级vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // library.xxx,需要>=2的长度\n if(Array.isArray(member) && member.length > 1 && vars.hasOwnProperty(id)) {\n if(member[0] === 'library') {\n let target = hash;\n for(let i = 1, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n let old = target[k];\n // 直接替换library的子对象,需补充id和tagName\n if(i === 1) {\n target[k] = Object.assign({ id: old.id, tagName: old.tagName }, v);\n }\n // 替换library中子对象的一个属性直接赋值\n else {\n target[k] = v;\n }\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Library slot miss ' + k);\n return;\n }\n }\n }\n }\n });\n }\n }\n // 兼容老版var-\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-library.') === 0) {\n let v = json[k];\n // 直接移除library插槽,防止下面调用replaceVars(json, vars)时报错\n delete json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(12);\n // 有id且变量里面传入了替换的值\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n if(isFunction(value)) {\n value = value(v);\n }\n // 替换图层的值必须是一个有tagName的对象\n if(!value || !value.tagName) {\n return;\n }\n // library对象也要加上id,与正常的library保持一致\n hash[k2] = Object.assign({ id: k2 }, value);\n }\n }\n });\n }\n }\n}\n\n/**\n * 遍历一遍library的一级,将一级的id存到hash上,无需递归二级,\n * 因为顺序前提要求排好且无循环依赖,所以被用到的一定在前面出现,\n * 一般是无children的元件在前,包含children的div在后\n * 即便library中的元素有children或library,在linkChild时将其link过去,parse递归会继续处理\n * @param item:library的一级孩子\n * @param hash:存放library的key/value引用\n */\nfunction linkLibrary(item, hash) {\n let id = item.id;\n // library中一定有id,因为是一级,二级+特殊需求才会出现放开\n if(isNil(id)) {\n throw new Error('Library item miss id: ' + JSON.stringify(item));\n }\n else {\n hash[id] = item;\n }\n}\n\n/**\n * 链接child到library文件,\n * props需要是clone的,因为防止多个child使用同一个库文件\n * children则直接引用,无需担心多个使用同一个\n * library也需要带上,在library直接子元素还包含library时会用到\n * @param child\n * @param libraryItem\n */\nfunction linkChild(child, libraryItem) {\n // 规定图层child只有init和动画,属性和子图层来自库\n child.tagName = libraryItem.tagName;\n child.props = clone(libraryItem.props);\n child.children = libraryItem.children;\n child.library = libraryItem.library;\n // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况\n Object.keys(libraryItem).forEach(k => {\n if(k.indexOf('var-') === 0 && !child.hasOwnProperty(k)) {\n child[k] = libraryItem[k];\n }\n });\n // 删除以免二次解析\n child.libraryId = null;\n // 规定图层实例化的属性和样式在init上,优先使用init,然后才取原型链的props\n let { init } = child;\n if(init) {\n let props = child.props = child.props || {};\n let style = props.style;\n extend(props, init);\n // style特殊处理,防止被上面覆盖丢失原始值\n if(style) {\n extend(style, init.style);\n props.style = style;\n }\n // 删除以免二次解析\n child.init = null;\n }\n}\n\nfunction parse(karas, json, animateRecords, opt, hash = {}) {\n if(isPrimitive(json) || json instanceof Node || json instanceof Component) {\n return json;\n }\n if(Array.isArray(json)) {\n return json.map(item => {\n return parse(karas, item, animateRecords, opt, hash);\n });\n }\n // 先判断是否是个链接到库的节点,是则进行链接操作\n let libraryId = json.libraryId;\n if(!isNil(libraryId)) {\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,tagName和属性和子图层来自库\n if(libraryItem) {\n linkChild(json, libraryItem);\n }\n else {\n throw new Error('Link library miss id: ' + libraryId);\n }\n json.libraryId = null;\n }\n // 再判断是否有library形成一个新的作用域,会出现library下的library使得一个链接节点链接后出现library的情况\n let library = json.library;\n if(Array.isArray(library)) {\n hash = {};\n library.forEach(item => {\n linkLibrary(item, hash);\n });\n // 替换library插槽\n replaceLibraryVars(json, hash, opt.vars);\n json.library = null;\n }\n let { tagName, props = {}, children = [], animate = [] } = json;\n if(!tagName) {\n throw new Error('Dom must have a tagName: ' + JSON.stringify(json));\n }\n let style = props.style;\n (opt.abbr !== false) && abbr2full(style, abbrCssProperty);\n // 先替换style的\n replaceVars(style, opt.vars);\n // 再替换静态属性,style也作为属性的一种,目前尚未被设计为被替换\n replaceVars(props, opt.vars);\n // 替换children里的内容,如文字,无法直接替换tagName/props/children/animate本身,因为下方用的还是原引用\n replaceVars(json, opt.vars);\n 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 let animationRecord;\n if(animate) {\n if(Array.isArray(animate)) {\n let has;\n animate.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrAnimate);\n let { value, options } = item;\n // 忽略空动画\n if(Array.isArray(value) && value.length) {\n has = true;\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n });\n if(has) {\n animationRecord = {\n animate,\n target: vd,\n };\n }\n }\n else {\n (opt.abbr !== false) && abbr2full(animate, abbrAnimate);\n let { value, options } = animate;\n if(Array.isArray(value) && value.length) {\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n animationRecord = {\n animate,\n target: vd,\n };\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n }\n }\n // 产生实际动画运行才存入列表供root调用执行\n if(animationRecord) {\n animateRecords.push(animationRecord);\n }\n return vd;\n}\n\nexport default parse;\n","import parse from './parse';\nimport abbr from './abbr';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport font from '../style/font';\nimport Controller from '../animate/Controller';\n\nlet o = {\n parse(karas, json, dom, options = {}) {\n json = util.clone(json);\n // 根节点的fonts字段定义字体信息\n let fonts = json.fonts;\n if(fonts) {\n if(!Array.isArray(fonts)) {\n fonts = [fonts];\n }\n fonts.forEach(item => {\n let { fontFamily, data } = item;\n if(fontFamily && data) {\n font.register(fontFamily, data);\n }\n });\n }\n // json中定义无abbr\n if(json.abbr === false) {\n options.abbr = false;\n }\n if(options.abbr !== false) {\n inject.warn('Abbr in json is deprecated');\n }\n // 重载,在确定dom传入选择器字符串或html节点对象时作为渲染功能,否则仅创建vd返回\n if(!inject.isDom(dom)) {\n options = dom || {};\n dom = null;\n }\n // 暂存所有动画声明,等root的生成后开始执行\n let animateRecords = [];\n let vd = parse(karas, json, animateRecords, options);\n // 有dom时parse作为根方法渲染\n if(dom) {\n let { tagName } = json;\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) === -1) {\n throw new Error('Parse dom must be canvas/svg');\n }\n // parse直接(非递归)的动画记录\n let ac = options.controller instanceof Controller ? options.controller : vd.animateController;\n // 第一次render,收集递归json里面的animateRecords,它在xom的__layout最后生成\n karas.render(vd, dom);\n // 由于vd首先生成的都是json,根parse要特殊处理将target指向真正的vd引用,json的vd在builder中赋值\n animateRecords.forEach(item => {\n item.target = item.target.vd;\n });\n // 直接的json里的animateRecords,再加上递归的parse的json的(第一次render布局时处理)动画一并播放\n if(options.autoPlay !== false) {\n ac.__records = ac.__records.concat(animateRecords);\n ac.__playAuto();\n }\n // 不自动播放进入记录列表,初始化并等待手动调用\n else {\n ac.__records2 = ac.__records2.concat(animateRecords);\n ac.init(ac.__records2, ac.list2);\n }\n }\n // 递归的parse,如果有动画,此时还没root,先暂存下来,等上面的root的render第一次布局时收集\n else {\n if(animateRecords.length) {\n vd.__animateRecords = {\n options,\n list: animateRecords,\n controller: options.controller instanceof Controller ? options.controller : null,\n };\n }\n }\n return vd;\n },\n loadAndParse(karas, json, dom, options) {\n let { fonts, components, imgs } = json;\n let list1 = [];\n let list2 = [];\n let list3 = [];\n if(fonts) {\n if(!Array.isArray(fonts)) {\n fonts = [fonts];\n }\n fonts.forEach(item => {\n let url = item.url;\n if(url) {\n list1.push(url);\n }\n });\n }\n if(components) {\n if(!Array.isArray(components)) {\n components = [components];\n }\n components.forEach(item => {\n let { tagName, url, reload } = item;\n // 如果没申明reload且已经被注册,则无需重复加载\n if(tagName && karas.Component.hasRegister(tagName) && !reload) {\n return;\n }\n // 即便没有tagName也要加载,可能组件内部执行了注册逻辑\n if(url) {\n list2.push(item);\n }\n });\n }\n if(imgs) {\n if(!Array.isArray(imgs)) {\n imgs = [imgs];\n }\n imgs.forEach(item => {\n let url = item.url;\n if(url) {\n list3.push(url);\n }\n });\n }\n let a = list1.length, b = list2.length, c = list3.length;\n if(a || b || c) {\n let count = 0;\n let cb = function() {\n if(count === a + b + c) {\n let res = o.parse(karas, json, dom, options);\n if(options && util.isFunction(options.callback)) {\n options.callback(res);\n }\n }\n };\n karas.inject.loadFont(list1, function() {\n count += a;\n cb();\n });\n karas.inject.loadComponent(list2.map(item => item.url), function() {\n count += b;\n // 默认约定加载的js组件会在全局变量申明同名tagName,已有不覆盖,防止组件代码内部本身有register\n list2.forEach(item => {\n let tagName = item.tagName;\n if(tagName && window[tagName] && !karas.Component.hasRegister(tagName)) {\n karas.Component.register(tagName, window[tagName]);\n }\n });\n cb();\n });\n karas.inject.measureImg(list3, function() {\n count += c;\n cb();\n });\n }\n else {\n let res = o.parse(karas, json, dom, options);\n if(options && util.isFunction(options.callback)) {\n options.callback(res);\n }\n return res;\n }\n },\n abbr,\n};\n\nexport default o;\n","import css from './css';\nimport reset from './reset';\nimport unit from './unit';\nimport font from './font';\nimport abbr from './abbr';\n\nexport default {\n css,\n reset,\n unit,\n font,\n abbr,\n};\n","import Animation from './Animation';\nimport Controller from './Controller';\nimport easing from './easing';\nimport frame from './frame';\n\nexport default {\n Animation,\n Controller,\n easing,\n frame,\n};\n","import level from './level';\nimport change from './change';\nimport Page from './Page';\nimport Cache from './Cache';\n\nexport default {\n level,\n change,\n Page,\n Cache,\n};\n","import Node from './node/Node';\nimport Text from './node/Text';\nimport Xom from './node/Xom';\nimport Dom from './node/Dom';\nimport Img from './node/Img';\nimport Root from './node/Root';\nimport tag from './node/tag';\nimport mode from './node/mode';\nimport Geom from './node/geom/Geom';\nimport Line from './node/geom/Line';\nimport Polyline from './node/geom/Polyline';\nimport Polygon from './node/geom/Polygon';\nimport Sector from './node/geom/Sector';\nimport Rect from './node/geom/Rect';\nimport Circle from './node/geom/Circle';\nimport Ellipse from './node/geom/Ellipse';\nimport Component from './node/Component';\nimport Event from './util/Event';\nimport util from './util/util';\nimport $$type from './util/$$type';\nimport builder from './util/builder';\nimport updater from './util/updater';\nimport inject from './util/inject';\nimport enums from './util/enums';\nimport debug from './util/debug';\nimport parser from './parser/index';\nimport style from './style/index';\nimport animate from './animate/index';\nimport math from './math/index';\nimport refresh from './refresh/index';\nimport { version } from '../package.json';\n\nGeom.register('$line', Line);\nGeom.register('$polyline', Polyline);\nGeom.register('$polygon', Polygon);\nGeom.register('$sector', Sector);\nGeom.register('$rect', Rect);\nGeom.register('$circle', Circle);\nGeom.register('$ellipse', Ellipse);\n\nlet karas = {\n version,\n render(root, dom) {\n if(!(root instanceof Root)) {\n throw new Error('Render dom must be canvas/svg');\n }\n if(dom) {\n root.appendTo(dom);\n }\n return root;\n },\n createElement(tagName, props) {\n props = props || {};\n let children = [];\n for(let i = 2, len = arguments.length; i < len; i++) {\n children.push(arguments[i]);\n }\n if(util.isString(tagName)) {\n if(tagName.charAt(0) === '$') {\n return this.createGm(tagName, props);\n }\n else {\n return this.createVd(tagName, props, children);\n }\n }\n else if(tagName) {\n return this.createCp(tagName, props, children);\n }\n },\n createVd(tagName, props, children = []) {\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n if(tag.TAG_NAME.hasOwnProperty(tagName)) {\n return {\n tagName,\n props,\n children,\n $$type: $$type.TYPE_VD,\n };\n }\n throw new Error(`Can not use <${tagName}>`);\n },\n createGm(tagName, props) {\n return {\n tagName,\n props,\n $$type: $$type.TYPE_GM,\n };\n },\n createCp(klass, props, children = []) {\n props.children = children;\n return {\n klass,\n props,\n $$type: $$type.TYPE_CP,\n };\n },\n parse(json, dom, options) {\n return parser.parse(this, json, dom, options);\n },\n loadAndParse(json, dom, options) {\n return parser.loadAndParse(this, json, dom, options);\n },\n mode,\n Component,\n Node,\n Text,\n Geom,\n Xom,\n Dom,\n Img,\n Root,\n Event,\n util,\n inject,\n style,\n parser,\n animate,\n math,\n builder,\n updater,\n refresh,\n enums,\n set debug(v) {\n debug.flag = !!v;\n },\n};\n\nbuilder.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\n\nif(typeof window !== 'undefined') {\n window.karas = karas;\n}\nelse if(typeof self !== 'undefined') {\n self.karas = karas;\n}\n\nexport default karas;\n"],"names":["STYLE_KEY","POSITION","DISPLAY","TOP","RIGHT","BOTTOM","LEFT","MARGIN_TOP","MARGIN_RIGHT","MARGIN_BOTTOM","MARGIN_LEFT","PADDING_TOP","PADDING_RIGHT","PADDING_BOTTOM","PADDING_LEFT","FONT_SIZE","FONT_FAMILY","COLOR","FONT_STYLE","FONT_WEIGHT","LINE_HEIGHT","BACKGROUND_IMAGE","BACKGROUND_COLOR","BACKGROUND_SIZE","BACKGROUND_REPEAT","BACKGROUND_POSITION_X","BACKGROUND_POSITION_Y","BORDER_TOP_WIDTH","BORDER_RIGHT_WIDTH","BORDER_BOTTOM_WIDTH","BORDER_LEFT_WIDTH","BORDER_TOP_COLOR","BORDER_RIGHT_COLOR","BORDER_BOTTOM_COLOR","BORDER_LEFT_COLOR","BORDER_TOP_STYLE","BORDER_RIGHT_STYLE","BORDER_BOTTOM_STYLE","BORDER_LEFT_STYLE","BORDER_TOP_LEFT_RADIUS","BORDER_TOP_RIGHT_RADIUS","BORDER_BOTTOM_RIGHT_RADIUS","BORDER_BOTTOM_LEFT_RADIUS","WIDTH","HEIGHT","FLEX_GROW","FLEX_SHRINK","FLEX_BASIS","FLEX_DIRECTION","JUSTIFY_CONTENT","ALIGN_ITEMS","ALIGN_SELF","TEXT_ALIGN","TRANSFORM_ORIGIN","VISIBILITY","OPACITY","Z_INDEX","TRANSFORM","TRANSLATE_X","TRANSLATE_Y","TRANSLATE_Z","SCALE_X","SCALE_Y","SCALE_Z","SKEW_X","SKEW_Y","ROTATE_X","ROTATE_Y","ROTATE_Z","ROTATE_3D","PERSPECTIVE","PERSPECTIVE_ORIGIN","FILTER","BOX_SHADOW","POINTER_EVENTS","OVERFLOW","MIX_BLEND_MODE","BACKGROUND_CLIP","WHITE_SPACE","TEXT_OVERFLOW","LETTER_SPACING","LINE_CLAMP","ORDER","FLEX_WRAP","ALIGN_CONTENT","TEXT_STROKE_WIDTH","TEXT_STROKE_COLOR","TEXT_STROKE_OVER","FILL","STROKE","STROKE_WIDTH","STROKE_DASHARRAY","STROKE_DASHARRAY_STR","STROKE_LINECAP","STROKE_LINEJOIN","STROKE_MITERLIMIT","FILL_RULE","MATRIX","BORDER_TOP","BORDER_RIGHT","BORDER_BOTTOM","BORDER_LEFT","TRANSLATE_PATH","STYLE2LOWER_MAP","style2Lower","s","toLowerCase","replace","$0","$1","toUpperCase","STYLE2UPPER_MAP","style2Upper","$2","STYLE_R_KEY","STYLE_RV_KEY","STYLE_V_KEY","Object","keys","forEach","k","k2","l","UPDATE_KEY","UPDATE_NODE","UPDATE_STYLE","UPDATE_FOCUS","UPDATE_MEASURE","UPDATE_COMPONENT","UPDATE_OVERWRITE","UPDATE_KEYS","UPDATE_LIST","UPDATE_CONFIG","UPDATE_ADD_DOM","UPDATE_REMOVE_DOM","KEY_FRAME_KEY","FRAME_STYLE","FRAME_TIME","FRAME_EASING","FRAME_TRANSITION","NODE_KEY","NODE_DOM_PARENT","NODE_OPACITY","NODE_MATRIX","NODE_MATRIX_EVENT","NODE_CACHE","NODE_CACHE_TOTAL","NODE_CACHE_FILTER","NODE_CACHE_MASK","NODE_CACHE_OVERFLOW","NODE_STRUCT","NODE_TAG_NAME","NODE_CURRENT_STYLE","NODE_CURRENT_PROPS","NODE_COMPUTED_STYLE","NODE_CACHE_STYLE","NODE_CACHE_PROPS","NODE_LIMIT_CACHE","NODE_IS_MASK","NODE_IS_INLINE","NODE_HAS_CONTENT","NODE_REFRESH_LV","NODE_IS_DESTROYED","NODE_STYLE","NODE_UPDATE_HASH","NODE_UNIQUE_UPDATE_ID","NODE_DEFS_CACHE","NODE_PERSPECTIVE_MATRIX","NODE_VIRTUAL_DOM","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_FRAME_CB","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_CAL_DIFF_TIME","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","__width","__height","__baseLine","__config","i","lv","j","root","struct","diff","isLayout","__sx","__sy","x","ox","y","oy","__prev","__next","__parent","__domParent","__root","__host","__hostRoot","__virtualDom","CANVAS","SVG","WEBGL","o","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","REM","EM","VW","VH","calUnit","v","n","parseFloat","test","info","arial","lhr","blr","lgr","padding","f","verdana","tahoma","S","T","Z","c","t","georgia","simsun","support","fontFamily","hasOwnProperty","register","name","emSquare","ascent","descent","lineGap","addPadding","assign","position","gradient","img","identity","multiply","a","b","isE","a0","a1","a2","a3","calPoint","point","m","z","w","undefined","length","b1","c1","d1","b2","c2","d2","b3","c3","d3","a4","b4","c4","d4","d","e","inverse","inverse4","divisor","inv","det","m2m6","point2d","slice","dotProduct","x1","y1","x2","y2","crossProduct","H","Math","sqrt","vector","mx","h","deg","cos","sin","pointInPolygon","vertexes","xmax","ymax","xmin","ymin","len","max","min","pointInQuadrilateral","x4","y4","x3","y3","matrix","w1","w2","w3","w4","angleBySide","theta","pow","acos","sideByAngle","alpha","pointsDistance","triangleIncentre","ellipsePoints","sectorPoints","r","begin","end","list","floor","h2","d2r","abs","atan","rx","ry","p1","p2","p4","p3","push","concat","temp","res","getRectsIntersection","isRectsOverlap","ax1","ay1","ax4","ay4","bx1","by1","bx4","by4","isRectsInside","calCoordsInNode","px","py","node","computedStyle","width","height","calPercentInNode","ds","Infinity","PI","dt","r2d","bboxBezier2","x0","y0","minX","minY","maxX","maxY","tx","ty","sx","sy","qx","qy","bboxBezier3","cx","cy","bx","by","ax","ay","hx","hy","q","bboxBezier","arguments","norm","order","sum","reduce","simpson38","derivativeFunc","middleL","middleR","adaptiveSimpson38","eps","mid","st","sl","sr","ans","bezierLength","points","startT","endT","at","at3","p0","at2","bezierOrder","derivativeOrder","pointAtBezier","percent","maxIteration","pointAtBezierWithLength","targetLen","approachLen","approachT","preApproachT","derivative1","derivative2","numerator","denominator","sliceBezier","x12","y12","x23","y23","x123","y123","x34","y34","x234","y234","x1234","y1234","sliceBezier2Both","start","reverse","pointOnCircle","getConicGradientImage","originX","originY","stop","data","Error","getAngle","dx","dy","increasingList","map","item","color","angle","factor","idx","canvasPolygon","ctx","Array","isArray","moveTo","lineTo","quadraticCurveTo","bezierCurveTo","svgPolygon","canvasLine","controlA","controlB","num","svgLine","canvasFilter","filter","svgFilter","geom","unit","painter","calFitDashed","total","bs","be","smin","smax","dmin","dmax","ps","pd","outer","per","free","mo","calDashed","style","m1","m2","m3","m4","bw","calPoints","borderWidth","borderStyle","deg1","deg2","direction","beginRadius","endRadius","indexOf","isLast","main1","main2","cross1","cross2","tan","calTopRadiusPoints","calRightRadiusPoints","calBottomRadiusPoints","calLeftRadiusPoints","pointsList","brx","bry","erx","ery","oxl","oxr","beginList","centerList","endList","ya","yb","beginLength","needInner","crossDeg","rx1","ry1","sx1","oyl","rx2","ry2","sx2","xa","xb","ca","calBezierTopLeft","cb","controls1","controls2","limit","pop","endLength","oyr","calBezierTopRight","isStart","crossDx","p1x","p1y","p2x","p2y","dx1","dsx1","dx2","dsx2","cpx2","cpy2","cpx1","cpy1","crossDsx","beta","tanBetaDiv2Sqrt","tanAlphaHalf","degTg","degTg1","cdx1","cdy1","cx1","cy1","degTg2","cdx2","cdy2","cx2","cy2","isEnd","oyt","oyb","oxt","calBezierRightTop","oxb","calBezierRightBottom","calBezierBottomLeft","calBezierBottomRight","calBezierLeftTop","calBezierLeftBottom","calRadius","btlr","btrr","bbrr","bblr","need","btlx","btly","btrx","btry","bbrx","bbry","bblx","bbly","BR_KS","calBorderRadius","currentStyle","noRadius","target","prev","next","half","calBorderRadiusInline","contentBoxList","first","last","outerWidth","outerHeight","renderBorder","xom","renderMode","mode","beginPath","fillStyle","fill","closePath","virtualDom","bb","type","tagName","props","TYPE_VD","_","TYPE_GM","TYPE_CP","toString","isType","obj","call","isObject","isString","isFunction","isNumber","isBoolean","isDate","hasOwn","fnToString","ObjectFunctionString","isNil","joinSourceArray","arr","stringify","encodeHtml","prop","joinVirtualDom","vd","defs","joinDef","joinVd","conClip","children","isMask","content","opacity","transform","visibility","mask","overflow","mixBlendMode","def","uuid","joinItem","rgba2int","charAt","parseInt","match","int2rgba","joinArr","int2invert","arr2hash","hash","hash2arr","clone","$$type","util","Date","isPlainObject","equalArr","ai","bi","isArrayA","isArrayB","equal","getTime","extend","source","split","extendAnimate","ovd","nvd","__animationList","animationList","splice","__setTarget","assigning","finished","__stayEnd","assignCurrentStyle","__frameAnimateList","transformBbox","bbox","proto","getPrototypeOf","Ctor","constructor","assignMatrix","isPrimitive","isAuto","flag","charWidth","ELLIPSIS","antialias","premultipliedAlpha","preserveDrawingBuffer","initShaders","gl","vshader","fshader","program","createProgram","enable","BLEND","blendFunc","ONE","ONE_MINUS_SRC_ALPHA","vertexShader","loadShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","attachShader","linkProgram","linked","getProgramParameter","LINK_STATUS","error","getProgramInfoLog","deleteProgram","deleteShader","shader","createShader","shaderSource","compileShader","compiled","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","convertCoords2Gl","revertY","createTexture","tex","texture","bindTexture","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","texImage2D","TEXTURE_2D","UNSIGNED_BYTE","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","LINEAR","TEXTURE_MAG_FILTER","activeTexture","drawTextureCache","vtPoint","vtTex","vtOpacity","lastChannel","record","stack","cache","channel","page","tx1","ty1","tx2","ty2","pointBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","Float32Array","STATIC_DRAW","a_position","getAttribLocation","vertexAttribPointer","FLOAT","enableVertexAttribArray","texBuffer","a_texCoords","opacityBuffer","a_opacity","u_texture","getUniformLocation","count","uniform1i","drawArrays","TRIANGLES","deleteBuffer","disableVertexAttribArray","drawBlur","frameBuffer","texCache","tex1","tex2","spread","sigma","u_direction","uniform2f","ratio","recycle","tex3","framebufferTexture2D","FRAMEBUFFER","COLOR_ATTACHMENT0","tex4","deleteTexture","drawCm","u_m","uniform1fv","drawOverflow","programOverflow","drawMask","u_texture1","u_texture2","drawMbm","W","SPF","CANVAS_LIST","WEBGL_LIST","SUPPORT_OFFSCREEN_CANVAS","OffscreenCanvas","prototype","getContext","defaultFontFamilyData","key","message","debug","document","createElement","setAttribute","body","appendChild","canvas","draw","enabled","available","release","cacheCanvas","cacheWebgl","IMG","INIT","LOADING","LOADED","FONT","COMPONENT","inject","measureText","textCache","html","lengths","chars","ff","fs","fw","inline","char","div","left","top","innerHTML","cns","childNodes","index","css","window","getComputedStyle","text","__measureCb","removeChild","measureTextSync","measureImg","url","state","success","task","Image","onload","onerror","substr","host","exec","location","hostname","crossOrigin","src","warn","console","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","id","clearTimeout","now","performance","hasCacheCanvas","getCacheCanvas","releaseCacheCanvas","delCacheCanvas","hasCacheWebgl","getCacheWebgl","releaseCacheWebgl","delCacheWebgl","isDom","Element","self","getElementsByTagName","isWebGLTexture","WebGLTexture","checkSupportFontFamily","font","checked","context","textAlign","textBaseline","clearRect","fillText","getImageData","loadFont","FontFace","load","then","loadComponent","script","async","head","getLinearDeg","getRadialPosition","center","right","bottom","getColorStop","firstColor","p","dr","dg","db","da","unshift","calLinearCoords","calCircleCentre","iw","ih","positionX","positionY","calRadialRadius","shape","size","xl","yl","asin","parseGradient","reg","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","log","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","__hasUpdate","__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","Animation","__id","nl","__options","op","config","__frameCb","__calDiffTime","iterations","framesR","originStyle","fps","spfLimit","delay","endDelay","playbackRate","isFinish","__cancelTask","__currentProps","__currentStyle","isDelay","FRAME","PLAY","playState","__hasFin","__hasCancel","playCount","currentFrames","stayBegin","stayEnd","is2","endTime","currentTime","currentFrame","round","isAlternate","alternate","isEven","isLastCount","frameTime","isLastFrame","inEndDelay","needClean","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","isDirectItem","__calMp","isVirtual","fromAbs","isShadowRoot","clearCache","__layoutData","__layoutNone","__mp","__isRealInline","__layoutFlex","__layoutInline","__layoutBlock","__sx2","__sx3","__sx4","__sx5","__sx6","__sy2","__sy3","__sy4","__sy5","__sy6","__execAr","ar","controller","autoPlay","__records2","init","list2","__records","__playAuto","h3","nowrap","fixedWidth","fixedHeight","selfEndSpace","offsetWidth","offsetHeight","matrixCache","isScale","clientHeight","x5","x6","y5","y6","__calFilter","bg","bgI","item2","kw","__bx1","__bx2","__by1","__by2","rebuild","__hasContent","isRealInline","sx4","sx5","sx6","sy4","sy5","sy6","hasContent","__calContent","__calPerspective","__calMatrix","__releaseWhenEmpty","limitCache","__calCache","perspectiveMatrix","offscreenBlend","offscreenMask","hasFilter","offscreenFilter","offscreenOverflow","borderList","hasBgi","some","svgBgSymbol","__gradient","isFirst","lastContentBox","lastLineBox","parentLineBox","countW","ix1","iy1","ix2","iy2","symbol","clearAnimate","clearFrameAnimate","__stopPropagation","__stopImmediatePropagation","willResponseEvent","hasEmitMask","ignore","inThis","__touchstartTarget","__getLg","__getRg","__getCg","lg","createLinearGradient","addColorStop","rg","createRadialGradient","ec","dc","pc","cur","onlyTotal","__cacheTotal","__cacheFilter","__cacheMask","__cacheOverflow","formatStyle","animation","cancel","enter","hostRoot","pJson","zChildren","zIndexChildren","__spreadBbox","LineBox","__list","__lineHeight","LineBoxManager","__lastX","__lastY","__maxX","__domList","__domStack","__isNewLine","__isEnd","__setLB","nextNewLine","genLineBox","verticalAlign","isNewLine","TAG_NAME","INLINE","BOLD","offsetAndResizeByNodeOnY","reflowHash","inDirectAbsList","isContainer","cs","__layoutAbs","isAbs","__resizeY","clearUniqueReflowId","__uniqueReflowId","getMergeMarginTB","topList","bottomList","genZIndexChildren","hasMc","mcHash","lastMaskIndex","__iIndex","__zIndex","__aIndex","genOrderChildren","__order","block","inlineBlock","none","tag","__flexLine","__zIndexChildren","__structure","nss","__structs","structs","needSort","__tryLayInline","firstCharWidth","main","isRow","__calMinMax","min2","max2","countMin","countMax","setNotEnd","__addMp","isFixed","isContent","fixedSize","__lineBoxManager","__preLayout","__ioSize","mergeMarginBottomList","mergeMarginTopList","isXom","isInlineBlock","isImg","reflow","__isIbFull","lastX","lastY","isNone","isEmptyBlock","tw","th","horizonAlign","__inlineSize","domList","__marginAuto","growList","shrinkList","basisList","maxList","minList","orderChildren","__calBasis","containerSize","isMultiLine","line","hypotheticalList","hypothetical","maxCrossList","__layoutFlexLine","maxCross","crossSum","crossSumList","between","around","__crossAlign","flexLine","hypotheticalSum","targetMainList","factorSum","factorList","needReset","factorSum2","lbmList","firstBaseLine","genLineBoxByInlineIfNewLine","setLbByInlineIfNotNewLine","pushContentBoxList","isIbFull","isInline2","isInlineBlock2","focusNoWrap","fw2","addX","popContentBoxList","maxCX","maxCY","minCX","minCY","maxFX","maxFY","minFX","minFY","maxOX","maxOY","minOX","minOY","absChildren","onlyRight","onlyBottom","fixedTop","fixedRight","fixedBottom","fixedLeft","needCalWidth","wl","hl","__computeMeasure","__deepScan","loadImg","__loadImg","placeholder","loading","__loadAndRefresh","showError","pts","arc","__addGeom","reload","Defs","cacheHash","__isMulti","multi","__cacheProps","strokeDasharrayStr","lineCap","lineJoin","miterLimit","getLineDash","setLineDash","preData","__preSet","fills","fillRules","strokes","strokeWidths","strokeDasharrays","strokeDasharrayStrs","strokeLinecaps","strokeLinejoins","strokeMiterlimits","__renderOnePolygon","isFillCE","isStrokeCE","isFillRE","isStrokeRE","__conicGradient","__drawPolygon","__radialEllipse","isFill","isStroke","__preSetCanvas","__propsStrokeStyle","__inversePtList","updateList","removeList","KEY_FLAG","check","checkCp","nextProps","forceCheckUpdate","shouldUpdate","shouldComponentUpdate","updateCp","oldS","oldSr","oldJson","diffSr","oj","nj","ojk","getKeyHash","njk","keyList","cpList","diffCp","diffChildren","diffChild","removeCpFromOldTree","oc","ol","of","nf","exist","ex","did","componentDidUpdate","elem","diffDefs","diffBb","diffD2D","od","nd","diffDef","removeAt","insertAt","insertAdjacentHTML","parentNode","removeAttribute","diffItem","diffD2G","replaceWith","diffT2T","diffG2D","diffG2G","diffItemSelf","diffX2X","diffByLessLv","firstChild","lastChild","obb","nbb","isText","svg","where","insertBefore","Controller","__list2","__onList","__lastTime","args","records","animate","onList","__action","__mergeAuto","__on","timestamp","__set","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","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","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","__ctx","__renderMode","vertex","fragment","vertexMask","fragmentMask","fragmentClip","fragmentOverflow","vertexCm","fragmentCm","MAX_TEXTURE_IMAGE_UNITS","__texCache","destroy","__eventCbList","__checkRoot","__checkUpdate","__checkReflow","noRender","__clear","__vd","domDiff","updateStyle","taskUp","__nextFrameCp","updater","includeIgnore","scan","path","zPath","__index__","karas","path2","zPath2","nodeConfig","rootConfig","updateHash","__updateRoot","updateRoot","hasUpdate","__updateStruct","measureHash","__uniqueUpdateId","isInherit","uniqueList","hasRoot","diffList","diffI","mergeOffsetList","__uniqueMergeOffsetId","cps","cts","isLastAbs","isNowAbs","isLastNone","isNowNone","hasFlowPrev","__modifyStruct","startIndex","startNode","oldH","nowH","lastIndex","ns","reBuild","base","reBuildC","curveNum","limitStartEnd","getNewPoint","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","__start","__end","dy2","buildCache","curve","bezierBox","concatPointAndControl","control","getLength","increase","getIndex","getNewList","prePercent","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","replaceLibraryVars","linkLibrary","JSON","linkChild","libraryItem","library","libraryId","parse","animateRecords","opt","createGm","createCp","createVd","animationRecord","fonts","loadAndParse","components","imgs","list1","list3","version","appendTo","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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EAAAA,IAAI,EAAJA,IA1EU;EA2EV0L,EAAAA,MAAM,EAANA,MA3EU;EA4EV3X,EAAAA,KAAK,EAALA,KA5EU;EA6EVqsE,EAAAA,MAAM,EAANA,GA7EU;EA8EVrY,EAAAA,OAAO,EAAPA,OA9EU;EA+EVl2B,EAAAA,IAAI,EAAJA,IA/EU;EAgFVkM,EAAAA,OAAO,EAAPA,OAhFU;EAiFV+5B,EAAAA,OAAO,EAAPA,OAjFU;EAkFVlL,EAAAA,OAAO,EAAPA,OAlFU;EAmFV/tE,EAAAA,KAAK,EAALA,KAnFU;;EAoFV,MAAI0rB,KAAJ,CAAU1oB,CAAV,EAAa;EACX0oB,IAAAA,KAAK,CAACrI,IAAN,GAAa,CAAC,CAACrgB,CAAf;EACD;;EAtFS,CAAZ;EAyFAk8C,OAAO,CAACrB,GAAR,CAAY;EACVvB,EAAAA,GAAG,EAAHA,KADU;EAEVC,EAAAA,GAAG,EAAHA,KAFU;EAGVC,EAAAA,GAAG,EAAHA,KAHU;EAIVC,EAAAA,IAAI,EAAJA,MAJU;EAKVC,EAAAA,SAAS,EAATA;EALU,CAAZ;;EAQA,IAAG,OAAO1uB,MAAP,KAAkB,WAArB,EAAkC;EAChCA,EAAAA,MAAM,CAACurD,KAAP,GAAeA,OAAf;EACD,CAFD,MAGK,IAAG,OAAO9oD,IAAP,KAAgB,WAAnB,EAAgC;EACnCA,EAAAA,IAAI,CAAC8oD,KAAL,GAAaA,OAAb;EACD;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["src/util/enums.js","src/node/Node.js","src/node/mode.js","src/style/unit.js","src/style/font.js","src/style/reg.js","src/math/matrix.js","src/math/vector.js","src/math/geom.js","src/math/gradient.js","src/util/painter.js","src/style/border.js","src/util/$$type.js","src/util/util.js","src/util/debug.js","src/node/textCache.js","src/gl/ca.js","src/gl/webgl.js","src/util/inject.js","src/style/gradient.js","src/style/reset.js","src/style/abbr.js","src/animate/key.js","src/refresh/change.js","src/style/css.js","src/node/TextBox.js","src/refresh/Page.js","src/math/tar.js","src/math/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_FRAME_CB: 8,\n I_PLAY_CB: 9,\n I_TARGET: 10,\n I_ROOT: 11,\n I_FRAMES: 12,\n I_FRAMES_R: 13,\n I_CURRENT_TIME: 14,\n I_NEXT_TIME: 15,\n I_STYLE: 16,\n I_DURATION: 17,\n I_ITERATIONS: 18,\n I_FILL: 19,\n I_PLAYBACK_RATE: 20,\n I_PLAY_COUNT: 21,\n I_PLAY_STATE: 22,\n I_DESTROYED: 23,\n I_START_TIME: 24,\n I_FPS_TIME: 25,\n I_EASING: 26,\n I_ENTER_FRAME: 27,\n I_DELAY: 28,\n I_END_DELAY: 29,\n I_KEYS: 30,\n I_ORIGIN_STYLE: 31,\n I_CURRENT_FRAMES: 32,\n I_CURRENT_FRAME: 33,\n I_SPF_LIMIT: 34,\n I_FPS: 35,\n I_DIRECTION: 36,\n I_CAL_DIFF_TIME: 37,\n I_FIRST_ENTER: 38,\n I_STAY_BEGIN: 39,\n I_STAY_END: 40,\n I_IS2: 41,\n I_END_TIME: 42,\n I_NODE_CONFIG: 43,\n I_ROOT_CONFIG: 44,\n I_OUT_BEGIN_DELAY: 45,\n I_TIME_STAMP: 46,\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.__width = 0;\n this.__height = 0;\n this.__baseLine = 0;\n this.__config = {};\n // 默认undefined\n // this.__prev = undefined;\n // this.__next = undefined;\n // this.__parent = undefined;\n // this.__domParent = undefined;\n // this.__root = undefined;\n // this.__host = undefined;\n }\n\n __structure(i, lv, j) {\n return this.__config[NODE_STRUCT] = {\n [STRUCT_NODE]: this,\n [STRUCT_INDEX]: i,\n [STRUCT_CHILD_INDEX]: j,\n [STRUCT_LV]: lv,\n };\n }\n\n __modifyStruct(root, offset = 0) {\n let struct = this.__config[NODE_STRUCT];\n return [struct, 0];\n }\n\n __offsetX(diff, isLayout) {\n if(isLayout) {\n this.__x += diff;\n }\n else {\n this.__ox += diff;\n }\n this.__sx += diff;\n }\n\n __offsetY(diff, isLayout) {\n if(isLayout) {\n this.__y += diff;\n }\n else {\n this.__oy += diff;\n }\n this.__sy += diff;\n }\n\n __destroy() {\n this.__config[NODE_IS_DESTROYED] = true;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get ox() {\n return this.__ox;\n }\n\n get oy() {\n return this.__oy;\n }\n\n get sx() {\n return this.x + this.ox;\n }\n\n get sy() {\n return this.y + this.oy;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n // canvas/svg根节点\n get root() {\n return this.__root;\n }\n\n // component根节点\n get host() {\n return this.__host;\n }\n\n // 考虑高阶组件在内的component根节点\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get baseLine() {\n return this.__baseLine;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get isDestroyed() {\n return this.__config[NODE_IS_DESTROYED];\n }\n}\n\nexport default Node;\n","export default {\n CANVAS: 0,\n SVG: 1,\n WEBGL: 2,\n};\n","let o = {\n AUTO: 0,\n PX: 1,\n PERCENT: 2,\n NUMBER: 3,\n INHERIT: 4,\n DEG: 5,\n STRING: 6,\n RGBA: 7,\n REM: 8,\n EM: 9,\n VW: 10,\n VH: 11,\n 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 verdana: {\n lhr: 1.21533203125, // (0+2059+430)/2048\n blr: 1.00537109375, // 2059/2048\n },\n tahoma: {\n lhr: 1.20703125, // (0+2049+423)/2048\n blr: 1.00048828125, // 2049/2048\n padding: {\n S: 1,\n T: 1,\n Z: 1,\n c: 1,\n f: 0.7,\n i: 1,\n l: 1,\n t: 0.9,\n },\n },\n georgia: {\n lhr: 1.13623046875, // (0+1878+449)/2048\n blr: 0.9169921875, // 1878/2048\n },\n 'courier new': {\n lhr: 1.1328125, // (0+1705+615)/2048\n blr: 0.83251953125, // 1705/2048\n },\n 'pingfang sc': {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06, // 1060/1000\n padding: {\n f: 0.5,\n },\n },\n simsun: {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06,\n padding: {\n f: 0.5,\n },\n },\n },\n support(fontFamily) {\n return this.info.hasOwnProperty(fontFamily);\n },\n register(name, info) {\n let { emSquare = 2048, ascent = 1854, descent = 434, lineGap = 67, padding = {} } = info || {};\n this.info[name.toLowerCase()] = {\n lhr: (ascent + descent + lineGap) / emSquare,\n blr: ascent / emSquare,\n padding,\n };\n },\n addPadding(name, padding) {\n Object.assign(this.info[name.toLowerCase()].padding, padding);\n },\n};\n\no.info['宋体'] = o.info.simsun;\n\nexport default o;\n","export default {\n position: /(([-+]?[\\d.]+[pxremvwh%]*)|(left|top|right|bottom|center)){1,2}/ig,\n // tfo: /((-?[\\d.]+(px|%)?)|(left|top|right|bottom|center)){1,2}/ig,\n gradient: /\\b(\\w+)-?gradient\\((.+)\\)/i,\n img: /(?:\\burl\\((['\"]?)(.*?)\\1\\))|(?:\\b((data:)))/i,\n};\n","// 生成4*4单位矩阵\nfunction identity() {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n}\n\n// 矩阵a*b,固定两个matrix都是长度16\nfunction multiply(a, b) {\n if(isE(a)) {\n return b;\n }\n if(isE(b)) {\n return a;\n }\n let c = [];\n for(let i = 0; i < 4; i++) {\n let a0 = a[i] || 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') {\n s += `${k}(${v}%)`;\n }\n });\n return s;\n}\n\nexport default {\n canvasPolygon,\n svgPolygon,\n canvasLine,\n svgLine,\n canvasFilter,\n svgFilter: canvasFilter,\n};\n","import geom from '../math/geom';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\nimport unit from './unit';\n\nconst { H } = geom;\nconst { PX, PERCENT, REM, VW, VH } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\nconst {\n STYLE_KEY: {\n BORDER_LEFT_WIDTH,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n PADDING_LEFT,\n PADDING_BOTTOM,\n PADDING_TOP,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n FONT_SIZE,\n },\n} = enums;\n\n/* 获取合适的虚线实体空白宽度ps/pd和数量n\n * 总长total,start边长bs,end边长be,内容长w,\n * 实体长范围[smin,smax],空白长范围[dmin,dmax]\n */\nfunction calFitDashed(total, bs, be, w, smin, smax, dmin, dmax) {\n let n = 1;\n let ps = 1;\n let pd = 1;\n // 从最大实体空白长开始尝试\n outer:\n for(let i = smax; i >= smin; i--) {\n for(let j = dmax; j >= dmin; j--) {\n // 已知实体空白长度,n实体和n-1空白组成total,计算获取n数量\n let per = i + j;\n let num = Math.floor((total + j) / per);\n let k = j;\n // 可能除不尽,此时扩展空白长\n if(num * per < j + total) {\n let free = total - num * i;\n k = free / (num - 1);\n if(k > dmax) {\n continue;\n }\n }\n per = i + k;\n // bs比实体大才有效,因为小的话必定和第一个实体完整相连\n if(bs > 1 && bs > i) {\n let mo = bs % per;\n if(mo > i) {\n continue;\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n if(num > 0) {\n n = num;\n ps = i;\n pd = k;\n }\n break outer;\n }\n }\n return {\n n,\n ps,\n pd,\n };\n}\n\n// dashed时n个实线和n-1虚线默认以3:1宽度组成,dotted则是n和n以1:1组成\nfunction calDashed(style, m1, m2, m3, m4, bw) {\n let total = m4 - m1;\n let w = m3 - m2;\n let bs = m2 - m1;\n let be = m4 - m3;\n if(style === 'dotted') {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n else {\n let { n, ps, pd } = calFitDashed(total, bs, be, w, bw, bw * 3, Math.max(1, bw * 0.25), bw * 2);\n if(n === 1) {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n // 降级为dotted\n return { n, ps, pd };\n }\n}\n\n// 获取边框分割为几块的坐标,虚线分割为若干四边形、三边型、五边形\n// 三边形重复内外边交点形成四边形,五边形进行切割形成2个四边形\n// direction为上右下左0123\nfunction calPoints(borderWidth, borderStyle, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, direction, beginRadius, endRadius) {\n let points = [];\n if(['dashed', 'dotted'].indexOf(borderStyle) > -1) {\n // 寻找一个合适的虚线线段长度和之间空白边距长度\n let { n, ps, pd } = (direction === 0 || direction === 2)\n ? calDashed(borderStyle, x1, x2, x3, x4, borderWidth)\n : calDashed(borderStyle, y1, y2, y3, y4, borderWidth);\n if(n > 1) {\n for(let i = 0; i < n; i++) {\n // 最后一个可能没有到底,延长之\n let isLast = i === n - 1;\n let main1;\n let main2;\n let cross1;\n let cross2;\n if(direction === 0 || direction === 2) {\n main1 = i ? (x1 + ps * i + pd * i) : x1;\n }\n else {\n main1 = i ? (y1 + ps * i + pd * i) : y1;\n }\n main2 = main1 + ps;\n if(direction === 0) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x4, y1],\n [x3, y2],\n [x2, y2]\n ]);\n }\n else {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n cross2 = y1 + (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y1 + (x4 - main1) * Math.tan(deg2);\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x4, y1],\n [main1, cross1]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross1]\n ]);\n if(isLast) {\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x2, y2]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross2],\n [x3, y2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y1],\n [main2, y1],\n [main2, y2],\n [x2, y2]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y1 + (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross2]\n ]);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y1],\n [x3, y1],\n [x3, y2],\n [main1, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x3, y2],\n [main1, y2]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, y2],\n [main1, y2]\n ]);\n }\n }\n }\n }\n else if(direction === 1) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n cross1 = x4 - (main1 - y1) * Math.tan(deg1);\n cross2 = x4 - (main2 - y1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2],\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x3 + (main1 - y3) * Math.tan(deg2);\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x3 + (main2 - y3) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross2, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, x4],\n [x4, x4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n }\n else if(direction === 2) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x3, y3],\n [x4, y4]\n ]);\n }\n else {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n cross2 = y4 - (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y4 - (x4 - main1) * Math.tan(deg2);\n cross2 = y4 - (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, cross1],\n [x4, y4],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y4 - (main2 - x3) * Math.tan(deg2);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [main2, cross2],\n [main2, y4],\n [x3, y4]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y3],\n [main2, y3],\n [main2, y4],\n [x2, y4]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y4 - (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y4 - (main1 - x3) * Math.tan(deg1);\n points.push([\n [main1, cross2],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y3],\n [x3, y3],\n [x3, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y3],\n [x3, y3],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, y3],\n [main2, y3],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n }\n }\n else if(direction === 3) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x2, y2],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n cross2 = x1 + (main2 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x1 + (y4 - main1) * Math.tan(deg2);\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [x1, main1],\n [cross1, main1],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [x2, y2],\n [x1, y2]\n ]);\n if(isLast) {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4],\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x1 + (y4 - main2) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross2, main1],\n [x2, y2],\n [x1, y1]\n ]);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n }\n }\n if(direction === 0) {\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n }\n }\n // 兜底返回实线\n if(direction === 0) {\n if(x2 > x1) {\n points.push([\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1, y1]\n ]);\n }\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n if(y2 > y1) {\n points.push([\n [x4, y1],\n [x4, y1],\n [x4, y2],\n [x3, y2]\n ]);\n }\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n if(x2 > x1) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x2, y4],\n [x1, y4]\n ]);\n }\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n if(y2 > y1) {\n points.push([\n [x1, y1],\n [x1, y1],\n [x2, y2],\n [x1, y2]\n ]);\n }\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n}\n\nfunction calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[1][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[0][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[1][0] > oxr && points[0][0] < oxl) {\n let ya = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, ya],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y1],\n [oxr, y1],\n [oxr, y2],\n [oxl, y2],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y1],\n [x3, y1],\n [x3, y2],\n [oxl, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [oxr, y1],\n [oxr, y2],\n [x2, y2],\n ]);\n }\n else {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n }\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, yb]\n ]);\n }\n // 跨越右圆角\n else if(points[1][0] > oxr) {\n let y = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n centerList.push([\n points[0],\n [oxr, y1],\n [oxr, y],\n points[3]\n ]);\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, y]\n ]);\n }\n // 跨越左圆角\n else if(points[0][0] < oxl) {\n let y = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, y],\n points[3]\n ]);\n centerList.push([\n [oxl, y1],\n points[1],\n points[2],\n [oxl, y],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y1 + bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierTopLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopLeft(points[0], points[1], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopLeft(points[3], points[2], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 0);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 0);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y1 + ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierTopRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopRight(points[0], points[1], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopRight(points[3], points[2], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 1);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 1);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierTopLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(p1x, p1y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(p2x, p2y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierTopRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (oy - p1y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy - Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy - Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (oy - p2y));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy - Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[2][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[1][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[2][1] > oyb && points[1][1] < oyt) {\n let xa = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n let xb = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [xa, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x3, oyt],\n [x4, oyt],\n [x4, oyb],\n [x3, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, oyb],\n [x3, oyb],\n ]);\n }\n else {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n }\n endList.push([\n [xb, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[2][1] > oyb) {\n let x = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n centerList.push([\n points[0],\n points[1],\n [x4, oyb],\n [x, oyb]\n ]);\n endList.push([\n [x, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [x, oyt]\n ]);\n centerList.push([\n [x, oyt],\n [x4, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x4 - brx;\n let rx2 = brx - (x4 - x3);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightTop(beginList[0][1], beginList[0][2], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierRightTop(beginList[0][0], beginList[0][3], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightTop(points[1], points[2], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightTop(points[0], points[3], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 2);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 2);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x4 - erx;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierRightBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightBottom(points[1], points[2], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightBottom(points[0], points[3], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 3);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 3);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierRightTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox + Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox + Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox + Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierRightBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[2][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[3][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[2][0] > oxr && points[3][0] < oxl) {\n let ya = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n beginList.push([\n points[0],\n [oxl, ya],\n [oxl, y4],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y3],\n [oxr, y3],\n [oxr, y4],\n [oxl, y4],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y3],\n [x3, y3],\n [x3, y4],\n [oxl, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [oxr, y3],\n [oxr, y4],\n [x2, y4],\n ]);\n }\n else {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n }\n endList.push([\n [oxr, yb],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越右圆角\n else if(points[2][0] > oxr) {\n let y = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n centerList.push([\n points[0],\n [oxr, y],\n [oxr, y4],\n points[3]\n ]);\n endList.push([\n [oxr, y],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越左圆角\n else if(points[3][0] < oxl) {\n let y = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y3;\n beginList.push([\n points[0],\n [oxl, y],\n [oxl, y4],\n points[3]\n ]);\n centerList.push([\n [oxl, y],\n points[1],\n points[2],\n [oxl, y4],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y4 - bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierBottomLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomLeft(points[3], points[2], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomLeft(points[0], points[1], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 4);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 4);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y4 - ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierBottomRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomRight(points[3], points[2], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomRight(points[0], points[1], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 5);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 5);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierBottomLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (p2y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy + Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy + Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (p1y - oy));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy + Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierBottomRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[3][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[0][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[3][1] > oyb && points[0][1] < oyt) {\n let xa = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n let xb = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n beginList.push([\n points[0],\n points[1],\n [xa, oyt],\n [x1, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, oyb],\n [x1, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, oyb],\n [x1, oyb],\n ]);\n }\n else {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n }\n endList.push([\n [x1, oyb],\n [xb, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[3][1] > oyb) {\n let x = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n centerList.push([\n points[0],\n points[1],\n [x, oyb],\n [x1, oyb]\n ]);\n endList.push([\n [x1, oyb],\n [x, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n beginList.push([\n points[0],\n points[1],\n [x, oyt],\n [x1, oyt]\n ]);\n centerList.push([\n [x1, oyt],\n [x, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x1 + brx;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftTop(beginList[0][0], beginList[0][3], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierLeftTop(beginList[0][1], beginList[0][2], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftTop(points[0], points[3], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftTop(points[1], points[2], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 6);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 6);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x1 + erx;\n let rx2 = erx - (x2 - x1);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierLeftBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftBottom(points[0], points[3], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftBottom(points[1], points[2], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 7);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 7);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierLeftTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierLeftBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox - Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox - Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox - Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\n/**\n * 简单计算椭圆的圆化坐标控制点,视作重合位置,外面判断backgroundClip并调整坐标\n * @param x 起始x\n * @param y 起始y\n * @param w 宽\n * @param h 高\n * @param btlr borderTopLeftRadius\n * @param btrr borderTopRightRadius\n * @param bbrr borderBottomRightRadius\n * @param bblr borderBottomLeftRadius\n * @returns {[]} 多边形的顶点和曲线控制点\n */\nfunction calRadius(x, y, w, h, btlr, btrr, bbrr, bblr) {\n let need;\n let [btlx, btly] = btlr;\n let [btrx, btry] = btrr;\n let [bbrx, bbry] = bbrr;\n let [bblx, bbly] = bblr;\n btlx = Math.max(btlx, 0);\n btly = Math.max(btly, 0);\n btrx = Math.max(btrx, 0);\n btry = Math.max(btry, 0);\n bbrx = Math.max(bbrx, 0);\n bbry = Math.max(bbry, 0);\n bblx = Math.max(bblx, 0);\n bbly = Math.max(bbly, 0);\n // 圆角必须x/y都>0才有效,否则视为不绘制\n if(btlx > 0 && btly > 0 || btrx > 0 && btry > 0 || bbrx > 0 && bbry > 0 || bblx > 0 && bbly > 0) {\n need = true;\n }\n if(need) {\n let list = [];\n if(btlx > 0 && btly > 0) {\n list.push([x, y + btly]);\n list.push([x, y + (btly) * (1 - H), x + btlx * (1 - H), y, x + btlx, y]);\n }\n else {\n list.push([x, y]);\n }\n if(btrx > 0 && btry > 0) {\n list.push([x + w - btrx, y]);\n list.push([x + w - btrx * (1 - H), y, x + w, y + btry * (1 - H), x + w, y + btry]);\n }\n else {\n list.push([x + w, y]);\n }\n if(bbrx > 0 && bbry > 0) {\n list.push([x + w, y + h - bbry]);\n list.push([x + w, y + h - bbry * (1 - H), x + w - bbrx * (1 - H), y + h, x + w - bbrx, y + h]);\n }\n else {\n list.push([x + w, y + h]);\n }\n if(bblx > 0 && bbly > 0) {\n list.push([x + bblx, y + h]);\n list.push([x + bblx * (1 - H), y + h, x, y + h - bbly * (1 - H), x, y + h - bbly]);\n }\n else {\n list.push([x, y + h]);\n }\n return list;\n }\n}\n\nfunction limit(points, x, y, direction) {\n if(direction === 0) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 1) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 2) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 3) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 4) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 5) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 6) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 7) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n}\n\nconst BR_KS = [BORDER_TOP_LEFT_RADIUS, BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS];\nfunction calBorderRadius(w, h, currentStyle, computedStyle, root) {\n let noRadius = true;\n BR_KS.forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n if(item[0] > 0) {\n noRadius = false;\n }\n else {\n return 0;\n }\n if(item[1] === PX) {\n return Math.max(0, item[0]);\n }\n else if(item[1] === PERCENT) {\n return Math.max(0, item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n return Math.max(0, item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n return Math.max(0, item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n return Math.max(0, item[0] * root.height * 0.01);\n }\n return 0;\n });\n });\n // 优化提前跳出\n if(noRadius) {\n return;\n }\n // radius限制,相交的2个之和不能超过边长,如果2个都超过中点取中点,只有1个超过取交点,这包含了单个不能超过总长的逻辑\n BR_KS.forEach((k, i) => {\n let j = i % 2 === 0 ? 0 : 1;\n let target = j ? h : w;\n let prev = computedStyle[k];\n let next = computedStyle[BR_KS[(i + 1) % 4]];\n // 相加超过边长则是相交\n if(prev[j] + next[j] > target) {\n let half = target * 0.5;\n // 都超过一半中点取中点\n if(prev[j] >= half && next[j] >= half) {\n prev[j] = next[j] = half;\n }\n // 仅1个超过中点,因相交用总长减去另一方即可\n else if(prev[j] > half) {\n prev[j] = target - next[j];\n }\n else if(next[j] > half) {\n next[j] = target - prev[j];\n }\n }\n });\n}\n\nfunction calBorderRadiusInline(contentBoxList, currentStyle, computedStyle) {\n let first, last;\n if(contentBoxList.length) {\n first = contentBoxList[0];\n last = contentBoxList[contentBoxList.length - 1]\n }\n // 先看first的左侧\n let w = first ? first.outerWidth : 0, h = first ? first.outerHeight : 0;\n w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT];\n h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH]\n + computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM];\n [BORDER_TOP_LEFT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS].forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n let v;\n if(item[1] === PX) {\n v = Math.max(0, item[0]);\n v = Math.min(i ? h : w, v);\n }\n else {\n v = Math.max(0, item[0] * (i ? h : w) * 0.01);\n v = Math.min(i ? h : w, v);\n }\n return v;\n });\n });\n // 再看end的右侧\n w = last ? last.outerWidth : 0;\n h = last ? last.outerHeight : 0;\n [BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS].forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n let v;\n if(item[1] === PX) {\n v = Math.max(0, item[0]);\n v = Math.min(i ? h : w, v);\n }\n else {\n v = Math.max(0, item[0] * (i ? h : w) * 0.01);\n v = Math.min(i ? h : w, v);\n }\n return v;\n });\n });\n}\n\nfunction renderBorder(xom, renderMode, ctx, points, color, dx, dy) {\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n points.forEach(point => {\n canvasPolygon(ctx, point, dx, dy);\n });\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let s = '';\n points.forEach(point => {\n s += svgPolygon(point);\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', s],\n ['fill', color],\n ],\n });\n }\n}\n\nexport default {\n calPoints,\n calRadius,\n calBorderRadius,\n calBorderRadiusInline,\n renderBorder,\n};\n","// 类型为引用防止json仿造\nconst TYPE_VD = { _: 1 };\nconst TYPE_GM = { _: 2 };\nconst TYPE_CP = { _: 3 };\n\nexport default {\n TYPE_VD,\n TYPE_GM,\n TYPE_CP,\n};\n","import $$type from './$$type';\nimport mx from '../math/matrix';\n\nlet toString = {}.toString;\nfunction isType(type) {\n return function(obj) {\n return toString.call(obj) === '[object ' + type + ']';\n }\n}\n\nlet isObject = isType('Object');\nlet isString = isType('String');\nlet isFunction = isType('Function');\nlet isNumber = isType('Number');\nlet isBoolean = isType('Boolean');\nlet isDate = isType('Date');\n\nlet hasOwn = {}.hasOwnProperty;\nlet fnToString = hasOwn.toString;\nlet ObjectFunctionString = fnToString.call(Object);\n\nfunction isNil(v) {\n return v === undefined || v === null;\n}\n\nfunction joinSourceArray(arr) {\n let res = '';\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n res += joinSourceArray(item);\n }\n else {\n res += stringify(item);\n }\n }\n return res;\n}\n\nfunction stringify(s) {\n if(isNil(s)) {\n return '';\n }\n return s.toString();\n}\n\nfunction encodeHtml(s, prop) {\n if(prop) {\n return s.replace(/\"/g, '"');\n }\n return s.replace(/&/g, '&').replace(/ {\n s += joinDef(item);\n });\n s += '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n return s;\n}\n\n// 普通元素\nfunction joinVd(vd) {\n if(vd.type === 'item' || vd.type === 'img') {\n let s = '';\n (vd.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n if(vd.tagName === 'text') {\n return '' + vd.content + '';\n }\n return '<' + vd.tagName + s + '/>';\n }\n else if(vd.type === 'text') {\n let s = ``;\n // text有许多lineBox\n (vd.children || []).forEach(item => {\n s += joinVd(item);\n });\n return '' + s + '';\n }\n else if(vd.type === 'dom' || vd.type === 'geom') {\n let s = '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n let { opacity, transform, visibility, mask, overflow, filter, mixBlendMode } = vd;\n return '' + s + '';\n }\n}\n\nfunction joinDef(def) {\n let s = '<' + def.tagName + ' id=\"' + def.uuid + '\"';\n if(def.tagName === 'mask' || def.tagName === 'clipPath') {\n // s += ' maskUnits=\"userSpaceOnUse\"';\n }\n else if(def.tagName === 'filter') {\n // s += ' filterUnits=\"userSpaceOnUse\"';\n }\n else {\n s += ' gradientUnits=\"userSpaceOnUse\"';\n }\n (def.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n (def.children || []).forEach(item => {\n s += joinItem(item);\n });\n s += '';\n return s;\n}\n\nfunction joinItem(item) {\n let s = '<' + item.tagName;\n (item.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n return s;\n}\n\nfunction rgba2int(color) {\n if(Array.isArray(color)) {\n return color;\n }\n let res = [];\n if(!color || color === 'transparent') {\n res = [0, 0, 0, 0];\n }\n else if(color.charAt(0) === '#') {\n color = color.slice(1);\n if(color.length === 3) {\n res.push(parseInt(color.charAt(0) + color.charAt(0), 16));\n res.push(parseInt(color.charAt(1) + color.charAt(1), 16));\n res.push(parseInt(color.charAt(2) + color.charAt(2), 16));\n res[3] = 1;\n }\n else if(color.length === 6) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4), 16));\n res[3] = 1;\n }\n else if(color.length === 8) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4, 6), 16));\n res.push(parseInt(color.slice(6), 16) / 255);\n }\n else {\n res[0] = res[1] = res[2] = 0;\n res[3] = 1;\n }\n }\n else {\n let c = color.match(/rgba?\\s*\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*,\\s*([\\d.]+)(?:\\s*,\\s*([\\d.]+))?\\s*\\)/i);\n if(c) {\n res = [parseInt(c[1]), parseInt(c[2]), parseInt(c[3])];\n if(!isNil(c[4])) {\n res[3] = parseFloat(c[4]);\n }\n else {\n res[3] = 1;\n }\n }\n else {\n res = [0, 0, 0, 0];\n }\n }\n return res;\n}\n\nfunction int2rgba(color) {\n if(Array.isArray(color)) {\n if(color.length === 4) {\n color = color.map((c, i) => i === 3 ? c : Math.floor(Math.max(0, c)));\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n color = color.map(c => Math.floor(c));\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return color || 'rgba(0,0,0,0)';\n}\n\nfunction int2invert(color) {\n if(Array.isArray(color)) {\n color = color.slice(0);\n color[0] = 255 - color[0];\n color[1] = 255 - color[1];\n color[2] = 255 - color[2];\n if(color.length === 4) {\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return 'rgba(0,0,0,0)';\n}\n\nfunction arr2hash(arr) {\n let hash = {};\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n hash[item[0]] = item[1];\n }\n else {\n for(let list = Object.keys(item), j = list.length - 1; j >= 0; j--) {\n let k = list[j];\n hash[k] = item[k];\n }\n }\n }\n return hash;\n}\n\nfunction hash2arr(hash) {\n if(Array.isArray(hash)) {\n return hash;\n }\n let arr = [];\n for(let list = Object.keys(hash), i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n arr.push([k, hash[k]]);\n }\n return arr;\n}\n\nfunction clone(obj) {\n if(isNil(obj) || typeof obj !== 'object') {\n return obj;\n }\n // parse递归会出现内部先返回解析好的json,外部parse不能clone\n if(obj.$$type === $$type.TYPE_VD\n || obj.$$type === $$type.TYPE_GM\n || obj.$$type === $$type.TYPE_CP) {\n return obj;\n }\n if(util.isDate(obj)) {\n return new Date(obj);\n }\n if(!isPlainObject(obj) && !Array.isArray(obj)) {\n return obj;\n }\n let n = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(i => {\n n[i] = clone(obj[i]);\n });\n return n;\n}\n\n/**\n * 简化的arr对比,arr中只有arr和其它类型,其它类型对比值或引用,arr递归\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equalArr(a, b) {\n if(!a || !b) {\n return a === b;\n }\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let ai = a[i];\n let bi = b[i];\n let isArrayA = Array.isArray(ai);\n let isArrayB = Array.isArray(bi);\n if(isArrayA && isArrayB) {\n if(!equalArr(ai, bi)) {\n return false;\n }\n }\n else if(isArrayA || isArrayB) {\n return false;\n }\n else if(ai !== bi) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 深度对比对象\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equal(a, b) {\n if(a === b) {\n return true;\n }\n if(isObject(a) && isObject(b)) {\n let hash = {};\n for(let i = 0, arr = Object.keys(a), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!b.hasOwnProperty(k) || !equal(a[k], b[k])) {\n return false;\n }\n hash[k] = true;\n }\n // a没有b有则false\n for(let i = 0, arr = Object.keys(b), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!hash.hasOwnProperty(k)) {\n return false;\n }\n }\n }\n else if(isDate(a) && isDate(b)) {\n return a.getTime() === b.getTime();\n }\n else if(Array.isArray(a) && Array.isArray(b)) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equal(a[i], b[i])) {\n return false;\n }\n }\n }\n else {\n return a === b;\n }\n return true;\n}\n\nfunction extend(target, source, keys) {\n if(source === null || typeof source !== 'object') {\n return target;\n }\n if(!keys) {\n keys = Object.keys(source);\n }\n let i = 0;\n let len = keys.length;\n while(i < len) {\n let k = keys[i];\n target[k] = source[k];\n i++;\n }\n return target;\n}\n\nfunction joinArr(arr, split) {\n let s = arr.length ? arr[0] : '';\n for(let i = 1, len = arr.length; i < len; i++) {\n s += split + arr[i];\n }\n return s;\n}\n\nfunction extendAnimate(ovd, nvd) {\n let list = nvd.__animationList = ovd.animationList.splice(0);\n list.forEach(item => {\n item.__setTarget(nvd);\n // 事件队列的缘故,可能动画本帧刚执行过,然后再继承,就会缺失,需再次赋值一遍;也有可能停留最后\n if(item.assigning || item.finished && item.__stayEnd()) {\n item.assignCurrentStyle();\n }\n });\n // 帧动画继承\n nvd.__frameAnimateList = ovd.__frameAnimateList.splice(0);\n}\n\nfunction transformBbox(bbox, matrix, dx = 0, dy = 0) {\n if(matrix && !mx.isE(matrix)) {\n let [x1, y1, x2, y2] = bbox;\n // 可能因filter的原因扩展范围\n if(dx) {\n x1 -= dx;\n x2 += dx;\n }\n if(dy) {\n y1 -= dy;\n y2 += dy;\n }\n let list = [x2, y1, x1, y2, x2, y2];\n let w;\n [x1, y1, , w] = mx.calPoint([x1, y1], matrix);\n if(w && w !== 1) {\n x1 /= w;\n y1 /= w;\n }\n let xa = x1, ya = y1, xb = x1, yb = y1;\n for(let i = 0; i < 6; i += 2) {\n let x = list[i], y = list[i + 1];\n [x, y, , w] = mx.calPoint([x, y], matrix);\n if(w && w !== 1) {\n x /= w;\n y /= w;\n }\n xa = Math.min(xa, x);\n xb = Math.max(xb, x);\n ya = Math.min(ya, y);\n yb = Math.max(yb, y);\n }\n bbox = [xa, ya, xb, yb];\n }\n else if(dx || dy) {\n bbox = bbox.slice(0);\n bbox[0] -= dx;\n bbox[1] -= dy;\n bbox[2] += dx;\n bbox[3] += dy;\n }\n return bbox;\n}\n\nfunction isPlainObject(obj) {\n if(!obj || toString.call(obj) !== '[object Object]') {\n return false;\n }\n let proto = Object.getPrototypeOf(obj);\n if(!proto) {\n return true;\n }\n let Ctor = hasOwn.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor === 'function' && fnToString.call(Ctor) === ObjectFunctionString;\n}\n\nfunction assignMatrix(t, v) {\n t[0] = v[0];\n t[1] = v[1];\n t[2] = v[2];\n t[3] = v[3];\n t[4] = v[4];\n t[5] = v[5];\n t[6] = v[6];\n t[7] = v[7];\n t[8] = v[8];\n t[9] = v[9];\n t[10] = v[10];\n t[11] = v[11];\n t[12] = v[12];\n t[13] = v[13];\n t[14] = v[14];\n t[15] = v[15];\n return t;\n}\n\nlet util = {\n isObject,\n isString,\n isFunction,\n isNumber,\n isBoolean,\n isDate,\n isNil,\n isPrimitive(v) {\n return util.isNil(v) || util.isBoolean(v) || util.isString(v) || util.isNumber(v);\n },\n // css中常用undefined/null表示auto本身\n isAuto(v) {\n return isNil(v) || v === 'auto';\n },\n isPlainObject,\n stringify,\n joinSourceArray(arr) {\n return joinSourceArray(arr);\n },\n encodeHtml,\n joinVirtualDom,\n joinVd,\n joinDef,\n rgba2int,\n int2rgba,\n int2invert,\n arr2hash,\n hash2arr,\n clone,\n equalArr,\n equal,\n extend,\n joinArr,\n extendAnimate,\n transformBbox,\n assignMatrix,\n};\n\nexport default util;\n","export default {\n flag: false,\n};\n","export default {\n list: [], // 每次渲染前的更新后,等待测量的文字对象列表\n data: {}, // Text中存入的特殊等待测量的信息,字体+字号+粗细为key\n charWidth: {}, // key的文字宽度hash\n padding: {}, // key的文字宽度偏移,少量字体的少量文字有\n ELLIPSIS: '…',\n};\n","export default {\n alpha: true,\n antialias: true,\n premultipliedAlpha: true,\n preserveDrawingBuffer: true,\n // depth: true,\n // stencil: true,\n};\n","import mx from '../math/matrix';\n\nconst calPoint = mx.calPoint;\n\n/**\n * 初始化 shader\n * @param gl GL context\n * @param vshader vertex shader (string)\n * @param fshader fragment shader (string)\n * @return program, if the program object was created and successfully made current\n */\nfunction initShaders(gl, vshader, fshader) {\n let program = createProgram(gl, vshader, fshader);\n if(!program) {\n throw new Error('Failed to create program');\n }\n\n // 要开启透明度,用以绘制透明的图形\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n return program;\n}\n\n/**\n * Create the linked program object\n * @param gl GL context\n * @param vshader a vertex shader program (string)\n * @param fshader a fragment shader program (string)\n * @return created program object, or null if the creation has failed\n */\nfunction createProgram(gl, vshader, fshader) {\n // Create shader object\n let vertexShader = loadShader(gl, gl.VERTEX_SHADER, vshader);\n let fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fshader);\n if(!vertexShader || !fragmentShader) {\n return null;\n }\n\n // Create a program object\n let program = gl.createProgram();\n if(!program) {\n return null;\n }\n program.vertexShader = vertexShader;\n program.fragmentShader = fragmentShader;\n\n // Attach the shader objects\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n // Link the program object\n gl.linkProgram(program);\n\n // Check the result of linking\n let linked = gl.getProgramParameter(program, gl.LINK_STATUS);\n if(!linked) {\n let error = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n gl.deleteShader(fragmentShader);\n gl.deleteShader(vertexShader);\n throw new Error('Failed to link program: ' + error);\n }\n return program;\n}\n\n/**\n * Create a shader object\n * @param gl GL context\n * @param type the type of the shader object to be created\n * @param source shader program (string)\n * @return created shader object, or null if the creation has failed.\n */\nexport function loadShader(gl, type, source) {\n // Create shader object\n let shader = gl.createShader(type);\n if(shader == null) {\n throw new Error('unable to create shader');\n }\n\n // Set the shader program\n gl.shaderSource(shader, source);\n\n // Compile the shader\n gl.compileShader(shader);\n\n // Check the result of compilation\n let compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if(!compiled) {\n let error = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error('Failed to compile shader: ' + error);\n }\n\n return shader;\n}\n\nfunction convertCoords2Gl([x, y, z, w], cx, cy, revertY) {\n if(z === undefined) {\n z = 0;\n }\n if(w === undefined) {\n w = 1;\n }\n if(w && w !== 1) {\n x /= w;\n y /= w;\n z /= w;\n }\n if(x === cx) {\n x = 0;\n }\n else {\n x = (x - cx) / cx;\n }\n if(y === cy) {\n y = 0;\n }\n else {\n y = (y - cy) / cy;\n if(revertY) {\n y = -y;\n }\n }\n return [x * w, y * w, z * w, w];\n}\n\nfunction createTexture(gl, tex, n, width, height) {\n let texture = gl.createTexture();\n bindTexture(gl, texture, n);\n // gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, -1);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n // 传入高宽时是绑定fbo,且tex一定为null\n if(width && height) {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n // 普通将canvas对象作为纹理\n else {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n return texture;\n}\n\nfunction bindTexture(gl, texture, n) {\n gl.activeTexture(gl['TEXTURE' + n]);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n}\n\n/**\n * texCache集满纹理上传占用最多可用纹理单元后,进行批量顺序绘制\n * 将所有dom的矩形顶点(经过transform变换后的)、贴图坐标、透明度存入3个buffer中,\n * 然后相同纹理单元的形成一批,设置uniform的纹理单元号进行绘制,如此循环\n * @param gl\n * @param list\n * @param hash\n * @param cx\n * @param cy\n * @param revertY\n */\nfunction drawTextureCache(gl, list, hash, cx, cy, revertY) {\n let vtPoint = [], vtTex = [], vtOpacity = [];\n let lastChannel; // 上一个dom的单元号\n let record = [0]; // [num, channel]每一批的数量和单元号记录\n let stack = [record]; // 所有批的数据记录集合\n list.forEach((item, i) => {\n let [cache, opacity, matrix, dx, dy] = item;\n if(i) {\n let channel = hash[cache.page.uuid];\n // 和上一个单元号不同时,生成新的批次记录\n if(lastChannel !== channel) {\n lastChannel = channel;\n record = [0, lastChannel];\n stack.push(record);\n }\n }\n else {\n lastChannel = hash[cache.page.uuid];\n record[1] = lastChannel;\n }\n let { x, y, width, height, page, bbox } = cache;\n // 计算顶点坐标和纹理坐标,转换[0,1]对应关系\n let bx = bbox[0], by = bbox[1];\n let [xa, ya] = [bx + (dx || 0), by + height + (dy || 0)];\n let [xb, yb] = [bx + width + (dx || 0), by + (dy || 0)];\n let [x1, y1, , w1] = calPoint([xa, ya], matrix);\n let [x2, y2, , w2] = calPoint([xb, ya], matrix);\n let [x3, y3, , w3] = calPoint([xb, yb], matrix);\n let [x4, y4, , w4] = calPoint([xa, yb], matrix);\n [x1, y1] = convertCoords2Gl([x1, y1, 0, w1], cx, cy, revertY);\n [x2, y2] = convertCoords2Gl([x2, y2, 0, w2], cx, cy, revertY);\n [x3, y3] = convertCoords2Gl([x3, y3, 0, w3], cx, cy, revertY);\n [x4, y4] = convertCoords2Gl([x4, y4, 0, w4], cx, cy, revertY);\n vtPoint.push(x1, y1, 0, w1, x4, y4, 0, w4, x2, y2, 0, w2, x4, y4, 0, w4, x2, y2, 0, w2, x3, y3, 0, w3);\n let tx1 = x / page.width, ty1 = (y + height) / page.height;\n let tx2 = (x + width) / page.width, ty2 = y / page.height;\n vtTex.push(tx1, ty1, tx1, ty2, tx2, ty1, tx1, ty2, tx2, ty1, tx2, ty2);\n vtOpacity.push(opacity, opacity, opacity, opacity, opacity, opacity);\n record[0]++;\n });\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtPoint), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.program, 'a_position');\n gl.vertexAttribPointer(a_position, 4, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtTex), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // opacity buffer\n let opacityBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, opacityBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtOpacity), gl.STATIC_DRAW);\n let a_opacity = gl.getAttribLocation(gl.program, 'a_opacity');\n gl.vertexAttribPointer(a_opacity, 1, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_opacity);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.program, 'u_texture');\n let count = 0;\n // 循环按批次渲染\n stack.forEach(record => {\n let [num, channel] = record;\n gl.uniform1i(u_texture, channel);\n num *= 6;\n gl.drawArrays(gl.TRIANGLES, count, num);\n count += num;\n });\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.deleteBuffer(opacityBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n gl.disableVertexAttribArray(a_opacity);\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核扩大3倍性能慢\n * x/y方向分开执行,加速性能,计算次数由d*d变为d+d,d为卷积核大小\n * spread由d和sigma计算得出,d由sigma计算得出,sigma即css的blur()参数\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * i和j为total和filter的纹理单元,3次执行(x/y合起来算1次)需互换单元,来回执行源和结果\n * 由total变为filter时cache会各方向上扩展spread的大小到width/height\n * 因此第一次绘制时坐标非1,后面则固定1\n * @param gl\n * @param program\n * @param frameBuffer\n * @param texCache\n * @param tex1 初次绘制目标纹理\n * @param tex2 初次绘制源纹理\n * @param i 初次绘制目标纹理单元\n * @param j 初次绘制源纹理单元\n * @param width\n * @param height\n * @param cx\n * @param cy\n * @param spread\n * @param d\n * @param sigma\n */\nfunction drawBlur(gl, program, frameBuffer, texCache, tex1, tex2, i, j, width, height, cx, cy, spread, d, sigma) {\n // 第一次将total绘制到blur上,此时尺寸存在spread差值,因此不加模糊防止坐标计算问题,仅作为扩展纹理尺寸\n let [x1, y2] = convertCoords2Gl([spread, height - spread], cx, cy);\n let [x2, y1] = convertCoords2Gl([width - spread, spread], cx, cy);\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // direction全0,即无模糊,此时只是进行扩展尺寸操作,还没到模糊所以传0\n let u_direction = gl.getUniformLocation(program, 'u_direction');\n gl.uniform2f(u_direction, 0, 0);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // fbo绑定切换纹理对象和单元索引,同时注意不能向源纹理绘制,因为源是cacheTotal,需要重新生成一个,y方向再来一次\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n /**\n * 反复执行共3次,坐标等均不变,只是切换fbo绑定对象和纹理单元\n * 注意max和ratio的设置,当是100尺寸的正方形时,传给direction的始终为1\n * 当正方形<100时,direction相应地要扩大相对于100的倍数,反之则缩小,如此为了取相邻点坐标时是+-1\n * 当非正方形时,长轴一端为基准值不变,短的要二次扩大比例倍数\n */\n let max = 100 / Math.max(width, height);\n let ratio = width / height;\n let recycle = []; // 3次过程中新生成的中间纹理需要回收\n for(let k = 0; k < 3; k++) {\n let tex3 = createTexture(gl, null, j, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex3, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, max, 0);\n }\n else {\n gl.uniform2f(u_direction, max * ratio, 0);\n }\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n recycle.push(tex1);\n let tex4 = createTexture(gl, null, i, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex4, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, 0, max * ratio);\n }\n else {\n gl.uniform2f(u_direction, 0, max);\n }\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n tex1 = tex4;\n recycle.push(tex3);\n }\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n recycle.forEach(item => gl.deleteTexture(item));\n return tex1;\n}\n\nfunction drawCm(gl, program, i, m) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, i);\n // matrix\n let u_m = gl.getUniformLocation(program, 'u_m');\n gl.uniform1fv(u_m, new Float32Array(m));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\n/**\n * 根据total/filter生成overflow\n * @param gl\n * @param i 输入纹理单元\n * @param dx 二者偏移值\n * @param dy\n * @param width 最终大小\n * @param height\n * @param w 输入纹理大小\n * @param h\n */\nfunction drawOverflow(gl, i, dx, dy, width, height, w, h) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.programOverflow, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer,原本大小width/height,使用其中的w/h\n let x1 = dx / w, y1 = dy / h, x2 = (width + dx) / w, y2 = (height + dy) /h;\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.programOverflow, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.programOverflow, 'u_texture');\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n}\n\nfunction drawMask(gl, i, j, program) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, j);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nfunction drawMbm(gl, program, i, j, W, H) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, i);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nexport default {\n initShaders,\n createTexture,\n bindTexture,\n drawTextureCache,\n drawBlur,\n drawOverflow,\n drawMask,\n drawMbm,\n drawCm,\n};\n","import util from './util';\nimport debug from './debug';\nimport textCache from '../node/textCache';\nimport font from '../style/font';\nimport ca from '../gl/ca';\nimport webgl from '../gl/webgl';\n\nconst SPF = 1000 / 60;\n\nconst CANVAS = {};\nconst WEBGL = {};\nconst CANVAS_LIST = [];\nconst WEBGL_LIST = [];\nconst SUPPORT_OFFSCREEN_CANVAS = typeof OffscreenCanvas === 'function' && util.isFunction(OffscreenCanvas.prototype.getContext);\n\nlet defaultFontFamilyData;\n\nfunction cache(key, width, height, hash, message) {\n let o;\n if(!key) {\n let target = hash === CANVAS ? CANVAS_LIST : WEBGL_LIST;\n if(target.length) {\n o = target.pop();\n }\n else {\n o = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n }\n else if(!hash[key]) {\n o = hash[key] = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n else {\n o = hash[key];\n }\n o.width = width;\n o.height = height;\n if(debug.flag) {\n o.style.width = width + 'px';\n o.style.height = height + 'px';\n o.setAttribute('type', hash === CANVAS ? 'canvas' : 'webgl');\n if(key) {\n o.setAttribute('key', key);\n }\n if(message) {\n o.setAttribute('message', message);\n }\n document.body.appendChild(o);\n }\n let ctx;\n if(hash === CANVAS) {\n ctx = o.getContext('2d');\n }\n else {\n ctx = o.getContext('webgl', ca) || o.getContext('experimental-webgl', ca);\n }\n return {\n canvas: o,\n ctx,\n draw() {\n // 空函数,仅对小程序提供hook特殊处理,flush缓冲\n },\n enabled: true,\n available: true,\n release() {\n if(!key && this.available) {\n if(hash === CANVAS) {\n CANVAS_LIST.push(this.canvas);\n }\n else {\n WEBGL_LIST.push(this.canvas);\n }\n }\n this.available = false;\n },\n };\n}\n\nfunction cacheCanvas(key, width, height, message) {\n return cache(key, width, height, CANVAS, message);\n}\n\nfunction cacheWebgl(key, width, height, message) {\n return cache(key, width, height, WEBGL, message);\n}\n\nconst IMG = {};\nconst INIT = 0;\nconst LOADING = 1;\nconst LOADED = 2;\nconst FONT = {};\nconst COMPONENT = {};\n\nlet inject = {\n measureText() {\n let { list, data } = textCache;\n let html = '';\n let keys = [];\n let lengths = [];\n let chars = [];\n Object.keys(data).forEach(key => {\n let { ff, fs, fw, s } = data[key];\n if(s) {\n keys.push(key);\n lengths.push(s.length);\n let inline = `position:absolute;font-family:${ff};font-size:${fs}px;font-weight:${fw}`;\n for(let i = 0, len = s.length; i < len; i++) {\n let char = s.charAt(i);\n chars.push(char);\n html += `${char.replace(/`;\n }\n data[key].s = '';\n }\n });\n if(!html) {\n return;\n }\n let div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n document.body.appendChild(div);\n div.innerHTML = html;\n let cns = div.childNodes;\n let { charWidth } = textCache;\n let count = 0, index = 0, key;\n for(let i = 0, len = cns.length; i < len; i++) {\n let node = cns[i];\n if(count === 0) {\n key = keys[index];\n }\n if(++count === lengths[index]) {\n index++;\n count = 0;\n }\n let char = chars[i];\n // clientWidth只返回ceil整数,精度必须用getComputedStyle\n let css = window.getComputedStyle(node, null);\n charWidth[key][char] = parseFloat(css.width);\n }\n list.forEach(text => text.__measureCb());\n textCache.list = [];\n textCache.data = {};\n if(!debug.flag) {\n document.body.removeChild(div);\n }\n },\n measureTextSync(key, ff, fs, fw, char) {\n let inline = `position:absolute;font-family:${ff};font-size:${fs}px;font-weight:${fw}`;\n let html = `${char}${char}${char}`;\n let div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n document.body.appendChild(div);\n div.innerHTML = html;\n let cns = div.childNodes;\n let w1 = parseFloat(window.getComputedStyle(cns[0], null).width);\n let w2 = parseFloat(window.getComputedStyle(cns[1], null).width);\n return w1 * 2 - w2;\n },\n IMG,\n INIT,\n LOADED,\n LOADING,\n measureImg(url, cb) {\n if(Array.isArray(url)) {\n if(!url.length) {\n return cb();\n }\n let count = 0;\n let len = url.length;\n let list = [];\n url.forEach((item, i) => {\n inject.measureImg(item, function(cache) {\n list[i] = cache;\n if(++count === len) {\n cb(list);\n }\n });\n });\n return;\n }\n else if(!url || !util.isString(url)) {\n inject.error('Measure img invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\n }\n let cache = IMG[url] = IMG[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb && cb(cache);\n }\n else if(cache.state === LOADING) {\n cb && cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cb && cache.task.push(cb);\n let img = new Image();\n img.onload = function() {\n cache.state = LOADED;\n cache.success = true;\n cache.width = img.width;\n cache.height = img.height;\n cache.source = img;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n img.onerror = function(e) {\n cache.state = LOADED;\n cache.success = false;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n if(url.substr(0, 5) !== 'data:') {\n let host = /^(?:\\w+:)?\\/\\/([^/:]+)/.exec(url);\n if(host) {\n if(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, calUnit } = unit;\nconst { d2r } = geom;\nconst { canvasPolygon, svgPolygon } = painter;\nconst {\n STYLE_KEY: {\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\n\nfunction getLinearDeg(v) {\n let deg = 180;\n if(v === 'to top') {\n deg = 0;\n }\n else if(v === 'to top right') {\n deg = 45;\n }\n else if(v === 'to right') {\n deg = 90;\n }\n else if(v === 'to bottom right') {\n deg = 135;\n }\n else if(v === 'to bottom') {\n }\n else if(v === 'to bottom left') {\n deg = 225;\n }\n else if(v === 'to left') {\n deg = 270;\n }\n else if(v === 'to top left') {\n deg = 315;\n }\n // 数字角度,没有的话取默认角度\n else {\n let match = /([-+]?[\\d.]+)deg/.exec(v);\n if(match) {\n deg = parseFloat(match[1]);\n }\n }\n return deg % 360;\n}\n\nfunction getRadialPosition(data) {\n if(/^[-+]?[\\d.]/.test(data)) {\n let v = calUnit(data);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[data] || 50,\n PERCENT,\n ];\n }\n}\n\n// 获取color-stop区间范围,去除无用值\nfunction getColorStop(v, length, root) {\n let list = [];\n let firstColor = v[0][0];\n // 先把已经声明距离的换算成[0,1]以数组形式存入,未声明的原样存入\n for(let i = 0, len = v.length; i < len; i++) {\n let item = v[i];\n // 考虑是否声明了位置\n if(item.length > 1) {\n let p = item[1];\n if(p[1] === PERCENT) {\n list.push([item[0], p[0] * 0.01]);\n }\n else if(p[1] === REM) {\n list.push([item[0], p[0] * root.computedStyle[FONT_SIZE] / length]);\n }\n else if(p[1] === VW) {\n list.push([item[0], p[0] * root.width / length]);\n }\n else if(p[1] === VH) {\n list.push([item[0], p[0] * root.height / length]);\n }\n else {\n list.push([item[0], p[0] / length]);\n }\n }\n else {\n list.push([item[0]]);\n }\n }\n if(list.length === 1) {\n list.push(util.clone(list[0]));\n }\n // 首尾不声明默认为[0, 1]\n if(list[0].length === 1) {\n list[0].push(0);\n }\n if(list.length > 1) {\n let i = list.length - 1;\n if(list[i].length === 1) {\n list[i].push(1);\n }\n }\n // 找到未声明位置的,需区间计算,找到连续的未声明的,前后的区间平分\n let start = list[0][1];\n for(let i = 1, len = list.length; i < len - 1; i++) {\n let item = list[i];\n if(item.length > 1) {\n start = item[1];\n }\n else {\n let j = i + 1;\n let end = list[list.length - 1][1];\n for(; j < len - 1; j++) {\n let item = list[j];\n if(item.length > 1) {\n end = item[1];\n break;\n }\n }\n let num = j - i + 1;\n let per = (end - start) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.push(start + per * (k + 1 - i));\n }\n i = j;\n }\n }\n // 每个不能小于前面的,canvas/svg不能兼容这种情况,需处理\n for(let i = 1, len = list.length; i < len; i++) {\n let item = list[i];\n let prev = list[i - 1];\n if(item[1] < prev[1]) {\n item[1] = prev[1];\n }\n }\n // 0之前的和1之后的要过滤掉\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item[1] > 1) {\n list.splice(i);\n let prev = list[i - 1];\n if(prev && prev[1] < 1) {\n let dr = item[0][0] - prev[0][0];\n let dg = item[0][1] - prev[0][1];\n let db = item[0][2] - prev[0][2];\n let da = item[0][3] - prev[0][3];\n let p = (1 - prev[1]) / (item[1] - prev[1]);\n list.push([\n [\n item[0][0] + dr * p,\n item[0][1] + dg * p,\n item[0][2] + db * p,\n item[0][3] + da * p,\n ],\n 1],\n );\n }\n break;\n }\n }\n for(let i = list.length - 1; i >= 0; i--) {\n let item = list[i];\n if(item[1] < 0) {\n list.splice(0, i + 1);\n let next = list[i];\n if(next && next[1] > 0) {\n let dr = next[0][0] - item[0][0];\n let dg = next[0][1] - item[0][1];\n let db = next[0][2] - item[0][2];\n let da = next[0][3] - item[0][3];\n let p = (-item[1]) / (next[1] - item[1]);\n list.unshift([\n [\n item[0][0] + dr * p,\n item[0][1] + dg * p,\n item[0][2] + db * p,\n item[0][3] + da * p,\n ],\n 0],\n );\n }\n break;\n }\n }\n // 可能存在超限情况,如在使用px单位超过len或 {\n // item[0] = int2rgba(item[0]);\n if(item[1] < 0) {\n item[1] = 0;\n }\n else if(item[1] > 1) {\n item[1] = 1;\n }\n });\n // 都超限时,第一个颜色兜底\n if(!list.length) {\n list.push([firstColor, 0]);\n }\n return list;\n}\n\n// 根据角度和圆心获取渐变的4个点坐标\nfunction calLinearCoords(deg, length, cx, cy) {\n let x0;\n let y0;\n let x1;\n let y1;\n if(deg >= 270) {\n let r = d2r(360 - deg);\n x0 = cx + Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n else if(deg >= 180) {\n let r = d2r(deg - 180);\n x0 = cx + Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else if(deg >= 90) {\n let r = d2r(180 - deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else {\n let r = d2r(deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n return [x0, y0, x1, y1];\n}\n\nfunction calCircleCentre(position, x1, y1, iw, ih, root) {\n let cx, cy;\n let positionX = position[0], positionY = position[1];\n if(positionX[1] === PERCENT) {\n cx = x1 + positionX[0] * iw * 0.01;\n }\n else if(positionX[1] === REM) {\n cx = x1 + positionX[0] * root.computedStyle[FONT_SIZE];\n }\n else if(positionX[1] === VW) {\n cx = x1 + positionX[0] * root.width * 0.01;\n }\n else if(positionX[1] === VH) {\n cx = x1 + positionX[0] * root.height * 0.01;\n }\n else {\n cx = x1 + positionX[0];\n }\n if(positionY[1] === PERCENT) {\n cy = y1 + positionY[0] * ih * 0.01;\n }\n else if(positionY[1] === REM) {\n cy = y1 + positionY[0] * root.computedStyle[FONT_SIZE];\n }\n else if(positionY[1] === VW) {\n cy = y1 + positionY[0] * root.width * 0.01;\n }\n else if(positionY[1] === VH) {\n cy = y1 + positionY[0] * root.height * 0.01;\n }\n else {\n cy = y1 + positionY[0];\n }\n return [cx, cy];\n}\n\n// 获取径向渐变圆心半径\nfunction calRadialRadius(shape, size, position, iw, ih, x1, y1, x2, y2, root) {\n let cx, cy, xl, yl, r, 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.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]);\n if(position) {\n let x = getRadialPosition(position[1]);\n let y = position[2] ? getRadialPosition(position[2]) : x;\n o.p = [x, y];\n }\n else {\n o.p = [[50, PERCENT], [50, PERCENT]];\n }\n }\n else if(o.k === 'conic') {\n let deg = /([-+]?[\\d.]+deg)/i.exec(gradient[2]);\n if(deg) {\n o.d = parseFloat(deg[0]) % 360;\n }\n else {\n o.d = 0;\n }\n let position = /at\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]);\n if(position) {\n let x = getRadialPosition(position[1]);\n let y = position[2] ? getRadialPosition(position[2]) : x;\n o.p = [x, y];\n }\n else {\n o.p = [[50, PERCENT], [50, PERCENT]];\n }\n }\n let v = gradient[2].match(/([-+]?[\\d.]+[pxremvwh%]+)?\\s*((#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))\\s*([-+]?[\\d.]+[pxremvwh%]+)?/ig) || [];\n o.v = v.map(item => {\n let color = /((?:#[0-9a-f]{3,8})|(?:rgba?\\s*\\(.+?\\)))/i.exec(item);\n let arr = [rgba2int(color[1])];\n let percent = /[-+]?[\\d.]+[pxremvwh%]+/.exec(item);\n if(percent) {\n let v = calUnit(percent[0]);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n arr[1] = v;\n }\n return arr;\n });\n return o;\n }\n}\n\nfunction getLinear(v, d, ox, oy, cx, cy, w, h, root, 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: '#000',\n borderRightColor: '#000',\n borderBottomColor: '#000',\n borderLeftColor: '#000',\n borderTopStyle: 'solid',\n borderRightStyle: 'solid',\n borderBottomStyle: 'solid',\n borderLeftStyle: 'solid',\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomLeftRadius: 0,\n width: 'auto',\n height: 'auto',\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto',\n flexDirection: 'row',\n flexWrap: 'nowrap',\n order: 0,\n justifyContent: 'flexStart',\n alignItems: 'stretch',\n alignSelf: 'auto',\n alignContent: 'stretch',\n textAlign: 'inherit',\n letterSpacing: 'inherit',\n transformOrigin: 'center',\n visibility: 'inherit',\n opacity: 1,\n zIndex: 0,\n transform: null,\n translateX: 0,\n translateY: 0,\n translateZ: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n skewX: 0,\n skewY: 0,\n rotateX: 0,\n rotateY: 0,\n rotateZ: 0,\n rotate3d: '0, 0, 0, 0',\n perspective: 0,\n perspectiveOrigin: 'center',\n filter: null,\n boxShadow: null,\n pointerEvents: 'inherit',\n overflow: 'visible',\n mixBlendMode: 'normal',\n whiteSpace: 'inherit',\n textOverflow: 'clip',\n lineClamp: 0,\n textStrokeWidth: 'inherit',\n textStrokeColor: 'inherit',\n textStrokeOver: 'inherit',\n};\n\nconst GEOM = {\n fill: 'transparent',\n stroke: '#000',\n strokeWidth: 1,\n strokeDasharray: '',\n strokeLinecap: 'butt',\n strokeLinejoin: 'miter',\n strokeMiterlimit: 4,\n fillRule: 'nonzero',\n};\n\nlet DOM_ENTRY_SET = [];\nlet DOM_KEY_SET = [];\nObject.keys(DOM).forEach(k => {\n DOM_KEY_SET.push(k);\n let v = DOM[k];\n DOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet GEOM_ENTRY_SET = [];\nlet GEOM_KEY_SET = [];\nObject.keys(GEOM).forEach(k => {\n GEOM_KEY_SET.push(k);\n let v = GEOM[k];\n GEOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet INHERIT = {\n fontFamily: 'arial',\n fontSize: 16,\n fontWeight: 400,\n fontStyle: 'normal',\n color: '#000',\n textAlign: 'left',\n visibility: 'visible',\n pointerEvents: 'auto',\n textStrokeColor: '#000',\n textStrokeWidth: 1,\n textStrokeOver: 'none',\n};\n\nlet INHERIT_KEY_SET = [];\nObject.keys(INHERIT).forEach(k => {\n INHERIT_KEY_SET.push(k);\n});\n\nexport default {\n DOM,\n GEOM,\n isValid(i) {\n return DOM.hasOwnProperty(i) || GEOM.hasOwnProperty(i);\n },\n DOM_KEY_SET,\n GEOM_KEY_SET,\n DOM_ENTRY_SET,\n GEOM_ENTRY_SET,\n INHERIT,\n INHERIT_KEY_SET,\n};\n","import reg from './reg';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction parseFlex(style, grow, shrink, basis) {\n if(isNil(style.flexGrow)) {\n style.flexGrow = grow || 0;\n }\n if(isNil(style.flexShrink)) {\n style.flexShrink = shrink || 0;\n }\n if(isNil(style.flexBasis)) {\n style.flexBasis = basis || 0;\n }\n}\n\nfunction parseMarginPadding(style, key, list) {\n let temp = style[key];\n if(!isNil(temp)) {\n let match = temp.toString().match(/([-+]?[\\d.]+[pxremvwh%]*)|(auto)/ig);\n if(match) {\n if(match.length === 1) {\n match[3] = match[2] = match[1] = match[0];\n }\n else if(match.length === 2) {\n match[2] = match[0];\n match[3] = match[1];\n }\n else if(match.length === 3) {\n match[3] = match[1];\n }\n list.forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = match[i];\n }\n });\n }\n }\n}\n\nfunction parseOneBorder(style, k) {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n // 后面会统一格式化处理\n if(isNil(style[k + 'Width'])) {\n let w = /\\b[\\d.]+[pxremvwh%]*\\b/i.exec(v);\n style[k + 'Width'] = w ? w[0] : 0;\n }\n if(isNil(style[k + 'Style'])) {\n let s = /\\b(solid|dashed|dotted)\\b/i.exec(v);\n style[k + 'Style'] = s ? s[1] : 'solid';\n }\n if(isNil(style[k + 'Color'])) {\n let c = /#[0-9a-f]{3,8}/i.exec(v);\n if(c && [4, 7, 9].indexOf(c[0].length) > -1) {\n style[k + 'Color'] = c[0];\n }\n else if(/\\btransparent\\b/i.test(v)) {\n style[k + 'Color'] = 'transparent';\n }\n else {\n c = /rgba?\\s*\\(.+\\)/i.exec(v);\n style[k + 'Color'] = c ? c[0] : 'transparent';\n }\n }\n}\n\nexport default {\n margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'],\n padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n border: ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'],\n borderTop: ['borderTopWidth', 'borderTopStyle', 'borderTopColor'],\n borderRight: ['borderRightWidth', 'borderRightStyle', 'borderRightColor'],\n borderBottom: ['borderBottomWidth', 'borderBottomStyle', 'borderBottomColor'],\n borderLeft: ['borderLeftWidth', 'borderLeftStyle', 'borderLeftColor'],\n borderWidth: ['borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth'],\n borderColor: ['borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor'],\n borderStyle: ['borderTopStyle', 'borderRightStyle', 'borderBottomStyle', 'borderLeftStyle'],\n borderRadius: ['borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'],\n background: ['backgroundColor', 'backgroundImage', 'backgroundRepeat', 'backgroundPosition'],\n backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n flex: ['flexGrow', 'flexShrink', 'flexBasis'],\n translate: ['translateX', 'translateY'],\n translate3d: ['translateX', 'translateY', 'translateY'],\n scale: ['scaleX', 'scaleY'],\n scale3d: ['scaleX', 'scaleY', 'scaleZ'],\n rotate: ['rotateZ'],\n skew: ['skewX', 'skewY'],\n textStroke: ['textStrokeWidth', 'textStrokeColor', 'textStrokeOver'],\n\n toFull(style, k) {\n let v = style[k];\n if(k === 'background') {\n // bg缩写多个时有color则必须是最后一个\n if(Array.isArray(v)) {\n let length = v.length;\n if(isNil(style.backgroundColor)) {\n let bgc = /^\\s*((transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))/i.exec(v[length - 1]);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.slice(0, length - 1);\n }\n }\n let bgi = [];\n let bgr = [];\n let bgp = [];\n v.forEach(item => {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(item);\n if(gd) {\n bgi.push(gd[0]);\n item = item.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n bgi.push(img[0]);\n item = item.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-?)?repeat(-?[xy])?/i.exec(item);\n if(repeat) {\n bgr.push(repeat[0].toLowerCase());\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = item.match(reg.position);\n if(position) {\n bgp.push(position.join(' '));\n }\n }\n });\n if(bgi.length) {\n style.backgroundImage = bgi;\n }\n if(bgr.length) {\n style.backgroundRepeat = bgr;\n }\n if(bgp.length) {\n style.backgroundPosition = bgp;\n this.toFull(style, 'backgroundPosition');\n }\n }\n else {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(v);\n if(gd) {\n style.backgroundImage = gd[0];\n v = v.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n style.backgroundImage = img[0];\n v = v.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-?)?repeat(-?[xy])?/i.exec(v);\n if(repeat) {\n style.backgroundRepeat = repeat[0].toLowerCase();\n }\n }\n if(isNil(style.backgroundColor)) {\n let bgc = /^(transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\))/i.exec(v);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.replace(bgc[0], '');\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = v.match(reg.position);\n if(position) {\n style.backgroundPosition = position.join(' ');\n this.toFull(style, 'backgroundPosition');\n }\n }\n }\n }\n else if(k === 'flex') {\n if(v === 'none') {\n parseFlex(style, 0, 0, 'auto');\n }\n else if(v === 'auto') {\n parseFlex(style, 1, 1, 'auto');\n }\n else if(/^[\\d.]+\\s+[\\d.]+\\s+(auto|none|content)/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]);\n }\n else if(/^[\\d.]+\\s+[\\d.]+\\s+[\\d.]+[pxremvwh%]*/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]);\n }\n else if(/^[\\d.]+\\s+[\\d.]+$/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), 0);\n }\n else if(/^[\\d.]+\\s+[\\d.]+[pxremvwh%]+/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), 1, arr[1]);\n }\n else if(/^[\\d.]+$/.test(v)) {\n parseFlex(style, parseFloat(v), 1, 0);\n }\n else if(/^[\\d.]+[pxremvwh%]+/i.test(v)) {\n parseFlex(style, 1, 1, v);\n }\n else {\n parseFlex(style, 0, 1, 'auto');\n }\n }\n else if(k === 'flexFlow') {\n v = v.toString().split(/\\s+/);\n if(v.length) {\n if(isNil(style.flexDirection)) {\n }\n style.flexDirection = v[0];\n if(v.length > 1) {\n style.flexWrap = v[1];\n }\n }\n }\n else if(k === 'borderRadius') {\n // borderRadius缩写很特殊,/分隔x/y,然后上右下左4个\n v = v.toString().split('/');\n if(v.length === 1) {\n v[1] = v[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = v[i].toString().split(/\\s+/);\n if(item.length === 0) {\n v[i] = [0, 0, 0, 0];\n }\n else if(item.length === 1) {\n v[i] = [item[0], item[0], item[0], item[0]];\n }\n else if(item.length === 2) {\n v[i] = [item[0], item[1], item[0], item[1]];\n }\n else if(item.length === 3) {\n v[i] = [item[0], item[1], item[2], item[1]];\n }\n else {\n v[i] = item.slice(0, 4);\n }\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = v[0][i] + ' ' + v[1][i];\n }\n });\n }\n else if(k === 'backgroundPosition') {\n if(!Array.isArray(v)) {\n v = [v];\n }\n let isEmpty = this[k].map(k2 => isNil(style[k2]));\n v.forEach(v2 => {\n v2 = v2.toString().split(/\\s+/);\n if(v2.length === 1) {\n v2[1] = '50%';\n }\n this[k].forEach((k2, i) => {\n if(isEmpty[i]) {\n style[k2] = style[k2] || [];\n style[k2].push(v2[i]);\n }\n });\n });\n }\n else if(['translate', 'scale', 'skew'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(['translate3d', 'scale3d'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[2] = arr[1] = arr[0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? 1 : 0;\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(k === 'margin' || k === 'padding') {\n parseMarginPadding(style, k, this[k]);\n }\n else if(/^border((Top)|(Right)|(Bottom)|(Left))$/.test(k)) {\n parseOneBorder(style, k);\n }\n else if(k === 'textStroke') {\n let w = /(?:^|\\s)([-+]?[\\d.]+[pxremvwh%]*)/.exec(v);\n if(w) {\n style.textStrokeWidth = w[1];\n }\n let c = /(transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\))/i.exec(v);\n if(c) {\n style.textStrokeColor = c[0];\n }\n if(/\\bfill\\b/i.test(v)) {\n style.textStrokeOver = 'fill';\n }\n else {\n style.textStrokeOver = 'none';\n }\n }\n else if(this[k]) {\n this[k].forEach(k => {\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n }\n return style;\n }\n};\n","import enums from '../util/enums';\n\nconst { STYLE_KEY } = enums;\n\nconst KEY_COLOR = [\n [STYLE_KEY.BACKGROUND_COLOR],\n [STYLE_KEY.BORDER_BOTTOM_COLOR],\n [STYLE_KEY.BORDER_LEFT_COLOR],\n [STYLE_KEY.BORDER_RIGHT_COLOR],\n [STYLE_KEY.BORDER_TOP_COLOR],\n [STYLE_KEY.COLOR],\n [STYLE_KEY.TEXT_STROKE_COLOR],\n];\n\nconst KEY_LENGTH = [\n [STYLE_KEY.FONT_SIZE],\n [STYLE_KEY.BORDER_BOTTOM_WIDTH],\n [STYLE_KEY.BORDER_LEFT_WIDTH],\n [STYLE_KEY.BORDER_RIGHT_WIDTH],\n [STYLE_KEY.BORDER_TOP_WIDTH],\n [STYLE_KEY.LEFT],\n [STYLE_KEY.TOP],\n [STYLE_KEY.RIGHT],\n [STYLE_KEY.BOTTOM],\n [STYLE_KEY.FLEX_BASIS],\n [STYLE_KEY.WIDTH],\n [STYLE_KEY.HEIGHT],\n [STYLE_KEY.LINE_HEIGHT],\n [STYLE_KEY.MARGIN_BOTTOM],\n [STYLE_KEY.MARGIN_LEFT],\n [STYLE_KEY.MARGIN_TOP],\n [STYLE_KEY.MARGIN_RIGHT],\n [STYLE_KEY.PADDING_TOP],\n [STYLE_KEY.PADDING_RIGHT],\n [STYLE_KEY.PADDING_BOTTOM],\n [STYLE_KEY.PADDING_LEFT],\n [STYLE_KEY.STROKE_WIDTH],\n [STYLE_KEY.STROKE_MITERLIMIT],\n [STYLE_KEY.LETTER_SPACING],\n [STYLE_KEY.PERSPECTIVE],\n [STYLE_KEY.TEXT_STROKE_WIDTH],\n];\n\nconst KEY_GRADIENT = [\n [STYLE_KEY.BACKGROUND_IMAGE],\n [STYLE_KEY.FILL],\n [STYLE_KEY.STROKE],\n];\n\nconst KEY_RADIUS = [\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS],\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS],\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS],\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS],\n];\n\nconst COLOR_HASH = {};\nKEY_COLOR.forEach(k => {\n COLOR_HASH[k] = true;\n});\n\nconst LENGTH_HASH = {};\nKEY_LENGTH.forEach(k => {\n LENGTH_HASH[k] = true;\n});\n\nconst RADIUS_HASH = {};\nKEY_RADIUS.forEach(k => {\n RADIUS_HASH[k] = true;\n});\n\nconst GRADIENT_HASH = {};\nKEY_GRADIENT.forEach(k => {\n GRADIENT_HASH[k] = true;\n});\n\nconst GRADIENT_TYPE = {\n linear: true,\n radial: true,\n conic: true,\n};\n\nconst KEY_EXPAND = [\n [STYLE_KEY.TRANSLATE_X],\n [STYLE_KEY.TRANSLATE_Y],\n [STYLE_KEY.TRANSLATE_Z],\n [STYLE_KEY.SKEW_X],\n [STYLE_KEY.SKEW_Y],\n [STYLE_KEY.SCALE_X],\n [STYLE_KEY.SCALE_Y],\n [STYLE_KEY.SCALE_Z],\n [STYLE_KEY.ROTATE_X],\n [STYLE_KEY.ROTATE_Y],\n [STYLE_KEY.ROTATE_Z],\n];\n\nconst EXPAND_HASH = {};\nKEY_EXPAND.forEach(k => {\n EXPAND_HASH[k] = true;\n});\n\nexport default {\n KEY_COLOR,\n KEY_EXPAND,\n KEY_GRADIENT,\n KEY_LENGTH,\n KEY_RADIUS,\n COLOR_HASH,\n EXPAND_HASH,\n GRADIENT_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_TYPE,\n};\n","import reset from '../style/reset';\nimport unit from '../style/unit';\nimport enums from '../util/enums';\n\nconst { DOM: RESET_DOM, GEOM: RESET_GEOM } = reset;\nconst { INHERIT } = unit;\nconst { STYLE_KEY } = enums;\n\nconst GEOM = {};\nconst GEOM_KEY_SET = [];\nconst IGNORE = {\n [STYLE_KEY.POINTER_EVENTS]: true,\n};\nconst REPAINT = {\n [STYLE_KEY.TRANSFORM]: true,\n [STYLE_KEY.TRANSLATE_X]: true,\n [STYLE_KEY.TRANSLATE_Y]: true,\n [STYLE_KEY.SKEW_X]: true,\n [STYLE_KEY.SKEW_Y]: true,\n [STYLE_KEY.SCALE_X]: true,\n [STYLE_KEY.SCALE_Y]: true,\n [STYLE_KEY.ROTATE_Z]: true,\n [STYLE_KEY.COLOR]: true,\n [STYLE_KEY.FONT_STYLE]: true,\n [STYLE_KEY.STROKE_WIDTH]: true,\n [STYLE_KEY.FILL]: true,\n [STYLE_KEY.STROKE_DASHARRAY]: true,\n [STYLE_KEY.STROKE_LINECAP]: true,\n [STYLE_KEY.STROKE_LINEJOIN]: true,\n [STYLE_KEY.STROKE_MITERLIMIT]: true,\n [STYLE_KEY.BACKGROUND_COLOR]: true,\n [STYLE_KEY.BACKGROUND_IMAGE]: true,\n [STYLE_KEY.BACKGROUND_POSITION_X]: true,\n [STYLE_KEY.BACKGROUND_POSITION_Y]: true,\n [STYLE_KEY.BACKGROUND_REPEAT]: true,\n [STYLE_KEY.BACKGROUND_SIZE]: true,\n [STYLE_KEY.STROKE]: true,\n [STYLE_KEY.BORDER_BOTTOM_COLOR]: true,\n [STYLE_KEY.BORDER_LEFT_COLOR]: true,\n [STYLE_KEY.BORDER_RIGHT_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS]: true,\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS]: true,\n [STYLE_KEY.VISIBILITY]: true,\n [STYLE_KEY.OPACITY]: true,\n [STYLE_KEY.Z_INDEX]: true,\n [STYLE_KEY.FILTER]: true,\n [STYLE_KEY.BOX_SHADOW]: true,\n [STYLE_KEY.OVERFLOW]: true,\n [STYLE_KEY.BACKGROUND_CLIP]: true,\n [STYLE_KEY.TEXT_STROKE_WIDTH]: true,\n [STYLE_KEY.TEXT_STROKE_COLOR]: true,\n [STYLE_KEY.TEXT_STROKE_OVER]: true,\n};\nconst MEASURE = {\n [STYLE_KEY.FONT_SIZE]: true,\n [STYLE_KEY.FONT_WEIGHT]: true,\n [STYLE_KEY.FONT_FAMILY]: true,\n};\n\nlet o = {\n GEOM,\n GEOM_KEY_SET,\n IGNORE,\n REPAINT,\n MEASURE,\n addGeom(tagName, ks, cb) {\n if(Array.isArray(ks)) {\n ks.forEach(k => {\n o.addGeom(tagName, k, cb);\n });\n }\n else if(ks) {\n if(!GEOM.hasOwnProperty(ks)) {\n GEOM_KEY_SET.push(ks);\n }\n let hash = GEOM[ks] = GEOM[ks] || {};\n hash[tagName] = cb || true;\n }\n },\n 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, calUnit } = unit;\nconst { isNil, rgba2int, equalArr } = util;\nconst { MEASURE_KEY_SET, isGeom, GEOM, GEOM_KEY_SET } = change;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nconst TRANSFORM_HASH = {\n translateX: TRANSLATE_X,\n translateY: TRANSLATE_Y,\n translateZ: TRANSLATE_Z,\n scaleX: SCALE_X,\n scaleY: SCALE_Y,\n scaleZ: SCALE_Z,\n skewX: SKEW_X,\n skewY: SKEW_Y,\n rotateX: ROTATE_X,\n rotateY: ROTATE_Y,\n rotateZ: ROTATE_Z,\n rotate: ROTATE_Z,\n};\n\nfunction compatibleTransform(k, arr) {\n if(k === SCALE_X || k === SCALE_Y || k === SCALE_Z) {\n arr[1] = NUMBER;\n }\n else if(k === TRANSLATE_X || k === TRANSLATE_Y || k === TRANSLATE_Z) {\n if(arr[1] === NUMBER) {\n arr[1] = PX;\n }\n }\n else if(k === PERSPECTIVE) {\n if([NUMBER, PERCENT, DEG].indexOf(arr[1]) > -1) {\n arr[1] = PX;\n }\n }\n else {\n if(arr[1] === NUMBER) {\n arr[1] = DEG;\n }\n }\n}\n\n/**\n * 将传入的手写style标准化,并且用reset默认值覆盖其中为空的\n * @param style 手写的style样式\n * @param reset 默认样式,可选\n * @returns Object 标准化的枚举数组结构样式\n */\nfunction normalize(style, reset = []) {\n if(!util.isObject(style)) {\n return {};\n }\n let res = {};\n // style只有单层无需深度clone\n style = util.extend({}, style);\n // 缩写提前处理,因为reset里没有缩写\n let temp = style.border;\n if(temp) {\n abbr.toFull(style, 'border');\n }\n ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'].forEach(k => {\n abbr.toFull(style, k);\n });\n temp = style.borderWidth;\n if(temp) {\n abbr.toFull(style, 'borderWidth');\n }\n temp = style.borderColor;\n if(temp) {\n abbr.toFull(style, 'borderColor');\n }\n temp = style.borderStyle;\n if(temp) {\n abbr.toFull(style, 'borderStyle');\n }\n temp = style.borderRadius;\n if(temp) {\n abbr.toFull(style, 'borderRadius');\n }\n temp = style.background;\n // 处理渐变背景缩写\n if(temp) {\n abbr.toFull(style, 'background');\n }\n // 背景位置\n temp = style.backgroundPosition;\n if(!isNil(temp)) {\n abbr.toFull(style, 'backgroundPosition');\n }\n // flex\n temp = style.flex;\n if(temp) {\n abbr.toFull(style, 'flex');\n }\n // flex-flow\n temp = style.flexFlow;\n if(temp) {\n abbr.toFull(style, 'flexFlow');\n }\n temp = style.margin;\n if(!isNil(temp)) {\n abbr.toFull(style, 'margin');\n }\n temp = style.padding;\n if(!isNil(temp)) {\n abbr.toFull(style, 'padding');\n }\n temp = style.textStroke;\n if(temp) {\n abbr.toFull(style, 'textStroke');\n }\n // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform\n ['translate', 'scale', 'skew', 'translate3d', 'scale3d', 'rotate'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n abbr.toFull(style, k);\n }\n });\n // 扩展的不能和transform混用,给出警告\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate3d',\n ].forEach(k => {\n let v = style[k];\n if(!isNil(v) && style.transform) {\n inject.warn(`Can not use expand style \"${k}\" with transform`);\n }\n });\n // 默认reset,根据传入不同,当style为空时覆盖\n reset.forEach(item => {\n let { k, v } = item;\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n // 背景图\n temp = style.backgroundImage;\n if(temp !== undefined) {\n if(!temp) {\n res[BACKGROUND_IMAGE] = [null];\n }\n else if(Array.isArray(temp)) {\n res[BACKGROUND_IMAGE] = temp.map(item => {\n if(!item) {\n return null;\n }\n if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n if(reg.img.test(item)) {\n return reg.img.exec(item)[2];\n }\n return null;\n });\n }\n // 区分是渐变色还是图\n else if(reg.gradient.test(temp)) {\n res[BACKGROUND_IMAGE] = [gradient.parseGradient(temp)];\n }\n else if(reg.img.test(temp)) {\n res[BACKGROUND_IMAGE] = [reg.img.exec(temp)[2]];\n }\n else {\n res[BACKGROUND_IMAGE] = [null];\n }\n }\n temp = style.backgroundColor;\n if(temp) {\n // 先赋值默认透明,后续操作有合法值覆盖\n let bgc = /^#[0-9a-f]{3,8}/i.exec(temp);\n if(bgc && [4, 7, 9].indexOf(bgc[0].length) > -1) {\n res[BACKGROUND_COLOR] = [rgba2int(bgc[0]), RGBA];\n }\n else {\n bgc = /rgba?\\s*\\(.+\\)/i.exec(temp);\n res[BACKGROUND_COLOR] = [rgba2int(bgc ? bgc[0] : [0, 0, 0, 0]), RGBA];\n }\n }\n ['backgroundPositionX', 'backgroundPositionY'].forEach((k, i) => {\n temp = style[k];\n if(!isNil(temp)) {\n k = i ? BACKGROUND_POSITION_Y : BACKGROUND_POSITION_X;\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[k] = temp.map(item => {\n if(/^[-+]?[\\d.]/.test(item)) {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item] || 0,\n PERCENT,\n ];\n }\n });\n }\n });\n // 背景尺寸\n temp = style.backgroundSize;\n if(temp) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[BACKGROUND_SIZE] = temp.map(item => {\n if(!item) {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n let match = item.toString().match(/\\b(?:([-+]?[\\d.]+[pxremvwh%]*)|(contain|cover|auto))/ig);\n if(match) {\n if(match.length === 1) {\n if(match[0] === 'contain' || match[0] === 'cover') {\n match[1] = match[0];\n }\n else {\n match[1] = 'auto';\n }\n }\n let v = [];\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n v.push(n);\n }\n else if(item === 'contain' || item === 'cover') {\n v.push([item, STRING]);\n }\n else {\n v.push([0, AUTO]);\n }\n }\n return v;\n }\n else {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n });\n }\n // border-color\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k + 'Color';\n let v = style[k];\n if(!isNil(v)) {\n res[STYLE_KEY[style2Upper(k)]] = [rgba2int(v), RGBA];\n }\n });\n // border-radius\n ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'].forEach(k => {\n k = 'border' + k + 'Radius';\n let v = style[k];\n if(!isNil(v)) {\n let arr = v.toString().split(/\\s+/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = arr[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n if(n[0] < 0) {\n n[0] = 0;\n }\n arr[i] = n;\n }\n else {\n arr[i] = [0, PX];\n }\n }\n res[STYLE_KEY[style2Upper(k)]] = arr;\n }\n });\n temp = style.transform;\n if(temp) {\n let transform = res[TRANSFORM] = [];\n let match = (temp || '').toString().match(/\\w+\\(.+?\\)/g);\n if(match) {\n match.forEach(item => {\n let i = item.indexOf('(');\n let k = item.slice(0, i);\n let v = item.slice(i + 1, item.length - 1);\n if(k === 'matrix') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 6) {\n arr = arr.slice(0, 6);\n }\n if(arr.length === 6) {\n transform.push([MATRIX, [\n arr[0], arr[1], 0, 0, arr[2], arr[3], 0, 0, 0, 0, 1, 0, arr[4], arr[5], 0, 1,\n ]]);\n }\n }\n else if(k === 'matrix3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 16) {\n arr = arr.slice(0, 16);\n }\n if(arr.length === 16) {\n transform.push([MATRIX, arr]);\n }\n }\n else if(k === 'perspective') {\n let arr = calUnit(v);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n transform.push([PERSPECTIVE, arr]);\n }\n else if(k === 'rotate3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n transform.push([ROTATE_3D, arr]);\n }\n }\n else if(TRANSFORM_HASH.hasOwnProperty(k)) {\n let k2 = TRANSFORM_HASH[k];\n let arr = calUnit(v);\n compatibleTransform(k2, arr);\n transform.push([k2, arr]);\n }\n else if({ translate: true, scale: true, skew: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale' ? arr[0] : [0];\n }\n if(arr.length === 2) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n }\n }\n else if({ translate3d: true, scale3d: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale3d' ? [1] : [0];\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n if(arr.length === 3) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let k3 = STYLE_KEY[style2Upper(k + 'Z')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n let arr3 = calUnit(arr[2]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n compatibleTransform(k3, arr3);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n transform.push([k3, arr3]);\n }\n }\n });\n }\n }\n temp = style.perspective;\n if(!isNil(temp)) {\n let arr = calUnit(temp);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n res[PERSPECTIVE] = arr;\n }\n ['perspectiveOrigin', 'transformOrigin'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n let arr = res[STYLE_KEY[style2Upper(k)]] = [];\n let match = temp.toString().match(reg.position);\n if(match) {\n if(match.length === 1) {\n match[1] = match[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n arr.push(n);\n }\n else {\n arr.push([\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item],\n PERCENT,\n ]);\n // 不规范的写法变默认值50%\n if(isNil(arr[i][0])) {\n arr[i][0] = 50;\n }\n }\n }\n }\n else {\n arr.push([50, PERCENT]);\n arr.push([50, PERCENT]);\n }\n }\n });\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n let k2 = TRANSFORM_HASH[k];\n let n = calUnit(v);\n // 没有单位或默认值处理单位\n compatibleTransform(k2, n);\n res[k2] = n;\n });\n temp = style.rotate3d;\n if(temp) {\n let arr = temp.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n res[ROTATE_3D] = arr;\n }\n }\n temp = style.opacity;\n if(!isNil(temp)) {\n temp = parseFloat(temp);\n if(!isNaN(temp)) {\n temp = Math.max(temp, 0);\n temp = Math.min(temp, 1);\n res[OPACITY] = temp;\n }\n else {\n res[OPACITY] = 1;\n }\n }\n temp = style.zIndex;\n if(!isNil(temp)) {\n res[Z_INDEX] = parseInt(temp) || 0;\n }\n // 转化不同单位值为对象标准化,不写单位的变成number单位转化为px\n [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'width',\n 'height',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n if(v === 'auto') {\n v = [0, AUTO];\n }\n else {\n v = calUnit(v);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n let k2 = STYLE_KEY[style2Upper(k)];\n res[k2] = v;\n // 限制padding/border为正数\n if({\n paddingTop: true,\n paddingRight: true,\n paddingBottom: true,\n paddingLeft: true,\n borderTopWidth: true,\n borderRightWidth: true,\n borderBottomWidth: true,\n borderLeftWidth: true,\n width: true,\n height: true,\n }.hasOwnProperty(k) && v[0] < 0) {\n v[0] = 0;\n }\n });\n temp = style.flexBasis;\n if(!isNil(temp)) {\n if(temp === 'content') {\n res[FLEX_BASIS] = [temp, STRING];\n }\n else if(/^[\\d.]/.test(temp)) {\n let v = res[FLEX_BASIS] = calUnit(temp);\n v[0] = Math.max(v[0], 0);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n else {\n res[FLEX_BASIS] = [0, AUTO];\n }\n }\n temp = style.order;\n if(!isNil(temp)) {\n res[ORDER] = parseInt(temp) || 0;\n }\n temp = style.color;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[COLOR] = [[], INHERIT];\n }\n else {\n res[COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.textStrokeColor;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_COLOR] = [[], INHERIT];\n }\n else {\n res[TEXT_STROKE_COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.fontSize;\n if(temp || temp === 0) {\n if(temp === 'inherit') {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // fontSize不能为负数,否则为继承\n if(v < 0) {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[FONT_SIZE] = v;\n }\n }\n }\n temp = style.textStrokeWidth;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // textStrokeWidth不能为负数,否则为继承\n if(v < 0) {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG, PERCENT].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[TEXT_STROKE_WIDTH] = v;\n }\n }\n }\n temp = style.textStrokeOver;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_OVER] = [0, INHERIT];\n }\n else {\n let v = temp.toString();\n if(v !== 'none' && v !== 'fill') {\n v = 'none';\n }\n res[TEXT_STROKE_OVER] = [v, STRING];\n }\n }\n temp = style.fontWeight;\n if(!isNil(temp)) {\n if(temp === 'bold') {\n res[FONT_WEIGHT] = [700, NUMBER];\n }\n else if(temp === 'normal') {\n res[FONT_WEIGHT] = [400, NUMBER];\n }\n else if(temp === 'lighter') {\n res[FONT_WEIGHT] = [200, NUMBER];\n }\n else if(temp === 'inherit') {\n res[FONT_WEIGHT] = [0, INHERIT];\n }\n else {\n res[FONT_WEIGHT] = [Math.max(0, parseInt(temp)) || 400, NUMBER];\n }\n }\n temp = style.fontStyle;\n if(temp) {\n if(temp === 'inherit') {\n res[FONT_STYLE] = [0, INHERIT];\n }\n else {\n res[FONT_STYLE] = [temp, STRING];\n }\n }\n temp = style.fontFamily;\n if(temp) {\n if(temp === 'inherit') {\n res[FONT_FAMILY] = [0, INHERIT];\n }\n else {\n // 统一文字声明格式\n res[FONT_FAMILY] = [temp.toString().toLowerCase().replace(/['\"]/, '').replace(/\\s*,\\s*/g, ','), STRING];\n }\n }\n temp = style.textAlign;\n if(temp) {\n if(temp === 'inherit') {\n res[TEXT_ALIGN] = [0, INHERIT];\n }\n else {\n res[TEXT_ALIGN] = [temp, STRING];\n }\n }\n temp = style.lineHeight;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LINE_HEIGHT] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LINE_HEIGHT] = [0, AUTO];\n }\n // lineHeight默认数字,想要px必须强制带单位\n else if(/^[\\d.]+/i.test(temp)) {\n let v = calUnit(temp);\n if([DEG].indexOf(v[1]) > -1) {\n v[1] = NUMBER;\n }\n res[LINE_HEIGHT] = v;\n }\n else {\n let n = Math.max(0, parseFloat(temp)) || 'normal';\n // 非法数字\n if(n === 'normal') {\n res[LINE_HEIGHT] = [null, AUTO];\n }\n else {\n res[LINE_HEIGHT] = [n, NUMBER];\n }\n }\n }\n temp = style.letterSpacing;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LETTER_SPACING] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LETTER_SPACING] = [0, PX];\n }\n else if(/^[-+]?[\\d.]/.test(temp)) {\n let v = calUnit(temp);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[LETTER_SPACING] = v;\n }\n else {\n res[LETTER_SPACING] = [parseFloat(temp) || 0, PX];\n }\n }\n temp = style.whiteSpace;\n if(temp) {\n if(temp === 'inherit') {\n res[WHITE_SPACE] = [0, INHERIT];\n }\n else {\n res[WHITE_SPACE] = [temp, STRING];\n }\n }\n temp = style.lineClamp;\n if(temp !== undefined) {\n temp = parseInt(temp) || 0;\n res[LINE_CLAMP] = Math.max(0, temp);\n }\n // fill和stroke为渐变时特殊处理,fillRule无需处理字符串\n temp = style.fill;\n if(temp !== undefined) {\n if(!temp) {\n res[FILL] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[FILL] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[FILL] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[FILL] = [gradient.parseGradient(temp)];\n }\n else {\n res[FILL] = [rgba2int(temp)];\n }\n }\n temp = style.stroke;\n if(temp !== undefined) {\n if(!temp) {\n res[STROKE] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[STROKE] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[STROKE] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[STROKE] = [gradient.parseGradient(temp)];\n }\n else {\n res[STROKE] = [rgba2int(temp)];\n }\n }\n temp = style.strokeWidth;\n if(!isNil(temp)) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[STROKE_WIDTH] = temp.map(item => {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n v[0] = Math.max(v[0], 0);\n return v;\n });\n }\n temp = style.strokeDasharray;\n if(!isNil(temp)) {\n if(Array.isArray(temp)) {\n res[STROKE_DASHARRAY] = temp.map(item => {\n let match = item.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n return match;\n }\n return [];\n });\n }\n else {\n let match = temp.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n res[STROKE_DASHARRAY] = [match];\n }\n else {\n res[STROKE_DASHARRAY] = [[]];\n }\n }\n }\n temp = style.filter;\n if(temp !== undefined) {\n let match = (temp || '').toString().match(/\\b[\\w-]+\\s*\\(\\s*[-+]?[\\d.]+\\s*[pxremvwhdg%]*\\s*\\)\\s*/ig);\n let f = null;\n if(match) {\n f = [];\n match.forEach(item => {\n let m2 = /([\\w-]+)\\s*\\(\\s*([-+]?[\\d.]+\\s*[pxremvwhdg%]*)\\s*\\)\\s*/i.exec(item);\n if(m2) {\n let k = m2[1].toLowerCase(), v = calUnit(m2[2]);\n if(k === 'blur') {\n if(v[0] <= 0 || [DEG, PERCENT].indexOf(v[1]) > -1) {\n return;\n }\n if(v[1] === NUMBER) {\n v[1] = PX;\n }\n f.push([k, v]);\n }\n else if(k === 'hue-rotate') {\n if([NUMBER, DEG].indexOf(v[1]) === -1) {\n return;\n }\n v[1] = DEG;\n f.push([k, v]);\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'grayscale' || k === 'contrast') {\n if([NUMBER, PERCENT].indexOf(v[1]) === -1) {\n return;\n }\n v[0] = Math.max(v[0], 0);\n v[1] = PERCENT;\n f.push([k, v]);\n }\n }\n });\n }\n res[FILTER] = f;\n }\n temp = style.visibility;\n if(temp) {\n if(temp === 'inherit') {\n res[VISIBILITY] = [0, INHERIT];\n }\n else {\n res[VISIBILITY] = [temp, STRING];\n }\n }\n temp = style.pointerEvents;\n if(temp) {\n if(temp === 'inherit') {\n res[POINTER_EVENTS] = [0, INHERIT];\n }\n else {\n res[POINTER_EVENTS] = [temp, STRING];\n }\n }\n temp = style.boxShadow;\n if(temp !== undefined) {\n let bs = null;\n let match = (temp || '').match(/([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*\\s*)?([-+]?[\\d.]+[pxremvwh%]*\\s*)?(((transparent)|(#[0-9a-f]{3,8})|(rgba?\\(.+?\\)))\\s*)?(inset|outset)?\\s*,?/ig);\n if(match) {\n match.forEach(item => {\n let boxShadow = /([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*\\s*)?([-+]?[\\d.]+[pxremvwh%]*\\s*)?(?:((?:transparent)|(?:#[0-9a-f]{3,8})|(?:rgba?\\(.+\\)))\\s*)?(inset|outset)?/i.exec(item);\n if(boxShadow) {\n bs = bs || [];\n let res = [];\n // v,h,blur,spread,color,inset\n for(let i = 0; i < 4; i++) {\n let v = calUnit(boxShadow[i + 1]);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n // x/y可以负,blur和spread不行\n if(i > 1 && v[0] < 0) {\n v = 0;\n }\n res.push(v);\n }\n res.push(rgba2int(boxShadow[5]));\n res.push(boxShadow[6] || 'outset');\n bs.push(res);\n }\n });\n }\n res[BOX_SHADOW] = bs;\n }\n // 直接赋值的string类型\n [\n 'position',\n 'display',\n 'flexDirection',\n 'flexWrap',\n 'justifyContent',\n 'alignItems',\n 'alignSelf',\n 'alignContent',\n 'overflow',\n 'mixBlendMode',\n 'borderTopStyle',\n 'borderRightStyle',\n 'borderBottomStyle',\n 'borderLeftStyle',\n 'backgroundClip',\n 'textOverflow',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[STYLE_KEY[style2Upper(k)]] = style[k];\n }\n });\n // 直接赋值的number类型\n [\n 'flexGrow',\n 'flexShrink',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[STYLE_KEY[style2Upper(k)]] = Math.max(parseFloat(style[k]) || 0, 0);\n }\n });\n temp = style.zIndex;\n if(!isNil(temp)) {\n res[Z_INDEX] = parseFloat(temp) || 0;\n }\n // 这些支持多个的用数组表示\n [\n 'backgroundRepeat',\n 'strokeLinecap',\n 'strokeLinejoin',\n 'strokeMiterlimit',\n 'fillRule',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n let v = style[k];\n res[STYLE_KEY[style2Upper(k)]] = Array.isArray(v) ? v : [v];\n }\n });\n GEOM_KEY_SET.forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[k] = style[k];\n }\n });\n return res;\n}\n\n/**\n * 第一次和REFLOW等级下,刷新前首先执行,生成computedStyle\n * 影响文字测量的只有字体和大小和重量,需要提前处理\n * 继承相关的计算\n * @param node 对象节点\n * @param isRoot 是否是根节点,无继承需使用默认值\n */\nfunction computeMeasure(node, isRoot) {\n let { currentStyle, computedStyle, domParent } = node;\n let parentComputedStyle = !isRoot && domParent.computedStyle;\n MEASURE_KEY_SET.forEach(k => {\n let v = currentStyle[k];\n // ff特殊处理\n if(k === FONT_FAMILY) {\n if(v[1] === INHERIT) {\n computedStyle[k] = getFontFamily(isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k]);\n }\n else {\n computedStyle[k] = getFontFamily(v[0]);\n }\n }\n else if(v[1] === INHERIT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k];\n }\n // 只有fontSize会有%\n else if(v[1] === PERCENT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (parentComputedStyle[k] * v[0] * 0.01);\n }\n else if(v[1] === REM) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.computedStyle[FONT_SIZE] * v[0]);\n }\n else if(v[1] === VW) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.width * 0.01 * v[0]);\n }\n else if(v[1] === VH) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.height * 0.01 * v[0]);\n }\n else {\n computedStyle[k] = v[0];\n }\n });\n}\n\n/**\n * 每次布局前需要计算的reflow相关的computedStyle\n * @param node 对象节点\n * @param isHost 是否是根节点或组件节点这种局部根节点,无继承需使用默认值\n */\nfunction computeReflow(node, isHost) {\n let { currentStyle, computedStyle, domParent: parent, root } = node;\n let rem = root.computedStyle[FONT_SIZE];\n let isRoot = !parent;\n let parentComputedStyle = parent && parent.computedStyle;\n [\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n ].forEach(k => {\n // border-width不支持百分比\n let item = currentStyle[k];\n if(item[1] === PX) {\n computedStyle[k] = item[0];\n }\n else if(item[1] === REM) {\n computedStyle[k] = item[0] * rem;\n }\n else if(item[1] === VW) {\n computedStyle[k] = item[0] * root.width * 0.01;\n }\n else if(item[1] === VH) {\n computedStyle[k] = item[0] * root.height * 0.01;\n }\n else {\n computedStyle[k] = 0;\n }\n });\n [\n POSITION,\n DISPLAY,\n FLEX_DIRECTION,\n JUSTIFY_CONTENT,\n ALIGN_ITEMS,\n ALIGN_SELF,\n FLEX_GROW,\n FLEX_SHRINK,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n let textAlign = currentStyle[TEXT_ALIGN];\n if(textAlign[1] === INHERIT) {\n computedStyle[TEXT_ALIGN] = isRoot ? 'left' : parentComputedStyle[TEXT_ALIGN];\n }\n else {\n computedStyle[TEXT_ALIGN] = textAlign[0];\n }\n let fontSize = computedStyle[FONT_SIZE];\n let lineHeight = currentStyle[LINE_HEIGHT];\n // lineHeight继承很特殊,数字和normal不同于普通单位\n if(lineHeight[1] === INHERIT) {\n if(isRoot) {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n else {\n let p = parent;\n let ph;\n while(p) {\n ph = p.currentStyle[LINE_HEIGHT];\n if(ph[1] !== INHERIT) {\n break;\n }\n p = p.domParent;\n }\n // 到root还是inherit或normal,或者中途遇到了normal,使用normal\n if([AUTO, INHERIT].indexOf(ph[1]) > -1) {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n // 数字继承\n else if(ph[1] === NUMBER) {\n computedStyle[LINE_HEIGHT] = Math.max(ph[0], 0) * fontSize;\n }\n // 单位继承\n else {\n computedStyle[LINE_HEIGHT] = parentComputedStyle[LINE_HEIGHT];\n }\n }\n }\n // 防止为0\n else if(lineHeight[1] === PX) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === PERCENT) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * fontSize * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === REM) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * rem, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VW) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.width * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VH) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.height * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === NUMBER) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) * fontSize || calNormalLineHeight(computedStyle);\n }\n // normal或auto\n else {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n let letterSpacing = currentStyle[LETTER_SPACING];\n if(letterSpacing[1] === INHERIT) {\n computedStyle[LETTER_SPACING] = isRoot ? 0 : parentComputedStyle[LETTER_SPACING];\n }\n else if(letterSpacing[1] === PERCENT) {\n computedStyle[LETTER_SPACING] = fontSize * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === REM) {\n computedStyle[LETTER_SPACING] = rem * letterSpacing[0];\n }\n else if(letterSpacing[1] === VW) {\n computedStyle[LETTER_SPACING] = root.width * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === VH) {\n computedStyle[LETTER_SPACING] = root.height * 0.01 * letterSpacing[0];\n }\n else {\n computedStyle[LETTER_SPACING] = letterSpacing[0];\n }\n //whiteSpace\n let whiteSpace = currentStyle[WHITE_SPACE];\n if(whiteSpace[1] === INHERIT) {\n computedStyle[WHITE_SPACE] = isRoot ? 'normal' : parentComputedStyle[WHITE_SPACE];\n }\n else {\n computedStyle[WHITE_SPACE] = whiteSpace[0];\n }\n}\n\nfunction setFontStyle(style) {\n let fontSize = style[FONT_SIZE];\n return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' '\n + fontSize + 'px/' + fontSize + 'px ' + (style[FONT_FAMILY] || 'arial');\n}\n\nfunction getFontFamily(str) {\n let ff = str.split(',');\n let f = 'arial';\n for(let i = 0, len = ff.length; i < len; i++) {\n if(font.support(ff[i])) {\n f = ff[i];\n break;\n }\n }\n return f;\n}\n\nfunction getBaseLine(style) {\n let fontSize = style[FONT_SIZE];\n let ff = getFontFamily(style[FONT_FAMILY]);\n let normal = fontSize * (font.info[ff] || font.info.arial).lhr;\n return (style[LINE_HEIGHT] - normal) * 0.5 + fontSize * (font.info[ff] || font.info.arial).blr;\n}\n\nfunction calNormalLineHeight(style) {\n let ff = getFontFamily(style[FONT_FAMILY]);\n return style[FONT_SIZE] * (font.info[ff] || font.info.arial).lhr;\n}\n\nfunction calRelativePercent(n, parent, k) {\n n *= 0.01;\n while(parent) {\n let style = parent.currentStyle[k];\n if(style[1] === AUTO) {\n if(k === WIDTH) {\n parent = parent.domParent;\n }\n else {\n break;\n }\n }\n else if(style[1] === PX) {\n return n * style[0];\n }\n else if(style[1] === PERCENT) {\n n *= style[0] * 0.01;\n parent = parent.domParent;\n }\n else if(style[1] === REM) {\n return n * style[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(style[1] === VW) {\n return n * style[0] * parent.root.width * 0.01;\n }\n else if(style[1] === VH) {\n return n * style[0] * parent.root.height * 0.01;\n }\n }\n return n;\n}\n\nfunction calRelative(currentStyle, k, v, parent, isWidth) {\n if(v[1] === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER].indexOf(v[1]) > -1) {\n v = v[0];\n }\n else if(v[1] === PERCENT) {\n if(isWidth) {\n v = calRelativePercent(v[0], parent, WIDTH);\n }\n else {\n v = calRelativePercent(v[0], parent, HEIGHT);\n }\n }\n else if(v[1] === REM) {\n v = v[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * parent.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * parent.root.height * 0.01;\n }\n return v;\n}\n\nfunction calAbsolute(currentStyle, k, v, size, root) {\n if(v[1] === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER, DEG, RGBA, STRING].indexOf(v[1]) > -1) {\n v = v[0];\n }\n else if(v[1] === PERCENT) {\n v = v[0] * size * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * root.height * 0.01;\n }\n return v;\n}\n\nfunction equalStyle(k, a, b, target) {\n if(!a || !b) {\n return a === b;\n }\n if(k === TRANSFORM) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let oa = a[i];\n let ob = b[i];\n if(oa[0] !== ob[0]) {\n return false;\n }\n // translate/matrix等都是数组\n if(!equalArr(oa[1], ob[1])) {\n return false;\n }\n }\n return true;\n }\n if(k === FILTER) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equalArr(a[i], b[i])) {\n return false;\n }\n }\n }\n if(k === BACKGROUND_SIZE) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let aa = a[i], bb = b[i];\n if(aa[0][0] !== bb[0][0] || aa[0][1] !== bb[0][1] || aa[1][0] !== bb[1][0] || aa[1][1] !== bb[1][1]) {\n return false;\n }\n }\n return true;\n }\n if(k === TRANSFORM_ORIGIN || RADIUS_HASH.hasOwnProperty(k)) {\n return a[0][0] === b[0][0] && a[0][1] === b[0][1]\n && a[1][0] === b[1][0] && a[1][1] === b[1][1];\n }\n if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y\n || LENGTH_HASH.hasOwnProperty(k) || EXPAND_HASH.hasOwnProperty(k)) {\n return a[0] === b[0] && a[1] === b[1];\n }\n if(k === BOX_SHADOW) {\n return equalArr(a, b);\n }\n if(COLOR_HASH.hasOwnProperty(k)) {\n return a[1] === b[1] && equalArr(a[0], b[0]);\n }\n if(GRADIENT_HASH.hasOwnProperty(k) && a.k === b.k && GRADIENT_TYPE.hasOwnProperty(a.k)) {\n let av = a.v;\n let bv = b.v;\n if(a.d !== b.d || av.length !== bv.length) {\n return false;\n }\n for(let i = 0, len = av.length; i < len; i++) {\n let ai = av[i];\n let bi = bv[i];\n if(ai.length !== bi.length) {\n return false;\n }\n for(let j = 0; j < 4; j++) {\n if(ai[0][j] !== bi[0][j]) {\n return false;\n }\n }\n if(ai.length > 1) {\n if(ai[1][0] !== bi[1][0] || ai[1][1] !== bi[1][1]) {\n return false;\n }\n }\n }\n return true;\n }\n // multi都是纯值数组,equalArr本身即递归,非multi根据类型判断\n if(isGeom(target.tagName, k) && (target.isMulti || Array.isArray(a) && Array.isArray(b))) {\n return equalArr(a, b);\n }\n return a === b;\n}\n\nfunction isRelativeOrAbsolute(node) {\n let position = node.currentStyle[POSITION];\n return position === 'relative' || position === 'absolute';\n}\n\nconst VALUE = {\n [POSITION]: true,\n [DISPLAY]: true,\n [STYLE_KEY.BACKGROUND_REPEAT]: true,\n [FLEX_DIRECTION]: true,\n [FLEX_GROW]: true,\n [FLEX_SHRINK]: true,\n [FLEX_WRAP]: true,\n [JUSTIFY_CONTENT]: true,\n [ALIGN_ITEMS]: true,\n [ALIGN_SELF]: true,\n [STYLE_KEY.OVERFLOW]: true,\n [STYLE_KEY.MIX_BLEND_MODE]: true,\n [STYLE_KEY.STROKE_LINECAP]: true,\n [STYLE_KEY.STROKE_LINEJOIN]: true,\n [STYLE_KEY.STROKE_MITERLIMIT]: true,\n [STYLE_KEY.FILL_RULE]: true,\n [OPACITY]: true,\n [Z_INDEX]: true,\n [BACKGROUND_CLIP]: true,\n [TEXT_OVERFLOW]: true,\n [LINE_CLAMP]: true,\n};\n// 仅1维数组\nconst ARRAY_0 = {\n [COLOR]: true,\n [TEXT_STROKE_COLOR]: true,\n [BACKGROUND_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_COLOR]: true,\n [STYLE_KEY.BORDER_RIGHT_COLOR]: true,\n [STYLE_KEY.BORDER_BOTTOM_COLOR]: true,\n [STYLE_KEY.BORDER_LEFT_COLOR]: true,\n};\n// 仅2维数组且只有2个值\nconst ARRAY_0_1 = {\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS]: true,\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS]: true,\n [TRANSFORM_ORIGIN]: true,\n [PERSPECTIVE_ORIGIN]: true,\n};\nfunction cloneStyle(style, keys) {\n if(!keys) {\n keys = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n }\n let res = {};\n for(let i = 0, len = keys.length; i < len; i++) {\n let k = keys[i];\n let v = style[k];\n // 渐变特殊处理\n if(k === BACKGROUND_IMAGE) {\n res[k] = v.map(item => {\n // 可能为null\n if(item && item.k) {\n return util.clone(item);\n }\n else {\n return item;\n }\n });\n }\n else if(k === FILL || k === STROKE) {\n res[k] = v.map(item => {\n // 渐变\n // 可能非法为空\n if(item && item.k) {\n return util.clone(item);\n }\n // 颜色\n else {\n return item.slice(0);\n }\n });\n }\n else if(k === TRANSFORM || k === FILTER) {\n if(v) {\n let n = v.slice(0);\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n n[i][1] = n[i][1].slice(0);\n }\n res[k] = n;\n }\n }\n else if(k === BOX_SHADOW) {\n if(v) {\n v = v.map(item => {\n let n = item.slice(0);\n n[4] = n[4].slice(0);\n return n;\n });\n res[k] = v;\n }\n }\n else if(k === TRANSLATE_PATH) {\n if(v) {\n res[k] = v.map(item => item.slice(0));\n }\n }\n // position等直接值类型赋值\n else if(VALUE.hasOwnProperty(k)) {\n res[k] = v;\n }\n // geom自定义属性\n else if(GEOM.hasOwnProperty(k)) {\n res[k] = util.clone(v);\n }\n // 其余皆是数组或空,默认是一维数组只需slice即可\n else if(v) {\n let n = res[k] = v.slice(0);\n // 特殊引用里数组某项再次clone\n if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n }\n }\n else if(k === BACKGROUND_SIZE) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n n[i][0] = n[i][0].slice(0);\n n[i][1] = n[i][1].slice(0);\n }\n }\n else if(ARRAY_0.hasOwnProperty(k)) {\n n[0] = n[0].slice(0);\n }\n else if(ARRAY_0_1.hasOwnProperty(k)) {\n n[0] = n[0].slice(0);\n n[1] = n[1].slice(0);\n }\n else if(k === TRANSFORM) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n }\n }\n else if(k === ROTATE_3D) {\n n[3] = n[3].slice(0);\n }\n }\n }\n return res;\n}\n\nexport default {\n normalize,\n computeMeasure,\n computeReflow,\n setFontStyle,\n getFontFamily,\n getBaseLine,\n calRelative,\n calAbsolute,\n equalStyle,\n isRelativeOrAbsolute,\n cloneStyle,\n};\n","import mode from './mode';\nimport css from '../style/css';\nimport enums from '../util/enums';\nimport util from '../util/util';\n\nconst { STYLE_KEY: {\n COLOR,\n FONT_WEIGHT,\n FONT_FAMILY,\n FONT_SIZE,\n FONT_STYLE,\n LETTER_SPACING,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_WIDTH,\n TEXT_STROKE_OVER,\n} } = enums;\n\n/**\n * 表示一行文本的类,保存它的位置、内容、从属信息,在布局阶段生成,并在渲染阶段被Text调用render()\n * 关系上直属于Text类,一个Text类可能因为换行原因导致有多个TextBox,一行内容中也可能有不同Text从而不同TextBox\n * 另外本类还会被LineBoxManager添加到LineBox里,LineBox为一行中的inline/文本组合,之间需要进行垂直对齐\n * 在textOverflow为ellipsis时,可能会收到后面节点的向前回退(后面不足放下…),使得省略号发生在本节点\n */\nclass TextBox {\n constructor(parent, index, x, y, w, h, content, wList) {\n this.__parent = parent;\n this.__index = index;\n this.__x = x;\n this.__y = y;\n this.__width = w;\n this.__height = h;\n this.__content = content;\n this.__wList = wList;\n this.__virtualDom = {};\n }\n\n /**\n * 渲染阶段被Text类调用,多行Text会有多个TextBox,内容被分拆开\n * @param renderMode\n * @param ctx\n * @param computedStyle\n * @param cacheStyle Text父节点Dom的缓存样式,相比computedStyle可以直接用,比如color被缓存为style字符串\n * @param dx\n * @param dy\n */\n render(renderMode, ctx, computedStyle, cacheStyle, dx, dy) {\n let { content, x, y, parent, wList, width } = this;\n let { ox, oy } = parent;\n y += css.getBaseLine(computedStyle);\n x += ox + dx;\n y += oy + dy;\n this.__endX = x + width;\n this.__endY = y;\n let {\n [LETTER_SPACING]: letterSpacing,\n [TEXT_STROKE_WIDTH]: textStrokeWidth,\n [TEXT_STROKE_COLOR]: textStrokeColor,\n } = computedStyle;\n let i = 0, length = content.length;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n let overFill = computedStyle[TEXT_STROKE_OVER] === 'fill';\n if(letterSpacing) {\n for(; i < length; i++) {\n if(overFill) {\n ctx.fillText(content.charAt(i), x, y);\n }\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n ctx.strokeText(content.charAt(i), x, y);\n }\n if(!overFill) {\n ctx.fillText(content.charAt(i), x, y);\n }\n x += wList[i] + letterSpacing;\n }\n }\n else {\n if(overFill) {\n ctx.fillText(content, x, y);\n }\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n ctx.strokeText(content, x, y);\n }\n if(!overFill) {\n ctx.fillText(content, x, y);\n }\n }\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['x', x],\n ['y', y],\n ['fill', cacheStyle[COLOR]],\n ['font-family', computedStyle[FONT_FAMILY]],\n ['font-weight', computedStyle[FONT_WEIGHT]],\n ['font-style', computedStyle[FONT_STYLE]],\n ['font-size', computedStyle[FONT_SIZE] + 'px'],\n ];\n // svg无法定义stroke的over\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n props.push(['stroke', cacheStyle[TEXT_STROKE_COLOR]]);\n props.push(['stroke-width', computedStyle[TEXT_STROKE_WIDTH]]);\n }\n if(letterSpacing) {\n props.push(['letter-spacing', letterSpacing]);\n }\n this.__virtualDom = {\n type: 'item',\n tagName: 'text',\n props,\n content: util.encodeHtml(content),\n };\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endX() {\n return this.__endX;\n }\n\n get endY() {\n return this.__endY;\n }\n\n get width() {\n return this.__width;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get content() {\n return this.__content;\n }\n\n get baseLine() {\n return this.parent.baseLine;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get parentLineBox() {\n return this.__parentLineBox;\n }\n\n get wList() {\n return this.__wList;\n }\n}\n\nexport default TextBox;\n","import inject from '../util/inject';\n\nlet SIZE = [8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192];\nlet NUMBER = [128, 64, 32, 16, 8, 4, 2, 1, 1, 1, 1];\nlet MAX = SIZE[SIZE.length - 1];\nconst HASH_CANVAS = {};\n\nlet uuid = 0;\n\nclass Page {\n constructor(size, number) {\n this.__size = size;\n this.__number = number;\n this.__free = this.__total = number * number;\n size *= number;\n this.__width = size;\n this.__height = size;\n let offscreen = this.__canvas = inject.getCacheCanvas(size, size, null, number);\n if(offscreen) {\n this.__offscreen = offscreen;\n }\n // 1/0标识n*n个单元格是否空闲可用,一维数组表示\n this.__grid = [];\n for(let i = 0; i < this.__total; i++) {\n this.__grid.push(1);\n }\n this.__uuid = uuid++;\n // webgl贴图缓存使用,一旦更新则标识记录,绑定某号纹理单元查看变化才更新贴图\n this.__update = false;\n this.time = 0;\n }\n\n add() {\n let { number, grid } = this;\n for(let i = 0; i < number; i++) {\n for(let j = 0; j < number; j++) {\n let index = i * number + j;\n if(grid[index]) {\n grid[index] = 0;\n this.__free--;\n return index;\n }\n }\n }\n // 理论不可能进入,除非bug\n throw new Error('Can not find free page');\n }\n\n del(pos) {\n if(!this.grid[pos]) {\n this.grid[pos] = 1;\n this.__free++;\n }\n }\n\n getCoords(pos) {\n let { size, number } = this;\n let x = pos % number;\n let y = Math.floor(pos / number);\n return [x * size, y * size];\n }\n\n get uuid() {\n return this.__uuid;\n }\n\n get size() {\n return this.__size;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get number() {\n return this.__number;\n }\n\n get total() {\n return this.__total;\n }\n\n get free() {\n return this.__free;\n }\n\n get grid() {\n return this.__grid;\n }\n\n get offscreen() {\n return this.__offscreen;\n }\n\n get canvas() {\n return this.offscreen.canvas;\n }\n\n get ctx() {\n return this.offscreen.ctx;\n }\n\n get update() {\n return this.__update;\n }\n\n set update(v) {\n this.__update = v;\n }\n\n static getInstance(size) {\n if(size > MAX) {\n return;\n }\n let s = SIZE[0];\n let n = NUMBER[0];\n // 使用刚好满足的尺寸\n for(let i = 0, len = SIZE.length; i < len; i++) {\n s = SIZE[i];\n n = NUMBER[i];\n if(SIZE[i] >= size) {\n break;\n }\n }\n let list = HASH_CANVAS[s] = HASH_CANVAS[s] || [];\n // 从hash列表中尝试取可用的一页,找不到就生成新的页\n let page;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item.free) {\n page = item;\n break;\n }\n }\n if(!page) {\n page = new Page(s, n);\n if(!page.offscreen) {\n inject.error('Can not create off-screen for page');\n return;\n }\n list.push(page);\n }\n let pos = page.add();\n return { page, pos };\n }\n\n static set CONFIG(v) {\n if(!v || !Array.isArray(v.SIZE) || !Array.isArray(v.NUMBER)) {\n return;\n }\n SIZE = v.SIZE;\n NUMBER = v.NUMBER;\n MAX = SIZE[SIZE.length - 1];\n }\n\n static get CONFIG() {\n return {\n SIZE,\n NUMBER,\n };\n }\n\n static get MAX() {\n return MAX;\n }\n\n static genUuid() {\n return uuid++;\n }\n}\n\nexport default Page;\n","import matrix from './matrix';\nimport geom from './geom';\n\n// 一条边相对于自己开始点的x向量角度,即从x到此边旋转,0~180和-180~0,需要判断象限\nfunction calDeg(x1, y1, x2, y2) {\n let dx = x2 - x1;\n let dy = y2 - y1;\n let atan = Math.atan(Math.abs(dy) / Math.abs(dx));\n // 2象限\n if(dx < 0 && dy >= 0) {\n return Math.PI - atan;\n }\n // 3象限\n if(dx < 0 && dy < 0) {\n return atan - Math.PI;\n }\n // 1象限\n if(dx >= 0 && dy >= 0) {\n return atan;\n }\n // 4象限,顺时针正好\n return -atan;\n}\n\nfunction rotate(theta) {\n let sin = Math.sin(theta);\n let cos = Math.cos(theta);\n let t = matrix.identity();\n t[0] = t[5] = cos;\n t[1] = sin;\n t[4] = -sin;\n return t;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param points\n */\nfunction pointIndex(points) {\n let [x1, y1, x2, y2, x3, y3] = points;\n let index = [0, 1, 2];\n // 将a点放入最左\n if(x2 < x1 && x2 < x3) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n index[0] = 1;\n index[1] = 0;\n }\n else if(x3 < x2 && x3 < x1) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n index[0] = 2;\n index[2] = 0;\n }\n // 有可能出现2个并列的情况,判断取上面那个\n if(x1 === x2) {\n if(y1 > y2) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n let t = index[0];\n index[0] = index[1];\n index[1] = t;\n }\n }\n else if(x1 === x3) {\n if(y1 > y3) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n let t = index[0];\n index[0] = index[2];\n index[2] = t;\n }\n }\n // ab到ac要顺时针旋转,即2个向量夹角为正,用向量叉乘判断正负\n let cross = (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1);\n if(cross < 0) {\n [x2, y2, x3, y3] = [x3, y3, x2, y2];\n let t = index[1];\n index[1] = index[2];\n index[2] = t;\n }\n return [x1, y1, x2, y2, x3, y3, index];\n}\n\n/**\n * 第2个点根据第一个点的交换顺序交换\n * @param points\n * @param index\n * @returns {[]}\n */\nfunction pointByIndex(points, index) {\n let res = [];\n for(let i = 0, len = index.length; i < len; i++) {\n let j = index[i];\n res.push(points[j * 2]);\n res.push(points[j * 2 + 1]);\n }\n return res;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param source 源3个点\n * @param target 目标3个点\n * @returns 交换顺序后的点坐标\n */\nfunction exchangeOrder(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3, index] = pointIndex(source);\n let [tx1, ty1, tx2, ty2, tx3, ty3] = pointByIndex(target, index);\n return [\n [sx1, sy1, sx2, sy2, sx3, sy3],\n [tx1, ty1, tx2, ty2, tx3, ty3]\n ];\n}\n\n/**\n * 存在一种情况,变换结果使得三角形镜像相反了,即顶点a越过bc线,判断是否溢出\n * @param source\n * @param target\n * @returns {boolean}是否溢出\n */\nfunction isOverflow(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n let cross1 = (sx2 - sx1) * (sy3 - sy1) - (sx3 - sx1) * (sy2 - sy1);\n let cross2 = (tx2 - tx1) * (ty3 - ty1) - (tx3 - tx1) * (ty2 - ty1);\n return cross1 > 0 && cross2 < 0 || cross1 < 0 && cross2 > 0;\n}\n\nfunction transform(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n // 记录翻转\n let overflow = isOverflow(source, target);\n // 第0步,将源三角第1个a点移到原点\n let m = matrix.identity();\n m[12] = -sx1;\n m[13] = -sy1;\n let t;\n // 第1步,以第1条边ab为基准,将其贴合x轴上,为后续倾斜不干扰做准备\n let theta = calDeg(sx1, sy1, sx2, sy2);\n if(theta !== 0) {\n t = rotate(-theta);\n m = matrix.multiply(t, m);\n }\n // 第2步,以第1条边AB为基准,缩放x轴ab至目标相同长度,可与4步合并\n let ls = geom.pointsDistance(sx1, sy1, sx2, sy2);\n let lt = geom.pointsDistance(tx1, ty1, tx2, ty2);\n // if(ls !== lt) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[0] = scale;\n // m = matrix.multiply(t, m);\n // }\n // 第3步,缩放y,先将目标三角形旋转到x轴平行,再变换坐标计算\n let n = matrix.identity();\n n[12] = -tx1;\n n[13] = -ty1;\n theta = calDeg(tx1, ty1, tx2, ty2);\n // 记录下这个旋转角度,后面源三角形要反向旋转\n let alpha = theta;\n if(theta !== 0) {\n t = rotate(-theta);\n n = matrix.multiply(t, n);\n }\n // 目标三角反向旋转至x轴后的坐标\n // 源三角目前的第3点坐标y值即为长度,因为a点在原点0无需减去\n let ls2 = Math.abs(matrix.calPoint([sx3, sy3], m)[1]);\n let lt2 = Math.abs(matrix.calPoint([tx3, ty3], n)[1]);\n // 缩放y\n // if(ls2 !== lt2) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[3] = scale;\n // m = matrix.multiply(t, m);\n // }\n if(ls !== lt || ls2 !== lt2) {\n t = matrix.identity();\n if(ls !== lt) {\n t[0] = lt / ls;\n }\n if(ls2 !== lt2) {\n t[5] = lt2 / ls2;\n }\n m = matrix.multiply(t, m);\n }\n // 第4步,x轴倾斜,用余弦定理求目前a和A的夹角\n n = m;\n let [ax1, ay1] = matrix.calPoint([sx1, sy1], n);\n let [ax2, ay2] = matrix.calPoint([sx2, sy2], n);\n let [ax3, ay3] = matrix.calPoint([sx3, sy3], n);\n let ab = geom.pointsDistance(ax1, ay1, ax2, ay2);\n let ac = geom.pointsDistance(ax1, ay1, ax3, ay3);\n let bc = geom.pointsDistance(ax3, ay3, ax2, ay2);\n let AB = geom.pointsDistance(tx1, ty1, tx2, ty2);\n let AC = geom.pointsDistance(tx1, ty1, tx3, ty3);\n let BC = geom.pointsDistance(tx3, ty3, tx2, ty2);\n let a = geom.angleBySide(bc, ab, ac);\n let A = geom.angleBySide(BC, AB, AC);\n // 先至90°,再旋转至目标角,可以合并成tan相加,不知道为什么不能直接tan倾斜差值角度\n if(a !== A) {\n t = matrix.identity();\n t[4] = Math.tan(a - Math.PI * 0.5) + Math.tan(Math.PI * 0.5 - A);\n m = matrix.multiply(t, m);\n }\n // 发生翻转时特殊处理按x轴垂直翻转\n if(overflow) {\n m[1] = -m[1];\n m[5] = -m[5];\n m[13] = -m[13];\n }\n // 第5步,再次旋转,角度为目标旋转到x轴的负值,可与下步合并\n if(alpha !== 0) {\n t = rotate(alpha);\n // m = matrix.multiply(t, m);\n }\n else {\n t = matrix.identity();\n }\n // 第6步,移动第一个点的差值\n // t = matrix.identity();\n t[12] = tx1;\n t[13] = ty1;\n return matrix.multiply(t, m);\n}\n\nexport default {\n exchangeOrder,\n isOverflow,\n transform,\n};\n","/**\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 } = unit;\nconst { matrix, geom } = math;\nconst { identity, multiply, isE } = matrix;\nconst { d2r } = geom;\n\nfunction calSingle(t, k, v) {\n if(k === TRANSLATE_X) {\n t[12] = v;\n }\n else if(k === TRANSLATE_Y) {\n t[13] = v;\n }\n else if(k === TRANSLATE_Z) {\n t[14] = v;\n }\n else if(k === SCALE_X) {\n t[0] = v;\n }\n else if(k === SCALE_Y) {\n t[5] = v;\n }\n else if(k === SCALE_Z) {\n t[10] = v;\n }\n else if(k === SKEW_X) {\n v = d2r(v);\n t[4] = Math.tan(v);\n }\n else if(k === SKEW_Y) {\n v = d2r(v);\n t[1] = Math.tan(v);\n }\n else if(k === ROTATE_X) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[5] = t[10] = cos;\n t[6] = sin;\n t[9] = -sin;\n }\n else if(k === ROTATE_Y) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[10] = cos;\n t[8] = sin;\n t[2] = -sin;\n }\n else if(k === ROTATE_Z) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[5] = cos;\n t[1] = sin;\n t[4] = -sin;\n }\n else if(k === ROTATE_3D) {\n let [x, y, z, r] = v;\n r = d2r(r[0]);\n let s = Math.sin(r);\n let c = Math.cos(r);\n if(x && !y && !z) {\n if(x < 0) {\n s = -s;\n }\n t[5] = c;\n t[9] = -s;\n t[6] = s;\n t[10] = c;\n }\n else if(y && !x && !z) {\n if(y < 0) {\n s = -s;\n }\n t[0] = c;\n t[8] = s;\n t[2] = -s;\n t[10] = c;\n }\n else if(z && !x && !y) {\n if(z < 0) {\n s = -s;\n }\n t[0] = c;\n t[4] = -s;\n t[1] = s;\n t[5] = c;\n }\n else {\n let len = Math.sqrt(x * x + y * y + z * z);\n if(len !== 1) {\n let rlen = 1 / len;\n x *= rlen;\n y *= rlen;\n z *= rlen;\n }\n let nc = 1 - c;\n let xy = x * y;\n let yz = y * z;\n let zx = z * x;\n let xs = x * s;\n let ys = y * s;\n let zs = z * s;\n\n t[0] = x * x * nc + c;\n t[1] = xy * nc + zs;\n t[2] = zx * nc - ys;\n t[3] = 0;\n\n t[4] = xy * nc - zs;\n t[5] = y * y * nc + c;\n t[6] = yz * nc + xs;\n t[7] = 0;\n\n t[8] = zx * nc + ys;\n t[9] = yz * nc - xs;\n t[10] = z * z * nc + c;\n t[11] = 0;\n\n t[12] = 0;\n t[13] = 0;\n t[14] = 0;\n t[15] = 1;\n }\n }\n else if(k === PERSPECTIVE && v > 0) {\n v = Math.max(v, 1);\n t[11] = -1 / v;\n }\n else if(k === MATRIX) {\n util.assignMatrix(t, v);\n }\n}\n\nfunction calMatrix(transform, ow, oh, root) {\n let list = normalize(transform, ow, oh, root);\n let m = identity();\n list.forEach(item => {\n let [k, v] = item;\n let t = identity();\n calSingle(t, k, v);\n m = multiply(m, t);\n });\n return m;\n}\n\n// 已有计算好的变换矩阵,根据tfo原点计算最终的matrix\nfunction calMatrixByOrigin(m, transformOrigin) {\n let [ox, oy] = transformOrigin;\n let res = m.slice(0);\n if(ox === 0 && oy === 0 || isE(m)) {\n return res;\n }\n res = multiply([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ox, oy, 0, 1], res);\n res = multiply(res, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -ox, -oy, 0, 1]);\n return res;\n}\n\n// img缩放svg下专用,无rem\nfunction calMatrixWithOrigin(transform, transformOrigin, ow, oh) {\n let m = calMatrix(transform, ow, oh);\n return calMatrixByOrigin(m, transformOrigin);\n}\n\nfunction normalizeSingle(k, v, ow, oh, root) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n if(v[1] === PERCENT) {\n return v[0] * ow * 0.01;\n }\n else if(v[1] === REM) {\n return v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n return v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n return v[0] * root.height * 0.01;\n }\n }\n else if(k === TRANSLATE_Y) {\n if(v[1] === PERCENT) {\n return v[0] * oh * 0.01;\n }\n else if(v[1] === REM) {\n return v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n return v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n return v[0] * root.height * 0.01;\n }\n }\n else if(k === MATRIX) {\n return v;\n }\n else if(k === ROTATE_3D) {\n return v;\n }\n return v[0];\n}\n\nfunction normalize(transform, ow, oh, root) {\n let res = [];\n transform.forEach(item => {\n let [k, v] = item;\n res.push([k, normalizeSingle(k, v, ow, oh, root)]);\n });\n return res;\n}\n\nfunction calOrigin(transformOrigin, w, h, root) {\n let tfo = [];\n transformOrigin.forEach((item, i) => {\n if(item[1] === PX) {\n tfo.push(item[0]);\n }\n else if(item[1] === PERCENT) {\n tfo.push(item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n tfo.push(item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n tfo.push(item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n tfo.push(item[0] * root.height * 0.01);\n }\n });\n return tfo;\n}\n\nfunction calMatrixByPerspective(m, pm) {\n if(!isE(pm)) {\n m = multiply(pm, m);\n }\n return m;\n}\n\nfunction calPerspectiveMatrix(ppt, po) {\n if(ppt && ppt > 0) {\n let res = identity();\n ppt = Math.max(ppt, 1);\n res[11] = -1 / ppt;\n let [ox, oy] = po;\n if(ox || oy) {\n res = multiply([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ox, oy, 0, 1], res);\n res = multiply(res, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -ox, -oy, 0, 1]);\n }\n return res;\n }\n}\n\n// 是否有透视矩阵应用\nfunction isPerspectiveMatrix(m) {\n if(!m) {\n return;\n }\n return !!(m[3] || m[7] || m[11]);\n}\n\nexport default {\n calMatrix,\n calOrigin,\n calMatrixByPerspective,\n calPerspectiveMatrix,\n calMatrixByOrigin,\n calMatrixWithOrigin,\n isPerspectiveMatrix,\n};\n","/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据模糊参数sigma求卷积核尺寸\n * @param sigma\n * @returns {number}\n */\nfunction kernelSize(sigma) {\n if(sigma <= 0) {\n return 0;\n }\n let d = Math.floor(sigma * 3 * Math.sqrt(2 * Math.PI) / 4 + 0.5);\n if(d < 2) {\n d = 2;\n }\n if(d % 2 === 0) {\n d++;\n }\n return d;\n}\n\n/**\n * 根据sigma求模糊扩展尺寸,卷积核求得后为d,再求半径/2,然后因为算法要执行3次,所以*3\n * 比如本来d为5,半径2.5算上自身像素点则各方向扩展2,*3则扩展6\n * @param sigma\n * @returns {number}\n */\nfunction outerSize(sigma) {\n let d = kernelSize(sigma);\n return outerSizeByD(d);\n}\n\nfunction outerSizeByD(d) {\n return Math.floor(d * 0.5) * 3;\n}\n\n/**\n * 一维高斯正态分布,根据标准差和卷积核尺寸返回一维权重数组\n * @param sigma\n * @param d\n */\nfunction gaussianWeight(sigma, d) {\n let list = [];\n let len = Math.floor(d * 0.5);\n let total = 0;\n for(let i = len; i >= 0; i--) {\n let n = Math.pow(Math.E, -Math.pow(i, 2) / (2 * Math.pow(sigma, 2)))\n / (sigma * Math.sqrt(2 * Math.PI));\n list.push(n);\n total += n;\n }\n for(let i = 1; i <= len; i++) {\n let n = Math.pow(Math.E, -Math.pow(i, 2) / (2 * Math.pow(sigma, 2)))\n / (sigma * Math.sqrt(2 * Math.PI));\n list.push(n);\n total += n;\n }\n if(total !== 1) {\n for(let i = 0; i < d; i++) {\n list[i] /= total;\n }\n }\n return list;\n}\n\nexport default {\n kernelSize,\n outerSize,\n outerSizeByD,\n gaussianWeight,\n};\n","import Page from './Page';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport enums from '../util/enums';\nimport painter from '../util/painter';\nimport debug from '../util/debug';\nimport tf from '../style/transform';\nimport mx from '../math/matrix';\nimport blur from '../math/blur';\n\nconst {\n STYLE_KEY: {\n TRANSFORM_ORIGIN,\n TRANSFORM,\n DISPLAY,\n VISIBILITY,\n },\n NODE_KEY: {\n NODE_OPACITY,\n NODE_CACHE_TOTAL,\n NODE_CACHE_FILTER,\n NODE_CACHE_OVERFLOW,\n NODE_HAS_CONTENT,\n NODE_COMPUTED_STYLE,\n },\n} = enums;\n\n// 根据一个共享cache的信息,生成一个独立的离屏canvas,一般是filter,mask用\nfunction genSingle(cache, message) {\n let { size, sx1, sy1, width, height, bbox } = cache;\n let offscreen = inject.getCacheCanvas(width, height, null, message);\n offscreen.x = 0;\n offscreen.y = 0;\n offscreen.bbox = bbox;\n offscreen.size = size;\n offscreen.sx1 = sx1;\n offscreen.sy1 = sy1;\n offscreen.dx = cache.dx;\n offscreen.dy = cache.dy;\n offscreen.dbx = cache.dbx;\n offscreen.dby = cache.dby;\n offscreen.width = width;\n offscreen.height = height;\n return offscreen;\n}\n\nclass Cache {\n constructor(w, h, bbox, page, pos, x1, y1) {\n this.__init(w, h, bbox, page, pos, x1, y1);\n }\n\n __init(w, h, bbox, page, pos, x1, y1) {\n this.__width = w;\n this.__height = h;\n this.__bbox = bbox;\n this.__page = page;\n this.__pos = pos;\n let [x, y] = page.getCoords(pos);\n this.__x = x;\n this.__y = y;\n this.__appendData(x1, y1);\n 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 },\n NODE_KEY: {\n NODE_CACHE,\n NODE_LIMIT_CACHE,\n NODE_DOM_PARENT,\n NODE_MATRIX_EVENT,\n NODE_OPACITY,\n NODE_VIRTUAL_DOM,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_MEASURE,\n UPDATE_FOCUS,\n UPDATE_CONFIG,\n },\n} = enums;\n\nconst ELLIPSIS = textCache.ELLIPSIS;\nconst { AUTO, REM, VW, VH } = unit;\n\nclass Text extends Node {\n constructor(content) {\n super();\n this.__content = util.isNil(content) ? '' : content.toString();\n this.__textBoxes = [];\n this.__charWidthList = [];\n this.__charWidth = 0;\n this.__textWidth = 0;\n }\n\n /**\n * 预先计算每个字的宽度,在每次布局渲染前做\n * @param renderMode\n * @param ctx\n * @private\n */\n __computeMeasure(renderMode, ctx) {\n let { content, computedStyle, charWidthList } = this;\n // 每次都要清空重新计算,计算会有缓存\n charWidthList.splice(0);\n let ffs = computedStyle[FONT_FAMILY].split(',');\n let ff = 'arial';\n for(let i = 0, len = ffs.length; i < len; i++) {\n if(inject.checkSupportFontFamily(ffs[i])) {\n ff = ffs[i];\n break;\n }\n }\n this.__ff = ff;\n let fs = computedStyle[FONT_SIZE];\n let fw = computedStyle[FONT_WEIGHT];\n let key = this.__key = computedStyle[FONT_SIZE] + ',' + ff + ',' + fw;\n let wait = textCache.data[key] = textCache.data[key] || {\n ff,\n fs,\n fw,\n hash: {},\n s: '',\n };\n let cache = textCache.charWidth[key] = textCache.charWidth[key] || {};\n let sum = 0;\n let needMeasure = false;\n // text-overflow:ellipse需要,即便没有也要先测量,其基于最近非inline父节点的字体\n let bp = this.domParent;\n while(bp.currentStyle[DISPLAY] === 'inline') {\n bp = bp.domParent;\n }\n this.__bp = bp;\n let parentComputedStyle = bp.computedStyle;\n let pff = 'arial';\n for(let i = 0, pffs = parentComputedStyle[FONT_FAMILY].split(','), len = pffs.length; i < len; i++) {\n if(inject.checkSupportFontFamily(pffs[i])) {\n ff = ffs[i];\n break;\n }\n }\n let pfs = parentComputedStyle[FONT_SIZE];\n let pfw = parentComputedStyle[FONT_WEIGHT];\n let pKey = this.__pKey = pfs + ',' + pff + ',' + pfw;\n let parentCache = textCache.charWidth[pKey] = textCache.charWidth[pKey] || {};\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(renderMode === mode.WEBGL) {\n ctx = inject.getCacheCanvas(16, 16, '__$$CHECK_SUPPORT_FONT_FAMILY$$__').ctx;\n }\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n ctx.font = css.setFontStyle(parentComputedStyle);\n parentCache[ELLIPSIS] = ctx.measureText(ELLIPSIS).width;\n }\n ctx.font = css.setFontStyle(computedStyle);\n }\n else if(renderMode === mode.SVG) {\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n parentCache[ELLIPSIS] = 0;\n let wait = textCache.data[pKey] = textCache.data[pKey] || {\n ff: pff,\n fs: pfs,\n fw: pfw,\n hash: {},\n s: '',\n };\n wait.s += ELLIPSIS;\n needMeasure = true;\n }\n }\n // 逐字测量,canvas可瞬间得到信息,svg先预存统一进行\n for(let i = 0, length = content.length; i < length; i++) {\n let char = content.charAt(i);\n let mw;\n if(cache.hasOwnProperty(char)) {\n mw = cache[char];\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n mw = cache[char] = ctx.measureText(char).width;\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else {\n if(!wait.hash.hasOwnProperty(char)) {\n wait.s += char;\n }\n wait.hash[char] = true;\n // 先预存标识位-1,测量完后替换它\n charWidthList.push(-1);\n needMeasure = true;\n }\n }\n this.__textWidth = sum;\n if(needMeasure) {\n textCache.list.push(this);\n }\n }\n\n __measureCb() {\n let { content, charWidthList } = this;\n let key = this.__key;\n let cache = textCache.charWidth[key];\n let sum = 0;\n for(let i = 0, len = charWidthList.length; i < len; i++) {\n if(charWidthList[i] < 0) {\n let mw = charWidthList[i] = cache[content.charAt(i)];\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n }\n this.__textWidth = sum;\n }\n\n /**\n * text在virtual时和普通一样,无需特殊处理\n * endSpace由外界inline布局控制,末尾最后一行的空白mpb,包含递归情况,递归为多个嵌套末尾节点的空白mpb之和\n * 即便宽度不足,每行还是强制渲染一个字符,换行依据lx开始,因为x可能是从中间开始的,非inline则两个相等\n * 最后一个字符排版时要考虑末尾mpb,排不下的话回退删掉这个字符,如果最后一个字符另起开头,排不下也强制排,每行至少1个字符\n * 在textOverflow时很特殊,多个inline同行,回退可能到前一个inline节点,这个通过x和lx判断是否行首,决定至少1个字符规则\n * @param data\n * @private\n */\n __layout(data) {\n let __cache = this.__config[NODE_CACHE];\n if(__cache) {\n __cache.release();\n }\n let { x, y, w, lx = x, lineBoxManager, endSpace = 0, lineClamp = 0, lineClampCount = 0 } = data;\n this.__x = this.__sx1 = x;\n this.__y = this.__sy1 = y;\n let { isDestroyed, content, currentStyle, computedStyle, textBoxes, charWidthList, root, __ff, __key } = this;\n textBoxes.splice(0);\n let __config = this.__config;\n __config[NODE_LIMIT_CACHE] = false;\n // 空内容w/h都为0可以提前跳出\n if(isDestroyed || currentStyle[DISPLAY] === 'none' || !content) {\n return lineClampCount;\n }\n this.__ox = this.__oy = 0;\n // 顺序尝试分割字符串为TextBox,形成多行,begin为每行起始索引,i是当前字符索引\n let begin = 0;\n let i = 0;\n let beginSpace = x - lx; // x>=lx,当第一行非起始处时前面被prev节点占据,这个差值可认为是count宽度\n let count = beginSpace;\n let length = content.length;\n let maxW = 0;\n let {\n [LINE_HEIGHT]: lineHeight,\n [LETTER_SPACING]: letterSpacing,\n [WHITE_SPACE]: whiteSpace,\n [FONT_SIZE]: fontSize,\n [FONT_WEIGHT]: fontWeight,\n } = computedStyle;\n // 特殊字体中特殊字符连续时需减少一定的padding量\n let padding = font.info[__ff].padding;\n let needReduce = !!padding;\n let lastChar;\n let ew = textCache.charWidth[this.__pKey][ELLIPSIS];\n let lineCount = 0;\n // 不换行特殊对待,同时考虑overflow和textOverflow\n if(whiteSpace === 'nowrap') {\n let isTextOverflow;\n // block的overflow:hidden和textOverflow:clip/ellipsis才生效,inline要看最近非inline父元素\n let bp = this.__bp;\n let {\n [DISPLAY]: display,\n [OVERFLOW]: overflow,\n [WIDTH]: width,\n [TEXT_OVERFLOW]: textOverflow,\n } = bp.currentStyle;\n // 只要是overflow隐藏,不管textOverflow如何(默认是clip等同于overflow:hidden的功能)都截取\n if(overflow === 'hidden') {\n while(i < length) {\n count += charWidthList[i] + letterSpacing;\n if(count > w) {\n // block/flex无需宽度,inline-block需要设置宽度才生效\n if(display === 'block' || display === 'flex') {\n isTextOverflow = true;\n }\n else if(width[1] !== AUTO) {\n isTextOverflow = true;\n }\n break;\n }\n i++;\n }\n }\n else {\n while(i < length) {\n count += charWidthList[i++] + letterSpacing;\n }\n }\n // ellipsis生效情况,本节点开始向前回退查找,尝试放下一部分字符\n if(isTextOverflow && textOverflow === 'ellipsis') {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n }\n // 默认clip跟随overflow:hidden,无需感知\n else {\n let textBox = new TextBox(this, textBoxes.length, x, y, count - beginSpace, lineHeight,\n content, charWidthList);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n maxW = count - beginSpace;\n y += lineHeight;\n }\n }\n // 普通换行,注意x和lx的区别,可能相同(block起始处)可能不同(非起始处),第1行从x开始,第2行及以后都从lx开始\n // 然后第一次换行还有特殊之处,可能同一行前半部行高很大,此时y增加并非自身的lineHeight,而是整体LineBox的\n else {\n while(i < length) {\n let cw = charWidthList[i] + letterSpacing;\n count += cw;\n // 连续字符减少padding,除了连续还需判断char是否在padding的hash中\n if(needReduce) {\n let char = content[i];\n if(char === lastChar && padding.hasOwnProperty(char) && padding[char]) {\n let hasCache, p = textCache.padding[__key] = textCache.padding[__key] || {};\n if(textCache.padding.hasOwnProperty(__key)) {\n if(p.hasOwnProperty(char)) {\n hasCache = true;\n count -= p[char];\n }\n }\n if(!hasCache) {\n let n = 0;\n if(root.renderMode === mode.CANVAS) {\n root.ctx.font = css.setFontStyle(computedStyle);\n let w1 = root.ctx.measureText(char).width;\n let w2 = root.ctx.measureText(char + char).width;\n n = w1 * 2 - w2;\n n *= padding[char];\n }\n else if(root.renderMode === mode.SVG) {\n n = inject.measureTextSync(__key, __ff, fontSize, fontWeight, char);\n n *= padding[char];\n }\n count -= n;\n p[char] = n;\n }\n }\n lastChar = char;\n }\n // 忽略零宽字符\n if(cw === 0) {\n i++;\n continue;\n }\n // 换行都要判断i不是0的时候,第1个字符强制不换行\n if(count === w) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n let textBox;\n // 特殊情况,恰好最后一行最后一个排满,此时查看末尾mpb,要防止i为0的情况首个字符特殊不回退,无需看开头mpb\n if(i === length - 1 && count > w - endSpace && i) {\n count -= charWidthList[i--];\n }\n i++;\n if(!lineCount) {\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, count);\n }\n // 必须先添加再设置y,当有diff的lineHeight时,第一个换行不影响,再换行时第2个换行即第3行会被第1行影响\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null; // 换行后连续字符reduce不生效重新计数\n }\n // 奇怪的精度问题,暂时不用相等判断,而是为原本w宽度加一点点冗余1e-10\n else if(count > w + (1e-10)) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n // 普通非多行文本阶段逻辑\n let width;\n // 宽度不足时无法跳出循环,至少也要塞个字符形成一行,无需判断第1行,因为是否放得下逻辑在dom中做过了,\n // 如果第1行放不下,一定会另起一行,此时作为开头再放不下才会进这里,这个if只有0或1个字符的情况\n if(i <= begin) {\n width = count;\n }\n // 超过2个字符回退1个\n else {\n width = count - charWidthList[i--];\n }\n i++;\n // 根据是否第一行分开处理行首空白\n let textBox;\n if(!lineCount) {\n maxW = width - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, width);\n }\n // 必须先添加再设置y,同上\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null;\n }\n else {\n i++;\n }\n }\n // 换行后Text的x重设为lx\n if(lineCount) {\n this.__x = this.__sx1 = lx;\n }\n // 最后一行,只有一行未满时也进这里,需查看末尾mpb,排不下回退一个字符\n // 声明了lineClamp时特殊考虑,这里一定是最后一行,要对比行数不能超过,超过忽略掉这些文本\n if(begin < length && (!lineClamp || lineCount + lineClampCount < lineClamp)) {\n let textBox;\n if(!lineCount) {\n let needBack;\n // 防止开头第一个begin=0时回退,这在inline有padding且是第一个child时会发生\n if(begin && count > w - endSpace) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n else {\n let needBack;\n // 防止begin在结尾时回退,必须要有个字符,这在最后一行1个字符排不下时会出现\n if(count > w - endSpace && begin < length - 1) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n maxW = Math.max(maxW, count);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n }\n }\n this.__width = maxW;\n this.__height = y - data.y;\n this.__baseLine = css.getBaseLine(computedStyle);\n return lineCount;\n }\n\n // 末尾行因ellipsis的缘故向前回退字符生成textBox,可能会因不满足宽度导致无法生成,此时向前继续回退TextBox\n __lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount, lineHeight, lx, x, y, maxW,\n textBoxes, content, charWidthList, lineBoxManager) {\n for(; i >= begin; i--) {\n count -= charWidthList[i] + letterSpacing;\n if(count + ew + endSpace <= w) {\n // 至少1个字符不用回退,到0也没找到需要回退\n if(i) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n break;\n }\n }\n }\n // 最后也没找到,看是否要查找前一个inline节点,还是本身是行首兜底首字母\n if(i < 0) {\n let lineBox = lineBoxManager.lineBox;\n // lineBox为空是行首,至少放1个字符\n if(!lineBox.size) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.charAt(begin), charWidthList.slice(begin, begin + 1));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n }\n // 向前查找inline节点,可能会有前面inline嵌套,因此直接用lineBox,不会出现inlineBlock,\n // 这里和css不同,ib强制超限换行不会同行\n else {\n let list = lineBox.list;\n outer:\n for(let j = list.length - 1; j >= 0; j--) {\n let tb = list[j];\n let { content, wList, width } = tb;\n // 整体减去可以说明可能在这个tb中,只要最后发现不是空文本节点就行,否则继续;第0个强制进入保证1字符\n if(count - width + ew <= w || !j) {\n // 找到可以跳出outer循环,找不到继续,注意第0个且1个字符判断\n for(let k = wList.length - 1; k >= 0; k--) {\n if(!k && !j || count + ew <= w) {\n tb.__content = content;\n tb.__width = width;\n tb.parent.__ellipsis = true;\n break outer;\n }\n else {\n let w2 = wList[k];\n tb.__endY -= w2;\n width -= w2;\n content = content.slice(0, k);\n count -= w2;\n wList.pop();\n }\n }\n }\n // 不够则看前一个tb并且删掉这个\n else {\n count -= width;\n }\n list.pop();\n tb.parent.textBoxes.pop();\n }\n }\n }\n return [y, maxW];\n }\n\n __offsetX(diff, isLayout) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetX(diff);\n });\n }\n this.__sx1 += diff;\n }\n\n __offsetY(diff, isLayout) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetY(diff);\n });\n }\n this.__sy1 += diff;\n }\n\n __tryLayInline(w) {\n return w - this.charWidthList[0];\n }\n\n __inlineSize() {\n let minX, maxX;\n this.textBoxes.forEach((item, i) => {\n if(i) {\n minX = Math.min(minX, item.x);\n maxX = Math.max(maxX, item.x + item.width);\n }\n else {\n minX = item.x;\n maxX = item.x + item.width;\n }\n });\n this.__x = minX;\n this.__sx = this.__sx1 = minX + this.ox;console.log(22222)\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] * 0.5, half);\n }\n else if(textStrokeWidth[1] === VW) {\n half = Math.max(textStrokeWidth[0] * root.width * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VH) {\n half = Math.max(textStrokeWidth[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(textStrokeWidth[0] * 0.5, half);\n }\n half += 1;\n return [sx - half, sy - half, sx + width + half, sy + height + half];\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get matrix() {\n return this.domParent.matrix;\n }\n\n get matrixEvent() {\n return this.domParent.matrixEvent;\n }\n}\n\nText.prototype.__renderByMask = Text.prototype.render;\n\nexport default Text;\n","import util from './util';\nimport $$type from './$$type';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\n/**\n * 2. 打平children中的数组,变成一维\n * 3. 合并相连的Text节点,即string内容\n */\nfunction flattenJson(parent) {\n if(Array.isArray(parent)) {\n return parent.map(item => flattenJson(item));\n }\n else if(!parent || [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) {\n return parent;\n }\n let list = [];\n traverseJson(list, parent.children, {\n lastText: null,\n });\n parent.children = list;\n return parent;\n}\n\nfunction traverseJson(list, children, options) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n traverseJson(list, item, options);\n });\n }\n else if(children && (children.$$type === TYPE_VD || children.$$type === TYPE_GM)) {\n if(['canvas', 'svg', 'webgl'].indexOf(children.tagName) > -1) {\n throw new Error('Can not nest canvas/svg/webgl');\n }\n if(children.$$type === TYPE_VD) {\n flattenJson(children);\n }\n list.push(children);\n options.lastText = null;\n }\n else if(children && children.$$type === TYPE_CP) {\n list.push(children);\n // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做\n options.lastText = null;\n }\n // 排除掉空的文本,连续的text合并\n else if(!util.isNil(children) && children !== '') {\n if(options.lastText !== null) {\n list[list.length - 1] = options.lastText += children;\n }\n else {\n list.push(children);\n }\n }\n}\n\nexport default flattenJson;\n","import Text from '../node/Text';\nimport util from './util';\nimport $$type from './$$type';\nimport enums from './enums';\nimport flatten from './flatten';\n\nconst { NODE_KEY: {\n NODE_DOM_PARENT,\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n} } = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nfunction initRoot(cd, root) {\n let c = flatten({\n tagName: root.tagName,\n props: {},\n children: cd,\n $$type: TYPE_VD,\n });\n root.__json = c;\n root.__host = root;\n let children = build(c.children, root, root);\n return relation(root, children);\n}\n\nfunction initDom(json, root, host, parent) {\n let vd = build(json, root, host);\n return relation(parent, vd);\n}\n\nfunction initCp(json, root, host) {\n if(util.isObject(json)) {\n // cp的flatten在__init中自己做\n return build(json, root, host);\n }\n // text的relation会由上层如Root设置\n else {\n return new Text(json);\n }\n}\n\nfunction initCp2(json, root, host, parent) {\n let vd = new json.klass(json.props);\n vd.__tagName = json.tagName || vd.__tagName;\n vd.__root = root;\n vd.__host = host;\n vd.__json = json;\n vd.__init();\n return relation(parent, vd);\n}\n\n/**\n * 将初始json文件生成virtualDom\n * @param json\n * @param root\n * @param host\n * @param hasP 出现过p标签\n * @returns vd\n */\nfunction build(json, root, host, hasP) {\n if(Array.isArray(json)) {\n return json.map(item => build(item, root, host, hasP));\n }\n let vd;\n if(util.isObject(json) && json.$$type) {\n let { tagName, props, children, klass, $$type, __inheritAnimate, __animateRecords } = json;\n // 更新过程中无变化的cp直接使用原来生成的\n if($$type === TYPE_CP && json.__placeholder) {\n return json.__placeholder;\n }\n if($$type === TYPE_VD) {\n if(tagName === 'img') {\n vd = new Img(tagName, props);\n if(Array.isArray(children) && children.length) {\n throw new Error('Img can not contain children');\n }\n }\n else {\n vd = new Dom(tagName, props);\n }\n // 检查p不能包含div\n if(tagName === 'p') {\n hasP = true;\n }\n else if(tagName === 'div' && hasP) {\n throw new Error('Markup p can not contain div');\n }\n if(Array.isArray(children)) {\n children = relation(vd, build(children, root, host, hasP));\n }\n else {\n children = [];\n }\n vd.__children = children;\n }\n else if($$type === TYPE_GM) {\n let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\n }\n else if($$type === TYPE_CP) {\n vd = new klass(props);\n vd.__tagName = tagName || vd.__tagName;\n }\n else {\n return new Text(json);\n }\n // 根parse需要用到真正的vd引用,然后vd也要引用json,用以做domApi\n json.vd = vd;\n vd.__json = json;\n // 递归parse中的动画记录需特殊处理,将target改为真正的vd引用\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n __animateRecords.list.forEach(item => {\n item.target = item.target.vd;\n });\n delete json.__animateRecords;\n }\n // 更新过程中key相同或者普通相同的vd继承动画\n if(__inheritAnimate) {\n util.extendAnimate(__inheritAnimate, vd);\n delete json.__inheritAnimate;\n }\n vd.__root = root;\n vd.__host = host;\n if($$type === TYPE_CP) {\n vd.__init();\n }\n let ref = props.ref;\n if(util.isString(ref) && ref || util.isNumber(ref)) {\n host.ref[ref] = vd;\n }\n else if(util.isFunction(ref)) {\n ref(vd);\n }\n return vd;\n }\n return new Text(json);\n}\n\n/**\n * 设置关系,父子和兄弟\n * @param parent\n * @param children\n * @param options\n * @returns {Xom|Text|Component}\n */\nfunction relation(parent, children, options = {}) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n relation(parent, item, options);\n });\n }\n else if(children instanceof Xom || children instanceof Component || children instanceof Text) {\n children.__parent = parent;\n children.__domParent = parent;\n // 极为恶心,为了v8的性能优化,text复用parent的__config部分,但domParent重设\n if(children instanceof Text) {\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n if(children.__config) {\n children.__config[NODE_DOM_PARENT] = parent;\n }\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n // 文字视作为父节点的直接文字子节点\n if(children instanceof Component) {\n let sr = children.shadowRoot;\n if(sr instanceof Text) {\n sr.__parent = parent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n sr.__domParent = parent;\n if(sr.__config) {\n sr.__config[NODE_DOM_PARENT] = parent;\n }\n }\n }\n return children;\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n initRoot,\n initDom,\n initCp,\n initCp2,\n relation,\n};\n","import util from './util';\n\nconst { isFunction } = util;\n\nclass Event {\n constructor() {\n this.__eHash = {};\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.on(id[i], handle);\n }\n }\n else {\n if(!self.__eHash.hasOwnProperty(id)) {\n self.__eHash[id] = [];\n }\n // 遍历防止此handle被侦听过了\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n if(item[i] === handle) {\n return self;\n }\n }\n self.__eHash[id].push(handle);\n }\n return self;\n }\n\n once(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n function cb(...data) {\n handle.apply(self, data);\n self.off(id, cb);\n }\n\n cb.__karasEventCb = handle;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.once(id[i], handle);\n }\n }\n else if(handle) {\n self.on(id, cb);\n }\n return this;\n }\n\n off(id, handle) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.off(id[i], handle);\n }\n }\n else if(self.__eHash.hasOwnProperty(id)) {\n if(handle) {\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n // 需考虑once包裹的引用对比\n if(item[i] === handle || item[i].__karasEventCb === handle) {\n item.splice(i, 1);\n break;\n }\n }\n }\n // 未定义为全部清除\n else {\n delete self.__eHash[id];\n }\n }\n return this;\n }\n\n emit(id, ...data) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.emit(id[i], data);\n }\n }\n else {\n if(self.__eHash.hasOwnProperty(id)) {\n let list = self.__eHash[id];\n if(list.length) {\n list = list.slice();\n for(let i = 0, len = list.length; i < len; i++) {\n let cb = list[i];\n if(isFunction(cb)) {\n cb.apply(self, data);\n }\n }\n }\n }\n }\n return this;\n }\n\n static mix(...obj) {\n for(let i = obj.length - 1; i >= 0; i--) {\n let o = obj[i];\n let event = new Event();\n o.__eHash = {};\n let fns = ['on', 'once', 'off', 'emit'];\n for(let j = fns.length - 1; j >= 0; j--) {\n let fn = fns[j];\n o[fn] = event[fn];\n }\n }\n }\n\n static REFRESH = 'refresh';\n static PAUSE = 'pause';\n static PLAY = 'play';\n static FRAME = 'frame';\n static FINISH = 'finish';\n static CANCEL = 'cancel';\n static BEGIN = 'begin';\n static END = 'end';\n}\n\nexport default Event;\n","import Node from './Node';\nimport Text from './Text';\nimport builder from '../util/builder';\nimport Event from '../util/Event';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport flatten from '../util/flatten';\nimport css from '../style/css';\nimport change from '../refresh/change';\n\nconst { isNil, isFunction, clone, extend } = util;\n\nconst REGISTER = {};\n\n/**\n * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归\n * 在check时树递归会用到,判断是否需要查找cp更新\n * @param cp\n */\nfunction setUpdateFlag(cp) {\n // 去重\n if(cp.__hasUpdate) {\n return;\n }\n cp.__hasUpdate = true;\n let host = cp.host;\n if(host) {\n setUpdateFlag(host);\n }\n}\n\nclass Component extends Event {\n constructor(props = {}) {\n super();\n this.__tagName = /(?:function|class)\\s+([\\w$]+)/.exec(this.constructor.toString())[1];\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__parent = null;\n this.__host = null;\n this.__ref = {};\n this.state = {};\n this.__isMounted = false;\n this.__taskList = [];\n }\n\n setState(n, cb) {\n let self = this;\n if(isNil(n)) {\n n = {};\n }\n else if(isFunction(n)) {\n return;\n }\n else {\n if(Object.keys(n).length === 0) {\n if(isFunction(cb)) {\n cb.call(self);\n }\n return;\n }\n let state = clone(self.state);\n n = extend(state, n);\n }\n let root = self.root;\n if(root && self.__isMounted) {\n // 一帧之内多次调用,需合并\n if(self.__nextState) {\n Object.assign(self.__nextState, n);\n self.__taskList.push(cb);\n }\n else {\n self.__nextState = n;\n self.__taskList = [cb];\n // 回调更新列表,before执行时splice出来供after执行,防止中途产生的后续setState干扰\n let list = [];\n let t = self.__task = {\n __before: () => {\n list = self.__taskList.splice(0);\n // 标识更新\n setUpdateFlag(this);\n },\n __after: () => {\n // self.__nextState = null; 由updater.js每次refresh前同步执行清空,这里不能异步清除,否则frame动画会乱序\n list.forEach(cb => {\n if(isFunction(cb)) {\n cb.call(self);\n }\n });\n },\n };\n root.addRefreshCp(t);\n }\n }\n // 构造函数中调用还未render,\n else if(isFunction(cb)) {\n self.state = n;\n cb.call(self);\n }\n }\n\n /**\n * build中调用初始化,json有值时是update过程才有,且处理过flatten\n * @param json\n * @private\n */\n __init(json) {\n this.__ref = {};\n let root = this.root;\n let cd = json || flatten(this.render());\n let sr = builder.initCp(cd, root, this);\n this.__cd = cd;\n if(sr instanceof Text) {\n // 文字视作为父节点的直接文字子节点,在builder里做\n }\n else if(sr instanceof Node) {\n let style = css.normalize(this.props.style);\n let keys = Object.keys(style);\n extend(sr.style, style, keys);\n extend(sr.currentStyle, style, keys);\n // 事件添加到sr\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n });\n }\n else if(!(sr instanceof Component)) {\n // 本身build是递归的,子cp已经初始化了\n throw new Error('Component render() must return a dom/text: ' + this);\n }\n // 自定义事件无视返回强制添加\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n k = k.slice(3);\n this.on(k, v);\n }\n });\n // shadow指向直接renderRoot,shadowRoot考虑到返回Component的递归即hoc高阶组件\n // host是直接所属,hostRoot同考虑到高阶组件\n this.__shadow = sr;\n sr.__host = this;\n // 递归下去,多层级时执行顺序由里到外,最终会被最上层执行替换\n while(sr instanceof Component) {\n sr.__hostRoot = this;\n sr.shadow.__host = sr;\n sr = sr.shadow;\n }\n this.__shadowRoot = sr;\n sr.__hostRoot = this;\n if(!this.__isMounted) {\n this.__isMounted = true;\n if(isFunction(this.componentDidMount)) {\n root.once(Event.REFRESH, () => {\n this.componentDidMount();\n });\n }\n }\n }\n\n render() {\n inject.warn('Component must implement render()');\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.__isDestroyed = true;\n this.__isMounted = false;\n if(isFunction(this.componentWillUnmount)) {\n this.componentWillUnmount();\n }\n this.root.delRefreshTask(this.__task);\n if(this.shadowRoot) {\n this.shadowRoot.__destroy();\n }\n this.__parent = null;\n }\n\n __emitEvent(e, force) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n return;\n }\n let res = sr.__emitEvent(e, force);\n if(res) {\n e.target = this;\n return true;\n }\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get shadow() {\n return this.__shadow;\n }\n\n get shadowRoot() {\n return this.__shadowRoot;\n }\n\n get root() {\n return this.__root;\n }\n\n get host() {\n return this.__host;\n }\n\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n get state() {\n return this.__state;\n }\n\n set state(v) {\n this.__state = v;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)) {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Component has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)\n || !obj.prototype || !(obj.prototype instanceof Component)) {\n throw new Error('Invalid param: Component register');\n }\n if(Component.hasRegister(name)) {\n throw new Error(`Component has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Component.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nObject.keys(change.GEOM).concat([\n 'x',\n 'y',\n 'ox',\n 'oy',\n 'sx',\n 'sy',\n // '__sx1',\n // '__sx2',\n // '__sx3',\n // '__sx4',\n // '__sx5',\n // '__sx6',\n // '__sy1',\n // '__sy2',\n // '__sy3',\n // '__sy4',\n // '__sy5',\n // '__sy6',\n 'width',\n 'height',\n 'outerWidth',\n 'outerHeight',\n 'clientWidth',\n 'clientHeight',\n 'offsetWidth',\n 'offsetHeight',\n 'style',\n 'animationList',\n 'animateStyle',\n 'currentStyle',\n 'computedStyle',\n 'currentProps',\n 'baseLine',\n 'virtualDom',\n 'mask',\n 'maskId',\n 'textWidth',\n 'content',\n 'lineBoxes',\n 'charWidthList',\n 'charWidth',\n '__layoutData',\n 'availableAnimating',\n 'effectiveAnimating',\n 'displayAnimating',\n 'visibilityAnimating',\n 'bbox',\n '__config',\n 'contentBoxList',\n 'listener',\n 'matrix',\n 'matrixEvent',\n]).forEach(fn => {\n Object.defineProperty(Component.prototype, fn, {\n get() {\n let sr = this.shadowRoot;\n if(sr) {\n return sr[fn];\n }\n },\n });\n});\n\n[\n '__layout',\n '__layoutAbs',\n '__layoutNone',\n '__tryLayInline',\n '__offsetX',\n '__offsetY',\n '__calAutoBasis',\n '__calMp',\n '__calAbs',\n '__renderAsMask',\n '__renderByMask',\n '__mp',\n 'animate',\n 'removeAnimate',\n 'clearAnimate',\n 'updateStyle',\n 'getBoundingClientRect',\n 'getComputedStyle',\n '__deepScan',\n 'clearCache',\n '__structure',\n '__modifyStruct',\n '__updateStruct',\n 'flowChildren',\n 'absChildren',\n '__isRealInline',\n '__calBasis',\n '__calMinMax',\n '__computeMeasure',\n 'appendChild',\n 'prependChild',\n 'insertBefore',\n 'insertAfter',\n 'removeChild',\n 'remove',\n].forEach(fn => {\n Component.prototype[fn] = function() {\n let sr = this.shadowRoot;\n if(sr && isFunction(sr[fn])) {\n return sr[fn].apply(sr, arguments);\n }\n };\n});\n\nexport default Component;\n","import unit from './unit';\nimport transform from './transform';\nimport enums from '../util/enums';\n\nconst { STYLE_KEY: { SCALE_X, SCALE_Y } } = enums;\nconst { PERCENT, NUMBER } = unit;\n\nfunction matrixResize(imgWidth, imgHeight, targetWidth, targetHeight, x, y, w, h) {\n if(imgWidth === targetWidth && imgHeight === targetHeight) {\n return;\n }\n let list = [\n [SCALE_X, [targetWidth / imgWidth, NUMBER]],\n [SCALE_Y, [targetHeight / imgHeight, NUMBER]],\n ];\n let tfo = transform.calOrigin([[0, PERCENT], [0, PERCENT]], w, h);\n tfo[0] += x;\n tfo[1] += y;\n return transform.calMatrixWithOrigin(list, tfo, w, h);\n}\n\nexport default {\n matrixResize,\n};\n","import border from './border';\nimport transform from './transform';\nimport mx from '../math/matrix';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\nimport unit from './unit';\nimport enums from '../util/enums';\nimport image from './image';\n\nconst {\n STYLE_KEY: {\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\nconst { clone, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { AUTO, PX, PERCENT, STRING, REM, VW, VH } = unit;\n\nfunction renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bbrr, bblr,\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] === AUTO) {\n res.push(-1);\n }\n else if(item[1] === STRING) {\n res.push(item[0] === 'contain' ? -2 : -3);\n }\n });\n return res;\n}\n\nfunction calBackgroundPosition(position, container, size, root) {\n if(Array.isArray(position)) {\n if(position[1] === PX) {\n return position[0];\n }\n else if(position[1] === PERCENT) {\n return (container - size) * position[0] * 0.01;\n }\n else if(position[1] === REM) {\n return position[0] * root.computedStyle[FONT_SIZE];\n }\n else if(position[1] === VW) {\n return position[0] * root.width * 0.01;\n }\n else if(position[1] === VH) {\n return position[0] * root.height * 0.01;\n }\n }\n return 0;\n}\n\nfunction renderImage(xom, renderMode, ctx, loadBgi,\n bx1, by1, bx2, by2, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, isInline,\n 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_FRAME_CB,\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_CAL_DIFF_TIME,\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, calUnit } = unit;\nconst { isNil, isFunction, isNumber, isObject, isString, clone, equalArr } = util;\nconst { linear } = easing;\nconst { cloneStyle } = css;\nconst { isGeom, GEOM } = change;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nconst NUM_CAL_HASH = {\n};\nObject.assign(NUM_CAL_HASH, LENGTH_HASH);\nObject.assign(NUM_CAL_HASH, EXPAND_HASH);\n\nfunction unify(frames, target) {\n let hash = {};\n let keys = [];\n // 获取所有关键帧的属性\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n Object.keys(style).forEach(k => {\n let v = style[k];\n // 未定义的过滤掉,null空有意义\n if(v !== undefined && !hash.hasOwnProperty(k)) {\n hash[k] = true;\n // geom为属性字符串,style都为枚举int\n if(!GEOM.hasOwnProperty(k)) {\n k = parseInt(k);\n }\n // path动画要转为translateXY,所以手动添加,使2帧之间存在过渡,有可能之前已存在这个动画,可忽视\n if(k === TRANSLATE_PATH) {\n if(!hash.hasOwnProperty(TRANSLATE_X)) {\n keys.push(TRANSLATE_X);\n }\n if(!hash.hasOwnProperty(TRANSLATE_Y)) {\n keys.push(TRANSLATE_Y);\n }\n hash[TRANSLATE_X] = hash[TRANSLATE_Y] = true;\n }\n keys.push(k);\n }\n });\n });\n // 添补没有声明完全的关键帧属性为节点当前值\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n keys.forEach(k => {\n if(!style.hasOwnProperty(k) || isNil(style[k])) {\n if(GEOM.hasOwnProperty(k)) {\n style[k] = target.getProps(k);\n }\n else {\n style[k] = target.currentStyle[k];\n }\n }\n });\n });\n return keys;\n}\n\n// 每次初始化时处理继承值,以及转换transform为单matrix矩阵\nfunction inherit(frames, keys, target) {\n let computedStyle = target.computedStyle;\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n keys.forEach(k => {\n let v = style[k];\n // geom的属性可能在帧中没有\n if(isNil(v)) {\n return;\n }\n if(k === TRANSFORM) {\n let ow = target.outerWidth;\n let oh = target.outerHeight;\n let m = tf.calMatrix(v, ow, oh);\n style[k] = [[MATRIX, m]];\n }\n else if(v[1] === INHERIT) {\n if(k === COLOR || k === TEXT_STROKE_COLOR) {\n style[k] = [util.rgba2int(computedStyle[k]), RGBA];\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n style[k] = [computedStyle[k], PX];\n }\n else if(k === FONT_WEIGHT) {\n style[k] = [computedStyle[k], NUMBER];\n }\n else if(k === FONT_STYLE || k === FONT_FAMILY || k === TEXT_ALIGN || k === TEXT_STROKE_OVER) {\n style[k] = [computedStyle[k], STRING];\n }\n }\n });\n });\n}\n\n/**\n * 通知root更新当前动画,需要根据frame的状态来决定是否是同步插入\n * 在异步时,因为动画本身是异步,需要addRefreshTask\n * 而如果此时frame在执行before过程中,说明帧动画本身是在before计算的,需要同步插入\n * @param style\n * @param keys 样式所有的key\n * @param __config\n * @param root\n * @param node\n */\nfunction genBeforeRefresh(style, keys, __config, root, node) {\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = keys;\n res[UPDATE_CONFIG] = __config[I_NODE_CONFIG];\n root.__addUpdate(node, __config[I_NODE_CONFIG], root, __config[I_ROOT_CONFIG], res);\n __config[I_STYLE] = style;\n __config[I_ASSIGNING] = true;\n // frame每帧回调时,下方先执行计算好变更的样式,这里特殊插入一个hook,让root增加一个刷新操作\n // 多个动画调用因为相同root也只会插入一个,这样在所有动画执行完毕后frame里检查同步进行刷新,解决单异步问题\n root.__frameHook();\n}\n\n/**\n * 将每帧的样式格式化,提取出offset属性并转化为时间,提取出缓动曲线easing\n * @param style 关键帧样式\n * @param duration 动画时间长度\n * @param es options的easing曲线控制,frame没有自定义则使用全局的\n * @returns {{style: *, time: number, easing: *, transition: []}}\n */\nfunction framing(style, duration, es) {\n let { offset, easing } = style;\n // 这两个特殊值提出来存储不干扰style\n delete style.offset;\n delete style.easing;\n // translatePath特殊对待,ae的曲线运动动画\n let translatePath = style.translatePath;\n style = css.normalize(style);\n if(Array.isArray(translatePath) && [6, 8].indexOf(translatePath.length) > -1) {\n style[TRANSLATE_PATH] = translatePath.map(item => calUnit(item));\n }\n let res = [];\n res[FRAME_STYLE] = style;\n res[FRAME_TIME] = offset * duration;\n res[FRAME_EASING] = easing || es;\n res[FRAME_TRANSITION] = [];\n return res;\n}\n\nfunction calByUnit(p, n, container, root) {\n if(p[1] === PX) {\n if(n[1] === PERCENT) {\n return n[0] * 0.01 * container - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width * 0.01 - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height * 0.01 - p[0];\n }\n }\n else if(p[1] === PERCENT) {\n if(n[1] === PX) {\n return n[0] * 100 / container - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * root.computedStyle[FONT_SIZE] * 100 / container - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / container - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / container - p[0];\n }\n }\n else if(p[1] === REM) {\n if(n[1] === PX) {\n return n[0] / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * 0.01 * container / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n }\n else if(p[1] === VW) {\n if(n[1] === PX) {\n return n[0] * 100 / root.width - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / root.width - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / root.width - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / root.width - p[0];\n }\n }\n else if(p[1] === VH) {\n if(n[1] === PX) {\n return n[0] * 100 / root.height - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / root.height - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / root.height - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / root.height - p[0];\n }\n }\n}\n\n/**\n * 计算两帧之间的差,单位不同的以后面为准,返回的v表示差值\n * 没有变化返回空\n * auto等无法比较的不参与计算,不返回来标识无过度效果\n * @param prev 上一帧样式\n * @param next 下一帧样式\n * @param k 比较的样式名\n * @param target dom对象\n * @param tagName dom名\n * @returns {{k: *, v: *}}\n */\nfunction calDiff(prev, next, k, target, tagName) {\n let res = [k];\n let p = prev[k];\n let n = next[k];\n if(k === TRANSFORM) {\n // transform因默认值null很特殊,不存在时需给默认矩阵\n if(!p && !n) {\n return;\n }\n let pm, nm;\n if(p) {\n pm = p[0][1];\n }\n else {\n pm = mx.identity();\n }\n if(n) {\n nm = n[0][1];\n }\n else {\n nm = mx.identity();\n }\n // transform特殊被初始化转成matrix矩阵,直接计算差值\n if(equalArr(pm, nm)) {\n return;\n }\n res[1] = [\n nm[0] - pm[0],\n nm[1] - pm[1],\n nm[2] - pm[2],\n nm[3] - pm[3],\n nm[4] - pm[4],\n nm[5] - pm[5],\n nm[6] - pm[6],\n nm[7] - pm[7],\n nm[8] - pm[8],\n nm[9] - pm[9],\n nm[10] - pm[10],\n nm[11] - pm[11],\n nm[12] - pm[12],\n nm[13] - pm[13],\n nm[14] - pm[14],\n nm[15] - pm[15],\n ];\n return res;\n }\n else if(k === ROTATE_3D) {\n if(equalArr(p, n)) {\n return;\n }\n res[1] = [n[0] - n[0], n[1] - p[1], n[2] - p[2], [n[3][0] - p[3][0], n[3][1]]];\n }\n else if(k === FILTER) {\n // filter很特殊,里面有多个滤镜,忽视顺序按hash计算,为空视为默认值,如blur默认0,brightness默认1\n let pHash = {}, nHash = {}, keyHash = {};\n if(p) {\n p.forEach(item => {\n keyHash[item[0]] = true;\n pHash[item[0]] = item[1];\n });\n }\n if(n) {\n n.forEach(item => {\n keyHash[item[0]] = true;\n nHash[item[0]] = item[1];\n })\n }\n let v = {}, hasChange;\n // 只有blur支持px/rem/vw/vh,其余都是特殊固定单位\n Object.keys(keyHash).forEach(k => {\n if(k === 'blur') {\n if(!pHash[k]) {\n v[k] = nHash[k].slice(0);\n hasChange = true;\n }\n else if(!nHash[k]) {\n v[k] = [-pHash[k][0], pHash[k][1]];\n hasChange = true;\n }\n else {\n let v2 = calByUnit(pHash[k], nHash[k], 0, target.root);\n v[k] = [v2, pHash[k][1]];\n hasChange = true;\n }\n }\n else if(k === 'hue-rotate') {\n let nv = isNil(nHash[k]) ? 0 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 0 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'contrast') {\n let nv = isNil(nHash[k]) ? 100 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 100 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n else if(k === 'grayscale') {\n let nv = isNil(nHash[k]) ? 0 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 0 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n });\n if(!hasChange) {\n return;\n }\n res[1] = v;\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n res[1] = [];\n for(let i = 0; i < 2; i++) {\n let pi = p[i];\n let ni = n[i];\n if(pi[1] === ni[1]) {\n res[1].push(ni[0] - pi[0]);\n }\n else {\n let v = calByUnit(pi, ni, target[i ? 'outerHeight' : 'outerWidth'], target.root);\n res[1].push(v || 0);\n }\n }\n if(equalArr(res[1], [0, 0])) {\n return;\n }\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n res[1] = [];\n let length = Math.min(p.length, n.length);\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni) {\n res[1].push(null);\n continue;\n }\n if(pi[1] === ni[1]) {\n let v = ni[0] - pi[0];\n if(!v) {\n res[1].push(null);\n return;\n }\n res[1].push(v);\n }\n else {\n let k2 = k === BACKGROUND_POSITION_X ? 'offsetWidth' : 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = k === BACKGROUND_POSITION_X ? 'clientWidth' : 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = k === BACKGROUND_POSITION_X ? 'width' : 'height';\n }\n let v = calByUnit(pi, ni, target[k2], target.root);\n if(!v) {\n res[1].push(null);\n return;\n }\n res[1].push(v);\n }\n }\n }\n else if(k === BOX_SHADOW) {\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let a = p[i];\n let b = n[i];\n let v = [];\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n v.push(b[j] - a[j]);\n }\n // rgba\n let c = [];\n for(let j = 0; j < 4; j++) {\n c.push(b[4][j] - a[4][j]);\n }\n v.push(c);\n res[1].push(v);\n }\n }\n else if(EXPAND_HASH.hasOwnProperty(k)) {\n if(p[1] === n[1]) {\n let v = n[0] - p[0];\n if(v === 0) {\n return;\n }\n res[1] = v;\n }\n else {\n let v = calByUnit(p, n, target[k === TRANSLATE_X || k === TRANSLATE_Z ? 'outerWidth' : 'outerHeight'], target.root);\n if(!v) {\n return;\n }\n res[1] = v;\n }\n }\n else if(k === BACKGROUND_SIZE) {\n res[1] = [];\n let length = Math.min(p.length, n.length);\n let has;\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni) {\n res[1].push(null);\n continue;\n }\n let temp = [];\n for(let j = 0; j < 2; j++) {\n let pp = pi[j], nn = ni[j];\n if(pp[1] === nn[1]) {\n temp.push(nn[0] - pp[0]);\n }\n else {\n let k2 = i ? 'offsetWidth' : 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = i ? 'clientWidth' : 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = i ? 'width' : 'height';\n }\n let v = calByUnit(pp, nn, target[k2], target.root);\n temp.push(v || 0);\n }\n }\n if(equalArr(temp, [0, 0])) {\n res[1].push(null);\n }\n else {\n res[1].push(temp);\n has = true;\n }\n }\n if(!has) {\n return;\n }\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n // backgroundImage发生了渐变色和图片的变化,fill发生渐变色和纯色的变化等\n res[1] = [];\n let length = Math.min(p.length, n.length);\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni || isString(pi) || isString(ni)) {\n res[1].push(null);\n continue;\n }\n if(pi.k !== ni.k) {\n res[1].push(null);\n continue;\n }\n let temp = [];\n // 渐变\n if(pi.k === 'linear' || pi.k === 'radial' || pi.k === 'conic') {\n let pv = pi.v;\n let nv = ni.v;\n temp[0] = [];\n let { clientWidth } = target;\n let eq = equalArr(pv, nv);\n for(let i = 0, len = Math.min(pv.length, nv.length); i < len; i++) {\n let a = pv[i];\n let b = nv[i];\n let t = [];\n t.push([\n b[0][0] - a[0][0],\n b[0][1] - a[0][1],\n b[0][2] - a[0][2],\n b[0][3] - a[0][3],\n ]);\n if(a[1] && b[1]) {\n if(a[1][1] === b[1][1]) {\n t.push(b[1][0] - a[1][0]);\n }\n else {\n let v = calByUnit(a[1], b[1], clientWidth, target.root);\n t.push(v || 0);\n }\n }\n temp[0].push(t);\n }\n // 线性渐变有角度差值变化\n if(pi.k === 'linear') {\n let isArrP = Array.isArray(pi.d);\n let isArrN = Array.isArray(ni.d);\n if(isArrN !== isArrP) {\n res[1].push(null);\n continue;\n }\n if(isArrP) {\n let v = [ni.d[0] - pi.d[0], ni.d[1] - pi.d[1], ni.d[2] - pi.d[2], ni.d[3] - pi.d[3]];\n if(eq && equalArr(v, [0, 0, 0, 0])) {\n res[1].push(null);\n continue;\n }\n temp[1] = v;\n }\n else {\n let v = ni.d - pi.d;\n if(eq && v === 0) {\n res[1].push(null);\n continue;\n }\n temp[1] = v;\n }\n }\n // 径向渐变的位置\n else if(pi.k === 'radial') {\n let isArrP = Array.isArray(pi.z);\n let isArrN = Array.isArray(ni.z);\n if(isArrN !== isArrP) {\n res[1].push(null);\n continue;\n }\n if(isArrP) {\n temp[2] = [];\n for(let i = 0; i < 5; i++) {\n let pz = pi.z[i];\n // 半径比例省略为1\n if(pz === undefined) {\n pz = 1;\n }\n let nz = ni.z[i];\n if(nz === undefined) {\n nz = 1;\n }\n temp[2].push(nz - pz);\n }\n if(eq && equalArr(res[4], [0, 0, 0, 0, 0])) {\n res[1].push(null);\n }\n }\n else {\n temp[2] = [];\n for(let i = 0; i < 2; i++) {\n let pp = pi.p[i];\n let np = ni.p[i];\n if(pp[1] === np[1]) {\n temp[2].push(np[0] - pp[0]);\n }\n else {\n let v = calByUnit(pp, np, target[i ? 'clientWidth' : 'clientHeight'], target.root);\n temp[2].push(v || 0);\n }\n }\n if(eq && equalArr(res[3], [0, 0])) {\n res[1].push(null);\n }\n }\n }\n else if(pi.k === 'conic') {\n temp[1].push(n.d - p.d);\n temp[2] = [];\n for(let i = 0; i < 2; i++) {\n let pp = p.p[i];\n let np = n.p[i];\n if(pp[1] === np[1]) {\n temp[2].push(np[0] - pp[0]);\n }\n else {\n let v = calByUnit(pp, np, target[i ? 'clientWidth' : 'clientHeight'], target.root);\n temp[2].push(v || 0);\n }\n }\n if(eq && res[2] !== 0 && equalArr(res[3], [0, 0])) {\n res[1].push(null);\n }\n }\n }\n // 纯色\n else {\n if(equalArr(n, pi)) {\n res[1].push(null);\n }\n temp[0] = [\n ni[0] - pi[0],\n ni[1] - pi[1],\n ni[2] - pi[2],\n ni[3] - pi[3]\n ];\n }\n res[1].push(temp);\n }\n }\n else if(COLOR_HASH.hasOwnProperty(k)) {\n n = n[0];\n p = p[0];\n if(equalArr(n, p) || n[3] === 0 && p[3] === 0) {\n return;\n }\n res[1] = [\n n[0] - p[0],\n n[1] - p[1],\n n[2] - p[2],\n n[3] - p[3]\n ];\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n // x/y都相等无需\n if(n[0][0] === p[0][0] && n[0][1] === p[0][1]\n && n[1][0] === p[1][0] && n[1][1] === p[1][1]) {\n return;\n }\n res[1] = [];\n for(let i = 0; i < 2; i++) {\n if(n[i][1] === p[i][1]) {\n res[1].push(n[i][0] - p[i][0]);\n }\n else {\n let v = calByUnit(p[i], n[i], target[i ? 'outerHeight' : 'outerWidth'], target.root);\n res[1].push(v || 0);\n }\n }\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n // auto不做动画\n if(p[1] === AUTO || n[1] === AUTO) {\n return;\n }\n let computedStyle = target.computedStyle;\n let parentComputedStyle = (target.domParent || target).computedStyle;\n let diff = 0;\n if(p[1] === n[1]) {\n diff = n[0] - p[0];\n }\n // lineHeight奇怪的单位变化,%相对于fontSize\n else if(k === LINE_HEIGHT) {\n diff = calByUnit(p, n, computedStyle[FONT_SIZE], target.root);\n }\n // fontSize的%相对于parent的\n else if(k === FONT_SIZE) {\n diff = calByUnit(p, n, parentComputedStyle[FONT_SIZE], target.root);\n }\n // 相对于父height的特殊属性\n else if(k === FLEX_BASIS\n && ['column', 'column-reverse', 'columnReverse'].indexOf(computedStyle[FLEX_DIRECTION]) > -1\n || [HEIGHT, TOP, BOTTOM].indexOf(k) > -1) {\n if(p[1] !== AUTO && n[1] !== AUTO) {\n diff = calByUnit(p, n, parentComputedStyle[HEIGHT], target.root);\n }\n }\n // 其余都是相对于父width的\n else {\n if(p[1] !== AUTO && n[1] !== AUTO) {\n diff = calByUnit(p, n, parentComputedStyle[WIDTH], target.root);\n }\n }\n // 兜底NaN非法\n if(diff === 0 || isNaN(diff)) {\n return;\n }\n res[1] = diff;\n }\n else if(GEOM.hasOwnProperty(k)) {\n if(isNil(p)) {\n return;\n }\n else if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calDiff)) {\n let fn = GEOM[k][tagName].calDiff;\n if(target.isMulti) {\n let arr = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n arr.push(fn(p[i], n[i]));\n }\n return arr;\n }\n else {\n res[1] = fn(p, n);\n }\n }\n // 特殊处理multi\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.min(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(null);\n }\n else {\n let v3 = [];\n for(let k = 0, len3 = Math.max(pv2.length, nv2.length); k < len3; k++) {\n let pv3 = pv2[k];\n let nv3 = nv2[k];\n // control由4点变2点\n if(isNil(pv3) || isNil(nv3)) {\n v3.push(0);\n }\n else {\n v3.push(nv3 - pv3);\n }\n }\n v2.push(v3);\n }\n }\n res[1].push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n res[1].push([\n nv[0] - pv[0],\n nv[1] - pv[1],\n ]);\n }\n }\n }\n else {\n if(n === p || equalArr(n, p) || k === 'edge' || k === 'closure' || 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 {\n return [parseFloat(v) || 0, PX];\n }\n });\n }\n // display等不能有增量过程的\n else {\n return;\n }\n return res;\n}\n\n// 计算两帧之间不相同的变化,存入transition,相同的忽略\nfunction calFrame(prev, next, keys, target, tagName) {\n keys.forEach(k => {\n let ts = calDiff(prev[FRAME_STYLE], next[FRAME_STYLE], k, target, tagName);\n // 可以形成过渡的才会产生结果返回\n if(ts) {\n prev[FRAME_TRANSITION].push(ts);\n }\n });\n return next;\n}\n\nfunction binarySearch(i, j, time, frames) {\n if(i === j) {\n let frame = frames[i];\n if(frame[FRAME_TIME] > time) {\n return i - 1;\n }\n return i;\n }\n else {\n let middle = i + ((j - i) >> 1);\n let frame = frames[middle];\n if(frame[FRAME_TIME] === time) {\n return middle;\n }\n else if(frame[FRAME_TIME] > time) {\n return binarySearch(i, Math.max(middle - 1, i), time, frames);\n }\n else {\n return binarySearch(Math.min(middle + 1, j), j, time, frames);\n }\n }\n}\n\nfunction getEasing(ea) {\n let timingFunction;\n if(ea) {\n if((timingFunction = /^\\s*steps\\s*\\(\\s*(\\d+)(?:\\s*,\\s*(\\w+))?\\s*\\)/i.exec(ea))) {\n let steps = parseInt(timingFunction[1]);\n let stepsD = timingFunction[2];\n timingFunction = function(percent) {\n // steps有效定义正整数\n if(steps && steps > 0) {\n let per = 1 / steps;\n let n = stepsD === 'start' ? Math.ceil(percent / per) : Math.floor(percent / per);\n return n / steps;\n }\n return percent;\n };\n }\n else {\n timingFunction = easing.getEasing(ea);\n }\n }\n return timingFunction;\n}\n\n/**\n * 根据百分比和缓动函数计算中间态样式\n * 当easing定义为steps时,优先计算\n * @param frame 当前帧\n * @param keys 所有样式key\n * @param percent 到下一帧时间的百分比\n * @param target vd\n * @returns {*}\n */\nfunction calIntermediateStyle(frame, keys, percent, target) {\n let style = cloneStyle(frame[FRAME_STYLE], keys);\n let timingFunction = getEasing(frame[FRAME_EASING]);\n if(timingFunction && timingFunction !== linear) {\n percent = timingFunction(percent);\n }\n let transition = frame[FRAME_TRANSITION];\n for(let i = 0, len = transition.length; i < len; i++) {\n let [k, v] = transition[i];\n let st = style[k];\n // transform特殊处理,只有1个matrix,有可能不存在,需给默认矩阵\n if(k === TRANSFORM) {\n if(!st) {\n st = style[k] = [[MATRIX, mx.identity()]];\n }\n for(let i = 0; i < 16; i++) {\n st[0][1][i] += v[i] * percent;\n }\n }\n // 特殊的曲线运动计算,转换为translateXY,出现在最后一定会覆盖原本的translate防重\n else if(k === TRANSLATE_PATH) {\n let t = 1 - percent;\n if(v.length === 8) {\n style[TRANSLATE_X] = [\n v[0][0] * t * t * t\n + 3 * v[2][0] * percent * t * t\n + 3 * v[4][0] * percent * percent * t\n + v[6][0] * percent * percent * percent,\n PX,\n ];\n style[TRANSLATE_Y] = [\n v[1][0] * t * t * t\n + 3 * v[3][0] * percent * t * t\n + 3 * v[5][0] * percent * percent * t\n + v[7][0] * percent * percent * percent,\n PX,\n ];\n }\n else if(v.length === 6) {\n style[TRANSLATE_X] = [\n v[0][0] * t * t\n + 2 * v[2][0] * percent * t\n + v[4][0] * percent * percent,\n PX,\n ];\n style[TRANSLATE_Y] = [\n v[1][0] * t * t\n + 3 * v[3][0] * percent * t\n + v[5][0] * percent * percent,\n PX,\n ];\n }\n }\n else if(k === ROTATE_3D) {\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3][0] += v[3][0] * percent;\n }\n else if(NUM_CAL_HASH.hasOwnProperty(k)) {\n if(v) {\n st[0] += v * percent;\n }\n }\n else if(k === FILTER) {\n // 只有1个样式声明了filter另外一个为空,会造成无样式,需初始化数组并在下面计算出样式存入\n if(!st) {\n st = style[k] = [];\n }\n // 将已有的样式按key存入引用来操作\n let hash = {};\n st.forEach(item => {\n hash[item[0]] = item[1];\n });\n Object.keys(v).forEach(k => {\n if(hash.hasOwnProperty(k)) {\n hash[k][0] += v[k][0] * percent;\n }\n else {\n // 2个关键帧中有1个未声明,需新建样式存入\n if(k === 'blur' || k === 'hue-rotate' || k === 'grayscale') {\n let n = v[k].slice(0);\n n[0] *= percent;\n st.push([k, n]);\n }\n // 默认值是1而非0\n else if(k === 'saturate' || k === 'brightness' || k === 'contrast') {\n let n = v[k].slice(0);\n n[0] = 100 + n[0] * percent;\n st.push([k, n]);\n }\n }\n });\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n for(let i = 0; i < 2; i++) {\n st[i][0] += v[i] * percent;\n }\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n if(v[0] !== 0) {\n st[0][0] += v[0] * percent;\n }\n if(v[1] !== 0) {\n st[1][0] += v[1] * percent;\n }\n }\n else if(k === BOX_SHADOW) {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n st[i][j] += v[i][j] * percent;\n }\n // rgba\n for(let j = 0; j < 4; j++) {\n st[i][4][j] += v[i][4][j] * percent;\n }\n }\n }\n else if(k === BACKGROUND_SIZE) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0][0] += v[i][0] * percent;\n item[1][0] += v[i][1] * percent;\n }\n });\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0] += v[i] * percent;\n }\n });\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n st.forEach((st2, i) => {\n let v2 = v[i];\n if(!v2) {\n return;\n }\n let [c, d, p, z] = v2;\n if(GRADIENT_TYPE.hasOwnProperty(st2.k)) {\n for(let i = 0, len = Math.min(st2.v.length, c.length); i < len; i++) {\n let a = st2.v[i];\n let b = c[i];\n a[0][0] += b[0][0] * percent;\n a[0][1] += b[0][1] * percent;\n a[0][2] += b[0][2] * percent;\n a[0][3] += b[0][3] * percent;\n if(a[1] && b[1]) {\n a[1][0] += b[1] * percent;\n }\n }\n if(st2.k === 'linear' && st2.d !== undefined && d !== undefined) {\n if(Array.isArray(d)) {\n st2.d[0] += d[0] * percent;\n st2.d[1] += d[1] * percent;\n st2.d[2] += d[2] * percent;\n st2.d[3] += d[3] * percent;\n }\n else {\n st2.d += d * percent;\n }\n }\n if(st2.k === 'radial') {\n if(st2.z !== undefined && z !== undefined) {\n st2.z[0] += z[0] * percent;\n st2.z[1] += z[1] * percent;\n st2.z[2] += z[2] * percent;\n st2.z[3] += z[3] * percent;\n st2.z[4] += z[4] * percent;\n }\n else if(st2.p !== undefined && p !== undefined) {\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n else if(st2.k === 'conic' && st2.d !== undefined && d !== undefined) {\n st2.d += d * percent;\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n // fill纯色\n else {\n st2[0] += c[0] * percent;\n st2[1] += c[1] * percent;\n st2[2] += c[2] * percent;\n st2[3] += c[3] * percent;\n }\n });\n }\n // color可能超限[0,255],但浏览器已经做了限制,无需关心\n else if(COLOR_HASH.hasOwnProperty(k)) {\n st = st[0];\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n else if(GEOM.hasOwnProperty(k)) {\n let st = style[k];\n let tagName = target.tagName;\n if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calIncrease)) {\n let fn = GEOM[k][tagName].calIncrease;\n if(target.isMulti) {\n style[k] = st.map((item, i) => {\n return fn(item, v[i], percent);\n });\n }\n else {\n style[k] = fn(st, v, percent);\n }\n }\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n let o2 = o[j];\n let n2 = n[j];\n if(!isNil(o2) && !isNil(n2)) {\n for(let k = 0, len3 = Math.min(o2.length, n2.length); k < len3; k++) {\n if(!isNil(o2[k]) && !isNil(n2[k])) {\n o2[k] += n2[k] * percent;\n }\n }\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n v.forEach((item, i) => {\n let st2 = st[i];\n if(!isNil(item) && !isNil(st2)) {\n for(let i = 0, len = Math.min(st2.length, item.length); i < len; i++) {\n let o = st2[i];\n let n = item[i];\n if(!isNil(o) && !isNil(n)) {\n st2[i] += n * percent;\n }\n }\n }\n });\n }\n else {\n v.forEach((item, i) => {\n if(!isNil(item) && !isNil(st[i])) {\n st[i] += item * percent;\n }\n });\n }\n }\n else {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n if(!isNil(o[j]) && !isNil(n[j])) {\n o[j] += n[j] * percent;\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(!isNil(st[0]) && !isNil(v[0])) {\n st[0] += v[0] * percent;\n }\n if(!isNil(st[1]) && !isNil(v[1])) {\n st[1] += v[1] * percent;\n }\n }\n else {\n if(!isNil(st) && !isNil(v)) {\n style[k] += v * percent;\n }\n }\n }\n }\n else if(k === OPACITY || k === Z_INDEX) {\n style[k] += v * percent;\n // 精度问题可能会超过[0,1]区间\n if(k === OPACITY) {\n if(style[k] < 0) {\n style[k] = 0;\n }\n else if(style[k] > 1) {\n style[k] = 1;\n }\n }\n }\n }\n return style;\n}\n\nfunction gotoOverload(options, cb) {\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n return [options || {}, cb];\n}\n\nlet uuid = 0;\n\nclass Animation extends Event {\n constructor(target, list, options) {\n super();\n this.__id = uuid++;\n list = clone(list || []);\n if(Array.isArray(list)) {\n list = list.filter(item => item && isObject(item));\n }\n // 动画过程另外一种形式,object描述k-v形式\n else if(list && isObject(list)) {\n let nl = [];\n Object.keys(list).forEach(k => {\n let v = list[k];\n if(Array.isArray(v)) {\n for(let i = 0, len = v.length; i < len; i++) {\n let o = nl[i] = nl[i] || {\n offset: i / (len - 1),\n };\n o[k] = v[i];\n }\n }\n });\n list = nl;\n }\n else {\n list = [];\n }\n if(isNumber(options)) {\n this.__options = {\n duration: options,\n };\n options = this.__options;\n }\n let op = this.__options = options || {\n duration: 0,\n };\n let root = target.root;\n let config = this.__config = [\n false, // assigning\n false, // inFps\n false, // isDelay\n false, // begin\n false, // end\n false, // finished\n false, // nextBegin\n true, // firstPlay\n this.__frameCb,\n null, // playCb\n target,\n root,\n null, // frames\n null, // framesR\n 0, // currentTime\n 0, // nextTime\n {}, // style\n 0, // duration\n 1, // iterations\n 'none', // fill\n 1, // playbackRate\n 0, // playCount\n 'idle',\n false, // destroy\n 0, // startTime\n 0, // fpsTime\n op.easing,\n false, // enterFrame\n 0, // delay\n 0, // endDelay\n null, // keys,\n null, // originStyle,\n null, // currentFrames\n null, // currentFrame\n false, // spfLimit\n 60, // fps\n 'normal', // direction\n this.__calDiffTime,\n true, // firstEnter,\n false, // stayBegin\n false, // stayEnd\n false, // is2\n 0, // endTime\n target.__config, // nodeConfig\n root && root.__config, // rootConfig,destroy后root可能为空\n false, // outBeginDelay\n ];\n let iterations = this.iterations = op.iterations;\n let duration = this.duration = op.duration;\n let [frames, framesR, keys, originStyle] = this.__init(list, iterations, duration, op.easing, target);\n config[I_FRAMES] = frames;\n config[I_FRAMES_R] = framesR;\n config[I_KEYS] = keys;\n config[I_ORIGIN_STYLE] = originStyle;\n if(frames.length === 2) {\n config[I_IS2] = true;\n config[I_END_TIME] = frames[1][FRAME_TIME];\n }\n let fps = parseInt(op.fps) || 0;\n if(fps <= 0) {\n fps = 60;\n }\n this.fps = fps;\n this.spfLimit = op.spfLimit;\n this.delay = op.delay;\n this.endDelay = op.endDelay;\n this.playbackRate = op.playbackRate;\n this.fill = op.fill;\n this.iterations = op.iterations;\n this.direction = op.direction;\n config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(op.direction) ? framesR : frames;\n // 时间戳\n config[I_TIME_STAMP] = frame.__now;\n // 性能优化访问\n this[0] = this.__before;\n this[1] = this.__after;\n }\n\n __init(list, iterations, duration, easing, target) {\n if(list.length < 1) {\n return [[], [], [], {}];\n }\n // 过滤时间非法的,过滤后续offset<=前面的\n let offset = -1;\n let tagName = target.tagName;\n for(let i = 0, len = list.length; i < len; i++) {\n let current = list[i];\n if(current.hasOwnProperty('offset')) {\n current.offset = parseFloat(current.offset) || 0;\n current.offset = Math.max(0, current.offset);\n current.offset = Math.min(1, current.offset);\n // 超过区间[0,1]\n if(isNaN(current.offset) || current.offset < 0 || current.offset > 1) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n // <=前面的\n else if(current.offset <= offset) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n }\n // 缩写处理\n Object.keys(current).forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(current, k);\n }\n });\n // 检查key合法性\n Object.keys(current).forEach(k => {\n if(k !== 'easing' && k !== 'offset' && !change.isValid(tagName, k)) {\n delete current[k];\n }\n });\n }\n // 只有1帧复制出来变成2帧方便运行\n if(list.length === 1) {\n list[0] = clone(list[0]);\n if(list[0].offset === 1) {\n list.unshift({\n offset: 0,\n });\n }\n else {\n let copy = clone(list[0]);\n copy.offset = 1;\n list.push(copy);\n }\n }\n // 强制clone防止同引用\n else {\n list.forEach((item, i) => {\n list[i] = clone(item);\n });\n }\n // 首尾时间偏移强制为[0, 1],不是的话前后加空帧\n let first = list[0];\n if(first.hasOwnProperty('offset') && first.offset > 0) {\n first = {\n offset: 0,\n };\n list.unshift(first);\n }\n else {\n first.offset = 0;\n }\n let last = list[list.length - 1];\n if(last.hasOwnProperty('offset') && last.offset < 1) {\n last = {\n offset: 1,\n };\n list.push(last);\n }\n else {\n last.offset = 1;\n }\n // 计算没有设置offset的时间\n for(let i = 1, len = list.length; i < len; i++) {\n let start = list[i];\n // 从i=1开始offset一定>0,找到下一个有offset的,均分中间无声明的\n if(!start.hasOwnProperty('offset')) {\n let end;\n let j = i + 1;\n for(; j < len; j++) {\n end = list[j];\n if(end.hasOwnProperty('offset')) {\n break;\n }\n }\n let num = j - i + 1;\n start = list[i - 1];\n let per = (end.offset - start.offset) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.offset = start.offset + per * (k + 1 - i);\n }\n i = j;\n }\n }\n let frames = [];\n // 换算每一关键帧样式标准化\n list.forEach(item => {\n frames.push(framing(item, duration, easing));\n });\n // 为方便两帧之间计算变化,强制统一所有帧的css属性相同,没有写的为节点的当前样式currentStyle\n let keys = unify(frames, target);\n inherit(frames, keys, target);\n let framesR = clone(frames).reverse();\n // 存储原本样式以便恢复用\n let { style, props } = target;\n let originStyle = {};\n keys.forEach(k => {\n if(isGeom(tagName, k)) {\n originStyle[k] = props[k];\n }\n originStyle[k] = style[k];\n });\n // 再计算两帧之间的变化,存入transition属性\n let length = frames.length;\n let prev = frames[0];\n for(let i = 1; i < length; i++) {\n let next = frames[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n // 反向存储帧的倒排结果\n framesR.forEach(item => {\n item[FRAME_TIME] = duration - item[FRAME_TIME];\n item[FRAME_TRANSITION] = [];\n });\n prev = framesR[0];\n for(let i = 1; i < length; i++) {\n let next = framesR[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n return [frames, framesR, keys, originStyle];\n }\n\n __clean(isFinish) {\n let __config = this.__config;\n this.__cancelTask();\n __config[I_NEXT_TIME] = 0;\n let restore;\n let style = __config[I_STYLE];\n let keys = __config[I_KEYS];\n let target = __config[I_TARGET];\n if(isFinish) {\n __config[I_CURRENT_TIME] = __config[I_DELAY] + __config[I_DURATION] + __config[I_END_DELAY];\n if(__config[I_PLAY_STATE] === 'finish') {\n return;\n }\n __config[I_PLAY_STATE] = 'finish';\n // cancel需要清除finish根据情况保留\n if(!__config[I_STAY_END]) {\n __config[I_STYLE] = {};\n restore = true;\n }\n }\n else {\n __config[I_PLAY_COUNT] = __config[I_CURRENT_TIME] = 0;\n if(__config[I_PLAY_STATE] === 'idle') {\n return;\n }\n __config[I_PLAY_STATE] = 'idle';\n __config[I_STYLE] = {};\n restore = true;\n }\n // 动画取消结束不停留在最后一帧需要还原target原本的样式,需要对比目前是否是由本动画赋值的\n if(restore) {\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n if(target.__currentProps[k] === style[k]) {\n target.__currentProps[k] = target.props[k];\n }\n }\n else {\n if(target.__currentStyle[k] === style[k]) {\n target.__currentStyle[k] = target.style[k];\n }\n }\n });\n }\n }\n\n __frameCb(__config, diff, isDelay) {\n this.emit(Event.FRAME, diff, isDelay);\n if(__config[I_FIRST_PLAY]) {\n __config[I_FIRST_PLAY] = false;\n this.emit(Event.PLAY);\n }\n if(isFunction(__config[I_PLAY_CB])) {\n __config[I_PLAY_CB].call(this, diff, isDelay);\n __config[I_PLAY_CB] = null;\n }\n }\n\n __calDiffTime(__config, diff) {\n let playbackRate = __config[I_PLAYBACK_RATE];\n let spfLimit = __config[I_SPF_LIMIT];\n let fps = __config[I_FPS];\n let v = __config[I_CURRENT_TIME] = __config[I_NEXT_TIME];\n // 定帧限制每帧时间间隔最大为spf\n if(spfLimit) {\n if(spfLimit === true) {\n diff = Math.min(diff, 1000 / fps);\n }\n else if(spfLimit > 0) {\n diff = Math.min(diff, spfLimit);\n }\n }\n // 播放时间累加,并且考虑播放速度加成\n if(playbackRate !== 1 && playbackRate > 0) {\n diff *= playbackRate;\n }\n __config[I_NEXT_TIME] += diff;\n return [v, diff];\n }\n\n play(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n if(playState === 'running') {\n return this;\n }\n this.__cancelTask();\n __config[I_PLAY_CB] = cb;\n __config[I_PLAY_STATE] = 'running';\n // 每次play调用标识第一次运行,需响应play事件和回调\n __config[I_FIRST_PLAY] = true;\n // 防止finish/cancel事件重复触发,每次播放重置\n this.__hasFin = false;\n this.__hasCancel = false;\n // 只有第一次调用会进初始化,另外finish/cancel视为销毁也会重新初始化\n if(!__config[I_ENTER_FRAME]) {\n __config[I_ENTER_FRAME] = true;\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n // 初始化根据方向确定帧序列\n __config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction) ? framesR : frames;\n __config[I_CURRENT_TIME] = __config[I_NEXT_TIME] = __config[I_FPS_TIME] = 0;\n }\n // 添加每帧回调且立刻执行,本次执行调用refreshTask也是下一帧再渲染,frame的每帧都是下一帧\n frame.offFrame(this);\n frame.onFrame(this);\n __config[I_START_TIME] = frame.__now;\n __config[I_END] = false;\n return this;\n }\n\n __before(diff) {\n let __config = this.__config;\n __config[I_TIME_STAMP] = frame.__now;\n let target = __config[I_TARGET];\n let fps = __config[I_FPS];\n let playCount = __config[I_PLAY_COUNT];\n let currentFrames = __config[I_CURRENT_FRAMES];\n let iterations = __config[I_ITERATIONS];\n let stayBegin = __config[I_STAY_BEGIN];\n let stayEnd = __config[I_STAY_END];\n let delay = __config[I_DELAY];\n let root = __config[I_ROOT];\n let is2 = __config[I_IS2];\n let endTime = __config[I_END_TIME];\n let duration = __config[I_DURATION];\n let endDelay = __config[I_END_DELAY];\n let length = currentFrames.length;\n // 用本帧和上帧时间差,计算累加运行时间currentTime,以便定位当前应该处于哪个时刻\n let [currentTime, d] = __config[I_CAL_DIFF_TIME](__config, diff);\n diff = d;\n // 增加的fps功能,当<60时计算跳帧,每帧运行依旧累加时间,达到fps时重置,第一帧强制不跳\n if(!__config[I_FIRST_ENTER] && fps < 60) {\n diff = __config[I_FPS_TIME] += diff;\n if(diff < 1000 / fps) {\n __config[I_IN_FPS] = true;\n return;\n }\n __config[I_FPS_TIME] = 0;\n }\n __config[I_FIRST_ENTER] = false;\n // delay仅第一次生效\n if(playCount === 0 && currentTime < delay) {\n if(stayBegin) {\n let currentFrame = __config[I_CURRENT_FRAME] = currentFrames[0];\n let current = currentFrame[FRAME_STYLE];\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n }\n // 即便不刷新,依旧执行帧回调,同时标明让后续第一帧响应begin\n __config[I_OUT_BEGIN_DELAY] = true;\n __config[I_IS_DELAY] = true;\n return;\n }\n // 减去delay,计算在哪一帧,仅首轮\n if(playCount === 0) {\n currentTime -= delay;\n }\n if(currentTime === 0 || __config[I_OUT_BEGIN_DELAY]) {\n __config[I_OUT_BEGIN_DELAY] = false;\n __config[I_BEGIN] = true;\n }\n // 超过duration非尾轮需处理回到开头,触发新一轮动画事件,这里可能时间间隔非常大直接跳过几轮\n let round;\n while(currentTime >= duration && playCount < iterations - 1) {\n currentTime -= duration;\n __config[I_NEXT_TIME] -= duration;\n playCount = ++__config[I_PLAY_COUNT];\n __config[I_BEGIN] = true;\n round = true;\n }\n // 如果发生轮换,需重新确定正反向\n if(round) {\n let direction = __config[I_DIRECTION];\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let isAlternate = {\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction);\n // 有正反向播放需要重设帧序列\n if(isAlternate) {\n let isEven = playCount % 2 === 0;\n if(direction === 'alternate') {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n }\n let isLastCount = playCount >= iterations - 1;\n // 只有2帧可优化,否则2分查找当前帧\n let i, frameTime;\n if(is2) {\n i = currentTime < endTime ? 0 : 1;\n frameTime = endTime;\n }\n else {\n i = binarySearch(0, length - 1, currentTime, currentFrames);\n frameTime = currentFrames[i][FRAME_TIME];\n }\n // 最后一帧结束动画,仅最后一轮才会进入,需处理endDelay\n let isLastFrame = isLastCount && i === length - 1;\n let percent = 0;\n if(isLastFrame) {\n // 无需任何处理\n }\n // 否则根据目前到下一帧的时间差,计算百分比,再反馈到变化数值上\n else if(is2) {\n percent = currentTime / duration;\n }\n else {\n let total = currentFrames[i + 1][FRAME_TIME] - frameTime;\n percent = (currentTime - frameTime) / total;\n }\n let inEndDelay, currentFrame = currentFrames[i], current;\n __config[I_CURRENT_FRAME] = currentFrame;\n /** 这里要考虑全几种场景:\n * 1. 单次播放无endDelay且fill不停留(有/无差异,下同)\n * 2. 单次播放无endDelay且fill停留\n * 3. 单次播放有endDelay且fill不停留\n * 4. 单次播放有endDelay且fill停留\n * 5. 多次播放无endDelay且fill不停留(尾次/非尾次,下同)\n * 6. 多次播放无endDelay且fill停留\n * 7. 多次播放有endDelay且fill不停留\n * 8. 多次播放有endDelay且fill停留\n */\n let needClean;\n if(isLastFrame) {\n inEndDelay = currentTime < duration + endDelay;\n // 停留对比最后一帧,endDelay可能会多次进入这里,第二次进入样式相等不再重绘\n if(stayEnd) {\n current = cloneStyle(currentFrame[FRAME_STYLE], __config[I_KEYS]);\n }\n // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里\n else {\n current = cloneStyle(__config[I_ORIGIN_STYLE], __config[I_KEYS]);\n }\n // 进入endDelay或结束阶段触发end事件,注意只触发一次,防重在触发的地方做\n __config[I_NEXT_END] = true;\n if(!inEndDelay) {\n __config[I_PLAY_COUNT]++;\n __config[I_FINISHED] = true;\n frame.offFrame(this);\n needClean = true;\n __config[I_NEXT_TIME] = 0;\n }\n }\n else {\n current = calIntermediateStyle(currentFrame, __config[I_KEYS], percent, target);\n }\n // 无论两帧之间是否有变化,都生成计算结果赋给style,去重在root做\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n if(needClean) {\n 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 __config[I_FRAME_CB].call(this, __config, diff, __config[I_IS_DELAY]);\n __config[I_IS_DELAY] = false;\n if(__config[I_BEGIN]) {\n __config[I_BEGIN] = false;\n this.emit(Event.BEGIN, __config[I_PLAY_COUNT]);\n }\n // end事件只触发一次,末轮进入endDelay或直接结束时\n if(__config[I_NEXT_END] && !__config[I_END]) {\n __config[I_END] = true;\n this.emit(Event.END, __config[I_PLAY_COUNT] - 1);\n }\n if(__config[I_FINISHED]) {\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n __config[I_PLAY_STATE] = 'finished';\n this.emit(Event.FINISH);\n }\n }\n\n pause(silence) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let { pending } = this;\n if(isDestroyed || duration <= 0 || pending) {\n return this;\n }\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(!silence) {\n this.emit(Event.PAUSE);\n }\n return this;\n }\n\n resume(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n if(isDestroyed || duration <= 0 || playState !== 'paused') {\n return this;\n }\n return this.play(cb);\n }\n\n finish(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1 || playState === 'finished' || playState === 'idle') {\n return self;\n }\n // 先清除所有回调任务,多次调用finish也会清除只留最后一次\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n let current;\n // 停留在最后一帧\n if(__config[I_STAY_END]) {\n __config[I_CURRENT_FRAME] = frames[frames.length - 1];\n current = frames[frames.length - 1][FRAME_STYLE];\n }\n else {\n current = originStyle;\n }\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(current, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean(true);\n },\n __after(diff) {\n if(!self.__hasFin) {\n self.__hasFin = true;\n __config[I_ASSIGNING] = false;\n __config[I_FRAME_CB].call(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.FINISH);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n cancel(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || playState === 'idle' || frames.length < 1) {\n return self;\n }\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(originStyle, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean();\n },\n __after(diff) {\n if(!self.__hasCancel) {\n self.__hasCancel = true;\n __config[I_ASSIGNING] = false;\n __config[I_FRAME_CB].call(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.CANCEL);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n gotoAndPlay(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n // 计算出时间点直接累加播放\n this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n return this.play(cb);\n }\n\n gotoAndStop(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n v = this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n // 先play一帧,回调里模拟暂停\n return this.play(diff => {\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isFunction(cb)) {\n cb.call(this, diff);\n }\n });\n }\n\n // 同步赋予,用在extendAnimate\n assignCurrentStyle() {\n let __config = this.__config;\n let style = __config[I_STYLE];\n let target = __config[I_TARGET];\n let keys = __config[I_KEYS];\n keys.forEach(i => {\n if(style.hasOwnProperty(i)) {\n let v = style[i];\n // geom的属性变化\n if(GEOM.hasOwnProperty(i)) {\n target.currentProps[i] = v;\n }\n // 样式\n else {\n // 将动画样式直接赋给currentStyle\n target.currentStyle[i] = v;\n }\n }\n });\n }\n\n __goto(v, isFrame, excludeDelay) {\n let __config = this.__config;\n let duration = __config[I_DURATION];\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isNaN(v) || v < 0) {\n throw new Error('Param of gotoAnd(Play/Stop) is illegal: ' + v);\n }\n if(isFrame) {\n v = (v - 1) / this.spf;\n }\n if(excludeDelay) {\n v += __config[I_DELAY];\n }\n // 超过一轮去掉delay\n if(v > duration + __config[I_DELAY]) {\n v -= __config[I_DELAY];\n }\n // 超过时间长度需要累加次数\n __config[I_PLAY_COUNT] = 0;\n while(v > duration && __config[I_PLAY_COUNT] < __config[I_ITERATIONS] - 1) {\n __config[I_PLAY_COUNT]++;\n v -= duration;\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n __config[I_NEXT_TIME] = v;\n // 防止play()重置时间和当前帧组,提前计算好\n __config[I_ENTER_FRAME] = true;\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n if({\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction)) {\n let isEven = __config[I_PLAY_COUNT] % 2 === 0;\n if(direction === 'alternate') {\n __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n return v;\n }\n\n addControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.add(this);\n }\n }\n\n removeControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.remove(this);\n }\n }\n\n __stayBegin() {\n return {\n backwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __stayEnd() {\n return {\n forwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __setTarget(target) {\n this.__target = target;\n this.__config[I_TARGET] = target;\n this.__config[I_NODE_CONFIG] = target.__config;\n }\n\n __cancelTask() {\n frame.offFrame(this);\n this.__config[I_PLAY_CB] = null;\n }\n\n __destroy(sync) {\n let self = this;\n let __config = self.__config;\n if(__config[I_DESTROYED]) {\n return;\n }\n self.removeControl();\n // clean异步执行,因为里面的样式还原需要等到下一帧,否则同步执行清除后,紧接着的新同步动画获取不到currentStyle\n if(sync) {\n self.__clean();\n __config[I_TARGET] = null;\n }\n else {\n frame.nextFrame({\n __before() {\n self.__clean();\n __config[I_TARGET] = null;\n },\n });\n }\n __config[I_START_TIME] = 0;\n __config[I_DESTROYED] = true;\n }\n\n __checkModify() {\n let __config = this.__config;\n if(__config[I_PLAY_STATE] !== 'idle' && __config[I_PLAY_STATE] !== 'finished') {\n inject.warn('Modification will not come into effect when animation is running');\n }\n }\n\n get id() {\n return this.__id;\n }\n\n get target() {\n return this.__config[I_TARGET];\n }\n\n get root() {\n return this.__config[I_ROOT];\n }\n\n get keys() {\n return this.__config[I_KEYS];\n }\n\n get style() {\n return this.__config[I_STYLE];\n }\n\n get options() {\n return this.__options;\n }\n\n get duration() {\n return this.__config[I_DURATION];\n }\n\n set duration(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DURATION] !== v) {\n __config[I_DURATION] = v;\n __config[I_END_TIME] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get delay() {\n return this.__config[I_DELAY];\n }\n\n set delay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DELAY] !== v) {\n __config[I_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get endDelay() {\n return this.__config[I_END_DELAY];\n }\n\n set endDelay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_END_DELAY] !== v) {\n __config[I_END_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get fps() {\n return this.__config[I_FPS];\n }\n\n set fps(v) {\n v = parseInt(v) || 60;\n let __config = this.__config;\n if(__config[I_FPS] !== v) {\n if(v <= 0) {\n v = 60;\n }\n __config[I_FPS] = v;\n }\n return v;\n }\n\n get spf() {\n return 1 / this.fps;\n }\n\n get iterations() {\n return this.__config[I_ITERATIONS];\n }\n\n set iterations(v) {\n if(v === Infinity || util.isString(v) && v.toLowerCase() === 'infinity') {\n v = Infinity;\n }\n else {\n v = parseInt(v);\n if(isNaN(v) || v < 0) {\n v = 1;\n }\n }\n let __config = this.__config;\n if(__config[I_ITERATIONS] !== v) {\n __config[I_ITERATIONS] = v;\n }\n return v;\n }\n\n get fill() {\n return this.__config[I_FILL];\n }\n\n set fill(v) {\n v = v || 'none';\n let __config = this.__config;\n if(__config[I_FILL] !== v) {\n __config[I_FILL] = v;\n this.__checkModify();\n }\n __config[I_STAY_BEGIN] = {\n backwards: true,\n both: true,\n }.hasOwnProperty(v);\n __config[I_STAY_END] = {\n forwards: true,\n both: true,\n }.hasOwnProperty(v);\n return v;\n }\n\n get direction() {\n return this.__config[I_DIRECTION];\n }\n\n set direction(v) {\n v = v || 'normal';\n let __config = this.__config;\n if(__config[I_DIRECTION] !== v) {\n __config[I_DIRECTION] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get frames() {\n return this.__config[I_FRAMES];\n }\n\n get framesR() {\n return this.__config[I_FRAMES_R];\n }\n\n get playbackRate() {\n return this.__config[I_PLAYBACK_RATE];\n }\n\n set playbackRate(v) {\n v = parseFloat(v) || 1;\n if(v <= 0) {\n v = 1;\n }\n let __config = this.__config;\n if(__config[I_PLAYBACK_RATE] !== v) {\n __config[I_PLAYBACK_RATE] = v;\n }\n return v;\n }\n\n get easing() {\n return this.__config[I_EASING];\n }\n\n get startTime() {\n return this.__config[I_START_TIME];\n }\n\n get currentTime() {\n return this.__config[I_CURRENT_TIME];\n }\n\n set currentTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_CURRENT_TIME] !== v) {\n __config[I_CURRENT_TIME] = v;\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get nextTime() {\n return this.__config[I_NEXT_TIME];\n }\n\n set nextTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_NEXT_TIME] !== v) {\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get timestamp() {\n return this.__config[I_TIME_STAMP];\n }\n\n get pending() {\n return this.__config[I_PLAY_STATE] !== 'running';\n }\n\n get finished() {\n return this.__config[I_PLAY_STATE] === 'finished';\n }\n\n get playState() {\n return this.__config[I_PLAY_STATE];\n }\n\n get playCount() {\n return this.__config[I_PLAY_COUNT];\n }\n\n set playCount(v) {\n v = Math.max(0, parseInt(v) || 0);\n let __config = this.__config;\n if(__config[I_PLAY_COUNT] !== v) {\n __config[I_PLAY_COUNT] = v;\n }\n return v;\n }\n\n get isDestroyed() {\n return this.__config[I_DESTROYED];\n }\n\n get animating() {\n let __config = this.__config;\n let playState = __config[I_PLAY_STATE];\n if(playState === 'idle') {\n return false;\n }\n return playState !== 'finished' || __config[I_STAY_END] || __config[I_STAY_BEGIN];\n }\n\n get spfLimit() {\n let __config = this.__config;\n return __config[I_SPF_LIMIT];\n }\n\n set spfLimit(v) {\n if(util.isNumber(v) || /^\\d/.test(v)) {\n v = Math.max(0, parseInt(v) || 0);\n }\n else {\n v = !!v;\n }\n let __config = this.__config;\n if(__config[I_SPF_LIMIT] !== v) {\n __config[I_SPF_LIMIT] = v;\n }\n return v;\n }\n\n get assigning() {\n return this.__config[I_ASSIGNING];\n }\n}\n\nexport default Animation;\n","import mode from '../node/mode';\nimport geom from '../math/geom';\nimport blur from '../math/blur';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\n\nconst {\n NODE_KEY: {\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { int2rgba } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nfunction renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h, 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, DEG } = unit;\nconst { int2rgba, rgba2int, joinArr, isNil } = util;\nconst { calRelative } = css;\nconst { GEOM } = change;\nconst { mbmName, isValidMbm } = mbm;\nconst { point2d } = mx;\n\nconst {\n contain,\n NONE,\n TRANSFORM: TF,\n REFLOW,\n REPAINT,\n TRANSLATE_X: TX,\n TRANSLATE_Y: TY,\n TRANSLATE_Z: TZ,\n} = level;\n\nfunction getFirstEmptyInlineWidth(xom) {\n let n = 0;\n let flowChildren = xom.flowChildren;\n let length = flowChildren.length;\n for(let i = 0; i < length; i++) {\n let child = flowChildren[i];\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.flowChildren.length) {\n n += getFirstEmptyInlineWidth(child);\n break;\n }\n else if(child.__config[NODE_IS_INLINE]) {\n n += child.outerWidth;\n }\n }\n else {\n break;\n }\n }\n return n;\n}\n\nfunction getLastEmptyInlineWidth(xom) {\n let n = 0;\n let flowChildren = xom.flowChildren;\n let length = flowChildren.length;\n for(let i = length - 1; i >= 0; i--) {\n let child = flowChildren[i];\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.flowChildren.length) {\n n += getLastEmptyInlineWidth(child);\n break;\n }\n else {\n n += child.outerWidth;\n }\n }\n else {\n break;\n }\n }\n return n;\n}\n\nclass Xom extends Node {\n constructor(tagName, props = {}) {\n super();\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__tagName = tagName;\n this.__style = this.props.style || {}; // style被解析后的k-v形式\n this.__currentStyle = {}; // 动画过程中绘制一开始会merge动画样式\n this.__computedStyle = {}; // 类似getComputedStyle()将currentStyle计算好数值赋给\n this.__listener = {};\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n this.listener[k] = v;\n }\n });\n this.__animationList = [];\n this.__loadBgi = {\n // 刷新回调函数,用以destroy取消用\n cb: function() {\n },\n };\n this.__cacheStyle = {}; // 是否缓存重新计算computedStyle的样式key\n this.__cacheDefs = []; // svg专用,缓存渲染时使用已有的defs,diff过程用,否则会defs被清空\n let isClip = this.__isClip = !!this.props.clip;\n let isMask = this.__isMask = isClip || !!this.props.mask;\n let config = this.__config;\n config[NODE_TAG_NAME] = tagName;\n config[NODE_CACHE_STYLE] = this.__cacheStyle;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_COMPUTED_STYLE] = this.__computedStyle;\n config[NODE_REFRESH_LV] = REFLOW;\n config[NODE_STYLE] = this.__style;\n config[NODE_MATRIX] = [];\n config[NODE_MATRIX_EVENT] = [];\n config[NODE_DEFS_CACHE] = this.__cacheDefs;\n config[NODE_IS_MASK] = isMask;\n this.__frameAnimateList = [];\n this.__contentBoxList = []; // inline存储内容用\n // this.__json domApi需要获取生成时的json引用,builder过程添加,如appendChild时json也需要跟着变更\n 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 return 0;\n }\n\n // dom常用的几种尺寸赋值\n __ioSize(w, h) {\n let computedStyle = this.computedStyle;\n this.__clientWidth = w += computedStyle[PADDING_LEFT] + computedStyle[PADDING_RIGHT];\n this.__clientHeight = h += computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM];\n this.__offsetWidth = w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[BORDER_RIGHT_WIDTH];\n this.__offsetHeight = h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH];\n this.__outerWidth = w + computedStyle[MARGIN_LEFT] + computedStyle[MARGIN_RIGHT];\n this.__outerHeight = h + computedStyle[MARGIN_TOP] + computedStyle[MARGIN_BOTTOM];\n }\n\n // 换算margin/padding为px单位,onlyFixedValue只考虑绝对值,不考虑百分比等\n __calMp(v, w, onlyFixedValue) {\n let n = 0;\n if(v[1] === PX) {\n n += v[0];\n }\n else if(v[1] === PERCENT && !onlyFixedValue) {\n v[0] *= w * 0.01;\n v[1] = PX;\n n += v[0];\n }\n else if(v[1] === REM) {\n n += v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n n += v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n n += v[0] * this.root.height * 0.01;\n }\n return n;\n }\n\n // 为basis的b/min/max添加mpb,只有当b未显示指定等于w/content时才加,同时返回mpb值\n __addMp(isDirectionRow, w, currentStyle, res, isDirectItem) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w, !isDirectItem)\n + this.__calMp(marginRight, w, !isDirectItem)\n + this.__calMp(paddingLeft, w, !isDirectItem)\n + this.__calMp(paddingRight, w, !isDirectItem);\n if(borderLeftWidth[1] === PX) {\n mp += borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n mp += borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n mp += borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n mp += borderLeftWidth[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n mp += borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n mp += borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n mp += borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n mp += borderRightWidth[0] * this.root.height * 0.01;\n }\n res = res.map(item => item + mp);\n }\n else {\n let mp = this.__calMp(marginTop, w, !isDirectItem)\n + this.__calMp(marginBottom, w, !isDirectItem)\n + this.__calMp(paddingTop, w, !isDirectItem)\n + this.__calMp(paddingBottom, w, !isDirectItem);\n if(borderTopWidth[1] === PX) {\n mp += borderTopWidth[0];\n }\n else if(borderTopWidth[1] === REM) {\n mp += borderTopWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderTopWidth[1] === VW) {\n mp += borderTopWidth[0] * this.root.width * 0.01;\n }\n else if(borderTopWidth[1] === VH) {\n mp += borderTopWidth[0] * this.root.height * 0.01;\n }\n if(borderBottomWidth[1] === PX) {\n mp += borderBottomWidth[0];\n }\n else if(borderBottomWidth[1] === REM) {\n mp += borderBottomWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderBottomWidth[1] === VW) {\n mp += borderBottomWidth[0] * this.root.width * 0.01;\n }\n else if(borderBottomWidth[1] === VH) {\n mp += borderBottomWidth[0] * this.root.height * 0.01;\n }\n res = res.map(item => item + mp);\n }\n return res;\n }\n\n // absolute且无尺寸时,isVirtual标明先假布局一次计算尺寸,还有flex列计算时\n // fromAbs为absolute节点特有省略计算标识,本节点是abs时真正布局传入\n __layout(data, isVirtual, fromAbs) {\n css.computeReflow(this, this.isShadowRoot);\n let { w } = data;\n let { isDestroyed, currentStyle, computedStyle, __config } = this;\n let {\n [DISPLAY]: display,\n } = computedStyle;\n let {\n [WIDTH]: width,\n [POSITION]: position,\n } = currentStyle;\n this.clearCache();\n this.__layoutData = {\n x: data.x,\n y: data.y,\n w: data.w,\n h: data.h,\n lx: data.lx,\n };\n __config[NODE_REFRESH_LV] = REFLOW;\n __config[NODE_LIMIT_CACHE] = false;\n __config[NODE_IS_INLINE] = false;\n // 防止display:none不统计mask,isVirtual忽略,abs布局后续会真正来走一遍\n if(!isVirtual) {\n let { next } = this;\n // mask关系只有布局才会变更,普通渲染关系不会改变,clip也是mask的一种\n if(!this.isMask && next && (next.isMask)) {\n let count = 0;\n while(next) {\n if(next.isMask) {\n count++;\n }\n else {\n break;\n }\n next = next.next;\n }\n this.__hasMask = count;\n }\n }\n this.__ox = this.__oy = 0;\n if(isDestroyed || display === 'none') {\n this.__width = this.__height\n = this.__clientWidth = this.__clientHeight\n = this.__offsetWidth = this.__offsetHeight\n = this.__outerWidth = this.__outerHeight\n = computedStyle[WIDTH] = computedStyle[HEIGHT] = 0;\n this.__x = data.x;\n this.__y = data.y;\n this.__layoutNone();\n return;\n }\n // margin/padding在abs前已经计算过了,无需二次计算\n if(!fromAbs) {\n this.__mp(currentStyle, computedStyle, w);\n }\n // inline的width/height无效,其它有效\n if(width[1] !== AUTO) {\n if(this.__isRealInline() && currentStyle[DISPLAY] === 'inline') {\n width[0] = 0;\n width[1] = AUTO;\n }\n else {\n switch(width[1]) {\n case PX:\n w = width[0];\n break;\n case PERCENT:\n w *= width[0] * 0.01;\n break;\n case REM:\n w = width[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n w = width[0] * this.root.width * 0.01;\n break;\n case VH:\n w = width[0] * this.root.height * 0.01;\n break;\n }\n }\n }\n let lineClampCount = 0;\n // 4种布局,默认block,inlineBlock基本可以复用inline逻辑,除了尺寸\n if(display === 'flex') {\n this.__layoutFlex(data, isVirtual);\n }\n else if(display === 'inlineBlock' || display === 'inline-block') {\n lineClampCount = this.__layoutInline(data, isVirtual);\n }\n else if(display === 'inline') {\n lineClampCount = this.__layoutInline(data, isVirtual, true);\n }\n else {\n this.__layoutBlock(data, isVirtual);\n }\n // relative渲染时做偏移,百分比基于父元素,若父元素没有定高则为0\n if(position === 'relative') {\n let { [TOP]: top, [RIGHT]: right, [BOTTOM]: bottom, [LEFT]: left } = currentStyle;\n let { parent } = this;\n if(top[1] !== AUTO) {\n let n = calRelative(currentStyle, TOP, top, parent);\n this.__offsetY(n);\n computedStyle[TOP] = n;\n computedStyle[BOTTOM] = 'auto';\n }\n else if(bottom[1] !== AUTO) {\n let n = calRelative(currentStyle, BOTTOM, bottom, parent);\n this.__offsetY(-n);\n computedStyle[BOTTOM] = n;\n computedStyle[TOP] = 'auto';\n }\n else {\n computedStyle[TOP] = computedStyle[BOTTOM] = 'auto';\n }\n if(left[1] !== AUTO) {\n let n = calRelative(currentStyle, LEFT, left, parent, true);\n this.__offsetX(n);\n computedStyle[LEFT] = n;\n computedStyle[RIGHT] = 'auto';\n }\n else if(right[1] !== AUTO) {\n let n = calRelative(currentStyle, RIGHT, right, parent, true);\n this.__offsetX(-n);\n computedStyle[RIGHT] = n;\n computedStyle[LEFT] = 'auto';\n }\n else {\n computedStyle[LEFT] = computedStyle[RIGHT] = 'auto';\n }\n }\n else if(position !== 'absolute') {\n computedStyle[TOP] = computedStyle[BOTTOM] = computedStyle[LEFT] = computedStyle[RIGHT] = 'auto';\n }\n // 计算结果存入computedStyle和6个坐标,inline在其inlineSize特殊处理\n let x = this.__sx = this.x + this.ox;\n let y = this.__sy = this.y + this.oy;\n if(!__config[NODE_IS_INLINE]) {\n x = this.__sx1 = x + computedStyle[MARGIN_LEFT];\n x = this.__sx2 = x + computedStyle[BORDER_LEFT_WIDTH];\n x = this.__sx3 = x + computedStyle[PADDING_LEFT];\n x = this.__sx4 = x + this.width;\n x = this.__sx5 = x + computedStyle[PADDING_RIGHT];\n this.__sx6 = x + computedStyle[BORDER_RIGHT_WIDTH];\n y = this.__sy1 = y + computedStyle[MARGIN_TOP];\n y = this.__sy2 = y + computedStyle[BORDER_TOP_WIDTH];\n y = this.__sy3 = y + computedStyle[PADDING_TOP];\n y = this.__sy4 = y + this.height;\n y = this.__sy5 = y + computedStyle[PADDING_BOTTOM];\n this.__sy6 = y + computedStyle[BORDER_BOTTOM_WIDTH];\n }\n computedStyle[WIDTH] = this.width;\n computedStyle[HEIGHT] = this.height;\n // abs布局的不执行,在__layoutAbs末尾做,防止未布局没有尺寸从而动画计算错误\n if(!fromAbs) {\n this.__execAr();\n }\n return lineClampCount;\n }\n\n __execAr() {\n // 动态json引用时动画暂存,第一次布局时处理这些动画到root的animateController上\n let ar = this.__animateRecords;\n if(ar) {\n this.__animateRecords = null;\n // parse没有dom时,animate的target引用都是json,vd后生成需重新赋值\n ar.list.forEach(item => {\n if(item.target.vd instanceof Xom) {\n item.target = item.target.vd;\n }\n });\n let ac = ar.controller || this.root.animateController;\n // 不自动播放进入记录列表,初始化并等待手动调用\n if(ar.options && ar.options.autoPlay === false) {\n ac.__records2 = ac.__records2.concat(ar.list);\n ac.init(ac.__records2, ac.list2);\n }\n else {\n ac.__records = ac.__records.concat(ar.list);\n ac.__playAuto();\n }\n }\n }\n\n __layoutNone() {\n let { computedStyle } = this;\n computedStyle[DISPLAY] = 'none';\n computedStyle[MARGIN_TOP]\n = computedStyle[MARGIN_RIGHT]\n = computedStyle[MARGIN_BOTTOM]\n = computedStyle[MARGIN_LEFT]\n = computedStyle[PADDING_TOP]\n = computedStyle[PADDING_RIGHT]\n = computedStyle[PADDING_BOTTOM]\n = computedStyle[PADDING_LEFT]\n = 0;\n }\n\n // 预先计算是否是固定宽高,布局点位和尺寸考虑margin/border/padding\n __preLayout(data, isInline) {\n let { x, y, w, h, w2, h2, w3, h3, lx, nowrap, lineBoxManager, endSpace = 0 } = data;\n this.__x = x;\n this.__y = y;\n let { currentStyle, computedStyle } = this;\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n // 除了auto外都是固定宽高度\n let fixedWidth;\n let fixedHeight;\n // 绝对定位是left+right这种其实等于定义了width,但不能修改原始style,存入特殊变量标识\n if(w2 !== undefined) {\n fixedWidth = true;\n w = w2;\n }\n // flex时也会用到,子级得出目标主尺寸后按这个来\n else if(w3 !== undefined) {\n fixedWidth = true;\n w = w3;\n }\n else if(width[1] !== AUTO) {\n fixedWidth = true;\n switch(width[1]) {\n case PX:\n w = width[0];\n break;\n case PERCENT:\n w *= width[0] * 0.01;\n break;\n case REM:\n w = width[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n w = width[0] * this.root.width * 0.01;\n break;\n case VH:\n w = width[0] * this.root.height * 0.01;\n break;\n }\n }\n if(h2 !== undefined) {\n fixedHeight = true;\n h = h2;\n }\n else if(h3 !== undefined) {\n fixedHeight = true;\n h = h3;\n }\n else if(height[1] !== AUTO) {\n fixedHeight = true;\n switch(height[1]) {\n case PX:\n h = height[0];\n break;\n case PERCENT:\n h *= height[0] * 0.01;\n break;\n case REM:\n h = height[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n h = height[0] * this.root.width * 0.01;\n break;\n case VH:\n h = height[0] * this.root.height * 0.01;\n break;\n }\n }\n // margin/padding/border影响x和y和尺寸,注意inline的y不受mpb影响\n x += borderLeftWidth + marginLeft + paddingLeft;\n data.x = x;\n if(!isInline) {\n y += borderTopWidth + marginTop + paddingTop;\n }\n data.y = y;\n // inline的w/h很特殊,需不考虑inline自身水平的mpb以便换行,因为mpb只在首尾行生效,所以首尾需特殊处理中间忽略\n // 当嵌套inline时更加复杂,假如inline有尾部mpb,最后一行需考虑,如果此inline是父的最后一个且父有mpb需叠加\n let selfEndSpace = 0;\n if(isInline) {\n selfEndSpace = paddingRight + borderRightWidth + marginRight;\n }\n // 传入w3/h3时,flex的item已知目标主尺寸,需减去mpb,其一定是block和inline互斥\n if(!isInline) {\n if(width[1] === AUTO || w3 !== undefined) {\n w -= borderLeftWidth + borderRightWidth + marginLeft + marginRight + paddingLeft + paddingRight;\n }\n if(height[1] === AUTO || h3 !== undefined) {\n h -= borderTopWidth + borderBottomWidth + marginTop + marginBottom + paddingTop + paddingBottom;\n }\n }\n return {\n fixedWidth,\n fixedHeight,\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n nowrap,\n endSpace,\n selfEndSpace,\n };\n }\n\n // 处理margin:xx auto居中对齐或右对齐\n __marginAuto(style, data) {\n let {\n [POSITION]: position,\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [WIDTH]: width,\n } = style;\n if(position !== 'absolute' && (display === 'block' || display === 'flex')\n && (width[1] !== AUTO || this.tagName === 'img') && marginLeft[1] === AUTO && marginRight[1] === AUTO) {\n let ow = this.outerWidth;\n if(ow < data.w) {\n this.__offsetX((data.w - ow) * 0.5, true);\n }\n }\n }\n\n __calMatrix(lv, __cacheStyle, currentStyle, computedStyle, __config, sx1, sy1, offsetWidth, offsetHeight) {\n if(__config[NODE_IS_INLINE]) {\n computedStyle[TRANSFORM_ORIGIN] = [sx1, sy1];\n return __cacheStyle[MATRIX] = mx.identity();\n }\n let matrixCache = __cacheStyle[MATRIX];\n // tx/ty变化特殊优化\n if(matrixCache && lv < REFLOW && !contain(lv, TF)) {\n let x = 0, y = 0, z = 0;\n if(contain(lv, TX)) {\n let v = currentStyle[TRANSLATE_X];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else {\n v = v[0];\n }\n x = v - (computedStyle[TRANSLATE_X] || 0);\n computedStyle[TRANSLATE_X] = v;\n computedStyle[TRANSFORM][12] += x;\n matrixCache[12] += x;\n }\n if(contain(lv, TY)) {\n let v = currentStyle[TRANSLATE_Y];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetHeight * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else {\n v = v[0];\n }\n y = v - (computedStyle[TRANSLATE_Y] || 0);\n computedStyle[TRANSLATE_Y] = v;\n computedStyle[TRANSFORM][13] += y;\n matrixCache[13] += y;\n }\n if(contain(lv, TZ)) {\n let v = currentStyle[TRANSLATE_Z];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else {\n v = v[0];\n }\n z = v - (computedStyle[TRANSLATE_Z] || 0);\n computedStyle[TRANSLATE_Z] = v;\n computedStyle[TRANSFORM][14] += z;\n matrixCache[14] += z;\n }\n __cacheStyle[MATRIX] = matrixCache;\n }\n // 先根据cache计算需要重新计算的computedStyle\n else {\n if(sx1 === undefined) {\n sx1 = this.__sx1;\n sy1 = this.__sy1;\n offsetWidth = this.offsetWidth;\n offsetHeight = this.offsetHeight;\n }\n if(__cacheStyle[TRANSFORM_ORIGIN] === undefined) {\n __cacheStyle[TRANSFORM_ORIGIN] = true;\n matrixCache = null;\n computedStyle[TRANSFORM_ORIGIN] = tf.calOrigin(currentStyle[TRANSFORM_ORIGIN], offsetWidth, offsetHeight, this.root);\n }\n if(__cacheStyle[TRANSFORM] === undefined\n || __cacheStyle[TRANSLATE_X] === undefined\n || __cacheStyle[TRANSLATE_Y] === undefined\n || __cacheStyle[TRANSLATE_Z] === undefined\n || __cacheStyle[ROTATE_X] === undefined\n || __cacheStyle[ROTATE_Y] === undefined\n || __cacheStyle[ROTATE_Z] === undefined\n || __cacheStyle[ROTATE_3D] === undefined\n || __cacheStyle[SCALE_X] === undefined\n || __cacheStyle[SCALE_Y] === undefined\n || __cacheStyle[SCALE_Z] === undefined\n || __cacheStyle[SKEW_X] === undefined\n || __cacheStyle[SKEW_Y] === undefined) {\n __cacheStyle[TRANSFORM]\n = __cacheStyle[TRANSLATE_X]\n = __cacheStyle[TRANSLATE_Y]\n = __cacheStyle[TRANSLATE_Z]\n = __cacheStyle[ROTATE_X]\n = __cacheStyle[ROTATE_Y]\n = __cacheStyle[ROTATE_Z]\n = __cacheStyle[SCALE_X]\n = __cacheStyle[SCALE_Y]\n = __cacheStyle[SCALE_Z]\n = __cacheStyle[SKEW_X]\n = __cacheStyle[SKEW_Y]\n = true;\n matrixCache = null;\n let matrix;\n // transform相对于自身\n if(currentStyle[TRANSFORM]) {\n matrix = tf.calMatrix(currentStyle[TRANSFORM], offsetWidth, offsetHeight, this.root);\n }\n // 没有transform则看是否有扩展的css独立变换属性\n else {\n let temp = [];\n [\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n ROTATE_3D,\n SKEW_X,\n SKEW_Y,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n ].forEach(k => {\n // 删除之前遗留的\n delete computedStyle[k];\n let v = currentStyle[k];\n if(isNil(v)) {\n return;\n }\n if(k === ROTATE_3D) {\n computedStyle[k] = [v[0], v[1], v[2], v[3][0]];\n if(v[3][0] === 0) {\n return;\n }\n temp.push([k, v]);\n return;\n }\n computedStyle[k] = v[0];\n // scale为1和其它为0避免计算浪费\n let isScale = k === SCALE_X || k === SCALE_Y || k === SCALE_Z;\n if(v[0] === 1 && isScale || !isScale && v[0] === 0) {\n return;\n }\n if(v[1] === PERCENT) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * offsetWidth * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * offsetHeight * 0.01;\n }\n }\n else if(v[1] === REM) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n }\n else if(v[1] === VW) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.width * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.width * 0.01;\n }\n }\n else if(v[1] === VH) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.height * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.height * 0.01;\n }\n }\n temp.push([k, v]);\n });\n if(temp.length) {\n matrix = tf.calMatrix(temp, offsetWidth, offsetHeight, this.root);\n }\n }\n computedStyle[TRANSFORM] = matrix || mx.identity();\n }\n if(!matrixCache) {\n let m = computedStyle[TRANSFORM];\n let tfo = computedStyle[TRANSFORM_ORIGIN].slice(0);\n tfo[0] += sx1 || 0;\n tfo[1] += sy1 || 0;\n matrixCache = __cacheStyle[MATRIX] = tf.calMatrixByOrigin(m, tfo);\n }\n }\n return matrixCache;\n }\n\n /**\n * 将currentStyle计算为computedStyle,同时存入cacheStyle可缓存的结果防止无变更重复计算\n * @param renderMode\n * @param ctx\n * @param parent\n * @param __cacheStyle\n * @param currentStyle\n * @param computedStyle\n * @param clientWidth\n * @param clientHeight\n * @param offsetWidth\n * @param offsetHeight\n * @param borderTopWidth\n * @param borderRightWidth\n * @param borderBottomWidth\n * @param borderLeftWidth\n * @param paddingTop\n * @param paddingRight\n * @param paddingBottom\n * @param paddingLeft\n * @param x1\n * @param x2\n * @param x3\n * @param x4\n * @param x5\n * @param x6\n * @param y1\n * @param y2\n * @param y3\n * @param y4\n * @param y5\n * @param y6\n * @returns {*[]}\n * @private\n */\n __calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6) {\n let bx1 = x1, by1 = y1, bx2 = x6, by2 = y6;\n let backgroundClip = computedStyle[BACKGROUND_CLIP] = currentStyle[BACKGROUND_CLIP];\n // 默认border-box\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n bx1 = x2;\n by1 = y2;\n bx2 = x5;\n by2 = y5;\n }\n else if(backgroundClip === 'contentBox' || backgroundClip === 'content-box') {\n bx1 = x3;\n by1 = y3;\n bx2 = x4;\n by2 = y4;\n }\n let isInline = this.__config[NODE_IS_INLINE];\n if(isInline && !this.contentBoxList.length) {\n isInline = false;\n }\n // 这些直接赋值的不需要再算缓存\n [\n OPACITY,\n Z_INDEX,\n BORDER_TOP_STYLE,\n BORDER_RIGHT_STYLE,\n BORDER_BOTTOM_STYLE,\n BORDER_LEFT_STYLE,\n BACKGROUND_REPEAT,\n OVERFLOW,\n MIX_BLEND_MODE,\n TEXT_OVERFLOW,\n BACKGROUND_CLIP,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n if(isNil(__cacheStyle[FILTER])) {\n __cacheStyle[FILTER] = true;\n this.__calFilter(currentStyle, computedStyle);\n }\n if(isNil(__cacheStyle[BACKGROUND_POSITION_X])) {\n __cacheStyle[BACKGROUND_POSITION_X] = true;\n let {\n [BACKGROUND_POSITION_X]: bgX,\n } = currentStyle;\n computedStyle[BACKGROUND_POSITION_X] = (bgX || []).map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n if(item[1] === PERCENT) {\n return item[0] + '%';\n }\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_POSITION_Y])) {\n __cacheStyle[BACKGROUND_POSITION_Y] = true;\n let {\n [BACKGROUND_POSITION_Y]: bgY,\n } = currentStyle;\n computedStyle[BACKGROUND_POSITION_Y] = (bgY || []).map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n if(item[1] === PERCENT) {\n return item[0] + '%';\n }\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_SIZE])) {\n __cacheStyle[BACKGROUND_SIZE] = true;\n computedStyle[BACKGROUND_SIZE] = (currentStyle[BACKGROUND_SIZE] || []).map(item => {\n return bg.calBackgroundSize(item, bx2 - bx1, by2 - by1, this.root);\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_IMAGE])) {\n let bgI = computedStyle[BACKGROUND_IMAGE] = currentStyle[BACKGROUND_IMAGE].slice(0);\n __cacheStyle[BACKGROUND_IMAGE] = bgI.map((bgi, i) => {\n if(!bgi) {\n return null;\n }\n // 防止隐藏不加载背景图\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i] = this.__loadBgi[i] || {};\n let cache = inject.IMG[BACKGROUND_IMAGE];\n if(cache && cache.state === inject.LOADED) {\n loadBgi.url = BACKGROUND_IMAGE;\n loadBgi.source = cache.source;\n loadBgi.width = cache.width;\n loadBgi.height = cache.height;\n }\n else if(loadBgi.url !== bgi) {\n // 可能改变导致多次加载,每次清空,成功后还要比对url是否相同\n loadBgi.url = bgi;\n loadBgi.source = null;\n let node = this;\n let root = node.root;\n inject.measureImg(bgi, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败不绘制bgi\n if(data.success && data.url === loadBgi.url && !this.isDestroyed) {\n loadBgi.source = data.source;\n loadBgi.width = data.width;\n loadBgi.height = data.height;\n root.delRefreshTask(loadBgi.cb);\n root.addRefreshTask(loadBgi.cb = {\n __before() {\n __cacheStyle[BACKGROUND_IMAGE] = undefined;\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_FOCUS] = REPAINT;\n res[UPDATE_CONFIG] = node.__config;\n root.__addUpdate(node, node.__config, root, root.__config, res);\n },\n });\n }\n }, {\n ctx,\n root,\n width: bx2 - bx1,\n height: by2 - by1,\n });\n }\n return true;\n }\n else if(!isInline && bgi.k) {\n // gradient在渲染时才生成\n return true;\n }\n });\n }\n if(isNil(__cacheStyle[BOX_SHADOW])) {\n __cacheStyle[BOX_SHADOW] = true;\n computedStyle[BOX_SHADOW] = (currentStyle[BOX_SHADOW] || []).map(item => {\n return item.map((item2, i) => {\n if(i > 3) {\n return item2;\n }\n let v = item2[0];\n if(item2[1] === PERCENT) {\n if(i % 2 === 0) {\n v *= 0.01 * (bx2 - bx1);\n }\n else {\n v *= 0.01 * (by2 - by1);\n }\n }\n else if(item2[1] === REM) {\n v = v * this.root.computedStyle[FONT_SIZE];\n }\n else if(item2[1] === VW) {\n v = v * this.root.width * 0.01;\n }\n else if(item2[1] === VH) {\n v = v * this.root.height * 0.01;\n }\n return v;\n });\n });\n }\n [\n BACKGROUND_COLOR,\n BORDER_TOP_COLOR,\n BORDER_RIGHT_COLOR,\n BORDER_BOTTOM_COLOR,\n BORDER_LEFT_COLOR,\n ].forEach(k => {\n if(isNil(__cacheStyle[k])) {\n __cacheStyle[k] = int2rgba(computedStyle[k] = currentStyle[k][0]);\n }\n });\n // 圆角边计算\n if(isNil(__cacheStyle[BORDER_TOP_LEFT_RADIUS])\n || isNil(__cacheStyle[BORDER_TOP_RIGHT_RADIUS])\n || isNil(__cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS])\n || isNil(__cacheStyle[BORDER_BOTTOM_LEFT_RADIUS])) {\n __cacheStyle[BORDER_TOP_LEFT_RADIUS]\n = __cacheStyle[BORDER_TOP_RIGHT_RADIUS]\n = __cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS]\n = __cacheStyle[BORDER_BOTTOM_LEFT_RADIUS]\n = true;\n // 非替代的inline计算看contentBox首尾\n if(isInline) {\n border.calBorderRadiusInline(this.contentBoxList, currentStyle, computedStyle, this.root);\n }\n // 普通block整体计算\n else {\n border.calBorderRadius(offsetWidth, offsetHeight, currentStyle, computedStyle, this.root);\n }\n }\n // width/style/radius影响border,color不影响渲染缓存\n let btlr = computedStyle[BORDER_TOP_LEFT_RADIUS];\n let btrr = computedStyle[BORDER_TOP_RIGHT_RADIUS];\n let bbrr = computedStyle[BORDER_BOTTOM_RIGHT_RADIUS];\n let bblr = computedStyle[BORDER_BOTTOM_LEFT_RADIUS];\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k;\n let k2 = STYLE_KEY[style2Upper(k)];\n let kw = STYLE_KEY[style2Upper(k + 'Width')];\n let ks = STYLE_KEY[style2Upper(k + 'Style')];\n // width/style变更影响border重新计算\n if(isNil(__cacheStyle[kw])) {\n __cacheStyle[kw] = true;\n __cacheStyle[k2] = undefined;\n }\n if(isNil(__cacheStyle[ks])) {\n __cacheStyle[ks] = true;\n __cacheStyle[k2] = undefined;\n }\n if(isNil(__cacheStyle[k2])) {\n if(k2 === BORDER_TOP) {\n if(borderTopWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderTopWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 0, btlr, btrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_RIGHT) {\n if(borderRightWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderRightWidth / borderTopWidth);\n let deg2 = Math.atan(borderRightWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderRightWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 1, btrr, bbrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_BOTTOM) {\n if(borderBottomWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderBottomWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 2, bblr, bbrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_LEFT) {\n if(borderLeftWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderLeftWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 3, btlr, bblr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n }\n });\n // 强制计算继承性的\n let parentComputedStyle = parent && parent.computedStyle;\n if(currentStyle[FONT_STYLE][1] === INHERIT) {\n computedStyle[FONT_STYLE] = parent ? parentComputedStyle[FONT_STYLE] : 'normal';\n }\n else if(isNil(__cacheStyle[FONT_STYLE])) {\n computedStyle[FONT_STYLE] = currentStyle[FONT_STYLE][0];\n }\n __cacheStyle[FONT_STYLE] = computedStyle[FONT_STYLE];\n if(currentStyle[COLOR][1] === INHERIT) {\n computedStyle[COLOR] = parent ? parentComputedStyle[COLOR] : [0, 0, 0, 1];\n __cacheStyle[COLOR] = int2rgba(computedStyle[COLOR]);\n }\n else if(isNil(__cacheStyle[COLOR])) {\n computedStyle[COLOR] = rgba2int(currentStyle[COLOR][0]);\n __cacheStyle[COLOR] = int2rgba(computedStyle[COLOR]);\n }\n if(currentStyle[TEXT_STROKE_COLOR][1] === INHERIT) {\n computedStyle[TEXT_STROKE_COLOR] = parent ? parentComputedStyle[TEXT_STROKE_COLOR] : [0, 0, 0, 1];\n __cacheStyle[TEXT_STROKE_COLOR] = int2rgba(computedStyle[TEXT_STROKE_COLOR]);\n }\n else if(isNil(__cacheStyle[TEXT_STROKE_COLOR])) {\n computedStyle[TEXT_STROKE_COLOR] = rgba2int(currentStyle[TEXT_STROKE_COLOR][0]);\n __cacheStyle[TEXT_STROKE_COLOR] = int2rgba(computedStyle[TEXT_STROKE_COLOR]);\n }\n if(currentStyle[TEXT_STROKE_WIDTH][1] === INHERIT) {\n computedStyle[TEXT_STROKE_WIDTH] = parent ? parentComputedStyle[TEXT_STROKE_WIDTH] : 0;\n __cacheStyle[TEXT_STROKE_WIDTH] = true;\n }\n else if(isNil(__cacheStyle[TEXT_STROKE_WIDTH])) {\n let v = currentStyle[TEXT_STROKE_WIDTH];\n if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else {\n v = v[0];\n }\n computedStyle[TEXT_STROKE_WIDTH] = v;\n __cacheStyle[TEXT_STROKE_WIDTH] = true;\n }\n if(currentStyle[TEXT_STROKE_OVER][1] === INHERIT) {\n __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = parent ? parentComputedStyle[TEXT_STROKE_OVER] : 'none';\n }\n else {\n __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = currentStyle[TEXT_STROKE_OVER][0];\n }\n if(currentStyle[VISIBILITY][1] === INHERIT) {\n computedStyle[VISIBILITY] = parent ? parentComputedStyle[VISIBILITY] : 'visible';\n }\n else if(isNil(__cacheStyle[VISIBILITY])) {\n computedStyle[VISIBILITY] = currentStyle[VISIBILITY][0];\n }\n __cacheStyle[VISIBILITY] = computedStyle[VISIBILITY];\n if(currentStyle[POINTER_EVENTS][1] === INHERIT) {\n computedStyle[POINTER_EVENTS] = parent ? parentComputedStyle[POINTER_EVENTS] : 'auto';\n }\n else if(isNil(__cacheStyle[POINTER_EVENTS])) {\n computedStyle[POINTER_EVENTS] = currentStyle[POINTER_EVENTS][0];\n }\n __cacheStyle[POINTER_EVENTS] = computedStyle[POINTER_EVENTS];\n 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 {\n ppt = v[0];\n }\n computedStyle[PERSPECTIVE] = ppt;\n }\n if(isNil(__cacheStyle[PERSPECTIVE_ORIGIN])) {\n __cacheStyle[PERSPECTIVE_ORIGIN] = true;\n rebuild = true;\n computedStyle[PERSPECTIVE_ORIGIN] = tf.calOrigin(currentStyle[PERSPECTIVE_ORIGIN], this.offsetWidth, this.offsetHeight, this.root);\n }\n if(rebuild) {\n if(sx1 === undefined) {\n sx1 = this.__sx1;\n sy1 = this.__sy1;\n }\n let po = computedStyle[PERSPECTIVE_ORIGIN].slice(0);\n po[0] += sx1 || 0;\n po[1] += sy1 || 0;\n __config[NODE_PERSPECTIVE_MATRIX] = tf.calPerspectiveMatrix(computedStyle[PERSPECTIVE], po);\n }\n }\n\n __calFilter(currentStyle, computedStyle) {\n return computedStyle[FILTER] = (currentStyle[FILTER] || []).map(item => {\n let [k, v] = item;\n // 部分%单位的滤镜强制使用数字\n if(v[1] === PX || v[1] === DEG || v[1] === PERCENT || v[1] === NUMBER) {\n v = v[0];\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n return [k, v];\n });\n }\n\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n if(renderMode === CANVAS || renderMode === WEBGL) {\n if(lv < REPAINT) {\n return this.__hasContent;\n }\n let visibility = currentStyle[VISIBILITY];\n if(visibility !== 'hidden') {\n let bgI = currentStyle[BACKGROUND_IMAGE];\n if(Array.isArray(bgI)) {\n for(let i = 0, len = bgI.length; i < len; i++) {\n if(bgI[i]) {\n return true;\n }\n }\n }\n if(currentStyle[BACKGROUND_COLOR][0][3] > 0) {\n let width = computedStyle[WIDTH], height = computedStyle[HEIGHT],\n paddingTop = computedStyle[PADDING_TOP], paddingRight = computedStyle[PADDING_RIGHT],\n paddingBottom = computedStyle[PADDING_BOTTOM], paddingLeft = computedStyle[PADDING_LEFT];\n if(width && height || paddingTop || paddingRight || paddingBottom || paddingLeft) {\n return true;\n }\n }\n for(let list = ['Top', 'Right', 'Bottom', 'Left'], i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n if(computedStyle[STYLE_KEY[style2Upper('border' + k + 'Width')]] > 0\n && currentStyle[STYLE_KEY[style2Upper('border' + k + 'Color')]][0][3] > 0) {\n return true;\n }\n }\n let bs = currentStyle[BOX_SHADOW];\n if(Array.isArray(bs)) {\n for(let i = 0, len = bs.length; i < len; i++) {\n let item = bs[i];\n if(item && (item[2] > 0 || item[3] > 0)) {\n return true;\n }\n }\n }\n }\n }\n return false;\n }\n\n /**\n * 渲染基础方法,Dom/Geom公用\n * @param renderMode\n * @param lv\n * @param ctx canvas/svg/webgl共用\n * @param cache 是否是局部根节点缓存模式下的绘制\n * @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 this.__bbox = null;\n if(isDestroyed) {\n return { isDestroyed, break: true };\n }\n let virtualDom;\n // svg设置vd上的lv属性标明lineHeight的话,另外特殊字体如arial拥有lineGap也会产生间隙,背景色不绘制这个间隙\n * x轴根据contentBox的范围坐标,y则固定和font/lineHeight相关\n * 圆角发生在首尾lineBox处,中间不会有,bgi则产生类似bgc作为mask的效果\n * 另外要注意多个时的顺序,必须依次渲染,后面的bb可能会覆盖前面行的\n */\n if(isRealInline) {\n let contentBoxList = this.contentBoxList;\n let length = contentBoxList.length;\n let hasBgi = backgroundImage.some(item => item);\n if(length) {\n let {\n [FONT_SIZE]: fontSize,\n [FONT_FAMILY]: fontFamily,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let iw = 0, ih = 0;\n let offscreen, svgBgSymbol = [];\n // bgi视作inline排满一行绘制,然后按分行拆开给每行\n if(hasBgi) {\n iw = inline.getInlineWidth(this, contentBoxList);\n ih = lineHeight;\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n iw += paddingLeft + paddingRight;\n ih += paddingTop + paddingBottom;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n iw += paddingLeft + paddingRight + borderLeftWidth + borderRightWidth;\n ih += paddingTop + paddingBottom + borderTopWidth + borderBottomWidth;\n }\n if(renderMode === CANVAS || renderMode === WEBGL) {\n offscreen = inject.getCacheCanvas(iw, ih, '__$$INLINE_BGI$$__');\n }\n let length = backgroundImage.length;\n backgroundImage.slice(0).reverse().forEach((bgi, i) => {\n if(!bgi) {\n return;\n }\n i = length - 1 - i;\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i];\n if(loadBgi.url === backgroundImage[i]) {\n let uuid = bg.renderImage(this, renderMode, offscreen && offscreen.ctx || ctx, loadBgi,\n 0, 0, iw, ih, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, true, 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.delRefreshTask(this.__loadBgi.cb);\n root.delRefreshTask(this.__task);\n this.__task = null;\n this.__root = null;\n this.clearCache();\n }\n\n // 先查找到注册了事件的节点,再捕获冒泡判断增加性能\n __emitEvent(e, force) {\n let { isDestroyed, computedStyle, isMask } = this;\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || e.__stopPropagation || isMask) {\n return;\n }\n let { event: { type } } = e;\n let { listener, __hasMask } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // touchmove之类强制的直接由Root通知即可\n if(force) {\n if(computedStyle[POINTER_EVENTS] !== 'none' && util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n // 非force的判断事件坐标是否在节点内\n if(this.willResponseEvent(e)) {\n // 如果有mask,点在mask上才行,点在clip外才行\n if(__hasMask) {\n let next = this.next;\n let isClip = next.isClip;\n let hasEmitMask;\n while(next && next.isMask) {\n if(next.willResponseEvent(e, true)) {\n hasEmitMask = true;\n break;\n }\n next = next.next;\n }\n if(!isClip && !hasEmitMask) {\n return;\n }\n }\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n\n willResponseEvent(e, ignore) {\n let { x, y } = e;\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent, computedStyle } = this;\n if(computedStyle[POINTER_EVENTS] === 'none') {\n return;\n }\n let inThis = geom.pointInQuadrilateral(\n x, y,\n __sx1, __sy1,\n __sx1 + offsetWidth, __sy1,\n __sx1 + offsetWidth, __sy1 + offsetHeight,\n __sx1, __sy1 + offsetHeight,\n matrixEvent\n );\n if(inThis) {\n if(!e.target && !ignore) {\n e.target = this;\n // 缓存target给move用\n if(e.event.type === 'touchstart') {\n this.root && (this.root.__touchstartTarget = this);\n }\n }\n return true;\n }\n }\n\n __gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi, 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(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, formatStyle);\n if(util.isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n // 传入格式化好key/value的样式\n updateFormatStyle(style, cb) {\n let node = this;\n let { root, __config } = node;\n if(root) {\n root.addRefreshTask(node.__task = {\n __before() {\n node.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(__config[NODE_IS_DESTROYED]) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n res[UPDATE_CONFIG] = __config;\n root.__addUpdate(node, __config, root, root.__config, res);\n },\n __after(diff) {\n if(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, style);\n if(util.isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n animate(list, options = {}) {\n let animation = new Animation(this, list, options);\n if(this.isDestroyed) {\n animation.__destroy(true);\n return animation;\n }\n this.animationList.push(animation);\n if(options.autoPlay === false) {\n return animation;\n }\n return animation.play();\n }\n\n removeAnimate(o) {\n if(o instanceof Animation) {\n let i = this.animationList.indexOf(o);\n if(i > -1) {\n o.cancel();\n o.__destroy();\n this.animationList.splice(i, 1);\n }\n }\n }\n\n clearAnimate() {\n this.animationList.splice(0).forEach(o => {\n o.cancel();\n o.__destroy();\n });\n }\n\n frameAnimate(cb) {\n if(util.isFunction(cb)) {\n let list = this.__frameAnimateList;\n // 防止重复\n for(let i = 0, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n return cb;\n }\n }\n let enter = {\n __after(diff) {\n cb(diff);\n },\n __karasFramecb: cb,\n };\n list.push(enter);\n frame.onFrame(enter);\n return cb;\n }\n }\n\n removeFrameAnimate(cb) {\n for(let i = 0, list = this.__frameAnimateList, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n list.splice(i, 1);\n frame.offFrame(cb);\n return;\n }\n }\n }\n\n clearFrameAnimate() {\n this.__frameAnimateList.splice(0).forEach(o => {\n frame.offFrame(o);\n });\n }\n\n __computeMeasure(renderMode, ctx, cb) {\n css.computeMeasure(this);\n if(util.isFunction(cb)) {\n cb(this);\n }\n }\n\n __deepScan(cb, options) {\n return cb(this, options);\n }\n\n // isLayout为false时,为relative/margin/flex/vertical等\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.__layoutData.x += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sx1 += diff;\n this.__sx2 += diff;\n this.__sx3 += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.__layoutData.y += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sy1 += diff;\n this.__sy2 += diff;\n this.__sy3 += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n }\n\n __resizeX(diff, lv) {\n this.computedStyle.width = this.__width += diff;\n this.__clientWidth += diff;\n this.__offsetWidth += diff;\n this.__outerWidth += diff;\n this.__layoutData.w += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __resizeY(diff, lv) {\n this.computedStyle.height = this.__height += diff;\n this.__clientHeight += diff;\n this.__offsetHeight += diff;\n this.__outerHeight += diff;\n this.__layoutData.h += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __spreadBbox(boxShadow) {\n let ox = 0, oy = 0;\n if(Array.isArray(boxShadow)) {\n boxShadow.forEach(item => {\n let [x, y, sigma, spread, , inset] = item;\n if(inset !== 'inset') {\n let d = blur.outerSize(sigma);\n d += spread;\n ox = Math.max(ox, x + d);\n oy = Math.max(oy, y + d);\n }\n });\n }\n return [ox, oy];\n }\n\n __releaseWhenEmpty(__cache) {\n if(__cache && __cache.available) {\n __cache.release();\n }\n return true;\n }\n\n getComputedStyle(key) {\n let computedStyle = this.computedStyle;\n let res = {};\n let keys;\n if(key) {\n if(Array.isArray(key)) {\n keys = key;\n }\n else {\n keys = [key];\n }\n keys = keys.map(s => {\n return STYLE_KEY[style2Upper(s)];\n });\n }\n else {\n keys = Object.keys(computedStyle);\n }\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n res[k] = computedStyle[k];\n }\n else {\n res[STYLE_RV_KEY[k]] = computedStyle[k];\n }\n });\n return res;\n }\n\n getBoundingClientRect() {\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent } = this;\n let p1 = point2d(mx.calPoint([__sx1, __sy1], matrixEvent));\n let p2 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1], matrixEvent));\n let p3 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1 + offsetHeight], matrixEvent));\n let p4 = point2d(mx.calPoint([__sx1, __sy1 + offsetHeight], matrixEvent));\n return {\n left: Math.min(p1[0], Math.min(p2[0], Math.min(p3[0], p4[0]))),\n top: Math.min(p1[1], Math.min(p2[1], Math.min(p3[1], p4[1]))),\n right: Math.max(p1[0], Math.max(p2[0], Math.max(p3[0], p4[0]))),\n bottom: Math.max(p1[1], Math.max(p2[1], Math.max(p3[1], p4[1]))),\n points: [p1, p2, p3, p4],\n };\n }\n\n // img和geom返回false,在inline布局时判断是否是真的inline\n __isRealInline() {\n return true;\n }\n\n remove(cb) {\n let self = this;\n if(self.isDestroyed) {\n inject.warn('Remove target is destroyed.');\n if(util.isFunction(cb)) {\n cb();\n }\n return;\n }\n let { root, domParent } = self;\n let target = self.isShadowRoot ? self.hostRoot : self;\n // 特殊情况连续append/remove时候,还未被添加进来找不到所以无需删除\n if(domParent.children.indexOf(target) === -1) {\n if(util.isFunction(cb)) {\n cb();\n }\n return;\n }\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n let pJson = domParent.__json;\n let i = pJson.children.indexOf(self.isShadowRoot ? self.hostRoot.__json : self.__json);\n let zChildren = domParent.zIndexChildren;\n let j = zChildren.indexOf(self.isShadowRoot ? self.hostRoot : self);\n if(i === -1 || j === -1) {\n throw new Error('Remove index Exception.')\n }\n pJson.children.splice(i, 1);\n domParent.children.splice(i, 1);\n zChildren.splice(j, 1);\n if(self.__prev) {\n self.__prev.__next = self.__next;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_REMOVE_DOM] = true;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after(diff) {\n self.isShadowRoot ? self.hostRoot.__destroy() : self.__destroy();\n if(util.isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get sx() {\n return this.__sx;\n }\n\n get sy() {\n return this.__sy;\n }\n\n get clientWidth() {\n return this.__clientWidth || 0;\n }\n\n get clientHeight() {\n return this.__clientHeight || 0;\n }\n\n get offsetWidth() {\n return this.__offsetWidth || 0;\n }\n\n get offsetHeight() {\n return this.__offsetHeight || 0;\n }\n\n get outerWidth() {\n return this.__outerWidth || 0;\n }\n\n get outerHeight() {\n return this.__outerHeight || 0;\n }\n\n // 不考虑margin的范围,>=REPAINT渲染或个别有影响的渲染改变(如blur)清空缓存\n get bbox() {\n if(!this.__bbox) {\n let {\n __sx1, __sy1, clientWidth, clientHeight,\n currentStyle: {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BOX_SHADOW]: boxShadow,\n },\n } = this;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n clientWidth += borderLeftWidth[0] + borderRightWidth[0];\n clientHeight += borderTopWidth[0] + borderBottomWidth[0];\n let half = 1;\n this.__bbox = [__sx1 - ox - half, __sy1 - oy - half, __sx1 + clientWidth + ox + half, __sy1 + clientHeight + oy + half];\n }\n return this.__bbox;\n }\n\n get listener() {\n return this.__listener;\n }\n\n get matrix() {\n return this.__config[NODE_MATRIX];\n }\n\n get matrixEvent() {\n return this.__config[NODE_MATRIX_EVENT];\n }\n\n get perspectiveMatrix() {\n return this.__config[NODE_PERSPECTIVE_MATRIX];\n }\n\n get style() {\n return this.__style;\n }\n\n get computedStyle() {\n return this.__computedStyle;\n }\n\n get animationList() {\n return this.__animationList;\n }\n\n get currentStyle() {\n return this.__currentStyle;\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get contentBoxList() {\n return this.__contentBoxList;\n }\n\n get baseLine() {\n return this.offsetHeight;\n }\n\n get firstBaseLine() {\n return this.offsetHeight;\n }\n\n get isMask() {\n return this.__isMask;\n }\n\n get isClip() {\n return this.__isClip;\n }\n\n 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 n = this.baseLine;\n // 只有1个也需要对齐,因为可能内嵌了空inline使得baseLine发生变化\n if(this.list.length) {\n this.list.forEach(item => {\n let m = item.baseLine;\n if(m !== n) {\n item.__offsetY(n - m);\n }\n });\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n /**\n * 防止非行首空inline,每当遇到inline就设置当前lineBox的lineHeight/baseLine,这样有最小值兜底\n * @param l\n * @param b\n * @private\n */\n __setLB(l, b) {\n this.__lineHeight = Math.max(l, this.__lineHeight);\n this.__baseLine = Math.max(b, this.__baseLine);\n }\n\n get list() {\n return this.__list;\n }\n\n get size() {\n return this.__list.length;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endY() {\n return this.y + this.height;\n }\n\n get width() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let first = list[0];\n let last = list[length - 1];\n let x1 = first.x;\n let dom = first instanceof TextBox ? first.parent.domParent : first.domParent;\n // 因为inline可以嵌套inline,所以一直向上查找到非inline为止,每层inline如果是首个则减去左侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [PADDING_LEFT]: paddingLeft,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[0]) {\n x1 -= marginLeft + borderLeftWidth + paddingLeft;\n }\n dom = dom.domParent;\n }\n let x2 = last.x + last.outerWidth;\n dom = last instanceof TextBox ? last.parent.domParent : last.domParent;\n // 同向上查非inline,每层inline如果是最后一个则加上右侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_RIGHT]: paddingRight,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[list.length - 1]) {\n x2 += marginRight + borderRightWidth + paddingRight;\n }\n dom = dom.domParent;\n }\n return x2 - x1;\n }\n return 0;\n }\n\n get height() {\n return this.lineHeight;\n }\n\n get baseLine() {\n let baseLine = 0;\n this.list.forEach(item => {\n baseLine = Math.max(baseLine, item.baseLine);\n });\n return Math.max(this.__baseLine, baseLine);\n }\n\n get lineHeight() {\n let lineHeight = 0;\n // 只有TextBox和InlineBlock\n this.list.forEach(item => {\n lineHeight = Math.max(lineHeight, item.outerHeight);\n });\n return Math.max(this.__lineHeight, lineHeight);\n }\n}\n\nexport default LineBox;\n","import LineBox from './LineBox';\n\n/**\n * 维护一个上下文的LineBox,向LineBox中添加Item以及新增下一行的LineBox,多个LineBox组成一个区域\n * 一个block/inlineBlock拥有一个本类对象,上下文即对应这个dom流,而inline则复用最近非inline父元素的\n * 同时LineBox可能连续也可能不连续,不连续的是中间有block之类的隔离开来\n */\nclass LineBoxManager {\n constructor(x, y, lineHeight, baseLine) {\n this.__x = this.__lastX = x; // last存储目前最后一行LineBox的结尾位置,供后续inline使用\n this.__y = this.__lastY = y;\n this.__maxX = x;\n this.__domList = [];\n this.__domStack = [];\n this.__list = []; // 包含若干LineBox\n this.__isNewLine = true; // 区域内是否是新行,容器dom(block)开头肯定是\n this.__lineHeight = lineHeight;\n this.__baseLine = baseLine;\n this.__isEnd = true; // 在dom中是否一个区域处在结尾,外部控制\n }\n\n /**\n * 每次换行时重新生成LineBox存入列表,同时由于flow流当前一定是流(dom)的结尾,设置isEnd\n * @returns {LineBox}\n */\n genLineBox(x, y) {\n let lineBox = new LineBox(x, y, this.__lineHeight, this.__baseLine);\n this.list.push(lineBox);\n this.__isEnd = true;\n return lineBox;\n }\n\n /**\n * inline的特殊调用,防止空内容但有mbp的inline不占位,放入一个有lineHeight的空lineBox\n * 只有新行开头时需要,后面的无论是否有内容都会影响lineHeight\n * @param x\n * @param y\n * @param l\n * @param b\n * @returns {LineBox}\n */\n genLineBoxByInlineIfNewLine(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseLine = Math.max(this.__baseLine, b);\n if(this.__isNewLine) {\n let lineBox = new LineBox(x, y, lineHeight, baseLine);\n this.list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n }\n\n setLbOrGenLineBoxByInline(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseLine = Math.max(this.__baseLine, b);\n let lineBox;\n let list = this.list;\n if(this.__isNewLine) {\n lineBox = new LineBox(x, y, lineHeight, baseLine);\n list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n else {\n let length = list.length;\n lineBox = list[length - 1];\n lineBox.__setLB(l, b);\n }\n }\n\n /**\n * 外部设置为结尾,如一个LineBox后出现一个block,此时会被隔断,不再作为流的末尾\n */\n setNotEnd() {\n this.__isEnd = false;\n }\n\n /**\n * 外部设置新行,下次新生成LineBox\n */\n setNewLine() {\n this.__isNewLine = true;\n }\n\n /**\n * 当前LineBox放入一个新项,当新行时(如第一行)产生一个新的LineBox并存入列表\n * 是否新区域和新行都是可以被外部控制,默认第一行是新\n * 当被隔断后会被外部重置新行,这样会生成新的来作为新加项的LineBox\n * 当换行时外部也会调用新行,这样再次添加Item时会自动生成新的LineBox而不是用之前的\n * @param o TextBox/Inline/InlineBlock\n * @param nextNewLine 是否设置newLine,标明下次添加新生成LineBox\n * @returns {LineBox}\n */\n addItem(o, nextNewLine) {\n let lineBox;\n if(this.__isNewLine) {\n this.__isNewLine = false;\n lineBox = this.genLineBox(o.x, o.y);\n }\n else {\n let list = this.list;\n let length = list.length;\n lineBox = list[length - 1];\n }\n // inline递归过程中所有inline父子顺序列表,每个dom都需要对当前内容保存\n this.__domStack.forEach(item => {\n item.__contentBoxList.push(o);\n });\n lineBox.add(o);\n // 设置结束x的位置给next的inline标记用,o可能是TextBox或inlineBlock,当next新行时注意位置\n if(nextNewLine) {\n this.__isNewLine = true;\n this.__lastX = o.x;\n this.__lastY = o.y + o.outerHeight;\n }\n else {\n this.__lastX = o.x + o.outerWidth;\n this.__lastY = o.y;\n }\n this.__maxX = Math.max(this.__maxX, o.x + o.outerWidth);\n return lineBox;\n }\n\n horizonAlign(w, textAlign) {\n this.list.forEach(lineBox => {\n let diff = w - lineBox.width;\n if(diff > 0) {\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n lineBox.__offsetX(diff);\n lineBox.list.forEach(item => {\n item.__offsetX(diff, true);\n });\n }\n });\n }\n\n verticalAlign() {\n this.list.forEach(lineBox => {\n lineBox.verticalAlign();\n });\n }\n\n addX(n) {\n this.__lastX += n;\n }\n\n /**\n * inline递归过程中布局调用,不断出入栈dom对象,获取当前行状态下有哪些dom还在\n * @param dom\n */\n pushContentBoxList(dom) {\n this.__domList.push(dom);\n this.__domStack.push(dom);\n }\n\n popContentBoxList() {\n this.__domStack.pop();\n }\n\n __offsetX(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetX(diff);\n });\n }\n\n __offsetY(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetY(diff);\n });\n }\n\n /**\n * inline的特殊调用,非行首无论是否有内容都设置lineBox的lineHeight\n * @param l\n * @param b\n * @private\n */\n setLbByInlineIfNotNewLine(l, b) {\n let length = this.list.length;\n if(length && !this.isNewLine) {\n this.list[length - 1].__setLB(l, b);\n }\n }\n\n get size() {\n return this.list.length;\n }\n\n get lastX() {\n return this.__lastX;\n }\n\n get lastY() {\n return this.__lastY;\n }\n\n get endY() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[length - 1].endY;\n }\n return this.__y;\n }\n\n get isEnd() {\n return this.__isEnd;\n }\n\n get isNewLine() {\n return this.__isNewLine;\n }\n\n get breakLine() {\n return this.list.length > 1;\n }\n\n get domList() {\n return this.__domList;\n }\n\n get baseLine() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let n = 0;\n for(let i = 0; i < length - 1; i++) {\n n += list[i].height;\n }\n return n + list[length - 1].baseLine;\n }\n return 0;\n }\n\n get firstBaseLine() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[0].baseLine;\n }\n return 0;\n }\n\n get lineHeight() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1].lineHeight;\n }\n return 0;\n }\n\n get lineBox() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1];\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get width() {\n let w = 0;\n this.list.forEach(item => {\n w = Math.max(w, item.width);\n });\n return w;\n }\n}\n\nexport default LineBoxManager;\n","const TAG_NAME = {\n 'div': true,\n 'p': true,\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst INLINE = {\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst BOLD = {\n 'b': true,\n 'strong': true,\n}\n\nexport default {\n TAG_NAME,\n INLINE,\n BOLD,\n};\n","import enums from '../util/enums';\nimport unit from '../style/unit';\nimport level from './level';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n TOP,\n BOTTOM,\n POSITION,\n HEIGHT,\n },\n} = enums;\nconst { AUTO, PX, PERCENT } = unit;\nconst { REFLOW } = level;\n\nfunction offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) {\n if(dy) {\n let last;\n do {\n // component的sr没有next兄弟,视为component的next\n while(node.isShadowRoot) {\n node = node.host;\n }\n last = node;\n let isContainer, parent = node.domParent;\n if(parent) {\n let cs = parent.computedStyle;\n let ps = cs[POSITION];\n isContainer = parent === root || parent.isShadowRoot || ps === 'relative' || ps === 'absolute';\n }\n // 先偏移next,忽略有定位的absolute,本身非container也忽略\n let next = node.next;\n let container;\n while(next) {\n if(next.currentStyle[DISPLAY] !== 'none') {\n if(next.currentStyle[POSITION] === 'absolute') {\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = next.currentStyle;\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO || bottom[1] === PX) {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n }\n else if(top[1] === PERCENT) {\n let v = top[0] * 0.01 * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, null, next);\n }\n else {\n if(!container) {\n container = parent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, next]);\n }\n }\n }\n else {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n }\n next = next.next;\n }\n // root本身没domParent\n if(!parent) {\n break;\n }\n node = parent;\n // parent判断是否要resize\n let { currentStyle } = node;\n let isAbs = currentStyle[POSITION] === 'absolute';\n let need;\n if(isAbs) {\n if(currentStyle[HEIGHT][1] === AUTO\n && (currentStyle[TOP][1] === AUTO || currentStyle[BOTTOM][1] === AUTO)) {\n need = true;\n }\n }\n // height不定则需要\n else if(currentStyle[HEIGHT][1] === AUTO) {\n need = true;\n }\n if(need) {\n node.__resizeY(dy, REFLOW);\n node.clearCache();\n }\n // abs或者高度不需要继续向上调整提前跳出\n else {\n break;\n }\n if(node === root) {\n break;\n }\n }\n while(true);\n // 最后一个递归向上取消总缓存,防止过程中重复next多次无用递归\n while(last) {\n last.clearCache(true);\n last = last.domParent;\n }\n }\n}\n\nfunction clearUniqueReflowId(hash) {\n for(let i in hash) {\n if(hash.hasOwnProperty(i)) {\n let { node } = hash[i];\n delete node.__uniqueReflowId;\n }\n }\n}\n\nfunction getMergeMarginTB(topList, bottomList) {\n let total = 0;\n let max = topList[0];\n let min = topList[0];\n topList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n bottomList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n // 正数取最大,负数取最小,正负则相加\n let diff = 0;\n if(max > 0 && min > 0) {\n diff = Math.max(max, min) - total;\n }\n else if(max < 0 && min < 0) {\n diff = Math.min(max, min) - total;\n }\n else if(max !== 0 || min !== 0) {\n diff = max + min - total;\n }\n return diff;\n}\n\nexport default {\n offsetAndResizeByNodeOnY,\n clearUniqueReflowId,\n getMergeMarginTB,\n};\n","import Xom from './Xom';\nimport Text from './Text';\nimport mode from './mode';\nimport LineBoxManager from './LineBoxManager';\nimport Component from './Component';\nimport tag from './tag';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport $$type from '../util/$$type';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport reflow from '../refresh/reflow';\nimport builder from '../util/builder';\nimport level from '../refresh/level';\n\nconst {\n STYLE_KEY: {\n POSITION,\n DISPLAY,\n FONT_WEIGHT,\n MARGIN_LEFT,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n PADDING_LEFT,\n PADDING_BOTTOM,\n PADDING_RIGHT,\n PADDING_TOP,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n TOP,\n RIGHT,\n BOTTOM,\n LEFT,\n WIDTH,\n HEIGHT,\n TEXT_ALIGN,\n FLEX_DIRECTION,\n FLEX_BASIS,\n FLEX_SHRINK,\n FLEX_GROW,\n ALIGN_SELF,\n ALIGN_ITEMS,\n JUSTIFY_CONTENT,\n Z_INDEX,\n WHITE_SPACE,\n LINE_HEIGHT,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n OVERFLOW,\n FONT_SIZE,\n // PERSPECTIVE,\n // TRANSFORM,\n },\n NODE_KEY: {\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_STRUCT,\n NODE_DOM_PARENT,\n NODE_IS_INLINE,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_ADD_DOM,\n UPDATE_CONFIG,\n UPDATE_MEASURE,\n },\n STRUCT_KEY: {\n STRUCT_NUM,\n STRUCT_LV,\n STRUCT_TOTAL,\n STRUCT_CHILD_INDEX,\n STRUCT_INDEX,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH } = unit;\nconst { calAbsolute, isRelativeOrAbsolute } = css;\n\nfunction genZIndexChildren(dom) {\n let normal = [];\n let hasMc;\n let mcHash = {};\n let lastMaskIndex;\n let children = dom.children;\n children.forEach((item, i) => {\n let child = item;\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n // 遮罩单独保存后特殊排序\n if(item instanceof Xom && item.isMask) {\n // 开头的mc忽略,后续的连续mc以第一次出现为准\n if(lastMaskIndex !== undefined) {\n mcHash[lastMaskIndex].push(item);\n }\n else if(i) {\n lastMaskIndex = i - 1;\n children[lastMaskIndex].__iIndex = lastMaskIndex;\n mcHash[lastMaskIndex] = [item];\n hasMc = true;\n }\n }\n else {\n lastMaskIndex = undefined;\n if(item instanceof Xom) {\n child.__zIndex = item.currentStyle[Z_INDEX];\n if(isRelativeOrAbsolute(item)) {\n // 临时变量为排序使用\n child.__aIndex = true;\n normal.push(child);\n }\n else {\n normal.push(child);\n }\n }\n else {\n child.__zIndex = 0;\n normal.push(child);\n }\n child.__iIndex = i;\n }\n });\n normal.sort(function(a, b) {\n if(a.__zIndex !== b.__zIndex) {\n return a.__zIndex - b.__zIndex;\n }\n // zIndex相等时abs优先flow\n if(a.__aIndex !== b.__aIndex) {\n if(a.__aIndex) {\n return 1;\n }\n return -1;\n }\n // 都相等看索引\n return a.__iIndex - b.__iIndex;\n });\n // 将遮罩插入到对应顺序上\n if(hasMc) {\n for(let i = normal.length - 1; i >= 0; i--) {\n let idx = normal[i].__iIndex;\n if(mcHash.hasOwnProperty(idx)) {\n normal.splice(i + 1, 0, ...mcHash[idx]);\n }\n }\n }\n return normal;\n}\n\n// flex布局阶段顺序,不是渲染也和struct结构无关,可以无视mask\nfunction genOrderChildren(flowChildren) {\n let normal = [];\n flowChildren.forEach((item, i) => {\n let child = item;\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Xom) {\n child.__order = item.currentStyle[ORDER];\n }\n else {\n child.__order = 0;\n }\n normal.push(child);\n child.__iIndex = i;\n });\n normal.sort(function(a, b) {\n if(a.__order !== b.__order) {\n return a.__order - b.__order;\n }\n // order相等时看节点索引\n return a.__iIndex - b.__iIndex;\n });\n return normal;\n}\n\nclass Dom extends Xom {\n constructor(tagName, props, children) {\n super(tagName, props);\n let { style } = this;\n if(!style.display || !{\n flex: true,\n block: true,\n inline: true,\n inlineBlock: true,\n 'inline-block': true,\n none: true,\n }.hasOwnProperty(style.display)) {\n if(tag.INLINE.hasOwnProperty(this.tagName)) {\n style.display = 'inline';\n }\n else {\n style.display = 'block';\n }\n }\n if(!style[FONT_WEIGHT] && tag.BOLD.hasOwnProperty(tagName)) {\n style.fontWeight = 700;\n }\n this.__style = css.normalize(style, reset.DOM_ENTRY_SET);\n // currentStyle/currentProps不深度clone,继承一层即可,动画时也是extend这样只改一层引用不动原始静态style\n this.__currentStyle = util.extend({}, this.__style);\n this.__children = children || [];\n this.__flexLine = []; // flex布局多行模式时存储行\n let config = this.__config;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_STYLE] = this.__style;\n }\n\n __structure(i, lv, j) {\n let res = super.__structure(i++, lv, j);\n let arr = [res];\n let zIndexChildren = this.__zIndexChildren = this.__zIndexChildren || genZIndexChildren(this);\n zIndexChildren.forEach((child, j) => {\n let temp = child.__structure(i, lv + 1, j);\n if(Array.isArray(temp)) {\n i += temp.length;\n arr = arr.concat(temp);\n }\n else {\n i++;\n arr.push(temp);\n }\n });\n let total = arr.length - 1;\n res[STRUCT_NUM] = zIndexChildren.length;\n res[STRUCT_TOTAL] = total;\n return arr;\n }\n\n __modifyStruct(root, offset = 0) {\n let __config = this.__config;\n let struct = __config[NODE_STRUCT];\n let total = struct[STRUCT_TOTAL] || 0;\n // 新生成了struct,引用也变了\n let nss = this.__structure(struct[STRUCT_INDEX], struct[STRUCT_LV], struct[STRUCT_CHILD_INDEX]);\n root.__structs.splice(struct[STRUCT_INDEX] + offset, total + 1, ...nss);\n let d = 0;\n if(this !== root) {\n struct = __config[NODE_STRUCT];\n d = (struct[STRUCT_TOTAL] || 0) - total;\n let ps = __config[NODE_DOM_PARENT].__config[NODE_STRUCT];\n ps[STRUCT_TOTAL] = ps[STRUCT_TOTAL] || 0;\n ps[STRUCT_TOTAL] += d;\n }\n return [struct, d];\n }\n\n /**\n * 因为zIndex/abs的变化造成的更新,只需重排这一段顺序即可\n * 即便包含component造成的dom变化也不影响,component作为子节点reflow会再执行,这里重排老的vd\n * @param structs\n * @private\n */\n __updateStruct(structs) {\n let { [STRUCT_INDEX]: index, [STRUCT_TOTAL]: total = 0 } = this.__config[NODE_STRUCT];\n let zIndexChildren = this.__zIndexChildren = genZIndexChildren(this);\n let length = zIndexChildren.length;\n if(length === 1) {\n return;\n }\n zIndexChildren.forEach((child, i) => {\n child.__config[NODE_STRUCT][STRUCT_CHILD_INDEX] = i;\n });\n // 按直接子节点划分为相同数量的若干段进行排序\n let arr = [];\n let source = [];\n for(let i = index + 1; i <= index + total; i++) {\n let child = structs[i];\n let o = {\n child,\n list: structs.slice(child[STRUCT_INDEX], child[STRUCT_INDEX] + child[STRUCT_TOTAL] + 1),\n };\n arr.push(o);\n source.push(o);\n i += child[STRUCT_TOTAL] || 0;\n }\n arr.sort(function(a, b) {\n return a.child[STRUCT_CHILD_INDEX] - b.child[STRUCT_CHILD_INDEX];\n });\n // 是否有变更,有才进行重新计算\n let needSort;\n for(let i = 0, len = source.length; i < len; i++) {\n if(source[i] !== arr[i]) {\n needSort = true;\n break;\n }\n }\n if(needSort) {\n let list = [];\n arr.forEach(item => {\n list = list.concat(item.list);\n });\n list.forEach((struct, i) => {\n struct[STRUCT_INDEX] = index + i + 1;\n })\n structs.splice(index + 1, total, ...list);\n }\n }\n\n /**\n * 给定父宽度情况下,尝试行内放下后的剩余宽度,为负数即放不下,这里只会出现行内级即inline(Block)\n * 调用前提是非行开头的inline尝试计算是否放得下,开头无需且禁止判断,防止出现永远放不下一个字符卡死\n * 返回非负数就是放得下,这样一些尺寸为0的也算\n * @param w 剩余宽度\n * @param total 容器尺寸\n * @returns {number|*}\n * @private\n */\n __tryLayInline(w, total) {\n let { flowChildren, currentStyle: {\n [DISPLAY]: display,\n [WIDTH]: width,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n // inline没w/h,并且尝试孩子第一个能放下即可,如果是文字就是第一个字符\n if(display === 'inline') {\n if(flowChildren.length) {\n let first = flowChildren[0];\n if(first instanceof Component) {\n first = first.shadowRoot;\n }\n if(first instanceof Xom) {\n w = first.__tryLayInline(w, total);\n }\n else {\n w -= first.firstCharWidth;\n }\n }\n }\n // inlineBlock尝试所有孩子在一行上\n else {\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n else {\n for(let i = 0; i < flowChildren.length; i++) {\n // 当放不下时直接返回,无需继续多余的尝试计算\n if(w < 0) {\n return w;\n }\n let item = flowChildren[i];\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Xom) {\n w = item.__tryLayInline(w, total);\n }\n // text强制一行,否则非头就是放不下,需从头开始\n else {\n w -= item.textWidth;\n }\n }\n }\n // ib要减去末尾mpb\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n }\n // 还要减去开头的mpb\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n return w;\n }\n\n // 设置y偏移值,递归包括children,此举在justify-content/margin-auto等对齐用\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n // 记得偏移LineBox\n if(isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) {\n this.lineBoxManager.__offsetX(diff);\n }\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetX(diff, isLayout, lv);\n }\n });\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n if(isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) {\n this.lineBoxManager.__offsetY(diff);\n }\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetY(diff, isLayout, lv);\n }\n });\n }\n\n // item的递归子节点求min/max,只考虑固定值单位,忽略百分比,同时按方向和display\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this, this.isShadowRoot);\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h, lineBoxManager } = data;\n // 计算需考虑style的属性\n let {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n else {\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n }\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n else if(display === 'block') {\n let countMin = 0, countMax = 0;\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n countMin = countMax = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n }\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n else {\n if(display === 'inlineBlock' || display === 'inline-block') {\n lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n }\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n if(isDirectionRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else if(isDirectionRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n });\n }\n }\n return [display, this.__addMp(isDirectionRow, w, currentStyle, [min, max])];\n }\n\n /**\n * flex布局时,计算basis尺寸,如果有固定声明则以其为标准,content为内容最大尺寸,auto依赖w/h或降级content\n * basis要考虑相加直接item的mpb,非绝对值单位以container为基准,basis为内容时为max值\n * item的孩子为孙子节点需递归,不参与basis计算,只参与min/max,尺寸和mpb均只考虑绝对值\n * 自动计算时影响尺寸的只有换行的text,以及一组inline,均按其中最大尺寸的一个计算\n * auto自动计算递归进行,如果是普通row方向,按最大text的charWidth为准\n * 如果是column方向,则虚拟布局后看text的height\n * 在abs下时进入特殊状态,无论是row/column,都会按row方向尝试最大尺寸,直到舞台边缘或容器声明的w折行\n * 返回b,声明则按css值,否则是auto/content\n * 返回min为最小宽度,遇到字符/inline则单列排版后需要的最大宽度\n * 返回max为最大宽度,理想情况一排最大值,在abs时isVirtual状态参与计算,文本抵达边界才进行换行\n * @param isDirectionRow\n * @param data\n * @param isVirtual abs非固定尺寸时先进行虚拟布局标识\n * @private\n */\n __calBasis(isDirectionRow, data, isVirtual) {\n css.computeReflow(this, this.isShadowRoot);\n let b = 0;\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h } = data;\n // 计算需考虑style的属性\n let {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n [FLEX_BASIS]: flexBasis,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content\n let isAuto = flexBasis[1] === AUTO;\n let isFixed = [PX, PERCENT, REM, VW, VH].indexOf(flexBasis[1]) > -1;\n let isContent = !isAuto && !isFixed;\n let fixedSize;\n // flex的item固定basis计算\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = fixedSize = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = fixedSize = (isDirectionRow ? w : h) * flexBasis[0] * 0.01;\n }\n else if(flexBasis[1] === REM) {\n b = fixedSize = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = fixedSize = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = fixedSize = flexBasis[0] * this.root.height * 0.01;\n }\n }\n // 已声明主轴尺寸的,当basis是auto时为值\n else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1) && isAuto) {\n if(main[1] === PX) {\n b = fixedSize = main[0];\n }\n else if(main[1] === PERCENT) {\n b = fixedSize = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = fixedSize = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = fixedSize = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = fixedSize = main[0] * this.root.height * 0.01;\n }\n }\n // 非固定尺寸的basis为auto时降级为content\n else if(isAuto) {\n isContent = true;\n }\n // flex的item还是flex时\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n }\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n // flex的item是block/inline时,inline也会变成block统一对待\n else {\n let countMin = 0, countMax = 0;\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n countMin = countMax = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n }\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n if(fixedSize) {\n max = Math.max(fixedSize, max);\n }\n if(isContent) {\n b = max;\n }\n // 直接item的mpb影响basis\n return this.__addMp(isDirectionRow, w, currentStyle, [b, min, max], true);\n }\n\n __layoutNone() {\n super.__layoutNone();\n let { children } = this;\n children.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n item.__layoutNone();\n }\n });\n }\n\n /**\n * block布局,本身固定尺寸优先,否则看内容从上往下从左往右flow流排布\n * 内部inline和inlineBlock组成LineBox,通过LineBoxManager来管理混排的现象\n * LineBoxManager只有block和inlineBlock内部生成,inline会复用最近父级的\n * 内部的block在垂直方向要考虑margin合并的问题,强制所有节点为bfc,精简逻辑\n * @param data\n * @param isVirtual abs无尺寸时提前虚拟布局计算尺寸\n * @private\n */\n __layoutBlock(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n // 虚线管理一个block内部的LineBox列表,使得inline的元素可以中途衔接处理折行\n // 内部维护inline结束的各种坐标来达到目的,遇到block时中断并处理换行坐标\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n // 因精度问题,统计宽度均从0开始累加每行,最后取最大值,仅在abs布局时isVirtual生效\n let maxW = 0;\n let cw = 0;\n // 连续block(flex相同,下面都是)的上下margin合并值记录,合并时从列表中取\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isImg = item.tagName === 'img';\n // 每次循环开始前,这次不是block的话,看之前遗留待合并margin,并重置\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n if(isXom) {\n // inline和inlineBlock的细节不同之处,ib除了w/h之外,更想像block一样占据一行\n // 比如2个inline前面占一半后面比一半多但还是会从一半开始然后第2行换行继续,但ib放不下则重开一行\n // inline和ib能互相嵌套,形成的LineBox中则是TextBox和节点混合\n if(isInlineBlock || isInline) {\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || isInline && whiteSpace === 'nowrap') {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager, // ib内部新生成会内部判断,这里不管统一传入\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样\n if(item.__isIbFull) {\n x = data.x;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // abs统计宽度\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下,内部判断了inline/ib,ib要考虑是否有width\n let fw = item.__tryLayInline(w + data.x - x, w);\n // 放得下继续,奇怪的精度问题,加上阈值\n if(fw >= (-1e-10)) {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n x = data.x;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n if(isVirtual) {\n cw += item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n // block/flex先处理之前可能遗留的最后一行LineBox,然后递归时不传lineBoxManager,其内部生成新的\n else {\n // 非开头,说明之前的text未换行,需要增加行数\n if(x !== data.x && flowChildren[i - 1] instanceof Text) {\n lineClampCount++;\n }\n x = data.x;\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n let isNone = item.currentStyle[DISPLAY] === 'none';\n // 自身无内容\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n y += item.outerHeight;\n lineBoxManager.__lastY = y;\n // absolute/flex前置虚拟计算\n if(isVirtual) {\n maxW = Math.max(maxW, item.outerWidth);\n cw = 0;\n }\n // 空block要留下轮循环看,除非是最后一个,此处非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n item.__offsetY(diff, true);\n y += diff;\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n }\n }\n // 文字和inline类似\n else {\n // lineClamp作用域为block下的inline(同LineBox上下文)\n if(lineClamp && lineClampCount >= lineClamp) {\n return;\n }\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.width;\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x);\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, item.width);\n cw = 0;\n }\n }\n if(isVirtual) {\n cw += item.width;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n });\n // 结束后如果是以LineBox结尾,则需要设置y到这里,否则流布局中block会设置\n // 当以block换行时,新行是true,否则是false即结尾\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n }\n let tw = this.__width = (fixedWidth || !isVirtual) ? w : maxW;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // 非abs提前的虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐\n if(!isVirtual) {\n lineBoxManager.verticalAlign();\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // 所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n this.__marginAuto(currentStyle, data);\n }\n }\n\n // 弹性布局时的计算位置\n __layoutFlex(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle, __flexLine } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n // 每次布局情况多行内容\n __flexLine.splice(0);\n let {\n [FLEX_DIRECTION]: flexDirection,\n [JUSTIFY_CONTENT]: justifyContent,\n [ALIGN_ITEMS]: alignItems,\n [LINE_CLAMP]: lineClamp,\n [FLEX_WRAP]: flexWrap,\n [ALIGN_CONTENT]: alignContent,\n [LINE_HEIGHT]: lineHeight,\n [TEXT_ALIGN]: textAlign,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n let maxX = 0;\n let isDirectionRow = ['column', 'column-reverse', 'columnReverse'].indexOf(flexDirection) === -1;\n // 计算伸缩基数\n let growList = [];\n let shrinkList = [];\n let basisList = [];\n let maxList = [];\n let minList = [];\n let orderChildren = genOrderChildren(flowChildren);\n orderChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n // abs虚拟布局计算时纵向也是看横向宽度\n let [b, min, max] = item.__calBasis(isVirtual ? true : isDirectionRow, { x, y, w, h }, isVirtual);\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += max;\n }\n else {\n maxX = Math.max(maxX, max);\n }\n return;\n }\n let { [FLEX_GROW]: flexGrow, [FLEX_SHRINK]: flexShrink } = currentStyle;\n computedStyle[FLEX_BASIS] = b;\n growList.push(flexGrow);\n shrinkList.push(flexShrink);\n // 根据basis不同,计算方式不同\n basisList.push(b);\n maxList.push(max);\n minList.push(min);\n }\n // 文本\n else {\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += item.textWidth;\n }\n else {\n maxX = Math.max(maxX, item.textWidth);\n }\n return;\n }\n growList.push(0);\n shrinkList.push(1);\n if(isDirectionRow) {\n let cw = item.charWidth;\n let tw = item.textWidth;\n basisList.push(tw);\n maxList.push(tw);\n minList.push(cw);\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n });\n let h = item.height;\n basisList.push(h);\n minList.push(h);\n }\n }\n });\n // abs时,只需关注宽度即可,无需真正布局\n if(isVirtual) {\n let tw = this.__width = Math.min(maxX, w);\n this.__ioSize(tw, this.height);\n return;\n }\n let containerSize = isDirectionRow ? w : h;\n let isMultiLine = flexWrap === 'wrap' || ['wrap-reverse', 'wrapReverse'].indexOf(flexWrap) > -1;\n /**\n * 判断是否需要分行,根据假设主尺寸来统计尺寸和计算,假设主尺寸是clamp(min_main_size, flex_base_size, max_main_size)\n * 当多行时,由于每行一定有最小限制,所以每行一般情况都不是shrink状态,\n * 但也有极端情况,比如一行只能放下1个元素时,且此元素比容器小,会是shrink\n */\n let line = [], sum = 0, hypotheticalList = [];\n basisList.forEach((item, i) => {\n let min = minList[i], max = maxList[i];\n let hypothetical;\n if(item < min) {\n hypothetical = min;\n }\n else if(item > max) {\n hypothetical = max;\n }\n else {\n hypothetical = item;\n }\n hypotheticalList.push(hypothetical);\n if(isMultiLine) {\n // 超过尺寸时,要防止sum为0即1个也会超过尺寸\n if(sum + hypothetical > containerSize) {\n if(sum) {\n __flexLine.push(line);\n line = [orderChildren[i]];\n sum = hypothetical;\n }\n else {\n line.push(orderChildren[i]);\n __flexLine.push(line);\n line = [];\n sum = 0;\n }\n }\n else {\n line.push(orderChildren[i]);\n sum += hypothetical;\n }\n }\n else {\n line.push(orderChildren[i]);\n }\n });\n if(line.length) {\n __flexLine.push(line);\n }\n let offset = 0, clone = { x, y, w, h };\n let maxCrossList = [];\n __flexLine.forEach(item => {\n let length = item.length;\n let end = offset + length;\n let [x1, y1, maxCross] = this.__layoutFlexLine(clone, isDirectionRow, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, orderChildren.slice(offset, end), item, textAlign,\n growList.slice(offset, end), shrinkList.slice(offset, end), basisList.slice(offset, end),\n hypotheticalList.slice(offset, end), minList.slice(offset, end));\n // 下一行/列更新坐标\n if(isDirectionRow) {\n clone.y = y1;\n }\n else {\n clone.x = x1;\n }\n x = Math.max(x, x1);\n y = Math.max(y, y1);\n maxCrossList.push(maxCross);\n offset += length;\n });\n let tw = this.__width = w;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // flexDirection当有reverse时交换每line的主轴序\n if(flexDirection === 'row-reverse' || flexDirection === 'rowReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = tw - item.outerWidth - (item.x - data.x) * 2;\n if(diff) {\n item.__offsetX(diff, true);\n }\n });\n });\n }\n else if(flexDirection === 'column-reverse' || flexDirection === 'columnReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = th - item.outerHeight - (item.y - data.y) * 2;\n if(diff) {\n item.__offsetY(diff, true);\n }\n });\n });\n }\n // wrap-reverse且多轴线时交换轴线序,需要2行及以上才行\n let length = __flexLine.length;\n if(['wrapReverse', 'wrap-reverse'].indexOf(flexWrap) > -1 && length > 1) {\n let crossSum = 0, crossSumList = [];\n maxCrossList.forEach(item => {\n crossSumList.push(crossSum);\n crossSum += item;\n });\n let count = 0;\n for(let i = length - 1; i >= 0; i--) {\n let line = __flexLine[i];\n let source = crossSumList[i];\n let diff = count - source;\n if(diff) {\n line.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n count += maxCrossList[i];\n }\n __flexLine.reverse();\n }\n // 侧轴对齐分flexLine做,要考虑整体的alignContent的stretch和每行的alignItems的stretch\n // 先做整体的,得出交叉轴空白再均分给每一行做单行的,整体的只有1行忽略\n let per;\n if(!isVirtual && length > 1 && (fixedHeight && isDirectionRow || !isDirectionRow)) {\n let diff = isDirectionRow ? th - (y - data.y) : tw - (x - data.x);\n // 有空余时才进行对齐\n if(diff > 0) {\n if(alignContent === 'center') {\n let per = diff * 0.5;\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per, true);\n }\n else {\n item.__offsetX(per, true);\n }\n });\n }\n else if(alignContent === 'flex-start' || alignContent === 'flexStart') {}\n else if(alignContent === 'flex-end' || alignContent === 'flexEnd') {\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n else if(alignContent === 'space-between' || alignContent === 'spaceBetween') {\n let between = diff / (length - 1);\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(between, true);\n }\n else {\n item.__offsetX(between, true);\n }\n });\n }\n });\n }\n else if(alignContent === 'space-around' || alignContent === 'spaceAround') {\n let around = diff / (length + 1);\n __flexLine.forEach((item, i) => {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(around * (i + 1), true);\n }\n else {\n item.__offsetX(around * (i + 1), true);\n }\n });\n });\n }\n // 默认stretch\n else {\n per = diff / length;\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per * i, true);\n }\n else {\n item.__offsetX(per * i, true);\n }\n });\n }\n });\n }\n }\n }\n // 每行再进行cross对齐,在alignContent为stretch时计算每行的高度\n if(!isVirtual) {\n if(length > 1) {\n __flexLine.forEach((item, i) => {\n let maxCross = maxCrossList[i];\n if(per) {\n maxCross += per;\n }\n this.__crossAlign(item, alignItems, isDirectionRow, maxCross);\n });\n }\n else if(length) {\n let maxCross = maxCrossList[0];\n if(isDirectionRow) {\n if(fixedHeight) {\n maxCross = h;\n }\n }\n else {\n maxCross = w;\n }\n this.__crossAlign(__flexLine[0], alignItems, isDirectionRow, maxCross);\n }\n }\n this.__marginAuto(currentStyle, data);\n }\n\n /**\n * 计算获取子元素的b/min/max完毕后,尝试进行flex每行布局\n * https://www.w3.org/TR/css-flexbox-1/#layout-algorithm\n * 假想主尺寸,其为clamp(min_main_size, flex_base_size, max_main_size)\n * 随后按算法一步步来 https://zhuanlan.zhihu.com/p/354567655\n * 规范没提到mpb,item的要计算,孙子的只考虑绝对值\n * 先收集basis和假设主尺寸\n */\n __layoutFlexLine(data, isDirectionRow, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, orderChildren, flexLine, textAlign,\n growList, shrinkList, basisList, hypotheticalList, minList) {\n let { x, y, w, h } = data;\n let hypotheticalSum = 0;\n hypotheticalList.forEach(item => {\n hypotheticalSum += item;\n });\n // 根据假设尺寸确定使用grow还是shrink,冻结非弹性项并设置target尺寸,确定剩余未冻结数量\n let isOverflow = hypotheticalSum >= containerSize;\n let targetMainList = [];\n basisList.forEach((item, i) => {\n if(isOverflow) {\n if(!shrinkList[i] || (basisList[i] < hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n else {\n if(!growList[i] || (basisList[i] > hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n });\n // 初始可用空间,冻结使用确定的target尺寸,未冻结使用假想\n let free = 0;\n basisList.forEach((item, i) => {\n if(targetMainList[i] !== undefined) {\n free += targetMainList[i];\n }\n else {\n free += item;\n }\n });\n let total = Infinity;\n if(isDirectionRow) {\n total = w;\n }\n else if(fixedHeight) {\n total = h;\n }\n else {\n total = free;\n }\n free = Math.abs(total - free);\n // 循环,文档算法不够简练,其合并了grow和shrink,实际拆开写更简单\n let factorSum = 0;\n if(isOverflow) {\n // 计算真正的因子占比,同时得出缩小尺寸数值\n // 还需判断每个item收缩不能 {\n if(targetMainList[i] === undefined) {\n let n = item * basisList[i];\n factorSum += n;\n return n;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要收缩的尺寸\n let n = basisList[i] - s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n else {\n let factorList = growList.map((item, i) => {\n if(targetMainList[i] === undefined) {\n factorSum += item;\n return item;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要扩展的尺寸\n let n = basisList[i] + s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n let maxCross = 0;\n let lbmList = [];\n orderChildren.forEach((item, i) => {\n let main = targetMainList[i];\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n if(isDirectionRow) {\n item.__layout({\n x,\n y,\n w: main,\n h,\n w3: main, // w3假设固定宽度,忽略原始style中的设置\n });\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h: main,\n h3: main, // 同w2\n });\n }\n }\n else {\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n lbmList.push(lineBoxManager);\n item.__layout({\n x,\n y,\n w: isDirectionRow ? main : w,\n h: isDirectionRow ? h : main,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n });\n }\n if(isDirectionRow) {\n x += item.outerWidth;\n maxCross = Math.max(maxCross, item.outerHeight);\n }\n else {\n y += item.outerHeight;\n maxCross = Math.max(maxCross, item.outerWidth);\n }\n });\n // 计算主轴剩余时要用真实剩余空间而不能用伸缩剩余空间\n let diff = isDirectionRow ? (w - x + data.x) : (h - y + data.y);\n // 主轴对齐方式\n if(diff > 0) {\n let len = orderChildren.length;\n if(justifyContent === 'flexEnd' || justifyContent === 'flex-end') {\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(diff, true) : child.__offsetY(diff, true);\n }\n }\n else if(justifyContent === 'center') {\n let center = diff * 0.5;\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(center, true) : child.__offsetY(center, true);\n }\n }\n else if(justifyContent === 'spaceBetween' || justifyContent === 'space-between') {\n let between = diff / (len - 1);\n for(let i = 1; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(between * i, true) : child.__offsetY(between * i, true);\n }\n }\n else if(justifyContent === 'spaceAround' || justifyContent === 'space-around') {\n let around = diff / (len + 1);\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(around * (i + 1), true) : child.__offsetY(around * (i + 1), true);\n }\n }\n }\n if(isDirectionRow) {\n y += maxCross;\n }\n else {\n x += maxCross;\n }\n // flex的直接text对齐比较特殊\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lbmList.forEach(item => {\n item.horizonAlign(item.width, textAlign);\n })\n }\n return [x, y, maxCross];\n }\n\n // 每个flexLine的侧轴对齐,单行时就是一行对齐\n __crossAlign(line, alignItems, isDirectionRow, maxCross) {\n let baseLine = 0;\n line.forEach(item => {\n baseLine = Math.max(baseLine, item.firstBaseLine);\n });\n line.forEach(item => {\n let { currentStyle: { [ALIGN_SELF]: alignSelf } } = item;\n if(isDirectionRow) {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [HEIGHT]: height } } = item;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = item.__height = computedStyle[HEIGHT] = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n else if(alignSelf === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [HEIGHT]: height,\n } } = item;\n // row的孩子还是flex且column且不定高时,如果高度<侧轴拉伸高度则重新布局\n if(isDirectionRow && display === 'flex' && flexDirection === 'column' && height[1] === AUTO && item.outerHeight < maxCross) {\n item.__layout(Object.assign(item.__layoutData, { h3: maxCross }));\n }\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n }\n }\n // column\n else {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [WIDTH]: width } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [WIDTH]: width,\n } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n }\n }\n });\n }\n\n /**\n * inline比较特殊,先简单顶部对其,后续还需根据vertical和lineHeight计算y偏移\n * inlineBlock复用逻辑,可以设置w/h,在混排时表现不同,inlineBlock换行限制在规定的矩形内,\n * 且ib会在没设置width且换行的时候撑满上一行,即便内部尺寸没抵达边界\n * 而inline换行则会从父容器start处开始,且首尾可能占用矩形不同\n * 嵌套inline情况十分复杂,尾部mpb空白可能产生叠加情况,因此endSpace表示自身,\n * 然后根据是否在最后一个元素进行叠加父元素的,多层嵌套则多层尾部叠加,均以最后一个元素为依据判断\n * Text获取这个叠加的endSpace值即可,无需感知是否最后一个,外层(此处)进行逻辑封装\n * @param data\n * @param isVirtual\n * @param isInline\n * @private\n */\n __layoutInline(data, isVirtual, isInline) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h, lx,\n lineBoxManager, nowrap, endSpace, selfEndSpace } = this.__preLayout(data, isInline);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n let {\n [WIDTH]: width,\n } = currentStyle;\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n } = computedStyle;\n let lineClampCount = data.lineClampCount || 0;\n if(isInline && !this.__isRealInline()) {\n isInline = false;\n }\n // 只有inline的孩子需要考虑换行后从行首开始,而ib不需要,因此重置行首标识lx为x,末尾空白为0\n // 而inline的LineBoxManager复用最近非inline父dom的,ib需要重新生成,末尾空白叠加\n if(isInline) {\n this.__config[NODE_IS_INLINE] = true;\n this.__lineBoxManager = lineBoxManager;\n let baseLine = css.getBaseLine(computedStyle);\n // 特殊inline调用,有内容的话(如左右mbp),默认生成一个lineBox,即便是空,也要形成占位,只有开头时需要\n if(marginLeft || marginRight\n || paddingLeft || paddingRight\n || borderLeftWidth || borderRightWidth) {\n if(lineBoxManager.isNewLine) {\n lineBoxManager.genLineBoxByInlineIfNewLine(x, y, lineHeight, baseLine);\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseLine);\n }\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseLine);\n }\n lineClamp = data.lineClamp || 0;\n }\n else {\n lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n lx = x;\n endSpace = selfEndSpace = lineClampCount = 0;\n }\n // 存LineBox里的内容列表专用,布局过程中由lineBoxManager存入,递归情况每个inline节点都保存contentBox\n let contentBoxList;\n if(isInline) {\n contentBoxList = this.__contentBoxList = [];\n lineBoxManager.pushContentBoxList(this);\n }\n let isIbFull = false; // ib时不限定w情况下发生折行则撑满行,即便内容没有撑满边界\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline2 = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock2 = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isRealInline = isXom && item.__isRealInline();\n // 最后一个元素会产生最后一行,叠加父元素的尾部mpb\n let isEnd = isInline && (i === length - 1);\n if(isEnd) {\n endSpace += selfEndSpace;\n }\n if(isXom) {\n if(!isInline2 && !isInlineBlock2) {\n item.currentStyle[DISPLAY] = item.computedStyle[DISPLAY] = 'inlineBlock';\n isInlineBlock2 = true;\n inject.warn('Inline can not contain block/flex');\n }\n // x开头,不用考虑是否放得下直接放,i为0强制不换行\n if(x === lx || !i || isInline2 && whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样\n if(item.__isIbFull) {\n isInlineBlock2 && (w[1] === AUTO) && (isIbFull = true);\n lineBoxManager.addItem(item);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中,以计算宽度\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n }\n else {\n // 不换行继续排,换行非开头先尝试是否放得下,结尾要考虑mpb因此减去endSpace\n let fw = (whiteSpace === 'nowrap') ? 0 : item.__tryLayInline(w - x + lx, w - (isEnd ? endSpace : 0));\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n nowrap: whiteSpace === 'nowrap',\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n isInline2 && lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n lineBoxManager.addItem(item);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n }\n }\n }\n // inline里的其它只有文本,可能开始紧跟着之前的x,也可能换行后从lx行头开始\n // 紧跟着x可能出现在前面有节点换行后第2行,此时不一定放得下,因此不能作为判断依据,开头仅有lx\n else {\n let n = lineBoxManager.size;\n // i为0时强制不换行\n if(x === lx || !i || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行,且非定宽\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n }\n else {\n // 非开头先尝试是否放得下,如果放得下再看是否end,加end且只有1个字时放不下要换行,否则可以放,换行由text内部做\n // 第一个Text且父元素声明了nowrap也强制不换行,非第一个则看本身whiteSpace声明\n let focusNoWrap = (!i && nowrap) || whiteSpace === 'nowrap';\n let fw = focusNoWrap ? 0 : item.__tryLayInline(w + lx - x);\n if(!focusNoWrap && fw >= 0 && isEnd && endSpace && item.content.length === 1) {\n let fw2 = fw - endSpace;\n if(fw2 < 0) {\n fw = fw2;\n }\n }\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // 这里ib放得下一定是要么没换行要么固定宽度,所以无需判断isIbFull\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n }\n }\n }\n });\n // 同block结尾,不过这里一定是lineBox结束,无需判断\n y = lineBoxManager.endY;\n // 标识ib情况同block一样占满行\n this.__isIbFull = isIbFull;\n // 元素的width在固定情况或者ibFull情况已被计算出来,否则为最大延展尺寸,inline没有固定尺寸概念\n let tw, th;\n if(isInline) {\n // inline最后的x要算上右侧mpb,为next行元素提供x坐标基准,同时其尺寸计算比较特殊\n if(selfEndSpace) {\n lineBoxManager.addX(selfEndSpace);\n }\n // 如果没有内容,空白还要加上开头即左侧mpb\n if(!flowChildren.length) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = computedStyle;\n lineBoxManager.addX(marginLeft + paddingLeft + borderLeftWidth);\n }\n // 结束出栈contentBox,递归情况结束子inline获取contentBox,父inline继续\n lineBoxManager.popContentBoxList();\n // abs非固定w时预计算,本来是最近非inline父层统一计算,但在abs时不算,\n if(isVirtual) {\n this.__inlineSize();\n }\n }\n else {\n // ib在满时很特殊,取最大值,可能w本身很小不足排下1个字符,此时要用maxW\n let maxW = lineBoxManager.__maxX - data.x;\n tw = this.__width = fixedWidth ? w : (isIbFull ? Math.max(w, maxW) : maxW);\n th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n }\n // 非abs提前虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐,inline会被父级调用这里只看ib\n if(!isVirtual && !isInline) {\n lineBoxManager.verticalAlign();\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // block的所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n }\n // inlineBlock新开上下文,但父级block遇到要处理换行\n return isInline ? lineClampCount : 0;\n }\n\n /**\n * inline的尺寸计算非常特殊,并非一个矩形区域,而是由字体行高结合节点下多个LineBox中的内容决定,\n * 且这个尺寸又并非真实LineBox中的内容直接合并计算而来,比如包含了个更大尺寸的ib却不会计入\n * 具体方法为遍历持有的LineBox下的内容,x取两侧极值,同时首尾要考虑mpb,y值取上下极值,同样首尾考虑mpb\n * 首尾行LineBox可能不是不是占满一行,比如前后都有同行inline的情况,非首尾行则肯定占满\n * 绘制内容(如背景色)的区域也很特殊,每行LineBox根据lineHeight对齐baseLine得来,并非LineBox全部\n * 当LineBox只有直属Text时如果font没有lineGap则等价于全部,如有则需减去\n * 另外其client/offset/outer的w/h尺寸计算也很特殊,皆因首尾x方向的mpb导致\n * @private\n */\n __inlineSize(tw, textAlign) {\n let { contentBoxList, computedStyle, __ox, __oy } = this;\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // x/clientX/offsetX/outerX\n let maxX, maxY, minX, minY, maxCX, maxCY, minCX, minCY, maxFX, maxFY, minFX, minFY, maxOX, maxOY, minOX, minOY;\n let length = contentBoxList.length;\n if(length) {\n // 遍历contentBox,里面存的是LineBox内容,根据父LineBox引用判断是否换行\n contentBoxList.forEach((item, i) => {\n // 非第一个除了minY不用看其它都要,minX是换行导致,而maxX在最后一个要考虑右侧mpb,中间的无需考虑嵌套inline的mpb\n if(i) {\n minX = Math.min(minX, item.x);\n minCX = Math.min(minCX, item.x);\n minFX = Math.min(minFX, item.x);\n minOX = Math.min(minOX, item.x);\n if(i === length - 1) {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n maxY = maxCY = maxFY = maxOY = Math.max(maxY, item.y + item.outerHeight);\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n else {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n }\n }\n // 第一个初始化\n else {\n minX = item.x;\n minY = item.y;\n minCX = minX - paddingLeft;\n minCY = minY - paddingTop;\n minFX = minCX - borderLeftWidth;\n minFY = minCY - borderTopWidth;\n minOX = minFX - marginLeft;\n minOY = minFY - marginTop;\n maxX = maxCX = maxFX = maxOX = item.x + item.outerWidth;\n maxY = maxCY = maxFY = maxOY = item.y + item.outerHeight;\n if(i === length - 1) {\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n }\n });\n this.__x = minOX;\n this.__y = minOY;\n this.__width = computedStyle[WIDTH] = maxX - minX;\n // 防止比自己最小高度lineHeight还小,比如内容是个小字体\n this.__height = computedStyle[HEIGHT] = Math.max(lineHeight, maxY - minY);\n this.__clientWidth = maxCX - minCX;\n this.__clientHeight = maxCY - minCY;\n this.__offsetWidth = maxFX - minFX;\n this.__offsetHeight = maxFY - minFY;\n this.__outerWidth = maxOX - minOX;\n this.__outerHeight = maxOY - minOY;\n this.__sx = minOX + __ox;\n this.__sy = minOY + __oy;\n this.__sx1 = minFX + __ox;\n this.__sy1 = minFY + __oy;\n this.__sx2 = minCX + __ox;\n this.__sy2 = minCY + __oy;\n this.__sx3 = minX + __ox;\n this.__sy3 = minY + __oy;\n this.__sx4 = maxX + __ox;\n this.__sy4 = maxY + __oy;\n this.__sx5 = maxCX + __ox;\n this.__sy5 = maxCY + __oy;\n this.__sx6 = maxFX + __ox;\n this.__sy6 = maxFY + __oy;\n // inline的text整体设置相同\n if(['center', 'right'].indexOf(textAlign) > -1) {\n this.children.forEach(item => {\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n }\n // 如果没有内容,宽度为0高度为lineHeight,对齐也特殊处理,lineBoxManager不会处理\n else {\n if(['center', 'right'].indexOf(textAlign) > -1) {\n let diff = tw;\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n if(diff) {\n this.__offsetX(diff, true);\n }\n }\n this.__width = computedStyle[WIDTH] = 0;\n let th = this.__height = computedStyle[HEIGHT] = lineHeight;\n this.__ioSize(0, th);\n this.__sy -= marginTop + paddingTop + borderTopWidth;\n this.__sx1 = this.sx + marginLeft;\n this.__sy1 = this.sy + marginTop;\n this.__sx2 = this.__sx1 + borderLeftWidth;\n this.__sy2 = this.__sy1 + borderTopWidth;\n this.__sx4 = this.__sx3 = this.__sx2 + paddingLeft;\n this.__sy4 = this.__sy3 = this.__sy2 + paddingTop;\n this.__sx5 = this.__sx4 + paddingRight;\n this.__sy5 = this.__sy4 + th + paddingBottom;\n this.__sx6 = this.__sx5 + borderRightWidth;\n this.__sy6 = this.__sy5 + borderBottomWidth;\n this.__clientWidth = this.__sx5 - this.__sx2;\n this.__clientHeight = this.__sy5 - this.__sy2;\n this.__offsetWidth = this.__sx6 - this.__sx1;\n this.__offsetHeight = this.__sy6 - this.__sy1;\n this.__outerWidth = this.__offsetWidth + marginLeft + marginRight;\n this.__outerHeight = this.__offsetHeight + marginTop + marginBottom;\n }\n }\n\n /**\n * 只针对绝对定位children布局\n * @param container\n * @param data\n * @param target 可选,只针对某个abs的child特定布局,在局部更新时用\n * @private\n */\n __layoutAbs(container, data, target) {\n let { sx: x, sy: y, clientWidth, clientHeight, computedStyle } = container;\n let { isDestroyed, children, absChildren } = this;\n let {\n [DISPLAY]: display,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n } = computedStyle;\n if(isDestroyed || display === 'none') {\n this.__layoutNone();\n return;\n }\n x += marginLeft + borderLeftWidth;\n y += marginTop + borderTopWidth;\n // 对absolute的元素进行相对容器布局\n absChildren.forEach(item => {\n if(target) {\n // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr\n let node = item;\n if(node instanceof Component) {\n node = item.shadowRoot;\n }\n // 所以得2个都对比\n if(target !== node && target !== item) {\n return;\n }\n }\n let { currentStyle, computedStyle } = item;\n if(currentStyle[DISPLAY] === 'none') {\n item.__layoutNone();\n return;\n }\n // 先根据容器宽度计算margin/padding\n item.__mp(currentStyle, computedStyle, clientWidth);\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let { [LEFT]: left, [TOP]: top, [RIGHT]: right,\n [BOTTOM]: bottom, [WIDTH]: width, [HEIGHT]: height, [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection } = currentStyle;\n let x2, y2, w2, h2;\n let onlyRight;\n let onlyBottom;\n let fixedTop;\n let fixedRight;\n let fixedBottom;\n let fixedLeft;\n // 判断何种方式的定位,比如左+宽度,左+右之类\n if(left[1] !== AUTO) {\n fixedLeft = true;\n computedStyle[LEFT] = calAbsolute(currentStyle, 'left', left, clientWidth, this.root);\n }\n else {\n computedStyle[LEFT] = 'auto';\n }\n if(right[1] !== AUTO) {\n fixedRight = true;\n computedStyle[RIGHT] = calAbsolute(currentStyle, 'right', right, clientWidth, this.root);\n }\n else {\n computedStyle[RIGHT] = 'auto';\n }\n if(top[1] !== AUTO) {\n fixedTop = true;\n computedStyle[TOP] = calAbsolute(currentStyle, 'top', top, clientHeight, this.root);\n }\n else {\n computedStyle[TOP] = 'auto';\n }\n if(bottom[1] !== AUTO) {\n fixedBottom = true;\n computedStyle[BOTTOM] = calAbsolute(currentStyle, 'bottom', bottom, clientHeight, this.root);\n }\n else {\n computedStyle[BOTTOM] = 'auto';\n }\n // 优先级最高left+right,其次left+width,再次right+width,再次仅申明单个,最次全部auto\n if(fixedLeft && fixedRight) {\n x2 = x + computedStyle[LEFT];\n w2 = x + clientWidth - computedStyle[RIGHT] - x2;\n }\n else if(fixedLeft) {\n x2 = x + computedStyle[LEFT];\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n }\n else if(fixedRight) {\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n else {\n onlyRight = true;\n }\n x2 = x + clientWidth - computedStyle[RIGHT] - (w2 || 0);\n // 右对齐有尺寸时还需减去margin/border/padding的\n x2 -= computedStyle[MARGIN_LEFT];\n x2 -= computedStyle[MARGIN_RIGHT];\n x2 -= computedStyle[PADDING_LEFT];\n x2 -= computedStyle[PADDING_RIGHT];\n x2 -= currentStyle[BORDER_LEFT_WIDTH][0];\n x2 -= currentStyle[BORDER_RIGHT_WIDTH][0];\n }\n else {\n x2 = x + paddingLeft;\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n }\n // top/bottom/height优先级同上\n if(fixedTop && fixedBottom) {\n y2 = y + computedStyle[TOP];\n h2 = y + clientHeight - computedStyle[BOTTOM] - y2;\n }\n else if(fixedTop) {\n y2 = y + computedStyle[TOP];\n if(height[1] !== AUTO) {\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else {\n h2 = height[0];\n }\n }\n }\n else if(fixedBottom) {\n if(height[1] !== AUTO) {\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else {\n h2 = height[0];\n }\n }\n else {\n onlyBottom = true;\n }\n y2 = y + clientHeight - computedStyle[BOTTOM] - (h2 || 0);\n // 底对齐有尺寸时y值还需减去margin/border/padding的\n y2 -= computedStyle[MARGIN_TOP];\n y2 -= computedStyle[MARGIN_BOTTOM];\n y2 -= computedStyle[PADDING_TOP];\n y2 -= computedStyle[PADDING_BOTTOM];\n y2 -= currentStyle[BORDER_TOP_WIDTH][0];\n y2 -= currentStyle[BORDER_BOTTOM_WIDTH][0];\n }\n // 未声明y的找到之前的流布局child,紧随其下\n else {\n y2 = y + paddingTop;\n let prev = item.prev;\n while(prev) {\n // 目前不考虑margin合并,直接以前面的flow的最近的prev末尾为准\n if(prev instanceof Text || prev.computedStyle[POSITION] !== 'absolute') {\n y2 = prev.y + prev.outerHeight;\n break;\n }\n prev = prev.prev;\n }\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else if(height[1] === PX) {\n h2 = height[0];\n }\n }\n // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局\n let needCalWidth;\n if((display === 'block' || ['inlineBlock', 'inline-block'].indexOf(display) > -1) && w2 === undefined) {\n needCalWidth = true;\n }\n else if(display === 'flex') {\n if(w2 === undefined) {\n needCalWidth = true;\n }\n else if(flexDirection === 'column' && h2 === undefined) {\n needCalWidth = true;\n }\n }\n // onlyRight时做的布局其实是以那个点位为left/top布局然后offset,limit要特殊计算,从本点向左侧为边界\n let wl = onlyRight ? x2 - x : clientWidth + x - x2;\n // onlyBottom相同,正常情况是左上到右下的尺寸限制\n let hl = onlyBottom ? y2 - y : clientHeight + y - y2;\n // 未直接或间接定义尺寸,取孩子宽度最大值\n if(needCalWidth) {\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n }, true, true);\n wl = item.outerWidth;\n }\n // needCalWidth传入,因为自适应尺寸上面已经计算过一次margin/padding了\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n w2, // left+right这种等于有宽度,但不能修改style,继续传入到__preLayout中特殊对待\n h2,\n }, false, true);\n if(onlyRight) {\n item.__offsetX(-item.outerWidth, true);\n }\n if(onlyBottom) {\n item.__offsetY(-item.outerHeight, true);\n }\n });\n // 递归进行,遇到absolute/relative/component的设置新容器\n children.forEach(item => {\n if(target) {\n // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr\n let node = item;\n if(node instanceof Component) {\n node = item.shadowRoot;\n }\n // 所以得2个都对比\n if(target !== node && target !== item) {\n return;\n }\n }\n if(item instanceof Dom) {\n item.__layoutAbs(isRelativeOrAbsolute(item) ? item : container, data);\n }\n else if(item instanceof Component) {\n let sr = item.shadowRoot;\n if(sr instanceof Dom) {\n sr.__layoutAbs(sr, data);\n }\n }\n });\n this.__execAr();\n }\n\n /**\n * 布局前检查继承的样式以及统计字体测量信息\n * 首次检查为整树遍历,后续检查是节点自发局部检查,不再进入\n * @param renderMode\n * @param ctx\n * @param cb\n * @private\n */\n __computeMeasure(renderMode, ctx, cb) {\n super.__computeMeasure(renderMode, ctx, cb);\n // 即便自己不需要计算,但children还要继续递归检查\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx, cb);\n });\n }\n\n render(renderMode, lv, ctx, cache, 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 unit from '../style/unit';\nimport image from '../style/image';\nimport border from '../style/border';\nimport enums from '../util/enums';\nimport level from '../refresh/level';\nimport mx from '../math/matrix';\n\nconst {\n STYLE_KEY: {\n WIDTH,\n HEIGHT,\n DISPLAY,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n VISIBILITY,\n BACKGROUND_IMAGE,\n BACKGROUND_COLOR,\n BOX_SHADOW,\n MIX_BLEND_MODE,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n FONT_SIZE,\n FLEX_BASIS,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_CONFIG,\n },\n NODE_KEY: {\n NODE_CACHE,\n NODE_DEFS_CACHE,\n NODE_IS_MASK,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH, RGBA } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { isFunction } = util;\n\nclass Img extends Dom {\n constructor(tagName, props) {\n super(tagName, props);\n let src = this.props.src;\n let loadImg = this.__loadImg = {\n src,\n };\n // 空url用错误图代替\n if(!src) {\n loadImg.error = true;\n }\n let config = this.__config;\n if(config[NODE_IS_MASK]) {\n let { style, currentStyle } = this;\n style[BACKGROUND_IMAGE] = currentStyle[BACKGROUND_IMAGE] = [null];\n style[BACKGROUND_COLOR] = currentStyle[BACKGROUND_COLOR] = [[0, 0, 0, 0], RGBA];\n style[BORDER_TOP_WIDTH] = currentStyle[BORDER_TOP_WIDTH] = [0, PX];\n style[BORDER_RIGHT_WIDTH] = currentStyle[BORDER_RIGHT_WIDTH] = [0, PX];\n style[BORDER_LEFT_WIDTH] = currentStyle[BORDER_LEFT_WIDTH] = [0, PX];\n style[BORDER_BOTTOM_WIDTH] = currentStyle[BORDER_BOTTOM_WIDTH] = [0, PX];\n style[BOX_SHADOW] = currentStyle[BOX_SHADOW] = null;\n style[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE] = 'normal';\n }\n }\n\n /**\n * 覆盖xom的方法,在__layout3个分支中会首先被调用\n * 当样式中固定宽高时,图片按样式尺寸,加载后重新绘制即可\n * 只固定宽高一个时,加载完要计算缩放比,重新布局绘制\n * 都没有固定,按照图片尺寸,重新布局绘制\n * 这里计算非固定的情况,将其改为固定供布局渲染使用,未加载完成为0\n * @param data\n * @returns {{fixedWidth: boolean, w: *, x: *, h: *, y: *, fixedHeight: boolean}}\n * @private\n */\n __preLayout(data) {\n let res = super.__preLayout(data);\n let loadImg = this.__loadImg;\n // 可能已提前加载好了,或有缓存,为减少刷新直接使用\n if(!loadImg.error) {\n let src = loadImg.src;\n let cache = inject.IMG[src];\n if(cache && cache.state === inject.LOADED) {\n loadImg.source = cache.source;\n loadImg.width = cache.width;\n loadImg.height = cache.height;\n }\n loadImg.cache = false;\n }\n if(res.fixedWidth && res.fixedHeight) {\n return res;\n }\n if(loadImg.error && !this.props.placeholder) {\n if(res.fixedWidth) {\n res.h = res.w;\n }\n else if(res.fixedHeight) {\n res.w = res.h;\n }\n else {\n res.w = res.h = 32;\n }\n }\n else if(loadImg.source) {\n if(res.fixedWidth) {\n res.h = res.w * loadImg.height / loadImg.width;\n }\n else if(res.fixedHeight) {\n res.w = res.h * loadImg.width / loadImg.height;\n }\n else {\n res.w = loadImg.width;\n res.h = loadImg.height;\n }\n }\n else {\n res.w = res.h = 0;\n }\n res.fixedWidth = true;\n res.fixedHeight = true;\n return res;\n }\n\n __addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n __destroy() {\n this.root.delRefreshTask(this.__task);\n super.__destroy();\n this.__task = null;\n }\n\n // img根据加载情况更新__hasContent\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n let res = super.__calContent(renderMode, lv, currentStyle, computedStyle);\n if(!res) {\n let {\n __loadImg: loadImg,\n } = this;\n if(computedStyle[VISIBILITY] !== 'hidden' && (computedStyle[WIDTH] || computedStyle[HEIGHT])\n && loadImg.source) {\n res = true;\n }\n }\n return res;\n }\n\n render(renderMode, lv, ctx, cache, 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 ctx.arc(cx, cy, r, 0, 2 * Math.PI);\n ctx.fill();\n ctx.closePath();\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for(let i = 1, len = pts.length; i < len; i++) {\n let point = pts[i];\n ctx.lineTo(point[0], point[1]);\n }\n ctx.lineTo(pts[0][0], pts[0][1]);\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n this.__addGeom('rect', [\n ['x', originX],\n ['y', originY],\n ['width', width],\n ['height', height],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ['fill', 'rgba(0,0,0,0)']\n ]);\n this.__addGeom('circle', [\n ['cx', cx],\n ['cy', cy],\n ['r', r],\n ['fill', fill],\n ]);\n let s = '';\n for(let i = 0, len = pts.length; i < len; i++) {\n let point = pts[i];\n if(i) {\n s += ' ';\n }\n s += point[0] + ',' + point[1];\n }\n this.__addGeom('polygon', [\n ['points', s],\n ['fill', fill]\n ]);\n }\n }\n else if(source) {\n // 圆角需要生成一个mask\n let list = border.calRadius(originX, originY, width, height,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n // 有border-radius需模拟遮罩裁剪\n if(list) {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list, 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 {\n let loadImg = this.__loadImg;\n // 加载成功计算缩放后的宽度\n if(loadImg.source) {\n if(height[1] === PX) {\n w -= loadImg.width * height[0] / loadImg.height;\n }\n else if(height[1] === PERCENT) {\n w -= loadImg.width * height[0] * total * 0.01 / loadImg.height;\n }\n else if(height[1] === REM) {\n w -= loadImg.width * height[0] * this.root.computedStyle[FONT_SIZE] / loadImg.height;\n }\n else if(height[1] === VW) {\n w -= loadImg.width * height[0] * this.root.width * 0.01 / loadImg.height;\n }\n else if(height[1] === VH) {\n w -= loadImg.width * height[0] * this.root.height * 0.01 / loadImg.height;\n }\n else {\n w -= loadImg.width;\n }\n }\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n return w;\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle, __loadImg } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n let cross = isDirectionRow ? height : width;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH].indexOf(flexBasis[1]) > -1;\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = max = min = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = max = min = flexBasis[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(flexBasis[1] === REM) {\n b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = max = min = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = max = min = flexBasis[0] * this.root.height * 0.01;\n }\n }\n else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1)) {\n if(main[1] === PX) {\n b = max = min = main[0];\n }\n else if(main[1] === PERCENT) {\n b = max = min = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = max = min = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = max = min = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = max = min = main[0] * this.root.height * 0.01;\n }\n }\n // auto和content固定尺寸比例计算\n else if(__loadImg.source || __loadImg.error) {\n if(cross[1] !== AUTO) {\n if(cross[1] === PX) {\n cross = cross[0];\n }\n else if(cross[1] === PERCENT) {\n cross = cross[0] * 0.01 * (isDirectionRow ? h : w);\n }\n else if(cross[1] === REM) {\n cross = cross[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(cross[1] === VW) {\n cross = cross[0] * this.root.width * 0.01;\n }\n else if(cross[1] === VH) {\n cross = cross[0] * this.root.height * 0.01;\n }\n let ratio = __loadImg.width / __loadImg.height;\n b = max = min = isDirectionRow ? cross * ratio : cross / ratio;\n }\n else {\n b = max = min = isDirectionRow ? __loadImg.width : __loadImg.height;\n }\n }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\n }\n\n __loadAndRefresh(loadImg, root, ctx, placeholder, computedStyle, width, height, cb) {\n let self = this;\n // 先清空之前可能的\n if(loadImg.source || loadImg.error) {\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n });\n loadImg.source = null;\n }\n loadImg.loading = true;\n // 再测量,可能瞬间完成替换掉上面的\n inject.measureImg(loadImg.src, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败走error绘制\n if(data.url === loadImg.src && !self.isDestroyed) {\n loadImg.cache && (loadImg.cache.cache = false);\n loadImg.loading = false;\n function reload() {\n let { currentStyle: { [WIDTH]: width, [HEIGHT]: height } } = self;\n root.delRefreshTask(self.__task);\n if(width[1] !== AUTO && height[1] !== AUTO) {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REPAINT;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n else {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n }\n if(data.success) {\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n }\n else if(placeholder) {\n inject.measureImg(placeholder, data => {\n if(data.success) {\n loadImg.error = true;\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n reload();\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n return;\n }\n else {\n loadImg.error = true;\n }\n // 可见状态进行刷新操作,visibility某些情况需要刷新,可能宽高未定义要重新布局\n if(computedStyle[DISPLAY] !== 'none') {\n reload();\n }\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n }\n\n updateSrc(v, cb) {\n let self = this;\n let loadImg = self.__loadImg;\n let root = this.root;\n // 相等或空且当前error直接返回\n if(v === loadImg.src || !v && loadImg.error) {\n if(isFunction(cb)) {\n cb(-1);\n }\n }\n else if(v) {\n loadImg.src = v;\n self.__loadAndRefresh(loadImg, root, root.ctx, self.props.placeholder, self.computedStyle, self.width, self.height, cb);\n }\n else {\n loadImg.src = v;\n loadImg.source = null;\n loadImg.error = true;\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, self.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb(diff);\n }\n },\n });\n }\n }\n\n appendChild() {\n inject.error('Img can not appendChild.');\n }\n\n get src() {\n return this.__loadImg.src;\n }\n\n static showError = true;\n}\n\nexport default Img;\n","class Defs {\n constructor(uuid) {\n this.id = uuid;\n this.count = 0;\n this.list = [];\n this.cacheHash = {}; // 每次svg渲染前重置,存储前次渲染不变的缓存id\n }\n add(data) {\n let uuid = this.count;\n let hash = this.cacheHash;\n while(hash.hasOwnProperty(uuid)) {\n uuid++;\n }\n this.count = uuid + 1;\n data.id = uuid;\n data.uuid = 'karas-defs-' + this.id + '-' + uuid;\n data.index = this.list.length;\n this.list.push(data);\n return data.uuid;\n }\n addCache(data) {\n data.index = this.list.length;\n this.list.push(data);\n this.cacheHash[data.id] = true;\n return data.uuid;\n }\n clear() {\n this.list = [];\n this.count = 0;\n this.cacheHash = {};\n }\n removeCache(data) {\n let list = this.list;\n let i = data.index;\n // 一般情况index即位置,但每次渲染过程中,可能会删掉一些,此时位置会往前,但index不变,因此遍历\n for(; i >= 0; i--) {\n if(list[i] === data) {\n list.splice(i, 1);\n return;\n }\n }\n }\n\n get value() {\n return this.list;\n }\n\n static getInstance(uuid) {\n return new Defs(uuid);\n }\n}\n\nexport default Defs;\n","import Xom from '../Xom';\nimport reset from '../../style/reset';\nimport css from '../../style/css';\nimport unit from '../../style/unit';\nimport enums from '../../util/enums';\nimport mode from '../mode';\nimport util from '../../util/util';\nimport painter from '../../util/painter';\nimport transform from '../../style/transform';\nimport mx from '../../math/matrix';\nimport inject from '../../util/inject';\nimport gradient from '../../math/gradient';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n WIDTH,\n HEIGHT,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n FILL,\n STROKE,\n STROKE_MITERLIMIT,\n STROKE_WIDTH,\n STROKE_LINECAP,\n STROKE_LINEJOIN,\n STROKE_DASHARRAY,\n STROKE_DASHARRAY_STR,\n FILL_RULE,\n VISIBILITY,\n FONT_SIZE,\n FLEX_BASIS,\n },\n NODE_KEY: {\n NODE_CACHE_PROPS,\n NODE_CURRENT_PROPS,\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { PX, PERCENT, REM, VW, VH } = unit;\nconst { int2rgba, isNil, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nconst REGISTER = {};\n\nclass Geom extends Xom {\n constructor(tagName, props) {\n super(tagName, props);\n this.__isMulti = !!this.props.multi;\n this.__style = css.normalize(this.style, reset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET));\n this.__currentStyle = util.extend({}, this.__style);\n this.__currentProps = util.clone(this.props);\n let config = this.__config;\n config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n config[NODE_CURRENT_PROPS] = this.__currentProps;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_STYLE] = this.__style;\n }\n\n __tryLayInline(w, total) {\n // 无children,直接以style的width为宽度,不定义则为0\n let { currentStyle: {\n [WIDTH]: width,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n return w;\n }\n\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this, this.isShadowRoot);\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n // 计算需考虑style的属性\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n [DISPLAY]: display,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n return [display, this.__addMp(isDirectionRow, data.w, currentStyle, [min, max])];\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH].indexOf(flexBasis[1]) > -1;\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = max = min = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = max = min = flexBasis[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(flexBasis[1] === REM) {\n b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = max = min = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = max = min = flexBasis[0] * this.root.height * 0.01;\n }\n }\n else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1)) {\n if(main[1] === PX) {\n b = max = min = main[0];\n }\n else if(main[1] === PERCENT) {\n b = max = min = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = max = min = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = max = min = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = max = min = main[0] * this.root.height * 0.01;\n }\n }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\n }\n\n __layoutBlock(data, isVirtual) {\n let { fixedWidth, fixedHeight, w, h } = this.__preLayout(data);\n this.__height = fixedHeight ? h : 0;\n if(isVirtual) {\n this.__width = fixedWidth ? w : 0;\n return;\n }\n this.__width = w;\n this.__ioSize(w, this.height);\n this.__marginAuto(this.currentStyle, data);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __layoutFlex(data) {\n // 无children所以等同于block\n this.__layoutBlock(data);\n }\n\n __layoutInline(data) {\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // 元素的width不能超过父元素w\n let tw = this.__width = fixedWidth ? w : x - data.x;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6) {\n let res = super.__calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6);\n if(isNil(__cacheStyle[STROKE_WIDTH])) {\n __cacheStyle[STROKE_WIDTH] = true;\n let strokeWidth = currentStyle[STROKE_WIDTH] || [];\n let w = this.width;\n computedStyle[STROKE_WIDTH] = strokeWidth.map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n else if(item[1] === PERCENT) {\n return item[0] * w * 0.01;\n }\n else if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n else if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n else {\n return 0;\n }\n });\n }\n if(isNil(__cacheStyle[STROKE_DASHARRAY])) {\n __cacheStyle[STROKE_DASHARRAY] = true;\n computedStyle[STROKE_DASHARRAY] = currentStyle[STROKE_DASHARRAY] || [];\n __cacheStyle[STROKE_DASHARRAY_STR] = computedStyle[STROKE_DASHARRAY].map(item => joinArr(item, ','));\n }\n // 直接赋值的\n [\n STROKE_LINECAP,\n STROKE_LINEJOIN,\n STROKE_MITERLIMIT,\n FILL_RULE,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n // stroke/fll移至render里处理,因为cache涉及渐变坐标偏移\n [STROKE, FILL].forEach(k => {\n if(isNil(__cacheStyle[k])) {\n let v = currentStyle[k];\n computedStyle[k] = v;\n let res = [];\n if(Array.isArray(v)) {\n v.forEach(item => {\n if(item && (item.k === 'linear' || item.k === 'radial' || item.k === 'conic')) {\n res.push(this.__gradient(renderMode, ctx, x3, y3, x4, y4, item));\n }\n else if(item[3] > 0) {\n res.push(int2rgba(item));\n }\n else {\n res.push('none');\n }\n });\n }\n __cacheStyle[k] = res;\n }\n });\n return res;\n }\n\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n // Geom强制有内容\n return computedStyle[VISIBILITY] !== 'hidden';\n }\n\n __preSet(res) {\n let { width, height, __cacheStyle, computedStyle } = this;\n let cx = res.sx3 + width * 0.5;\n let cy = res.sy3 + height * 0.5;\n let {\n [FILL]: fill,\n [STROKE]: stroke,\n [STROKE_DASHARRAY_STR]: strokeDasharrayStr,\n } = __cacheStyle;\n let {\n [STROKE_WIDTH]: strokeWidth,\n [STROKE_LINECAP]: strokeLinecap,\n [STROKE_LINEJOIN]: strokeLinejoin,\n [STROKE_MITERLIMIT]: strokeMiterlimit,\n [STROKE_DASHARRAY]: strokeDasharray,\n [FILL_RULE]: fillRule,\n } = computedStyle;\n return {\n cx,\n cy,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n fillRule,\n };\n }\n\n __preSetCanvas(renderMode, ctx, res) {\n let {\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n } = res;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(fill) {\n if(fill.k === 'linear') {\n ctx.fillStyle = fill.v;\n }\n else if(fill.k === 'radial' && !Array.isArray(fill.v)) {\n ctx.fillStyle = fill.v;\n }\n else if(fill.k === 'conic') {\n //\n }\n else if(!fill.k && ctx.fillStyle !== fill) {\n ctx.fillStyle = fill;\n }\n }\n if(stroke) {\n if(stroke.k === 'linear') {\n ctx.strokeStyle = stroke.v;\n }\n else if(stroke.k === 'radial' && !Array.isArray(stroke.v)) {\n ctx.strokeStyle = stroke.v;\n }\n else if(stroke.k === 'conic') {\n //\n }\n else if(!stroke.k && ctx.strokeStyle !== stroke) {\n ctx.strokeStyle = stroke;\n }\n }\n if(strokeWidth !== undefined && ctx.lineWidth !== strokeWidth) {\n ctx.lineWidth = strokeWidth;\n }\n if(strokeLinecap !== undefined && ctx.lineCap !== strokeLinecap) {\n ctx.lineCap = strokeLinecap;\n }\n if(strokeLinejoin !== undefined && ctx.lineJoin !== strokeLinejoin) {\n ctx.lineJoin = strokeLinejoin;\n }\n if(strokeMiterlimit !== undefined && ctx.miterLimit !== strokeMiterlimit) {\n ctx.miterLimit = strokeMiterlimit;\n }\n // 小程序没这个方法\n if(util.isFunction(ctx.getLineDash)) {\n if(strokeDasharray && !util.equalArr(ctx.getLineDash(), strokeDasharray)) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n else if(strokeDasharray) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, 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() {}\n\n // offset/resize时要多一步清空props上记录的缓存\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeX(diff, lv) {\n super.__resizeX(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeY(diff, lv) {\n super.__resizeY(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n getProps(k) {\n let v = this.currentProps[k];\n if(!isNil(v)) {\n return v;\n }\n return this['__' + k];\n }\n\n __isRealInline() {\n return false;\n }\n\n get isMulti() {\n return this.__isMulti;\n }\n\n get currentProps() {\n return this.__currentProps;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$') {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Geom has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$'\n || !obj.prototype || !(obj.prototype instanceof Geom)) {\n throw new Error('Invalid param');\n }\n if(Geom.hasRegister(name)) {\n throw new Error(`Geom has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Geom.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nexport default Geom;\n","import Xom from '../node/Xom';\nimport Dom from '../node/Dom';\nimport Component from '../node/Component';\nimport util from './util';\nimport inject from './inject';\nimport flatten from './flatten';\nimport $$type from './$$type';\nimport enums from './enums';\n\nconst {\n NODE_KEY: {\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_DOM_PARENT,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n NODE_STRUCT,\n },\n} = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet updateList = [];\nlet removeList = [];\n\nconst KEY_FLAG = {};\n\n/**\n * setState后刷新前先根遍历检查组件开始进行shouldComponentUpdate判断\n */\nfunction check(vd) {\n if(vd instanceof Dom) {\n vd.children.forEach(child => {\n if(child instanceof Dom) {\n check(child);\n }\n // 当组件有setState更新时,从叶子到根链路会标识__hasUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasUpdate) {\n child.__hasUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n // 高阶组件会进入此分支,被父组件调用\n else if(vd instanceof Component && vd.__hasUpdate) {\n vd.__hasUpdate = false;\n checkCp(vd, vd.props);\n }\n}\n\n/**\n * 检查cp是否有state变更,注意递归检查时需要看shadow不能看shadowRoot,\n * 否则高阶组件会被跳过,其更新无法触发update生命周期\n * @param cp\n * @param nextProps\n * @param forceCheckUpdate,被render()后的json的二级组件,发现props有变更强制检查更新,否则可以跳过\n */\nfunction checkCp(cp, nextProps, forceCheckUpdate) {\n if(cp.__nextState || forceCheckUpdate) {\n let shouldUpdate;\n if(util.isFunction(cp.shouldComponentUpdate)) {\n shouldUpdate = cp.shouldComponentUpdate(nextProps, cp.__nextState || cp.state);\n }\n else {\n // 没有默认更新\n shouldUpdate = true;\n }\n if(shouldUpdate) {\n updateCp(cp, nextProps, cp.__nextState || cp.state);\n }\n // 不更新则递归检查子tree的cp\n else {\n cp.props = nextProps;\n cp.state = cp.__nextState || cp.state;\n check(cp.shadow);\n }\n }\n else {\n check(cp.shadow);\n }\n}\n\n/**\n * 更新组件的props和state,清空__nextState\n * @param cp\n * @param props\n * @param state\n */\nfunction updateCp(cp, props, state) {\n cp.props = props;\n cp.state = state;\n cp.__nextState = null; // 同步在refresh前清除component的新state标识,这样frame动画在after回调中可以新设\n let oldS = cp.shadow;\n let oldSr = cp.shadowRoot;\n let oldJson = cp.__cd;\n let json = flatten(cp.render());\n // 对比新老render()返回的内容,更新后重新生成sr\n diffSr(oldS, oldJson, json);\n cp.__init(json);\n // 为了局部dom布局需要知道老的css信息\n let sr = cp.shadowRoot;\n if(sr instanceof Xom) {\n [\n '__outerWidth',\n '__outerHeight',\n '__sx',\n '__sy',\n '__sx2',\n '__sx3',\n '__sx4',\n '__sx5',\n '__sx6',\n '__sy2',\n '__sy3',\n '__sy4',\n '__sy5',\n '__sy6',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__computedStyle = sr.__config[NODE_COMPUTED_STYLE] = oldSr.computedStyle;\n }\n else {\n let domParent = cp.domParent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n sr.__config[k] = domParent.__config[k];\n });\n }\n [\n '__x',\n '__y',\n '__width',\n '__height',\n '__sx1', // text和xom\n '__sy1',\n '__layoutData',\n '__parent',\n '__domParent',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__config[NODE_DOM_PARENT] = oldSr.domParent;\n sr.__config[NODE_STRUCT] = oldSr.__config[NODE_STRUCT];\n updateList.push(cp);\n // 老的需回收,diff会生成新的dom,唯一列外是cp直接返回一个没变化的cp\n if(!util.isObject(json) || !json.__placeholder) {\n removeList.push(oldS);\n }\n // 子组件使用老的json时标识,更新后删除,render()返回空会没json对象\n if(json && json.__placeholder) {\n delete json.__placeholder;\n }\n if(json && json.__inheritAnimate) {\n delete json.__inheritAnimate;\n }\n if(json && json.__animateRecords) {\n delete json.__animateRecords;\n }\n // 高阶组件时需判断,子组件更新后生成新的sr,父组件的sr/host需要同时更新引用\n let host = cp.host;\n while(host) {\n if(host.shadow === cp) {\n host.__shadowRoot = sr;\n sr.__hostRoot = host;\n cp = host;\n host = host.host;\n }\n else {\n break;\n }\n }\n}\n\n/**\n * 非一级组件sr进行对比,key相同的无需重新生成且继承动画\n * @param vd\n * @param oj oldJson\n * @param nj\n */\nfunction diffSr(vd, oj, nj) {\n // 先遍历检查key相同的,将没有变化的key暂存下来,深度优先,这样叶子节点出现在前面,当key的叶子也有key时,确保叶子先对比\n let ojk = getKeyHash(oj, {}, vd);\n let njk = getKeyHash(nj, {});\n let keyList = [];\n let cpList = [];\n // 先对比key对应的节点,如果新老有一方对不上则落空\n Object.keys(ojk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n if(!n) {\n o.json.key = KEY_FLAG;\n }\n });\n Object.keys(njk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n // 有可能老的没有这个key,新key落空\n if(!o) {\n n.json.key = KEY_FLAG;\n return;\n }\n let oj = o.json;\n let nj = n.json;\n let vd = o.vd;\n // 相同class的组件进行对比替换\n if(oj.$$type === TYPE_CP && nj.$$type === TYPE_CP) {\n if(oj.klass === nj.klass) {\n // 对比props和children看是否全等,是则直接替换新json类型为占位符,引用老vd,否则强制更新\n diffCp(oj, nj, vd);\n // 标识对比过了\n oj.key = nj.key = KEY_FLAG;\n // 老的sr里需删除这个vd,因为老sr会回收\n cpList.push(vd);\n }\n }\n // 相同类型的vd进行对比继承动画\n else if(oj.$$type === nj.$$type && oj.tagName === nj.tagName) {\n // 需判断矢量标签mutil是否相等\n if(nj.$$type !== TYPE_GM || oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n oj.key = nj.key = KEY_FLAG;\n // key相同的dom暂存下来\n if(nj.$$type === TYPE_VD) {\n keyList.push({\n vd,\n oj,\n nj,\n });\n }\n }\n });\n // key相同的dom对比children,下面非key逻辑就不做了\n keyList.forEach(item => {\n diffChildren(item.vd, item.oj, item.nj);\n });\n // 整体tree进行对比\n diffChild(vd, oj, nj);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的\n cpList.forEach(vd => {\n removeCpFromOldTree(vd);\n });\n}\n\n/**\n * 递归检查dom的children,相同的无需重新生成,用PL类型占位符代替直接返回老vd\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChild(vd, oj, nj) {\n if(util.isObject(nj)) {\n if(nj.$$type === TYPE_CP) {\n // key对比过了忽略\n if(nj.key === KEY_FLAG) {\n return;\n }\n // 相同class的组件处理\n if(oj && oj.$$type === nj.$$type && oj.klass === nj.klass) {\n diffCp(oj, nj, vd);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收\n removeCpFromOldTree(vd);\n }\n }\n else if(nj.$$type === TYPE_GM && oj && oj.$$type === TYPE_GM) {\n // $geom的multi必须一致\n if(oj.tagName === nj.tagName && oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n }\n // dom类型递归children\n else if(nj.$$type === TYPE_VD && oj && oj.$$type === TYPE_VD) {\n if(oj.tagName === nj.tagName) {\n nj.__inheritAnimate = vd;\n }\n diffChildren(vd, oj, nj);\n }\n }\n}\n\n/**\n * dom类型的vd对比children\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChildren(vd, oj, nj) {\n let oc = oj.children;\n let nc = nj.children;\n let ol = oc.length;\n let nl = nc.length;\n let children = vd.children;\n for(let i = 0, of = 0, nf = 0, len = Math.min(ol, nl); i < len; i++) {\n let o = oc[i + of];\n let n = nc[i + nf];\n // 新老都是key直接跳过\n if(o.key === KEY_FLAG && n.key === KEY_FLAG) {\n }\n // 其中一个是key对比过了调整索引和长度\n else if(o.key === KEY_FLAG) {\n of++;\n i--;\n ol--;\n len = Math.min(ol, nl);\n }\n else if(n.key === KEY_FLAG) {\n nf++;\n i--;\n nl--;\n len = Math.min(ol, nl);\n }\n else {\n diffChild(children[i + of], o, n);\n }\n }\n // 长度不同增减的无需关注,新json创建cp有didMount,老vd会调用cp的destroy\n}\n\n/**\n * 根据json对比看cp如何更新,被render()后的json的二级组件对比才会出现\n * @param oj\n * @param nj\n * @param vd\n */\nfunction diffCp(oj, nj, vd) {\n // props全等,直接替换新json类型为占位符,引用老vd内容,无需重新创建,暂时存在json的placeholder上\n // 否则需要强制触发组件更新,包含setState内容\n nj.__placeholder = vd;\n let sr = vd.shadowRoot;\n // 对比需忽略on开头的事件,直接改老的引用到新的上,这样只变了on的话无需更新\n let exist = {};\n Object.keys(oj.props).forEach(k => {\n let v = oj.props[k];\n exist[k] = v;\n });\n Object.keys(nj.props).forEach(k => {\n let v = nj.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n vd.off(k, exist[k]);\n vd.on(k, v);\n }\n delete exist[k];\n }\n else {\n k = k.slice(2).toLowerCase();\n vd.on(k, v);\n }\n }\n });\n // 新的少的事件取消\n Object.keys(exist).forEach(k => {\n let v = exist[k];\n if(/^on[a-zA-Z]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n delete sr.listener[k];\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n vd.off(k, v);\n }\n });\n checkCp(vd, nj.props, !util.equal(oj.props, nj.props));\n}\n\n/**\n * 深度优先遍历json,将有key的记录在hash中,如果传入根vd,同步递归保存对应位置的vd\n * @param json\n * @param hash\n * @param vd\n * @returns {*}\n */\nfunction getKeyHash(json, hash, vd) {\n if(Array.isArray(json)) {\n json.forEach((item, i) => getKeyHash(item, hash, vd && vd[i]));\n }\n else if(util.isObject(json)) {\n if(json.$$type === TYPE_VD || json.$$type === TYPE_GM || json.$$type === TYPE_CP) {\n // 深度优先\n if(json.$$type === TYPE_VD) {\n getKeyHash(json.children, hash, vd && vd.children);\n }\n let key = json.props.key;\n if(!util.isNil(key) && key !== '') {\n // 重复key错误警告\n if(hash.hasOwnProperty(key)) {\n inject.warn('Component ' + vd.tagName + ' has duplicate key: ' + key);\n }\n hash[key] = {\n json,\n vd,\n };\n }\n }\n }\n return hash;\n}\n\n/**\n * 非一级组件diff发生更新时,其需要从sr的tree中移除,因为sr会销毁\n */\nfunction removeCpFromOldTree(vd) {\n // root下的一级组件不会发生回收情况,忽略\n if(!vd.host) {\n return;\n }\n let parent = vd.parent;\n if(parent) {\n let i = parent.children.indexOf(vd);\n if(i > -1) {\n parent.children[i] = null;\n }\n else {\n throw new Error('Can not find child: ' + vd.tagName);\n }\n }\n}\n\n/**\n * 执行componentDidUpdate/destroy\n */\nfunction did() {\n updateList.forEach(item => {\n if(util.isFunction(item.componentDidUpdate)) {\n item.componentDidUpdate();\n }\n });\n updateList.splice(0);\n removeList.forEach(item => {\n item.__destroy();\n });\n removeList = [];\n}\n\nexport default {\n updateList,\n check,\n did,\n};\n","import util from './util';\nimport level from '../refresh/level';\n\nconst { joinVd, joinDef } = util;\nconst { contain, NONE, TRANSFORM_ALL, OPACITY, FILTER, MIX_BLEND_MODE } = level;\n\nfunction diff(elem, ovd, nvd) {\n let cns = elem.childNodes;\n diffDefs(cns[0], ovd.defs, nvd.defs);\n // = i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinDef(nd[i]));\n }\n }\n}\n\nfunction diffDef(elem, od, nd) {\n if(od.tagName !== nd.tagName) {\n insertAdjacentHTML(elem, 'beforebegin', joinDef(nd));\n // elem.insertAdjacentHTML('beforebegin', joinDef(nd));\n elem.parentNode.removeChild(elem);\n }\n else {\n if(od.uuid !== nd.uuid) {\n elem.setAttribute('id', nd.uuid);\n }\n let op = {};\n for(let i = 0, len = (od.props || []).length; i < len; i++) {\n let prop = od.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nd.props || []).length; i < len; i++) {\n let prop = nd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n let cns = elem.childNodes;\n let ol = od.children.length;\n let nl = nd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, od.children[i], nd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nd.children[i]));\n }\n }\n }\n}\n\nfunction diffChild(elem, ovd, nvd) {\n if(ovd.type === 'dom') {\n if(nvd.type === 'dom') {\n diffD2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffD2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'text') {\n if(nvd.type === 'text') {\n diffT2T(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'geom') {\n if(nvd.type === 'dom') {\n diffG2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffG2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'img') {\n if(nvd.type === 'img') {\n diffItemSelf(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n}\n\nfunction diffX2X(elem, ovd, nvd) {\n let { transform, opacity, visibility, mask, overflow, filter, mixBlendMode, conClip } = nvd;\n if(ovd.transform !== transform) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(ovd.opacity !== opacity) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(ovd.visibility !== visibility) {\n elem.setAttribute('visibility', visibility);\n }\n if(ovd.mask !== mask) {\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n }\n if(ovd.filter !== filter || ovd.mixBlendMode !== mixBlendMode) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('filter');\n }\n }\n // if(ovd.filter !== filter) {\n // if(filter) {\n // elem.setAttribute('filter', filter);\n // }\n // else {\n // elem.removeAttribute('filter');\n // }\n // }\n if(ovd.overflow !== overflow) {\n if(overflow) {\n elem.setAttribute('clipPath', overflow);\n }\n else {\n elem.removeAttribute('overflow');\n }\n }\n if(ovd.conClip !== conClip) {\n if(conClip) {\n elem.childNodes[1].setAttribute('clip-path', conClip);\n }\n else {\n elem.childNodes[1].removeAttribute('clip-path');\n }\n }\n}\n\nfunction diffByLessLv(elem, ovd, nvd, lv) {\n let { transform, opacity, mask, filter, mixBlendMode } = nvd;\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n if(lv === NONE) {\n return;\n }\n if(contain(lv, TRANSFORM_ALL)) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(contain(lv, OPACITY)) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(contain(lv, FILTER) || contain(lv, MIX_BLEND_MODE)) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('style');\n }\n }\n}\n\nfunction diffD2D(elem, ovd, nvd, root) {\n // cache表明children无变化缓存,一定是REPAINT以下的,只需看自身的lv以及mask\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffD2G(elem, ovd, nvd) {\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n replaceWith(cns[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffT2T(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, ovd.children[i], nvd.children[i], true);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffG2D(elem, ovd, nvd) {\n diffD2G(elem, ovd, nvd);\n}\n\nfunction diffG2G(elem, ovd, nvd) {\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n }\n}\n\nfunction diffBb(elem, obb, nbb) {\n let ol = obb.length;\n let nl = nbb.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, obb[i], nbb[i]);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nbb[i]));\n }\n }\n}\n\nfunction diffItem(elem, i, ovd, nvd, isText) {\n let cns = elem.childNodes;\n if(ovd.tagName !== nvd.tagName) {\n replaceWith(cns[i], nvd);\n }\n else {\n diffItemSelf(cns[i], ovd, nvd);\n if(isText && ovd.content !== nvd.content) {\n cns[i].innerHTML = nvd.content;\n }\n }\n}\n\nfunction diffItemSelf(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let op = {};\n for(let i = 0, len = (ovd.props || []).length; i < len; i++) {\n let prop = ovd.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nvd.props || []).length; i < len; i++) {\n let prop = nvd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n}\n\nfunction replaceWith(elem, vd) {\n let res;\n if(Array.isArray(vd)) {\n res = '';\n vd.forEach(item => {\n res += joinVd(item);\n });\n }\n else {\n res = joinVd(vd);\n }\n insertAdjacentHTML(elem, 'beforebegin', res);\n // elem.insertAdjacentHTML('beforebegin', res);\n elem.parentNode.removeChild(elem);\n}\n\nfunction insertAt(elem, cns, index, html) {\n if(index >= cns.length) {\n insertAdjacentHTML(elem, 'beforeend', html);\n // elem.insertAdjacentHTML('beforeend', html);\n }\n else {\n insertAdjacentHTML(cns[index], 'beforebegin', html);\n // cns[index].insertAdjacentHTML('beforebegin', html);\n }\n}\n\nfunction removeAt(elem, cns, index) {\n if(cns[index]) {\n elem.removeChild(cns[index]);\n }\n}\n\nlet svg;\nfunction insertAdjacentHTML(elem, where, content) {\n if(elem.insertAdjacentHTML) {\n elem.insertAdjacentHTML(where, content);\n }\n else {\n switch(where) {\n case 'beforeend':\n elem.innerHTML += content;\n break;\n case 'beforebegin':\n svg = svg || document.createElement('svg');\n svg.innerHTML = content;\n elem.parentNode.insertBefore(svg.childNodes[0], elem);\n break;\n }\n }\n}\n\nexport default diff;\n","import util from '../util/util';\n\nconst { isFunction } = util;\n\nclass Controller {\n constructor() {\n this.__records = []; // 默认记录和自动记录\n this.__records2 = []; // 非自动播放的动画记录\n this.__list = [] // 默认初始化播放列表,自动播放也存这里\n this.__list2 = []; // json中autoPlay为false的初始化存入这里\n this.__onList = []; // list中已存在的侦听事件,list2初始化时也需要增加上\n this.__lastTime = {}; // 每个类型的上次触发时间,防止重复emit\n }\n\n add(v, list = this.list) {\n if(list.indexOf(v) === -1) {\n list.push(v);\n }\n }\n\n remove(v) {\n let i = this.list.indexOf(v);\n if(i > -1) {\n this.list.splice(i, 1);\n }\n }\n\n __destroy() {\n this.__records = [];\n this.__records2 = [];\n this.__list = [];\n this.__list2 = [];\n }\n\n __action(k, args) {\n this.list.forEach(item => {\n item[k].apply(item, args);\n });\n }\n\n init(records = this.__records, list = this.list) {\n // 检查尚未初始化的record,并初始化,后面才能调用各种控制方法\n if(records.length) {\n // 清除防止重复调用,并且新的json还会进入整体逻辑\n records.splice(0).forEach(item => {\n let { target, animate } = item;\n if(target.isDestroyed) {\n return;\n }\n if(Array.isArray(animate)) {\n animate.forEach(animate => {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n });\n }\n else {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n }\n });\n }\n // 非自动播放后初始化需检测事件,给非自动播放添加上,并清空本次\n if(records === this.__records2) {\n let onList = this.__onList;\n let list2 = this.list2;\n if(list2.length && onList.length) {\n list2.forEach(item => {\n onList.forEach(arr => {\n item.off(arr[0], arr[1]);\n item.on(arr[0], arr[1]);\n });\n });\n }\n }\n }\n\n __playAuto() {\n this.init();\n this.__action('play');\n }\n\n play(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('play', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n pause() {\n this.__action('pause');\n }\n\n resume(cb) {\n let once = true;\n this.__action('resume', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n __mergeAuto() {\n this.init();\n this.init(this.__records2);\n if(this.__list2.length) {\n this.__list = this.__list.concat(this.__list2);\n this.__list2 = [];\n }\n }\n\n cancel(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('cancel', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n finish(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('finish', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndStop(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('gotoAndStop', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndPlay(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('gotoAndPlay', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.__on(id[i], handle);\n }\n this.__onList.push([id, handle]);\n }\n else {\n this.__on(id, handle);\n this.__onList.push([id, handle]);\n }\n }\n\n __on(id, handle) {\n this.list.forEach(item => {\n let cb = () => {\n let time = item.timestamp;\n if(time !== this.__lastTime[id]) {\n this.__lastTime[id] = time;\n handle();\n }\n };\n cb.__karasEventCb = handle;\n item.on(id, cb);\n });\n }\n\n off(id, handle) {\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.off(id[i], handle);\n }\n }\n else {\n this.list.forEach(item => {\n item.off(id, handle);\n });\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get list2() {\n return this.__list2;\n }\n\n __set(key, value) {\n this.list.forEach(item => {\n item[key] = value;\n });\n }\n\n set playbackRate(v) {\n this.__set('playbackRate', v);\n }\n\n set iterations(v) {\n this.__set('iterations', v);\n }\n\n set playCount(v) {\n this.__set('playCount', v);\n }\n\n set fps(v) {\n this.__set('fps', v);\n }\n\n set currentTime(v) {\n this.__set('currentTime', v);\n }\n\n set spfLimit(v) {\n this.__set('spfLimit', v);\n }\n\n set delay(v) {\n this.__set('delay', v);\n }\n\n set endDelay(v) {\n this.__set('endDelay', v);\n }\n\n set fill(v) {\n this.__set('fill', v);\n }\n\n set direction(v) {\n this.__set('direction', v);\n }\n}\n\nexport default Controller;\n","import 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 Geom from '../node/geom/Geom';\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;\n }\n // 局部根节点如有perspective,则计算pm,这里不会出现嵌套,因为每个出现都会生成局部根节点\n let pm;\n if(perspective) {\n pm = tf.calPerspectiveMatrix(perspective, perspectiveOrigin);\n }\n // 广度遍历,不断一层层循环下去,用2个hash暂存每层的父matrix和opacity,blur只需记住顶层,因为子的如果有一定是cacheFilter\n let list = [index];\n let d = 0;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n d = blur.outerSize(v);\n }\n });\n opacityHash[index] = 1;\n // opacity可以保存下来层级相乘结果供外部使用,但matrix不可以,因为这里按画布原点为坐标系计算,外部合并局部根节点以bbox左上角为原点\n let matrixHash = {};\n while(list.length) {\n let arr = list.splice(0);\n for(let i = 0, len = arr.length; i < len; i++) {\n let parentIndex = arr[i];\n let total = __structs[parentIndex][STRUCT_TOTAL] || 0;\n for(let i = parentIndex + 1, len = parentIndex + total + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node2,\n [STRUCT_TOTAL]: total,\n } = __structs[i];\n // mask也不占bbox位置\n if(node2.isMask) {\n continue;\n }\n let {\n __sx1,\n __sy1,\n __config: {\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [OPACITY]: opacity,\n },\n },\n } = node2;\n // webgl不能跳过超限\n if(limitCache && !includeLimitCache) {\n return;\n }\n // display:none跳过整个节点树,visibility只跳过自身\n if(display === 'none') {\n i += total || 0;\n continue;\n }\n if(visibility === 'hidden') {\n continue;\n }\n parentIndexHash[i] = parentIndex;\n opacityHash[i] = opacityHash[parentIndex] * opacity;\n // 防止text的情况,其一定属于某个node,其bbox被计算过,text不应该计算\n if(node2 instanceof Text) {\n continue;\n }\n let bbox, dx = 0, dy = 0, hasTotal;\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n bbox = target.bbox.slice(0);\n dx = target.dbx;\n dy = target.dby;\n i += total || 0;\n hasTotal = true;\n }\n else if(__cache && __cache.available) {\n bbox = __cache.bbox.slice(0);\n dx = __cache.dbx;\n dy = __cache.dby;\n }\n else {\n bbox = node2.bbox;\n }\n // 可能Xom没有内容\n if(bbox) {\n bbox[0] -= sx1;\n bbox[1] -= sy1;\n bbox[2] -= sx1;\n bbox[3] -= sy1;\n let matrix = matrixHash[parentIndex];\n // 父级matrix初始化E为null,自身不为E时才运算,可以加速\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n tfo[0] += __sx1 - sx1 + dx;\n tfo[1] += __sy1 - sy1 + dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(pm) {\n matrix = multiply(pm, matrix);\n }\n bbox = 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);\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);\n texCache.refresh(gl, cx, cy);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n // 因为cacheTotal不总是以左上角原点为开始,所以必须每个节点重算matrix,合并box时计算的无法用到\n let matrixHash = {};\n // 先序遍历汇总到total\n for(let i = index + 1, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n let parentIndex = parentIndexHash[i];\n let matrix = matrixHash[parentIndex]; // 父节点的在每个节点计算后保存,第一个为top的默认为E(空)\n let opacity = opacityHash[i]; // opacity在合并box时已经计算可以直接用\n // 先看text,visibility会在内部判断,display会被parent判断\n if(node instanceof Text) {\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n texCache.addTexAndDrawWhenLimit(gl, __config[NODE_CACHE], opacity, matrix, cx, cy, dx, dy);\n }\n // 再看total缓存/cache,都没有的是无内容的Xom节点\n else {\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_IS_MASK]: isMask,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // mask和不可见不能被汇总到top上\n if(visibility === 'hidden' || isMask) {\n continue;\n }\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n if(__cache && __cache.available) {\n tfo[0] += __cache.sx1;\n tfo[1] += __cache.sy1;\n }\n else {\n tfo[0] += node.__sx1;\n tfo[1] += node.__sy1;\n }\n let dx = -sx1 + dbx;\n let dy = -sy1 + dby;\n tfo[0] += dx;\n tfo[1] += dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n if(target) {\n // 局部的mbm和主画布一样,先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成\n if(isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy);\n texCache.refresh(gl, cx, cy);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前fbo作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy);\n }\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n // 绘制到fbo的纹理对象上并删除fbo恢复\n texCache.refresh(gl, cx, cy);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 生成的纹理对象本身已绑定一个纹理单元了,释放lock的同时可以给texCache的channel缓存,避免重复上传\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bboxTotal);\n texCache.releaseLockChannel(n, mockCache.page);\n return [limitCache || totalLimitCache, mockCache];\n}\n\nfunction genFilterWebgl(gl, texCache, node, cache, filter, W, H) {\n let { sx1, sy1, width, height, bbox } = cache;\n let mockCache = cache;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n let res = genBlurWebgl(gl, texCache, mockCache, v, width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'hue-rotate') {\n let rotation = geom.d2r(v % 360);\n let cosR = Math.cos(rotation);\n let sinR = Math.sin(rotation);\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + cosR * 0.787 - sinR * 0.213, 0.715 - cosR * 0.715 - sinR * 0.715, 0.072 - cosR * 0.072 + sinR * 0.928, 0, 0,\n 0.213 - cosR * 0.213 + sinR * 0.143, 0.715 + cosR * 0.285 + sinR * 0.140, 0.072 - cosR * 0.072 - sinR * 0.283, 0, 0,\n 0.213 - cosR * 0.213 - sinR * 0.787, 0.715 - cosR * 0.715 + sinR * 0.715, 0.072 + cosR * 0.928 + sinR * 0.072, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'saturate' && v !== 100) {\n let amount = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + 0.787 * amount, 0.715 - 0.715 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 + 0.285 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 - 0.715 * amount, 0.072 + 0.928 * amount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'brightness' && v !== 100) {\n let b = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'grayscale' && v > 0) {\n let oneMinusAmount = 1 - v * 0.01;\n if(oneMinusAmount < 0) {\n oneMinusAmount = 0;\n }\n else if(oneMinusAmount > 1) {\n oneMinusAmount = 1;\n }\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.2126 + 0.7874 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 + 0.2848 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 + 0.9278 * oneMinusAmount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'contrast' && v !== 100) {\n let amount = v * 0.01;\n let o = -0.5 * amount;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n amount, 0, 0, 0, o,\n 0, amount, 0, 0, o,\n 0, 0, amount, 0, o,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n });\n // 切换回主程序\n gl.useProgram(gl.program);\n gl.viewport(0, 0, W, H);\n return mockCache;\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核d扩大3倍性能慢\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * 先动态生成gl程序,默认3核源码示例已注释,根据sigma获得d(一定奇数),再计算权重\n * 然后将d尺寸和权重拼接成真正程序并编译成program,再开始绘制\n */\nfunction genBlurWebgl(gl, texCache, cache, sigma, width, height, sx1, sy1, bbox) {\n let d = blur.kernelSize(sigma);\n let max = Math.max(15, gl.getParameter(gl.MAX_VARYING_VECTORS));\n while(d > max) {\n d -= 2;\n }\n let spread = blur.outerSizeByD(d);\n width += spread * 2;\n height += spread * 2;\n // 防止超限,webgl最大纹理尺寸限制\n let limit = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n if(width > limit || height > limit) {\n return;\n }\n bbox = bbox.slice(0);\n bbox[0] -= spread;\n bbox[1] -= spread;\n bbox[2] += spread;\n bbox[3] += spread;\n let cx = width * 0.5, cy = height * 0.5;\n let weights = blur.gaussianWeight(sigma, d);\n let vert = '';\n let frag = '';\n let r = Math.floor(d * 0.5);\n for(let i = 0; i < r; i++) {\n let c = (r - i) * 0.01;\n vert += `\\nv_texCoordsBlur[${i}] = a_texCoords + vec2(-${c}, -${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i}]) * ${weights[i]};`;\n }\n vert += `\\nv_texCoordsBlur[${r}] = a_texCoords;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${r}]) * ${weights[r]};`;\n for(let i = 0; i < r; i++) {\n let c = (i + 1) * 0.01;\n vert += `\\nv_texCoordsBlur[${i + r + 1}] = a_texCoords + vec2(${c}, ${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i + r + 1}]) * ${weights[i + r + 1]};`;\n }\n vert = vertexBlur.replace('[3]', '[' + d + ']').replace(/}$/, vert + '}');\n frag = fragmentBlur.replace('[3]', '[' + d + ']').replace(/}$/, frag + '}');\n let program = webgl.initShaders(gl, vert, frag);\n gl.useProgram(program);\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n texture = webgl.drawBlur(gl, program, frameBuffer, texCache, texture, cache.page.texture, i, j,\n width, height, cx, cy, spread, d, sigma);\n // 销毁这个临时program\n gl.deleteShader(program.vertexShader);\n gl.deleteShader(program.fragmentShader);\n gl.deleteProgram(program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n texCache.releaseLockChannel(j);\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox);\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genColorMatrixWebgl(gl, texCache, cache, m, width, height, sx1, sy1, bbox) {\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n gl.useProgram(gl.programCm);\n webgl.drawCm(gl, gl.programCm, j, m);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox.slice(0));\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genOverflowWebgl(gl, texCache, node, cache, W, H) {\n let sbox = node.bbox.slice(0);\n let bbox = cache.bbox;\n // 没超过无需生成\n if(bbox[0] >= sbox[0] && bbox[1] >= sbox[1] && bbox[2] <= sbox[2] && bbox[3] <= sbox[3]) {\n return;\n }\n let width = sbox[2] - sbox[0], height = sbox[3] - sbox[1];\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n // 绘制,根据坐标裁剪使用原本纹理的一部分\n gl.useProgram(gl.programOverflow);\n webgl.drawOverflow(gl, j, sbox[0] - bbox[0], sbox[1] - bbox[1], width, height, cache.width, cache.height);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let overflowCache = new MockCache(gl, texture, cache.sx1, cache.sy1, width, height, sbox);\n texCache.releaseLockChannel(i, overflowCache.page);\n return overflowCache;\n}\n\nfunction genMaskWebgl(gl, texCache, node, __config, cache, W, H, 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);console.log(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 // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n assignMatrix(m, matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n // node本身有或者父有perspective都认为需要生成3d渲染上下文\n if(tf.isPerspectiveMatrix(matrix) || parentPm) {\n if(hasRecordAsMask) {\n hasRecordAsMask[9] = true;\n }\n else {\n hasRecordAsMask = [i, lv, total, node, __config, null, null, null, null, true];\n }\n }\n // 先左乘perspective的矩阵,再左乘父级的总矩阵\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n 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 }\n else {\n mergeList.push([i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective]);\n }\n }\n }\n let limitHash = {};\n // 根据收集的需要合并局部根的索引,尝试合并,按照层级从大到小,索引从大到小的顺序,\n // 这样保证子节点在前,后节点在前,后节点是为了mask先应用自身如filter之后再进行遮罩\n if(mergeList.length) {\n mergeList.sort(function(a, b) {\n if(a[1] === b[1]) {\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n mergeList.forEach(item => {\n let [i, lv, total, node, __config, limitCache, hasMask, filter, overflow] = item;\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n } = __config;\n let needGen;\n // 可能没变化,比如被遮罩节点、filter变更等\n if(!__cacheTotal || !__cacheTotal.available) {\n let [limit, res] = genTotalWebgl(gl, texCache, node, __config, i, total || 0, __structs, __cache, limitCache, 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 target = genOverflowWebgl(gl, texCache, node, target, width, height);\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n if(filter.length) {\n if(!__cacheFilter || !__cacheFilter.available || needGen) {\n let old = target;\n target = genFilterWebgl(gl, texCache, node, target, filter, width, height);\n if(target !== old) {\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n }\n if(hasMask && (!__cacheMask || !__cacheMask.available || needGen)) {\n target = genMaskWebgl(gl, texCache, node, __config, target, width, height, 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 m = mx.m2Mat4(matrixEvent, cx, cy);\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 }\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[0] !== page || page.update) {\n // page可能为一个已有纹理,或者贴图\n if(page instanceof MockPage) {\n webgl.bindTexture(gl, page.texture, i);\n channels[i] = page;\n }\n else {\n // 可能老的先删除\n if(last) {\n gl.deleteTexture(last.texture);\n }\n page.texture = webgl.createTexture(gl, page.canvas, i);\n channels[i] = page;\n }\n hash[page.uuid] = i;\n }\n else {\n hash[page.uuid] = i;\n }\n // 标识没有更新,以及最后使用时间\n page.update = false;\n page.time = inject.now();\n }\n // 再次遍历开始本次渲染并清空\n webgl.drawTextureCache(gl, list, hash, cx, cy, revertY);\n pages.splice(0);\n list.splice(0);\n }\n }\n\n findExistTexChannel(page) {\n return this.channels.indexOf(page);\n }\n\n /**\n * 获取并锁定一个纹理单元优先使用空的,其次最久未使用的\n * @returns {number|*}\n */\n lockOneChannel() {\n // 优先返回空单元\n let channels = this.channels;\n let locks = this.locks;\n for(let i = 0; i < this.__units; i++) {\n if(!channels[i] && !locks[i]) {\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n }\n // 根据NRU返回最久未使用的\n let units = this.__units;\n let cl = [];\n for(let i = 0; i < units; i++) {\n if(!locks[i]) {\n cl.push([i, channels[i]]);\n }\n }\n if(cl.length) {\n cl.sort(function(a, b) {\n if(a[1].time !== b[1].time) {\n return (a[1].time || 0) - (b[1].time || 0);\n }\n if(a[1].fullSize !== b[1].fullSize) {\n return a[1].fullSize - b[1].fullSize;\n }\n return a[0] - b[0];\n });\n let i = cl[0][0];\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n throw new Error('No free texture unit');\n }\n\n /**\n * 释放掉i单元,并且设置内容到缓存channel中\n * @param i\n * @param setToChannel\n */\n releaseLockChannel(i, setToChannel) {\n if(this.locks[i]) {\n this.locks[i] = false;\n this.__lockUnits--;\n if(setToChannel) {\n this.channels[i] = setToChannel;\n }\n }\n }\n\n // 指定锁定一个单元\n lockChannel(i) {\n let channels = this.channels;\n let locks = this.locks;\n if(!locks[i]) {\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n }\n }\n\n /**\n * 释放纹理单元\n * @param gl\n */\n release(gl) {\n this.channels.forEach(item => {\n if(item) {\n gl.deleteTexture(item.texture);\n }\n });\n }\n\n get channels() {\n return this.__channels;\n }\n\n get locks() {\n return this.__locks;\n }\n\n 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 // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d');\n this.__renderMode = mode.CANVAS;\n }\n else if(this.tagName === 'svg') {\n this.__renderMode = mode.SVG;\n }\n else if(this.tagName === 'webgl') {\n let gl = this.__ctx = this.__dom.getContext('webgl', ca);\n this.__renderMode = mode.WEBGL;\n gl.program = webgl.initShaders(gl, vertex, fragment);\n gl.programMask = webgl.initShaders(gl, vertexMask, fragmentMask);\n gl.programClip = webgl.initShaders(gl, vertexMask, fragmentClip);\n gl.programOverflow = webgl.initShaders(gl, vertexMask, fragmentOverflow);\n gl.programCm = webgl.initShaders(gl, vertexCm, fragmentCm);\n gl.useProgram(gl.program);\n // 第一次渲染生成纹理缓存管理对象,收集渲染过程中生成的纹理并在gl纹理单元满了时进行绘制和清空,减少texImage2d耗时问题\n const MAX_TEXTURE_IMAGE_UNITS = Math.min(16, gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));\n this.__texCache = new TexCache(MAX_TEXTURE_IMAGE_UNITS);\n }\n this.refresh(null, true);\n // 第一次节点没有__root,渲染一次就有了才能diff\n if(this.dom.__root && this.dom.__root instanceof Root) {\n this.dom.__root.destroy();\n }\n this.__eventCbList = initEvent(this.dom, Root);\n this.dom.__root = this;\n }\n\n refresh(cb, isFirst) {\n this.__hookTask = null;\n let { isDestroyed, renderMode, ctx, defs, width, height } = this;\n if(isDestroyed) {\n return;\n }\n defs.clear();\n // 首次递归测量整树的继承,后续更改各自更新机制做,防止每次整树遍历;root检查首次直接做,后续在checkUpdate()中插入\n if(isFirst) {\n this.__checkRoot(renderMode, width, height);\n this.__computeMeasure(renderMode, ctx);\n }\n // 非首次刷新如果没有更新则无需继续\n else if(!this.__checkUpdate(renderMode, ctx, width, height)) {\n return;\n }\n // 获取所有字体和大小测量,仅svg需要,canvas直接做\n inject.measureText();\n this.__checkReflow(width, height);\n if(renderMode === mode.CANVAS && !this.props.noRender) {\n this.__clear(ctx, renderMode);\n 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 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 let hasUpdate;\n // root更新特殊提前,因为有继承因素\n if(updateRoot) {\n root.__updateRoot = null;\n hasUpdate = parseUpdate(renderMode, root, updateRoot,\n reflowList, measureList, cacheHash, cacheList);\n // 此时做root检查,防止root出现继承等无效样式,或者发生resize()\n if(hasUpdate) {\n root.__checkRoot(renderMode, width, height);\n }\n }\n // 汇总处理每个节点,k是递增数字直接循环遍历\n let keys = Object.keys(updateHash);\n for(let i = 0, len = keys.length; i < len; i++) {\n let t = parseUpdate(renderMode, root, updateHash[keys[i]],\n reflowList, measureList, cacheHash, cacheList, zHash, zList);\n hasUpdate = hasUpdate || t;\n }\n // 先做一部分reset避免下面measureList干扰,cacheList的是专门收集新增的额外节点\n root.__reflowList = reflowList;\n uniqueUpdateId = 0;\n root.__updateHash = root.__config[NODE_UPDATE_HASH] = {};\n cacheList.forEach(__config => {\n delete __config[NODE_UNIQUE_UPDATE_ID];\n });\n // zIndex改变的汇总修改,防止重复操作\n zList.forEach(item => {\n if(item.hasOwnProperty('__uniqueZId')) {\n delete item.__uniqueZId;\n item.__updateStruct(root.__structs);\n }\n });\n /**\n * 遍历每项节点,计算测量信息,节点向上向下查找继承信息,如果parent也是继承,先计算parent的\n * 过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n */\n let measureHash = {};\n measureList.forEach(node => {\n let { __config:{ [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId, [NODE_DOM_PARENT]: parent } } = node;\n // 在root下的component变更时root会进入,但其没有__uniqueUpdateId\n if(node !== root) {\n if(measureHash.hasOwnProperty(__uniqueUpdateId)) {\n return;\n }\n measureHash[__uniqueUpdateId] = true;\n }\n let last = node;\n // 检查measure的属性是否是inherit,在root下的component变更时root会进入,但其没有__uniqueUpdateId\n // 另外dom标识表明有dom变更强制进入\n let isInherit = node !== root\n && (updateHash[__uniqueUpdateId][UPDATE_ADD_DOM]\n || change.isMeasureInherit(updateHash[__uniqueUpdateId][UPDATE_STYLE]));\n // 是inherit,需要向上查找,从顶部向下递归计算继承信息\n if(isInherit) {\n while(parent && parent !== root) {\n let { __config: {\n [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId,\n }, currentStyle } = parent;\n let isInherit;\n if(parent.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n let style = updateHash[__uniqueUpdateId][UPDATE_STYLE];\n measureHash[__uniqueUpdateId] = true;\n let temp = change.measureInheritList(style);\n isInherit = !!temp.length;\n }\n else {\n isInherit = change.isMeasureInherit(currentStyle);\n }\n // 如果parent有inherit存入列表且继续向上,否则跳出循环\n if(isInherit) {\n last = parent;\n }\n else {\n break;\n }\n // 考虑component下的继续往上继承\n parent = parent.domParent;\n }\n }\n // 自顶向下查找inherit的,利用已有的方法+回调,当递归包含重复时标记防止重复\n last.__computeMeasure(renderMode, ctx, function(target) {\n if(target.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n measureHash[target.__config[NODE_UNIQUE_UPDATE_ID]] = true;\n }\n });\n });\n // 做完清空留待下次刷新重来\n for(let i = 0, len = keys.length; i < len; i++) {\n delete updateHash[keys[i]][UPDATE_CONFIG][NODE_UNIQUE_UPDATE_ID];\n }\n return hasUpdate;\n }\n\n /**\n * 除首次外每次刷新前检查reflow列表,计算需要reflow的节点局部重新布局\n * 当一个元素absolute不变时,其变化不会影响父元素和兄弟元素,直接自己重新局部LAYOUT包含子节点\n * 当absolute发生改变时,其变化会影响父和兄弟,视作父重新布局\n * 当inline变化时,视为其最近block/flex父变化\n * 当block变化时,往上查找最上层flex视为其变化,如不是则影响后面兄弟offset和父resize\n * 当flex变化时,往上查找最上层flex视为其变化,如不是则影响所有递归子节点layout和父resize\n * 以上3种情况向上查找时遇到absolute父均提前跳出,并标记absolute父LAYOUT\n * 上面所有情况即便结束还得额外看是否处于absolute中,是还是标记absolute重新布局\n * 当relative只变化left/top/right/bottom时,自己重新layout\n * 检测节点时记录影响的所有节点,最终形成一棵或n棵局部树\n * 需要重新布局的记作LAYOUT,被兄弟影响只需偏移的记作OFFSET,OFFSET可能会重复变为LAYOUT\n * 上述情况倘若发生包含重复,去掉子树,因子树视为被包含的重新布局\n * 如果有从root开始的,直接重新布局像首次那样即可\n * 如果非root,所有树根按先根顺序记录下来,依次执行局部布局\n * =========================\n * addDom比较特殊,是向已有节点中添加新的节点,检查影响与普通domDiff变化不同\n * @private\n */\n __checkReflow(width, height) {\n let { __reflowList: reflowList } = this;\n if(!reflowList.length) {\n return;\n }\n let root = this;\n let uniqueList = [];\n let hasRoot;\n __uniqueReflowId = 0;\n let reflowHash = {};\n // 遍历检查发生布局改变的节点列表,此时computedStyle还是老的,currentStyle是新的\n for(let i = 0, len = reflowList.length; i < len; i++) {\n let item = reflowList[i];\n let { node, component, addDom, removeDom } = item;\n // root提前跳出,完全重新布局\n if(node === this) {\n hasRoot = true;\n break;\n }\n // 添加时如果是cp则node取sr来布局\n if(addDom && node instanceof Component) {\n node = node.shadowRoot;\n }\n // 每个节点生成唯一的布局识别id存入hash防止重复\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n reflowHash[__uniqueReflowId++] = item;\n }\n // 每个节点都向上检查影响,以及是否从root开始完全重新,remove特殊对待,影响父节点视为普通父节点relay\n if(checkInfluence(root, reflowHash, node, component, addDom)) {\n hasRoot = true;\n if(addDom) {\n this.__zIndexChildren = null;\n }\n break;\n }\n // remove的要特殊对待,因为提前删除了父子兄弟关系,下面deepScan不会出现\n else if(removeDom) {\n uniqueList.push(item);\n }\n }\n __uniqueReflowId = 0;\n this.__reflowList = [];\n // 有root提前跳出\n if(hasRoot) {\n reflow.clearUniqueReflowId(reflowHash);\n // 布局分为两步,普通流和定位流,互相递归\n this.__layout({\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n // 绝对布局需要从根开始保存相对坐标系的容器引用,并根据relative/absolute情况变更\n this.__layoutAbs(this, {\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n this.__structs = this.__structure(0, 0);\n return true;\n }\n /**\n * 修剪树,自顶向下深度遍历\n * LAYOUT节点作为局部根,其递归子节点无需重复任何操作,直接去重\n * OFFSET节点作为局部根,其递归子节点先执行任何操作,后续根节点再偏移一次\n */\n else {\n this.__deepScan(function(node, options) {\n if(node.hasOwnProperty('__uniqueReflowId')) {\n let o = reflowHash[node.__uniqueReflowId];\n options.uniqueList.push(o);\n // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行\n return true;\n }\n // reflowHash没有记录则无返回继续递归执行\n }, { uniqueList });\n /**\n * 按顺序执行列表即可,上层LAYOUT先执行且停止递归子节点,上层OFFSET后执行等子节点先LAYOUT/OFFSET\n * 同级按先后顺序排列,过程中记录diff在结束后进行structs更新\n * 这里要注意margin合并的逻辑,因为最终都是block(flex等同),需要进行合并\n * 在处理一个block时,先判断是否是空block,同时看后面紧邻的有没有在uniqueList的下一个\n * 单独空block处理、2个相邻的非block处理直接可以进行判断\n * 中间的空block(即非空block的下一个是空block,且下一个不是最后一个),先记录下来list,合并后一并offset\n * 合并margin和Dom的逻辑一样,抽离共有方法\n **/\n let diffList = [];\n let diffI = 0;\n let mergeOffsetList = [];\n let __uniqueMergeOffsetId = 0;\n uniqueList.forEach(item => {\n let { node, component, addDom, removeDom } = item;\n // 重新layout的w/h数据使用之前parent暂存的,x使用parent,y使用prev或者parent的\n let cps = node.computedStyle, cts = node.currentStyle;\n let zIndex = cps[Z_INDEX], position = cps[POSITION], display = cps[DISPLAY];\n let isLastAbs = position === 'absolute';\n let isNowAbs = cts[POSITION] === 'absolute';\n let isLastNone = display === 'none';\n let isNowNone = cts[DISPLAY] === 'none';\n // none不可见布局无效可以无视\n if(isLastNone && isNowNone) {\n return;\n }\n let parent = node.domParent;\n let { __layoutData: { x, y, h }, width, computedStyle } = parent;\n let current = node;\n // cp的shadowRoot要向上到cp本身,考虑高阶组件在内到真正的顶层cp\n if(current.isShadowRoot) {\n current = current.hostRoot;\n }\n // y使用prev或者parent的,首个节点无prev,prev要忽略absolute的和display:none的\n let ref = current.prev;\n let hasFlowPrev;\n while(ref) {\n if(ref instanceof Text\n || (ref.computedStyle[POSITION] !== 'absolute' && ref.computedStyle[DISPLAY] !== 'none')) {\n y = ref.y + ref.outerHeight;\n hasFlowPrev = true;\n break;\n }\n ref = ref.prev;\n }\n // 找不到prev以parent为基准,找到则增加自身,排除remove\n if(!removeDom) {\n if(!hasFlowPrev) {\n y += computedStyle[MARGIN_TOP] + computedStyle[BORDER_TOP_WIDTH] + computedStyle[PADDING_TOP];\n }\n x += computedStyle[MARGIN_LEFT] + computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT];\n }\n // 找到最上层容器,如果是组件的子节点,以sr为container,sr本身往上找\n let container = node;\n // remove的节点本身无需再次布局\n if(!removeDom) {\n if(isNowAbs) {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n if(!container) {\n container = root;\n }\n // 由setState引发的要检查是cp自身还是更上层,如果cp被abs包含,那么node是cp的父亲,否则node是cp的sr\n // 而这种情况下传cp或node都一样,所以最终统一传node\n parent.__layoutAbs(container, null, node);\n // 优先判断dom变更\n if(addDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n return;\n }\n // 前后都是abs无需偏移后面兄弟和parent调整,component变化节点需更新struct\n else if(isLastAbs) {\n if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n }\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n return;\n }\n // 标识flow变abs,可能引发zIndex变更,重设struct和svg\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // 现在是普通流,不管之前是啥直接布局,排除remove删除的\n else {\n node.__layout({\n x,\n y,\n w: width,\n h,\n });\n y += node.outerHeight;\n if(component) {\n container = node;\n }\n else {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n }\n if(!container) {\n container = root;\n }\n // 防止geom\n if(node instanceof Dom) {\n node.__layoutAbs(container, {\n x,\n y,\n w: width,\n h,\n });\n }\n }\n }\n\n // 向上查找最近的parent是relative,需再次累加ox/oy,无需继续向上递归,因为parent已经递归包含了\n // 这样node重新布局后再次设置其使用parent的偏移\n let p = node;\n while(p && p !== root) {\n p = p.domParent;\n computedStyle = p.computedStyle;\n if(computedStyle[POSITION] === 'relative') {\n let { ox, oy } = p;\n ox && node.__offsetX(ox);\n oy && node.__offsetY(oy);\n break;\n }\n }\n\n // 向下调整next的flow位置,遇到重复LAYOUT的跳出等待其调用并处理其next,忽视掉abs,margin和abs在merge中做\n if(node.isShadowRoot) {\n node = node.hostRoot;\n }\n let next = node.next;\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n if(next.computedStyle[POSITION] === 'absolute') {\n next = next.next;\n continue;\n }\n let { y: oy } = next;\n let diff = y - oy;\n if(diff) {\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n let target = next;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let cs = target.computedStyle;\n if(cs[POSITION] !== 'absolute' && cs[DISPLAY] !== 'none') {\n target.__offsetY(diff, true, REPAINT);\n }\n next = next.next;\n }\n }\n break;\n }\n\n // 去重防止abs并记录parent,整个结束后按先序顺序进行margin合并以及偏移,注意忽略有display:none变block同时为absolute的\n if(!parent.hasOwnProperty('__uniqueMergeOffsetId') && !(isNowAbs && isLastNone)) {\n parent.__uniqueMergeOffsetId = __uniqueMergeOffsetId++;\n mergeOffsetList.push(parent);\n }\n\n // add和remove都需父节点重新生成struct,zIndexChildren已在对应api操作的before()侦听做了\n if(addDom || removeDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // component未知dom变化,所以强制重新struct,text则为其父节点,同时防止zIndex变更影响父节点\n else if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n node.domParent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(node.domParent);\n }\n }\n }\n // display有none变化,重置struct和zIndexChildren\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n });\n /**\n * mergeMargin后续调整,记录的是变更节点的父节点,因此每个节点内部直接遍历孩子进行\n * 由于保持先根遍历的顺序,因此会从最上最里的节点开始,先进行margin合并\n * 由于之前忽略掉abs节点,因此再检查直接abs是否要调整\n * 完成后对此父节点的后续兄弟节点进行调整,多次不会干扰影响\n * 然后继续往上循环,直到root结束\n */\n let inDirectAbsList = [];\n mergeOffsetList.forEach(parent => {\n delete parent.__uniqueMergeOffsetId;\n let flowChildren = parent.flowChildren, absChildren = parent.absChildren;\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length, lastChild;\n let isStart, startIndex, startNode;\n // 遍历flow孩子,从开始变化的节点开始,看变化造成的影响,对其后面节点进行偏移,并统计总偏移量\n for(let i = 0; i < length; i++) {\n let item = flowChildren[i];\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n let isXom = item instanceof Xom;\n // 忽略掉前面没有变更的节点,不能合并\n if(!isStart && isXom) {\n if(item.hasOwnProperty('__uniqueReflowId')) {\n isStart = true;\n startIndex = i;\n startNode = item;\n }\n }\n // 开始变更的节点,至少不是第0个\n let cs = isXom && item.currentStyle;\n let isInline = isXom && cs[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(cs[DISPLAY]) > -1;\n lastChild = item;\n // 每次循环开始前,这次不是block的话,看之前遗留的,可能是以空block结束,需要特殊处理,单独一个空block也包含\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length && isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n // 和普通布局类似,只是不用重新布局只需处理合并margin再根据差值偏移\n if(isXom && !isInline) {\n let isNone = isXom && cs[DISPLAY] === 'none';\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n // 空block要留下轮循环看,除非是最后一个,非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n if(isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n // 需要合并的情况,根据记录数和索引向上向下遍历节点设置偏移,同时设置总偏移量供父级使用\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0,最后一个一定有不必判断isStart\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n }\n // 先检查parent的尺寸是否发生了变化,从而决定是否调整next以及向上递归调整\n let cs = parent.currentStyle;\n let height = cs[HEIGHT];\n let isContainer = parent === root || parent.isShadowRoot || cs[POSITION] === 'absolute' || cs[POSITION] === 'relative';\n if(height[1] === AUTO && lastChild) {\n let oldH = parent.height + parent.computedStyle[PADDING_TOP];\n let nowH = lastChild.y + lastChild.outerHeight - parent.y;\n let diff = nowH - oldH;\n // 调整next以及非固定PX的abs,再递归向上\n if(diff) {\n parent.__resizeY(diff, REPAINT);\n let container;\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = item.currentStyle;\n // 是容器,所有的都调整,不是容器,其偏移是上级parent的某一个,根据情况具体不同\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n else if(bottom[1] === PX) {\n item.__offsetY(diff, true, REPAINT);\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n else if(top[1] === PERCENT) {\n if(isContainer) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n // 非容器的特殊处理\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n if(container.currentStyle[HEIGHT][1] !== PX) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, null, item);\n }\n // 不在容器内说明在上级,存入等结束后统一重新布局\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, item]);\n }\n }\n }\n reflow.offsetAndResizeByNodeOnY(parent, root, reflowHash, diff, inDirectAbsList);\n return;\n }\n }\n // 没有diff变化或者固定尺寸,可能内部发生变化,调整AUTO的abs,不递归向上\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom } = item.currentStyle;\n if(top[1] === AUTO && bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n }\n });\n // merge过程中需要重新布局的abs\n inDirectAbsList.forEach(arr => {\n arr[0].__layoutAbs(arr[1], null, arr[2]);\n });\n\n // 调整因reflow造成的原struct数据索引数量偏差,纯zIndex的已经在repaint里面重新生成过了\n // 这里因为和update保持一致的顺序,因此一定是先根顺序且互不包含\n let diff = 0, lastIndex = 0, isFirst = true, structs = root.__structs;\n diffList.forEach(item => {\n let [ns, d] = item;\n // 第一个有变化的,及后面无论有无变化都需更新\n // 第1个变化区域无需更改前面一段\n if(isFirst) {\n isFirst = false;\n lastIndex = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1;\n diff += d;\n }\n // 第2+个变化区域看是否和前面一个相连,有不变的段则先偏移它,然后再偏移自己\n else {\n let j = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1 + diff;\n for(let i = lastIndex; i < j; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n lastIndex = j;\n diff += d;\n }\n });\n // 后面的要根据偏移量校正索引\n if(diff) {\n for(let i = lastIndex, len = structs.length; i < len; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n }\n // 清除id\n reflow.clearUniqueReflowId(reflowHash);\n }\n }\n\n // 特殊覆盖方法,不需要super()计算自己,因为放在每次checkRoot()做过了\n __computeMeasure(renderMode, ctx) {\n css.computeMeasure(this, true);\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx);\n });\n }\n\n // 每个root拥有一个刷新hook,多个root塞到frame的__hookTask里\n // frame在所有的帧刷新逻辑执行后检查hook列表,进行root刷新操作\n __frameHook() {\n if(!this.__hookTask) {\n let r = this.__hookTask = (() => {\n this.refresh();\n });\n frame.__hookTask.push(r);\n }\n }\n\n __clear(ctx, renderMode) {\n if(renderMode === mode.CANVAS) {\n // 可能会调整宽高,所以每次清除用最大值\n this.__mw = Math.max(this.__mw, this.width);\n this.__mh = Math.max(this.__mh, this.height);\n // 清除前得恢复默认matrix,防止每次布局改变了属性\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, this.__mw, this.__mh);\n }\n else if(renderMode === mode.WEBGL) {\n ctx.clearColor(0, 0, 0, 0);\n ctx.clear(ctx.COLOR_BUFFER_BIT);\n }\n }\n\n get dom() {\n return this.__dom;\n }\n\n get uuid() {\n return this.__uuid;\n }\n\n get renderMode() {\n return this.__renderMode;\n }\n\n get ctx() {\n return this.__ctx;\n }\n\n get defs() {\n return this.__defs;\n }\n\n get taskUp() {\n return this.__taskUp;\n }\n\n get taskCp() {\n return this.__taskCp;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get animateController() {\n return this.__animateController;\n }\n\n get texCache() {\n return this.__texCache;\n }\n}\n\nexport default Root;\n","import Geom from './Geom';\nimport mode from '../mode';\nimport painter from '../../util/painter';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction reBuild(target, origin, base, isMulti) {\n if(isMulti) {\n return target.map(item => origin + item * base);\n }\n else {\n return origin + target * base;\n }\n}\n\nfunction reBuildC(target, originX, originY, width, height, isMulti) {\n if(isMulti) {\n if(target) {\n return target.map(item => reBuildC(item, originX, originY, width, height));\n }\n }\n else {\n if(target && target.length >= 2) {\n return [\n originX + target[0] * width,\n originY + target[1] * height,\n ];\n }\n }\n return [];\n}\n\nfunction curveNum(controlA, controlB) {\n let num = 0;\n if(controlA.length >= 2) {\n num++;\n }\n if(controlB.length >= 2) {\n num += 2;\n }\n return num;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getNewPoint(x1, y1, x2, y2, controlA, controlB, num, start = 0, end = 1) {\n if(start > 0 || end < 1) {\n if(num === 3) {\n [[x1, y1], controlA, controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, controlB, [x2, y2]], start, end);\n }\n else if(num === 2) {\n [[x1, y1], controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlB, [x2, y2]], start, end);\n }\n else if(num === 1) {\n [[x1, y1], controlA, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, [x2, y2]], start, end);\n }\n else {\n let a = Math.abs(x1 - x2);\n let b = Math.abs(y1 - y2);\n x1 += a * start;\n y1 += b * start;\n x2 -= a * (1 - end);\n y2 -= b * (1 - end);\n }\n }\n return [x1, y1, x2, y2, controlA, controlB];\n}\n\nclass Line extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // x1,y1和x2,y2表明线段的首尾坐标,control表明控制点坐标\n if(this.isMulti) {\n this.__x1 = [0];\n this.__y1 = [0];\n this.__x2 = [1];\n this.__y2 = [1];\n this.__controlA = [[]];\n this.__controlB = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.x1)) {\n this.__x1 = props.x1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x1)) {\n this.__x1 = [parseFloat(props.x1) || 0];\n }\n if(Array.isArray(props.y1)) {\n this.__y1 = props.y1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y1)) {\n this.__y1 = [parseFloat(props.y1) || 0];\n }\n if(Array.isArray(props.x2)) {\n this.__x2 = props.x2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x2)) {\n this.__x2 = [parseFloat(props.x2) || 0];\n }\n if(Array.isArray(props.y2)) {\n this.__y2 = props.y2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y2)) {\n this.__y2 = [parseFloat(props.y2) || 0];\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__x1.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__x1.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__x1.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__x1.map(() => v);\n }\n }\n else {\n this.__x1 = this.__y1 = this.__start = 0;\n this.__x2 = this.__y2 = this.__end = 1;\n this.__controlA = [];\n this.__controlB = [];\n if(!isNil(props.x1)) {\n this.__x1 = parseFloat(props.x1) || 0;\n }\n if(!isNil(props.y1)) {\n this.__y1 = parseFloat(props.y1) || 0;\n }\n if(!isNil(props.x2)) {\n this.__x2 = parseFloat(props.x2) || 0;\n }\n if(!isNil(props.y2)) {\n this.__y2 = parseFloat(props.y2) || 0;\n }\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA;\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB;\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, __cacheProps, isMulti } = this;\n let rebuild;\n ['x1', 'x2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originX, width, isMulti);\n }\n });\n ['y1', 'y2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originY, height, isMulti);\n }\n });\n ['controlA', 'controlB'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuildC(this[k], originX, originY, width, height, isMulti);\n }\n });\n ['start', 'end'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = this[k];\n }\n });\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 },\n } = this;\n this.buildCache(originX, originY);\n let { x1, y1, x2, y2, controlA, controlB } = __cacheProps;\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n if(!isMulti) {\n x1 = [x1];\n x2 = [x2];\n y1 = [y1];\n y2 = [y2];\n controlA = [controlA];\n controlB = [controlB];\n }\n x1.forEach((xa, i) => {\n let ya = y1[i];\n let xb = x2[i];\n let yb = y2[i];\n let ca = controlA[i];\n let cb = controlB[i];\n if((isNil(ca) || ca.length < 2) && (isNil(cb) || cb.length < 2)) {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[0] = Math.min(bbox[0], xb - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[1] = Math.min(bbox[1], yb - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[2] = Math.max(bbox[2], xb + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n bbox[3] = Math.max(bbox[3], yb + oy);\n }\n else if(isNil(ca) || ca.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(isNil(cb) || cb.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n });\n return bbox;\n }\n}\n\nexport default Line;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction concatPointAndControl(point, control) {\n if(Array.isArray(control) && (control.length === 2 || control.length === 4)\n && Array.isArray(point) && point.length === 2) {\n return control.concat(point);\n }\n return point;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getLength(list, isMulti) {\n let res = [];\n let total = 0;\n let increase = [];\n if(isMulti) {\n total = [];\n list.forEach(list => {\n let temp = getLength(list);\n res.push(temp.list);\n total.push(temp.total);\n increase.push([0].concat(temp.increase));\n });\n }\n else if(Array.isArray(list)) {\n total = 0;\n increase.push(0);\n let start = 0;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item)) {\n start = i;\n break;\n }\n }\n let prev = list[start];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n let a = Math.abs(item[0] - prev[0]);\n let b = Math.abs(item[1] - prev[1]);\n let c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n res.push(c);\n total += c;\n increase.push(total);\n prev = item;\n }\n else if(item.length === 4) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]]], 2);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[2], item[3]];\n }\n else if(item.length === 6) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]], [item[4], item[5]]], 3);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[4], item[5]];\n }\n }\n }\n return {\n list: res,\n total,\n increase,\n };\n}\n\nfunction getIndex(list, t, i, j) {\n if(i === j) {\n if(list[i] > t) {\n return i - 1;\n }\n return i;\n }\n let middle = i + ((j - i) >> 1);\n if(list[middle] === t) {\n return middle;\n }\n else if(list[middle] > t) {\n return getIndex(list, t, i, Math.max(middle - 1, i));\n }\n else {\n return getIndex(list, t, Math.min(middle + 1, j), j);\n }\n}\n\nfunction getNewList(list, len, start = 0, end = 1) {\n if(start === 0 && end === 1) {\n return list;\n }\n if(start >= end) {\n return [];\n }\n let i = 0, j = list.length - 1;\n if(start > 0) {\n i = getIndex(len.increase, start * len.total, i, j);\n }\n if(end < 1) {\n j = getIndex(len.increase, end * len.total, i, j);\n }\n list = util.clone(list);\n end *= len.total;\n let prePercent = 1;\n if(end > len.increase[j]) {\n let prev = list[j].slice(list[j].length - 2); // 最后2个点是x,y,前面是control\n let current = list[j + 1];\n let l = len.list[j];\n let diff = end - len.increase[j];\n let t = diff / l;\n prePercent = t;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[j + 1] = [current[1] - (1 - t) * a, current[1] - (1 - t) * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], res[3][0], res[3][1]];\n }\n }\n start *= len.total;\n if(start > len.increase[i]) {\n let prev = list[i].slice(list[i].length - 2);\n let current = list[i + 1];\n let l = len.list[i];\n // 同一条线段时如果有end裁剪,会影响start长度\n if(i === j && prePercent !== 1) {\n l *= prePercent;\n }\n let diff = start - len.increase[i];\n let t = diff / l;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[i] = [prev[0] + t * a, prev[1] + t * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([[current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([[current[4], current[5]], [current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], current[4], current[5]];\n }\n }\n if(j < list.length - 2) {\n list = list.slice(0, j + 2);\n }\n if(i > 0) {\n list = list.slice(i);\n }\n return list;\n}\n\nclass Polyline extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 所有点的列表\n if(this.isMulti) {\n this.__points = [[]];\n this.__controls = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__points.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__points.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__points.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__points.map(() => v);\n }\n }\n else {\n this.__points = [];\n // 控制点\n this.__controls = [];\n this.__start = 0;\n this.__end = 1;\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n }\n if(Array.isArray(props.controls)) {\n this.__controls = props.controls;\n }\n if(Array.isArray(props.points)) {\n this.__points = props.points;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n return points.map((item, i) => {\n if(!Array.isArray(item)) {\n return;\n }\n let len = item.length;\n if(isControl) {\n if(len !== 0 && len !== 2 && len !== 4) {\n return;\n }\n }\n else {\n if(len !== 0 && len !== 2) {\n return;\n }\n }\n let res = [];\n for(let i = 0; i < len; i++) {\n if(i % 2 === 0) {\n res.push(originX + item[i] * width);\n }\n else {\n res.push(originY + item[i] * height);\n }\n }\n return res;\n });\n }\n\n // 供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 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 },\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let { points, controls } = __cacheProps;\n if(!isMulti) {\n points = [points];\n controls = [controls];\n }\n points.forEach((pointList, i) => {\n if(!pointList || pointList.length < 2 || pointList[0].length < 2 || pointList[1].length < 2) {\n return;\n }\n let controlList = controls[i] || [];\n let [xa, ya] = pointList[0];\n for(let i = 1, len = pointList.length; i < len; i++) {\n let [xb, yb] = pointList[i];\n let c = controlList[i - 1];\n if(c && c.length === 4) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], c[2], c[3], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(c && c.length === 2) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n }\n xa = xb;\n ya = yb;\n }\n });\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Polyline;\n","import Polyline from './Polyline';\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} } = enums;\nconst { isNil } = util;\nconst { sectorPoints } = geom;\nconst { REM, VW, VH } = unit;\n\nfunction getR(v, dft) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = dft;\n }\n return v;\n}\n\nclass Sector extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 角度\n if(this.isMulti) {\n this.__begin = [0];\n this.__end = [0];\n this.__r = [1];\n if(Array.isArray(props.begin)) {\n this.__begin = props.begin.map(i => getR(i, 0));\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => getR(i, 0));\n }\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i, 1));\n }\n if(Array.isArray(props.edge)) {\n this.__edge = props.edge.map(i => !!i);\n }\n if(Array.isArray(props.closure)) {\n this.__closure = props.closure.map(i => !!i);\n }\n }\n else {\n this.__begin = this.__end = 0;\n // 半径[0, ∞),默认1\n this.__r = 1;\n // 扇形两侧是否有边\n this.__edge = false;\n // 扇形大于180°时,是否闭合两端\n this.__closure = false;\n if(!isNil(props.begin)) {\n this.__begin = getR(props.begin, 0);\n }\n if(!isNil(props.end)) {\n this.__end = getR(props.end, 0);\n }\n if(!isNil(props.r)) {\n this.__r = getR(props.r, 1);\n }\n if(!isNil(props.edge)) {\n this.__edge = !!props.edge;\n }\n if(!isNil(props.closure)) {\n this.__closure = !!props.closure;\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, begin, end, r, edge, closure, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.begin) || focus) {\n rebuild = true;\n __cacheProps.begin = (begin || 0) % 360;\n }\n if(isNil(__cacheProps.end) || focus) {\n rebuild = true;\n __cacheProps.end = (end || 0) % 360;\n }\n if(isNil(__cacheProps.r) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.r = r.map(r => r * width * 0.5);\n }\n else {\n __cacheProps.r = r * width * 0.5;\n }\n }\n r = __cacheProps.r;\n if(isNil(__cacheProps.edge) || focus) {\n rebuild = true;\n __cacheProps.edge = edge;\n }\n if(isNil(__cacheProps.closure) || focus) {\n rebuild = true;\n __cacheProps.closure = closure;\n }\n if(rebuild) {\n if(isMulti) {\n __cacheProps.list = [];\n __cacheProps.sList = [];\n begin.forEach((begin, i) => {\n let r2 = isNil(r[i]) ? width * 0.5 : r[i];\n let list = sectorPoints(cx, cy, r2, parseFloat(begin || 0) % 360, parseFloat(end[i] || 0) % 360);\n let sList = list.slice(0);\n if(closure[i]) {\n list.push(list[0].slice(0));\n if(edge) {\n sList.push(sList[0].slice(0));\n }\n }\n else {\n list.unshift([cx, cy]);\n list.push([cx, cy]);\n if(edge) {\n sList.unshift([cx, cy]);\n sList.push([cx, cy]);\n }\n }\n __cacheProps.list.push(list);\n __cacheProps.sList.push(sList);\n });\n }\n else {\n let list = sectorPoints(cx, cy, r, parseFloat(begin || 0), parseFloat(end || 0));\n let sList = list.slice(0);\n if(closure) {\n list.push(list[0].slice(0));\n if(edge) {\n sList.push(sList[0].slice(0));\n }\n }\n else {\n list.unshift([cx, cy]);\n list.push([cx, cy]);\n if(edge) {\n sList.unshift([cx, cy]);\n sList.push([cx, cy]);\n }\n }\n __cacheProps.list = list;\n __cacheProps.sList = sList;\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Sector;\n","import Geom from './Geom';\nimport util from \"../../util/util\";\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction genVertex(x, y, width, height, rx = 0, ry = 0) {\n if(rx === 0 || ry === 0) {\n return [\n [x, y],\n [x + width, y],\n [x + width, y + height],\n [x, y + height],\n [x, y],\n ];\n }\n let ox = rx * geom.H;\n let oy = ry * geom.H;\n return [\n [x + rx, y],\n [x + width - rx, y],\n [x + width + ox - rx, y, x + width, y + ry - oy, x + width, y + ry],\n [x + width, y + height - ry],\n [x + width, y + height + oy - ry, x + width + ox - rx, y + height, x + width - rx, y + height],\n [x + rx, y + height],\n [x + rx - ox, y + height, x, y + height + oy - ry, x, y + height - ry],\n [x, y + ry],\n [x, y + ry - oy, x + rx - ox, y, x + rx, y]\n ];\n}\n\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 0;\n }\n return v;\n}\n\nclass Rect extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 圆角\n if(this.isMulti) {\n this.__rx = [0];\n this.__ry = [0];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n }\n else {\n this.__rx = this.__ry = 0;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(rx => Math.min(rx, 0.5) * width);\n }\n else {\n __cacheProps.rx = Math.min(rx, 0.5) * width;\n }\n }\n if(isNil(__cacheProps.ry) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = rx.map(ry => Math.min(ry, 0.5) * height);\n }\n else {\n __cacheProps.ry = Math.min(ry, 0.5) * height;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => genVertex(originX, originY, width, height, rx, ry[i]));\n }\n else {\n __cacheProps.list = genVertex(originX, originY, width, height, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n bbox[0] = Math.min(bbox[0], originX - ox);\n bbox[1] = Math.min(bbox[1], originY - oy);\n bbox[2] = Math.max(bbox[2], originX + width + ox);\n bbox[3] = Math.max(bbox[3], originY + height + oy);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Rect;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Circle extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__r = [1];\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i));\n }\n else if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n else {\n this.__r = 1;\n if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, r, __cacheProps, isMulti } = this;\n if(isNil(__cacheProps.r) || focus) {\n if(isMulti) {\n __cacheProps.r = r.map(i => i * width * 0.5);\n __cacheProps.list = __cacheProps.r.map(r => geom.ellipsePoints(cx, cy, r));\n }\n else {\n __cacheProps.r = r * width * 0.5;\n __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Circle;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Ellipse extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__rx = [1];\n this.__ry = [1];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n else if(!isNil(props.rx)) {\n this.__rx = [getR(props.rx)];\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n else if(!isNil(props.ry)) {\n this.__ry = [getR(props.ry)];\n }\n }\n else {\n this.__rx = 1;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n this.__ry = 1;\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(i => i * width * 0.5);\n }\n else {\n __cacheProps.rx = rx * width * 0.5;\n }\n }\n if(isNil(__cacheProps.ry) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = ry.map(i => i * height * 0.5);\n }\n else {\n __cacheProps.ry = ry * height * 0.5;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => geom.ellipsePoints(cx, cy, rx, ry[i]));\n }\n else {\n __cacheProps.list = geom.ellipsePoints(cx, cy, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let rx = 0, ry = 0;\n if(isMulti) {\n let mx = 0, my = 0;\n __cacheProps.rx.forEach((rx, i) => {\n mx = Math.max(rx, mx);\n my = Math.max(ry, __cacheProps.ry[i]);\n });\n rx = mx;\n ry = my;\n }\n else {\n rx = __cacheProps.rx;\n ry = __cacheProps.ry;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - rx - ox;\n let xb = cx + rx + ox;\n let ya = cy - ry - oy;\n let yb = cy + ry + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Ellipse;\n","import reset from '../style/reset';\n\nlet fullCssProperty = {\n skewX: 'kx',\n skewY: 'ky',\n transform: 'tf',\n fontSize: 'fz',\n offset: 'os',\n easing: 'e',\n filter: 'ft',\n boxShadow: 'bd',\n overflow: 'of',\n backgroundClip: 'bp',\n textOverflow: 'tof',\n flexWrap: 'fp',\n perspective: 'ppt',\n rotate3d: 'r3',\n};\n\nlet abbrCssProperty = {\n os: 'offset', // 非css属性不会被下面反向遍历插入,手动\n e: 'easing',\n};\n\nlet fullAnimate = {\n value: 'v',\n options: 'o',\n};\n\nlet abbrAnimate = {};\n\nlet fullAnimateOption = {\n duration: 'dt',\n delay: 'd',\n endDelay: 'ed',\n iterations: 'i',\n direction: 'dc',\n fill: 'f',\n fps: 'fp',\n playbackRate: 'p',\n spfLimit: 'sl',\n};\n\nlet abbrAnimateOption = {};\n\nreset.DOM_KEY_SET.concat(reset.GEOM_KEY_SET).forEach(k => {\n if(fullCssProperty.hasOwnProperty(k)) {\n abbrCssProperty[fullCssProperty[k]] = k;\n return;\n }\n let v = k.charAt(0) + k.replace(/[a-z]/g, '').toLowerCase();\n fullCssProperty[k] = v;\n abbrCssProperty[v] = k;\n});\n\nObject.keys(fullAnimate).forEach(k => {\n abbrAnimate[fullAnimate[k]] = k;\n});\n\nObject.keys(fullAnimateOption).forEach(k => {\n abbrAnimateOption[fullAnimateOption[k]] = k;\n});\n\nexport default {\n fullCssProperty,\n abbrCssProperty,\n fullAnimate,\n abbrAnimate,\n fullAnimateOption,\n abbrAnimateOption,\n};\n","import abbr from './abbr';\nimport Node from '../node/Node';\nimport Component from '../node/Component';\nimport $$type from '../util/$$type';\nimport util from '../util/util';\nimport inject from '../util/inject';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet { isNil, isFunction, isPrimitive, clone, extend } = util;\nlet { abbrCssProperty, abbrAnimateOption, abbrAnimate } = abbr;\n\n/**\n * 还原缩写到全称,涉及样式和动画属性\n * @param target 还原的对象\n * @param hash 缩写映射\n */\nfunction abbr2full(target, hash) {\n // 也许节点没写样式\n if(target) {\n Object.keys(target).forEach(k => {\n // var-attr格式特殊考虑,仅映射attr部分,var-还要保留\n if(k.indexOf('var-') === 0) {\n let k2 = k.slice(4);\n if(hash.hasOwnProperty(k2)) {\n let fk = hash[k2];\n target['var-' + fk] = target[k];\n // delete target[k];\n }\n }\n // 普通样式缩写还原\n else if(hash.hasOwnProperty(k)) {\n let fk = hash[k];\n target[fk] = target[k];\n // 删除以免二次解析\n delete target[k];\n }\n });\n }\n}\n\nfunction replaceVars(json, vars) {\n if(json && vars) {\n // 新版vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // 排除特殊的library\n if(Array.isArray(member) && member.length && member[0] !== 'library' && vars.hasOwnProperty(id)) {\n let target = json;\n for(let i = 0, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // undefined和null意义不同\n if(v === undefined) {\n return;\n }\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n target[k] = v;\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Slot miss ' + k);\n return;\n }\n }\n }\n });\n }\n }\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-') === 0) {\n let v = json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(4);\n // 有id且变量里面传入了替换的值,值可为null,因为某些情况下空为自动\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n // undefined和null意义不同\n if(value === undefined) {\n return;\n }\n let target = json;\n // 如果有.则特殊处理子属性\n if(k2.indexOf('.') > -1) {\n let list = k2.split('.');\n let len = list.length;\n for(let i = 0; i < len - 1; i++) {\n k2 = list[i];\n // 避免异常\n if(target[k2]) {\n target = target[k2];\n }\n else {\n inject.warn('parseJson vars is not exist: ' + v.id + ', ' + k + ', ' + list.slice(0, i).join('.'));\n return;\n }\n }\n k2 = list[len - 1];\n }\n // 支持函数模式和值模式\n if(isFunction(value)) {\n value = value(v);\n }\n target[k2] = value;\n }\n }\n });\n }\n }\n}\n\nfunction replaceLibraryVars(json, hash, vars) {\n if(vars) {\n // 新版同级vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // library.xxx,需要>=2的长度\n if(Array.isArray(member) && member.length > 1 && vars.hasOwnProperty(id)) {\n if(member[0] === 'library') {\n let target = hash;\n for(let i = 1, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n let old = target[k];\n // 直接替换library的子对象,需补充id和tagName\n if(i === 1) {\n target[k] = Object.assign({ id: old.id, tagName: old.tagName }, v);\n }\n // 替换library中子对象的一个属性直接赋值\n else {\n target[k] = v;\n }\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Library slot miss ' + k);\n return;\n }\n }\n }\n }\n });\n }\n }\n // 兼容老版var-\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-library.') === 0) {\n let v = json[k];\n // 直接移除library插槽,防止下面调用replaceVars(json, vars)时报错\n delete json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(12);\n // 有id且变量里面传入了替换的值\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n if(isFunction(value)) {\n value = value(v);\n }\n // 替换图层的值必须是一个有tagName的对象\n if(!value || !value.tagName) {\n return;\n }\n // library对象也要加上id,与正常的library保持一致\n hash[k2] = Object.assign({ id: k2 }, value);\n }\n }\n });\n }\n }\n}\n\n/**\n * 遍历一遍library的一级,将一级的id存到hash上,无需递归二级,\n * 因为顺序前提要求排好且无循环依赖,所以被用到的一定在前面出现,\n * 一般是无children的元件在前,包含children的div在后\n * 即便library中的元素有children或library,在linkChild时将其link过去,parse递归会继续处理\n * @param item:library的一级孩子\n * @param hash:存放library的key/value引用\n */\nfunction linkLibrary(item, hash) {\n let id = item.id;\n // library中一定有id,因为是一级,二级+特殊需求才会出现放开\n if(isNil(id)) {\n throw new Error('Library item miss id: ' + JSON.stringify(item));\n }\n else {\n hash[id] = item;\n }\n}\n\n/**\n * 链接child到library文件,\n * props需要是clone的,因为防止多个child使用同一个库文件\n * children则直接引用,无需担心多个使用同一个\n * library也需要带上,在library直接子元素还包含library时会用到\n * @param child\n * @param libraryItem\n */\nfunction linkChild(child, libraryItem) {\n // 规定图层child只有init和动画,属性和子图层来自库\n child.tagName = libraryItem.tagName;\n child.props = clone(libraryItem.props);\n child.children = libraryItem.children;\n child.library = libraryItem.library;\n // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况\n Object.keys(libraryItem).forEach(k => {\n if(k.indexOf('var-') === 0 && !child.hasOwnProperty(k)) {\n child[k] = libraryItem[k];\n }\n });\n // 删除以免二次解析\n child.libraryId = null;\n // 规定图层实例化的属性和样式在init上,优先使用init,然后才取原型链的props\n let { init } = child;\n if(init) {\n let props = child.props = child.props || {};\n let style = props.style;\n extend(props, init);\n // style特殊处理,防止被上面覆盖丢失原始值\n if(style) {\n extend(style, init.style);\n props.style = style;\n }\n // 删除以免二次解析\n child.init = null;\n }\n}\n\nfunction parse(karas, json, animateRecords, opt, hash = {}) {\n if(isPrimitive(json) || json instanceof Node || json instanceof Component) {\n return json;\n }\n if(Array.isArray(json)) {\n return json.map(item => {\n return parse(karas, item, animateRecords, opt, hash);\n });\n }\n // 先判断是否是个链接到库的节点,是则进行链接操作\n let libraryId = json.libraryId;\n if(!isNil(libraryId)) {\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,tagName和属性和子图层来自库\n if(libraryItem) {\n linkChild(json, libraryItem);\n }\n else {\n throw new Error('Link library miss id: ' + libraryId);\n }\n json.libraryId = null;\n }\n // 再判断是否有library形成一个新的作用域,会出现library下的library使得一个链接节点链接后出现library的情况\n let library = json.library;\n if(Array.isArray(library)) {\n hash = {};\n library.forEach(item => {\n linkLibrary(item, hash);\n });\n // 替换library插槽\n replaceLibraryVars(json, hash, opt.vars);\n json.library = null;\n }\n let { tagName, props = {}, children = [], animate = [] } = json;\n if(!tagName) {\n throw new Error('Dom must have a tagName: ' + JSON.stringify(json));\n }\n let style = props.style;\n (opt.abbr !== false) && abbr2full(style, abbrCssProperty);\n // 先替换style的\n replaceVars(style, opt.vars);\n // 再替换静态属性,style也作为属性的一种,目前尚未被设计为被替换\n replaceVars(props, opt.vars);\n // 替换children里的内容,如文字,无法直接替换tagName/props/children/animate本身,因为下方用的还是原引用\n replaceVars(json, opt.vars);\n 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 let animationRecord;\n if(animate) {\n if(Array.isArray(animate)) {\n let has;\n animate.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrAnimate);\n let { value, options } = item;\n // 忽略空动画\n if(Array.isArray(value) && value.length) {\n has = true;\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n });\n if(has) {\n animationRecord = {\n animate,\n target: vd,\n };\n }\n }\n else {\n (opt.abbr !== false) && abbr2full(animate, abbrAnimate);\n let { value, options } = animate;\n if(Array.isArray(value) && value.length) {\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n animationRecord = {\n animate,\n target: vd,\n };\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n }\n }\n // 产生实际动画运行才存入列表供root调用执行\n if(animationRecord) {\n animateRecords.push(animationRecord);\n }\n return vd;\n}\n\nexport default parse;\n","import parse from './parse';\nimport abbr from './abbr';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport font from '../style/font';\nimport Controller from '../animate/Controller';\n\nlet o = {\n parse(karas, json, dom, options = {}) {\n // 特殊单例声明无需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';\n\nexport default {\n css,\n reset,\n unit,\n font,\n abbr,\n};\n","import Animation from './Animation';\nimport Controller from './Controller';\nimport easing from './easing';\nimport frame from './frame';\n\nexport default {\n Animation,\n Controller,\n easing,\n frame,\n};\n","import level from './level';\nimport change from './change';\nimport Page from './Page';\nimport Cache from './Cache';\n\nexport default {\n level,\n change,\n Page,\n Cache,\n};\n","import Node from './node/Node';\nimport Text from './node/Text';\nimport Xom from './node/Xom';\nimport Dom from './node/Dom';\nimport Img from './node/Img';\nimport Root from './node/Root';\nimport tag from './node/tag';\nimport mode from './node/mode';\nimport Geom from './node/geom/Geom';\nimport Line from './node/geom/Line';\nimport Polyline from './node/geom/Polyline';\nimport Polygon from './node/geom/Polygon';\nimport Sector from './node/geom/Sector';\nimport Rect from './node/geom/Rect';\nimport Circle from './node/geom/Circle';\nimport Ellipse from './node/geom/Ellipse';\nimport Component from './node/Component';\nimport Event from './util/Event';\nimport util from './util/util';\nimport $$type from './util/$$type';\nimport builder from './util/builder';\nimport updater from './util/updater';\nimport inject from './util/inject';\nimport enums from './util/enums';\nimport debug from './util/debug';\nimport parser from './parser/index';\nimport style from './style/index';\nimport animate from './animate/index';\nimport math from './math/index';\nimport refresh from './refresh/index';\nimport { version } from '../package.json';\n\nGeom.register('$line', Line);\nGeom.register('$polyline', Polyline);\nGeom.register('$polygon', Polygon);\nGeom.register('$sector', Sector);\nGeom.register('$rect', Rect);\nGeom.register('$circle', Circle);\nGeom.register('$ellipse', Ellipse);\n\nlet karas = {\n version,\n render(root, dom) {\n if(!(root instanceof Root)) {\n throw new Error('Render dom must be canvas/svg');\n }\n if(dom) {\n root.appendTo(dom);\n }\n return root;\n },\n createElement(tagName, props) {\n props = props || {};\n let children = [];\n for(let i = 2, len = arguments.length; i < len; i++) {\n children.push(arguments[i]);\n }\n if(util.isString(tagName)) {\n if(tagName.charAt(0) === '$') {\n return this.createGm(tagName, props);\n }\n else {\n return this.createVd(tagName, props, children);\n }\n }\n else if(tagName) {\n return this.createCp(tagName, props, children);\n }\n },\n createVd(tagName, props, children = []) {\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n if(tag.TAG_NAME.hasOwnProperty(tagName)) {\n return {\n tagName,\n props,\n children,\n $$type: $$type.TYPE_VD,\n };\n }\n throw new Error(`Can not use <${tagName}>`);\n },\n createGm(tagName, props) {\n return {\n tagName,\n props,\n $$type: $$type.TYPE_GM,\n };\n },\n createCp(klass, props, children = []) {\n props.children = children;\n return {\n klass,\n props,\n $$type: $$type.TYPE_CP,\n };\n },\n parse(json, dom, options) {\n return parser.parse(this, json, dom, options);\n },\n loadAndParse(json, dom, options) {\n return parser.loadAndParse(this, json, dom, options);\n },\n mode,\n Component,\n Node,\n Text,\n Geom,\n Xom,\n Dom,\n Img,\n Root,\n Event,\n util,\n inject,\n style,\n parser,\n animate,\n math,\n builder,\n updater,\n refresh,\n enums,\n set debug(v) {\n debug.flag = !!v;\n },\n};\n\nbuilder.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\n\nif(typeof window !== 'undefined') {\n window.karas = karas;\n}\nelse if(typeof self !== 'undefined') {\n self.karas = karas;\n}\n\nexport default karas;\n"],"names":["STYLE_KEY","POSITION","DISPLAY","TOP","RIGHT","BOTTOM","LEFT","MARGIN_TOP","MARGIN_RIGHT","MARGIN_BOTTOM","MARGIN_LEFT","PADDING_TOP","PADDING_RIGHT","PADDING_BOTTOM","PADDING_LEFT","FONT_SIZE","FONT_FAMILY","COLOR","FONT_STYLE","FONT_WEIGHT","LINE_HEIGHT","BACKGROUND_IMAGE","BACKGROUND_COLOR","BACKGROUND_SIZE","BACKGROUND_REPEAT","BACKGROUND_POSITION_X","BACKGROUND_POSITION_Y","BORDER_TOP_WIDTH","BORDER_RIGHT_WIDTH","BORDER_BOTTOM_WIDTH","BORDER_LEFT_WIDTH","BORDER_TOP_COLOR","BORDER_RIGHT_COLOR","BORDER_BOTTOM_COLOR","BORDER_LEFT_COLOR","BORDER_TOP_STYLE","BORDER_RIGHT_STYLE","BORDER_BOTTOM_STYLE","BORDER_LEFT_STYLE","BORDER_TOP_LEFT_RADIUS","BORDER_TOP_RIGHT_RADIUS","BORDER_BOTTOM_RIGHT_RADIUS","BORDER_BOTTOM_LEFT_RADIUS","WIDTH","HEIGHT","FLEX_GROW","FLEX_SHRINK","FLEX_BASIS","FLEX_DIRECTION","JUSTIFY_CONTENT","ALIGN_ITEMS","ALIGN_SELF","TEXT_ALIGN","TRANSFORM_ORIGIN","VISIBILITY","OPACITY","Z_INDEX","TRANSFORM","TRANSLATE_X","TRANSLATE_Y","TRANSLATE_Z","SCALE_X","SCALE_Y","SCALE_Z","SKEW_X","SKEW_Y","ROTATE_X","ROTATE_Y","ROTATE_Z","ROTATE_3D","PERSPECTIVE","PERSPECTIVE_ORIGIN","FILTER","BOX_SHADOW","POINTER_EVENTS","OVERFLOW","MIX_BLEND_MODE","BACKGROUND_CLIP","WHITE_SPACE","TEXT_OVERFLOW","LETTER_SPACING","LINE_CLAMP","ORDER","FLEX_WRAP","ALIGN_CONTENT","TEXT_STROKE_WIDTH","TEXT_STROKE_COLOR","TEXT_STROKE_OVER","FILL","STROKE","STROKE_WIDTH","STROKE_DASHARRAY","STROKE_DASHARRAY_STR","STROKE_LINECAP","STROKE_LINEJOIN","STROKE_MITERLIMIT","FILL_RULE","MATRIX","BORDER_TOP","BORDER_RIGHT","BORDER_BOTTOM","BORDER_LEFT","TRANSLATE_PATH","STYLE2LOWER_MAP","style2Lower","s","toLowerCase","replace","$0","$1","toUpperCase","STYLE2UPPER_MAP","style2Upper","$2","STYLE_R_KEY","STYLE_RV_KEY","STYLE_V_KEY","Object","keys","forEach","k","k2","l","UPDATE_KEY","UPDATE_NODE","UPDATE_STYLE","UPDATE_FOCUS","UPDATE_MEASURE","UPDATE_COMPONENT","UPDATE_OVERWRITE","UPDATE_KEYS","UPDATE_LIST","UPDATE_CONFIG","UPDATE_ADD_DOM","UPDATE_REMOVE_DOM","KEY_FRAME_KEY","FRAME_STYLE","FRAME_TIME","FRAME_EASING","FRAME_TRANSITION","NODE_KEY","NODE_DOM_PARENT","NODE_OPACITY","NODE_MATRIX","NODE_MATRIX_EVENT","NODE_CACHE","NODE_CACHE_TOTAL","NODE_CACHE_FILTER","NODE_CACHE_MASK","NODE_CACHE_OVERFLOW","NODE_STRUCT","NODE_TAG_NAME","NODE_CURRENT_STYLE","NODE_CURRENT_PROPS","NODE_COMPUTED_STYLE","NODE_CACHE_STYLE","NODE_CACHE_PROPS","NODE_LIMIT_CACHE","NODE_IS_MASK","NODE_IS_INLINE","NODE_HAS_CONTENT","NODE_REFRESH_LV","NODE_IS_DESTROYED","NODE_STYLE","NODE_UPDATE_HASH","NODE_UNIQUE_UPDATE_ID","NODE_DEFS_CACHE","NODE_PERSPECTIVE_MATRIX","NODE_VIRTUAL_DOM","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_FRAME_CB","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_CAL_DIFF_TIME","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","__width","__height","__baseLine","__config","i","lv","j","root","struct","diff","isLayout","__sx","__sy","x","ox","y","oy","__prev","__next","__parent","__domParent","__root","__host","__hostRoot","__virtualDom","CANVAS","SVG","WEBGL","o","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","REM","EM","VW","VH","VMAX","VMIN","calUnit","v","n","parseFloat","test","info","arial","lhr","blr","lgr","padding","f","verdana","tahoma","S","T","Z","c","t","georgia","simsun","support","fontFamily","hasOwnProperty","register","name","emSquare","ascent","descent","lineGap","addPadding","assign","position","gradient","img","identity","multiply","a","b","isE","a0","a1","a2","a3","calPoint","point","m","z","w","undefined","length","b1","c1","d1","b2","c2","d2","b3","c3","d3","a4","b4","c4","d4","d","e","inverse","inverse4","divisor","inv","det","m2m6","point2d","slice","dotProduct","x1","y1","x2","y2","crossProduct","H","Math","sqrt","vector","mx","h","deg","cos","sin","pointInPolygon","vertexes","xmax","ymax","xmin","ymin","len","max","min","pointInQuadrilateral","x4","y4","x3","y3","matrix","w1","w2","w3","w4","angleBySide","theta","pow","acos","sideByAngle","alpha","pointsDistance","triangleIncentre","ellipsePoints","sectorPoints","r","begin","end","list","floor","h2","d2r","abs","atan","rx","ry","p1","p2","p4","p3","push","concat","temp","res","getRectsIntersection","isRectsOverlap","ax1","ay1","ax4","ay4","bx1","by1","bx4","by4","isRectsInside","calCoordsInNode","px","py","node","computedStyle","width","height","calPercentInNode","ds","Infinity","PI","dt","r2d","bboxBezier2","x0","y0","minX","minY","maxX","maxY","tx","ty","sx","sy","qx","qy","bboxBezier3","cx","cy","bx","by","ax","ay","hx","hy","q","bboxBezier","arguments","norm","order","sum","reduce","simpson38","derivativeFunc","middleL","middleR","adaptiveSimpson38","eps","mid","st","sl","sr","ans","bezierLength","points","startT","endT","at","at3","p0","at2","bezierOrder","derivativeOrder","pointAtBezier","percent","maxIteration","pointAtBezierWithLength","targetLen","approachLen","approachT","preApproachT","derivative1","derivative2","numerator","denominator","sliceBezier","x12","y12","x23","y23","x123","y123","x34","y34","x234","y234","x1234","y1234","sliceBezier2Both","start","reverse","pointOnCircle","getConicGradientImage","originX","originY","stop","data","Error","getAngle","dx","dy","increasingList","map","item","color","angle","factor","idx","canvasPolygon","ctx","Array","isArray","moveTo","lineTo","quadraticCurveTo","bezierCurveTo","svgPolygon","canvasLine","controlA","controlB","num","svgLine","canvasFilter","filter","svgFilter","geom","unit","painter","calFitDashed","total","bs","be","smin","smax","dmin","dmax","ps","pd","outer","per","free","mo","calDashed","style","m1","m2","m3","m4","bw","calPoints","borderWidth","borderStyle","deg1","deg2","direction","beginRadius","endRadius","indexOf","isLast","main1","main2","cross1","cross2","tan","calTopRadiusPoints","calRightRadiusPoints","calBottomRadiusPoints","calLeftRadiusPoints","pointsList","brx","bry","erx","ery","oxl","oxr","beginList","centerList","endList","ya","yb","beginLength","needInner","crossDeg","rx1","ry1","sx1","oyl","rx2","ry2","sx2","xa","xb","ca","calBezierTopLeft","cb","controls1","controls2","limit","pop","endLength","oyr","calBezierTopRight","isStart","crossDx","p1x","p1y","p2x","p2y","dx1","dsx1","dx2","dsx2","cpx2","cpy2","cpx1","cpy1","crossDsx","beta","tanBetaDiv2Sqrt","tanAlphaHalf","degTg","degTg1","cdx1","cdy1","cx1","cy1","degTg2","cdx2","cdy2","cx2","cy2","isEnd","oyt","oyb","oxt","calBezierRightTop","oxb","calBezierRightBottom","calBezierBottomLeft","calBezierBottomRight","calBezierLeftTop","calBezierLeftBottom","calRadius","btlr","btrr","bbrr","bblr","need","btlx","btly","btrx","btry","bbrx","bbry","bblx","bbly","BR_KS","calBorderRadius","currentStyle","noRadius","target","prev","next","half","calBorderRadiusInline","contentBoxList","first","last","outerWidth","outerHeight","renderBorder","xom","renderMode","mode","beginPath","fillStyle","fill","closePath","virtualDom","bb","type","tagName","props","TYPE_VD","_","TYPE_GM","TYPE_CP","toString","isType","obj","call","isObject","isString","isFunction","isNumber","isBoolean","isDate","hasOwn","fnToString","ObjectFunctionString","isNil","joinSourceArray","arr","stringify","encodeHtml","prop","joinVirtualDom","vd","defs","joinDef","joinVd","conClip","children","isMask","content","opacity","transform","visibility","mask","overflow","mixBlendMode","def","uuid","joinItem","rgba2int","charAt","parseInt","match","int2rgba","joinArr","int2invert","arr2hash","hash","hash2arr","clone","$$type","util","Date","isPlainObject","equalArr","ai","bi","isArrayA","isArrayB","equal","getTime","extend","source","split","extendAnimate","ovd","nvd","__animationList","animationList","splice","__setTarget","assigning","finished","__stayEnd","assignCurrentStyle","__frameAnimateList","transformBbox","bbox","proto","getPrototypeOf","Ctor","constructor","assignMatrix","isPrimitive","isAuto","flag","charWidth","ELLIPSIS","antialias","premultipliedAlpha","preserveDrawingBuffer","initShaders","gl","vshader","fshader","program","createProgram","enable","BLEND","blendFunc","ONE","ONE_MINUS_SRC_ALPHA","vertexShader","loadShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","attachShader","linkProgram","linked","getProgramParameter","LINK_STATUS","error","getProgramInfoLog","deleteProgram","deleteShader","shader","createShader","shaderSource","compileShader","compiled","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","convertCoords2Gl","revertY","createTexture","tex","texture","bindTexture","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","texImage2D","TEXTURE_2D","UNSIGNED_BYTE","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","LINEAR","TEXTURE_MAG_FILTER","activeTexture","drawTextureCache","vtPoint","vtTex","vtOpacity","lastChannel","record","stack","cache","channel","page","tx1","ty1","tx2","ty2","pointBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","Float32Array","STATIC_DRAW","a_position","getAttribLocation","vertexAttribPointer","FLOAT","enableVertexAttribArray","texBuffer","a_texCoords","opacityBuffer","a_opacity","u_texture","getUniformLocation","count","uniform1i","drawArrays","TRIANGLES","deleteBuffer","disableVertexAttribArray","drawBlur","frameBuffer","texCache","tex1","tex2","spread","sigma","u_direction","uniform2f","ratio","recycle","tex3","framebufferTexture2D","FRAMEBUFFER","COLOR_ATTACHMENT0","tex4","deleteTexture","drawCm","u_m","uniform1fv","drawOverflow","programOverflow","drawMask","u_texture1","u_texture2","drawMbm","W","SPF","CANVAS_LIST","WEBGL_LIST","SUPPORT_OFFSCREEN_CANVAS","OffscreenCanvas","prototype","getContext","defaultFontFamilyData","key","message","debug","document","createElement","setAttribute","body","appendChild","canvas","draw","enabled","available","release","cacheCanvas","cacheWebgl","IMG","INIT","LOADING","LOADED","FONT","COMPONENT","inject","measureText","textCache","html","lengths","chars","ff","fs","fw","inline","char","div","left","top","innerHTML","cns","childNodes","index","css","window","getComputedStyle","text","__measureCb","removeChild","measureTextSync","measureImg","url","state","success","task","Image","onload","onerror","substr","host","exec","location","hostname","crossOrigin","src","warn","console","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","id","clearTimeout","now","performance","hasCacheCanvas","getCacheCanvas","releaseCacheCanvas","delCacheCanvas","hasCacheWebgl","getCacheWebgl","releaseCacheWebgl","delCacheWebgl","isDom","Element","self","getElementsByTagName","isWebGLTexture","WebGLTexture","checkSupportFontFamily","font","checked","context","textAlign","textBaseline","clearRect","fillText","getImageData","loadFont","FontFace","load","then","loadComponent","script","async","head","getLinearDeg","getRadialPosition","center","right","bottom","getColorStop","firstColor","p","dr","dg","db","da","unshift","calLinearCoords","calCircleCentre","iw","ih","positionX","positionY","calRadialRadius","shape","size","xl","yl","asin","parseGradient","reg","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","log","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","__hasUpdate","__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","Animation","__id","nl","__options","op","config","__frameCb","__calDiffTime","iterations","framesR","originStyle","fps","spfLimit","delay","endDelay","playbackRate","isFinish","__cancelTask","__currentProps","__currentStyle","isDelay","FRAME","PLAY","playState","__hasFin","__hasCancel","playCount","currentFrames","stayBegin","stayEnd","is2","endTime","currentTime","currentFrame","round","isAlternate","alternate","isEven","isLastCount","frameTime","isLastFrame","inEndDelay","needClean","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","isDirectItem","__calMp","isVirtual","fromAbs","isShadowRoot","clearCache","__layoutData","__layoutNone","__mp","__isRealInline","__layoutFlex","__layoutInline","__layoutBlock","__sx2","__sx3","__sx4","__sx5","__sx6","__sy2","__sy3","__sy4","__sy5","__sy6","__execAr","ar","controller","autoPlay","__records2","init","list2","__records","__playAuto","h3","nowrap","fixedWidth","fixedHeight","selfEndSpace","offsetWidth","offsetHeight","matrixCache","isScale","clientHeight","x5","x6","y5","y6","__calFilter","bg","bgI","item2","kw","__bx1","__bx2","__by1","__by2","rebuild","__hasContent","isRealInline","sx4","sx5","sx6","sy4","sy5","sy6","hasContent","__calContent","__calPerspective","__calMatrix","__releaseWhenEmpty","limitCache","__calCache","perspectiveMatrix","offscreenBlend","offscreenMask","hasFilter","offscreenFilter","offscreenOverflow","borderList","hasBgi","some","svgBgSymbol","__gradient","isFirst","lastContentBox","lastLineBox","parentLineBox","countW","ix1","iy1","ix2","iy2","symbol","clearAnimate","clearFrameAnimate","__stopPropagation","__stopImmediatePropagation","willResponseEvent","hasEmitMask","ignore","inThis","__touchstartTarget","__getLg","__getRg","__getCg","lg","createLinearGradient","addColorStop","rg","createRadialGradient","ec","dc","pc","cur","onlyTotal","__cacheTotal","__cacheFilter","__cacheMask","__cacheOverflow","formatStyle","animation","cancel","enter","hostRoot","pJson","zChildren","zIndexChildren","__spreadBbox","LineBox","__list","__lineHeight","LineBoxManager","__lastX","__lastY","__maxX","__domList","__domStack","__isNewLine","__isEnd","__setLB","nextNewLine","genLineBox","verticalAlign","isNewLine","TAG_NAME","INLINE","BOLD","offsetAndResizeByNodeOnY","reflowHash","inDirectAbsList","isContainer","cs","__layoutAbs","isAbs","__resizeY","clearUniqueReflowId","__uniqueReflowId","getMergeMarginTB","topList","bottomList","genZIndexChildren","hasMc","mcHash","lastMaskIndex","__iIndex","__zIndex","__aIndex","genOrderChildren","__order","block","inlineBlock","none","tag","__flexLine","__zIndexChildren","__structure","nss","__structs","structs","needSort","__tryLayInline","firstCharWidth","main","isRow","__calMinMax","min2","max2","countMin","countMax","setNotEnd","__addMp","isFixed","isContent","fixedSize","__lineBoxManager","__preLayout","__ioSize","mergeMarginBottomList","mergeMarginTopList","isXom","isInlineBlock","isImg","reflow","__isIbFull","lastX","lastY","isNone","isEmptyBlock","tw","th","horizonAlign","__inlineSize","domList","__marginAuto","growList","shrinkList","basisList","maxList","minList","orderChildren","__calBasis","containerSize","isMultiLine","line","hypotheticalList","hypothetical","maxCrossList","__layoutFlexLine","maxCross","crossSum","crossSumList","between","around","__crossAlign","flexLine","hypotheticalSum","targetMainList","factorSum","factorList","needReset","factorSum2","lbmList","firstBaseLine","genLineBoxByInlineIfNewLine","setLbByInlineIfNotNewLine","pushContentBoxList","isIbFull","isInline2","isInlineBlock2","focusNoWrap","fw2","addX","popContentBoxList","maxCX","maxCY","minCX","minCY","maxFX","maxFY","minFX","minFY","maxOX","maxOY","minOX","minOY","absChildren","onlyRight","onlyBottom","fixedTop","fixedRight","fixedBottom","fixedLeft","needCalWidth","wl","hl","__computeMeasure","__deepScan","loadImg","__loadImg","placeholder","loading","__loadAndRefresh","showError","pts","arc","__addGeom","reload","Defs","cacheHash","__isMulti","multi","__cacheProps","strokeDasharrayStr","lineCap","lineJoin","miterLimit","getLineDash","setLineDash","preData","__preSet","fills","fillRules","strokes","strokeWidths","strokeDasharrays","strokeDasharrayStrs","strokeLinecaps","strokeLinejoins","strokeMiterlimits","__renderOnePolygon","isFillCE","isStrokeCE","isFillRE","isStrokeRE","__conicGradient","__drawPolygon","__radialEllipse","isFill","isStroke","__preSetCanvas","__propsStrokeStyle","__inversePtList","updateList","removeList","KEY_FLAG","check","checkCp","nextProps","forceCheckUpdate","shouldUpdate","shouldComponentUpdate","updateCp","oldS","oldSr","oldJson","diffSr","oj","nj","ojk","getKeyHash","njk","keyList","cpList","diffCp","diffChildren","diffChild","removeCpFromOldTree","oc","ol","of","nf","exist","ex","did","componentDidUpdate","elem","diffDefs","diffBb","diffD2D","od","nd","diffDef","removeAt","insertAt","insertAdjacentHTML","parentNode","removeAttribute","diffItem","diffD2G","replaceWith","diffT2T","diffG2D","diffG2G","diffItemSelf","diffX2X","diffByLessLv","firstChild","lastChild","obb","nbb","isText","svg","where","insertBefore","Controller","__list2","__onList","__lastTime","args","records","animate","onList","__action","__mergeAuto","__on","timestamp","__set","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","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","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","__ctx","__renderMode","vertex","fragment","vertexMask","fragmentMask","fragmentClip","fragmentOverflow","vertexCm","fragmentCm","MAX_TEXTURE_IMAGE_UNITS","__texCache","destroy","__eventCbList","__checkRoot","__checkUpdate","__checkReflow","noRender","__clear","__vd","domDiff","updateStyle","taskUp","__nextFrameCp","updater","includeIgnore","scan","path","zPath","__index__","karas","path2","zPath2","nodeConfig","rootConfig","updateHash","__updateRoot","updateRoot","hasUpdate","__updateStruct","measureHash","__uniqueUpdateId","isInherit","uniqueList","hasRoot","diffList","diffI","mergeOffsetList","__uniqueMergeOffsetId","cps","cts","isLastAbs","isNowAbs","isLastNone","isNowNone","hasFlowPrev","__modifyStruct","startIndex","startNode","oldH","nowH","lastIndex","ns","reBuild","base","reBuildC","curveNum","limitStartEnd","getNewPoint","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","__start","__end","dy2","buildCache","curve","bezierBox","concatPointAndControl","control","getLength","increase","getIndex","getNewList","prePercent","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","replaceLibraryVars","linkLibrary","JSON","linkChild","libraryItem","library","libraryId","parse","animateRecords","opt","createGm","createCp","createVd","animationRecord","singleton","fonts","loadAndParse","components","imgs","list1","list3","version","appendTo","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAMA,SAAS,GAAG;EAChBC,EAAAA,QAAQ,EAAE,CADM;EAEhBC,EAAAA,OAAO,EAAE,CAFO;EAGhBC,EAAAA,GAAG,EAAE,CAHW;EAIhBC,EAAAA,KAAK,EAAE,CAJS;EAKhBC,EAAAA,MAAM,EAAE,CALQ;EAMhBC,EAAAA,IAAI,EAAE,CANU;EAOhBC,EAAAA,UAAU,EAAE,CAPI;EAQhBC,EAAAA,YAAY,EAAE,CARE;EAShBC,EAAAA,aAAa,EAAE,CATC;EAUhBC,EAAAA,WAAW,EAAE,CAVG;EAWhBC,EAAAA,WAAW,EAAE,EAXG;EAYhBC,EAAAA,aAAa,EAAE,EAZC;EAahBC,EAAAA,cAAc,EAAE,EAbA;EAchBC,EAAAA,YAAY,EAAE,EAdE;EAehBC,EAAAA,SAAS,EAAE,EAfK;EAgBhBC,EAAAA,WAAW,EAAE,EAhBG;EAiBhBC,EAAAA,KAAK,EAAE,EAjBS;EAkBhBC,EAAAA,UAAU,EAAE,EAlBI;EAmBhBC,EAAAA,WAAW,EAAE,EAnBG;EAoBhBC,EAAAA,WAAW,EAAE,EApBG;EAqBhBC,EAAAA,gBAAgB,EAAE,EArBF;EAsBhBC,EAAAA,gBAAgB,EAAE,EAtBF;EAuBhBC,EAAAA,eAAe,EAAE,EAvBD;EAw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ae2995e8258e6c55828b387ee3e79733d9 Mon Sep 17 00:00:00 2001 From: army8735 Date: Mon, 29 Nov 2021 14:54:08 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81vmax/vmin=20#194?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 502 +++++++++++++++++++++++++++++++++++--- index.js.map | 2 +- src/animate/Animation.js | 80 +++++- src/node/Dom.js | 104 +++++++- src/node/Img.js | 72 +++++- src/node/Text.js | 8 +- src/node/Xom.js | 126 +++++++++- src/node/geom/Circle.js | 8 +- src/node/geom/Ellipse.js | 8 +- src/node/geom/Geom.js | 72 +++++- src/node/geom/Line.js | 8 +- src/node/geom/Polyline.js | 8 +- src/node/geom/Rect.js | 8 +- src/node/geom/Sector.js | 8 +- src/style/abbr.js | 12 +- src/style/bg.js | 14 +- src/style/border.js | 8 +- src/style/css.js | 50 +++- src/style/gradient.js | 28 ++- src/style/reg.js | 2 +- src/style/transform.js | 20 +- 21 files changed, 1074 insertions(+), 74 deletions(-) diff --git a/index.js b/index.js index 090d0dffc..21730348a 100644 --- a/index.js +++ b/index.js @@ -839,7 +839,7 @@ o$1.info['宋体'] = o$1.info.simsun; var reg = { - position: /(([-+]?[\d.]+[pxremvwh%]*)|(left|top|right|bottom|center)){1,2}/ig, + position: /(([-+]?[\d.]+[pxremvwhina%]*)|(left|top|right|bottom|center)){1,2}/ig, // tfo: /((-?[\d.]+(px|%)?)|(left|top|right|bottom|center)){1,2}/ig, gradient: /\b(\w+)-?gradient\((.+)\)/i, img: /(?:\burl\((['"]?)(.*?)\1\))|(?:\b((data:)))/i @@ -2376,7 +2376,9 @@ PERCENT = o.PERCENT, REM = o.REM, VW = o.VW, - VH = o.VH; + VH = o.VH, + VMAX = o.VMAX, + VMIN = o.VMIN; var canvasPolygon$1 = painter.canvasPolygon, svgPolygon$1 = painter.svgPolygon; var _enums$STYLE_KEY$1 = enums.STYLE_KEY, @@ -4625,6 +4627,10 @@ return Math.max(0, item[0] * root.width * 0.01); } else if (item[1] === VH) { return Math.max(0, item[0] * root.height * 0.01); + } else if (item[1] === VMAX) { + return Math.max(0, item[0] * Math.max(root.width, root.height) * 0.01); + } else if (item[1] === VMIN) { + return Math.max(0, item[0] * Math.min(root.width, root.height) * 0.01); } return 0; @@ -6519,6 +6525,8 @@ REM$1 = o.REM, VW$1 = o.VW, VH$1 = o.VH, + VMAX$1 = o.VMAX, + VMIN$1 = o.VMIN, calUnit = o.calUnit; var d2r$1 = geom.d2r; var canvasPolygon$2 = painter.canvasPolygon, @@ -6594,6 +6602,10 @@ list.push([item[0], p[0] * root.width / length]); } else if (p[1] === VH$1) { list.push([item[0], p[0] * root.height / length]); + } else if (p[1] === VMAX$1) { + list.push([item[0], p[0] * Math.max(root.width, root.height) / length]); + } else if (p[1] === VMIN$1) { + list.push([item[0], p[0] * Math.min(root.width, root.height) / length]); } else { list.push([item[0], p[0] / length]); } @@ -6780,6 +6792,10 @@ cx = x1 + positionX[0] * root.width * 0.01; } else if (positionX[1] === VH$1) { cx = x1 + positionX[0] * root.height * 0.01; + } else if (positionX[1] === VMAX$1) { + cx = x1 + positionX[0] * Math.max(root.width, root.height) * 0.01; + } else if (positionX[1] === VMIN$1) { + cx = x1 + positionX[0] * Math.min(root.width, root.height) * 0.01; } else { cx = x1 + positionX[0]; } @@ -6792,6 +6808,10 @@ cy = y1 + positionY[0] * root.width * 0.01; } else if (positionY[1] === VH$1) { cy = y1 + positionY[0] * root.height * 0.01; + } else if (positionY[1] === VH$1) { + cy = y1 + positionY[0] * Math.max(root.width, root.height) * 0.01; + } else if (positionY[1] === VH$1) { + cy = y1 + positionY[0] * Math.min(root.width, root.height) * 0.01; } else { cy = y1 + positionY[0]; } @@ -6999,7 +7019,7 @@ } } - var position = /at\s+((?:[-+]?[\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\s+((?:[-+]?[\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]); + var position = /at\s+((?:[-+]?[\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center))(?:\s+((?:[-+]?[\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]); if (position) { var x = getRadialPosition(position[1]); @@ -7017,7 +7037,7 @@ o.d = 0; } - var _position = /at\s+((?:[-+]?[\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\s+((?:[-+]?[\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]); + var _position = /at\s+((?:[-+]?[\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center))(?:\s+((?:[-+]?[\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]); if (_position) { var _x = getRadialPosition(_position[1]); @@ -7030,11 +7050,11 @@ } } - var v = gradient[2].match(/([-+]?[\d.]+[pxremvwh%]+)?\s*((#[0-9a-f]{3,8})|(rgba?\s*\(.+?\)))\s*([-+]?[\d.]+[pxremvwh%]+)?/ig) || []; + var v = gradient[2].match(/([-+]?[\d.]+[pxremvwhina%]+)?\s*((#[0-9a-f]{3,8})|(rgba?\s*\(.+?\)))\s*([-+]?[\d.]+[pxremvwhina%]+)?/ig) || []; o.v = v.map(function (item) { var color = /((?:#[0-9a-f]{3,8})|(?:rgba?\s*\(.+?\)))/i.exec(item); var arr = [rgba2int$1(color[1])]; - var percent = /[-+]?[\d.]+[pxremvwh%]+/.exec(item); + var percent = /[-+]?[\d.]+[pxremvwhina%]+/.exec(item); if (percent) { var _v = calUnit(percent[0]); @@ -7465,7 +7485,7 @@ var temp = style[key]; if (!isNil$2(temp)) { - var match = temp.toString().match(/([-+]?[\d.]+[pxremvwh%]*)|(auto)/ig); + var match = temp.toString().match(/([-+]?[\d.]+[pxremvwhina%]*)|(auto)/ig); if (match) { if (match.length === 1) { @@ -7495,7 +7515,7 @@ if (isNil$2(style[k + 'Width'])) { - var w = /\b[\d.]+[pxremvwh%]*\b/i.exec(v); + var w = /\b[\d.]+[pxremvwhina%]*\b/i.exec(v); style[k + 'Width'] = w ? w[0] : 0; } @@ -7659,7 +7679,7 @@ } else if (/^[\d.]+\s+[\d.]+\s+(auto|none|content)/.test(v)) { var arr = v.split(/\s+/); parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]); - } else if (/^[\d.]+\s+[\d.]+\s+[\d.]+[pxremvwh%]*/.test(v)) { + } else if (/^[\d.]+\s+[\d.]+\s+[\d.]+[pxremvwhina%]*/.test(v)) { var _arr = v.split(/\s+/); parseFlex(style, parseFloat(_arr[0]), parseFloat(_arr[1]), _arr[2]); @@ -7667,13 +7687,13 @@ var _arr2 = v.split(/\s+/); parseFlex(style, parseFloat(_arr2[0]), parseFloat(_arr2[1]), 0); - } else if (/^[\d.]+\s+[\d.]+[pxremvwh%]+/.test(v)) { + } else if (/^[\d.]+\s+[\d.]+[pxremvwhina%]+/.test(v)) { var _arr3 = v.split(/\s+/); parseFlex(style, parseFloat(_arr3[0]), 1, _arr3[1]); } else if (/^[\d.]+$/.test(v)) { parseFlex(style, parseFloat(v), 1, 0); - } else if (/^[\d.]+[pxremvwh%]+/i.test(v)) { + } else if (/^[\d.]+[pxremvwhina%]+/i.test(v)) { parseFlex(style, 1, 1, v); } else { parseFlex(style, 0, 1, 'auto'); @@ -7772,7 +7792,7 @@ } else if (/^border((Top)|(Right)|(Bottom)|(Left))$/.test(k)) { parseOneBorder(style, k); } else if (k === 'textStroke') { - var w = /(?:^|\s)([-+]?[\d.]+[pxremvwh%]*)/.exec(v); + var w = /(?:^|\s)([-+]?[\d.]+[pxremvwhina%]*)/.exec(v); if (w) { style.textStrokeWidth = w[1]; @@ -8038,6 +8058,8 @@ REM$2 = o.REM, VW$2 = o.VW, VH$2 = o.VH, + VMAX$2 = o.VMAX, + VMIN$2 = o.VMIN, calUnit$1 = o.calUnit; var isNil$3 = util.isNil, rgba2int$2 = util.rgba2int, @@ -8296,7 +8318,7 @@ return [[0, AUTO], [0, AUTO]]; } - var match = item.toString().match(/\b(?:([-+]?[\d.]+[pxremvwh%]*)|(contain|cover|auto))/ig); + var match = item.toString().match(/\b(?:([-+]?[\d.]+[pxremvwhina%]*)|(contain|cover|auto))/ig); if (match) { if (match.length === 1) { @@ -9044,11 +9066,11 @@ if (temp !== undefined) { var bs = null; - var _match4 = (temp || '').match(/([-+]?[\d.]+[pxremvwh%]*)\s*([-+]?[\d.]+[pxremvwh%]*)\s*([-+]?[\d.]+[pxremvwh%]*\s*)?([-+]?[\d.]+[pxremvwh%]*\s*)?(((transparent)|(#[0-9a-f]{3,8})|(rgba?\(.+?\)))\s*)?(inset|outset)?\s*,?/ig); + var _match4 = (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); if (_match4) { _match4.forEach(function (item) { - var boxShadow = /([-+]?[\d.]+[pxremvwh%]*)\s*([-+]?[\d.]+[pxremvwh%]*)\s*([-+]?[\d.]+[pxremvwh%]*\s*)?([-+]?[\d.]+[pxremvwh%]*\s*)?(?:((?:transparent)|(?:#[0-9a-f]{3,8})|(?:rgba?\(.+\)))\s*)?(inset|outset)?/i.exec(item); + var 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); if (boxShadow) { bs = bs || []; @@ -9147,6 +9169,10 @@ computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : node.root.width * 0.01 * v[0]; } else if (v[1] === VH$2) { computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : node.root.height * 0.01 * v[0]; + } else if (v[1] === VMAX$2) { + computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : Math.max(node.root.width, node.root.height) * 0.01 * v[0]; + } else if (v[1] === VMIN$2) { + computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : Math.min(node.root.width, node.root.height) * 0.01 * v[0]; } else { computedStyle[k] = v[0]; } @@ -9179,6 +9205,10 @@ computedStyle[k] = item[0] * root.width * 0.01; } else if (item[1] === VH$2) { computedStyle[k] = item[0] * root.height * 0.01; + } else if (item[1] === VMAX$2) { + computedStyle[k] = item[0] * Math.max(root.width, root.height) * 0.01; + } else if (item[1] === VMIN$2) { + computedStyle[k] = item[0] * Math.min(root.width, root.height) * 0.01; } else { computedStyle[k] = 0; } @@ -9236,6 +9266,10 @@ computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.width * 0.01, 0) || calNormalLineHeight(computedStyle); } else if (lineHeight[1] === VH$2) { computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.height * 0.01, 0) || calNormalLineHeight(computedStyle); + } else if (lineHeight[1] === VMAX$2) { + computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * Math.max(root.width, root.height) * 0.01, 0) || calNormalLineHeight(computedStyle); + } else if (lineHeight[1] === VMIN$2) { + computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * Math.min(root.width, root.height) * 0.01, 0) || calNormalLineHeight(computedStyle); } else if (lineHeight[1] === NUMBER$1) { computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) * fontSize || calNormalLineHeight(computedStyle); } // normal或auto @@ -9255,6 +9289,10 @@ computedStyle[LETTER_SPACING] = root.width * 0.01 * letterSpacing[0]; } else if (letterSpacing[1] === VH$2) { computedStyle[LETTER_SPACING] = root.height * 0.01 * letterSpacing[0]; + } else if (letterSpacing[1] === VMAX$2) { + computedStyle[LETTER_SPACING] = Math.max(root.width, root.height) * 0.01 * letterSpacing[0]; + } else if (letterSpacing[1] === VMIN$2) { + computedStyle[LETTER_SPACING] = Math.min(root.width, root.height) * 0.01 * letterSpacing[0]; } else { computedStyle[LETTER_SPACING] = letterSpacing[0]; } //whiteSpace @@ -9323,6 +9361,10 @@ return n * style[0] * parent.root.width * 0.01; } else if (style[1] === VH$2) { return n * style[0] * parent.root.height * 0.01; + } else if (style[1] === VMAX$2) { + return n * style[0] * Math.max(parent.root.width, parent.root.height) * 0.01; + } else if (style[1] === VMIN$2) { + return n * style[0] * Math.min(parent.root.width, parent.root.height) * 0.01; } } @@ -9346,6 +9388,10 @@ v = v[0] * parent.root.width * 0.01; } else if (v[1] === VH$2) { v = v[0] * parent.root.height * 0.01; + } else if (v[1] === VMAX$2) { + v = v[0] * Math.max(parent.root.width, parent.root.height) * 0.01; + } else if (v[1] === VMIN$2) { + v = v[0] * Math.min(parent.root.width, parent.root.height) * 0.01; } return v; @@ -9364,6 +9410,10 @@ v = v[0] * root.width * 0.01; } else if (v[1] === VH$2) { v = v[0] * root.height * 0.01; + } else if (v[1] === VMAX$2) { + v = v[0] * Math.max(root.width, root.height) * 0.01; + } else if (v[1] === VMIN$2) { + v = v[0] * Math.min(root.width, root.height) * 0.01; } return v; @@ -12736,7 +12786,9 @@ PERCENT$3 = o.PERCENT, REM$3 = o.REM, VW$3 = o.VW, - VH$3 = o.VH; + VH$3 = o.VH, + VMAX$3 = o.VMAX, + VMIN$3 = o.VMIN; var matrix = math.matrix, geom$1 = math.geom; var identity$1 = matrix.identity, @@ -12919,6 +12971,10 @@ return v[0] * root.width * 0.01; } else if (v[1] === VH$3) { return v[0] * root.height * 0.01; + } else if (v[1] === VMAX$3) { + return v[0] * Math.max(root.width, root.height) * 0.01; + } else if (v[1] === VMIN$3) { + return v[0] * Math.min(root.width, root.height) * 0.01; } } else if (k === TRANSLATE_Y$1) { if (v[1] === PERCENT$3) { @@ -12929,6 +12985,10 @@ return v[0] * root.width * 0.01; } else if (v[1] === VH$3) { return v[0] * root.height * 0.01; + } else if (v[1] === VMAX$3) { + return v[0] * Math.max(root.width, root.height) * 0.01; + } else if (v[1] === VMIN$3) { + return v[0] * Math.min(root.width, root.height) * 0.01; } } else if (k === MATRIX$1) { return v; @@ -12964,6 +13024,10 @@ tfo.push(item[0] * root.width * 0.01); } else if (item[1] === VH$3) { tfo.push(item[0] * root.height * 0.01); + } else if (item[1] === VMAX$3) { + tfo.push(item[0] * Math.max(root.width, root.height) * 0.01); + } else if (item[1] === VMIN$3) { + tfo.push(item[0] * Math.min(root.width, root.height) * 0.01); } }); return tfo; @@ -13692,7 +13756,9 @@ var AUTO$1 = o.AUTO, REM$4 = o.REM, VW$4 = o.VW, - VH$4 = o.VH; + VH$4 = o.VH, + VMAX$4 = o.VMAX, + VMIN$4 = o.VMIN; var Text = /*#__PURE__*/function (_Node) { _inherits(Text, _Node); @@ -14599,6 +14665,10 @@ half = Math.max(textStrokeWidth[0] * root.width * 0.01 * 0.5, half); } else if (textStrokeWidth[1] === VH$4) { half = Math.max(textStrokeWidth[0] * root.height * 0.01 * 0.5, half); + } else if (textStrokeWidth[1] === VMAX$4) { + half = Math.max(textStrokeWidth[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else if (textStrokeWidth[1] === VMIN$4) { + half = Math.max(textStrokeWidth[0] * Math.min(root.width, root.height) * 0.01 * 0.5, half); } else { half = Math.max(textStrokeWidth[0] * 0.5, half); } @@ -15493,7 +15563,9 @@ STRING$1 = o.STRING, REM$5 = o.REM, VW$5 = o.VW, - VH$5 = o.VH; + VH$5 = o.VH, + VMAX$5 = o.VMAX, + VMIN$5 = o.VMIN; function renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bbrr, bblr) { var method = arguments.length > 13 && arguments[13] !== undefined ? arguments[13] : 'fill'; @@ -15605,6 +15677,10 @@ res.push(item[0] * root.width * 0.01); } else if (item[1] === VH$5) { res.push(item[0] * root.height * 0.01); + } else if (item[1] === VMAX$5) { + res.push(item[0] * Math.max(root.width, root.height) * 0.01); + } else if (item[1] === VMIN$5) { + res.push(item[0] * Math.min(root.width, root.height) * 0.01); } else if (item[1] === AUTO$2) { res.push(-1); } else if (item[1] === STRING$1) { @@ -15626,6 +15702,10 @@ return position[0] * root.width * 0.01; } else if (position[1] === VH$5) { return position[0] * root.height * 0.01; + } else if (position[1] === VMAX$5) { + res.push(position[0] * Math.max(root.width, root.height) * 0.01); + } else if (position[1] === VMIN$5) { + res.push(position[0] * Math.min(root.width, root.height) * 0.01); } } @@ -16418,6 +16498,8 @@ REM$6 = o.REM, VW$6 = o.VW, VH$6 = o.VH, + VMAX$6 = o.VMAX, + VMIN$6 = o.VMIN, calUnit$2 = o.calUnit; var isNil$5 = util.isNil, isFunction$4 = util.isFunction, @@ -16591,6 +16673,10 @@ return n[0] * root.width * 0.01 - p[0]; } else if (n[1] === VH$6) { return n[0] * root.height * 0.01 - p[0]; + } else if (n[1] === VMAX$6) { + return n[0] * Math.max(root.width, root.height) * 0.01 - p[0]; + } else if (n[1] === VMIN$6) { + return n[0] * Math.min(root.width, root.height) * 0.01 - p[0]; } } else if (p[1] === PERCENT$6) { if (n[1] === PX$5) { @@ -16601,6 +16687,10 @@ return n[0] * root.width / container - p[0]; } else if (n[1] === VH$6) { return n[0] * root.height / container - p[0]; + } else if (n[1] === VMAX$6) { + return n[0] * Math.max(root.width, root.height) / container - p[0]; + } else if (n[1] === VMIN$6) { + return n[0] * Math.min(root.width, root.height) / container - p[0]; } } else if (p[1] === REM$6) { if (n[1] === PX$5) { @@ -16611,6 +16701,10 @@ return n[0] * root.width * 0.01 / root.computedStyle[FONT_SIZE$7] - p[0]; } else if (n[1] === VH$6) { return n[0] * root.height * 0.01 / root.computedStyle[FONT_SIZE$7] - p[0]; + } else if (n[1] === VMAX$6) { + return n[0] * Math.max(root.width, root.height) * 0.01 / root.computedStyle[FONT_SIZE$7] - p[0]; + } else if (n[1] === VMIN$6) { + return n[0] * Math.min(root.width, root.height) * 0.01 / root.computedStyle[FONT_SIZE$7] - p[0]; } } else if (p[1] === VW$6) { if (n[1] === PX$5) { @@ -16621,6 +16715,10 @@ return n[0] * container / root.width - p[0]; } else if (n[1] === VH$6) { return n[0] * root.height / root.width - p[0]; + } else if (n[1] === VMAX$6) { + return n[0] * Math.max(root.width, root.height) / root.width - p[0]; + } else if (n[1] === VMIN$6) { + return n[0] * Math.min(root.width, root.height) / root.width - p[0]; } } else if (p[1] === VH$6) { if (n[1] === PX$5) { @@ -16631,6 +16729,38 @@ return n[0] * root.width / root.height - p[0]; } else if (n[1] === PERCENT$6) { return n[0] * container / root.height - p[0]; + } else if (n[1] === VMAX$6) { + return n[0] * Math.max(root.width, root.height) / root.height - p[0]; + } else if (n[1] === VMIN$6) { + return n[0] * Math.min(root.width, root.height) / root.height - p[0]; + } + } else if (p[1] === VMAX$6) { + if (n[1] === PX$5) { + return n[0] * 100 / Math.max(root.width, root.height) - p[0]; + } else if (n[1] === REM$6) { + return n[0] * 100 * root.computedStyle[FONT_SIZE$7] / Math.max(root.width, root.height) - p[0]; + } else if (n[1] === PERCENT$6) { + return n[0] * container / Math.max(root.width, root.height) - p[0]; + } else if (n[1] === VW$6) { + return n[0] * root.width / Math.max(root.width, root.height) - p[0]; + } else if (n[1] === VH$6) { + return n[0] * root.height / Math.max(root.width, root.height) - p[0]; + } else if (n[1] === VMIN$6) { + return n[0] * Math.min(root.width, root.height) / Math.max(root.width, root.height) - p[0]; + } + } else if (p[1] === VMIN$6) { + if (n[1] === PX$5) { + return n[0] * 100 / Math.min(root.width, root.height) - p[0]; + } else if (n[1] === REM$6) { + return n[0] * 100 * root.computedStyle[FONT_SIZE$7] / Math.min(root.width, root.height) - p[0]; + } else if (n[1] === PERCENT$6) { + return n[0] * container / Math.min(root.width, root.height) - p[0]; + } else if (n[1] === VW$6) { + return n[0] * root.width / Math.min(root.width, root.height) - p[0]; + } else if (n[1] === VH$6) { + return n[0] * root.height / Math.min(root.width, root.height) - p[0]; + } else if (n[1] === VMAX$6) { + return n[0] * Math.max(root.width, root.height) / Math.min(root.width, root.height) - p[0]; } } } @@ -16706,7 +16836,7 @@ } var v = {}, - hasChange; // 只有blur支持px/rem/vw/vh,其余都是特殊固定单位 + hasChange; // 只有blur支持px/rem/vw/vh/vmax/vmin,其余都是特殊固定单位 Object.keys(keyHash).forEach(function (k) { if (k === 'blur') { @@ -17311,6 +17441,10 @@ return [(parseFloat(v) || 0) * 0.01 * root.width, PX$5]; } else if (u === VH$6) { return [(parseFloat(v) || 0) * 0.01 * root.height, PX$5]; + } else if (u === VMAX$6) { + return [(parseFloat(v) || 0) * 0.01 * Math.max(root.width, root.height), PX$5]; + } else if (u === VMIN$6) { + return [(parseFloat(v) || 0) * 0.01 * Math.min(root.width, root.height), PX$5]; } else { return [parseFloat(v) || 0, PX$5]; } @@ -19751,6 +19885,8 @@ REM$7 = o.REM, VW$7 = o.VW, VH$7 = o.VH, + VMAX$7 = o.VMAX, + VMIN$7 = o.VMIN, DEG$2 = o.DEG; var int2rgba$2 = util.int2rgba, rgba2int$3 = util.rgba2int, @@ -19920,6 +20056,10 @@ return mp[0] * this.root.width * 0.01; } else if (mp[1] === VH$7) { return mp[0] * this.root.height * 0.01; + } else if (mp[1] === VMAX$7) { + return mp[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (mp[1] === VMIN$7) { + return mp[0] * Math.min(this.root.width, this.root.height) * 0.01; } return 0; @@ -19954,6 +20094,10 @@ n += v[0] * this.root.width * 0.01; } else if (v[1] === VH$7) { n += v[0] * this.root.height * 0.01; + } else if (v[1] === VMAX$7) { + n += v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (v[1] === VMIN$7) { + n += v[0] * Math.min(this.root.width, this.root.height) * 0.01; } return n; @@ -19986,6 +20130,10 @@ 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) { @@ -19996,6 +20144,10 @@ 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; } res = res.map(function (item) { @@ -20012,6 +20164,10 @@ _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) { @@ -20022,6 +20178,10 @@ _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; } res = res.map(function (item) { @@ -20120,6 +20280,14 @@ case VH$7: w = width[0] * this.root.height * 0.01; break; + + case VMAX$7: + w = width[0] * Math.max(this.root.width, this.root.height) * 0.01; + break; + + case VMIN$7: + w = width[0] * Math.min(this.root.width, this.root.height) * 0.01; + break; } } } @@ -20313,6 +20481,14 @@ case VH$7: w = width[0] * this.root.height * 0.01; break; + + case VMAX$7: + w = width[0] * Math.max(this.root.width, this.root.height) * 0.01; + break; + + case VMIN$7: + w = width[0] * Math.min(this.root.width, this.root.height) * 0.01; + break; } } @@ -20345,6 +20521,14 @@ case VH$7: h = height[0] * this.root.height * 0.01; break; + + case VMAX$7: + h = height[0] * Math.max(this.root.width, this.root.height) * 0.01; + break; + + case VMIN$7: + h = height[0] * Math.min(this.root.width, this.root.height) * 0.01; + break; } } // margin/padding/border影响x和y和尺寸,注意inline的y不受mpb影响 @@ -20438,6 +20622,10 @@ v = v[0] * this.root.width * 0.01; } else if (v[1] === VH$7) { v = v[0] * this.root.height * 0.01; + } else if (v[1] === VMAX$7) { + v = v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (v[1] === VMIN$7) { + v = v[0] * Math.min(this.root.width, this.root.height) * 0.01; } else { v = v[0]; } @@ -20461,6 +20649,10 @@ _v = _v[0] * this.root.width * 0.01; } else if (_v[1] === VH$7) { _v = _v[0] * this.root.height * 0.01; + } else if (_v[1] === VMAX$7) { + _v = _v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (_v[1] === VMIN$7) { + _v = _v[0] * Math.min(this.root.width, this.root.height) * 0.01; } else { _v = _v[0]; } @@ -20484,6 +20676,10 @@ _v2 = _v2[0] * this.root.width * 0.01; } else if (_v2[1] === VH$7) { _v2 = _v2[0] * this.root.height * 0.01; + } else if (_v2[1] === VMAX$7) { + _v2 = _v2[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (_v2[1] === VMIN$7) { + _v2 = _v2[0] * Math.min(this.root.width, this.root.height) * 0.01; } else { _v2 = _v2[0]; } @@ -20572,6 +20768,18 @@ } else if (k === TRANSLATE_Y$4) { computedStyle[k] = v[0] * _this3.root.height * 0.01; } + } else if (v[1] === VMAX$7) { + if (k === TRANSLATE_X$4 || k === TRANSLATE_Z$4) { + computedStyle[k] = v[0] * Math.max(_this3.root.width, _this3.root.height) * 0.01; + } else if (k === TRANSLATE_Y$4) { + computedStyle[k] = v[0] * Math.max(_this3.root.width, _this3.root.height) * 0.01; + } + } else if (v[1] === VMIN$7) { + if (k === TRANSLATE_X$4 || k === TRANSLATE_Z$4) { + computedStyle[k] = v[0] * Math.min(_this3.root.width, _this3.root.height) * 0.01; + } else if (k === TRANSLATE_Y$4) { + computedStyle[k] = v[0] * Math.min(_this3.root.width, _this3.root.height) * 0.01; + } } temp.push([k, v]); @@ -20692,6 +20900,14 @@ return item[0] * _this4.root.height * 0.01; } + if (item[1] === VMAX$7) { + return item[0] * Math.max(_this4.root.width, _this4.root.height) * 0.01; + } + + if (item[1] === VMIN$7) { + return item[0] * Math.min(_this4.root.width, _this4.root.height) * 0.01; + } + if (item[1] === PERCENT$7) { return item[0] + '%'; } @@ -20718,6 +20934,14 @@ return item[0] * _this4.root.height * 0.01; } + if (item[1] === VMAX$7) { + return item[0] * Math.max(_this4.root.width, _this4.root.height) * 0.01; + } + + if (item[1] === VMIN$7) { + return item[0] * Math.min(_this4.root.width, _this4.root.height) * 0.01; + } + if (item[1] === PERCENT$7) { return item[0] + '%'; } @@ -20811,6 +21035,10 @@ v = v * _this4.root.width * 0.01; } else if (item2[1] === VH$7) { v = v * _this4.root.height * 0.01; + } else if (item2[1] === VMAX$7) { + v = v * Math.max(_this4.root.width, _this4.root.height) * 0.01; + } else if (item2[1] === VMIN$7) { + v = v * Math.min(_this4.root.width, _this4.root.height) * 0.01; } return v; @@ -20945,6 +21173,10 @@ v = v[0] * this.root.width * 0.01; } else if (v[1] === VH$7) { v = v[0] * this.root.height * 0.01; + } else if (v[1] === VMAX$7) { + v = v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (v[1] === VMIN$7) { + v = v[0] * Math.min(this.root.width, this.root.height) * 0.01; } else { v = v[0]; } @@ -20997,6 +21229,10 @@ ppt = v[0] * this.root.width * 0.01; } else if (v[1] === VH$7) { ppt = v[0] * this.root.height * 0.01; + } else if (v[1] === VMAX$7) { + ppt = v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (v[1] === VMIN$7) { + ppt = v[0] * Math.min(this.root.width, this.root.height) * 0.01; } else { ppt = v[0]; } @@ -21041,6 +21277,10 @@ v = v[0] * _this5.root.width * 0.01; } else if (v[1] === VH$7) { v = v[0] * _this5.root.height * 0.01; + } else if (v[1] === VMAX$7) { + v = v[0] * Math.max(_this5.root.width, _this5.root.height) * 0.01; + } else if (v[1] === VMIN$7) { + v = v[0] * Math.min(_this5.root.width, _this5.root.height) * 0.01; } return [k, v]; @@ -23676,7 +23916,9 @@ PERCENT$9 = o.PERCENT, REM$8 = o.REM, VW$8 = o.VW, - VH$8 = o.VH; + VH$8 = o.VH, + VMAX$8 = o.VMAX, + VMIN$8 = o.VMIN; var calAbsolute$1 = css.calAbsolute, isRelativeOrAbsolute$1 = css.isRelativeOrAbsolute; @@ -23994,6 +24236,10 @@ w -= width[0] * this.root.width * 0.01; } else if (width[1] === VH$8) { w -= width[0] * this.root.height * 0.01; + } else if (width[1] === VMAX$8) { + w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (width[1] === VMIN$8) { + w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01; } else { for (var i = 0; i < flowChildren.length; i++) { // 当放不下时直接返回,无需继续多余的尝试计算 @@ -24027,6 +24273,10 @@ w -= marginRight[0] * this.root.width * 0.01; } else if (marginRight[1] === VH$8) { w -= marginRight[0] * this.root.height * 0.01; + } else if (marginRight[1] === VMAX$8) { + w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (marginRight[1] === VMIN$8) { + w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (paddingRight[1] === PX$8) { @@ -24039,6 +24289,10 @@ w -= paddingRight[0] * this.root.width * 0.01; } else if (paddingRight[1] === VH$8) { w -= paddingRight[0] * this.root.height * 0.01; + } else if (paddingRight[1] === VMAX$8) { + w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (paddingRight[1] === VMIN$8) { + w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (borderRightWidth[1] === PX$8) { @@ -24049,6 +24303,10 @@ w -= borderRightWidth[0] * this.root.width * 0.01; } else if (borderRightWidth[1] === VH$8) { w -= borderRightWidth[0] * this.root.height * 0.01; + } else if (borderRightWidth[1] === VMAX$8) { + w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (borderRightWidth[1] === VMIN$8) { + w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; } } // 还要减去开头的mpb @@ -24063,6 +24321,10 @@ w -= marginLeft[0] * this.root.width * 0.01; } else if (marginLeft[1] === VH$8) { w -= marginLeft[0] * this.root.height * 0.01; + } else if (marginLeft[1] === VMAX$8) { + w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (marginLeft[1] === VMIN$8) { + w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (paddingLeft[1] === PX$8) { @@ -24075,6 +24337,10 @@ w -= paddingLeft[0] * this.root.width * 0.01; } else if (paddingLeft[1] === VH$8) { w -= paddingLeft[0] * this.root.height * 0.01; + } else if (paddingLeft[1] === VMAX$8) { + w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (paddingLeft[1] === VMIN$8) { + w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (borderLeftWidth[1] === PX$8) { @@ -24085,6 +24351,10 @@ w -= borderLeftWidth[0] * this.root.width * 0.01; } else if (borderLeftWidth[1] === VH$8) { w -= borderLeftWidth[0] * this.root.height * 0.01; + } else if (borderLeftWidth[1] === VMAX$8) { + w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (borderLeftWidth[1] === VMIN$8) { + w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; } return w; @@ -24152,6 +24422,10 @@ min = max = main[0] * this.root.width * 0.01; } else if (main[1] === VH$8) { min = max = main[0] * this.root.height * 0.01; + } else if (main[1] === VMAX$8) { + min = max = main[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (main[1] === VMIN$8) { + min = max = main[0] * Math.min(this.root.width, this.root.height) * 0.01; } else { if (display === 'flex') { var isRow = flexDirection !== 'column'; @@ -24393,7 +24667,7 @@ var main = isDirectionRow ? width : height; // basis3种情况:auto、固定、content var isAuto = flexBasis[1] === AUTO$6; - var isFixed = [PX$8, PERCENT$9, REM$8, VW$8, VH$8].indexOf(flexBasis[1]) > -1; + var isFixed = [PX$8, PERCENT$9, REM$8, VW$8, VH$8, VMAX$8, VMIN$8].indexOf(flexBasis[1]) > -1; var isContent = !isAuto && !isFixed; var fixedSize; // flex的item固定basis计算 @@ -24408,9 +24682,13 @@ b = fixedSize = flexBasis[0] * this.root.width * 0.01; } else if (flexBasis[1] === VH$8) { b = fixedSize = flexBasis[0] * this.root.height * 0.01; + } else if (flexBasis[1] === VMAX$8) { + b = fixedSize = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (flexBasis[1] === VMIN$8) { + b = fixedSize = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01; } } // 已声明主轴尺寸的,当basis是auto时为值 - else if ([PX$8, PERCENT$9, REM$8, VW$8, VH$8].indexOf(main[1]) > -1 && isAuto) { + else if ([PX$8, PERCENT$9, REM$8, VW$8, VH$8, VMAX$8, VMIN$8].indexOf(main[1]) > -1 && isAuto) { if (main[1] === PX$8) { b = fixedSize = main[0]; } else if (main[1] === PERCENT$9) { @@ -24421,6 +24699,10 @@ b = fixedSize = main[0] * this.root.width * 0.01; } else if (main[1] === VH$8) { b = fixedSize = main[0] * this.root.height * 0.01; + } else if (main[1] === VMAX$8) { + b = fixedSize = main[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (main[1] === VMIN$8) { + b = fixedSize = main[0] * Math.min(this.root.width, this.root.height) * 0.01; } } // 非固定尺寸的basis为auto时降级为content else if (isAuto) { @@ -26434,6 +26716,10 @@ w2 = width[0] * _this4.root.width * 0.01; } else if (width[1] === VH$8) { w2 = width[0] * _this4.root.height * 0.01; + } else if (width[1] === VMAX$8) { + w2 = width[0] * Math.max(_this4.root.width, _this4.root.height) * 0.01; + } else if (width[1] === VMIN$8) { + w2 = width[0] * Math.min(_this4.root.width, _this4.root.height) * 0.01; } else { w2 = width[0]; } @@ -26448,6 +26734,10 @@ w2 = width[0] * _this4.root.width * 0.01; } else if (width[1] === VH$8) { w2 = width[0] * _this4.root.height * 0.01; + } else if (width[1] === VMAX$8) { + w2 = width[0] * Math.max(_this4.root.width, _this4.root.height) * 0.01; + } else if (width[1] === VMIN$8) { + w2 = width[0] * Math.min(_this4.root.width, _this4.root.height) * 0.01; } else { w2 = width[0]; } @@ -26475,6 +26765,10 @@ w2 = width[0] * _this4.root.width * 0.01; } else if (width[1] === VH$8) { w2 = width[0] * _this4.root.height * 0.01; + } else if (width[1] === VMAX$8) { + w2 = width[0] * Math.max(_this4.root.width, _this4.root.height) * 0.01; + } else if (width[1] === VMIN$8) { + w2 = width[0] * Math.min(_this4.root.width, _this4.root.height) * 0.01; } else { w2 = width[0]; } @@ -26497,6 +26791,10 @@ h2 = height[0] * _this4.root.width * 0.01; } else if (height[1] === VH$8) { h2 = height[0] * _this4.root.height * 0.01; + } else if (height[1] === VMAX$8) { + h2 = height[0] * Math.max(_this4.root.width, _this4.root.height) * 0.01; + } else if (height[1] === VMIN$8) { + h2 = height[0] * Math.min(_this4.root.width, _this4.root.height) * 0.01; } else { h2 = height[0]; } @@ -26511,6 +26809,10 @@ h2 = height[0] * _this4.root.width * 0.01; } else if (height[1] === VH$8) { h2 = height[0] * _this4.root.height * 0.01; + } else if (height[1] === VMAX$8) { + h2 = height[0] * Math.max(_this4.root.width, _this4.root.height) * 0.01; + } else if (height[1] === VMIN$8) { + h2 = height[0] * Math.min(_this4.root.width, _this4.root.height) * 0.01; } else { h2 = height[0]; } @@ -26549,7 +26851,11 @@ h2 = height[0] * _this4.root.width * 0.01; } else if (height[1] === VH$8) { h2 = height[0] * _this4.root.height * 0.01; - } else if (height[1] === PX$8) { + } else if (height[1] === VMAX$8) { + h2 = height[0] * Math.max(_this4.root.width, _this4.root.height) * 0.01; + } else if (height[1] === VMIN$8) { + h2 = height[0] * Math.min(_this4.root.width, _this4.root.height) * 0.01; + } else { h2 = height[0]; } } // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局 @@ -27172,6 +27478,8 @@ REM$9 = o.REM, VW$9 = o.VW, VH$9 = o.VH, + VMAX$9 = o.VMAX, + VMIN$9 = o.VMIN, RGBA$2 = o.RGBA; var canvasPolygon$5 = painter.canvasPolygon, svgPolygon$6 = painter.svgPolygon; @@ -27565,6 +27873,10 @@ w -= width[0] * this.root.width * 0.01; } else if (width[1] === VH$9) { w -= width[0] * this.root.height * 0.01; + } else if (width[1] === VMAX$9) { + w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (width[1] === VMIN$9) { + w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01; } else { var loadImg = this.__loadImg; // 加载成功计算缩放后的宽度 @@ -27579,6 +27891,10 @@ w -= loadImg.width * height[0] * this.root.width * 0.01 / loadImg.height; } else if (height[1] === VH$9) { w -= loadImg.width * height[0] * this.root.height * 0.01 / loadImg.height; + } else if (height[1] === VMAX$9) { + w -= height[0] * Math.max(this.root.width, this.root.height) * 0.01 / loadImg.height; + } else if (height[1] === VMIN$9) { + w -= height[0] * Math.min(this.root.width, this.root.height) * 0.01 / loadImg.height; } else { w -= loadImg.width; } @@ -27596,6 +27912,10 @@ w -= marginLeft[0] * this.root.width * 0.01; } else if (marginLeft[1] === VH$9) { w -= marginLeft[0] * this.root.height * 0.01; + } else if (marginLeft[1] === VMAX$9) { + w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (marginLeft[1] === VMIN$9) { + w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (paddingLeft[1] === PX$9) { @@ -27608,6 +27928,10 @@ w -= paddingLeft[0] * this.root.width * 0.01; } else if (paddingLeft[1] === VH$9) { w -= paddingLeft[0] * this.root.height * 0.01; + } else if (paddingLeft[1] === VMAX$9) { + w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (paddingLeft[1] === VMIN$9) { + w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (borderLeftWidth[1] === PX$9) { @@ -27618,6 +27942,10 @@ w -= borderLeftWidth[0] * this.root.width * 0.01; } else if (borderLeftWidth[1] === VH$9) { w -= borderLeftWidth[0] * this.root.height * 0.01; + } else if (borderLeftWidth[1] === VMAX$9) { + w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (borderLeftWidth[1] === VMIN$9) { + w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (marginRight[1] === PX$9) { @@ -27630,6 +27958,10 @@ w -= marginRight[0] * this.root.width * 0.01; } else if (marginRight[1] === VH$9) { w -= marginRight[0] * this.root.height * 0.01; + } else if (marginRight[1] === VMAX$9) { + w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (marginRight[1] === VMIN$9) { + w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (paddingRight[1] === PX$9) { @@ -27642,6 +27974,10 @@ w -= paddingRight[0] * this.root.width * 0.01; } else if (paddingRight[1] === VH$9) { w -= paddingRight[0] * this.root.height * 0.01; + } else if (paddingRight[1] === VMAX$9) { + w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (paddingRight[1] === VMIN$9) { + w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (borderRightWidth[1] === PX$9) { @@ -27652,6 +27988,10 @@ w -= borderRightWidth[0] * this.root.width * 0.01; } else if (borderRightWidth[1] === VH$9) { w -= borderRightWidth[0] * this.root.height * 0.01; + } else if (borderRightWidth[1] === VMAX$9) { + w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (borderRightWidth[1] === VMIN$9) { + w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; } return w; @@ -27685,7 +28025,7 @@ var main = isDirectionRow ? width : height; var cross = isDirectionRow ? height : width; // basis3种情况:auto、固定、content,只区分固定和其它 - var isFixed = [PX$9, PERCENT$a, REM$9, VW$9, VH$9].indexOf(flexBasis[1]) > -1; + var isFixed = [PX$9, PERCENT$a, REM$9, VW$9, VH$9, VMAX$9, VMIN$9].indexOf(flexBasis[1]) > -1; if (isFixed) { if (flexBasis[1] === PX$9) { @@ -27698,8 +28038,12 @@ b = max = min = flexBasis[0] * this.root.width * 0.01; } else if (flexBasis[1] === VH$9) { b = max = min = flexBasis[0] * this.root.height * 0.01; + } else if (flexBasis[1] === VMAX$9) { + b = max = min = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (flexBasis[1] === VMIN$9) { + b = max = min = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01; } - } else if ([PX$9, PERCENT$a, REM$9, VW$9, VH$9].indexOf(main[1]) > -1) { + } else if ([PX$9, PERCENT$a, REM$9, VW$9, VH$9, VMAX$9, VMIN$9].indexOf(main[1]) > -1) { if (main[1] === PX$9) { b = max = min = main[0]; } else if (main[1] === PERCENT$a) { @@ -27710,6 +28054,10 @@ b = max = min = main[0] * this.root.width * 0.01; } else if (main[1] === VH$9) { b = max = min = main[0] * this.root.height * 0.01; + } else if (main[1] === VMAX$9) { + b = max = min = main[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (main[1] === VMIN$9) { + b = max = min = main[0] * Math.min(this.root.width, this.root.height) * 0.01; } } // auto和content固定尺寸比例计算 else if (__loadImg.source || __loadImg.error) { @@ -27724,6 +28072,10 @@ cross = cross[0] * this.root.width * 0.01; } else if (cross[1] === VH$9) { cross = cross[0] * this.root.height * 0.01; + } else if (cross[1] === VMAX$9) { + cross = cross[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (cross[1] === VMIN$9) { + cross = cross[0] * Math.min(this.root.width, this.root.height) * 0.01; } var ratio = __loadImg.width / __loadImg.height; @@ -28048,7 +28400,9 @@ PERCENT$b = o.PERCENT, REM$a = o.REM, VW$a = o.VW, - VH$a = o.VH; + VH$a = o.VH, + VMAX$a = o.VMAX, + VMIN$a = o.VMIN; var int2rgba$3 = util.int2rgba, isNil$7 = util.isNil, joinArr$3 = util.joinArr; @@ -28102,6 +28456,10 @@ w -= width[0] * this.root.width * 0.01; } else if (width[1] === VH$a) { w -= width[0] * this.root.height * 0.01; + } else if (width[1] === VMAX$a) { + w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (width[1] === VMIN$a) { + w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01; } // 减去水平mbp @@ -28115,6 +28473,10 @@ w -= marginLeft[0] * this.root.width * 0.01; } else if (marginLeft[1] === VH$a) { w -= marginLeft[0] * this.root.height * 0.01; + } else if (marginLeft[1] === VMAX$a) { + w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (marginLeft[1] === VMIN$a) { + w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (paddingLeft[1] === PX$a) { @@ -28127,6 +28489,10 @@ w -= paddingLeft[0] * this.root.width * 0.01; } else if (paddingLeft[1] === VH$a) { w -= paddingLeft[0] * this.root.height * 0.01; + } else if (paddingLeft[1] === VMAX$a) { + w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (paddingLeft[1] === VMIN$a) { + w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (borderLeftWidth[1] === PX$a) { @@ -28137,6 +28503,10 @@ w -= borderLeftWidth[0] * this.root.width * 0.01; } else if (borderLeftWidth[1] === VH$a) { w -= borderLeftWidth[0] * this.root.height * 0.01; + } else if (borderLeftWidth[1] === VMAX$a) { + w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (borderLeftWidth[1] === VMIN$a) { + w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (marginRight[1] === PX$a) { @@ -28149,6 +28519,10 @@ w -= marginRight[0] * this.root.width * 0.01; } else if (marginRight[1] === VH$a) { w -= marginRight[0] * this.root.height * 0.01; + } else if (marginRight[1] === VMAX$a) { + w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (marginRight[1] === VMIN$a) { + w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (paddingRight[1] === PX$a) { @@ -28161,6 +28535,10 @@ w -= paddingRight[0] * this.root.width * 0.01; } else if (paddingRight[1] === VH$a) { w -= paddingRight[0] * this.root.height * 0.01; + } else if (paddingRight[1] === VMAX$a) { + w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (paddingRight[1] === VMIN$a) { + w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (borderRightWidth[1] === PX$a) { @@ -28171,6 +28549,10 @@ w -= borderRightWidth[0] * this.root.width * 0.01; } else if (borderRightWidth[1] === VH$a) { w -= borderRightWidth[0] * this.root.height * 0.01; + } else if (borderRightWidth[1] === VMAX$a) { + w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (borderRightWidth[1] === VMIN$a) { + w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; } return w; @@ -28196,6 +28578,10 @@ min = max = main[0] * this.root.width * 0.01; } else if (main[1] === VH$a) { min = max = main[0] * this.root.height * 0.01; + } else if (main[1] === VMAX$a) { + min = max = main[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (main[1] === VMIN$a) { + min = max = main[0] * Math.min(this.root.width, this.root.height) * 0.01; } return [display, this.__addMp(isDirectionRow, data.w, currentStyle, [min, max])]; @@ -28227,7 +28613,7 @@ borderLeftWidth = currentStyle[BORDER_LEFT_WIDTH$7]; var main = isDirectionRow ? width : height; // basis3种情况:auto、固定、content,只区分固定和其它 - var isFixed = [PX$a, PERCENT$b, REM$a, VW$a, VH$a].indexOf(flexBasis[1]) > -1; + var isFixed = [PX$a, PERCENT$b, REM$a, VW$a, VH$a, VMAX$a, VMIN$a].indexOf(flexBasis[1]) > -1; if (isFixed) { if (flexBasis[1] === PX$a) { @@ -28240,8 +28626,12 @@ b = max = min = flexBasis[0] * this.root.width * 0.01; } else if (flexBasis[1] === VH$a) { b = max = min = flexBasis[0] * this.root.height * 0.01; + } else if (flexBasis[1] === VMAX$a) { + b = max = min = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (flexBasis[1] === VMIN$a) { + b = max = min = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01; } - } else if ([PX$a, PERCENT$b, REM$a, VW$a, VH$a].indexOf(main[1]) > -1) { + } else if ([PX$a, PERCENT$b, REM$a, VW$a, VH$a, VMAX$a, VMIN$a].indexOf(main[1]) > -1) { if (main[1] === PX$a) { b = max = min = main[0]; } else if (main[1] === PERCENT$b) { @@ -28252,6 +28642,10 @@ b = max = min = main[0] * this.root.width * 0.01; } else if (main[1] === VH$a) { b = max = min = main[0] * this.root.height * 0.01; + } else if (main[1] === VMAX$a) { + b = max = min = main[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (main[1] === VMIN$a) { + b = max = min = main[0] * Math.min(this.root.width, this.root.height) * 0.01; } } // border也得计算在内 @@ -28345,6 +28739,10 @@ return item[0] * _this2.root.width * 0.01; } else if (item[1] === VH$a) { return item[0] * _this2.root.height * 0.01; + } else if (item[1] === VMAX$a) { + return item[0] * Math.max(_this2.root.width, _this2.root.height) * 0.01; + } else if (item[1] === VMIN$a) { + return item[0] * Math.min(_this2.root.width, _this2.root.height) * 0.01; } else { return 0; } @@ -36333,7 +36731,9 @@ var isNil$9 = util.isNil; var REM$b = o.REM, VW$b = o.VW, - VH$b = o.VH; + VH$b = o.VH, + VMAX$b = o.VMAX, + VMIN$b = o.VMIN; function reBuild(target, origin, base, isMulti) { if (isMulti) { @@ -36896,6 +37296,10 @@ half = Math.max(item[0] * root.width * 0.01 * 0.5, half); } else if (item[1] === VH$b) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); + } else if (item[1] === VMAX$b) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else if (item[1] === VMIN$b) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); } @@ -36983,7 +37387,9 @@ var isNil$a = util.isNil; var REM$c = o.REM, VW$c = o.VW, - VH$c = o.VH; + VH$c = o.VH, + VMAX$c = o.VMAX, + VMIN$c = o.VMIN; function concatPointAndControl(point, control) { if (Array.isArray(control) && (control.length === 2 || control.length === 4) && Array.isArray(point) && point.length === 2) { @@ -37513,6 +37919,10 @@ half = Math.max(item[0] * root.width * 0.01 * 0.5, half); } else if (item[1] === VH$c) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); + } else if (item[1] === VMAX$c) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else if (item[1] === VMIN$c) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); } @@ -37753,7 +38163,9 @@ var sectorPoints$1 = geom.sectorPoints; var REM$d = o.REM, VW$d = o.VW, - VH$d = o.VH; + VH$d = o.VH, + VMAX$d = o.VMAX, + VMIN$d = o.VMIN; function getR(v, dft) { v = parseFloat(v); @@ -38167,6 +38579,10 @@ half = Math.max(item[0] * root.width * 0.01 * 0.5, half); } else if (item[1] === VH$d) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); + } else if (item[1] === VMAX$d) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else if (item[1] === VMIN$d) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); } @@ -38205,7 +38621,9 @@ var isNil$c = util.isNil; var REM$e = o.REM, VW$e = o.VW, - VH$e = o.VH; + VH$e = o.VH, + VMAX$e = o.VMAX, + VMIN$e = o.VMIN; function genVertex(x, y, width, height) { var rx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; @@ -38372,6 +38790,10 @@ half = Math.max(item[0] * root.width * 0.01 * 0.5, half); } else if (item[1] === VH$e) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); + } else if (item[1] === VMAX$e) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else if (item[1] === VMIN$e) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); } @@ -38406,7 +38828,9 @@ var isNil$d = util.isNil; var REM$f = o.REM, VW$f = o.VW, - VH$f = o.VH; + VH$f = o.VH, + VMAX$f = o.VMAX, + VMIN$f = o.VMIN; function getR$2(v) { v = parseFloat(v); @@ -38535,6 +38959,10 @@ half = Math.max(item[0] * root.width * 0.01 * 0.5, half); } else if (item[1] === VH$f) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); + } else if (item[1] === VMAX$f) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else if (item[1] === VMIN$f) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); } @@ -38573,7 +39001,9 @@ var isNil$e = util.isNil; var REM$g = o.REM, VW$g = o.VW, - VH$g = o.VH; + VH$g = o.VH, + VMAX$g = o.VMAX, + VMIN$g = o.VMIN; function getR$3(v) { v = parseFloat(v); @@ -38755,6 +39185,10 @@ half = Math.max(item[0] * root.width * 0.01 * 0.5, half); } else if (item[1] === VH$g) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); + } else if (item[1] === VMAX$g) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else if (item[1] === VMIN$g) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); } diff --git a/index.js.map b/index.js.map index 922371d90..860ed33e7 100644 --- a/index.js.map +++ b/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["src/util/enums.js","src/node/Node.js","src/node/mode.js","src/style/unit.js","src/style/font.js","src/style/reg.js","src/math/matrix.js","src/math/vector.js","src/math/geom.js","src/math/gradient.js","src/util/painter.js","src/style/border.js","src/util/$$type.js","src/util/util.js","src/util/debug.js","src/node/textCache.js","src/gl/ca.js","src/gl/webgl.js","src/util/inject.js","src/style/gradient.js","src/style/reset.js","src/style/abbr.js","src/animate/key.js","src/refresh/change.js","src/style/css.js","src/node/TextBox.js","src/refresh/Page.js","src/math/tar.js","src/math/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_FRAME_CB: 8,\n I_PLAY_CB: 9,\n I_TARGET: 10,\n I_ROOT: 11,\n I_FRAMES: 12,\n I_FRAMES_R: 13,\n I_CURRENT_TIME: 14,\n I_NEXT_TIME: 15,\n I_STYLE: 16,\n I_DURATION: 17,\n I_ITERATIONS: 18,\n I_FILL: 19,\n I_PLAYBACK_RATE: 20,\n I_PLAY_COUNT: 21,\n I_PLAY_STATE: 22,\n I_DESTROYED: 23,\n I_START_TIME: 24,\n I_FPS_TIME: 25,\n I_EASING: 26,\n I_ENTER_FRAME: 27,\n I_DELAY: 28,\n I_END_DELAY: 29,\n I_KEYS: 30,\n I_ORIGIN_STYLE: 31,\n I_CURRENT_FRAMES: 32,\n I_CURRENT_FRAME: 33,\n I_SPF_LIMIT: 34,\n I_FPS: 35,\n I_DIRECTION: 36,\n I_CAL_DIFF_TIME: 37,\n I_FIRST_ENTER: 38,\n I_STAY_BEGIN: 39,\n I_STAY_END: 40,\n I_IS2: 41,\n I_END_TIME: 42,\n I_NODE_CONFIG: 43,\n I_ROOT_CONFIG: 44,\n I_OUT_BEGIN_DELAY: 45,\n I_TIME_STAMP: 46,\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.__width = 0;\n this.__height = 0;\n this.__baseLine = 0;\n this.__config = {};\n // 默认undefined\n // this.__prev = undefined;\n // this.__next = undefined;\n // this.__parent = undefined;\n // this.__domParent = undefined;\n // this.__root = undefined;\n // this.__host = undefined;\n }\n\n __structure(i, lv, j) {\n return this.__config[NODE_STRUCT] = {\n [STRUCT_NODE]: this,\n [STRUCT_INDEX]: i,\n [STRUCT_CHILD_INDEX]: j,\n [STRUCT_LV]: lv,\n };\n }\n\n __modifyStruct(root, offset = 0) {\n let struct = this.__config[NODE_STRUCT];\n return [struct, 0];\n }\n\n __offsetX(diff, isLayout) {\n if(isLayout) {\n this.__x += diff;\n }\n else {\n this.__ox += diff;\n }\n this.__sx += diff;\n }\n\n __offsetY(diff, isLayout) {\n if(isLayout) {\n this.__y += diff;\n }\n else {\n this.__oy += diff;\n }\n this.__sy += diff;\n }\n\n __destroy() {\n this.__config[NODE_IS_DESTROYED] = true;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get ox() {\n return this.__ox;\n }\n\n get oy() {\n return this.__oy;\n }\n\n get sx() {\n return this.x + this.ox;\n }\n\n get sy() {\n return this.y + this.oy;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n // canvas/svg根节点\n get root() {\n return this.__root;\n }\n\n // component根节点\n get host() {\n return this.__host;\n }\n\n // 考虑高阶组件在内的component根节点\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get baseLine() {\n return this.__baseLine;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get isDestroyed() {\n return this.__config[NODE_IS_DESTROYED];\n }\n}\n\nexport default Node;\n","export default {\n CANVAS: 0,\n SVG: 1,\n WEBGL: 2,\n};\n","let o = {\n AUTO: 0,\n PX: 1,\n PERCENT: 2,\n NUMBER: 3,\n INHERIT: 4,\n DEG: 5,\n STRING: 6,\n RGBA: 7,\n REM: 8,\n EM: 9,\n VW: 10,\n VH: 11,\n 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 verdana: {\n lhr: 1.21533203125, // (0+2059+430)/2048\n blr: 1.00537109375, // 2059/2048\n },\n tahoma: {\n lhr: 1.20703125, // (0+2049+423)/2048\n blr: 1.00048828125, // 2049/2048\n padding: {\n S: 1,\n T: 1,\n Z: 1,\n c: 1,\n f: 0.7,\n i: 1,\n l: 1,\n t: 0.9,\n },\n },\n georgia: {\n lhr: 1.13623046875, // (0+1878+449)/2048\n blr: 0.9169921875, // 1878/2048\n },\n 'courier new': {\n lhr: 1.1328125, // (0+1705+615)/2048\n blr: 0.83251953125, // 1705/2048\n },\n 'pingfang sc': {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06, // 1060/1000\n padding: {\n f: 0.5,\n },\n },\n simsun: {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06,\n padding: {\n f: 0.5,\n },\n },\n },\n support(fontFamily) {\n return this.info.hasOwnProperty(fontFamily);\n },\n register(name, info) {\n let { emSquare = 2048, ascent = 1854, descent = 434, lineGap = 67, padding = {} } = info || {};\n this.info[name.toLowerCase()] = {\n lhr: (ascent + descent + lineGap) / emSquare,\n blr: ascent / emSquare,\n padding,\n };\n },\n addPadding(name, padding) {\n Object.assign(this.info[name.toLowerCase()].padding, padding);\n },\n};\n\no.info['宋体'] = o.info.simsun;\n\nexport default o;\n","export default {\n position: /(([-+]?[\\d.]+[pxremvwh%]*)|(left|top|right|bottom|center)){1,2}/ig,\n // tfo: /((-?[\\d.]+(px|%)?)|(left|top|right|bottom|center)){1,2}/ig,\n gradient: /\\b(\\w+)-?gradient\\((.+)\\)/i,\n img: /(?:\\burl\\((['\"]?)(.*?)\\1\\))|(?:\\b((data:)))/i,\n};\n","// 生成4*4单位矩阵\nfunction identity() {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n}\n\n// 矩阵a*b,固定两个matrix都是长度16\nfunction multiply(a, b) {\n if(isE(a)) {\n return b;\n }\n if(isE(b)) {\n return a;\n }\n let c = [];\n for(let i = 0; i < 4; i++) {\n let a0 = a[i] || 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') {\n s += `${k}(${v}%)`;\n }\n });\n return s;\n}\n\nexport default {\n canvasPolygon,\n svgPolygon,\n canvasLine,\n svgLine,\n canvasFilter,\n svgFilter: canvasFilter,\n};\n","import geom from '../math/geom';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\nimport unit from './unit';\n\nconst { H } = geom;\nconst { PX, PERCENT, REM, VW, VH } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\nconst {\n STYLE_KEY: {\n BORDER_LEFT_WIDTH,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n PADDING_LEFT,\n PADDING_BOTTOM,\n PADDING_TOP,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n FONT_SIZE,\n },\n} = enums;\n\n/* 获取合适的虚线实体空白宽度ps/pd和数量n\n * 总长total,start边长bs,end边长be,内容长w,\n * 实体长范围[smin,smax],空白长范围[dmin,dmax]\n */\nfunction calFitDashed(total, bs, be, w, smin, smax, dmin, dmax) {\n let n = 1;\n let ps = 1;\n let pd = 1;\n // 从最大实体空白长开始尝试\n outer:\n for(let i = smax; i >= smin; i--) {\n for(let j = dmax; j >= dmin; j--) {\n // 已知实体空白长度,n实体和n-1空白组成total,计算获取n数量\n let per = i + j;\n let num = Math.floor((total + j) / per);\n let k = j;\n // 可能除不尽,此时扩展空白长\n if(num * per < j + total) {\n let free = total - num * i;\n k = free / (num - 1);\n if(k > dmax) {\n continue;\n }\n }\n per = i + k;\n // bs比实体大才有效,因为小的话必定和第一个实体完整相连\n if(bs > 1 && bs > i) {\n let mo = bs % per;\n if(mo > i) {\n continue;\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n if(num > 0) {\n n = num;\n ps = i;\n pd = k;\n }\n break outer;\n }\n }\n return {\n n,\n ps,\n pd,\n };\n}\n\n// dashed时n个实线和n-1虚线默认以3:1宽度组成,dotted则是n和n以1:1组成\nfunction calDashed(style, m1, m2, m3, m4, bw) {\n let total = m4 - m1;\n let w = m3 - m2;\n let bs = m2 - m1;\n let be = m4 - m3;\n if(style === 'dotted') {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n else {\n let { n, ps, pd } = calFitDashed(total, bs, be, w, bw, bw * 3, Math.max(1, bw * 0.25), bw * 2);\n if(n === 1) {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n // 降级为dotted\n return { n, ps, pd };\n }\n}\n\n// 获取边框分割为几块的坐标,虚线分割为若干四边形、三边型、五边形\n// 三边形重复内外边交点形成四边形,五边形进行切割形成2个四边形\n// direction为上右下左0123\nfunction calPoints(borderWidth, borderStyle, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, direction, beginRadius, endRadius) {\n let points = [];\n if(['dashed', 'dotted'].indexOf(borderStyle) > -1) {\n // 寻找一个合适的虚线线段长度和之间空白边距长度\n let { n, ps, pd } = (direction === 0 || direction === 2)\n ? calDashed(borderStyle, x1, x2, x3, x4, borderWidth)\n : calDashed(borderStyle, y1, y2, y3, y4, borderWidth);\n if(n > 1) {\n for(let i = 0; i < n; i++) {\n // 最后一个可能没有到底,延长之\n let isLast = i === n - 1;\n let main1;\n let main2;\n let cross1;\n let cross2;\n if(direction === 0 || direction === 2) {\n main1 = i ? (x1 + ps * i + pd * i) : x1;\n }\n else {\n main1 = i ? (y1 + ps * i + pd * i) : y1;\n }\n main2 = main1 + ps;\n if(direction === 0) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x4, y1],\n [x3, y2],\n [x2, y2]\n ]);\n }\n else {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n cross2 = y1 + (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y1 + (x4 - main1) * Math.tan(deg2);\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x4, y1],\n [main1, cross1]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross1]\n ]);\n if(isLast) {\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x2, y2]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross2],\n [x3, y2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y1],\n [main2, y1],\n [main2, y2],\n [x2, y2]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y1 + (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross2]\n ]);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y1],\n [x3, y1],\n [x3, y2],\n [main1, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x3, y2],\n [main1, y2]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, y2],\n [main1, y2]\n ]);\n }\n }\n }\n }\n else if(direction === 1) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n cross1 = x4 - (main1 - y1) * Math.tan(deg1);\n cross2 = x4 - (main2 - y1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2],\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x3 + (main1 - y3) * Math.tan(deg2);\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x3 + (main2 - y3) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross2, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, x4],\n [x4, x4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n }\n else if(direction === 2) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x3, y3],\n [x4, y4]\n ]);\n }\n else {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n cross2 = y4 - (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y4 - (x4 - main1) * Math.tan(deg2);\n cross2 = y4 - (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, cross1],\n [x4, y4],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y4 - (main2 - x3) * Math.tan(deg2);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [main2, cross2],\n [main2, y4],\n [x3, y4]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y3],\n [main2, y3],\n [main2, y4],\n [x2, y4]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y4 - (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y4 - (main1 - x3) * Math.tan(deg1);\n points.push([\n [main1, cross2],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y3],\n [x3, y3],\n [x3, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y3],\n [x3, y3],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, y3],\n [main2, y3],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n }\n }\n else if(direction === 3) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x2, y2],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n cross2 = x1 + (main2 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x1 + (y4 - main1) * Math.tan(deg2);\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [x1, main1],\n [cross1, main1],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [x2, y2],\n [x1, y2]\n ]);\n if(isLast) {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4],\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x1 + (y4 - main2) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross2, main1],\n [x2, y2],\n [x1, y1]\n ]);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n }\n }\n if(direction === 0) {\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n }\n }\n // 兜底返回实线\n if(direction === 0) {\n if(x2 > x1) {\n points.push([\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1, y1]\n ]);\n }\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n if(y2 > y1) {\n points.push([\n [x4, y1],\n [x4, y1],\n [x4, y2],\n [x3, y2]\n ]);\n }\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n if(x2 > x1) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x2, y4],\n [x1, y4]\n ]);\n }\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n if(y2 > y1) {\n points.push([\n [x1, y1],\n [x1, y1],\n [x2, y2],\n [x1, y2]\n ]);\n }\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n}\n\nfunction calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[1][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[0][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[1][0] > oxr && points[0][0] < oxl) {\n let ya = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, ya],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y1],\n [oxr, y1],\n [oxr, y2],\n [oxl, y2],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y1],\n [x3, y1],\n [x3, y2],\n [oxl, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [oxr, y1],\n [oxr, y2],\n [x2, y2],\n ]);\n }\n else {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n }\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, yb]\n ]);\n }\n // 跨越右圆角\n else if(points[1][0] > oxr) {\n let y = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n centerList.push([\n points[0],\n [oxr, y1],\n [oxr, y],\n points[3]\n ]);\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, y]\n ]);\n }\n // 跨越左圆角\n else if(points[0][0] < oxl) {\n let y = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, y],\n points[3]\n ]);\n centerList.push([\n [oxl, y1],\n points[1],\n points[2],\n [oxl, y],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y1 + bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierTopLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopLeft(points[0], points[1], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopLeft(points[3], points[2], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 0);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 0);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y1 + ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierTopRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopRight(points[0], points[1], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopRight(points[3], points[2], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 1);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 1);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierTopLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(p1x, p1y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(p2x, p2y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierTopRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (oy - p1y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy - Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy - Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (oy - p2y));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy - Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[2][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[1][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[2][1] > oyb && points[1][1] < oyt) {\n let xa = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n let xb = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [xa, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x3, oyt],\n [x4, oyt],\n [x4, oyb],\n [x3, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, oyb],\n [x3, oyb],\n ]);\n }\n else {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n }\n endList.push([\n [xb, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[2][1] > oyb) {\n let x = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n centerList.push([\n points[0],\n points[1],\n [x4, oyb],\n [x, oyb]\n ]);\n endList.push([\n [x, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [x, oyt]\n ]);\n centerList.push([\n [x, oyt],\n [x4, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x4 - brx;\n let rx2 = brx - (x4 - x3);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightTop(beginList[0][1], beginList[0][2], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierRightTop(beginList[0][0], beginList[0][3], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightTop(points[1], points[2], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightTop(points[0], points[3], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 2);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 2);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x4 - erx;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierRightBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightBottom(points[1], points[2], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightBottom(points[0], points[3], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 3);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 3);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierRightTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox + Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox + Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox + Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierRightBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[2][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[3][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[2][0] > oxr && points[3][0] < oxl) {\n let ya = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n beginList.push([\n points[0],\n [oxl, ya],\n [oxl, y4],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y3],\n [oxr, y3],\n [oxr, y4],\n [oxl, y4],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y3],\n [x3, y3],\n [x3, y4],\n [oxl, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [oxr, y3],\n [oxr, y4],\n [x2, y4],\n ]);\n }\n else {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n }\n endList.push([\n [oxr, yb],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越右圆角\n else if(points[2][0] > oxr) {\n let y = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n centerList.push([\n points[0],\n [oxr, y],\n [oxr, y4],\n points[3]\n ]);\n endList.push([\n [oxr, y],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越左圆角\n else if(points[3][0] < oxl) {\n let y = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y3;\n beginList.push([\n points[0],\n [oxl, y],\n [oxl, y4],\n points[3]\n ]);\n centerList.push([\n [oxl, y],\n points[1],\n points[2],\n [oxl, y4],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y4 - bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierBottomLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomLeft(points[3], points[2], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomLeft(points[0], points[1], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 4);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 4);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y4 - ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierBottomRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomRight(points[3], points[2], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomRight(points[0], points[1], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 5);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 5);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierBottomLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (p2y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy + Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy + Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (p1y - oy));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy + Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierBottomRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[3][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[0][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[3][1] > oyb && points[0][1] < oyt) {\n let xa = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n let xb = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n beginList.push([\n points[0],\n points[1],\n [xa, oyt],\n [x1, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, oyb],\n [x1, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, oyb],\n [x1, oyb],\n ]);\n }\n else {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n }\n endList.push([\n [x1, oyb],\n [xb, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[3][1] > oyb) {\n let x = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n centerList.push([\n points[0],\n points[1],\n [x, oyb],\n [x1, oyb]\n ]);\n endList.push([\n [x1, oyb],\n [x, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n beginList.push([\n points[0],\n points[1],\n [x, oyt],\n [x1, oyt]\n ]);\n centerList.push([\n [x1, oyt],\n [x, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x1 + brx;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftTop(beginList[0][0], beginList[0][3], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierLeftTop(beginList[0][1], beginList[0][2], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftTop(points[0], points[3], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftTop(points[1], points[2], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 6);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 6);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x1 + erx;\n let rx2 = erx - (x2 - x1);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierLeftBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftBottom(points[0], points[3], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftBottom(points[1], points[2], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 7);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 7);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierLeftTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierLeftBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox - Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox - Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox - Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\n/**\n * 简单计算椭圆的圆化坐标控制点,视作重合位置,外面判断backgroundClip并调整坐标\n * @param x 起始x\n * @param y 起始y\n * @param w 宽\n * @param h 高\n * @param btlr borderTopLeftRadius\n * @param btrr borderTopRightRadius\n * @param bbrr borderBottomRightRadius\n * @param bblr borderBottomLeftRadius\n * @returns {[]} 多边形的顶点和曲线控制点\n */\nfunction calRadius(x, y, w, h, btlr, btrr, bbrr, bblr) {\n let need;\n let [btlx, btly] = btlr;\n let [btrx, btry] = btrr;\n let [bbrx, bbry] = bbrr;\n let [bblx, bbly] = bblr;\n btlx = Math.max(btlx, 0);\n btly = Math.max(btly, 0);\n btrx = Math.max(btrx, 0);\n btry = Math.max(btry, 0);\n bbrx = Math.max(bbrx, 0);\n bbry = Math.max(bbry, 0);\n bblx = Math.max(bblx, 0);\n bbly = Math.max(bbly, 0);\n // 圆角必须x/y都>0才有效,否则视为不绘制\n if(btlx > 0 && btly > 0 || btrx > 0 && btry > 0 || bbrx > 0 && bbry > 0 || bblx > 0 && bbly > 0) {\n need = true;\n }\n if(need) {\n let list = [];\n if(btlx > 0 && btly > 0) {\n list.push([x, y + btly]);\n list.push([x, y + (btly) * (1 - H), x + btlx * (1 - H), y, x + btlx, y]);\n }\n else {\n list.push([x, y]);\n }\n if(btrx > 0 && btry > 0) {\n list.push([x + w - btrx, y]);\n list.push([x + w - btrx * (1 - H), y, x + w, y + btry * (1 - H), x + w, y + btry]);\n }\n else {\n list.push([x + w, y]);\n }\n if(bbrx > 0 && bbry > 0) {\n list.push([x + w, y + h - bbry]);\n list.push([x + w, y + h - bbry * (1 - H), x + w - bbrx * (1 - H), y + h, x + w - bbrx, y + h]);\n }\n else {\n list.push([x + w, y + h]);\n }\n if(bblx > 0 && bbly > 0) {\n list.push([x + bblx, y + h]);\n list.push([x + bblx * (1 - H), y + h, x, y + h - bbly * (1 - H), x, y + h - bbly]);\n }\n else {\n list.push([x, y + h]);\n }\n return list;\n }\n}\n\nfunction limit(points, x, y, direction) {\n if(direction === 0) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 1) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 2) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 3) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 4) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 5) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 6) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 7) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n}\n\nconst BR_KS = [BORDER_TOP_LEFT_RADIUS, BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS];\nfunction calBorderRadius(w, h, currentStyle, computedStyle, root) {\n let noRadius = true;\n BR_KS.forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n if(item[0] > 0) {\n noRadius = false;\n }\n else {\n return 0;\n }\n if(item[1] === PX) {\n return Math.max(0, item[0]);\n }\n else if(item[1] === PERCENT) {\n return Math.max(0, item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n return Math.max(0, item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n return Math.max(0, item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n return Math.max(0, item[0] * root.height * 0.01);\n }\n return 0;\n });\n });\n // 优化提前跳出\n if(noRadius) {\n return;\n }\n // radius限制,相交的2个之和不能超过边长,如果2个都超过中点取中点,只有1个超过取交点,这包含了单个不能超过总长的逻辑\n BR_KS.forEach((k, i) => {\n let j = i % 2 === 0 ? 0 : 1;\n let target = j ? h : w;\n let prev = computedStyle[k];\n let next = computedStyle[BR_KS[(i + 1) % 4]];\n // 相加超过边长则是相交\n if(prev[j] + next[j] > target) {\n let half = target * 0.5;\n // 都超过一半中点取中点\n if(prev[j] >= half && next[j] >= half) {\n prev[j] = next[j] = half;\n }\n // 仅1个超过中点,因相交用总长减去另一方即可\n else if(prev[j] > half) {\n prev[j] = target - next[j];\n }\n else if(next[j] > half) {\n next[j] = target - prev[j];\n }\n }\n });\n}\n\nfunction calBorderRadiusInline(contentBoxList, currentStyle, computedStyle) {\n let first, last;\n if(contentBoxList.length) {\n first = contentBoxList[0];\n last = contentBoxList[contentBoxList.length - 1]\n }\n // 先看first的左侧\n let w = first ? first.outerWidth : 0, h = first ? first.outerHeight : 0;\n w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT];\n h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH]\n + computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM];\n [BORDER_TOP_LEFT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS].forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n let v;\n if(item[1] === PX) {\n v = Math.max(0, item[0]);\n v = Math.min(i ? h : w, v);\n }\n else {\n v = Math.max(0, item[0] * (i ? h : w) * 0.01);\n v = Math.min(i ? h : w, v);\n }\n return v;\n });\n });\n // 再看end的右侧\n w = last ? last.outerWidth : 0;\n h = last ? last.outerHeight : 0;\n [BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS].forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n let v;\n if(item[1] === PX) {\n v = Math.max(0, item[0]);\n v = Math.min(i ? h : w, v);\n }\n else {\n v = Math.max(0, item[0] * (i ? h : w) * 0.01);\n v = Math.min(i ? h : w, v);\n }\n return v;\n });\n });\n}\n\nfunction renderBorder(xom, renderMode, ctx, points, color, dx, dy) {\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n points.forEach(point => {\n canvasPolygon(ctx, point, dx, dy);\n });\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let s = '';\n points.forEach(point => {\n s += svgPolygon(point);\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', s],\n ['fill', color],\n ],\n });\n }\n}\n\nexport default {\n calPoints,\n calRadius,\n calBorderRadius,\n calBorderRadiusInline,\n renderBorder,\n};\n","// 类型为引用防止json仿造\nconst TYPE_VD = { _: 1 };\nconst TYPE_GM = { _: 2 };\nconst TYPE_CP = { _: 3 };\n\nexport default {\n TYPE_VD,\n TYPE_GM,\n TYPE_CP,\n};\n","import $$type from './$$type';\nimport mx from '../math/matrix';\n\nlet toString = {}.toString;\nfunction isType(type) {\n return function(obj) {\n return toString.call(obj) === '[object ' + type + ']';\n }\n}\n\nlet isObject = isType('Object');\nlet isString = isType('String');\nlet isFunction = isType('Function');\nlet isNumber = isType('Number');\nlet isBoolean = isType('Boolean');\nlet isDate = isType('Date');\n\nlet hasOwn = {}.hasOwnProperty;\nlet fnToString = hasOwn.toString;\nlet ObjectFunctionString = fnToString.call(Object);\n\nfunction isNil(v) {\n return v === undefined || v === null;\n}\n\nfunction joinSourceArray(arr) {\n let res = '';\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n res += joinSourceArray(item);\n }\n else {\n res += stringify(item);\n }\n }\n return res;\n}\n\nfunction stringify(s) {\n if(isNil(s)) {\n return '';\n }\n return s.toString();\n}\n\nfunction encodeHtml(s, prop) {\n if(prop) {\n return s.replace(/\"/g, '"');\n }\n return s.replace(/&/g, '&').replace(/ {\n s += joinDef(item);\n });\n s += '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n return s;\n}\n\n// 普通元素\nfunction joinVd(vd) {\n if(vd.type === 'item' || vd.type === 'img') {\n let s = '';\n (vd.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n if(vd.tagName === 'text') {\n return '' + vd.content + '';\n }\n return '<' + vd.tagName + s + '/>';\n }\n else if(vd.type === 'text') {\n let s = ``;\n // text有许多lineBox\n (vd.children || []).forEach(item => {\n s += joinVd(item);\n });\n return '' + s + '';\n }\n else if(vd.type === 'dom' || vd.type === 'geom') {\n let s = '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n let { opacity, transform, visibility, mask, overflow, filter, mixBlendMode } = vd;\n return '' + s + '';\n }\n}\n\nfunction joinDef(def) {\n let s = '<' + def.tagName + ' id=\"' + def.uuid + '\"';\n if(def.tagName === 'mask' || def.tagName === 'clipPath') {\n // s += ' maskUnits=\"userSpaceOnUse\"';\n }\n else if(def.tagName === 'filter') {\n // s += ' filterUnits=\"userSpaceOnUse\"';\n }\n else {\n s += ' gradientUnits=\"userSpaceOnUse\"';\n }\n (def.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n (def.children || []).forEach(item => {\n s += joinItem(item);\n });\n s += '';\n return s;\n}\n\nfunction joinItem(item) {\n let s = '<' + item.tagName;\n (item.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n return s;\n}\n\nfunction rgba2int(color) {\n if(Array.isArray(color)) {\n return color;\n }\n let res = [];\n if(!color || color === 'transparent') {\n res = [0, 0, 0, 0];\n }\n else if(color.charAt(0) === '#') {\n color = color.slice(1);\n if(color.length === 3) {\n res.push(parseInt(color.charAt(0) + color.charAt(0), 16));\n res.push(parseInt(color.charAt(1) + color.charAt(1), 16));\n res.push(parseInt(color.charAt(2) + color.charAt(2), 16));\n res[3] = 1;\n }\n else if(color.length === 6) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4), 16));\n res[3] = 1;\n }\n else if(color.length === 8) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4, 6), 16));\n res.push(parseInt(color.slice(6), 16) / 255);\n }\n else {\n res[0] = res[1] = res[2] = 0;\n res[3] = 1;\n }\n }\n else {\n let c = color.match(/rgba?\\s*\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*,\\s*([\\d.]+)(?:\\s*,\\s*([\\d.]+))?\\s*\\)/i);\n if(c) {\n res = [parseInt(c[1]), parseInt(c[2]), parseInt(c[3])];\n if(!isNil(c[4])) {\n res[3] = parseFloat(c[4]);\n }\n else {\n res[3] = 1;\n }\n }\n else {\n res = [0, 0, 0, 0];\n }\n }\n return res;\n}\n\nfunction int2rgba(color) {\n if(Array.isArray(color)) {\n if(color.length === 4) {\n color = color.map((c, i) => i === 3 ? c : Math.floor(Math.max(0, c)));\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n color = color.map(c => Math.floor(c));\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return color || 'rgba(0,0,0,0)';\n}\n\nfunction int2invert(color) {\n if(Array.isArray(color)) {\n color = color.slice(0);\n color[0] = 255 - color[0];\n color[1] = 255 - color[1];\n color[2] = 255 - color[2];\n if(color.length === 4) {\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return 'rgba(0,0,0,0)';\n}\n\nfunction arr2hash(arr) {\n let hash = {};\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n hash[item[0]] = item[1];\n }\n else {\n for(let list = Object.keys(item), j = list.length - 1; j >= 0; j--) {\n let k = list[j];\n hash[k] = item[k];\n }\n }\n }\n return hash;\n}\n\nfunction hash2arr(hash) {\n if(Array.isArray(hash)) {\n return hash;\n }\n let arr = [];\n for(let list = Object.keys(hash), i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n arr.push([k, hash[k]]);\n }\n return arr;\n}\n\nfunction clone(obj) {\n if(isNil(obj) || typeof obj !== 'object') {\n return obj;\n }\n // parse递归会出现内部先返回解析好的json,外部parse不能clone\n if(obj.$$type === $$type.TYPE_VD\n || obj.$$type === $$type.TYPE_GM\n || obj.$$type === $$type.TYPE_CP) {\n return obj;\n }\n if(util.isDate(obj)) {\n return new Date(obj);\n }\n if(!isPlainObject(obj) && !Array.isArray(obj)) {\n return obj;\n }\n let n = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(i => {\n n[i] = clone(obj[i]);\n });\n return n;\n}\n\n/**\n * 简化的arr对比,arr中只有arr和其它类型,其它类型对比值或引用,arr递归\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equalArr(a, b) {\n if(!a || !b) {\n return a === b;\n }\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let ai = a[i];\n let bi = b[i];\n let isArrayA = Array.isArray(ai);\n let isArrayB = Array.isArray(bi);\n if(isArrayA && isArrayB) {\n if(!equalArr(ai, bi)) {\n return false;\n }\n }\n else if(isArrayA || isArrayB) {\n return false;\n }\n else if(ai !== bi) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 深度对比对象\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equal(a, b) {\n if(a === b) {\n return true;\n }\n if(isObject(a) && isObject(b)) {\n let hash = {};\n for(let i = 0, arr = Object.keys(a), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!b.hasOwnProperty(k) || !equal(a[k], b[k])) {\n return false;\n }\n hash[k] = true;\n }\n // a没有b有则false\n for(let i = 0, arr = Object.keys(b), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!hash.hasOwnProperty(k)) {\n return false;\n }\n }\n }\n else if(isDate(a) && isDate(b)) {\n return a.getTime() === b.getTime();\n }\n else if(Array.isArray(a) && Array.isArray(b)) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equal(a[i], b[i])) {\n return false;\n }\n }\n }\n else {\n return a === b;\n }\n return true;\n}\n\nfunction extend(target, source, keys) {\n if(source === null || typeof source !== 'object') {\n return target;\n }\n if(!keys) {\n keys = Object.keys(source);\n }\n let i = 0;\n let len = keys.length;\n while(i < len) {\n let k = keys[i];\n target[k] = source[k];\n i++;\n }\n return target;\n}\n\nfunction joinArr(arr, split) {\n let s = arr.length ? arr[0] : '';\n for(let i = 1, len = arr.length; i < len; i++) {\n s += split + arr[i];\n }\n return s;\n}\n\nfunction extendAnimate(ovd, nvd) {\n let list = nvd.__animationList = ovd.animationList.splice(0);\n list.forEach(item => {\n item.__setTarget(nvd);\n // 事件队列的缘故,可能动画本帧刚执行过,然后再继承,就会缺失,需再次赋值一遍;也有可能停留最后\n if(item.assigning || item.finished && item.__stayEnd()) {\n item.assignCurrentStyle();\n }\n });\n // 帧动画继承\n nvd.__frameAnimateList = ovd.__frameAnimateList.splice(0);\n}\n\nfunction transformBbox(bbox, matrix, dx = 0, dy = 0) {\n if(matrix && !mx.isE(matrix)) {\n let [x1, y1, x2, y2] = bbox;\n // 可能因filter的原因扩展范围\n if(dx) {\n x1 -= dx;\n x2 += dx;\n }\n if(dy) {\n y1 -= dy;\n y2 += dy;\n }\n let list = [x2, y1, x1, y2, x2, y2];\n let w;\n [x1, y1, , w] = mx.calPoint([x1, y1], matrix);\n if(w && w !== 1) {\n x1 /= w;\n y1 /= w;\n }\n let xa = x1, ya = y1, xb = x1, yb = y1;\n for(let i = 0; i < 6; i += 2) {\n let x = list[i], y = list[i + 1];\n [x, y, , w] = mx.calPoint([x, y], matrix);\n if(w && w !== 1) {\n x /= w;\n y /= w;\n }\n xa = Math.min(xa, x);\n xb = Math.max(xb, x);\n ya = Math.min(ya, y);\n yb = Math.max(yb, y);\n }\n bbox = [xa, ya, xb, yb];\n }\n else if(dx || dy) {\n bbox = bbox.slice(0);\n bbox[0] -= dx;\n bbox[1] -= dy;\n bbox[2] += dx;\n bbox[3] += dy;\n }\n return bbox;\n}\n\nfunction isPlainObject(obj) {\n if(!obj || toString.call(obj) !== '[object Object]') {\n return false;\n }\n let proto = Object.getPrototypeOf(obj);\n if(!proto) {\n return true;\n }\n let Ctor = hasOwn.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor === 'function' && fnToString.call(Ctor) === ObjectFunctionString;\n}\n\nfunction assignMatrix(t, v) {\n t[0] = v[0];\n t[1] = v[1];\n t[2] = v[2];\n t[3] = v[3];\n t[4] = v[4];\n t[5] = v[5];\n t[6] = v[6];\n t[7] = v[7];\n t[8] = v[8];\n t[9] = v[9];\n t[10] = v[10];\n t[11] = v[11];\n t[12] = v[12];\n t[13] = v[13];\n t[14] = v[14];\n t[15] = v[15];\n return t;\n}\n\nlet util = {\n isObject,\n isString,\n isFunction,\n isNumber,\n isBoolean,\n isDate,\n isNil,\n isPrimitive(v) {\n return util.isNil(v) || util.isBoolean(v) || util.isString(v) || util.isNumber(v);\n },\n // css中常用undefined/null表示auto本身\n isAuto(v) {\n return isNil(v) || v === 'auto';\n },\n isPlainObject,\n stringify,\n joinSourceArray(arr) {\n return joinSourceArray(arr);\n },\n encodeHtml,\n joinVirtualDom,\n joinVd,\n joinDef,\n rgba2int,\n int2rgba,\n int2invert,\n arr2hash,\n hash2arr,\n clone,\n equalArr,\n equal,\n extend,\n joinArr,\n extendAnimate,\n transformBbox,\n assignMatrix,\n};\n\nexport default util;\n","export default {\n flag: false,\n};\n","export default {\n list: [], // 每次渲染前的更新后,等待测量的文字对象列表\n data: {}, // Text中存入的特殊等待测量的信息,字体+字号+粗细为key\n charWidth: {}, // key的文字宽度hash\n padding: {}, // key的文字宽度偏移,少量字体的少量文字有\n ELLIPSIS: '…',\n};\n","export default {\n alpha: true,\n antialias: true,\n premultipliedAlpha: true,\n preserveDrawingBuffer: true,\n // depth: true,\n // stencil: true,\n};\n","import mx from '../math/matrix';\n\nconst calPoint = mx.calPoint;\n\n/**\n * 初始化 shader\n * @param gl GL context\n * @param vshader vertex shader (string)\n * @param fshader fragment shader (string)\n * @return program, if the program object was created and successfully made current\n */\nfunction initShaders(gl, vshader, fshader) {\n let program = createProgram(gl, vshader, fshader);\n if(!program) {\n throw new Error('Failed to create program');\n }\n\n // 要开启透明度,用以绘制透明的图形\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n return program;\n}\n\n/**\n * Create the linked program object\n * @param gl GL context\n * @param vshader a vertex shader program (string)\n * @param fshader a fragment shader program (string)\n * @return created program object, or null if the creation has failed\n */\nfunction createProgram(gl, vshader, fshader) {\n // Create shader object\n let vertexShader = loadShader(gl, gl.VERTEX_SHADER, vshader);\n let fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fshader);\n if(!vertexShader || !fragmentShader) {\n return null;\n }\n\n // Create a program object\n let program = gl.createProgram();\n if(!program) {\n return null;\n }\n program.vertexShader = vertexShader;\n program.fragmentShader = fragmentShader;\n\n // Attach the shader objects\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n // Link the program object\n gl.linkProgram(program);\n\n // Check the result of linking\n let linked = gl.getProgramParameter(program, gl.LINK_STATUS);\n if(!linked) {\n let error = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n gl.deleteShader(fragmentShader);\n gl.deleteShader(vertexShader);\n throw new Error('Failed to link program: ' + error);\n }\n return program;\n}\n\n/**\n * Create a shader object\n * @param gl GL context\n * @param type the type of the shader object to be created\n * @param source shader program (string)\n * @return created shader object, or null if the creation has failed.\n */\nexport function loadShader(gl, type, source) {\n // Create shader object\n let shader = gl.createShader(type);\n if(shader == null) {\n throw new Error('unable to create shader');\n }\n\n // Set the shader program\n gl.shaderSource(shader, source);\n\n // Compile the shader\n gl.compileShader(shader);\n\n // Check the result of compilation\n let compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if(!compiled) {\n let error = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error('Failed to compile shader: ' + error);\n }\n\n return shader;\n}\n\nfunction convertCoords2Gl([x, y, z, w], cx, cy, revertY) {\n if(z === undefined) {\n z = 0;\n }\n if(w === undefined) {\n w = 1;\n }\n if(w && w !== 1) {\n x /= w;\n y /= w;\n z /= w;\n }\n if(x === cx) {\n x = 0;\n }\n else {\n x = (x - cx) / cx;\n }\n if(y === cy) {\n y = 0;\n }\n else {\n y = (y - cy) / cy;\n if(revertY) {\n y = -y;\n }\n }\n return [x * w, y * w, z * w, w];\n}\n\nfunction createTexture(gl, tex, n, width, height) {\n let texture = gl.createTexture();\n bindTexture(gl, texture, n);\n // gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, -1);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n // 传入高宽时是绑定fbo,且tex一定为null\n if(width && height) {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n // 普通将canvas对象作为纹理\n else {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n return texture;\n}\n\nfunction bindTexture(gl, texture, n) {\n gl.activeTexture(gl['TEXTURE' + n]);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n}\n\n/**\n * texCache集满纹理上传占用最多可用纹理单元后,进行批量顺序绘制\n * 将所有dom的矩形顶点(经过transform变换后的)、贴图坐标、透明度存入3个buffer中,\n * 然后相同纹理单元的形成一批,设置uniform的纹理单元号进行绘制,如此循环\n * @param gl\n * @param list\n * @param hash\n * @param cx\n * @param cy\n * @param revertY\n */\nfunction drawTextureCache(gl, list, hash, cx, cy, revertY) {\n let vtPoint = [], vtTex = [], vtOpacity = [];\n let lastChannel; // 上一个dom的单元号\n let record = [0]; // [num, channel]每一批的数量和单元号记录\n let stack = [record]; // 所有批的数据记录集合\n list.forEach((item, i) => {\n let [cache, opacity, matrix, dx, dy] = item;\n if(i) {\n let channel = hash[cache.page.uuid];\n // 和上一个单元号不同时,生成新的批次记录\n if(lastChannel !== channel) {\n lastChannel = channel;\n record = [0, lastChannel];\n stack.push(record);\n }\n }\n else {\n lastChannel = hash[cache.page.uuid];\n record[1] = lastChannel;\n }\n let { x, y, width, height, page, bbox } = cache;\n // 计算顶点坐标和纹理坐标,转换[0,1]对应关系\n let bx = bbox[0], by = bbox[1];\n let [xa, ya] = [bx + (dx || 0), by + height + (dy || 0)];\n let [xb, yb] = [bx + width + (dx || 0), by + (dy || 0)];\n let [x1, y1, , w1] = calPoint([xa, ya], matrix);\n let [x2, y2, , w2] = calPoint([xb, ya], matrix);\n let [x3, y3, , w3] = calPoint([xb, yb], matrix);\n let [x4, y4, , w4] = calPoint([xa, yb], matrix);\n [x1, y1] = convertCoords2Gl([x1, y1, 0, w1], cx, cy, revertY);\n [x2, y2] = convertCoords2Gl([x2, y2, 0, w2], cx, cy, revertY);\n [x3, y3] = convertCoords2Gl([x3, y3, 0, w3], cx, cy, revertY);\n [x4, y4] = convertCoords2Gl([x4, y4, 0, w4], cx, cy, revertY);\n vtPoint.push(x1, y1, 0, w1, x4, y4, 0, w4, x2, y2, 0, w2, x4, y4, 0, w4, x2, y2, 0, w2, x3, y3, 0, w3);\n let tx1 = x / page.width, ty1 = (y + height) / page.height;\n let tx2 = (x + width) / page.width, ty2 = y / page.height;\n vtTex.push(tx1, ty1, tx1, ty2, tx2, ty1, tx1, ty2, tx2, ty1, tx2, ty2);\n vtOpacity.push(opacity, opacity, opacity, opacity, opacity, opacity);\n record[0]++;\n });\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtPoint), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.program, 'a_position');\n gl.vertexAttribPointer(a_position, 4, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtTex), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // opacity buffer\n let opacityBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, opacityBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtOpacity), gl.STATIC_DRAW);\n let a_opacity = gl.getAttribLocation(gl.program, 'a_opacity');\n gl.vertexAttribPointer(a_opacity, 1, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_opacity);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.program, 'u_texture');\n let count = 0;\n // 循环按批次渲染\n stack.forEach(record => {\n let [num, channel] = record;\n gl.uniform1i(u_texture, channel);\n num *= 6;\n gl.drawArrays(gl.TRIANGLES, count, num);\n count += num;\n });\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.deleteBuffer(opacityBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n gl.disableVertexAttribArray(a_opacity);\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核扩大3倍性能慢\n * x/y方向分开执行,加速性能,计算次数由d*d变为d+d,d为卷积核大小\n * spread由d和sigma计算得出,d由sigma计算得出,sigma即css的blur()参数\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * i和j为total和filter的纹理单元,3次执行(x/y合起来算1次)需互换单元,来回执行源和结果\n * 由total变为filter时cache会各方向上扩展spread的大小到width/height\n * 因此第一次绘制时坐标非1,后面则固定1\n * @param gl\n * @param program\n * @param frameBuffer\n * @param texCache\n * @param tex1 初次绘制目标纹理\n * @param tex2 初次绘制源纹理\n * @param i 初次绘制目标纹理单元\n * @param j 初次绘制源纹理单元\n * @param width\n * @param height\n * @param cx\n * @param cy\n * @param spread\n * @param d\n * @param sigma\n */\nfunction drawBlur(gl, program, frameBuffer, texCache, tex1, tex2, i, j, width, height, cx, cy, spread, d, sigma) {\n // 第一次将total绘制到blur上,此时尺寸存在spread差值,因此不加模糊防止坐标计算问题,仅作为扩展纹理尺寸\n let [x1, y2] = convertCoords2Gl([spread, height - spread], cx, cy);\n let [x2, y1] = convertCoords2Gl([width - spread, spread], cx, cy);\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // direction全0,即无模糊,此时只是进行扩展尺寸操作,还没到模糊所以传0\n let u_direction = gl.getUniformLocation(program, 'u_direction');\n gl.uniform2f(u_direction, 0, 0);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // fbo绑定切换纹理对象和单元索引,同时注意不能向源纹理绘制,因为源是cacheTotal,需要重新生成一个,y方向再来一次\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n /**\n * 反复执行共3次,坐标等均不变,只是切换fbo绑定对象和纹理单元\n * 注意max和ratio的设置,当是100尺寸的正方形时,传给direction的始终为1\n * 当正方形<100时,direction相应地要扩大相对于100的倍数,反之则缩小,如此为了取相邻点坐标时是+-1\n * 当非正方形时,长轴一端为基准值不变,短的要二次扩大比例倍数\n */\n let max = 100 / Math.max(width, height);\n let ratio = width / height;\n let recycle = []; // 3次过程中新生成的中间纹理需要回收\n for(let k = 0; k < 3; k++) {\n let tex3 = createTexture(gl, null, j, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex3, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, max, 0);\n }\n else {\n gl.uniform2f(u_direction, max * ratio, 0);\n }\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n recycle.push(tex1);\n let tex4 = createTexture(gl, null, i, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex4, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, 0, max * ratio);\n }\n else {\n gl.uniform2f(u_direction, 0, max);\n }\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n tex1 = tex4;\n recycle.push(tex3);\n }\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n recycle.forEach(item => gl.deleteTexture(item));\n return tex1;\n}\n\nfunction drawCm(gl, program, i, m) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, i);\n // matrix\n let u_m = gl.getUniformLocation(program, 'u_m');\n gl.uniform1fv(u_m, new Float32Array(m));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\n/**\n * 根据total/filter生成overflow\n * @param gl\n * @param i 输入纹理单元\n * @param dx 二者偏移值\n * @param dy\n * @param width 最终大小\n * @param height\n * @param w 输入纹理大小\n * @param h\n */\nfunction drawOverflow(gl, i, dx, dy, width, height, w, h) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.programOverflow, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer,原本大小width/height,使用其中的w/h\n let x1 = dx / w, y1 = dy / h, x2 = (width + dx) / w, y2 = (height + dy) /h;\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.programOverflow, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.programOverflow, 'u_texture');\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n}\n\nfunction drawMask(gl, i, j, program) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, j);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nfunction drawMbm(gl, program, i, j, W, H) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, i);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nexport default {\n initShaders,\n createTexture,\n bindTexture,\n drawTextureCache,\n drawBlur,\n drawOverflow,\n drawMask,\n drawMbm,\n drawCm,\n};\n","import util from './util';\nimport debug from './debug';\nimport textCache from '../node/textCache';\nimport font from '../style/font';\nimport ca from '../gl/ca';\nimport webgl from '../gl/webgl';\n\nconst SPF = 1000 / 60;\n\nconst CANVAS = {};\nconst WEBGL = {};\nconst CANVAS_LIST = [];\nconst WEBGL_LIST = [];\nconst SUPPORT_OFFSCREEN_CANVAS = typeof OffscreenCanvas === 'function' && util.isFunction(OffscreenCanvas.prototype.getContext);\n\nlet defaultFontFamilyData;\n\nfunction cache(key, width, height, hash, message) {\n let o;\n if(!key) {\n let target = hash === CANVAS ? CANVAS_LIST : WEBGL_LIST;\n if(target.length) {\n o = target.pop();\n }\n else {\n o = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n }\n else if(!hash[key]) {\n o = hash[key] = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n else {\n o = hash[key];\n }\n o.width = width;\n o.height = height;\n if(debug.flag) {\n o.style.width = width + 'px';\n o.style.height = height + 'px';\n o.setAttribute('type', hash === CANVAS ? 'canvas' : 'webgl');\n if(key) {\n o.setAttribute('key', key);\n }\n if(message) {\n o.setAttribute('message', message);\n }\n document.body.appendChild(o);\n }\n let ctx;\n if(hash === CANVAS) {\n ctx = o.getContext('2d');\n }\n else {\n ctx = o.getContext('webgl', ca) || o.getContext('experimental-webgl', ca);\n }\n return {\n canvas: o,\n ctx,\n draw() {\n // 空函数,仅对小程序提供hook特殊处理,flush缓冲\n },\n enabled: true,\n available: true,\n release() {\n if(!key && this.available) {\n if(hash === CANVAS) {\n CANVAS_LIST.push(this.canvas);\n }\n else {\n WEBGL_LIST.push(this.canvas);\n }\n }\n this.available = false;\n },\n };\n}\n\nfunction cacheCanvas(key, width, height, message) {\n return cache(key, width, height, CANVAS, message);\n}\n\nfunction cacheWebgl(key, width, height, message) {\n return cache(key, width, height, WEBGL, message);\n}\n\nconst IMG = {};\nconst INIT = 0;\nconst LOADING = 1;\nconst LOADED = 2;\nconst FONT = {};\nconst COMPONENT = {};\n\nlet inject = {\n measureText() {\n let { list, data } = textCache;\n let html = '';\n let keys = [];\n let lengths = [];\n let chars = [];\n Object.keys(data).forEach(key => {\n let { ff, fs, fw, s } = data[key];\n if(s) {\n keys.push(key);\n lengths.push(s.length);\n let inline = `position:absolute;font-family:${ff};font-size:${fs}px;font-weight:${fw}`;\n for(let i = 0, len = s.length; i < len; i++) {\n let char = s.charAt(i);\n chars.push(char);\n html += `${char.replace(/`;\n }\n data[key].s = '';\n }\n });\n if(!html) {\n return;\n }\n let div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n document.body.appendChild(div);\n div.innerHTML = html;\n let cns = div.childNodes;\n let { charWidth } = textCache;\n let count = 0, index = 0, key;\n for(let i = 0, len = cns.length; i < len; i++) {\n let node = cns[i];\n if(count === 0) {\n key = keys[index];\n }\n if(++count === lengths[index]) {\n index++;\n count = 0;\n }\n let char = chars[i];\n // clientWidth只返回ceil整数,精度必须用getComputedStyle\n let css = window.getComputedStyle(node, null);\n charWidth[key][char] = parseFloat(css.width);\n }\n list.forEach(text => text.__measureCb());\n textCache.list = [];\n textCache.data = {};\n if(!debug.flag) {\n document.body.removeChild(div);\n }\n },\n measureTextSync(key, ff, fs, fw, char) {\n let inline = `position:absolute;font-family:${ff};font-size:${fs}px;font-weight:${fw}`;\n let html = `${char}${char}${char}`;\n let div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n document.body.appendChild(div);\n div.innerHTML = html;\n let cns = div.childNodes;\n let w1 = parseFloat(window.getComputedStyle(cns[0], null).width);\n let w2 = parseFloat(window.getComputedStyle(cns[1], null).width);\n return w1 * 2 - w2;\n },\n IMG,\n INIT,\n LOADED,\n LOADING,\n measureImg(url, cb) {\n if(Array.isArray(url)) {\n if(!url.length) {\n return cb();\n }\n let count = 0;\n let len = url.length;\n let list = [];\n url.forEach((item, i) => {\n inject.measureImg(item, function(cache) {\n list[i] = cache;\n if(++count === len) {\n cb(list);\n }\n });\n });\n return;\n }\n else if(!url || !util.isString(url)) {\n inject.error('Measure img invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\n }\n let cache = IMG[url] = IMG[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb && cb(cache);\n }\n else if(cache.state === LOADING) {\n cb && cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cb && cache.task.push(cb);\n let img = new Image();\n img.onload = function() {\n cache.state = LOADED;\n cache.success = true;\n cache.width = img.width;\n cache.height = img.height;\n cache.source = img;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n img.onerror = function(e) {\n cache.state = LOADED;\n cache.success = false;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n if(url.substr(0, 5) !== 'data:') {\n let host = /^(?:\\w+:)?\\/\\/([^/:]+)/.exec(url);\n if(host) {\n if(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, calUnit } = unit;\nconst { d2r } = geom;\nconst { canvasPolygon, svgPolygon } = painter;\nconst {\n STYLE_KEY: {\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\n\nfunction getLinearDeg(v) {\n let deg = 180;\n if(v === 'to top') {\n deg = 0;\n }\n else if(v === 'to top right') {\n deg = 45;\n }\n else if(v === 'to right') {\n deg = 90;\n }\n else if(v === 'to bottom right') {\n deg = 135;\n }\n else if(v === 'to bottom') {\n }\n else if(v === 'to bottom left') {\n deg = 225;\n }\n else if(v === 'to left') {\n deg = 270;\n }\n else if(v === 'to top left') {\n deg = 315;\n }\n // 数字角度,没有的话取默认角度\n else {\n let match = /([-+]?[\\d.]+)deg/.exec(v);\n if(match) {\n deg = parseFloat(match[1]);\n }\n }\n return deg % 360;\n}\n\nfunction getRadialPosition(data) {\n if(/^[-+]?[\\d.]/.test(data)) {\n let v = calUnit(data);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[data] || 50,\n PERCENT,\n ];\n }\n}\n\n// 获取color-stop区间范围,去除无用值\nfunction getColorStop(v, length, root) {\n let list = [];\n let firstColor = v[0][0];\n // 先把已经声明距离的换算成[0,1]以数组形式存入,未声明的原样存入\n for(let i = 0, len = v.length; i < len; i++) {\n let item = v[i];\n // 考虑是否声明了位置\n if(item.length > 1) {\n let p = item[1];\n if(p[1] === PERCENT) {\n list.push([item[0], p[0] * 0.01]);\n }\n else if(p[1] === REM) {\n list.push([item[0], p[0] * root.computedStyle[FONT_SIZE] / length]);\n }\n else if(p[1] === VW) {\n list.push([item[0], p[0] * root.width / length]);\n }\n else if(p[1] === VH) {\n list.push([item[0], p[0] * root.height / length]);\n }\n else {\n list.push([item[0], p[0] / length]);\n }\n }\n else {\n list.push([item[0]]);\n }\n }\n if(list.length === 1) {\n list.push(util.clone(list[0]));\n }\n // 首尾不声明默认为[0, 1]\n if(list[0].length === 1) {\n list[0].push(0);\n }\n if(list.length > 1) {\n let i = list.length - 1;\n if(list[i].length === 1) {\n list[i].push(1);\n }\n }\n // 找到未声明位置的,需区间计算,找到连续的未声明的,前后的区间平分\n let start = list[0][1];\n for(let i = 1, len = list.length; i < len - 1; i++) {\n let item = list[i];\n if(item.length > 1) {\n start = item[1];\n }\n else {\n let j = i + 1;\n let end = list[list.length - 1][1];\n for(; j < len - 1; j++) {\n let item = list[j];\n if(item.length > 1) {\n end = item[1];\n break;\n }\n }\n let num = j - i + 1;\n let per = (end - start) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.push(start + per * (k + 1 - i));\n }\n i = j;\n }\n }\n // 每个不能小于前面的,canvas/svg不能兼容这种情况,需处理\n for(let i = 1, len = list.length; i < len; i++) {\n let item = list[i];\n let prev = list[i - 1];\n if(item[1] < prev[1]) {\n item[1] = prev[1];\n }\n }\n // 0之前的和1之后的要过滤掉\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item[1] > 1) {\n list.splice(i);\n let prev = list[i - 1];\n if(prev && prev[1] < 1) {\n let dr = item[0][0] - prev[0][0];\n let dg = item[0][1] - prev[0][1];\n let db = item[0][2] - prev[0][2];\n let da = item[0][3] - prev[0][3];\n let p = (1 - prev[1]) / (item[1] - prev[1]);\n list.push([\n [\n item[0][0] + dr * p,\n item[0][1] + dg * p,\n item[0][2] + db * p,\n item[0][3] + da * p,\n ],\n 1],\n );\n }\n break;\n }\n }\n for(let i = list.length - 1; i >= 0; i--) {\n let item = list[i];\n if(item[1] < 0) {\n list.splice(0, i + 1);\n let next = list[i];\n if(next && next[1] > 0) {\n let dr = next[0][0] - item[0][0];\n let dg = next[0][1] - item[0][1];\n let db = next[0][2] - item[0][2];\n let da = next[0][3] - item[0][3];\n let p = (-item[1]) / (next[1] - item[1]);\n list.unshift([\n [\n item[0][0] + dr * p,\n item[0][1] + dg * p,\n item[0][2] + db * p,\n item[0][3] + da * p,\n ],\n 0],\n );\n }\n break;\n }\n }\n // 可能存在超限情况,如在使用px单位超过len或 {\n // item[0] = int2rgba(item[0]);\n if(item[1] < 0) {\n item[1] = 0;\n }\n else if(item[1] > 1) {\n item[1] = 1;\n }\n });\n // 都超限时,第一个颜色兜底\n if(!list.length) {\n list.push([firstColor, 0]);\n }\n return list;\n}\n\n// 根据角度和圆心获取渐变的4个点坐标\nfunction calLinearCoords(deg, length, cx, cy) {\n let x0;\n let y0;\n let x1;\n let y1;\n if(deg >= 270) {\n let r = d2r(360 - deg);\n x0 = cx + Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n else if(deg >= 180) {\n let r = d2r(deg - 180);\n x0 = cx + Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else if(deg >= 90) {\n let r = d2r(180 - deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else {\n let r = d2r(deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n return [x0, y0, x1, y1];\n}\n\nfunction calCircleCentre(position, x1, y1, iw, ih, root) {\n let cx, cy;\n let positionX = position[0], positionY = position[1];\n if(positionX[1] === PERCENT) {\n cx = x1 + positionX[0] * iw * 0.01;\n }\n else if(positionX[1] === REM) {\n cx = x1 + positionX[0] * root.computedStyle[FONT_SIZE];\n }\n else if(positionX[1] === VW) {\n cx = x1 + positionX[0] * root.width * 0.01;\n }\n else if(positionX[1] === VH) {\n cx = x1 + positionX[0] * root.height * 0.01;\n }\n else {\n cx = x1 + positionX[0];\n }\n if(positionY[1] === PERCENT) {\n cy = y1 + positionY[0] * ih * 0.01;\n }\n else if(positionY[1] === REM) {\n cy = y1 + positionY[0] * root.computedStyle[FONT_SIZE];\n }\n else if(positionY[1] === VW) {\n cy = y1 + positionY[0] * root.width * 0.01;\n }\n else if(positionY[1] === VH) {\n cy = y1 + positionY[0] * root.height * 0.01;\n }\n else {\n cy = y1 + positionY[0];\n }\n return [cx, cy];\n}\n\n// 获取径向渐变圆心半径\nfunction calRadialRadius(shape, size, position, iw, ih, x1, y1, x2, y2, root) {\n let cx, cy, xl, yl, r, 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.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]);\n if(position) {\n let x = getRadialPosition(position[1]);\n let y = position[2] ? getRadialPosition(position[2]) : x;\n o.p = [x, y];\n }\n else {\n o.p = [[50, PERCENT], [50, PERCENT]];\n }\n }\n else if(o.k === 'conic') {\n let deg = /([-+]?[\\d.]+deg)/i.exec(gradient[2]);\n if(deg) {\n o.d = parseFloat(deg[0]) % 360;\n }\n else {\n o.d = 0;\n }\n let position = /at\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]);\n if(position) {\n let x = getRadialPosition(position[1]);\n let y = position[2] ? getRadialPosition(position[2]) : x;\n o.p = [x, y];\n }\n else {\n o.p = [[50, PERCENT], [50, PERCENT]];\n }\n }\n let v = gradient[2].match(/([-+]?[\\d.]+[pxremvwh%]+)?\\s*((#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))\\s*([-+]?[\\d.]+[pxremvwh%]+)?/ig) || [];\n o.v = v.map(item => {\n let color = /((?:#[0-9a-f]{3,8})|(?:rgba?\\s*\\(.+?\\)))/i.exec(item);\n let arr = [rgba2int(color[1])];\n let percent = /[-+]?[\\d.]+[pxremvwh%]+/.exec(item);\n if(percent) {\n let v = calUnit(percent[0]);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n arr[1] = v;\n }\n return arr;\n });\n return o;\n }\n}\n\nfunction getLinear(v, d, ox, oy, cx, cy, w, h, root, 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: '#000',\n borderRightColor: '#000',\n borderBottomColor: '#000',\n borderLeftColor: '#000',\n borderTopStyle: 'solid',\n borderRightStyle: 'solid',\n borderBottomStyle: 'solid',\n borderLeftStyle: 'solid',\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomLeftRadius: 0,\n width: 'auto',\n height: 'auto',\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto',\n flexDirection: 'row',\n flexWrap: 'nowrap',\n order: 0,\n justifyContent: 'flexStart',\n alignItems: 'stretch',\n alignSelf: 'auto',\n alignContent: 'stretch',\n textAlign: 'inherit',\n letterSpacing: 'inherit',\n transformOrigin: 'center',\n visibility: 'inherit',\n opacity: 1,\n zIndex: 0,\n transform: null,\n translateX: 0,\n translateY: 0,\n translateZ: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n skewX: 0,\n skewY: 0,\n rotateX: 0,\n rotateY: 0,\n rotateZ: 0,\n rotate3d: '0, 0, 0, 0',\n perspective: 0,\n perspectiveOrigin: 'center',\n filter: null,\n boxShadow: null,\n pointerEvents: 'inherit',\n overflow: 'visible',\n mixBlendMode: 'normal',\n whiteSpace: 'inherit',\n textOverflow: 'clip',\n lineClamp: 0,\n textStrokeWidth: 'inherit',\n textStrokeColor: 'inherit',\n textStrokeOver: 'inherit',\n};\n\nconst GEOM = {\n fill: 'transparent',\n stroke: '#000',\n strokeWidth: 1,\n strokeDasharray: '',\n strokeLinecap: 'butt',\n strokeLinejoin: 'miter',\n strokeMiterlimit: 4,\n fillRule: 'nonzero',\n};\n\nlet DOM_ENTRY_SET = [];\nlet DOM_KEY_SET = [];\nObject.keys(DOM).forEach(k => {\n DOM_KEY_SET.push(k);\n let v = DOM[k];\n DOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet GEOM_ENTRY_SET = [];\nlet GEOM_KEY_SET = [];\nObject.keys(GEOM).forEach(k => {\n GEOM_KEY_SET.push(k);\n let v = GEOM[k];\n GEOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet INHERIT = {\n fontFamily: 'arial',\n fontSize: 16,\n fontWeight: 400,\n fontStyle: 'normal',\n color: '#000',\n textAlign: 'left',\n visibility: 'visible',\n pointerEvents: 'auto',\n textStrokeColor: '#000',\n textStrokeWidth: 1,\n textStrokeOver: 'none',\n};\n\nlet INHERIT_KEY_SET = [];\nObject.keys(INHERIT).forEach(k => {\n INHERIT_KEY_SET.push(k);\n});\n\nexport default {\n DOM,\n GEOM,\n isValid(i) {\n return DOM.hasOwnProperty(i) || GEOM.hasOwnProperty(i);\n },\n DOM_KEY_SET,\n GEOM_KEY_SET,\n DOM_ENTRY_SET,\n GEOM_ENTRY_SET,\n INHERIT,\n INHERIT_KEY_SET,\n};\n","import reg from './reg';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction parseFlex(style, grow, shrink, basis) {\n if(isNil(style.flexGrow)) {\n style.flexGrow = grow || 0;\n }\n if(isNil(style.flexShrink)) {\n style.flexShrink = shrink || 0;\n }\n if(isNil(style.flexBasis)) {\n style.flexBasis = basis || 0;\n }\n}\n\nfunction parseMarginPadding(style, key, list) {\n let temp = style[key];\n if(!isNil(temp)) {\n let match = temp.toString().match(/([-+]?[\\d.]+[pxremvwh%]*)|(auto)/ig);\n if(match) {\n if(match.length === 1) {\n match[3] = match[2] = match[1] = match[0];\n }\n else if(match.length === 2) {\n match[2] = match[0];\n match[3] = match[1];\n }\n else if(match.length === 3) {\n match[3] = match[1];\n }\n list.forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = match[i];\n }\n });\n }\n }\n}\n\nfunction parseOneBorder(style, k) {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n // 后面会统一格式化处理\n if(isNil(style[k + 'Width'])) {\n let w = /\\b[\\d.]+[pxremvwh%]*\\b/i.exec(v);\n style[k + 'Width'] = w ? w[0] : 0;\n }\n if(isNil(style[k + 'Style'])) {\n let s = /\\b(solid|dashed|dotted)\\b/i.exec(v);\n style[k + 'Style'] = s ? s[1] : 'solid';\n }\n if(isNil(style[k + 'Color'])) {\n let c = /#[0-9a-f]{3,8}/i.exec(v);\n if(c && [4, 7, 9].indexOf(c[0].length) > -1) {\n style[k + 'Color'] = c[0];\n }\n else if(/\\btransparent\\b/i.test(v)) {\n style[k + 'Color'] = 'transparent';\n }\n else {\n c = /rgba?\\s*\\(.+\\)/i.exec(v);\n style[k + 'Color'] = c ? c[0] : 'transparent';\n }\n }\n}\n\nexport default {\n margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'],\n padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n border: ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'],\n borderTop: ['borderTopWidth', 'borderTopStyle', 'borderTopColor'],\n borderRight: ['borderRightWidth', 'borderRightStyle', 'borderRightColor'],\n borderBottom: ['borderBottomWidth', 'borderBottomStyle', 'borderBottomColor'],\n borderLeft: ['borderLeftWidth', 'borderLeftStyle', 'borderLeftColor'],\n borderWidth: ['borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth'],\n borderColor: ['borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor'],\n borderStyle: ['borderTopStyle', 'borderRightStyle', 'borderBottomStyle', 'borderLeftStyle'],\n borderRadius: ['borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'],\n background: ['backgroundColor', 'backgroundImage', 'backgroundRepeat', 'backgroundPosition'],\n backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n flex: ['flexGrow', 'flexShrink', 'flexBasis'],\n translate: ['translateX', 'translateY'],\n translate3d: ['translateX', 'translateY', 'translateY'],\n scale: ['scaleX', 'scaleY'],\n scale3d: ['scaleX', 'scaleY', 'scaleZ'],\n rotate: ['rotateZ'],\n skew: ['skewX', 'skewY'],\n textStroke: ['textStrokeWidth', 'textStrokeColor', 'textStrokeOver'],\n\n toFull(style, k) {\n let v = style[k];\n if(k === 'background') {\n // bg缩写多个时有color则必须是最后一个\n if(Array.isArray(v)) {\n let length = v.length;\n if(isNil(style.backgroundColor)) {\n let bgc = /^\\s*((transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))/i.exec(v[length - 1]);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.slice(0, length - 1);\n }\n }\n let bgi = [];\n let bgr = [];\n let bgp = [];\n v.forEach(item => {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(item);\n if(gd) {\n bgi.push(gd[0]);\n item = item.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n bgi.push(img[0]);\n item = item.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-?)?repeat(-?[xy])?/i.exec(item);\n if(repeat) {\n bgr.push(repeat[0].toLowerCase());\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = item.match(reg.position);\n if(position) {\n bgp.push(position.join(' '));\n }\n }\n });\n if(bgi.length) {\n style.backgroundImage = bgi;\n }\n if(bgr.length) {\n style.backgroundRepeat = bgr;\n }\n if(bgp.length) {\n style.backgroundPosition = bgp;\n this.toFull(style, 'backgroundPosition');\n }\n }\n else {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(v);\n if(gd) {\n style.backgroundImage = gd[0];\n v = v.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n style.backgroundImage = img[0];\n v = v.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-?)?repeat(-?[xy])?/i.exec(v);\n if(repeat) {\n style.backgroundRepeat = repeat[0].toLowerCase();\n }\n }\n if(isNil(style.backgroundColor)) {\n let bgc = /^(transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\))/i.exec(v);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.replace(bgc[0], '');\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = v.match(reg.position);\n if(position) {\n style.backgroundPosition = position.join(' ');\n this.toFull(style, 'backgroundPosition');\n }\n }\n }\n }\n else if(k === 'flex') {\n if(v === 'none') {\n parseFlex(style, 0, 0, 'auto');\n }\n else if(v === 'auto') {\n parseFlex(style, 1, 1, 'auto');\n }\n else if(/^[\\d.]+\\s+[\\d.]+\\s+(auto|none|content)/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]);\n }\n else if(/^[\\d.]+\\s+[\\d.]+\\s+[\\d.]+[pxremvwh%]*/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]);\n }\n else if(/^[\\d.]+\\s+[\\d.]+$/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), 0);\n }\n else if(/^[\\d.]+\\s+[\\d.]+[pxremvwh%]+/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), 1, arr[1]);\n }\n else if(/^[\\d.]+$/.test(v)) {\n parseFlex(style, parseFloat(v), 1, 0);\n }\n else if(/^[\\d.]+[pxremvwh%]+/i.test(v)) {\n parseFlex(style, 1, 1, v);\n }\n else {\n parseFlex(style, 0, 1, 'auto');\n }\n }\n else if(k === 'flexFlow') {\n v = v.toString().split(/\\s+/);\n if(v.length) {\n if(isNil(style.flexDirection)) {\n }\n style.flexDirection = v[0];\n if(v.length > 1) {\n style.flexWrap = v[1];\n }\n }\n }\n else if(k === 'borderRadius') {\n // borderRadius缩写很特殊,/分隔x/y,然后上右下左4个\n v = v.toString().split('/');\n if(v.length === 1) {\n v[1] = v[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = v[i].toString().split(/\\s+/);\n if(item.length === 0) {\n v[i] = [0, 0, 0, 0];\n }\n else if(item.length === 1) {\n v[i] = [item[0], item[0], item[0], item[0]];\n }\n else if(item.length === 2) {\n v[i] = [item[0], item[1], item[0], item[1]];\n }\n else if(item.length === 3) {\n v[i] = [item[0], item[1], item[2], item[1]];\n }\n else {\n v[i] = item.slice(0, 4);\n }\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = v[0][i] + ' ' + v[1][i];\n }\n });\n }\n else if(k === 'backgroundPosition') {\n if(!Array.isArray(v)) {\n v = [v];\n }\n let isEmpty = this[k].map(k2 => isNil(style[k2]));\n v.forEach(v2 => {\n v2 = v2.toString().split(/\\s+/);\n if(v2.length === 1) {\n v2[1] = '50%';\n }\n this[k].forEach((k2, i) => {\n if(isEmpty[i]) {\n style[k2] = style[k2] || [];\n style[k2].push(v2[i]);\n }\n });\n });\n }\n else if(['translate', 'scale', 'skew'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(['translate3d', 'scale3d'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[2] = arr[1] = arr[0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? 1 : 0;\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(k === 'margin' || k === 'padding') {\n parseMarginPadding(style, k, this[k]);\n }\n else if(/^border((Top)|(Right)|(Bottom)|(Left))$/.test(k)) {\n parseOneBorder(style, k);\n }\n else if(k === 'textStroke') {\n let w = /(?:^|\\s)([-+]?[\\d.]+[pxremvwh%]*)/.exec(v);\n if(w) {\n style.textStrokeWidth = w[1];\n }\n let c = /(transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\))/i.exec(v);\n if(c) {\n style.textStrokeColor = c[0];\n }\n if(/\\bfill\\b/i.test(v)) {\n style.textStrokeOver = 'fill';\n }\n else {\n style.textStrokeOver = 'none';\n }\n }\n else if(this[k]) {\n this[k].forEach(k => {\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n }\n return style;\n }\n};\n","import enums from '../util/enums';\n\nconst { STYLE_KEY } = enums;\n\nconst KEY_COLOR = [\n [STYLE_KEY.BACKGROUND_COLOR],\n [STYLE_KEY.BORDER_BOTTOM_COLOR],\n [STYLE_KEY.BORDER_LEFT_COLOR],\n [STYLE_KEY.BORDER_RIGHT_COLOR],\n [STYLE_KEY.BORDER_TOP_COLOR],\n [STYLE_KEY.COLOR],\n [STYLE_KEY.TEXT_STROKE_COLOR],\n];\n\nconst KEY_LENGTH = [\n [STYLE_KEY.FONT_SIZE],\n [STYLE_KEY.BORDER_BOTTOM_WIDTH],\n [STYLE_KEY.BORDER_LEFT_WIDTH],\n [STYLE_KEY.BORDER_RIGHT_WIDTH],\n [STYLE_KEY.BORDER_TOP_WIDTH],\n [STYLE_KEY.LEFT],\n [STYLE_KEY.TOP],\n [STYLE_KEY.RIGHT],\n [STYLE_KEY.BOTTOM],\n [STYLE_KEY.FLEX_BASIS],\n [STYLE_KEY.WIDTH],\n [STYLE_KEY.HEIGHT],\n [STYLE_KEY.LINE_HEIGHT],\n [STYLE_KEY.MARGIN_BOTTOM],\n [STYLE_KEY.MARGIN_LEFT],\n [STYLE_KEY.MARGIN_TOP],\n [STYLE_KEY.MARGIN_RIGHT],\n [STYLE_KEY.PADDING_TOP],\n [STYLE_KEY.PADDING_RIGHT],\n [STYLE_KEY.PADDING_BOTTOM],\n [STYLE_KEY.PADDING_LEFT],\n [STYLE_KEY.STROKE_WIDTH],\n [STYLE_KEY.STROKE_MITERLIMIT],\n [STYLE_KEY.LETTER_SPACING],\n [STYLE_KEY.PERSPECTIVE],\n [STYLE_KEY.TEXT_STROKE_WIDTH],\n];\n\nconst KEY_GRADIENT = [\n [STYLE_KEY.BACKGROUND_IMAGE],\n [STYLE_KEY.FILL],\n [STYLE_KEY.STROKE],\n];\n\nconst KEY_RADIUS = [\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS],\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS],\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS],\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS],\n];\n\nconst COLOR_HASH = {};\nKEY_COLOR.forEach(k => {\n COLOR_HASH[k] = true;\n});\n\nconst LENGTH_HASH = {};\nKEY_LENGTH.forEach(k => {\n LENGTH_HASH[k] = true;\n});\n\nconst RADIUS_HASH = {};\nKEY_RADIUS.forEach(k => {\n RADIUS_HASH[k] = true;\n});\n\nconst GRADIENT_HASH = {};\nKEY_GRADIENT.forEach(k => {\n GRADIENT_HASH[k] = true;\n});\n\nconst GRADIENT_TYPE = {\n linear: true,\n radial: true,\n conic: true,\n};\n\nconst KEY_EXPAND = [\n [STYLE_KEY.TRANSLATE_X],\n [STYLE_KEY.TRANSLATE_Y],\n [STYLE_KEY.TRANSLATE_Z],\n [STYLE_KEY.SKEW_X],\n [STYLE_KEY.SKEW_Y],\n [STYLE_KEY.SCALE_X],\n [STYLE_KEY.SCALE_Y],\n [STYLE_KEY.SCALE_Z],\n [STYLE_KEY.ROTATE_X],\n [STYLE_KEY.ROTATE_Y],\n [STYLE_KEY.ROTATE_Z],\n];\n\nconst EXPAND_HASH = {};\nKEY_EXPAND.forEach(k => {\n EXPAND_HASH[k] = true;\n});\n\nexport default {\n KEY_COLOR,\n KEY_EXPAND,\n KEY_GRADIENT,\n KEY_LENGTH,\n KEY_RADIUS,\n COLOR_HASH,\n EXPAND_HASH,\n GRADIENT_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_TYPE,\n};\n","import reset from '../style/reset';\nimport unit from '../style/unit';\nimport enums from '../util/enums';\n\nconst { DOM: RESET_DOM, GEOM: RESET_GEOM } = reset;\nconst { INHERIT } = unit;\nconst { STYLE_KEY } = enums;\n\nconst GEOM = {};\nconst GEOM_KEY_SET = [];\nconst IGNORE = {\n [STYLE_KEY.POINTER_EVENTS]: true,\n};\nconst REPAINT = {\n [STYLE_KEY.TRANSFORM]: true,\n [STYLE_KEY.TRANSLATE_X]: true,\n [STYLE_KEY.TRANSLATE_Y]: true,\n [STYLE_KEY.SKEW_X]: true,\n [STYLE_KEY.SKEW_Y]: true,\n [STYLE_KEY.SCALE_X]: true,\n [STYLE_KEY.SCALE_Y]: true,\n [STYLE_KEY.ROTATE_Z]: true,\n [STYLE_KEY.COLOR]: true,\n [STYLE_KEY.FONT_STYLE]: true,\n [STYLE_KEY.STROKE_WIDTH]: true,\n [STYLE_KEY.FILL]: true,\n [STYLE_KEY.STROKE_DASHARRAY]: true,\n [STYLE_KEY.STROKE_LINECAP]: true,\n [STYLE_KEY.STROKE_LINEJOIN]: true,\n [STYLE_KEY.STROKE_MITERLIMIT]: true,\n [STYLE_KEY.BACKGROUND_COLOR]: true,\n [STYLE_KEY.BACKGROUND_IMAGE]: true,\n [STYLE_KEY.BACKGROUND_POSITION_X]: true,\n [STYLE_KEY.BACKGROUND_POSITION_Y]: true,\n [STYLE_KEY.BACKGROUND_REPEAT]: true,\n [STYLE_KEY.BACKGROUND_SIZE]: true,\n [STYLE_KEY.STROKE]: true,\n [STYLE_KEY.BORDER_BOTTOM_COLOR]: true,\n [STYLE_KEY.BORDER_LEFT_COLOR]: true,\n [STYLE_KEY.BORDER_RIGHT_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS]: true,\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS]: true,\n [STYLE_KEY.VISIBILITY]: true,\n [STYLE_KEY.OPACITY]: true,\n [STYLE_KEY.Z_INDEX]: true,\n [STYLE_KEY.FILTER]: true,\n [STYLE_KEY.BOX_SHADOW]: true,\n [STYLE_KEY.OVERFLOW]: true,\n [STYLE_KEY.BACKGROUND_CLIP]: true,\n [STYLE_KEY.TEXT_STROKE_WIDTH]: true,\n [STYLE_KEY.TEXT_STROKE_COLOR]: true,\n [STYLE_KEY.TEXT_STROKE_OVER]: true,\n};\nconst MEASURE = {\n [STYLE_KEY.FONT_SIZE]: true,\n [STYLE_KEY.FONT_WEIGHT]: true,\n [STYLE_KEY.FONT_FAMILY]: true,\n};\n\nlet o = {\n GEOM,\n GEOM_KEY_SET,\n IGNORE,\n REPAINT,\n MEASURE,\n addGeom(tagName, ks, cb) {\n if(Array.isArray(ks)) {\n ks.forEach(k => {\n o.addGeom(tagName, k, cb);\n });\n }\n else if(ks) {\n if(!GEOM.hasOwnProperty(ks)) {\n GEOM_KEY_SET.push(ks);\n }\n let hash = GEOM[ks] = GEOM[ks] || {};\n hash[tagName] = cb || true;\n }\n },\n 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, calUnit } = unit;\nconst { isNil, rgba2int, equalArr } = util;\nconst { MEASURE_KEY_SET, isGeom, GEOM, GEOM_KEY_SET } = change;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nconst TRANSFORM_HASH = {\n translateX: TRANSLATE_X,\n translateY: TRANSLATE_Y,\n translateZ: TRANSLATE_Z,\n scaleX: SCALE_X,\n scaleY: SCALE_Y,\n scaleZ: SCALE_Z,\n skewX: SKEW_X,\n skewY: SKEW_Y,\n rotateX: ROTATE_X,\n rotateY: ROTATE_Y,\n rotateZ: ROTATE_Z,\n rotate: ROTATE_Z,\n};\n\nfunction compatibleTransform(k, arr) {\n if(k === SCALE_X || k === SCALE_Y || k === SCALE_Z) {\n arr[1] = NUMBER;\n }\n else if(k === TRANSLATE_X || k === TRANSLATE_Y || k === TRANSLATE_Z) {\n if(arr[1] === NUMBER) {\n arr[1] = PX;\n }\n }\n else if(k === PERSPECTIVE) {\n if([NUMBER, PERCENT, DEG].indexOf(arr[1]) > -1) {\n arr[1] = PX;\n }\n }\n else {\n if(arr[1] === NUMBER) {\n arr[1] = DEG;\n }\n }\n}\n\n/**\n * 将传入的手写style标准化,并且用reset默认值覆盖其中为空的\n * @param style 手写的style样式\n * @param reset 默认样式,可选\n * @returns Object 标准化的枚举数组结构样式\n */\nfunction normalize(style, reset = []) {\n if(!util.isObject(style)) {\n return {};\n }\n let res = {};\n // style只有单层无需深度clone\n style = util.extend({}, style);\n // 缩写提前处理,因为reset里没有缩写\n let temp = style.border;\n if(temp) {\n abbr.toFull(style, 'border');\n }\n ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'].forEach(k => {\n abbr.toFull(style, k);\n });\n temp = style.borderWidth;\n if(temp) {\n abbr.toFull(style, 'borderWidth');\n }\n temp = style.borderColor;\n if(temp) {\n abbr.toFull(style, 'borderColor');\n }\n temp = style.borderStyle;\n if(temp) {\n abbr.toFull(style, 'borderStyle');\n }\n temp = style.borderRadius;\n if(temp) {\n abbr.toFull(style, 'borderRadius');\n }\n temp = style.background;\n // 处理渐变背景缩写\n if(temp) {\n abbr.toFull(style, 'background');\n }\n // 背景位置\n temp = style.backgroundPosition;\n if(!isNil(temp)) {\n abbr.toFull(style, 'backgroundPosition');\n }\n // flex\n temp = style.flex;\n if(temp) {\n abbr.toFull(style, 'flex');\n }\n // flex-flow\n temp = style.flexFlow;\n if(temp) {\n abbr.toFull(style, 'flexFlow');\n }\n temp = style.margin;\n if(!isNil(temp)) {\n abbr.toFull(style, 'margin');\n }\n temp = style.padding;\n if(!isNil(temp)) {\n abbr.toFull(style, 'padding');\n }\n temp = style.textStroke;\n if(temp) {\n abbr.toFull(style, 'textStroke');\n }\n // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform\n ['translate', 'scale', 'skew', 'translate3d', 'scale3d', 'rotate'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n abbr.toFull(style, k);\n }\n });\n // 扩展的不能和transform混用,给出警告\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate3d',\n ].forEach(k => {\n let v = style[k];\n if(!isNil(v) && style.transform) {\n inject.warn(`Can not use expand style \"${k}\" with transform`);\n }\n });\n // 默认reset,根据传入不同,当style为空时覆盖\n reset.forEach(item => {\n let { k, v } = item;\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n // 背景图\n temp = style.backgroundImage;\n if(temp !== undefined) {\n if(!temp) {\n res[BACKGROUND_IMAGE] = [null];\n }\n else if(Array.isArray(temp)) {\n res[BACKGROUND_IMAGE] = temp.map(item => {\n if(!item) {\n return null;\n }\n if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n if(reg.img.test(item)) {\n return reg.img.exec(item)[2];\n }\n return null;\n });\n }\n // 区分是渐变色还是图\n else if(reg.gradient.test(temp)) {\n res[BACKGROUND_IMAGE] = [gradient.parseGradient(temp)];\n }\n else if(reg.img.test(temp)) {\n res[BACKGROUND_IMAGE] = [reg.img.exec(temp)[2]];\n }\n else {\n res[BACKGROUND_IMAGE] = [null];\n }\n }\n temp = style.backgroundColor;\n if(temp) {\n // 先赋值默认透明,后续操作有合法值覆盖\n let bgc = /^#[0-9a-f]{3,8}/i.exec(temp);\n if(bgc && [4, 7, 9].indexOf(bgc[0].length) > -1) {\n res[BACKGROUND_COLOR] = [rgba2int(bgc[0]), RGBA];\n }\n else {\n bgc = /rgba?\\s*\\(.+\\)/i.exec(temp);\n res[BACKGROUND_COLOR] = [rgba2int(bgc ? bgc[0] : [0, 0, 0, 0]), RGBA];\n }\n }\n ['backgroundPositionX', 'backgroundPositionY'].forEach((k, i) => {\n temp = style[k];\n if(!isNil(temp)) {\n k = i ? BACKGROUND_POSITION_Y : BACKGROUND_POSITION_X;\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[k] = temp.map(item => {\n if(/^[-+]?[\\d.]/.test(item)) {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item] || 0,\n PERCENT,\n ];\n }\n });\n }\n });\n // 背景尺寸\n temp = style.backgroundSize;\n if(temp) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[BACKGROUND_SIZE] = temp.map(item => {\n if(!item) {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n let match = item.toString().match(/\\b(?:([-+]?[\\d.]+[pxremvwh%]*)|(contain|cover|auto))/ig);\n if(match) {\n if(match.length === 1) {\n if(match[0] === 'contain' || match[0] === 'cover') {\n match[1] = match[0];\n }\n else {\n match[1] = 'auto';\n }\n }\n let v = [];\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n v.push(n);\n }\n else if(item === 'contain' || item === 'cover') {\n v.push([item, STRING]);\n }\n else {\n v.push([0, AUTO]);\n }\n }\n return v;\n }\n else {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n });\n }\n // border-color\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k + 'Color';\n let v = style[k];\n if(!isNil(v)) {\n res[STYLE_KEY[style2Upper(k)]] = [rgba2int(v), RGBA];\n }\n });\n // border-radius\n ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'].forEach(k => {\n k = 'border' + k + 'Radius';\n let v = style[k];\n if(!isNil(v)) {\n let arr = v.toString().split(/\\s+/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = arr[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n if(n[0] < 0) {\n n[0] = 0;\n }\n arr[i] = n;\n }\n else {\n arr[i] = [0, PX];\n }\n }\n res[STYLE_KEY[style2Upper(k)]] = arr;\n }\n });\n temp = style.transform;\n if(temp) {\n let transform = res[TRANSFORM] = [];\n let match = (temp || '').toString().match(/\\w+\\(.+?\\)/g);\n if(match) {\n match.forEach(item => {\n let i = item.indexOf('(');\n let k = item.slice(0, i);\n let v = item.slice(i + 1, item.length - 1);\n if(k === 'matrix') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 6) {\n arr = arr.slice(0, 6);\n }\n if(arr.length === 6) {\n transform.push([MATRIX, [\n arr[0], arr[1], 0, 0, arr[2], arr[3], 0, 0, 0, 0, 1, 0, arr[4], arr[5], 0, 1,\n ]]);\n }\n }\n else if(k === 'matrix3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 16) {\n arr = arr.slice(0, 16);\n }\n if(arr.length === 16) {\n transform.push([MATRIX, arr]);\n }\n }\n else if(k === 'perspective') {\n let arr = calUnit(v);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n transform.push([PERSPECTIVE, arr]);\n }\n else if(k === 'rotate3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n transform.push([ROTATE_3D, arr]);\n }\n }\n else if(TRANSFORM_HASH.hasOwnProperty(k)) {\n let k2 = TRANSFORM_HASH[k];\n let arr = calUnit(v);\n compatibleTransform(k2, arr);\n transform.push([k2, arr]);\n }\n else if({ translate: true, scale: true, skew: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale' ? arr[0] : [0];\n }\n if(arr.length === 2) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n }\n }\n else if({ translate3d: true, scale3d: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale3d' ? [1] : [0];\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n if(arr.length === 3) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let k3 = STYLE_KEY[style2Upper(k + 'Z')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n let arr3 = calUnit(arr[2]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n compatibleTransform(k3, arr3);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n transform.push([k3, arr3]);\n }\n }\n });\n }\n }\n temp = style.perspective;\n if(!isNil(temp)) {\n let arr = calUnit(temp);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n res[PERSPECTIVE] = arr;\n }\n ['perspectiveOrigin', 'transformOrigin'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n let arr = res[STYLE_KEY[style2Upper(k)]] = [];\n let match = temp.toString().match(reg.position);\n if(match) {\n if(match.length === 1) {\n match[1] = match[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n arr.push(n);\n }\n else {\n arr.push([\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item],\n PERCENT,\n ]);\n // 不规范的写法变默认值50%\n if(isNil(arr[i][0])) {\n arr[i][0] = 50;\n }\n }\n }\n }\n else {\n arr.push([50, PERCENT]);\n arr.push([50, PERCENT]);\n }\n }\n });\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n let k2 = TRANSFORM_HASH[k];\n let n = calUnit(v);\n // 没有单位或默认值处理单位\n compatibleTransform(k2, n);\n res[k2] = n;\n });\n temp = style.rotate3d;\n if(temp) {\n let arr = temp.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n res[ROTATE_3D] = arr;\n }\n }\n temp = style.opacity;\n if(!isNil(temp)) {\n temp = parseFloat(temp);\n if(!isNaN(temp)) {\n temp = Math.max(temp, 0);\n temp = Math.min(temp, 1);\n res[OPACITY] = temp;\n }\n else {\n res[OPACITY] = 1;\n }\n }\n temp = style.zIndex;\n if(!isNil(temp)) {\n res[Z_INDEX] = parseInt(temp) || 0;\n }\n // 转化不同单位值为对象标准化,不写单位的变成number单位转化为px\n [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'width',\n 'height',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n if(v === 'auto') {\n v = [0, AUTO];\n }\n else {\n v = calUnit(v);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n let k2 = STYLE_KEY[style2Upper(k)];\n res[k2] = v;\n // 限制padding/border为正数\n if({\n paddingTop: true,\n paddingRight: true,\n paddingBottom: true,\n paddingLeft: true,\n borderTopWidth: true,\n borderRightWidth: true,\n borderBottomWidth: true,\n borderLeftWidth: true,\n width: true,\n height: true,\n }.hasOwnProperty(k) && v[0] < 0) {\n v[0] = 0;\n }\n });\n temp = style.flexBasis;\n if(!isNil(temp)) {\n if(temp === 'content') {\n res[FLEX_BASIS] = [temp, STRING];\n }\n else if(/^[\\d.]/.test(temp)) {\n let v = res[FLEX_BASIS] = calUnit(temp);\n v[0] = Math.max(v[0], 0);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n else {\n res[FLEX_BASIS] = [0, AUTO];\n }\n }\n temp = style.order;\n if(!isNil(temp)) {\n res[ORDER] = parseInt(temp) || 0;\n }\n temp = style.color;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[COLOR] = [[], INHERIT];\n }\n else {\n res[COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.textStrokeColor;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_COLOR] = [[], INHERIT];\n }\n else {\n res[TEXT_STROKE_COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.fontSize;\n if(temp || temp === 0) {\n if(temp === 'inherit') {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // fontSize不能为负数,否则为继承\n if(v < 0) {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[FONT_SIZE] = v;\n }\n }\n }\n temp = style.textStrokeWidth;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // textStrokeWidth不能为负数,否则为继承\n if(v < 0) {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG, PERCENT].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[TEXT_STROKE_WIDTH] = v;\n }\n }\n }\n temp = style.textStrokeOver;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_OVER] = [0, INHERIT];\n }\n else {\n let v = temp.toString();\n if(v !== 'none' && v !== 'fill') {\n v = 'none';\n }\n res[TEXT_STROKE_OVER] = [v, STRING];\n }\n }\n temp = style.fontWeight;\n if(!isNil(temp)) {\n if(temp === 'bold') {\n res[FONT_WEIGHT] = [700, NUMBER];\n }\n else if(temp === 'normal') {\n res[FONT_WEIGHT] = [400, NUMBER];\n }\n else if(temp === 'lighter') {\n res[FONT_WEIGHT] = [200, NUMBER];\n }\n else if(temp === 'inherit') {\n res[FONT_WEIGHT] = [0, INHERIT];\n }\n else {\n res[FONT_WEIGHT] = [Math.max(0, parseInt(temp)) || 400, NUMBER];\n }\n }\n temp = style.fontStyle;\n if(temp) {\n if(temp === 'inherit') {\n res[FONT_STYLE] = [0, INHERIT];\n }\n else {\n res[FONT_STYLE] = [temp, STRING];\n }\n }\n temp = style.fontFamily;\n if(temp) {\n if(temp === 'inherit') {\n res[FONT_FAMILY] = [0, INHERIT];\n }\n else {\n // 统一文字声明格式\n res[FONT_FAMILY] = [temp.toString().toLowerCase().replace(/['\"]/, '').replace(/\\s*,\\s*/g, ','), STRING];\n }\n }\n temp = style.textAlign;\n if(temp) {\n if(temp === 'inherit') {\n res[TEXT_ALIGN] = [0, INHERIT];\n }\n else {\n res[TEXT_ALIGN] = [temp, STRING];\n }\n }\n temp = style.lineHeight;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LINE_HEIGHT] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LINE_HEIGHT] = [0, AUTO];\n }\n // lineHeight默认数字,想要px必须强制带单位\n else if(/^[\\d.]+/i.test(temp)) {\n let v = calUnit(temp);\n if([DEG].indexOf(v[1]) > -1) {\n v[1] = NUMBER;\n }\n res[LINE_HEIGHT] = v;\n }\n else {\n let n = Math.max(0, parseFloat(temp)) || 'normal';\n // 非法数字\n if(n === 'normal') {\n res[LINE_HEIGHT] = [null, AUTO];\n }\n else {\n res[LINE_HEIGHT] = [n, NUMBER];\n }\n }\n }\n temp = style.letterSpacing;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LETTER_SPACING] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LETTER_SPACING] = [0, PX];\n }\n else if(/^[-+]?[\\d.]/.test(temp)) {\n let v = calUnit(temp);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[LETTER_SPACING] = v;\n }\n else {\n res[LETTER_SPACING] = [parseFloat(temp) || 0, PX];\n }\n }\n temp = style.whiteSpace;\n if(temp) {\n if(temp === 'inherit') {\n res[WHITE_SPACE] = [0, INHERIT];\n }\n else {\n res[WHITE_SPACE] = [temp, STRING];\n }\n }\n temp = style.lineClamp;\n if(temp !== undefined) {\n temp = parseInt(temp) || 0;\n res[LINE_CLAMP] = Math.max(0, temp);\n }\n // fill和stroke为渐变时特殊处理,fillRule无需处理字符串\n temp = style.fill;\n if(temp !== undefined) {\n if(!temp) {\n res[FILL] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[FILL] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[FILL] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[FILL] = [gradient.parseGradient(temp)];\n }\n else {\n res[FILL] = [rgba2int(temp)];\n }\n }\n temp = style.stroke;\n if(temp !== undefined) {\n if(!temp) {\n res[STROKE] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[STROKE] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[STROKE] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[STROKE] = [gradient.parseGradient(temp)];\n }\n else {\n res[STROKE] = [rgba2int(temp)];\n }\n }\n temp = style.strokeWidth;\n if(!isNil(temp)) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[STROKE_WIDTH] = temp.map(item => {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n v[0] = Math.max(v[0], 0);\n return v;\n });\n }\n temp = style.strokeDasharray;\n if(!isNil(temp)) {\n if(Array.isArray(temp)) {\n res[STROKE_DASHARRAY] = temp.map(item => {\n let match = item.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n return match;\n }\n return [];\n });\n }\n else {\n let match = temp.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n res[STROKE_DASHARRAY] = [match];\n }\n else {\n res[STROKE_DASHARRAY] = [[]];\n }\n }\n }\n temp = style.filter;\n if(temp !== undefined) {\n let match = (temp || '').toString().match(/\\b[\\w-]+\\s*\\(\\s*[-+]?[\\d.]+\\s*[pxremvwhdg%]*\\s*\\)\\s*/ig);\n let f = null;\n if(match) {\n f = [];\n match.forEach(item => {\n let m2 = /([\\w-]+)\\s*\\(\\s*([-+]?[\\d.]+\\s*[pxremvwhdg%]*)\\s*\\)\\s*/i.exec(item);\n if(m2) {\n let k = m2[1].toLowerCase(), v = calUnit(m2[2]);\n if(k === 'blur') {\n if(v[0] <= 0 || [DEG, PERCENT].indexOf(v[1]) > -1) {\n return;\n }\n if(v[1] === NUMBER) {\n v[1] = PX;\n }\n f.push([k, v]);\n }\n else if(k === 'hue-rotate') {\n if([NUMBER, DEG].indexOf(v[1]) === -1) {\n return;\n }\n v[1] = DEG;\n f.push([k, v]);\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'grayscale' || k === 'contrast') {\n if([NUMBER, PERCENT].indexOf(v[1]) === -1) {\n return;\n }\n v[0] = Math.max(v[0], 0);\n v[1] = PERCENT;\n f.push([k, v]);\n }\n }\n });\n }\n res[FILTER] = f;\n }\n temp = style.visibility;\n if(temp) {\n if(temp === 'inherit') {\n res[VISIBILITY] = [0, INHERIT];\n }\n else {\n res[VISIBILITY] = [temp, STRING];\n }\n }\n temp = style.pointerEvents;\n if(temp) {\n if(temp === 'inherit') {\n res[POINTER_EVENTS] = [0, INHERIT];\n }\n else {\n res[POINTER_EVENTS] = [temp, STRING];\n }\n }\n temp = style.boxShadow;\n if(temp !== undefined) {\n let bs = null;\n let match = (temp || '').match(/([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*\\s*)?([-+]?[\\d.]+[pxremvwh%]*\\s*)?(((transparent)|(#[0-9a-f]{3,8})|(rgba?\\(.+?\\)))\\s*)?(inset|outset)?\\s*,?/ig);\n if(match) {\n match.forEach(item => {\n let boxShadow = /([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*\\s*)?([-+]?[\\d.]+[pxremvwh%]*\\s*)?(?:((?:transparent)|(?:#[0-9a-f]{3,8})|(?:rgba?\\(.+\\)))\\s*)?(inset|outset)?/i.exec(item);\n if(boxShadow) {\n bs = bs || [];\n let res = [];\n // v,h,blur,spread,color,inset\n for(let i = 0; i < 4; i++) {\n let v = calUnit(boxShadow[i + 1]);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n // x/y可以负,blur和spread不行\n if(i > 1 && v[0] < 0) {\n v = 0;\n }\n res.push(v);\n }\n res.push(rgba2int(boxShadow[5]));\n res.push(boxShadow[6] || 'outset');\n bs.push(res);\n }\n });\n }\n res[BOX_SHADOW] = bs;\n }\n // 直接赋值的string类型\n [\n 'position',\n 'display',\n 'flexDirection',\n 'flexWrap',\n 'justifyContent',\n 'alignItems',\n 'alignSelf',\n 'alignContent',\n 'overflow',\n 'mixBlendMode',\n 'borderTopStyle',\n 'borderRightStyle',\n 'borderBottomStyle',\n 'borderLeftStyle',\n 'backgroundClip',\n 'textOverflow',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[STYLE_KEY[style2Upper(k)]] = style[k];\n }\n });\n // 直接赋值的number类型\n [\n 'flexGrow',\n 'flexShrink',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[STYLE_KEY[style2Upper(k)]] = Math.max(parseFloat(style[k]) || 0, 0);\n }\n });\n temp = style.zIndex;\n if(!isNil(temp)) {\n res[Z_INDEX] = parseFloat(temp) || 0;\n }\n // 这些支持多个的用数组表示\n [\n 'backgroundRepeat',\n 'strokeLinecap',\n 'strokeLinejoin',\n 'strokeMiterlimit',\n 'fillRule',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n let v = style[k];\n res[STYLE_KEY[style2Upper(k)]] = Array.isArray(v) ? v : [v];\n }\n });\n GEOM_KEY_SET.forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[k] = style[k];\n }\n });\n return res;\n}\n\n/**\n * 第一次和REFLOW等级下,刷新前首先执行,生成computedStyle\n * 影响文字测量的只有字体和大小和重量,需要提前处理\n * 继承相关的计算\n * @param node 对象节点\n * @param isRoot 是否是根节点,无继承需使用默认值\n */\nfunction computeMeasure(node, isRoot) {\n let { currentStyle, computedStyle, domParent } = node;\n let parentComputedStyle = !isRoot && domParent.computedStyle;\n MEASURE_KEY_SET.forEach(k => {\n let v = currentStyle[k];\n // ff特殊处理\n if(k === FONT_FAMILY) {\n if(v[1] === INHERIT) {\n computedStyle[k] = getFontFamily(isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k]);\n }\n else {\n computedStyle[k] = getFontFamily(v[0]);\n }\n }\n else if(v[1] === INHERIT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k];\n }\n // 只有fontSize会有%\n else if(v[1] === PERCENT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (parentComputedStyle[k] * v[0] * 0.01);\n }\n else if(v[1] === REM) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.computedStyle[FONT_SIZE] * v[0]);\n }\n else if(v[1] === VW) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.width * 0.01 * v[0]);\n }\n else if(v[1] === VH) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.height * 0.01 * v[0]);\n }\n else {\n computedStyle[k] = v[0];\n }\n });\n}\n\n/**\n * 每次布局前需要计算的reflow相关的computedStyle\n * @param node 对象节点\n * @param isHost 是否是根节点或组件节点这种局部根节点,无继承需使用默认值\n */\nfunction computeReflow(node, isHost) {\n let { currentStyle, computedStyle, domParent: parent, root } = node;\n let rem = root.computedStyle[FONT_SIZE];\n let isRoot = !parent;\n let parentComputedStyle = parent && parent.computedStyle;\n [\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n ].forEach(k => {\n // border-width不支持百分比\n let item = currentStyle[k];\n if(item[1] === PX) {\n computedStyle[k] = item[0];\n }\n else if(item[1] === REM) {\n computedStyle[k] = item[0] * rem;\n }\n else if(item[1] === VW) {\n computedStyle[k] = item[0] * root.width * 0.01;\n }\n else if(item[1] === VH) {\n computedStyle[k] = item[0] * root.height * 0.01;\n }\n else {\n computedStyle[k] = 0;\n }\n });\n [\n POSITION,\n DISPLAY,\n FLEX_DIRECTION,\n JUSTIFY_CONTENT,\n ALIGN_ITEMS,\n ALIGN_SELF,\n FLEX_GROW,\n FLEX_SHRINK,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n let textAlign = currentStyle[TEXT_ALIGN];\n if(textAlign[1] === INHERIT) {\n computedStyle[TEXT_ALIGN] = isRoot ? 'left' : parentComputedStyle[TEXT_ALIGN];\n }\n else {\n computedStyle[TEXT_ALIGN] = textAlign[0];\n }\n let fontSize = computedStyle[FONT_SIZE];\n let lineHeight = currentStyle[LINE_HEIGHT];\n // lineHeight继承很特殊,数字和normal不同于普通单位\n if(lineHeight[1] === INHERIT) {\n if(isRoot) {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n else {\n let p = parent;\n let ph;\n while(p) {\n ph = p.currentStyle[LINE_HEIGHT];\n if(ph[1] !== INHERIT) {\n break;\n }\n p = p.domParent;\n }\n // 到root还是inherit或normal,或者中途遇到了normal,使用normal\n if([AUTO, INHERIT].indexOf(ph[1]) > -1) {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n // 数字继承\n else if(ph[1] === NUMBER) {\n computedStyle[LINE_HEIGHT] = Math.max(ph[0], 0) * fontSize;\n }\n // 单位继承\n else {\n computedStyle[LINE_HEIGHT] = parentComputedStyle[LINE_HEIGHT];\n }\n }\n }\n // 防止为0\n else if(lineHeight[1] === PX) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === PERCENT) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * fontSize * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === REM) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * rem, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VW) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.width * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VH) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.height * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === NUMBER) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) * fontSize || calNormalLineHeight(computedStyle);\n }\n // normal或auto\n else {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n let letterSpacing = currentStyle[LETTER_SPACING];\n if(letterSpacing[1] === INHERIT) {\n computedStyle[LETTER_SPACING] = isRoot ? 0 : parentComputedStyle[LETTER_SPACING];\n }\n else if(letterSpacing[1] === PERCENT) {\n computedStyle[LETTER_SPACING] = fontSize * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === REM) {\n computedStyle[LETTER_SPACING] = rem * letterSpacing[0];\n }\n else if(letterSpacing[1] === VW) {\n computedStyle[LETTER_SPACING] = root.width * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === VH) {\n computedStyle[LETTER_SPACING] = root.height * 0.01 * letterSpacing[0];\n }\n else {\n computedStyle[LETTER_SPACING] = letterSpacing[0];\n }\n //whiteSpace\n let whiteSpace = currentStyle[WHITE_SPACE];\n if(whiteSpace[1] === INHERIT) {\n computedStyle[WHITE_SPACE] = isRoot ? 'normal' : parentComputedStyle[WHITE_SPACE];\n }\n else {\n computedStyle[WHITE_SPACE] = whiteSpace[0];\n }\n}\n\nfunction setFontStyle(style) {\n let fontSize = style[FONT_SIZE];\n return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' '\n + fontSize + 'px/' + fontSize + 'px ' + (style[FONT_FAMILY] || 'arial');\n}\n\nfunction getFontFamily(str) {\n let ff = str.split(',');\n let f = 'arial';\n for(let i = 0, len = ff.length; i < len; i++) {\n if(font.support(ff[i])) {\n f = ff[i];\n break;\n }\n }\n return f;\n}\n\nfunction getBaseLine(style) {\n let fontSize = style[FONT_SIZE];\n let ff = getFontFamily(style[FONT_FAMILY]);\n let normal = fontSize * (font.info[ff] || font.info.arial).lhr;\n return (style[LINE_HEIGHT] - normal) * 0.5 + fontSize * (font.info[ff] || font.info.arial).blr;\n}\n\nfunction calNormalLineHeight(style) {\n let ff = getFontFamily(style[FONT_FAMILY]);\n return style[FONT_SIZE] * (font.info[ff] || font.info.arial).lhr;\n}\n\nfunction calRelativePercent(n, parent, k) {\n n *= 0.01;\n while(parent) {\n let style = parent.currentStyle[k];\n if(style[1] === AUTO) {\n if(k === WIDTH) {\n parent = parent.domParent;\n }\n else {\n break;\n }\n }\n else if(style[1] === PX) {\n return n * style[0];\n }\n else if(style[1] === PERCENT) {\n n *= style[0] * 0.01;\n parent = parent.domParent;\n }\n else if(style[1] === REM) {\n return n * style[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(style[1] === VW) {\n return n * style[0] * parent.root.width * 0.01;\n }\n else if(style[1] === VH) {\n return n * style[0] * parent.root.height * 0.01;\n }\n }\n return n;\n}\n\nfunction calRelative(currentStyle, k, v, parent, isWidth) {\n if(v[1] === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER].indexOf(v[1]) > -1) {\n v = v[0];\n }\n else if(v[1] === PERCENT) {\n if(isWidth) {\n v = calRelativePercent(v[0], parent, WIDTH);\n }\n else {\n v = calRelativePercent(v[0], parent, HEIGHT);\n }\n }\n else if(v[1] === REM) {\n v = v[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * parent.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * parent.root.height * 0.01;\n }\n return v;\n}\n\nfunction calAbsolute(currentStyle, k, v, size, root) {\n if(v[1] === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER, DEG, RGBA, STRING].indexOf(v[1]) > -1) {\n v = v[0];\n }\n else if(v[1] === PERCENT) {\n v = v[0] * size * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * root.height * 0.01;\n }\n return v;\n}\n\nfunction equalStyle(k, a, b, target) {\n if(!a || !b) {\n return a === b;\n }\n if(k === TRANSFORM) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let oa = a[i];\n let ob = b[i];\n if(oa[0] !== ob[0]) {\n return false;\n }\n // translate/matrix等都是数组\n if(!equalArr(oa[1], ob[1])) {\n return false;\n }\n }\n return true;\n }\n if(k === FILTER) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equalArr(a[i], b[i])) {\n return false;\n }\n }\n }\n if(k === BACKGROUND_SIZE) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let aa = a[i], bb = b[i];\n if(aa[0][0] !== bb[0][0] || aa[0][1] !== bb[0][1] || aa[1][0] !== bb[1][0] || aa[1][1] !== bb[1][1]) {\n return false;\n }\n }\n return true;\n }\n if(k === TRANSFORM_ORIGIN || RADIUS_HASH.hasOwnProperty(k)) {\n return a[0][0] === b[0][0] && a[0][1] === b[0][1]\n && a[1][0] === b[1][0] && a[1][1] === b[1][1];\n }\n if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y\n || LENGTH_HASH.hasOwnProperty(k) || EXPAND_HASH.hasOwnProperty(k)) {\n return a[0] === b[0] && a[1] === b[1];\n }\n if(k === BOX_SHADOW) {\n return equalArr(a, b);\n }\n if(COLOR_HASH.hasOwnProperty(k)) {\n return a[1] === b[1] && equalArr(a[0], b[0]);\n }\n if(GRADIENT_HASH.hasOwnProperty(k) && a.k === b.k && GRADIENT_TYPE.hasOwnProperty(a.k)) {\n let av = a.v;\n let bv = b.v;\n if(a.d !== b.d || av.length !== bv.length) {\n return false;\n }\n for(let i = 0, len = av.length; i < len; i++) {\n let ai = av[i];\n let bi = bv[i];\n if(ai.length !== bi.length) {\n return false;\n }\n for(let j = 0; j < 4; j++) {\n if(ai[0][j] !== bi[0][j]) {\n return false;\n }\n }\n if(ai.length > 1) {\n if(ai[1][0] !== bi[1][0] || ai[1][1] !== bi[1][1]) {\n return false;\n }\n }\n }\n return true;\n }\n // multi都是纯值数组,equalArr本身即递归,非multi根据类型判断\n if(isGeom(target.tagName, k) && (target.isMulti || Array.isArray(a) && Array.isArray(b))) {\n return equalArr(a, b);\n }\n return a === b;\n}\n\nfunction isRelativeOrAbsolute(node) {\n let position = node.currentStyle[POSITION];\n return position === 'relative' || position === 'absolute';\n}\n\nconst VALUE = {\n [POSITION]: true,\n [DISPLAY]: true,\n [STYLE_KEY.BACKGROUND_REPEAT]: true,\n [FLEX_DIRECTION]: true,\n [FLEX_GROW]: true,\n [FLEX_SHRINK]: true,\n [FLEX_WRAP]: true,\n [JUSTIFY_CONTENT]: true,\n [ALIGN_ITEMS]: true,\n [ALIGN_SELF]: true,\n [STYLE_KEY.OVERFLOW]: true,\n [STYLE_KEY.MIX_BLEND_MODE]: true,\n [STYLE_KEY.STROKE_LINECAP]: true,\n [STYLE_KEY.STROKE_LINEJOIN]: true,\n [STYLE_KEY.STROKE_MITERLIMIT]: true,\n [STYLE_KEY.FILL_RULE]: true,\n [OPACITY]: true,\n [Z_INDEX]: true,\n [BACKGROUND_CLIP]: true,\n [TEXT_OVERFLOW]: true,\n [LINE_CLAMP]: true,\n};\n// 仅1维数组\nconst ARRAY_0 = {\n [COLOR]: true,\n [TEXT_STROKE_COLOR]: true,\n [BACKGROUND_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_COLOR]: true,\n [STYLE_KEY.BORDER_RIGHT_COLOR]: true,\n [STYLE_KEY.BORDER_BOTTOM_COLOR]: true,\n [STYLE_KEY.BORDER_LEFT_COLOR]: true,\n};\n// 仅2维数组且只有2个值\nconst ARRAY_0_1 = {\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS]: true,\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS]: true,\n [TRANSFORM_ORIGIN]: true,\n [PERSPECTIVE_ORIGIN]: true,\n};\nfunction cloneStyle(style, keys) {\n if(!keys) {\n keys = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n }\n let res = {};\n for(let i = 0, len = keys.length; i < len; i++) {\n let k = keys[i];\n let v = style[k];\n // 渐变特殊处理\n if(k === BACKGROUND_IMAGE) {\n res[k] = v.map(item => {\n // 可能为null\n if(item && item.k) {\n return util.clone(item);\n }\n else {\n return item;\n }\n });\n }\n else if(k === FILL || k === STROKE) {\n res[k] = v.map(item => {\n // 渐变\n // 可能非法为空\n if(item && item.k) {\n return util.clone(item);\n }\n // 颜色\n else {\n return item.slice(0);\n }\n });\n }\n else if(k === TRANSFORM || k === FILTER) {\n if(v) {\n let n = v.slice(0);\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n n[i][1] = n[i][1].slice(0);\n }\n res[k] = n;\n }\n }\n else if(k === BOX_SHADOW) {\n if(v) {\n v = v.map(item => {\n let n = item.slice(0);\n n[4] = n[4].slice(0);\n return n;\n });\n res[k] = v;\n }\n }\n else if(k === TRANSLATE_PATH) {\n if(v) {\n res[k] = v.map(item => item.slice(0));\n }\n }\n // position等直接值类型赋值\n else if(VALUE.hasOwnProperty(k)) {\n res[k] = v;\n }\n // geom自定义属性\n else if(GEOM.hasOwnProperty(k)) {\n res[k] = util.clone(v);\n }\n // 其余皆是数组或空,默认是一维数组只需slice即可\n else if(v) {\n let n = res[k] = v.slice(0);\n // 特殊引用里数组某项再次clone\n if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n }\n }\n else if(k === BACKGROUND_SIZE) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n n[i][0] = n[i][0].slice(0);\n n[i][1] = n[i][1].slice(0);\n }\n }\n else if(ARRAY_0.hasOwnProperty(k)) {\n n[0] = n[0].slice(0);\n }\n else if(ARRAY_0_1.hasOwnProperty(k)) {\n n[0] = n[0].slice(0);\n n[1] = n[1].slice(0);\n }\n else if(k === TRANSFORM) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n }\n }\n else if(k === ROTATE_3D) {\n n[3] = n[3].slice(0);\n }\n }\n }\n return res;\n}\n\nexport default {\n normalize,\n computeMeasure,\n computeReflow,\n setFontStyle,\n getFontFamily,\n getBaseLine,\n calRelative,\n calAbsolute,\n equalStyle,\n isRelativeOrAbsolute,\n cloneStyle,\n};\n","import mode from './mode';\nimport css from '../style/css';\nimport enums from '../util/enums';\nimport util from '../util/util';\n\nconst { STYLE_KEY: {\n COLOR,\n FONT_WEIGHT,\n FONT_FAMILY,\n FONT_SIZE,\n FONT_STYLE,\n LETTER_SPACING,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_WIDTH,\n TEXT_STROKE_OVER,\n} } = enums;\n\n/**\n * 表示一行文本的类,保存它的位置、内容、从属信息,在布局阶段生成,并在渲染阶段被Text调用render()\n * 关系上直属于Text类,一个Text类可能因为换行原因导致有多个TextBox,一行内容中也可能有不同Text从而不同TextBox\n * 另外本类还会被LineBoxManager添加到LineBox里,LineBox为一行中的inline/文本组合,之间需要进行垂直对齐\n * 在textOverflow为ellipsis时,可能会收到后面节点的向前回退(后面不足放下…),使得省略号发生在本节点\n */\nclass TextBox {\n constructor(parent, index, x, y, w, h, content, wList) {\n this.__parent = parent;\n this.__index = index;\n this.__x = x;\n this.__y = y;\n this.__width = w;\n this.__height = h;\n this.__content = content;\n this.__wList = wList;\n this.__virtualDom = {};\n }\n\n /**\n * 渲染阶段被Text类调用,多行Text会有多个TextBox,内容被分拆开\n * @param renderMode\n * @param ctx\n * @param computedStyle\n * @param cacheStyle Text父节点Dom的缓存样式,相比computedStyle可以直接用,比如color被缓存为style字符串\n * @param dx\n * @param dy\n */\n render(renderMode, ctx, computedStyle, cacheStyle, dx, dy) {\n let { content, x, y, parent, wList, width } = this;\n let { ox, oy } = parent;\n y += css.getBaseLine(computedStyle);\n x += ox + dx;\n y += oy + dy;\n this.__endX = x + width;\n this.__endY = y;\n let {\n [LETTER_SPACING]: letterSpacing,\n [TEXT_STROKE_WIDTH]: textStrokeWidth,\n [TEXT_STROKE_COLOR]: textStrokeColor,\n } = computedStyle;\n let i = 0, length = content.length;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n let overFill = computedStyle[TEXT_STROKE_OVER] === 'fill';\n if(letterSpacing) {\n for(; i < length; i++) {\n if(overFill) {\n ctx.fillText(content.charAt(i), x, y);\n }\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n ctx.strokeText(content.charAt(i), x, y);\n }\n if(!overFill) {\n ctx.fillText(content.charAt(i), x, y);\n }\n x += wList[i] + letterSpacing;\n }\n }\n else {\n if(overFill) {\n ctx.fillText(content, x, y);\n }\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n ctx.strokeText(content, x, y);\n }\n if(!overFill) {\n ctx.fillText(content, x, y);\n }\n }\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['x', x],\n ['y', y],\n ['fill', cacheStyle[COLOR]],\n ['font-family', computedStyle[FONT_FAMILY]],\n ['font-weight', computedStyle[FONT_WEIGHT]],\n ['font-style', computedStyle[FONT_STYLE]],\n ['font-size', computedStyle[FONT_SIZE] + 'px'],\n ];\n // svg无法定义stroke的over\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n props.push(['stroke', cacheStyle[TEXT_STROKE_COLOR]]);\n props.push(['stroke-width', computedStyle[TEXT_STROKE_WIDTH]]);\n }\n if(letterSpacing) {\n props.push(['letter-spacing', letterSpacing]);\n }\n this.__virtualDom = {\n type: 'item',\n tagName: 'text',\n props,\n content: util.encodeHtml(content),\n };\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endX() {\n return this.__endX;\n }\n\n get endY() {\n return this.__endY;\n }\n\n get width() {\n return this.__width;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get content() {\n return this.__content;\n }\n\n get baseLine() {\n return this.parent.baseLine;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get parentLineBox() {\n return this.__parentLineBox;\n }\n\n get wList() {\n return this.__wList;\n }\n}\n\nexport default TextBox;\n","import inject from '../util/inject';\n\nlet SIZE = [8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192];\nlet NUMBER = [128, 64, 32, 16, 8, 4, 2, 1, 1, 1, 1];\nlet MAX = SIZE[SIZE.length - 1];\nconst HASH_CANVAS = {};\n\nlet uuid = 0;\n\nclass Page {\n constructor(size, number) {\n this.__size = size;\n this.__number = number;\n this.__free = this.__total = number * number;\n size *= number;\n this.__width = size;\n this.__height = size;\n let offscreen = this.__canvas = inject.getCacheCanvas(size, size, null, number);\n if(offscreen) {\n this.__offscreen = offscreen;\n }\n // 1/0标识n*n个单元格是否空闲可用,一维数组表示\n this.__grid = [];\n for(let i = 0; i < this.__total; i++) {\n this.__grid.push(1);\n }\n this.__uuid = uuid++;\n // webgl贴图缓存使用,一旦更新则标识记录,绑定某号纹理单元查看变化才更新贴图\n this.__update = false;\n this.time = 0;\n }\n\n add() {\n let { number, grid } = this;\n for(let i = 0; i < number; i++) {\n for(let j = 0; j < number; j++) {\n let index = i * number + j;\n if(grid[index]) {\n grid[index] = 0;\n this.__free--;\n return index;\n }\n }\n }\n // 理论不可能进入,除非bug\n throw new Error('Can not find free page');\n }\n\n del(pos) {\n if(!this.grid[pos]) {\n this.grid[pos] = 1;\n this.__free++;\n }\n }\n\n getCoords(pos) {\n let { size, number } = this;\n let x = pos % number;\n let y = Math.floor(pos / number);\n return [x * size, y * size];\n }\n\n get uuid() {\n return this.__uuid;\n }\n\n get size() {\n return this.__size;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get number() {\n return this.__number;\n }\n\n get total() {\n return this.__total;\n }\n\n get free() {\n return this.__free;\n }\n\n get grid() {\n return this.__grid;\n }\n\n get offscreen() {\n return this.__offscreen;\n }\n\n get canvas() {\n return this.offscreen.canvas;\n }\n\n get ctx() {\n return this.offscreen.ctx;\n }\n\n get update() {\n return this.__update;\n }\n\n set update(v) {\n this.__update = v;\n }\n\n static getInstance(size) {\n if(size > MAX) {\n return;\n }\n let s = SIZE[0];\n let n = NUMBER[0];\n // 使用刚好满足的尺寸\n for(let i = 0, len = SIZE.length; i < len; i++) {\n s = SIZE[i];\n n = NUMBER[i];\n if(SIZE[i] >= size) {\n break;\n }\n }\n let list = HASH_CANVAS[s] = HASH_CANVAS[s] || [];\n // 从hash列表中尝试取可用的一页,找不到就生成新的页\n let page;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item.free) {\n page = item;\n break;\n }\n }\n if(!page) {\n page = new Page(s, n);\n if(!page.offscreen) {\n inject.error('Can not create off-screen for page');\n return;\n }\n list.push(page);\n }\n let pos = page.add();\n return { page, pos };\n }\n\n static set CONFIG(v) {\n if(!v || !Array.isArray(v.SIZE) || !Array.isArray(v.NUMBER)) {\n return;\n }\n SIZE = v.SIZE;\n NUMBER = v.NUMBER;\n MAX = SIZE[SIZE.length - 1];\n }\n\n static get CONFIG() {\n return {\n SIZE,\n NUMBER,\n };\n }\n\n static get MAX() {\n return MAX;\n }\n\n static genUuid() {\n return uuid++;\n }\n}\n\nexport default Page;\n","import matrix from './matrix';\nimport geom from './geom';\n\n// 一条边相对于自己开始点的x向量角度,即从x到此边旋转,0~180和-180~0,需要判断象限\nfunction calDeg(x1, y1, x2, y2) {\n let dx = x2 - x1;\n let dy = y2 - y1;\n let atan = Math.atan(Math.abs(dy) / Math.abs(dx));\n // 2象限\n if(dx < 0 && dy >= 0) {\n return Math.PI - atan;\n }\n // 3象限\n if(dx < 0 && dy < 0) {\n return atan - Math.PI;\n }\n // 1象限\n if(dx >= 0 && dy >= 0) {\n return atan;\n }\n // 4象限,顺时针正好\n return -atan;\n}\n\nfunction rotate(theta) {\n let sin = Math.sin(theta);\n let cos = Math.cos(theta);\n let t = matrix.identity();\n t[0] = t[5] = cos;\n t[1] = sin;\n t[4] = -sin;\n return t;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param points\n */\nfunction pointIndex(points) {\n let [x1, y1, x2, y2, x3, y3] = points;\n let index = [0, 1, 2];\n // 将a点放入最左\n if(x2 < x1 && x2 < x3) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n index[0] = 1;\n index[1] = 0;\n }\n else if(x3 < x2 && x3 < x1) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n index[0] = 2;\n index[2] = 0;\n }\n // 有可能出现2个并列的情况,判断取上面那个\n if(x1 === x2) {\n if(y1 > y2) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n let t = index[0];\n index[0] = index[1];\n index[1] = t;\n }\n }\n else if(x1 === x3) {\n if(y1 > y3) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n let t = index[0];\n index[0] = index[2];\n index[2] = t;\n }\n }\n // ab到ac要顺时针旋转,即2个向量夹角为正,用向量叉乘判断正负\n let cross = (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1);\n if(cross < 0) {\n [x2, y2, x3, y3] = [x3, y3, x2, y2];\n let t = index[1];\n index[1] = index[2];\n index[2] = t;\n }\n return [x1, y1, x2, y2, x3, y3, index];\n}\n\n/**\n * 第2个点根据第一个点的交换顺序交换\n * @param points\n * @param index\n * @returns {[]}\n */\nfunction pointByIndex(points, index) {\n let res = [];\n for(let i = 0, len = index.length; i < len; i++) {\n let j = index[i];\n res.push(points[j * 2]);\n res.push(points[j * 2 + 1]);\n }\n return res;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param source 源3个点\n * @param target 目标3个点\n * @returns 交换顺序后的点坐标\n */\nfunction exchangeOrder(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3, index] = pointIndex(source);\n let [tx1, ty1, tx2, ty2, tx3, ty3] = pointByIndex(target, index);\n return [\n [sx1, sy1, sx2, sy2, sx3, sy3],\n [tx1, ty1, tx2, ty2, tx3, ty3]\n ];\n}\n\n/**\n * 存在一种情况,变换结果使得三角形镜像相反了,即顶点a越过bc线,判断是否溢出\n * @param source\n * @param target\n * @returns {boolean}是否溢出\n */\nfunction isOverflow(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n let cross1 = (sx2 - sx1) * (sy3 - sy1) - (sx3 - sx1) * (sy2 - sy1);\n let cross2 = (tx2 - tx1) * (ty3 - ty1) - (tx3 - tx1) * (ty2 - ty1);\n return cross1 > 0 && cross2 < 0 || cross1 < 0 && cross2 > 0;\n}\n\nfunction transform(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n // 记录翻转\n let overflow = isOverflow(source, target);\n // 第0步,将源三角第1个a点移到原点\n let m = matrix.identity();\n m[12] = -sx1;\n m[13] = -sy1;\n let t;\n // 第1步,以第1条边ab为基准,将其贴合x轴上,为后续倾斜不干扰做准备\n let theta = calDeg(sx1, sy1, sx2, sy2);\n if(theta !== 0) {\n t = rotate(-theta);\n m = matrix.multiply(t, m);\n }\n // 第2步,以第1条边AB为基准,缩放x轴ab至目标相同长度,可与4步合并\n let ls = geom.pointsDistance(sx1, sy1, sx2, sy2);\n let lt = geom.pointsDistance(tx1, ty1, tx2, ty2);\n // if(ls !== lt) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[0] = scale;\n // m = matrix.multiply(t, m);\n // }\n // 第3步,缩放y,先将目标三角形旋转到x轴平行,再变换坐标计算\n let n = matrix.identity();\n n[12] = -tx1;\n n[13] = -ty1;\n theta = calDeg(tx1, ty1, tx2, ty2);\n // 记录下这个旋转角度,后面源三角形要反向旋转\n let alpha = theta;\n if(theta !== 0) {\n t = rotate(-theta);\n n = matrix.multiply(t, n);\n }\n // 目标三角反向旋转至x轴后的坐标\n // 源三角目前的第3点坐标y值即为长度,因为a点在原点0无需减去\n let ls2 = Math.abs(matrix.calPoint([sx3, sy3], m)[1]);\n let lt2 = Math.abs(matrix.calPoint([tx3, ty3], n)[1]);\n // 缩放y\n // if(ls2 !== lt2) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[3] = scale;\n // m = matrix.multiply(t, m);\n // }\n if(ls !== lt || ls2 !== lt2) {\n t = matrix.identity();\n if(ls !== lt) {\n t[0] = lt / ls;\n }\n if(ls2 !== lt2) {\n t[5] = lt2 / ls2;\n }\n m = matrix.multiply(t, m);\n }\n // 第4步,x轴倾斜,用余弦定理求目前a和A的夹角\n n = m;\n let [ax1, ay1] = matrix.calPoint([sx1, sy1], n);\n let [ax2, ay2] = matrix.calPoint([sx2, sy2], n);\n let [ax3, ay3] = matrix.calPoint([sx3, sy3], n);\n let ab = geom.pointsDistance(ax1, ay1, ax2, ay2);\n let ac = geom.pointsDistance(ax1, ay1, ax3, ay3);\n let bc = geom.pointsDistance(ax3, ay3, ax2, ay2);\n let AB = geom.pointsDistance(tx1, ty1, tx2, ty2);\n let AC = geom.pointsDistance(tx1, ty1, tx3, ty3);\n let BC = geom.pointsDistance(tx3, ty3, tx2, ty2);\n let a = geom.angleBySide(bc, ab, ac);\n let A = geom.angleBySide(BC, AB, AC);\n // 先至90°,再旋转至目标角,可以合并成tan相加,不知道为什么不能直接tan倾斜差值角度\n if(a !== A) {\n t = matrix.identity();\n t[4] = Math.tan(a - Math.PI * 0.5) + Math.tan(Math.PI * 0.5 - A);\n m = matrix.multiply(t, m);\n }\n // 发生翻转时特殊处理按x轴垂直翻转\n if(overflow) {\n m[1] = -m[1];\n m[5] = -m[5];\n m[13] = -m[13];\n }\n // 第5步,再次旋转,角度为目标旋转到x轴的负值,可与下步合并\n if(alpha !== 0) {\n t = rotate(alpha);\n // m = matrix.multiply(t, m);\n }\n else {\n t = matrix.identity();\n }\n // 第6步,移动第一个点的差值\n // t = matrix.identity();\n t[12] = tx1;\n t[13] = ty1;\n return matrix.multiply(t, m);\n}\n\nexport default {\n exchangeOrder,\n isOverflow,\n transform,\n};\n","/**\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 } = unit;\nconst { matrix, geom } = math;\nconst { identity, multiply, isE } = matrix;\nconst { d2r } = geom;\n\nfunction calSingle(t, k, v) {\n if(k === TRANSLATE_X) {\n t[12] = v;\n }\n else if(k === TRANSLATE_Y) {\n t[13] = v;\n }\n else if(k === TRANSLATE_Z) {\n t[14] = v;\n }\n else if(k === SCALE_X) {\n t[0] = v;\n }\n else if(k === SCALE_Y) {\n t[5] = v;\n }\n else if(k === SCALE_Z) {\n t[10] = v;\n }\n else if(k === SKEW_X) {\n v = d2r(v);\n t[4] = Math.tan(v);\n }\n else if(k === SKEW_Y) {\n v = d2r(v);\n t[1] = Math.tan(v);\n }\n else if(k === ROTATE_X) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[5] = t[10] = cos;\n t[6] = sin;\n t[9] = -sin;\n }\n else if(k === ROTATE_Y) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[10] = cos;\n t[8] = sin;\n t[2] = -sin;\n }\n else if(k === ROTATE_Z) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[5] = cos;\n t[1] = sin;\n t[4] = -sin;\n }\n else if(k === ROTATE_3D) {\n let [x, y, z, r] = v;\n r = d2r(r[0]);\n let s = Math.sin(r);\n let c = Math.cos(r);\n if(x && !y && !z) {\n if(x < 0) {\n s = -s;\n }\n t[5] = c;\n t[9] = -s;\n t[6] = s;\n t[10] = c;\n }\n else if(y && !x && !z) {\n if(y < 0) {\n s = -s;\n }\n t[0] = c;\n t[8] = s;\n t[2] = -s;\n t[10] = c;\n }\n else if(z && !x && !y) {\n if(z < 0) {\n s = -s;\n }\n t[0] = c;\n t[4] = -s;\n t[1] = s;\n t[5] = c;\n }\n else {\n let len = Math.sqrt(x * x + y * y + z * z);\n if(len !== 1) {\n let rlen = 1 / len;\n x *= rlen;\n y *= rlen;\n z *= rlen;\n }\n let nc = 1 - c;\n let xy = x * y;\n let yz = y * z;\n let zx = z * x;\n let xs = x * s;\n let ys = y * s;\n let zs = z * s;\n\n t[0] = x * x * nc + c;\n t[1] = xy * nc + zs;\n t[2] = zx * nc - ys;\n t[3] = 0;\n\n t[4] = xy * nc - zs;\n t[5] = y * y * nc + c;\n t[6] = yz * nc + xs;\n t[7] = 0;\n\n t[8] = zx * nc + ys;\n t[9] = yz * nc - xs;\n t[10] = z * z * nc + c;\n t[11] = 0;\n\n t[12] = 0;\n t[13] = 0;\n t[14] = 0;\n t[15] = 1;\n }\n }\n else if(k === PERSPECTIVE && v > 0) {\n v = Math.max(v, 1);\n t[11] = -1 / v;\n }\n else if(k === MATRIX) {\n util.assignMatrix(t, v);\n }\n}\n\nfunction calMatrix(transform, ow, oh, root) {\n let list = normalize(transform, ow, oh, root);\n let m = identity();\n list.forEach(item => {\n let [k, v] = item;\n let t = identity();\n calSingle(t, k, v);\n m = multiply(m, t);\n });\n return m;\n}\n\n// 已有计算好的变换矩阵,根据tfo原点计算最终的matrix\nfunction calMatrixByOrigin(m, transformOrigin) {\n let [ox, oy] = transformOrigin;\n let res = m.slice(0);\n if(ox === 0 && oy === 0 || isE(m)) {\n return res;\n }\n res = multiply([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ox, oy, 0, 1], res);\n res = multiply(res, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -ox, -oy, 0, 1]);\n return res;\n}\n\n// img缩放svg下专用,无rem\nfunction calMatrixWithOrigin(transform, transformOrigin, ow, oh) {\n let m = calMatrix(transform, ow, oh);\n return calMatrixByOrigin(m, transformOrigin);\n}\n\nfunction normalizeSingle(k, v, ow, oh, root) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n if(v[1] === PERCENT) {\n return v[0] * ow * 0.01;\n }\n else if(v[1] === REM) {\n return v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n return v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n return v[0] * root.height * 0.01;\n }\n }\n else if(k === TRANSLATE_Y) {\n if(v[1] === PERCENT) {\n return v[0] * oh * 0.01;\n }\n else if(v[1] === REM) {\n return v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n return v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n return v[0] * root.height * 0.01;\n }\n }\n else if(k === MATRIX) {\n return v;\n }\n else if(k === ROTATE_3D) {\n return v;\n }\n return v[0];\n}\n\nfunction normalize(transform, ow, oh, root) {\n let res = [];\n transform.forEach(item => {\n let [k, v] = item;\n res.push([k, normalizeSingle(k, v, ow, oh, root)]);\n });\n return res;\n}\n\nfunction calOrigin(transformOrigin, w, h, root) {\n let tfo = [];\n transformOrigin.forEach((item, i) => {\n if(item[1] === PX) {\n tfo.push(item[0]);\n }\n else if(item[1] === PERCENT) {\n tfo.push(item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n tfo.push(item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n tfo.push(item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n tfo.push(item[0] * root.height * 0.01);\n }\n });\n return tfo;\n}\n\nfunction calMatrixByPerspective(m, pm) {\n if(!isE(pm)) {\n m = multiply(pm, m);\n }\n return m;\n}\n\nfunction calPerspectiveMatrix(ppt, po) {\n if(ppt && ppt > 0) {\n let res = identity();\n ppt = Math.max(ppt, 1);\n res[11] = -1 / ppt;\n let [ox, oy] = po;\n if(ox || oy) {\n res = multiply([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ox, oy, 0, 1], res);\n res = multiply(res, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -ox, -oy, 0, 1]);\n }\n return res;\n }\n}\n\n// 是否有透视矩阵应用\nfunction isPerspectiveMatrix(m) {\n if(!m) {\n return;\n }\n return !!(m[3] || m[7] || m[11]);\n}\n\nexport default {\n calMatrix,\n calOrigin,\n calMatrixByPerspective,\n calPerspectiveMatrix,\n calMatrixByOrigin,\n calMatrixWithOrigin,\n isPerspectiveMatrix,\n};\n","/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据模糊参数sigma求卷积核尺寸\n * @param sigma\n * @returns {number}\n */\nfunction kernelSize(sigma) {\n if(sigma <= 0) {\n return 0;\n }\n let d = Math.floor(sigma * 3 * Math.sqrt(2 * Math.PI) / 4 + 0.5);\n if(d < 2) {\n d = 2;\n }\n if(d % 2 === 0) {\n d++;\n }\n return d;\n}\n\n/**\n * 根据sigma求模糊扩展尺寸,卷积核求得后为d,再求半径/2,然后因为算法要执行3次,所以*3\n * 比如本来d为5,半径2.5算上自身像素点则各方向扩展2,*3则扩展6\n * @param sigma\n * @returns {number}\n */\nfunction outerSize(sigma) {\n let d = kernelSize(sigma);\n return outerSizeByD(d);\n}\n\nfunction outerSizeByD(d) {\n return Math.floor(d * 0.5) * 3;\n}\n\n/**\n * 一维高斯正态分布,根据标准差和卷积核尺寸返回一维权重数组\n * @param sigma\n * @param d\n */\nfunction gaussianWeight(sigma, d) {\n let list = [];\n let len = Math.floor(d * 0.5);\n let total = 0;\n for(let i = len; i >= 0; i--) {\n let n = Math.pow(Math.E, -Math.pow(i, 2) / (2 * Math.pow(sigma, 2)))\n / (sigma * Math.sqrt(2 * Math.PI));\n list.push(n);\n total += n;\n }\n for(let i = 1; i <= len; i++) {\n let n = Math.pow(Math.E, -Math.pow(i, 2) / (2 * Math.pow(sigma, 2)))\n / (sigma * Math.sqrt(2 * Math.PI));\n list.push(n);\n total += n;\n }\n if(total !== 1) {\n for(let i = 0; i < d; i++) {\n list[i] /= total;\n }\n }\n return list;\n}\n\nexport default {\n kernelSize,\n outerSize,\n outerSizeByD,\n gaussianWeight,\n};\n","import Page from './Page';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport enums from '../util/enums';\nimport painter from '../util/painter';\nimport debug from '../util/debug';\nimport tf from '../style/transform';\nimport mx from '../math/matrix';\nimport blur from '../math/blur';\n\nconst {\n STYLE_KEY: {\n TRANSFORM_ORIGIN,\n TRANSFORM,\n DISPLAY,\n VISIBILITY,\n },\n NODE_KEY: {\n NODE_OPACITY,\n NODE_CACHE_TOTAL,\n NODE_CACHE_FILTER,\n NODE_CACHE_OVERFLOW,\n NODE_HAS_CONTENT,\n NODE_COMPUTED_STYLE,\n },\n} = enums;\n\n// 根据一个共享cache的信息,生成一个独立的离屏canvas,一般是filter,mask用\nfunction genSingle(cache, message) {\n let { size, sx1, sy1, width, height, bbox } = cache;\n let offscreen = inject.getCacheCanvas(width, height, null, message);\n offscreen.x = 0;\n offscreen.y = 0;\n offscreen.bbox = bbox;\n offscreen.size = size;\n offscreen.sx1 = sx1;\n offscreen.sy1 = sy1;\n offscreen.dx = cache.dx;\n offscreen.dy = cache.dy;\n offscreen.dbx = cache.dbx;\n offscreen.dby = cache.dby;\n offscreen.width = width;\n offscreen.height = height;\n return offscreen;\n}\n\nclass Cache {\n constructor(w, h, bbox, page, pos, x1, y1) {\n this.__init(w, h, bbox, page, pos, x1, y1);\n }\n\n __init(w, h, bbox, page, pos, x1, y1) {\n this.__width = w;\n this.__height = h;\n this.__bbox = bbox;\n this.__page = page;\n this.__pos = pos;\n let [x, y] = page.getCoords(pos);\n this.__x = x;\n this.__y = y;\n this.__appendData(x1, y1);\n 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 },\n NODE_KEY: {\n NODE_CACHE,\n NODE_LIMIT_CACHE,\n NODE_DOM_PARENT,\n NODE_MATRIX_EVENT,\n NODE_OPACITY,\n NODE_VIRTUAL_DOM,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_MEASURE,\n UPDATE_FOCUS,\n UPDATE_CONFIG,\n },\n} = enums;\n\nconst ELLIPSIS = textCache.ELLIPSIS;\nconst { AUTO, REM, VW, VH } = unit;\n\nclass Text extends Node {\n constructor(content) {\n super();\n this.__content = util.isNil(content) ? '' : content.toString();\n this.__textBoxes = [];\n this.__charWidthList = [];\n this.__charWidth = 0;\n this.__textWidth = 0;\n }\n\n /**\n * 预先计算每个字的宽度,在每次布局渲染前做\n * @param renderMode\n * @param ctx\n * @private\n */\n __computeMeasure(renderMode, ctx) {\n let { content, computedStyle, charWidthList } = this;\n // 每次都要清空重新计算,计算会有缓存\n charWidthList.splice(0);\n let ffs = computedStyle[FONT_FAMILY].split(',');\n let ff = 'arial';\n for(let i = 0, len = ffs.length; i < len; i++) {\n if(inject.checkSupportFontFamily(ffs[i])) {\n ff = ffs[i];\n break;\n }\n }\n this.__ff = ff;\n let fs = computedStyle[FONT_SIZE];\n let fw = computedStyle[FONT_WEIGHT];\n let key = this.__key = computedStyle[FONT_SIZE] + ',' + ff + ',' + fw;\n let wait = textCache.data[key] = textCache.data[key] || {\n ff,\n fs,\n fw,\n hash: {},\n s: '',\n };\n let cache = textCache.charWidth[key] = textCache.charWidth[key] || {};\n let sum = 0;\n let needMeasure = false;\n // text-overflow:ellipse需要,即便没有也要先测量,其基于最近非inline父节点的字体\n let bp = this.domParent;\n while(bp.currentStyle[DISPLAY] === 'inline') {\n bp = bp.domParent;\n }\n this.__bp = bp;\n let parentComputedStyle = bp.computedStyle;\n let pff = 'arial';\n for(let i = 0, pffs = parentComputedStyle[FONT_FAMILY].split(','), len = pffs.length; i < len; i++) {\n if(inject.checkSupportFontFamily(pffs[i])) {\n ff = ffs[i];\n break;\n }\n }\n let pfs = parentComputedStyle[FONT_SIZE];\n let pfw = parentComputedStyle[FONT_WEIGHT];\n let pKey = this.__pKey = pfs + ',' + pff + ',' + pfw;\n let parentCache = textCache.charWidth[pKey] = textCache.charWidth[pKey] || {};\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(renderMode === mode.WEBGL) {\n ctx = inject.getCacheCanvas(16, 16, '__$$CHECK_SUPPORT_FONT_FAMILY$$__').ctx;\n }\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n ctx.font = css.setFontStyle(parentComputedStyle);\n parentCache[ELLIPSIS] = ctx.measureText(ELLIPSIS).width;\n }\n ctx.font = css.setFontStyle(computedStyle);\n }\n else if(renderMode === mode.SVG) {\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n parentCache[ELLIPSIS] = 0;\n let wait = textCache.data[pKey] = textCache.data[pKey] || {\n ff: pff,\n fs: pfs,\n fw: pfw,\n hash: {},\n s: '',\n };\n wait.s += ELLIPSIS;\n needMeasure = true;\n }\n }\n // 逐字测量,canvas可瞬间得到信息,svg先预存统一进行\n for(let i = 0, length = content.length; i < length; i++) {\n let char = content.charAt(i);\n let mw;\n if(cache.hasOwnProperty(char)) {\n mw = cache[char];\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n mw = cache[char] = ctx.measureText(char).width;\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else {\n if(!wait.hash.hasOwnProperty(char)) {\n wait.s += char;\n }\n wait.hash[char] = true;\n // 先预存标识位-1,测量完后替换它\n charWidthList.push(-1);\n needMeasure = true;\n }\n }\n this.__textWidth = sum;\n if(needMeasure) {\n textCache.list.push(this);\n }\n }\n\n __measureCb() {\n let { content, charWidthList } = this;\n let key = this.__key;\n let cache = textCache.charWidth[key];\n let sum = 0;\n for(let i = 0, len = charWidthList.length; i < len; i++) {\n if(charWidthList[i] < 0) {\n let mw = charWidthList[i] = cache[content.charAt(i)];\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n }\n this.__textWidth = sum;\n }\n\n /**\n * text在virtual时和普通一样,无需特殊处理\n * endSpace由外界inline布局控制,末尾最后一行的空白mpb,包含递归情况,递归为多个嵌套末尾节点的空白mpb之和\n * 即便宽度不足,每行还是强制渲染一个字符,换行依据lx开始,因为x可能是从中间开始的,非inline则两个相等\n * 最后一个字符排版时要考虑末尾mpb,排不下的话回退删掉这个字符,如果最后一个字符另起开头,排不下也强制排,每行至少1个字符\n * 在textOverflow时很特殊,多个inline同行,回退可能到前一个inline节点,这个通过x和lx判断是否行首,决定至少1个字符规则\n * @param data\n * @private\n */\n __layout(data) {\n let __cache = this.__config[NODE_CACHE];\n if(__cache) {\n __cache.release();\n }\n let { x, y, w, lx = x, lineBoxManager, endSpace = 0, lineClamp = 0, lineClampCount = 0 } = data;\n this.__x = this.__sx1 = x;\n this.__y = this.__sy1 = y;\n let { isDestroyed, content, currentStyle, computedStyle, textBoxes, charWidthList, root, __ff, __key } = this;\n textBoxes.splice(0);\n let __config = this.__config;\n __config[NODE_LIMIT_CACHE] = false;\n // 空内容w/h都为0可以提前跳出\n if(isDestroyed || currentStyle[DISPLAY] === 'none' || !content) {\n return lineClampCount;\n }\n this.__ox = this.__oy = 0;\n // 顺序尝试分割字符串为TextBox,形成多行,begin为每行起始索引,i是当前字符索引\n let begin = 0;\n let i = 0;\n let beginSpace = x - lx; // x>=lx,当第一行非起始处时前面被prev节点占据,这个差值可认为是count宽度\n let count = beginSpace;\n let length = content.length;\n let maxW = 0;\n let {\n [LINE_HEIGHT]: lineHeight,\n [LETTER_SPACING]: letterSpacing,\n [WHITE_SPACE]: whiteSpace,\n [FONT_SIZE]: fontSize,\n [FONT_WEIGHT]: fontWeight,\n } = computedStyle;\n // 特殊字体中特殊字符连续时需减少一定的padding量\n let padding = font.info[__ff].padding;\n let needReduce = !!padding;\n let lastChar;\n let ew = textCache.charWidth[this.__pKey][ELLIPSIS];\n let lineCount = 0;\n // 不换行特殊对待,同时考虑overflow和textOverflow\n if(whiteSpace === 'nowrap') {\n let isTextOverflow;\n // block的overflow:hidden和textOverflow:clip/ellipsis才生效,inline要看最近非inline父元素\n let bp = this.__bp;\n let {\n [DISPLAY]: display,\n [OVERFLOW]: overflow,\n [WIDTH]: width,\n [TEXT_OVERFLOW]: textOverflow,\n } = bp.currentStyle;\n // 只要是overflow隐藏,不管textOverflow如何(默认是clip等同于overflow:hidden的功能)都截取\n if(overflow === 'hidden') {\n while(i < length) {\n count += charWidthList[i] + letterSpacing;\n if(count > w) {\n // block/flex无需宽度,inline-block需要设置宽度才生效\n if(display === 'block' || display === 'flex') {\n isTextOverflow = true;\n }\n else if(width[1] !== AUTO) {\n isTextOverflow = true;\n }\n break;\n }\n i++;\n }\n }\n else {\n while(i < length) {\n count += charWidthList[i++] + letterSpacing;\n }\n }\n // ellipsis生效情况,本节点开始向前回退查找,尝试放下一部分字符\n if(isTextOverflow && textOverflow === 'ellipsis') {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n }\n // 默认clip跟随overflow:hidden,无需感知\n else {\n let textBox = new TextBox(this, textBoxes.length, x, y, count - beginSpace, lineHeight,\n content, charWidthList);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n maxW = count - beginSpace;\n y += lineHeight;\n }\n }\n // 普通换行,注意x和lx的区别,可能相同(block起始处)可能不同(非起始处),第1行从x开始,第2行及以后都从lx开始\n // 然后第一次换行还有特殊之处,可能同一行前半部行高很大,此时y增加并非自身的lineHeight,而是整体LineBox的\n else {\n while(i < length) {\n let cw = charWidthList[i] + letterSpacing;\n count += cw;\n // 连续字符减少padding,除了连续还需判断char是否在padding的hash中\n if(needReduce) {\n let char = content[i];\n if(char === lastChar && padding.hasOwnProperty(char) && padding[char]) {\n let hasCache, p = textCache.padding[__key] = textCache.padding[__key] || {};\n if(textCache.padding.hasOwnProperty(__key)) {\n if(p.hasOwnProperty(char)) {\n hasCache = true;\n count -= p[char];\n }\n }\n if(!hasCache) {\n let n = 0;\n if(root.renderMode === mode.CANVAS) {\n root.ctx.font = css.setFontStyle(computedStyle);\n let w1 = root.ctx.measureText(char).width;\n let w2 = root.ctx.measureText(char + char).width;\n n = w1 * 2 - w2;\n n *= padding[char];\n }\n else if(root.renderMode === mode.SVG) {\n n = inject.measureTextSync(__key, __ff, fontSize, fontWeight, char);\n n *= padding[char];\n }\n count -= n;\n p[char] = n;\n }\n }\n lastChar = char;\n }\n // 忽略零宽字符\n if(cw === 0) {\n i++;\n continue;\n }\n // 换行都要判断i不是0的时候,第1个字符强制不换行\n if(count === w) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n let textBox;\n // 特殊情况,恰好最后一行最后一个排满,此时查看末尾mpb,要防止i为0的情况首个字符特殊不回退,无需看开头mpb\n if(i === length - 1 && count > w - endSpace && i) {\n count -= charWidthList[i--];\n }\n i++;\n if(!lineCount) {\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, count);\n }\n // 必须先添加再设置y,当有diff的lineHeight时,第一个换行不影响,再换行时第2个换行即第3行会被第1行影响\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null; // 换行后连续字符reduce不生效重新计数\n }\n // 奇怪的精度问题,暂时不用相等判断,而是为原本w宽度加一点点冗余1e-10\n else if(count > w + (1e-10)) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n // 普通非多行文本阶段逻辑\n let width;\n // 宽度不足时无法跳出循环,至少也要塞个字符形成一行,无需判断第1行,因为是否放得下逻辑在dom中做过了,\n // 如果第1行放不下,一定会另起一行,此时作为开头再放不下才会进这里,这个if只有0或1个字符的情况\n if(i <= begin) {\n width = count;\n }\n // 超过2个字符回退1个\n else {\n width = count - charWidthList[i--];\n }\n i++;\n // 根据是否第一行分开处理行首空白\n let textBox;\n if(!lineCount) {\n maxW = width - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, width);\n }\n // 必须先添加再设置y,同上\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null;\n }\n else {\n i++;\n }\n }\n // 换行后Text的x重设为lx\n if(lineCount) {\n this.__x = this.__sx1 = lx;\n }\n // 最后一行,只有一行未满时也进这里,需查看末尾mpb,排不下回退一个字符\n // 声明了lineClamp时特殊考虑,这里一定是最后一行,要对比行数不能超过,超过忽略掉这些文本\n if(begin < length && (!lineClamp || lineCount + lineClampCount < lineClamp)) {\n let textBox;\n if(!lineCount) {\n let needBack;\n // 防止开头第一个begin=0时回退,这在inline有padding且是第一个child时会发生\n if(begin && count > w - endSpace) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n else {\n let needBack;\n // 防止begin在结尾时回退,必须要有个字符,这在最后一行1个字符排不下时会出现\n if(count > w - endSpace && begin < length - 1) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n maxW = Math.max(maxW, count);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n }\n }\n this.__width = maxW;\n this.__height = y - data.y;\n this.__baseLine = css.getBaseLine(computedStyle);\n return lineCount;\n }\n\n // 末尾行因ellipsis的缘故向前回退字符生成textBox,可能会因不满足宽度导致无法生成,此时向前继续回退TextBox\n __lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount, lineHeight, lx, x, y, maxW,\n textBoxes, content, charWidthList, lineBoxManager) {\n for(; i >= begin; i--) {\n count -= charWidthList[i] + letterSpacing;\n if(count + ew + endSpace <= w) {\n // 至少1个字符不用回退,到0也没找到需要回退\n if(i) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n break;\n }\n }\n }\n // 最后也没找到,看是否要查找前一个inline节点,还是本身是行首兜底首字母\n if(i < 0) {\n let lineBox = lineBoxManager.lineBox;\n // lineBox为空是行首,至少放1个字符\n if(!lineBox.size) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.charAt(begin), charWidthList.slice(begin, begin + 1));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n }\n // 向前查找inline节点,可能会有前面inline嵌套,因此直接用lineBox,不会出现inlineBlock,\n // 这里和css不同,ib强制超限换行不会同行\n else {\n let list = lineBox.list;\n outer:\n for(let j = list.length - 1; j >= 0; j--) {\n let tb = list[j];\n let { content, wList, width } = tb;\n // 整体减去可以说明可能在这个tb中,只要最后发现不是空文本节点就行,否则继续;第0个强制进入保证1字符\n if(count - width + ew <= w || !j) {\n // 找到可以跳出outer循环,找不到继续,注意第0个且1个字符判断\n for(let k = wList.length - 1; k >= 0; k--) {\n if(!k && !j || count + ew <= w) {\n tb.__content = content;\n tb.__width = width;\n tb.parent.__ellipsis = true;\n break outer;\n }\n else {\n let w2 = wList[k];\n tb.__endY -= w2;\n width -= w2;\n content = content.slice(0, k);\n count -= w2;\n wList.pop();\n }\n }\n }\n // 不够则看前一个tb并且删掉这个\n else {\n count -= width;\n }\n list.pop();\n tb.parent.textBoxes.pop();\n }\n }\n }\n return [y, maxW];\n }\n\n __offsetX(diff, isLayout) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetX(diff);\n });\n }\n this.__sx1 += diff;\n }\n\n __offsetY(diff, isLayout) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetY(diff);\n });\n }\n this.__sy1 += diff;\n }\n\n __tryLayInline(w) {\n return w - this.charWidthList[0];\n }\n\n __inlineSize() {\n let minX, maxX;\n this.textBoxes.forEach((item, i) => {\n if(i) {\n minX = Math.min(minX, item.x);\n maxX = Math.max(maxX, item.x + item.width);\n }\n else {\n minX = item.x;\n maxX = item.x + item.width;\n }\n });\n this.__x = minX;\n this.__sx = this.__sx1 = minX + this.ox;console.log(22222)\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] * 0.5, half);\n }\n else if(textStrokeWidth[1] === VW) {\n half = Math.max(textStrokeWidth[0] * root.width * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VH) {\n half = Math.max(textStrokeWidth[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(textStrokeWidth[0] * 0.5, half);\n }\n half += 1;\n return [sx - half, sy - half, sx + width + half, sy + height + half];\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get matrix() {\n return this.domParent.matrix;\n }\n\n get matrixEvent() {\n return this.domParent.matrixEvent;\n }\n}\n\nText.prototype.__renderByMask = Text.prototype.render;\n\nexport default Text;\n","import util from './util';\nimport $$type from './$$type';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\n/**\n * 2. 打平children中的数组,变成一维\n * 3. 合并相连的Text节点,即string内容\n */\nfunction flattenJson(parent) {\n if(Array.isArray(parent)) {\n return parent.map(item => flattenJson(item));\n }\n else if(!parent || [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) {\n return parent;\n }\n let list = [];\n traverseJson(list, parent.children, {\n lastText: null,\n });\n parent.children = list;\n return parent;\n}\n\nfunction traverseJson(list, children, options) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n traverseJson(list, item, options);\n });\n }\n else if(children && (children.$$type === TYPE_VD || children.$$type === TYPE_GM)) {\n if(['canvas', 'svg', 'webgl'].indexOf(children.tagName) > -1) {\n throw new Error('Can not nest canvas/svg/webgl');\n }\n if(children.$$type === TYPE_VD) {\n flattenJson(children);\n }\n list.push(children);\n options.lastText = null;\n }\n else if(children && children.$$type === TYPE_CP) {\n list.push(children);\n // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做\n options.lastText = null;\n }\n // 排除掉空的文本,连续的text合并\n else if(!util.isNil(children) && children !== '') {\n if(options.lastText !== null) {\n list[list.length - 1] = options.lastText += children;\n }\n else {\n list.push(children);\n }\n }\n}\n\nexport default flattenJson;\n","import Text from '../node/Text';\nimport util from './util';\nimport $$type from './$$type';\nimport enums from './enums';\nimport flatten from './flatten';\n\nconst { NODE_KEY: {\n NODE_DOM_PARENT,\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n} } = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nfunction initRoot(cd, root) {\n let c = flatten({\n tagName: root.tagName,\n props: {},\n children: cd,\n $$type: TYPE_VD,\n });\n root.__json = c;\n root.__host = root;\n let children = build(c.children, root, root);\n return relation(root, children);\n}\n\nfunction initDom(json, root, host, parent) {\n let vd = build(json, root, host);\n return relation(parent, vd);\n}\n\nfunction initCp(json, root, host) {\n if(util.isObject(json)) {\n // cp的flatten在__init中自己做\n return build(json, root, host);\n }\n // text的relation会由上层如Root设置\n else {\n return new Text(json);\n }\n}\n\nfunction initCp2(json, root, host, parent) {\n let vd = new json.klass(json.props);\n vd.__tagName = json.tagName || vd.__tagName;\n vd.__root = root;\n vd.__host = host;\n vd.__json = json;\n vd.__init();\n return relation(parent, vd);\n}\n\n/**\n * 将初始json文件生成virtualDom\n * @param json\n * @param root\n * @param host\n * @param hasP 出现过p标签\n * @returns vd\n */\nfunction build(json, root, host, hasP) {\n if(Array.isArray(json)) {\n return json.map(item => build(item, root, host, hasP));\n }\n let vd;\n if(util.isObject(json) && json.$$type) {\n let { tagName, props, children, klass, $$type, __inheritAnimate, __animateRecords } = json;\n // 更新过程中无变化的cp直接使用原来生成的\n if($$type === TYPE_CP && json.__placeholder) {\n return json.__placeholder;\n }\n if($$type === TYPE_VD) {\n if(tagName === 'img') {\n vd = new Img(tagName, props);\n if(Array.isArray(children) && children.length) {\n throw new Error('Img can not contain children');\n }\n }\n else {\n vd = new Dom(tagName, props);\n }\n // 检查p不能包含div\n if(tagName === 'p') {\n hasP = true;\n }\n else if(tagName === 'div' && hasP) {\n throw new Error('Markup p can not contain div');\n }\n if(Array.isArray(children)) {\n children = relation(vd, build(children, root, host, hasP));\n }\n else {\n children = [];\n }\n vd.__children = children;\n }\n else if($$type === TYPE_GM) {\n let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\n }\n else if($$type === TYPE_CP) {\n vd = new klass(props);\n vd.__tagName = tagName || vd.__tagName;\n }\n else {\n return new Text(json);\n }\n // 根parse需要用到真正的vd引用,然后vd也要引用json,用以做domApi\n json.vd = vd;\n vd.__json = json;\n // 递归parse中的动画记录需特殊处理,将target改为真正的vd引用\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n __animateRecords.list.forEach(item => {\n item.target = item.target.vd;\n });\n delete json.__animateRecords;\n }\n // 更新过程中key相同或者普通相同的vd继承动画\n if(__inheritAnimate) {\n util.extendAnimate(__inheritAnimate, vd);\n delete json.__inheritAnimate;\n }\n vd.__root = root;\n vd.__host = host;\n if($$type === TYPE_CP) {\n vd.__init();\n }\n let ref = props.ref;\n if(util.isString(ref) && ref || util.isNumber(ref)) {\n host.ref[ref] = vd;\n }\n else if(util.isFunction(ref)) {\n ref(vd);\n }\n return vd;\n }\n return new Text(json);\n}\n\n/**\n * 设置关系,父子和兄弟\n * @param parent\n * @param children\n * @param options\n * @returns {Xom|Text|Component}\n */\nfunction relation(parent, children, options = {}) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n relation(parent, item, options);\n });\n }\n else if(children instanceof Xom || children instanceof Component || children instanceof Text) {\n children.__parent = parent;\n children.__domParent = parent;\n // 极为恶心,为了v8的性能优化,text复用parent的__config部分,但domParent重设\n if(children instanceof Text) {\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n if(children.__config) {\n children.__config[NODE_DOM_PARENT] = parent;\n }\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n // 文字视作为父节点的直接文字子节点\n if(children instanceof Component) {\n let sr = children.shadowRoot;\n if(sr instanceof Text) {\n sr.__parent = parent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n sr.__domParent = parent;\n if(sr.__config) {\n sr.__config[NODE_DOM_PARENT] = parent;\n }\n }\n }\n return children;\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n initRoot,\n initDom,\n initCp,\n initCp2,\n relation,\n};\n","import util from './util';\n\nconst { isFunction } = util;\n\nclass Event {\n constructor() {\n this.__eHash = {};\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.on(id[i], handle);\n }\n }\n else {\n if(!self.__eHash.hasOwnProperty(id)) {\n self.__eHash[id] = [];\n }\n // 遍历防止此handle被侦听过了\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n if(item[i] === handle) {\n return self;\n }\n }\n self.__eHash[id].push(handle);\n }\n return self;\n }\n\n once(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n function cb(...data) {\n handle.apply(self, data);\n self.off(id, cb);\n }\n\n cb.__karasEventCb = handle;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.once(id[i], handle);\n }\n }\n else if(handle) {\n self.on(id, cb);\n }\n return this;\n }\n\n off(id, handle) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.off(id[i], handle);\n }\n }\n else if(self.__eHash.hasOwnProperty(id)) {\n if(handle) {\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n // 需考虑once包裹的引用对比\n if(item[i] === handle || item[i].__karasEventCb === handle) {\n item.splice(i, 1);\n break;\n }\n }\n }\n // 未定义为全部清除\n else {\n delete self.__eHash[id];\n }\n }\n return this;\n }\n\n emit(id, ...data) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.emit(id[i], data);\n }\n }\n else {\n if(self.__eHash.hasOwnProperty(id)) {\n let list = self.__eHash[id];\n if(list.length) {\n list = list.slice();\n for(let i = 0, len = list.length; i < len; i++) {\n let cb = list[i];\n if(isFunction(cb)) {\n cb.apply(self, data);\n }\n }\n }\n }\n }\n return this;\n }\n\n static mix(...obj) {\n for(let i = obj.length - 1; i >= 0; i--) {\n let o = obj[i];\n let event = new Event();\n o.__eHash = {};\n let fns = ['on', 'once', 'off', 'emit'];\n for(let j = fns.length - 1; j >= 0; j--) {\n let fn = fns[j];\n o[fn] = event[fn];\n }\n }\n }\n\n static REFRESH = 'refresh';\n static PAUSE = 'pause';\n static PLAY = 'play';\n static FRAME = 'frame';\n static FINISH = 'finish';\n static CANCEL = 'cancel';\n static BEGIN = 'begin';\n static END = 'end';\n}\n\nexport default Event;\n","import Node from './Node';\nimport Text from './Text';\nimport builder from '../util/builder';\nimport Event from '../util/Event';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport flatten from '../util/flatten';\nimport css from '../style/css';\nimport change from '../refresh/change';\n\nconst { isNil, isFunction, clone, extend } = util;\n\nconst REGISTER = {};\n\n/**\n * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归\n * 在check时树递归会用到,判断是否需要查找cp更新\n * @param cp\n */\nfunction setUpdateFlag(cp) {\n // 去重\n if(cp.__hasUpdate) {\n return;\n }\n cp.__hasUpdate = true;\n let host = cp.host;\n if(host) {\n setUpdateFlag(host);\n }\n}\n\nclass Component extends Event {\n constructor(props = {}) {\n super();\n this.__tagName = /(?:function|class)\\s+([\\w$]+)/.exec(this.constructor.toString())[1];\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__parent = null;\n this.__host = null;\n this.__ref = {};\n this.state = {};\n this.__isMounted = false;\n this.__taskList = [];\n }\n\n setState(n, cb) {\n let self = this;\n if(isNil(n)) {\n n = {};\n }\n else if(isFunction(n)) {\n return;\n }\n else {\n if(Object.keys(n).length === 0) {\n if(isFunction(cb)) {\n cb.call(self);\n }\n return;\n }\n let state = clone(self.state);\n n = extend(state, n);\n }\n let root = self.root;\n if(root && self.__isMounted) {\n // 一帧之内多次调用,需合并\n if(self.__nextState) {\n Object.assign(self.__nextState, n);\n self.__taskList.push(cb);\n }\n else {\n self.__nextState = n;\n self.__taskList = [cb];\n // 回调更新列表,before执行时splice出来供after执行,防止中途产生的后续setState干扰\n let list = [];\n let t = self.__task = {\n __before: () => {\n list = self.__taskList.splice(0);\n // 标识更新\n setUpdateFlag(this);\n },\n __after: () => {\n // self.__nextState = null; 由updater.js每次refresh前同步执行清空,这里不能异步清除,否则frame动画会乱序\n list.forEach(cb => {\n if(isFunction(cb)) {\n cb.call(self);\n }\n });\n },\n };\n root.addRefreshCp(t);\n }\n }\n // 构造函数中调用还未render,\n else if(isFunction(cb)) {\n self.state = n;\n cb.call(self);\n }\n }\n\n /**\n * build中调用初始化,json有值时是update过程才有,且处理过flatten\n * @param json\n * @private\n */\n __init(json) {\n this.__ref = {};\n let root = this.root;\n let cd = json || flatten(this.render());\n let sr = builder.initCp(cd, root, this);\n this.__cd = cd;\n if(sr instanceof Text) {\n // 文字视作为父节点的直接文字子节点,在builder里做\n }\n else if(sr instanceof Node) {\n let style = css.normalize(this.props.style);\n let keys = Object.keys(style);\n extend(sr.style, style, keys);\n extend(sr.currentStyle, style, keys);\n // 事件添加到sr\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n });\n }\n else if(!(sr instanceof Component)) {\n // 本身build是递归的,子cp已经初始化了\n throw new Error('Component render() must return a dom/text: ' + this);\n }\n // 自定义事件无视返回强制添加\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n k = k.slice(3);\n this.on(k, v);\n }\n });\n // shadow指向直接renderRoot,shadowRoot考虑到返回Component的递归即hoc高阶组件\n // host是直接所属,hostRoot同考虑到高阶组件\n this.__shadow = sr;\n sr.__host = this;\n // 递归下去,多层级时执行顺序由里到外,最终会被最上层执行替换\n while(sr instanceof Component) {\n sr.__hostRoot = this;\n sr.shadow.__host = sr;\n sr = sr.shadow;\n }\n this.__shadowRoot = sr;\n sr.__hostRoot = this;\n if(!this.__isMounted) {\n this.__isMounted = true;\n if(isFunction(this.componentDidMount)) {\n root.once(Event.REFRESH, () => {\n this.componentDidMount();\n });\n }\n }\n }\n\n render() {\n inject.warn('Component must implement render()');\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.__isDestroyed = true;\n this.__isMounted = false;\n if(isFunction(this.componentWillUnmount)) {\n this.componentWillUnmount();\n }\n this.root.delRefreshTask(this.__task);\n if(this.shadowRoot) {\n this.shadowRoot.__destroy();\n }\n this.__parent = null;\n }\n\n __emitEvent(e, force) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n return;\n }\n let res = sr.__emitEvent(e, force);\n if(res) {\n e.target = this;\n return true;\n }\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get shadow() {\n return this.__shadow;\n }\n\n get shadowRoot() {\n return this.__shadowRoot;\n }\n\n get root() {\n return this.__root;\n }\n\n get host() {\n return this.__host;\n }\n\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n get state() {\n return this.__state;\n }\n\n set state(v) {\n this.__state = v;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)) {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Component has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)\n || !obj.prototype || !(obj.prototype instanceof Component)) {\n throw new Error('Invalid param: Component register');\n }\n if(Component.hasRegister(name)) {\n throw new Error(`Component has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Component.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nObject.keys(change.GEOM).concat([\n 'x',\n 'y',\n 'ox',\n 'oy',\n 'sx',\n 'sy',\n // '__sx1',\n // '__sx2',\n // '__sx3',\n // '__sx4',\n // '__sx5',\n // '__sx6',\n // '__sy1',\n // '__sy2',\n // '__sy3',\n // '__sy4',\n // '__sy5',\n // '__sy6',\n 'width',\n 'height',\n 'outerWidth',\n 'outerHeight',\n 'clientWidth',\n 'clientHeight',\n 'offsetWidth',\n 'offsetHeight',\n 'style',\n 'animationList',\n 'animateStyle',\n 'currentStyle',\n 'computedStyle',\n 'currentProps',\n 'baseLine',\n 'virtualDom',\n 'mask',\n 'maskId',\n 'textWidth',\n 'content',\n 'lineBoxes',\n 'charWidthList',\n 'charWidth',\n '__layoutData',\n 'availableAnimating',\n 'effectiveAnimating',\n 'displayAnimating',\n 'visibilityAnimating',\n 'bbox',\n '__config',\n 'contentBoxList',\n 'listener',\n 'matrix',\n 'matrixEvent',\n]).forEach(fn => {\n Object.defineProperty(Component.prototype, fn, {\n get() {\n let sr = this.shadowRoot;\n if(sr) {\n return sr[fn];\n }\n },\n });\n});\n\n[\n '__layout',\n '__layoutAbs',\n '__layoutNone',\n '__tryLayInline',\n '__offsetX',\n '__offsetY',\n '__calAutoBasis',\n '__calMp',\n '__calAbs',\n '__renderAsMask',\n '__renderByMask',\n '__mp',\n 'animate',\n 'removeAnimate',\n 'clearAnimate',\n 'updateStyle',\n 'getBoundingClientRect',\n 'getComputedStyle',\n '__deepScan',\n 'clearCache',\n '__structure',\n '__modifyStruct',\n '__updateStruct',\n 'flowChildren',\n 'absChildren',\n '__isRealInline',\n '__calBasis',\n '__calMinMax',\n '__computeMeasure',\n 'appendChild',\n 'prependChild',\n 'insertBefore',\n 'insertAfter',\n 'removeChild',\n 'remove',\n].forEach(fn => {\n Component.prototype[fn] = function() {\n let sr = this.shadowRoot;\n if(sr && isFunction(sr[fn])) {\n return sr[fn].apply(sr, arguments);\n }\n };\n});\n\nexport default Component;\n","import unit from './unit';\nimport transform from './transform';\nimport enums from '../util/enums';\n\nconst { STYLE_KEY: { SCALE_X, SCALE_Y } } = enums;\nconst { PERCENT, NUMBER } = unit;\n\nfunction matrixResize(imgWidth, imgHeight, targetWidth, targetHeight, x, y, w, h) {\n if(imgWidth === targetWidth && imgHeight === targetHeight) {\n return;\n }\n let list = [\n [SCALE_X, [targetWidth / imgWidth, NUMBER]],\n [SCALE_Y, [targetHeight / imgHeight, NUMBER]],\n ];\n let tfo = transform.calOrigin([[0, PERCENT], [0, PERCENT]], w, h);\n tfo[0] += x;\n tfo[1] += y;\n return transform.calMatrixWithOrigin(list, tfo, w, h);\n}\n\nexport default {\n matrixResize,\n};\n","import border from './border';\nimport transform from './transform';\nimport mx from '../math/matrix';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\nimport unit from './unit';\nimport enums from '../util/enums';\nimport image from './image';\n\nconst {\n STYLE_KEY: {\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\nconst { clone, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { AUTO, PX, PERCENT, STRING, REM, VW, VH } = unit;\n\nfunction renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bbrr, bblr,\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] === AUTO) {\n res.push(-1);\n }\n else if(item[1] === STRING) {\n res.push(item[0] === 'contain' ? -2 : -3);\n }\n });\n return res;\n}\n\nfunction calBackgroundPosition(position, container, size, root) {\n if(Array.isArray(position)) {\n if(position[1] === PX) {\n return position[0];\n }\n else if(position[1] === PERCENT) {\n return (container - size) * position[0] * 0.01;\n }\n else if(position[1] === REM) {\n return position[0] * root.computedStyle[FONT_SIZE];\n }\n else if(position[1] === VW) {\n return position[0] * root.width * 0.01;\n }\n else if(position[1] === VH) {\n return position[0] * root.height * 0.01;\n }\n }\n return 0;\n}\n\nfunction renderImage(xom, renderMode, ctx, loadBgi,\n bx1, by1, bx2, by2, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, isInline,\n 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_FRAME_CB,\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_CAL_DIFF_TIME,\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, calUnit } = unit;\nconst { isNil, isFunction, isNumber, isObject, isString, clone, equalArr } = util;\nconst { linear } = easing;\nconst { cloneStyle } = css;\nconst { isGeom, GEOM } = change;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nconst NUM_CAL_HASH = {\n};\nObject.assign(NUM_CAL_HASH, LENGTH_HASH);\nObject.assign(NUM_CAL_HASH, EXPAND_HASH);\n\nfunction unify(frames, target) {\n let hash = {};\n let keys = [];\n // 获取所有关键帧的属性\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n Object.keys(style).forEach(k => {\n let v = style[k];\n // 未定义的过滤掉,null空有意义\n if(v !== undefined && !hash.hasOwnProperty(k)) {\n hash[k] = true;\n // geom为属性字符串,style都为枚举int\n if(!GEOM.hasOwnProperty(k)) {\n k = parseInt(k);\n }\n // path动画要转为translateXY,所以手动添加,使2帧之间存在过渡,有可能之前已存在这个动画,可忽视\n if(k === TRANSLATE_PATH) {\n if(!hash.hasOwnProperty(TRANSLATE_X)) {\n keys.push(TRANSLATE_X);\n }\n if(!hash.hasOwnProperty(TRANSLATE_Y)) {\n keys.push(TRANSLATE_Y);\n }\n hash[TRANSLATE_X] = hash[TRANSLATE_Y] = true;\n }\n keys.push(k);\n }\n });\n });\n // 添补没有声明完全的关键帧属性为节点当前值\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n keys.forEach(k => {\n if(!style.hasOwnProperty(k) || isNil(style[k])) {\n if(GEOM.hasOwnProperty(k)) {\n style[k] = target.getProps(k);\n }\n else {\n style[k] = target.currentStyle[k];\n }\n }\n });\n });\n return keys;\n}\n\n// 每次初始化时处理继承值,以及转换transform为单matrix矩阵\nfunction inherit(frames, keys, target) {\n let computedStyle = target.computedStyle;\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n keys.forEach(k => {\n let v = style[k];\n // geom的属性可能在帧中没有\n if(isNil(v)) {\n return;\n }\n if(k === TRANSFORM) {\n let ow = target.outerWidth;\n let oh = target.outerHeight;\n let m = tf.calMatrix(v, ow, oh);\n style[k] = [[MATRIX, m]];\n }\n else if(v[1] === INHERIT) {\n if(k === COLOR || k === TEXT_STROKE_COLOR) {\n style[k] = [util.rgba2int(computedStyle[k]), RGBA];\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n style[k] = [computedStyle[k], PX];\n }\n else if(k === FONT_WEIGHT) {\n style[k] = [computedStyle[k], NUMBER];\n }\n else if(k === FONT_STYLE || k === FONT_FAMILY || k === TEXT_ALIGN || k === TEXT_STROKE_OVER) {\n style[k] = [computedStyle[k], STRING];\n }\n }\n });\n });\n}\n\n/**\n * 通知root更新当前动画,需要根据frame的状态来决定是否是同步插入\n * 在异步时,因为动画本身是异步,需要addRefreshTask\n * 而如果此时frame在执行before过程中,说明帧动画本身是在before计算的,需要同步插入\n * @param style\n * @param keys 样式所有的key\n * @param __config\n * @param root\n * @param node\n */\nfunction genBeforeRefresh(style, keys, __config, root, node) {\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = keys;\n res[UPDATE_CONFIG] = __config[I_NODE_CONFIG];\n root.__addUpdate(node, __config[I_NODE_CONFIG], root, __config[I_ROOT_CONFIG], res);\n __config[I_STYLE] = style;\n __config[I_ASSIGNING] = true;\n // frame每帧回调时,下方先执行计算好变更的样式,这里特殊插入一个hook,让root增加一个刷新操作\n // 多个动画调用因为相同root也只会插入一个,这样在所有动画执行完毕后frame里检查同步进行刷新,解决单异步问题\n root.__frameHook();\n}\n\n/**\n * 将每帧的样式格式化,提取出offset属性并转化为时间,提取出缓动曲线easing\n * @param style 关键帧样式\n * @param duration 动画时间长度\n * @param es options的easing曲线控制,frame没有自定义则使用全局的\n * @returns {{style: *, time: number, easing: *, transition: []}}\n */\nfunction framing(style, duration, es) {\n let { offset, easing } = style;\n // 这两个特殊值提出来存储不干扰style\n delete style.offset;\n delete style.easing;\n // translatePath特殊对待,ae的曲线运动动画\n let translatePath = style.translatePath;\n style = css.normalize(style);\n if(Array.isArray(translatePath) && [6, 8].indexOf(translatePath.length) > -1) {\n style[TRANSLATE_PATH] = translatePath.map(item => calUnit(item));\n }\n let res = [];\n res[FRAME_STYLE] = style;\n res[FRAME_TIME] = offset * duration;\n res[FRAME_EASING] = easing || es;\n res[FRAME_TRANSITION] = [];\n return res;\n}\n\nfunction calByUnit(p, n, container, root) {\n if(p[1] === PX) {\n if(n[1] === PERCENT) {\n return n[0] * 0.01 * container - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width * 0.01 - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height * 0.01 - p[0];\n }\n }\n else if(p[1] === PERCENT) {\n if(n[1] === PX) {\n return n[0] * 100 / container - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * root.computedStyle[FONT_SIZE] * 100 / container - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / container - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / container - p[0];\n }\n }\n else if(p[1] === REM) {\n if(n[1] === PX) {\n return n[0] / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * 0.01 * container / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n }\n else if(p[1] === VW) {\n if(n[1] === PX) {\n return n[0] * 100 / root.width - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / root.width - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / root.width - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / root.width - p[0];\n }\n }\n else if(p[1] === VH) {\n if(n[1] === PX) {\n return n[0] * 100 / root.height - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / root.height - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / root.height - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / root.height - p[0];\n }\n }\n}\n\n/**\n * 计算两帧之间的差,单位不同的以后面为准,返回的v表示差值\n * 没有变化返回空\n * auto等无法比较的不参与计算,不返回来标识无过度效果\n * @param prev 上一帧样式\n * @param next 下一帧样式\n * @param k 比较的样式名\n * @param target dom对象\n * @param tagName dom名\n * @returns {{k: *, v: *}}\n */\nfunction calDiff(prev, next, k, target, tagName) {\n let res = [k];\n let p = prev[k];\n let n = next[k];\n if(k === TRANSFORM) {\n // transform因默认值null很特殊,不存在时需给默认矩阵\n if(!p && !n) {\n return;\n }\n let pm, nm;\n if(p) {\n pm = p[0][1];\n }\n else {\n pm = mx.identity();\n }\n if(n) {\n nm = n[0][1];\n }\n else {\n nm = mx.identity();\n }\n // transform特殊被初始化转成matrix矩阵,直接计算差值\n if(equalArr(pm, nm)) {\n return;\n }\n res[1] = [\n nm[0] - pm[0],\n nm[1] - pm[1],\n nm[2] - pm[2],\n nm[3] - pm[3],\n nm[4] - pm[4],\n nm[5] - pm[5],\n nm[6] - pm[6],\n nm[7] - pm[7],\n nm[8] - pm[8],\n nm[9] - pm[9],\n nm[10] - pm[10],\n nm[11] - pm[11],\n nm[12] - pm[12],\n nm[13] - pm[13],\n nm[14] - pm[14],\n nm[15] - pm[15],\n ];\n return res;\n }\n else if(k === ROTATE_3D) {\n if(equalArr(p, n)) {\n return;\n }\n res[1] = [n[0] - n[0], n[1] - p[1], n[2] - p[2], [n[3][0] - p[3][0], n[3][1]]];\n }\n else if(k === FILTER) {\n // filter很特殊,里面有多个滤镜,忽视顺序按hash计算,为空视为默认值,如blur默认0,brightness默认1\n let pHash = {}, nHash = {}, keyHash = {};\n if(p) {\n p.forEach(item => {\n keyHash[item[0]] = true;\n pHash[item[0]] = item[1];\n });\n }\n if(n) {\n n.forEach(item => {\n keyHash[item[0]] = true;\n nHash[item[0]] = item[1];\n })\n }\n let v = {}, hasChange;\n // 只有blur支持px/rem/vw/vh,其余都是特殊固定单位\n Object.keys(keyHash).forEach(k => {\n if(k === 'blur') {\n if(!pHash[k]) {\n v[k] = nHash[k].slice(0);\n hasChange = true;\n }\n else if(!nHash[k]) {\n v[k] = [-pHash[k][0], pHash[k][1]];\n hasChange = true;\n }\n else {\n let v2 = calByUnit(pHash[k], nHash[k], 0, target.root);\n v[k] = [v2, pHash[k][1]];\n hasChange = true;\n }\n }\n else if(k === 'hue-rotate') {\n let nv = isNil(nHash[k]) ? 0 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 0 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'contrast') {\n let nv = isNil(nHash[k]) ? 100 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 100 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n else if(k === 'grayscale') {\n let nv = isNil(nHash[k]) ? 0 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 0 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n });\n if(!hasChange) {\n return;\n }\n res[1] = v;\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n res[1] = [];\n for(let i = 0; i < 2; i++) {\n let pi = p[i];\n let ni = n[i];\n if(pi[1] === ni[1]) {\n res[1].push(ni[0] - pi[0]);\n }\n else {\n let v = calByUnit(pi, ni, target[i ? 'outerHeight' : 'outerWidth'], target.root);\n res[1].push(v || 0);\n }\n }\n if(equalArr(res[1], [0, 0])) {\n return;\n }\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n res[1] = [];\n let length = Math.min(p.length, n.length);\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni) {\n res[1].push(null);\n continue;\n }\n if(pi[1] === ni[1]) {\n let v = ni[0] - pi[0];\n if(!v) {\n res[1].push(null);\n return;\n }\n res[1].push(v);\n }\n else {\n let k2 = k === BACKGROUND_POSITION_X ? 'offsetWidth' : 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = k === BACKGROUND_POSITION_X ? 'clientWidth' : 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = k === BACKGROUND_POSITION_X ? 'width' : 'height';\n }\n let v = calByUnit(pi, ni, target[k2], target.root);\n if(!v) {\n res[1].push(null);\n return;\n }\n res[1].push(v);\n }\n }\n }\n else if(k === BOX_SHADOW) {\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let a = p[i];\n let b = n[i];\n let v = [];\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n v.push(b[j] - a[j]);\n }\n // rgba\n let c = [];\n for(let j = 0; j < 4; j++) {\n c.push(b[4][j] - a[4][j]);\n }\n v.push(c);\n res[1].push(v);\n }\n }\n else if(EXPAND_HASH.hasOwnProperty(k)) {\n if(p[1] === n[1]) {\n let v = n[0] - p[0];\n if(v === 0) {\n return;\n }\n res[1] = v;\n }\n else {\n let v = calByUnit(p, n, target[k === TRANSLATE_X || k === TRANSLATE_Z ? 'outerWidth' : 'outerHeight'], target.root);\n if(!v) {\n return;\n }\n res[1] = v;\n }\n }\n else if(k === BACKGROUND_SIZE) {\n res[1] = [];\n let length = Math.min(p.length, n.length);\n let has;\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni) {\n res[1].push(null);\n continue;\n }\n let temp = [];\n for(let j = 0; j < 2; j++) {\n let pp = pi[j], nn = ni[j];\n if(pp[1] === nn[1]) {\n temp.push(nn[0] - pp[0]);\n }\n else {\n let k2 = i ? 'offsetWidth' : 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = i ? 'clientWidth' : 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = i ? 'width' : 'height';\n }\n let v = calByUnit(pp, nn, target[k2], target.root);\n temp.push(v || 0);\n }\n }\n if(equalArr(temp, [0, 0])) {\n res[1].push(null);\n }\n else {\n res[1].push(temp);\n has = true;\n }\n }\n if(!has) {\n return;\n }\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n // backgroundImage发生了渐变色和图片的变化,fill发生渐变色和纯色的变化等\n res[1] = [];\n let length = Math.min(p.length, n.length);\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni || isString(pi) || isString(ni)) {\n res[1].push(null);\n continue;\n }\n if(pi.k !== ni.k) {\n res[1].push(null);\n continue;\n }\n let temp = [];\n // 渐变\n if(pi.k === 'linear' || pi.k === 'radial' || pi.k === 'conic') {\n let pv = pi.v;\n let nv = ni.v;\n temp[0] = [];\n let { clientWidth } = target;\n let eq = equalArr(pv, nv);\n for(let i = 0, len = Math.min(pv.length, nv.length); i < len; i++) {\n let a = pv[i];\n let b = nv[i];\n let t = [];\n t.push([\n b[0][0] - a[0][0],\n b[0][1] - a[0][1],\n b[0][2] - a[0][2],\n b[0][3] - a[0][3],\n ]);\n if(a[1] && b[1]) {\n if(a[1][1] === b[1][1]) {\n t.push(b[1][0] - a[1][0]);\n }\n else {\n let v = calByUnit(a[1], b[1], clientWidth, target.root);\n t.push(v || 0);\n }\n }\n temp[0].push(t);\n }\n // 线性渐变有角度差值变化\n if(pi.k === 'linear') {\n let isArrP = Array.isArray(pi.d);\n let isArrN = Array.isArray(ni.d);\n if(isArrN !== isArrP) {\n res[1].push(null);\n continue;\n }\n if(isArrP) {\n let v = [ni.d[0] - pi.d[0], ni.d[1] - pi.d[1], ni.d[2] - pi.d[2], ni.d[3] - pi.d[3]];\n if(eq && equalArr(v, [0, 0, 0, 0])) {\n res[1].push(null);\n continue;\n }\n temp[1] = v;\n }\n else {\n let v = ni.d - pi.d;\n if(eq && v === 0) {\n res[1].push(null);\n continue;\n }\n temp[1] = v;\n }\n }\n // 径向渐变的位置\n else if(pi.k === 'radial') {\n let isArrP = Array.isArray(pi.z);\n let isArrN = Array.isArray(ni.z);\n if(isArrN !== isArrP) {\n res[1].push(null);\n continue;\n }\n if(isArrP) {\n temp[2] = [];\n for(let i = 0; i < 5; i++) {\n let pz = pi.z[i];\n // 半径比例省略为1\n if(pz === undefined) {\n pz = 1;\n }\n let nz = ni.z[i];\n if(nz === undefined) {\n nz = 1;\n }\n temp[2].push(nz - pz);\n }\n if(eq && equalArr(res[4], [0, 0, 0, 0, 0])) {\n res[1].push(null);\n }\n }\n else {\n temp[2] = [];\n for(let i = 0; i < 2; i++) {\n let pp = pi.p[i];\n let np = ni.p[i];\n if(pp[1] === np[1]) {\n temp[2].push(np[0] - pp[0]);\n }\n else {\n let v = calByUnit(pp, np, target[i ? 'clientWidth' : 'clientHeight'], target.root);\n temp[2].push(v || 0);\n }\n }\n if(eq && equalArr(res[3], [0, 0])) {\n res[1].push(null);\n }\n }\n }\n else if(pi.k === 'conic') {\n temp[1].push(n.d - p.d);\n temp[2] = [];\n for(let i = 0; i < 2; i++) {\n let pp = p.p[i];\n let np = n.p[i];\n if(pp[1] === np[1]) {\n temp[2].push(np[0] - pp[0]);\n }\n else {\n let v = calByUnit(pp, np, target[i ? 'clientWidth' : 'clientHeight'], target.root);\n temp[2].push(v || 0);\n }\n }\n if(eq && res[2] !== 0 && equalArr(res[3], [0, 0])) {\n res[1].push(null);\n }\n }\n }\n // 纯色\n else {\n if(equalArr(n, pi)) {\n res[1].push(null);\n }\n temp[0] = [\n ni[0] - pi[0],\n ni[1] - pi[1],\n ni[2] - pi[2],\n ni[3] - pi[3]\n ];\n }\n res[1].push(temp);\n }\n }\n else if(COLOR_HASH.hasOwnProperty(k)) {\n n = n[0];\n p = p[0];\n if(equalArr(n, p) || n[3] === 0 && p[3] === 0) {\n return;\n }\n res[1] = [\n n[0] - p[0],\n n[1] - p[1],\n n[2] - p[2],\n n[3] - p[3]\n ];\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n // x/y都相等无需\n if(n[0][0] === p[0][0] && n[0][1] === p[0][1]\n && n[1][0] === p[1][0] && n[1][1] === p[1][1]) {\n return;\n }\n res[1] = [];\n for(let i = 0; i < 2; i++) {\n if(n[i][1] === p[i][1]) {\n res[1].push(n[i][0] - p[i][0]);\n }\n else {\n let v = calByUnit(p[i], n[i], target[i ? 'outerHeight' : 'outerWidth'], target.root);\n res[1].push(v || 0);\n }\n }\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n // auto不做动画\n if(p[1] === AUTO || n[1] === AUTO) {\n return;\n }\n let computedStyle = target.computedStyle;\n let parentComputedStyle = (target.domParent || target).computedStyle;\n let diff = 0;\n if(p[1] === n[1]) {\n diff = n[0] - p[0];\n }\n // lineHeight奇怪的单位变化,%相对于fontSize\n else if(k === LINE_HEIGHT) {\n diff = calByUnit(p, n, computedStyle[FONT_SIZE], target.root);\n }\n // fontSize的%相对于parent的\n else if(k === FONT_SIZE) {\n diff = calByUnit(p, n, parentComputedStyle[FONT_SIZE], target.root);\n }\n // 相对于父height的特殊属性\n else if(k === FLEX_BASIS\n && ['column', 'column-reverse', 'columnReverse'].indexOf(computedStyle[FLEX_DIRECTION]) > -1\n || [HEIGHT, TOP, BOTTOM].indexOf(k) > -1) {\n if(p[1] !== AUTO && n[1] !== AUTO) {\n diff = calByUnit(p, n, parentComputedStyle[HEIGHT], target.root);\n }\n }\n // 其余都是相对于父width的\n else {\n if(p[1] !== AUTO && n[1] !== AUTO) {\n diff = calByUnit(p, n, parentComputedStyle[WIDTH], target.root);\n }\n }\n // 兜底NaN非法\n if(diff === 0 || isNaN(diff)) {\n return;\n }\n res[1] = diff;\n }\n else if(GEOM.hasOwnProperty(k)) {\n if(isNil(p)) {\n return;\n }\n else if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calDiff)) {\n let fn = GEOM[k][tagName].calDiff;\n if(target.isMulti) {\n let arr = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n arr.push(fn(p[i], n[i]));\n }\n return arr;\n }\n else {\n res[1] = fn(p, n);\n }\n }\n // 特殊处理multi\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.min(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(null);\n }\n else {\n let v3 = [];\n for(let k = 0, len3 = Math.max(pv2.length, nv2.length); k < len3; k++) {\n let pv3 = pv2[k];\n let nv3 = nv2[k];\n // control由4点变2点\n if(isNil(pv3) || isNil(nv3)) {\n v3.push(0);\n }\n else {\n v3.push(nv3 - pv3);\n }\n }\n v2.push(v3);\n }\n }\n res[1].push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n res[1].push([\n nv[0] - pv[0],\n nv[1] - pv[1],\n ]);\n }\n }\n }\n else {\n if(n === p || equalArr(n, p) || k === 'edge' || k === 'closure' || 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 {\n return [parseFloat(v) || 0, PX];\n }\n });\n }\n // display等不能有增量过程的\n else {\n return;\n }\n return res;\n}\n\n// 计算两帧之间不相同的变化,存入transition,相同的忽略\nfunction calFrame(prev, next, keys, target, tagName) {\n keys.forEach(k => {\n let ts = calDiff(prev[FRAME_STYLE], next[FRAME_STYLE], k, target, tagName);\n // 可以形成过渡的才会产生结果返回\n if(ts) {\n prev[FRAME_TRANSITION].push(ts);\n }\n });\n return next;\n}\n\nfunction binarySearch(i, j, time, frames) {\n if(i === j) {\n let frame = frames[i];\n if(frame[FRAME_TIME] > time) {\n return i - 1;\n }\n return i;\n }\n else {\n let middle = i + ((j - i) >> 1);\n let frame = frames[middle];\n if(frame[FRAME_TIME] === time) {\n return middle;\n }\n else if(frame[FRAME_TIME] > time) {\n return binarySearch(i, Math.max(middle - 1, i), time, frames);\n }\n else {\n return binarySearch(Math.min(middle + 1, j), j, time, frames);\n }\n }\n}\n\nfunction getEasing(ea) {\n let timingFunction;\n if(ea) {\n if((timingFunction = /^\\s*steps\\s*\\(\\s*(\\d+)(?:\\s*,\\s*(\\w+))?\\s*\\)/i.exec(ea))) {\n let steps = parseInt(timingFunction[1]);\n let stepsD = timingFunction[2];\n timingFunction = function(percent) {\n // steps有效定义正整数\n if(steps && steps > 0) {\n let per = 1 / steps;\n let n = stepsD === 'start' ? Math.ceil(percent / per) : Math.floor(percent / per);\n return n / steps;\n }\n return percent;\n };\n }\n else {\n timingFunction = easing.getEasing(ea);\n }\n }\n return timingFunction;\n}\n\n/**\n * 根据百分比和缓动函数计算中间态样式\n * 当easing定义为steps时,优先计算\n * @param frame 当前帧\n * @param keys 所有样式key\n * @param percent 到下一帧时间的百分比\n * @param target vd\n * @returns {*}\n */\nfunction calIntermediateStyle(frame, keys, percent, target) {\n let style = cloneStyle(frame[FRAME_STYLE], keys);\n let timingFunction = getEasing(frame[FRAME_EASING]);\n if(timingFunction && timingFunction !== linear) {\n percent = timingFunction(percent);\n }\n let transition = frame[FRAME_TRANSITION];\n for(let i = 0, len = transition.length; i < len; i++) {\n let [k, v] = transition[i];\n let st = style[k];\n // transform特殊处理,只有1个matrix,有可能不存在,需给默认矩阵\n if(k === TRANSFORM) {\n if(!st) {\n st = style[k] = [[MATRIX, mx.identity()]];\n }\n for(let i = 0; i < 16; i++) {\n st[0][1][i] += v[i] * percent;\n }\n }\n // 特殊的曲线运动计算,转换为translateXY,出现在最后一定会覆盖原本的translate防重\n else if(k === TRANSLATE_PATH) {\n let t = 1 - percent;\n if(v.length === 8) {\n style[TRANSLATE_X] = [\n v[0][0] * t * t * t\n + 3 * v[2][0] * percent * t * t\n + 3 * v[4][0] * percent * percent * t\n + v[6][0] * percent * percent * percent,\n PX,\n ];\n style[TRANSLATE_Y] = [\n v[1][0] * t * t * t\n + 3 * v[3][0] * percent * t * t\n + 3 * v[5][0] * percent * percent * t\n + v[7][0] * percent * percent * percent,\n PX,\n ];\n }\n else if(v.length === 6) {\n style[TRANSLATE_X] = [\n v[0][0] * t * t\n + 2 * v[2][0] * percent * t\n + v[4][0] * percent * percent,\n PX,\n ];\n style[TRANSLATE_Y] = [\n v[1][0] * t * t\n + 3 * v[3][0] * percent * t\n + v[5][0] * percent * percent,\n PX,\n ];\n }\n }\n else if(k === ROTATE_3D) {\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3][0] += v[3][0] * percent;\n }\n else if(NUM_CAL_HASH.hasOwnProperty(k)) {\n if(v) {\n st[0] += v * percent;\n }\n }\n else if(k === FILTER) {\n // 只有1个样式声明了filter另外一个为空,会造成无样式,需初始化数组并在下面计算出样式存入\n if(!st) {\n st = style[k] = [];\n }\n // 将已有的样式按key存入引用来操作\n let hash = {};\n st.forEach(item => {\n hash[item[0]] = item[1];\n });\n Object.keys(v).forEach(k => {\n if(hash.hasOwnProperty(k)) {\n hash[k][0] += v[k][0] * percent;\n }\n else {\n // 2个关键帧中有1个未声明,需新建样式存入\n if(k === 'blur' || k === 'hue-rotate' || k === 'grayscale') {\n let n = v[k].slice(0);\n n[0] *= percent;\n st.push([k, n]);\n }\n // 默认值是1而非0\n else if(k === 'saturate' || k === 'brightness' || k === 'contrast') {\n let n = v[k].slice(0);\n n[0] = 100 + n[0] * percent;\n st.push([k, n]);\n }\n }\n });\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n for(let i = 0; i < 2; i++) {\n st[i][0] += v[i] * percent;\n }\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n if(v[0] !== 0) {\n st[0][0] += v[0] * percent;\n }\n if(v[1] !== 0) {\n st[1][0] += v[1] * percent;\n }\n }\n else if(k === BOX_SHADOW) {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n st[i][j] += v[i][j] * percent;\n }\n // rgba\n for(let j = 0; j < 4; j++) {\n st[i][4][j] += v[i][4][j] * percent;\n }\n }\n }\n else if(k === BACKGROUND_SIZE) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0][0] += v[i][0] * percent;\n item[1][0] += v[i][1] * percent;\n }\n });\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0] += v[i] * percent;\n }\n });\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n st.forEach((st2, i) => {\n let v2 = v[i];\n if(!v2) {\n return;\n }\n let [c, d, p, z] = v2;\n if(GRADIENT_TYPE.hasOwnProperty(st2.k)) {\n for(let i = 0, len = Math.min(st2.v.length, c.length); i < len; i++) {\n let a = st2.v[i];\n let b = c[i];\n a[0][0] += b[0][0] * percent;\n a[0][1] += b[0][1] * percent;\n a[0][2] += b[0][2] * percent;\n a[0][3] += b[0][3] * percent;\n if(a[1] && b[1]) {\n a[1][0] += b[1] * percent;\n }\n }\n if(st2.k === 'linear' && st2.d !== undefined && d !== undefined) {\n if(Array.isArray(d)) {\n st2.d[0] += d[0] * percent;\n st2.d[1] += d[1] * percent;\n st2.d[2] += d[2] * percent;\n st2.d[3] += d[3] * percent;\n }\n else {\n st2.d += d * percent;\n }\n }\n if(st2.k === 'radial') {\n if(st2.z !== undefined && z !== undefined) {\n st2.z[0] += z[0] * percent;\n st2.z[1] += z[1] * percent;\n st2.z[2] += z[2] * percent;\n st2.z[3] += z[3] * percent;\n st2.z[4] += z[4] * percent;\n }\n else if(st2.p !== undefined && p !== undefined) {\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n else if(st2.k === 'conic' && st2.d !== undefined && d !== undefined) {\n st2.d += d * percent;\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n // fill纯色\n else {\n st2[0] += c[0] * percent;\n st2[1] += c[1] * percent;\n st2[2] += c[2] * percent;\n st2[3] += c[3] * percent;\n }\n });\n }\n // color可能超限[0,255],但浏览器已经做了限制,无需关心\n else if(COLOR_HASH.hasOwnProperty(k)) {\n st = st[0];\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n else if(GEOM.hasOwnProperty(k)) {\n let st = style[k];\n let tagName = target.tagName;\n if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calIncrease)) {\n let fn = GEOM[k][tagName].calIncrease;\n if(target.isMulti) {\n style[k] = st.map((item, i) => {\n return fn(item, v[i], percent);\n });\n }\n else {\n style[k] = fn(st, v, percent);\n }\n }\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n let o2 = o[j];\n let n2 = n[j];\n if(!isNil(o2) && !isNil(n2)) {\n for(let k = 0, len3 = Math.min(o2.length, n2.length); k < len3; k++) {\n if(!isNil(o2[k]) && !isNil(n2[k])) {\n o2[k] += n2[k] * percent;\n }\n }\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n v.forEach((item, i) => {\n let st2 = st[i];\n if(!isNil(item) && !isNil(st2)) {\n for(let i = 0, len = Math.min(st2.length, item.length); i < len; i++) {\n let o = st2[i];\n let n = item[i];\n if(!isNil(o) && !isNil(n)) {\n st2[i] += n * percent;\n }\n }\n }\n });\n }\n else {\n v.forEach((item, i) => {\n if(!isNil(item) && !isNil(st[i])) {\n st[i] += item * percent;\n }\n });\n }\n }\n else {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n if(!isNil(o[j]) && !isNil(n[j])) {\n o[j] += n[j] * percent;\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(!isNil(st[0]) && !isNil(v[0])) {\n st[0] += v[0] * percent;\n }\n if(!isNil(st[1]) && !isNil(v[1])) {\n st[1] += v[1] * percent;\n }\n }\n else {\n if(!isNil(st) && !isNil(v)) {\n style[k] += v * percent;\n }\n }\n }\n }\n else if(k === OPACITY || k === Z_INDEX) {\n style[k] += v * percent;\n // 精度问题可能会超过[0,1]区间\n if(k === OPACITY) {\n if(style[k] < 0) {\n style[k] = 0;\n }\n else if(style[k] > 1) {\n style[k] = 1;\n }\n }\n }\n }\n return style;\n}\n\nfunction gotoOverload(options, cb) {\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n return [options || {}, cb];\n}\n\nlet uuid = 0;\n\nclass Animation extends Event {\n constructor(target, list, options) {\n super();\n this.__id = uuid++;\n list = clone(list || []);\n if(Array.isArray(list)) {\n list = list.filter(item => item && isObject(item));\n }\n // 动画过程另外一种形式,object描述k-v形式\n else if(list && isObject(list)) {\n let nl = [];\n Object.keys(list).forEach(k => {\n let v = list[k];\n if(Array.isArray(v)) {\n for(let i = 0, len = v.length; i < len; i++) {\n let o = nl[i] = nl[i] || {\n offset: i / (len - 1),\n };\n o[k] = v[i];\n }\n }\n });\n list = nl;\n }\n else {\n list = [];\n }\n if(isNumber(options)) {\n this.__options = {\n duration: options,\n };\n options = this.__options;\n }\n let op = this.__options = options || {\n duration: 0,\n };\n let root = target.root;\n let config = this.__config = [\n false, // assigning\n false, // inFps\n false, // isDelay\n false, // begin\n false, // end\n false, // finished\n false, // nextBegin\n true, // firstPlay\n this.__frameCb,\n null, // playCb\n target,\n root,\n null, // frames\n null, // framesR\n 0, // currentTime\n 0, // nextTime\n {}, // style\n 0, // duration\n 1, // iterations\n 'none', // fill\n 1, // playbackRate\n 0, // playCount\n 'idle',\n false, // destroy\n 0, // startTime\n 0, // fpsTime\n op.easing,\n false, // enterFrame\n 0, // delay\n 0, // endDelay\n null, // keys,\n null, // originStyle,\n null, // currentFrames\n null, // currentFrame\n false, // spfLimit\n 60, // fps\n 'normal', // direction\n this.__calDiffTime,\n true, // firstEnter,\n false, // stayBegin\n false, // stayEnd\n false, // is2\n 0, // endTime\n target.__config, // nodeConfig\n root && root.__config, // rootConfig,destroy后root可能为空\n false, // outBeginDelay\n ];\n let iterations = this.iterations = op.iterations;\n let duration = this.duration = op.duration;\n let [frames, framesR, keys, originStyle] = this.__init(list, iterations, duration, op.easing, target);\n config[I_FRAMES] = frames;\n config[I_FRAMES_R] = framesR;\n config[I_KEYS] = keys;\n config[I_ORIGIN_STYLE] = originStyle;\n if(frames.length === 2) {\n config[I_IS2] = true;\n config[I_END_TIME] = frames[1][FRAME_TIME];\n }\n let fps = parseInt(op.fps) || 0;\n if(fps <= 0) {\n fps = 60;\n }\n this.fps = fps;\n this.spfLimit = op.spfLimit;\n this.delay = op.delay;\n this.endDelay = op.endDelay;\n this.playbackRate = op.playbackRate;\n this.fill = op.fill;\n this.iterations = op.iterations;\n this.direction = op.direction;\n config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(op.direction) ? framesR : frames;\n // 时间戳\n config[I_TIME_STAMP] = frame.__now;\n // 性能优化访问\n this[0] = this.__before;\n this[1] = this.__after;\n }\n\n __init(list, iterations, duration, easing, target) {\n if(list.length < 1) {\n return [[], [], [], {}];\n }\n // 过滤时间非法的,过滤后续offset<=前面的\n let offset = -1;\n let tagName = target.tagName;\n for(let i = 0, len = list.length; i < len; i++) {\n let current = list[i];\n if(current.hasOwnProperty('offset')) {\n current.offset = parseFloat(current.offset) || 0;\n current.offset = Math.max(0, current.offset);\n current.offset = Math.min(1, current.offset);\n // 超过区间[0,1]\n if(isNaN(current.offset) || current.offset < 0 || current.offset > 1) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n // <=前面的\n else if(current.offset <= offset) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n }\n // 缩写处理\n Object.keys(current).forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(current, k);\n }\n });\n // 检查key合法性\n Object.keys(current).forEach(k => {\n if(k !== 'easing' && k !== 'offset' && !change.isValid(tagName, k)) {\n delete current[k];\n }\n });\n }\n // 只有1帧复制出来变成2帧方便运行\n if(list.length === 1) {\n list[0] = clone(list[0]);\n if(list[0].offset === 1) {\n list.unshift({\n offset: 0,\n });\n }\n else {\n let copy = clone(list[0]);\n copy.offset = 1;\n list.push(copy);\n }\n }\n // 强制clone防止同引用\n else {\n list.forEach((item, i) => {\n list[i] = clone(item);\n });\n }\n // 首尾时间偏移强制为[0, 1],不是的话前后加空帧\n let first = list[0];\n if(first.hasOwnProperty('offset') && first.offset > 0) {\n first = {\n offset: 0,\n };\n list.unshift(first);\n }\n else {\n first.offset = 0;\n }\n let last = list[list.length - 1];\n if(last.hasOwnProperty('offset') && last.offset < 1) {\n last = {\n offset: 1,\n };\n list.push(last);\n }\n else {\n last.offset = 1;\n }\n // 计算没有设置offset的时间\n for(let i = 1, len = list.length; i < len; i++) {\n let start = list[i];\n // 从i=1开始offset一定>0,找到下一个有offset的,均分中间无声明的\n if(!start.hasOwnProperty('offset')) {\n let end;\n let j = i + 1;\n for(; j < len; j++) {\n end = list[j];\n if(end.hasOwnProperty('offset')) {\n break;\n }\n }\n let num = j - i + 1;\n start = list[i - 1];\n let per = (end.offset - start.offset) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.offset = start.offset + per * (k + 1 - i);\n }\n i = j;\n }\n }\n let frames = [];\n // 换算每一关键帧样式标准化\n list.forEach(item => {\n frames.push(framing(item, duration, easing));\n });\n // 为方便两帧之间计算变化,强制统一所有帧的css属性相同,没有写的为节点的当前样式currentStyle\n let keys = unify(frames, target);\n inherit(frames, keys, target);\n let framesR = clone(frames).reverse();\n // 存储原本样式以便恢复用\n let { style, props } = target;\n let originStyle = {};\n keys.forEach(k => {\n if(isGeom(tagName, k)) {\n originStyle[k] = props[k];\n }\n originStyle[k] = style[k];\n });\n // 再计算两帧之间的变化,存入transition属性\n let length = frames.length;\n let prev = frames[0];\n for(let i = 1; i < length; i++) {\n let next = frames[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n // 反向存储帧的倒排结果\n framesR.forEach(item => {\n item[FRAME_TIME] = duration - item[FRAME_TIME];\n item[FRAME_TRANSITION] = [];\n });\n prev = framesR[0];\n for(let i = 1; i < length; i++) {\n let next = framesR[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n return [frames, framesR, keys, originStyle];\n }\n\n __clean(isFinish) {\n let __config = this.__config;\n this.__cancelTask();\n __config[I_NEXT_TIME] = 0;\n let restore;\n let style = __config[I_STYLE];\n let keys = __config[I_KEYS];\n let target = __config[I_TARGET];\n if(isFinish) {\n __config[I_CURRENT_TIME] = __config[I_DELAY] + __config[I_DURATION] + __config[I_END_DELAY];\n if(__config[I_PLAY_STATE] === 'finish') {\n return;\n }\n __config[I_PLAY_STATE] = 'finish';\n // cancel需要清除finish根据情况保留\n if(!__config[I_STAY_END]) {\n __config[I_STYLE] = {};\n restore = true;\n }\n }\n else {\n __config[I_PLAY_COUNT] = __config[I_CURRENT_TIME] = 0;\n if(__config[I_PLAY_STATE] === 'idle') {\n return;\n }\n __config[I_PLAY_STATE] = 'idle';\n __config[I_STYLE] = {};\n restore = true;\n }\n // 动画取消结束不停留在最后一帧需要还原target原本的样式,需要对比目前是否是由本动画赋值的\n if(restore) {\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n if(target.__currentProps[k] === style[k]) {\n target.__currentProps[k] = target.props[k];\n }\n }\n else {\n if(target.__currentStyle[k] === style[k]) {\n target.__currentStyle[k] = target.style[k];\n }\n }\n });\n }\n }\n\n __frameCb(__config, diff, isDelay) {\n this.emit(Event.FRAME, diff, isDelay);\n if(__config[I_FIRST_PLAY]) {\n __config[I_FIRST_PLAY] = false;\n this.emit(Event.PLAY);\n }\n if(isFunction(__config[I_PLAY_CB])) {\n __config[I_PLAY_CB].call(this, diff, isDelay);\n __config[I_PLAY_CB] = null;\n }\n }\n\n __calDiffTime(__config, diff) {\n let playbackRate = __config[I_PLAYBACK_RATE];\n let spfLimit = __config[I_SPF_LIMIT];\n let fps = __config[I_FPS];\n let v = __config[I_CURRENT_TIME] = __config[I_NEXT_TIME];\n // 定帧限制每帧时间间隔最大为spf\n if(spfLimit) {\n if(spfLimit === true) {\n diff = Math.min(diff, 1000 / fps);\n }\n else if(spfLimit > 0) {\n diff = Math.min(diff, spfLimit);\n }\n }\n // 播放时间累加,并且考虑播放速度加成\n if(playbackRate !== 1 && playbackRate > 0) {\n diff *= playbackRate;\n }\n __config[I_NEXT_TIME] += diff;\n return [v, diff];\n }\n\n play(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n if(playState === 'running') {\n return this;\n }\n this.__cancelTask();\n __config[I_PLAY_CB] = cb;\n __config[I_PLAY_STATE] = 'running';\n // 每次play调用标识第一次运行,需响应play事件和回调\n __config[I_FIRST_PLAY] = true;\n // 防止finish/cancel事件重复触发,每次播放重置\n this.__hasFin = false;\n this.__hasCancel = false;\n // 只有第一次调用会进初始化,另外finish/cancel视为销毁也会重新初始化\n if(!__config[I_ENTER_FRAME]) {\n __config[I_ENTER_FRAME] = true;\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n // 初始化根据方向确定帧序列\n __config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction) ? framesR : frames;\n __config[I_CURRENT_TIME] = __config[I_NEXT_TIME] = __config[I_FPS_TIME] = 0;\n }\n // 添加每帧回调且立刻执行,本次执行调用refreshTask也是下一帧再渲染,frame的每帧都是下一帧\n frame.offFrame(this);\n frame.onFrame(this);\n __config[I_START_TIME] = frame.__now;\n __config[I_END] = false;\n return this;\n }\n\n __before(diff) {\n let __config = this.__config;\n __config[I_TIME_STAMP] = frame.__now;\n let target = __config[I_TARGET];\n let fps = __config[I_FPS];\n let playCount = __config[I_PLAY_COUNT];\n let currentFrames = __config[I_CURRENT_FRAMES];\n let iterations = __config[I_ITERATIONS];\n let stayBegin = __config[I_STAY_BEGIN];\n let stayEnd = __config[I_STAY_END];\n let delay = __config[I_DELAY];\n let root = __config[I_ROOT];\n let is2 = __config[I_IS2];\n let endTime = __config[I_END_TIME];\n let duration = __config[I_DURATION];\n let endDelay = __config[I_END_DELAY];\n let length = currentFrames.length;\n // 用本帧和上帧时间差,计算累加运行时间currentTime,以便定位当前应该处于哪个时刻\n let [currentTime, d] = __config[I_CAL_DIFF_TIME](__config, diff);\n diff = d;\n // 增加的fps功能,当<60时计算跳帧,每帧运行依旧累加时间,达到fps时重置,第一帧强制不跳\n if(!__config[I_FIRST_ENTER] && fps < 60) {\n diff = __config[I_FPS_TIME] += diff;\n if(diff < 1000 / fps) {\n __config[I_IN_FPS] = true;\n return;\n }\n __config[I_FPS_TIME] = 0;\n }\n __config[I_FIRST_ENTER] = false;\n // delay仅第一次生效\n if(playCount === 0 && currentTime < delay) {\n if(stayBegin) {\n let currentFrame = __config[I_CURRENT_FRAME] = currentFrames[0];\n let current = currentFrame[FRAME_STYLE];\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n }\n // 即便不刷新,依旧执行帧回调,同时标明让后续第一帧响应begin\n __config[I_OUT_BEGIN_DELAY] = true;\n __config[I_IS_DELAY] = true;\n return;\n }\n // 减去delay,计算在哪一帧,仅首轮\n if(playCount === 0) {\n currentTime -= delay;\n }\n if(currentTime === 0 || __config[I_OUT_BEGIN_DELAY]) {\n __config[I_OUT_BEGIN_DELAY] = false;\n __config[I_BEGIN] = true;\n }\n // 超过duration非尾轮需处理回到开头,触发新一轮动画事件,这里可能时间间隔非常大直接跳过几轮\n let round;\n while(currentTime >= duration && playCount < iterations - 1) {\n currentTime -= duration;\n __config[I_NEXT_TIME] -= duration;\n playCount = ++__config[I_PLAY_COUNT];\n __config[I_BEGIN] = true;\n round = true;\n }\n // 如果发生轮换,需重新确定正反向\n if(round) {\n let direction = __config[I_DIRECTION];\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let isAlternate = {\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction);\n // 有正反向播放需要重设帧序列\n if(isAlternate) {\n let isEven = playCount % 2 === 0;\n if(direction === 'alternate') {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n }\n let isLastCount = playCount >= iterations - 1;\n // 只有2帧可优化,否则2分查找当前帧\n let i, frameTime;\n if(is2) {\n i = currentTime < endTime ? 0 : 1;\n frameTime = endTime;\n }\n else {\n i = binarySearch(0, length - 1, currentTime, currentFrames);\n frameTime = currentFrames[i][FRAME_TIME];\n }\n // 最后一帧结束动画,仅最后一轮才会进入,需处理endDelay\n let isLastFrame = isLastCount && i === length - 1;\n let percent = 0;\n if(isLastFrame) {\n // 无需任何处理\n }\n // 否则根据目前到下一帧的时间差,计算百分比,再反馈到变化数值上\n else if(is2) {\n percent = currentTime / duration;\n }\n else {\n let total = currentFrames[i + 1][FRAME_TIME] - frameTime;\n percent = (currentTime - frameTime) / total;\n }\n let inEndDelay, currentFrame = currentFrames[i], current;\n __config[I_CURRENT_FRAME] = currentFrame;\n /** 这里要考虑全几种场景:\n * 1. 单次播放无endDelay且fill不停留(有/无差异,下同)\n * 2. 单次播放无endDelay且fill停留\n * 3. 单次播放有endDelay且fill不停留\n * 4. 单次播放有endDelay且fill停留\n * 5. 多次播放无endDelay且fill不停留(尾次/非尾次,下同)\n * 6. 多次播放无endDelay且fill停留\n * 7. 多次播放有endDelay且fill不停留\n * 8. 多次播放有endDelay且fill停留\n */\n let needClean;\n if(isLastFrame) {\n inEndDelay = currentTime < duration + endDelay;\n // 停留对比最后一帧,endDelay可能会多次进入这里,第二次进入样式相等不再重绘\n if(stayEnd) {\n current = cloneStyle(currentFrame[FRAME_STYLE], __config[I_KEYS]);\n }\n // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里\n else {\n current = cloneStyle(__config[I_ORIGIN_STYLE], __config[I_KEYS]);\n }\n // 进入endDelay或结束阶段触发end事件,注意只触发一次,防重在触发的地方做\n __config[I_NEXT_END] = true;\n if(!inEndDelay) {\n __config[I_PLAY_COUNT]++;\n __config[I_FINISHED] = true;\n frame.offFrame(this);\n needClean = true;\n __config[I_NEXT_TIME] = 0;\n }\n }\n else {\n current = calIntermediateStyle(currentFrame, __config[I_KEYS], percent, target);\n }\n // 无论两帧之间是否有变化,都生成计算结果赋给style,去重在root做\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n if(needClean) {\n 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 __config[I_FRAME_CB].call(this, __config, diff, __config[I_IS_DELAY]);\n __config[I_IS_DELAY] = false;\n if(__config[I_BEGIN]) {\n __config[I_BEGIN] = false;\n this.emit(Event.BEGIN, __config[I_PLAY_COUNT]);\n }\n // end事件只触发一次,末轮进入endDelay或直接结束时\n if(__config[I_NEXT_END] && !__config[I_END]) {\n __config[I_END] = true;\n this.emit(Event.END, __config[I_PLAY_COUNT] - 1);\n }\n if(__config[I_FINISHED]) {\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n __config[I_PLAY_STATE] = 'finished';\n this.emit(Event.FINISH);\n }\n }\n\n pause(silence) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let { pending } = this;\n if(isDestroyed || duration <= 0 || pending) {\n return this;\n }\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(!silence) {\n this.emit(Event.PAUSE);\n }\n return this;\n }\n\n resume(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n if(isDestroyed || duration <= 0 || playState !== 'paused') {\n return this;\n }\n return this.play(cb);\n }\n\n finish(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1 || playState === 'finished' || playState === 'idle') {\n return self;\n }\n // 先清除所有回调任务,多次调用finish也会清除只留最后一次\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n let current;\n // 停留在最后一帧\n if(__config[I_STAY_END]) {\n __config[I_CURRENT_FRAME] = frames[frames.length - 1];\n current = frames[frames.length - 1][FRAME_STYLE];\n }\n else {\n current = originStyle;\n }\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(current, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean(true);\n },\n __after(diff) {\n if(!self.__hasFin) {\n self.__hasFin = true;\n __config[I_ASSIGNING] = false;\n __config[I_FRAME_CB].call(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.FINISH);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n cancel(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || playState === 'idle' || frames.length < 1) {\n return self;\n }\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(originStyle, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean();\n },\n __after(diff) {\n if(!self.__hasCancel) {\n self.__hasCancel = true;\n __config[I_ASSIGNING] = false;\n __config[I_FRAME_CB].call(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.CANCEL);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n gotoAndPlay(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n // 计算出时间点直接累加播放\n this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n return this.play(cb);\n }\n\n gotoAndStop(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n v = this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n // 先play一帧,回调里模拟暂停\n return this.play(diff => {\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isFunction(cb)) {\n cb.call(this, diff);\n }\n });\n }\n\n // 同步赋予,用在extendAnimate\n assignCurrentStyle() {\n let __config = this.__config;\n let style = __config[I_STYLE];\n let target = __config[I_TARGET];\n let keys = __config[I_KEYS];\n keys.forEach(i => {\n if(style.hasOwnProperty(i)) {\n let v = style[i];\n // geom的属性变化\n if(GEOM.hasOwnProperty(i)) {\n target.currentProps[i] = v;\n }\n // 样式\n else {\n // 将动画样式直接赋给currentStyle\n target.currentStyle[i] = v;\n }\n }\n });\n }\n\n __goto(v, isFrame, excludeDelay) {\n let __config = this.__config;\n let duration = __config[I_DURATION];\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isNaN(v) || v < 0) {\n throw new Error('Param of gotoAnd(Play/Stop) is illegal: ' + v);\n }\n if(isFrame) {\n v = (v - 1) / this.spf;\n }\n if(excludeDelay) {\n v += __config[I_DELAY];\n }\n // 超过一轮去掉delay\n if(v > duration + __config[I_DELAY]) {\n v -= __config[I_DELAY];\n }\n // 超过时间长度需要累加次数\n __config[I_PLAY_COUNT] = 0;\n while(v > duration && __config[I_PLAY_COUNT] < __config[I_ITERATIONS] - 1) {\n __config[I_PLAY_COUNT]++;\n v -= duration;\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n __config[I_NEXT_TIME] = v;\n // 防止play()重置时间和当前帧组,提前计算好\n __config[I_ENTER_FRAME] = true;\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n if({\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction)) {\n let isEven = __config[I_PLAY_COUNT] % 2 === 0;\n if(direction === 'alternate') {\n __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n return v;\n }\n\n addControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.add(this);\n }\n }\n\n removeControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.remove(this);\n }\n }\n\n __stayBegin() {\n return {\n backwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __stayEnd() {\n return {\n forwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __setTarget(target) {\n this.__target = target;\n this.__config[I_TARGET] = target;\n this.__config[I_NODE_CONFIG] = target.__config;\n }\n\n __cancelTask() {\n frame.offFrame(this);\n this.__config[I_PLAY_CB] = null;\n }\n\n __destroy(sync) {\n let self = this;\n let __config = self.__config;\n if(__config[I_DESTROYED]) {\n return;\n }\n self.removeControl();\n // clean异步执行,因为里面的样式还原需要等到下一帧,否则同步执行清除后,紧接着的新同步动画获取不到currentStyle\n if(sync) {\n self.__clean();\n __config[I_TARGET] = null;\n }\n else {\n frame.nextFrame({\n __before() {\n self.__clean();\n __config[I_TARGET] = null;\n },\n });\n }\n __config[I_START_TIME] = 0;\n __config[I_DESTROYED] = true;\n }\n\n __checkModify() {\n let __config = this.__config;\n if(__config[I_PLAY_STATE] !== 'idle' && __config[I_PLAY_STATE] !== 'finished') {\n inject.warn('Modification will not come into effect when animation is running');\n }\n }\n\n get id() {\n return this.__id;\n }\n\n get target() {\n return this.__config[I_TARGET];\n }\n\n get root() {\n return this.__config[I_ROOT];\n }\n\n get keys() {\n return this.__config[I_KEYS];\n }\n\n get style() {\n return this.__config[I_STYLE];\n }\n\n get options() {\n return this.__options;\n }\n\n get duration() {\n return this.__config[I_DURATION];\n }\n\n set duration(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DURATION] !== v) {\n __config[I_DURATION] = v;\n __config[I_END_TIME] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get delay() {\n return this.__config[I_DELAY];\n }\n\n set delay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DELAY] !== v) {\n __config[I_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get endDelay() {\n return this.__config[I_END_DELAY];\n }\n\n set endDelay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_END_DELAY] !== v) {\n __config[I_END_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get fps() {\n return this.__config[I_FPS];\n }\n\n set fps(v) {\n v = parseInt(v) || 60;\n let __config = this.__config;\n if(__config[I_FPS] !== v) {\n if(v <= 0) {\n v = 60;\n }\n __config[I_FPS] = v;\n }\n return v;\n }\n\n get spf() {\n return 1 / this.fps;\n }\n\n get iterations() {\n return this.__config[I_ITERATIONS];\n }\n\n set iterations(v) {\n if(v === Infinity || util.isString(v) && v.toLowerCase() === 'infinity') {\n v = Infinity;\n }\n else {\n v = parseInt(v);\n if(isNaN(v) || v < 0) {\n v = 1;\n }\n }\n let __config = this.__config;\n if(__config[I_ITERATIONS] !== v) {\n __config[I_ITERATIONS] = v;\n }\n return v;\n }\n\n get fill() {\n return this.__config[I_FILL];\n }\n\n set fill(v) {\n v = v || 'none';\n let __config = this.__config;\n if(__config[I_FILL] !== v) {\n __config[I_FILL] = v;\n this.__checkModify();\n }\n __config[I_STAY_BEGIN] = {\n backwards: true,\n both: true,\n }.hasOwnProperty(v);\n __config[I_STAY_END] = {\n forwards: true,\n both: true,\n }.hasOwnProperty(v);\n return v;\n }\n\n get direction() {\n return this.__config[I_DIRECTION];\n }\n\n set direction(v) {\n v = v || 'normal';\n let __config = this.__config;\n if(__config[I_DIRECTION] !== v) {\n __config[I_DIRECTION] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get frames() {\n return this.__config[I_FRAMES];\n }\n\n get framesR() {\n return this.__config[I_FRAMES_R];\n }\n\n get playbackRate() {\n return this.__config[I_PLAYBACK_RATE];\n }\n\n set playbackRate(v) {\n v = parseFloat(v) || 1;\n if(v <= 0) {\n v = 1;\n }\n let __config = this.__config;\n if(__config[I_PLAYBACK_RATE] !== v) {\n __config[I_PLAYBACK_RATE] = v;\n }\n return v;\n }\n\n get easing() {\n return this.__config[I_EASING];\n }\n\n get startTime() {\n return this.__config[I_START_TIME];\n }\n\n get currentTime() {\n return this.__config[I_CURRENT_TIME];\n }\n\n set currentTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_CURRENT_TIME] !== v) {\n __config[I_CURRENT_TIME] = v;\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get nextTime() {\n return this.__config[I_NEXT_TIME];\n }\n\n set nextTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_NEXT_TIME] !== v) {\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get timestamp() {\n return this.__config[I_TIME_STAMP];\n }\n\n get pending() {\n return this.__config[I_PLAY_STATE] !== 'running';\n }\n\n get finished() {\n return this.__config[I_PLAY_STATE] === 'finished';\n }\n\n get playState() {\n return this.__config[I_PLAY_STATE];\n }\n\n get playCount() {\n return this.__config[I_PLAY_COUNT];\n }\n\n set playCount(v) {\n v = Math.max(0, parseInt(v) || 0);\n let __config = this.__config;\n if(__config[I_PLAY_COUNT] !== v) {\n __config[I_PLAY_COUNT] = v;\n }\n return v;\n }\n\n get isDestroyed() {\n return this.__config[I_DESTROYED];\n }\n\n get animating() {\n let __config = this.__config;\n let playState = __config[I_PLAY_STATE];\n if(playState === 'idle') {\n return false;\n }\n return playState !== 'finished' || __config[I_STAY_END] || __config[I_STAY_BEGIN];\n }\n\n get spfLimit() {\n let __config = this.__config;\n return __config[I_SPF_LIMIT];\n }\n\n set spfLimit(v) {\n if(util.isNumber(v) || /^\\d/.test(v)) {\n v = Math.max(0, parseInt(v) || 0);\n }\n else {\n v = !!v;\n }\n let __config = this.__config;\n if(__config[I_SPF_LIMIT] !== v) {\n __config[I_SPF_LIMIT] = v;\n }\n return v;\n }\n\n get assigning() {\n return this.__config[I_ASSIGNING];\n }\n}\n\nexport default Animation;\n","import mode from '../node/mode';\nimport geom from '../math/geom';\nimport blur from '../math/blur';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\n\nconst {\n NODE_KEY: {\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { int2rgba } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nfunction renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h, 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, DEG } = unit;\nconst { int2rgba, rgba2int, joinArr, isNil } = util;\nconst { calRelative } = css;\nconst { GEOM } = change;\nconst { mbmName, isValidMbm } = mbm;\nconst { point2d } = mx;\n\nconst {\n contain,\n NONE,\n TRANSFORM: TF,\n REFLOW,\n REPAINT,\n TRANSLATE_X: TX,\n TRANSLATE_Y: TY,\n TRANSLATE_Z: TZ,\n} = level;\n\nfunction getFirstEmptyInlineWidth(xom) {\n let n = 0;\n let flowChildren = xom.flowChildren;\n let length = flowChildren.length;\n for(let i = 0; i < length; i++) {\n let child = flowChildren[i];\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.flowChildren.length) {\n n += getFirstEmptyInlineWidth(child);\n break;\n }\n else if(child.__config[NODE_IS_INLINE]) {\n n += child.outerWidth;\n }\n }\n else {\n break;\n }\n }\n return n;\n}\n\nfunction getLastEmptyInlineWidth(xom) {\n let n = 0;\n let flowChildren = xom.flowChildren;\n let length = flowChildren.length;\n for(let i = length - 1; i >= 0; i--) {\n let child = flowChildren[i];\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.flowChildren.length) {\n n += getLastEmptyInlineWidth(child);\n break;\n }\n else {\n n += child.outerWidth;\n }\n }\n else {\n break;\n }\n }\n return n;\n}\n\nclass Xom extends Node {\n constructor(tagName, props = {}) {\n super();\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__tagName = tagName;\n this.__style = this.props.style || {}; // style被解析后的k-v形式\n this.__currentStyle = {}; // 动画过程中绘制一开始会merge动画样式\n this.__computedStyle = {}; // 类似getComputedStyle()将currentStyle计算好数值赋给\n this.__listener = {};\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n this.listener[k] = v;\n }\n });\n this.__animationList = [];\n this.__loadBgi = {\n // 刷新回调函数,用以destroy取消用\n cb: function() {\n },\n };\n this.__cacheStyle = {}; // 是否缓存重新计算computedStyle的样式key\n this.__cacheDefs = []; // svg专用,缓存渲染时使用已有的defs,diff过程用,否则会defs被清空\n let isClip = this.__isClip = !!this.props.clip;\n let isMask = this.__isMask = isClip || !!this.props.mask;\n let config = this.__config;\n config[NODE_TAG_NAME] = tagName;\n config[NODE_CACHE_STYLE] = this.__cacheStyle;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_COMPUTED_STYLE] = this.__computedStyle;\n config[NODE_REFRESH_LV] = REFLOW;\n config[NODE_STYLE] = this.__style;\n config[NODE_MATRIX] = [];\n config[NODE_MATRIX_EVENT] = [];\n config[NODE_DEFS_CACHE] = this.__cacheDefs;\n config[NODE_IS_MASK] = isMask;\n this.__frameAnimateList = [];\n this.__contentBoxList = []; // inline存储内容用\n // this.__json domApi需要获取生成时的json引用,builder过程添加,如appendChild时json也需要跟着变更\n 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 return 0;\n }\n\n // dom常用的几种尺寸赋值\n __ioSize(w, h) {\n let computedStyle = this.computedStyle;\n this.__clientWidth = w += computedStyle[PADDING_LEFT] + computedStyle[PADDING_RIGHT];\n this.__clientHeight = h += computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM];\n this.__offsetWidth = w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[BORDER_RIGHT_WIDTH];\n this.__offsetHeight = h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH];\n this.__outerWidth = w + computedStyle[MARGIN_LEFT] + computedStyle[MARGIN_RIGHT];\n this.__outerHeight = h + computedStyle[MARGIN_TOP] + computedStyle[MARGIN_BOTTOM];\n }\n\n // 换算margin/padding为px单位,onlyFixedValue只考虑绝对值,不考虑百分比等\n __calMp(v, w, onlyFixedValue) {\n let n = 0;\n if(v[1] === PX) {\n n += v[0];\n }\n else if(v[1] === PERCENT && !onlyFixedValue) {\n v[0] *= w * 0.01;\n v[1] = PX;\n n += v[0];\n }\n else if(v[1] === REM) {\n n += v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n n += v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n n += v[0] * this.root.height * 0.01;\n }\n return n;\n }\n\n // 为basis的b/min/max添加mpb,只有当b未显示指定等于w/content时才加,同时返回mpb值\n __addMp(isDirectionRow, w, currentStyle, res, isDirectItem) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w, !isDirectItem)\n + this.__calMp(marginRight, w, !isDirectItem)\n + this.__calMp(paddingLeft, w, !isDirectItem)\n + this.__calMp(paddingRight, w, !isDirectItem);\n if(borderLeftWidth[1] === PX) {\n mp += borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n mp += borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n mp += borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n mp += borderLeftWidth[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n mp += borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n mp += borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n mp += borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n mp += borderRightWidth[0] * this.root.height * 0.01;\n }\n res = res.map(item => item + mp);\n }\n else {\n let mp = this.__calMp(marginTop, w, !isDirectItem)\n + this.__calMp(marginBottom, w, !isDirectItem)\n + this.__calMp(paddingTop, w, !isDirectItem)\n + this.__calMp(paddingBottom, w, !isDirectItem);\n if(borderTopWidth[1] === PX) {\n mp += borderTopWidth[0];\n }\n else if(borderTopWidth[1] === REM) {\n mp += borderTopWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderTopWidth[1] === VW) {\n mp += borderTopWidth[0] * this.root.width * 0.01;\n }\n else if(borderTopWidth[1] === VH) {\n mp += borderTopWidth[0] * this.root.height * 0.01;\n }\n if(borderBottomWidth[1] === PX) {\n mp += borderBottomWidth[0];\n }\n else if(borderBottomWidth[1] === REM) {\n mp += borderBottomWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderBottomWidth[1] === VW) {\n mp += borderBottomWidth[0] * this.root.width * 0.01;\n }\n else if(borderBottomWidth[1] === VH) {\n mp += borderBottomWidth[0] * this.root.height * 0.01;\n }\n res = res.map(item => item + mp);\n }\n return res;\n }\n\n // absolute且无尺寸时,isVirtual标明先假布局一次计算尺寸,还有flex列计算时\n // fromAbs为absolute节点特有省略计算标识,本节点是abs时真正布局传入\n __layout(data, isVirtual, fromAbs) {\n css.computeReflow(this, this.isShadowRoot);\n let { w } = data;\n let { isDestroyed, currentStyle, computedStyle, __config } = this;\n let {\n [DISPLAY]: display,\n } = computedStyle;\n let {\n [WIDTH]: width,\n [POSITION]: position,\n } = currentStyle;\n this.clearCache();\n this.__layoutData = {\n x: data.x,\n y: data.y,\n w: data.w,\n h: data.h,\n lx: data.lx,\n };\n __config[NODE_REFRESH_LV] = REFLOW;\n __config[NODE_LIMIT_CACHE] = false;\n __config[NODE_IS_INLINE] = false;\n // 防止display:none不统计mask,isVirtual忽略,abs布局后续会真正来走一遍\n if(!isVirtual) {\n let { next } = this;\n // mask关系只有布局才会变更,普通渲染关系不会改变,clip也是mask的一种\n if(!this.isMask && next && (next.isMask)) {\n let count = 0;\n while(next) {\n if(next.isMask) {\n count++;\n }\n else {\n break;\n }\n next = next.next;\n }\n this.__hasMask = count;\n }\n }\n this.__ox = this.__oy = 0;\n if(isDestroyed || display === 'none') {\n this.__width = this.__height\n = this.__clientWidth = this.__clientHeight\n = this.__offsetWidth = this.__offsetHeight\n = this.__outerWidth = this.__outerHeight\n = computedStyle[WIDTH] = computedStyle[HEIGHT] = 0;\n this.__x = data.x;\n this.__y = data.y;\n this.__layoutNone();\n return;\n }\n // margin/padding在abs前已经计算过了,无需二次计算\n if(!fromAbs) {\n this.__mp(currentStyle, computedStyle, w);\n }\n // inline的width/height无效,其它有效\n if(width[1] !== AUTO) {\n if(this.__isRealInline() && currentStyle[DISPLAY] === 'inline') {\n width[0] = 0;\n width[1] = AUTO;\n }\n else {\n switch(width[1]) {\n case PX:\n w = width[0];\n break;\n case PERCENT:\n w *= width[0] * 0.01;\n break;\n case REM:\n w = width[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n w = width[0] * this.root.width * 0.01;\n break;\n case VH:\n w = width[0] * this.root.height * 0.01;\n break;\n }\n }\n }\n let lineClampCount = 0;\n // 4种布局,默认block,inlineBlock基本可以复用inline逻辑,除了尺寸\n if(display === 'flex') {\n this.__layoutFlex(data, isVirtual);\n }\n else if(display === 'inlineBlock' || display === 'inline-block') {\n lineClampCount = this.__layoutInline(data, isVirtual);\n }\n else if(display === 'inline') {\n lineClampCount = this.__layoutInline(data, isVirtual, true);\n }\n else {\n this.__layoutBlock(data, isVirtual);\n }\n // relative渲染时做偏移,百分比基于父元素,若父元素没有定高则为0\n if(position === 'relative') {\n let { [TOP]: top, [RIGHT]: right, [BOTTOM]: bottom, [LEFT]: left } = currentStyle;\n let { parent } = this;\n if(top[1] !== AUTO) {\n let n = calRelative(currentStyle, TOP, top, parent);\n this.__offsetY(n);\n computedStyle[TOP] = n;\n computedStyle[BOTTOM] = 'auto';\n }\n else if(bottom[1] !== AUTO) {\n let n = calRelative(currentStyle, BOTTOM, bottom, parent);\n this.__offsetY(-n);\n computedStyle[BOTTOM] = n;\n computedStyle[TOP] = 'auto';\n }\n else {\n computedStyle[TOP] = computedStyle[BOTTOM] = 'auto';\n }\n if(left[1] !== AUTO) {\n let n = calRelative(currentStyle, LEFT, left, parent, true);\n this.__offsetX(n);\n computedStyle[LEFT] = n;\n computedStyle[RIGHT] = 'auto';\n }\n else if(right[1] !== AUTO) {\n let n = calRelative(currentStyle, RIGHT, right, parent, true);\n this.__offsetX(-n);\n computedStyle[RIGHT] = n;\n computedStyle[LEFT] = 'auto';\n }\n else {\n computedStyle[LEFT] = computedStyle[RIGHT] = 'auto';\n }\n }\n else if(position !== 'absolute') {\n computedStyle[TOP] = computedStyle[BOTTOM] = computedStyle[LEFT] = computedStyle[RIGHT] = 'auto';\n }\n // 计算结果存入computedStyle和6个坐标,inline在其inlineSize特殊处理\n let x = this.__sx = this.x + this.ox;\n let y = this.__sy = this.y + this.oy;\n if(!__config[NODE_IS_INLINE]) {\n x = this.__sx1 = x + computedStyle[MARGIN_LEFT];\n x = this.__sx2 = x + computedStyle[BORDER_LEFT_WIDTH];\n x = this.__sx3 = x + computedStyle[PADDING_LEFT];\n x = this.__sx4 = x + this.width;\n x = this.__sx5 = x + computedStyle[PADDING_RIGHT];\n this.__sx6 = x + computedStyle[BORDER_RIGHT_WIDTH];\n y = this.__sy1 = y + computedStyle[MARGIN_TOP];\n y = this.__sy2 = y + computedStyle[BORDER_TOP_WIDTH];\n y = this.__sy3 = y + computedStyle[PADDING_TOP];\n y = this.__sy4 = y + this.height;\n y = this.__sy5 = y + computedStyle[PADDING_BOTTOM];\n this.__sy6 = y + computedStyle[BORDER_BOTTOM_WIDTH];\n }\n computedStyle[WIDTH] = this.width;\n computedStyle[HEIGHT] = this.height;\n // abs布局的不执行,在__layoutAbs末尾做,防止未布局没有尺寸从而动画计算错误\n if(!fromAbs) {\n this.__execAr();\n }\n return lineClampCount;\n }\n\n __execAr() {\n // 动态json引用时动画暂存,第一次布局时处理这些动画到root的animateController上\n let ar = this.__animateRecords;\n if(ar) {\n this.__animateRecords = null;\n // parse没有dom时,animate的target引用都是json,vd后生成需重新赋值\n ar.list.forEach(item => {\n if(item.target.vd instanceof Xom) {\n item.target = item.target.vd;\n }\n });\n let ac = ar.controller || this.root.animateController;\n // 不自动播放进入记录列表,初始化并等待手动调用\n if(ar.options && ar.options.autoPlay === false) {\n ac.__records2 = ac.__records2.concat(ar.list);\n ac.init(ac.__records2, ac.list2);\n }\n else {\n ac.__records = ac.__records.concat(ar.list);\n ac.__playAuto();\n }\n }\n }\n\n __layoutNone() {\n let { computedStyle } = this;\n computedStyle[DISPLAY] = 'none';\n computedStyle[MARGIN_TOP]\n = computedStyle[MARGIN_RIGHT]\n = computedStyle[MARGIN_BOTTOM]\n = computedStyle[MARGIN_LEFT]\n = computedStyle[PADDING_TOP]\n = computedStyle[PADDING_RIGHT]\n = computedStyle[PADDING_BOTTOM]\n = computedStyle[PADDING_LEFT]\n = 0;\n }\n\n // 预先计算是否是固定宽高,布局点位和尺寸考虑margin/border/padding\n __preLayout(data, isInline) {\n let { x, y, w, h, w2, h2, w3, h3, lx, nowrap, lineBoxManager, endSpace = 0 } = data;\n this.__x = x;\n this.__y = y;\n let { currentStyle, computedStyle } = this;\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n // 除了auto外都是固定宽高度\n let fixedWidth;\n let fixedHeight;\n // 绝对定位是left+right这种其实等于定义了width,但不能修改原始style,存入特殊变量标识\n if(w2 !== undefined) {\n fixedWidth = true;\n w = w2;\n }\n // flex时也会用到,子级得出目标主尺寸后按这个来\n else if(w3 !== undefined) {\n fixedWidth = true;\n w = w3;\n }\n else if(width[1] !== AUTO) {\n fixedWidth = true;\n switch(width[1]) {\n case PX:\n w = width[0];\n break;\n case PERCENT:\n w *= width[0] * 0.01;\n break;\n case REM:\n w = width[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n w = width[0] * this.root.width * 0.01;\n break;\n case VH:\n w = width[0] * this.root.height * 0.01;\n break;\n }\n }\n if(h2 !== undefined) {\n fixedHeight = true;\n h = h2;\n }\n else if(h3 !== undefined) {\n fixedHeight = true;\n h = h3;\n }\n else if(height[1] !== AUTO) {\n fixedHeight = true;\n switch(height[1]) {\n case PX:\n h = height[0];\n break;\n case PERCENT:\n h *= height[0] * 0.01;\n break;\n case REM:\n h = height[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n h = height[0] * this.root.width * 0.01;\n break;\n case VH:\n h = height[0] * this.root.height * 0.01;\n break;\n }\n }\n // margin/padding/border影响x和y和尺寸,注意inline的y不受mpb影响\n x += borderLeftWidth + marginLeft + paddingLeft;\n data.x = x;\n if(!isInline) {\n y += borderTopWidth + marginTop + paddingTop;\n }\n data.y = y;\n // inline的w/h很特殊,需不考虑inline自身水平的mpb以便换行,因为mpb只在首尾行生效,所以首尾需特殊处理中间忽略\n // 当嵌套inline时更加复杂,假如inline有尾部mpb,最后一行需考虑,如果此inline是父的最后一个且父有mpb需叠加\n let selfEndSpace = 0;\n if(isInline) {\n selfEndSpace = paddingRight + borderRightWidth + marginRight;\n }\n // 传入w3/h3时,flex的item已知目标主尺寸,需减去mpb,其一定是block和inline互斥\n if(!isInline) {\n if(width[1] === AUTO || w3 !== undefined) {\n w -= borderLeftWidth + borderRightWidth + marginLeft + marginRight + paddingLeft + paddingRight;\n }\n if(height[1] === AUTO || h3 !== undefined) {\n h -= borderTopWidth + borderBottomWidth + marginTop + marginBottom + paddingTop + paddingBottom;\n }\n }\n return {\n fixedWidth,\n fixedHeight,\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n nowrap,\n endSpace,\n selfEndSpace,\n };\n }\n\n // 处理margin:xx auto居中对齐或右对齐\n __marginAuto(style, data) {\n let {\n [POSITION]: position,\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [WIDTH]: width,\n } = style;\n if(position !== 'absolute' && (display === 'block' || display === 'flex')\n && (width[1] !== AUTO || this.tagName === 'img') && marginLeft[1] === AUTO && marginRight[1] === AUTO) {\n let ow = this.outerWidth;\n if(ow < data.w) {\n this.__offsetX((data.w - ow) * 0.5, true);\n }\n }\n }\n\n __calMatrix(lv, __cacheStyle, currentStyle, computedStyle, __config, sx1, sy1, offsetWidth, offsetHeight) {\n if(__config[NODE_IS_INLINE]) {\n computedStyle[TRANSFORM_ORIGIN] = [sx1, sy1];\n return __cacheStyle[MATRIX] = mx.identity();\n }\n let matrixCache = __cacheStyle[MATRIX];\n // tx/ty变化特殊优化\n if(matrixCache && lv < REFLOW && !contain(lv, TF)) {\n let x = 0, y = 0, z = 0;\n if(contain(lv, TX)) {\n let v = currentStyle[TRANSLATE_X];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else {\n v = v[0];\n }\n x = v - (computedStyle[TRANSLATE_X] || 0);\n computedStyle[TRANSLATE_X] = v;\n computedStyle[TRANSFORM][12] += x;\n matrixCache[12] += x;\n }\n if(contain(lv, TY)) {\n let v = currentStyle[TRANSLATE_Y];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetHeight * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else {\n v = v[0];\n }\n y = v - (computedStyle[TRANSLATE_Y] || 0);\n computedStyle[TRANSLATE_Y] = v;\n computedStyle[TRANSFORM][13] += y;\n matrixCache[13] += y;\n }\n if(contain(lv, TZ)) {\n let v = currentStyle[TRANSLATE_Z];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else {\n v = v[0];\n }\n z = v - (computedStyle[TRANSLATE_Z] || 0);\n computedStyle[TRANSLATE_Z] = v;\n computedStyle[TRANSFORM][14] += z;\n matrixCache[14] += z;\n }\n __cacheStyle[MATRIX] = matrixCache;\n }\n // 先根据cache计算需要重新计算的computedStyle\n else {\n if(sx1 === undefined) {\n sx1 = this.__sx1;\n sy1 = this.__sy1;\n offsetWidth = this.offsetWidth;\n offsetHeight = this.offsetHeight;\n }\n if(__cacheStyle[TRANSFORM_ORIGIN] === undefined) {\n __cacheStyle[TRANSFORM_ORIGIN] = true;\n matrixCache = null;\n computedStyle[TRANSFORM_ORIGIN] = tf.calOrigin(currentStyle[TRANSFORM_ORIGIN], offsetWidth, offsetHeight, this.root);\n }\n if(__cacheStyle[TRANSFORM] === undefined\n || __cacheStyle[TRANSLATE_X] === undefined\n || __cacheStyle[TRANSLATE_Y] === undefined\n || __cacheStyle[TRANSLATE_Z] === undefined\n || __cacheStyle[ROTATE_X] === undefined\n || __cacheStyle[ROTATE_Y] === undefined\n || __cacheStyle[ROTATE_Z] === undefined\n || __cacheStyle[ROTATE_3D] === undefined\n || __cacheStyle[SCALE_X] === undefined\n || __cacheStyle[SCALE_Y] === undefined\n || __cacheStyle[SCALE_Z] === undefined\n || __cacheStyle[SKEW_X] === undefined\n || __cacheStyle[SKEW_Y] === undefined) {\n __cacheStyle[TRANSFORM]\n = __cacheStyle[TRANSLATE_X]\n = __cacheStyle[TRANSLATE_Y]\n = __cacheStyle[TRANSLATE_Z]\n = __cacheStyle[ROTATE_X]\n = __cacheStyle[ROTATE_Y]\n = __cacheStyle[ROTATE_Z]\n = __cacheStyle[SCALE_X]\n = __cacheStyle[SCALE_Y]\n = __cacheStyle[SCALE_Z]\n = __cacheStyle[SKEW_X]\n = __cacheStyle[SKEW_Y]\n = true;\n matrixCache = null;\n let matrix;\n // transform相对于自身\n if(currentStyle[TRANSFORM]) {\n matrix = tf.calMatrix(currentStyle[TRANSFORM], offsetWidth, offsetHeight, this.root);\n }\n // 没有transform则看是否有扩展的css独立变换属性\n else {\n let temp = [];\n [\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n ROTATE_3D,\n SKEW_X,\n SKEW_Y,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n ].forEach(k => {\n // 删除之前遗留的\n delete computedStyle[k];\n let v = currentStyle[k];\n if(isNil(v)) {\n return;\n }\n if(k === ROTATE_3D) {\n computedStyle[k] = [v[0], v[1], v[2], v[3][0]];\n if(v[3][0] === 0) {\n return;\n }\n temp.push([k, v]);\n return;\n }\n computedStyle[k] = v[0];\n // scale为1和其它为0避免计算浪费\n let isScale = k === SCALE_X || k === SCALE_Y || k === SCALE_Z;\n if(v[0] === 1 && isScale || !isScale && v[0] === 0) {\n return;\n }\n if(v[1] === PERCENT) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * offsetWidth * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * offsetHeight * 0.01;\n }\n }\n else if(v[1] === REM) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n }\n else if(v[1] === VW) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.width * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.width * 0.01;\n }\n }\n else if(v[1] === VH) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.height * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.height * 0.01;\n }\n }\n temp.push([k, v]);\n });\n if(temp.length) {\n matrix = tf.calMatrix(temp, offsetWidth, offsetHeight, this.root);\n }\n }\n computedStyle[TRANSFORM] = matrix || mx.identity();\n }\n if(!matrixCache) {\n let m = computedStyle[TRANSFORM];\n let tfo = computedStyle[TRANSFORM_ORIGIN].slice(0);\n tfo[0] += sx1 || 0;\n tfo[1] += sy1 || 0;\n matrixCache = __cacheStyle[MATRIX] = tf.calMatrixByOrigin(m, tfo);\n }\n }\n return matrixCache;\n }\n\n /**\n * 将currentStyle计算为computedStyle,同时存入cacheStyle可缓存的结果防止无变更重复计算\n * @param renderMode\n * @param ctx\n * @param parent\n * @param __cacheStyle\n * @param currentStyle\n * @param computedStyle\n * @param clientWidth\n * @param clientHeight\n * @param offsetWidth\n * @param offsetHeight\n * @param borderTopWidth\n * @param borderRightWidth\n * @param borderBottomWidth\n * @param borderLeftWidth\n * @param paddingTop\n * @param paddingRight\n * @param paddingBottom\n * @param paddingLeft\n * @param x1\n * @param x2\n * @param x3\n * @param x4\n * @param x5\n * @param x6\n * @param y1\n * @param y2\n * @param y3\n * @param y4\n * @param y5\n * @param y6\n * @returns {*[]}\n * @private\n */\n __calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6) {\n let bx1 = x1, by1 = y1, bx2 = x6, by2 = y6;\n let backgroundClip = computedStyle[BACKGROUND_CLIP] = currentStyle[BACKGROUND_CLIP];\n // 默认border-box\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n bx1 = x2;\n by1 = y2;\n bx2 = x5;\n by2 = y5;\n }\n else if(backgroundClip === 'contentBox' || backgroundClip === 'content-box') {\n bx1 = x3;\n by1 = y3;\n bx2 = x4;\n by2 = y4;\n }\n let isInline = this.__config[NODE_IS_INLINE];\n if(isInline && !this.contentBoxList.length) {\n isInline = false;\n }\n // 这些直接赋值的不需要再算缓存\n [\n OPACITY,\n Z_INDEX,\n BORDER_TOP_STYLE,\n BORDER_RIGHT_STYLE,\n BORDER_BOTTOM_STYLE,\n BORDER_LEFT_STYLE,\n BACKGROUND_REPEAT,\n OVERFLOW,\n MIX_BLEND_MODE,\n TEXT_OVERFLOW,\n BACKGROUND_CLIP,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n if(isNil(__cacheStyle[FILTER])) {\n __cacheStyle[FILTER] = true;\n this.__calFilter(currentStyle, computedStyle);\n }\n if(isNil(__cacheStyle[BACKGROUND_POSITION_X])) {\n __cacheStyle[BACKGROUND_POSITION_X] = true;\n let {\n [BACKGROUND_POSITION_X]: bgX,\n } = currentStyle;\n computedStyle[BACKGROUND_POSITION_X] = (bgX || []).map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n if(item[1] === PERCENT) {\n return item[0] + '%';\n }\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_POSITION_Y])) {\n __cacheStyle[BACKGROUND_POSITION_Y] = true;\n let {\n [BACKGROUND_POSITION_Y]: bgY,\n } = currentStyle;\n computedStyle[BACKGROUND_POSITION_Y] = (bgY || []).map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n if(item[1] === PERCENT) {\n return item[0] + '%';\n }\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_SIZE])) {\n __cacheStyle[BACKGROUND_SIZE] = true;\n computedStyle[BACKGROUND_SIZE] = (currentStyle[BACKGROUND_SIZE] || []).map(item => {\n return bg.calBackgroundSize(item, bx2 - bx1, by2 - by1, this.root);\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_IMAGE])) {\n let bgI = computedStyle[BACKGROUND_IMAGE] = currentStyle[BACKGROUND_IMAGE].slice(0);\n __cacheStyle[BACKGROUND_IMAGE] = bgI.map((bgi, i) => {\n if(!bgi) {\n return null;\n }\n // 防止隐藏不加载背景图\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i] = this.__loadBgi[i] || {};\n let cache = inject.IMG[BACKGROUND_IMAGE];\n if(cache && cache.state === inject.LOADED) {\n loadBgi.url = BACKGROUND_IMAGE;\n loadBgi.source = cache.source;\n loadBgi.width = cache.width;\n loadBgi.height = cache.height;\n }\n else if(loadBgi.url !== bgi) {\n // 可能改变导致多次加载,每次清空,成功后还要比对url是否相同\n loadBgi.url = bgi;\n loadBgi.source = null;\n let node = this;\n let root = node.root;\n inject.measureImg(bgi, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败不绘制bgi\n if(data.success && data.url === loadBgi.url && !this.isDestroyed) {\n loadBgi.source = data.source;\n loadBgi.width = data.width;\n loadBgi.height = data.height;\n root.delRefreshTask(loadBgi.cb);\n root.addRefreshTask(loadBgi.cb = {\n __before() {\n __cacheStyle[BACKGROUND_IMAGE] = undefined;\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_FOCUS] = REPAINT;\n res[UPDATE_CONFIG] = node.__config;\n root.__addUpdate(node, node.__config, root, root.__config, res);\n },\n });\n }\n }, {\n ctx,\n root,\n width: bx2 - bx1,\n height: by2 - by1,\n });\n }\n return true;\n }\n else if(!isInline && bgi.k) {\n // gradient在渲染时才生成\n return true;\n }\n });\n }\n if(isNil(__cacheStyle[BOX_SHADOW])) {\n __cacheStyle[BOX_SHADOW] = true;\n computedStyle[BOX_SHADOW] = (currentStyle[BOX_SHADOW] || []).map(item => {\n return item.map((item2, i) => {\n if(i > 3) {\n return item2;\n }\n let v = item2[0];\n if(item2[1] === PERCENT) {\n if(i % 2 === 0) {\n v *= 0.01 * (bx2 - bx1);\n }\n else {\n v *= 0.01 * (by2 - by1);\n }\n }\n else if(item2[1] === REM) {\n v = v * this.root.computedStyle[FONT_SIZE];\n }\n else if(item2[1] === VW) {\n v = v * this.root.width * 0.01;\n }\n else if(item2[1] === VH) {\n v = v * this.root.height * 0.01;\n }\n return v;\n });\n });\n }\n [\n BACKGROUND_COLOR,\n BORDER_TOP_COLOR,\n BORDER_RIGHT_COLOR,\n BORDER_BOTTOM_COLOR,\n BORDER_LEFT_COLOR,\n ].forEach(k => {\n if(isNil(__cacheStyle[k])) {\n __cacheStyle[k] = int2rgba(computedStyle[k] = currentStyle[k][0]);\n }\n });\n // 圆角边计算\n if(isNil(__cacheStyle[BORDER_TOP_LEFT_RADIUS])\n || isNil(__cacheStyle[BORDER_TOP_RIGHT_RADIUS])\n || isNil(__cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS])\n || isNil(__cacheStyle[BORDER_BOTTOM_LEFT_RADIUS])) {\n __cacheStyle[BORDER_TOP_LEFT_RADIUS]\n = __cacheStyle[BORDER_TOP_RIGHT_RADIUS]\n = __cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS]\n = __cacheStyle[BORDER_BOTTOM_LEFT_RADIUS]\n = true;\n // 非替代的inline计算看contentBox首尾\n if(isInline) {\n border.calBorderRadiusInline(this.contentBoxList, currentStyle, computedStyle, this.root);\n }\n // 普通block整体计算\n else {\n border.calBorderRadius(offsetWidth, offsetHeight, currentStyle, computedStyle, this.root);\n }\n }\n // width/style/radius影响border,color不影响渲染缓存\n let btlr = computedStyle[BORDER_TOP_LEFT_RADIUS];\n let btrr = computedStyle[BORDER_TOP_RIGHT_RADIUS];\n let bbrr = computedStyle[BORDER_BOTTOM_RIGHT_RADIUS];\n let bblr = computedStyle[BORDER_BOTTOM_LEFT_RADIUS];\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k;\n let k2 = STYLE_KEY[style2Upper(k)];\n let kw = STYLE_KEY[style2Upper(k + 'Width')];\n let ks = STYLE_KEY[style2Upper(k + 'Style')];\n // width/style变更影响border重新计算\n if(isNil(__cacheStyle[kw])) {\n __cacheStyle[kw] = true;\n __cacheStyle[k2] = undefined;\n }\n if(isNil(__cacheStyle[ks])) {\n __cacheStyle[ks] = true;\n __cacheStyle[k2] = undefined;\n }\n if(isNil(__cacheStyle[k2])) {\n if(k2 === BORDER_TOP) {\n if(borderTopWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderTopWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 0, btlr, btrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_RIGHT) {\n if(borderRightWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderRightWidth / borderTopWidth);\n let deg2 = Math.atan(borderRightWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderRightWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 1, btrr, bbrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_BOTTOM) {\n if(borderBottomWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderBottomWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 2, bblr, bbrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_LEFT) {\n if(borderLeftWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderLeftWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 3, btlr, bblr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n }\n });\n // 强制计算继承性的\n let parentComputedStyle = parent && parent.computedStyle;\n if(currentStyle[FONT_STYLE][1] === INHERIT) {\n computedStyle[FONT_STYLE] = parent ? parentComputedStyle[FONT_STYLE] : 'normal';\n }\n else if(isNil(__cacheStyle[FONT_STYLE])) {\n computedStyle[FONT_STYLE] = currentStyle[FONT_STYLE][0];\n }\n __cacheStyle[FONT_STYLE] = computedStyle[FONT_STYLE];\n if(currentStyle[COLOR][1] === INHERIT) {\n computedStyle[COLOR] = parent ? parentComputedStyle[COLOR] : [0, 0, 0, 1];\n __cacheStyle[COLOR] = int2rgba(computedStyle[COLOR]);\n }\n else if(isNil(__cacheStyle[COLOR])) {\n computedStyle[COLOR] = rgba2int(currentStyle[COLOR][0]);\n __cacheStyle[COLOR] = int2rgba(computedStyle[COLOR]);\n }\n if(currentStyle[TEXT_STROKE_COLOR][1] === INHERIT) {\n computedStyle[TEXT_STROKE_COLOR] = parent ? parentComputedStyle[TEXT_STROKE_COLOR] : [0, 0, 0, 1];\n __cacheStyle[TEXT_STROKE_COLOR] = int2rgba(computedStyle[TEXT_STROKE_COLOR]);\n }\n else if(isNil(__cacheStyle[TEXT_STROKE_COLOR])) {\n computedStyle[TEXT_STROKE_COLOR] = rgba2int(currentStyle[TEXT_STROKE_COLOR][0]);\n __cacheStyle[TEXT_STROKE_COLOR] = int2rgba(computedStyle[TEXT_STROKE_COLOR]);\n }\n if(currentStyle[TEXT_STROKE_WIDTH][1] === INHERIT) {\n computedStyle[TEXT_STROKE_WIDTH] = parent ? parentComputedStyle[TEXT_STROKE_WIDTH] : 0;\n __cacheStyle[TEXT_STROKE_WIDTH] = true;\n }\n else if(isNil(__cacheStyle[TEXT_STROKE_WIDTH])) {\n let v = currentStyle[TEXT_STROKE_WIDTH];\n if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else {\n v = v[0];\n }\n computedStyle[TEXT_STROKE_WIDTH] = v;\n __cacheStyle[TEXT_STROKE_WIDTH] = true;\n }\n if(currentStyle[TEXT_STROKE_OVER][1] === INHERIT) {\n __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = parent ? parentComputedStyle[TEXT_STROKE_OVER] : 'none';\n }\n else {\n __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = currentStyle[TEXT_STROKE_OVER][0];\n }\n if(currentStyle[VISIBILITY][1] === INHERIT) {\n computedStyle[VISIBILITY] = parent ? parentComputedStyle[VISIBILITY] : 'visible';\n }\n else if(isNil(__cacheStyle[VISIBILITY])) {\n computedStyle[VISIBILITY] = currentStyle[VISIBILITY][0];\n }\n __cacheStyle[VISIBILITY] = computedStyle[VISIBILITY];\n if(currentStyle[POINTER_EVENTS][1] === INHERIT) {\n computedStyle[POINTER_EVENTS] = parent ? parentComputedStyle[POINTER_EVENTS] : 'auto';\n }\n else if(isNil(__cacheStyle[POINTER_EVENTS])) {\n computedStyle[POINTER_EVENTS] = currentStyle[POINTER_EVENTS][0];\n }\n __cacheStyle[POINTER_EVENTS] = computedStyle[POINTER_EVENTS];\n 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 {\n ppt = v[0];\n }\n computedStyle[PERSPECTIVE] = ppt;\n }\n if(isNil(__cacheStyle[PERSPECTIVE_ORIGIN])) {\n __cacheStyle[PERSPECTIVE_ORIGIN] = true;\n rebuild = true;\n computedStyle[PERSPECTIVE_ORIGIN] = tf.calOrigin(currentStyle[PERSPECTIVE_ORIGIN], this.offsetWidth, this.offsetHeight, this.root);\n }\n if(rebuild) {\n if(sx1 === undefined) {\n sx1 = this.__sx1;\n sy1 = this.__sy1;\n }\n let po = computedStyle[PERSPECTIVE_ORIGIN].slice(0);\n po[0] += sx1 || 0;\n po[1] += sy1 || 0;\n __config[NODE_PERSPECTIVE_MATRIX] = tf.calPerspectiveMatrix(computedStyle[PERSPECTIVE], po);\n }\n }\n\n __calFilter(currentStyle, computedStyle) {\n return computedStyle[FILTER] = (currentStyle[FILTER] || []).map(item => {\n let [k, v] = item;\n // 部分%单位的滤镜强制使用数字\n if(v[1] === PX || v[1] === DEG || v[1] === PERCENT || v[1] === NUMBER) {\n v = v[0];\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n return [k, v];\n });\n }\n\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n if(renderMode === CANVAS || renderMode === WEBGL) {\n if(lv < REPAINT) {\n return this.__hasContent;\n }\n let visibility = currentStyle[VISIBILITY];\n if(visibility !== 'hidden') {\n let bgI = currentStyle[BACKGROUND_IMAGE];\n if(Array.isArray(bgI)) {\n for(let i = 0, len = bgI.length; i < len; i++) {\n if(bgI[i]) {\n return true;\n }\n }\n }\n if(currentStyle[BACKGROUND_COLOR][0][3] > 0) {\n let width = computedStyle[WIDTH], height = computedStyle[HEIGHT],\n paddingTop = computedStyle[PADDING_TOP], paddingRight = computedStyle[PADDING_RIGHT],\n paddingBottom = computedStyle[PADDING_BOTTOM], paddingLeft = computedStyle[PADDING_LEFT];\n if(width && height || paddingTop || paddingRight || paddingBottom || paddingLeft) {\n return true;\n }\n }\n for(let list = ['Top', 'Right', 'Bottom', 'Left'], i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n if(computedStyle[STYLE_KEY[style2Upper('border' + k + 'Width')]] > 0\n && currentStyle[STYLE_KEY[style2Upper('border' + k + 'Color')]][0][3] > 0) {\n return true;\n }\n }\n let bs = currentStyle[BOX_SHADOW];\n if(Array.isArray(bs)) {\n for(let i = 0, len = bs.length; i < len; i++) {\n let item = bs[i];\n if(item && (item[2] > 0 || item[3] > 0)) {\n return true;\n }\n }\n }\n }\n }\n return false;\n }\n\n /**\n * 渲染基础方法,Dom/Geom公用\n * @param renderMode\n * @param lv\n * @param ctx canvas/svg/webgl共用\n * @param cache 是否是局部根节点缓存模式下的绘制\n * @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 this.__bbox = null;\n if(isDestroyed) {\n return { isDestroyed, break: true };\n }\n let virtualDom;\n // svg设置vd上的lv属性标明lineHeight的话,另外特殊字体如arial拥有lineGap也会产生间隙,背景色不绘制这个间隙\n * x轴根据contentBox的范围坐标,y则固定和font/lineHeight相关\n * 圆角发生在首尾lineBox处,中间不会有,bgi则产生类似bgc作为mask的效果\n * 另外要注意多个时的顺序,必须依次渲染,后面的bb可能会覆盖前面行的\n */\n if(isRealInline) {\n let contentBoxList = this.contentBoxList;\n let length = contentBoxList.length;\n let hasBgi = backgroundImage.some(item => item);\n if(length) {\n let {\n [FONT_SIZE]: fontSize,\n [FONT_FAMILY]: fontFamily,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let iw = 0, ih = 0;\n let offscreen, svgBgSymbol = [];\n // bgi视作inline排满一行绘制,然后按分行拆开给每行\n if(hasBgi) {\n iw = inline.getInlineWidth(this, contentBoxList);\n ih = lineHeight;\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n iw += paddingLeft + paddingRight;\n ih += paddingTop + paddingBottom;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n iw += paddingLeft + paddingRight + borderLeftWidth + borderRightWidth;\n ih += paddingTop + paddingBottom + borderTopWidth + borderBottomWidth;\n }\n if(renderMode === CANVAS || renderMode === WEBGL) {\n offscreen = inject.getCacheCanvas(iw, ih, '__$$INLINE_BGI$$__');\n }\n let length = backgroundImage.length;\n backgroundImage.slice(0).reverse().forEach((bgi, i) => {\n if(!bgi) {\n return;\n }\n i = length - 1 - i;\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i];\n if(loadBgi.url === backgroundImage[i]) {\n let uuid = bg.renderImage(this, renderMode, offscreen && offscreen.ctx || ctx, loadBgi,\n 0, 0, iw, ih, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, true, 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.delRefreshTask(this.__loadBgi.cb);\n root.delRefreshTask(this.__task);\n this.__task = null;\n this.__root = null;\n this.clearCache();\n }\n\n // 先查找到注册了事件的节点,再捕获冒泡判断增加性能\n __emitEvent(e, force) {\n let { isDestroyed, computedStyle, isMask } = this;\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || e.__stopPropagation || isMask) {\n return;\n }\n let { event: { type } } = e;\n let { listener, __hasMask } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // touchmove之类强制的直接由Root通知即可\n if(force) {\n if(computedStyle[POINTER_EVENTS] !== 'none' && util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n // 非force的判断事件坐标是否在节点内\n if(this.willResponseEvent(e)) {\n // 如果有mask,点在mask上才行,点在clip外才行\n if(__hasMask) {\n let next = this.next;\n let isClip = next.isClip;\n let hasEmitMask;\n while(next && next.isMask) {\n if(next.willResponseEvent(e, true)) {\n hasEmitMask = true;\n break;\n }\n next = next.next;\n }\n if(!isClip && !hasEmitMask) {\n return;\n }\n }\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n\n willResponseEvent(e, ignore) {\n let { x, y } = e;\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent, computedStyle } = this;\n if(computedStyle[POINTER_EVENTS] === 'none') {\n return;\n }\n let inThis = geom.pointInQuadrilateral(\n x, y,\n __sx1, __sy1,\n __sx1 + offsetWidth, __sy1,\n __sx1 + offsetWidth, __sy1 + offsetHeight,\n __sx1, __sy1 + offsetHeight,\n matrixEvent\n );\n if(inThis) {\n if(!e.target && !ignore) {\n e.target = this;\n // 缓存target给move用\n if(e.event.type === 'touchstart') {\n this.root && (this.root.__touchstartTarget = this);\n }\n }\n return true;\n }\n }\n\n __gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi, 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(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, formatStyle);\n if(util.isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n // 传入格式化好key/value的样式\n updateFormatStyle(style, cb) {\n let node = this;\n let { root, __config } = node;\n if(root) {\n root.addRefreshTask(node.__task = {\n __before() {\n node.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(__config[NODE_IS_DESTROYED]) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n res[UPDATE_CONFIG] = __config;\n root.__addUpdate(node, __config, root, root.__config, res);\n },\n __after(diff) {\n if(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, style);\n if(util.isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n animate(list, options = {}) {\n let animation = new Animation(this, list, options);\n if(this.isDestroyed) {\n animation.__destroy(true);\n return animation;\n }\n this.animationList.push(animation);\n if(options.autoPlay === false) {\n return animation;\n }\n return animation.play();\n }\n\n removeAnimate(o) {\n if(o instanceof Animation) {\n let i = this.animationList.indexOf(o);\n if(i > -1) {\n o.cancel();\n o.__destroy();\n this.animationList.splice(i, 1);\n }\n }\n }\n\n clearAnimate() {\n this.animationList.splice(0).forEach(o => {\n o.cancel();\n o.__destroy();\n });\n }\n\n frameAnimate(cb) {\n if(util.isFunction(cb)) {\n let list = this.__frameAnimateList;\n // 防止重复\n for(let i = 0, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n return cb;\n }\n }\n let enter = {\n __after(diff) {\n cb(diff);\n },\n __karasFramecb: cb,\n };\n list.push(enter);\n frame.onFrame(enter);\n return cb;\n }\n }\n\n removeFrameAnimate(cb) {\n for(let i = 0, list = this.__frameAnimateList, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n list.splice(i, 1);\n frame.offFrame(cb);\n return;\n }\n }\n }\n\n clearFrameAnimate() {\n this.__frameAnimateList.splice(0).forEach(o => {\n frame.offFrame(o);\n });\n }\n\n __computeMeasure(renderMode, ctx, cb) {\n css.computeMeasure(this);\n if(util.isFunction(cb)) {\n cb(this);\n }\n }\n\n __deepScan(cb, options) {\n return cb(this, options);\n }\n\n // isLayout为false时,为relative/margin/flex/vertical等\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.__layoutData.x += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sx1 += diff;\n this.__sx2 += diff;\n this.__sx3 += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.__layoutData.y += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sy1 += diff;\n this.__sy2 += diff;\n this.__sy3 += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n }\n\n __resizeX(diff, lv) {\n this.computedStyle.width = this.__width += diff;\n this.__clientWidth += diff;\n this.__offsetWidth += diff;\n this.__outerWidth += diff;\n this.__layoutData.w += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __resizeY(diff, lv) {\n this.computedStyle.height = this.__height += diff;\n this.__clientHeight += diff;\n this.__offsetHeight += diff;\n this.__outerHeight += diff;\n this.__layoutData.h += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __spreadBbox(boxShadow) {\n let ox = 0, oy = 0;\n if(Array.isArray(boxShadow)) {\n boxShadow.forEach(item => {\n let [x, y, sigma, spread, , inset] = item;\n if(inset !== 'inset') {\n let d = blur.outerSize(sigma);\n d += spread;\n ox = Math.max(ox, x + d);\n oy = Math.max(oy, y + d);\n }\n });\n }\n return [ox, oy];\n }\n\n __releaseWhenEmpty(__cache) {\n if(__cache && __cache.available) {\n __cache.release();\n }\n return true;\n }\n\n getComputedStyle(key) {\n let computedStyle = this.computedStyle;\n let res = {};\n let keys;\n if(key) {\n if(Array.isArray(key)) {\n keys = key;\n }\n else {\n keys = [key];\n }\n keys = keys.map(s => {\n return STYLE_KEY[style2Upper(s)];\n });\n }\n else {\n keys = Object.keys(computedStyle);\n }\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n res[k] = computedStyle[k];\n }\n else {\n res[STYLE_RV_KEY[k]] = computedStyle[k];\n }\n });\n return res;\n }\n\n getBoundingClientRect() {\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent } = this;\n let p1 = point2d(mx.calPoint([__sx1, __sy1], matrixEvent));\n let p2 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1], matrixEvent));\n let p3 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1 + offsetHeight], matrixEvent));\n let p4 = point2d(mx.calPoint([__sx1, __sy1 + offsetHeight], matrixEvent));\n return {\n left: Math.min(p1[0], Math.min(p2[0], Math.min(p3[0], p4[0]))),\n top: Math.min(p1[1], Math.min(p2[1], Math.min(p3[1], p4[1]))),\n right: Math.max(p1[0], Math.max(p2[0], Math.max(p3[0], p4[0]))),\n bottom: Math.max(p1[1], Math.max(p2[1], Math.max(p3[1], p4[1]))),\n points: [p1, p2, p3, p4],\n };\n }\n\n // img和geom返回false,在inline布局时判断是否是真的inline\n __isRealInline() {\n return true;\n }\n\n remove(cb) {\n let self = this;\n if(self.isDestroyed) {\n inject.warn('Remove target is destroyed.');\n if(util.isFunction(cb)) {\n cb();\n }\n return;\n }\n let { root, domParent } = self;\n let target = self.isShadowRoot ? self.hostRoot : self;\n // 特殊情况连续append/remove时候,还未被添加进来找不到所以无需删除\n if(domParent.children.indexOf(target) === -1) {\n if(util.isFunction(cb)) {\n cb();\n }\n return;\n }\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n let pJson = domParent.__json;\n let i = pJson.children.indexOf(self.isShadowRoot ? self.hostRoot.__json : self.__json);\n let zChildren = domParent.zIndexChildren;\n let j = zChildren.indexOf(self.isShadowRoot ? self.hostRoot : self);\n if(i === -1 || j === -1) {\n throw new Error('Remove index Exception.')\n }\n pJson.children.splice(i, 1);\n domParent.children.splice(i, 1);\n zChildren.splice(j, 1);\n if(self.__prev) {\n self.__prev.__next = self.__next;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_REMOVE_DOM] = true;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after(diff) {\n self.isShadowRoot ? self.hostRoot.__destroy() : self.__destroy();\n if(util.isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get sx() {\n return this.__sx;\n }\n\n get sy() {\n return this.__sy;\n }\n\n get clientWidth() {\n return this.__clientWidth || 0;\n }\n\n get clientHeight() {\n return this.__clientHeight || 0;\n }\n\n get offsetWidth() {\n return this.__offsetWidth || 0;\n }\n\n get offsetHeight() {\n return this.__offsetHeight || 0;\n }\n\n get outerWidth() {\n return this.__outerWidth || 0;\n }\n\n get outerHeight() {\n return this.__outerHeight || 0;\n }\n\n // 不考虑margin的范围,>=REPAINT渲染或个别有影响的渲染改变(如blur)清空缓存\n get bbox() {\n if(!this.__bbox) {\n let {\n __sx1, __sy1, clientWidth, clientHeight,\n currentStyle: {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BOX_SHADOW]: boxShadow,\n },\n } = this;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n clientWidth += borderLeftWidth[0] + borderRightWidth[0];\n clientHeight += borderTopWidth[0] + borderBottomWidth[0];\n let half = 1;\n this.__bbox = [__sx1 - ox - half, __sy1 - oy - half, __sx1 + clientWidth + ox + half, __sy1 + clientHeight + oy + half];\n }\n return this.__bbox;\n }\n\n get listener() {\n return this.__listener;\n }\n\n get matrix() {\n return this.__config[NODE_MATRIX];\n }\n\n get matrixEvent() {\n return this.__config[NODE_MATRIX_EVENT];\n }\n\n get perspectiveMatrix() {\n return this.__config[NODE_PERSPECTIVE_MATRIX];\n }\n\n get style() {\n return this.__style;\n }\n\n get computedStyle() {\n return this.__computedStyle;\n }\n\n get animationList() {\n return this.__animationList;\n }\n\n get currentStyle() {\n return this.__currentStyle;\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get contentBoxList() {\n return this.__contentBoxList;\n }\n\n get baseLine() {\n return this.offsetHeight;\n }\n\n get firstBaseLine() {\n return this.offsetHeight;\n }\n\n get isMask() {\n return this.__isMask;\n }\n\n get isClip() {\n return this.__isClip;\n }\n\n 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 n = this.baseLine;\n // 只有1个也需要对齐,因为可能内嵌了空inline使得baseLine发生变化\n if(this.list.length) {\n this.list.forEach(item => {\n let m = item.baseLine;\n if(m !== n) {\n item.__offsetY(n - m);\n }\n });\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n /**\n * 防止非行首空inline,每当遇到inline就设置当前lineBox的lineHeight/baseLine,这样有最小值兜底\n * @param l\n * @param b\n * @private\n */\n __setLB(l, b) {\n this.__lineHeight = Math.max(l, this.__lineHeight);\n this.__baseLine = Math.max(b, this.__baseLine);\n }\n\n get list() {\n return this.__list;\n }\n\n get size() {\n return this.__list.length;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endY() {\n return this.y + this.height;\n }\n\n get width() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let first = list[0];\n let last = list[length - 1];\n let x1 = first.x;\n let dom = first instanceof TextBox ? first.parent.domParent : first.domParent;\n // 因为inline可以嵌套inline,所以一直向上查找到非inline为止,每层inline如果是首个则减去左侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [PADDING_LEFT]: paddingLeft,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[0]) {\n x1 -= marginLeft + borderLeftWidth + paddingLeft;\n }\n dom = dom.domParent;\n }\n let x2 = last.x + last.outerWidth;\n dom = last instanceof TextBox ? last.parent.domParent : last.domParent;\n // 同向上查非inline,每层inline如果是最后一个则加上右侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_RIGHT]: paddingRight,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[list.length - 1]) {\n x2 += marginRight + borderRightWidth + paddingRight;\n }\n dom = dom.domParent;\n }\n return x2 - x1;\n }\n return 0;\n }\n\n get height() {\n return this.lineHeight;\n }\n\n get baseLine() {\n let baseLine = 0;\n this.list.forEach(item => {\n baseLine = Math.max(baseLine, item.baseLine);\n });\n return Math.max(this.__baseLine, baseLine);\n }\n\n get lineHeight() {\n let lineHeight = 0;\n // 只有TextBox和InlineBlock\n this.list.forEach(item => {\n lineHeight = Math.max(lineHeight, item.outerHeight);\n });\n return Math.max(this.__lineHeight, lineHeight);\n }\n}\n\nexport default LineBox;\n","import LineBox from './LineBox';\n\n/**\n * 维护一个上下文的LineBox,向LineBox中添加Item以及新增下一行的LineBox,多个LineBox组成一个区域\n * 一个block/inlineBlock拥有一个本类对象,上下文即对应这个dom流,而inline则复用最近非inline父元素的\n * 同时LineBox可能连续也可能不连续,不连续的是中间有block之类的隔离开来\n */\nclass LineBoxManager {\n constructor(x, y, lineHeight, baseLine) {\n this.__x = this.__lastX = x; // last存储目前最后一行LineBox的结尾位置,供后续inline使用\n this.__y = this.__lastY = y;\n this.__maxX = x;\n this.__domList = [];\n this.__domStack = [];\n this.__list = []; // 包含若干LineBox\n this.__isNewLine = true; // 区域内是否是新行,容器dom(block)开头肯定是\n this.__lineHeight = lineHeight;\n this.__baseLine = baseLine;\n this.__isEnd = true; // 在dom中是否一个区域处在结尾,外部控制\n }\n\n /**\n * 每次换行时重新生成LineBox存入列表,同时由于flow流当前一定是流(dom)的结尾,设置isEnd\n * @returns {LineBox}\n */\n genLineBox(x, y) {\n let lineBox = new LineBox(x, y, this.__lineHeight, this.__baseLine);\n this.list.push(lineBox);\n this.__isEnd = true;\n return lineBox;\n }\n\n /**\n * inline的特殊调用,防止空内容但有mbp的inline不占位,放入一个有lineHeight的空lineBox\n * 只有新行开头时需要,后面的无论是否有内容都会影响lineHeight\n * @param x\n * @param y\n * @param l\n * @param b\n * @returns {LineBox}\n */\n genLineBoxByInlineIfNewLine(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseLine = Math.max(this.__baseLine, b);\n if(this.__isNewLine) {\n let lineBox = new LineBox(x, y, lineHeight, baseLine);\n this.list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n }\n\n setLbOrGenLineBoxByInline(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseLine = Math.max(this.__baseLine, b);\n let lineBox;\n let list = this.list;\n if(this.__isNewLine) {\n lineBox = new LineBox(x, y, lineHeight, baseLine);\n list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n else {\n let length = list.length;\n lineBox = list[length - 1];\n lineBox.__setLB(l, b);\n }\n }\n\n /**\n * 外部设置为结尾,如一个LineBox后出现一个block,此时会被隔断,不再作为流的末尾\n */\n setNotEnd() {\n this.__isEnd = false;\n }\n\n /**\n * 外部设置新行,下次新生成LineBox\n */\n setNewLine() {\n this.__isNewLine = true;\n }\n\n /**\n * 当前LineBox放入一个新项,当新行时(如第一行)产生一个新的LineBox并存入列表\n * 是否新区域和新行都是可以被外部控制,默认第一行是新\n * 当被隔断后会被外部重置新行,这样会生成新的来作为新加项的LineBox\n * 当换行时外部也会调用新行,这样再次添加Item时会自动生成新的LineBox而不是用之前的\n * @param o TextBox/Inline/InlineBlock\n * @param nextNewLine 是否设置newLine,标明下次添加新生成LineBox\n * @returns {LineBox}\n */\n addItem(o, nextNewLine) {\n let lineBox;\n if(this.__isNewLine) {\n this.__isNewLine = false;\n lineBox = this.genLineBox(o.x, o.y);\n }\n else {\n let list = this.list;\n let length = list.length;\n lineBox = list[length - 1];\n }\n // inline递归过程中所有inline父子顺序列表,每个dom都需要对当前内容保存\n this.__domStack.forEach(item => {\n item.__contentBoxList.push(o);\n });\n lineBox.add(o);\n // 设置结束x的位置给next的inline标记用,o可能是TextBox或inlineBlock,当next新行时注意位置\n if(nextNewLine) {\n this.__isNewLine = true;\n this.__lastX = o.x;\n this.__lastY = o.y + o.outerHeight;\n }\n else {\n this.__lastX = o.x + o.outerWidth;\n this.__lastY = o.y;\n }\n this.__maxX = Math.max(this.__maxX, o.x + o.outerWidth);\n return lineBox;\n }\n\n horizonAlign(w, textAlign) {\n this.list.forEach(lineBox => {\n let diff = w - lineBox.width;\n if(diff > 0) {\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n lineBox.__offsetX(diff);\n lineBox.list.forEach(item => {\n item.__offsetX(diff, true);\n });\n }\n });\n }\n\n verticalAlign() {\n this.list.forEach(lineBox => {\n lineBox.verticalAlign();\n });\n }\n\n addX(n) {\n this.__lastX += n;\n }\n\n /**\n * inline递归过程中布局调用,不断出入栈dom对象,获取当前行状态下有哪些dom还在\n * @param dom\n */\n pushContentBoxList(dom) {\n this.__domList.push(dom);\n this.__domStack.push(dom);\n }\n\n popContentBoxList() {\n this.__domStack.pop();\n }\n\n __offsetX(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetX(diff);\n });\n }\n\n __offsetY(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetY(diff);\n });\n }\n\n /**\n * inline的特殊调用,非行首无论是否有内容都设置lineBox的lineHeight\n * @param l\n * @param b\n * @private\n */\n setLbByInlineIfNotNewLine(l, b) {\n let length = this.list.length;\n if(length && !this.isNewLine) {\n this.list[length - 1].__setLB(l, b);\n }\n }\n\n get size() {\n return this.list.length;\n }\n\n get lastX() {\n return this.__lastX;\n }\n\n get lastY() {\n return this.__lastY;\n }\n\n get endY() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[length - 1].endY;\n }\n return this.__y;\n }\n\n get isEnd() {\n return this.__isEnd;\n }\n\n get isNewLine() {\n return this.__isNewLine;\n }\n\n get breakLine() {\n return this.list.length > 1;\n }\n\n get domList() {\n return this.__domList;\n }\n\n get baseLine() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let n = 0;\n for(let i = 0; i < length - 1; i++) {\n n += list[i].height;\n }\n return n + list[length - 1].baseLine;\n }\n return 0;\n }\n\n get firstBaseLine() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[0].baseLine;\n }\n return 0;\n }\n\n get lineHeight() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1].lineHeight;\n }\n return 0;\n }\n\n get lineBox() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1];\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get width() {\n let w = 0;\n this.list.forEach(item => {\n w = Math.max(w, item.width);\n });\n return w;\n }\n}\n\nexport default LineBoxManager;\n","const TAG_NAME = {\n 'div': true,\n 'p': true,\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst INLINE = {\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst BOLD = {\n 'b': true,\n 'strong': true,\n}\n\nexport default {\n TAG_NAME,\n INLINE,\n BOLD,\n};\n","import enums from '../util/enums';\nimport unit from '../style/unit';\nimport level from './level';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n TOP,\n BOTTOM,\n POSITION,\n HEIGHT,\n },\n} = enums;\nconst { AUTO, PX, PERCENT } = unit;\nconst { REFLOW } = level;\n\nfunction offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) {\n if(dy) {\n let last;\n do {\n // component的sr没有next兄弟,视为component的next\n while(node.isShadowRoot) {\n node = node.host;\n }\n last = node;\n let isContainer, parent = node.domParent;\n if(parent) {\n let cs = parent.computedStyle;\n let ps = cs[POSITION];\n isContainer = parent === root || parent.isShadowRoot || ps === 'relative' || ps === 'absolute';\n }\n // 先偏移next,忽略有定位的absolute,本身非container也忽略\n let next = node.next;\n let container;\n while(next) {\n if(next.currentStyle[DISPLAY] !== 'none') {\n if(next.currentStyle[POSITION] === 'absolute') {\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = next.currentStyle;\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO || bottom[1] === PX) {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n }\n else if(top[1] === PERCENT) {\n let v = top[0] * 0.01 * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, null, next);\n }\n else {\n if(!container) {\n container = parent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, next]);\n }\n }\n }\n else {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n }\n next = next.next;\n }\n // root本身没domParent\n if(!parent) {\n break;\n }\n node = parent;\n // parent判断是否要resize\n let { currentStyle } = node;\n let isAbs = currentStyle[POSITION] === 'absolute';\n let need;\n if(isAbs) {\n if(currentStyle[HEIGHT][1] === AUTO\n && (currentStyle[TOP][1] === AUTO || currentStyle[BOTTOM][1] === AUTO)) {\n need = true;\n }\n }\n // height不定则需要\n else if(currentStyle[HEIGHT][1] === AUTO) {\n need = true;\n }\n if(need) {\n node.__resizeY(dy, REFLOW);\n node.clearCache();\n }\n // abs或者高度不需要继续向上调整提前跳出\n else {\n break;\n }\n if(node === root) {\n break;\n }\n }\n while(true);\n // 最后一个递归向上取消总缓存,防止过程中重复next多次无用递归\n while(last) {\n last.clearCache(true);\n last = last.domParent;\n }\n }\n}\n\nfunction clearUniqueReflowId(hash) {\n for(let i in hash) {\n if(hash.hasOwnProperty(i)) {\n let { node } = hash[i];\n delete node.__uniqueReflowId;\n }\n }\n}\n\nfunction getMergeMarginTB(topList, bottomList) {\n let total = 0;\n let max = topList[0];\n let min = topList[0];\n topList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n bottomList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n // 正数取最大,负数取最小,正负则相加\n let diff = 0;\n if(max > 0 && min > 0) {\n diff = Math.max(max, min) - total;\n }\n else if(max < 0 && min < 0) {\n diff = Math.min(max, min) - total;\n }\n else if(max !== 0 || min !== 0) {\n diff = max + min - total;\n }\n return diff;\n}\n\nexport default {\n offsetAndResizeByNodeOnY,\n clearUniqueReflowId,\n getMergeMarginTB,\n};\n","import Xom from './Xom';\nimport Text from './Text';\nimport mode from './mode';\nimport LineBoxManager from './LineBoxManager';\nimport Component from './Component';\nimport tag from './tag';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport $$type from '../util/$$type';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport reflow from '../refresh/reflow';\nimport builder from '../util/builder';\nimport level from '../refresh/level';\n\nconst {\n STYLE_KEY: {\n POSITION,\n DISPLAY,\n FONT_WEIGHT,\n MARGIN_LEFT,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n PADDING_LEFT,\n PADDING_BOTTOM,\n PADDING_RIGHT,\n PADDING_TOP,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n TOP,\n RIGHT,\n BOTTOM,\n LEFT,\n WIDTH,\n HEIGHT,\n TEXT_ALIGN,\n FLEX_DIRECTION,\n FLEX_BASIS,\n FLEX_SHRINK,\n FLEX_GROW,\n ALIGN_SELF,\n ALIGN_ITEMS,\n JUSTIFY_CONTENT,\n Z_INDEX,\n WHITE_SPACE,\n LINE_HEIGHT,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n OVERFLOW,\n FONT_SIZE,\n // PERSPECTIVE,\n // TRANSFORM,\n },\n NODE_KEY: {\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_STRUCT,\n NODE_DOM_PARENT,\n NODE_IS_INLINE,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_ADD_DOM,\n UPDATE_CONFIG,\n UPDATE_MEASURE,\n },\n STRUCT_KEY: {\n STRUCT_NUM,\n STRUCT_LV,\n STRUCT_TOTAL,\n STRUCT_CHILD_INDEX,\n STRUCT_INDEX,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH } = unit;\nconst { calAbsolute, isRelativeOrAbsolute } = css;\n\nfunction genZIndexChildren(dom) {\n let normal = [];\n let hasMc;\n let mcHash = {};\n let lastMaskIndex;\n let children = dom.children;\n children.forEach((item, i) => {\n let child = item;\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n // 遮罩单独保存后特殊排序\n if(item instanceof Xom && item.isMask) {\n // 开头的mc忽略,后续的连续mc以第一次出现为准\n if(lastMaskIndex !== undefined) {\n mcHash[lastMaskIndex].push(item);\n }\n else if(i) {\n lastMaskIndex = i - 1;\n children[lastMaskIndex].__iIndex = lastMaskIndex;\n mcHash[lastMaskIndex] = [item];\n hasMc = true;\n }\n }\n else {\n lastMaskIndex = undefined;\n if(item instanceof Xom) {\n child.__zIndex = item.currentStyle[Z_INDEX];\n if(isRelativeOrAbsolute(item)) {\n // 临时变量为排序使用\n child.__aIndex = true;\n normal.push(child);\n }\n else {\n normal.push(child);\n }\n }\n else {\n child.__zIndex = 0;\n normal.push(child);\n }\n child.__iIndex = i;\n }\n });\n normal.sort(function(a, b) {\n if(a.__zIndex !== b.__zIndex) {\n return a.__zIndex - b.__zIndex;\n }\n // zIndex相等时abs优先flow\n if(a.__aIndex !== b.__aIndex) {\n if(a.__aIndex) {\n return 1;\n }\n return -1;\n }\n // 都相等看索引\n return a.__iIndex - b.__iIndex;\n });\n // 将遮罩插入到对应顺序上\n if(hasMc) {\n for(let i = normal.length - 1; i >= 0; i--) {\n let idx = normal[i].__iIndex;\n if(mcHash.hasOwnProperty(idx)) {\n normal.splice(i + 1, 0, ...mcHash[idx]);\n }\n }\n }\n return normal;\n}\n\n// flex布局阶段顺序,不是渲染也和struct结构无关,可以无视mask\nfunction genOrderChildren(flowChildren) {\n let normal = [];\n flowChildren.forEach((item, i) => {\n let child = item;\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Xom) {\n child.__order = item.currentStyle[ORDER];\n }\n else {\n child.__order = 0;\n }\n normal.push(child);\n child.__iIndex = i;\n });\n normal.sort(function(a, b) {\n if(a.__order !== b.__order) {\n return a.__order - b.__order;\n }\n // order相等时看节点索引\n return a.__iIndex - b.__iIndex;\n });\n return normal;\n}\n\nclass Dom extends Xom {\n constructor(tagName, props, children) {\n super(tagName, props);\n let { style } = this;\n if(!style.display || !{\n flex: true,\n block: true,\n inline: true,\n inlineBlock: true,\n 'inline-block': true,\n none: true,\n }.hasOwnProperty(style.display)) {\n if(tag.INLINE.hasOwnProperty(this.tagName)) {\n style.display = 'inline';\n }\n else {\n style.display = 'block';\n }\n }\n if(!style[FONT_WEIGHT] && tag.BOLD.hasOwnProperty(tagName)) {\n style.fontWeight = 700;\n }\n this.__style = css.normalize(style, reset.DOM_ENTRY_SET);\n // currentStyle/currentProps不深度clone,继承一层即可,动画时也是extend这样只改一层引用不动原始静态style\n this.__currentStyle = util.extend({}, this.__style);\n this.__children = children || [];\n this.__flexLine = []; // flex布局多行模式时存储行\n let config = this.__config;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_STYLE] = this.__style;\n }\n\n __structure(i, lv, j) {\n let res = super.__structure(i++, lv, j);\n let arr = [res];\n let zIndexChildren = this.__zIndexChildren = this.__zIndexChildren || genZIndexChildren(this);\n zIndexChildren.forEach((child, j) => {\n let temp = child.__structure(i, lv + 1, j);\n if(Array.isArray(temp)) {\n i += temp.length;\n arr = arr.concat(temp);\n }\n else {\n i++;\n arr.push(temp);\n }\n });\n let total = arr.length - 1;\n res[STRUCT_NUM] = zIndexChildren.length;\n res[STRUCT_TOTAL] = total;\n return arr;\n }\n\n __modifyStruct(root, offset = 0) {\n let __config = this.__config;\n let struct = __config[NODE_STRUCT];\n let total = struct[STRUCT_TOTAL] || 0;\n // 新生成了struct,引用也变了\n let nss = this.__structure(struct[STRUCT_INDEX], struct[STRUCT_LV], struct[STRUCT_CHILD_INDEX]);\n root.__structs.splice(struct[STRUCT_INDEX] + offset, total + 1, ...nss);\n let d = 0;\n if(this !== root) {\n struct = __config[NODE_STRUCT];\n d = (struct[STRUCT_TOTAL] || 0) - total;\n let ps = __config[NODE_DOM_PARENT].__config[NODE_STRUCT];\n ps[STRUCT_TOTAL] = ps[STRUCT_TOTAL] || 0;\n ps[STRUCT_TOTAL] += d;\n }\n return [struct, d];\n }\n\n /**\n * 因为zIndex/abs的变化造成的更新,只需重排这一段顺序即可\n * 即便包含component造成的dom变化也不影响,component作为子节点reflow会再执行,这里重排老的vd\n * @param structs\n * @private\n */\n __updateStruct(structs) {\n let { [STRUCT_INDEX]: index, [STRUCT_TOTAL]: total = 0 } = this.__config[NODE_STRUCT];\n let zIndexChildren = this.__zIndexChildren = genZIndexChildren(this);\n let length = zIndexChildren.length;\n if(length === 1) {\n return;\n }\n zIndexChildren.forEach((child, i) => {\n child.__config[NODE_STRUCT][STRUCT_CHILD_INDEX] = i;\n });\n // 按直接子节点划分为相同数量的若干段进行排序\n let arr = [];\n let source = [];\n for(let i = index + 1; i <= index + total; i++) {\n let child = structs[i];\n let o = {\n child,\n list: structs.slice(child[STRUCT_INDEX], child[STRUCT_INDEX] + child[STRUCT_TOTAL] + 1),\n };\n arr.push(o);\n source.push(o);\n i += child[STRUCT_TOTAL] || 0;\n }\n arr.sort(function(a, b) {\n return a.child[STRUCT_CHILD_INDEX] - b.child[STRUCT_CHILD_INDEX];\n });\n // 是否有变更,有才进行重新计算\n let needSort;\n for(let i = 0, len = source.length; i < len; i++) {\n if(source[i] !== arr[i]) {\n needSort = true;\n break;\n }\n }\n if(needSort) {\n let list = [];\n arr.forEach(item => {\n list = list.concat(item.list);\n });\n list.forEach((struct, i) => {\n struct[STRUCT_INDEX] = index + i + 1;\n })\n structs.splice(index + 1, total, ...list);\n }\n }\n\n /**\n * 给定父宽度情况下,尝试行内放下后的剩余宽度,为负数即放不下,这里只会出现行内级即inline(Block)\n * 调用前提是非行开头的inline尝试计算是否放得下,开头无需且禁止判断,防止出现永远放不下一个字符卡死\n * 返回非负数就是放得下,这样一些尺寸为0的也算\n * @param w 剩余宽度\n * @param total 容器尺寸\n * @returns {number|*}\n * @private\n */\n __tryLayInline(w, total) {\n let { flowChildren, currentStyle: {\n [DISPLAY]: display,\n [WIDTH]: width,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n // inline没w/h,并且尝试孩子第一个能放下即可,如果是文字就是第一个字符\n if(display === 'inline') {\n if(flowChildren.length) {\n let first = flowChildren[0];\n if(first instanceof Component) {\n first = first.shadowRoot;\n }\n if(first instanceof Xom) {\n w = first.__tryLayInline(w, total);\n }\n else {\n w -= first.firstCharWidth;\n }\n }\n }\n // inlineBlock尝试所有孩子在一行上\n else {\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n else {\n for(let i = 0; i < flowChildren.length; i++) {\n // 当放不下时直接返回,无需继续多余的尝试计算\n if(w < 0) {\n return w;\n }\n let item = flowChildren[i];\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Xom) {\n w = item.__tryLayInline(w, total);\n }\n // text强制一行,否则非头就是放不下,需从头开始\n else {\n w -= item.textWidth;\n }\n }\n }\n // ib要减去末尾mpb\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n }\n // 还要减去开头的mpb\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n return w;\n }\n\n // 设置y偏移值,递归包括children,此举在justify-content/margin-auto等对齐用\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n // 记得偏移LineBox\n if(isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) {\n this.lineBoxManager.__offsetX(diff);\n }\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetX(diff, isLayout, lv);\n }\n });\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n if(isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) {\n this.lineBoxManager.__offsetY(diff);\n }\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetY(diff, isLayout, lv);\n }\n });\n }\n\n // item的递归子节点求min/max,只考虑固定值单位,忽略百分比,同时按方向和display\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this, this.isShadowRoot);\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h, lineBoxManager } = data;\n // 计算需考虑style的属性\n let {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n else {\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n }\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n else if(display === 'block') {\n let countMin = 0, countMax = 0;\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n countMin = countMax = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n }\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n else {\n if(display === 'inlineBlock' || display === 'inline-block') {\n lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n }\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n if(isDirectionRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else if(isDirectionRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n });\n }\n }\n return [display, this.__addMp(isDirectionRow, w, currentStyle, [min, max])];\n }\n\n /**\n * flex布局时,计算basis尺寸,如果有固定声明则以其为标准,content为内容最大尺寸,auto依赖w/h或降级content\n * basis要考虑相加直接item的mpb,非绝对值单位以container为基准,basis为内容时为max值\n * item的孩子为孙子节点需递归,不参与basis计算,只参与min/max,尺寸和mpb均只考虑绝对值\n * 自动计算时影响尺寸的只有换行的text,以及一组inline,均按其中最大尺寸的一个计算\n * auto自动计算递归进行,如果是普通row方向,按最大text的charWidth为准\n * 如果是column方向,则虚拟布局后看text的height\n * 在abs下时进入特殊状态,无论是row/column,都会按row方向尝试最大尺寸,直到舞台边缘或容器声明的w折行\n * 返回b,声明则按css值,否则是auto/content\n * 返回min为最小宽度,遇到字符/inline则单列排版后需要的最大宽度\n * 返回max为最大宽度,理想情况一排最大值,在abs时isVirtual状态参与计算,文本抵达边界才进行换行\n * @param isDirectionRow\n * @param data\n * @param isVirtual abs非固定尺寸时先进行虚拟布局标识\n * @private\n */\n __calBasis(isDirectionRow, data, isVirtual) {\n css.computeReflow(this, this.isShadowRoot);\n let b = 0;\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h } = data;\n // 计算需考虑style的属性\n let {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n [FLEX_BASIS]: flexBasis,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content\n let isAuto = flexBasis[1] === AUTO;\n let isFixed = [PX, PERCENT, REM, VW, VH].indexOf(flexBasis[1]) > -1;\n let isContent = !isAuto && !isFixed;\n let fixedSize;\n // flex的item固定basis计算\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = fixedSize = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = fixedSize = (isDirectionRow ? w : h) * flexBasis[0] * 0.01;\n }\n else if(flexBasis[1] === REM) {\n b = fixedSize = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = fixedSize = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = fixedSize = flexBasis[0] * this.root.height * 0.01;\n }\n }\n // 已声明主轴尺寸的,当basis是auto时为值\n else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1) && isAuto) {\n if(main[1] === PX) {\n b = fixedSize = main[0];\n }\n else if(main[1] === PERCENT) {\n b = fixedSize = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = fixedSize = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = fixedSize = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = fixedSize = main[0] * this.root.height * 0.01;\n }\n }\n // 非固定尺寸的basis为auto时降级为content\n else if(isAuto) {\n isContent = true;\n }\n // flex的item还是flex时\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n }\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n // flex的item是block/inline时,inline也会变成block统一对待\n else {\n let countMin = 0, countMax = 0;\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n countMin = countMax = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n }\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n if(fixedSize) {\n max = Math.max(fixedSize, max);\n }\n if(isContent) {\n b = max;\n }\n // 直接item的mpb影响basis\n return this.__addMp(isDirectionRow, w, currentStyle, [b, min, max], true);\n }\n\n __layoutNone() {\n super.__layoutNone();\n let { children } = this;\n children.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n item.__layoutNone();\n }\n });\n }\n\n /**\n * block布局,本身固定尺寸优先,否则看内容从上往下从左往右flow流排布\n * 内部inline和inlineBlock组成LineBox,通过LineBoxManager来管理混排的现象\n * LineBoxManager只有block和inlineBlock内部生成,inline会复用最近父级的\n * 内部的block在垂直方向要考虑margin合并的问题,强制所有节点为bfc,精简逻辑\n * @param data\n * @param isVirtual abs无尺寸时提前虚拟布局计算尺寸\n * @private\n */\n __layoutBlock(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n // 虚线管理一个block内部的LineBox列表,使得inline的元素可以中途衔接处理折行\n // 内部维护inline结束的各种坐标来达到目的,遇到block时中断并处理换行坐标\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n // 因精度问题,统计宽度均从0开始累加每行,最后取最大值,仅在abs布局时isVirtual生效\n let maxW = 0;\n let cw = 0;\n // 连续block(flex相同,下面都是)的上下margin合并值记录,合并时从列表中取\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isImg = item.tagName === 'img';\n // 每次循环开始前,这次不是block的话,看之前遗留待合并margin,并重置\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n if(isXom) {\n // inline和inlineBlock的细节不同之处,ib除了w/h之外,更想像block一样占据一行\n // 比如2个inline前面占一半后面比一半多但还是会从一半开始然后第2行换行继续,但ib放不下则重开一行\n // inline和ib能互相嵌套,形成的LineBox中则是TextBox和节点混合\n if(isInlineBlock || isInline) {\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || isInline && whiteSpace === 'nowrap') {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager, // ib内部新生成会内部判断,这里不管统一传入\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样\n if(item.__isIbFull) {\n x = data.x;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // abs统计宽度\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下,内部判断了inline/ib,ib要考虑是否有width\n let fw = item.__tryLayInline(w + data.x - x, w);\n // 放得下继续,奇怪的精度问题,加上阈值\n if(fw >= (-1e-10)) {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n x = data.x;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n if(isVirtual) {\n cw += item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n // block/flex先处理之前可能遗留的最后一行LineBox,然后递归时不传lineBoxManager,其内部生成新的\n else {\n // 非开头,说明之前的text未换行,需要增加行数\n if(x !== data.x && flowChildren[i - 1] instanceof Text) {\n lineClampCount++;\n }\n x = data.x;\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n let isNone = item.currentStyle[DISPLAY] === 'none';\n // 自身无内容\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n y += item.outerHeight;\n lineBoxManager.__lastY = y;\n // absolute/flex前置虚拟计算\n if(isVirtual) {\n maxW = Math.max(maxW, item.outerWidth);\n cw = 0;\n }\n // 空block要留下轮循环看,除非是最后一个,此处非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n item.__offsetY(diff, true);\n y += diff;\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n }\n }\n // 文字和inline类似\n else {\n // lineClamp作用域为block下的inline(同LineBox上下文)\n if(lineClamp && lineClampCount >= lineClamp) {\n return;\n }\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.width;\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x);\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, item.width);\n cw = 0;\n }\n }\n if(isVirtual) {\n cw += item.width;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n });\n // 结束后如果是以LineBox结尾,则需要设置y到这里,否则流布局中block会设置\n // 当以block换行时,新行是true,否则是false即结尾\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n }\n let tw = this.__width = (fixedWidth || !isVirtual) ? w : maxW;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // 非abs提前的虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐\n if(!isVirtual) {\n lineBoxManager.verticalAlign();\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // 所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n this.__marginAuto(currentStyle, data);\n }\n }\n\n // 弹性布局时的计算位置\n __layoutFlex(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle, __flexLine } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n // 每次布局情况多行内容\n __flexLine.splice(0);\n let {\n [FLEX_DIRECTION]: flexDirection,\n [JUSTIFY_CONTENT]: justifyContent,\n [ALIGN_ITEMS]: alignItems,\n [LINE_CLAMP]: lineClamp,\n [FLEX_WRAP]: flexWrap,\n [ALIGN_CONTENT]: alignContent,\n [LINE_HEIGHT]: lineHeight,\n [TEXT_ALIGN]: textAlign,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n let maxX = 0;\n let isDirectionRow = ['column', 'column-reverse', 'columnReverse'].indexOf(flexDirection) === -1;\n // 计算伸缩基数\n let growList = [];\n let shrinkList = [];\n let basisList = [];\n let maxList = [];\n let minList = [];\n let orderChildren = genOrderChildren(flowChildren);\n orderChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n // abs虚拟布局计算时纵向也是看横向宽度\n let [b, min, max] = item.__calBasis(isVirtual ? true : isDirectionRow, { x, y, w, h }, isVirtual);\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += max;\n }\n else {\n maxX = Math.max(maxX, max);\n }\n return;\n }\n let { [FLEX_GROW]: flexGrow, [FLEX_SHRINK]: flexShrink } = currentStyle;\n computedStyle[FLEX_BASIS] = b;\n growList.push(flexGrow);\n shrinkList.push(flexShrink);\n // 根据basis不同,计算方式不同\n basisList.push(b);\n maxList.push(max);\n minList.push(min);\n }\n // 文本\n else {\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += item.textWidth;\n }\n else {\n maxX = Math.max(maxX, item.textWidth);\n }\n return;\n }\n growList.push(0);\n shrinkList.push(1);\n if(isDirectionRow) {\n let cw = item.charWidth;\n let tw = item.textWidth;\n basisList.push(tw);\n maxList.push(tw);\n minList.push(cw);\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n });\n let h = item.height;\n basisList.push(h);\n minList.push(h);\n }\n }\n });\n // abs时,只需关注宽度即可,无需真正布局\n if(isVirtual) {\n let tw = this.__width = Math.min(maxX, w);\n this.__ioSize(tw, this.height);\n return;\n }\n let containerSize = isDirectionRow ? w : h;\n let isMultiLine = flexWrap === 'wrap' || ['wrap-reverse', 'wrapReverse'].indexOf(flexWrap) > -1;\n /**\n * 判断是否需要分行,根据假设主尺寸来统计尺寸和计算,假设主尺寸是clamp(min_main_size, flex_base_size, max_main_size)\n * 当多行时,由于每行一定有最小限制,所以每行一般情况都不是shrink状态,\n * 但也有极端情况,比如一行只能放下1个元素时,且此元素比容器小,会是shrink\n */\n let line = [], sum = 0, hypotheticalList = [];\n basisList.forEach((item, i) => {\n let min = minList[i], max = maxList[i];\n let hypothetical;\n if(item < min) {\n hypothetical = min;\n }\n else if(item > max) {\n hypothetical = max;\n }\n else {\n hypothetical = item;\n }\n hypotheticalList.push(hypothetical);\n if(isMultiLine) {\n // 超过尺寸时,要防止sum为0即1个也会超过尺寸\n if(sum + hypothetical > containerSize) {\n if(sum) {\n __flexLine.push(line);\n line = [orderChildren[i]];\n sum = hypothetical;\n }\n else {\n line.push(orderChildren[i]);\n __flexLine.push(line);\n line = [];\n sum = 0;\n }\n }\n else {\n line.push(orderChildren[i]);\n sum += hypothetical;\n }\n }\n else {\n line.push(orderChildren[i]);\n }\n });\n if(line.length) {\n __flexLine.push(line);\n }\n let offset = 0, clone = { x, y, w, h };\n let maxCrossList = [];\n __flexLine.forEach(item => {\n let length = item.length;\n let end = offset + length;\n let [x1, y1, maxCross] = this.__layoutFlexLine(clone, isDirectionRow, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, orderChildren.slice(offset, end), item, textAlign,\n growList.slice(offset, end), shrinkList.slice(offset, end), basisList.slice(offset, end),\n hypotheticalList.slice(offset, end), minList.slice(offset, end));\n // 下一行/列更新坐标\n if(isDirectionRow) {\n clone.y = y1;\n }\n else {\n clone.x = x1;\n }\n x = Math.max(x, x1);\n y = Math.max(y, y1);\n maxCrossList.push(maxCross);\n offset += length;\n });\n let tw = this.__width = w;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // flexDirection当有reverse时交换每line的主轴序\n if(flexDirection === 'row-reverse' || flexDirection === 'rowReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = tw - item.outerWidth - (item.x - data.x) * 2;\n if(diff) {\n item.__offsetX(diff, true);\n }\n });\n });\n }\n else if(flexDirection === 'column-reverse' || flexDirection === 'columnReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = th - item.outerHeight - (item.y - data.y) * 2;\n if(diff) {\n item.__offsetY(diff, true);\n }\n });\n });\n }\n // wrap-reverse且多轴线时交换轴线序,需要2行及以上才行\n let length = __flexLine.length;\n if(['wrapReverse', 'wrap-reverse'].indexOf(flexWrap) > -1 && length > 1) {\n let crossSum = 0, crossSumList = [];\n maxCrossList.forEach(item => {\n crossSumList.push(crossSum);\n crossSum += item;\n });\n let count = 0;\n for(let i = length - 1; i >= 0; i--) {\n let line = __flexLine[i];\n let source = crossSumList[i];\n let diff = count - source;\n if(diff) {\n line.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n count += maxCrossList[i];\n }\n __flexLine.reverse();\n }\n // 侧轴对齐分flexLine做,要考虑整体的alignContent的stretch和每行的alignItems的stretch\n // 先做整体的,得出交叉轴空白再均分给每一行做单行的,整体的只有1行忽略\n let per;\n if(!isVirtual && length > 1 && (fixedHeight && isDirectionRow || !isDirectionRow)) {\n let diff = isDirectionRow ? th - (y - data.y) : tw - (x - data.x);\n // 有空余时才进行对齐\n if(diff > 0) {\n if(alignContent === 'center') {\n let per = diff * 0.5;\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per, true);\n }\n else {\n item.__offsetX(per, true);\n }\n });\n }\n else if(alignContent === 'flex-start' || alignContent === 'flexStart') {}\n else if(alignContent === 'flex-end' || alignContent === 'flexEnd') {\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n else if(alignContent === 'space-between' || alignContent === 'spaceBetween') {\n let between = diff / (length - 1);\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(between, true);\n }\n else {\n item.__offsetX(between, true);\n }\n });\n }\n });\n }\n else if(alignContent === 'space-around' || alignContent === 'spaceAround') {\n let around = diff / (length + 1);\n __flexLine.forEach((item, i) => {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(around * (i + 1), true);\n }\n else {\n item.__offsetX(around * (i + 1), true);\n }\n });\n });\n }\n // 默认stretch\n else {\n per = diff / length;\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per * i, true);\n }\n else {\n item.__offsetX(per * i, true);\n }\n });\n }\n });\n }\n }\n }\n // 每行再进行cross对齐,在alignContent为stretch时计算每行的高度\n if(!isVirtual) {\n if(length > 1) {\n __flexLine.forEach((item, i) => {\n let maxCross = maxCrossList[i];\n if(per) {\n maxCross += per;\n }\n this.__crossAlign(item, alignItems, isDirectionRow, maxCross);\n });\n }\n else if(length) {\n let maxCross = maxCrossList[0];\n if(isDirectionRow) {\n if(fixedHeight) {\n maxCross = h;\n }\n }\n else {\n maxCross = w;\n }\n this.__crossAlign(__flexLine[0], alignItems, isDirectionRow, maxCross);\n }\n }\n this.__marginAuto(currentStyle, data);\n }\n\n /**\n * 计算获取子元素的b/min/max完毕后,尝试进行flex每行布局\n * https://www.w3.org/TR/css-flexbox-1/#layout-algorithm\n * 假想主尺寸,其为clamp(min_main_size, flex_base_size, max_main_size)\n * 随后按算法一步步来 https://zhuanlan.zhihu.com/p/354567655\n * 规范没提到mpb,item的要计算,孙子的只考虑绝对值\n * 先收集basis和假设主尺寸\n */\n __layoutFlexLine(data, isDirectionRow, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, orderChildren, flexLine, textAlign,\n growList, shrinkList, basisList, hypotheticalList, minList) {\n let { x, y, w, h } = data;\n let hypotheticalSum = 0;\n hypotheticalList.forEach(item => {\n hypotheticalSum += item;\n });\n // 根据假设尺寸确定使用grow还是shrink,冻结非弹性项并设置target尺寸,确定剩余未冻结数量\n let isOverflow = hypotheticalSum >= containerSize;\n let targetMainList = [];\n basisList.forEach((item, i) => {\n if(isOverflow) {\n if(!shrinkList[i] || (basisList[i] < hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n else {\n if(!growList[i] || (basisList[i] > hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n });\n // 初始可用空间,冻结使用确定的target尺寸,未冻结使用假想\n let free = 0;\n basisList.forEach((item, i) => {\n if(targetMainList[i] !== undefined) {\n free += targetMainList[i];\n }\n else {\n free += item;\n }\n });\n let total = Infinity;\n if(isDirectionRow) {\n total = w;\n }\n else if(fixedHeight) {\n total = h;\n }\n else {\n total = free;\n }\n free = Math.abs(total - free);\n // 循环,文档算法不够简练,其合并了grow和shrink,实际拆开写更简单\n let factorSum = 0;\n if(isOverflow) {\n // 计算真正的因子占比,同时得出缩小尺寸数值\n // 还需判断每个item收缩不能 {\n if(targetMainList[i] === undefined) {\n let n = item * basisList[i];\n factorSum += n;\n return n;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要收缩的尺寸\n let n = basisList[i] - s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n else {\n let factorList = growList.map((item, i) => {\n if(targetMainList[i] === undefined) {\n factorSum += item;\n return item;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要扩展的尺寸\n let n = basisList[i] + s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n let maxCross = 0;\n let lbmList = [];\n orderChildren.forEach((item, i) => {\n let main = targetMainList[i];\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n if(isDirectionRow) {\n item.__layout({\n x,\n y,\n w: main,\n h,\n w3: main, // w3假设固定宽度,忽略原始style中的设置\n });\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h: main,\n h3: main, // 同w2\n });\n }\n }\n else {\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n lbmList.push(lineBoxManager);\n item.__layout({\n x,\n y,\n w: isDirectionRow ? main : w,\n h: isDirectionRow ? h : main,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n });\n }\n if(isDirectionRow) {\n x += item.outerWidth;\n maxCross = Math.max(maxCross, item.outerHeight);\n }\n else {\n y += item.outerHeight;\n maxCross = Math.max(maxCross, item.outerWidth);\n }\n });\n // 计算主轴剩余时要用真实剩余空间而不能用伸缩剩余空间\n let diff = isDirectionRow ? (w - x + data.x) : (h - y + data.y);\n // 主轴对齐方式\n if(diff > 0) {\n let len = orderChildren.length;\n if(justifyContent === 'flexEnd' || justifyContent === 'flex-end') {\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(diff, true) : child.__offsetY(diff, true);\n }\n }\n else if(justifyContent === 'center') {\n let center = diff * 0.5;\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(center, true) : child.__offsetY(center, true);\n }\n }\n else if(justifyContent === 'spaceBetween' || justifyContent === 'space-between') {\n let between = diff / (len - 1);\n for(let i = 1; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(between * i, true) : child.__offsetY(between * i, true);\n }\n }\n else if(justifyContent === 'spaceAround' || justifyContent === 'space-around') {\n let around = diff / (len + 1);\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(around * (i + 1), true) : child.__offsetY(around * (i + 1), true);\n }\n }\n }\n if(isDirectionRow) {\n y += maxCross;\n }\n else {\n x += maxCross;\n }\n // flex的直接text对齐比较特殊\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lbmList.forEach(item => {\n item.horizonAlign(item.width, textAlign);\n })\n }\n return [x, y, maxCross];\n }\n\n // 每个flexLine的侧轴对齐,单行时就是一行对齐\n __crossAlign(line, alignItems, isDirectionRow, maxCross) {\n let baseLine = 0;\n line.forEach(item => {\n baseLine = Math.max(baseLine, item.firstBaseLine);\n });\n line.forEach(item => {\n let { currentStyle: { [ALIGN_SELF]: alignSelf } } = item;\n if(isDirectionRow) {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [HEIGHT]: height } } = item;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = item.__height = computedStyle[HEIGHT] = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n else if(alignSelf === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [HEIGHT]: height,\n } } = item;\n // row的孩子还是flex且column且不定高时,如果高度<侧轴拉伸高度则重新布局\n if(isDirectionRow && display === 'flex' && flexDirection === 'column' && height[1] === AUTO && item.outerHeight < maxCross) {\n item.__layout(Object.assign(item.__layoutData, { h3: maxCross }));\n }\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n }\n }\n // column\n else {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [WIDTH]: width } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [WIDTH]: width,\n } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n }\n }\n });\n }\n\n /**\n * inline比较特殊,先简单顶部对其,后续还需根据vertical和lineHeight计算y偏移\n * inlineBlock复用逻辑,可以设置w/h,在混排时表现不同,inlineBlock换行限制在规定的矩形内,\n * 且ib会在没设置width且换行的时候撑满上一行,即便内部尺寸没抵达边界\n * 而inline换行则会从父容器start处开始,且首尾可能占用矩形不同\n * 嵌套inline情况十分复杂,尾部mpb空白可能产生叠加情况,因此endSpace表示自身,\n * 然后根据是否在最后一个元素进行叠加父元素的,多层嵌套则多层尾部叠加,均以最后一个元素为依据判断\n * Text获取这个叠加的endSpace值即可,无需感知是否最后一个,外层(此处)进行逻辑封装\n * @param data\n * @param isVirtual\n * @param isInline\n * @private\n */\n __layoutInline(data, isVirtual, isInline) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h, lx,\n lineBoxManager, nowrap, endSpace, selfEndSpace } = this.__preLayout(data, isInline);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n let {\n [WIDTH]: width,\n } = currentStyle;\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n } = computedStyle;\n let lineClampCount = data.lineClampCount || 0;\n if(isInline && !this.__isRealInline()) {\n isInline = false;\n }\n // 只有inline的孩子需要考虑换行后从行首开始,而ib不需要,因此重置行首标识lx为x,末尾空白为0\n // 而inline的LineBoxManager复用最近非inline父dom的,ib需要重新生成,末尾空白叠加\n if(isInline) {\n this.__config[NODE_IS_INLINE] = true;\n this.__lineBoxManager = lineBoxManager;\n let baseLine = css.getBaseLine(computedStyle);\n // 特殊inline调用,有内容的话(如左右mbp),默认生成一个lineBox,即便是空,也要形成占位,只有开头时需要\n if(marginLeft || marginRight\n || paddingLeft || paddingRight\n || borderLeftWidth || borderRightWidth) {\n if(lineBoxManager.isNewLine) {\n lineBoxManager.genLineBoxByInlineIfNewLine(x, y, lineHeight, baseLine);\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseLine);\n }\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseLine);\n }\n lineClamp = data.lineClamp || 0;\n }\n else {\n lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n lx = x;\n endSpace = selfEndSpace = lineClampCount = 0;\n }\n // 存LineBox里的内容列表专用,布局过程中由lineBoxManager存入,递归情况每个inline节点都保存contentBox\n let contentBoxList;\n if(isInline) {\n contentBoxList = this.__contentBoxList = [];\n lineBoxManager.pushContentBoxList(this);\n }\n let isIbFull = false; // ib时不限定w情况下发生折行则撑满行,即便内容没有撑满边界\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline2 = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock2 = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isRealInline = isXom && item.__isRealInline();\n // 最后一个元素会产生最后一行,叠加父元素的尾部mpb\n let isEnd = isInline && (i === length - 1);\n if(isEnd) {\n endSpace += selfEndSpace;\n }\n if(isXom) {\n if(!isInline2 && !isInlineBlock2) {\n item.currentStyle[DISPLAY] = item.computedStyle[DISPLAY] = 'inlineBlock';\n isInlineBlock2 = true;\n inject.warn('Inline can not contain block/flex');\n }\n // x开头,不用考虑是否放得下直接放,i为0强制不换行\n if(x === lx || !i || isInline2 && whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样\n if(item.__isIbFull) {\n isInlineBlock2 && (w[1] === AUTO) && (isIbFull = true);\n lineBoxManager.addItem(item);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中,以计算宽度\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n }\n else {\n // 不换行继续排,换行非开头先尝试是否放得下,结尾要考虑mpb因此减去endSpace\n let fw = (whiteSpace === 'nowrap') ? 0 : item.__tryLayInline(w - x + lx, w - (isEnd ? endSpace : 0));\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n nowrap: whiteSpace === 'nowrap',\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n isInline2 && lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n lineBoxManager.addItem(item);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n }\n }\n }\n // inline里的其它只有文本,可能开始紧跟着之前的x,也可能换行后从lx行头开始\n // 紧跟着x可能出现在前面有节点换行后第2行,此时不一定放得下,因此不能作为判断依据,开头仅有lx\n else {\n let n = lineBoxManager.size;\n // i为0时强制不换行\n if(x === lx || !i || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行,且非定宽\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n }\n else {\n // 非开头先尝试是否放得下,如果放得下再看是否end,加end且只有1个字时放不下要换行,否则可以放,换行由text内部做\n // 第一个Text且父元素声明了nowrap也强制不换行,非第一个则看本身whiteSpace声明\n let focusNoWrap = (!i && nowrap) || whiteSpace === 'nowrap';\n let fw = focusNoWrap ? 0 : item.__tryLayInline(w + lx - x);\n if(!focusNoWrap && fw >= 0 && isEnd && endSpace && item.content.length === 1) {\n let fw2 = fw - endSpace;\n if(fw2 < 0) {\n fw = fw2;\n }\n }\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // 这里ib放得下一定是要么没换行要么固定宽度,所以无需判断isIbFull\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n }\n }\n }\n });\n // 同block结尾,不过这里一定是lineBox结束,无需判断\n y = lineBoxManager.endY;\n // 标识ib情况同block一样占满行\n this.__isIbFull = isIbFull;\n // 元素的width在固定情况或者ibFull情况已被计算出来,否则为最大延展尺寸,inline没有固定尺寸概念\n let tw, th;\n if(isInline) {\n // inline最后的x要算上右侧mpb,为next行元素提供x坐标基准,同时其尺寸计算比较特殊\n if(selfEndSpace) {\n lineBoxManager.addX(selfEndSpace);\n }\n // 如果没有内容,空白还要加上开头即左侧mpb\n if(!flowChildren.length) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = computedStyle;\n lineBoxManager.addX(marginLeft + paddingLeft + borderLeftWidth);\n }\n // 结束出栈contentBox,递归情况结束子inline获取contentBox,父inline继续\n lineBoxManager.popContentBoxList();\n // abs非固定w时预计算,本来是最近非inline父层统一计算,但在abs时不算,\n if(isVirtual) {\n this.__inlineSize();\n }\n }\n else {\n // ib在满时很特殊,取最大值,可能w本身很小不足排下1个字符,此时要用maxW\n let maxW = lineBoxManager.__maxX - data.x;\n tw = this.__width = fixedWidth ? w : (isIbFull ? Math.max(w, maxW) : maxW);\n th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n }\n // 非abs提前虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐,inline会被父级调用这里只看ib\n if(!isVirtual && !isInline) {\n lineBoxManager.verticalAlign();\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // block的所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n }\n // inlineBlock新开上下文,但父级block遇到要处理换行\n return isInline ? lineClampCount : 0;\n }\n\n /**\n * inline的尺寸计算非常特殊,并非一个矩形区域,而是由字体行高结合节点下多个LineBox中的内容决定,\n * 且这个尺寸又并非真实LineBox中的内容直接合并计算而来,比如包含了个更大尺寸的ib却不会计入\n * 具体方法为遍历持有的LineBox下的内容,x取两侧极值,同时首尾要考虑mpb,y值取上下极值,同样首尾考虑mpb\n * 首尾行LineBox可能不是不是占满一行,比如前后都有同行inline的情况,非首尾行则肯定占满\n * 绘制内容(如背景色)的区域也很特殊,每行LineBox根据lineHeight对齐baseLine得来,并非LineBox全部\n * 当LineBox只有直属Text时如果font没有lineGap则等价于全部,如有则需减去\n * 另外其client/offset/outer的w/h尺寸计算也很特殊,皆因首尾x方向的mpb导致\n * @private\n */\n __inlineSize(tw, textAlign) {\n let { contentBoxList, computedStyle, __ox, __oy } = this;\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // x/clientX/offsetX/outerX\n let maxX, maxY, minX, minY, maxCX, maxCY, minCX, minCY, maxFX, maxFY, minFX, minFY, maxOX, maxOY, minOX, minOY;\n let length = contentBoxList.length;\n if(length) {\n // 遍历contentBox,里面存的是LineBox内容,根据父LineBox引用判断是否换行\n contentBoxList.forEach((item, i) => {\n // 非第一个除了minY不用看其它都要,minX是换行导致,而maxX在最后一个要考虑右侧mpb,中间的无需考虑嵌套inline的mpb\n if(i) {\n minX = Math.min(minX, item.x);\n minCX = Math.min(minCX, item.x);\n minFX = Math.min(minFX, item.x);\n minOX = Math.min(minOX, item.x);\n if(i === length - 1) {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n maxY = maxCY = maxFY = maxOY = Math.max(maxY, item.y + item.outerHeight);\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n else {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n }\n }\n // 第一个初始化\n else {\n minX = item.x;\n minY = item.y;\n minCX = minX - paddingLeft;\n minCY = minY - paddingTop;\n minFX = minCX - borderLeftWidth;\n minFY = minCY - borderTopWidth;\n minOX = minFX - marginLeft;\n minOY = minFY - marginTop;\n maxX = maxCX = maxFX = maxOX = item.x + item.outerWidth;\n maxY = maxCY = maxFY = maxOY = item.y + item.outerHeight;\n if(i === length - 1) {\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n }\n });\n this.__x = minOX;\n this.__y = minOY;\n this.__width = computedStyle[WIDTH] = maxX - minX;\n // 防止比自己最小高度lineHeight还小,比如内容是个小字体\n this.__height = computedStyle[HEIGHT] = Math.max(lineHeight, maxY - minY);\n this.__clientWidth = maxCX - minCX;\n this.__clientHeight = maxCY - minCY;\n this.__offsetWidth = maxFX - minFX;\n this.__offsetHeight = maxFY - minFY;\n this.__outerWidth = maxOX - minOX;\n this.__outerHeight = maxOY - minOY;\n this.__sx = minOX + __ox;\n this.__sy = minOY + __oy;\n this.__sx1 = minFX + __ox;\n this.__sy1 = minFY + __oy;\n this.__sx2 = minCX + __ox;\n this.__sy2 = minCY + __oy;\n this.__sx3 = minX + __ox;\n this.__sy3 = minY + __oy;\n this.__sx4 = maxX + __ox;\n this.__sy4 = maxY + __oy;\n this.__sx5 = maxCX + __ox;\n this.__sy5 = maxCY + __oy;\n this.__sx6 = maxFX + __ox;\n this.__sy6 = maxFY + __oy;\n // inline的text整体设置相同\n if(['center', 'right'].indexOf(textAlign) > -1) {\n this.children.forEach(item => {\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n }\n // 如果没有内容,宽度为0高度为lineHeight,对齐也特殊处理,lineBoxManager不会处理\n else {\n if(['center', 'right'].indexOf(textAlign) > -1) {\n let diff = tw;\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n if(diff) {\n this.__offsetX(diff, true);\n }\n }\n this.__width = computedStyle[WIDTH] = 0;\n let th = this.__height = computedStyle[HEIGHT] = lineHeight;\n this.__ioSize(0, th);\n this.__sy -= marginTop + paddingTop + borderTopWidth;\n this.__sx1 = this.sx + marginLeft;\n this.__sy1 = this.sy + marginTop;\n this.__sx2 = this.__sx1 + borderLeftWidth;\n this.__sy2 = this.__sy1 + borderTopWidth;\n this.__sx4 = this.__sx3 = this.__sx2 + paddingLeft;\n this.__sy4 = this.__sy3 = this.__sy2 + paddingTop;\n this.__sx5 = this.__sx4 + paddingRight;\n this.__sy5 = this.__sy4 + th + paddingBottom;\n this.__sx6 = this.__sx5 + borderRightWidth;\n this.__sy6 = this.__sy5 + borderBottomWidth;\n this.__clientWidth = this.__sx5 - this.__sx2;\n this.__clientHeight = this.__sy5 - this.__sy2;\n this.__offsetWidth = this.__sx6 - this.__sx1;\n this.__offsetHeight = this.__sy6 - this.__sy1;\n this.__outerWidth = this.__offsetWidth + marginLeft + marginRight;\n this.__outerHeight = this.__offsetHeight + marginTop + marginBottom;\n }\n }\n\n /**\n * 只针对绝对定位children布局\n * @param container\n * @param data\n * @param target 可选,只针对某个abs的child特定布局,在局部更新时用\n * @private\n */\n __layoutAbs(container, data, target) {\n let { sx: x, sy: y, clientWidth, clientHeight, computedStyle } = container;\n let { isDestroyed, children, absChildren } = this;\n let {\n [DISPLAY]: display,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n } = computedStyle;\n if(isDestroyed || display === 'none') {\n this.__layoutNone();\n return;\n }\n x += marginLeft + borderLeftWidth;\n y += marginTop + borderTopWidth;\n // 对absolute的元素进行相对容器布局\n absChildren.forEach(item => {\n if(target) {\n // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr\n let node = item;\n if(node instanceof Component) {\n node = item.shadowRoot;\n }\n // 所以得2个都对比\n if(target !== node && target !== item) {\n return;\n }\n }\n let { currentStyle, computedStyle } = item;\n if(currentStyle[DISPLAY] === 'none') {\n item.__layoutNone();\n return;\n }\n // 先根据容器宽度计算margin/padding\n item.__mp(currentStyle, computedStyle, clientWidth);\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let { [LEFT]: left, [TOP]: top, [RIGHT]: right,\n [BOTTOM]: bottom, [WIDTH]: width, [HEIGHT]: height, [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection } = currentStyle;\n let x2, y2, w2, h2;\n let onlyRight;\n let onlyBottom;\n let fixedTop;\n let fixedRight;\n let fixedBottom;\n let fixedLeft;\n // 判断何种方式的定位,比如左+宽度,左+右之类\n if(left[1] !== AUTO) {\n fixedLeft = true;\n computedStyle[LEFT] = calAbsolute(currentStyle, 'left', left, clientWidth, this.root);\n }\n else {\n computedStyle[LEFT] = 'auto';\n }\n if(right[1] !== AUTO) {\n fixedRight = true;\n computedStyle[RIGHT] = calAbsolute(currentStyle, 'right', right, clientWidth, this.root);\n }\n else {\n computedStyle[RIGHT] = 'auto';\n }\n if(top[1] !== AUTO) {\n fixedTop = true;\n computedStyle[TOP] = calAbsolute(currentStyle, 'top', top, clientHeight, this.root);\n }\n else {\n computedStyle[TOP] = 'auto';\n }\n if(bottom[1] !== AUTO) {\n fixedBottom = true;\n computedStyle[BOTTOM] = calAbsolute(currentStyle, 'bottom', bottom, clientHeight, this.root);\n }\n else {\n computedStyle[BOTTOM] = 'auto';\n }\n // 优先级最高left+right,其次left+width,再次right+width,再次仅申明单个,最次全部auto\n if(fixedLeft && fixedRight) {\n x2 = x + computedStyle[LEFT];\n w2 = x + clientWidth - computedStyle[RIGHT] - x2;\n }\n else if(fixedLeft) {\n x2 = x + computedStyle[LEFT];\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n }\n else if(fixedRight) {\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n else {\n onlyRight = true;\n }\n x2 = x + clientWidth - computedStyle[RIGHT] - (w2 || 0);\n // 右对齐有尺寸时还需减去margin/border/padding的\n x2 -= computedStyle[MARGIN_LEFT];\n x2 -= computedStyle[MARGIN_RIGHT];\n x2 -= computedStyle[PADDING_LEFT];\n x2 -= computedStyle[PADDING_RIGHT];\n x2 -= currentStyle[BORDER_LEFT_WIDTH][0];\n x2 -= currentStyle[BORDER_RIGHT_WIDTH][0];\n }\n else {\n x2 = x + paddingLeft;\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n }\n // top/bottom/height优先级同上\n if(fixedTop && fixedBottom) {\n y2 = y + computedStyle[TOP];\n h2 = y + clientHeight - computedStyle[BOTTOM] - y2;\n }\n else if(fixedTop) {\n y2 = y + computedStyle[TOP];\n if(height[1] !== AUTO) {\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else {\n h2 = height[0];\n }\n }\n }\n else if(fixedBottom) {\n if(height[1] !== AUTO) {\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else {\n h2 = height[0];\n }\n }\n else {\n onlyBottom = true;\n }\n y2 = y + clientHeight - computedStyle[BOTTOM] - (h2 || 0);\n // 底对齐有尺寸时y值还需减去margin/border/padding的\n y2 -= computedStyle[MARGIN_TOP];\n y2 -= computedStyle[MARGIN_BOTTOM];\n y2 -= computedStyle[PADDING_TOP];\n y2 -= computedStyle[PADDING_BOTTOM];\n y2 -= currentStyle[BORDER_TOP_WIDTH][0];\n y2 -= currentStyle[BORDER_BOTTOM_WIDTH][0];\n }\n // 未声明y的找到之前的流布局child,紧随其下\n else {\n y2 = y + paddingTop;\n let prev = item.prev;\n while(prev) {\n // 目前不考虑margin合并,直接以前面的flow的最近的prev末尾为准\n if(prev instanceof Text || prev.computedStyle[POSITION] !== 'absolute') {\n y2 = prev.y + prev.outerHeight;\n break;\n }\n prev = prev.prev;\n }\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else if(height[1] === PX) {\n h2 = height[0];\n }\n }\n // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局\n let needCalWidth;\n if((display === 'block' || ['inlineBlock', 'inline-block'].indexOf(display) > -1) && w2 === undefined) {\n needCalWidth = true;\n }\n else if(display === 'flex') {\n if(w2 === undefined) {\n needCalWidth = true;\n }\n else if(flexDirection === 'column' && h2 === undefined) {\n needCalWidth = true;\n }\n }\n // onlyRight时做的布局其实是以那个点位为left/top布局然后offset,limit要特殊计算,从本点向左侧为边界\n let wl = onlyRight ? x2 - x : clientWidth + x - x2;\n // onlyBottom相同,正常情况是左上到右下的尺寸限制\n let hl = onlyBottom ? y2 - y : clientHeight + y - y2;\n // 未直接或间接定义尺寸,取孩子宽度最大值\n if(needCalWidth) {\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n }, true, true);\n wl = item.outerWidth;\n }\n // needCalWidth传入,因为自适应尺寸上面已经计算过一次margin/padding了\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n w2, // left+right这种等于有宽度,但不能修改style,继续传入到__preLayout中特殊对待\n h2,\n }, false, true);\n if(onlyRight) {\n item.__offsetX(-item.outerWidth, true);\n }\n if(onlyBottom) {\n item.__offsetY(-item.outerHeight, true);\n }\n });\n // 递归进行,遇到absolute/relative/component的设置新容器\n children.forEach(item => {\n if(target) {\n // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr\n let node = item;\n if(node instanceof Component) {\n node = item.shadowRoot;\n }\n // 所以得2个都对比\n if(target !== node && target !== item) {\n return;\n }\n }\n if(item instanceof Dom) {\n item.__layoutAbs(isRelativeOrAbsolute(item) ? item : container, data);\n }\n else if(item instanceof Component) {\n let sr = item.shadowRoot;\n if(sr instanceof Dom) {\n sr.__layoutAbs(sr, data);\n }\n }\n });\n this.__execAr();\n }\n\n /**\n * 布局前检查继承的样式以及统计字体测量信息\n * 首次检查为整树遍历,后续检查是节点自发局部检查,不再进入\n * @param renderMode\n * @param ctx\n * @param cb\n * @private\n */\n __computeMeasure(renderMode, ctx, cb) {\n super.__computeMeasure(renderMode, ctx, cb);\n // 即便自己不需要计算,但children还要继续递归检查\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx, cb);\n });\n }\n\n render(renderMode, lv, ctx, cache, 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 unit from '../style/unit';\nimport image from '../style/image';\nimport border from '../style/border';\nimport enums from '../util/enums';\nimport level from '../refresh/level';\nimport mx from '../math/matrix';\n\nconst {\n STYLE_KEY: {\n WIDTH,\n HEIGHT,\n DISPLAY,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n VISIBILITY,\n BACKGROUND_IMAGE,\n BACKGROUND_COLOR,\n BOX_SHADOW,\n MIX_BLEND_MODE,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n FONT_SIZE,\n FLEX_BASIS,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_CONFIG,\n },\n NODE_KEY: {\n NODE_CACHE,\n NODE_DEFS_CACHE,\n NODE_IS_MASK,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH, RGBA } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { isFunction } = util;\n\nclass Img extends Dom {\n constructor(tagName, props) {\n super(tagName, props);\n let src = this.props.src;\n let loadImg = this.__loadImg = {\n src,\n };\n // 空url用错误图代替\n if(!src) {\n loadImg.error = true;\n }\n let config = this.__config;\n if(config[NODE_IS_MASK]) {\n let { style, currentStyle } = this;\n style[BACKGROUND_IMAGE] = currentStyle[BACKGROUND_IMAGE] = [null];\n style[BACKGROUND_COLOR] = currentStyle[BACKGROUND_COLOR] = [[0, 0, 0, 0], RGBA];\n style[BORDER_TOP_WIDTH] = currentStyle[BORDER_TOP_WIDTH] = [0, PX];\n style[BORDER_RIGHT_WIDTH] = currentStyle[BORDER_RIGHT_WIDTH] = [0, PX];\n style[BORDER_LEFT_WIDTH] = currentStyle[BORDER_LEFT_WIDTH] = [0, PX];\n style[BORDER_BOTTOM_WIDTH] = currentStyle[BORDER_BOTTOM_WIDTH] = [0, PX];\n style[BOX_SHADOW] = currentStyle[BOX_SHADOW] = null;\n style[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE] = 'normal';\n }\n }\n\n /**\n * 覆盖xom的方法,在__layout3个分支中会首先被调用\n * 当样式中固定宽高时,图片按样式尺寸,加载后重新绘制即可\n * 只固定宽高一个时,加载完要计算缩放比,重新布局绘制\n * 都没有固定,按照图片尺寸,重新布局绘制\n * 这里计算非固定的情况,将其改为固定供布局渲染使用,未加载完成为0\n * @param data\n * @returns {{fixedWidth: boolean, w: *, x: *, h: *, y: *, fixedHeight: boolean}}\n * @private\n */\n __preLayout(data) {\n let res = super.__preLayout(data);\n let loadImg = this.__loadImg;\n // 可能已提前加载好了,或有缓存,为减少刷新直接使用\n if(!loadImg.error) {\n let src = loadImg.src;\n let cache = inject.IMG[src];\n if(cache && cache.state === inject.LOADED) {\n loadImg.source = cache.source;\n loadImg.width = cache.width;\n loadImg.height = cache.height;\n }\n loadImg.cache = false;\n }\n if(res.fixedWidth && res.fixedHeight) {\n return res;\n }\n if(loadImg.error && !this.props.placeholder) {\n if(res.fixedWidth) {\n res.h = res.w;\n }\n else if(res.fixedHeight) {\n res.w = res.h;\n }\n else {\n res.w = res.h = 32;\n }\n }\n else if(loadImg.source) {\n if(res.fixedWidth) {\n res.h = res.w * loadImg.height / loadImg.width;\n }\n else if(res.fixedHeight) {\n res.w = res.h * loadImg.width / loadImg.height;\n }\n else {\n res.w = loadImg.width;\n res.h = loadImg.height;\n }\n }\n else {\n res.w = res.h = 0;\n }\n res.fixedWidth = true;\n res.fixedHeight = true;\n return res;\n }\n\n __addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n __destroy() {\n this.root.delRefreshTask(this.__task);\n super.__destroy();\n this.__task = null;\n }\n\n // img根据加载情况更新__hasContent\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n let res = super.__calContent(renderMode, lv, currentStyle, computedStyle);\n if(!res) {\n let {\n __loadImg: loadImg,\n } = this;\n if(computedStyle[VISIBILITY] !== 'hidden' && (computedStyle[WIDTH] || computedStyle[HEIGHT])\n && loadImg.source) {\n res = true;\n }\n }\n return res;\n }\n\n render(renderMode, lv, ctx, cache, 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 ctx.arc(cx, cy, r, 0, 2 * Math.PI);\n ctx.fill();\n ctx.closePath();\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for(let i = 1, len = pts.length; i < len; i++) {\n let point = pts[i];\n ctx.lineTo(point[0], point[1]);\n }\n ctx.lineTo(pts[0][0], pts[0][1]);\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n this.__addGeom('rect', [\n ['x', originX],\n ['y', originY],\n ['width', width],\n ['height', height],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ['fill', 'rgba(0,0,0,0)']\n ]);\n this.__addGeom('circle', [\n ['cx', cx],\n ['cy', cy],\n ['r', r],\n ['fill', fill],\n ]);\n let s = '';\n for(let i = 0, len = pts.length; i < len; i++) {\n let point = pts[i];\n if(i) {\n s += ' ';\n }\n s += point[0] + ',' + point[1];\n }\n this.__addGeom('polygon', [\n ['points', s],\n ['fill', fill]\n ]);\n }\n }\n else if(source) {\n // 圆角需要生成一个mask\n let list = border.calRadius(originX, originY, width, height,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n // 有border-radius需模拟遮罩裁剪\n if(list) {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list, 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 {\n let loadImg = this.__loadImg;\n // 加载成功计算缩放后的宽度\n if(loadImg.source) {\n if(height[1] === PX) {\n w -= loadImg.width * height[0] / loadImg.height;\n }\n else if(height[1] === PERCENT) {\n w -= loadImg.width * height[0] * total * 0.01 / loadImg.height;\n }\n else if(height[1] === REM) {\n w -= loadImg.width * height[0] * this.root.computedStyle[FONT_SIZE] / loadImg.height;\n }\n else if(height[1] === VW) {\n w -= loadImg.width * height[0] * this.root.width * 0.01 / loadImg.height;\n }\n else if(height[1] === VH) {\n w -= loadImg.width * height[0] * this.root.height * 0.01 / loadImg.height;\n }\n else {\n w -= loadImg.width;\n }\n }\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n return w;\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle, __loadImg } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n let cross = isDirectionRow ? height : width;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH].indexOf(flexBasis[1]) > -1;\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = max = min = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = max = min = flexBasis[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(flexBasis[1] === REM) {\n b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = max = min = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = max = min = flexBasis[0] * this.root.height * 0.01;\n }\n }\n else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1)) {\n if(main[1] === PX) {\n b = max = min = main[0];\n }\n else if(main[1] === PERCENT) {\n b = max = min = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = max = min = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = max = min = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = max = min = main[0] * this.root.height * 0.01;\n }\n }\n // auto和content固定尺寸比例计算\n else if(__loadImg.source || __loadImg.error) {\n if(cross[1] !== AUTO) {\n if(cross[1] === PX) {\n cross = cross[0];\n }\n else if(cross[1] === PERCENT) {\n cross = cross[0] * 0.01 * (isDirectionRow ? h : w);\n }\n else if(cross[1] === REM) {\n cross = cross[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(cross[1] === VW) {\n cross = cross[0] * this.root.width * 0.01;\n }\n else if(cross[1] === VH) {\n cross = cross[0] * this.root.height * 0.01;\n }\n let ratio = __loadImg.width / __loadImg.height;\n b = max = min = isDirectionRow ? cross * ratio : cross / ratio;\n }\n else {\n b = max = min = isDirectionRow ? __loadImg.width : __loadImg.height;\n }\n }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\n }\n\n __loadAndRefresh(loadImg, root, ctx, placeholder, computedStyle, width, height, cb) {\n let self = this;\n // 先清空之前可能的\n if(loadImg.source || loadImg.error) {\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n });\n loadImg.source = null;\n }\n loadImg.loading = true;\n // 再测量,可能瞬间完成替换掉上面的\n inject.measureImg(loadImg.src, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败走error绘制\n if(data.url === loadImg.src && !self.isDestroyed) {\n loadImg.cache && (loadImg.cache.cache = false);\n loadImg.loading = false;\n function reload() {\n let { currentStyle: { [WIDTH]: width, [HEIGHT]: height } } = self;\n root.delRefreshTask(self.__task);\n if(width[1] !== AUTO && height[1] !== AUTO) {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REPAINT;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n else {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n }\n if(data.success) {\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n }\n else if(placeholder) {\n inject.measureImg(placeholder, data => {\n if(data.success) {\n loadImg.error = true;\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n reload();\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n return;\n }\n else {\n loadImg.error = true;\n }\n // 可见状态进行刷新操作,visibility某些情况需要刷新,可能宽高未定义要重新布局\n if(computedStyle[DISPLAY] !== 'none') {\n reload();\n }\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n }\n\n updateSrc(v, cb) {\n let self = this;\n let loadImg = self.__loadImg;\n let root = this.root;\n // 相等或空且当前error直接返回\n if(v === loadImg.src || !v && loadImg.error) {\n if(isFunction(cb)) {\n cb(-1);\n }\n }\n else if(v) {\n loadImg.src = v;\n self.__loadAndRefresh(loadImg, root, root.ctx, self.props.placeholder, self.computedStyle, self.width, self.height, cb);\n }\n else {\n loadImg.src = v;\n loadImg.source = null;\n loadImg.error = true;\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, self.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb(diff);\n }\n },\n });\n }\n }\n\n appendChild() {\n inject.error('Img can not appendChild.');\n }\n\n get src() {\n return this.__loadImg.src;\n }\n\n static showError = true;\n}\n\nexport default Img;\n","class Defs {\n constructor(uuid) {\n this.id = uuid;\n this.count = 0;\n this.list = [];\n this.cacheHash = {}; // 每次svg渲染前重置,存储前次渲染不变的缓存id\n }\n add(data) {\n let uuid = this.count;\n let hash = this.cacheHash;\n while(hash.hasOwnProperty(uuid)) {\n uuid++;\n }\n this.count = uuid + 1;\n data.id = uuid;\n data.uuid = 'karas-defs-' + this.id + '-' + uuid;\n data.index = this.list.length;\n this.list.push(data);\n return data.uuid;\n }\n addCache(data) {\n data.index = this.list.length;\n this.list.push(data);\n this.cacheHash[data.id] = true;\n return data.uuid;\n }\n clear() {\n this.list = [];\n this.count = 0;\n this.cacheHash = {};\n }\n removeCache(data) {\n let list = this.list;\n let i = data.index;\n // 一般情况index即位置,但每次渲染过程中,可能会删掉一些,此时位置会往前,但index不变,因此遍历\n for(; i >= 0; i--) {\n if(list[i] === data) {\n list.splice(i, 1);\n return;\n }\n }\n }\n\n get value() {\n return this.list;\n }\n\n static getInstance(uuid) {\n return new Defs(uuid);\n }\n}\n\nexport default Defs;\n","import Xom from '../Xom';\nimport reset from '../../style/reset';\nimport css from '../../style/css';\nimport unit from '../../style/unit';\nimport enums from '../../util/enums';\nimport mode from '../mode';\nimport util from '../../util/util';\nimport painter from '../../util/painter';\nimport transform from '../../style/transform';\nimport mx from '../../math/matrix';\nimport inject from '../../util/inject';\nimport gradient from '../../math/gradient';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n WIDTH,\n HEIGHT,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n FILL,\n STROKE,\n STROKE_MITERLIMIT,\n STROKE_WIDTH,\n STROKE_LINECAP,\n STROKE_LINEJOIN,\n STROKE_DASHARRAY,\n STROKE_DASHARRAY_STR,\n FILL_RULE,\n VISIBILITY,\n FONT_SIZE,\n FLEX_BASIS,\n },\n NODE_KEY: {\n NODE_CACHE_PROPS,\n NODE_CURRENT_PROPS,\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { PX, PERCENT, REM, VW, VH } = unit;\nconst { int2rgba, isNil, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nconst REGISTER = {};\n\nclass Geom extends Xom {\n constructor(tagName, props) {\n super(tagName, props);\n this.__isMulti = !!this.props.multi;\n this.__style = css.normalize(this.style, reset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET));\n this.__currentStyle = util.extend({}, this.__style);\n this.__currentProps = util.clone(this.props);\n let config = this.__config;\n config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n config[NODE_CURRENT_PROPS] = this.__currentProps;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_STYLE] = this.__style;\n }\n\n __tryLayInline(w, total) {\n // 无children,直接以style的width为宽度,不定义则为0\n let { currentStyle: {\n [WIDTH]: width,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n return w;\n }\n\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this, this.isShadowRoot);\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n // 计算需考虑style的属性\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n [DISPLAY]: display,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n return [display, this.__addMp(isDirectionRow, data.w, currentStyle, [min, max])];\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH].indexOf(flexBasis[1]) > -1;\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = max = min = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = max = min = flexBasis[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(flexBasis[1] === REM) {\n b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = max = min = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = max = min = flexBasis[0] * this.root.height * 0.01;\n }\n }\n else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1)) {\n if(main[1] === PX) {\n b = max = min = main[0];\n }\n else if(main[1] === PERCENT) {\n b = max = min = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = max = min = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = max = min = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = max = min = main[0] * this.root.height * 0.01;\n }\n }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\n }\n\n __layoutBlock(data, isVirtual) {\n let { fixedWidth, fixedHeight, w, h } = this.__preLayout(data);\n this.__height = fixedHeight ? h : 0;\n if(isVirtual) {\n this.__width = fixedWidth ? w : 0;\n return;\n }\n this.__width = w;\n this.__ioSize(w, this.height);\n this.__marginAuto(this.currentStyle, data);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __layoutFlex(data) {\n // 无children所以等同于block\n this.__layoutBlock(data);\n }\n\n __layoutInline(data) {\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // 元素的width不能超过父元素w\n let tw = this.__width = fixedWidth ? w : x - data.x;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6) {\n let res = super.__calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6);\n if(isNil(__cacheStyle[STROKE_WIDTH])) {\n __cacheStyle[STROKE_WIDTH] = true;\n let strokeWidth = currentStyle[STROKE_WIDTH] || [];\n let w = this.width;\n computedStyle[STROKE_WIDTH] = strokeWidth.map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n else if(item[1] === PERCENT) {\n return item[0] * w * 0.01;\n }\n else if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n else if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n else {\n return 0;\n }\n });\n }\n if(isNil(__cacheStyle[STROKE_DASHARRAY])) {\n __cacheStyle[STROKE_DASHARRAY] = true;\n computedStyle[STROKE_DASHARRAY] = currentStyle[STROKE_DASHARRAY] || [];\n __cacheStyle[STROKE_DASHARRAY_STR] = computedStyle[STROKE_DASHARRAY].map(item => joinArr(item, ','));\n }\n // 直接赋值的\n [\n STROKE_LINECAP,\n STROKE_LINEJOIN,\n STROKE_MITERLIMIT,\n FILL_RULE,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n // stroke/fll移至render里处理,因为cache涉及渐变坐标偏移\n [STROKE, FILL].forEach(k => {\n if(isNil(__cacheStyle[k])) {\n let v = currentStyle[k];\n computedStyle[k] = v;\n let res = [];\n if(Array.isArray(v)) {\n v.forEach(item => {\n if(item && (item.k === 'linear' || item.k === 'radial' || item.k === 'conic')) {\n res.push(this.__gradient(renderMode, ctx, x3, y3, x4, y4, item));\n }\n else if(item[3] > 0) {\n res.push(int2rgba(item));\n }\n else {\n res.push('none');\n }\n });\n }\n __cacheStyle[k] = res;\n }\n });\n return res;\n }\n\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n // Geom强制有内容\n return computedStyle[VISIBILITY] !== 'hidden';\n }\n\n __preSet(res) {\n let { width, height, __cacheStyle, computedStyle } = this;\n let cx = res.sx3 + width * 0.5;\n let cy = res.sy3 + height * 0.5;\n let {\n [FILL]: fill,\n [STROKE]: stroke,\n [STROKE_DASHARRAY_STR]: strokeDasharrayStr,\n } = __cacheStyle;\n let {\n [STROKE_WIDTH]: strokeWidth,\n [STROKE_LINECAP]: strokeLinecap,\n [STROKE_LINEJOIN]: strokeLinejoin,\n [STROKE_MITERLIMIT]: strokeMiterlimit,\n [STROKE_DASHARRAY]: strokeDasharray,\n [FILL_RULE]: fillRule,\n } = computedStyle;\n return {\n cx,\n cy,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n fillRule,\n };\n }\n\n __preSetCanvas(renderMode, ctx, res) {\n let {\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n } = res;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(fill) {\n if(fill.k === 'linear') {\n ctx.fillStyle = fill.v;\n }\n else if(fill.k === 'radial' && !Array.isArray(fill.v)) {\n ctx.fillStyle = fill.v;\n }\n else if(fill.k === 'conic') {\n //\n }\n else if(!fill.k && ctx.fillStyle !== fill) {\n ctx.fillStyle = fill;\n }\n }\n if(stroke) {\n if(stroke.k === 'linear') {\n ctx.strokeStyle = stroke.v;\n }\n else if(stroke.k === 'radial' && !Array.isArray(stroke.v)) {\n ctx.strokeStyle = stroke.v;\n }\n else if(stroke.k === 'conic') {\n //\n }\n else if(!stroke.k && ctx.strokeStyle !== stroke) {\n ctx.strokeStyle = stroke;\n }\n }\n if(strokeWidth !== undefined && ctx.lineWidth !== strokeWidth) {\n ctx.lineWidth = strokeWidth;\n }\n if(strokeLinecap !== undefined && ctx.lineCap !== strokeLinecap) {\n ctx.lineCap = strokeLinecap;\n }\n if(strokeLinejoin !== undefined && ctx.lineJoin !== strokeLinejoin) {\n ctx.lineJoin = strokeLinejoin;\n }\n if(strokeMiterlimit !== undefined && ctx.miterLimit !== strokeMiterlimit) {\n ctx.miterLimit = strokeMiterlimit;\n }\n // 小程序没这个方法\n if(util.isFunction(ctx.getLineDash)) {\n if(strokeDasharray && !util.equalArr(ctx.getLineDash(), strokeDasharray)) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n else if(strokeDasharray) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, 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() {}\n\n // offset/resize时要多一步清空props上记录的缓存\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeX(diff, lv) {\n super.__resizeX(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeY(diff, lv) {\n super.__resizeY(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n getProps(k) {\n let v = this.currentProps[k];\n if(!isNil(v)) {\n return v;\n }\n return this['__' + k];\n }\n\n __isRealInline() {\n return false;\n }\n\n get isMulti() {\n return this.__isMulti;\n }\n\n get currentProps() {\n return this.__currentProps;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$') {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Geom has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$'\n || !obj.prototype || !(obj.prototype instanceof Geom)) {\n throw new Error('Invalid param');\n }\n if(Geom.hasRegister(name)) {\n throw new Error(`Geom has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Geom.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nexport default Geom;\n","import Xom from '../node/Xom';\nimport Dom from '../node/Dom';\nimport Component from '../node/Component';\nimport util from './util';\nimport inject from './inject';\nimport flatten from './flatten';\nimport $$type from './$$type';\nimport enums from './enums';\n\nconst {\n NODE_KEY: {\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_DOM_PARENT,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n NODE_STRUCT,\n },\n} = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet updateList = [];\nlet removeList = [];\n\nconst KEY_FLAG = {};\n\n/**\n * setState后刷新前先根遍历检查组件开始进行shouldComponentUpdate判断\n */\nfunction check(vd) {\n if(vd instanceof Dom) {\n vd.children.forEach(child => {\n if(child instanceof Dom) {\n check(child);\n }\n // 当组件有setState更新时,从叶子到根链路会标识__hasUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasUpdate) {\n child.__hasUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n // 高阶组件会进入此分支,被父组件调用\n else if(vd instanceof Component && vd.__hasUpdate) {\n vd.__hasUpdate = false;\n checkCp(vd, vd.props);\n }\n}\n\n/**\n * 检查cp是否有state变更,注意递归检查时需要看shadow不能看shadowRoot,\n * 否则高阶组件会被跳过,其更新无法触发update生命周期\n * @param cp\n * @param nextProps\n * @param forceCheckUpdate,被render()后的json的二级组件,发现props有变更强制检查更新,否则可以跳过\n */\nfunction checkCp(cp, nextProps, forceCheckUpdate) {\n if(cp.__nextState || forceCheckUpdate) {\n let shouldUpdate;\n if(util.isFunction(cp.shouldComponentUpdate)) {\n shouldUpdate = cp.shouldComponentUpdate(nextProps, cp.__nextState || cp.state);\n }\n else {\n // 没有默认更新\n shouldUpdate = true;\n }\n if(shouldUpdate) {\n updateCp(cp, nextProps, cp.__nextState || cp.state);\n }\n // 不更新则递归检查子tree的cp\n else {\n cp.props = nextProps;\n cp.state = cp.__nextState || cp.state;\n check(cp.shadow);\n }\n }\n else {\n check(cp.shadow);\n }\n}\n\n/**\n * 更新组件的props和state,清空__nextState\n * @param cp\n * @param props\n * @param state\n */\nfunction updateCp(cp, props, state) {\n cp.props = props;\n cp.state = state;\n cp.__nextState = null; // 同步在refresh前清除component的新state标识,这样frame动画在after回调中可以新设\n let oldS = cp.shadow;\n let oldSr = cp.shadowRoot;\n let oldJson = cp.__cd;\n let json = flatten(cp.render());\n // 对比新老render()返回的内容,更新后重新生成sr\n diffSr(oldS, oldJson, json);\n cp.__init(json);\n // 为了局部dom布局需要知道老的css信息\n let sr = cp.shadowRoot;\n if(sr instanceof Xom) {\n [\n '__outerWidth',\n '__outerHeight',\n '__sx',\n '__sy',\n '__sx2',\n '__sx3',\n '__sx4',\n '__sx5',\n '__sx6',\n '__sy2',\n '__sy3',\n '__sy4',\n '__sy5',\n '__sy6',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__computedStyle = sr.__config[NODE_COMPUTED_STYLE] = oldSr.computedStyle;\n }\n else {\n let domParent = cp.domParent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n sr.__config[k] = domParent.__config[k];\n });\n }\n [\n '__x',\n '__y',\n '__width',\n '__height',\n '__sx1', // text和xom\n '__sy1',\n '__layoutData',\n '__parent',\n '__domParent',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__config[NODE_DOM_PARENT] = oldSr.domParent;\n sr.__config[NODE_STRUCT] = oldSr.__config[NODE_STRUCT];\n updateList.push(cp);\n // 老的需回收,diff会生成新的dom,唯一列外是cp直接返回一个没变化的cp\n if(!util.isObject(json) || !json.__placeholder) {\n removeList.push(oldS);\n }\n // 子组件使用老的json时标识,更新后删除,render()返回空会没json对象\n if(json && json.__placeholder) {\n delete json.__placeholder;\n }\n if(json && json.__inheritAnimate) {\n delete json.__inheritAnimate;\n }\n if(json && json.__animateRecords) {\n delete json.__animateRecords;\n }\n // 高阶组件时需判断,子组件更新后生成新的sr,父组件的sr/host需要同时更新引用\n let host = cp.host;\n while(host) {\n if(host.shadow === cp) {\n host.__shadowRoot = sr;\n sr.__hostRoot = host;\n cp = host;\n host = host.host;\n }\n else {\n break;\n }\n }\n}\n\n/**\n * 非一级组件sr进行对比,key相同的无需重新生成且继承动画\n * @param vd\n * @param oj oldJson\n * @param nj\n */\nfunction diffSr(vd, oj, nj) {\n // 先遍历检查key相同的,将没有变化的key暂存下来,深度优先,这样叶子节点出现在前面,当key的叶子也有key时,确保叶子先对比\n let ojk = getKeyHash(oj, {}, vd);\n let njk = getKeyHash(nj, {});\n let keyList = [];\n let cpList = [];\n // 先对比key对应的节点,如果新老有一方对不上则落空\n Object.keys(ojk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n if(!n) {\n o.json.key = KEY_FLAG;\n }\n });\n Object.keys(njk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n // 有可能老的没有这个key,新key落空\n if(!o) {\n n.json.key = KEY_FLAG;\n return;\n }\n let oj = o.json;\n let nj = n.json;\n let vd = o.vd;\n // 相同class的组件进行对比替换\n if(oj.$$type === TYPE_CP && nj.$$type === TYPE_CP) {\n if(oj.klass === nj.klass) {\n // 对比props和children看是否全等,是则直接替换新json类型为占位符,引用老vd,否则强制更新\n diffCp(oj, nj, vd);\n // 标识对比过了\n oj.key = nj.key = KEY_FLAG;\n // 老的sr里需删除这个vd,因为老sr会回收\n cpList.push(vd);\n }\n }\n // 相同类型的vd进行对比继承动画\n else if(oj.$$type === nj.$$type && oj.tagName === nj.tagName) {\n // 需判断矢量标签mutil是否相等\n if(nj.$$type !== TYPE_GM || oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n oj.key = nj.key = KEY_FLAG;\n // key相同的dom暂存下来\n if(nj.$$type === TYPE_VD) {\n keyList.push({\n vd,\n oj,\n nj,\n });\n }\n }\n });\n // key相同的dom对比children,下面非key逻辑就不做了\n keyList.forEach(item => {\n diffChildren(item.vd, item.oj, item.nj);\n });\n // 整体tree进行对比\n diffChild(vd, oj, nj);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的\n cpList.forEach(vd => {\n removeCpFromOldTree(vd);\n });\n}\n\n/**\n * 递归检查dom的children,相同的无需重新生成,用PL类型占位符代替直接返回老vd\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChild(vd, oj, nj) {\n if(util.isObject(nj)) {\n if(nj.$$type === TYPE_CP) {\n // key对比过了忽略\n if(nj.key === KEY_FLAG) {\n return;\n }\n // 相同class的组件处理\n if(oj && oj.$$type === nj.$$type && oj.klass === nj.klass) {\n diffCp(oj, nj, vd);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收\n removeCpFromOldTree(vd);\n }\n }\n else if(nj.$$type === TYPE_GM && oj && oj.$$type === TYPE_GM) {\n // $geom的multi必须一致\n if(oj.tagName === nj.tagName && oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n }\n // dom类型递归children\n else if(nj.$$type === TYPE_VD && oj && oj.$$type === TYPE_VD) {\n if(oj.tagName === nj.tagName) {\n nj.__inheritAnimate = vd;\n }\n diffChildren(vd, oj, nj);\n }\n }\n}\n\n/**\n * dom类型的vd对比children\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChildren(vd, oj, nj) {\n let oc = oj.children;\n let nc = nj.children;\n let ol = oc.length;\n let nl = nc.length;\n let children = vd.children;\n for(let i = 0, of = 0, nf = 0, len = Math.min(ol, nl); i < len; i++) {\n let o = oc[i + of];\n let n = nc[i + nf];\n // 新老都是key直接跳过\n if(o.key === KEY_FLAG && n.key === KEY_FLAG) {\n }\n // 其中一个是key对比过了调整索引和长度\n else if(o.key === KEY_FLAG) {\n of++;\n i--;\n ol--;\n len = Math.min(ol, nl);\n }\n else if(n.key === KEY_FLAG) {\n nf++;\n i--;\n nl--;\n len = Math.min(ol, nl);\n }\n else {\n diffChild(children[i + of], o, n);\n }\n }\n // 长度不同增减的无需关注,新json创建cp有didMount,老vd会调用cp的destroy\n}\n\n/**\n * 根据json对比看cp如何更新,被render()后的json的二级组件对比才会出现\n * @param oj\n * @param nj\n * @param vd\n */\nfunction diffCp(oj, nj, vd) {\n // props全等,直接替换新json类型为占位符,引用老vd内容,无需重新创建,暂时存在json的placeholder上\n // 否则需要强制触发组件更新,包含setState内容\n nj.__placeholder = vd;\n let sr = vd.shadowRoot;\n // 对比需忽略on开头的事件,直接改老的引用到新的上,这样只变了on的话无需更新\n let exist = {};\n Object.keys(oj.props).forEach(k => {\n let v = oj.props[k];\n exist[k] = v;\n });\n Object.keys(nj.props).forEach(k => {\n let v = nj.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n vd.off(k, exist[k]);\n vd.on(k, v);\n }\n delete exist[k];\n }\n else {\n k = k.slice(2).toLowerCase();\n vd.on(k, v);\n }\n }\n });\n // 新的少的事件取消\n Object.keys(exist).forEach(k => {\n let v = exist[k];\n if(/^on[a-zA-Z]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n delete sr.listener[k];\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n vd.off(k, v);\n }\n });\n checkCp(vd, nj.props, !util.equal(oj.props, nj.props));\n}\n\n/**\n * 深度优先遍历json,将有key的记录在hash中,如果传入根vd,同步递归保存对应位置的vd\n * @param json\n * @param hash\n * @param vd\n * @returns {*}\n */\nfunction getKeyHash(json, hash, vd) {\n if(Array.isArray(json)) {\n json.forEach((item, i) => getKeyHash(item, hash, vd && vd[i]));\n }\n else if(util.isObject(json)) {\n if(json.$$type === TYPE_VD || json.$$type === TYPE_GM || json.$$type === TYPE_CP) {\n // 深度优先\n if(json.$$type === TYPE_VD) {\n getKeyHash(json.children, hash, vd && vd.children);\n }\n let key = json.props.key;\n if(!util.isNil(key) && key !== '') {\n // 重复key错误警告\n if(hash.hasOwnProperty(key)) {\n inject.warn('Component ' + vd.tagName + ' has duplicate key: ' + key);\n }\n hash[key] = {\n json,\n vd,\n };\n }\n }\n }\n return hash;\n}\n\n/**\n * 非一级组件diff发生更新时,其需要从sr的tree中移除,因为sr会销毁\n */\nfunction removeCpFromOldTree(vd) {\n // root下的一级组件不会发生回收情况,忽略\n if(!vd.host) {\n return;\n }\n let parent = vd.parent;\n if(parent) {\n let i = parent.children.indexOf(vd);\n if(i > -1) {\n parent.children[i] = null;\n }\n else {\n throw new Error('Can not find child: ' + vd.tagName);\n }\n }\n}\n\n/**\n * 执行componentDidUpdate/destroy\n */\nfunction did() {\n updateList.forEach(item => {\n if(util.isFunction(item.componentDidUpdate)) {\n item.componentDidUpdate();\n }\n });\n updateList.splice(0);\n removeList.forEach(item => {\n item.__destroy();\n });\n removeList = [];\n}\n\nexport default {\n updateList,\n check,\n did,\n};\n","import util from './util';\nimport level from '../refresh/level';\n\nconst { joinVd, joinDef } = util;\nconst { contain, NONE, TRANSFORM_ALL, OPACITY, FILTER, MIX_BLEND_MODE } = level;\n\nfunction diff(elem, ovd, nvd) {\n let cns = elem.childNodes;\n diffDefs(cns[0], ovd.defs, nvd.defs);\n // = i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinDef(nd[i]));\n }\n }\n}\n\nfunction diffDef(elem, od, nd) {\n if(od.tagName !== nd.tagName) {\n insertAdjacentHTML(elem, 'beforebegin', joinDef(nd));\n // elem.insertAdjacentHTML('beforebegin', joinDef(nd));\n elem.parentNode.removeChild(elem);\n }\n else {\n if(od.uuid !== nd.uuid) {\n elem.setAttribute('id', nd.uuid);\n }\n let op = {};\n for(let i = 0, len = (od.props || []).length; i < len; i++) {\n let prop = od.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nd.props || []).length; i < len; i++) {\n let prop = nd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n let cns = elem.childNodes;\n let ol = od.children.length;\n let nl = nd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, od.children[i], nd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nd.children[i]));\n }\n }\n }\n}\n\nfunction diffChild(elem, ovd, nvd) {\n if(ovd.type === 'dom') {\n if(nvd.type === 'dom') {\n diffD2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffD2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'text') {\n if(nvd.type === 'text') {\n diffT2T(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'geom') {\n if(nvd.type === 'dom') {\n diffG2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffG2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'img') {\n if(nvd.type === 'img') {\n diffItemSelf(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n}\n\nfunction diffX2X(elem, ovd, nvd) {\n let { transform, opacity, visibility, mask, overflow, filter, mixBlendMode, conClip } = nvd;\n if(ovd.transform !== transform) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(ovd.opacity !== opacity) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(ovd.visibility !== visibility) {\n elem.setAttribute('visibility', visibility);\n }\n if(ovd.mask !== mask) {\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n }\n if(ovd.filter !== filter || ovd.mixBlendMode !== mixBlendMode) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('filter');\n }\n }\n // if(ovd.filter !== filter) {\n // if(filter) {\n // elem.setAttribute('filter', filter);\n // }\n // else {\n // elem.removeAttribute('filter');\n // }\n // }\n if(ovd.overflow !== overflow) {\n if(overflow) {\n elem.setAttribute('clipPath', overflow);\n }\n else {\n elem.removeAttribute('overflow');\n }\n }\n if(ovd.conClip !== conClip) {\n if(conClip) {\n elem.childNodes[1].setAttribute('clip-path', conClip);\n }\n else {\n elem.childNodes[1].removeAttribute('clip-path');\n }\n }\n}\n\nfunction diffByLessLv(elem, ovd, nvd, lv) {\n let { transform, opacity, mask, filter, mixBlendMode } = nvd;\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n if(lv === NONE) {\n return;\n }\n if(contain(lv, TRANSFORM_ALL)) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(contain(lv, OPACITY)) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(contain(lv, FILTER) || contain(lv, MIX_BLEND_MODE)) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('style');\n }\n }\n}\n\nfunction diffD2D(elem, ovd, nvd, root) {\n // cache表明children无变化缓存,一定是REPAINT以下的,只需看自身的lv以及mask\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffD2G(elem, ovd, nvd) {\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n replaceWith(cns[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffT2T(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, ovd.children[i], nvd.children[i], true);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffG2D(elem, ovd, nvd) {\n diffD2G(elem, ovd, nvd);\n}\n\nfunction diffG2G(elem, ovd, nvd) {\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n }\n}\n\nfunction diffBb(elem, obb, nbb) {\n let ol = obb.length;\n let nl = nbb.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, obb[i], nbb[i]);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nbb[i]));\n }\n }\n}\n\nfunction diffItem(elem, i, ovd, nvd, isText) {\n let cns = elem.childNodes;\n if(ovd.tagName !== nvd.tagName) {\n replaceWith(cns[i], nvd);\n }\n else {\n diffItemSelf(cns[i], ovd, nvd);\n if(isText && ovd.content !== nvd.content) {\n cns[i].innerHTML = nvd.content;\n }\n }\n}\n\nfunction diffItemSelf(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let op = {};\n for(let i = 0, len = (ovd.props || []).length; i < len; i++) {\n let prop = ovd.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nvd.props || []).length; i < len; i++) {\n let prop = nvd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n}\n\nfunction replaceWith(elem, vd) {\n let res;\n if(Array.isArray(vd)) {\n res = '';\n vd.forEach(item => {\n res += joinVd(item);\n });\n }\n else {\n res = joinVd(vd);\n }\n insertAdjacentHTML(elem, 'beforebegin', res);\n // elem.insertAdjacentHTML('beforebegin', res);\n elem.parentNode.removeChild(elem);\n}\n\nfunction insertAt(elem, cns, index, html) {\n if(index >= cns.length) {\n insertAdjacentHTML(elem, 'beforeend', html);\n // elem.insertAdjacentHTML('beforeend', html);\n }\n else {\n insertAdjacentHTML(cns[index], 'beforebegin', html);\n // cns[index].insertAdjacentHTML('beforebegin', html);\n }\n}\n\nfunction removeAt(elem, cns, index) {\n if(cns[index]) {\n elem.removeChild(cns[index]);\n }\n}\n\nlet svg;\nfunction insertAdjacentHTML(elem, where, content) {\n if(elem.insertAdjacentHTML) {\n elem.insertAdjacentHTML(where, content);\n }\n else {\n switch(where) {\n case 'beforeend':\n elem.innerHTML += content;\n break;\n case 'beforebegin':\n svg = svg || document.createElement('svg');\n svg.innerHTML = content;\n elem.parentNode.insertBefore(svg.childNodes[0], elem);\n break;\n }\n }\n}\n\nexport default diff;\n","import util from '../util/util';\n\nconst { isFunction } = util;\n\nclass Controller {\n constructor() {\n this.__records = []; // 默认记录和自动记录\n this.__records2 = []; // 非自动播放的动画记录\n this.__list = [] // 默认初始化播放列表,自动播放也存这里\n this.__list2 = []; // json中autoPlay为false的初始化存入这里\n this.__onList = []; // list中已存在的侦听事件,list2初始化时也需要增加上\n this.__lastTime = {}; // 每个类型的上次触发时间,防止重复emit\n }\n\n add(v, list = this.list) {\n if(list.indexOf(v) === -1) {\n list.push(v);\n }\n }\n\n remove(v) {\n let i = this.list.indexOf(v);\n if(i > -1) {\n this.list.splice(i, 1);\n }\n }\n\n __destroy() {\n this.__records = [];\n this.__records2 = [];\n this.__list = [];\n this.__list2 = [];\n }\n\n __action(k, args) {\n this.list.forEach(item => {\n item[k].apply(item, args);\n });\n }\n\n init(records = this.__records, list = this.list) {\n // 检查尚未初始化的record,并初始化,后面才能调用各种控制方法\n if(records.length) {\n // 清除防止重复调用,并且新的json还会进入整体逻辑\n records.splice(0).forEach(item => {\n let { target, animate } = item;\n if(target.isDestroyed) {\n return;\n }\n if(Array.isArray(animate)) {\n animate.forEach(animate => {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n });\n }\n else {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n }\n });\n }\n // 非自动播放后初始化需检测事件,给非自动播放添加上,并清空本次\n if(records === this.__records2) {\n let onList = this.__onList;\n let list2 = this.list2;\n if(list2.length && onList.length) {\n list2.forEach(item => {\n onList.forEach(arr => {\n item.off(arr[0], arr[1]);\n item.on(arr[0], arr[1]);\n });\n });\n }\n }\n }\n\n __playAuto() {\n this.init();\n this.__action('play');\n }\n\n play(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('play', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n pause() {\n this.__action('pause');\n }\n\n resume(cb) {\n let once = true;\n this.__action('resume', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n __mergeAuto() {\n this.init();\n this.init(this.__records2);\n if(this.__list2.length) {\n this.__list = this.__list.concat(this.__list2);\n this.__list2 = [];\n }\n }\n\n cancel(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('cancel', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n finish(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('finish', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndStop(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('gotoAndStop', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndPlay(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('gotoAndPlay', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.__on(id[i], handle);\n }\n this.__onList.push([id, handle]);\n }\n else {\n this.__on(id, handle);\n this.__onList.push([id, handle]);\n }\n }\n\n __on(id, handle) {\n this.list.forEach(item => {\n let cb = () => {\n let time = item.timestamp;\n if(time !== this.__lastTime[id]) {\n this.__lastTime[id] = time;\n handle();\n }\n };\n cb.__karasEventCb = handle;\n item.on(id, cb);\n });\n }\n\n off(id, handle) {\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.off(id[i], handle);\n }\n }\n else {\n this.list.forEach(item => {\n item.off(id, handle);\n });\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get list2() {\n return this.__list2;\n }\n\n __set(key, value) {\n this.list.forEach(item => {\n item[key] = value;\n });\n }\n\n set playbackRate(v) {\n this.__set('playbackRate', v);\n }\n\n set iterations(v) {\n this.__set('iterations', v);\n }\n\n set playCount(v) {\n this.__set('playCount', v);\n }\n\n set fps(v) {\n this.__set('fps', v);\n }\n\n set currentTime(v) {\n this.__set('currentTime', v);\n }\n\n set spfLimit(v) {\n this.__set('spfLimit', v);\n }\n\n set delay(v) {\n this.__set('delay', v);\n }\n\n set endDelay(v) {\n this.__set('endDelay', v);\n }\n\n set fill(v) {\n this.__set('fill', v);\n }\n\n set direction(v) {\n this.__set('direction', v);\n }\n}\n\nexport default Controller;\n","import 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 Geom from '../node/geom/Geom';\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;\n }\n // 局部根节点如有perspective,则计算pm,这里不会出现嵌套,因为每个出现都会生成局部根节点\n let pm;\n if(perspective) {\n pm = tf.calPerspectiveMatrix(perspective, perspectiveOrigin);\n }\n // 广度遍历,不断一层层循环下去,用2个hash暂存每层的父matrix和opacity,blur只需记住顶层,因为子的如果有一定是cacheFilter\n let list = [index];\n let d = 0;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n d = blur.outerSize(v);\n }\n });\n opacityHash[index] = 1;\n // opacity可以保存下来层级相乘结果供外部使用,但matrix不可以,因为这里按画布原点为坐标系计算,外部合并局部根节点以bbox左上角为原点\n let matrixHash = {};\n while(list.length) {\n let arr = list.splice(0);\n for(let i = 0, len = arr.length; i < len; i++) {\n let parentIndex = arr[i];\n let total = __structs[parentIndex][STRUCT_TOTAL] || 0;\n for(let i = parentIndex + 1, len = parentIndex + total + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node2,\n [STRUCT_TOTAL]: total,\n } = __structs[i];\n // mask也不占bbox位置\n if(node2.isMask) {\n continue;\n }\n let {\n __sx1,\n __sy1,\n __config: {\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [OPACITY]: opacity,\n },\n },\n } = node2;\n // webgl不能跳过超限\n if(limitCache && !includeLimitCache) {\n return;\n }\n // display:none跳过整个节点树,visibility只跳过自身\n if(display === 'none') {\n i += total || 0;\n continue;\n }\n if(visibility === 'hidden') {\n continue;\n }\n parentIndexHash[i] = parentIndex;\n opacityHash[i] = opacityHash[parentIndex] * opacity;\n // 防止text的情况,其一定属于某个node,其bbox被计算过,text不应该计算\n if(node2 instanceof Text) {\n continue;\n }\n let bbox, dx = 0, dy = 0, hasTotal;\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n bbox = target.bbox.slice(0);\n dx = target.dbx;\n dy = target.dby;\n i += total || 0;\n hasTotal = true;\n }\n else if(__cache && __cache.available) {\n bbox = __cache.bbox.slice(0);\n dx = __cache.dbx;\n dy = __cache.dby;\n }\n else {\n bbox = node2.bbox;\n }\n // 可能Xom没有内容\n if(bbox) {\n bbox[0] -= sx1;\n bbox[1] -= sy1;\n bbox[2] -= sx1;\n bbox[3] -= sy1;\n let matrix = matrixHash[parentIndex];\n // 父级matrix初始化E为null,自身不为E时才运算,可以加速\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n tfo[0] += __sx1 - sx1 + dx;\n tfo[1] += __sy1 - sy1 + dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(pm) {\n matrix = multiply(pm, matrix);\n }\n bbox = 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);\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);\n texCache.refresh(gl, cx, cy);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n // 因为cacheTotal不总是以左上角原点为开始,所以必须每个节点重算matrix,合并box时计算的无法用到\n let matrixHash = {};\n // 先序遍历汇总到total\n for(let i = index + 1, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n let parentIndex = parentIndexHash[i];\n let matrix = matrixHash[parentIndex]; // 父节点的在每个节点计算后保存,第一个为top的默认为E(空)\n let opacity = opacityHash[i]; // opacity在合并box时已经计算可以直接用\n // 先看text,visibility会在内部判断,display会被parent判断\n if(node instanceof Text) {\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n texCache.addTexAndDrawWhenLimit(gl, __config[NODE_CACHE], opacity, matrix, cx, cy, dx, dy);\n }\n // 再看total缓存/cache,都没有的是无内容的Xom节点\n else {\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_IS_MASK]: isMask,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // mask和不可见不能被汇总到top上\n if(visibility === 'hidden' || isMask) {\n continue;\n }\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n if(__cache && __cache.available) {\n tfo[0] += __cache.sx1;\n tfo[1] += __cache.sy1;\n }\n else {\n tfo[0] += node.__sx1;\n tfo[1] += node.__sy1;\n }\n let dx = -sx1 + dbx;\n let dy = -sy1 + dby;\n tfo[0] += dx;\n tfo[1] += dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n if(target) {\n // 局部的mbm和主画布一样,先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成\n if(isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy);\n texCache.refresh(gl, cx, cy);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前fbo作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy);\n }\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n // 绘制到fbo的纹理对象上并删除fbo恢复\n texCache.refresh(gl, cx, cy);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 生成的纹理对象本身已绑定一个纹理单元了,释放lock的同时可以给texCache的channel缓存,避免重复上传\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bboxTotal);\n texCache.releaseLockChannel(n, mockCache.page);\n return [limitCache || totalLimitCache, mockCache];\n}\n\nfunction genFilterWebgl(gl, texCache, node, cache, filter, W, H) {\n let { sx1, sy1, width, height, bbox } = cache;\n let mockCache = cache;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n let res = genBlurWebgl(gl, texCache, mockCache, v, width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'hue-rotate') {\n let rotation = geom.d2r(v % 360);\n let cosR = Math.cos(rotation);\n let sinR = Math.sin(rotation);\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + cosR * 0.787 - sinR * 0.213, 0.715 - cosR * 0.715 - sinR * 0.715, 0.072 - cosR * 0.072 + sinR * 0.928, 0, 0,\n 0.213 - cosR * 0.213 + sinR * 0.143, 0.715 + cosR * 0.285 + sinR * 0.140, 0.072 - cosR * 0.072 - sinR * 0.283, 0, 0,\n 0.213 - cosR * 0.213 - sinR * 0.787, 0.715 - cosR * 0.715 + sinR * 0.715, 0.072 + cosR * 0.928 + sinR * 0.072, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'saturate' && v !== 100) {\n let amount = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + 0.787 * amount, 0.715 - 0.715 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 + 0.285 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 - 0.715 * amount, 0.072 + 0.928 * amount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'brightness' && v !== 100) {\n let b = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'grayscale' && v > 0) {\n let oneMinusAmount = 1 - v * 0.01;\n if(oneMinusAmount < 0) {\n oneMinusAmount = 0;\n }\n else if(oneMinusAmount > 1) {\n oneMinusAmount = 1;\n }\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.2126 + 0.7874 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 + 0.2848 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 + 0.9278 * oneMinusAmount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'contrast' && v !== 100) {\n let amount = v * 0.01;\n let o = -0.5 * amount;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n amount, 0, 0, 0, o,\n 0, amount, 0, 0, o,\n 0, 0, amount, 0, o,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n });\n // 切换回主程序\n gl.useProgram(gl.program);\n gl.viewport(0, 0, W, H);\n return mockCache;\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核d扩大3倍性能慢\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * 先动态生成gl程序,默认3核源码示例已注释,根据sigma获得d(一定奇数),再计算权重\n * 然后将d尺寸和权重拼接成真正程序并编译成program,再开始绘制\n */\nfunction genBlurWebgl(gl, texCache, cache, sigma, width, height, sx1, sy1, bbox) {\n let d = blur.kernelSize(sigma);\n let max = Math.max(15, gl.getParameter(gl.MAX_VARYING_VECTORS));\n while(d > max) {\n d -= 2;\n }\n let spread = blur.outerSizeByD(d);\n width += spread * 2;\n height += spread * 2;\n // 防止超限,webgl最大纹理尺寸限制\n let limit = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n if(width > limit || height > limit) {\n return;\n }\n bbox = bbox.slice(0);\n bbox[0] -= spread;\n bbox[1] -= spread;\n bbox[2] += spread;\n bbox[3] += spread;\n let cx = width * 0.5, cy = height * 0.5;\n let weights = blur.gaussianWeight(sigma, d);\n let vert = '';\n let frag = '';\n let r = Math.floor(d * 0.5);\n for(let i = 0; i < r; i++) {\n let c = (r - i) * 0.01;\n vert += `\\nv_texCoordsBlur[${i}] = a_texCoords + vec2(-${c}, -${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i}]) * ${weights[i]};`;\n }\n vert += `\\nv_texCoordsBlur[${r}] = a_texCoords;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${r}]) * ${weights[r]};`;\n for(let i = 0; i < r; i++) {\n let c = (i + 1) * 0.01;\n vert += `\\nv_texCoordsBlur[${i + r + 1}] = a_texCoords + vec2(${c}, ${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i + r + 1}]) * ${weights[i + r + 1]};`;\n }\n vert = vertexBlur.replace('[3]', '[' + d + ']').replace(/}$/, vert + '}');\n frag = fragmentBlur.replace('[3]', '[' + d + ']').replace(/}$/, frag + '}');\n let program = webgl.initShaders(gl, vert, frag);\n gl.useProgram(program);\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n texture = webgl.drawBlur(gl, program, frameBuffer, texCache, texture, cache.page.texture, i, j,\n width, height, cx, cy, spread, d, sigma);\n // 销毁这个临时program\n gl.deleteShader(program.vertexShader);\n gl.deleteShader(program.fragmentShader);\n gl.deleteProgram(program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n texCache.releaseLockChannel(j);\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox);\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genColorMatrixWebgl(gl, texCache, cache, m, width, height, sx1, sy1, bbox) {\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n gl.useProgram(gl.programCm);\n webgl.drawCm(gl, gl.programCm, j, m);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox.slice(0));\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genOverflowWebgl(gl, texCache, node, cache, W, H) {\n let sbox = node.bbox.slice(0);\n let bbox = cache.bbox;\n // 没超过无需生成\n if(bbox[0] >= sbox[0] && bbox[1] >= sbox[1] && bbox[2] <= sbox[2] && bbox[3] <= sbox[3]) {\n return;\n }\n let width = sbox[2] - sbox[0], height = sbox[3] - sbox[1];\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n // 绘制,根据坐标裁剪使用原本纹理的一部分\n gl.useProgram(gl.programOverflow);\n webgl.drawOverflow(gl, j, sbox[0] - bbox[0], sbox[1] - bbox[1], width, height, cache.width, cache.height);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let overflowCache = new MockCache(gl, texture, cache.sx1, cache.sy1, width, height, sbox);\n texCache.releaseLockChannel(i, overflowCache.page);\n return overflowCache;\n}\n\nfunction genMaskWebgl(gl, texCache, node, __config, cache, W, H, 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);console.log(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 // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n assignMatrix(m, matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n // node本身有或者父有perspective都认为需要生成3d渲染上下文\n if(tf.isPerspectiveMatrix(matrix) || parentPm) {\n if(hasRecordAsMask) {\n hasRecordAsMask[9] = true;\n }\n else {\n hasRecordAsMask = [i, lv, total, node, __config, null, null, null, null, true];\n }\n }\n // 先左乘perspective的矩阵,再左乘父级的总矩阵\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n 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 }\n else {\n mergeList.push([i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective]);\n }\n }\n }\n let limitHash = {};\n // 根据收集的需要合并局部根的索引,尝试合并,按照层级从大到小,索引从大到小的顺序,\n // 这样保证子节点在前,后节点在前,后节点是为了mask先应用自身如filter之后再进行遮罩\n if(mergeList.length) {\n mergeList.sort(function(a, b) {\n if(a[1] === b[1]) {\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n mergeList.forEach(item => {\n let [i, lv, total, node, __config, limitCache, hasMask, filter, overflow] = item;\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n } = __config;\n let needGen;\n // 可能没变化,比如被遮罩节点、filter变更等\n if(!__cacheTotal || !__cacheTotal.available) {\n let [limit, res] = genTotalWebgl(gl, texCache, node, __config, i, total || 0, __structs, __cache, limitCache, 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 target = genOverflowWebgl(gl, texCache, node, target, width, height);\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n if(filter.length) {\n if(!__cacheFilter || !__cacheFilter.available || needGen) {\n let old = target;\n target = genFilterWebgl(gl, texCache, node, target, filter, width, height);\n if(target !== old) {\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n }\n if(hasMask && (!__cacheMask || !__cacheMask.available || needGen)) {\n target = genMaskWebgl(gl, texCache, node, __config, target, width, height, 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 m = mx.m2Mat4(matrixEvent, cx, cy);\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 }\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[0] !== page || page.update) {\n // page可能为一个已有纹理,或者贴图\n if(page instanceof MockPage) {\n webgl.bindTexture(gl, page.texture, i);\n channels[i] = page;\n }\n else {\n // 可能老的先删除\n if(last) {\n gl.deleteTexture(last.texture);\n }\n page.texture = webgl.createTexture(gl, page.canvas, i);\n channels[i] = page;\n }\n hash[page.uuid] = i;\n }\n else {\n hash[page.uuid] = i;\n }\n // 标识没有更新,以及最后使用时间\n page.update = false;\n page.time = inject.now();\n }\n // 再次遍历开始本次渲染并清空\n webgl.drawTextureCache(gl, list, hash, cx, cy, revertY);\n pages.splice(0);\n list.splice(0);\n }\n }\n\n findExistTexChannel(page) {\n return this.channels.indexOf(page);\n }\n\n /**\n * 获取并锁定一个纹理单元优先使用空的,其次最久未使用的\n * @returns {number|*}\n */\n lockOneChannel() {\n // 优先返回空单元\n let channels = this.channels;\n let locks = this.locks;\n for(let i = 0; i < this.__units; i++) {\n if(!channels[i] && !locks[i]) {\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n }\n // 根据NRU返回最久未使用的\n let units = this.__units;\n let cl = [];\n for(let i = 0; i < units; i++) {\n if(!locks[i]) {\n cl.push([i, channels[i]]);\n }\n }\n if(cl.length) {\n cl.sort(function(a, b) {\n if(a[1].time !== b[1].time) {\n return (a[1].time || 0) - (b[1].time || 0);\n }\n if(a[1].fullSize !== b[1].fullSize) {\n return a[1].fullSize - b[1].fullSize;\n }\n return a[0] - b[0];\n });\n let i = cl[0][0];\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n throw new Error('No free texture unit');\n }\n\n /**\n * 释放掉i单元,并且设置内容到缓存channel中\n * @param i\n * @param setToChannel\n */\n releaseLockChannel(i, setToChannel) {\n if(this.locks[i]) {\n this.locks[i] = false;\n this.__lockUnits--;\n if(setToChannel) {\n this.channels[i] = setToChannel;\n }\n }\n }\n\n // 指定锁定一个单元\n lockChannel(i) {\n let channels = this.channels;\n let locks = this.locks;\n if(!locks[i]) {\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n }\n }\n\n /**\n * 释放纹理单元\n * @param gl\n */\n release(gl) {\n this.channels.forEach(item => {\n if(item) {\n gl.deleteTexture(item.texture);\n }\n });\n }\n\n get channels() {\n return this.__channels;\n }\n\n get locks() {\n return this.__locks;\n }\n\n 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 // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d');\n this.__renderMode = mode.CANVAS;\n }\n else if(this.tagName === 'svg') {\n this.__renderMode = mode.SVG;\n }\n else if(this.tagName === 'webgl') {\n let gl = this.__ctx = this.__dom.getContext('webgl', ca);\n this.__renderMode = mode.WEBGL;\n gl.program = webgl.initShaders(gl, vertex, fragment);\n gl.programMask = webgl.initShaders(gl, vertexMask, fragmentMask);\n gl.programClip = webgl.initShaders(gl, vertexMask, fragmentClip);\n gl.programOverflow = webgl.initShaders(gl, vertexMask, fragmentOverflow);\n gl.programCm = webgl.initShaders(gl, vertexCm, fragmentCm);\n gl.useProgram(gl.program);\n // 第一次渲染生成纹理缓存管理对象,收集渲染过程中生成的纹理并在gl纹理单元满了时进行绘制和清空,减少texImage2d耗时问题\n const MAX_TEXTURE_IMAGE_UNITS = Math.min(16, gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));\n this.__texCache = new TexCache(MAX_TEXTURE_IMAGE_UNITS);\n }\n this.refresh(null, true);\n // 第一次节点没有__root,渲染一次就有了才能diff\n if(this.dom.__root && this.dom.__root instanceof Root) {\n this.dom.__root.destroy();\n }\n this.__eventCbList = initEvent(this.dom, Root);\n this.dom.__root = this;\n }\n\n refresh(cb, isFirst) {\n this.__hookTask = null;\n let { isDestroyed, renderMode, ctx, defs, width, height } = this;\n if(isDestroyed) {\n return;\n }\n defs.clear();\n // 首次递归测量整树的继承,后续更改各自更新机制做,防止每次整树遍历;root检查首次直接做,后续在checkUpdate()中插入\n if(isFirst) {\n this.__checkRoot(renderMode, width, height);\n this.__computeMeasure(renderMode, ctx);\n }\n // 非首次刷新如果没有更新则无需继续\n else if(!this.__checkUpdate(renderMode, ctx, width, height)) {\n return;\n }\n // 获取所有字体和大小测量,仅svg需要,canvas直接做\n inject.measureText();\n this.__checkReflow(width, height);\n if(renderMode === mode.CANVAS && !this.props.noRender) {\n this.__clear(ctx, renderMode);\n 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 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 let hasUpdate;\n // root更新特殊提前,因为有继承因素\n if(updateRoot) {\n root.__updateRoot = null;\n hasUpdate = parseUpdate(renderMode, root, updateRoot,\n reflowList, measureList, cacheHash, cacheList);\n // 此时做root检查,防止root出现继承等无效样式,或者发生resize()\n if(hasUpdate) {\n root.__checkRoot(renderMode, width, height);\n }\n }\n // 汇总处理每个节点,k是递增数字直接循环遍历\n let keys = Object.keys(updateHash);\n for(let i = 0, len = keys.length; i < len; i++) {\n let t = parseUpdate(renderMode, root, updateHash[keys[i]],\n reflowList, measureList, cacheHash, cacheList, zHash, zList);\n hasUpdate = hasUpdate || t;\n }\n // 先做一部分reset避免下面measureList干扰,cacheList的是专门收集新增的额外节点\n root.__reflowList = reflowList;\n uniqueUpdateId = 0;\n root.__updateHash = root.__config[NODE_UPDATE_HASH] = {};\n cacheList.forEach(__config => {\n delete __config[NODE_UNIQUE_UPDATE_ID];\n });\n // zIndex改变的汇总修改,防止重复操作\n zList.forEach(item => {\n if(item.hasOwnProperty('__uniqueZId')) {\n delete item.__uniqueZId;\n item.__updateStruct(root.__structs);\n }\n });\n /**\n * 遍历每项节点,计算测量信息,节点向上向下查找继承信息,如果parent也是继承,先计算parent的\n * 过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n */\n let measureHash = {};\n measureList.forEach(node => {\n let { __config:{ [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId, [NODE_DOM_PARENT]: parent } } = node;\n // 在root下的component变更时root会进入,但其没有__uniqueUpdateId\n if(node !== root) {\n if(measureHash.hasOwnProperty(__uniqueUpdateId)) {\n return;\n }\n measureHash[__uniqueUpdateId] = true;\n }\n let last = node;\n // 检查measure的属性是否是inherit,在root下的component变更时root会进入,但其没有__uniqueUpdateId\n // 另外dom标识表明有dom变更强制进入\n let isInherit = node !== root\n && (updateHash[__uniqueUpdateId][UPDATE_ADD_DOM]\n || change.isMeasureInherit(updateHash[__uniqueUpdateId][UPDATE_STYLE]));\n // 是inherit,需要向上查找,从顶部向下递归计算继承信息\n if(isInherit) {\n while(parent && parent !== root) {\n let { __config: {\n [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId,\n }, currentStyle } = parent;\n let isInherit;\n if(parent.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n let style = updateHash[__uniqueUpdateId][UPDATE_STYLE];\n measureHash[__uniqueUpdateId] = true;\n let temp = change.measureInheritList(style);\n isInherit = !!temp.length;\n }\n else {\n isInherit = change.isMeasureInherit(currentStyle);\n }\n // 如果parent有inherit存入列表且继续向上,否则跳出循环\n if(isInherit) {\n last = parent;\n }\n else {\n break;\n }\n // 考虑component下的继续往上继承\n parent = parent.domParent;\n }\n }\n // 自顶向下查找inherit的,利用已有的方法+回调,当递归包含重复时标记防止重复\n last.__computeMeasure(renderMode, ctx, function(target) {\n if(target.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n measureHash[target.__config[NODE_UNIQUE_UPDATE_ID]] = true;\n }\n });\n });\n // 做完清空留待下次刷新重来\n for(let i = 0, len = keys.length; i < len; i++) {\n delete updateHash[keys[i]][UPDATE_CONFIG][NODE_UNIQUE_UPDATE_ID];\n }\n return hasUpdate;\n }\n\n /**\n * 除首次外每次刷新前检查reflow列表,计算需要reflow的节点局部重新布局\n * 当一个元素absolute不变时,其变化不会影响父元素和兄弟元素,直接自己重新局部LAYOUT包含子节点\n * 当absolute发生改变时,其变化会影响父和兄弟,视作父重新布局\n * 当inline变化时,视为其最近block/flex父变化\n * 当block变化时,往上查找最上层flex视为其变化,如不是则影响后面兄弟offset和父resize\n * 当flex变化时,往上查找最上层flex视为其变化,如不是则影响所有递归子节点layout和父resize\n * 以上3种情况向上查找时遇到absolute父均提前跳出,并标记absolute父LAYOUT\n * 上面所有情况即便结束还得额外看是否处于absolute中,是还是标记absolute重新布局\n * 当relative只变化left/top/right/bottom时,自己重新layout\n * 检测节点时记录影响的所有节点,最终形成一棵或n棵局部树\n * 需要重新布局的记作LAYOUT,被兄弟影响只需偏移的记作OFFSET,OFFSET可能会重复变为LAYOUT\n * 上述情况倘若发生包含重复,去掉子树,因子树视为被包含的重新布局\n * 如果有从root开始的,直接重新布局像首次那样即可\n * 如果非root,所有树根按先根顺序记录下来,依次执行局部布局\n * =========================\n * addDom比较特殊,是向已有节点中添加新的节点,检查影响与普通domDiff变化不同\n * @private\n */\n __checkReflow(width, height) {\n let { __reflowList: reflowList } = this;\n if(!reflowList.length) {\n return;\n }\n let root = this;\n let uniqueList = [];\n let hasRoot;\n __uniqueReflowId = 0;\n let reflowHash = {};\n // 遍历检查发生布局改变的节点列表,此时computedStyle还是老的,currentStyle是新的\n for(let i = 0, len = reflowList.length; i < len; i++) {\n let item = reflowList[i];\n let { node, component, addDom, removeDom } = item;\n // root提前跳出,完全重新布局\n if(node === this) {\n hasRoot = true;\n break;\n }\n // 添加时如果是cp则node取sr来布局\n if(addDom && node instanceof Component) {\n node = node.shadowRoot;\n }\n // 每个节点生成唯一的布局识别id存入hash防止重复\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n reflowHash[__uniqueReflowId++] = item;\n }\n // 每个节点都向上检查影响,以及是否从root开始完全重新,remove特殊对待,影响父节点视为普通父节点relay\n if(checkInfluence(root, reflowHash, node, component, addDom)) {\n hasRoot = true;\n if(addDom) {\n this.__zIndexChildren = null;\n }\n break;\n }\n // remove的要特殊对待,因为提前删除了父子兄弟关系,下面deepScan不会出现\n else if(removeDom) {\n uniqueList.push(item);\n }\n }\n __uniqueReflowId = 0;\n this.__reflowList = [];\n // 有root提前跳出\n if(hasRoot) {\n reflow.clearUniqueReflowId(reflowHash);\n // 布局分为两步,普通流和定位流,互相递归\n this.__layout({\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n // 绝对布局需要从根开始保存相对坐标系的容器引用,并根据relative/absolute情况变更\n this.__layoutAbs(this, {\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n this.__structs = this.__structure(0, 0);\n return true;\n }\n /**\n * 修剪树,自顶向下深度遍历\n * LAYOUT节点作为局部根,其递归子节点无需重复任何操作,直接去重\n * OFFSET节点作为局部根,其递归子节点先执行任何操作,后续根节点再偏移一次\n */\n else {\n this.__deepScan(function(node, options) {\n if(node.hasOwnProperty('__uniqueReflowId')) {\n let o = reflowHash[node.__uniqueReflowId];\n options.uniqueList.push(o);\n // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行\n return true;\n }\n // reflowHash没有记录则无返回继续递归执行\n }, { uniqueList });\n /**\n * 按顺序执行列表即可,上层LAYOUT先执行且停止递归子节点,上层OFFSET后执行等子节点先LAYOUT/OFFSET\n * 同级按先后顺序排列,过程中记录diff在结束后进行structs更新\n * 这里要注意margin合并的逻辑,因为最终都是block(flex等同),需要进行合并\n * 在处理一个block时,先判断是否是空block,同时看后面紧邻的有没有在uniqueList的下一个\n * 单独空block处理、2个相邻的非block处理直接可以进行判断\n * 中间的空block(即非空block的下一个是空block,且下一个不是最后一个),先记录下来list,合并后一并offset\n * 合并margin和Dom的逻辑一样,抽离共有方法\n **/\n let diffList = [];\n let diffI = 0;\n let mergeOffsetList = [];\n let __uniqueMergeOffsetId = 0;\n uniqueList.forEach(item => {\n let { node, component, addDom, removeDom } = item;\n // 重新layout的w/h数据使用之前parent暂存的,x使用parent,y使用prev或者parent的\n let cps = node.computedStyle, cts = node.currentStyle;\n let zIndex = cps[Z_INDEX], position = cps[POSITION], display = cps[DISPLAY];\n let isLastAbs = position === 'absolute';\n let isNowAbs = cts[POSITION] === 'absolute';\n let isLastNone = display === 'none';\n let isNowNone = cts[DISPLAY] === 'none';\n // none不可见布局无效可以无视\n if(isLastNone && isNowNone) {\n return;\n }\n let parent = node.domParent;\n let { __layoutData: { x, y, h }, width, computedStyle } = parent;\n let current = node;\n // cp的shadowRoot要向上到cp本身,考虑高阶组件在内到真正的顶层cp\n if(current.isShadowRoot) {\n current = current.hostRoot;\n }\n // y使用prev或者parent的,首个节点无prev,prev要忽略absolute的和display:none的\n let ref = current.prev;\n let hasFlowPrev;\n while(ref) {\n if(ref instanceof Text\n || (ref.computedStyle[POSITION] !== 'absolute' && ref.computedStyle[DISPLAY] !== 'none')) {\n y = ref.y + ref.outerHeight;\n hasFlowPrev = true;\n break;\n }\n ref = ref.prev;\n }\n // 找不到prev以parent为基准,找到则增加自身,排除remove\n if(!removeDom) {\n if(!hasFlowPrev) {\n y += computedStyle[MARGIN_TOP] + computedStyle[BORDER_TOP_WIDTH] + computedStyle[PADDING_TOP];\n }\n x += computedStyle[MARGIN_LEFT] + computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT];\n }\n // 找到最上层容器,如果是组件的子节点,以sr为container,sr本身往上找\n let container = node;\n // remove的节点本身无需再次布局\n if(!removeDom) {\n if(isNowAbs) {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n if(!container) {\n container = root;\n }\n // 由setState引发的要检查是cp自身还是更上层,如果cp被abs包含,那么node是cp的父亲,否则node是cp的sr\n // 而这种情况下传cp或node都一样,所以最终统一传node\n parent.__layoutAbs(container, null, node);\n // 优先判断dom变更\n if(addDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n return;\n }\n // 前后都是abs无需偏移后面兄弟和parent调整,component变化节点需更新struct\n else if(isLastAbs) {\n if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n }\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n return;\n }\n // 标识flow变abs,可能引发zIndex变更,重设struct和svg\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // 现在是普通流,不管之前是啥直接布局,排除remove删除的\n else {\n node.__layout({\n x,\n y,\n w: width,\n h,\n });\n y += node.outerHeight;\n if(component) {\n container = node;\n }\n else {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n }\n if(!container) {\n container = root;\n }\n // 防止geom\n if(node instanceof Dom) {\n node.__layoutAbs(container, {\n x,\n y,\n w: width,\n h,\n });\n }\n }\n }\n\n // 向上查找最近的parent是relative,需再次累加ox/oy,无需继续向上递归,因为parent已经递归包含了\n // 这样node重新布局后再次设置其使用parent的偏移\n let p = node;\n while(p && p !== root) {\n p = p.domParent;\n computedStyle = p.computedStyle;\n if(computedStyle[POSITION] === 'relative') {\n let { ox, oy } = p;\n ox && node.__offsetX(ox);\n oy && node.__offsetY(oy);\n break;\n }\n }\n\n // 向下调整next的flow位置,遇到重复LAYOUT的跳出等待其调用并处理其next,忽视掉abs,margin和abs在merge中做\n if(node.isShadowRoot) {\n node = node.hostRoot;\n }\n let next = node.next;\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n if(next.computedStyle[POSITION] === 'absolute') {\n next = next.next;\n continue;\n }\n let { y: oy } = next;\n let diff = y - oy;\n if(diff) {\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n let target = next;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let cs = target.computedStyle;\n if(cs[POSITION] !== 'absolute' && cs[DISPLAY] !== 'none') {\n target.__offsetY(diff, true, REPAINT);\n }\n next = next.next;\n }\n }\n break;\n }\n\n // 去重防止abs并记录parent,整个结束后按先序顺序进行margin合并以及偏移,注意忽略有display:none变block同时为absolute的\n if(!parent.hasOwnProperty('__uniqueMergeOffsetId') && !(isNowAbs && isLastNone)) {\n parent.__uniqueMergeOffsetId = __uniqueMergeOffsetId++;\n mergeOffsetList.push(parent);\n }\n\n // add和remove都需父节点重新生成struct,zIndexChildren已在对应api操作的before()侦听做了\n if(addDom || removeDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // component未知dom变化,所以强制重新struct,text则为其父节点,同时防止zIndex变更影响父节点\n else if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n node.domParent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(node.domParent);\n }\n }\n }\n // display有none变化,重置struct和zIndexChildren\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n });\n /**\n * mergeMargin后续调整,记录的是变更节点的父节点,因此每个节点内部直接遍历孩子进行\n * 由于保持先根遍历的顺序,因此会从最上最里的节点开始,先进行margin合并\n * 由于之前忽略掉abs节点,因此再检查直接abs是否要调整\n * 完成后对此父节点的后续兄弟节点进行调整,多次不会干扰影响\n * 然后继续往上循环,直到root结束\n */\n let inDirectAbsList = [];\n mergeOffsetList.forEach(parent => {\n delete parent.__uniqueMergeOffsetId;\n let flowChildren = parent.flowChildren, absChildren = parent.absChildren;\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length, lastChild;\n let isStart, startIndex, startNode;\n // 遍历flow孩子,从开始变化的节点开始,看变化造成的影响,对其后面节点进行偏移,并统计总偏移量\n for(let i = 0; i < length; i++) {\n let item = flowChildren[i];\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n let isXom = item instanceof Xom;\n // 忽略掉前面没有变更的节点,不能合并\n if(!isStart && isXom) {\n if(item.hasOwnProperty('__uniqueReflowId')) {\n isStart = true;\n startIndex = i;\n startNode = item;\n }\n }\n // 开始变更的节点,至少不是第0个\n let cs = isXom && item.currentStyle;\n let isInline = isXom && cs[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(cs[DISPLAY]) > -1;\n lastChild = item;\n // 每次循环开始前,这次不是block的话,看之前遗留的,可能是以空block结束,需要特殊处理,单独一个空block也包含\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length && isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n // 和普通布局类似,只是不用重新布局只需处理合并margin再根据差值偏移\n if(isXom && !isInline) {\n let isNone = isXom && cs[DISPLAY] === 'none';\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n // 空block要留下轮循环看,除非是最后一个,非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n if(isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n // 需要合并的情况,根据记录数和索引向上向下遍历节点设置偏移,同时设置总偏移量供父级使用\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0,最后一个一定有不必判断isStart\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n }\n // 先检查parent的尺寸是否发生了变化,从而决定是否调整next以及向上递归调整\n let cs = parent.currentStyle;\n let height = cs[HEIGHT];\n let isContainer = parent === root || parent.isShadowRoot || cs[POSITION] === 'absolute' || cs[POSITION] === 'relative';\n if(height[1] === AUTO && lastChild) {\n let oldH = parent.height + parent.computedStyle[PADDING_TOP];\n let nowH = lastChild.y + lastChild.outerHeight - parent.y;\n let diff = nowH - oldH;\n // 调整next以及非固定PX的abs,再递归向上\n if(diff) {\n parent.__resizeY(diff, REPAINT);\n let container;\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = item.currentStyle;\n // 是容器,所有的都调整,不是容器,其偏移是上级parent的某一个,根据情况具体不同\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n else if(bottom[1] === PX) {\n item.__offsetY(diff, true, REPAINT);\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n else if(top[1] === PERCENT) {\n if(isContainer) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n // 非容器的特殊处理\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n if(container.currentStyle[HEIGHT][1] !== PX) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, null, item);\n }\n // 不在容器内说明在上级,存入等结束后统一重新布局\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, item]);\n }\n }\n }\n reflow.offsetAndResizeByNodeOnY(parent, root, reflowHash, diff, inDirectAbsList);\n return;\n }\n }\n // 没有diff变化或者固定尺寸,可能内部发生变化,调整AUTO的abs,不递归向上\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom } = item.currentStyle;\n if(top[1] === AUTO && bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n }\n });\n // merge过程中需要重新布局的abs\n inDirectAbsList.forEach(arr => {\n arr[0].__layoutAbs(arr[1], null, arr[2]);\n });\n\n // 调整因reflow造成的原struct数据索引数量偏差,纯zIndex的已经在repaint里面重新生成过了\n // 这里因为和update保持一致的顺序,因此一定是先根顺序且互不包含\n let diff = 0, lastIndex = 0, isFirst = true, structs = root.__structs;\n diffList.forEach(item => {\n let [ns, d] = item;\n // 第一个有变化的,及后面无论有无变化都需更新\n // 第1个变化区域无需更改前面一段\n if(isFirst) {\n isFirst = false;\n lastIndex = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1;\n diff += d;\n }\n // 第2+个变化区域看是否和前面一个相连,有不变的段则先偏移它,然后再偏移自己\n else {\n let j = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1 + diff;\n for(let i = lastIndex; i < j; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n lastIndex = j;\n diff += d;\n }\n });\n // 后面的要根据偏移量校正索引\n if(diff) {\n for(let i = lastIndex, len = structs.length; i < len; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n }\n // 清除id\n reflow.clearUniqueReflowId(reflowHash);\n }\n }\n\n // 特殊覆盖方法,不需要super()计算自己,因为放在每次checkRoot()做过了\n __computeMeasure(renderMode, ctx) {\n css.computeMeasure(this, true);\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx);\n });\n }\n\n // 每个root拥有一个刷新hook,多个root塞到frame的__hookTask里\n // frame在所有的帧刷新逻辑执行后检查hook列表,进行root刷新操作\n __frameHook() {\n if(!this.__hookTask) {\n let r = this.__hookTask = (() => {\n this.refresh();\n });\n frame.__hookTask.push(r);\n }\n }\n\n __clear(ctx, renderMode) {\n if(renderMode === mode.CANVAS) {\n // 可能会调整宽高,所以每次清除用最大值\n this.__mw = Math.max(this.__mw, this.width);\n this.__mh = Math.max(this.__mh, this.height);\n // 清除前得恢复默认matrix,防止每次布局改变了属性\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, this.__mw, this.__mh);\n }\n else if(renderMode === mode.WEBGL) {\n ctx.clearColor(0, 0, 0, 0);\n ctx.clear(ctx.COLOR_BUFFER_BIT);\n }\n }\n\n get dom() {\n return this.__dom;\n }\n\n get uuid() {\n return this.__uuid;\n }\n\n get renderMode() {\n return this.__renderMode;\n }\n\n get ctx() {\n return this.__ctx;\n }\n\n get defs() {\n return this.__defs;\n }\n\n get taskUp() {\n return this.__taskUp;\n }\n\n get taskCp() {\n return this.__taskCp;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get animateController() {\n return this.__animateController;\n }\n\n get texCache() {\n return this.__texCache;\n }\n}\n\nexport default Root;\n","import Geom from './Geom';\nimport mode from '../mode';\nimport painter from '../../util/painter';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction reBuild(target, origin, base, isMulti) {\n if(isMulti) {\n return target.map(item => origin + item * base);\n }\n else {\n return origin + target * base;\n }\n}\n\nfunction reBuildC(target, originX, originY, width, height, isMulti) {\n if(isMulti) {\n if(target) {\n return target.map(item => reBuildC(item, originX, originY, width, height));\n }\n }\n else {\n if(target && target.length >= 2) {\n return [\n originX + target[0] * width,\n originY + target[1] * height,\n ];\n }\n }\n return [];\n}\n\nfunction curveNum(controlA, controlB) {\n let num = 0;\n if(controlA.length >= 2) {\n num++;\n }\n if(controlB.length >= 2) {\n num += 2;\n }\n return num;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getNewPoint(x1, y1, x2, y2, controlA, controlB, num, start = 0, end = 1) {\n if(start > 0 || end < 1) {\n if(num === 3) {\n [[x1, y1], controlA, controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, controlB, [x2, y2]], start, end);\n }\n else if(num === 2) {\n [[x1, y1], controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlB, [x2, y2]], start, end);\n }\n else if(num === 1) {\n [[x1, y1], controlA, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, [x2, y2]], start, end);\n }\n else {\n let a = Math.abs(x1 - x2);\n let b = Math.abs(y1 - y2);\n x1 += a * start;\n y1 += b * start;\n x2 -= a * (1 - end);\n y2 -= b * (1 - end);\n }\n }\n return [x1, y1, x2, y2, controlA, controlB];\n}\n\nclass Line extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // x1,y1和x2,y2表明线段的首尾坐标,control表明控制点坐标\n if(this.isMulti) {\n this.__x1 = [0];\n this.__y1 = [0];\n this.__x2 = [1];\n this.__y2 = [1];\n this.__controlA = [[]];\n this.__controlB = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.x1)) {\n this.__x1 = props.x1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x1)) {\n this.__x1 = [parseFloat(props.x1) || 0];\n }\n if(Array.isArray(props.y1)) {\n this.__y1 = props.y1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y1)) {\n this.__y1 = [parseFloat(props.y1) || 0];\n }\n if(Array.isArray(props.x2)) {\n this.__x2 = props.x2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x2)) {\n this.__x2 = [parseFloat(props.x2) || 0];\n }\n if(Array.isArray(props.y2)) {\n this.__y2 = props.y2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y2)) {\n this.__y2 = [parseFloat(props.y2) || 0];\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__x1.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__x1.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__x1.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__x1.map(() => v);\n }\n }\n else {\n this.__x1 = this.__y1 = this.__start = 0;\n this.__x2 = this.__y2 = this.__end = 1;\n this.__controlA = [];\n this.__controlB = [];\n if(!isNil(props.x1)) {\n this.__x1 = parseFloat(props.x1) || 0;\n }\n if(!isNil(props.y1)) {\n this.__y1 = parseFloat(props.y1) || 0;\n }\n if(!isNil(props.x2)) {\n this.__x2 = parseFloat(props.x2) || 0;\n }\n if(!isNil(props.y2)) {\n this.__y2 = parseFloat(props.y2) || 0;\n }\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA;\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB;\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, __cacheProps, isMulti } = this;\n let rebuild;\n ['x1', 'x2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originX, width, isMulti);\n }\n });\n ['y1', 'y2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originY, height, isMulti);\n }\n });\n ['controlA', 'controlB'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuildC(this[k], originX, originY, width, height, isMulti);\n }\n });\n ['start', 'end'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = this[k];\n }\n });\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 },\n } = this;\n this.buildCache(originX, originY);\n let { x1, y1, x2, y2, controlA, controlB } = __cacheProps;\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n if(!isMulti) {\n x1 = [x1];\n x2 = [x2];\n y1 = [y1];\n y2 = [y2];\n controlA = [controlA];\n controlB = [controlB];\n }\n x1.forEach((xa, i) => {\n let ya = y1[i];\n let xb = x2[i];\n let yb = y2[i];\n let ca = controlA[i];\n let cb = controlB[i];\n if((isNil(ca) || ca.length < 2) && (isNil(cb) || cb.length < 2)) {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[0] = Math.min(bbox[0], xb - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[1] = Math.min(bbox[1], yb - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[2] = Math.max(bbox[2], xb + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n bbox[3] = Math.max(bbox[3], yb + oy);\n }\n else if(isNil(ca) || ca.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(isNil(cb) || cb.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n });\n return bbox;\n }\n}\n\nexport default Line;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction concatPointAndControl(point, control) {\n if(Array.isArray(control) && (control.length === 2 || control.length === 4)\n && Array.isArray(point) && point.length === 2) {\n return control.concat(point);\n }\n return point;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getLength(list, isMulti) {\n let res = [];\n let total = 0;\n let increase = [];\n if(isMulti) {\n total = [];\n list.forEach(list => {\n let temp = getLength(list);\n res.push(temp.list);\n total.push(temp.total);\n increase.push([0].concat(temp.increase));\n });\n }\n else if(Array.isArray(list)) {\n total = 0;\n increase.push(0);\n let start = 0;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item)) {\n start = i;\n break;\n }\n }\n let prev = list[start];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n let a = Math.abs(item[0] - prev[0]);\n let b = Math.abs(item[1] - prev[1]);\n let c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n res.push(c);\n total += c;\n increase.push(total);\n prev = item;\n }\n else if(item.length === 4) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]]], 2);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[2], item[3]];\n }\n else if(item.length === 6) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]], [item[4], item[5]]], 3);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[4], item[5]];\n }\n }\n }\n return {\n list: res,\n total,\n increase,\n };\n}\n\nfunction getIndex(list, t, i, j) {\n if(i === j) {\n if(list[i] > t) {\n return i - 1;\n }\n return i;\n }\n let middle = i + ((j - i) >> 1);\n if(list[middle] === t) {\n return middle;\n }\n else if(list[middle] > t) {\n return getIndex(list, t, i, Math.max(middle - 1, i));\n }\n else {\n return getIndex(list, t, Math.min(middle + 1, j), j);\n }\n}\n\nfunction getNewList(list, len, start = 0, end = 1) {\n if(start === 0 && end === 1) {\n return list;\n }\n if(start >= end) {\n return [];\n }\n let i = 0, j = list.length - 1;\n if(start > 0) {\n i = getIndex(len.increase, start * len.total, i, j);\n }\n if(end < 1) {\n j = getIndex(len.increase, end * len.total, i, j);\n }\n list = util.clone(list);\n end *= len.total;\n let prePercent = 1;\n if(end > len.increase[j]) {\n let prev = list[j].slice(list[j].length - 2); // 最后2个点是x,y,前面是control\n let current = list[j + 1];\n let l = len.list[j];\n let diff = end - len.increase[j];\n let t = diff / l;\n prePercent = t;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[j + 1] = [current[1] - (1 - t) * a, current[1] - (1 - t) * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], res[3][0], res[3][1]];\n }\n }\n start *= len.total;\n if(start > len.increase[i]) {\n let prev = list[i].slice(list[i].length - 2);\n let current = list[i + 1];\n let l = len.list[i];\n // 同一条线段时如果有end裁剪,会影响start长度\n if(i === j && prePercent !== 1) {\n l *= prePercent;\n }\n let diff = start - len.increase[i];\n let t = diff / l;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[i] = [prev[0] + t * a, prev[1] + t * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([[current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([[current[4], current[5]], [current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], current[4], current[5]];\n }\n }\n if(j < list.length - 2) {\n list = list.slice(0, j + 2);\n }\n if(i > 0) {\n list = list.slice(i);\n }\n return list;\n}\n\nclass Polyline extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 所有点的列表\n if(this.isMulti) {\n this.__points = [[]];\n this.__controls = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__points.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__points.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__points.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__points.map(() => v);\n }\n }\n else {\n this.__points = [];\n // 控制点\n this.__controls = [];\n this.__start = 0;\n this.__end = 1;\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n }\n if(Array.isArray(props.controls)) {\n this.__controls = props.controls;\n }\n if(Array.isArray(props.points)) {\n this.__points = props.points;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n return points.map((item, i) => {\n if(!Array.isArray(item)) {\n return;\n }\n let len = item.length;\n if(isControl) {\n if(len !== 0 && len !== 2 && len !== 4) {\n return;\n }\n }\n else {\n if(len !== 0 && len !== 2) {\n return;\n }\n }\n let res = [];\n for(let i = 0; i < len; i++) {\n if(i % 2 === 0) {\n res.push(originX + item[i] * width);\n }\n else {\n res.push(originY + item[i] * height);\n }\n }\n return res;\n });\n }\n\n // 供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 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 },\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let { points, controls } = __cacheProps;\n if(!isMulti) {\n points = [points];\n controls = [controls];\n }\n points.forEach((pointList, i) => {\n if(!pointList || pointList.length < 2 || pointList[0].length < 2 || pointList[1].length < 2) {\n return;\n }\n let controlList = controls[i] || [];\n let [xa, ya] = pointList[0];\n for(let i = 1, len = pointList.length; i < len; i++) {\n let [xb, yb] = pointList[i];\n let c = controlList[i - 1];\n if(c && c.length === 4) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], c[2], c[3], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(c && c.length === 2) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n }\n xa = xb;\n ya = yb;\n }\n });\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Polyline;\n","import Polyline from './Polyline';\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} } = enums;\nconst { isNil } = util;\nconst { sectorPoints } = geom;\nconst { REM, VW, VH } = unit;\n\nfunction getR(v, dft) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = dft;\n }\n return v;\n}\n\nclass Sector extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 角度\n if(this.isMulti) {\n this.__begin = [0];\n this.__end = [0];\n this.__r = [1];\n if(Array.isArray(props.begin)) {\n this.__begin = props.begin.map(i => getR(i, 0));\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => getR(i, 0));\n }\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i, 1));\n }\n if(Array.isArray(props.edge)) {\n this.__edge = props.edge.map(i => !!i);\n }\n if(Array.isArray(props.closure)) {\n this.__closure = props.closure.map(i => !!i);\n }\n }\n else {\n this.__begin = this.__end = 0;\n // 半径[0, ∞),默认1\n this.__r = 1;\n // 扇形两侧是否有边\n this.__edge = false;\n // 扇形大于180°时,是否闭合两端\n this.__closure = false;\n if(!isNil(props.begin)) {\n this.__begin = getR(props.begin, 0);\n }\n if(!isNil(props.end)) {\n this.__end = getR(props.end, 0);\n }\n if(!isNil(props.r)) {\n this.__r = getR(props.r, 1);\n }\n if(!isNil(props.edge)) {\n this.__edge = !!props.edge;\n }\n if(!isNil(props.closure)) {\n this.__closure = !!props.closure;\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, begin, end, r, edge, closure, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.begin) || focus) {\n rebuild = true;\n __cacheProps.begin = (begin || 0) % 360;\n }\n if(isNil(__cacheProps.end) || focus) {\n rebuild = true;\n __cacheProps.end = (end || 0) % 360;\n }\n if(isNil(__cacheProps.r) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.r = r.map(r => r * width * 0.5);\n }\n else {\n __cacheProps.r = r * width * 0.5;\n }\n }\n r = __cacheProps.r;\n if(isNil(__cacheProps.edge) || focus) {\n rebuild = true;\n __cacheProps.edge = edge;\n }\n if(isNil(__cacheProps.closure) || focus) {\n rebuild = true;\n __cacheProps.closure = closure;\n }\n if(rebuild) {\n if(isMulti) {\n __cacheProps.list = [];\n __cacheProps.sList = [];\n begin.forEach((begin, i) => {\n let r2 = isNil(r[i]) ? width * 0.5 : r[i];\n let list = sectorPoints(cx, cy, r2, parseFloat(begin || 0) % 360, parseFloat(end[i] || 0) % 360);\n let sList = list.slice(0);\n if(closure[i]) {\n list.push(list[0].slice(0));\n if(edge) {\n sList.push(sList[0].slice(0));\n }\n }\n else {\n list.unshift([cx, cy]);\n list.push([cx, cy]);\n if(edge) {\n sList.unshift([cx, cy]);\n sList.push([cx, cy]);\n }\n }\n __cacheProps.list.push(list);\n __cacheProps.sList.push(sList);\n });\n }\n else {\n let list = sectorPoints(cx, cy, r, parseFloat(begin || 0), parseFloat(end || 0));\n let sList = list.slice(0);\n if(closure) {\n list.push(list[0].slice(0));\n if(edge) {\n sList.push(sList[0].slice(0));\n }\n }\n else {\n list.unshift([cx, cy]);\n list.push([cx, cy]);\n if(edge) {\n sList.unshift([cx, cy]);\n sList.push([cx, cy]);\n }\n }\n __cacheProps.list = list;\n __cacheProps.sList = sList;\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Sector;\n","import Geom from './Geom';\nimport util from \"../../util/util\";\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction genVertex(x, y, width, height, rx = 0, ry = 0) {\n if(rx === 0 || ry === 0) {\n return [\n [x, y],\n [x + width, y],\n [x + width, y + height],\n [x, y + height],\n [x, y],\n ];\n }\n let ox = rx * geom.H;\n let oy = ry * geom.H;\n return [\n [x + rx, y],\n [x + width - rx, y],\n [x + width + ox - rx, y, x + width, y + ry - oy, x + width, y + ry],\n [x + width, y + height - ry],\n [x + width, y + height + oy - ry, x + width + ox - rx, y + height, x + width - rx, y + height],\n [x + rx, y + height],\n [x + rx - ox, y + height, x, y + height + oy - ry, x, y + height - ry],\n [x, y + ry],\n [x, y + ry - oy, x + rx - ox, y, x + rx, y]\n ];\n}\n\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 0;\n }\n return v;\n}\n\nclass Rect extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 圆角\n if(this.isMulti) {\n this.__rx = [0];\n this.__ry = [0];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n }\n else {\n this.__rx = this.__ry = 0;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(rx => Math.min(rx, 0.5) * width);\n }\n else {\n __cacheProps.rx = Math.min(rx, 0.5) * width;\n }\n }\n if(isNil(__cacheProps.ry) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = rx.map(ry => Math.min(ry, 0.5) * height);\n }\n else {\n __cacheProps.ry = Math.min(ry, 0.5) * height;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => genVertex(originX, originY, width, height, rx, ry[i]));\n }\n else {\n __cacheProps.list = genVertex(originX, originY, width, height, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n bbox[0] = Math.min(bbox[0], originX - ox);\n bbox[1] = Math.min(bbox[1], originY - oy);\n bbox[2] = Math.max(bbox[2], originX + width + ox);\n bbox[3] = Math.max(bbox[3], originY + height + oy);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Rect;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Circle extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__r = [1];\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i));\n }\n else if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n else {\n this.__r = 1;\n if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, r, __cacheProps, isMulti } = this;\n if(isNil(__cacheProps.r) || focus) {\n if(isMulti) {\n __cacheProps.r = r.map(i => i * width * 0.5);\n __cacheProps.list = __cacheProps.r.map(r => geom.ellipsePoints(cx, cy, r));\n }\n else {\n __cacheProps.r = r * width * 0.5;\n __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Circle;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Ellipse extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__rx = [1];\n this.__ry = [1];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n else if(!isNil(props.rx)) {\n this.__rx = [getR(props.rx)];\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n else if(!isNil(props.ry)) {\n this.__ry = [getR(props.ry)];\n }\n }\n else {\n this.__rx = 1;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n this.__ry = 1;\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(i => i * width * 0.5);\n }\n else {\n __cacheProps.rx = rx * width * 0.5;\n }\n }\n if(isNil(__cacheProps.ry) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = ry.map(i => i * height * 0.5);\n }\n else {\n __cacheProps.ry = ry * height * 0.5;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => geom.ellipsePoints(cx, cy, rx, ry[i]));\n }\n else {\n __cacheProps.list = geom.ellipsePoints(cx, cy, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let rx = 0, ry = 0;\n if(isMulti) {\n let mx = 0, my = 0;\n __cacheProps.rx.forEach((rx, i) => {\n mx = Math.max(rx, mx);\n my = Math.max(ry, __cacheProps.ry[i]);\n });\n rx = mx;\n ry = my;\n }\n else {\n rx = __cacheProps.rx;\n ry = __cacheProps.ry;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - rx - ox;\n let xb = cx + rx + ox;\n let ya = cy - ry - oy;\n let yb = cy + ry + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Ellipse;\n","import reset from '../style/reset';\n\nlet fullCssProperty = {\n skewX: 'kx',\n skewY: 'ky',\n transform: 'tf',\n fontSize: 'fz',\n offset: 'os',\n easing: 'e',\n filter: 'ft',\n boxShadow: 'bd',\n overflow: 'of',\n backgroundClip: 'bp',\n textOverflow: 'tof',\n flexWrap: 'fp',\n perspective: 'ppt',\n rotate3d: 'r3',\n};\n\nlet abbrCssProperty = {\n os: 'offset', // 非css属性不会被下面反向遍历插入,手动\n e: 'easing',\n};\n\nlet fullAnimate = {\n value: 'v',\n options: 'o',\n};\n\nlet abbrAnimate = {};\n\nlet fullAnimateOption = {\n duration: 'dt',\n delay: 'd',\n endDelay: 'ed',\n iterations: 'i',\n direction: 'dc',\n fill: 'f',\n fps: 'fp',\n playbackRate: 'p',\n spfLimit: 'sl',\n};\n\nlet abbrAnimateOption = {};\n\nreset.DOM_KEY_SET.concat(reset.GEOM_KEY_SET).forEach(k => {\n if(fullCssProperty.hasOwnProperty(k)) {\n abbrCssProperty[fullCssProperty[k]] = k;\n return;\n }\n let v = k.charAt(0) + k.replace(/[a-z]/g, '').toLowerCase();\n fullCssProperty[k] = v;\n abbrCssProperty[v] = k;\n});\n\nObject.keys(fullAnimate).forEach(k => {\n abbrAnimate[fullAnimate[k]] = k;\n});\n\nObject.keys(fullAnimateOption).forEach(k => {\n abbrAnimateOption[fullAnimateOption[k]] = k;\n});\n\nexport default {\n fullCssProperty,\n abbrCssProperty,\n fullAnimate,\n abbrAnimate,\n fullAnimateOption,\n abbrAnimateOption,\n};\n","import abbr from './abbr';\nimport Node from '../node/Node';\nimport Component from '../node/Component';\nimport $$type from '../util/$$type';\nimport util from '../util/util';\nimport inject from '../util/inject';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet { isNil, isFunction, isPrimitive, clone, extend } = util;\nlet { abbrCssProperty, abbrAnimateOption, abbrAnimate } = abbr;\n\n/**\n * 还原缩写到全称,涉及样式和动画属性\n * @param target 还原的对象\n * @param hash 缩写映射\n */\nfunction abbr2full(target, hash) {\n // 也许节点没写样式\n if(target) {\n Object.keys(target).forEach(k => {\n // var-attr格式特殊考虑,仅映射attr部分,var-还要保留\n if(k.indexOf('var-') === 0) {\n let k2 = k.slice(4);\n if(hash.hasOwnProperty(k2)) {\n let fk = hash[k2];\n target['var-' + fk] = target[k];\n // delete target[k];\n }\n }\n // 普通样式缩写还原\n else if(hash.hasOwnProperty(k)) {\n let fk = hash[k];\n target[fk] = target[k];\n // 删除以免二次解析\n delete target[k];\n }\n });\n }\n}\n\nfunction replaceVars(json, vars) {\n if(json && vars) {\n // 新版vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // 排除特殊的library\n if(Array.isArray(member) && member.length && member[0] !== 'library' && vars.hasOwnProperty(id)) {\n let target = json;\n for(let i = 0, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // undefined和null意义不同\n if(v === undefined) {\n return;\n }\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n target[k] = v;\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Slot miss ' + k);\n return;\n }\n }\n }\n });\n }\n }\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-') === 0) {\n let v = json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(4);\n // 有id且变量里面传入了替换的值,值可为null,因为某些情况下空为自动\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n // undefined和null意义不同\n if(value === undefined) {\n return;\n }\n let target = json;\n // 如果有.则特殊处理子属性\n if(k2.indexOf('.') > -1) {\n let list = k2.split('.');\n let len = list.length;\n for(let i = 0; i < len - 1; i++) {\n k2 = list[i];\n // 避免异常\n if(target[k2]) {\n target = target[k2];\n }\n else {\n inject.warn('parseJson vars is not exist: ' + v.id + ', ' + k + ', ' + list.slice(0, i).join('.'));\n return;\n }\n }\n k2 = list[len - 1];\n }\n // 支持函数模式和值模式\n if(isFunction(value)) {\n value = value(v);\n }\n target[k2] = value;\n }\n }\n });\n }\n }\n}\n\nfunction replaceLibraryVars(json, hash, vars) {\n if(vars) {\n // 新版同级vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // library.xxx,需要>=2的长度\n if(Array.isArray(member) && member.length > 1 && vars.hasOwnProperty(id)) {\n if(member[0] === 'library') {\n let target = hash;\n for(let i = 1, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n let old = target[k];\n // 直接替换library的子对象,需补充id和tagName\n if(i === 1) {\n target[k] = Object.assign({ id: old.id, tagName: old.tagName }, v);\n }\n // 替换library中子对象的一个属性直接赋值\n else {\n target[k] = v;\n }\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Library slot miss ' + k);\n return;\n }\n }\n }\n }\n });\n }\n }\n // 兼容老版var-\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-library.') === 0) {\n let v = json[k];\n // 直接移除library插槽,防止下面调用replaceVars(json, vars)时报错\n delete json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(12);\n // 有id且变量里面传入了替换的值\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n if(isFunction(value)) {\n value = value(v);\n }\n // 替换图层的值必须是一个有tagName的对象\n if(!value || !value.tagName) {\n return;\n }\n // library对象也要加上id,与正常的library保持一致\n hash[k2] = Object.assign({ id: k2 }, value);\n }\n }\n });\n }\n }\n}\n\n/**\n * 遍历一遍library的一级,将一级的id存到hash上,无需递归二级,\n * 因为顺序前提要求排好且无循环依赖,所以被用到的一定在前面出现,\n * 一般是无children的元件在前,包含children的div在后\n * 即便library中的元素有children或library,在linkChild时将其link过去,parse递归会继续处理\n * @param item:library的一级孩子\n * @param hash:存放library的key/value引用\n */\nfunction linkLibrary(item, hash) {\n let id = item.id;\n // library中一定有id,因为是一级,二级+特殊需求才会出现放开\n if(isNil(id)) {\n throw new Error('Library item miss id: ' + JSON.stringify(item));\n }\n else {\n hash[id] = item;\n }\n}\n\n/**\n * 链接child到library文件,\n * props需要是clone的,因为防止多个child使用同一个库文件\n * children则直接引用,无需担心多个使用同一个\n * library也需要带上,在library直接子元素还包含library时会用到\n * @param child\n * @param libraryItem\n */\nfunction linkChild(child, libraryItem) {\n // 规定图层child只有init和动画,属性和子图层来自库\n child.tagName = libraryItem.tagName;\n child.props = clone(libraryItem.props);\n child.children = libraryItem.children;\n child.library = libraryItem.library;\n // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况\n Object.keys(libraryItem).forEach(k => {\n if(k.indexOf('var-') === 0 && !child.hasOwnProperty(k)) {\n child[k] = libraryItem[k];\n }\n });\n // 删除以免二次解析\n child.libraryId = null;\n // 规定图层实例化的属性和样式在init上,优先使用init,然后才取原型链的props\n let { init } = child;\n if(init) {\n let props = child.props = child.props || {};\n let style = props.style;\n extend(props, init);\n // style特殊处理,防止被上面覆盖丢失原始值\n if(style) {\n extend(style, init.style);\n props.style = style;\n }\n // 删除以免二次解析\n child.init = null;\n }\n}\n\nfunction parse(karas, json, animateRecords, opt, hash = {}) {\n if(isPrimitive(json) || json instanceof Node || json instanceof Component) {\n return json;\n }\n if(Array.isArray(json)) {\n return json.map(item => {\n return parse(karas, item, animateRecords, opt, hash);\n });\n }\n // 先判断是否是个链接到库的节点,是则进行链接操作\n let libraryId = json.libraryId;\n if(!isNil(libraryId)) {\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,tagName和属性和子图层来自库\n if(libraryItem) {\n linkChild(json, libraryItem);\n }\n else {\n throw new Error('Link library miss id: ' + libraryId);\n }\n json.libraryId = null;\n }\n // 再判断是否有library形成一个新的作用域,会出现library下的library使得一个链接节点链接后出现library的情况\n let library = json.library;\n if(Array.isArray(library)) {\n hash = {};\n library.forEach(item => {\n linkLibrary(item, hash);\n });\n // 替换library插槽\n replaceLibraryVars(json, hash, opt.vars);\n json.library = null;\n }\n let { tagName, props = {}, children = [], animate = [] } = json;\n if(!tagName) {\n throw new Error('Dom must have a tagName: ' + JSON.stringify(json));\n }\n let style = props.style;\n (opt.abbr !== false) && abbr2full(style, abbrCssProperty);\n // 先替换style的\n replaceVars(style, opt.vars);\n // 再替换静态属性,style也作为属性的一种,目前尚未被设计为被替换\n replaceVars(props, opt.vars);\n // 替换children里的内容,如文字,无法直接替换tagName/props/children/animate本身,因为下方用的还是原引用\n replaceVars(json, opt.vars);\n 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 let animationRecord;\n if(animate) {\n if(Array.isArray(animate)) {\n let has;\n animate.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrAnimate);\n let { value, options } = item;\n // 忽略空动画\n if(Array.isArray(value) && value.length) {\n has = true;\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n });\n if(has) {\n animationRecord = {\n animate,\n target: vd,\n };\n }\n }\n else {\n (opt.abbr !== false) && abbr2full(animate, abbrAnimate);\n let { value, options } = animate;\n if(Array.isArray(value) && value.length) {\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n animationRecord = {\n animate,\n target: vd,\n };\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n }\n }\n // 产生实际动画运行才存入列表供root调用执行\n if(animationRecord) {\n animateRecords.push(animationRecord);\n }\n return vd;\n}\n\nexport default parse;\n","import parse from './parse';\nimport abbr from './abbr';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport font from '../style/font';\nimport Controller from '../animate/Controller';\n\nlet o = {\n parse(karas, json, dom, options = {}) {\n // 特殊单例声明无需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';\n\nexport default {\n css,\n reset,\n unit,\n font,\n abbr,\n};\n","import Animation from './Animation';\nimport Controller from './Controller';\nimport easing from './easing';\nimport frame from './frame';\n\nexport default {\n Animation,\n Controller,\n easing,\n frame,\n};\n","import level from './level';\nimport change from './change';\nimport Page from './Page';\nimport Cache from './Cache';\n\nexport default {\n level,\n change,\n Page,\n Cache,\n};\n","import Node from './node/Node';\nimport Text from './node/Text';\nimport Xom from './node/Xom';\nimport Dom from './node/Dom';\nimport Img from './node/Img';\nimport Root from './node/Root';\nimport tag from './node/tag';\nimport mode from './node/mode';\nimport Geom from './node/geom/Geom';\nimport Line from './node/geom/Line';\nimport Polyline from './node/geom/Polyline';\nimport Polygon from './node/geom/Polygon';\nimport Sector from './node/geom/Sector';\nimport Rect from './node/geom/Rect';\nimport Circle from './node/geom/Circle';\nimport Ellipse from './node/geom/Ellipse';\nimport Component from './node/Component';\nimport Event from './util/Event';\nimport util from './util/util';\nimport $$type from './util/$$type';\nimport builder from './util/builder';\nimport updater from './util/updater';\nimport inject from './util/inject';\nimport enums from './util/enums';\nimport debug from './util/debug';\nimport parser from './parser/index';\nimport style from './style/index';\nimport animate from './animate/index';\nimport math from './math/index';\nimport refresh from './refresh/index';\nimport { version } from '../package.json';\n\nGeom.register('$line', Line);\nGeom.register('$polyline', Polyline);\nGeom.register('$polygon', Polygon);\nGeom.register('$sector', Sector);\nGeom.register('$rect', Rect);\nGeom.register('$circle', Circle);\nGeom.register('$ellipse', Ellipse);\n\nlet karas = {\n version,\n render(root, dom) {\n if(!(root instanceof Root)) {\n throw new Error('Render dom must be canvas/svg');\n }\n if(dom) {\n root.appendTo(dom);\n }\n return root;\n },\n createElement(tagName, props) {\n props = props || {};\n let children = [];\n for(let i = 2, len = arguments.length; i < len; i++) {\n children.push(arguments[i]);\n }\n if(util.isString(tagName)) {\n if(tagName.charAt(0) === '$') {\n return this.createGm(tagName, props);\n }\n else {\n return this.createVd(tagName, props, children);\n }\n }\n else if(tagName) {\n return this.createCp(tagName, props, children);\n }\n },\n createVd(tagName, props, children = []) {\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n if(tag.TAG_NAME.hasOwnProperty(tagName)) {\n return {\n tagName,\n props,\n children,\n $$type: $$type.TYPE_VD,\n };\n }\n throw new Error(`Can not use <${tagName}>`);\n },\n createGm(tagName, props) {\n return {\n tagName,\n props,\n $$type: $$type.TYPE_GM,\n };\n },\n createCp(klass, props, children = []) {\n props.children = children;\n return {\n klass,\n props,\n $$type: $$type.TYPE_CP,\n };\n },\n parse(json, dom, options) {\n return parser.parse(this, json, dom, options);\n },\n loadAndParse(json, dom, options) {\n return parser.loadAndParse(this, json, dom, options);\n },\n mode,\n Component,\n Node,\n Text,\n Geom,\n Xom,\n Dom,\n Img,\n Root,\n Event,\n util,\n inject,\n style,\n parser,\n animate,\n math,\n builder,\n updater,\n refresh,\n enums,\n set debug(v) {\n debug.flag = !!v;\n },\n};\n\nbuilder.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\n\nif(typeof window !== 'undefined') {\n window.karas = karas;\n}\nelse if(typeof self !== 'undefined') {\n self.karas = karas;\n}\n\nexport default karas;\n"],"names":["STYLE_KEY","POSITION","DISPLAY","TOP","RIGHT","BOTTOM","LEFT","MARGIN_TOP","MARGIN_RIGHT","MARGIN_BOTTOM","MARGIN_LEFT","PADDING_TOP","PADDING_RIGHT","PADDING_BOTTOM","PADDING_LEFT","FONT_SIZE","FONT_FAMILY","COLOR","FONT_STYLE","FONT_WEIGHT","LINE_HEIGHT","BACKGROUND_IMAGE","BACKGROUND_COLOR","BACKGROUND_SIZE","BACKGROUND_REPEAT","BACKGROUND_POSITION_X","BACKGROUND_POSITION_Y","BORDER_TOP_WIDTH","BORDER_RIGHT_WIDTH","BORDER_BOTTOM_WIDTH","BORDER_LEFT_WIDTH","BORDER_TOP_COLOR","BORDER_RIGHT_COLOR","BORDER_BOTTOM_COLOR","BORDER_LEFT_COLOR","BORDER_TOP_STYLE","BORDER_RIGHT_STYLE","BORDER_BOTTOM_STYLE","BORDER_LEFT_STYLE","BORDER_TOP_LEFT_RADIUS","BORDER_TOP_RIGHT_RADIUS","BORDER_BOTTOM_RIGHT_RADIUS","BORDER_BOTTOM_LEFT_RADIUS","WIDTH","HEIGHT","FLEX_GROW","FLEX_SHRINK","FLEX_BASIS","FLEX_DIRECTION","JUSTIFY_CONTENT","ALIGN_ITEMS","ALIGN_SELF","TEXT_ALIGN","TRANSFORM_ORIGIN","VISIBILITY","OPACITY","Z_INDEX","TRANSFORM","TRANSLATE_X","TRANSLATE_Y","TRANSLATE_Z","SCALE_X","SCALE_Y","SCALE_Z","SKEW_X","SKEW_Y","ROTATE_X","ROTATE_Y","ROTATE_Z","ROTATE_3D","PERSPECTIVE","PERSPECTIVE_ORIGIN","FILTER","BOX_SHADOW","POINTER_EVENTS","OVERFLOW","MIX_BLEND_MODE","BACKGROUND_CLIP","WHITE_SPACE","TEXT_OVERFLOW","LETTER_SPACING","LINE_CLAMP","ORDER","FLEX_WRAP","ALIGN_CONTENT","TEXT_STROKE_WIDTH","TEXT_STROKE_COLOR","TEXT_STROKE_OVER","FILL","STROKE","STROKE_WIDTH","STROKE_DASHARRAY","STROKE_DASHARRAY_STR","STROKE_LINECAP","STROKE_LINEJOIN","STROKE_MITERLIMIT","FILL_RULE","MATRIX","BORDER_TOP","BORDER_RIGHT","BORDER_BOTTOM","BORDER_LEFT","TRANSLATE_PATH","STYLE2LOWER_MAP","style2Lower","s","toLowerCase","replace","$0","$1","toUpperCase","STYLE2UPPER_MAP","style2Upper","$2","STYLE_R_KEY","STYLE_RV_KEY","STYLE_V_KEY","Object","keys","forEach","k","k2","l","UPDATE_KEY","UPDATE_NODE","UPDATE_STYLE","UPDATE_FOCUS","UPDATE_MEASURE","UPDATE_COMPONENT","UPDATE_OVERWRITE","UPDATE_KEYS","UPDATE_LIST","UPDATE_CONFIG","UPDATE_ADD_DOM","UPDATE_REMOVE_DOM","KEY_FRAME_KEY","FRAME_STYLE","FRAME_TIME","FRAME_EASING","FRAME_TRANSITION","NODE_KEY","NODE_DOM_PARENT","NODE_OPACITY","NODE_MATRIX","NODE_MATRIX_EVENT","NODE_CACHE","NODE_CACHE_TOTAL","NODE_CACHE_FILTER","NODE_CACHE_MASK","NODE_CACHE_OVERFLOW","NODE_STRUCT","NODE_TAG_NAME","NODE_CURRENT_STYLE","NODE_CURRENT_PROPS","NODE_COMPUTED_STYLE","NODE_CACHE_STYLE","NODE_CACHE_PROPS","NODE_LIMIT_CACHE","NODE_IS_MASK","NODE_IS_INLINE","NODE_HAS_CONTENT","NODE_REFRESH_LV","NODE_IS_DESTROYED","NODE_STYLE","NODE_UPDATE_HASH","NODE_UNIQUE_UPDATE_ID","NODE_DEFS_CACHE","NODE_PERSPECTIVE_MATRIX","NODE_VIRTUAL_DOM","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_FRAME_CB","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_CAL_DIFF_TIME","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","__width","__height","__baseLine","__config","i","lv","j","root","struct","diff","isLayout","__sx","__sy","x","ox","y","oy","__prev","__next","__parent","__domParent","__root","__host","__hostRoot","__virtualDom","CANVAS","SVG","WEBGL","o","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","REM","EM","VW","VH","VMAX","VMIN","calUnit","v","n","parseFloat","test","info","arial","lhr","blr","lgr","padding","f","verdana","tahoma","S","T","Z","c","t","georgia","simsun","support","fontFamily","hasOwnProperty","register","name","emSquare","ascent","descent","lineGap","addPadding","assign","position","gradient","img","identity","multiply","a","b","isE","a0","a1","a2","a3","calPoint","point","m","z","w","undefined","length","b1","c1","d1","b2","c2","d2","b3","c3","d3","a4","b4","c4","d4","d","e","inverse","inverse4","divisor","inv","det","m2m6","point2d","slice","dotProduct","x1","y1","x2","y2","crossProduct","H","Math","sqrt","vector","mx","h","deg","cos","sin","pointInPolygon","vertexes","xmax","ymax","xmin","ymin","len","max","min","pointInQuadrilateral","x4","y4","x3","y3","matrix","w1","w2","w3","w4","angleBySide","theta","pow","acos","sideByAngle","alpha","pointsDistance","triangleIncentre","ellipsePoints","sectorPoints","r","begin","end","list","floor","h2","d2r","abs","atan","rx","ry","p1","p2","p4","p3","push","concat","temp","res","getRectsIntersection","isRectsOverlap","ax1","ay1","ax4","ay4","bx1","by1","bx4","by4","isRectsInside","calCoordsInNode","px","py","node","computedStyle","width","height","calPercentInNode","ds","Infinity","PI","dt","r2d","bboxBezier2","x0","y0","minX","minY","maxX","maxY","tx","ty","sx","sy","qx","qy","bboxBezier3","cx","cy","bx","by","ax","ay","hx","hy","q","bboxBezier","arguments","norm","order","sum","reduce","simpson38","derivativeFunc","middleL","middleR","adaptiveSimpson38","eps","mid","st","sl","sr","ans","bezierLength","points","startT","endT","at","at3","p0","at2","bezierOrder","derivativeOrder","pointAtBezier","percent","maxIteration","pointAtBezierWithLength","targetLen","approachLen","approachT","preApproachT","derivative1","derivative2","numerator","denominator","sliceBezier","x12","y12","x23","y23","x123","y123","x34","y34","x234","y234","x1234","y1234","sliceBezier2Both","start","reverse","pointOnCircle","getConicGradientImage","originX","originY","stop","data","Error","getAngle","dx","dy","increasingList","map","item","color","angle","factor","idx","canvasPolygon","ctx","Array","isArray","moveTo","lineTo","quadraticCurveTo","bezierCurveTo","svgPolygon","canvasLine","controlA","controlB","num","svgLine","canvasFilter","filter","svgFilter","geom","unit","painter","calFitDashed","total","bs","be","smin","smax","dmin","dmax","ps","pd","outer","per","free","mo","calDashed","style","m1","m2","m3","m4","bw","calPoints","borderWidth","borderStyle","deg1","deg2","direction","beginRadius","endRadius","indexOf","isLast","main1","main2","cross1","cross2","tan","calTopRadiusPoints","calRightRadiusPoints","calBottomRadiusPoints","calLeftRadiusPoints","pointsList","brx","bry","erx","ery","oxl","oxr","beginList","centerList","endList","ya","yb","beginLength","needInner","crossDeg","rx1","ry1","sx1","oyl","rx2","ry2","sx2","xa","xb","ca","calBezierTopLeft","cb","controls1","controls2","limit","pop","endLength","oyr","calBezierTopRight","isStart","crossDx","p1x","p1y","p2x","p2y","dx1","dsx1","dx2","dsx2","cpx2","cpy2","cpx1","cpy1","crossDsx","beta","tanBetaDiv2Sqrt","tanAlphaHalf","degTg","degTg1","cdx1","cdy1","cx1","cy1","degTg2","cdx2","cdy2","cx2","cy2","isEnd","oyt","oyb","oxt","calBezierRightTop","oxb","calBezierRightBottom","calBezierBottomLeft","calBezierBottomRight","calBezierLeftTop","calBezierLeftBottom","calRadius","btlr","btrr","bbrr","bblr","need","btlx","btly","btrx","btry","bbrx","bbry","bblx","bbly","BR_KS","calBorderRadius","currentStyle","noRadius","target","prev","next","half","calBorderRadiusInline","contentBoxList","first","last","outerWidth","outerHeight","renderBorder","xom","renderMode","mode","beginPath","fillStyle","fill","closePath","virtualDom","bb","type","tagName","props","TYPE_VD","_","TYPE_GM","TYPE_CP","toString","isType","obj","call","isObject","isString","isFunction","isNumber","isBoolean","isDate","hasOwn","fnToString","ObjectFunctionString","isNil","joinSourceArray","arr","stringify","encodeHtml","prop","joinVirtualDom","vd","defs","joinDef","joinVd","conClip","children","isMask","content","opacity","transform","visibility","mask","overflow","mixBlendMode","def","uuid","joinItem","rgba2int","charAt","parseInt","match","int2rgba","joinArr","int2invert","arr2hash","hash","hash2arr","clone","$$type","util","Date","isPlainObject","equalArr","ai","bi","isArrayA","isArrayB","equal","getTime","extend","source","split","extendAnimate","ovd","nvd","__animationList","animationList","splice","__setTarget","assigning","finished","__stayEnd","assignCurrentStyle","__frameAnimateList","transformBbox","bbox","proto","getPrototypeOf","Ctor","constructor","assignMatrix","isPrimitive","isAuto","flag","charWidth","ELLIPSIS","antialias","premultipliedAlpha","preserveDrawingBuffer","initShaders","gl","vshader","fshader","program","createProgram","enable","BLEND","blendFunc","ONE","ONE_MINUS_SRC_ALPHA","vertexShader","loadShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","attachShader","linkProgram","linked","getProgramParameter","LINK_STATUS","error","getProgramInfoLog","deleteProgram","deleteShader","shader","createShader","shaderSource","compileShader","compiled","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","convertCoords2Gl","revertY","createTexture","tex","texture","bindTexture","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","texImage2D","TEXTURE_2D","UNSIGNED_BYTE","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","LINEAR","TEXTURE_MAG_FILTER","activeTexture","drawTextureCache","vtPoint","vtTex","vtOpacity","lastChannel","record","stack","cache","channel","page","tx1","ty1","tx2","ty2","pointBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","Float32Array","STATIC_DRAW","a_position","getAttribLocation","vertexAttribPointer","FLOAT","enableVertexAttribArray","texBuffer","a_texCoords","opacityBuffer","a_opacity","u_texture","getUniformLocation","count","uniform1i","drawArrays","TRIANGLES","deleteBuffer","disableVertexAttribArray","drawBlur","frameBuffer","texCache","tex1","tex2","spread","sigma","u_direction","uniform2f","ratio","recycle","tex3","framebufferTexture2D","FRAMEBUFFER","COLOR_ATTACHMENT0","tex4","deleteTexture","drawCm","u_m","uniform1fv","drawOverflow","programOverflow","drawMask","u_texture1","u_texture2","drawMbm","W","SPF","CANVAS_LIST","WEBGL_LIST","SUPPORT_OFFSCREEN_CANVAS","OffscreenCanvas","prototype","getContext","defaultFontFamilyData","key","message","debug","document","createElement","setAttribute","body","appendChild","canvas","draw","enabled","available","release","cacheCanvas","cacheWebgl","IMG","INIT","LOADING","LOADED","FONT","COMPONENT","inject","measureText","textCache","html","lengths","chars","ff","fs","fw","inline","char","div","left","top","innerHTML","cns","childNodes","index","css","window","getComputedStyle","text","__measureCb","removeChild","measureTextSync","measureImg","url","state","success","task","Image","onload","onerror","substr","host","exec","location","hostname","crossOrigin","src","warn","console","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","id","clearTimeout","now","performance","hasCacheCanvas","getCacheCanvas","releaseCacheCanvas","delCacheCanvas","hasCacheWebgl","getCacheWebgl","releaseCacheWebgl","delCacheWebgl","isDom","Element","self","getElementsByTagName","isWebGLTexture","WebGLTexture","checkSupportFontFamily","font","checked","context","textAlign","textBaseline","clearRect","fillText","getImageData","loadFont","FontFace","load","then","loadComponent","script","async","head","getLinearDeg","getRadialPosition","center","right","bottom","getColorStop","firstColor","p","dr","dg","db","da","unshift","calLinearCoords","calCircleCentre","iw","ih","positionX","positionY","calRadialRadius","shape","size","xl","yl","asin","parseGradient","reg","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","log","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","__hasUpdate","__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","Animation","__id","nl","__options","op","config","__frameCb","__calDiffTime","iterations","framesR","originStyle","fps","spfLimit","delay","endDelay","playbackRate","isFinish","__cancelTask","__currentProps","__currentStyle","isDelay","FRAME","PLAY","playState","__hasFin","__hasCancel","playCount","currentFrames","stayBegin","stayEnd","is2","endTime","currentTime","currentFrame","round","isAlternate","alternate","isEven","isLastCount","frameTime","isLastFrame","inEndDelay","needClean","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","isDirectItem","__calMp","isVirtual","fromAbs","isShadowRoot","clearCache","__layoutData","__layoutNone","__mp","__isRealInline","__layoutFlex","__layoutInline","__layoutBlock","__sx2","__sx3","__sx4","__sx5","__sx6","__sy2","__sy3","__sy4","__sy5","__sy6","__execAr","ar","controller","autoPlay","__records2","init","list2","__records","__playAuto","h3","nowrap","fixedWidth","fixedHeight","selfEndSpace","offsetWidth","offsetHeight","matrixCache","isScale","clientHeight","x5","x6","y5","y6","__calFilter","bg","bgI","item2","kw","__bx1","__bx2","__by1","__by2","rebuild","__hasContent","isRealInline","sx4","sx5","sx6","sy4","sy5","sy6","hasContent","__calContent","__calPerspective","__calMatrix","__releaseWhenEmpty","limitCache","__calCache","perspectiveMatrix","offscreenBlend","offscreenMask","hasFilter","offscreenFilter","offscreenOverflow","borderList","hasBgi","some","svgBgSymbol","__gradient","isFirst","lastContentBox","lastLineBox","parentLineBox","countW","ix1","iy1","ix2","iy2","symbol","clearAnimate","clearFrameAnimate","__stopPropagation","__stopImmediatePropagation","willResponseEvent","hasEmitMask","ignore","inThis","__touchstartTarget","__getLg","__getRg","__getCg","lg","createLinearGradient","addColorStop","rg","createRadialGradient","ec","dc","pc","cur","onlyTotal","__cacheTotal","__cacheFilter","__cacheMask","__cacheOverflow","formatStyle","animation","cancel","enter","hostRoot","pJson","zChildren","zIndexChildren","__spreadBbox","LineBox","__list","__lineHeight","LineBoxManager","__lastX","__lastY","__maxX","__domList","__domStack","__isNewLine","__isEnd","__setLB","nextNewLine","genLineBox","verticalAlign","isNewLine","TAG_NAME","INLINE","BOLD","offsetAndResizeByNodeOnY","reflowHash","inDirectAbsList","isContainer","cs","__layoutAbs","isAbs","__resizeY","clearUniqueReflowId","__uniqueReflowId","getMergeMarginTB","topList","bottomList","genZIndexChildren","hasMc","mcHash","lastMaskIndex","__iIndex","__zIndex","__aIndex","genOrderChildren","__order","block","inlineBlock","none","tag","__flexLine","__zIndexChildren","__structure","nss","__structs","structs","needSort","__tryLayInline","firstCharWidth","main","isRow","__calMinMax","min2","max2","countMin","countMax","setNotEnd","__addMp","isFixed","isContent","fixedSize","__lineBoxManager","__preLayout","__ioSize","mergeMarginBottomList","mergeMarginTopList","isXom","isInlineBlock","isImg","reflow","__isIbFull","lastX","lastY","isNone","isEmptyBlock","tw","th","horizonAlign","__inlineSize","domList","__marginAuto","growList","shrinkList","basisList","maxList","minList","orderChildren","__calBasis","containerSize","isMultiLine","line","hypotheticalList","hypothetical","maxCrossList","__layoutFlexLine","maxCross","crossSum","crossSumList","between","around","__crossAlign","flexLine","hypotheticalSum","targetMainList","factorSum","factorList","needReset","factorSum2","lbmList","firstBaseLine","genLineBoxByInlineIfNewLine","setLbByInlineIfNotNewLine","pushContentBoxList","isIbFull","isInline2","isInlineBlock2","focusNoWrap","fw2","addX","popContentBoxList","maxCX","maxCY","minCX","minCY","maxFX","maxFY","minFX","minFY","maxOX","maxOY","minOX","minOY","absChildren","onlyRight","onlyBottom","fixedTop","fixedRight","fixedBottom","fixedLeft","needCalWidth","wl","hl","__computeMeasure","__deepScan","loadImg","__loadImg","placeholder","loading","__loadAndRefresh","showError","pts","arc","__addGeom","reload","Defs","cacheHash","__isMulti","multi","__cacheProps","strokeDasharrayStr","lineCap","lineJoin","miterLimit","getLineDash","setLineDash","preData","__preSet","fills","fillRules","strokes","strokeWidths","strokeDasharrays","strokeDasharrayStrs","strokeLinecaps","strokeLinejoins","strokeMiterlimits","__renderOnePolygon","isFillCE","isStrokeCE","isFillRE","isStrokeRE","__conicGradient","__drawPolygon","__radialEllipse","isFill","isStroke","__preSetCanvas","__propsStrokeStyle","__inversePtList","updateList","removeList","KEY_FLAG","check","checkCp","nextProps","forceCheckUpdate","shouldUpdate","shouldComponentUpdate","updateCp","oldS","oldSr","oldJson","diffSr","oj","nj","ojk","getKeyHash","njk","keyList","cpList","diffCp","diffChildren","diffChild","removeCpFromOldTree","oc","ol","of","nf","exist","ex","did","componentDidUpdate","elem","diffDefs","diffBb","diffD2D","od","nd","diffDef","removeAt","insertAt","insertAdjacentHTML","parentNode","removeAttribute","diffItem","diffD2G","replaceWith","diffT2T","diffG2D","diffG2G","diffItemSelf","diffX2X","diffByLessLv","firstChild","lastChild","obb","nbb","isText","svg","where","insertBefore","Controller","__list2","__onList","__lastTime","args","records","animate","onList","__action","__mergeAuto","__on","timestamp","__set","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","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","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","__ctx","__renderMode","vertex","fragment","vertexMask","fragmentMask","fragmentClip","fragmentOverflow","vertexCm","fragmentCm","MAX_TEXTURE_IMAGE_UNITS","__texCache","destroy","__eventCbList","__checkRoot","__checkUpdate","__checkReflow","noRender","__clear","__vd","domDiff","updateStyle","taskUp","__nextFrameCp","updater","includeIgnore","scan","path","zPath","__index__","karas","path2","zPath2","nodeConfig","rootConfig","updateHash","__updateRoot","updateRoot","hasUpdate","__updateStruct","measureHash","__uniqueUpdateId","isInherit","uniqueList","hasRoot","diffList","diffI","mergeOffsetList","__uniqueMergeOffsetId","cps","cts","isLastAbs","isNowAbs","isLastNone","isNowNone","hasFlowPrev","__modifyStruct","startIndex","startNode","oldH","nowH","lastIndex","ns","reBuild","base","reBuildC","curveNum","limitStartEnd","getNewPoint","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","__start","__end","dy2","buildCache","curve","bezierBox","concatPointAndControl","control","getLength","increase","getIndex","getNewList","prePercent","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","replaceLibraryVars","linkLibrary","JSON","linkChild","libraryItem","library","libraryId","parse","animateRecords","opt","createGm","createCp","createVd","animationRecord","singleton","fonts","loadAndParse","components","imgs","list1","list3","version","appendTo","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAMA,SAAS,GAAG;EAChBC,EAAAA,QAAQ,EAAE,CADM;EAEhBC,EAAAA,OAAO,EAAE,CAFO;EAGhBC,EAAAA,GAAG,EAAE,CAHW;EAIhBC,EAAAA,KAAK,EAAE,CAJS;EAKhBC,EAAAA,MAAM,EAAE,CALQ;EAMhBC,EAAAA,IAAI,EAAE,CANU;EAOhBC,EAAAA,UAAU,EAAE,CAPI;EAQhBC,EAAAA,YAAY,EAAE,CARE;EAShBC,EAAAA,aAAa,EAAE,CATC;EAUhBC,EAAAA,WAAW,EAAE,CAVG;EAWhBC,EAAAA,WAAW,EAAE,EAXG;EAYhBC,EAAAA,aAAa,EAAE,EAZC;EAahBC,EAAAA,cAAc,EAAE,EAbA;EAchBC,EAAAA,YAA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AANA,GA7EU;EA8EVtY,EAAAA,OAAO,EAAPA,OA9EU;EA+EVl2B,EAAAA,IAAI,EAAJA,IA/EU;EAgFVkM,EAAAA,OAAO,EAAPA,OAhFU;EAiFV+5B,EAAAA,OAAO,EAAPA,OAjFU;EAkFVlL,EAAAA,OAAO,EAAPA,OAlFU;EAmFVjuE,EAAAA,KAAK,EAALA,KAnFU;;EAoFV,MAAI4rB,KAAJ,CAAU1oB,CAAV,EAAa;EACX0oB,IAAAA,KAAK,CAACrI,IAAN,GAAa,CAAC,CAACrgB,CAAf;EACD;;EAtFS,CAAZ;EAyFAk8C,OAAO,CAACrB,GAAR,CAAY;EACVvB,EAAAA,GAAG,EAAHA,KADU;EAEVC,EAAAA,GAAG,EAAHA,KAFU;EAGVC,EAAAA,GAAG,EAAHA,KAHU;EAIVC,EAAAA,IAAI,EAAJA,MAJU;EAKVC,EAAAA,SAAS,EAATA;EALU,CAAZ;;EAQA,IAAG,OAAO1uB,MAAP,KAAkB,WAArB,EAAkC;EAChCA,EAAAA,MAAM,CAACurD,KAAP,GAAeA,OAAf;EACD,CAFD,MAGK,IAAG,OAAO9oD,IAAP,KAAgB,WAAnB,EAAgC;EACnCA,EAAAA,IAAI,CAAC8oD,KAAL,GAAaA,OAAb;EACD;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["src/util/enums.js","src/node/Node.js","src/node/mode.js","src/style/unit.js","src/style/font.js","src/style/reg.js","src/math/matrix.js","src/math/vector.js","src/math/geom.js","src/math/gradient.js","src/util/painter.js","src/style/border.js","src/util/$$type.js","src/util/util.js","src/util/debug.js","src/node/textCache.js","src/gl/ca.js","src/gl/webgl.js","src/util/inject.js","src/style/gradient.js","src/style/reset.js","src/style/abbr.js","src/animate/key.js","src/refresh/change.js","src/style/css.js","src/node/TextBox.js","src/refresh/Page.js","src/math/tar.js","src/math/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_FRAME_CB: 8,\n I_PLAY_CB: 9,\n I_TARGET: 10,\n I_ROOT: 11,\n I_FRAMES: 12,\n I_FRAMES_R: 13,\n I_CURRENT_TIME: 14,\n I_NEXT_TIME: 15,\n I_STYLE: 16,\n I_DURATION: 17,\n I_ITERATIONS: 18,\n I_FILL: 19,\n I_PLAYBACK_RATE: 20,\n I_PLAY_COUNT: 21,\n I_PLAY_STATE: 22,\n I_DESTROYED: 23,\n I_START_TIME: 24,\n I_FPS_TIME: 25,\n I_EASING: 26,\n I_ENTER_FRAME: 27,\n I_DELAY: 28,\n I_END_DELAY: 29,\n I_KEYS: 30,\n I_ORIGIN_STYLE: 31,\n I_CURRENT_FRAMES: 32,\n I_CURRENT_FRAME: 33,\n I_SPF_LIMIT: 34,\n I_FPS: 35,\n I_DIRECTION: 36,\n I_CAL_DIFF_TIME: 37,\n I_FIRST_ENTER: 38,\n I_STAY_BEGIN: 39,\n I_STAY_END: 40,\n I_IS2: 41,\n I_END_TIME: 42,\n I_NODE_CONFIG: 43,\n I_ROOT_CONFIG: 44,\n I_OUT_BEGIN_DELAY: 45,\n I_TIME_STAMP: 46,\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.__width = 0;\n this.__height = 0;\n this.__baseLine = 0;\n this.__config = {};\n // 默认undefined\n // this.__prev = undefined;\n // this.__next = undefined;\n // this.__parent = undefined;\n // this.__domParent = undefined;\n // this.__root = undefined;\n // this.__host = undefined;\n }\n\n __structure(i, lv, j) {\n return this.__config[NODE_STRUCT] = {\n [STRUCT_NODE]: this,\n [STRUCT_INDEX]: i,\n [STRUCT_CHILD_INDEX]: j,\n [STRUCT_LV]: lv,\n };\n }\n\n __modifyStruct(root, offset = 0) {\n let struct = this.__config[NODE_STRUCT];\n return [struct, 0];\n }\n\n __offsetX(diff, isLayout) {\n if(isLayout) {\n this.__x += diff;\n }\n else {\n this.__ox += diff;\n }\n this.__sx += diff;\n }\n\n __offsetY(diff, isLayout) {\n if(isLayout) {\n this.__y += diff;\n }\n else {\n this.__oy += diff;\n }\n this.__sy += diff;\n }\n\n __destroy() {\n this.__config[NODE_IS_DESTROYED] = true;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get ox() {\n return this.__ox;\n }\n\n get oy() {\n return this.__oy;\n }\n\n get sx() {\n return this.x + this.ox;\n }\n\n get sy() {\n return this.y + this.oy;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n // canvas/svg根节点\n get root() {\n return this.__root;\n }\n\n // component根节点\n get host() {\n return this.__host;\n }\n\n // 考虑高阶组件在内的component根节点\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get baseLine() {\n return this.__baseLine;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get isDestroyed() {\n return this.__config[NODE_IS_DESTROYED];\n }\n}\n\nexport default Node;\n","export default {\n CANVAS: 0,\n SVG: 1,\n WEBGL: 2,\n};\n","let o = {\n AUTO: 0,\n PX: 1,\n PERCENT: 2,\n NUMBER: 3,\n INHERIT: 4,\n DEG: 5,\n STRING: 6,\n RGBA: 7,\n REM: 8,\n EM: 9,\n VW: 10,\n VH: 11,\n 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 verdana: {\n lhr: 1.21533203125, // (0+2059+430)/2048\n blr: 1.00537109375, // 2059/2048\n },\n tahoma: {\n lhr: 1.20703125, // (0+2049+423)/2048\n blr: 1.00048828125, // 2049/2048\n padding: {\n S: 1,\n T: 1,\n Z: 1,\n c: 1,\n f: 0.7,\n i: 1,\n l: 1,\n t: 0.9,\n },\n },\n georgia: {\n lhr: 1.13623046875, // (0+1878+449)/2048\n blr: 0.9169921875, // 1878/2048\n },\n 'courier new': {\n lhr: 1.1328125, // (0+1705+615)/2048\n blr: 0.83251953125, // 1705/2048\n },\n 'pingfang sc': {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06, // 1060/1000\n padding: {\n f: 0.5,\n },\n },\n simsun: {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06,\n padding: {\n f: 0.5,\n },\n },\n },\n support(fontFamily) {\n return this.info.hasOwnProperty(fontFamily);\n },\n register(name, info) {\n let { emSquare = 2048, ascent = 1854, descent = 434, lineGap = 67, padding = {} } = info || {};\n this.info[name.toLowerCase()] = {\n lhr: (ascent + descent + lineGap) / emSquare,\n blr: ascent / emSquare,\n padding,\n };\n },\n addPadding(name, padding) {\n Object.assign(this.info[name.toLowerCase()].padding, padding);\n },\n};\n\no.info['宋体'] = o.info.simsun;\n\nexport default o;\n","export default {\n position: /(([-+]?[\\d.]+[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') {\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(['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 = { _: 1 };\nconst TYPE_GM = { _: 2 };\nconst TYPE_CP = { _: 3 };\n\nexport default {\n TYPE_VD,\n TYPE_GM,\n TYPE_CP,\n};\n","import $$type from './$$type';\nimport mx from '../math/matrix';\n\nlet toString = {}.toString;\nfunction isType(type) {\n return function(obj) {\n return toString.call(obj) === '[object ' + type + ']';\n }\n}\n\nlet isObject = isType('Object');\nlet isString = isType('String');\nlet isFunction = isType('Function');\nlet isNumber = isType('Number');\nlet isBoolean = isType('Boolean');\nlet isDate = isType('Date');\n\nlet hasOwn = {}.hasOwnProperty;\nlet fnToString = hasOwn.toString;\nlet ObjectFunctionString = fnToString.call(Object);\n\nfunction isNil(v) {\n return v === undefined || v === null;\n}\n\nfunction joinSourceArray(arr) {\n let res = '';\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n res += joinSourceArray(item);\n }\n else {\n res += stringify(item);\n }\n }\n return res;\n}\n\nfunction stringify(s) {\n if(isNil(s)) {\n return '';\n }\n return s.toString();\n}\n\nfunction encodeHtml(s, prop) {\n if(prop) {\n return s.replace(/\"/g, '"');\n }\n return s.replace(/&/g, '&').replace(/ {\n s += joinDef(item);\n });\n s += '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n return s;\n}\n\n// 普通元素\nfunction joinVd(vd) {\n if(vd.type === 'item' || vd.type === 'img') {\n let s = '';\n (vd.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n if(vd.tagName === 'text') {\n return '' + vd.content + '';\n }\n return '<' + vd.tagName + s + '/>';\n }\n else if(vd.type === 'text') {\n let s = ``;\n // text有许多lineBox\n (vd.children || []).forEach(item => {\n s += joinVd(item);\n });\n return '' + s + '';\n }\n else if(vd.type === 'dom' || vd.type === 'geom') {\n let s = '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n let { opacity, transform, visibility, mask, overflow, filter, mixBlendMode } = vd;\n return '' + s + '';\n }\n}\n\nfunction joinDef(def) {\n let s = '<' + def.tagName + ' id=\"' + def.uuid + '\"';\n if(def.tagName === 'mask' || def.tagName === 'clipPath') {\n // s += ' maskUnits=\"userSpaceOnUse\"';\n }\n else if(def.tagName === 'filter') {\n // s += ' filterUnits=\"userSpaceOnUse\"';\n }\n else {\n s += ' gradientUnits=\"userSpaceOnUse\"';\n }\n (def.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n (def.children || []).forEach(item => {\n s += joinItem(item);\n });\n s += '';\n return s;\n}\n\nfunction joinItem(item) {\n let s = '<' + item.tagName;\n (item.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n return s;\n}\n\nfunction rgba2int(color) {\n if(Array.isArray(color)) {\n return color;\n }\n let res = [];\n if(!color || color === 'transparent') {\n res = [0, 0, 0, 0];\n }\n else if(color.charAt(0) === '#') {\n color = color.slice(1);\n if(color.length === 3) {\n res.push(parseInt(color.charAt(0) + color.charAt(0), 16));\n res.push(parseInt(color.charAt(1) + color.charAt(1), 16));\n res.push(parseInt(color.charAt(2) + color.charAt(2), 16));\n res[3] = 1;\n }\n else if(color.length === 6) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4), 16));\n res[3] = 1;\n }\n else if(color.length === 8) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4, 6), 16));\n res.push(parseInt(color.slice(6), 16) / 255);\n }\n else {\n res[0] = res[1] = res[2] = 0;\n res[3] = 1;\n }\n }\n else {\n let c = color.match(/rgba?\\s*\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*,\\s*([\\d.]+)(?:\\s*,\\s*([\\d.]+))?\\s*\\)/i);\n if(c) {\n res = [parseInt(c[1]), parseInt(c[2]), parseInt(c[3])];\n if(!isNil(c[4])) {\n res[3] = parseFloat(c[4]);\n }\n else {\n res[3] = 1;\n }\n }\n else {\n res = [0, 0, 0, 0];\n }\n }\n return res;\n}\n\nfunction int2rgba(color) {\n if(Array.isArray(color)) {\n if(color.length === 4) {\n color = color.map((c, i) => i === 3 ? c : Math.floor(Math.max(0, c)));\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n color = color.map(c => Math.floor(c));\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return color || 'rgba(0,0,0,0)';\n}\n\nfunction int2invert(color) {\n if(Array.isArray(color)) {\n color = color.slice(0);\n color[0] = 255 - color[0];\n color[1] = 255 - color[1];\n color[2] = 255 - color[2];\n if(color.length === 4) {\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return 'rgba(0,0,0,0)';\n}\n\nfunction arr2hash(arr) {\n let hash = {};\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n hash[item[0]] = item[1];\n }\n else {\n for(let list = Object.keys(item), j = list.length - 1; j >= 0; j--) {\n let k = list[j];\n hash[k] = item[k];\n }\n }\n }\n return hash;\n}\n\nfunction hash2arr(hash) {\n if(Array.isArray(hash)) {\n return hash;\n }\n let arr = [];\n for(let list = Object.keys(hash), i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n arr.push([k, hash[k]]);\n }\n return arr;\n}\n\nfunction clone(obj) {\n if(isNil(obj) || typeof obj !== 'object') {\n return obj;\n }\n // parse递归会出现内部先返回解析好的json,外部parse不能clone\n if(obj.$$type === $$type.TYPE_VD\n || obj.$$type === $$type.TYPE_GM\n || obj.$$type === $$type.TYPE_CP) {\n return obj;\n }\n if(util.isDate(obj)) {\n return new Date(obj);\n }\n if(!isPlainObject(obj) && !Array.isArray(obj)) {\n return obj;\n }\n let n = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(i => {\n n[i] = clone(obj[i]);\n });\n return n;\n}\n\n/**\n * 简化的arr对比,arr中只有arr和其它类型,其它类型对比值或引用,arr递归\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equalArr(a, b) {\n if(!a || !b) {\n return a === b;\n }\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let ai = a[i];\n let bi = b[i];\n let isArrayA = Array.isArray(ai);\n let isArrayB = Array.isArray(bi);\n if(isArrayA && isArrayB) {\n if(!equalArr(ai, bi)) {\n return false;\n }\n }\n else if(isArrayA || isArrayB) {\n return false;\n }\n else if(ai !== bi) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 深度对比对象\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equal(a, b) {\n if(a === b) {\n return true;\n }\n if(isObject(a) && isObject(b)) {\n let hash = {};\n for(let i = 0, arr = Object.keys(a), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!b.hasOwnProperty(k) || !equal(a[k], b[k])) {\n return false;\n }\n hash[k] = true;\n }\n // a没有b有则false\n for(let i = 0, arr = Object.keys(b), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!hash.hasOwnProperty(k)) {\n return false;\n }\n }\n }\n else if(isDate(a) && isDate(b)) {\n return a.getTime() === b.getTime();\n }\n else if(Array.isArray(a) && Array.isArray(b)) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equal(a[i], b[i])) {\n return false;\n }\n }\n }\n else {\n return a === b;\n }\n return true;\n}\n\nfunction extend(target, source, keys) {\n if(source === null || typeof source !== 'object') {\n return target;\n }\n if(!keys) {\n keys = Object.keys(source);\n }\n let i = 0;\n let len = keys.length;\n while(i < len) {\n let k = keys[i];\n target[k] = source[k];\n i++;\n }\n return target;\n}\n\nfunction joinArr(arr, split) {\n let s = arr.length ? arr[0] : '';\n for(let i = 1, len = arr.length; i < len; i++) {\n s += split + arr[i];\n }\n return s;\n}\n\nfunction extendAnimate(ovd, nvd) {\n let list = nvd.__animationList = ovd.animationList.splice(0);\n list.forEach(item => {\n item.__setTarget(nvd);\n // 事件队列的缘故,可能动画本帧刚执行过,然后再继承,就会缺失,需再次赋值一遍;也有可能停留最后\n if(item.assigning || item.finished && item.__stayEnd()) {\n item.assignCurrentStyle();\n }\n });\n // 帧动画继承\n nvd.__frameAnimateList = ovd.__frameAnimateList.splice(0);\n}\n\nfunction transformBbox(bbox, matrix, dx = 0, dy = 0) {\n if(matrix && !mx.isE(matrix)) {\n let [x1, y1, x2, y2] = bbox;\n // 可能因filter的原因扩展范围\n if(dx) {\n x1 -= dx;\n x2 += dx;\n }\n if(dy) {\n y1 -= dy;\n y2 += dy;\n }\n let list = [x2, y1, x1, y2, x2, y2];\n let w;\n [x1, y1, , w] = mx.calPoint([x1, y1], matrix);\n if(w && w !== 1) {\n x1 /= w;\n y1 /= w;\n }\n let xa = x1, ya = y1, xb = x1, yb = y1;\n for(let i = 0; i < 6; i += 2) {\n let x = list[i], y = list[i + 1];\n [x, y, , w] = mx.calPoint([x, y], matrix);\n if(w && w !== 1) {\n x /= w;\n y /= w;\n }\n xa = Math.min(xa, x);\n xb = Math.max(xb, x);\n ya = Math.min(ya, y);\n yb = Math.max(yb, y);\n }\n bbox = [xa, ya, xb, yb];\n }\n else if(dx || dy) {\n bbox = bbox.slice(0);\n bbox[0] -= dx;\n bbox[1] -= dy;\n bbox[2] += dx;\n bbox[3] += dy;\n }\n return bbox;\n}\n\nfunction isPlainObject(obj) {\n if(!obj || toString.call(obj) !== '[object Object]') {\n return false;\n }\n let proto = Object.getPrototypeOf(obj);\n if(!proto) {\n return true;\n }\n let Ctor = hasOwn.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor === 'function' && fnToString.call(Ctor) === ObjectFunctionString;\n}\n\nfunction assignMatrix(t, v) {\n t[0] = v[0];\n t[1] = v[1];\n t[2] = v[2];\n t[3] = v[3];\n t[4] = v[4];\n t[5] = v[5];\n t[6] = v[6];\n t[7] = v[7];\n t[8] = v[8];\n t[9] = v[9];\n t[10] = v[10];\n t[11] = v[11];\n t[12] = v[12];\n t[13] = v[13];\n t[14] = v[14];\n t[15] = v[15];\n return t;\n}\n\nlet util = {\n isObject,\n isString,\n isFunction,\n isNumber,\n isBoolean,\n isDate,\n isNil,\n isPrimitive(v) {\n return util.isNil(v) || util.isBoolean(v) || util.isString(v) || util.isNumber(v);\n },\n // css中常用undefined/null表示auto本身\n isAuto(v) {\n return isNil(v) || v === 'auto';\n },\n isPlainObject,\n stringify,\n joinSourceArray(arr) {\n return joinSourceArray(arr);\n },\n encodeHtml,\n joinVirtualDom,\n joinVd,\n joinDef,\n rgba2int,\n int2rgba,\n int2invert,\n arr2hash,\n hash2arr,\n clone,\n equalArr,\n equal,\n extend,\n joinArr,\n extendAnimate,\n transformBbox,\n assignMatrix,\n};\n\nexport default util;\n","export default {\n flag: false,\n};\n","export default {\n list: [], // 每次渲染前的更新后,等待测量的文字对象列表\n data: {}, // Text中存入的特殊等待测量的信息,字体+字号+粗细为key\n charWidth: {}, // key的文字宽度hash\n padding: {}, // key的文字宽度偏移,少量字体的少量文字有\n ELLIPSIS: '…',\n};\n","export default {\n alpha: true,\n antialias: true,\n premultipliedAlpha: true,\n preserveDrawingBuffer: true,\n // depth: true,\n // stencil: true,\n};\n","import mx from '../math/matrix';\n\nconst calPoint = mx.calPoint;\n\n/**\n * 初始化 shader\n * @param gl GL context\n * @param vshader vertex shader (string)\n * @param fshader fragment shader (string)\n * @return program, if the program object was created and successfully made current\n */\nfunction initShaders(gl, vshader, fshader) {\n let program = createProgram(gl, vshader, fshader);\n if(!program) {\n throw new Error('Failed to create program');\n }\n\n // 要开启透明度,用以绘制透明的图形\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n return program;\n}\n\n/**\n * Create the linked program object\n * @param gl GL context\n * @param vshader a vertex shader program (string)\n * @param fshader a fragment shader program (string)\n * @return created program object, or null if the creation has failed\n */\nfunction createProgram(gl, vshader, fshader) {\n // Create shader object\n let vertexShader = loadShader(gl, gl.VERTEX_SHADER, vshader);\n let fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fshader);\n if(!vertexShader || !fragmentShader) {\n return null;\n }\n\n // Create a program object\n let program = gl.createProgram();\n if(!program) {\n return null;\n }\n program.vertexShader = vertexShader;\n program.fragmentShader = fragmentShader;\n\n // Attach the shader objects\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n // Link the program object\n gl.linkProgram(program);\n\n // Check the result of linking\n let linked = gl.getProgramParameter(program, gl.LINK_STATUS);\n if(!linked) {\n let error = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n gl.deleteShader(fragmentShader);\n gl.deleteShader(vertexShader);\n throw new Error('Failed to link program: ' + error);\n }\n return program;\n}\n\n/**\n * Create a shader object\n * @param gl GL context\n * @param type the type of the shader object to be created\n * @param source shader program (string)\n * @return created shader object, or null if the creation has failed.\n */\nexport function loadShader(gl, type, source) {\n // Create shader object\n let shader = gl.createShader(type);\n if(shader == null) {\n throw new Error('unable to create shader');\n }\n\n // Set the shader program\n gl.shaderSource(shader, source);\n\n // Compile the shader\n gl.compileShader(shader);\n\n // Check the result of compilation\n let compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if(!compiled) {\n let error = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error('Failed to compile shader: ' + error);\n }\n\n return shader;\n}\n\nfunction convertCoords2Gl([x, y, z, w], cx, cy, revertY) {\n if(z === undefined) {\n z = 0;\n }\n if(w === undefined) {\n w = 1;\n }\n if(w && w !== 1) {\n x /= w;\n y /= w;\n z /= w;\n }\n if(x === cx) {\n x = 0;\n }\n else {\n x = (x - cx) / cx;\n }\n if(y === cy) {\n y = 0;\n }\n else {\n y = (y - cy) / cy;\n if(revertY) {\n y = -y;\n }\n }\n return [x * w, y * w, z * w, w];\n}\n\nfunction createTexture(gl, tex, n, width, height) {\n let texture = gl.createTexture();\n bindTexture(gl, texture, n);\n // gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, -1);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n // 传入高宽时是绑定fbo,且tex一定为null\n if(width && height) {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n // 普通将canvas对象作为纹理\n else {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n return texture;\n}\n\nfunction bindTexture(gl, texture, n) {\n gl.activeTexture(gl['TEXTURE' + n]);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n}\n\n/**\n * texCache集满纹理上传占用最多可用纹理单元后,进行批量顺序绘制\n * 将所有dom的矩形顶点(经过transform变换后的)、贴图坐标、透明度存入3个buffer中,\n * 然后相同纹理单元的形成一批,设置uniform的纹理单元号进行绘制,如此循环\n * @param gl\n * @param list\n * @param hash\n * @param cx\n * @param cy\n * @param revertY\n */\nfunction drawTextureCache(gl, list, hash, cx, cy, revertY) {\n let vtPoint = [], vtTex = [], vtOpacity = [];\n let lastChannel; // 上一个dom的单元号\n let record = [0]; // [num, channel]每一批的数量和单元号记录\n let stack = [record]; // 所有批的数据记录集合\n list.forEach((item, i) => {\n let [cache, opacity, matrix, dx, dy] = item;\n if(i) {\n let channel = hash[cache.page.uuid];\n // 和上一个单元号不同时,生成新的批次记录\n if(lastChannel !== channel) {\n lastChannel = channel;\n record = [0, lastChannel];\n stack.push(record);\n }\n }\n else {\n lastChannel = hash[cache.page.uuid];\n record[1] = lastChannel;\n }\n let { x, y, width, height, page, bbox } = cache;\n // 计算顶点坐标和纹理坐标,转换[0,1]对应关系\n let bx = bbox[0], by = bbox[1];\n let [xa, ya] = [bx + (dx || 0), by + height + (dy || 0)];\n let [xb, yb] = [bx + width + (dx || 0), by + (dy || 0)];\n let [x1, y1, , w1] = calPoint([xa, ya], matrix);\n let [x2, y2, , w2] = calPoint([xb, ya], matrix);\n let [x3, y3, , w3] = calPoint([xb, yb], matrix);\n let [x4, y4, , w4] = calPoint([xa, yb], matrix);\n [x1, y1] = convertCoords2Gl([x1, y1, 0, w1], cx, cy, revertY);\n [x2, y2] = convertCoords2Gl([x2, y2, 0, w2], cx, cy, revertY);\n [x3, y3] = convertCoords2Gl([x3, y3, 0, w3], cx, cy, revertY);\n [x4, y4] = convertCoords2Gl([x4, y4, 0, w4], cx, cy, revertY);\n vtPoint.push(x1, y1, 0, w1, x4, y4, 0, w4, x2, y2, 0, w2, x4, y4, 0, w4, x2, y2, 0, w2, x3, y3, 0, w3);\n let tx1 = x / page.width, ty1 = (y + height) / page.height;\n let tx2 = (x + width) / page.width, ty2 = y / page.height;\n vtTex.push(tx1, ty1, tx1, ty2, tx2, ty1, tx1, ty2, tx2, ty1, tx2, ty2);\n vtOpacity.push(opacity, opacity, opacity, opacity, opacity, opacity);\n record[0]++;\n });\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtPoint), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.program, 'a_position');\n gl.vertexAttribPointer(a_position, 4, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtTex), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // opacity buffer\n let opacityBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, opacityBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtOpacity), gl.STATIC_DRAW);\n let a_opacity = gl.getAttribLocation(gl.program, 'a_opacity');\n gl.vertexAttribPointer(a_opacity, 1, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_opacity);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.program, 'u_texture');\n let count = 0;\n // 循环按批次渲染\n stack.forEach(record => {\n let [num, channel] = record;\n gl.uniform1i(u_texture, channel);\n num *= 6;\n gl.drawArrays(gl.TRIANGLES, count, num);\n count += num;\n });\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.deleteBuffer(opacityBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n gl.disableVertexAttribArray(a_opacity);\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核扩大3倍性能慢\n * x/y方向分开执行,加速性能,计算次数由d*d变为d+d,d为卷积核大小\n * spread由d和sigma计算得出,d由sigma计算得出,sigma即css的blur()参数\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * i和j为total和filter的纹理单元,3次执行(x/y合起来算1次)需互换单元,来回执行源和结果\n * 由total变为filter时cache会各方向上扩展spread的大小到width/height\n * 因此第一次绘制时坐标非1,后面则固定1\n * @param gl\n * @param program\n * @param frameBuffer\n * @param texCache\n * @param tex1 初次绘制目标纹理\n * @param tex2 初次绘制源纹理\n * @param i 初次绘制目标纹理单元\n * @param j 初次绘制源纹理单元\n * @param width\n * @param height\n * @param cx\n * @param cy\n * @param spread\n * @param d\n * @param sigma\n */\nfunction drawBlur(gl, program, frameBuffer, texCache, tex1, tex2, i, j, width, height, cx, cy, spread, d, sigma) {\n // 第一次将total绘制到blur上,此时尺寸存在spread差值,因此不加模糊防止坐标计算问题,仅作为扩展纹理尺寸\n let [x1, y2] = convertCoords2Gl([spread, height - spread], cx, cy);\n let [x2, y1] = convertCoords2Gl([width - spread, spread], cx, cy);\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // direction全0,即无模糊,此时只是进行扩展尺寸操作,还没到模糊所以传0\n let u_direction = gl.getUniformLocation(program, 'u_direction');\n gl.uniform2f(u_direction, 0, 0);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // fbo绑定切换纹理对象和单元索引,同时注意不能向源纹理绘制,因为源是cacheTotal,需要重新生成一个,y方向再来一次\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n /**\n * 反复执行共3次,坐标等均不变,只是切换fbo绑定对象和纹理单元\n * 注意max和ratio的设置,当是100尺寸的正方形时,传给direction的始终为1\n * 当正方形<100时,direction相应地要扩大相对于100的倍数,反之则缩小,如此为了取相邻点坐标时是+-1\n * 当非正方形时,长轴一端为基准值不变,短的要二次扩大比例倍数\n */\n let max = 100 / Math.max(width, height);\n let ratio = width / height;\n let recycle = []; // 3次过程中新生成的中间纹理需要回收\n for(let k = 0; k < 3; k++) {\n let tex3 = createTexture(gl, null, j, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex3, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, max, 0);\n }\n else {\n gl.uniform2f(u_direction, max * ratio, 0);\n }\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n recycle.push(tex1);\n let tex4 = createTexture(gl, null, i, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex4, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, 0, max * ratio);\n }\n else {\n gl.uniform2f(u_direction, 0, max);\n }\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n tex1 = tex4;\n recycle.push(tex3);\n }\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n recycle.forEach(item => gl.deleteTexture(item));\n return tex1;\n}\n\nfunction drawCm(gl, program, i, m) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, i);\n // matrix\n let u_m = gl.getUniformLocation(program, 'u_m');\n gl.uniform1fv(u_m, new Float32Array(m));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\n/**\n * 根据total/filter生成overflow\n * @param gl\n * @param i 输入纹理单元\n * @param dx 二者偏移值\n * @param dy\n * @param width 最终大小\n * @param height\n * @param w 输入纹理大小\n * @param h\n */\nfunction drawOverflow(gl, i, dx, dy, width, height, w, h) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.programOverflow, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer,原本大小width/height,使用其中的w/h\n let x1 = dx / w, y1 = dy / h, x2 = (width + dx) / w, y2 = (height + dy) /h;\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.programOverflow, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.programOverflow, 'u_texture');\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n}\n\nfunction drawMask(gl, i, j, program) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, j);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nfunction drawMbm(gl, program, i, j, W, H) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, i);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nexport default {\n initShaders,\n createTexture,\n bindTexture,\n drawTextureCache,\n drawBlur,\n drawOverflow,\n drawMask,\n drawMbm,\n drawCm,\n};\n","import util from './util';\nimport debug from './debug';\nimport textCache from '../node/textCache';\nimport font from '../style/font';\nimport ca from '../gl/ca';\nimport webgl from '../gl/webgl';\n\nconst SPF = 1000 / 60;\n\nconst CANVAS = {};\nconst WEBGL = {};\nconst CANVAS_LIST = [];\nconst WEBGL_LIST = [];\nconst SUPPORT_OFFSCREEN_CANVAS = typeof OffscreenCanvas === 'function' && util.isFunction(OffscreenCanvas.prototype.getContext);\n\nlet defaultFontFamilyData;\n\nfunction cache(key, width, height, hash, message) {\n let o;\n if(!key) {\n let target = hash === CANVAS ? CANVAS_LIST : WEBGL_LIST;\n if(target.length) {\n o = target.pop();\n }\n else {\n o = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n }\n else if(!hash[key]) {\n o = hash[key] = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n else {\n o = hash[key];\n }\n o.width = width;\n o.height = height;\n if(debug.flag) {\n o.style.width = width + 'px';\n o.style.height = height + 'px';\n o.setAttribute('type', hash === CANVAS ? 'canvas' : 'webgl');\n if(key) {\n o.setAttribute('key', key);\n }\n if(message) {\n o.setAttribute('message', message);\n }\n document.body.appendChild(o);\n }\n let ctx;\n if(hash === CANVAS) {\n ctx = o.getContext('2d');\n }\n else {\n ctx = o.getContext('webgl', ca) || o.getContext('experimental-webgl', ca);\n }\n return {\n canvas: o,\n ctx,\n draw() {\n // 空函数,仅对小程序提供hook特殊处理,flush缓冲\n },\n enabled: true,\n available: true,\n release() {\n if(!key && this.available) {\n if(hash === CANVAS) {\n CANVAS_LIST.push(this.canvas);\n }\n else {\n WEBGL_LIST.push(this.canvas);\n }\n }\n this.available = false;\n },\n };\n}\n\nfunction cacheCanvas(key, width, height, message) {\n return cache(key, width, height, CANVAS, message);\n}\n\nfunction cacheWebgl(key, width, height, message) {\n return cache(key, width, height, WEBGL, message);\n}\n\nconst IMG = {};\nconst INIT = 0;\nconst LOADING = 1;\nconst LOADED = 2;\nconst FONT = {};\nconst COMPONENT = {};\n\nlet inject = {\n measureText() {\n let { list, data } = textCache;\n let html = '';\n let keys = [];\n let lengths = [];\n let chars = [];\n Object.keys(data).forEach(key => {\n let { ff, fs, fw, s } = data[key];\n if(s) {\n keys.push(key);\n lengths.push(s.length);\n let inline = `position:absolute;font-family:${ff};font-size:${fs}px;font-weight:${fw}`;\n for(let i = 0, len = s.length; i < len; i++) {\n let char = s.charAt(i);\n chars.push(char);\n html += `${char.replace(/`;\n }\n data[key].s = '';\n }\n });\n if(!html) {\n return;\n }\n let div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n document.body.appendChild(div);\n div.innerHTML = html;\n let cns = div.childNodes;\n let { charWidth } = textCache;\n let count = 0, index = 0, key;\n for(let i = 0, len = cns.length; i < len; i++) {\n let node = cns[i];\n if(count === 0) {\n key = keys[index];\n }\n if(++count === lengths[index]) {\n index++;\n count = 0;\n }\n let char = chars[i];\n // clientWidth只返回ceil整数,精度必须用getComputedStyle\n let css = window.getComputedStyle(node, null);\n charWidth[key][char] = parseFloat(css.width);\n }\n list.forEach(text => text.__measureCb());\n textCache.list = [];\n textCache.data = {};\n if(!debug.flag) {\n document.body.removeChild(div);\n }\n },\n measureTextSync(key, ff, fs, fw, char) {\n let inline = `position:absolute;font-family:${ff};font-size:${fs}px;font-weight:${fw}`;\n let html = `${char}${char}${char}`;\n let div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n document.body.appendChild(div);\n div.innerHTML = html;\n let cns = div.childNodes;\n let w1 = parseFloat(window.getComputedStyle(cns[0], null).width);\n let w2 = parseFloat(window.getComputedStyle(cns[1], null).width);\n return w1 * 2 - w2;\n },\n IMG,\n INIT,\n LOADED,\n LOADING,\n measureImg(url, cb) {\n if(Array.isArray(url)) {\n if(!url.length) {\n return cb();\n }\n let count = 0;\n let len = url.length;\n let list = [];\n url.forEach((item, i) => {\n inject.measureImg(item, function(cache) {\n list[i] = cache;\n if(++count === len) {\n cb(list);\n }\n });\n });\n return;\n }\n else if(!url || !util.isString(url)) {\n inject.error('Measure img invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\n }\n let cache = IMG[url] = IMG[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb && cb(cache);\n }\n else if(cache.state === LOADING) {\n cb && cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cb && cache.task.push(cb);\n let img = new Image();\n img.onload = function() {\n cache.state = LOADED;\n cache.success = true;\n cache.width = img.width;\n cache.height = img.height;\n cache.source = img;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n img.onerror = function(e) {\n cache.state = LOADED;\n cache.success = false;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n if(url.substr(0, 5) !== 'data:') {\n let host = /^(?:\\w+:)?\\/\\/([^/:]+)/.exec(url);\n if(host) {\n if(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%]+)?/ig) || [];\n o.v = v.map(item => {\n let color = /((?:#[0-9a-f]{3,8})|(?:rgba?\\s*\\(.+?\\)))/i.exec(item);\n let arr = [rgba2int(color[1])];\n let percent = /[-+]?[\\d.]+[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: '#000',\n borderRightColor: '#000',\n borderBottomColor: '#000',\n borderLeftColor: '#000',\n borderTopStyle: 'solid',\n borderRightStyle: 'solid',\n borderBottomStyle: 'solid',\n borderLeftStyle: 'solid',\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomLeftRadius: 0,\n width: 'auto',\n height: 'auto',\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto',\n flexDirection: 'row',\n flexWrap: 'nowrap',\n order: 0,\n justifyContent: 'flexStart',\n alignItems: 'stretch',\n alignSelf: 'auto',\n alignContent: 'stretch',\n textAlign: 'inherit',\n letterSpacing: 'inherit',\n transformOrigin: 'center',\n visibility: 'inherit',\n opacity: 1,\n zIndex: 0,\n transform: null,\n translateX: 0,\n translateY: 0,\n translateZ: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n skewX: 0,\n skewY: 0,\n rotateX: 0,\n rotateY: 0,\n rotateZ: 0,\n rotate3d: '0, 0, 0, 0',\n perspective: 0,\n perspectiveOrigin: 'center',\n filter: null,\n boxShadow: null,\n pointerEvents: 'inherit',\n overflow: 'visible',\n mixBlendMode: 'normal',\n whiteSpace: 'inherit',\n textOverflow: 'clip',\n lineClamp: 0,\n textStrokeWidth: 'inherit',\n textStrokeColor: 'inherit',\n textStrokeOver: 'inherit',\n};\n\nconst GEOM = {\n fill: 'transparent',\n stroke: '#000',\n strokeWidth: 1,\n strokeDasharray: '',\n strokeLinecap: 'butt',\n strokeLinejoin: 'miter',\n strokeMiterlimit: 4,\n fillRule: 'nonzero',\n};\n\nlet DOM_ENTRY_SET = [];\nlet DOM_KEY_SET = [];\nObject.keys(DOM).forEach(k => {\n DOM_KEY_SET.push(k);\n let v = DOM[k];\n DOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet GEOM_ENTRY_SET = [];\nlet GEOM_KEY_SET = [];\nObject.keys(GEOM).forEach(k => {\n GEOM_KEY_SET.push(k);\n let v = GEOM[k];\n GEOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet INHERIT = {\n fontFamily: 'arial',\n fontSize: 16,\n fontWeight: 400,\n fontStyle: 'normal',\n color: '#000',\n textAlign: 'left',\n visibility: 'visible',\n pointerEvents: 'auto',\n textStrokeColor: '#000',\n textStrokeWidth: 1,\n textStrokeOver: 'none',\n};\n\nlet INHERIT_KEY_SET = [];\nObject.keys(INHERIT).forEach(k => {\n INHERIT_KEY_SET.push(k);\n});\n\nexport default {\n DOM,\n GEOM,\n isValid(i) {\n return DOM.hasOwnProperty(i) || GEOM.hasOwnProperty(i);\n },\n DOM_KEY_SET,\n GEOM_KEY_SET,\n DOM_ENTRY_SET,\n GEOM_ENTRY_SET,\n INHERIT,\n INHERIT_KEY_SET,\n};\n","import reg from './reg';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction parseFlex(style, grow, shrink, basis) {\n if(isNil(style.flexGrow)) {\n style.flexGrow = grow || 0;\n }\n if(isNil(style.flexShrink)) {\n style.flexShrink = shrink || 0;\n }\n if(isNil(style.flexBasis)) {\n style.flexBasis = basis || 0;\n }\n}\n\nfunction parseMarginPadding(style, key, list) {\n let temp = style[key];\n if(!isNil(temp)) {\n let match = temp.toString().match(/([-+]?[\\d.]+[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 // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform\n ['translate', 'scale', 'skew', 'translate3d', 'scale3d', 'rotate'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n abbr.toFull(style, k);\n }\n });\n // 扩展的不能和transform混用,给出警告\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate3d',\n ].forEach(k => {\n let v = style[k];\n if(!isNil(v) && style.transform) {\n inject.warn(`Can not use expand style \"${k}\" with transform`);\n }\n });\n // 默认reset,根据传入不同,当style为空时覆盖\n reset.forEach(item => {\n let { k, v } = item;\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n // 背景图\n temp = style.backgroundImage;\n if(temp !== undefined) {\n if(!temp) {\n res[BACKGROUND_IMAGE] = [null];\n }\n else if(Array.isArray(temp)) {\n res[BACKGROUND_IMAGE] = temp.map(item => {\n if(!item) {\n return null;\n }\n if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n if(reg.img.test(item)) {\n return reg.img.exec(item)[2];\n }\n return null;\n });\n }\n // 区分是渐变色还是图\n else if(reg.gradient.test(temp)) {\n res[BACKGROUND_IMAGE] = [gradient.parseGradient(temp)];\n }\n else if(reg.img.test(temp)) {\n res[BACKGROUND_IMAGE] = [reg.img.exec(temp)[2]];\n }\n else {\n res[BACKGROUND_IMAGE] = [null];\n }\n }\n temp = style.backgroundColor;\n if(temp) {\n // 先赋值默认透明,后续操作有合法值覆盖\n let bgc = /^#[0-9a-f]{3,8}/i.exec(temp);\n if(bgc && [4, 7, 9].indexOf(bgc[0].length) > -1) {\n res[BACKGROUND_COLOR] = [rgba2int(bgc[0]), RGBA];\n }\n else {\n bgc = /rgba?\\s*\\(.+\\)/i.exec(temp);\n res[BACKGROUND_COLOR] = [rgba2int(bgc ? bgc[0] : [0, 0, 0, 0]), RGBA];\n }\n }\n ['backgroundPositionX', 'backgroundPositionY'].forEach((k, i) => {\n temp = style[k];\n if(!isNil(temp)) {\n k = i ? BACKGROUND_POSITION_Y : BACKGROUND_POSITION_X;\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[k] = temp.map(item => {\n if(/^[-+]?[\\d.]/.test(item)) {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item] || 0,\n PERCENT,\n ];\n }\n });\n }\n });\n // 背景尺寸\n temp = style.backgroundSize;\n if(temp) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[BACKGROUND_SIZE] = temp.map(item => {\n if(!item) {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n let match = item.toString().match(/\\b(?:([-+]?[\\d.]+[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(!isNil(v)) {\n res[STYLE_KEY[style2Upper(k)]] = [rgba2int(v), RGBA];\n }\n });\n // border-radius\n ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'].forEach(k => {\n k = 'border' + k + 'Radius';\n let v = style[k];\n if(!isNil(v)) {\n let arr = v.toString().split(/\\s+/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = arr[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n if(n[0] < 0) {\n n[0] = 0;\n }\n arr[i] = n;\n }\n else {\n arr[i] = [0, PX];\n }\n }\n res[STYLE_KEY[style2Upper(k)]] = arr;\n }\n });\n temp = style.transform;\n if(temp) {\n let transform = res[TRANSFORM] = [];\n let match = (temp || '').toString().match(/\\w+\\(.+?\\)/g);\n if(match) {\n match.forEach(item => {\n let i = item.indexOf('(');\n let k = item.slice(0, i);\n let v = item.slice(i + 1, item.length - 1);\n if(k === 'matrix') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 6) {\n arr = arr.slice(0, 6);\n }\n if(arr.length === 6) {\n transform.push([MATRIX, [\n arr[0], arr[1], 0, 0, arr[2], arr[3], 0, 0, 0, 0, 1, 0, arr[4], arr[5], 0, 1,\n ]]);\n }\n }\n else if(k === 'matrix3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 16) {\n arr = arr.slice(0, 16);\n }\n if(arr.length === 16) {\n transform.push([MATRIX, arr]);\n }\n }\n else if(k === 'perspective') {\n let arr = calUnit(v);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n transform.push([PERSPECTIVE, arr]);\n }\n else if(k === 'rotate3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n transform.push([ROTATE_3D, arr]);\n }\n }\n else if(TRANSFORM_HASH.hasOwnProperty(k)) {\n let k2 = TRANSFORM_HASH[k];\n let arr = calUnit(v);\n compatibleTransform(k2, arr);\n transform.push([k2, arr]);\n }\n else if({ translate: true, scale: true, skew: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale' ? arr[0] : [0];\n }\n if(arr.length === 2) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n }\n }\n else if({ translate3d: true, scale3d: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale3d' ? [1] : [0];\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n if(arr.length === 3) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let k3 = STYLE_KEY[style2Upper(k + 'Z')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n let arr3 = calUnit(arr[2]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n compatibleTransform(k3, arr3);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n transform.push([k3, arr3]);\n }\n }\n });\n }\n }\n temp = style.perspective;\n if(!isNil(temp)) {\n let arr = calUnit(temp);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n res[PERSPECTIVE] = arr;\n }\n ['perspectiveOrigin', 'transformOrigin'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n let arr = res[STYLE_KEY[style2Upper(k)]] = [];\n let match = temp.toString().match(reg.position);\n if(match) {\n if(match.length === 1) {\n match[1] = match[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n arr.push(n);\n }\n else {\n arr.push([\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item],\n PERCENT,\n ]);\n // 不规范的写法变默认值50%\n if(isNil(arr[i][0])) {\n arr[i][0] = 50;\n }\n }\n }\n }\n else {\n arr.push([50, PERCENT]);\n arr.push([50, PERCENT]);\n }\n }\n });\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n let k2 = TRANSFORM_HASH[k];\n let n = calUnit(v);\n // 没有单位或默认值处理单位\n compatibleTransform(k2, n);\n res[k2] = n;\n });\n temp = style.rotate3d;\n if(temp) {\n let arr = temp.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n res[ROTATE_3D] = arr;\n }\n }\n temp = style.opacity;\n if(!isNil(temp)) {\n temp = parseFloat(temp);\n if(!isNaN(temp)) {\n temp = Math.max(temp, 0);\n temp = Math.min(temp, 1);\n res[OPACITY] = temp;\n }\n else {\n res[OPACITY] = 1;\n }\n }\n temp = style.zIndex;\n if(!isNil(temp)) {\n res[Z_INDEX] = parseInt(temp) || 0;\n }\n // 转化不同单位值为对象标准化,不写单位的变成number单位转化为px\n [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'width',\n 'height',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n if(v === 'auto') {\n v = [0, AUTO];\n }\n else {\n v = calUnit(v);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n let k2 = STYLE_KEY[style2Upper(k)];\n res[k2] = v;\n // 限制padding/border为正数\n if({\n paddingTop: true,\n paddingRight: true,\n paddingBottom: true,\n paddingLeft: true,\n borderTopWidth: true,\n borderRightWidth: true,\n borderBottomWidth: true,\n borderLeftWidth: true,\n width: true,\n height: true,\n }.hasOwnProperty(k) && v[0] < 0) {\n v[0] = 0;\n }\n });\n temp = style.flexBasis;\n if(!isNil(temp)) {\n if(temp === 'content') {\n res[FLEX_BASIS] = [temp, STRING];\n }\n else if(/^[\\d.]/.test(temp)) {\n let v = res[FLEX_BASIS] = calUnit(temp);\n v[0] = Math.max(v[0], 0);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n else {\n res[FLEX_BASIS] = [0, AUTO];\n }\n }\n temp = style.order;\n if(!isNil(temp)) {\n res[ORDER] = parseInt(temp) || 0;\n }\n temp = style.color;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[COLOR] = [[], INHERIT];\n }\n else {\n res[COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.textStrokeColor;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_COLOR] = [[], INHERIT];\n }\n else {\n res[TEXT_STROKE_COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.fontSize;\n if(temp || temp === 0) {\n if(temp === 'inherit') {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // fontSize不能为负数,否则为继承\n if(v < 0) {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[FONT_SIZE] = v;\n }\n }\n }\n temp = style.textStrokeWidth;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // textStrokeWidth不能为负数,否则为继承\n if(v < 0) {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG, PERCENT].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[TEXT_STROKE_WIDTH] = v;\n }\n }\n }\n temp = style.textStrokeOver;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_OVER] = [0, INHERIT];\n }\n else {\n let v = temp.toString();\n if(v !== 'none' && v !== 'fill') {\n v = 'none';\n }\n res[TEXT_STROKE_OVER] = [v, STRING];\n }\n }\n temp = style.fontWeight;\n if(!isNil(temp)) {\n if(temp === 'bold') {\n res[FONT_WEIGHT] = [700, NUMBER];\n }\n else if(temp === 'normal') {\n res[FONT_WEIGHT] = [400, NUMBER];\n }\n else if(temp === 'lighter') {\n res[FONT_WEIGHT] = [200, NUMBER];\n }\n else if(temp === 'inherit') {\n res[FONT_WEIGHT] = [0, INHERIT];\n }\n else {\n res[FONT_WEIGHT] = [Math.max(0, parseInt(temp)) || 400, NUMBER];\n }\n }\n temp = style.fontStyle;\n if(temp) {\n if(temp === 'inherit') {\n res[FONT_STYLE] = [0, INHERIT];\n }\n else {\n res[FONT_STYLE] = [temp, STRING];\n }\n }\n temp = style.fontFamily;\n if(temp) {\n if(temp === 'inherit') {\n res[FONT_FAMILY] = [0, INHERIT];\n }\n else {\n // 统一文字声明格式\n res[FONT_FAMILY] = [temp.toString().toLowerCase().replace(/['\"]/, '').replace(/\\s*,\\s*/g, ','), STRING];\n }\n }\n temp = style.textAlign;\n if(temp) {\n if(temp === 'inherit') {\n res[TEXT_ALIGN] = [0, INHERIT];\n }\n else {\n res[TEXT_ALIGN] = [temp, STRING];\n }\n }\n temp = style.lineHeight;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LINE_HEIGHT] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LINE_HEIGHT] = [0, AUTO];\n }\n // lineHeight默认数字,想要px必须强制带单位\n else if(/^[\\d.]+/i.test(temp)) {\n let v = calUnit(temp);\n if([DEG].indexOf(v[1]) > -1) {\n v[1] = NUMBER;\n }\n res[LINE_HEIGHT] = v;\n }\n else {\n let n = Math.max(0, parseFloat(temp)) || 'normal';\n // 非法数字\n if(n === 'normal') {\n res[LINE_HEIGHT] = [null, AUTO];\n }\n else {\n res[LINE_HEIGHT] = [n, NUMBER];\n }\n }\n }\n temp = style.letterSpacing;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LETTER_SPACING] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LETTER_SPACING] = [0, PX];\n }\n else if(/^[-+]?[\\d.]/.test(temp)) {\n let v = calUnit(temp);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[LETTER_SPACING] = v;\n }\n else {\n res[LETTER_SPACING] = [parseFloat(temp) || 0, PX];\n }\n }\n temp = style.whiteSpace;\n if(temp) {\n if(temp === 'inherit') {\n res[WHITE_SPACE] = [0, INHERIT];\n }\n else {\n res[WHITE_SPACE] = [temp, STRING];\n }\n }\n temp = style.lineClamp;\n if(temp !== undefined) {\n temp = parseInt(temp) || 0;\n res[LINE_CLAMP] = Math.max(0, temp);\n }\n // fill和stroke为渐变时特殊处理,fillRule无需处理字符串\n temp = style.fill;\n if(temp !== undefined) {\n if(!temp) {\n res[FILL] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[FILL] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[FILL] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[FILL] = [gradient.parseGradient(temp)];\n }\n else {\n res[FILL] = [rgba2int(temp)];\n }\n }\n temp = style.stroke;\n if(temp !== undefined) {\n if(!temp) {\n res[STROKE] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[STROKE] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[STROKE] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[STROKE] = [gradient.parseGradient(temp)];\n }\n else {\n res[STROKE] = [rgba2int(temp)];\n }\n }\n temp = style.strokeWidth;\n if(!isNil(temp)) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[STROKE_WIDTH] = temp.map(item => {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n v[0] = Math.max(v[0], 0);\n return v;\n });\n }\n temp = style.strokeDasharray;\n if(!isNil(temp)) {\n if(Array.isArray(temp)) {\n res[STROKE_DASHARRAY] = temp.map(item => {\n let match = item.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n return match;\n }\n return [];\n });\n }\n else {\n let match = temp.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n res[STROKE_DASHARRAY] = [match];\n }\n else {\n res[STROKE_DASHARRAY] = [[]];\n }\n }\n }\n temp = style.filter;\n if(temp !== undefined) {\n let match = (temp || '').toString().match(/\\b[\\w-]+\\s*\\(\\s*[-+]?[\\d.]+\\s*[pxremvwhdg%]*\\s*\\)\\s*/ig);\n let f = null;\n if(match) {\n f = [];\n match.forEach(item => {\n let m2 = /([\\w-]+)\\s*\\(\\s*([-+]?[\\d.]+\\s*[pxremvwhdg%]*)\\s*\\)\\s*/i.exec(item);\n if(m2) {\n let k = m2[1].toLowerCase(), v = calUnit(m2[2]);\n if(k === 'blur') {\n if(v[0] <= 0 || [DEG, PERCENT].indexOf(v[1]) > -1) {\n return;\n }\n if(v[1] === NUMBER) {\n v[1] = PX;\n }\n f.push([k, v]);\n }\n else if(k === 'hue-rotate') {\n if([NUMBER, DEG].indexOf(v[1]) === -1) {\n return;\n }\n v[1] = DEG;\n f.push([k, v]);\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'grayscale' || k === 'contrast') {\n if([NUMBER, PERCENT].indexOf(v[1]) === -1) {\n return;\n }\n v[0] = Math.max(v[0], 0);\n v[1] = PERCENT;\n f.push([k, v]);\n }\n }\n });\n }\n res[FILTER] = f;\n }\n temp = style.visibility;\n if(temp) {\n if(temp === 'inherit') {\n res[VISIBILITY] = [0, INHERIT];\n }\n else {\n res[VISIBILITY] = [temp, STRING];\n }\n }\n temp = style.pointerEvents;\n if(temp) {\n if(temp === 'inherit') {\n res[POINTER_EVENTS] = [0, INHERIT];\n }\n else {\n res[POINTER_EVENTS] = [temp, STRING];\n }\n }\n temp = style.boxShadow;\n if(temp !== undefined) {\n let bs = null;\n let match = (temp || '').match(/([-+]?[\\d.]+[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(!isNil(temp)) {\n res[Z_INDEX] = parseFloat(temp) || 0;\n }\n // 这些支持多个的用数组表示\n [\n 'backgroundRepeat',\n 'strokeLinecap',\n 'strokeLinejoin',\n 'strokeMiterlimit',\n 'fillRule',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n let v = style[k];\n res[STYLE_KEY[style2Upper(k)]] = Array.isArray(v) ? v : [v];\n }\n });\n GEOM_KEY_SET.forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[k] = style[k];\n }\n });\n return res;\n}\n\n/**\n * 第一次和REFLOW等级下,刷新前首先执行,生成computedStyle\n * 影响文字测量的只有字体和大小和重量,需要提前处理\n * 继承相关的计算\n * @param node 对象节点\n * @param isRoot 是否是根节点,无继承需使用默认值\n */\nfunction computeMeasure(node, isRoot) {\n let { currentStyle, computedStyle, domParent } = node;\n let parentComputedStyle = !isRoot && domParent.computedStyle;\n MEASURE_KEY_SET.forEach(k => {\n let v = currentStyle[k];\n // ff特殊处理\n if(k === FONT_FAMILY) {\n if(v[1] === INHERIT) {\n computedStyle[k] = getFontFamily(isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k]);\n }\n else {\n computedStyle[k] = getFontFamily(v[0]);\n }\n }\n else if(v[1] === INHERIT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k];\n }\n // 只有fontSize会有%\n else if(v[1] === PERCENT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (parentComputedStyle[k] * v[0] * 0.01);\n }\n else if(v[1] === REM) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.computedStyle[FONT_SIZE] * v[0]);\n }\n else if(v[1] === VW) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.width * 0.01 * v[0]);\n }\n else if(v[1] === VH) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.height * 0.01 * v[0]);\n }\n else 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];\n return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' '\n + fontSize + 'px/' + fontSize + 'px ' + (style[FONT_FAMILY] || 'arial');\n}\n\nfunction getFontFamily(str) {\n let ff = str.split(',');\n let f = 'arial';\n for(let i = 0, len = ff.length; i < len; i++) {\n if(font.support(ff[i])) {\n f = ff[i];\n break;\n }\n }\n return f;\n}\n\nfunction getBaseLine(style) {\n let fontSize = style[FONT_SIZE];\n let ff = getFontFamily(style[FONT_FAMILY]);\n let normal = fontSize * (font.info[ff] || font.info.arial).lhr;\n return (style[LINE_HEIGHT] - normal) * 0.5 + fontSize * (font.info[ff] || font.info.arial).blr;\n}\n\nfunction calNormalLineHeight(style) {\n let ff = getFontFamily(style[FONT_FAMILY]);\n return style[FONT_SIZE] * (font.info[ff] || font.info.arial).lhr;\n}\n\nfunction calRelativePercent(n, parent, k) {\n n *= 0.01;\n while(parent) {\n let style = parent.currentStyle[k];\n if(style[1] === AUTO) {\n if(k === WIDTH) {\n parent = parent.domParent;\n }\n else {\n break;\n }\n }\n else if(style[1] === PX) {\n return n * style[0];\n }\n else if(style[1] === PERCENT) {\n n *= style[0] * 0.01;\n parent = parent.domParent;\n }\n else if(style[1] === REM) {\n return n * style[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(style[1] === VW) {\n return n * style[0] * parent.root.width * 0.01;\n }\n else if(style[1] === VH) {\n return n * style[0] * parent.root.height * 0.01;\n }\n 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\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 DISPLAY,\n VISIBILITY,\n },\n NODE_KEY: {\n NODE_OPACITY,\n NODE_CACHE_TOTAL,\n NODE_CACHE_FILTER,\n NODE_CACHE_OVERFLOW,\n NODE_HAS_CONTENT,\n NODE_COMPUTED_STYLE,\n },\n} = enums;\n\n// 根据一个共享cache的信息,生成一个独立的离屏canvas,一般是filter,mask用\nfunction genSingle(cache, message) {\n let { size, sx1, sy1, width, height, bbox } = cache;\n let offscreen = inject.getCacheCanvas(width, height, null, message);\n offscreen.x = 0;\n offscreen.y = 0;\n offscreen.bbox = bbox;\n offscreen.size = size;\n offscreen.sx1 = sx1;\n offscreen.sy1 = sy1;\n offscreen.dx = cache.dx;\n offscreen.dy = cache.dy;\n offscreen.dbx = cache.dbx;\n offscreen.dby = cache.dby;\n offscreen.width = width;\n offscreen.height = height;\n return offscreen;\n}\n\nclass Cache {\n constructor(w, h, bbox, page, pos, x1, y1) {\n this.__init(w, h, bbox, page, pos, x1, y1);\n }\n\n __init(w, h, bbox, page, pos, x1, y1) {\n this.__width = w;\n this.__height = h;\n this.__bbox = bbox;\n this.__page = page;\n this.__pos = pos;\n let [x, y] = page.getCoords(pos);\n this.__x = x;\n this.__y = y;\n this.__appendData(x1, y1);\n 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 },\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') {\n bp = bp.domParent;\n }\n this.__bp = bp;\n let parentComputedStyle = bp.computedStyle;\n let pff = 'arial';\n for(let i = 0, pffs = parentComputedStyle[FONT_FAMILY].split(','), len = pffs.length; i < len; i++) {\n if(inject.checkSupportFontFamily(pffs[i])) {\n ff = ffs[i];\n break;\n }\n }\n let pfs = parentComputedStyle[FONT_SIZE];\n let pfw = parentComputedStyle[FONT_WEIGHT];\n let pKey = this.__pKey = pfs + ',' + pff + ',' + pfw;\n let parentCache = textCache.charWidth[pKey] = textCache.charWidth[pKey] || {};\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(renderMode === mode.WEBGL) {\n ctx = inject.getCacheCanvas(16, 16, '__$$CHECK_SUPPORT_FONT_FAMILY$$__').ctx;\n }\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n ctx.font = css.setFontStyle(parentComputedStyle);\n parentCache[ELLIPSIS] = ctx.measureText(ELLIPSIS).width;\n }\n ctx.font = css.setFontStyle(computedStyle);\n }\n else if(renderMode === mode.SVG) {\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n parentCache[ELLIPSIS] = 0;\n let wait = textCache.data[pKey] = textCache.data[pKey] || {\n ff: pff,\n fs: pfs,\n fw: pfw,\n hash: {},\n s: '',\n };\n wait.s += ELLIPSIS;\n needMeasure = true;\n }\n }\n // 逐字测量,canvas可瞬间得到信息,svg先预存统一进行\n for(let i = 0, length = content.length; i < length; i++) {\n let char = content.charAt(i);\n let mw;\n if(cache.hasOwnProperty(char)) {\n mw = cache[char];\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n mw = cache[char] = ctx.measureText(char).width;\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else {\n if(!wait.hash.hasOwnProperty(char)) {\n wait.s += char;\n }\n wait.hash[char] = true;\n // 先预存标识位-1,测量完后替换它\n charWidthList.push(-1);\n needMeasure = true;\n }\n }\n this.__textWidth = sum;\n if(needMeasure) {\n textCache.list.push(this);\n }\n }\n\n __measureCb() {\n let { content, charWidthList } = this;\n let key = this.__key;\n let cache = textCache.charWidth[key];\n let sum = 0;\n for(let i = 0, len = charWidthList.length; i < len; i++) {\n if(charWidthList[i] < 0) {\n let mw = charWidthList[i] = cache[content.charAt(i)];\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n }\n this.__textWidth = sum;\n }\n\n /**\n * text在virtual时和普通一样,无需特殊处理\n * endSpace由外界inline布局控制,末尾最后一行的空白mpb,包含递归情况,递归为多个嵌套末尾节点的空白mpb之和\n * 即便宽度不足,每行还是强制渲染一个字符,换行依据lx开始,因为x可能是从中间开始的,非inline则两个相等\n * 最后一个字符排版时要考虑末尾mpb,排不下的话回退删掉这个字符,如果最后一个字符另起开头,排不下也强制排,每行至少1个字符\n * 在textOverflow时很特殊,多个inline同行,回退可能到前一个inline节点,这个通过x和lx判断是否行首,决定至少1个字符规则\n * @param data\n * @private\n */\n __layout(data) {\n let __cache = this.__config[NODE_CACHE];\n if(__cache) {\n __cache.release();\n }\n let { x, y, w, lx = x, lineBoxManager, endSpace = 0, lineClamp = 0, lineClampCount = 0 } = data;\n this.__x = this.__sx1 = x;\n this.__y = this.__sy1 = y;\n let { isDestroyed, content, currentStyle, computedStyle, textBoxes, charWidthList, root, __ff, __key } = this;\n textBoxes.splice(0);\n let __config = this.__config;\n __config[NODE_LIMIT_CACHE] = false;\n // 空内容w/h都为0可以提前跳出\n if(isDestroyed || currentStyle[DISPLAY] === 'none' || !content) {\n return lineClampCount;\n }\n this.__ox = this.__oy = 0;\n // 顺序尝试分割字符串为TextBox,形成多行,begin为每行起始索引,i是当前字符索引\n let begin = 0;\n let i = 0;\n let beginSpace = x - lx; // x>=lx,当第一行非起始处时前面被prev节点占据,这个差值可认为是count宽度\n let count = beginSpace;\n let length = content.length;\n let maxW = 0;\n let {\n [LINE_HEIGHT]: lineHeight,\n [LETTER_SPACING]: letterSpacing,\n [WHITE_SPACE]: whiteSpace,\n [FONT_SIZE]: fontSize,\n [FONT_WEIGHT]: fontWeight,\n } = computedStyle;\n // 特殊字体中特殊字符连续时需减少一定的padding量\n let padding = font.info[__ff].padding;\n let needReduce = !!padding;\n let lastChar;\n let ew = textCache.charWidth[this.__pKey][ELLIPSIS];\n let lineCount = 0;\n // 不换行特殊对待,同时考虑overflow和textOverflow\n if(whiteSpace === 'nowrap') {\n let isTextOverflow;\n // block的overflow:hidden和textOverflow:clip/ellipsis才生效,inline要看最近非inline父元素\n let bp = this.__bp;\n let {\n [DISPLAY]: display,\n [OVERFLOW]: overflow,\n [WIDTH]: width,\n [TEXT_OVERFLOW]: textOverflow,\n } = bp.currentStyle;\n // 只要是overflow隐藏,不管textOverflow如何(默认是clip等同于overflow:hidden的功能)都截取\n if(overflow === 'hidden') {\n while(i < length) {\n count += charWidthList[i] + letterSpacing;\n if(count > w) {\n // block/flex无需宽度,inline-block需要设置宽度才生效\n if(display === 'block' || display === 'flex') {\n isTextOverflow = true;\n }\n else if(width[1] !== AUTO) {\n isTextOverflow = true;\n }\n break;\n }\n i++;\n }\n }\n else {\n while(i < length) {\n count += charWidthList[i++] + letterSpacing;\n }\n }\n // ellipsis生效情况,本节点开始向前回退查找,尝试放下一部分字符\n if(isTextOverflow && textOverflow === 'ellipsis') {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n }\n // 默认clip跟随overflow:hidden,无需感知\n else {\n let textBox = new TextBox(this, textBoxes.length, x, y, count - beginSpace, lineHeight,\n content, charWidthList);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n maxW = count - beginSpace;\n y += lineHeight;\n }\n }\n // 普通换行,注意x和lx的区别,可能相同(block起始处)可能不同(非起始处),第1行从x开始,第2行及以后都从lx开始\n // 然后第一次换行还有特殊之处,可能同一行前半部行高很大,此时y增加并非自身的lineHeight,而是整体LineBox的\n else {\n while(i < length) {\n let cw = charWidthList[i] + letterSpacing;\n count += cw;\n // 连续字符减少padding,除了连续还需判断char是否在padding的hash中\n if(needReduce) {\n let char = content[i];\n if(char === lastChar && padding.hasOwnProperty(char) && padding[char]) {\n let hasCache, p = textCache.padding[__key] = textCache.padding[__key] || {};\n if(textCache.padding.hasOwnProperty(__key)) {\n if(p.hasOwnProperty(char)) {\n hasCache = true;\n count -= p[char];\n }\n }\n if(!hasCache) {\n let n = 0;\n if(root.renderMode === mode.CANVAS) {\n root.ctx.font = css.setFontStyle(computedStyle);\n let w1 = root.ctx.measureText(char).width;\n let w2 = root.ctx.measureText(char + char).width;\n n = w1 * 2 - w2;\n n *= padding[char];\n }\n else if(root.renderMode === mode.SVG) {\n n = inject.measureTextSync(__key, __ff, fontSize, fontWeight, char);\n n *= padding[char];\n }\n count -= n;\n p[char] = n;\n }\n }\n lastChar = char;\n }\n // 忽略零宽字符\n if(cw === 0) {\n i++;\n continue;\n }\n // 换行都要判断i不是0的时候,第1个字符强制不换行\n if(count === w) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n let textBox;\n // 特殊情况,恰好最后一行最后一个排满,此时查看末尾mpb,要防止i为0的情况首个字符特殊不回退,无需看开头mpb\n if(i === length - 1 && count > w - endSpace && i) {\n count -= charWidthList[i--];\n }\n i++;\n if(!lineCount) {\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, count);\n }\n // 必须先添加再设置y,当有diff的lineHeight时,第一个换行不影响,再换行时第2个换行即第3行会被第1行影响\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null; // 换行后连续字符reduce不生效重新计数\n }\n // 奇怪的精度问题,暂时不用相等判断,而是为原本w宽度加一点点冗余1e-10\n else if(count > w + (1e-10)) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n // 普通非多行文本阶段逻辑\n let width;\n // 宽度不足时无法跳出循环,至少也要塞个字符形成一行,无需判断第1行,因为是否放得下逻辑在dom中做过了,\n // 如果第1行放不下,一定会另起一行,此时作为开头再放不下才会进这里,这个if只有0或1个字符的情况\n if(i <= begin) {\n width = count;\n }\n // 超过2个字符回退1个\n else {\n width = count - charWidthList[i--];\n }\n i++;\n // 根据是否第一行分开处理行首空白\n let textBox;\n if(!lineCount) {\n maxW = width - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, width);\n }\n // 必须先添加再设置y,同上\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null;\n }\n else {\n i++;\n }\n }\n // 换行后Text的x重设为lx\n if(lineCount) {\n this.__x = this.__sx1 = lx;\n }\n // 最后一行,只有一行未满时也进这里,需查看末尾mpb,排不下回退一个字符\n // 声明了lineClamp时特殊考虑,这里一定是最后一行,要对比行数不能超过,超过忽略掉这些文本\n if(begin < length && (!lineClamp || lineCount + lineClampCount < lineClamp)) {\n let textBox;\n if(!lineCount) {\n let needBack;\n // 防止开头第一个begin=0时回退,这在inline有padding且是第一个child时会发生\n if(begin && count > w - endSpace) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n else {\n let needBack;\n // 防止begin在结尾时回退,必须要有个字符,这在最后一行1个字符排不下时会出现\n if(count > w - endSpace && begin < length - 1) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n maxW = Math.max(maxW, count);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n }\n }\n this.__width = maxW;\n this.__height = y - data.y;\n this.__baseLine = css.getBaseLine(computedStyle);\n return lineCount;\n }\n\n // 末尾行因ellipsis的缘故向前回退字符生成textBox,可能会因不满足宽度导致无法生成,此时向前继续回退TextBox\n __lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount, lineHeight, lx, x, y, maxW,\n textBoxes, content, charWidthList, lineBoxManager) {\n for(; i >= begin; i--) {\n count -= charWidthList[i] + letterSpacing;\n if(count + ew + endSpace <= w) {\n // 至少1个字符不用回退,到0也没找到需要回退\n if(i) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n break;\n }\n }\n }\n // 最后也没找到,看是否要查找前一个inline节点,还是本身是行首兜底首字母\n if(i < 0) {\n let lineBox = lineBoxManager.lineBox;\n // lineBox为空是行首,至少放1个字符\n if(!lineBox.size) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.charAt(begin), charWidthList.slice(begin, begin + 1));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n }\n // 向前查找inline节点,可能会有前面inline嵌套,因此直接用lineBox,不会出现inlineBlock,\n // 这里和css不同,ib强制超限换行不会同行\n else {\n let list = lineBox.list;\n outer:\n for(let j = list.length - 1; j >= 0; j--) {\n let tb = list[j];\n let { content, wList, width } = tb;\n // 整体减去可以说明可能在这个tb中,只要最后发现不是空文本节点就行,否则继续;第0个强制进入保证1字符\n if(count - width + ew <= w || !j) {\n // 找到可以跳出outer循环,找不到继续,注意第0个且1个字符判断\n for(let k = wList.length - 1; k >= 0; k--) {\n if(!k && !j || count + ew <= w) {\n tb.__content = content;\n tb.__width = width;\n tb.parent.__ellipsis = true;\n break outer;\n }\n else {\n let w2 = wList[k];\n tb.__endY -= w2;\n width -= w2;\n content = content.slice(0, k);\n count -= w2;\n wList.pop();\n }\n }\n }\n // 不够则看前一个tb并且删掉这个\n else {\n count -= width;\n }\n list.pop();\n tb.parent.textBoxes.pop();\n }\n }\n }\n return [y, maxW];\n }\n\n __offsetX(diff, isLayout) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetX(diff);\n });\n }\n this.__sx1 += diff;\n }\n\n __offsetY(diff, isLayout) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetY(diff);\n });\n }\n this.__sy1 += diff;\n }\n\n __tryLayInline(w) {\n return w - this.charWidthList[0];\n }\n\n __inlineSize() {\n let minX, maxX;\n this.textBoxes.forEach((item, i) => {\n if(i) {\n minX = Math.min(minX, item.x);\n maxX = Math.max(maxX, item.x + item.width);\n }\n else {\n minX = item.x;\n maxX = item.x + item.width;\n }\n });\n this.__x = minX;\n this.__sx = this.__sx1 = minX + this.ox;console.log(22222)\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] * 0.5, half);\n }\n else if(textStrokeWidth[1] === VW) {\n half = Math.max(textStrokeWidth[0] * root.width * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VH) {\n half = Math.max(textStrokeWidth[0] * root.height * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VMAX) {\n half = Math.max(textStrokeWidth[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VMIN) {\n half = Math.max(textStrokeWidth[0] * Math.min(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(textStrokeWidth[0] * 0.5, half);\n }\n half += 1;\n return [sx - half, sy - half, sx + width + half, sy + height + half];\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get matrix() {\n return this.domParent.matrix;\n }\n\n get matrixEvent() {\n return this.domParent.matrixEvent;\n }\n}\n\nText.prototype.__renderByMask = Text.prototype.render;\n\nexport default Text;\n","import util from './util';\nimport $$type from './$$type';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\n/**\n * 2. 打平children中的数组,变成一维\n * 3. 合并相连的Text节点,即string内容\n */\nfunction flattenJson(parent) {\n if(Array.isArray(parent)) {\n return parent.map(item => flattenJson(item));\n }\n else if(!parent || [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) {\n return parent;\n }\n let list = [];\n traverseJson(list, parent.children, {\n lastText: null,\n });\n parent.children = list;\n return parent;\n}\n\nfunction traverseJson(list, children, options) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n traverseJson(list, item, options);\n });\n }\n else if(children && (children.$$type === TYPE_VD || children.$$type === TYPE_GM)) {\n if(['canvas', 'svg', 'webgl'].indexOf(children.tagName) > -1) {\n throw new Error('Can not nest canvas/svg/webgl');\n }\n if(children.$$type === TYPE_VD) {\n flattenJson(children);\n }\n list.push(children);\n options.lastText = null;\n }\n else if(children && children.$$type === TYPE_CP) {\n list.push(children);\n // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做\n options.lastText = null;\n }\n // 排除掉空的文本,连续的text合并\n else if(!util.isNil(children) && children !== '') {\n if(options.lastText !== null) {\n list[list.length - 1] = options.lastText += children;\n }\n else {\n list.push(children);\n }\n }\n}\n\nexport default flattenJson;\n","import Text from '../node/Text';\nimport util from './util';\nimport $$type from './$$type';\nimport enums from './enums';\nimport flatten from './flatten';\n\nconst { NODE_KEY: {\n NODE_DOM_PARENT,\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n} } = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nfunction initRoot(cd, root) {\n let c = flatten({\n tagName: root.tagName,\n props: {},\n children: cd,\n $$type: TYPE_VD,\n });\n root.__json = c;\n root.__host = root;\n let children = build(c.children, root, root);\n return relation(root, children);\n}\n\nfunction initDom(json, root, host, parent) {\n let vd = build(json, root, host);\n return relation(parent, vd);\n}\n\nfunction initCp(json, root, host) {\n if(util.isObject(json)) {\n // cp的flatten在__init中自己做\n return build(json, root, host);\n }\n // text的relation会由上层如Root设置\n else {\n return new Text(json);\n }\n}\n\nfunction initCp2(json, root, host, parent) {\n let vd = new json.klass(json.props);\n vd.__tagName = json.tagName || vd.__tagName;\n vd.__root = root;\n vd.__host = host;\n vd.__json = json;\n vd.__init();\n return relation(parent, vd);\n}\n\n/**\n * 将初始json文件生成virtualDom\n * @param json\n * @param root\n * @param host\n * @param hasP 出现过p标签\n * @returns vd\n */\nfunction build(json, root, host, hasP) {\n if(Array.isArray(json)) {\n return json.map(item => build(item, root, host, hasP));\n }\n let vd;\n if(util.isObject(json) && json.$$type) {\n let { tagName, props, children, klass, $$type, __inheritAnimate, __animateRecords } = json;\n // 更新过程中无变化的cp直接使用原来生成的\n if($$type === TYPE_CP && json.__placeholder) {\n return json.__placeholder;\n }\n if($$type === TYPE_VD) {\n if(tagName === 'img') {\n vd = new Img(tagName, props);\n if(Array.isArray(children) && children.length) {\n throw new Error('Img can not contain children');\n }\n }\n else {\n vd = new Dom(tagName, props);\n }\n // 检查p不能包含div\n if(tagName === 'p') {\n hasP = true;\n }\n else if(tagName === 'div' && hasP) {\n throw new Error('Markup p can not contain div');\n }\n if(Array.isArray(children)) {\n children = relation(vd, build(children, root, host, hasP));\n }\n else {\n children = [];\n }\n vd.__children = children;\n }\n else if($$type === TYPE_GM) {\n let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\n }\n else if($$type === TYPE_CP) {\n vd = new klass(props);\n vd.__tagName = tagName || vd.__tagName;\n }\n else {\n return new Text(json);\n }\n // 根parse需要用到真正的vd引用,然后vd也要引用json,用以做domApi\n json.vd = vd;\n vd.__json = json;\n // 递归parse中的动画记录需特殊处理,将target改为真正的vd引用\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n __animateRecords.list.forEach(item => {\n item.target = item.target.vd;\n });\n delete json.__animateRecords;\n }\n // 更新过程中key相同或者普通相同的vd继承动画\n if(__inheritAnimate) {\n util.extendAnimate(__inheritAnimate, vd);\n delete json.__inheritAnimate;\n }\n vd.__root = root;\n vd.__host = host;\n if($$type === TYPE_CP) {\n vd.__init();\n }\n let ref = props.ref;\n if(util.isString(ref) && ref || util.isNumber(ref)) {\n host.ref[ref] = vd;\n }\n else if(util.isFunction(ref)) {\n ref(vd);\n }\n return vd;\n }\n return new Text(json);\n}\n\n/**\n * 设置关系,父子和兄弟\n * @param parent\n * @param children\n * @param options\n * @returns {Xom|Text|Component}\n */\nfunction relation(parent, children, options = {}) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n relation(parent, item, options);\n });\n }\n else if(children instanceof Xom || children instanceof Component || children instanceof Text) {\n children.__parent = parent;\n children.__domParent = parent;\n // 极为恶心,为了v8的性能优化,text复用parent的__config部分,但domParent重设\n if(children instanceof Text) {\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n if(children.__config) {\n children.__config[NODE_DOM_PARENT] = parent;\n }\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n // 文字视作为父节点的直接文字子节点\n if(children instanceof Component) {\n let sr = children.shadowRoot;\n if(sr instanceof Text) {\n sr.__parent = parent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n sr.__domParent = parent;\n if(sr.__config) {\n sr.__config[NODE_DOM_PARENT] = parent;\n }\n }\n }\n return children;\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n initRoot,\n initDom,\n initCp,\n initCp2,\n relation,\n};\n","import util from './util';\n\nconst { isFunction } = util;\n\nclass Event {\n constructor() {\n this.__eHash = {};\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.on(id[i], handle);\n }\n }\n else {\n if(!self.__eHash.hasOwnProperty(id)) {\n self.__eHash[id] = [];\n }\n // 遍历防止此handle被侦听过了\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n if(item[i] === handle) {\n return self;\n }\n }\n self.__eHash[id].push(handle);\n }\n return self;\n }\n\n once(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n function cb(...data) {\n handle.apply(self, data);\n self.off(id, cb);\n }\n\n cb.__karasEventCb = handle;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.once(id[i], handle);\n }\n }\n else if(handle) {\n self.on(id, cb);\n }\n return this;\n }\n\n off(id, handle) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.off(id[i], handle);\n }\n }\n else if(self.__eHash.hasOwnProperty(id)) {\n if(handle) {\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n // 需考虑once包裹的引用对比\n if(item[i] === handle || item[i].__karasEventCb === handle) {\n item.splice(i, 1);\n break;\n }\n }\n }\n // 未定义为全部清除\n else {\n delete self.__eHash[id];\n }\n }\n return this;\n }\n\n emit(id, ...data) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.emit(id[i], data);\n }\n }\n else {\n if(self.__eHash.hasOwnProperty(id)) {\n let list = self.__eHash[id];\n if(list.length) {\n list = list.slice();\n for(let i = 0, len = list.length; i < len; i++) {\n let cb = list[i];\n if(isFunction(cb)) {\n cb.apply(self, data);\n }\n }\n }\n }\n }\n return this;\n }\n\n static mix(...obj) {\n for(let i = obj.length - 1; i >= 0; i--) {\n let o = obj[i];\n let event = new Event();\n o.__eHash = {};\n let fns = ['on', 'once', 'off', 'emit'];\n for(let j = fns.length - 1; j >= 0; j--) {\n let fn = fns[j];\n o[fn] = event[fn];\n }\n }\n }\n\n static REFRESH = 'refresh';\n static PAUSE = 'pause';\n static PLAY = 'play';\n static FRAME = 'frame';\n static FINISH = 'finish';\n static CANCEL = 'cancel';\n static BEGIN = 'begin';\n static END = 'end';\n}\n\nexport default Event;\n","import Node from './Node';\nimport Text from './Text';\nimport builder from '../util/builder';\nimport Event from '../util/Event';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport flatten from '../util/flatten';\nimport css from '../style/css';\nimport change from '../refresh/change';\n\nconst { isNil, isFunction, clone, extend } = util;\n\nconst REGISTER = {};\n\n/**\n * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归\n * 在check时树递归会用到,判断是否需要查找cp更新\n * @param cp\n */\nfunction setUpdateFlag(cp) {\n // 去重\n if(cp.__hasUpdate) {\n return;\n }\n cp.__hasUpdate = true;\n let host = cp.host;\n if(host) {\n setUpdateFlag(host);\n }\n}\n\nclass Component extends Event {\n constructor(props = {}) {\n super();\n this.__tagName = /(?:function|class)\\s+([\\w$]+)/.exec(this.constructor.toString())[1];\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__parent = null;\n this.__host = null;\n this.__ref = {};\n this.state = {};\n this.__isMounted = false;\n this.__taskList = [];\n }\n\n setState(n, cb) {\n let self = this;\n if(isNil(n)) {\n n = {};\n }\n else if(isFunction(n)) {\n return;\n }\n else {\n if(Object.keys(n).length === 0) {\n if(isFunction(cb)) {\n cb.call(self);\n }\n return;\n }\n let state = clone(self.state);\n n = extend(state, n);\n }\n let root = self.root;\n if(root && self.__isMounted) {\n // 一帧之内多次调用,需合并\n if(self.__nextState) {\n Object.assign(self.__nextState, n);\n self.__taskList.push(cb);\n }\n else {\n self.__nextState = n;\n self.__taskList = [cb];\n // 回调更新列表,before执行时splice出来供after执行,防止中途产生的后续setState干扰\n let list = [];\n let t = self.__task = {\n __before: () => {\n list = self.__taskList.splice(0);\n // 标识更新\n setUpdateFlag(this);\n },\n __after: () => {\n // self.__nextState = null; 由updater.js每次refresh前同步执行清空,这里不能异步清除,否则frame动画会乱序\n list.forEach(cb => {\n if(isFunction(cb)) {\n cb.call(self);\n }\n });\n },\n };\n root.addRefreshCp(t);\n }\n }\n // 构造函数中调用还未render,\n else if(isFunction(cb)) {\n self.state = n;\n cb.call(self);\n }\n }\n\n /**\n * build中调用初始化,json有值时是update过程才有,且处理过flatten\n * @param json\n * @private\n */\n __init(json) {\n this.__ref = {};\n let root = this.root;\n let cd = json || flatten(this.render());\n let sr = builder.initCp(cd, root, this);\n this.__cd = cd;\n if(sr instanceof Text) {\n // 文字视作为父节点的直接文字子节点,在builder里做\n }\n else if(sr instanceof Node) {\n let style = css.normalize(this.props.style);\n let keys = Object.keys(style);\n extend(sr.style, style, keys);\n extend(sr.currentStyle, style, keys);\n // 事件添加到sr\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n });\n }\n else if(!(sr instanceof Component)) {\n // 本身build是递归的,子cp已经初始化了\n throw new Error('Component render() must return a dom/text: ' + this);\n }\n // 自定义事件无视返回强制添加\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n k = k.slice(3);\n this.on(k, v);\n }\n });\n // shadow指向直接renderRoot,shadowRoot考虑到返回Component的递归即hoc高阶组件\n // host是直接所属,hostRoot同考虑到高阶组件\n this.__shadow = sr;\n sr.__host = this;\n // 递归下去,多层级时执行顺序由里到外,最终会被最上层执行替换\n while(sr instanceof Component) {\n sr.__hostRoot = this;\n sr.shadow.__host = sr;\n sr = sr.shadow;\n }\n this.__shadowRoot = sr;\n sr.__hostRoot = this;\n if(!this.__isMounted) {\n this.__isMounted = true;\n if(isFunction(this.componentDidMount)) {\n root.once(Event.REFRESH, () => {\n this.componentDidMount();\n });\n }\n }\n }\n\n render() {\n inject.warn('Component must implement render()');\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.__isDestroyed = true;\n this.__isMounted = false;\n if(isFunction(this.componentWillUnmount)) {\n this.componentWillUnmount();\n }\n this.root.delRefreshTask(this.__task);\n if(this.shadowRoot) {\n this.shadowRoot.__destroy();\n }\n this.__parent = null;\n }\n\n __emitEvent(e, force) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n return;\n }\n let res = sr.__emitEvent(e, force);\n if(res) {\n e.target = this;\n return true;\n }\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get shadow() {\n return this.__shadow;\n }\n\n get shadowRoot() {\n return this.__shadowRoot;\n }\n\n get root() {\n return this.__root;\n }\n\n get host() {\n return this.__host;\n }\n\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n get state() {\n return this.__state;\n }\n\n set state(v) {\n this.__state = v;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)) {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Component has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)\n || !obj.prototype || !(obj.prototype instanceof Component)) {\n throw new Error('Invalid param: Component register');\n }\n if(Component.hasRegister(name)) {\n throw new Error(`Component has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Component.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nObject.keys(change.GEOM).concat([\n 'x',\n 'y',\n 'ox',\n 'oy',\n 'sx',\n 'sy',\n // '__sx1',\n // '__sx2',\n // '__sx3',\n // '__sx4',\n // '__sx5',\n // '__sx6',\n // '__sy1',\n // '__sy2',\n // '__sy3',\n // '__sy4',\n // '__sy5',\n // '__sy6',\n 'width',\n 'height',\n 'outerWidth',\n 'outerHeight',\n 'clientWidth',\n 'clientHeight',\n 'offsetWidth',\n 'offsetHeight',\n 'style',\n 'animationList',\n 'animateStyle',\n 'currentStyle',\n 'computedStyle',\n 'currentProps',\n 'baseLine',\n 'virtualDom',\n 'mask',\n 'maskId',\n 'textWidth',\n 'content',\n 'lineBoxes',\n 'charWidthList',\n 'charWidth',\n '__layoutData',\n 'availableAnimating',\n 'effectiveAnimating',\n 'displayAnimating',\n 'visibilityAnimating',\n 'bbox',\n '__config',\n 'contentBoxList',\n 'listener',\n 'matrix',\n 'matrixEvent',\n]).forEach(fn => {\n Object.defineProperty(Component.prototype, fn, {\n get() {\n let sr = this.shadowRoot;\n if(sr) {\n return sr[fn];\n }\n },\n });\n});\n\n[\n '__layout',\n '__layoutAbs',\n '__layoutNone',\n '__tryLayInline',\n '__offsetX',\n '__offsetY',\n '__calAutoBasis',\n '__calMp',\n '__calAbs',\n '__renderAsMask',\n '__renderByMask',\n '__mp',\n 'animate',\n 'removeAnimate',\n 'clearAnimate',\n 'updateStyle',\n 'getBoundingClientRect',\n 'getComputedStyle',\n '__deepScan',\n 'clearCache',\n '__structure',\n '__modifyStruct',\n '__updateStruct',\n 'flowChildren',\n 'absChildren',\n '__isRealInline',\n '__calBasis',\n '__calMinMax',\n '__computeMeasure',\n 'appendChild',\n 'prependChild',\n 'insertBefore',\n 'insertAfter',\n 'removeChild',\n 'remove',\n].forEach(fn => {\n Component.prototype[fn] = function() {\n let sr = this.shadowRoot;\n if(sr && isFunction(sr[fn])) {\n return sr[fn].apply(sr, arguments);\n }\n };\n});\n\nexport default Component;\n","import unit from './unit';\nimport transform from './transform';\nimport enums from '../util/enums';\n\nconst { STYLE_KEY: { SCALE_X, SCALE_Y } } = enums;\nconst { PERCENT, NUMBER } = unit;\n\nfunction matrixResize(imgWidth, imgHeight, targetWidth, targetHeight, x, y, w, h) {\n if(imgWidth === targetWidth && imgHeight === targetHeight) {\n return;\n }\n let list = [\n [SCALE_X, [targetWidth / imgWidth, NUMBER]],\n [SCALE_Y, [targetHeight / imgHeight, NUMBER]],\n ];\n let tfo = transform.calOrigin([[0, PERCENT], [0, PERCENT]], w, h);\n tfo[0] += x;\n tfo[1] += y;\n return transform.calMatrixWithOrigin(list, tfo, w, h);\n}\n\nexport default {\n matrixResize,\n};\n","import border from './border';\nimport transform from './transform';\nimport mx from '../math/matrix';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\nimport unit from './unit';\nimport enums from '../util/enums';\nimport image from './image';\n\nconst {\n STYLE_KEY: {\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\nconst { clone, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { AUTO, PX, PERCENT, STRING, REM, VW, VH, 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 res.push(position[0] * Math.max(root.width, root.height) * 0.01);\n }\n else if(position[1] === VMIN) {\n res.push(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_FRAME_CB,\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_CAL_DIFF_TIME,\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') {\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') {\n let n = v[k].slice(0);\n n[0] = 100 + n[0] * percent;\n st.push([k, n]);\n }\n }\n });\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n for(let i = 0; i < 2; i++) {\n st[i][0] += v[i] * percent;\n }\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n if(v[0] !== 0) {\n st[0][0] += v[0] * percent;\n }\n if(v[1] !== 0) {\n st[1][0] += v[1] * percent;\n }\n }\n else if(k === BOX_SHADOW) {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n st[i][j] += v[i][j] * percent;\n }\n // rgba\n for(let j = 0; j < 4; j++) {\n st[i][4][j] += v[i][4][j] * percent;\n }\n }\n }\n else if(k === BACKGROUND_SIZE) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0][0] += v[i][0] * percent;\n item[1][0] += v[i][1] * percent;\n }\n });\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0] += v[i] * percent;\n }\n });\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n st.forEach((st2, i) => {\n let v2 = v[i];\n if(!v2) {\n return;\n }\n let [c, d, p, z] = v2;\n if(GRADIENT_TYPE.hasOwnProperty(st2.k)) {\n for(let i = 0, len = Math.min(st2.v.length, c.length); i < len; i++) {\n let a = st2.v[i];\n let b = c[i];\n a[0][0] += b[0][0] * percent;\n a[0][1] += b[0][1] * percent;\n a[0][2] += b[0][2] * percent;\n a[0][3] += b[0][3] * percent;\n if(a[1] && b[1]) {\n a[1][0] += b[1] * percent;\n }\n }\n if(st2.k === 'linear' && st2.d !== undefined && d !== undefined) {\n if(Array.isArray(d)) {\n st2.d[0] += d[0] * percent;\n st2.d[1] += d[1] * percent;\n st2.d[2] += d[2] * percent;\n st2.d[3] += d[3] * percent;\n }\n else {\n st2.d += d * percent;\n }\n }\n if(st2.k === 'radial') {\n if(st2.z !== undefined && z !== undefined) {\n st2.z[0] += z[0] * percent;\n st2.z[1] += z[1] * percent;\n st2.z[2] += z[2] * percent;\n st2.z[3] += z[3] * percent;\n st2.z[4] += z[4] * percent;\n }\n else if(st2.p !== undefined && p !== undefined) {\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n else if(st2.k === 'conic' && st2.d !== undefined && d !== undefined) {\n st2.d += d * percent;\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n // fill纯色\n else {\n st2[0] += c[0] * percent;\n st2[1] += c[1] * percent;\n st2[2] += c[2] * percent;\n st2[3] += c[3] * percent;\n }\n });\n }\n // color可能超限[0,255],但浏览器已经做了限制,无需关心\n else if(COLOR_HASH.hasOwnProperty(k)) {\n st = st[0];\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n else if(GEOM.hasOwnProperty(k)) {\n let st = style[k];\n let tagName = target.tagName;\n if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calIncrease)) {\n let fn = GEOM[k][tagName].calIncrease;\n if(target.isMulti) {\n style[k] = st.map((item, i) => {\n return fn(item, v[i], percent);\n });\n }\n else {\n style[k] = fn(st, v, percent);\n }\n }\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n let o2 = o[j];\n let n2 = n[j];\n if(!isNil(o2) && !isNil(n2)) {\n for(let k = 0, len3 = Math.min(o2.length, n2.length); k < len3; k++) {\n if(!isNil(o2[k]) && !isNil(n2[k])) {\n o2[k] += n2[k] * percent;\n }\n }\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n v.forEach((item, i) => {\n let st2 = st[i];\n if(!isNil(item) && !isNil(st2)) {\n for(let i = 0, len = Math.min(st2.length, item.length); i < len; i++) {\n let o = st2[i];\n let n = item[i];\n if(!isNil(o) && !isNil(n)) {\n st2[i] += n * percent;\n }\n }\n }\n });\n }\n else {\n v.forEach((item, i) => {\n if(!isNil(item) && !isNil(st[i])) {\n st[i] += item * percent;\n }\n });\n }\n }\n else {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n if(!isNil(o[j]) && !isNil(n[j])) {\n o[j] += n[j] * percent;\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(!isNil(st[0]) && !isNil(v[0])) {\n st[0] += v[0] * percent;\n }\n if(!isNil(st[1]) && !isNil(v[1])) {\n st[1] += v[1] * percent;\n }\n }\n else {\n if(!isNil(st) && !isNil(v)) {\n style[k] += v * percent;\n }\n }\n }\n }\n else if(k === OPACITY || k === Z_INDEX) {\n style[k] += v * percent;\n // 精度问题可能会超过[0,1]区间\n if(k === OPACITY) {\n if(style[k] < 0) {\n style[k] = 0;\n }\n else if(style[k] > 1) {\n style[k] = 1;\n }\n }\n }\n }\n return style;\n}\n\nfunction gotoOverload(options, cb) {\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n return [options || {}, cb];\n}\n\nlet uuid = 0;\n\nclass Animation extends Event {\n constructor(target, list, options) {\n super();\n this.__id = uuid++;\n list = clone(list || []);\n if(Array.isArray(list)) {\n list = list.filter(item => item && isObject(item));\n }\n // 动画过程另外一种形式,object描述k-v形式\n else if(list && isObject(list)) {\n let nl = [];\n Object.keys(list).forEach(k => {\n let v = list[k];\n if(Array.isArray(v)) {\n for(let i = 0, len = v.length; i < len; i++) {\n let o = nl[i] = nl[i] || {\n offset: i / (len - 1),\n };\n o[k] = v[i];\n }\n }\n });\n list = nl;\n }\n else {\n list = [];\n }\n if(isNumber(options)) {\n this.__options = {\n duration: options,\n };\n options = this.__options;\n }\n let op = this.__options = options || {\n duration: 0,\n };\n let root = target.root;\n let config = this.__config = [\n false, // assigning\n false, // inFps\n false, // isDelay\n false, // begin\n false, // end\n false, // finished\n false, // nextBegin\n true, // firstPlay\n this.__frameCb,\n null, // playCb\n target,\n root,\n null, // frames\n null, // framesR\n 0, // currentTime\n 0, // nextTime\n {}, // style\n 0, // duration\n 1, // iterations\n 'none', // fill\n 1, // playbackRate\n 0, // playCount\n 'idle',\n false, // destroy\n 0, // startTime\n 0, // fpsTime\n op.easing,\n false, // enterFrame\n 0, // delay\n 0, // endDelay\n null, // keys,\n null, // originStyle,\n null, // currentFrames\n null, // currentFrame\n false, // spfLimit\n 60, // fps\n 'normal', // direction\n this.__calDiffTime,\n true, // firstEnter,\n false, // stayBegin\n false, // stayEnd\n false, // is2\n 0, // endTime\n target.__config, // nodeConfig\n root && root.__config, // rootConfig,destroy后root可能为空\n false, // outBeginDelay\n ];\n let iterations = this.iterations = op.iterations;\n let duration = this.duration = op.duration;\n let [frames, framesR, keys, originStyle] = this.__init(list, iterations, duration, op.easing, target);\n config[I_FRAMES] = frames;\n config[I_FRAMES_R] = framesR;\n config[I_KEYS] = keys;\n config[I_ORIGIN_STYLE] = originStyle;\n if(frames.length === 2) {\n config[I_IS2] = true;\n config[I_END_TIME] = frames[1][FRAME_TIME];\n }\n let fps = parseInt(op.fps) || 0;\n if(fps <= 0) {\n fps = 60;\n }\n this.fps = fps;\n this.spfLimit = op.spfLimit;\n this.delay = op.delay;\n this.endDelay = op.endDelay;\n this.playbackRate = op.playbackRate;\n this.fill = op.fill;\n this.iterations = op.iterations;\n this.direction = op.direction;\n config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(op.direction) ? framesR : frames;\n // 时间戳\n config[I_TIME_STAMP] = frame.__now;\n // 性能优化访问\n this[0] = this.__before;\n this[1] = this.__after;\n }\n\n __init(list, iterations, duration, easing, target) {\n if(list.length < 1) {\n return [[], [], [], {}];\n }\n // 过滤时间非法的,过滤后续offset<=前面的\n let offset = -1;\n let tagName = target.tagName;\n for(let i = 0, len = list.length; i < len; i++) {\n let current = list[i];\n if(current.hasOwnProperty('offset')) {\n current.offset = parseFloat(current.offset) || 0;\n current.offset = Math.max(0, current.offset);\n current.offset = Math.min(1, current.offset);\n // 超过区间[0,1]\n if(isNaN(current.offset) || current.offset < 0 || current.offset > 1) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n // <=前面的\n else if(current.offset <= offset) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n }\n // 缩写处理\n Object.keys(current).forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(current, k);\n }\n });\n // 检查key合法性\n Object.keys(current).forEach(k => {\n if(k !== 'easing' && k !== 'offset' && !change.isValid(tagName, k)) {\n delete current[k];\n }\n });\n }\n // 只有1帧复制出来变成2帧方便运行\n if(list.length === 1) {\n list[0] = clone(list[0]);\n if(list[0].offset === 1) {\n list.unshift({\n offset: 0,\n });\n }\n else {\n let copy = clone(list[0]);\n copy.offset = 1;\n list.push(copy);\n }\n }\n // 强制clone防止同引用\n else {\n list.forEach((item, i) => {\n list[i] = clone(item);\n });\n }\n // 首尾时间偏移强制为[0, 1],不是的话前后加空帧\n let first = list[0];\n if(first.hasOwnProperty('offset') && first.offset > 0) {\n first = {\n offset: 0,\n };\n list.unshift(first);\n }\n else {\n first.offset = 0;\n }\n let last = list[list.length - 1];\n if(last.hasOwnProperty('offset') && last.offset < 1) {\n last = {\n offset: 1,\n };\n list.push(last);\n }\n else {\n last.offset = 1;\n }\n // 计算没有设置offset的时间\n for(let i = 1, len = list.length; i < len; i++) {\n let start = list[i];\n // 从i=1开始offset一定>0,找到下一个有offset的,均分中间无声明的\n if(!start.hasOwnProperty('offset')) {\n let end;\n let j = i + 1;\n for(; j < len; j++) {\n end = list[j];\n if(end.hasOwnProperty('offset')) {\n break;\n }\n }\n let num = j - i + 1;\n start = list[i - 1];\n let per = (end.offset - start.offset) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.offset = start.offset + per * (k + 1 - i);\n }\n i = j;\n }\n }\n let frames = [];\n // 换算每一关键帧样式标准化\n list.forEach(item => {\n frames.push(framing(item, duration, easing));\n });\n // 为方便两帧之间计算变化,强制统一所有帧的css属性相同,没有写的为节点的当前样式currentStyle\n let keys = unify(frames, target);\n inherit(frames, keys, target);\n let framesR = clone(frames).reverse();\n // 存储原本样式以便恢复用\n let { style, props } = target;\n let originStyle = {};\n keys.forEach(k => {\n if(isGeom(tagName, k)) {\n originStyle[k] = props[k];\n }\n originStyle[k] = style[k];\n });\n // 再计算两帧之间的变化,存入transition属性\n let length = frames.length;\n let prev = frames[0];\n for(let i = 1; i < length; i++) {\n let next = frames[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n // 反向存储帧的倒排结果\n framesR.forEach(item => {\n item[FRAME_TIME] = duration - item[FRAME_TIME];\n item[FRAME_TRANSITION] = [];\n });\n prev = framesR[0];\n for(let i = 1; i < length; i++) {\n let next = framesR[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n return [frames, framesR, keys, originStyle];\n }\n\n __clean(isFinish) {\n let __config = this.__config;\n this.__cancelTask();\n __config[I_NEXT_TIME] = 0;\n let restore;\n let style = __config[I_STYLE];\n let keys = __config[I_KEYS];\n let target = __config[I_TARGET];\n if(isFinish) {\n __config[I_CURRENT_TIME] = __config[I_DELAY] + __config[I_DURATION] + __config[I_END_DELAY];\n if(__config[I_PLAY_STATE] === 'finish') {\n return;\n }\n __config[I_PLAY_STATE] = 'finish';\n // cancel需要清除finish根据情况保留\n if(!__config[I_STAY_END]) {\n __config[I_STYLE] = {};\n restore = true;\n }\n }\n else {\n __config[I_PLAY_COUNT] = __config[I_CURRENT_TIME] = 0;\n if(__config[I_PLAY_STATE] === 'idle') {\n return;\n }\n __config[I_PLAY_STATE] = 'idle';\n __config[I_STYLE] = {};\n restore = true;\n }\n // 动画取消结束不停留在最后一帧需要还原target原本的样式,需要对比目前是否是由本动画赋值的\n if(restore) {\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n if(target.__currentProps[k] === style[k]) {\n target.__currentProps[k] = target.props[k];\n }\n }\n else {\n if(target.__currentStyle[k] === style[k]) {\n target.__currentStyle[k] = target.style[k];\n }\n }\n });\n }\n }\n\n __frameCb(__config, diff, isDelay) {\n this.emit(Event.FRAME, diff, isDelay);\n if(__config[I_FIRST_PLAY]) {\n __config[I_FIRST_PLAY] = false;\n this.emit(Event.PLAY);\n }\n if(isFunction(__config[I_PLAY_CB])) {\n __config[I_PLAY_CB].call(this, diff, isDelay);\n __config[I_PLAY_CB] = null;\n }\n }\n\n __calDiffTime(__config, diff) {\n let playbackRate = __config[I_PLAYBACK_RATE];\n let spfLimit = __config[I_SPF_LIMIT];\n let fps = __config[I_FPS];\n let v = __config[I_CURRENT_TIME] = __config[I_NEXT_TIME];\n // 定帧限制每帧时间间隔最大为spf\n if(spfLimit) {\n if(spfLimit === true) {\n diff = Math.min(diff, 1000 / fps);\n }\n else if(spfLimit > 0) {\n diff = Math.min(diff, spfLimit);\n }\n }\n // 播放时间累加,并且考虑播放速度加成\n if(playbackRate !== 1 && playbackRate > 0) {\n diff *= playbackRate;\n }\n __config[I_NEXT_TIME] += diff;\n return [v, diff];\n }\n\n play(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n if(playState === 'running') {\n return this;\n }\n this.__cancelTask();\n __config[I_PLAY_CB] = cb;\n __config[I_PLAY_STATE] = 'running';\n // 每次play调用标识第一次运行,需响应play事件和回调\n __config[I_FIRST_PLAY] = true;\n // 防止finish/cancel事件重复触发,每次播放重置\n this.__hasFin = false;\n this.__hasCancel = false;\n // 只有第一次调用会进初始化,另外finish/cancel视为销毁也会重新初始化\n if(!__config[I_ENTER_FRAME]) {\n __config[I_ENTER_FRAME] = true;\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n // 初始化根据方向确定帧序列\n __config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction) ? framesR : frames;\n __config[I_CURRENT_TIME] = __config[I_NEXT_TIME] = __config[I_FPS_TIME] = 0;\n }\n // 添加每帧回调且立刻执行,本次执行调用refreshTask也是下一帧再渲染,frame的每帧都是下一帧\n frame.offFrame(this);\n frame.onFrame(this);\n __config[I_START_TIME] = frame.__now;\n __config[I_END] = false;\n return this;\n }\n\n __before(diff) {\n let __config = this.__config;\n __config[I_TIME_STAMP] = frame.__now;\n let target = __config[I_TARGET];\n let fps = __config[I_FPS];\n let playCount = __config[I_PLAY_COUNT];\n let currentFrames = __config[I_CURRENT_FRAMES];\n let iterations = __config[I_ITERATIONS];\n let stayBegin = __config[I_STAY_BEGIN];\n let stayEnd = __config[I_STAY_END];\n let delay = __config[I_DELAY];\n let root = __config[I_ROOT];\n let is2 = __config[I_IS2];\n let endTime = __config[I_END_TIME];\n let duration = __config[I_DURATION];\n let endDelay = __config[I_END_DELAY];\n let length = currentFrames.length;\n // 用本帧和上帧时间差,计算累加运行时间currentTime,以便定位当前应该处于哪个时刻\n let [currentTime, d] = __config[I_CAL_DIFF_TIME](__config, diff);\n diff = d;\n // 增加的fps功能,当<60时计算跳帧,每帧运行依旧累加时间,达到fps时重置,第一帧强制不跳\n if(!__config[I_FIRST_ENTER] && fps < 60) {\n diff = __config[I_FPS_TIME] += diff;\n if(diff < 1000 / fps) {\n __config[I_IN_FPS] = true;\n return;\n }\n __config[I_FPS_TIME] = 0;\n }\n __config[I_FIRST_ENTER] = false;\n // delay仅第一次生效\n if(playCount === 0 && currentTime < delay) {\n if(stayBegin) {\n let currentFrame = __config[I_CURRENT_FRAME] = currentFrames[0];\n let current = currentFrame[FRAME_STYLE];\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n }\n // 即便不刷新,依旧执行帧回调,同时标明让后续第一帧响应begin\n __config[I_OUT_BEGIN_DELAY] = true;\n __config[I_IS_DELAY] = true;\n return;\n }\n // 减去delay,计算在哪一帧,仅首轮\n if(playCount === 0) {\n currentTime -= delay;\n }\n if(currentTime === 0 || __config[I_OUT_BEGIN_DELAY]) {\n __config[I_OUT_BEGIN_DELAY] = false;\n __config[I_BEGIN] = true;\n }\n // 超过duration非尾轮需处理回到开头,触发新一轮动画事件,这里可能时间间隔非常大直接跳过几轮\n let round;\n while(currentTime >= duration && playCount < iterations - 1) {\n currentTime -= duration;\n __config[I_NEXT_TIME] -= duration;\n playCount = ++__config[I_PLAY_COUNT];\n __config[I_BEGIN] = true;\n round = true;\n }\n // 如果发生轮换,需重新确定正反向\n if(round) {\n let direction = __config[I_DIRECTION];\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let isAlternate = {\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction);\n // 有正反向播放需要重设帧序列\n if(isAlternate) {\n let isEven = playCount % 2 === 0;\n if(direction === 'alternate') {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n }\n let isLastCount = playCount >= iterations - 1;\n // 只有2帧可优化,否则2分查找当前帧\n let i, frameTime;\n if(is2) {\n i = currentTime < endTime ? 0 : 1;\n frameTime = endTime;\n }\n else {\n i = binarySearch(0, length - 1, currentTime, currentFrames);\n frameTime = currentFrames[i][FRAME_TIME];\n }\n // 最后一帧结束动画,仅最后一轮才会进入,需处理endDelay\n let isLastFrame = isLastCount && i === length - 1;\n let percent = 0;\n if(isLastFrame) {\n // 无需任何处理\n }\n // 否则根据目前到下一帧的时间差,计算百分比,再反馈到变化数值上\n else if(is2) {\n percent = currentTime / duration;\n }\n else {\n let total = currentFrames[i + 1][FRAME_TIME] - frameTime;\n percent = (currentTime - frameTime) / total;\n }\n let inEndDelay, currentFrame = currentFrames[i], current;\n __config[I_CURRENT_FRAME] = currentFrame;\n /** 这里要考虑全几种场景:\n * 1. 单次播放无endDelay且fill不停留(有/无差异,下同)\n * 2. 单次播放无endDelay且fill停留\n * 3. 单次播放有endDelay且fill不停留\n * 4. 单次播放有endDelay且fill停留\n * 5. 多次播放无endDelay且fill不停留(尾次/非尾次,下同)\n * 6. 多次播放无endDelay且fill停留\n * 7. 多次播放有endDelay且fill不停留\n * 8. 多次播放有endDelay且fill停留\n */\n let needClean;\n if(isLastFrame) {\n inEndDelay = currentTime < duration + endDelay;\n // 停留对比最后一帧,endDelay可能会多次进入这里,第二次进入样式相等不再重绘\n if(stayEnd) {\n current = cloneStyle(currentFrame[FRAME_STYLE], __config[I_KEYS]);\n }\n // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里\n else {\n current = cloneStyle(__config[I_ORIGIN_STYLE], __config[I_KEYS]);\n }\n // 进入endDelay或结束阶段触发end事件,注意只触发一次,防重在触发的地方做\n __config[I_NEXT_END] = true;\n if(!inEndDelay) {\n __config[I_PLAY_COUNT]++;\n __config[I_FINISHED] = true;\n frame.offFrame(this);\n needClean = true;\n __config[I_NEXT_TIME] = 0;\n }\n }\n else {\n current = calIntermediateStyle(currentFrame, __config[I_KEYS], percent, target);\n }\n // 无论两帧之间是否有变化,都生成计算结果赋给style,去重在root做\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n if(needClean) {\n 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 __config[I_FRAME_CB].call(this, __config, diff, __config[I_IS_DELAY]);\n __config[I_IS_DELAY] = false;\n if(__config[I_BEGIN]) {\n __config[I_BEGIN] = false;\n this.emit(Event.BEGIN, __config[I_PLAY_COUNT]);\n }\n // end事件只触发一次,末轮进入endDelay或直接结束时\n if(__config[I_NEXT_END] && !__config[I_END]) {\n __config[I_END] = true;\n this.emit(Event.END, __config[I_PLAY_COUNT] - 1);\n }\n if(__config[I_FINISHED]) {\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n __config[I_PLAY_STATE] = 'finished';\n this.emit(Event.FINISH);\n }\n }\n\n pause(silence) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let { pending } = this;\n if(isDestroyed || duration <= 0 || pending) {\n return this;\n }\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(!silence) {\n this.emit(Event.PAUSE);\n }\n return this;\n }\n\n resume(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n if(isDestroyed || duration <= 0 || playState !== 'paused') {\n return this;\n }\n return this.play(cb);\n }\n\n finish(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1 || playState === 'finished' || playState === 'idle') {\n return self;\n }\n // 先清除所有回调任务,多次调用finish也会清除只留最后一次\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n let current;\n // 停留在最后一帧\n if(__config[I_STAY_END]) {\n __config[I_CURRENT_FRAME] = frames[frames.length - 1];\n current = frames[frames.length - 1][FRAME_STYLE];\n }\n else {\n current = originStyle;\n }\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(current, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean(true);\n },\n __after(diff) {\n if(!self.__hasFin) {\n self.__hasFin = true;\n __config[I_ASSIGNING] = false;\n __config[I_FRAME_CB].call(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.FINISH);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n cancel(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || playState === 'idle' || frames.length < 1) {\n return self;\n }\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(originStyle, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean();\n },\n __after(diff) {\n if(!self.__hasCancel) {\n self.__hasCancel = true;\n __config[I_ASSIGNING] = false;\n __config[I_FRAME_CB].call(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.CANCEL);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n gotoAndPlay(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n // 计算出时间点直接累加播放\n this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n return this.play(cb);\n }\n\n gotoAndStop(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n v = this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n // 先play一帧,回调里模拟暂停\n return this.play(diff => {\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isFunction(cb)) {\n cb.call(this, diff);\n }\n });\n }\n\n // 同步赋予,用在extendAnimate\n assignCurrentStyle() {\n let __config = this.__config;\n let style = __config[I_STYLE];\n let target = __config[I_TARGET];\n let keys = __config[I_KEYS];\n keys.forEach(i => {\n if(style.hasOwnProperty(i)) {\n let v = style[i];\n // geom的属性变化\n if(GEOM.hasOwnProperty(i)) {\n target.currentProps[i] = v;\n }\n // 样式\n else {\n // 将动画样式直接赋给currentStyle\n target.currentStyle[i] = v;\n }\n }\n });\n }\n\n __goto(v, isFrame, excludeDelay) {\n let __config = this.__config;\n let duration = __config[I_DURATION];\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isNaN(v) || v < 0) {\n throw new Error('Param of gotoAnd(Play/Stop) is illegal: ' + v);\n }\n if(isFrame) {\n v = (v - 1) / this.spf;\n }\n if(excludeDelay) {\n v += __config[I_DELAY];\n }\n // 超过一轮去掉delay\n if(v > duration + __config[I_DELAY]) {\n v -= __config[I_DELAY];\n }\n // 超过时间长度需要累加次数\n __config[I_PLAY_COUNT] = 0;\n while(v > duration && __config[I_PLAY_COUNT] < __config[I_ITERATIONS] - 1) {\n __config[I_PLAY_COUNT]++;\n v -= duration;\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n __config[I_NEXT_TIME] = v;\n // 防止play()重置时间和当前帧组,提前计算好\n __config[I_ENTER_FRAME] = true;\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n if({\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction)) {\n let isEven = __config[I_PLAY_COUNT] % 2 === 0;\n if(direction === 'alternate') {\n __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n return v;\n }\n\n addControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.add(this);\n }\n }\n\n removeControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.remove(this);\n }\n }\n\n __stayBegin() {\n return {\n backwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __stayEnd() {\n return {\n forwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __setTarget(target) {\n this.__target = target;\n this.__config[I_TARGET] = target;\n this.__config[I_NODE_CONFIG] = target.__config;\n }\n\n __cancelTask() {\n frame.offFrame(this);\n this.__config[I_PLAY_CB] = null;\n }\n\n __destroy(sync) {\n let self = this;\n let __config = self.__config;\n if(__config[I_DESTROYED]) {\n return;\n }\n self.removeControl();\n // clean异步执行,因为里面的样式还原需要等到下一帧,否则同步执行清除后,紧接着的新同步动画获取不到currentStyle\n if(sync) {\n self.__clean();\n __config[I_TARGET] = null;\n }\n else {\n frame.nextFrame({\n __before() {\n self.__clean();\n __config[I_TARGET] = null;\n },\n });\n }\n __config[I_START_TIME] = 0;\n __config[I_DESTROYED] = true;\n }\n\n __checkModify() {\n let __config = this.__config;\n if(__config[I_PLAY_STATE] !== 'idle' && __config[I_PLAY_STATE] !== 'finished') {\n inject.warn('Modification will not come into effect when animation is running');\n }\n }\n\n get id() {\n return this.__id;\n }\n\n get target() {\n return this.__config[I_TARGET];\n }\n\n get root() {\n return this.__config[I_ROOT];\n }\n\n get keys() {\n return this.__config[I_KEYS];\n }\n\n get style() {\n return this.__config[I_STYLE];\n }\n\n get options() {\n return this.__options;\n }\n\n get duration() {\n return this.__config[I_DURATION];\n }\n\n set duration(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DURATION] !== v) {\n __config[I_DURATION] = v;\n __config[I_END_TIME] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get delay() {\n return this.__config[I_DELAY];\n }\n\n set delay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DELAY] !== v) {\n __config[I_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get endDelay() {\n return this.__config[I_END_DELAY];\n }\n\n set endDelay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_END_DELAY] !== v) {\n __config[I_END_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get fps() {\n return this.__config[I_FPS];\n }\n\n set fps(v) {\n v = parseInt(v) || 60;\n let __config = this.__config;\n if(__config[I_FPS] !== v) {\n if(v <= 0) {\n v = 60;\n }\n __config[I_FPS] = v;\n }\n return v;\n }\n\n get spf() {\n return 1 / this.fps;\n }\n\n get iterations() {\n return this.__config[I_ITERATIONS];\n }\n\n set iterations(v) {\n if(v === Infinity || util.isString(v) && v.toLowerCase() === 'infinity') {\n v = Infinity;\n }\n else {\n v = parseInt(v);\n if(isNaN(v) || v < 0) {\n v = 1;\n }\n }\n let __config = this.__config;\n if(__config[I_ITERATIONS] !== v) {\n __config[I_ITERATIONS] = v;\n }\n return v;\n }\n\n get fill() {\n return this.__config[I_FILL];\n }\n\n set fill(v) {\n v = v || 'none';\n let __config = this.__config;\n if(__config[I_FILL] !== v) {\n __config[I_FILL] = v;\n this.__checkModify();\n }\n __config[I_STAY_BEGIN] = {\n backwards: true,\n both: true,\n }.hasOwnProperty(v);\n __config[I_STAY_END] = {\n forwards: true,\n both: true,\n }.hasOwnProperty(v);\n return v;\n }\n\n get direction() {\n return this.__config[I_DIRECTION];\n }\n\n set direction(v) {\n v = v || 'normal';\n let __config = this.__config;\n if(__config[I_DIRECTION] !== v) {\n __config[I_DIRECTION] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get frames() {\n return this.__config[I_FRAMES];\n }\n\n get framesR() {\n return this.__config[I_FRAMES_R];\n }\n\n get playbackRate() {\n return this.__config[I_PLAYBACK_RATE];\n }\n\n set playbackRate(v) {\n v = parseFloat(v) || 1;\n if(v <= 0) {\n v = 1;\n }\n let __config = this.__config;\n if(__config[I_PLAYBACK_RATE] !== v) {\n __config[I_PLAYBACK_RATE] = v;\n }\n return v;\n }\n\n get easing() {\n return this.__config[I_EASING];\n }\n\n get startTime() {\n return this.__config[I_START_TIME];\n }\n\n get currentTime() {\n return this.__config[I_CURRENT_TIME];\n }\n\n set currentTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_CURRENT_TIME] !== v) {\n __config[I_CURRENT_TIME] = v;\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get nextTime() {\n return this.__config[I_NEXT_TIME];\n }\n\n set nextTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_NEXT_TIME] !== v) {\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get timestamp() {\n return this.__config[I_TIME_STAMP];\n }\n\n get pending() {\n return this.__config[I_PLAY_STATE] !== 'running';\n }\n\n get finished() {\n return this.__config[I_PLAY_STATE] === 'finished';\n }\n\n get playState() {\n return this.__config[I_PLAY_STATE];\n }\n\n get playCount() {\n return this.__config[I_PLAY_COUNT];\n }\n\n set playCount(v) {\n v = Math.max(0, parseInt(v) || 0);\n let __config = this.__config;\n if(__config[I_PLAY_COUNT] !== v) {\n __config[I_PLAY_COUNT] = v;\n }\n return v;\n }\n\n get isDestroyed() {\n return this.__config[I_DESTROYED];\n }\n\n get animating() {\n let __config = this.__config;\n let playState = __config[I_PLAY_STATE];\n if(playState === 'idle') {\n return false;\n }\n return playState !== 'finished' || __config[I_STAY_END] || __config[I_STAY_BEGIN];\n }\n\n get spfLimit() {\n let __config = this.__config;\n return __config[I_SPF_LIMIT];\n }\n\n set spfLimit(v) {\n if(util.isNumber(v) || /^\\d/.test(v)) {\n v = Math.max(0, parseInt(v) || 0);\n }\n else {\n v = !!v;\n }\n let __config = this.__config;\n if(__config[I_SPF_LIMIT] !== v) {\n __config[I_SPF_LIMIT] = v;\n }\n return v;\n }\n\n get assigning() {\n return this.__config[I_ASSIGNING];\n }\n}\n\nexport default Animation;\n","import mode from '../node/mode';\nimport geom from '../math/geom';\nimport blur from '../math/blur';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\n\nconst {\n NODE_KEY: {\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { int2rgba } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nfunction renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h, 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 } = 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, isDirectItem) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w, !isDirectItem)\n + this.__calMp(marginRight, w, !isDirectItem)\n + this.__calMp(paddingLeft, w, !isDirectItem)\n + this.__calMp(paddingRight, w, !isDirectItem);\n if(borderLeftWidth[1] === PX) {\n mp += borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n mp += borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n mp += borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n mp += borderLeftWidth[0] * this.root.height * 0.01;\n }\n 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 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;\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 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.tagName === 'img') && marginLeft[1] === AUTO && marginRight[1] === AUTO) {\n let ow = this.outerWidth;\n if(ow < data.w) {\n this.__offsetX((data.w - ow) * 0.5, true);\n }\n }\n }\n\n __calMatrix(lv, __cacheStyle, currentStyle, computedStyle, __config, sx1, sy1, offsetWidth, offsetHeight) {\n if(__config[NODE_IS_INLINE]) {\n computedStyle[TRANSFORM_ORIGIN] = [sx1, sy1];\n return __cacheStyle[MATRIX] = mx.identity();\n }\n let matrixCache = __cacheStyle[MATRIX];\n // tx/ty变化特殊优化\n if(matrixCache && lv < REFLOW && !contain(lv, TF)) {\n let x = 0, y = 0, z = 0;\n if(contain(lv, TX)) {\n let v = currentStyle[TRANSLATE_X];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else 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 * @param lv\n * @param ctx canvas/svg/webgl共用\n * @param cache 是否是局部根节点缓存模式下的绘制\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 this.__bbox = null;\n if(isDestroyed) {\n return { isDestroyed, break: true };\n }\n let virtualDom;\n // svg设置vd上的lv属性标明lineHeight的话,另外特殊字体如arial拥有lineGap也会产生间隙,背景色不绘制这个间隙\n * x轴根据contentBox的范围坐标,y则固定和font/lineHeight相关\n * 圆角发生在首尾lineBox处,中间不会有,bgi则产生类似bgc作为mask的效果\n * 另外要注意多个时的顺序,必须依次渲染,后面的bb可能会覆盖前面行的\n */\n if(isRealInline) {\n let contentBoxList = this.contentBoxList;\n let length = contentBoxList.length;\n let hasBgi = backgroundImage.some(item => item);\n if(length) {\n let {\n [FONT_SIZE]: fontSize,\n [FONT_FAMILY]: fontFamily,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let iw = 0, ih = 0;\n let offscreen, svgBgSymbol = [];\n // bgi视作inline排满一行绘制,然后按分行拆开给每行\n if(hasBgi) {\n iw = inline.getInlineWidth(this, contentBoxList);\n ih = lineHeight;\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n iw += paddingLeft + paddingRight;\n ih += paddingTop + paddingBottom;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n iw += paddingLeft + paddingRight + borderLeftWidth + borderRightWidth;\n ih += paddingTop + paddingBottom + borderTopWidth + borderBottomWidth;\n }\n if(renderMode === CANVAS || renderMode === WEBGL) {\n offscreen = inject.getCacheCanvas(iw, ih, '__$$INLINE_BGI$$__');\n }\n let length = backgroundImage.length;\n backgroundImage.slice(0).reverse().forEach((bgi, i) => {\n if(!bgi) {\n return;\n }\n i = length - 1 - i;\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i];\n if(loadBgi.url === backgroundImage[i]) {\n let uuid = bg.renderImage(this, renderMode, offscreen && offscreen.ctx || ctx, loadBgi,\n 0, 0, iw, ih, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, true, 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.delRefreshTask(this.__loadBgi.cb);\n root.delRefreshTask(this.__task);\n this.__task = null;\n this.__root = null;\n this.clearCache();\n }\n\n // 先查找到注册了事件的节点,再捕获冒泡判断增加性能\n __emitEvent(e, force) {\n let { isDestroyed, computedStyle, isMask } = this;\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || e.__stopPropagation || isMask) {\n return;\n }\n let { event: { type } } = e;\n let { listener, __hasMask } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // touchmove之类强制的直接由Root通知即可\n if(force) {\n if(computedStyle[POINTER_EVENTS] !== 'none' && util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n // 非force的判断事件坐标是否在节点内\n if(this.willResponseEvent(e)) {\n // 如果有mask,点在mask上才行,点在clip外才行\n if(__hasMask) {\n let next = this.next;\n let isClip = next.isClip;\n let hasEmitMask;\n while(next && next.isMask) {\n if(next.willResponseEvent(e, true)) {\n hasEmitMask = true;\n break;\n }\n next = next.next;\n }\n if(!isClip && !hasEmitMask) {\n return;\n }\n }\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n\n willResponseEvent(e, ignore) {\n let { x, y } = e;\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent, computedStyle } = this;\n if(computedStyle[POINTER_EVENTS] === 'none') {\n return;\n }\n let inThis = geom.pointInQuadrilateral(\n x, y,\n __sx1, __sy1,\n __sx1 + offsetWidth, __sy1,\n __sx1 + offsetWidth, __sy1 + offsetHeight,\n __sx1, __sy1 + offsetHeight,\n matrixEvent\n );\n if(inThis) {\n if(!e.target && !ignore) {\n e.target = this;\n // 缓存target给move用\n if(e.event.type === 'touchstart') {\n this.root && (this.root.__touchstartTarget = this);\n }\n }\n return true;\n }\n }\n\n __gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi, 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(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, formatStyle);\n if(util.isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n // 传入格式化好key/value的样式\n updateFormatStyle(style, cb) {\n let node = this;\n let { root, __config } = node;\n if(root) {\n root.addRefreshTask(node.__task = {\n __before() {\n node.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(__config[NODE_IS_DESTROYED]) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n res[UPDATE_CONFIG] = __config;\n root.__addUpdate(node, __config, root, root.__config, res);\n },\n __after(diff) {\n if(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, style);\n if(util.isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n animate(list, options = {}) {\n let animation = new Animation(this, list, options);\n if(this.isDestroyed) {\n animation.__destroy(true);\n return animation;\n }\n this.animationList.push(animation);\n if(options.autoPlay === false) {\n return animation;\n }\n return animation.play();\n }\n\n removeAnimate(o) {\n if(o instanceof Animation) {\n let i = this.animationList.indexOf(o);\n if(i > -1) {\n o.cancel();\n o.__destroy();\n this.animationList.splice(i, 1);\n }\n }\n }\n\n clearAnimate() {\n this.animationList.splice(0).forEach(o => {\n o.cancel();\n o.__destroy();\n });\n }\n\n frameAnimate(cb) {\n if(util.isFunction(cb)) {\n let list = this.__frameAnimateList;\n // 防止重复\n for(let i = 0, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n return cb;\n }\n }\n let enter = {\n __after(diff) {\n cb(diff);\n },\n __karasFramecb: cb,\n };\n list.push(enter);\n frame.onFrame(enter);\n return cb;\n }\n }\n\n removeFrameAnimate(cb) {\n for(let i = 0, list = this.__frameAnimateList, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n list.splice(i, 1);\n frame.offFrame(cb);\n return;\n }\n }\n }\n\n clearFrameAnimate() {\n this.__frameAnimateList.splice(0).forEach(o => {\n frame.offFrame(o);\n });\n }\n\n __computeMeasure(renderMode, ctx, cb) {\n css.computeMeasure(this);\n if(util.isFunction(cb)) {\n cb(this);\n }\n }\n\n __deepScan(cb, options) {\n return cb(this, options);\n }\n\n // isLayout为false时,为relative/margin/flex/vertical等\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.__layoutData.x += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sx1 += diff;\n this.__sx2 += diff;\n this.__sx3 += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.__layoutData.y += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sy1 += diff;\n this.__sy2 += diff;\n this.__sy3 += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n }\n\n __resizeX(diff, lv) {\n this.computedStyle.width = this.__width += diff;\n this.__clientWidth += diff;\n this.__offsetWidth += diff;\n this.__outerWidth += diff;\n this.__layoutData.w += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __resizeY(diff, lv) {\n this.computedStyle.height = this.__height += diff;\n this.__clientHeight += diff;\n this.__offsetHeight += diff;\n this.__outerHeight += diff;\n this.__layoutData.h += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __spreadBbox(boxShadow) {\n let ox = 0, oy = 0;\n if(Array.isArray(boxShadow)) {\n boxShadow.forEach(item => {\n let [x, y, sigma, spread, , inset] = item;\n if(inset !== 'inset') {\n let d = blur.outerSize(sigma);\n d += spread;\n ox = Math.max(ox, x + d);\n oy = Math.max(oy, y + d);\n }\n });\n }\n return [ox, oy];\n }\n\n __releaseWhenEmpty(__cache) {\n if(__cache && __cache.available) {\n __cache.release();\n }\n return true;\n }\n\n getComputedStyle(key) {\n let computedStyle = this.computedStyle;\n let res = {};\n let keys;\n if(key) {\n if(Array.isArray(key)) {\n keys = key;\n }\n else {\n keys = [key];\n }\n keys = keys.map(s => {\n return STYLE_KEY[style2Upper(s)];\n });\n }\n else {\n keys = Object.keys(computedStyle);\n }\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n res[k] = computedStyle[k];\n }\n else {\n res[STYLE_RV_KEY[k]] = computedStyle[k];\n }\n });\n return res;\n }\n\n getBoundingClientRect() {\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent } = this;\n let p1 = point2d(mx.calPoint([__sx1, __sy1], matrixEvent));\n let p2 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1], matrixEvent));\n let p3 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1 + offsetHeight], matrixEvent));\n let p4 = point2d(mx.calPoint([__sx1, __sy1 + offsetHeight], matrixEvent));\n return {\n left: Math.min(p1[0], Math.min(p2[0], Math.min(p3[0], p4[0]))),\n top: Math.min(p1[1], Math.min(p2[1], Math.min(p3[1], p4[1]))),\n right: Math.max(p1[0], Math.max(p2[0], Math.max(p3[0], p4[0]))),\n bottom: Math.max(p1[1], Math.max(p2[1], Math.max(p3[1], p4[1]))),\n points: [p1, p2, p3, p4],\n };\n }\n\n // img和geom返回false,在inline布局时判断是否是真的inline\n __isRealInline() {\n return true;\n }\n\n remove(cb) {\n let self = this;\n if(self.isDestroyed) {\n inject.warn('Remove target is destroyed.');\n if(util.isFunction(cb)) {\n cb();\n }\n return;\n }\n let { root, domParent } = self;\n let target = self.isShadowRoot ? self.hostRoot : self;\n // 特殊情况连续append/remove时候,还未被添加进来找不到所以无需删除\n if(domParent.children.indexOf(target) === -1) {\n if(util.isFunction(cb)) {\n cb();\n }\n return;\n }\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n let pJson = domParent.__json;\n let i = pJson.children.indexOf(self.isShadowRoot ? self.hostRoot.__json : self.__json);\n let zChildren = domParent.zIndexChildren;\n let j = zChildren.indexOf(self.isShadowRoot ? self.hostRoot : self);\n if(i === -1 || j === -1) {\n throw new Error('Remove index Exception.')\n }\n pJson.children.splice(i, 1);\n domParent.children.splice(i, 1);\n zChildren.splice(j, 1);\n if(self.__prev) {\n self.__prev.__next = self.__next;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_REMOVE_DOM] = true;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after(diff) {\n self.isShadowRoot ? self.hostRoot.__destroy() : self.__destroy();\n if(util.isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get sx() {\n return this.__sx;\n }\n\n get sy() {\n return this.__sy;\n }\n\n get clientWidth() {\n return this.__clientWidth || 0;\n }\n\n get clientHeight() {\n return this.__clientHeight || 0;\n }\n\n get offsetWidth() {\n return this.__offsetWidth || 0;\n }\n\n get offsetHeight() {\n return this.__offsetHeight || 0;\n }\n\n get outerWidth() {\n return this.__outerWidth || 0;\n }\n\n get outerHeight() {\n return this.__outerHeight || 0;\n }\n\n // 不考虑margin的范围,>=REPAINT渲染或个别有影响的渲染改变(如blur)清空缓存\n get bbox() {\n if(!this.__bbox) {\n let {\n __sx1, __sy1, clientWidth, clientHeight,\n currentStyle: {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BOX_SHADOW]: boxShadow,\n },\n } = this;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n clientWidth += borderLeftWidth[0] + borderRightWidth[0];\n clientHeight += borderTopWidth[0] + borderBottomWidth[0];\n let half = 1;\n this.__bbox = [__sx1 - ox - half, __sy1 - oy - half, __sx1 + clientWidth + ox + half, __sy1 + clientHeight + oy + half];\n }\n return this.__bbox;\n }\n\n get listener() {\n return this.__listener;\n }\n\n get matrix() {\n return this.__config[NODE_MATRIX];\n }\n\n get matrixEvent() {\n return this.__config[NODE_MATRIX_EVENT];\n }\n\n get perspectiveMatrix() {\n return this.__config[NODE_PERSPECTIVE_MATRIX];\n }\n\n get style() {\n return this.__style;\n }\n\n get computedStyle() {\n return this.__computedStyle;\n }\n\n get animationList() {\n return this.__animationList;\n }\n\n get currentStyle() {\n return this.__currentStyle;\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get contentBoxList() {\n return this.__contentBoxList;\n }\n\n get baseLine() {\n return this.offsetHeight;\n }\n\n get firstBaseLine() {\n return this.offsetHeight;\n }\n\n get isMask() {\n return this.__isMask;\n }\n\n get isClip() {\n return this.__isClip;\n }\n\n 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 n = this.baseLine;\n // 只有1个也需要对齐,因为可能内嵌了空inline使得baseLine发生变化\n if(this.list.length) {\n this.list.forEach(item => {\n let m = item.baseLine;\n if(m !== n) {\n item.__offsetY(n - m);\n }\n });\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n /**\n * 防止非行首空inline,每当遇到inline就设置当前lineBox的lineHeight/baseLine,这样有最小值兜底\n * @param l\n * @param b\n * @private\n */\n __setLB(l, b) {\n this.__lineHeight = Math.max(l, this.__lineHeight);\n this.__baseLine = Math.max(b, this.__baseLine);\n }\n\n get list() {\n return this.__list;\n }\n\n get size() {\n return this.__list.length;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endY() {\n return this.y + this.height;\n }\n\n get width() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let first = list[0];\n let last = list[length - 1];\n let x1 = first.x;\n let dom = first instanceof TextBox ? first.parent.domParent : first.domParent;\n // 因为inline可以嵌套inline,所以一直向上查找到非inline为止,每层inline如果是首个则减去左侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [PADDING_LEFT]: paddingLeft,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[0]) {\n x1 -= marginLeft + borderLeftWidth + paddingLeft;\n }\n dom = dom.domParent;\n }\n let x2 = last.x + last.outerWidth;\n dom = last instanceof TextBox ? last.parent.domParent : last.domParent;\n // 同向上查非inline,每层inline如果是最后一个则加上右侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_RIGHT]: paddingRight,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[list.length - 1]) {\n x2 += marginRight + borderRightWidth + paddingRight;\n }\n dom = dom.domParent;\n }\n return x2 - x1;\n }\n return 0;\n }\n\n get height() {\n return this.lineHeight;\n }\n\n get baseLine() {\n let baseLine = 0;\n this.list.forEach(item => {\n baseLine = Math.max(baseLine, item.baseLine);\n });\n return Math.max(this.__baseLine, baseLine);\n }\n\n get lineHeight() {\n let lineHeight = 0;\n // 只有TextBox和InlineBlock\n this.list.forEach(item => {\n lineHeight = Math.max(lineHeight, item.outerHeight);\n });\n return Math.max(this.__lineHeight, lineHeight);\n }\n}\n\nexport default LineBox;\n","import LineBox from './LineBox';\n\n/**\n * 维护一个上下文的LineBox,向LineBox中添加Item以及新增下一行的LineBox,多个LineBox组成一个区域\n * 一个block/inlineBlock拥有一个本类对象,上下文即对应这个dom流,而inline则复用最近非inline父元素的\n * 同时LineBox可能连续也可能不连续,不连续的是中间有block之类的隔离开来\n */\nclass LineBoxManager {\n constructor(x, y, lineHeight, baseLine) {\n this.__x = this.__lastX = x; // last存储目前最后一行LineBox的结尾位置,供后续inline使用\n this.__y = this.__lastY = y;\n this.__maxX = x;\n this.__domList = [];\n this.__domStack = [];\n this.__list = []; // 包含若干LineBox\n this.__isNewLine = true; // 区域内是否是新行,容器dom(block)开头肯定是\n this.__lineHeight = lineHeight;\n this.__baseLine = baseLine;\n this.__isEnd = true; // 在dom中是否一个区域处在结尾,外部控制\n }\n\n /**\n * 每次换行时重新生成LineBox存入列表,同时由于flow流当前一定是流(dom)的结尾,设置isEnd\n * @returns {LineBox}\n */\n genLineBox(x, y) {\n let lineBox = new LineBox(x, y, this.__lineHeight, this.__baseLine);\n this.list.push(lineBox);\n this.__isEnd = true;\n return lineBox;\n }\n\n /**\n * inline的特殊调用,防止空内容但有mbp的inline不占位,放入一个有lineHeight的空lineBox\n * 只有新行开头时需要,后面的无论是否有内容都会影响lineHeight\n * @param x\n * @param y\n * @param l\n * @param b\n * @returns {LineBox}\n */\n genLineBoxByInlineIfNewLine(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseLine = Math.max(this.__baseLine, b);\n if(this.__isNewLine) {\n let lineBox = new LineBox(x, y, lineHeight, baseLine);\n this.list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n }\n\n setLbOrGenLineBoxByInline(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseLine = Math.max(this.__baseLine, b);\n let lineBox;\n let list = this.list;\n if(this.__isNewLine) {\n lineBox = new LineBox(x, y, lineHeight, baseLine);\n list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n else {\n let length = list.length;\n lineBox = list[length - 1];\n lineBox.__setLB(l, b);\n }\n }\n\n /**\n * 外部设置为结尾,如一个LineBox后出现一个block,此时会被隔断,不再作为流的末尾\n */\n setNotEnd() {\n this.__isEnd = false;\n }\n\n /**\n * 外部设置新行,下次新生成LineBox\n */\n setNewLine() {\n this.__isNewLine = true;\n }\n\n /**\n * 当前LineBox放入一个新项,当新行时(如第一行)产生一个新的LineBox并存入列表\n * 是否新区域和新行都是可以被外部控制,默认第一行是新\n * 当被隔断后会被外部重置新行,这样会生成新的来作为新加项的LineBox\n * 当换行时外部也会调用新行,这样再次添加Item时会自动生成新的LineBox而不是用之前的\n * @param o TextBox/Inline/InlineBlock\n * @param nextNewLine 是否设置newLine,标明下次添加新生成LineBox\n * @returns {LineBox}\n */\n addItem(o, nextNewLine) {\n let lineBox;\n if(this.__isNewLine) {\n this.__isNewLine = false;\n lineBox = this.genLineBox(o.x, o.y);\n }\n else {\n let list = this.list;\n let length = list.length;\n lineBox = list[length - 1];\n }\n // inline递归过程中所有inline父子顺序列表,每个dom都需要对当前内容保存\n this.__domStack.forEach(item => {\n item.__contentBoxList.push(o);\n });\n lineBox.add(o);\n // 设置结束x的位置给next的inline标记用,o可能是TextBox或inlineBlock,当next新行时注意位置\n if(nextNewLine) {\n this.__isNewLine = true;\n this.__lastX = o.x;\n this.__lastY = o.y + o.outerHeight;\n }\n else {\n this.__lastX = o.x + o.outerWidth;\n this.__lastY = o.y;\n }\n this.__maxX = Math.max(this.__maxX, o.x + o.outerWidth);\n return lineBox;\n }\n\n horizonAlign(w, textAlign) {\n this.list.forEach(lineBox => {\n let diff = w - lineBox.width;\n if(diff > 0) {\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n lineBox.__offsetX(diff);\n lineBox.list.forEach(item => {\n item.__offsetX(diff, true);\n });\n }\n });\n }\n\n verticalAlign() {\n this.list.forEach(lineBox => {\n lineBox.verticalAlign();\n });\n }\n\n addX(n) {\n this.__lastX += n;\n }\n\n /**\n * inline递归过程中布局调用,不断出入栈dom对象,获取当前行状态下有哪些dom还在\n * @param dom\n */\n pushContentBoxList(dom) {\n this.__domList.push(dom);\n this.__domStack.push(dom);\n }\n\n popContentBoxList() {\n this.__domStack.pop();\n }\n\n __offsetX(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetX(diff);\n });\n }\n\n __offsetY(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetY(diff);\n });\n }\n\n /**\n * inline的特殊调用,非行首无论是否有内容都设置lineBox的lineHeight\n * @param l\n * @param b\n * @private\n */\n setLbByInlineIfNotNewLine(l, b) {\n let length = this.list.length;\n if(length && !this.isNewLine) {\n this.list[length - 1].__setLB(l, b);\n }\n }\n\n get size() {\n return this.list.length;\n }\n\n get lastX() {\n return this.__lastX;\n }\n\n get lastY() {\n return this.__lastY;\n }\n\n get endY() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[length - 1].endY;\n }\n return this.__y;\n }\n\n get isEnd() {\n return this.__isEnd;\n }\n\n get isNewLine() {\n return this.__isNewLine;\n }\n\n get breakLine() {\n return this.list.length > 1;\n }\n\n get domList() {\n return this.__domList;\n }\n\n get baseLine() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let n = 0;\n for(let i = 0; i < length - 1; i++) {\n n += list[i].height;\n }\n return n + list[length - 1].baseLine;\n }\n return 0;\n }\n\n get firstBaseLine() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[0].baseLine;\n }\n return 0;\n }\n\n get lineHeight() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1].lineHeight;\n }\n return 0;\n }\n\n get lineBox() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1];\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get width() {\n let w = 0;\n this.list.forEach(item => {\n w = Math.max(w, item.width);\n });\n return w;\n }\n}\n\nexport default LineBoxManager;\n","const TAG_NAME = {\n 'div': true,\n 'p': true,\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst INLINE = {\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst BOLD = {\n 'b': true,\n 'strong': true,\n}\n\nexport default {\n TAG_NAME,\n INLINE,\n BOLD,\n};\n","import enums from '../util/enums';\nimport unit from '../style/unit';\nimport level from './level';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n TOP,\n BOTTOM,\n POSITION,\n HEIGHT,\n },\n} = enums;\nconst { AUTO, PX, PERCENT } = unit;\nconst { REFLOW } = level;\n\nfunction offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) {\n if(dy) {\n let last;\n do {\n // component的sr没有next兄弟,视为component的next\n while(node.isShadowRoot) {\n node = node.host;\n }\n last = node;\n let isContainer, parent = node.domParent;\n if(parent) {\n let cs = parent.computedStyle;\n let ps = cs[POSITION];\n isContainer = parent === root || parent.isShadowRoot || ps === 'relative' || ps === 'absolute';\n }\n // 先偏移next,忽略有定位的absolute,本身非container也忽略\n let next = node.next;\n let container;\n while(next) {\n if(next.currentStyle[DISPLAY] !== 'none') {\n if(next.currentStyle[POSITION] === 'absolute') {\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = next.currentStyle;\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO || bottom[1] === PX) {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n }\n else if(top[1] === PERCENT) {\n let v = top[0] * 0.01 * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, null, next);\n }\n else {\n if(!container) {\n container = parent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, next]);\n }\n }\n }\n else {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n }\n next = next.next;\n }\n // root本身没domParent\n if(!parent) {\n break;\n }\n node = parent;\n // parent判断是否要resize\n let { currentStyle } = node;\n let isAbs = currentStyle[POSITION] === 'absolute';\n let need;\n if(isAbs) {\n if(currentStyle[HEIGHT][1] === AUTO\n && (currentStyle[TOP][1] === AUTO || currentStyle[BOTTOM][1] === AUTO)) {\n need = true;\n }\n }\n // height不定则需要\n else if(currentStyle[HEIGHT][1] === AUTO) {\n need = true;\n }\n if(need) {\n node.__resizeY(dy, REFLOW);\n node.clearCache();\n }\n // abs或者高度不需要继续向上调整提前跳出\n else {\n break;\n }\n if(node === root) {\n break;\n }\n }\n while(true);\n // 最后一个递归向上取消总缓存,防止过程中重复next多次无用递归\n while(last) {\n last.clearCache(true);\n last = last.domParent;\n }\n }\n}\n\nfunction clearUniqueReflowId(hash) {\n for(let i in hash) {\n if(hash.hasOwnProperty(i)) {\n let { node } = hash[i];\n delete node.__uniqueReflowId;\n }\n }\n}\n\nfunction getMergeMarginTB(topList, bottomList) {\n let total = 0;\n let max = topList[0];\n let min = topList[0];\n topList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n bottomList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n // 正数取最大,负数取最小,正负则相加\n let diff = 0;\n if(max > 0 && min > 0) {\n diff = Math.max(max, min) - total;\n }\n else if(max < 0 && min < 0) {\n diff = Math.min(max, min) - total;\n }\n else if(max !== 0 || min !== 0) {\n diff = max + min - total;\n }\n return diff;\n}\n\nexport default {\n offsetAndResizeByNodeOnY,\n clearUniqueReflowId,\n getMergeMarginTB,\n};\n","import Xom from './Xom';\nimport Text from './Text';\nimport mode from './mode';\nimport LineBoxManager from './LineBoxManager';\nimport Component from './Component';\nimport tag from './tag';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport $$type from '../util/$$type';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport reflow from '../refresh/reflow';\nimport builder from '../util/builder';\nimport level from '../refresh/level';\n\nconst {\n STYLE_KEY: {\n POSITION,\n DISPLAY,\n FONT_WEIGHT,\n MARGIN_LEFT,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n PADDING_LEFT,\n PADDING_BOTTOM,\n PADDING_RIGHT,\n PADDING_TOP,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n TOP,\n RIGHT,\n BOTTOM,\n LEFT,\n WIDTH,\n HEIGHT,\n TEXT_ALIGN,\n FLEX_DIRECTION,\n FLEX_BASIS,\n FLEX_SHRINK,\n FLEX_GROW,\n ALIGN_SELF,\n ALIGN_ITEMS,\n JUSTIFY_CONTENT,\n Z_INDEX,\n WHITE_SPACE,\n LINE_HEIGHT,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n OVERFLOW,\n FONT_SIZE,\n // PERSPECTIVE,\n // TRANSFORM,\n },\n NODE_KEY: {\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_STRUCT,\n NODE_DOM_PARENT,\n NODE_IS_INLINE,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_ADD_DOM,\n UPDATE_CONFIG,\n UPDATE_MEASURE,\n },\n STRUCT_KEY: {\n STRUCT_NUM,\n STRUCT_LV,\n STRUCT_TOTAL,\n STRUCT_CHILD_INDEX,\n STRUCT_INDEX,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH, 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 // 只绝对值生效,%不生效,依旧要判断\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 if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n }\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n else if(display === 'block') {\n let countMin = 0, countMax = 0;\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n countMin = countMax = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n }\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n else {\n if(display === 'inlineBlock' || display === 'inline-block') {\n lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n }\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n if(isDirectionRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else if(isDirectionRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n });\n }\n }\n return [display, this.__addMp(isDirectionRow, w, currentStyle, [min, max])];\n }\n\n /**\n * flex布局时,计算basis尺寸,如果有固定声明则以其为标准,content为内容最大尺寸,auto依赖w/h或降级content\n * basis要考虑相加直接item的mpb,非绝对值单位以container为基准,basis为内容时为max值\n * item的孩子为孙子节点需递归,不参与basis计算,只参与min/max,尺寸和mpb均只考虑绝对值\n * 自动计算时影响尺寸的只有换行的text,以及一组inline,均按其中最大尺寸的一个计算\n * auto自动计算递归进行,如果是普通row方向,按最大text的charWidth为准\n * 如果是column方向,则虚拟布局后看text的height\n * 在abs下时进入特殊状态,无论是row/column,都会按row方向尝试最大尺寸,直到舞台边缘或容器声明的w折行\n * 返回b,声明则按css值,否则是auto/content\n * 返回min为最小宽度,遇到字符/inline则单列排版后需要的最大宽度\n * 返回max为最大宽度,理想情况一排最大值,在abs时isVirtual状态参与计算,文本抵达边界才进行换行\n * @param isDirectionRow\n * @param data\n * @param isVirtual abs非固定尺寸时先进行虚拟布局标识\n * @private\n */\n __calBasis(isDirectionRow, data, isVirtual) {\n css.computeReflow(this, this.isShadowRoot);\n let b = 0;\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h } = data;\n // 计算需考虑style的属性\n let {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n [FLEX_BASIS]: flexBasis,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content\n let isAuto = flexBasis[1] === AUTO;\n let isFixed = [PX, PERCENT, REM, VW, VH, 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 // flex的item还是flex时\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n }\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n // flex的item是block/inline时,inline也会变成block统一对待\n else {\n let countMin = 0, countMax = 0;\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n countMin = countMax = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n }\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n if(fixedSize) {\n max = Math.max(fixedSize, max);\n }\n if(isContent) {\n b = max;\n }\n // 直接item的mpb影响basis\n return this.__addMp(isDirectionRow, w, currentStyle, [b, min, max], true);\n }\n\n __layoutNone() {\n super.__layoutNone();\n let { children } = this;\n children.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n item.__layoutNone();\n }\n });\n }\n\n /**\n * block布局,本身固定尺寸优先,否则看内容从上往下从左往右flow流排布\n * 内部inline和inlineBlock组成LineBox,通过LineBoxManager来管理混排的现象\n * LineBoxManager只有block和inlineBlock内部生成,inline会复用最近父级的\n * 内部的block在垂直方向要考虑margin合并的问题,强制所有节点为bfc,精简逻辑\n * @param data\n * @param isVirtual abs无尺寸时提前虚拟布局计算尺寸\n * @private\n */\n __layoutBlock(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n // 虚线管理一个block内部的LineBox列表,使得inline的元素可以中途衔接处理折行\n // 内部维护inline结束的各种坐标来达到目的,遇到block时中断并处理换行坐标\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n // 因精度问题,统计宽度均从0开始累加每行,最后取最大值,仅在abs布局时isVirtual生效\n let maxW = 0;\n let cw = 0;\n // 连续block(flex相同,下面都是)的上下margin合并值记录,合并时从列表中取\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isImg = item.tagName === 'img';\n // 每次循环开始前,这次不是block的话,看之前遗留待合并margin,并重置\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n if(isXom) {\n // inline和inlineBlock的细节不同之处,ib除了w/h之外,更想像block一样占据一行\n // 比如2个inline前面占一半后面比一半多但还是会从一半开始然后第2行换行继续,但ib放不下则重开一行\n // inline和ib能互相嵌套,形成的LineBox中则是TextBox和节点混合\n if(isInlineBlock || isInline) {\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || isInline && whiteSpace === 'nowrap') {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager, // ib内部新生成会内部判断,这里不管统一传入\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样\n if(item.__isIbFull) {\n x = data.x;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // abs统计宽度\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下,内部判断了inline/ib,ib要考虑是否有width\n let fw = item.__tryLayInline(w + data.x - x, w);\n // 放得下继续,奇怪的精度问题,加上阈值\n if(fw >= (-1e-10)) {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n x = data.x;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n if(isVirtual) {\n cw += item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n // block/flex先处理之前可能遗留的最后一行LineBox,然后递归时不传lineBoxManager,其内部生成新的\n else {\n // 非开头,说明之前的text未换行,需要增加行数\n if(x !== data.x && flowChildren[i - 1] instanceof Text) {\n lineClampCount++;\n }\n x = data.x;\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n let isNone = item.currentStyle[DISPLAY] === 'none';\n // 自身无内容\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n y += item.outerHeight;\n lineBoxManager.__lastY = y;\n // absolute/flex前置虚拟计算\n if(isVirtual) {\n maxW = Math.max(maxW, item.outerWidth);\n cw = 0;\n }\n // 空block要留下轮循环看,除非是最后一个,此处非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n item.__offsetY(diff, true);\n y += diff;\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n }\n }\n // 文字和inline类似\n else {\n // lineClamp作用域为block下的inline(同LineBox上下文)\n if(lineClamp && lineClampCount >= lineClamp) {\n return;\n }\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.width;\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x);\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, item.width);\n cw = 0;\n }\n }\n if(isVirtual) {\n cw += item.width;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n });\n // 结束后如果是以LineBox结尾,则需要设置y到这里,否则流布局中block会设置\n // 当以block换行时,新行是true,否则是false即结尾\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n }\n let tw = this.__width = (fixedWidth || !isVirtual) ? w : maxW;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // 非abs提前的虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐\n if(!isVirtual) {\n lineBoxManager.verticalAlign();\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // 所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n this.__marginAuto(currentStyle, data);\n }\n }\n\n // 弹性布局时的计算位置\n __layoutFlex(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle, __flexLine } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n // 每次布局情况多行内容\n __flexLine.splice(0);\n let {\n [FLEX_DIRECTION]: flexDirection,\n [JUSTIFY_CONTENT]: justifyContent,\n [ALIGN_ITEMS]: alignItems,\n [LINE_CLAMP]: lineClamp,\n [FLEX_WRAP]: flexWrap,\n [ALIGN_CONTENT]: alignContent,\n [LINE_HEIGHT]: lineHeight,\n [TEXT_ALIGN]: textAlign,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n let maxX = 0;\n let isDirectionRow = ['column', 'column-reverse', 'columnReverse'].indexOf(flexDirection) === -1;\n // 计算伸缩基数\n let growList = [];\n let shrinkList = [];\n let basisList = [];\n let maxList = [];\n let minList = [];\n let orderChildren = genOrderChildren(flowChildren);\n orderChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n // abs虚拟布局计算时纵向也是看横向宽度\n let [b, min, max] = item.__calBasis(isVirtual ? true : isDirectionRow, { x, y, w, h }, isVirtual);\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += max;\n }\n else {\n maxX = Math.max(maxX, max);\n }\n return;\n }\n let { [FLEX_GROW]: flexGrow, [FLEX_SHRINK]: flexShrink } = currentStyle;\n computedStyle[FLEX_BASIS] = b;\n growList.push(flexGrow);\n shrinkList.push(flexShrink);\n // 根据basis不同,计算方式不同\n basisList.push(b);\n maxList.push(max);\n minList.push(min);\n }\n // 文本\n else {\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += item.textWidth;\n }\n else {\n maxX = Math.max(maxX, item.textWidth);\n }\n return;\n }\n growList.push(0);\n shrinkList.push(1);\n if(isDirectionRow) {\n let cw = item.charWidth;\n let tw = item.textWidth;\n basisList.push(tw);\n maxList.push(tw);\n minList.push(cw);\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n });\n let h = item.height;\n basisList.push(h);\n minList.push(h);\n }\n }\n });\n // abs时,只需关注宽度即可,无需真正布局\n if(isVirtual) {\n let tw = this.__width = Math.min(maxX, w);\n this.__ioSize(tw, this.height);\n return;\n }\n let containerSize = isDirectionRow ? w : h;\n let isMultiLine = flexWrap === 'wrap' || ['wrap-reverse', 'wrapReverse'].indexOf(flexWrap) > -1;\n /**\n * 判断是否需要分行,根据假设主尺寸来统计尺寸和计算,假设主尺寸是clamp(min_main_size, flex_base_size, max_main_size)\n * 当多行时,由于每行一定有最小限制,所以每行一般情况都不是shrink状态,\n * 但也有极端情况,比如一行只能放下1个元素时,且此元素比容器小,会是shrink\n */\n let line = [], sum = 0, hypotheticalList = [];\n basisList.forEach((item, i) => {\n let min = minList[i], max = maxList[i];\n let hypothetical;\n if(item < min) {\n hypothetical = min;\n }\n else if(item > max) {\n hypothetical = max;\n }\n else {\n hypothetical = item;\n }\n hypotheticalList.push(hypothetical);\n if(isMultiLine) {\n // 超过尺寸时,要防止sum为0即1个也会超过尺寸\n if(sum + hypothetical > containerSize) {\n if(sum) {\n __flexLine.push(line);\n line = [orderChildren[i]];\n sum = hypothetical;\n }\n else {\n line.push(orderChildren[i]);\n __flexLine.push(line);\n line = [];\n sum = 0;\n }\n }\n else {\n line.push(orderChildren[i]);\n sum += hypothetical;\n }\n }\n else {\n line.push(orderChildren[i]);\n }\n });\n if(line.length) {\n __flexLine.push(line);\n }\n let offset = 0, clone = { x, y, w, h };\n let maxCrossList = [];\n __flexLine.forEach(item => {\n let length = item.length;\n let end = offset + length;\n let [x1, y1, maxCross] = this.__layoutFlexLine(clone, isDirectionRow, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, orderChildren.slice(offset, end), item, textAlign,\n growList.slice(offset, end), shrinkList.slice(offset, end), basisList.slice(offset, end),\n hypotheticalList.slice(offset, end), minList.slice(offset, end));\n // 下一行/列更新坐标\n if(isDirectionRow) {\n clone.y = y1;\n }\n else {\n clone.x = x1;\n }\n x = Math.max(x, x1);\n y = Math.max(y, y1);\n maxCrossList.push(maxCross);\n offset += length;\n });\n let tw = this.__width = w;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // flexDirection当有reverse时交换每line的主轴序\n if(flexDirection === 'row-reverse' || flexDirection === 'rowReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = tw - item.outerWidth - (item.x - data.x) * 2;\n if(diff) {\n item.__offsetX(diff, true);\n }\n });\n });\n }\n else if(flexDirection === 'column-reverse' || flexDirection === 'columnReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = th - item.outerHeight - (item.y - data.y) * 2;\n if(diff) {\n item.__offsetY(diff, true);\n }\n });\n });\n }\n // wrap-reverse且多轴线时交换轴线序,需要2行及以上才行\n let length = __flexLine.length;\n if(['wrapReverse', 'wrap-reverse'].indexOf(flexWrap) > -1 && length > 1) {\n let crossSum = 0, crossSumList = [];\n maxCrossList.forEach(item => {\n crossSumList.push(crossSum);\n crossSum += item;\n });\n let count = 0;\n for(let i = length - 1; i >= 0; i--) {\n let line = __flexLine[i];\n let source = crossSumList[i];\n let diff = count - source;\n if(diff) {\n line.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n count += maxCrossList[i];\n }\n __flexLine.reverse();\n }\n // 侧轴对齐分flexLine做,要考虑整体的alignContent的stretch和每行的alignItems的stretch\n // 先做整体的,得出交叉轴空白再均分给每一行做单行的,整体的只有1行忽略\n let per;\n if(!isVirtual && length > 1 && (fixedHeight && isDirectionRow || !isDirectionRow)) {\n let diff = isDirectionRow ? th - (y - data.y) : tw - (x - data.x);\n // 有空余时才进行对齐\n if(diff > 0) {\n if(alignContent === 'center') {\n let per = diff * 0.5;\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per, true);\n }\n else {\n item.__offsetX(per, true);\n }\n });\n }\n else if(alignContent === 'flex-start' || alignContent === 'flexStart') {}\n else if(alignContent === 'flex-end' || alignContent === 'flexEnd') {\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n else if(alignContent === 'space-between' || alignContent === 'spaceBetween') {\n let between = diff / (length - 1);\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(between, true);\n }\n else {\n item.__offsetX(between, true);\n }\n });\n }\n });\n }\n else if(alignContent === 'space-around' || alignContent === 'spaceAround') {\n let around = diff / (length + 1);\n __flexLine.forEach((item, i) => {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(around * (i + 1), true);\n }\n else {\n item.__offsetX(around * (i + 1), true);\n }\n });\n });\n }\n // 默认stretch\n else {\n per = diff / length;\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per * i, true);\n }\n else {\n item.__offsetX(per * i, true);\n }\n });\n }\n });\n }\n }\n }\n // 每行再进行cross对齐,在alignContent为stretch时计算每行的高度\n if(!isVirtual) {\n if(length > 1) {\n __flexLine.forEach((item, i) => {\n let maxCross = maxCrossList[i];\n if(per) {\n maxCross += per;\n }\n this.__crossAlign(item, alignItems, isDirectionRow, maxCross);\n });\n }\n else if(length) {\n let maxCross = maxCrossList[0];\n if(isDirectionRow) {\n if(fixedHeight) {\n maxCross = h;\n }\n }\n else {\n maxCross = w;\n }\n this.__crossAlign(__flexLine[0], alignItems, isDirectionRow, maxCross);\n }\n }\n this.__marginAuto(currentStyle, data);\n }\n\n /**\n * 计算获取子元素的b/min/max完毕后,尝试进行flex每行布局\n * https://www.w3.org/TR/css-flexbox-1/#layout-algorithm\n * 假想主尺寸,其为clamp(min_main_size, flex_base_size, max_main_size)\n * 随后按算法一步步来 https://zhuanlan.zhihu.com/p/354567655\n * 规范没提到mpb,item的要计算,孙子的只考虑绝对值\n * 先收集basis和假设主尺寸\n */\n __layoutFlexLine(data, isDirectionRow, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, orderChildren, flexLine, textAlign,\n growList, shrinkList, basisList, hypotheticalList, minList) {\n let { x, y, w, h } = data;\n let hypotheticalSum = 0;\n hypotheticalList.forEach(item => {\n hypotheticalSum += item;\n });\n // 根据假设尺寸确定使用grow还是shrink,冻结非弹性项并设置target尺寸,确定剩余未冻结数量\n let isOverflow = hypotheticalSum >= containerSize;\n let targetMainList = [];\n basisList.forEach((item, i) => {\n if(isOverflow) {\n if(!shrinkList[i] || (basisList[i] < hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n else {\n if(!growList[i] || (basisList[i] > hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n });\n // 初始可用空间,冻结使用确定的target尺寸,未冻结使用假想\n let free = 0;\n basisList.forEach((item, i) => {\n if(targetMainList[i] !== undefined) {\n free += targetMainList[i];\n }\n else {\n free += item;\n }\n });\n let total = Infinity;\n if(isDirectionRow) {\n total = w;\n }\n else if(fixedHeight) {\n total = h;\n }\n else {\n total = free;\n }\n free = Math.abs(total - free);\n // 循环,文档算法不够简练,其合并了grow和shrink,实际拆开写更简单\n let factorSum = 0;\n if(isOverflow) {\n // 计算真正的因子占比,同时得出缩小尺寸数值\n // 还需判断每个item收缩不能 {\n if(targetMainList[i] === undefined) {\n let n = item * basisList[i];\n factorSum += n;\n return n;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要收缩的尺寸\n let n = basisList[i] - s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n else {\n let factorList = growList.map((item, i) => {\n if(targetMainList[i] === undefined) {\n factorSum += item;\n return item;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要扩展的尺寸\n let n = basisList[i] + s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n let maxCross = 0;\n let lbmList = [];\n orderChildren.forEach((item, i) => {\n let main = targetMainList[i];\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n if(isDirectionRow) {\n item.__layout({\n x,\n y,\n w: main,\n h,\n w3: main, // w3假设固定宽度,忽略原始style中的设置\n });\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h: main,\n h3: main, // 同w2\n });\n }\n }\n else {\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n lbmList.push(lineBoxManager);\n item.__layout({\n x,\n y,\n w: isDirectionRow ? main : w,\n h: isDirectionRow ? h : main,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n });\n }\n if(isDirectionRow) {\n x += item.outerWidth;\n maxCross = Math.max(maxCross, item.outerHeight);\n }\n else {\n y += item.outerHeight;\n maxCross = Math.max(maxCross, item.outerWidth);\n }\n });\n // 计算主轴剩余时要用真实剩余空间而不能用伸缩剩余空间\n let diff = isDirectionRow ? (w - x + data.x) : (h - y + data.y);\n // 主轴对齐方式\n if(diff > 0) {\n let len = orderChildren.length;\n if(justifyContent === 'flexEnd' || justifyContent === 'flex-end') {\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(diff, true) : child.__offsetY(diff, true);\n }\n }\n else if(justifyContent === 'center') {\n let center = diff * 0.5;\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(center, true) : child.__offsetY(center, true);\n }\n }\n else if(justifyContent === 'spaceBetween' || justifyContent === 'space-between') {\n let between = diff / (len - 1);\n for(let i = 1; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(between * i, true) : child.__offsetY(between * i, true);\n }\n }\n else if(justifyContent === 'spaceAround' || justifyContent === 'space-around') {\n let around = diff / (len + 1);\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(around * (i + 1), true) : child.__offsetY(around * (i + 1), true);\n }\n }\n }\n if(isDirectionRow) {\n y += maxCross;\n }\n else {\n x += maxCross;\n }\n // flex的直接text对齐比较特殊\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lbmList.forEach(item => {\n item.horizonAlign(item.width, textAlign);\n })\n }\n return [x, y, maxCross];\n }\n\n // 每个flexLine的侧轴对齐,单行时就是一行对齐\n __crossAlign(line, alignItems, isDirectionRow, maxCross) {\n let baseLine = 0;\n line.forEach(item => {\n baseLine = Math.max(baseLine, item.firstBaseLine);\n });\n line.forEach(item => {\n let { currentStyle: { [ALIGN_SELF]: alignSelf } } = item;\n if(isDirectionRow) {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [HEIGHT]: height } } = item;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = item.__height = computedStyle[HEIGHT] = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n else if(alignSelf === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [HEIGHT]: height,\n } } = item;\n // row的孩子还是flex且column且不定高时,如果高度<侧轴拉伸高度则重新布局\n if(isDirectionRow && display === 'flex' && flexDirection === 'column' && height[1] === AUTO && item.outerHeight < maxCross) {\n item.__layout(Object.assign(item.__layoutData, { h3: maxCross }));\n }\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n }\n }\n // column\n else {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [WIDTH]: width } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [WIDTH]: width,\n } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n }\n }\n });\n }\n\n /**\n * inline比较特殊,先简单顶部对其,后续还需根据vertical和lineHeight计算y偏移\n * inlineBlock复用逻辑,可以设置w/h,在混排时表现不同,inlineBlock换行限制在规定的矩形内,\n * 且ib会在没设置width且换行的时候撑满上一行,即便内部尺寸没抵达边界\n * 而inline换行则会从父容器start处开始,且首尾可能占用矩形不同\n * 嵌套inline情况十分复杂,尾部mpb空白可能产生叠加情况,因此endSpace表示自身,\n * 然后根据是否在最后一个元素进行叠加父元素的,多层嵌套则多层尾部叠加,均以最后一个元素为依据判断\n * Text获取这个叠加的endSpace值即可,无需感知是否最后一个,外层(此处)进行逻辑封装\n * @param data\n * @param isVirtual\n * @param isInline\n * @private\n */\n __layoutInline(data, isVirtual, isInline) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h, lx,\n lineBoxManager, nowrap, endSpace, selfEndSpace } = this.__preLayout(data, isInline);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n let {\n [WIDTH]: width,\n } = currentStyle;\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n } = computedStyle;\n let lineClampCount = data.lineClampCount || 0;\n if(isInline && !this.__isRealInline()) {\n isInline = false;\n }\n // 只有inline的孩子需要考虑换行后从行首开始,而ib不需要,因此重置行首标识lx为x,末尾空白为0\n // 而inline的LineBoxManager复用最近非inline父dom的,ib需要重新生成,末尾空白叠加\n if(isInline) {\n this.__config[NODE_IS_INLINE] = true;\n this.__lineBoxManager = lineBoxManager;\n let baseLine = css.getBaseLine(computedStyle);\n // 特殊inline调用,有内容的话(如左右mbp),默认生成一个lineBox,即便是空,也要形成占位,只有开头时需要\n if(marginLeft || marginRight\n || paddingLeft || paddingRight\n || borderLeftWidth || borderRightWidth) {\n if(lineBoxManager.isNewLine) {\n lineBoxManager.genLineBoxByInlineIfNewLine(x, y, lineHeight, baseLine);\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseLine);\n }\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseLine);\n }\n lineClamp = data.lineClamp || 0;\n }\n else {\n lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n lx = x;\n endSpace = selfEndSpace = lineClampCount = 0;\n }\n // 存LineBox里的内容列表专用,布局过程中由lineBoxManager存入,递归情况每个inline节点都保存contentBox\n let contentBoxList;\n if(isInline) {\n contentBoxList = this.__contentBoxList = [];\n lineBoxManager.pushContentBoxList(this);\n }\n let isIbFull = false; // ib时不限定w情况下发生折行则撑满行,即便内容没有撑满边界\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline2 = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock2 = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isRealInline = isXom && item.__isRealInline();\n // 最后一个元素会产生最后一行,叠加父元素的尾部mpb\n let isEnd = isInline && (i === length - 1);\n if(isEnd) {\n endSpace += selfEndSpace;\n }\n if(isXom) {\n if(!isInline2 && !isInlineBlock2) {\n item.currentStyle[DISPLAY] = item.computedStyle[DISPLAY] = 'inlineBlock';\n isInlineBlock2 = true;\n inject.warn('Inline can not contain block/flex');\n }\n // x开头,不用考虑是否放得下直接放,i为0强制不换行\n if(x === lx || !i || isInline2 && whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样\n if(item.__isIbFull) {\n isInlineBlock2 && (w[1] === AUTO) && (isIbFull = true);\n lineBoxManager.addItem(item);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中,以计算宽度\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n }\n else {\n // 不换行继续排,换行非开头先尝试是否放得下,结尾要考虑mpb因此减去endSpace\n let fw = (whiteSpace === 'nowrap') ? 0 : item.__tryLayInline(w - x + lx, w - (isEnd ? endSpace : 0));\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n nowrap: whiteSpace === 'nowrap',\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n isInline2 && lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n lineBoxManager.addItem(item);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n }\n }\n }\n // inline里的其它只有文本,可能开始紧跟着之前的x,也可能换行后从lx行头开始\n // 紧跟着x可能出现在前面有节点换行后第2行,此时不一定放得下,因此不能作为判断依据,开头仅有lx\n else {\n let n = lineBoxManager.size;\n // i为0时强制不换行\n if(x === lx || !i || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行,且非定宽\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n }\n else {\n // 非开头先尝试是否放得下,如果放得下再看是否end,加end且只有1个字时放不下要换行,否则可以放,换行由text内部做\n // 第一个Text且父元素声明了nowrap也强制不换行,非第一个则看本身whiteSpace声明\n let focusNoWrap = (!i && nowrap) || whiteSpace === 'nowrap';\n let fw = focusNoWrap ? 0 : item.__tryLayInline(w + lx - x);\n if(!focusNoWrap && fw >= 0 && isEnd && endSpace && item.content.length === 1) {\n let fw2 = fw - endSpace;\n if(fw2 < 0) {\n fw = fw2;\n }\n }\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // 这里ib放得下一定是要么没换行要么固定宽度,所以无需判断isIbFull\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n }\n }\n }\n });\n // 同block结尾,不过这里一定是lineBox结束,无需判断\n y = lineBoxManager.endY;\n // 标识ib情况同block一样占满行\n this.__isIbFull = isIbFull;\n // 元素的width在固定情况或者ibFull情况已被计算出来,否则为最大延展尺寸,inline没有固定尺寸概念\n let tw, th;\n if(isInline) {\n // inline最后的x要算上右侧mpb,为next行元素提供x坐标基准,同时其尺寸计算比较特殊\n if(selfEndSpace) {\n lineBoxManager.addX(selfEndSpace);\n }\n // 如果没有内容,空白还要加上开头即左侧mpb\n if(!flowChildren.length) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = computedStyle;\n lineBoxManager.addX(marginLeft + paddingLeft + borderLeftWidth);\n }\n // 结束出栈contentBox,递归情况结束子inline获取contentBox,父inline继续\n lineBoxManager.popContentBoxList();\n // abs非固定w时预计算,本来是最近非inline父层统一计算,但在abs时不算,\n if(isVirtual) {\n this.__inlineSize();\n }\n }\n else {\n // ib在满时很特殊,取最大值,可能w本身很小不足排下1个字符,此时要用maxW\n let maxW = lineBoxManager.__maxX - data.x;\n tw = this.__width = fixedWidth ? w : (isIbFull ? Math.max(w, maxW) : maxW);\n th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n }\n // 非abs提前虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐,inline会被父级调用这里只看ib\n if(!isVirtual && !isInline) {\n lineBoxManager.verticalAlign();\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // block的所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n }\n // inlineBlock新开上下文,但父级block遇到要处理换行\n return isInline ? lineClampCount : 0;\n }\n\n /**\n * inline的尺寸计算非常特殊,并非一个矩形区域,而是由字体行高结合节点下多个LineBox中的内容决定,\n * 且这个尺寸又并非真实LineBox中的内容直接合并计算而来,比如包含了个更大尺寸的ib却不会计入\n * 具体方法为遍历持有的LineBox下的内容,x取两侧极值,同时首尾要考虑mpb,y值取上下极值,同样首尾考虑mpb\n * 首尾行LineBox可能不是不是占满一行,比如前后都有同行inline的情况,非首尾行则肯定占满\n * 绘制内容(如背景色)的区域也很特殊,每行LineBox根据lineHeight对齐baseLine得来,并非LineBox全部\n * 当LineBox只有直属Text时如果font没有lineGap则等价于全部,如有则需减去\n * 另外其client/offset/outer的w/h尺寸计算也很特殊,皆因首尾x方向的mpb导致\n * @private\n */\n __inlineSize(tw, textAlign) {\n let { contentBoxList, computedStyle, __ox, __oy } = this;\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // x/clientX/offsetX/outerX\n let maxX, maxY, minX, minY, maxCX, maxCY, minCX, minCY, maxFX, maxFY, minFX, minFY, maxOX, maxOY, minOX, minOY;\n let length = contentBoxList.length;\n if(length) {\n // 遍历contentBox,里面存的是LineBox内容,根据父LineBox引用判断是否换行\n contentBoxList.forEach((item, i) => {\n // 非第一个除了minY不用看其它都要,minX是换行导致,而maxX在最后一个要考虑右侧mpb,中间的无需考虑嵌套inline的mpb\n if(i) {\n minX = Math.min(minX, item.x);\n minCX = Math.min(minCX, item.x);\n minFX = Math.min(minFX, item.x);\n minOX = Math.min(minOX, item.x);\n if(i === length - 1) {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n maxY = maxCY = maxFY = maxOY = Math.max(maxY, item.y + item.outerHeight);\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n else {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n }\n }\n // 第一个初始化\n else {\n minX = item.x;\n minY = item.y;\n minCX = minX - paddingLeft;\n minCY = minY - paddingTop;\n minFX = minCX - borderLeftWidth;\n minFY = minCY - borderTopWidth;\n minOX = minFX - marginLeft;\n minOY = minFY - marginTop;\n maxX = maxCX = maxFX = maxOX = item.x + item.outerWidth;\n maxY = maxCY = maxFY = maxOY = item.y + item.outerHeight;\n if(i === length - 1) {\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n }\n });\n this.__x = minOX;\n this.__y = minOY;\n this.__width = computedStyle[WIDTH] = maxX - minX;\n // 防止比自己最小高度lineHeight还小,比如内容是个小字体\n this.__height = computedStyle[HEIGHT] = Math.max(lineHeight, maxY - minY);\n this.__clientWidth = maxCX - minCX;\n this.__clientHeight = maxCY - minCY;\n this.__offsetWidth = maxFX - minFX;\n this.__offsetHeight = maxFY - minFY;\n this.__outerWidth = maxOX - minOX;\n this.__outerHeight = maxOY - minOY;\n this.__sx = minOX + __ox;\n this.__sy = minOY + __oy;\n this.__sx1 = minFX + __ox;\n this.__sy1 = minFY + __oy;\n this.__sx2 = minCX + __ox;\n this.__sy2 = minCY + __oy;\n this.__sx3 = minX + __ox;\n this.__sy3 = minY + __oy;\n this.__sx4 = maxX + __ox;\n this.__sy4 = maxY + __oy;\n this.__sx5 = maxCX + __ox;\n this.__sy5 = maxCY + __oy;\n this.__sx6 = maxFX + __ox;\n this.__sy6 = maxFY + __oy;\n // inline的text整体设置相同\n if(['center', 'right'].indexOf(textAlign) > -1) {\n this.children.forEach(item => {\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n }\n // 如果没有内容,宽度为0高度为lineHeight,对齐也特殊处理,lineBoxManager不会处理\n else {\n if(['center', 'right'].indexOf(textAlign) > -1) {\n let diff = tw;\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n if(diff) {\n this.__offsetX(diff, true);\n }\n }\n this.__width = computedStyle[WIDTH] = 0;\n let th = this.__height = computedStyle[HEIGHT] = lineHeight;\n this.__ioSize(0, th);\n this.__sy -= marginTop + paddingTop + borderTopWidth;\n this.__sx1 = this.sx + marginLeft;\n this.__sy1 = this.sy + marginTop;\n this.__sx2 = this.__sx1 + borderLeftWidth;\n this.__sy2 = this.__sy1 + borderTopWidth;\n this.__sx4 = this.__sx3 = this.__sx2 + paddingLeft;\n this.__sy4 = this.__sy3 = this.__sy2 + paddingTop;\n this.__sx5 = this.__sx4 + paddingRight;\n this.__sy5 = this.__sy4 + th + paddingBottom;\n this.__sx6 = this.__sx5 + borderRightWidth;\n this.__sy6 = this.__sy5 + borderBottomWidth;\n this.__clientWidth = this.__sx5 - this.__sx2;\n this.__clientHeight = this.__sy5 - this.__sy2;\n this.__offsetWidth = this.__sx6 - this.__sx1;\n this.__offsetHeight = this.__sy6 - this.__sy1;\n this.__outerWidth = this.__offsetWidth + marginLeft + marginRight;\n this.__outerHeight = this.__offsetHeight + marginTop + marginBottom;\n }\n }\n\n /**\n * 只针对绝对定位children布局\n * @param container\n * @param data\n * @param target 可选,只针对某个abs的child特定布局,在局部更新时用\n * @private\n */\n __layoutAbs(container, data, target) {\n let { sx: x, sy: y, clientWidth, clientHeight, computedStyle } = container;\n let { isDestroyed, children, absChildren } = this;\n let {\n [DISPLAY]: display,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n } = computedStyle;\n if(isDestroyed || display === 'none') {\n this.__layoutNone();\n return;\n }\n x += marginLeft + borderLeftWidth;\n y += marginTop + borderTopWidth;\n // 对absolute的元素进行相对容器布局\n absChildren.forEach(item => {\n if(target) {\n // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr\n let node = item;\n if(node instanceof Component) {\n node = item.shadowRoot;\n }\n // 所以得2个都对比\n if(target !== node && target !== item) {\n return;\n }\n }\n let { currentStyle, computedStyle } = item;\n if(currentStyle[DISPLAY] === 'none') {\n item.__layoutNone();\n return;\n }\n // 先根据容器宽度计算margin/padding\n item.__mp(currentStyle, computedStyle, clientWidth);\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let { [LEFT]: left, [TOP]: top, [RIGHT]: right,\n [BOTTOM]: bottom, [WIDTH]: width, [HEIGHT]: height, [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection } = currentStyle;\n let x2, y2, w2, h2;\n let onlyRight;\n let onlyBottom;\n let fixedTop;\n let fixedRight;\n let fixedBottom;\n let fixedLeft;\n // 判断何种方式的定位,比如左+宽度,左+右之类\n if(left[1] !== AUTO) {\n fixedLeft = true;\n computedStyle[LEFT] = calAbsolute(currentStyle, 'left', left, clientWidth, this.root);\n }\n else {\n computedStyle[LEFT] = 'auto';\n }\n if(right[1] !== AUTO) {\n fixedRight = true;\n computedStyle[RIGHT] = calAbsolute(currentStyle, 'right', right, clientWidth, this.root);\n }\n else {\n computedStyle[RIGHT] = 'auto';\n }\n if(top[1] !== AUTO) {\n fixedTop = true;\n computedStyle[TOP] = calAbsolute(currentStyle, 'top', top, clientHeight, this.root);\n }\n else {\n computedStyle[TOP] = 'auto';\n }\n if(bottom[1] !== AUTO) {\n fixedBottom = true;\n computedStyle[BOTTOM] = calAbsolute(currentStyle, 'bottom', bottom, clientHeight, this.root);\n }\n else {\n computedStyle[BOTTOM] = 'auto';\n }\n // 优先级最高left+right,其次left+width,再次right+width,再次仅申明单个,最次全部auto\n if(fixedLeft && fixedRight) {\n x2 = x + computedStyle[LEFT];\n w2 = x + clientWidth - computedStyle[RIGHT] - x2;\n }\n else if(fixedLeft) {\n x2 = x + computedStyle[LEFT];\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else 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 else {\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 unit from '../style/unit';\nimport image from '../style/image';\nimport border from '../style/border';\nimport enums from '../util/enums';\nimport level from '../refresh/level';\nimport mx from '../math/matrix';\n\nconst {\n STYLE_KEY: {\n WIDTH,\n HEIGHT,\n DISPLAY,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n VISIBILITY,\n BACKGROUND_IMAGE,\n BACKGROUND_COLOR,\n BOX_SHADOW,\n MIX_BLEND_MODE,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n FONT_SIZE,\n FLEX_BASIS,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_CONFIG,\n },\n NODE_KEY: {\n NODE_CACHE,\n NODE_DEFS_CACHE,\n NODE_IS_MASK,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH, 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 ctx.arc(cx, cy, r, 0, 2 * Math.PI);\n ctx.fill();\n ctx.closePath();\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for(let i = 1, len = pts.length; i < len; i++) {\n let point = pts[i];\n ctx.lineTo(point[0], point[1]);\n }\n ctx.lineTo(pts[0][0], pts[0][1]);\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n this.__addGeom('rect', [\n ['x', originX],\n ['y', originY],\n ['width', width],\n ['height', height],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ['fill', 'rgba(0,0,0,0)']\n ]);\n this.__addGeom('circle', [\n ['cx', cx],\n ['cy', cy],\n ['r', r],\n ['fill', fill],\n ]);\n let s = '';\n for(let i = 0, len = pts.length; i < len; i++) {\n let point = pts[i];\n if(i) {\n s += ' ';\n }\n s += point[0] + ',' + point[1];\n }\n this.__addGeom('polygon', [\n ['points', s],\n ['fill', fill]\n ]);\n }\n }\n else if(source) {\n // 圆角需要生成一个mask\n let list = border.calRadius(originX, originY, width, height,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n // 有border-radius需模拟遮罩裁剪\n if(list) {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list, dx, dy);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(source, originX, originY, width, height);\n ctx.restore();\n }\n else {\n ctx.drawImage(source, originX, originY, width, height);\n }\n }\n else if(renderMode === mode.SVG) {\n // img没有变化无需diff,直接用上次的vd\n if(loadImg.cache) {\n loadImg.cache.cache = true;\n virtualDom.children = [loadImg.cache];\n // 但是还是要校验是否有borderRadius变化,引发img的圆角遮罩\n if(!virtualDom.cache && list) {\n let d = svgPolygon(list);\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF'],\n ],\n }\n ],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.conClip = 'url(#' + id + ')';\n }\n return;\n }\n // 缩放图片,无需考虑原先矩阵,xom里对父层已经变换过了\n let matrix;\n if(width !== loadImg.width || height !== loadImg.height) {\n matrix = image.matrixResize(loadImg.width, loadImg.height, width, height, originX, originY, width, height);\n }\n let props = [\n ['xlink:href', loadImg.error ? placeholder : loadImg.src],\n ['x', originX],\n ['y', originY],\n ['width', loadImg.width],\n ['height', loadImg.height]\n ];\n if(list) {\n let d = svgPolygon(list);\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF']\n ],\n }\n ],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.conClip = 'url(#' + id + ')';\n delete virtualDom.cache;\n }\n if(matrix && !mx.isE(matrix)) {\n props.push(['transform', 'matrix(' + util.joinArr(mx.m2m6(matrix), ',') + ')']);\n }\n let vd = {\n type: 'img',\n tagName: 'image',\n props,\n };\n virtualDom.children = [vd];\n loadImg.cache = vd;\n }\n }\n return res;\n }\n\n // img没加载时,清空,这样Xom就认为没内容不生成cache,防止img先绘制cache再绘制主屏,重复\n __releaseWhenEmpty(__cache) {\n if(!this.__loadImg.error && !this.__loadImg.source) {\n return super.__releaseWhenEmpty(__cache);\n }\n }\n\n __isRealInline() {\n return false;\n }\n\n // overwrite\n __tryLayInline(w, total) {\n let { currentStyle: {\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n let loadImg = this.__loadImg;\n // 加载成功计算缩放后的宽度\n if(loadImg.source) {\n if(height[1] === PX) {\n w -= loadImg.width * height[0] / loadImg.height;\n }\n else if(height[1] === PERCENT) {\n w -= loadImg.width * height[0] * total * 0.01 / loadImg.height;\n }\n else if(height[1] === REM) {\n w -= loadImg.width * height[0] * this.root.computedStyle[FONT_SIZE] / loadImg.height;\n }\n else if(height[1] === VW) {\n w -= loadImg.width * height[0] * this.root.width * 0.01 / loadImg.height;\n }\n else if(height[1] === VH) {\n w -= loadImg.width * height[0] * this.root.height * 0.01 / loadImg.height;\n }\n else if(height[1] === VMAX) {\n w -= height[0] * Math.max(this.root.width, this.root.height) * 0.01 / loadImg.height;\n }\n else if(height[1] === VMIN) {\n w -= height[0] * Math.min(this.root.width, this.root.height) * 0.01 / loadImg.height;\n }\n else {\n w -= loadImg.width;\n }\n }\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n else if(marginLeft[1] === VMAX) {\n w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginLeft[1] === VMIN) {\n w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n else if(paddingLeft[1] === VMAX) {\n w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingLeft[1] === VMIN) {\n w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n else if(borderLeftWidth[1] === VMAX) {\n w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderLeftWidth[1] === VMIN) {\n w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n else if(marginRight[1] === VMAX) {\n w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginRight[1] === VMIN) {\n w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n else if(paddingRight[1] === VMAX) {\n w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingRight[1] === VMIN) {\n w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n else if(borderRightWidth[1] === VMAX) {\n w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderRightWidth[1] === VMIN) {\n w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return w;\n }\n\n __calBasis(isDirectionRow, 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 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 = __loadImg.width / __loadImg.height;\n b = max = min = isDirectionRow ? cross * ratio : cross / ratio;\n }\n else {\n b = max = min = isDirectionRow ? __loadImg.width : __loadImg.height;\n }\n }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\n }\n\n __loadAndRefresh(loadImg, root, ctx, placeholder, computedStyle, width, height, cb) {\n let self = this;\n // 先清空之前可能的\n if(loadImg.source || loadImg.error) {\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n });\n loadImg.source = null;\n }\n loadImg.loading = true;\n // 再测量,可能瞬间完成替换掉上面的\n inject.measureImg(loadImg.src, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败走error绘制\n if(data.url === loadImg.src && !self.isDestroyed) {\n loadImg.cache && (loadImg.cache.cache = false);\n loadImg.loading = false;\n function reload() {\n let { currentStyle: { [WIDTH]: width, [HEIGHT]: height } } = self;\n root.delRefreshTask(self.__task);\n if(width[1] !== AUTO && height[1] !== AUTO) {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REPAINT;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n else {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n }\n if(data.success) {\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n }\n else if(placeholder) {\n inject.measureImg(placeholder, data => {\n if(data.success) {\n loadImg.error = true;\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n reload();\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n return;\n }\n else {\n loadImg.error = true;\n }\n // 可见状态进行刷新操作,visibility某些情况需要刷新,可能宽高未定义要重新布局\n if(computedStyle[DISPLAY] !== 'none') {\n reload();\n }\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n }\n\n updateSrc(v, cb) {\n let self = this;\n let loadImg = self.__loadImg;\n let root = this.root;\n // 相等或空且当前error直接返回\n if(v === loadImg.src || !v && loadImg.error) {\n if(isFunction(cb)) {\n cb(-1);\n }\n }\n else if(v) {\n loadImg.src = v;\n self.__loadAndRefresh(loadImg, root, root.ctx, self.props.placeholder, self.computedStyle, self.width, self.height, cb);\n }\n else {\n loadImg.src = v;\n loadImg.source = null;\n loadImg.error = true;\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, self.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb(diff);\n }\n },\n });\n }\n }\n\n appendChild() {\n inject.error('Img can not appendChild.');\n }\n\n get src() {\n return this.__loadImg.src;\n }\n\n static showError = true;\n}\n\nexport default Img;\n","class Defs {\n constructor(uuid) {\n this.id = uuid;\n this.count = 0;\n this.list = [];\n this.cacheHash = {}; // 每次svg渲染前重置,存储前次渲染不变的缓存id\n }\n add(data) {\n let uuid = this.count;\n let hash = this.cacheHash;\n while(hash.hasOwnProperty(uuid)) {\n uuid++;\n }\n this.count = uuid + 1;\n data.id = uuid;\n data.uuid = 'karas-defs-' + this.id + '-' + uuid;\n data.index = this.list.length;\n this.list.push(data);\n return data.uuid;\n }\n addCache(data) {\n data.index = this.list.length;\n this.list.push(data);\n this.cacheHash[data.id] = true;\n return data.uuid;\n }\n clear() {\n this.list = [];\n this.count = 0;\n this.cacheHash = {};\n }\n removeCache(data) {\n let list = this.list;\n let i = data.index;\n // 一般情况index即位置,但每次渲染过程中,可能会删掉一些,此时位置会往前,但index不变,因此遍历\n for(; i >= 0; i--) {\n if(list[i] === data) {\n list.splice(i, 1);\n return;\n }\n }\n }\n\n get value() {\n return this.list;\n }\n\n static getInstance(uuid) {\n return new Defs(uuid);\n }\n}\n\nexport default Defs;\n","import Xom from '../Xom';\nimport reset from '../../style/reset';\nimport css from '../../style/css';\nimport unit from '../../style/unit';\nimport enums from '../../util/enums';\nimport mode from '../mode';\nimport util from '../../util/util';\nimport painter from '../../util/painter';\nimport transform from '../../style/transform';\nimport mx from '../../math/matrix';\nimport inject from '../../util/inject';\nimport gradient from '../../math/gradient';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n WIDTH,\n HEIGHT,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n FILL,\n STROKE,\n STROKE_MITERLIMIT,\n STROKE_WIDTH,\n STROKE_LINECAP,\n STROKE_LINEJOIN,\n STROKE_DASHARRAY,\n STROKE_DASHARRAY_STR,\n FILL_RULE,\n VISIBILITY,\n FONT_SIZE,\n FLEX_BASIS,\n },\n NODE_KEY: {\n NODE_CACHE_PROPS,\n NODE_CURRENT_PROPS,\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit;\nconst { int2rgba, isNil, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nconst REGISTER = {};\n\nclass Geom extends Xom {\n constructor(tagName, props) {\n super(tagName, props);\n this.__isMulti = !!this.props.multi;\n this.__style = css.normalize(this.style, reset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET));\n this.__currentStyle = util.extend({}, this.__style);\n this.__currentProps = util.clone(this.props);\n let config = this.__config;\n config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n config[NODE_CURRENT_PROPS] = this.__currentProps;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_STYLE] = this.__style;\n }\n\n __tryLayInline(w, total) {\n // 无children,直接以style的width为宽度,不定义则为0\n let { currentStyle: {\n [WIDTH]: width,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n 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 let min = 0;\n let max = 0;\n let { currentStyle } = this;\n // 计算需考虑style的属性\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n [DISPLAY]: display,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n 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 return [display, this.__addMp(isDirectionRow, data.w, currentStyle, [min, max])];\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH, 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 return [b, min, max];\n }\n\n __layoutBlock(data, isVirtual) {\n let { fixedWidth, fixedHeight, w, h } = this.__preLayout(data);\n this.__height = fixedHeight ? h : 0;\n if(isVirtual) {\n this.__width = fixedWidth ? w : 0;\n return;\n }\n this.__width = w;\n this.__ioSize(w, this.height);\n this.__marginAuto(this.currentStyle, data);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __layoutFlex(data) {\n // 无children所以等同于block\n this.__layoutBlock(data);\n }\n\n __layoutInline(data) {\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // 元素的width不能超过父元素w\n let tw = this.__width = fixedWidth ? w : x - data.x;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6) {\n let res = super.__calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6);\n if(isNil(__cacheStyle[STROKE_WIDTH])) {\n __cacheStyle[STROKE_WIDTH] = true;\n let strokeWidth = currentStyle[STROKE_WIDTH] || [];\n let w = this.width;\n computedStyle[STROKE_WIDTH] = strokeWidth.map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n else if(item[1] === PERCENT) {\n return item[0] * w * 0.01;\n }\n else if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n else if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n else 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 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() {}\n\n // offset/resize时要多一步清空props上记录的缓存\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeX(diff, lv) {\n super.__resizeX(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeY(diff, lv) {\n super.__resizeY(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n getProps(k) {\n let v = this.currentProps[k];\n if(!isNil(v)) {\n return v;\n }\n return this['__' + k];\n }\n\n __isRealInline() {\n return false;\n }\n\n get isMulti() {\n return this.__isMulti;\n }\n\n get currentProps() {\n return this.__currentProps;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$') {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Geom has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$'\n || !obj.prototype || !(obj.prototype instanceof Geom)) {\n throw new Error('Invalid param');\n }\n if(Geom.hasRegister(name)) {\n throw new Error(`Geom has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Geom.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nexport default Geom;\n","import Xom from '../node/Xom';\nimport Dom from '../node/Dom';\nimport Component from '../node/Component';\nimport util from './util';\nimport inject from './inject';\nimport flatten from './flatten';\nimport $$type from './$$type';\nimport enums from './enums';\n\nconst {\n NODE_KEY: {\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_DOM_PARENT,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n NODE_STRUCT,\n },\n} = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet updateList = [];\nlet removeList = [];\n\nconst KEY_FLAG = {};\n\n/**\n * setState后刷新前先根遍历检查组件开始进行shouldComponentUpdate判断\n */\nfunction check(vd) {\n if(vd instanceof Dom) {\n vd.children.forEach(child => {\n if(child instanceof Dom) {\n check(child);\n }\n // 当组件有setState更新时,从叶子到根链路会标识__hasUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasUpdate) {\n child.__hasUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n // 高阶组件会进入此分支,被父组件调用\n else if(vd instanceof Component && vd.__hasUpdate) {\n vd.__hasUpdate = false;\n checkCp(vd, vd.props);\n }\n}\n\n/**\n * 检查cp是否有state变更,注意递归检查时需要看shadow不能看shadowRoot,\n * 否则高阶组件会被跳过,其更新无法触发update生命周期\n * @param cp\n * @param nextProps\n * @param forceCheckUpdate,被render()后的json的二级组件,发现props有变更强制检查更新,否则可以跳过\n */\nfunction checkCp(cp, nextProps, forceCheckUpdate) {\n if(cp.__nextState || forceCheckUpdate) {\n let shouldUpdate;\n if(util.isFunction(cp.shouldComponentUpdate)) {\n shouldUpdate = cp.shouldComponentUpdate(nextProps, cp.__nextState || cp.state);\n }\n else {\n // 没有默认更新\n shouldUpdate = true;\n }\n if(shouldUpdate) {\n updateCp(cp, nextProps, cp.__nextState || cp.state);\n }\n // 不更新则递归检查子tree的cp\n else {\n cp.props = nextProps;\n cp.state = cp.__nextState || cp.state;\n check(cp.shadow);\n }\n }\n else {\n check(cp.shadow);\n }\n}\n\n/**\n * 更新组件的props和state,清空__nextState\n * @param cp\n * @param props\n * @param state\n */\nfunction updateCp(cp, props, state) {\n cp.props = props;\n cp.state = state;\n cp.__nextState = null; // 同步在refresh前清除component的新state标识,这样frame动画在after回调中可以新设\n let oldS = cp.shadow;\n let oldSr = cp.shadowRoot;\n let oldJson = cp.__cd;\n let json = flatten(cp.render());\n // 对比新老render()返回的内容,更新后重新生成sr\n diffSr(oldS, oldJson, json);\n cp.__init(json);\n // 为了局部dom布局需要知道老的css信息\n let sr = cp.shadowRoot;\n if(sr instanceof Xom) {\n [\n '__outerWidth',\n '__outerHeight',\n '__sx',\n '__sy',\n '__sx2',\n '__sx3',\n '__sx4',\n '__sx5',\n '__sx6',\n '__sy2',\n '__sy3',\n '__sy4',\n '__sy5',\n '__sy6',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__computedStyle = sr.__config[NODE_COMPUTED_STYLE] = oldSr.computedStyle;\n }\n else {\n let domParent = cp.domParent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n sr.__config[k] = domParent.__config[k];\n });\n }\n [\n '__x',\n '__y',\n '__width',\n '__height',\n '__sx1', // text和xom\n '__sy1',\n '__layoutData',\n '__parent',\n '__domParent',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__config[NODE_DOM_PARENT] = oldSr.domParent;\n sr.__config[NODE_STRUCT] = oldSr.__config[NODE_STRUCT];\n updateList.push(cp);\n // 老的需回收,diff会生成新的dom,唯一列外是cp直接返回一个没变化的cp\n if(!util.isObject(json) || !json.__placeholder) {\n removeList.push(oldS);\n }\n // 子组件使用老的json时标识,更新后删除,render()返回空会没json对象\n if(json && json.__placeholder) {\n delete json.__placeholder;\n }\n if(json && json.__inheritAnimate) {\n delete json.__inheritAnimate;\n }\n if(json && json.__animateRecords) {\n delete json.__animateRecords;\n }\n // 高阶组件时需判断,子组件更新后生成新的sr,父组件的sr/host需要同时更新引用\n let host = cp.host;\n while(host) {\n if(host.shadow === cp) {\n host.__shadowRoot = sr;\n sr.__hostRoot = host;\n cp = host;\n host = host.host;\n }\n else {\n break;\n }\n }\n}\n\n/**\n * 非一级组件sr进行对比,key相同的无需重新生成且继承动画\n * @param vd\n * @param oj oldJson\n * @param nj\n */\nfunction diffSr(vd, oj, nj) {\n // 先遍历检查key相同的,将没有变化的key暂存下来,深度优先,这样叶子节点出现在前面,当key的叶子也有key时,确保叶子先对比\n let ojk = getKeyHash(oj, {}, vd);\n let njk = getKeyHash(nj, {});\n let keyList = [];\n let cpList = [];\n // 先对比key对应的节点,如果新老有一方对不上则落空\n Object.keys(ojk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n if(!n) {\n o.json.key = KEY_FLAG;\n }\n });\n Object.keys(njk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n // 有可能老的没有这个key,新key落空\n if(!o) {\n n.json.key = KEY_FLAG;\n return;\n }\n let oj = o.json;\n let nj = n.json;\n let vd = o.vd;\n // 相同class的组件进行对比替换\n if(oj.$$type === TYPE_CP && nj.$$type === TYPE_CP) {\n if(oj.klass === nj.klass) {\n // 对比props和children看是否全等,是则直接替换新json类型为占位符,引用老vd,否则强制更新\n diffCp(oj, nj, vd);\n // 标识对比过了\n oj.key = nj.key = KEY_FLAG;\n // 老的sr里需删除这个vd,因为老sr会回收\n cpList.push(vd);\n }\n }\n // 相同类型的vd进行对比继承动画\n else if(oj.$$type === nj.$$type && oj.tagName === nj.tagName) {\n // 需判断矢量标签mutil是否相等\n if(nj.$$type !== TYPE_GM || oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n oj.key = nj.key = KEY_FLAG;\n // key相同的dom暂存下来\n if(nj.$$type === TYPE_VD) {\n keyList.push({\n vd,\n oj,\n nj,\n });\n }\n }\n });\n // key相同的dom对比children,下面非key逻辑就不做了\n keyList.forEach(item => {\n diffChildren(item.vd, item.oj, item.nj);\n });\n // 整体tree进行对比\n diffChild(vd, oj, nj);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的\n cpList.forEach(vd => {\n removeCpFromOldTree(vd);\n });\n}\n\n/**\n * 递归检查dom的children,相同的无需重新生成,用PL类型占位符代替直接返回老vd\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChild(vd, oj, nj) {\n if(util.isObject(nj)) {\n if(nj.$$type === TYPE_CP) {\n // key对比过了忽略\n if(nj.key === KEY_FLAG) {\n return;\n }\n // 相同class的组件处理\n if(oj && oj.$$type === nj.$$type && oj.klass === nj.klass) {\n diffCp(oj, nj, vd);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收\n removeCpFromOldTree(vd);\n }\n }\n else if(nj.$$type === TYPE_GM && oj && oj.$$type === TYPE_GM) {\n // $geom的multi必须一致\n if(oj.tagName === nj.tagName && oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n }\n // dom类型递归children\n else if(nj.$$type === TYPE_VD && oj && oj.$$type === TYPE_VD) {\n if(oj.tagName === nj.tagName) {\n nj.__inheritAnimate = vd;\n }\n diffChildren(vd, oj, nj);\n }\n }\n}\n\n/**\n * dom类型的vd对比children\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChildren(vd, oj, nj) {\n let oc = oj.children;\n let nc = nj.children;\n let ol = oc.length;\n let nl = nc.length;\n let children = vd.children;\n for(let i = 0, of = 0, nf = 0, len = Math.min(ol, nl); i < len; i++) {\n let o = oc[i + of];\n let n = nc[i + nf];\n // 新老都是key直接跳过\n if(o.key === KEY_FLAG && n.key === KEY_FLAG) {\n }\n // 其中一个是key对比过了调整索引和长度\n else if(o.key === KEY_FLAG) {\n of++;\n i--;\n ol--;\n len = Math.min(ol, nl);\n }\n else if(n.key === KEY_FLAG) {\n nf++;\n i--;\n nl--;\n len = Math.min(ol, nl);\n }\n else {\n diffChild(children[i + of], o, n);\n }\n }\n // 长度不同增减的无需关注,新json创建cp有didMount,老vd会调用cp的destroy\n}\n\n/**\n * 根据json对比看cp如何更新,被render()后的json的二级组件对比才会出现\n * @param oj\n * @param nj\n * @param vd\n */\nfunction diffCp(oj, nj, vd) {\n // props全等,直接替换新json类型为占位符,引用老vd内容,无需重新创建,暂时存在json的placeholder上\n // 否则需要强制触发组件更新,包含setState内容\n nj.__placeholder = vd;\n let sr = vd.shadowRoot;\n // 对比需忽略on开头的事件,直接改老的引用到新的上,这样只变了on的话无需更新\n let exist = {};\n Object.keys(oj.props).forEach(k => {\n let v = oj.props[k];\n exist[k] = v;\n });\n Object.keys(nj.props).forEach(k => {\n let v = nj.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n vd.off(k, exist[k]);\n vd.on(k, v);\n }\n delete exist[k];\n }\n else {\n k = k.slice(2).toLowerCase();\n vd.on(k, v);\n }\n }\n });\n // 新的少的事件取消\n Object.keys(exist).forEach(k => {\n let v = exist[k];\n if(/^on[a-zA-Z]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n delete sr.listener[k];\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n vd.off(k, v);\n }\n });\n checkCp(vd, nj.props, !util.equal(oj.props, nj.props));\n}\n\n/**\n * 深度优先遍历json,将有key的记录在hash中,如果传入根vd,同步递归保存对应位置的vd\n * @param json\n * @param hash\n * @param vd\n * @returns {*}\n */\nfunction getKeyHash(json, hash, vd) {\n if(Array.isArray(json)) {\n json.forEach((item, i) => getKeyHash(item, hash, vd && vd[i]));\n }\n else if(util.isObject(json)) {\n if(json.$$type === TYPE_VD || json.$$type === TYPE_GM || json.$$type === TYPE_CP) {\n // 深度优先\n if(json.$$type === TYPE_VD) {\n getKeyHash(json.children, hash, vd && vd.children);\n }\n let key = json.props.key;\n if(!util.isNil(key) && key !== '') {\n // 重复key错误警告\n if(hash.hasOwnProperty(key)) {\n inject.warn('Component ' + vd.tagName + ' has duplicate key: ' + key);\n }\n hash[key] = {\n json,\n vd,\n };\n }\n }\n }\n return hash;\n}\n\n/**\n * 非一级组件diff发生更新时,其需要从sr的tree中移除,因为sr会销毁\n */\nfunction removeCpFromOldTree(vd) {\n // root下的一级组件不会发生回收情况,忽略\n if(!vd.host) {\n return;\n }\n let parent = vd.parent;\n if(parent) {\n let i = parent.children.indexOf(vd);\n if(i > -1) {\n parent.children[i] = null;\n }\n else {\n throw new Error('Can not find child: ' + vd.tagName);\n }\n }\n}\n\n/**\n * 执行componentDidUpdate/destroy\n */\nfunction did() {\n updateList.forEach(item => {\n if(util.isFunction(item.componentDidUpdate)) {\n item.componentDidUpdate();\n }\n });\n updateList.splice(0);\n removeList.forEach(item => {\n item.__destroy();\n });\n removeList = [];\n}\n\nexport default {\n updateList,\n check,\n did,\n};\n","import util from './util';\nimport level from '../refresh/level';\n\nconst { joinVd, joinDef } = util;\nconst { contain, NONE, TRANSFORM_ALL, OPACITY, FILTER, MIX_BLEND_MODE } = level;\n\nfunction diff(elem, ovd, nvd) {\n let cns = elem.childNodes;\n diffDefs(cns[0], ovd.defs, nvd.defs);\n // = i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinDef(nd[i]));\n }\n }\n}\n\nfunction diffDef(elem, od, nd) {\n if(od.tagName !== nd.tagName) {\n insertAdjacentHTML(elem, 'beforebegin', joinDef(nd));\n // elem.insertAdjacentHTML('beforebegin', joinDef(nd));\n elem.parentNode.removeChild(elem);\n }\n else {\n if(od.uuid !== nd.uuid) {\n elem.setAttribute('id', nd.uuid);\n }\n let op = {};\n for(let i = 0, len = (od.props || []).length; i < len; i++) {\n let prop = od.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nd.props || []).length; i < len; i++) {\n let prop = nd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n let cns = elem.childNodes;\n let ol = od.children.length;\n let nl = nd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, od.children[i], nd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nd.children[i]));\n }\n }\n }\n}\n\nfunction diffChild(elem, ovd, nvd) {\n if(ovd.type === 'dom') {\n if(nvd.type === 'dom') {\n diffD2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffD2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'text') {\n if(nvd.type === 'text') {\n diffT2T(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'geom') {\n if(nvd.type === 'dom') {\n diffG2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffG2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'img') {\n if(nvd.type === 'img') {\n diffItemSelf(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n}\n\nfunction diffX2X(elem, ovd, nvd) {\n let { transform, opacity, visibility, mask, overflow, filter, mixBlendMode, conClip } = nvd;\n if(ovd.transform !== transform) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(ovd.opacity !== opacity) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(ovd.visibility !== visibility) {\n elem.setAttribute('visibility', visibility);\n }\n if(ovd.mask !== mask) {\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n }\n if(ovd.filter !== filter || ovd.mixBlendMode !== mixBlendMode) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('filter');\n }\n }\n // if(ovd.filter !== filter) {\n // if(filter) {\n // elem.setAttribute('filter', filter);\n // }\n // else {\n // elem.removeAttribute('filter');\n // }\n // }\n if(ovd.overflow !== overflow) {\n if(overflow) {\n elem.setAttribute('clipPath', overflow);\n }\n else {\n elem.removeAttribute('overflow');\n }\n }\n if(ovd.conClip !== conClip) {\n if(conClip) {\n elem.childNodes[1].setAttribute('clip-path', conClip);\n }\n else {\n elem.childNodes[1].removeAttribute('clip-path');\n }\n }\n}\n\nfunction diffByLessLv(elem, ovd, nvd, lv) {\n let { transform, opacity, mask, filter, mixBlendMode } = nvd;\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n if(lv === NONE) {\n return;\n }\n if(contain(lv, TRANSFORM_ALL)) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(contain(lv, OPACITY)) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(contain(lv, FILTER) || contain(lv, MIX_BLEND_MODE)) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('style');\n }\n }\n}\n\nfunction diffD2D(elem, ovd, nvd, root) {\n // cache表明children无变化缓存,一定是REPAINT以下的,只需看自身的lv以及mask\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffD2G(elem, ovd, nvd) {\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n replaceWith(cns[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffT2T(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, ovd.children[i], nvd.children[i], true);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffG2D(elem, ovd, nvd) {\n diffD2G(elem, ovd, nvd);\n}\n\nfunction diffG2G(elem, ovd, nvd) {\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n }\n}\n\nfunction diffBb(elem, obb, nbb) {\n let ol = obb.length;\n let nl = nbb.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, obb[i], nbb[i]);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nbb[i]));\n }\n }\n}\n\nfunction diffItem(elem, i, ovd, nvd, isText) {\n let cns = elem.childNodes;\n if(ovd.tagName !== nvd.tagName) {\n replaceWith(cns[i], nvd);\n }\n else {\n diffItemSelf(cns[i], ovd, nvd);\n if(isText && ovd.content !== nvd.content) {\n cns[i].innerHTML = nvd.content;\n }\n }\n}\n\nfunction diffItemSelf(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let op = {};\n for(let i = 0, len = (ovd.props || []).length; i < len; i++) {\n let prop = ovd.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nvd.props || []).length; i < len; i++) {\n let prop = nvd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n}\n\nfunction replaceWith(elem, vd) {\n let res;\n if(Array.isArray(vd)) {\n res = '';\n vd.forEach(item => {\n res += joinVd(item);\n });\n }\n else {\n res = joinVd(vd);\n }\n insertAdjacentHTML(elem, 'beforebegin', res);\n // elem.insertAdjacentHTML('beforebegin', res);\n elem.parentNode.removeChild(elem);\n}\n\nfunction insertAt(elem, cns, index, html) {\n if(index >= cns.length) {\n insertAdjacentHTML(elem, 'beforeend', html);\n // elem.insertAdjacentHTML('beforeend', html);\n }\n else {\n insertAdjacentHTML(cns[index], 'beforebegin', html);\n // cns[index].insertAdjacentHTML('beforebegin', html);\n }\n}\n\nfunction removeAt(elem, cns, index) {\n if(cns[index]) {\n elem.removeChild(cns[index]);\n }\n}\n\nlet svg;\nfunction insertAdjacentHTML(elem, where, content) {\n if(elem.insertAdjacentHTML) {\n elem.insertAdjacentHTML(where, content);\n }\n else {\n switch(where) {\n case 'beforeend':\n elem.innerHTML += content;\n break;\n case 'beforebegin':\n svg = svg || document.createElement('svg');\n svg.innerHTML = content;\n elem.parentNode.insertBefore(svg.childNodes[0], elem);\n break;\n }\n }\n}\n\nexport default diff;\n","import util from '../util/util';\n\nconst { isFunction } = util;\n\nclass Controller {\n constructor() {\n this.__records = []; // 默认记录和自动记录\n this.__records2 = []; // 非自动播放的动画记录\n this.__list = [] // 默认初始化播放列表,自动播放也存这里\n this.__list2 = []; // json中autoPlay为false的初始化存入这里\n this.__onList = []; // list中已存在的侦听事件,list2初始化时也需要增加上\n this.__lastTime = {}; // 每个类型的上次触发时间,防止重复emit\n }\n\n add(v, list = this.list) {\n if(list.indexOf(v) === -1) {\n list.push(v);\n }\n }\n\n remove(v) {\n let i = this.list.indexOf(v);\n if(i > -1) {\n this.list.splice(i, 1);\n }\n }\n\n __destroy() {\n this.__records = [];\n this.__records2 = [];\n this.__list = [];\n this.__list2 = [];\n }\n\n __action(k, args) {\n this.list.forEach(item => {\n item[k].apply(item, args);\n });\n }\n\n init(records = this.__records, list = this.list) {\n // 检查尚未初始化的record,并初始化,后面才能调用各种控制方法\n if(records.length) {\n // 清除防止重复调用,并且新的json还会进入整体逻辑\n records.splice(0).forEach(item => {\n let { target, animate } = item;\n if(target.isDestroyed) {\n return;\n }\n if(Array.isArray(animate)) {\n animate.forEach(animate => {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n });\n }\n else {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n }\n });\n }\n // 非自动播放后初始化需检测事件,给非自动播放添加上,并清空本次\n if(records === this.__records2) {\n let onList = this.__onList;\n let list2 = this.list2;\n if(list2.length && onList.length) {\n list2.forEach(item => {\n onList.forEach(arr => {\n item.off(arr[0], arr[1]);\n item.on(arr[0], arr[1]);\n });\n });\n }\n }\n }\n\n __playAuto() {\n this.init();\n this.__action('play');\n }\n\n play(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('play', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n pause() {\n this.__action('pause');\n }\n\n resume(cb) {\n let once = true;\n this.__action('resume', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n __mergeAuto() {\n this.init();\n this.init(this.__records2);\n if(this.__list2.length) {\n this.__list = this.__list.concat(this.__list2);\n this.__list2 = [];\n }\n }\n\n cancel(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('cancel', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n finish(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('finish', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndStop(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('gotoAndStop', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndPlay(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('gotoAndPlay', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.__on(id[i], handle);\n }\n this.__onList.push([id, handle]);\n }\n else {\n this.__on(id, handle);\n this.__onList.push([id, handle]);\n }\n }\n\n __on(id, handle) {\n this.list.forEach(item => {\n let cb = () => {\n let time = item.timestamp;\n if(time !== this.__lastTime[id]) {\n this.__lastTime[id] = time;\n handle();\n }\n };\n cb.__karasEventCb = handle;\n item.on(id, cb);\n });\n }\n\n off(id, handle) {\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.off(id[i], handle);\n }\n }\n else {\n this.list.forEach(item => {\n item.off(id, handle);\n });\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get list2() {\n return this.__list2;\n }\n\n __set(key, value) {\n this.list.forEach(item => {\n item[key] = value;\n });\n }\n\n set playbackRate(v) {\n this.__set('playbackRate', v);\n }\n\n set iterations(v) {\n this.__set('iterations', v);\n }\n\n set playCount(v) {\n this.__set('playCount', v);\n }\n\n set fps(v) {\n this.__set('fps', v);\n }\n\n set currentTime(v) {\n this.__set('currentTime', v);\n }\n\n set spfLimit(v) {\n this.__set('spfLimit', v);\n }\n\n set delay(v) {\n this.__set('delay', v);\n }\n\n set endDelay(v) {\n this.__set('endDelay', v);\n }\n\n set fill(v) {\n this.__set('fill', v);\n }\n\n set direction(v) {\n this.__set('direction', v);\n }\n}\n\nexport default Controller;\n","import 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 Geom from '../node/geom/Geom';\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;\n }\n // 局部根节点如有perspective,则计算pm,这里不会出现嵌套,因为每个出现都会生成局部根节点\n let pm;\n if(perspective) {\n pm = tf.calPerspectiveMatrix(perspective, perspectiveOrigin);\n }\n // 广度遍历,不断一层层循环下去,用2个hash暂存每层的父matrix和opacity,blur只需记住顶层,因为子的如果有一定是cacheFilter\n let list = [index];\n let d = 0;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n d = blur.outerSize(v);\n }\n });\n opacityHash[index] = 1;\n // opacity可以保存下来层级相乘结果供外部使用,但matrix不可以,因为这里按画布原点为坐标系计算,外部合并局部根节点以bbox左上角为原点\n let matrixHash = {};\n while(list.length) {\n let arr = list.splice(0);\n for(let i = 0, len = arr.length; i < len; i++) {\n let parentIndex = arr[i];\n let total = __structs[parentIndex][STRUCT_TOTAL] || 0;\n for(let i = parentIndex + 1, len = parentIndex + total + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node2,\n [STRUCT_TOTAL]: total,\n } = __structs[i];\n // mask也不占bbox位置\n if(node2.isMask) {\n continue;\n }\n let {\n __sx1,\n __sy1,\n __config: {\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [OPACITY]: opacity,\n },\n },\n } = node2;\n // webgl不能跳过超限\n if(limitCache && !includeLimitCache) {\n return;\n }\n // display:none跳过整个节点树,visibility只跳过自身\n if(display === 'none') {\n i += total || 0;\n continue;\n }\n if(visibility === 'hidden') {\n continue;\n }\n parentIndexHash[i] = parentIndex;\n opacityHash[i] = opacityHash[parentIndex] * opacity;\n // 防止text的情况,其一定属于某个node,其bbox被计算过,text不应该计算\n if(node2 instanceof Text) {\n continue;\n }\n let bbox, dx = 0, dy = 0, hasTotal;\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n bbox = target.bbox.slice(0);\n dx = target.dbx;\n dy = target.dby;\n i += total || 0;\n hasTotal = true;\n }\n else if(__cache && __cache.available) {\n bbox = __cache.bbox.slice(0);\n dx = __cache.dbx;\n dy = __cache.dby;\n }\n else {\n bbox = node2.bbox;\n }\n // 可能Xom没有内容\n if(bbox) {\n bbox[0] -= sx1;\n bbox[1] -= sy1;\n bbox[2] -= sx1;\n bbox[3] -= sy1;\n let matrix = matrixHash[parentIndex];\n // 父级matrix初始化E为null,自身不为E时才运算,可以加速\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n tfo[0] += __sx1 - sx1 + dx;\n tfo[1] += __sy1 - sy1 + dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(pm) {\n matrix = multiply(pm, matrix);\n }\n bbox = 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);\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);\n texCache.refresh(gl, cx, cy);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n // 因为cacheTotal不总是以左上角原点为开始,所以必须每个节点重算matrix,合并box时计算的无法用到\n let matrixHash = {};\n // 先序遍历汇总到total\n for(let i = index + 1, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n let parentIndex = parentIndexHash[i];\n let matrix = matrixHash[parentIndex]; // 父节点的在每个节点计算后保存,第一个为top的默认为E(空)\n let opacity = opacityHash[i]; // opacity在合并box时已经计算可以直接用\n // 先看text,visibility会在内部判断,display会被parent判断\n if(node instanceof Text) {\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n texCache.addTexAndDrawWhenLimit(gl, __config[NODE_CACHE], opacity, matrix, cx, cy, dx, dy);\n }\n // 再看total缓存/cache,都没有的是无内容的Xom节点\n else {\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_IS_MASK]: isMask,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // mask和不可见不能被汇总到top上\n if(visibility === 'hidden' || isMask) {\n continue;\n }\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n if(__cache && __cache.available) {\n tfo[0] += __cache.sx1;\n tfo[1] += __cache.sy1;\n }\n else {\n tfo[0] += node.__sx1;\n tfo[1] += node.__sy1;\n }\n let dx = -sx1 + dbx;\n let dy = -sy1 + dby;\n tfo[0] += dx;\n tfo[1] += dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n if(target) {\n // 局部的mbm和主画布一样,先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成\n if(isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy);\n texCache.refresh(gl, cx, cy);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前fbo作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy);\n }\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n // 绘制到fbo的纹理对象上并删除fbo恢复\n texCache.refresh(gl, cx, cy);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 生成的纹理对象本身已绑定一个纹理单元了,释放lock的同时可以给texCache的channel缓存,避免重复上传\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bboxTotal);\n texCache.releaseLockChannel(n, mockCache.page);\n return [limitCache || totalLimitCache, mockCache];\n}\n\nfunction genFilterWebgl(gl, texCache, node, cache, filter, W, H) {\n let { sx1, sy1, width, height, bbox } = cache;\n let mockCache = cache;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n let res = genBlurWebgl(gl, texCache, mockCache, v, width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'hue-rotate') {\n let rotation = geom.d2r(v % 360);\n let cosR = Math.cos(rotation);\n let sinR = Math.sin(rotation);\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + cosR * 0.787 - sinR * 0.213, 0.715 - cosR * 0.715 - sinR * 0.715, 0.072 - cosR * 0.072 + sinR * 0.928, 0, 0,\n 0.213 - cosR * 0.213 + sinR * 0.143, 0.715 + cosR * 0.285 + sinR * 0.140, 0.072 - cosR * 0.072 - sinR * 0.283, 0, 0,\n 0.213 - cosR * 0.213 - sinR * 0.787, 0.715 - cosR * 0.715 + sinR * 0.715, 0.072 + cosR * 0.928 + sinR * 0.072, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'saturate' && v !== 100) {\n let amount = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + 0.787 * amount, 0.715 - 0.715 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 + 0.285 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 - 0.715 * amount, 0.072 + 0.928 * amount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'brightness' && v !== 100) {\n let b = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'grayscale' && v > 0) {\n let oneMinusAmount = 1 - v * 0.01;\n if(oneMinusAmount < 0) {\n oneMinusAmount = 0;\n }\n else if(oneMinusAmount > 1) {\n oneMinusAmount = 1;\n }\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.2126 + 0.7874 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 + 0.2848 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 + 0.9278 * oneMinusAmount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'contrast' && v !== 100) {\n let amount = v * 0.01;\n let o = -0.5 * amount;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n amount, 0, 0, 0, o,\n 0, amount, 0, 0, o,\n 0, 0, amount, 0, o,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n });\n // 切换回主程序\n gl.useProgram(gl.program);\n gl.viewport(0, 0, W, H);\n return mockCache;\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核d扩大3倍性能慢\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * 先动态生成gl程序,默认3核源码示例已注释,根据sigma获得d(一定奇数),再计算权重\n * 然后将d尺寸和权重拼接成真正程序并编译成program,再开始绘制\n */\nfunction genBlurWebgl(gl, texCache, cache, sigma, width, height, sx1, sy1, bbox) {\n let d = blur.kernelSize(sigma);\n let max = Math.max(15, gl.getParameter(gl.MAX_VARYING_VECTORS));\n while(d > max) {\n d -= 2;\n }\n let spread = blur.outerSizeByD(d);\n width += spread * 2;\n height += spread * 2;\n // 防止超限,webgl最大纹理尺寸限制\n let limit = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n if(width > limit || height > limit) {\n return;\n }\n bbox = bbox.slice(0);\n bbox[0] -= spread;\n bbox[1] -= spread;\n bbox[2] += spread;\n bbox[3] += spread;\n let cx = width * 0.5, cy = height * 0.5;\n let weights = blur.gaussianWeight(sigma, d);\n let vert = '';\n let frag = '';\n let r = Math.floor(d * 0.5);\n for(let i = 0; i < r; i++) {\n let c = (r - i) * 0.01;\n vert += `\\nv_texCoordsBlur[${i}] = a_texCoords + vec2(-${c}, -${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i}]) * ${weights[i]};`;\n }\n vert += `\\nv_texCoordsBlur[${r}] = a_texCoords;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${r}]) * ${weights[r]};`;\n for(let i = 0; i < r; i++) {\n let c = (i + 1) * 0.01;\n vert += `\\nv_texCoordsBlur[${i + r + 1}] = a_texCoords + vec2(${c}, ${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i + r + 1}]) * ${weights[i + r + 1]};`;\n }\n vert = vertexBlur.replace('[3]', '[' + d + ']').replace(/}$/, vert + '}');\n frag = fragmentBlur.replace('[3]', '[' + d + ']').replace(/}$/, frag + '}');\n let program = webgl.initShaders(gl, vert, frag);\n gl.useProgram(program);\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n texture = webgl.drawBlur(gl, program, frameBuffer, texCache, texture, cache.page.texture, i, j,\n width, height, cx, cy, spread, d, sigma);\n // 销毁这个临时program\n gl.deleteShader(program.vertexShader);\n gl.deleteShader(program.fragmentShader);\n gl.deleteProgram(program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n texCache.releaseLockChannel(j);\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox);\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genColorMatrixWebgl(gl, texCache, cache, m, width, height, sx1, sy1, bbox) {\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n gl.useProgram(gl.programCm);\n webgl.drawCm(gl, gl.programCm, j, m);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox.slice(0));\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genOverflowWebgl(gl, texCache, node, cache, W, H) {\n let sbox = node.bbox.slice(0);\n let bbox = cache.bbox;\n // 没超过无需生成\n if(bbox[0] >= sbox[0] && bbox[1] >= sbox[1] && bbox[2] <= sbox[2] && bbox[3] <= sbox[3]) {\n return;\n }\n let width = sbox[2] - sbox[0], height = sbox[3] - sbox[1];\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n // 绘制,根据坐标裁剪使用原本纹理的一部分\n gl.useProgram(gl.programOverflow);\n webgl.drawOverflow(gl, j, sbox[0] - bbox[0], sbox[1] - bbox[1], width, height, cache.width, cache.height);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let overflowCache = new MockCache(gl, texture, cache.sx1, cache.sy1, width, height, sbox);\n texCache.releaseLockChannel(i, overflowCache.page);\n return overflowCache;\n}\n\nfunction genMaskWebgl(gl, texCache, node, __config, cache, W, H, 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);console.log(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 // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n assignMatrix(m, matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n // node本身有或者父有perspective都认为需要生成3d渲染上下文\n if(tf.isPerspectiveMatrix(matrix) || parentPm) {\n if(hasRecordAsMask) {\n hasRecordAsMask[9] = true;\n }\n else {\n hasRecordAsMask = [i, lv, total, node, __config, null, null, null, null, true];\n }\n }\n // 先左乘perspective的矩阵,再左乘父级的总矩阵\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n 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 }\n else {\n mergeList.push([i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective]);\n }\n }\n }\n let limitHash = {};\n // 根据收集的需要合并局部根的索引,尝试合并,按照层级从大到小,索引从大到小的顺序,\n // 这样保证子节点在前,后节点在前,后节点是为了mask先应用自身如filter之后再进行遮罩\n if(mergeList.length) {\n mergeList.sort(function(a, b) {\n if(a[1] === b[1]) {\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n mergeList.forEach(item => {\n let [i, lv, total, node, __config, limitCache, hasMask, filter, overflow] = item;\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n } = __config;\n let needGen;\n // 可能没变化,比如被遮罩节点、filter变更等\n if(!__cacheTotal || !__cacheTotal.available) {\n let [limit, res] = genTotalWebgl(gl, texCache, node, __config, i, total || 0, __structs, __cache, limitCache, 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 target = genOverflowWebgl(gl, texCache, node, target, width, height);\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n if(filter.length) {\n if(!__cacheFilter || !__cacheFilter.available || needGen) {\n let old = target;\n target = genFilterWebgl(gl, texCache, node, target, filter, width, height);\n if(target !== old) {\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n }\n if(hasMask && (!__cacheMask || !__cacheMask.available || needGen)) {\n target = genMaskWebgl(gl, texCache, node, __config, target, width, height, 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 m = mx.m2Mat4(matrixEvent, cx, cy);\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 }\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[0] !== page || page.update) {\n // page可能为一个已有纹理,或者贴图\n if(page instanceof MockPage) {\n webgl.bindTexture(gl, page.texture, i);\n channels[i] = page;\n }\n else {\n // 可能老的先删除\n if(last) {\n gl.deleteTexture(last.texture);\n }\n page.texture = webgl.createTexture(gl, page.canvas, i);\n channels[i] = page;\n }\n hash[page.uuid] = i;\n }\n else {\n hash[page.uuid] = i;\n }\n // 标识没有更新,以及最后使用时间\n page.update = false;\n page.time = inject.now();\n }\n // 再次遍历开始本次渲染并清空\n webgl.drawTextureCache(gl, list, hash, cx, cy, revertY);\n pages.splice(0);\n list.splice(0);\n }\n }\n\n findExistTexChannel(page) {\n return this.channels.indexOf(page);\n }\n\n /**\n * 获取并锁定一个纹理单元优先使用空的,其次最久未使用的\n * @returns {number|*}\n */\n lockOneChannel() {\n // 优先返回空单元\n let channels = this.channels;\n let locks = this.locks;\n for(let i = 0; i < this.__units; i++) {\n if(!channels[i] && !locks[i]) {\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n }\n // 根据NRU返回最久未使用的\n let units = this.__units;\n let cl = [];\n for(let i = 0; i < units; i++) {\n if(!locks[i]) {\n cl.push([i, channels[i]]);\n }\n }\n if(cl.length) {\n cl.sort(function(a, b) {\n if(a[1].time !== b[1].time) {\n return (a[1].time || 0) - (b[1].time || 0);\n }\n if(a[1].fullSize !== b[1].fullSize) {\n return a[1].fullSize - b[1].fullSize;\n }\n return a[0] - b[0];\n });\n let i = cl[0][0];\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n throw new Error('No free texture unit');\n }\n\n /**\n * 释放掉i单元,并且设置内容到缓存channel中\n * @param i\n * @param setToChannel\n */\n releaseLockChannel(i, setToChannel) {\n if(this.locks[i]) {\n this.locks[i] = false;\n this.__lockUnits--;\n if(setToChannel) {\n this.channels[i] = setToChannel;\n }\n }\n }\n\n // 指定锁定一个单元\n lockChannel(i) {\n let channels = this.channels;\n let locks = this.locks;\n if(!locks[i]) {\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n }\n }\n\n /**\n * 释放纹理单元\n * @param gl\n */\n release(gl) {\n this.channels.forEach(item => {\n if(item) {\n gl.deleteTexture(item.texture);\n }\n });\n }\n\n get channels() {\n return this.__channels;\n }\n\n get locks() {\n return this.__locks;\n }\n\n 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 // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d');\n this.__renderMode = mode.CANVAS;\n }\n else if(this.tagName === 'svg') {\n this.__renderMode = mode.SVG;\n }\n else if(this.tagName === 'webgl') {\n let gl = this.__ctx = this.__dom.getContext('webgl', ca);\n this.__renderMode = mode.WEBGL;\n gl.program = webgl.initShaders(gl, vertex, fragment);\n gl.programMask = webgl.initShaders(gl, vertexMask, fragmentMask);\n gl.programClip = webgl.initShaders(gl, vertexMask, fragmentClip);\n gl.programOverflow = webgl.initShaders(gl, vertexMask, fragmentOverflow);\n gl.programCm = webgl.initShaders(gl, vertexCm, fragmentCm);\n gl.useProgram(gl.program);\n // 第一次渲染生成纹理缓存管理对象,收集渲染过程中生成的纹理并在gl纹理单元满了时进行绘制和清空,减少texImage2d耗时问题\n const MAX_TEXTURE_IMAGE_UNITS = Math.min(16, gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));\n this.__texCache = new TexCache(MAX_TEXTURE_IMAGE_UNITS);\n }\n this.refresh(null, true);\n // 第一次节点没有__root,渲染一次就有了才能diff\n if(this.dom.__root && this.dom.__root instanceof Root) {\n this.dom.__root.destroy();\n }\n this.__eventCbList = initEvent(this.dom, Root);\n this.dom.__root = this;\n }\n\n refresh(cb, isFirst) {\n this.__hookTask = null;\n let { isDestroyed, renderMode, ctx, defs, width, height } = this;\n if(isDestroyed) {\n return;\n }\n defs.clear();\n // 首次递归测量整树的继承,后续更改各自更新机制做,防止每次整树遍历;root检查首次直接做,后续在checkUpdate()中插入\n if(isFirst) {\n this.__checkRoot(renderMode, width, height);\n this.__computeMeasure(renderMode, ctx);\n }\n // 非首次刷新如果没有更新则无需继续\n else if(!this.__checkUpdate(renderMode, ctx, width, height)) {\n return;\n }\n // 获取所有字体和大小测量,仅svg需要,canvas直接做\n inject.measureText();\n this.__checkReflow(width, height);\n if(renderMode === mode.CANVAS && !this.props.noRender) {\n this.__clear(ctx, renderMode);\n 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 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 let hasUpdate;\n // root更新特殊提前,因为有继承因素\n if(updateRoot) {\n root.__updateRoot = null;\n hasUpdate = parseUpdate(renderMode, root, updateRoot,\n reflowList, measureList, cacheHash, cacheList);\n // 此时做root检查,防止root出现继承等无效样式,或者发生resize()\n if(hasUpdate) {\n root.__checkRoot(renderMode, width, height);\n }\n }\n // 汇总处理每个节点,k是递增数字直接循环遍历\n let keys = Object.keys(updateHash);\n for(let i = 0, len = keys.length; i < len; i++) {\n let t = parseUpdate(renderMode, root, updateHash[keys[i]],\n reflowList, measureList, cacheHash, cacheList, zHash, zList);\n hasUpdate = hasUpdate || t;\n }\n // 先做一部分reset避免下面measureList干扰,cacheList的是专门收集新增的额外节点\n root.__reflowList = reflowList;\n uniqueUpdateId = 0;\n root.__updateHash = root.__config[NODE_UPDATE_HASH] = {};\n cacheList.forEach(__config => {\n delete __config[NODE_UNIQUE_UPDATE_ID];\n });\n // zIndex改变的汇总修改,防止重复操作\n zList.forEach(item => {\n if(item.hasOwnProperty('__uniqueZId')) {\n delete item.__uniqueZId;\n item.__updateStruct(root.__structs);\n }\n });\n /**\n * 遍历每项节点,计算测量信息,节点向上向下查找继承信息,如果parent也是继承,先计算parent的\n * 过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n */\n let measureHash = {};\n measureList.forEach(node => {\n let { __config:{ [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId, [NODE_DOM_PARENT]: parent } } = node;\n // 在root下的component变更时root会进入,但其没有__uniqueUpdateId\n if(node !== root) {\n if(measureHash.hasOwnProperty(__uniqueUpdateId)) {\n return;\n }\n measureHash[__uniqueUpdateId] = true;\n }\n let last = node;\n // 检查measure的属性是否是inherit,在root下的component变更时root会进入,但其没有__uniqueUpdateId\n // 另外dom标识表明有dom变更强制进入\n let isInherit = node !== root\n && (updateHash[__uniqueUpdateId][UPDATE_ADD_DOM]\n || change.isMeasureInherit(updateHash[__uniqueUpdateId][UPDATE_STYLE]));\n // 是inherit,需要向上查找,从顶部向下递归计算继承信息\n if(isInherit) {\n while(parent && parent !== root) {\n let { __config: {\n [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId,\n }, currentStyle } = parent;\n let isInherit;\n if(parent.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n let style = updateHash[__uniqueUpdateId][UPDATE_STYLE];\n measureHash[__uniqueUpdateId] = true;\n let temp = change.measureInheritList(style);\n isInherit = !!temp.length;\n }\n else {\n isInherit = change.isMeasureInherit(currentStyle);\n }\n // 如果parent有inherit存入列表且继续向上,否则跳出循环\n if(isInherit) {\n last = parent;\n }\n else {\n break;\n }\n // 考虑component下的继续往上继承\n parent = parent.domParent;\n }\n }\n // 自顶向下查找inherit的,利用已有的方法+回调,当递归包含重复时标记防止重复\n last.__computeMeasure(renderMode, ctx, function(target) {\n if(target.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n measureHash[target.__config[NODE_UNIQUE_UPDATE_ID]] = true;\n }\n });\n });\n // 做完清空留待下次刷新重来\n for(let i = 0, len = keys.length; i < len; i++) {\n delete updateHash[keys[i]][UPDATE_CONFIG][NODE_UNIQUE_UPDATE_ID];\n }\n return hasUpdate;\n }\n\n /**\n * 除首次外每次刷新前检查reflow列表,计算需要reflow的节点局部重新布局\n * 当一个元素absolute不变时,其变化不会影响父元素和兄弟元素,直接自己重新局部LAYOUT包含子节点\n * 当absolute发生改变时,其变化会影响父和兄弟,视作父重新布局\n * 当inline变化时,视为其最近block/flex父变化\n * 当block变化时,往上查找最上层flex视为其变化,如不是则影响后面兄弟offset和父resize\n * 当flex变化时,往上查找最上层flex视为其变化,如不是则影响所有递归子节点layout和父resize\n * 以上3种情况向上查找时遇到absolute父均提前跳出,并标记absolute父LAYOUT\n * 上面所有情况即便结束还得额外看是否处于absolute中,是还是标记absolute重新布局\n * 当relative只变化left/top/right/bottom时,自己重新layout\n * 检测节点时记录影响的所有节点,最终形成一棵或n棵局部树\n * 需要重新布局的记作LAYOUT,被兄弟影响只需偏移的记作OFFSET,OFFSET可能会重复变为LAYOUT\n * 上述情况倘若发生包含重复,去掉子树,因子树视为被包含的重新布局\n * 如果有从root开始的,直接重新布局像首次那样即可\n * 如果非root,所有树根按先根顺序记录下来,依次执行局部布局\n * =========================\n * addDom比较特殊,是向已有节点中添加新的节点,检查影响与普通domDiff变化不同\n * @private\n */\n __checkReflow(width, height) {\n let { __reflowList: reflowList } = this;\n if(!reflowList.length) {\n return;\n }\n let root = this;\n let uniqueList = [];\n let hasRoot;\n __uniqueReflowId = 0;\n let reflowHash = {};\n // 遍历检查发生布局改变的节点列表,此时computedStyle还是老的,currentStyle是新的\n for(let i = 0, len = reflowList.length; i < len; i++) {\n let item = reflowList[i];\n let { node, component, addDom, removeDom } = item;\n // root提前跳出,完全重新布局\n if(node === this) {\n hasRoot = true;\n break;\n }\n // 添加时如果是cp则node取sr来布局\n if(addDom && node instanceof Component) {\n node = node.shadowRoot;\n }\n // 每个节点生成唯一的布局识别id存入hash防止重复\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n reflowHash[__uniqueReflowId++] = item;\n }\n // 每个节点都向上检查影响,以及是否从root开始完全重新,remove特殊对待,影响父节点视为普通父节点relay\n if(checkInfluence(root, reflowHash, node, component, addDom)) {\n hasRoot = true;\n if(addDom) {\n this.__zIndexChildren = null;\n }\n break;\n }\n // remove的要特殊对待,因为提前删除了父子兄弟关系,下面deepScan不会出现\n else if(removeDom) {\n uniqueList.push(item);\n }\n }\n __uniqueReflowId = 0;\n this.__reflowList = [];\n // 有root提前跳出\n if(hasRoot) {\n reflow.clearUniqueReflowId(reflowHash);\n // 布局分为两步,普通流和定位流,互相递归\n this.__layout({\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n // 绝对布局需要从根开始保存相对坐标系的容器引用,并根据relative/absolute情况变更\n this.__layoutAbs(this, {\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n this.__structs = this.__structure(0, 0);\n return true;\n }\n /**\n * 修剪树,自顶向下深度遍历\n * LAYOUT节点作为局部根,其递归子节点无需重复任何操作,直接去重\n * OFFSET节点作为局部根,其递归子节点先执行任何操作,后续根节点再偏移一次\n */\n else {\n this.__deepScan(function(node, options) {\n if(node.hasOwnProperty('__uniqueReflowId')) {\n let o = reflowHash[node.__uniqueReflowId];\n options.uniqueList.push(o);\n // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行\n return true;\n }\n // reflowHash没有记录则无返回继续递归执行\n }, { uniqueList });\n /**\n * 按顺序执行列表即可,上层LAYOUT先执行且停止递归子节点,上层OFFSET后执行等子节点先LAYOUT/OFFSET\n * 同级按先后顺序排列,过程中记录diff在结束后进行structs更新\n * 这里要注意margin合并的逻辑,因为最终都是block(flex等同),需要进行合并\n * 在处理一个block时,先判断是否是空block,同时看后面紧邻的有没有在uniqueList的下一个\n * 单独空block处理、2个相邻的非block处理直接可以进行判断\n * 中间的空block(即非空block的下一个是空block,且下一个不是最后一个),先记录下来list,合并后一并offset\n * 合并margin和Dom的逻辑一样,抽离共有方法\n **/\n let diffList = [];\n let diffI = 0;\n let mergeOffsetList = [];\n let __uniqueMergeOffsetId = 0;\n uniqueList.forEach(item => {\n let { node, component, addDom, removeDom } = item;\n // 重新layout的w/h数据使用之前parent暂存的,x使用parent,y使用prev或者parent的\n let cps = node.computedStyle, cts = node.currentStyle;\n let zIndex = cps[Z_INDEX], position = cps[POSITION], display = cps[DISPLAY];\n let isLastAbs = position === 'absolute';\n let isNowAbs = cts[POSITION] === 'absolute';\n let isLastNone = display === 'none';\n let isNowNone = cts[DISPLAY] === 'none';\n // none不可见布局无效可以无视\n if(isLastNone && isNowNone) {\n return;\n }\n let parent = node.domParent;\n let { __layoutData: { x, y, h }, width, computedStyle } = parent;\n let current = node;\n // cp的shadowRoot要向上到cp本身,考虑高阶组件在内到真正的顶层cp\n if(current.isShadowRoot) {\n current = current.hostRoot;\n }\n // y使用prev或者parent的,首个节点无prev,prev要忽略absolute的和display:none的\n let ref = current.prev;\n let hasFlowPrev;\n while(ref) {\n if(ref instanceof Text\n || (ref.computedStyle[POSITION] !== 'absolute' && ref.computedStyle[DISPLAY] !== 'none')) {\n y = ref.y + ref.outerHeight;\n hasFlowPrev = true;\n break;\n }\n ref = ref.prev;\n }\n // 找不到prev以parent为基准,找到则增加自身,排除remove\n if(!removeDom) {\n if(!hasFlowPrev) {\n y += computedStyle[MARGIN_TOP] + computedStyle[BORDER_TOP_WIDTH] + computedStyle[PADDING_TOP];\n }\n x += computedStyle[MARGIN_LEFT] + computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT];\n }\n // 找到最上层容器,如果是组件的子节点,以sr为container,sr本身往上找\n let container = node;\n // remove的节点本身无需再次布局\n if(!removeDom) {\n if(isNowAbs) {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n if(!container) {\n container = root;\n }\n // 由setState引发的要检查是cp自身还是更上层,如果cp被abs包含,那么node是cp的父亲,否则node是cp的sr\n // 而这种情况下传cp或node都一样,所以最终统一传node\n parent.__layoutAbs(container, null, node);\n // 优先判断dom变更\n if(addDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n return;\n }\n // 前后都是abs无需偏移后面兄弟和parent调整,component变化节点需更新struct\n else if(isLastAbs) {\n if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n }\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n return;\n }\n // 标识flow变abs,可能引发zIndex变更,重设struct和svg\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // 现在是普通流,不管之前是啥直接布局,排除remove删除的\n else {\n node.__layout({\n x,\n y,\n w: width,\n h,\n });\n y += node.outerHeight;\n if(component) {\n container = node;\n }\n else {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n }\n if(!container) {\n container = root;\n }\n // 防止geom\n if(node instanceof Dom) {\n node.__layoutAbs(container, {\n x,\n y,\n w: width,\n h,\n });\n }\n }\n }\n\n // 向上查找最近的parent是relative,需再次累加ox/oy,无需继续向上递归,因为parent已经递归包含了\n // 这样node重新布局后再次设置其使用parent的偏移\n let p = node;\n while(p && p !== root) {\n p = p.domParent;\n computedStyle = p.computedStyle;\n if(computedStyle[POSITION] === 'relative') {\n let { ox, oy } = p;\n ox && node.__offsetX(ox);\n oy && node.__offsetY(oy);\n break;\n }\n }\n\n // 向下调整next的flow位置,遇到重复LAYOUT的跳出等待其调用并处理其next,忽视掉abs,margin和abs在merge中做\n if(node.isShadowRoot) {\n node = node.hostRoot;\n }\n let next = node.next;\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n if(next.computedStyle[POSITION] === 'absolute') {\n next = next.next;\n continue;\n }\n let { y: oy } = next;\n let diff = y - oy;\n if(diff) {\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n let target = next;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let cs = target.computedStyle;\n if(cs[POSITION] !== 'absolute' && cs[DISPLAY] !== 'none') {\n target.__offsetY(diff, true, REPAINT);\n }\n next = next.next;\n }\n }\n break;\n }\n\n // 去重防止abs并记录parent,整个结束后按先序顺序进行margin合并以及偏移,注意忽略有display:none变block同时为absolute的\n if(!parent.hasOwnProperty('__uniqueMergeOffsetId') && !(isNowAbs && isLastNone)) {\n parent.__uniqueMergeOffsetId = __uniqueMergeOffsetId++;\n mergeOffsetList.push(parent);\n }\n\n // add和remove都需父节点重新生成struct,zIndexChildren已在对应api操作的before()侦听做了\n if(addDom || removeDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // component未知dom变化,所以强制重新struct,text则为其父节点,同时防止zIndex变更影响父节点\n else if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n node.domParent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(node.domParent);\n }\n }\n }\n // display有none变化,重置struct和zIndexChildren\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n });\n /**\n * mergeMargin后续调整,记录的是变更节点的父节点,因此每个节点内部直接遍历孩子进行\n * 由于保持先根遍历的顺序,因此会从最上最里的节点开始,先进行margin合并\n * 由于之前忽略掉abs节点,因此再检查直接abs是否要调整\n * 完成后对此父节点的后续兄弟节点进行调整,多次不会干扰影响\n * 然后继续往上循环,直到root结束\n */\n let inDirectAbsList = [];\n mergeOffsetList.forEach(parent => {\n delete parent.__uniqueMergeOffsetId;\n let flowChildren = parent.flowChildren, absChildren = parent.absChildren;\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length, lastChild;\n let isStart, startIndex, startNode;\n // 遍历flow孩子,从开始变化的节点开始,看变化造成的影响,对其后面节点进行偏移,并统计总偏移量\n for(let i = 0; i < length; i++) {\n let item = flowChildren[i];\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n let isXom = item instanceof Xom;\n // 忽略掉前面没有变更的节点,不能合并\n if(!isStart && isXom) {\n if(item.hasOwnProperty('__uniqueReflowId')) {\n isStart = true;\n startIndex = i;\n startNode = item;\n }\n }\n // 开始变更的节点,至少不是第0个\n let cs = isXom && item.currentStyle;\n let isInline = isXom && cs[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(cs[DISPLAY]) > -1;\n lastChild = item;\n // 每次循环开始前,这次不是block的话,看之前遗留的,可能是以空block结束,需要特殊处理,单独一个空block也包含\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length && isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n // 和普通布局类似,只是不用重新布局只需处理合并margin再根据差值偏移\n if(isXom && !isInline) {\n let isNone = isXom && cs[DISPLAY] === 'none';\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n // 空block要留下轮循环看,除非是最后一个,非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n if(isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n // 需要合并的情况,根据记录数和索引向上向下遍历节点设置偏移,同时设置总偏移量供父级使用\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0,最后一个一定有不必判断isStart\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n }\n // 先检查parent的尺寸是否发生了变化,从而决定是否调整next以及向上递归调整\n let cs = parent.currentStyle;\n let height = cs[HEIGHT];\n let isContainer = parent === root || parent.isShadowRoot || cs[POSITION] === 'absolute' || cs[POSITION] === 'relative';\n if(height[1] === AUTO && lastChild) {\n let oldH = parent.height + parent.computedStyle[PADDING_TOP];\n let nowH = lastChild.y + lastChild.outerHeight - parent.y;\n let diff = nowH - oldH;\n // 调整next以及非固定PX的abs,再递归向上\n if(diff) {\n parent.__resizeY(diff, REPAINT);\n let container;\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = item.currentStyle;\n // 是容器,所有的都调整,不是容器,其偏移是上级parent的某一个,根据情况具体不同\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n else if(bottom[1] === PX) {\n item.__offsetY(diff, true, REPAINT);\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n else if(top[1] === PERCENT) {\n if(isContainer) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n // 非容器的特殊处理\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n if(container.currentStyle[HEIGHT][1] !== PX) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, null, item);\n }\n // 不在容器内说明在上级,存入等结束后统一重新布局\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, item]);\n }\n }\n }\n reflow.offsetAndResizeByNodeOnY(parent, root, reflowHash, diff, inDirectAbsList);\n return;\n }\n }\n // 没有diff变化或者固定尺寸,可能内部发生变化,调整AUTO的abs,不递归向上\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom } = item.currentStyle;\n if(top[1] === AUTO && bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n }\n });\n // merge过程中需要重新布局的abs\n inDirectAbsList.forEach(arr => {\n arr[0].__layoutAbs(arr[1], null, arr[2]);\n });\n\n // 调整因reflow造成的原struct数据索引数量偏差,纯zIndex的已经在repaint里面重新生成过了\n // 这里因为和update保持一致的顺序,因此一定是先根顺序且互不包含\n let diff = 0, lastIndex = 0, isFirst = true, structs = root.__structs;\n diffList.forEach(item => {\n let [ns, d] = item;\n // 第一个有变化的,及后面无论有无变化都需更新\n // 第1个变化区域无需更改前面一段\n if(isFirst) {\n isFirst = false;\n lastIndex = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1;\n diff += d;\n }\n // 第2+个变化区域看是否和前面一个相连,有不变的段则先偏移它,然后再偏移自己\n else {\n let j = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1 + diff;\n for(let i = lastIndex; i < j; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n lastIndex = j;\n diff += d;\n }\n });\n // 后面的要根据偏移量校正索引\n if(diff) {\n for(let i = lastIndex, len = structs.length; i < len; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n }\n // 清除id\n reflow.clearUniqueReflowId(reflowHash);\n }\n }\n\n // 特殊覆盖方法,不需要super()计算自己,因为放在每次checkRoot()做过了\n __computeMeasure(renderMode, ctx) {\n css.computeMeasure(this, true);\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx);\n });\n }\n\n // 每个root拥有一个刷新hook,多个root塞到frame的__hookTask里\n // frame在所有的帧刷新逻辑执行后检查hook列表,进行root刷新操作\n __frameHook() {\n if(!this.__hookTask) {\n let r = this.__hookTask = (() => {\n this.refresh();\n });\n frame.__hookTask.push(r);\n }\n }\n\n __clear(ctx, renderMode) {\n if(renderMode === mode.CANVAS) {\n // 可能会调整宽高,所以每次清除用最大值\n this.__mw = Math.max(this.__mw, this.width);\n this.__mh = Math.max(this.__mh, this.height);\n // 清除前得恢复默认matrix,防止每次布局改变了属性\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, this.__mw, this.__mh);\n }\n else if(renderMode === mode.WEBGL) {\n ctx.clearColor(0, 0, 0, 0);\n ctx.clear(ctx.COLOR_BUFFER_BIT);\n }\n }\n\n get dom() {\n return this.__dom;\n }\n\n get uuid() {\n return this.__uuid;\n }\n\n get renderMode() {\n return this.__renderMode;\n }\n\n get ctx() {\n return this.__ctx;\n }\n\n get defs() {\n return this.__defs;\n }\n\n get taskUp() {\n return this.__taskUp;\n }\n\n get taskCp() {\n return this.__taskCp;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get animateController() {\n return this.__animateController;\n }\n\n get texCache() {\n return this.__texCache;\n }\n}\n\nexport default Root;\n","import Geom from './Geom';\nimport mode from '../mode';\nimport painter from '../../util/painter';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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.length >= 2) {\n num++;\n }\n if(controlB.length >= 2) {\n num += 2;\n }\n return num;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getNewPoint(x1, y1, x2, y2, controlA, controlB, num, start = 0, end = 1) {\n if(start > 0 || end < 1) {\n if(num === 3) {\n [[x1, y1], controlA, controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, controlB, [x2, y2]], start, end);\n }\n else if(num === 2) {\n [[x1, y1], controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlB, [x2, y2]], start, end);\n }\n else if(num === 1) {\n [[x1, y1], controlA, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, [x2, y2]], start, end);\n }\n else {\n let a = Math.abs(x1 - x2);\n let b = Math.abs(y1 - y2);\n x1 += a * start;\n y1 += b * start;\n x2 -= a * (1 - end);\n y2 -= b * (1 - end);\n }\n }\n return [x1, y1, x2, y2, controlA, controlB];\n}\n\nclass Line extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // x1,y1和x2,y2表明线段的首尾坐标,control表明控制点坐标\n if(this.isMulti) {\n this.__x1 = [0];\n this.__y1 = [0];\n this.__x2 = [1];\n this.__y2 = [1];\n this.__controlA = [[]];\n this.__controlB = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.x1)) {\n this.__x1 = props.x1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x1)) {\n this.__x1 = [parseFloat(props.x1) || 0];\n }\n if(Array.isArray(props.y1)) {\n this.__y1 = props.y1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y1)) {\n this.__y1 = [parseFloat(props.y1) || 0];\n }\n if(Array.isArray(props.x2)) {\n this.__x2 = props.x2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x2)) {\n this.__x2 = [parseFloat(props.x2) || 0];\n }\n if(Array.isArray(props.y2)) {\n this.__y2 = props.y2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y2)) {\n this.__y2 = [parseFloat(props.y2) || 0];\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__x1.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__x1.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__x1.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__x1.map(() => v);\n }\n }\n else {\n this.__x1 = this.__y1 = this.__start = 0;\n this.__x2 = this.__y2 = this.__end = 1;\n this.__controlA = [];\n this.__controlB = [];\n if(!isNil(props.x1)) {\n this.__x1 = parseFloat(props.x1) || 0;\n }\n if(!isNil(props.y1)) {\n this.__y1 = parseFloat(props.y1) || 0;\n }\n if(!isNil(props.x2)) {\n this.__x2 = parseFloat(props.x2) || 0;\n }\n if(!isNil(props.y2)) {\n this.__y2 = parseFloat(props.y2) || 0;\n }\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA;\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB;\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, __cacheProps, isMulti } = this;\n let rebuild;\n ['x1', 'x2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originX, width, isMulti);\n }\n });\n ['y1', 'y2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originY, height, isMulti);\n }\n });\n ['controlA', 'controlB'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuildC(this[k], originX, originY, width, height, isMulti);\n }\n });\n ['start', 'end'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = this[k];\n }\n });\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 },\n } = this;\n this.buildCache(originX, originY);\n let { x1, y1, x2, y2, controlA, controlB } = __cacheProps;\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n if(!isMulti) {\n x1 = [x1];\n x2 = [x2];\n y1 = [y1];\n y2 = [y2];\n controlA = [controlA];\n controlB = [controlB];\n }\n x1.forEach((xa, i) => {\n let ya = y1[i];\n let xb = x2[i];\n let yb = y2[i];\n let ca = controlA[i];\n let cb = controlB[i];\n if((isNil(ca) || ca.length < 2) && (isNil(cb) || cb.length < 2)) {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[0] = Math.min(bbox[0], xb - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[1] = Math.min(bbox[1], yb - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[2] = Math.max(bbox[2], xb + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n bbox[3] = Math.max(bbox[3], yb + oy);\n }\n else if(isNil(ca) || ca.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(isNil(cb) || cb.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n });\n return bbox;\n }\n}\n\nexport default Line;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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 limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getLength(list, isMulti) {\n let res = [];\n let total = 0;\n let increase = [];\n if(isMulti) {\n total = [];\n list.forEach(list => {\n let temp = getLength(list);\n res.push(temp.list);\n total.push(temp.total);\n increase.push([0].concat(temp.increase));\n });\n }\n else if(Array.isArray(list)) {\n total = 0;\n increase.push(0);\n let start = 0;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item)) {\n start = i;\n break;\n }\n }\n let prev = list[start];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n let a = Math.abs(item[0] - prev[0]);\n let b = Math.abs(item[1] - prev[1]);\n let c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n res.push(c);\n total += c;\n increase.push(total);\n prev = item;\n }\n else if(item.length === 4) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]]], 2);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[2], item[3]];\n }\n else if(item.length === 6) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]], [item[4], item[5]]], 3);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[4], item[5]];\n }\n }\n }\n return {\n list: res,\n total,\n increase,\n };\n}\n\nfunction getIndex(list, t, i, j) {\n if(i === j) {\n if(list[i] > t) {\n return i - 1;\n }\n return i;\n }\n let middle = i + ((j - i) >> 1);\n if(list[middle] === t) {\n return middle;\n }\n else if(list[middle] > t) {\n return getIndex(list, t, i, Math.max(middle - 1, i));\n }\n else {\n return getIndex(list, t, Math.min(middle + 1, j), j);\n }\n}\n\nfunction getNewList(list, len, start = 0, end = 1) {\n if(start === 0 && end === 1) {\n return list;\n }\n if(start >= end) {\n return [];\n }\n let i = 0, j = list.length - 1;\n if(start > 0) {\n i = getIndex(len.increase, start * len.total, i, j);\n }\n if(end < 1) {\n j = getIndex(len.increase, end * len.total, i, j);\n }\n list = util.clone(list);\n end *= len.total;\n let prePercent = 1;\n if(end > len.increase[j]) {\n let prev = list[j].slice(list[j].length - 2); // 最后2个点是x,y,前面是control\n let current = list[j + 1];\n let l = len.list[j];\n let diff = end - len.increase[j];\n let t = diff / l;\n prePercent = t;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[j + 1] = [current[1] - (1 - t) * a, current[1] - (1 - t) * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], res[3][0], res[3][1]];\n }\n }\n start *= len.total;\n if(start > len.increase[i]) {\n let prev = list[i].slice(list[i].length - 2);\n let current = list[i + 1];\n let l = len.list[i];\n // 同一条线段时如果有end裁剪,会影响start长度\n if(i === j && prePercent !== 1) {\n l *= prePercent;\n }\n let diff = start - len.increase[i];\n let t = diff / l;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[i] = [prev[0] + t * a, prev[1] + t * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([[current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([[current[4], current[5]], [current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], current[4], current[5]];\n }\n }\n if(j < list.length - 2) {\n list = list.slice(0, j + 2);\n }\n if(i > 0) {\n list = list.slice(i);\n }\n return list;\n}\n\nclass Polyline extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 所有点的列表\n if(this.isMulti) {\n this.__points = [[]];\n this.__controls = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__points.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__points.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__points.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__points.map(() => v);\n }\n }\n else {\n this.__points = [];\n // 控制点\n this.__controls = [];\n this.__start = 0;\n this.__end = 1;\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n }\n if(Array.isArray(props.controls)) {\n this.__controls = props.controls;\n }\n if(Array.isArray(props.points)) {\n this.__points = props.points;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n return points.map((item, i) => {\n if(!Array.isArray(item)) {\n return;\n }\n let len = item.length;\n if(isControl) {\n if(len !== 0 && len !== 2 && len !== 4) {\n return;\n }\n }\n else {\n if(len !== 0 && len !== 2) {\n return;\n }\n }\n let res = [];\n for(let i = 0; i < len; i++) {\n if(i % 2 === 0) {\n res.push(originX + item[i] * width);\n }\n else {\n res.push(originY + item[i] * height);\n }\n }\n return res;\n });\n }\n\n // 供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 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 },\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let { points, controls } = __cacheProps;\n if(!isMulti) {\n points = [points];\n controls = [controls];\n }\n points.forEach((pointList, i) => {\n if(!pointList || pointList.length < 2 || pointList[0].length < 2 || pointList[1].length < 2) {\n return;\n }\n let controlList = controls[i] || [];\n let [xa, ya] = pointList[0];\n for(let i = 1, len = pointList.length; i < len; i++) {\n let [xb, yb] = pointList[i];\n let c = controlList[i - 1];\n if(c && c.length === 4) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], c[2], c[3], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(c && c.length === 2) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n }\n xa = xb;\n ya = yb;\n }\n });\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Polyline;\n","import Polyline from './Polyline';\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} } = 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Sector;\n","import Geom from './Geom';\nimport util from \"../../util/util\";\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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 }\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n bbox[0] = Math.min(bbox[0], originX - ox);\n bbox[1] = Math.min(bbox[1], originY - oy);\n bbox[2] = Math.max(bbox[2], originX + width + ox);\n bbox[3] = Math.max(bbox[3], originY + height + oy);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Rect;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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));\n }\n else {\n __cacheProps.r = r * width * 0.5;\n __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Circle;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let rx = 0, ry = 0;\n if(isMulti) {\n let mx = 0, my = 0;\n __cacheProps.rx.forEach((rx, i) => {\n mx = Math.max(rx, mx);\n my = Math.max(ry, __cacheProps.ry[i]);\n });\n rx = mx;\n ry = my;\n }\n else {\n rx = __cacheProps.rx;\n ry = __cacheProps.ry;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - rx - ox;\n let xb = cx + rx + ox;\n let ya = cy - ry - oy;\n let yb = cy + ry + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Ellipse;\n","import reset from '../style/reset';\n\nlet fullCssProperty = {\n skewX: 'kx',\n skewY: 'ky',\n transform: 'tf',\n fontSize: 'fz',\n offset: 'os',\n easing: 'e',\n filter: 'ft',\n boxShadow: 'bd',\n overflow: 'of',\n backgroundClip: 'bp',\n textOverflow: 'tof',\n flexWrap: 'fp',\n perspective: 'ppt',\n rotate3d: 'r3',\n};\n\nlet abbrCssProperty = {\n os: 'offset', // 非css属性不会被下面反向遍历插入,手动\n e: 'easing',\n};\n\nlet fullAnimate = {\n value: 'v',\n options: 'o',\n};\n\nlet abbrAnimate = {};\n\nlet fullAnimateOption = {\n duration: 'dt',\n delay: 'd',\n endDelay: 'ed',\n iterations: 'i',\n direction: 'dc',\n fill: 'f',\n fps: 'fp',\n playbackRate: 'p',\n spfLimit: 'sl',\n};\n\nlet abbrAnimateOption = {};\n\nreset.DOM_KEY_SET.concat(reset.GEOM_KEY_SET).forEach(k => {\n if(fullCssProperty.hasOwnProperty(k)) {\n abbrCssProperty[fullCssProperty[k]] = k;\n return;\n }\n let v = k.charAt(0) + k.replace(/[a-z]/g, '').toLowerCase();\n fullCssProperty[k] = v;\n abbrCssProperty[v] = k;\n});\n\nObject.keys(fullAnimate).forEach(k => {\n abbrAnimate[fullAnimate[k]] = k;\n});\n\nObject.keys(fullAnimateOption).forEach(k => {\n abbrAnimateOption[fullAnimateOption[k]] = k;\n});\n\nexport default {\n fullCssProperty,\n abbrCssProperty,\n fullAnimate,\n abbrAnimate,\n fullAnimateOption,\n abbrAnimateOption,\n};\n","import abbr from './abbr';\nimport Node from '../node/Node';\nimport Component from '../node/Component';\nimport $$type from '../util/$$type';\nimport util from '../util/util';\nimport inject from '../util/inject';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet { isNil, isFunction, isPrimitive, clone, extend } = util;\nlet { abbrCssProperty, abbrAnimateOption, abbrAnimate } = abbr;\n\n/**\n * 还原缩写到全称,涉及样式和动画属性\n * @param target 还原的对象\n * @param hash 缩写映射\n */\nfunction abbr2full(target, hash) {\n // 也许节点没写样式\n if(target) {\n Object.keys(target).forEach(k => {\n // var-attr格式特殊考虑,仅映射attr部分,var-还要保留\n if(k.indexOf('var-') === 0) {\n let k2 = k.slice(4);\n if(hash.hasOwnProperty(k2)) {\n let fk = hash[k2];\n target['var-' + fk] = target[k];\n // delete target[k];\n }\n }\n // 普通样式缩写还原\n else if(hash.hasOwnProperty(k)) {\n let fk = hash[k];\n target[fk] = target[k];\n // 删除以免二次解析\n delete target[k];\n }\n });\n }\n}\n\nfunction replaceVars(json, vars) {\n if(json && vars) {\n // 新版vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // 排除特殊的library\n if(Array.isArray(member) && member.length && member[0] !== 'library' && vars.hasOwnProperty(id)) {\n let target = json;\n for(let i = 0, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // undefined和null意义不同\n if(v === undefined) {\n return;\n }\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n target[k] = v;\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Slot miss ' + k);\n return;\n }\n }\n }\n });\n }\n }\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-') === 0) {\n let v = json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(4);\n // 有id且变量里面传入了替换的值,值可为null,因为某些情况下空为自动\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n // undefined和null意义不同\n if(value === undefined) {\n return;\n }\n let target = json;\n // 如果有.则特殊处理子属性\n if(k2.indexOf('.') > -1) {\n let list = k2.split('.');\n let len = list.length;\n for(let i = 0; i < len - 1; i++) {\n k2 = list[i];\n // 避免异常\n if(target[k2]) {\n target = target[k2];\n }\n else {\n inject.warn('parseJson vars is not exist: ' + v.id + ', ' + k + ', ' + list.slice(0, i).join('.'));\n return;\n }\n }\n k2 = list[len - 1];\n }\n // 支持函数模式和值模式\n if(isFunction(value)) {\n value = value(v);\n }\n target[k2] = value;\n }\n }\n });\n }\n }\n}\n\nfunction replaceLibraryVars(json, hash, vars) {\n if(vars) {\n // 新版同级vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // library.xxx,需要>=2的长度\n if(Array.isArray(member) && member.length > 1 && vars.hasOwnProperty(id)) {\n if(member[0] === 'library') {\n let target = hash;\n for(let i = 1, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n let old = target[k];\n // 直接替换library的子对象,需补充id和tagName\n if(i === 1) {\n target[k] = Object.assign({ id: old.id, tagName: old.tagName }, v);\n }\n // 替换library中子对象的一个属性直接赋值\n else {\n target[k] = v;\n }\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Library slot miss ' + k);\n return;\n }\n }\n }\n }\n });\n }\n }\n // 兼容老版var-\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-library.') === 0) {\n let v = json[k];\n // 直接移除library插槽,防止下面调用replaceVars(json, vars)时报错\n delete json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(12);\n // 有id且变量里面传入了替换的值\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n if(isFunction(value)) {\n value = value(v);\n }\n // 替换图层的值必须是一个有tagName的对象\n if(!value || !value.tagName) {\n return;\n }\n // library对象也要加上id,与正常的library保持一致\n hash[k2] = Object.assign({ id: k2 }, value);\n }\n }\n });\n }\n }\n}\n\n/**\n * 遍历一遍library的一级,将一级的id存到hash上,无需递归二级,\n * 因为顺序前提要求排好且无循环依赖,所以被用到的一定在前面出现,\n * 一般是无children的元件在前,包含children的div在后\n * 即便library中的元素有children或library,在linkChild时将其link过去,parse递归会继续处理\n * @param item:library的一级孩子\n * @param hash:存放library的key/value引用\n */\nfunction linkLibrary(item, hash) {\n let id = item.id;\n // library中一定有id,因为是一级,二级+特殊需求才会出现放开\n if(isNil(id)) {\n throw new Error('Library item miss id: ' + JSON.stringify(item));\n }\n else {\n hash[id] = item;\n }\n}\n\n/**\n * 链接child到library文件,\n * props需要是clone的,因为防止多个child使用同一个库文件\n * children则直接引用,无需担心多个使用同一个\n * library也需要带上,在library直接子元素还包含library时会用到\n * @param child\n * @param libraryItem\n */\nfunction linkChild(child, libraryItem) {\n // 规定图层child只有init和动画,属性和子图层来自库\n child.tagName = libraryItem.tagName;\n child.props = clone(libraryItem.props);\n child.children = libraryItem.children;\n child.library = libraryItem.library;\n // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况\n Object.keys(libraryItem).forEach(k => {\n if(k.indexOf('var-') === 0 && !child.hasOwnProperty(k)) {\n child[k] = libraryItem[k];\n }\n });\n // 删除以免二次解析\n child.libraryId = null;\n // 规定图层实例化的属性和样式在init上,优先使用init,然后才取原型链的props\n let { init } = child;\n if(init) {\n let props = child.props = child.props || {};\n let style = props.style;\n extend(props, init);\n // style特殊处理,防止被上面覆盖丢失原始值\n if(style) {\n extend(style, init.style);\n props.style = style;\n }\n // 删除以免二次解析\n child.init = null;\n }\n}\n\nfunction parse(karas, json, animateRecords, opt, hash = {}) {\n if(isPrimitive(json) || json instanceof Node || json instanceof Component) {\n return json;\n }\n if(Array.isArray(json)) {\n return json.map(item => {\n return parse(karas, item, animateRecords, opt, hash);\n });\n }\n // 先判断是否是个链接到库的节点,是则进行链接操作\n let libraryId = json.libraryId;\n if(!isNil(libraryId)) {\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,tagName和属性和子图层来自库\n if(libraryItem) {\n linkChild(json, libraryItem);\n }\n else {\n throw new Error('Link library miss id: ' + libraryId);\n }\n json.libraryId = null;\n }\n // 再判断是否有library形成一个新的作用域,会出现library下的library使得一个链接节点链接后出现library的情况\n let library = json.library;\n if(Array.isArray(library)) {\n hash = {};\n library.forEach(item => {\n linkLibrary(item, hash);\n });\n // 替换library插槽\n replaceLibraryVars(json, hash, opt.vars);\n json.library = null;\n }\n let { tagName, props = {}, children = [], animate = [] } = json;\n if(!tagName) {\n throw new Error('Dom must have a tagName: ' + JSON.stringify(json));\n }\n let style = props.style;\n (opt.abbr !== false) && abbr2full(style, abbrCssProperty);\n // 先替换style的\n replaceVars(style, opt.vars);\n // 再替换静态属性,style也作为属性的一种,目前尚未被设计为被替换\n replaceVars(props, opt.vars);\n // 替换children里的内容,如文字,无法直接替换tagName/props/children/animate本身,因为下方用的还是原引用\n replaceVars(json, opt.vars);\n 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 let animationRecord;\n if(animate) {\n if(Array.isArray(animate)) {\n let has;\n animate.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrAnimate);\n let { value, options } = item;\n // 忽略空动画\n if(Array.isArray(value) && value.length) {\n has = true;\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n });\n if(has) {\n animationRecord = {\n animate,\n target: vd,\n };\n }\n }\n else {\n (opt.abbr !== false) && abbr2full(animate, abbrAnimate);\n let { value, options } = animate;\n if(Array.isArray(value) && value.length) {\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n animationRecord = {\n animate,\n target: vd,\n };\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n }\n }\n // 产生实际动画运行才存入列表供root调用执行\n if(animationRecord) {\n animateRecords.push(animationRecord);\n }\n return vd;\n}\n\nexport default parse;\n","import parse from './parse';\nimport abbr from './abbr';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport font from '../style/font';\nimport Controller from '../animate/Controller';\n\nlet o = {\n parse(karas, json, dom, options = {}) {\n // 特殊单例声明无需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';\n\nexport default {\n css,\n reset,\n unit,\n font,\n abbr,\n};\n","import Animation from './Animation';\nimport Controller from './Controller';\nimport easing from './easing';\nimport frame from './frame';\n\nexport default {\n Animation,\n Controller,\n easing,\n frame,\n};\n","import level from './level';\nimport change from './change';\nimport Page from './Page';\nimport Cache from './Cache';\n\nexport default {\n level,\n change,\n Page,\n Cache,\n};\n","import Node from './node/Node';\nimport Text from './node/Text';\nimport Xom from './node/Xom';\nimport Dom from './node/Dom';\nimport Img from './node/Img';\nimport Root from './node/Root';\nimport tag from './node/tag';\nimport mode from './node/mode';\nimport Geom from './node/geom/Geom';\nimport Line from './node/geom/Line';\nimport Polyline from './node/geom/Polyline';\nimport Polygon from './node/geom/Polygon';\nimport Sector from './node/geom/Sector';\nimport Rect from './node/geom/Rect';\nimport Circle from './node/geom/Circle';\nimport Ellipse from './node/geom/Ellipse';\nimport Component from './node/Component';\nimport Event from './util/Event';\nimport util from './util/util';\nimport $$type from './util/$$type';\nimport builder from './util/builder';\nimport updater from './util/updater';\nimport inject from './util/inject';\nimport enums from './util/enums';\nimport debug from './util/debug';\nimport parser from './parser/index';\nimport style from './style/index';\nimport animate from './animate/index';\nimport math from './math/index';\nimport refresh from './refresh/index';\nimport { version } from '../package.json';\n\nGeom.register('$line', Line);\nGeom.register('$polyline', Polyline);\nGeom.register('$polygon', Polygon);\nGeom.register('$sector', Sector);\nGeom.register('$rect', Rect);\nGeom.register('$circle', Circle);\nGeom.register('$ellipse', Ellipse);\n\nlet karas = {\n version,\n render(root, dom) {\n if(!(root instanceof Root)) {\n throw new Error('Render dom must be canvas/svg');\n }\n if(dom) {\n root.appendTo(dom);\n }\n return root;\n },\n createElement(tagName, props) {\n props = props || {};\n let children = [];\n for(let i = 2, len = arguments.length; i < len; i++) {\n children.push(arguments[i]);\n }\n if(util.isString(tagName)) {\n if(tagName.charAt(0) === '$') {\n return this.createGm(tagName, props);\n }\n else {\n return this.createVd(tagName, props, children);\n }\n }\n else if(tagName) {\n return this.createCp(tagName, props, children);\n }\n },\n createVd(tagName, props, children = []) {\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n if(tag.TAG_NAME.hasOwnProperty(tagName)) {\n return {\n tagName,\n props,\n children,\n $$type: $$type.TYPE_VD,\n };\n }\n throw new Error(`Can not use <${tagName}>`);\n },\n createGm(tagName, props) {\n return {\n tagName,\n props,\n $$type: $$type.TYPE_GM,\n };\n },\n createCp(klass, props, children = []) {\n props.children = children;\n return {\n klass,\n props,\n $$type: $$type.TYPE_CP,\n };\n },\n parse(json, dom, options) {\n return parser.parse(this, json, dom, options);\n },\n loadAndParse(json, dom, options) {\n return parser.loadAndParse(this, json, dom, options);\n },\n mode,\n Component,\n Node,\n Text,\n Geom,\n Xom,\n Dom,\n Img,\n Root,\n Event,\n util,\n inject,\n style,\n parser,\n animate,\n math,\n builder,\n updater,\n refresh,\n enums,\n set debug(v) {\n debug.flag = !!v;\n },\n};\n\nbuilder.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\n\nif(typeof window !== 'undefined') {\n window.karas = karas;\n}\nelse if(typeof self !== 'undefined') {\n self.karas = karas;\n}\n\nexport default karas;\n"],"names":["STYLE_KEY","POSITION","DISPLAY","TOP","RIGHT","BOTTOM","LEFT","MARGIN_TOP","MARGIN_RIGHT","MARGIN_BOTTOM","MARGIN_LEFT","PADDING_TOP","PADDING_RIGHT","PADDING_BOTTOM","PADDING_LEFT","FONT_SIZE","FONT_FAMILY","COLOR","FONT_STYLE","FONT_WEIGHT","LINE_HEIGHT","BACKGROUND_IMAGE","BACKGROUND_COLOR","BACKGROUND_SIZE","BACKGROUND_REPEAT","BACKGROUND_POSITION_X","BACKGROUND_POSITION_Y","BORDER_TOP_WIDTH","BORDER_RIGHT_WIDTH","BORDER_BOTTOM_WIDTH","BORDER_LEFT_WIDTH","BORDER_TOP_COLOR","BORDER_RIGHT_COLOR","BORDER_BOTTOM_COLOR","BORDER_LEFT_COLOR","BORDER_TOP_STYLE","BORDER_RIGHT_STYLE","BORDER_BOTTOM_STYLE","BORDER_LEFT_STYLE","BORDER_TOP_LEFT_RADIUS","BORDER_TOP_RIGHT_RADIUS","BORDER_BOTTOM_RIGHT_RADIUS","BORDER_BOTTOM_LEFT_RADIUS","WIDTH","HEIGHT","FLEX_GROW","FLEX_SHRINK","FLEX_BASIS","FLEX_DIRECTION","JUSTIFY_CONTENT","ALIGN_ITEMS","ALIGN_SELF","TEXT_ALIGN","TRANSFORM_ORIGIN","VISIBILITY","OPACITY","Z_INDEX","TRANSFORM","TRANSLATE_X","TRANSLATE_Y","TRANSLATE_Z","SCALE_X","SCALE_Y","SCALE_Z","SKEW_X","SKEW_Y","ROTATE_X","ROTATE_Y","ROTATE_Z","ROTATE_3D","PERSPECTIVE","PERSPECTIVE_ORIGIN","FILTER","BOX_SHADOW","POINTER_EVENTS","OVERFLOW","MIX_BLEND_MODE","BACKGROUND_CLIP","WHITE_SPACE","TEXT_OVERFLOW","LETTER_SPACING","LINE_CLAMP","ORDER","FLEX_WRAP","ALIGN_CONTENT","TEXT_STROKE_WIDTH","TEXT_STROKE_COLOR","TEXT_STROKE_OVER","FILL","STROKE","STROKE_WIDTH","STROKE_DASHARRAY","STROKE_DASHARRAY_STR","STROKE_LINECAP","STROKE_LINEJOIN","STROKE_MITERLIMIT","FILL_RULE","MATRIX","BORDER_TOP","BORDER_RIGHT","BORDER_BOTTOM","BORDER_LEFT","TRANSLATE_PATH","STYLE2LOWER_MAP","style2Lower","s","toLowerCase","replace","$0","$1","toUpperCase","STYLE2UPPER_MAP","style2Upper","$2","STYLE_R_KEY","STYLE_RV_KEY","STYLE_V_KEY","Object","keys","forEach","k","k2","l","UPDATE_KEY","UPDATE_NODE","UPDATE_STYLE","UPDATE_FOCUS","UPDATE_MEASURE","UPDATE_COMPONENT","UPDATE_OVERWRITE","UPDATE_KEYS","UPDATE_LIST","UPDATE_CONFIG","UPDATE_ADD_DOM","UPDATE_REMOVE_DOM","KEY_FRAME_KEY","FRAME_STYLE","FRAME_TIME","FRAME_EASING","FRAME_TRANSITION","NODE_KEY","NODE_DOM_PARENT","NODE_OPACITY","NODE_MATRIX","NODE_MATRIX_EVENT","NODE_CACHE","NODE_CACHE_TOTAL","NODE_CACHE_FILTER","NODE_CACHE_MASK","NODE_CACHE_OVERFLOW","NODE_STRUCT","NODE_TAG_NAME","NODE_CURRENT_STYLE","NODE_CURRENT_PROPS","NODE_COMPUTED_STYLE","NODE_CACHE_STYLE","NODE_CACHE_PROPS","NODE_LIMIT_CACHE","NODE_IS_MASK","NODE_IS_INLINE","NODE_HAS_CONTENT","NODE_REFRESH_LV","NODE_IS_DESTROYED","NODE_STYLE","NODE_UPDATE_HASH","NODE_UNIQUE_UPDATE_ID","NODE_DEFS_CACHE","NODE_PERSPECTIVE_MATRIX","NODE_VIRTUAL_DOM","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_FRAME_CB","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_CAL_DIFF_TIME","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","__width","__height","__baseLine","__config","i","lv","j","root","struct","diff","isLayout","__sx","__sy","x","ox","y","oy","__prev","__next","__parent","__domParent","__root","__host","__hostRoot","__virtualDom","CANVAS","SVG","WEBGL","o","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","REM","EM","VW","VH","VMAX","VMIN","calUnit","v","n","parseFloat","test","info","arial","lhr","blr","lgr","padding","f","verdana","tahoma","S","T","Z","c","t","georgia","simsun","support","fontFamily","hasOwnProperty","register","name","emSquare","ascent","descent","lineGap","addPadding","assign","position","gradient","img","identity","multiply","a","b","isE","a0","a1","a2","a3","calPoint","point","m","z","w","undefined","length","b1","c1","d1","b2","c2","d2","b3","c3","d3","a4","b4","c4","d4","d","e","inverse","inverse4","divisor","inv","det","m2m6","point2d","slice","dotProduct","x1","y1","x2","y2","crossProduct","H","Math","sqrt","vector","mx","h","deg","cos","sin","pointInPolygon","vertexes","xmax","ymax","xmin","ymin","len","max","min","pointInQuadrilateral","x4","y4","x3","y3","matrix","w1","w2","w3","w4","angleBySide","theta","pow","acos","sideByAngle","alpha","pointsDistance","triangleIncentre","ellipsePoints","sectorPoints","r","begin","end","list","floor","h2","d2r","abs","atan","rx","ry","p1","p2","p4","p3","push","concat","temp","res","getRectsIntersection","isRectsOverlap","ax1","ay1","ax4","ay4","bx1","by1","bx4","by4","isRectsInside","calCoordsInNode","px","py","node","computedStyle","width","height","calPercentInNode","ds","Infinity","PI","dt","r2d","bboxBezier2","x0","y0","minX","minY","maxX","maxY","tx","ty","sx","sy","qx","qy","bboxBezier3","cx","cy","bx","by","ax","ay","hx","hy","q","bboxBezier","arguments","norm","order","sum","reduce","simpson38","derivativeFunc","middleL","middleR","adaptiveSimpson38","eps","mid","st","sl","sr","ans","bezierLength","points","startT","endT","at","at3","p0","at2","bezierOrder","derivativeOrder","pointAtBezier","percent","maxIteration","pointAtBezierWithLength","targetLen","approachLen","approachT","preApproachT","derivative1","derivative2","numerator","denominator","sliceBezier","x12","y12","x23","y23","x123","y123","x34","y34","x234","y234","x1234","y1234","sliceBezier2Both","start","reverse","pointOnCircle","getConicGradientImage","originX","originY","stop","data","Error","getAngle","dx","dy","increasingList","map","item","color","angle","factor","idx","canvasPolygon","ctx","Array","isArray","moveTo","lineTo","quadraticCurveTo","bezierCurveTo","svgPolygon","canvasLine","controlA","controlB","num","svgLine","canvasFilter","filter","svgFilter","geom","unit","painter","calFitDashed","total","bs","be","smin","smax","dmin","dmax","ps","pd","outer","per","free","mo","calDashed","style","m1","m2","m3","m4","bw","calPoints","borderWidth","borderStyle","deg1","deg2","direction","beginRadius","endRadius","indexOf","isLast","main1","main2","cross1","cross2","tan","calTopRadiusPoints","calRightRadiusPoints","calBottomRadiusPoints","calLeftRadiusPoints","pointsList","brx","bry","erx","ery","oxl","oxr","beginList","centerList","endList","ya","yb","beginLength","needInner","crossDeg","rx1","ry1","sx1","oyl","rx2","ry2","sx2","xa","xb","ca","calBezierTopLeft","cb","controls1","controls2","limit","pop","endLength","oyr","calBezierTopRight","isStart","crossDx","p1x","p1y","p2x","p2y","dx1","dsx1","dx2","dsx2","cpx2","cpy2","cpx1","cpy1","crossDsx","beta","tanBetaDiv2Sqrt","tanAlphaHalf","degTg","degTg1","cdx1","cdy1","cx1","cy1","degTg2","cdx2","cdy2","cx2","cy2","isEnd","oyt","oyb","oxt","calBezierRightTop","oxb","calBezierRightBottom","calBezierBottomLeft","calBezierBottomRight","calBezierLeftTop","calBezierLeftBottom","calRadius","btlr","btrr","bbrr","bblr","need","btlx","btly","btrx","btry","bbrx","bbry","bblx","bbly","BR_KS","calBorderRadius","currentStyle","noRadius","target","prev","next","half","calBorderRadiusInline","contentBoxList","first","last","outerWidth","outerHeight","renderBorder","xom","renderMode","mode","beginPath","fillStyle","fill","closePath","virtualDom","bb","type","tagName","props","TYPE_VD","_","TYPE_GM","TYPE_CP","toString","isType","obj","call","isObject","isString","isFunction","isNumber","isBoolean","isDate","hasOwn","fnToString","ObjectFunctionString","isNil","joinSourceArray","arr","stringify","encodeHtml","prop","joinVirtualDom","vd","defs","joinDef","joinVd","conClip","children","isMask","content","opacity","transform","visibility","mask","overflow","mixBlendMode","def","uuid","joinItem","rgba2int","charAt","parseInt","match","int2rgba","joinArr","int2invert","arr2hash","hash","hash2arr","clone","$$type","util","Date","isPlainObject","equalArr","ai","bi","isArrayA","isArrayB","equal","getTime","extend","source","split","extendAnimate","ovd","nvd","__animationList","animationList","splice","__setTarget","assigning","finished","__stayEnd","assignCurrentStyle","__frameAnimateList","transformBbox","bbox","proto","getPrototypeOf","Ctor","constructor","assignMatrix","isPrimitive","isAuto","flag","charWidth","ELLIPSIS","antialias","premultipliedAlpha","preserveDrawingBuffer","initShaders","gl","vshader","fshader","program","createProgram","enable","BLEND","blendFunc","ONE","ONE_MINUS_SRC_ALPHA","vertexShader","loadShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","attachShader","linkProgram","linked","getProgramParameter","LINK_STATUS","error","getProgramInfoLog","deleteProgram","deleteShader","shader","createShader","shaderSource","compileShader","compiled","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","convertCoords2Gl","revertY","createTexture","tex","texture","bindTexture","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","texImage2D","TEXTURE_2D","UNSIGNED_BYTE","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","LINEAR","TEXTURE_MAG_FILTER","activeTexture","drawTextureCache","vtPoint","vtTex","vtOpacity","lastChannel","record","stack","cache","channel","page","tx1","ty1","tx2","ty2","pointBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","Float32Array","STATIC_DRAW","a_position","getAttribLocation","vertexAttribPointer","FLOAT","enableVertexAttribArray","texBuffer","a_texCoords","opacityBuffer","a_opacity","u_texture","getUniformLocation","count","uniform1i","drawArrays","TRIANGLES","deleteBuffer","disableVertexAttribArray","drawBlur","frameBuffer","texCache","tex1","tex2","spread","sigma","u_direction","uniform2f","ratio","recycle","tex3","framebufferTexture2D","FRAMEBUFFER","COLOR_ATTACHMENT0","tex4","deleteTexture","drawCm","u_m","uniform1fv","drawOverflow","programOverflow","drawMask","u_texture1","u_texture2","drawMbm","W","SPF","CANVAS_LIST","WEBGL_LIST","SUPPORT_OFFSCREEN_CANVAS","OffscreenCanvas","prototype","getContext","defaultFontFamilyData","key","message","debug","document","createElement","setAttribute","body","appendChild","canvas","draw","enabled","available","release","cacheCanvas","cacheWebgl","IMG","INIT","LOADING","LOADED","FONT","COMPONENT","inject","measureText","textCache","html","lengths","chars","ff","fs","fw","inline","char","div","left","top","innerHTML","cns","childNodes","index","css","window","getComputedStyle","text","__measureCb","removeChild","measureTextSync","measureImg","url","state","success","task","Image","onload","onerror","substr","host","exec","location","hostname","crossOrigin","src","warn","console","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","id","clearTimeout","now","performance","hasCacheCanvas","getCacheCanvas","releaseCacheCanvas","delCacheCanvas","hasCacheWebgl","getCacheWebgl","releaseCacheWebgl","delCacheWebgl","isDom","Element","self","getElementsByTagName","isWebGLTexture","WebGLTexture","checkSupportFontFamily","font","checked","context","textAlign","textBaseline","clearRect","fillText","getImageData","loadFont","FontFace","load","then","loadComponent","script","async","head","getLinearDeg","getRadialPosition","center","right","bottom","getColorStop","firstColor","p","dr","dg","db","da","unshift","calLinearCoords","calCircleCentre","iw","ih","positionX","positionY","calRadialRadius","shape","size","xl","yl","asin","parseGradient","reg","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","log","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","__hasUpdate","__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","Animation","__id","nl","__options","op","config","__frameCb","__calDiffTime","iterations","framesR","originStyle","fps","spfLimit","delay","endDelay","playbackRate","isFinish","__cancelTask","__currentProps","__currentStyle","isDelay","FRAME","PLAY","playState","__hasFin","__hasCancel","playCount","currentFrames","stayBegin","stayEnd","is2","endTime","currentTime","currentFrame","round","isAlternate","alternate","isEven","isLastCount","frameTime","isLastFrame","inEndDelay","needClean","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","isDirectItem","__calMp","isVirtual","fromAbs","isShadowRoot","clearCache","__layoutData","__layoutNone","__mp","__isRealInline","__layoutFlex","__layoutInline","__layoutBlock","__sx2","__sx3","__sx4","__sx5","__sx6","__sy2","__sy3","__sy4","__sy5","__sy6","__execAr","ar","controller","autoPlay","__records2","init","list2","__records","__playAuto","h3","nowrap","fixedWidth","fixedHeight","selfEndSpace","offsetWidth","offsetHeight","matrixCache","isScale","clientHeight","x5","x6","y5","y6","__calFilter","bg","bgI","item2","kw","__bx1","__bx2","__by1","__by2","rebuild","__hasContent","isRealInline","sx4","sx5","sx6","sy4","sy5","sy6","hasContent","__calContent","__calPerspective","__calMatrix","__releaseWhenEmpty","limitCache","__calCache","perspectiveMatrix","offscreenBlend","offscreenMask","hasFilter","offscreenFilter","offscreenOverflow","borderList","hasBgi","some","svgBgSymbol","__gradient","isFirst","lastContentBox","lastLineBox","parentLineBox","countW","ix1","iy1","ix2","iy2","symbol","clearAnimate","clearFrameAnimate","__stopPropagation","__stopImmediatePropagation","willResponseEvent","hasEmitMask","ignore","inThis","__touchstartTarget","__getLg","__getRg","__getCg","lg","createLinearGradient","addColorStop","rg","createRadialGradient","ec","dc","pc","cur","onlyTotal","__cacheTotal","__cacheFilter","__cacheMask","__cacheOverflow","formatStyle","animation","cancel","enter","hostRoot","pJson","zChildren","zIndexChildren","__spreadBbox","LineBox","__list","__lineHeight","LineBoxManager","__lastX","__lastY","__maxX","__domList","__domStack","__isNewLine","__isEnd","__setLB","nextNewLine","genLineBox","verticalAlign","isNewLine","TAG_NAME","INLINE","BOLD","offsetAndResizeByNodeOnY","reflowHash","inDirectAbsList","isContainer","cs","__layoutAbs","isAbs","__resizeY","clearUniqueReflowId","__uniqueReflowId","getMergeMarginTB","topList","bottomList","genZIndexChildren","hasMc","mcHash","lastMaskIndex","__iIndex","__zIndex","__aIndex","genOrderChildren","__order","block","inlineBlock","none","tag","__flexLine","__zIndexChildren","__structure","nss","__structs","structs","needSort","__tryLayInline","firstCharWidth","main","isRow","__calMinMax","min2","max2","countMin","countMax","setNotEnd","__addMp","isFixed","isContent","fixedSize","__lineBoxManager","__preLayout","__ioSize","mergeMarginBottomList","mergeMarginTopList","isXom","isInlineBlock","isImg","reflow","__isIbFull","lastX","lastY","isNone","isEmptyBlock","tw","th","horizonAlign","__inlineSize","domList","__marginAuto","growList","shrinkList","basisList","maxList","minList","orderChildren","__calBasis","containerSize","isMultiLine","line","hypotheticalList","hypothetical","maxCrossList","__layoutFlexLine","maxCross","crossSum","crossSumList","between","around","__crossAlign","flexLine","hypotheticalSum","targetMainList","factorSum","factorList","needReset","factorSum2","lbmList","firstBaseLine","genLineBoxByInlineIfNewLine","setLbByInlineIfNotNewLine","pushContentBoxList","isIbFull","isInline2","isInlineBlock2","focusNoWrap","fw2","addX","popContentBoxList","maxCX","maxCY","minCX","minCY","maxFX","maxFY","minFX","minFY","maxOX","maxOY","minOX","minOY","absChildren","onlyRight","onlyBottom","fixedTop","fixedRight","fixedBottom","fixedLeft","needCalWidth","wl","hl","__computeMeasure","__deepScan","loadImg","__loadImg","placeholder","loading","__loadAndRefresh","showError","pts","arc","__addGeom","reload","Defs","cacheHash","__isMulti","multi","__cacheProps","strokeDasharrayStr","lineCap","lineJoin","miterLimit","getLineDash","setLineDash","preData","__preSet","fills","fillRules","strokes","strokeWidths","strokeDasharrays","strokeDasharrayStrs","strokeLinecaps","strokeLinejoins","strokeMiterlimits","__renderOnePolygon","isFillCE","isStrokeCE","isFillRE","isStrokeRE","__conicGradient","__drawPolygon","__radialEllipse","isFill","isStroke","__preSetCanvas","__propsStrokeStyle","__inversePtList","updateList","removeList","KEY_FLAG","check","checkCp","nextProps","forceCheckUpdate","shouldUpdate","shouldComponentUpdate","updateCp","oldS","oldSr","oldJson","diffSr","oj","nj","ojk","getKeyHash","njk","keyList","cpList","diffCp","diffChildren","diffChild","removeCpFromOldTree","oc","ol","of","nf","exist","ex","did","componentDidUpdate","elem","diffDefs","diffBb","diffD2D","od","nd","diffDef","removeAt","insertAt","insertAdjacentHTML","parentNode","removeAttribute","diffItem","diffD2G","replaceWith","diffT2T","diffG2D","diffG2G","diffItemSelf","diffX2X","diffByLessLv","firstChild","lastChild","obb","nbb","isText","svg","where","insertBefore","Controller","__list2","__onList","__lastTime","args","records","animate","onList","__action","__mergeAuto","__on","timestamp","__set","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","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","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","__ctx","__renderMode","vertex","fragment","vertexMask","fragmentMask","fragmentClip","fragmentOverflow","vertexCm","fragmentCm","MAX_TEXTURE_IMAGE_UNITS","__texCache","destroy","__eventCbList","__checkRoot","__checkUpdate","__checkReflow","noRender","__clear","__vd","domDiff","updateStyle","taskUp","__nextFrameCp","updater","includeIgnore","scan","path","zPath","__index__","karas","path2","zPath2","nodeConfig","rootConfig","updateHash","__updateRoot","updateRoot","hasUpdate","__updateStruct","measureHash","__uniqueUpdateId","isInherit","uniqueList","hasRoot","diffList","diffI","mergeOffsetList","__uniqueMergeOffsetId","cps","cts","isLastAbs","isNowAbs","isLastNone","isNowNone","hasFlowPrev","__modifyStruct","startIndex","startNode","oldH","nowH","lastIndex","ns","reBuild","base","reBuildC","curveNum","limitStartEnd","getNewPoint","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","__start","__end","dy2","buildCache","curve","bezierBox","concatPointAndControl","control","getLength","increase","getIndex","getNewList","prePercent","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","replaceLibraryVars","linkLibrary","JSON","linkChild","libraryItem","library","libraryId","parse","animateRecords","opt","createGm","createCp","createVd","animationRecord","singleton","fonts","loadAndParse","components","imgs","list1","list3","version","appendTo","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAMA,SAAS,GAAG;EAChBC,EAAAA,QAAQ,EAAE,CADM;EAEhBC,EAAAA,OAAO,EAAE,CAFO;EAGhBC,EAAAA,GAAG,EAAE,CAHW;EAIhBC,EAAAA,KAAK,EAAE,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A,OAAO,EAAPA,OAjFU;EAkFVlL,EAAAA,OAAO,EAAPA,OAlFU;EAmFVjuE,EAAAA,KAAK,EAALA,KAnFU;;EAoFV,MAAI4rB,KAAJ,CAAU1oB,CAAV,EAAa;EACX0oB,IAAAA,KAAK,CAACrI,IAAN,GAAa,CAAC,CAACrgB,CAAf;EACD;;EAtFS,CAAZ;EAyFAk8C,OAAO,CAACrB,GAAR,CAAY;EACVvB,EAAAA,GAAG,EAAHA,KADU;EAEVC,EAAAA,GAAG,EAAHA,KAFU;EAGVC,EAAAA,GAAG,EAAHA,KAHU;EAIVC,EAAAA,IAAI,EAAJA,MAJU;EAKVC,EAAAA,SAAS,EAATA;EALU,CAAZ;;EAQA,IAAG,OAAO1uB,MAAP,KAAkB,WAArB,EAAkC;EAChCA,EAAAA,MAAM,CAACurD,KAAP,GAAeA,OAAf;EACD,CAFD,MAGK,IAAG,OAAO9oD,IAAP,KAAgB,WAAnB,EAAgC;EACnCA,EAAAA,IAAI,CAAC8oD,KAAL,GAAaA,OAAb;EACD;;;;;;;;"} \ No newline at end of file diff --git a/src/animate/Animation.js b/src/animate/Animation.js index 96f4f7ae7..0c53c7e88 100644 --- a/src/animate/Animation.js +++ b/src/animate/Animation.js @@ -109,7 +109,7 @@ const { I_TIME_STAMP, }, } = enums; -const { AUTO, PX, PERCENT, INHERIT, RGBA, STRING, NUMBER, REM, VW, VH, calUnit } = unit; +const { AUTO, PX, PERCENT, INHERIT, RGBA, STRING, NUMBER, REM, VW, VH, VMAX, VMIN, calUnit } = unit; const { isNil, isFunction, isNumber, isObject, isString, clone, equalArr } = util; const { linear } = easing; const { cloneStyle } = css; @@ -274,6 +274,12 @@ function calByUnit(p, n, container, root) { else if(n[1] === VH) { return n[0] * root.height * 0.01 - p[0]; } + else if(n[1] === VMAX) { + return n[0] * Math.max(root.width, root.height) * 0.01 - p[0]; + } + else if(n[1] === VMIN) { + return n[0] * Math.min(root.width, root.height) * 0.01 - p[0]; + } } else if(p[1] === PERCENT) { if(n[1] === PX) { @@ -288,6 +294,12 @@ function calByUnit(p, n, container, root) { else if(n[1] === VH) { return n[0] * root.height / container - p[0]; } + else if(n[1] === VMAX) { + return n[0] * Math.max(root.width, root.height) / container - p[0]; + } + else if(n[1] === VMIN) { + return n[0] * Math.min(root.width, root.height) / container - p[0]; + } } else if(p[1] === REM) { if(n[1] === PX) { @@ -302,6 +314,12 @@ function calByUnit(p, n, container, root) { else if(n[1] === VH) { return n[0] * root.height * 0.01 / root.computedStyle[FONT_SIZE] - p[0]; } + else if(n[1] === VMAX) { + return n[0] * Math.max(root.width, root.height) * 0.01 / root.computedStyle[FONT_SIZE] - p[0]; + } + else if(n[1] === VMIN) { + return n[0] * Math.min(root.width, root.height) * 0.01 / root.computedStyle[FONT_SIZE] - p[0]; + } } else if(p[1] === VW) { if(n[1] === PX) { @@ -316,6 +334,12 @@ function calByUnit(p, n, container, root) { else if(n[1] === VH) { return n[0] * root.height / root.width - p[0]; } + else if(n[1] === VMAX) { + return n[0] * Math.max(root.width, root.height) / root.width - p[0]; + } + else if(n[1] === VMIN) { + return n[0] * Math.min(root.width, root.height) / root.width - p[0]; + } } else if(p[1] === VH) { if(n[1] === PX) { @@ -330,6 +354,52 @@ function calByUnit(p, n, container, root) { else if(n[1] === PERCENT) { return n[0] * container / root.height - p[0]; } + else if(n[1] === VMAX) { + return n[0] * Math.max(root.width, root.height) / root.height - p[0]; + } + else if(n[1] === VMIN) { + return n[0] * Math.min(root.width, root.height) / root.height - p[0]; + } + } + else if(p[1] === VMAX) { + if(n[1] === PX) { + return n[0] * 100 / Math.max(root.width, root.height) - p[0]; + } + else if(n[1] === REM) { + return n[0] * 100 * root.computedStyle[FONT_SIZE] / Math.max(root.width, root.height) - p[0]; + } + else if(n[1] === PERCENT) { + return n[0] * container / Math.max(root.width, root.height) - p[0]; + } + else if(n[1] === VW) { + return n[0] * root.width / Math.max(root.width, root.height) - p[0]; + } + else if(n[1] === VH) { + return n[0] * root.height / Math.max(root.width, root.height) - p[0]; + } + else if(n[1] === VMIN) { + return n[0] * Math.min(root.width, root.height) / Math.max(root.width, root.height) - p[0]; + } + } + else if(p[1] === VMIN) { + if(n[1] === PX) { + return n[0] * 100 / Math.min(root.width, root.height) - p[0]; + } + else if(n[1] === REM) { + return n[0] * 100 * root.computedStyle[FONT_SIZE] / Math.min(root.width, root.height) - p[0]; + } + else if(n[1] === PERCENT) { + return n[0] * container / Math.min(root.width, root.height) - p[0]; + } + else if(n[1] === VW) { + return n[0] * root.width / Math.min(root.width, root.height) - p[0]; + } + else if(n[1] === VH) { + return n[0] * root.height / Math.min(root.width, root.height) - p[0]; + } + else if(n[1] === VMAX) { + return n[0] * Math.max(root.width, root.height) / Math.min(root.width, root.height) - p[0]; + } } } @@ -412,7 +482,7 @@ function calDiff(prev, next, k, target, tagName) { }) } let v = {}, hasChange; - // 只有blur支持px/rem/vw/vh,其余都是特殊固定单位 + // 只有blur支持px/rem/vw/vh/vmax/vmin,其余都是特殊固定单位 Object.keys(keyHash).forEach(k => { if(k === 'blur') { if(!pHash[k]) { @@ -977,6 +1047,12 @@ function calDiff(prev, next, k, target, tagName) { else if(u === VH) { return [(parseFloat(v) || 0) * 0.01 * root.height, PX]; } + else if(u === VMAX) { + return [(parseFloat(v) || 0) * 0.01 * Math.max(root.width, root.height), PX]; + } + else if(u === VMIN) { + return [(parseFloat(v) || 0) * 0.01 * Math.min(root.width, root.height), PX]; + } else { return [parseFloat(v) || 0, PX]; } diff --git a/src/node/Dom.js b/src/node/Dom.js index f45425b75..81b64a382 100644 --- a/src/node/Dom.js +++ b/src/node/Dom.js @@ -80,7 +80,7 @@ const { STRUCT_INDEX, }, } = enums; -const { AUTO, PX, PERCENT, REM, VW, VH } = unit; +const { AUTO, PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit; const { calAbsolute, isRelativeOrAbsolute } = css; function genZIndexChildren(dom) { @@ -355,6 +355,12 @@ class Dom extends Xom { else if(width[1] === VH) { w -= width[0] * this.root.height * 0.01; } + else if(width[1] === VMAX) { + w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(width[1] === VMIN) { + w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01; + } else { for(let i = 0; i < flowChildren.length; i++) { // 当放不下时直接返回,无需继续多余的尝试计算 @@ -390,6 +396,12 @@ class Dom extends Xom { else if(marginRight[1] === VH) { w -= marginRight[0] * this.root.height * 0.01; } + else if(marginRight[1] === VMAX) { + w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(marginRight[1] === VMIN) { + w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01; + } if(paddingRight[1] === PX) { w -= paddingRight[0]; } @@ -405,6 +417,12 @@ class Dom extends Xom { else if(paddingRight[1] === VH) { w -= paddingRight[0] * this.root.height * 0.01; } + else if(paddingRight[1] === VMAX) { + w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(paddingRight[1] === VMIN) { + w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01; + } if(borderRightWidth[1] === PX) { w -= borderRightWidth[0]; } @@ -417,6 +435,12 @@ class Dom extends Xom { else if(borderRightWidth[1] === VH) { w -= borderRightWidth[0] * this.root.height * 0.01; } + else if(borderRightWidth[1] === VMAX) { + w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(borderRightWidth[1] === VMIN) { + w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; + } } // 还要减去开头的mpb if(marginLeft[1] === PX) { @@ -434,6 +458,12 @@ class Dom extends Xom { else if(marginLeft[1] === VH) { w -= marginLeft[0] * this.root.height * 0.01; } + else if(marginLeft[1] === VMAX) { + w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(marginLeft[1] === VMIN) { + w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01; + } if(paddingLeft[1] === PX) { w -= paddingLeft[0]; } @@ -449,6 +479,12 @@ class Dom extends Xom { else if(paddingLeft[1] === VH) { w -= paddingLeft[0] * this.root.height * 0.01; } + else if(paddingLeft[1] === VMAX) { + w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(paddingLeft[1] === VMIN) { + w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01; + } if(borderLeftWidth[1] === PX) { w -= borderLeftWidth[0]; } @@ -461,6 +497,12 @@ class Dom extends Xom { else if(borderLeftWidth[1] === VH) { w -= borderLeftWidth[0] * this.root.height * 0.01; } + else if(borderLeftWidth[1] === VMAX) { + w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(borderLeftWidth[1] === VMIN) { + w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; + } return w; } @@ -521,6 +563,12 @@ class Dom extends Xom { else if(main[1] === VH) { min = max = main[0] * this.root.height * 0.01; } + else if(main[1] === VMAX) { + min = max = main[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(main[1] === VMIN) { + min = max = main[0] * Math.min(this.root.width, this.root.height) * 0.01; + } else { if(display === 'flex') { let isRow = flexDirection !== 'column'; @@ -728,7 +776,7 @@ class Dom extends Xom { let main = isDirectionRow ? width : height; // basis3种情况:auto、固定、content let isAuto = flexBasis[1] === AUTO; - let isFixed = [PX, PERCENT, REM, VW, VH].indexOf(flexBasis[1]) > -1; + let isFixed = [PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(flexBasis[1]) > -1; let isContent = !isAuto && !isFixed; let fixedSize; // flex的item固定basis计算 @@ -748,9 +796,15 @@ class Dom extends Xom { else if(flexBasis[1] === VH) { b = fixedSize = flexBasis[0] * this.root.height * 0.01; } + else if(flexBasis[1] === VMAX) { + b = fixedSize = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(flexBasis[1] === VMIN) { + b = fixedSize = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01; + } } // 已声明主轴尺寸的,当basis是auto时为值 - else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1) && isAuto) { + else if(([PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(main[1]) > -1) && isAuto) { if(main[1] === PX) { b = fixedSize = main[0]; } @@ -766,6 +820,12 @@ class Dom extends Xom { else if(main[1] === VH) { b = fixedSize = main[0] * this.root.height * 0.01; } + else if(main[1] === VMAX) { + b = fixedSize = main[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(main[1] === VMIN) { + b = fixedSize = main[0] * Math.min(this.root.width, this.root.height) * 0.01; + } } // 非固定尺寸的basis为auto时降级为content else if(isAuto) { @@ -2571,6 +2631,12 @@ class Dom extends Xom { else if(width[1] === VH) { w2 = width[0] * this.root.height * 0.01; } + else if(width[1] === VMAX) { + w2 = width[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(width[1] === VMIN) { + w2 = width[0] * Math.min(this.root.width, this.root.height) * 0.01; + } else { w2 = width[0]; } @@ -2590,6 +2656,12 @@ class Dom extends Xom { else if(width[1] === VH) { w2 = width[0] * this.root.height * 0.01; } + else if(width[1] === VMAX) { + w2 = width[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(width[1] === VMIN) { + w2 = width[0] * Math.min(this.root.width, this.root.height) * 0.01; + } else { w2 = width[0]; } @@ -2621,6 +2693,12 @@ class Dom extends Xom { else if(width[1] === VH) { w2 = width[0] * this.root.height * 0.01; } + else if(width[1] === VMAX) { + w2 = width[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(width[1] === VMIN) { + w2 = width[0] * Math.min(this.root.width, this.root.height) * 0.01; + } else { w2 = width[0]; } @@ -2646,6 +2724,12 @@ class Dom extends Xom { else if(height[1] === VH) { h2 = height[0] * this.root.height * 0.01; } + else if(height[1] === VMAX) { + h2 = height[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(height[1] === VMIN) { + h2 = height[0] * Math.min(this.root.width, this.root.height) * 0.01; + } else { h2 = height[0]; } @@ -2665,6 +2749,12 @@ class Dom extends Xom { else if(height[1] === VH) { h2 = height[0] * this.root.height * 0.01; } + else if(height[1] === VMAX) { + h2 = height[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(height[1] === VMIN) { + h2 = height[0] * Math.min(this.root.width, this.root.height) * 0.01; + } else { h2 = height[0]; } @@ -2705,7 +2795,13 @@ class Dom extends Xom { else if(height[1] === VH) { h2 = height[0] * this.root.height * 0.01; } - else if(height[1] === PX) { + else if(height[1] === VMAX) { + h2 = height[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(height[1] === VMIN) { + h2 = height[0] * Math.min(this.root.width, this.root.height) * 0.01; + } + else { h2 = height[0]; } } diff --git a/src/node/Img.js b/src/node/Img.js index b4285f428..b8ddc7597 100644 --- a/src/node/Img.js +++ b/src/node/Img.js @@ -50,7 +50,7 @@ const { NODE_IS_MASK, }, } = enums; -const { AUTO, PX, PERCENT, REM, VW, VH, RGBA } = unit; +const { AUTO, PX, PERCENT, REM, VW, VH, VMAX, VMIN, RGBA } = unit; const { canvasPolygon, svgPolygon } = painter; const { isFunction } = util; @@ -427,6 +427,12 @@ class Img extends Dom { else if(width[1] === VH) { w -= width[0] * this.root.height * 0.01; } + else if(width[1] === VMAX) { + w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(width[1] === VMIN) { + w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01; + } else { let loadImg = this.__loadImg; // 加载成功计算缩放后的宽度 @@ -446,6 +452,12 @@ class Img extends Dom { else if(height[1] === VH) { w -= loadImg.width * height[0] * this.root.height * 0.01 / loadImg.height; } + else if(height[1] === VMAX) { + w -= height[0] * Math.max(this.root.width, this.root.height) * 0.01 / loadImg.height; + } + else if(height[1] === VMIN) { + w -= height[0] * Math.min(this.root.width, this.root.height) * 0.01 / loadImg.height; + } else { w -= loadImg.width; } @@ -467,6 +479,12 @@ class Img extends Dom { else if(marginLeft[1] === VH) { w -= marginLeft[0] * this.root.height * 0.01; } + else if(marginLeft[1] === VMAX) { + w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(marginLeft[1] === VMIN) { + w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01; + } if(paddingLeft[1] === PX) { w -= paddingLeft[0]; } @@ -482,6 +500,12 @@ class Img extends Dom { else if(paddingLeft[1] === VH) { w -= paddingLeft[0] * this.root.height * 0.01; } + else if(paddingLeft[1] === VMAX) { + w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(paddingLeft[1] === VMIN) { + w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01; + } if(borderLeftWidth[1] === PX) { w -= borderLeftWidth[0]; } @@ -494,6 +518,12 @@ class Img extends Dom { else if(borderLeftWidth[1] === VH) { w -= borderLeftWidth[0] * this.root.height * 0.01; } + else if(borderLeftWidth[1] === VMAX) { + w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(borderLeftWidth[1] === VMIN) { + w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; + } if(marginRight[1] === PX) { w -= marginRight[0]; } @@ -509,6 +539,12 @@ class Img extends Dom { else if(marginRight[1] === VH) { w -= marginRight[0] * this.root.height * 0.01; } + else if(marginRight[1] === VMAX) { + w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(marginRight[1] === VMIN) { + w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01; + } if(paddingRight[1] === PX) { w -= paddingRight[0]; } @@ -524,6 +560,12 @@ class Img extends Dom { else if(paddingRight[1] === VH) { w -= paddingRight[0] * this.root.height * 0.01; } + else if(paddingRight[1] === VMAX) { + w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(paddingRight[1] === VMIN) { + w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01; + } if(borderRightWidth[1] === PX) { w -= borderRightWidth[0]; } @@ -536,6 +578,12 @@ class Img extends Dom { else if(borderRightWidth[1] === VH) { w -= borderRightWidth[0] * this.root.height * 0.01; } + else if(borderRightWidth[1] === VMAX) { + w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(borderRightWidth[1] === VMIN) { + w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; + } return w; } @@ -566,7 +614,7 @@ class Img extends Dom { let main = isDirectionRow ? width : height; let cross = isDirectionRow ? height : width; // basis3种情况:auto、固定、content,只区分固定和其它 - let isFixed = [PX, PERCENT, REM, VW, VH].indexOf(flexBasis[1]) > -1; + let isFixed = [PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(flexBasis[1]) > -1; if(isFixed) { if(flexBasis[1] === PX) { b = max = min = flexBasis[0]; @@ -583,8 +631,14 @@ class Img extends Dom { else if(flexBasis[1] === VH) { b = max = min = flexBasis[0] * this.root.height * 0.01; } + else if(flexBasis[1] === VMAX) { + b = max = min = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(flexBasis[1] === VMIN) { + b = max = min = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01; + } } - else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1)) { + else if(([PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(main[1]) > -1)) { if(main[1] === PX) { b = max = min = main[0]; } @@ -600,6 +654,12 @@ class Img extends Dom { else if(main[1] === VH) { b = max = min = main[0] * this.root.height * 0.01; } + else if(main[1] === VMAX) { + b = max = min = main[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(main[1] === VMIN) { + b = max = min = main[0] * Math.min(this.root.width, this.root.height) * 0.01; + } } // auto和content固定尺寸比例计算 else if(__loadImg.source || __loadImg.error) { @@ -619,6 +679,12 @@ class Img extends Dom { else if(cross[1] === VH) { cross = cross[0] * this.root.height * 0.01; } + else if(cross[1] === VMAX) { + cross = cross[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(cross[1] === VMIN) { + cross = cross[0] * Math.min(this.root.width, this.root.height) * 0.01; + } let ratio = __loadImg.width / __loadImg.height; b = max = min = isDirectionRow ? cross * ratio : cross / ratio; } diff --git a/src/node/Text.js b/src/node/Text.js index b44d8aca6..498d7b20d 100644 --- a/src/node/Text.js +++ b/src/node/Text.js @@ -46,7 +46,7 @@ const { } = enums; const ELLIPSIS = textCache.ELLIPSIS; -const { AUTO, REM, VW, VH } = unit; +const { AUTO, REM, VW, VH, VMAX, VMIN } = unit; class Text extends Node { constructor(content) { @@ -815,6 +815,12 @@ class Text extends Node { else if(textStrokeWidth[1] === VH) { half = Math.max(textStrokeWidth[0] * root.height * 0.01 * 0.5, half); } + else if(textStrokeWidth[1] === VMAX) { + half = Math.max(textStrokeWidth[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } + else if(textStrokeWidth[1] === VMIN) { + half = Math.max(textStrokeWidth[0] * Math.min(root.width, root.height) * 0.01 * 0.5, half); + } else { half = Math.max(textStrokeWidth[0] * 0.5, half); } diff --git a/src/node/Xom.js b/src/node/Xom.js index 13311c6db..16d7c0161 100644 --- a/src/node/Xom.js +++ b/src/node/Xom.js @@ -151,7 +151,7 @@ const { NODE_CACHE_AS_BITMAP, } } = enums; -const { AUTO, PX, PERCENT, INHERIT, NUMBER, REM, VW, VH, DEG } = unit; +const { AUTO, PX, PERCENT, INHERIT, NUMBER, REM, VW, VH, VMAX, VMIN, DEG } = unit; const { int2rgba, rgba2int, joinArr, isNil } = util; const { calRelative } = css; const { GEOM } = change; @@ -302,6 +302,12 @@ class Xom extends Node { else if(mp[1] === VH) { return mp[0] * this.root.height * 0.01; } + else if(mp[1] === VMAX) { + return mp[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(mp[1] === VMIN) { + return mp[0] * Math.min(this.root.width, this.root.height) * 0.01; + } return 0; } @@ -336,6 +342,12 @@ class Xom extends Node { else if(v[1] === VH) { n += v[0] * this.root.height * 0.01; } + else if(v[1] === VMAX) { + n += v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(v[1] === VMIN) { + n += v[0] * Math.min(this.root.width, this.root.height) * 0.01; + } return n; } @@ -372,6 +384,12 @@ class Xom extends Node { else if(borderLeftWidth[1] === VH) { mp += borderLeftWidth[0] * this.root.height * 0.01; } + else if(borderLeftWidth[1] === VMAX) { + mp += borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(borderLeftWidth[1] === VMIN) { + mp += borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; + } if(borderRightWidth[1] === PX) { mp += borderRightWidth[0]; } @@ -384,6 +402,12 @@ class Xom extends Node { else if(borderRightWidth[1] === VH) { mp += borderRightWidth[0] * this.root.height * 0.01; } + else if(borderRightWidth[1] === VMAX) { + mp += borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(borderRightWidth[1] === VMIN) { + mp += borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; + } res = res.map(item => item + mp); } else { @@ -403,6 +427,12 @@ class Xom extends Node { else if(borderTopWidth[1] === VH) { mp += borderTopWidth[0] * this.root.height * 0.01; } + else if(borderTopWidth[1] === VMAX) { + mp += borderTopWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(borderTopWidth[1] === VMIN) { + mp += borderTopWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; + } if(borderBottomWidth[1] === PX) { mp += borderBottomWidth[0]; } @@ -415,6 +445,12 @@ class Xom extends Node { else if(borderBottomWidth[1] === VH) { mp += borderBottomWidth[0] * this.root.height * 0.01; } + else if(borderBottomWidth[1] === VMAX) { + mp += borderBottomWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(borderBottomWidth[1] === VMIN) { + mp += borderBottomWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; + } res = res.map(item => item + mp); } return res; @@ -501,6 +537,12 @@ class Xom extends Node { case VH: w = width[0] * this.root.height * 0.01; break; + case VMAX: + w = width[0] * Math.max(this.root.width, this.root.height) * 0.01; + break; + case VMIN: + w = width[0] * Math.min(this.root.width, this.root.height) * 0.01; + break; } } } @@ -675,6 +717,12 @@ class Xom extends Node { case VH: w = width[0] * this.root.height * 0.01; break; + case VMAX: + w = width[0] * Math.max(this.root.width, this.root.height) * 0.01; + break; + case VMIN: + w = width[0] * Math.min(this.root.width, this.root.height) * 0.01; + break; } } if(h2 !== undefined) { @@ -703,6 +751,12 @@ class Xom extends Node { case VH: h = height[0] * this.root.height * 0.01; break; + case VMAX: + h = height[0] * Math.max(this.root.width, this.root.height) * 0.01; + break; + case VMIN: + h = height[0] * Math.min(this.root.width, this.root.height) * 0.01; + break; } } // margin/padding/border影响x和y和尺寸,注意inline的y不受mpb影响 @@ -786,6 +840,12 @@ class Xom extends Node { else if(v[1] === VH) { v = v[0] * this.root.height * 0.01; } + else if(v[1] === VMAX) { + v = v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(v[1] === VMIN) { + v = v[0] * Math.min(this.root.width, this.root.height) * 0.01; + } else { v = v[0]; } @@ -811,6 +871,12 @@ class Xom extends Node { else if(v[1] === VH) { v = v[0] * this.root.height * 0.01; } + else if(v[1] === VMAX) { + v = v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(v[1] === VMIN) { + v = v[0] * Math.min(this.root.width, this.root.height) * 0.01; + } else { v = v[0]; } @@ -836,6 +902,12 @@ class Xom extends Node { else if(v[1] === VH) { v = v[0] * this.root.height * 0.01; } + else if(v[1] === VMAX) { + v = v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(v[1] === VMIN) { + v = v[0] * Math.min(this.root.width, this.root.height) * 0.01; + } else { v = v[0]; } @@ -960,6 +1032,22 @@ class Xom extends Node { computedStyle[k] = v[0] * this.root.height * 0.01; } } + else if(v[1] === VMAX) { + if(k === TRANSLATE_X || k === TRANSLATE_Z) { + computedStyle[k] = v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(k === TRANSLATE_Y) { + computedStyle[k] = v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + } + else if(v[1] === VMIN) { + if(k === TRANSLATE_X || k === TRANSLATE_Z) { + computedStyle[k] = v[0] * Math.min(this.root.width, this.root.height) * 0.01; + } + else if(k === TRANSLATE_Y) { + computedStyle[k] = v[0] * Math.min(this.root.width, this.root.height) * 0.01; + } + } temp.push([k, v]); }); if(temp.length) { @@ -1076,6 +1164,12 @@ class Xom extends Node { if(item[1] === VH) { return item[0] * this.root.height * 0.01; } + if(item[1] === VMAX) { + return item[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + if(item[1] === VMIN) { + return item[0] * Math.min(this.root.width, this.root.height) * 0.01; + } if(item[1] === PERCENT) { return item[0] + '%'; } @@ -1099,6 +1193,12 @@ class Xom extends Node { if(item[1] === VH) { return item[0] * this.root.height * 0.01; } + if(item[1] === VMAX) { + return item[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + if(item[1] === VMIN) { + return item[0] * Math.min(this.root.width, this.root.height) * 0.01; + } if(item[1] === PERCENT) { return item[0] + '%'; } @@ -1190,6 +1290,12 @@ class Xom extends Node { else if(item2[1] === VH) { v = v * this.root.height * 0.01; } + else if(item2[1] === VMAX) { + v = v * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(item2[1] === VMIN) { + v = v * Math.min(this.root.width, this.root.height) * 0.01; + } return v; }); }); @@ -1338,6 +1444,12 @@ class Xom extends Node { else if(v[1] === VH) { v = v[0] * this.root.height * 0.01; } + else if(v[1] === VMAX) { + v = v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(v[1] === VMIN) { + v = v[0] * Math.min(this.root.width, this.root.height) * 0.01; + } else { v = v[0]; } @@ -1387,6 +1499,12 @@ class Xom extends Node { else if(v[1] === VH) { ppt = v[0] * this.root.height * 0.01; } + else if(v[1] === VMAX) { + ppt = v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(v[1] === VMIN) { + ppt = v[0] * Math.min(this.root.width, this.root.height) * 0.01; + } else { ppt = v[0]; } @@ -1425,6 +1543,12 @@ class Xom extends Node { else if(v[1] === VH) { v = v[0] * this.root.height * 0.01; } + else if(v[1] === VMAX) { + v = v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(v[1] === VMIN) { + v = v[0] * Math.min(this.root.width, this.root.height) * 0.01; + } return [k, v]; }); } diff --git a/src/node/geom/Circle.js b/src/node/geom/Circle.js index 1f3da8989..73711c883 100644 --- a/src/node/geom/Circle.js +++ b/src/node/geom/Circle.js @@ -10,7 +10,7 @@ const { STYLE_KEY: { FONT_SIZE, } } = enums; const { isNil } = util; -const { REM, VW, VH } = unit; +const { REM, VW, VH, VMAX, VMIN } = unit; function getR(v) { v = parseFloat(v); @@ -106,6 +106,12 @@ class Circle extends Geom { else if(item[1] === VH) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); } + else if(item[1] === VMAX) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } + else if(item[1] === VMIN) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else { half = Math.max(item[0] * 0.5, half); } diff --git a/src/node/geom/Ellipse.js b/src/node/geom/Ellipse.js index dcc05b99f..7b2624564 100644 --- a/src/node/geom/Ellipse.js +++ b/src/node/geom/Ellipse.js @@ -10,7 +10,7 @@ const { STYLE_KEY: { FONT_SIZE, } } = enums; const { isNil } = util; -const { REM, VW, VH } = unit; +const { REM, VW, VH, VMAX, VMIN } = unit; function getR(v) { v = parseFloat(v); @@ -143,6 +143,12 @@ class Ellipse extends Geom { else if(item[1] === VH) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); } + else if(item[1] === VMAX) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } + else if(item[1] === VMIN) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else { half = Math.max(item[0] * 0.5, half); } diff --git a/src/node/geom/Geom.js b/src/node/geom/Geom.js index 45ccf4298..57401d7c5 100644 --- a/src/node/geom/Geom.js +++ b/src/node/geom/Geom.js @@ -49,7 +49,7 @@ const { NODE_DEFS_CACHE, } } = enums; -const { PX, PERCENT, REM, VW, VH } = unit; +const { PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit; const { int2rgba, isNil, joinArr } = util; const { canvasPolygon, svgPolygon } = painter; @@ -95,6 +95,12 @@ class Geom extends Xom { else if(width[1] === VH) { w -= width[0] * this.root.height * 0.01; } + else if(width[1] === VMAX) { + w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(width[1] === VMIN) { + w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01; + } // 减去水平mbp if(marginLeft[1] === PX) { w -= marginLeft[0]; @@ -111,6 +117,12 @@ class Geom extends Xom { else if(marginLeft[1] === VH) { w -= marginLeft[0] * this.root.height * 0.01; } + else if(marginLeft[1] === VMAX) { + w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(marginLeft[1] === VMIN) { + w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01; + } if(paddingLeft[1] === PX) { w -= paddingLeft[0]; } @@ -126,6 +138,12 @@ class Geom extends Xom { else if(paddingLeft[1] === VH) { w -= paddingLeft[0] * this.root.height * 0.01; } + else if(paddingLeft[1] === VMAX) { + w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(paddingLeft[1] === VMIN) { + w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01; + } if(borderLeftWidth[1] === PX) { w -= borderLeftWidth[0]; } @@ -138,6 +156,12 @@ class Geom extends Xom { else if(borderLeftWidth[1] === VH) { w -= borderLeftWidth[0] * this.root.height * 0.01; } + else if(borderLeftWidth[1] === VMAX) { + w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(borderLeftWidth[1] === VMIN) { + w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; + } if(marginRight[1] === PX) { w -= marginRight[0]; } @@ -153,6 +177,12 @@ class Geom extends Xom { else if(marginRight[1] === VH) { w -= marginRight[0] * this.root.height * 0.01; } + else if(marginRight[1] === VMAX) { + w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(marginRight[1] === VMIN) { + w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01; + } if(paddingRight[1] === PX) { w -= paddingRight[0]; } @@ -168,6 +198,12 @@ class Geom extends Xom { else if(paddingRight[1] === VH) { w -= paddingRight[0] * this.root.height * 0.01; } + else if(paddingRight[1] === VMAX) { + w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(paddingRight[1] === VMIN) { + w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01; + } if(borderRightWidth[1] === PX) { w -= borderRightWidth[0]; } @@ -180,6 +216,12 @@ class Geom extends Xom { else if(borderRightWidth[1] === VH) { w -= borderRightWidth[0] * this.root.height * 0.01; } + else if(borderRightWidth[1] === VMAX) { + w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(borderRightWidth[1] === VMIN) { + w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; + } return w; } @@ -208,6 +250,12 @@ class Geom extends Xom { else if(main[1] === VH) { min = max = main[0] * this.root.height * 0.01; } + else if(main[1] === VMAX) { + min = max = main[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(main[1] === VMIN) { + min = max = main[0] * Math.min(this.root.width, this.root.height) * 0.01; + } return [display, this.__addMp(isDirectionRow, data.w, currentStyle, [min, max])]; } @@ -237,7 +285,7 @@ class Geom extends Xom { } = currentStyle; let main = isDirectionRow ? width : height; // basis3种情况:auto、固定、content,只区分固定和其它 - let isFixed = [PX, PERCENT, REM, VW, VH].indexOf(flexBasis[1]) > -1; + let isFixed = [PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(flexBasis[1]) > -1; if(isFixed) { if(flexBasis[1] === PX) { b = max = min = flexBasis[0]; @@ -254,8 +302,14 @@ class Geom extends Xom { else if(flexBasis[1] === VH) { b = max = min = flexBasis[0] * this.root.height * 0.01; } + else if(flexBasis[1] === VMAX) { + b = max = min = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(flexBasis[1] === VMIN) { + b = max = min = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01; + } } - else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1)) { + else if(([PX, PERCENT, REM, VW, VH, VMAX, VMIN].indexOf(main[1]) > -1)) { if(main[1] === PX) { b = max = min = main[0]; } @@ -271,6 +325,12 @@ class Geom extends Xom { else if(main[1] === VH) { b = max = min = main[0] * this.root.height * 0.01; } + else if(main[1] === VMAX) { + b = max = min = main[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(main[1] === VMIN) { + b = max = min = main[0] * Math.min(this.root.width, this.root.height) * 0.01; + } } // border也得计算在内 if(isDirectionRow) { @@ -353,6 +413,12 @@ class Geom extends Xom { else if(item[1] === VH) { return item[0] * this.root.height * 0.01; } + else if(item[1] === VMAX) { + return item[0] * Math.max(this.root.width, this.root.height) * 0.01; + } + else if(item[1] === VMIN) { + return item[0] * Math.min(this.root.width, this.root.height) * 0.01; + } else { return 0; } diff --git a/src/node/geom/Line.js b/src/node/geom/Line.js index f585d5c07..f1744570c 100644 --- a/src/node/geom/Line.js +++ b/src/node/geom/Line.js @@ -12,7 +12,7 @@ const { STYLE_KEY: { FONT_SIZE, } } = enums; const { isNil } = util; -const { REM, VW, VH } = unit; +const { REM, VW, VH, VMAX, VMIN } = unit; function reBuild(target, origin, base, isMulti) { if(isMulti) { @@ -401,6 +401,12 @@ class Line extends Geom { else if(item[1] === VH) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); } + else if(item[1] === VMAX) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } + else if(item[1] === VMIN) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else { half = Math.max(item[0] * 0.5, half); } diff --git a/src/node/geom/Polyline.js b/src/node/geom/Polyline.js index f4e088f45..a2b3276a4 100644 --- a/src/node/geom/Polyline.js +++ b/src/node/geom/Polyline.js @@ -10,7 +10,7 @@ const { STYLE_KEY: { FONT_SIZE, } } = enums; const { isNil } = util; -const { REM, VW, VH } = unit; +const { REM, VW, VH, VMAX, VMIN } = unit; function concatPointAndControl(point, control) { if(Array.isArray(control) && (control.length === 2 || control.length === 4) @@ -439,6 +439,12 @@ class Polyline extends Geom { else if(item[1] === VH) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); } + else if(item[1] === VMAX) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } + else if(item[1] === VMIN) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else { half = Math.max(item[0] * 0.5, half); } diff --git a/src/node/geom/Rect.js b/src/node/geom/Rect.js index 477697660..2ff69f391 100644 --- a/src/node/geom/Rect.js +++ b/src/node/geom/Rect.js @@ -10,7 +10,7 @@ const { STYLE_KEY: { FONT_SIZE, } } = enums; const { isNil } = util; -const { REM, VW, VH } = unit; +const { REM, VW, VH, VMAX, VMIN } = unit; function genVertex(x, y, width, height, rx = 0, ry = 0) { if(rx === 0 || ry === 0) { @@ -146,6 +146,12 @@ class Rect extends Geom { else if(item[1] === VH) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); } + else if(item[1] === VMAX) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } + else if(item[1] === VMIN) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else { half = Math.max(item[0] * 0.5, half); } diff --git a/src/node/geom/Sector.js b/src/node/geom/Sector.js index a7a2670ed..7c3a50d70 100644 --- a/src/node/geom/Sector.js +++ b/src/node/geom/Sector.js @@ -12,7 +12,7 @@ const { STYLE_KEY: { } } = enums; const { isNil } = util; const { sectorPoints } = geom; -const { REM, VW, VH } = unit; +const { REM, VW, VH, VMAX, VMIN } = unit; function getR(v, dft) { v = parseFloat(v); @@ -361,6 +361,12 @@ class Sector extends Geom { else if(item[1] === VH) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); } + else if(item[1] === VMAX) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } + else if(item[1] === VMIN) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else { half = Math.max(item[0] * 0.5, half); } diff --git a/src/style/abbr.js b/src/style/abbr.js index 802053870..97a7172a5 100644 --- a/src/style/abbr.js +++ b/src/style/abbr.js @@ -18,7 +18,7 @@ function parseFlex(style, grow, shrink, basis) { function parseMarginPadding(style, key, list) { let temp = style[key]; if(!isNil(temp)) { - let match = temp.toString().match(/([-+]?[\d.]+[pxremvwh%]*)|(auto)/ig); + let match = temp.toString().match(/([-+]?[\d.]+[pxremvwhina%]*)|(auto)/ig); if(match) { if(match.length === 1) { match[3] = match[2] = match[1] = match[0]; @@ -46,7 +46,7 @@ function parseOneBorder(style, k) { } // 后面会统一格式化处理 if(isNil(style[k + 'Width'])) { - let w = /\b[\d.]+[pxremvwh%]*\b/i.exec(v); + let w = /\b[\d.]+[pxremvwhina%]*\b/i.exec(v); style[k + 'Width'] = w ? w[0] : 0; } if(isNil(style[k + 'Style'])) { @@ -194,7 +194,7 @@ export default { let arr = v.split(/\s+/); parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]); } - else if(/^[\d.]+\s+[\d.]+\s+[\d.]+[pxremvwh%]*/.test(v)) { + else if(/^[\d.]+\s+[\d.]+\s+[\d.]+[pxremvwhina%]*/.test(v)) { let arr = v.split(/\s+/); parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]); } @@ -202,14 +202,14 @@ export default { let arr = v.split(/\s+/); parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), 0); } - else if(/^[\d.]+\s+[\d.]+[pxremvwh%]+/.test(v)) { + else if(/^[\d.]+\s+[\d.]+[pxremvwhina%]+/.test(v)) { let arr = v.split(/\s+/); parseFlex(style, parseFloat(arr[0]), 1, arr[1]); } else if(/^[\d.]+$/.test(v)) { parseFlex(style, parseFloat(v), 1, 0); } - else if(/^[\d.]+[pxremvwh%]+/i.test(v)) { + else if(/^[\d.]+[pxremvwhina%]+/i.test(v)) { parseFlex(style, 1, 1, v); } else { @@ -307,7 +307,7 @@ export default { parseOneBorder(style, k); } else if(k === 'textStroke') { - let w = /(?:^|\s)([-+]?[\d.]+[pxremvwh%]*)/.exec(v); + let w = /(?:^|\s)([-+]?[\d.]+[pxremvwhina%]*)/.exec(v); if(w) { style.textStrokeWidth = w[1]; } diff --git a/src/style/bg.js b/src/style/bg.js index 09da2f667..5abef2be7 100644 --- a/src/style/bg.js +++ b/src/style/bg.js @@ -20,7 +20,7 @@ const { } = enums; const { clone, joinArr } = util; const { canvasPolygon, svgPolygon } = painter; -const { AUTO, PX, PERCENT, STRING, REM, VW, VH } = unit; +const { AUTO, PX, PERCENT, STRING, REM, VW, VH, VMAX, VMIN } = unit; function renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bbrr, bblr, method = 'fill', isInline = false, dx = 0, dy = 0) { @@ -135,6 +135,12 @@ function calBackgroundSize(value, w, h, root) { else if(item[1] === VH) { res.push(item[0] * root.height * 0.01); } + else if(item[1] === VMAX) { + res.push(item[0] * Math.max(root.width, root.height) * 0.01); + } + else if(item[1] === VMIN) { + res.push(item[0] * Math.min(root.width, root.height) * 0.01); + } else if(item[1] === AUTO) { res.push(-1); } @@ -162,6 +168,12 @@ function calBackgroundPosition(position, container, size, root) { else if(position[1] === VH) { return position[0] * root.height * 0.01; } + else if(position[1] === VMAX) { + res.push(position[0] * Math.max(root.width, root.height) * 0.01); + } + else if(position[1] === VMIN) { + res.push(position[0] * Math.min(root.width, root.height) * 0.01); + } } return 0; } diff --git a/src/style/border.js b/src/style/border.js index 62a5e74c4..4e53149e0 100644 --- a/src/style/border.js +++ b/src/style/border.js @@ -5,7 +5,7 @@ import enums from '../util/enums'; import unit from './unit'; const { H } = geom; -const { PX, PERCENT, REM, VW, VH } = unit; +const { PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit; const { canvasPolygon, svgPolygon } = painter; const { STYLE_KEY: { @@ -2783,6 +2783,12 @@ function calBorderRadius(w, h, currentStyle, computedStyle, root) { else if(item[1] === VH) { return Math.max(0, item[0] * root.height * 0.01); } + else if(item[1] === VMAX) { + return Math.max(0, item[0] * Math.max(root.width, root.height) * 0.01); + } + else if(item[1] === VMIN) { + return Math.max(0, item[0] * Math.min(root.width, root.height) * 0.01); + } return 0; }); }); diff --git a/src/style/css.js b/src/style/css.js index da107debb..9e65069c9 100644 --- a/src/style/css.js +++ b/src/style/css.js @@ -78,7 +78,7 @@ const { STYLE_KEY, STYLE_RV_KEY, style2Upper, STYLE_KEY: { TEXT_STROKE_WIDTH, TEXT_STROKE_OVER, } } = enums; -const { AUTO, PX, PERCENT, NUMBER, INHERIT, DEG, RGBA, STRING, REM, VW, VH, calUnit } = unit; +const { AUTO, PX, PERCENT, NUMBER, INHERIT, DEG, RGBA, STRING, REM, VW, VH, VMAX, VMIN, calUnit } = unit; const { isNil, rgba2int, equalArr } = util; const { MEASURE_KEY_SET, isGeom, GEOM, GEOM_KEY_SET } = change; @@ -316,7 +316,7 @@ function normalize(style, reset = []) { [0, AUTO], ]; } - let match = item.toString().match(/\b(?:([-+]?[\d.]+[pxremvwh%]*)|(contain|cover|auto))/ig); + let match = item.toString().match(/\b(?:([-+]?[\d.]+[pxremvwhina%]*)|(contain|cover|auto))/ig); if(match) { if(match.length === 1) { if(match[0] === 'contain' || match[0] === 'cover') { @@ -1006,10 +1006,10 @@ function normalize(style, reset = []) { temp = style.boxShadow; if(temp !== undefined) { let bs = null; - let match = (temp || '').match(/([-+]?[\d.]+[pxremvwh%]*)\s*([-+]?[\d.]+[pxremvwh%]*)\s*([-+]?[\d.]+[pxremvwh%]*\s*)?([-+]?[\d.]+[pxremvwh%]*\s*)?(((transparent)|(#[0-9a-f]{3,8})|(rgba?\(.+?\)))\s*)?(inset|outset)?\s*,?/ig); + 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); if(match) { match.forEach(item => { - let boxShadow = /([-+]?[\d.]+[pxremvwh%]*)\s*([-+]?[\d.]+[pxremvwh%]*)\s*([-+]?[\d.]+[pxremvwh%]*\s*)?([-+]?[\d.]+[pxremvwh%]*\s*)?(?:((?:transparent)|(?:#[0-9a-f]{3,8})|(?:rgba?\(.+\)))\s*)?(inset|outset)?/i.exec(item); + 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); if(boxShadow) { bs = bs || []; let res = []; @@ -1127,6 +1127,12 @@ function computeMeasure(node, isRoot) { else if(v[1] === VH) { computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.height * 0.01 * v[0]); } + else if(v[1] === VMAX) { + computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (Math.max(node.root.width, node.root.height) * 0.01 * v[0]); + } + else if(v[1] === VMIN) { + computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (Math.min(node.root.width, node.root.height) * 0.01 * v[0]); + } else { computedStyle[k] = v[0]; } @@ -1163,6 +1169,12 @@ function computeReflow(node, isHost) { else if(item[1] === VH) { computedStyle[k] = item[0] * root.height * 0.01; } + else if(item[1] === VMAX) { + computedStyle[k] = item[0] * Math.max(root.width, root.height) * 0.01; + } + else if(item[1] === VMIN) { + computedStyle[k] = item[0] * Math.min(root.width, root.height) * 0.01; + } else { computedStyle[k] = 0; } @@ -1237,6 +1249,12 @@ function computeReflow(node, isHost) { else if(lineHeight[1] === VH) { computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.height * 0.01, 0) || calNormalLineHeight(computedStyle); } + else if(lineHeight[1] === VMAX) { + computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * Math.max(root.width, root.height) * 0.01, 0) || calNormalLineHeight(computedStyle); + } + else if(lineHeight[1] === VMIN) { + computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * Math.min(root.width, root.height) * 0.01, 0) || calNormalLineHeight(computedStyle); + } else if(lineHeight[1] === NUMBER) { computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) * fontSize || calNormalLineHeight(computedStyle); } @@ -1260,6 +1278,12 @@ function computeReflow(node, isHost) { else if(letterSpacing[1] === VH) { computedStyle[LETTER_SPACING] = root.height * 0.01 * letterSpacing[0]; } + else if(letterSpacing[1] === VMAX) { + computedStyle[LETTER_SPACING] = Math.max(root.width, root.height) * 0.01 * letterSpacing[0]; + } + else if(letterSpacing[1] === VMIN) { + computedStyle[LETTER_SPACING] = Math.min(root.width, root.height) * 0.01 * letterSpacing[0]; + } else { computedStyle[LETTER_SPACING] = letterSpacing[0]; } @@ -1331,6 +1355,12 @@ function calRelativePercent(n, parent, k) { else if(style[1] === VH) { return n * style[0] * parent.root.height * 0.01; } + else if(style[1] === VMAX) { + return n * style[0] * Math.max(parent.root.width, parent.root.height) * 0.01; + } + else if(style[1] === VMIN) { + return n * style[0] * Math.min(parent.root.width, parent.root.height) * 0.01; + } } return n; } @@ -1359,6 +1389,12 @@ function calRelative(currentStyle, k, v, parent, isWidth) { else if(v[1] === VH) { v = v[0] * parent.root.height * 0.01; } + else if(v[1] === VMAX) { + v = v[0] * Math.max(parent.root.width, parent.root.height) * 0.01; + } + else if(v[1] === VMIN) { + v = v[0] * Math.min(parent.root.width, parent.root.height) * 0.01; + } return v; } @@ -1381,6 +1417,12 @@ function calAbsolute(currentStyle, k, v, size, root) { else if(v[1] === VH) { v = v[0] * root.height * 0.01; } + else if(v[1] === VMAX) { + v = v[0] * Math.max(root.width, root.height) * 0.01; + } + else if(v[1] === VMIN) { + v = v[0] * Math.min(root.width, root.height) * 0.01; + } return v; } diff --git a/src/style/gradient.js b/src/style/gradient.js index ad9e77411..442e774ac 100644 --- a/src/style/gradient.js +++ b/src/style/gradient.js @@ -12,7 +12,7 @@ import enums from '../util/enums'; import inject from '../util/inject'; const { rgba2int, isNil } = util; -const { PX, PERCENT, DEG, NUMBER, REM, VW, VH, calUnit } = unit; +const { PX, PERCENT, DEG, NUMBER, REM, VW, VH, VMAX, VMIN, calUnit } = unit; const { d2r } = geom; const { canvasPolygon, svgPolygon } = painter; const { @@ -103,6 +103,12 @@ function getColorStop(v, length, root) { else if(p[1] === VH) { list.push([item[0], p[0] * root.height / length]); } + else if(p[1] === VMAX) { + list.push([item[0], p[0] * Math.max(root.width, root.height) / length]); + } + else if(p[1] === VMIN) { + list.push([item[0], p[0] * Math.min(root.width, root.height) / length]); + } else { list.push([item[0], p[0] / length]); } @@ -276,6 +282,12 @@ function calCircleCentre(position, x1, y1, iw, ih, root) { else if(positionX[1] === VH) { cx = x1 + positionX[0] * root.height * 0.01; } + else if(positionX[1] === VMAX) { + cx = x1 + positionX[0] * Math.max(root.width, root.height) * 0.01; + } + else if(positionX[1] === VMIN) { + cx = x1 + positionX[0] * Math.min(root.width, root.height) * 0.01; + } else { cx = x1 + positionX[0]; } @@ -291,6 +303,12 @@ function calCircleCentre(position, x1, y1, iw, ih, root) { else if(positionY[1] === VH) { cy = y1 + positionY[0] * root.height * 0.01; } + else if(positionY[1] === VH) { + cy = y1 + positionY[0] * Math.max(root.width, root.height) * 0.01; + } + else if(positionY[1] === VH) { + cy = y1 + positionY[0] * Math.min(root.width, root.height) * 0.01; + } else { cy = y1 + positionY[0]; } @@ -489,7 +507,7 @@ function parseGradient(s) { o.z = 'farthest-corner'; } } - let position = /at\s+((?:[-+]?[\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\s+((?:[-+]?[\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]); + let position = /at\s+((?:[-+]?[\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center))(?:\s+((?:[-+]?[\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]); if(position) { let x = getRadialPosition(position[1]); let y = position[2] ? getRadialPosition(position[2]) : x; @@ -507,7 +525,7 @@ function parseGradient(s) { else { o.d = 0; } - let position = /at\s+((?:[-+]?[\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\s+((?:[-+]?[\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]); + let position = /at\s+((?:[-+]?[\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center))(?:\s+((?:[-+]?[\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]); if(position) { let x = getRadialPosition(position[1]); let y = position[2] ? getRadialPosition(position[2]) : x; @@ -517,11 +535,11 @@ function parseGradient(s) { o.p = [[50, PERCENT], [50, PERCENT]]; } } - let v = gradient[2].match(/([-+]?[\d.]+[pxremvwh%]+)?\s*((#[0-9a-f]{3,8})|(rgba?\s*\(.+?\)))\s*([-+]?[\d.]+[pxremvwh%]+)?/ig) || []; + let v = gradient[2].match(/([-+]?[\d.]+[pxremvwhina%]+)?\s*((#[0-9a-f]{3,8})|(rgba?\s*\(.+?\)))\s*([-+]?[\d.]+[pxremvwhina%]+)?/ig) || []; o.v = v.map(item => { let color = /((?:#[0-9a-f]{3,8})|(?:rgba?\s*\(.+?\)))/i.exec(item); let arr = [rgba2int(color[1])]; - let percent = /[-+]?[\d.]+[pxremvwh%]+/.exec(item); + let percent = /[-+]?[\d.]+[pxremvwhina%]+/.exec(item); if(percent) { let v = calUnit(percent[0]); if([NUMBER, DEG].indexOf(v[1]) > -1) { diff --git a/src/style/reg.js b/src/style/reg.js index 6cc0faa3b..0a14d6340 100644 --- a/src/style/reg.js +++ b/src/style/reg.js @@ -1,5 +1,5 @@ export default { - position: /(([-+]?[\d.]+[pxremvwh%]*)|(left|top|right|bottom|center)){1,2}/ig, + position: /(([-+]?[\d.]+[pxremvwhina%]*)|(left|top|right|bottom|center)){1,2}/ig, // tfo: /((-?[\d.]+(px|%)?)|(left|top|right|bottom|center)){1,2}/ig, gradient: /\b(\w+)-?gradient\((.+)\)/i, img: /(?:\burl\((['"]?)(.*?)\1\))|(?:\b((data:)))/i, diff --git a/src/style/transform.js b/src/style/transform.js index 22e281e8e..6b64e00a8 100644 --- a/src/style/transform.js +++ b/src/style/transform.js @@ -20,7 +20,7 @@ const { STYLE_KEY: { MATRIX, FONT_SIZE, }} = enums; -const { PX, PERCENT, REM, VW, VH } = unit; +const { PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit; const { matrix, geom } = math; const { identity, multiply, isE } = matrix; const { d2r } = geom; @@ -198,6 +198,12 @@ function normalizeSingle(k, v, ow, oh, root) { else if(v[1] === VH) { return v[0] * root.height * 0.01; } + else if(v[1] === VMAX) { + return v[0] * Math.max(root.width, root.height) * 0.01; + } + else if(v[1] === VMIN) { + return v[0] * Math.min(root.width, root.height) * 0.01; + } } else if(k === TRANSLATE_Y) { if(v[1] === PERCENT) { @@ -212,6 +218,12 @@ function normalizeSingle(k, v, ow, oh, root) { else if(v[1] === VH) { return v[0] * root.height * 0.01; } + else if(v[1] === VMAX) { + return v[0] * Math.max(root.width, root.height) * 0.01; + } + else if(v[1] === VMIN) { + return v[0] * Math.min(root.width, root.height) * 0.01; + } } else if(k === MATRIX) { return v; @@ -249,6 +261,12 @@ function calOrigin(transformOrigin, w, h, root) { else if(item[1] === VH) { tfo.push(item[0] * root.height * 0.01); } + else if(item[1] === VMAX) { + tfo.push(item[0] * Math.max(root.width, root.height) * 0.01); + } + else if(item[1] === VMIN) { + tfo.push(item[0] * Math.min(root.width, root.height) * 0.01); + } }); return tfo; } From ec9120bf1304f7b0e407530261f74842162a56a1 Mon Sep 17 00:00:00 2001 From: army8735 Date: Mon, 29 Nov 2021 15:08:16 +0800 Subject: [PATCH 4/5] fix: vmax/vmin #194 --- index.js | 11 ++++++----- index.js.map | 2 +- src/node/Dom.js | 3 ++- src/style/bg.js | 4 ++-- test/group4/vmax-svg/index.html | 15 +++++++++++++++ test/group4/vmax-svg/script.jsx | 25 +++++++++++++++++++++++++ test/group4/vmax-svg/test.js | 13 +++++++++++++ 7 files changed, 64 insertions(+), 9 deletions(-) create mode 100644 test/group4/vmax-svg/index.html create mode 100644 test/group4/vmax-svg/script.jsx create mode 100644 test/group4/vmax-svg/test.js diff --git a/index.js b/index.js index 21730348a..93b371c4a 100644 --- a/index.js +++ b/index.js @@ -15703,9 +15703,9 @@ } else if (position[1] === VH$5) { return position[0] * root.height * 0.01; } else if (position[1] === VMAX$5) { - res.push(position[0] * Math.max(root.width, root.height) * 0.01); + return position[0] * Math.max(root.width, root.height) * 0.01; } else if (position[1] === VMIN$5) { - res.push(position[0] * Math.min(root.width, root.height) * 0.01); + return position[0] * Math.min(root.width, root.height) * 0.01; } } @@ -26855,9 +26855,10 @@ h2 = height[0] * Math.max(_this4.root.width, _this4.root.height) * 0.01; } else if (height[1] === VMIN$8) { h2 = height[0] * Math.min(_this4.root.width, _this4.root.height) * 0.01; - } else { - h2 = height[0]; - } + } // 特殊必须声明防止AUTO + else if (height[1] === PX$8) { + h2 = height[0]; + } } // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局 diff --git a/index.js.map b/index.js.map index 860ed33e7..b57d90d85 100644 --- a/index.js.map +++ b/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["src/util/enums.js","src/node/Node.js","src/node/mode.js","src/style/unit.js","src/style/font.js","src/style/reg.js","src/math/matrix.js","src/math/vector.js","src/math/geom.js","src/math/gradient.js","src/util/painter.js","src/style/border.js","src/util/$$type.js","src/util/util.js","src/util/debug.js","src/node/textCache.js","src/gl/ca.js","src/gl/webgl.js","src/util/inject.js","src/style/gradient.js","src/style/reset.js","src/style/abbr.js","src/animate/key.js","src/refresh/change.js","src/style/css.js","src/node/TextBox.js","src/refresh/Page.js","src/math/tar.js","src/math/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_FRAME_CB: 8,\n I_PLAY_CB: 9,\n I_TARGET: 10,\n I_ROOT: 11,\n I_FRAMES: 12,\n I_FRAMES_R: 13,\n I_CURRENT_TIME: 14,\n I_NEXT_TIME: 15,\n I_STYLE: 16,\n I_DURATION: 17,\n I_ITERATIONS: 18,\n I_FILL: 19,\n I_PLAYBACK_RATE: 20,\n I_PLAY_COUNT: 21,\n I_PLAY_STATE: 22,\n I_DESTROYED: 23,\n I_START_TIME: 24,\n I_FPS_TIME: 25,\n I_EASING: 26,\n I_ENTER_FRAME: 27,\n I_DELAY: 28,\n I_END_DELAY: 29,\n I_KEYS: 30,\n I_ORIGIN_STYLE: 31,\n I_CURRENT_FRAMES: 32,\n I_CURRENT_FRAME: 33,\n I_SPF_LIMIT: 34,\n I_FPS: 35,\n I_DIRECTION: 36,\n I_CAL_DIFF_TIME: 37,\n I_FIRST_ENTER: 38,\n I_STAY_BEGIN: 39,\n I_STAY_END: 40,\n I_IS2: 41,\n I_END_TIME: 42,\n I_NODE_CONFIG: 43,\n I_ROOT_CONFIG: 44,\n I_OUT_BEGIN_DELAY: 45,\n I_TIME_STAMP: 46,\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.__width = 0;\n this.__height = 0;\n this.__baseLine = 0;\n this.__config = {};\n // 默认undefined\n // this.__prev = undefined;\n // this.__next = undefined;\n // this.__parent = undefined;\n // this.__domParent = undefined;\n // this.__root = undefined;\n // this.__host = undefined;\n }\n\n __structure(i, lv, j) {\n return this.__config[NODE_STRUCT] = {\n [STRUCT_NODE]: this,\n [STRUCT_INDEX]: i,\n [STRUCT_CHILD_INDEX]: j,\n [STRUCT_LV]: lv,\n };\n }\n\n __modifyStruct(root, offset = 0) {\n let struct = this.__config[NODE_STRUCT];\n return [struct, 0];\n }\n\n __offsetX(diff, isLayout) {\n if(isLayout) {\n this.__x += diff;\n }\n else {\n this.__ox += diff;\n }\n this.__sx += diff;\n }\n\n __offsetY(diff, isLayout) {\n if(isLayout) {\n this.__y += diff;\n }\n else {\n this.__oy += diff;\n }\n this.__sy += diff;\n }\n\n __destroy() {\n this.__config[NODE_IS_DESTROYED] = true;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get ox() {\n return this.__ox;\n }\n\n get oy() {\n return this.__oy;\n }\n\n get sx() {\n return this.x + this.ox;\n }\n\n get sy() {\n return this.y + this.oy;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n // canvas/svg根节点\n get root() {\n return this.__root;\n }\n\n // component根节点\n get host() {\n return this.__host;\n }\n\n // 考虑高阶组件在内的component根节点\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get baseLine() {\n return this.__baseLine;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get isDestroyed() {\n return this.__config[NODE_IS_DESTROYED];\n }\n}\n\nexport default Node;\n","export default {\n CANVAS: 0,\n SVG: 1,\n WEBGL: 2,\n};\n","let o = {\n AUTO: 0,\n PX: 1,\n PERCENT: 2,\n NUMBER: 3,\n INHERIT: 4,\n DEG: 5,\n STRING: 6,\n RGBA: 7,\n REM: 8,\n EM: 9,\n VW: 10,\n VH: 11,\n 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 verdana: {\n lhr: 1.21533203125, // (0+2059+430)/2048\n blr: 1.00537109375, // 2059/2048\n },\n tahoma: {\n lhr: 1.20703125, // (0+2049+423)/2048\n blr: 1.00048828125, // 2049/2048\n padding: {\n S: 1,\n T: 1,\n Z: 1,\n c: 1,\n f: 0.7,\n i: 1,\n l: 1,\n t: 0.9,\n },\n },\n georgia: {\n lhr: 1.13623046875, // (0+1878+449)/2048\n blr: 0.9169921875, // 1878/2048\n },\n 'courier new': {\n lhr: 1.1328125, // (0+1705+615)/2048\n blr: 0.83251953125, // 1705/2048\n },\n 'pingfang sc': {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06, // 1060/1000\n padding: {\n f: 0.5,\n },\n },\n simsun: {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06,\n padding: {\n f: 0.5,\n },\n },\n },\n support(fontFamily) {\n return this.info.hasOwnProperty(fontFamily);\n },\n register(name, info) {\n let { emSquare = 2048, ascent = 1854, descent = 434, lineGap = 67, padding = {} } = info || {};\n this.info[name.toLowerCase()] = {\n lhr: (ascent + descent + lineGap) / emSquare,\n blr: ascent / emSquare,\n padding,\n };\n },\n addPadding(name, padding) {\n Object.assign(this.info[name.toLowerCase()].padding, padding);\n },\n};\n\no.info['宋体'] = o.info.simsun;\n\nexport default o;\n","export default {\n position: /(([-+]?[\\d.]+[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') {\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(['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 = { _: 1 };\nconst TYPE_GM = { _: 2 };\nconst TYPE_CP = { _: 3 };\n\nexport default {\n TYPE_VD,\n TYPE_GM,\n TYPE_CP,\n};\n","import $$type from './$$type';\nimport mx from '../math/matrix';\n\nlet toString = {}.toString;\nfunction isType(type) {\n return function(obj) {\n return toString.call(obj) === '[object ' + type + ']';\n }\n}\n\nlet isObject = isType('Object');\nlet isString = isType('String');\nlet isFunction = isType('Function');\nlet isNumber = isType('Number');\nlet isBoolean = isType('Boolean');\nlet isDate = isType('Date');\n\nlet hasOwn = {}.hasOwnProperty;\nlet fnToString = hasOwn.toString;\nlet ObjectFunctionString = fnToString.call(Object);\n\nfunction isNil(v) {\n return v === undefined || v === null;\n}\n\nfunction joinSourceArray(arr) {\n let res = '';\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n res += joinSourceArray(item);\n }\n else {\n res += stringify(item);\n }\n }\n return res;\n}\n\nfunction stringify(s) {\n if(isNil(s)) {\n return '';\n }\n return s.toString();\n}\n\nfunction encodeHtml(s, prop) {\n if(prop) {\n return s.replace(/\"/g, '"');\n }\n return s.replace(/&/g, '&').replace(/ {\n s += joinDef(item);\n });\n s += '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n return s;\n}\n\n// 普通元素\nfunction joinVd(vd) {\n if(vd.type === 'item' || vd.type === 'img') {\n let s = '';\n (vd.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n if(vd.tagName === 'text') {\n return '' + vd.content + '';\n }\n return '<' + vd.tagName + s + '/>';\n }\n else if(vd.type === 'text') {\n let s = ``;\n // text有许多lineBox\n (vd.children || []).forEach(item => {\n s += joinVd(item);\n });\n return '' + s + '';\n }\n else if(vd.type === 'dom' || vd.type === 'geom') {\n let s = '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n let { opacity, transform, visibility, mask, overflow, filter, mixBlendMode } = vd;\n return '' + s + '';\n }\n}\n\nfunction joinDef(def) {\n let s = '<' + def.tagName + ' id=\"' + def.uuid + '\"';\n if(def.tagName === 'mask' || def.tagName === 'clipPath') {\n // s += ' maskUnits=\"userSpaceOnUse\"';\n }\n else if(def.tagName === 'filter') {\n // s += ' filterUnits=\"userSpaceOnUse\"';\n }\n else {\n s += ' gradientUnits=\"userSpaceOnUse\"';\n }\n (def.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n (def.children || []).forEach(item => {\n s += joinItem(item);\n });\n s += '';\n return s;\n}\n\nfunction joinItem(item) {\n let s = '<' + item.tagName;\n (item.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n return s;\n}\n\nfunction rgba2int(color) {\n if(Array.isArray(color)) {\n return color;\n }\n let res = [];\n if(!color || color === 'transparent') {\n res = [0, 0, 0, 0];\n }\n else if(color.charAt(0) === '#') {\n color = color.slice(1);\n if(color.length === 3) {\n res.push(parseInt(color.charAt(0) + color.charAt(0), 16));\n res.push(parseInt(color.charAt(1) + color.charAt(1), 16));\n res.push(parseInt(color.charAt(2) + color.charAt(2), 16));\n res[3] = 1;\n }\n else if(color.length === 6) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4), 16));\n res[3] = 1;\n }\n else if(color.length === 8) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4, 6), 16));\n res.push(parseInt(color.slice(6), 16) / 255);\n }\n else {\n res[0] = res[1] = res[2] = 0;\n res[3] = 1;\n }\n }\n else {\n let c = color.match(/rgba?\\s*\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*,\\s*([\\d.]+)(?:\\s*,\\s*([\\d.]+))?\\s*\\)/i);\n if(c) {\n res = [parseInt(c[1]), parseInt(c[2]), parseInt(c[3])];\n if(!isNil(c[4])) {\n res[3] = parseFloat(c[4]);\n }\n else {\n res[3] = 1;\n }\n }\n else {\n res = [0, 0, 0, 0];\n }\n }\n return res;\n}\n\nfunction int2rgba(color) {\n if(Array.isArray(color)) {\n if(color.length === 4) {\n color = color.map((c, i) => i === 3 ? c : Math.floor(Math.max(0, c)));\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n color = color.map(c => Math.floor(c));\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return color || 'rgba(0,0,0,0)';\n}\n\nfunction int2invert(color) {\n if(Array.isArray(color)) {\n color = color.slice(0);\n color[0] = 255 - color[0];\n color[1] = 255 - color[1];\n color[2] = 255 - color[2];\n if(color.length === 4) {\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return 'rgba(0,0,0,0)';\n}\n\nfunction arr2hash(arr) {\n let hash = {};\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n hash[item[0]] = item[1];\n }\n else {\n for(let list = Object.keys(item), j = list.length - 1; j >= 0; j--) {\n let k = list[j];\n hash[k] = item[k];\n }\n }\n }\n return hash;\n}\n\nfunction hash2arr(hash) {\n if(Array.isArray(hash)) {\n return hash;\n }\n let arr = [];\n for(let list = Object.keys(hash), i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n arr.push([k, hash[k]]);\n }\n return arr;\n}\n\nfunction clone(obj) {\n if(isNil(obj) || typeof obj !== 'object') {\n return obj;\n }\n // parse递归会出现内部先返回解析好的json,外部parse不能clone\n if(obj.$$type === $$type.TYPE_VD\n || obj.$$type === $$type.TYPE_GM\n || obj.$$type === $$type.TYPE_CP) {\n return obj;\n }\n if(util.isDate(obj)) {\n return new Date(obj);\n }\n if(!isPlainObject(obj) && !Array.isArray(obj)) {\n return obj;\n }\n let n = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(i => {\n n[i] = clone(obj[i]);\n });\n return n;\n}\n\n/**\n * 简化的arr对比,arr中只有arr和其它类型,其它类型对比值或引用,arr递归\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equalArr(a, b) {\n if(!a || !b) {\n return a === b;\n }\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let ai = a[i];\n let bi = b[i];\n let isArrayA = Array.isArray(ai);\n let isArrayB = Array.isArray(bi);\n if(isArrayA && isArrayB) {\n if(!equalArr(ai, bi)) {\n return false;\n }\n }\n else if(isArrayA || isArrayB) {\n return false;\n }\n else if(ai !== bi) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 深度对比对象\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equal(a, b) {\n if(a === b) {\n return true;\n }\n if(isObject(a) && isObject(b)) {\n let hash = {};\n for(let i = 0, arr = Object.keys(a), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!b.hasOwnProperty(k) || !equal(a[k], b[k])) {\n return false;\n }\n hash[k] = true;\n }\n // a没有b有则false\n for(let i = 0, arr = Object.keys(b), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!hash.hasOwnProperty(k)) {\n return false;\n }\n }\n }\n else if(isDate(a) && isDate(b)) {\n return a.getTime() === b.getTime();\n }\n else if(Array.isArray(a) && Array.isArray(b)) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equal(a[i], b[i])) {\n return false;\n }\n }\n }\n else {\n return a === b;\n }\n return true;\n}\n\nfunction extend(target, source, keys) {\n if(source === null || typeof source !== 'object') {\n return target;\n }\n if(!keys) {\n keys = Object.keys(source);\n }\n let i = 0;\n let len = keys.length;\n while(i < len) {\n let k = keys[i];\n target[k] = source[k];\n i++;\n }\n return target;\n}\n\nfunction joinArr(arr, split) {\n let s = arr.length ? arr[0] : '';\n for(let i = 1, len = arr.length; i < len; i++) {\n s += split + arr[i];\n }\n return s;\n}\n\nfunction extendAnimate(ovd, nvd) {\n let list = nvd.__animationList = ovd.animationList.splice(0);\n list.forEach(item => {\n item.__setTarget(nvd);\n // 事件队列的缘故,可能动画本帧刚执行过,然后再继承,就会缺失,需再次赋值一遍;也有可能停留最后\n if(item.assigning || item.finished && item.__stayEnd()) {\n item.assignCurrentStyle();\n }\n });\n // 帧动画继承\n nvd.__frameAnimateList = ovd.__frameAnimateList.splice(0);\n}\n\nfunction transformBbox(bbox, matrix, dx = 0, dy = 0) {\n if(matrix && !mx.isE(matrix)) {\n let [x1, y1, x2, y2] = bbox;\n // 可能因filter的原因扩展范围\n if(dx) {\n x1 -= dx;\n x2 += dx;\n }\n if(dy) {\n y1 -= dy;\n y2 += dy;\n }\n let list = [x2, y1, x1, y2, x2, y2];\n let w;\n [x1, y1, , w] = mx.calPoint([x1, y1], matrix);\n if(w && w !== 1) {\n x1 /= w;\n y1 /= w;\n }\n let xa = x1, ya = y1, xb = x1, yb = y1;\n for(let i = 0; i < 6; i += 2) {\n let x = list[i], y = list[i + 1];\n [x, y, , w] = mx.calPoint([x, y], matrix);\n if(w && w !== 1) {\n x /= w;\n y /= w;\n }\n xa = Math.min(xa, x);\n xb = Math.max(xb, x);\n ya = Math.min(ya, y);\n yb = Math.max(yb, y);\n }\n bbox = [xa, ya, xb, yb];\n }\n else if(dx || dy) {\n bbox = bbox.slice(0);\n bbox[0] -= dx;\n bbox[1] -= dy;\n bbox[2] += dx;\n bbox[3] += dy;\n }\n return bbox;\n}\n\nfunction isPlainObject(obj) {\n if(!obj || toString.call(obj) !== '[object Object]') {\n return false;\n }\n let proto = Object.getPrototypeOf(obj);\n if(!proto) {\n return true;\n }\n let Ctor = hasOwn.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor === 'function' && fnToString.call(Ctor) === ObjectFunctionString;\n}\n\nfunction assignMatrix(t, v) {\n t[0] = v[0];\n t[1] = v[1];\n t[2] = v[2];\n t[3] = v[3];\n t[4] = v[4];\n t[5] = v[5];\n t[6] = v[6];\n t[7] = v[7];\n t[8] = v[8];\n t[9] = v[9];\n t[10] = v[10];\n t[11] = v[11];\n t[12] = v[12];\n t[13] = v[13];\n t[14] = v[14];\n t[15] = v[15];\n return t;\n}\n\nlet util = {\n isObject,\n isString,\n isFunction,\n isNumber,\n isBoolean,\n isDate,\n isNil,\n isPrimitive(v) {\n return util.isNil(v) || util.isBoolean(v) || util.isString(v) || util.isNumber(v);\n },\n // css中常用undefined/null表示auto本身\n isAuto(v) {\n return isNil(v) || v === 'auto';\n },\n isPlainObject,\n stringify,\n joinSourceArray(arr) {\n return joinSourceArray(arr);\n },\n encodeHtml,\n joinVirtualDom,\n joinVd,\n joinDef,\n rgba2int,\n int2rgba,\n int2invert,\n arr2hash,\n hash2arr,\n clone,\n equalArr,\n equal,\n extend,\n joinArr,\n extendAnimate,\n transformBbox,\n assignMatrix,\n};\n\nexport default util;\n","export default {\n flag: false,\n};\n","export default {\n list: [], // 每次渲染前的更新后,等待测量的文字对象列表\n data: {}, // Text中存入的特殊等待测量的信息,字体+字号+粗细为key\n charWidth: {}, // key的文字宽度hash\n padding: {}, // key的文字宽度偏移,少量字体的少量文字有\n ELLIPSIS: '…',\n};\n","export default {\n alpha: true,\n antialias: true,\n premultipliedAlpha: true,\n preserveDrawingBuffer: true,\n // depth: true,\n // stencil: true,\n};\n","import mx from '../math/matrix';\n\nconst calPoint = mx.calPoint;\n\n/**\n * 初始化 shader\n * @param gl GL context\n * @param vshader vertex shader (string)\n * @param fshader fragment shader (string)\n * @return program, if the program object was created and successfully made current\n */\nfunction initShaders(gl, vshader, fshader) {\n let program = createProgram(gl, vshader, fshader);\n if(!program) {\n throw new Error('Failed to create program');\n }\n\n // 要开启透明度,用以绘制透明的图形\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n return program;\n}\n\n/**\n * Create the linked program object\n * @param gl GL context\n * @param vshader a vertex shader program (string)\n * @param fshader a fragment shader program (string)\n * @return created program object, or null if the creation has failed\n */\nfunction createProgram(gl, vshader, fshader) {\n // Create shader object\n let vertexShader = loadShader(gl, gl.VERTEX_SHADER, vshader);\n let fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fshader);\n if(!vertexShader || !fragmentShader) {\n return null;\n }\n\n // Create a program object\n let program = gl.createProgram();\n if(!program) {\n return null;\n }\n program.vertexShader = vertexShader;\n program.fragmentShader = fragmentShader;\n\n // Attach the shader objects\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n // Link the program object\n gl.linkProgram(program);\n\n // Check the result of linking\n let linked = gl.getProgramParameter(program, gl.LINK_STATUS);\n if(!linked) {\n let error = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n gl.deleteShader(fragmentShader);\n gl.deleteShader(vertexShader);\n throw new Error('Failed to link program: ' + error);\n }\n return program;\n}\n\n/**\n * Create a shader object\n * @param gl GL context\n * @param type the type of the shader object to be created\n * @param source shader program (string)\n * @return created shader object, or null if the creation has failed.\n */\nexport function loadShader(gl, type, source) {\n // Create shader object\n let shader = gl.createShader(type);\n if(shader == null) {\n throw new Error('unable to create shader');\n }\n\n // Set the shader program\n gl.shaderSource(shader, source);\n\n // Compile the shader\n gl.compileShader(shader);\n\n // Check the result of compilation\n let compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if(!compiled) {\n let error = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error('Failed to compile shader: ' + error);\n }\n\n return shader;\n}\n\nfunction convertCoords2Gl([x, y, z, w], cx, cy, revertY) {\n if(z === undefined) {\n z = 0;\n }\n if(w === undefined) {\n w = 1;\n }\n if(w && w !== 1) {\n x /= w;\n y /= w;\n z /= w;\n }\n if(x === cx) {\n x = 0;\n }\n else {\n x = (x - cx) / cx;\n }\n if(y === cy) {\n y = 0;\n }\n else {\n y = (y - cy) / cy;\n if(revertY) {\n y = -y;\n }\n }\n return [x * w, y * w, z * w, w];\n}\n\nfunction createTexture(gl, tex, n, width, height) {\n let texture = gl.createTexture();\n bindTexture(gl, texture, n);\n // gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, -1);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n // 传入高宽时是绑定fbo,且tex一定为null\n if(width && height) {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n // 普通将canvas对象作为纹理\n else {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n return texture;\n}\n\nfunction bindTexture(gl, texture, n) {\n gl.activeTexture(gl['TEXTURE' + n]);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n}\n\n/**\n * texCache集满纹理上传占用最多可用纹理单元后,进行批量顺序绘制\n * 将所有dom的矩形顶点(经过transform变换后的)、贴图坐标、透明度存入3个buffer中,\n * 然后相同纹理单元的形成一批,设置uniform的纹理单元号进行绘制,如此循环\n * @param gl\n * @param list\n * @param hash\n * @param cx\n * @param cy\n * @param revertY\n */\nfunction drawTextureCache(gl, list, hash, cx, cy, revertY) {\n let vtPoint = [], vtTex = [], vtOpacity = [];\n let lastChannel; // 上一个dom的单元号\n let record = [0]; // [num, channel]每一批的数量和单元号记录\n let stack = [record]; // 所有批的数据记录集合\n list.forEach((item, i) => {\n let [cache, opacity, matrix, dx, dy] = item;\n if(i) {\n let channel = hash[cache.page.uuid];\n // 和上一个单元号不同时,生成新的批次记录\n if(lastChannel !== channel) {\n lastChannel = channel;\n record = [0, lastChannel];\n stack.push(record);\n }\n }\n else {\n lastChannel = hash[cache.page.uuid];\n record[1] = lastChannel;\n }\n let { x, y, width, height, page, bbox } = cache;\n // 计算顶点坐标和纹理坐标,转换[0,1]对应关系\n let bx = bbox[0], by = bbox[1];\n let [xa, ya] = [bx + (dx || 0), by + height + (dy || 0)];\n let [xb, yb] = [bx + width + (dx || 0), by + (dy || 0)];\n let [x1, y1, , w1] = calPoint([xa, ya], matrix);\n let [x2, y2, , w2] = calPoint([xb, ya], matrix);\n let [x3, y3, , w3] = calPoint([xb, yb], matrix);\n let [x4, y4, , w4] = calPoint([xa, yb], matrix);\n [x1, y1] = convertCoords2Gl([x1, y1, 0, w1], cx, cy, revertY);\n [x2, y2] = convertCoords2Gl([x2, y2, 0, w2], cx, cy, revertY);\n [x3, y3] = convertCoords2Gl([x3, y3, 0, w3], cx, cy, revertY);\n [x4, y4] = convertCoords2Gl([x4, y4, 0, w4], cx, cy, revertY);\n vtPoint.push(x1, y1, 0, w1, x4, y4, 0, w4, x2, y2, 0, w2, x4, y4, 0, w4, x2, y2, 0, w2, x3, y3, 0, w3);\n let tx1 = x / page.width, ty1 = (y + height) / page.height;\n let tx2 = (x + width) / page.width, ty2 = y / page.height;\n vtTex.push(tx1, ty1, tx1, ty2, tx2, ty1, tx1, ty2, tx2, ty1, tx2, ty2);\n vtOpacity.push(opacity, opacity, opacity, opacity, opacity, opacity);\n record[0]++;\n });\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtPoint), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.program, 'a_position');\n gl.vertexAttribPointer(a_position, 4, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtTex), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // opacity buffer\n let opacityBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, opacityBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtOpacity), gl.STATIC_DRAW);\n let a_opacity = gl.getAttribLocation(gl.program, 'a_opacity');\n gl.vertexAttribPointer(a_opacity, 1, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_opacity);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.program, 'u_texture');\n let count = 0;\n // 循环按批次渲染\n stack.forEach(record => {\n let [num, channel] = record;\n gl.uniform1i(u_texture, channel);\n num *= 6;\n gl.drawArrays(gl.TRIANGLES, count, num);\n count += num;\n });\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.deleteBuffer(opacityBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n gl.disableVertexAttribArray(a_opacity);\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核扩大3倍性能慢\n * x/y方向分开执行,加速性能,计算次数由d*d变为d+d,d为卷积核大小\n * spread由d和sigma计算得出,d由sigma计算得出,sigma即css的blur()参数\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * i和j为total和filter的纹理单元,3次执行(x/y合起来算1次)需互换单元,来回执行源和结果\n * 由total变为filter时cache会各方向上扩展spread的大小到width/height\n * 因此第一次绘制时坐标非1,后面则固定1\n * @param gl\n * @param program\n * @param frameBuffer\n * @param texCache\n * @param tex1 初次绘制目标纹理\n * @param tex2 初次绘制源纹理\n * @param i 初次绘制目标纹理单元\n * @param j 初次绘制源纹理单元\n * @param width\n * @param height\n * @param cx\n * @param cy\n * @param spread\n * @param d\n * @param sigma\n */\nfunction drawBlur(gl, program, frameBuffer, texCache, tex1, tex2, i, j, width, height, cx, cy, spread, d, sigma) {\n // 第一次将total绘制到blur上,此时尺寸存在spread差值,因此不加模糊防止坐标计算问题,仅作为扩展纹理尺寸\n let [x1, y2] = convertCoords2Gl([spread, height - spread], cx, cy);\n let [x2, y1] = convertCoords2Gl([width - spread, spread], cx, cy);\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // direction全0,即无模糊,此时只是进行扩展尺寸操作,还没到模糊所以传0\n let u_direction = gl.getUniformLocation(program, 'u_direction');\n gl.uniform2f(u_direction, 0, 0);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // fbo绑定切换纹理对象和单元索引,同时注意不能向源纹理绘制,因为源是cacheTotal,需要重新生成一个,y方向再来一次\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n /**\n * 反复执行共3次,坐标等均不变,只是切换fbo绑定对象和纹理单元\n * 注意max和ratio的设置,当是100尺寸的正方形时,传给direction的始终为1\n * 当正方形<100时,direction相应地要扩大相对于100的倍数,反之则缩小,如此为了取相邻点坐标时是+-1\n * 当非正方形时,长轴一端为基准值不变,短的要二次扩大比例倍数\n */\n let max = 100 / Math.max(width, height);\n let ratio = width / height;\n let recycle = []; // 3次过程中新生成的中间纹理需要回收\n for(let k = 0; k < 3; k++) {\n let tex3 = createTexture(gl, null, j, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex3, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, max, 0);\n }\n else {\n gl.uniform2f(u_direction, max * ratio, 0);\n }\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n recycle.push(tex1);\n let tex4 = createTexture(gl, null, i, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex4, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, 0, max * ratio);\n }\n else {\n gl.uniform2f(u_direction, 0, max);\n }\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n tex1 = tex4;\n recycle.push(tex3);\n }\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n recycle.forEach(item => gl.deleteTexture(item));\n return tex1;\n}\n\nfunction drawCm(gl, program, i, m) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, i);\n // matrix\n let u_m = gl.getUniformLocation(program, 'u_m');\n gl.uniform1fv(u_m, new Float32Array(m));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\n/**\n * 根据total/filter生成overflow\n * @param gl\n * @param i 输入纹理单元\n * @param dx 二者偏移值\n * @param dy\n * @param width 最终大小\n * @param height\n * @param w 输入纹理大小\n * @param h\n */\nfunction drawOverflow(gl, i, dx, dy, width, height, w, h) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.programOverflow, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer,原本大小width/height,使用其中的w/h\n let x1 = dx / w, y1 = dy / h, x2 = (width + dx) / w, y2 = (height + dy) /h;\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.programOverflow, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.programOverflow, 'u_texture');\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n}\n\nfunction drawMask(gl, i, j, program) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, j);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nfunction drawMbm(gl, program, i, j, W, H) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, i);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nexport default {\n initShaders,\n createTexture,\n bindTexture,\n drawTextureCache,\n drawBlur,\n drawOverflow,\n drawMask,\n drawMbm,\n drawCm,\n};\n","import util from './util';\nimport debug from './debug';\nimport textCache from '../node/textCache';\nimport font from '../style/font';\nimport ca from '../gl/ca';\nimport webgl from '../gl/webgl';\n\nconst SPF = 1000 / 60;\n\nconst CANVAS = {};\nconst WEBGL = {};\nconst CANVAS_LIST = [];\nconst WEBGL_LIST = [];\nconst SUPPORT_OFFSCREEN_CANVAS = typeof OffscreenCanvas === 'function' && util.isFunction(OffscreenCanvas.prototype.getContext);\n\nlet defaultFontFamilyData;\n\nfunction cache(key, width, height, hash, message) {\n let o;\n if(!key) {\n let target = hash === CANVAS ? CANVAS_LIST : WEBGL_LIST;\n if(target.length) {\n o = target.pop();\n }\n else {\n o = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n }\n else if(!hash[key]) {\n o = hash[key] = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n else {\n o = hash[key];\n }\n o.width = width;\n o.height = height;\n if(debug.flag) {\n o.style.width = width + 'px';\n o.style.height = height + 'px';\n o.setAttribute('type', hash === CANVAS ? 'canvas' : 'webgl');\n if(key) {\n o.setAttribute('key', key);\n }\n if(message) {\n o.setAttribute('message', message);\n }\n document.body.appendChild(o);\n }\n let ctx;\n if(hash === CANVAS) {\n ctx = o.getContext('2d');\n }\n else {\n ctx = o.getContext('webgl', ca) || o.getContext('experimental-webgl', ca);\n }\n return {\n canvas: o,\n ctx,\n draw() {\n // 空函数,仅对小程序提供hook特殊处理,flush缓冲\n },\n enabled: true,\n available: true,\n release() {\n if(!key && this.available) {\n if(hash === CANVAS) {\n CANVAS_LIST.push(this.canvas);\n }\n else {\n WEBGL_LIST.push(this.canvas);\n }\n }\n this.available = false;\n },\n };\n}\n\nfunction cacheCanvas(key, width, height, message) {\n return cache(key, width, height, CANVAS, message);\n}\n\nfunction cacheWebgl(key, width, height, message) {\n return cache(key, width, height, WEBGL, message);\n}\n\nconst IMG = {};\nconst INIT = 0;\nconst LOADING = 1;\nconst LOADED = 2;\nconst FONT = {};\nconst COMPONENT = {};\n\nlet inject = {\n measureText() {\n let { list, data } = textCache;\n let html = '';\n let keys = [];\n let lengths = [];\n let chars = [];\n Object.keys(data).forEach(key => {\n let { ff, fs, fw, s } = data[key];\n if(s) {\n keys.push(key);\n lengths.push(s.length);\n let inline = `position:absolute;font-family:${ff};font-size:${fs}px;font-weight:${fw}`;\n for(let i = 0, len = s.length; i < len; i++) {\n let char = s.charAt(i);\n chars.push(char);\n html += `${char.replace(/`;\n }\n data[key].s = '';\n }\n });\n if(!html) {\n return;\n }\n let div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n document.body.appendChild(div);\n div.innerHTML = html;\n let cns = div.childNodes;\n let { charWidth } = textCache;\n let count = 0, index = 0, key;\n for(let i = 0, len = cns.length; i < len; i++) {\n let node = cns[i];\n if(count === 0) {\n key = keys[index];\n }\n if(++count === lengths[index]) {\n index++;\n count = 0;\n }\n let char = chars[i];\n // clientWidth只返回ceil整数,精度必须用getComputedStyle\n let css = window.getComputedStyle(node, null);\n charWidth[key][char] = parseFloat(css.width);\n }\n list.forEach(text => text.__measureCb());\n textCache.list = [];\n textCache.data = {};\n if(!debug.flag) {\n document.body.removeChild(div);\n }\n },\n measureTextSync(key, ff, fs, fw, char) {\n let inline = `position:absolute;font-family:${ff};font-size:${fs}px;font-weight:${fw}`;\n let html = `${char}${char}${char}`;\n let div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n document.body.appendChild(div);\n div.innerHTML = html;\n let cns = div.childNodes;\n let w1 = parseFloat(window.getComputedStyle(cns[0], null).width);\n let w2 = parseFloat(window.getComputedStyle(cns[1], null).width);\n return w1 * 2 - w2;\n },\n IMG,\n INIT,\n LOADED,\n LOADING,\n measureImg(url, cb) {\n if(Array.isArray(url)) {\n if(!url.length) {\n return cb();\n }\n let count = 0;\n let len = url.length;\n let list = [];\n url.forEach((item, i) => {\n inject.measureImg(item, function(cache) {\n list[i] = cache;\n if(++count === len) {\n cb(list);\n }\n });\n });\n return;\n }\n else if(!url || !util.isString(url)) {\n inject.error('Measure img invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\n }\n let cache = IMG[url] = IMG[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb && cb(cache);\n }\n else if(cache.state === LOADING) {\n cb && cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cb && cache.task.push(cb);\n let img = new Image();\n img.onload = function() {\n cache.state = LOADED;\n cache.success = true;\n cache.width = img.width;\n cache.height = img.height;\n cache.source = img;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n img.onerror = function(e) {\n cache.state = LOADED;\n cache.success = false;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n if(url.substr(0, 5) !== 'data:') {\n let host = /^(?:\\w+:)?\\/\\/([^/:]+)/.exec(url);\n if(host) {\n if(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%]+)?/ig) || [];\n o.v = v.map(item => {\n let color = /((?:#[0-9a-f]{3,8})|(?:rgba?\\s*\\(.+?\\)))/i.exec(item);\n let arr = [rgba2int(color[1])];\n let percent = /[-+]?[\\d.]+[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: '#000',\n borderRightColor: '#000',\n borderBottomColor: '#000',\n borderLeftColor: '#000',\n borderTopStyle: 'solid',\n borderRightStyle: 'solid',\n borderBottomStyle: 'solid',\n borderLeftStyle: 'solid',\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomLeftRadius: 0,\n width: 'auto',\n height: 'auto',\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto',\n flexDirection: 'row',\n flexWrap: 'nowrap',\n order: 0,\n justifyContent: 'flexStart',\n alignItems: 'stretch',\n alignSelf: 'auto',\n alignContent: 'stretch',\n textAlign: 'inherit',\n letterSpacing: 'inherit',\n transformOrigin: 'center',\n visibility: 'inherit',\n opacity: 1,\n zIndex: 0,\n transform: null,\n translateX: 0,\n translateY: 0,\n translateZ: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n skewX: 0,\n skewY: 0,\n rotateX: 0,\n rotateY: 0,\n rotateZ: 0,\n rotate3d: '0, 0, 0, 0',\n perspective: 0,\n perspectiveOrigin: 'center',\n filter: null,\n boxShadow: null,\n pointerEvents: 'inherit',\n overflow: 'visible',\n mixBlendMode: 'normal',\n whiteSpace: 'inherit',\n textOverflow: 'clip',\n lineClamp: 0,\n textStrokeWidth: 'inherit',\n textStrokeColor: 'inherit',\n textStrokeOver: 'inherit',\n};\n\nconst GEOM = {\n fill: 'transparent',\n stroke: '#000',\n strokeWidth: 1,\n strokeDasharray: '',\n strokeLinecap: 'butt',\n strokeLinejoin: 'miter',\n strokeMiterlimit: 4,\n fillRule: 'nonzero',\n};\n\nlet DOM_ENTRY_SET = [];\nlet DOM_KEY_SET = [];\nObject.keys(DOM).forEach(k => {\n DOM_KEY_SET.push(k);\n let v = DOM[k];\n DOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet GEOM_ENTRY_SET = [];\nlet GEOM_KEY_SET = [];\nObject.keys(GEOM).forEach(k => {\n GEOM_KEY_SET.push(k);\n let v = GEOM[k];\n GEOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet INHERIT = {\n fontFamily: 'arial',\n fontSize: 16,\n fontWeight: 400,\n fontStyle: 'normal',\n color: '#000',\n textAlign: 'left',\n visibility: 'visible',\n pointerEvents: 'auto',\n textStrokeColor: '#000',\n textStrokeWidth: 1,\n textStrokeOver: 'none',\n};\n\nlet INHERIT_KEY_SET = [];\nObject.keys(INHERIT).forEach(k => {\n INHERIT_KEY_SET.push(k);\n});\n\nexport default {\n DOM,\n GEOM,\n isValid(i) {\n return DOM.hasOwnProperty(i) || GEOM.hasOwnProperty(i);\n },\n DOM_KEY_SET,\n GEOM_KEY_SET,\n DOM_ENTRY_SET,\n GEOM_ENTRY_SET,\n INHERIT,\n INHERIT_KEY_SET,\n};\n","import reg from './reg';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction parseFlex(style, grow, shrink, basis) {\n if(isNil(style.flexGrow)) {\n style.flexGrow = grow || 0;\n }\n if(isNil(style.flexShrink)) {\n style.flexShrink = shrink || 0;\n }\n if(isNil(style.flexBasis)) {\n style.flexBasis = basis || 0;\n }\n}\n\nfunction parseMarginPadding(style, key, list) {\n let temp = style[key];\n if(!isNil(temp)) {\n let match = temp.toString().match(/([-+]?[\\d.]+[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 // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform\n ['translate', 'scale', 'skew', 'translate3d', 'scale3d', 'rotate'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n abbr.toFull(style, k);\n }\n });\n // 扩展的不能和transform混用,给出警告\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate3d',\n ].forEach(k => {\n let v = style[k];\n if(!isNil(v) && style.transform) {\n inject.warn(`Can not use expand style \"${k}\" with transform`);\n }\n });\n // 默认reset,根据传入不同,当style为空时覆盖\n reset.forEach(item => {\n let { k, v } = item;\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n // 背景图\n temp = style.backgroundImage;\n if(temp !== undefined) {\n if(!temp) {\n res[BACKGROUND_IMAGE] = [null];\n }\n else if(Array.isArray(temp)) {\n res[BACKGROUND_IMAGE] = temp.map(item => {\n if(!item) {\n return null;\n }\n if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n if(reg.img.test(item)) {\n return reg.img.exec(item)[2];\n }\n return null;\n });\n }\n // 区分是渐变色还是图\n else if(reg.gradient.test(temp)) {\n res[BACKGROUND_IMAGE] = [gradient.parseGradient(temp)];\n }\n else if(reg.img.test(temp)) {\n res[BACKGROUND_IMAGE] = [reg.img.exec(temp)[2]];\n }\n else {\n res[BACKGROUND_IMAGE] = [null];\n }\n }\n temp = style.backgroundColor;\n if(temp) {\n // 先赋值默认透明,后续操作有合法值覆盖\n let bgc = /^#[0-9a-f]{3,8}/i.exec(temp);\n if(bgc && [4, 7, 9].indexOf(bgc[0].length) > -1) {\n res[BACKGROUND_COLOR] = [rgba2int(bgc[0]), RGBA];\n }\n else {\n bgc = /rgba?\\s*\\(.+\\)/i.exec(temp);\n res[BACKGROUND_COLOR] = [rgba2int(bgc ? bgc[0] : [0, 0, 0, 0]), RGBA];\n }\n }\n ['backgroundPositionX', 'backgroundPositionY'].forEach((k, i) => {\n temp = style[k];\n if(!isNil(temp)) {\n k = i ? BACKGROUND_POSITION_Y : BACKGROUND_POSITION_X;\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[k] = temp.map(item => {\n if(/^[-+]?[\\d.]/.test(item)) {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item] || 0,\n PERCENT,\n ];\n }\n });\n }\n });\n // 背景尺寸\n temp = style.backgroundSize;\n if(temp) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[BACKGROUND_SIZE] = temp.map(item => {\n if(!item) {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n let match = item.toString().match(/\\b(?:([-+]?[\\d.]+[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(!isNil(v)) {\n res[STYLE_KEY[style2Upper(k)]] = [rgba2int(v), RGBA];\n }\n });\n // border-radius\n ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'].forEach(k => {\n k = 'border' + k + 'Radius';\n let v = style[k];\n if(!isNil(v)) {\n let arr = v.toString().split(/\\s+/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = arr[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n if(n[0] < 0) {\n n[0] = 0;\n }\n arr[i] = n;\n }\n else {\n arr[i] = [0, PX];\n }\n }\n res[STYLE_KEY[style2Upper(k)]] = arr;\n }\n });\n temp = style.transform;\n if(temp) {\n let transform = res[TRANSFORM] = [];\n let match = (temp || '').toString().match(/\\w+\\(.+?\\)/g);\n if(match) {\n match.forEach(item => {\n let i = item.indexOf('(');\n let k = item.slice(0, i);\n let v = item.slice(i + 1, item.length - 1);\n if(k === 'matrix') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 6) {\n arr = arr.slice(0, 6);\n }\n if(arr.length === 6) {\n transform.push([MATRIX, [\n arr[0], arr[1], 0, 0, arr[2], arr[3], 0, 0, 0, 0, 1, 0, arr[4], arr[5], 0, 1,\n ]]);\n }\n }\n else if(k === 'matrix3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 16) {\n arr = arr.slice(0, 16);\n }\n if(arr.length === 16) {\n transform.push([MATRIX, arr]);\n }\n }\n else if(k === 'perspective') {\n let arr = calUnit(v);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n transform.push([PERSPECTIVE, arr]);\n }\n else if(k === 'rotate3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n transform.push([ROTATE_3D, arr]);\n }\n }\n else if(TRANSFORM_HASH.hasOwnProperty(k)) {\n let k2 = TRANSFORM_HASH[k];\n let arr = calUnit(v);\n compatibleTransform(k2, arr);\n transform.push([k2, arr]);\n }\n else if({ translate: true, scale: true, skew: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale' ? arr[0] : [0];\n }\n if(arr.length === 2) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n }\n }\n else if({ translate3d: true, scale3d: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale3d' ? [1] : [0];\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n if(arr.length === 3) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let k3 = STYLE_KEY[style2Upper(k + 'Z')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n let arr3 = calUnit(arr[2]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n compatibleTransform(k3, arr3);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n transform.push([k3, arr3]);\n }\n }\n });\n }\n }\n temp = style.perspective;\n if(!isNil(temp)) {\n let arr = calUnit(temp);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n res[PERSPECTIVE] = arr;\n }\n ['perspectiveOrigin', 'transformOrigin'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n let arr = res[STYLE_KEY[style2Upper(k)]] = [];\n let match = temp.toString().match(reg.position);\n if(match) {\n if(match.length === 1) {\n match[1] = match[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n arr.push(n);\n }\n else {\n arr.push([\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item],\n PERCENT,\n ]);\n // 不规范的写法变默认值50%\n if(isNil(arr[i][0])) {\n arr[i][0] = 50;\n }\n }\n }\n }\n else {\n arr.push([50, PERCENT]);\n arr.push([50, PERCENT]);\n }\n }\n });\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n let k2 = TRANSFORM_HASH[k];\n let n = calUnit(v);\n // 没有单位或默认值处理单位\n compatibleTransform(k2, n);\n res[k2] = n;\n });\n temp = style.rotate3d;\n if(temp) {\n let arr = temp.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n res[ROTATE_3D] = arr;\n }\n }\n temp = style.opacity;\n if(!isNil(temp)) {\n temp = parseFloat(temp);\n if(!isNaN(temp)) {\n temp = Math.max(temp, 0);\n temp = Math.min(temp, 1);\n res[OPACITY] = temp;\n }\n else {\n res[OPACITY] = 1;\n }\n }\n temp = style.zIndex;\n if(!isNil(temp)) {\n res[Z_INDEX] = parseInt(temp) || 0;\n }\n // 转化不同单位值为对象标准化,不写单位的变成number单位转化为px\n [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'width',\n 'height',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n if(v === 'auto') {\n v = [0, AUTO];\n }\n else {\n v = calUnit(v);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n let k2 = STYLE_KEY[style2Upper(k)];\n res[k2] = v;\n // 限制padding/border为正数\n if({\n paddingTop: true,\n paddingRight: true,\n paddingBottom: true,\n paddingLeft: true,\n borderTopWidth: true,\n borderRightWidth: true,\n borderBottomWidth: true,\n borderLeftWidth: true,\n width: true,\n height: true,\n }.hasOwnProperty(k) && v[0] < 0) {\n v[0] = 0;\n }\n });\n temp = style.flexBasis;\n if(!isNil(temp)) {\n if(temp === 'content') {\n res[FLEX_BASIS] = [temp, STRING];\n }\n else if(/^[\\d.]/.test(temp)) {\n let v = res[FLEX_BASIS] = calUnit(temp);\n v[0] = Math.max(v[0], 0);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n else {\n res[FLEX_BASIS] = [0, AUTO];\n }\n }\n temp = style.order;\n if(!isNil(temp)) {\n res[ORDER] = parseInt(temp) || 0;\n }\n temp = style.color;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[COLOR] = [[], INHERIT];\n }\n else {\n res[COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.textStrokeColor;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_COLOR] = [[], INHERIT];\n }\n else {\n res[TEXT_STROKE_COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.fontSize;\n if(temp || temp === 0) {\n if(temp === 'inherit') {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // fontSize不能为负数,否则为继承\n if(v < 0) {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[FONT_SIZE] = v;\n }\n }\n }\n temp = style.textStrokeWidth;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // textStrokeWidth不能为负数,否则为继承\n if(v < 0) {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG, PERCENT].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[TEXT_STROKE_WIDTH] = v;\n }\n }\n }\n temp = style.textStrokeOver;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_OVER] = [0, INHERIT];\n }\n else {\n let v = temp.toString();\n if(v !== 'none' && v !== 'fill') {\n v = 'none';\n }\n res[TEXT_STROKE_OVER] = [v, STRING];\n }\n }\n temp = style.fontWeight;\n if(!isNil(temp)) {\n if(temp === 'bold') {\n res[FONT_WEIGHT] = [700, NUMBER];\n }\n else if(temp === 'normal') {\n res[FONT_WEIGHT] = [400, NUMBER];\n }\n else if(temp === 'lighter') {\n res[FONT_WEIGHT] = [200, NUMBER];\n }\n else if(temp === 'inherit') {\n res[FONT_WEIGHT] = [0, INHERIT];\n }\n else {\n res[FONT_WEIGHT] = [Math.max(0, parseInt(temp)) || 400, NUMBER];\n }\n }\n temp = style.fontStyle;\n if(temp) {\n if(temp === 'inherit') {\n res[FONT_STYLE] = [0, INHERIT];\n }\n else {\n res[FONT_STYLE] = [temp, STRING];\n }\n }\n temp = style.fontFamily;\n if(temp) {\n if(temp === 'inherit') {\n res[FONT_FAMILY] = [0, INHERIT];\n }\n else {\n // 统一文字声明格式\n res[FONT_FAMILY] = [temp.toString().toLowerCase().replace(/['\"]/, '').replace(/\\s*,\\s*/g, ','), STRING];\n }\n }\n temp = style.textAlign;\n if(temp) {\n if(temp === 'inherit') {\n res[TEXT_ALIGN] = [0, INHERIT];\n }\n else {\n res[TEXT_ALIGN] = [temp, STRING];\n }\n }\n temp = style.lineHeight;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LINE_HEIGHT] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LINE_HEIGHT] = [0, AUTO];\n }\n // lineHeight默认数字,想要px必须强制带单位\n else if(/^[\\d.]+/i.test(temp)) {\n let v = calUnit(temp);\n if([DEG].indexOf(v[1]) > -1) {\n v[1] = NUMBER;\n }\n res[LINE_HEIGHT] = v;\n }\n else {\n let n = Math.max(0, parseFloat(temp)) || 'normal';\n // 非法数字\n if(n === 'normal') {\n res[LINE_HEIGHT] = [null, AUTO];\n }\n else {\n res[LINE_HEIGHT] = [n, NUMBER];\n }\n }\n }\n temp = style.letterSpacing;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LETTER_SPACING] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LETTER_SPACING] = [0, PX];\n }\n else if(/^[-+]?[\\d.]/.test(temp)) {\n let v = calUnit(temp);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[LETTER_SPACING] = v;\n }\n else {\n res[LETTER_SPACING] = [parseFloat(temp) || 0, PX];\n }\n }\n temp = style.whiteSpace;\n if(temp) {\n if(temp === 'inherit') {\n res[WHITE_SPACE] = [0, INHERIT];\n }\n else {\n res[WHITE_SPACE] = [temp, STRING];\n }\n }\n temp = style.lineClamp;\n if(temp !== undefined) {\n temp = parseInt(temp) || 0;\n res[LINE_CLAMP] = Math.max(0, temp);\n }\n // fill和stroke为渐变时特殊处理,fillRule无需处理字符串\n temp = style.fill;\n if(temp !== undefined) {\n if(!temp) {\n res[FILL] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[FILL] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[FILL] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[FILL] = [gradient.parseGradient(temp)];\n }\n else {\n res[FILL] = [rgba2int(temp)];\n }\n }\n temp = style.stroke;\n if(temp !== undefined) {\n if(!temp) {\n res[STROKE] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[STROKE] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[STROKE] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[STROKE] = [gradient.parseGradient(temp)];\n }\n else {\n res[STROKE] = [rgba2int(temp)];\n }\n }\n temp = style.strokeWidth;\n if(!isNil(temp)) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[STROKE_WIDTH] = temp.map(item => {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n v[0] = Math.max(v[0], 0);\n return v;\n });\n }\n temp = style.strokeDasharray;\n if(!isNil(temp)) {\n if(Array.isArray(temp)) {\n res[STROKE_DASHARRAY] = temp.map(item => {\n let match = item.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n return match;\n }\n return [];\n });\n }\n else {\n let match = temp.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n res[STROKE_DASHARRAY] = [match];\n }\n else {\n res[STROKE_DASHARRAY] = [[]];\n }\n }\n }\n temp = style.filter;\n if(temp !== undefined) {\n let match = (temp || '').toString().match(/\\b[\\w-]+\\s*\\(\\s*[-+]?[\\d.]+\\s*[pxremvwhdg%]*\\s*\\)\\s*/ig);\n let f = null;\n if(match) {\n f = [];\n match.forEach(item => {\n let m2 = /([\\w-]+)\\s*\\(\\s*([-+]?[\\d.]+\\s*[pxremvwhdg%]*)\\s*\\)\\s*/i.exec(item);\n if(m2) {\n let k = m2[1].toLowerCase(), v = calUnit(m2[2]);\n if(k === 'blur') {\n if(v[0] <= 0 || [DEG, PERCENT].indexOf(v[1]) > -1) {\n return;\n }\n if(v[1] === NUMBER) {\n v[1] = PX;\n }\n f.push([k, v]);\n }\n else if(k === 'hue-rotate') {\n if([NUMBER, DEG].indexOf(v[1]) === -1) {\n return;\n }\n v[1] = DEG;\n f.push([k, v]);\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'grayscale' || k === 'contrast') {\n if([NUMBER, PERCENT].indexOf(v[1]) === -1) {\n return;\n }\n v[0] = Math.max(v[0], 0);\n v[1] = PERCENT;\n f.push([k, v]);\n }\n }\n });\n }\n res[FILTER] = f;\n }\n temp = style.visibility;\n if(temp) {\n if(temp === 'inherit') {\n res[VISIBILITY] = [0, INHERIT];\n }\n else {\n res[VISIBILITY] = [temp, STRING];\n }\n }\n temp = style.pointerEvents;\n if(temp) {\n if(temp === 'inherit') {\n res[POINTER_EVENTS] = [0, INHERIT];\n }\n else {\n res[POINTER_EVENTS] = [temp, STRING];\n }\n }\n temp = style.boxShadow;\n if(temp !== undefined) {\n let bs = null;\n let match = (temp || '').match(/([-+]?[\\d.]+[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(!isNil(temp)) {\n res[Z_INDEX] = parseFloat(temp) || 0;\n }\n // 这些支持多个的用数组表示\n [\n 'backgroundRepeat',\n 'strokeLinecap',\n 'strokeLinejoin',\n 'strokeMiterlimit',\n 'fillRule',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n let v = style[k];\n res[STYLE_KEY[style2Upper(k)]] = Array.isArray(v) ? v : [v];\n }\n });\n GEOM_KEY_SET.forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[k] = style[k];\n }\n });\n return res;\n}\n\n/**\n * 第一次和REFLOW等级下,刷新前首先执行,生成computedStyle\n * 影响文字测量的只有字体和大小和重量,需要提前处理\n * 继承相关的计算\n * @param node 对象节点\n * @param isRoot 是否是根节点,无继承需使用默认值\n */\nfunction computeMeasure(node, isRoot) {\n let { currentStyle, computedStyle, domParent } = node;\n let parentComputedStyle = !isRoot && domParent.computedStyle;\n MEASURE_KEY_SET.forEach(k => {\n let v = currentStyle[k];\n // ff特殊处理\n if(k === FONT_FAMILY) {\n if(v[1] === INHERIT) {\n computedStyle[k] = getFontFamily(isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k]);\n }\n else {\n computedStyle[k] = getFontFamily(v[0]);\n }\n }\n else if(v[1] === INHERIT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k];\n }\n // 只有fontSize会有%\n else if(v[1] === PERCENT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (parentComputedStyle[k] * v[0] * 0.01);\n }\n else if(v[1] === REM) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.computedStyle[FONT_SIZE] * v[0]);\n }\n else if(v[1] === VW) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.width * 0.01 * v[0]);\n }\n else if(v[1] === VH) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.height * 0.01 * v[0]);\n }\n else 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];\n return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' '\n + fontSize + 'px/' + fontSize + 'px ' + (style[FONT_FAMILY] || 'arial');\n}\n\nfunction getFontFamily(str) {\n let ff = str.split(',');\n let f = 'arial';\n for(let i = 0, len = ff.length; i < len; i++) {\n if(font.support(ff[i])) {\n f = ff[i];\n break;\n }\n }\n return f;\n}\n\nfunction getBaseLine(style) {\n let fontSize = style[FONT_SIZE];\n let ff = getFontFamily(style[FONT_FAMILY]);\n let normal = fontSize * (font.info[ff] || font.info.arial).lhr;\n return (style[LINE_HEIGHT] - normal) * 0.5 + fontSize * (font.info[ff] || font.info.arial).blr;\n}\n\nfunction calNormalLineHeight(style) {\n let ff = getFontFamily(style[FONT_FAMILY]);\n return style[FONT_SIZE] * (font.info[ff] || font.info.arial).lhr;\n}\n\nfunction calRelativePercent(n, parent, k) {\n n *= 0.01;\n while(parent) {\n let style = parent.currentStyle[k];\n if(style[1] === AUTO) {\n if(k === WIDTH) {\n parent = parent.domParent;\n }\n else {\n break;\n }\n }\n else if(style[1] === PX) {\n return n * style[0];\n }\n else if(style[1] === PERCENT) {\n n *= style[0] * 0.01;\n parent = parent.domParent;\n }\n else if(style[1] === REM) {\n return n * style[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(style[1] === VW) {\n return n * style[0] * parent.root.width * 0.01;\n }\n else if(style[1] === VH) {\n return n * style[0] * parent.root.height * 0.01;\n }\n 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\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 DISPLAY,\n VISIBILITY,\n },\n NODE_KEY: {\n NODE_OPACITY,\n NODE_CACHE_TOTAL,\n NODE_CACHE_FILTER,\n NODE_CACHE_OVERFLOW,\n NODE_HAS_CONTENT,\n NODE_COMPUTED_STYLE,\n },\n} = enums;\n\n// 根据一个共享cache的信息,生成一个独立的离屏canvas,一般是filter,mask用\nfunction genSingle(cache, message) {\n let { size, sx1, sy1, width, height, bbox } = cache;\n let offscreen = inject.getCacheCanvas(width, height, null, message);\n offscreen.x = 0;\n offscreen.y = 0;\n offscreen.bbox = bbox;\n offscreen.size = size;\n offscreen.sx1 = sx1;\n offscreen.sy1 = sy1;\n offscreen.dx = cache.dx;\n offscreen.dy = cache.dy;\n offscreen.dbx = cache.dbx;\n offscreen.dby = cache.dby;\n offscreen.width = width;\n offscreen.height = height;\n return offscreen;\n}\n\nclass Cache {\n constructor(w, h, bbox, page, pos, x1, y1) {\n this.__init(w, h, bbox, page, pos, x1, y1);\n }\n\n __init(w, h, bbox, page, pos, x1, y1) {\n this.__width = w;\n this.__height = h;\n this.__bbox = bbox;\n this.__page = page;\n this.__pos = pos;\n let [x, y] = page.getCoords(pos);\n this.__x = x;\n this.__y = y;\n this.__appendData(x1, y1);\n 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 },\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') {\n bp = bp.domParent;\n }\n this.__bp = bp;\n let parentComputedStyle = bp.computedStyle;\n let pff = 'arial';\n for(let i = 0, pffs = parentComputedStyle[FONT_FAMILY].split(','), len = pffs.length; i < len; i++) {\n if(inject.checkSupportFontFamily(pffs[i])) {\n ff = ffs[i];\n break;\n }\n }\n let pfs = parentComputedStyle[FONT_SIZE];\n let pfw = parentComputedStyle[FONT_WEIGHT];\n let pKey = this.__pKey = pfs + ',' + pff + ',' + pfw;\n let parentCache = textCache.charWidth[pKey] = textCache.charWidth[pKey] || {};\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(renderMode === mode.WEBGL) {\n ctx = inject.getCacheCanvas(16, 16, '__$$CHECK_SUPPORT_FONT_FAMILY$$__').ctx;\n }\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n ctx.font = css.setFontStyle(parentComputedStyle);\n parentCache[ELLIPSIS] = ctx.measureText(ELLIPSIS).width;\n }\n ctx.font = css.setFontStyle(computedStyle);\n }\n else if(renderMode === mode.SVG) {\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n parentCache[ELLIPSIS] = 0;\n let wait = textCache.data[pKey] = textCache.data[pKey] || {\n ff: pff,\n fs: pfs,\n fw: pfw,\n hash: {},\n s: '',\n };\n wait.s += ELLIPSIS;\n needMeasure = true;\n }\n }\n // 逐字测量,canvas可瞬间得到信息,svg先预存统一进行\n for(let i = 0, length = content.length; i < length; i++) {\n let char = content.charAt(i);\n let mw;\n if(cache.hasOwnProperty(char)) {\n mw = cache[char];\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n mw = cache[char] = ctx.measureText(char).width;\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else {\n if(!wait.hash.hasOwnProperty(char)) {\n wait.s += char;\n }\n wait.hash[char] = true;\n // 先预存标识位-1,测量完后替换它\n charWidthList.push(-1);\n needMeasure = true;\n }\n }\n this.__textWidth = sum;\n if(needMeasure) {\n textCache.list.push(this);\n }\n }\n\n __measureCb() {\n let { content, charWidthList } = this;\n let key = this.__key;\n let cache = textCache.charWidth[key];\n let sum = 0;\n for(let i = 0, len = charWidthList.length; i < len; i++) {\n if(charWidthList[i] < 0) {\n let mw = charWidthList[i] = cache[content.charAt(i)];\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n }\n this.__textWidth = sum;\n }\n\n /**\n * text在virtual时和普通一样,无需特殊处理\n * endSpace由外界inline布局控制,末尾最后一行的空白mpb,包含递归情况,递归为多个嵌套末尾节点的空白mpb之和\n * 即便宽度不足,每行还是强制渲染一个字符,换行依据lx开始,因为x可能是从中间开始的,非inline则两个相等\n * 最后一个字符排版时要考虑末尾mpb,排不下的话回退删掉这个字符,如果最后一个字符另起开头,排不下也强制排,每行至少1个字符\n * 在textOverflow时很特殊,多个inline同行,回退可能到前一个inline节点,这个通过x和lx判断是否行首,决定至少1个字符规则\n * @param data\n * @private\n */\n __layout(data) {\n let __cache = this.__config[NODE_CACHE];\n if(__cache) {\n __cache.release();\n }\n let { x, y, w, lx = x, lineBoxManager, endSpace = 0, lineClamp = 0, lineClampCount = 0 } = data;\n this.__x = this.__sx1 = x;\n this.__y = this.__sy1 = y;\n let { isDestroyed, content, currentStyle, computedStyle, textBoxes, charWidthList, root, __ff, __key } = this;\n textBoxes.splice(0);\n let __config = this.__config;\n __config[NODE_LIMIT_CACHE] = false;\n // 空内容w/h都为0可以提前跳出\n if(isDestroyed || currentStyle[DISPLAY] === 'none' || !content) {\n return lineClampCount;\n }\n this.__ox = this.__oy = 0;\n // 顺序尝试分割字符串为TextBox,形成多行,begin为每行起始索引,i是当前字符索引\n let begin = 0;\n let i = 0;\n let beginSpace = x - lx; // x>=lx,当第一行非起始处时前面被prev节点占据,这个差值可认为是count宽度\n let count = beginSpace;\n let length = content.length;\n let maxW = 0;\n let {\n [LINE_HEIGHT]: lineHeight,\n [LETTER_SPACING]: letterSpacing,\n [WHITE_SPACE]: whiteSpace,\n [FONT_SIZE]: fontSize,\n [FONT_WEIGHT]: fontWeight,\n } = computedStyle;\n // 特殊字体中特殊字符连续时需减少一定的padding量\n let padding = font.info[__ff].padding;\n let needReduce = !!padding;\n let lastChar;\n let ew = textCache.charWidth[this.__pKey][ELLIPSIS];\n let lineCount = 0;\n // 不换行特殊对待,同时考虑overflow和textOverflow\n if(whiteSpace === 'nowrap') {\n let isTextOverflow;\n // block的overflow:hidden和textOverflow:clip/ellipsis才生效,inline要看最近非inline父元素\n let bp = this.__bp;\n let {\n [DISPLAY]: display,\n [OVERFLOW]: overflow,\n [WIDTH]: width,\n [TEXT_OVERFLOW]: textOverflow,\n } = bp.currentStyle;\n // 只要是overflow隐藏,不管textOverflow如何(默认是clip等同于overflow:hidden的功能)都截取\n if(overflow === 'hidden') {\n while(i < length) {\n count += charWidthList[i] + letterSpacing;\n if(count > w) {\n // block/flex无需宽度,inline-block需要设置宽度才生效\n if(display === 'block' || display === 'flex') {\n isTextOverflow = true;\n }\n else if(width[1] !== AUTO) {\n isTextOverflow = true;\n }\n break;\n }\n i++;\n }\n }\n else {\n while(i < length) {\n count += charWidthList[i++] + letterSpacing;\n }\n }\n // ellipsis生效情况,本节点开始向前回退查找,尝试放下一部分字符\n if(isTextOverflow && textOverflow === 'ellipsis') {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n }\n // 默认clip跟随overflow:hidden,无需感知\n else {\n let textBox = new TextBox(this, textBoxes.length, x, y, count - beginSpace, lineHeight,\n content, charWidthList);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n maxW = count - beginSpace;\n y += lineHeight;\n }\n }\n // 普通换行,注意x和lx的区别,可能相同(block起始处)可能不同(非起始处),第1行从x开始,第2行及以后都从lx开始\n // 然后第一次换行还有特殊之处,可能同一行前半部行高很大,此时y增加并非自身的lineHeight,而是整体LineBox的\n else {\n while(i < length) {\n let cw = charWidthList[i] + letterSpacing;\n count += cw;\n // 连续字符减少padding,除了连续还需判断char是否在padding的hash中\n if(needReduce) {\n let char = content[i];\n if(char === lastChar && padding.hasOwnProperty(char) && padding[char]) {\n let hasCache, p = textCache.padding[__key] = textCache.padding[__key] || {};\n if(textCache.padding.hasOwnProperty(__key)) {\n if(p.hasOwnProperty(char)) {\n hasCache = true;\n count -= p[char];\n }\n }\n if(!hasCache) {\n let n = 0;\n if(root.renderMode === mode.CANVAS) {\n root.ctx.font = css.setFontStyle(computedStyle);\n let w1 = root.ctx.measureText(char).width;\n let w2 = root.ctx.measureText(char + char).width;\n n = w1 * 2 - w2;\n n *= padding[char];\n }\n else if(root.renderMode === mode.SVG) {\n n = inject.measureTextSync(__key, __ff, fontSize, fontWeight, char);\n n *= padding[char];\n }\n count -= n;\n p[char] = n;\n }\n }\n lastChar = char;\n }\n // 忽略零宽字符\n if(cw === 0) {\n i++;\n continue;\n }\n // 换行都要判断i不是0的时候,第1个字符强制不换行\n if(count === w) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n let textBox;\n // 特殊情况,恰好最后一行最后一个排满,此时查看末尾mpb,要防止i为0的情况首个字符特殊不回退,无需看开头mpb\n if(i === length - 1 && count > w - endSpace && i) {\n count -= charWidthList[i--];\n }\n i++;\n if(!lineCount) {\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, count);\n }\n // 必须先添加再设置y,当有diff的lineHeight时,第一个换行不影响,再换行时第2个换行即第3行会被第1行影响\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null; // 换行后连续字符reduce不生效重新计数\n }\n // 奇怪的精度问题,暂时不用相等判断,而是为原本w宽度加一点点冗余1e-10\n else if(count > w + (1e-10)) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n // 普通非多行文本阶段逻辑\n let width;\n // 宽度不足时无法跳出循环,至少也要塞个字符形成一行,无需判断第1行,因为是否放得下逻辑在dom中做过了,\n // 如果第1行放不下,一定会另起一行,此时作为开头再放不下才会进这里,这个if只有0或1个字符的情况\n if(i <= begin) {\n width = count;\n }\n // 超过2个字符回退1个\n else {\n width = count - charWidthList[i--];\n }\n i++;\n // 根据是否第一行分开处理行首空白\n let textBox;\n if(!lineCount) {\n maxW = width - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, width);\n }\n // 必须先添加再设置y,同上\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null;\n }\n else {\n i++;\n }\n }\n // 换行后Text的x重设为lx\n if(lineCount) {\n this.__x = this.__sx1 = lx;\n }\n // 最后一行,只有一行未满时也进这里,需查看末尾mpb,排不下回退一个字符\n // 声明了lineClamp时特殊考虑,这里一定是最后一行,要对比行数不能超过,超过忽略掉这些文本\n if(begin < length && (!lineClamp || lineCount + lineClampCount < lineClamp)) {\n let textBox;\n if(!lineCount) {\n let needBack;\n // 防止开头第一个begin=0时回退,这在inline有padding且是第一个child时会发生\n if(begin && count > w - endSpace) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n else {\n let needBack;\n // 防止begin在结尾时回退,必须要有个字符,这在最后一行1个字符排不下时会出现\n if(count > w - endSpace && begin < length - 1) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n maxW = Math.max(maxW, count);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n }\n }\n this.__width = maxW;\n this.__height = y - data.y;\n this.__baseLine = css.getBaseLine(computedStyle);\n return lineCount;\n }\n\n // 末尾行因ellipsis的缘故向前回退字符生成textBox,可能会因不满足宽度导致无法生成,此时向前继续回退TextBox\n __lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount, lineHeight, lx, x, y, maxW,\n textBoxes, content, charWidthList, lineBoxManager) {\n for(; i >= begin; i--) {\n count -= charWidthList[i] + letterSpacing;\n if(count + ew + endSpace <= w) {\n // 至少1个字符不用回退,到0也没找到需要回退\n if(i) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n break;\n }\n }\n }\n // 最后也没找到,看是否要查找前一个inline节点,还是本身是行首兜底首字母\n if(i < 0) {\n let lineBox = lineBoxManager.lineBox;\n // lineBox为空是行首,至少放1个字符\n if(!lineBox.size) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.charAt(begin), charWidthList.slice(begin, begin + 1));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n }\n // 向前查找inline节点,可能会有前面inline嵌套,因此直接用lineBox,不会出现inlineBlock,\n // 这里和css不同,ib强制超限换行不会同行\n else {\n let list = lineBox.list;\n outer:\n for(let j = list.length - 1; j >= 0; j--) {\n let tb = list[j];\n let { content, wList, width } = tb;\n // 整体减去可以说明可能在这个tb中,只要最后发现不是空文本节点就行,否则继续;第0个强制进入保证1字符\n if(count - width + ew <= w || !j) {\n // 找到可以跳出outer循环,找不到继续,注意第0个且1个字符判断\n for(let k = wList.length - 1; k >= 0; k--) {\n if(!k && !j || count + ew <= w) {\n tb.__content = content;\n tb.__width = width;\n tb.parent.__ellipsis = true;\n break outer;\n }\n else {\n let w2 = wList[k];\n tb.__endY -= w2;\n width -= w2;\n content = content.slice(0, k);\n count -= w2;\n wList.pop();\n }\n }\n }\n // 不够则看前一个tb并且删掉这个\n else {\n count -= width;\n }\n list.pop();\n tb.parent.textBoxes.pop();\n }\n }\n }\n return [y, maxW];\n }\n\n __offsetX(diff, isLayout) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetX(diff);\n });\n }\n this.__sx1 += diff;\n }\n\n __offsetY(diff, isLayout) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetY(diff);\n });\n }\n this.__sy1 += diff;\n }\n\n __tryLayInline(w) {\n return w - this.charWidthList[0];\n }\n\n __inlineSize() {\n let minX, maxX;\n this.textBoxes.forEach((item, i) => {\n if(i) {\n minX = Math.min(minX, item.x);\n maxX = Math.max(maxX, item.x + item.width);\n }\n else {\n minX = item.x;\n maxX = item.x + item.width;\n }\n });\n this.__x = minX;\n this.__sx = this.__sx1 = minX + this.ox;console.log(22222)\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] * 0.5, half);\n }\n else if(textStrokeWidth[1] === VW) {\n half = Math.max(textStrokeWidth[0] * root.width * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VH) {\n half = Math.max(textStrokeWidth[0] * root.height * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VMAX) {\n half = Math.max(textStrokeWidth[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VMIN) {\n half = Math.max(textStrokeWidth[0] * Math.min(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(textStrokeWidth[0] * 0.5, half);\n }\n half += 1;\n return [sx - half, sy - half, sx + width + half, sy + height + half];\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get matrix() {\n return this.domParent.matrix;\n }\n\n get matrixEvent() {\n return this.domParent.matrixEvent;\n }\n}\n\nText.prototype.__renderByMask = Text.prototype.render;\n\nexport default Text;\n","import util from './util';\nimport $$type from './$$type';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\n/**\n * 2. 打平children中的数组,变成一维\n * 3. 合并相连的Text节点,即string内容\n */\nfunction flattenJson(parent) {\n if(Array.isArray(parent)) {\n return parent.map(item => flattenJson(item));\n }\n else if(!parent || [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) {\n return parent;\n }\n let list = [];\n traverseJson(list, parent.children, {\n lastText: null,\n });\n parent.children = list;\n return parent;\n}\n\nfunction traverseJson(list, children, options) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n traverseJson(list, item, options);\n });\n }\n else if(children && (children.$$type === TYPE_VD || children.$$type === TYPE_GM)) {\n if(['canvas', 'svg', 'webgl'].indexOf(children.tagName) > -1) {\n throw new Error('Can not nest canvas/svg/webgl');\n }\n if(children.$$type === TYPE_VD) {\n flattenJson(children);\n }\n list.push(children);\n options.lastText = null;\n }\n else if(children && children.$$type === TYPE_CP) {\n list.push(children);\n // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做\n options.lastText = null;\n }\n // 排除掉空的文本,连续的text合并\n else if(!util.isNil(children) && children !== '') {\n if(options.lastText !== null) {\n list[list.length - 1] = options.lastText += children;\n }\n else {\n list.push(children);\n }\n }\n}\n\nexport default flattenJson;\n","import Text from '../node/Text';\nimport util from './util';\nimport $$type from './$$type';\nimport enums from './enums';\nimport flatten from './flatten';\n\nconst { NODE_KEY: {\n NODE_DOM_PARENT,\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n} } = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nfunction initRoot(cd, root) {\n let c = flatten({\n tagName: root.tagName,\n props: {},\n children: cd,\n $$type: TYPE_VD,\n });\n root.__json = c;\n root.__host = root;\n let children = build(c.children, root, root);\n return relation(root, children);\n}\n\nfunction initDom(json, root, host, parent) {\n let vd = build(json, root, host);\n return relation(parent, vd);\n}\n\nfunction initCp(json, root, host) {\n if(util.isObject(json)) {\n // cp的flatten在__init中自己做\n return build(json, root, host);\n }\n // text的relation会由上层如Root设置\n else {\n return new Text(json);\n }\n}\n\nfunction initCp2(json, root, host, parent) {\n let vd = new json.klass(json.props);\n vd.__tagName = json.tagName || vd.__tagName;\n vd.__root = root;\n vd.__host = host;\n vd.__json = json;\n vd.__init();\n return relation(parent, vd);\n}\n\n/**\n * 将初始json文件生成virtualDom\n * @param json\n * @param root\n * @param host\n * @param hasP 出现过p标签\n * @returns vd\n */\nfunction build(json, root, host, hasP) {\n if(Array.isArray(json)) {\n return json.map(item => build(item, root, host, hasP));\n }\n let vd;\n if(util.isObject(json) && json.$$type) {\n let { tagName, props, children, klass, $$type, __inheritAnimate, __animateRecords } = json;\n // 更新过程中无变化的cp直接使用原来生成的\n if($$type === TYPE_CP && json.__placeholder) {\n return json.__placeholder;\n }\n if($$type === TYPE_VD) {\n if(tagName === 'img') {\n vd = new Img(tagName, props);\n if(Array.isArray(children) && children.length) {\n throw new Error('Img can not contain children');\n }\n }\n else {\n vd = new Dom(tagName, props);\n }\n // 检查p不能包含div\n if(tagName === 'p') {\n hasP = true;\n }\n else if(tagName === 'div' && hasP) {\n throw new Error('Markup p can not contain div');\n }\n if(Array.isArray(children)) {\n children = relation(vd, build(children, root, host, hasP));\n }\n else {\n children = [];\n }\n vd.__children = children;\n }\n else if($$type === TYPE_GM) {\n let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\n }\n else if($$type === TYPE_CP) {\n vd = new klass(props);\n vd.__tagName = tagName || vd.__tagName;\n }\n else {\n return new Text(json);\n }\n // 根parse需要用到真正的vd引用,然后vd也要引用json,用以做domApi\n json.vd = vd;\n vd.__json = json;\n // 递归parse中的动画记录需特殊处理,将target改为真正的vd引用\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n __animateRecords.list.forEach(item => {\n item.target = item.target.vd;\n });\n delete json.__animateRecords;\n }\n // 更新过程中key相同或者普通相同的vd继承动画\n if(__inheritAnimate) {\n util.extendAnimate(__inheritAnimate, vd);\n delete json.__inheritAnimate;\n }\n vd.__root = root;\n vd.__host = host;\n if($$type === TYPE_CP) {\n vd.__init();\n }\n let ref = props.ref;\n if(util.isString(ref) && ref || util.isNumber(ref)) {\n host.ref[ref] = vd;\n }\n else if(util.isFunction(ref)) {\n ref(vd);\n }\n return vd;\n }\n return new Text(json);\n}\n\n/**\n * 设置关系,父子和兄弟\n * @param parent\n * @param children\n * @param options\n * @returns {Xom|Text|Component}\n */\nfunction relation(parent, children, options = {}) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n relation(parent, item, options);\n });\n }\n else if(children instanceof Xom || children instanceof Component || children instanceof Text) {\n children.__parent = parent;\n children.__domParent = parent;\n // 极为恶心,为了v8的性能优化,text复用parent的__config部分,但domParent重设\n if(children instanceof Text) {\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n if(children.__config) {\n children.__config[NODE_DOM_PARENT] = parent;\n }\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n // 文字视作为父节点的直接文字子节点\n if(children instanceof Component) {\n let sr = children.shadowRoot;\n if(sr instanceof Text) {\n sr.__parent = parent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n sr.__domParent = parent;\n if(sr.__config) {\n sr.__config[NODE_DOM_PARENT] = parent;\n }\n }\n }\n return children;\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n initRoot,\n initDom,\n initCp,\n initCp2,\n relation,\n};\n","import util from './util';\n\nconst { isFunction } = util;\n\nclass Event {\n constructor() {\n this.__eHash = {};\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.on(id[i], handle);\n }\n }\n else {\n if(!self.__eHash.hasOwnProperty(id)) {\n self.__eHash[id] = [];\n }\n // 遍历防止此handle被侦听过了\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n if(item[i] === handle) {\n return self;\n }\n }\n self.__eHash[id].push(handle);\n }\n return self;\n }\n\n once(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n function cb(...data) {\n handle.apply(self, data);\n self.off(id, cb);\n }\n\n cb.__karasEventCb = handle;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.once(id[i], handle);\n }\n }\n else if(handle) {\n self.on(id, cb);\n }\n return this;\n }\n\n off(id, handle) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.off(id[i], handle);\n }\n }\n else if(self.__eHash.hasOwnProperty(id)) {\n if(handle) {\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n // 需考虑once包裹的引用对比\n if(item[i] === handle || item[i].__karasEventCb === handle) {\n item.splice(i, 1);\n break;\n }\n }\n }\n // 未定义为全部清除\n else {\n delete self.__eHash[id];\n }\n }\n return this;\n }\n\n emit(id, ...data) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.emit(id[i], data);\n }\n }\n else {\n if(self.__eHash.hasOwnProperty(id)) {\n let list = self.__eHash[id];\n if(list.length) {\n list = list.slice();\n for(let i = 0, len = list.length; i < len; i++) {\n let cb = list[i];\n if(isFunction(cb)) {\n cb.apply(self, data);\n }\n }\n }\n }\n }\n return this;\n }\n\n static mix(...obj) {\n for(let i = obj.length - 1; i >= 0; i--) {\n let o = obj[i];\n let event = new Event();\n o.__eHash = {};\n let fns = ['on', 'once', 'off', 'emit'];\n for(let j = fns.length - 1; j >= 0; j--) {\n let fn = fns[j];\n o[fn] = event[fn];\n }\n }\n }\n\n static REFRESH = 'refresh';\n static PAUSE = 'pause';\n static PLAY = 'play';\n static FRAME = 'frame';\n static FINISH = 'finish';\n static CANCEL = 'cancel';\n static BEGIN = 'begin';\n static END = 'end';\n}\n\nexport default Event;\n","import Node from './Node';\nimport Text from './Text';\nimport builder from '../util/builder';\nimport Event from '../util/Event';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport flatten from '../util/flatten';\nimport css from '../style/css';\nimport change from '../refresh/change';\n\nconst { isNil, isFunction, clone, extend } = util;\n\nconst REGISTER = {};\n\n/**\n * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归\n * 在check时树递归会用到,判断是否需要查找cp更新\n * @param cp\n */\nfunction setUpdateFlag(cp) {\n // 去重\n if(cp.__hasUpdate) {\n return;\n }\n cp.__hasUpdate = true;\n let host = cp.host;\n if(host) {\n setUpdateFlag(host);\n }\n}\n\nclass Component extends Event {\n constructor(props = {}) {\n super();\n this.__tagName = /(?:function|class)\\s+([\\w$]+)/.exec(this.constructor.toString())[1];\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__parent = null;\n this.__host = null;\n this.__ref = {};\n this.state = {};\n this.__isMounted = false;\n this.__taskList = [];\n }\n\n setState(n, cb) {\n let self = this;\n if(isNil(n)) {\n n = {};\n }\n else if(isFunction(n)) {\n return;\n }\n else {\n if(Object.keys(n).length === 0) {\n if(isFunction(cb)) {\n cb.call(self);\n }\n return;\n }\n let state = clone(self.state);\n n = extend(state, n);\n }\n let root = self.root;\n if(root && self.__isMounted) {\n // 一帧之内多次调用,需合并\n if(self.__nextState) {\n Object.assign(self.__nextState, n);\n self.__taskList.push(cb);\n }\n else {\n self.__nextState = n;\n self.__taskList = [cb];\n // 回调更新列表,before执行时splice出来供after执行,防止中途产生的后续setState干扰\n let list = [];\n let t = self.__task = {\n __before: () => {\n list = self.__taskList.splice(0);\n // 标识更新\n setUpdateFlag(this);\n },\n __after: () => {\n // self.__nextState = null; 由updater.js每次refresh前同步执行清空,这里不能异步清除,否则frame动画会乱序\n list.forEach(cb => {\n if(isFunction(cb)) {\n cb.call(self);\n }\n });\n },\n };\n root.addRefreshCp(t);\n }\n }\n // 构造函数中调用还未render,\n else if(isFunction(cb)) {\n self.state = n;\n cb.call(self);\n }\n }\n\n /**\n * build中调用初始化,json有值时是update过程才有,且处理过flatten\n * @param json\n * @private\n */\n __init(json) {\n this.__ref = {};\n let root = this.root;\n let cd = json || flatten(this.render());\n let sr = builder.initCp(cd, root, this);\n this.__cd = cd;\n if(sr instanceof Text) {\n // 文字视作为父节点的直接文字子节点,在builder里做\n }\n else if(sr instanceof Node) {\n let style = css.normalize(this.props.style);\n let keys = Object.keys(style);\n extend(sr.style, style, keys);\n extend(sr.currentStyle, style, keys);\n // 事件添加到sr\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n });\n }\n else if(!(sr instanceof Component)) {\n // 本身build是递归的,子cp已经初始化了\n throw new Error('Component render() must return a dom/text: ' + this);\n }\n // 自定义事件无视返回强制添加\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n k = k.slice(3);\n this.on(k, v);\n }\n });\n // shadow指向直接renderRoot,shadowRoot考虑到返回Component的递归即hoc高阶组件\n // host是直接所属,hostRoot同考虑到高阶组件\n this.__shadow = sr;\n sr.__host = this;\n // 递归下去,多层级时执行顺序由里到外,最终会被最上层执行替换\n while(sr instanceof Component) {\n sr.__hostRoot = this;\n sr.shadow.__host = sr;\n sr = sr.shadow;\n }\n this.__shadowRoot = sr;\n sr.__hostRoot = this;\n if(!this.__isMounted) {\n this.__isMounted = true;\n if(isFunction(this.componentDidMount)) {\n root.once(Event.REFRESH, () => {\n this.componentDidMount();\n });\n }\n }\n }\n\n render() {\n inject.warn('Component must implement render()');\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.__isDestroyed = true;\n this.__isMounted = false;\n if(isFunction(this.componentWillUnmount)) {\n this.componentWillUnmount();\n }\n this.root.delRefreshTask(this.__task);\n if(this.shadowRoot) {\n this.shadowRoot.__destroy();\n }\n this.__parent = null;\n }\n\n __emitEvent(e, force) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n return;\n }\n let res = sr.__emitEvent(e, force);\n if(res) {\n e.target = this;\n return true;\n }\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get shadow() {\n return this.__shadow;\n }\n\n get shadowRoot() {\n return this.__shadowRoot;\n }\n\n get root() {\n return this.__root;\n }\n\n get host() {\n return this.__host;\n }\n\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n get state() {\n return this.__state;\n }\n\n set state(v) {\n this.__state = v;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)) {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Component has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)\n || !obj.prototype || !(obj.prototype instanceof Component)) {\n throw new Error('Invalid param: Component register');\n }\n if(Component.hasRegister(name)) {\n throw new Error(`Component has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Component.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nObject.keys(change.GEOM).concat([\n 'x',\n 'y',\n 'ox',\n 'oy',\n 'sx',\n 'sy',\n // '__sx1',\n // '__sx2',\n // '__sx3',\n // '__sx4',\n // '__sx5',\n // '__sx6',\n // '__sy1',\n // '__sy2',\n // '__sy3',\n // '__sy4',\n // '__sy5',\n // '__sy6',\n 'width',\n 'height',\n 'outerWidth',\n 'outerHeight',\n 'clientWidth',\n 'clientHeight',\n 'offsetWidth',\n 'offsetHeight',\n 'style',\n 'animationList',\n 'animateStyle',\n 'currentStyle',\n 'computedStyle',\n 'currentProps',\n 'baseLine',\n 'virtualDom',\n 'mask',\n 'maskId',\n 'textWidth',\n 'content',\n 'lineBoxes',\n 'charWidthList',\n 'charWidth',\n '__layoutData',\n 'availableAnimating',\n 'effectiveAnimating',\n 'displayAnimating',\n 'visibilityAnimating',\n 'bbox',\n '__config',\n 'contentBoxList',\n 'listener',\n 'matrix',\n 'matrixEvent',\n]).forEach(fn => {\n Object.defineProperty(Component.prototype, fn, {\n get() {\n let sr = this.shadowRoot;\n if(sr) {\n return sr[fn];\n }\n },\n });\n});\n\n[\n '__layout',\n '__layoutAbs',\n '__layoutNone',\n '__tryLayInline',\n '__offsetX',\n '__offsetY',\n '__calAutoBasis',\n '__calMp',\n '__calAbs',\n '__renderAsMask',\n '__renderByMask',\n '__mp',\n 'animate',\n 'removeAnimate',\n 'clearAnimate',\n 'updateStyle',\n 'getBoundingClientRect',\n 'getComputedStyle',\n '__deepScan',\n 'clearCache',\n '__structure',\n '__modifyStruct',\n '__updateStruct',\n 'flowChildren',\n 'absChildren',\n '__isRealInline',\n '__calBasis',\n '__calMinMax',\n '__computeMeasure',\n 'appendChild',\n 'prependChild',\n 'insertBefore',\n 'insertAfter',\n 'removeChild',\n 'remove',\n].forEach(fn => {\n Component.prototype[fn] = function() {\n let sr = this.shadowRoot;\n if(sr && isFunction(sr[fn])) {\n return sr[fn].apply(sr, arguments);\n }\n };\n});\n\nexport default Component;\n","import unit from './unit';\nimport transform from './transform';\nimport enums from '../util/enums';\n\nconst { STYLE_KEY: { SCALE_X, SCALE_Y } } = enums;\nconst { PERCENT, NUMBER } = unit;\n\nfunction matrixResize(imgWidth, imgHeight, targetWidth, targetHeight, x, y, w, h) {\n if(imgWidth === targetWidth && imgHeight === targetHeight) {\n return;\n }\n let list = [\n [SCALE_X, [targetWidth / imgWidth, NUMBER]],\n [SCALE_Y, [targetHeight / imgHeight, NUMBER]],\n ];\n let tfo = transform.calOrigin([[0, PERCENT], [0, PERCENT]], w, h);\n tfo[0] += x;\n tfo[1] += y;\n return transform.calMatrixWithOrigin(list, tfo, w, h);\n}\n\nexport default {\n matrixResize,\n};\n","import border from './border';\nimport transform from './transform';\nimport mx from '../math/matrix';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\nimport unit from './unit';\nimport enums from '../util/enums';\nimport image from './image';\n\nconst {\n STYLE_KEY: {\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\nconst { clone, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { AUTO, PX, PERCENT, STRING, REM, VW, VH, 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 res.push(position[0] * Math.max(root.width, root.height) * 0.01);\n }\n else if(position[1] === VMIN) {\n res.push(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_FRAME_CB,\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_CAL_DIFF_TIME,\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') {\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') {\n let n = v[k].slice(0);\n n[0] = 100 + n[0] * percent;\n st.push([k, n]);\n }\n }\n });\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n for(let i = 0; i < 2; i++) {\n st[i][0] += v[i] * percent;\n }\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n if(v[0] !== 0) {\n st[0][0] += v[0] * percent;\n }\n if(v[1] !== 0) {\n st[1][0] += v[1] * percent;\n }\n }\n else if(k === BOX_SHADOW) {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n st[i][j] += v[i][j] * percent;\n }\n // rgba\n for(let j = 0; j < 4; j++) {\n st[i][4][j] += v[i][4][j] * percent;\n }\n }\n }\n else if(k === BACKGROUND_SIZE) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0][0] += v[i][0] * percent;\n item[1][0] += v[i][1] * percent;\n }\n });\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0] += v[i] * percent;\n }\n });\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n st.forEach((st2, i) => {\n let v2 = v[i];\n if(!v2) {\n return;\n }\n let [c, d, p, z] = v2;\n if(GRADIENT_TYPE.hasOwnProperty(st2.k)) {\n for(let i = 0, len = Math.min(st2.v.length, c.length); i < len; i++) {\n let a = st2.v[i];\n let b = c[i];\n a[0][0] += b[0][0] * percent;\n a[0][1] += b[0][1] * percent;\n a[0][2] += b[0][2] * percent;\n a[0][3] += b[0][3] * percent;\n if(a[1] && b[1]) {\n a[1][0] += b[1] * percent;\n }\n }\n if(st2.k === 'linear' && st2.d !== undefined && d !== undefined) {\n if(Array.isArray(d)) {\n st2.d[0] += d[0] * percent;\n st2.d[1] += d[1] * percent;\n st2.d[2] += d[2] * percent;\n st2.d[3] += d[3] * percent;\n }\n else {\n st2.d += d * percent;\n }\n }\n if(st2.k === 'radial') {\n if(st2.z !== undefined && z !== undefined) {\n st2.z[0] += z[0] * percent;\n st2.z[1] += z[1] * percent;\n st2.z[2] += z[2] * percent;\n st2.z[3] += z[3] * percent;\n st2.z[4] += z[4] * percent;\n }\n else if(st2.p !== undefined && p !== undefined) {\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n else if(st2.k === 'conic' && st2.d !== undefined && d !== undefined) {\n st2.d += d * percent;\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n // fill纯色\n else {\n st2[0] += c[0] * percent;\n st2[1] += c[1] * percent;\n st2[2] += c[2] * percent;\n st2[3] += c[3] * percent;\n }\n });\n }\n // color可能超限[0,255],但浏览器已经做了限制,无需关心\n else if(COLOR_HASH.hasOwnProperty(k)) {\n st = st[0];\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n else if(GEOM.hasOwnProperty(k)) {\n let st = style[k];\n let tagName = target.tagName;\n if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calIncrease)) {\n let fn = GEOM[k][tagName].calIncrease;\n if(target.isMulti) {\n style[k] = st.map((item, i) => {\n return fn(item, v[i], percent);\n });\n }\n else {\n style[k] = fn(st, v, percent);\n }\n }\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n let o2 = o[j];\n let n2 = n[j];\n if(!isNil(o2) && !isNil(n2)) {\n for(let k = 0, len3 = Math.min(o2.length, n2.length); k < len3; k++) {\n if(!isNil(o2[k]) && !isNil(n2[k])) {\n o2[k] += n2[k] * percent;\n }\n }\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n v.forEach((item, i) => {\n let st2 = st[i];\n if(!isNil(item) && !isNil(st2)) {\n for(let i = 0, len = Math.min(st2.length, item.length); i < len; i++) {\n let o = st2[i];\n let n = item[i];\n if(!isNil(o) && !isNil(n)) {\n st2[i] += n * percent;\n }\n }\n }\n });\n }\n else {\n v.forEach((item, i) => {\n if(!isNil(item) && !isNil(st[i])) {\n st[i] += item * percent;\n }\n });\n }\n }\n else {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n if(!isNil(o[j]) && !isNil(n[j])) {\n o[j] += n[j] * percent;\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(!isNil(st[0]) && !isNil(v[0])) {\n st[0] += v[0] * percent;\n }\n if(!isNil(st[1]) && !isNil(v[1])) {\n st[1] += v[1] * percent;\n }\n }\n else {\n if(!isNil(st) && !isNil(v)) {\n style[k] += v * percent;\n }\n }\n }\n }\n else if(k === OPACITY || k === Z_INDEX) {\n style[k] += v * percent;\n // 精度问题可能会超过[0,1]区间\n if(k === OPACITY) {\n if(style[k] < 0) {\n style[k] = 0;\n }\n else if(style[k] > 1) {\n style[k] = 1;\n }\n }\n }\n }\n return style;\n}\n\nfunction gotoOverload(options, cb) {\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n return [options || {}, cb];\n}\n\nlet uuid = 0;\n\nclass Animation extends Event {\n constructor(target, list, options) {\n super();\n this.__id = uuid++;\n list = clone(list || []);\n if(Array.isArray(list)) {\n list = list.filter(item => item && isObject(item));\n }\n // 动画过程另外一种形式,object描述k-v形式\n else if(list && isObject(list)) {\n let nl = [];\n Object.keys(list).forEach(k => {\n let v = list[k];\n if(Array.isArray(v)) {\n for(let i = 0, len = v.length; i < len; i++) {\n let o = nl[i] = nl[i] || {\n offset: i / (len - 1),\n };\n o[k] = v[i];\n }\n }\n });\n list = nl;\n }\n else {\n list = [];\n }\n if(isNumber(options)) {\n this.__options = {\n duration: options,\n };\n options = this.__options;\n }\n let op = this.__options = options || {\n duration: 0,\n };\n let root = target.root;\n let config = this.__config = [\n false, // assigning\n false, // inFps\n false, // isDelay\n false, // begin\n false, // end\n false, // finished\n false, // nextBegin\n true, // firstPlay\n this.__frameCb,\n null, // playCb\n target,\n root,\n null, // frames\n null, // framesR\n 0, // currentTime\n 0, // nextTime\n {}, // style\n 0, // duration\n 1, // iterations\n 'none', // fill\n 1, // playbackRate\n 0, // playCount\n 'idle',\n false, // destroy\n 0, // startTime\n 0, // fpsTime\n op.easing,\n false, // enterFrame\n 0, // delay\n 0, // endDelay\n null, // keys,\n null, // originStyle,\n null, // currentFrames\n null, // currentFrame\n false, // spfLimit\n 60, // fps\n 'normal', // direction\n this.__calDiffTime,\n true, // firstEnter,\n false, // stayBegin\n false, // stayEnd\n false, // is2\n 0, // endTime\n target.__config, // nodeConfig\n root && root.__config, // rootConfig,destroy后root可能为空\n false, // outBeginDelay\n ];\n let iterations = this.iterations = op.iterations;\n let duration = this.duration = op.duration;\n let [frames, framesR, keys, originStyle] = this.__init(list, iterations, duration, op.easing, target);\n config[I_FRAMES] = frames;\n config[I_FRAMES_R] = framesR;\n config[I_KEYS] = keys;\n config[I_ORIGIN_STYLE] = originStyle;\n if(frames.length === 2) {\n config[I_IS2] = true;\n config[I_END_TIME] = frames[1][FRAME_TIME];\n }\n let fps = parseInt(op.fps) || 0;\n if(fps <= 0) {\n fps = 60;\n }\n this.fps = fps;\n this.spfLimit = op.spfLimit;\n this.delay = op.delay;\n this.endDelay = op.endDelay;\n this.playbackRate = op.playbackRate;\n this.fill = op.fill;\n this.iterations = op.iterations;\n this.direction = op.direction;\n config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(op.direction) ? framesR : frames;\n // 时间戳\n config[I_TIME_STAMP] = frame.__now;\n // 性能优化访问\n this[0] = this.__before;\n this[1] = this.__after;\n }\n\n __init(list, iterations, duration, easing, target) {\n if(list.length < 1) {\n return [[], [], [], {}];\n }\n // 过滤时间非法的,过滤后续offset<=前面的\n let offset = -1;\n let tagName = target.tagName;\n for(let i = 0, len = list.length; i < len; i++) {\n let current = list[i];\n if(current.hasOwnProperty('offset')) {\n current.offset = parseFloat(current.offset) || 0;\n current.offset = Math.max(0, current.offset);\n current.offset = Math.min(1, current.offset);\n // 超过区间[0,1]\n if(isNaN(current.offset) || current.offset < 0 || current.offset > 1) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n // <=前面的\n else if(current.offset <= offset) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n }\n // 缩写处理\n Object.keys(current).forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(current, k);\n }\n });\n // 检查key合法性\n Object.keys(current).forEach(k => {\n if(k !== 'easing' && k !== 'offset' && !change.isValid(tagName, k)) {\n delete current[k];\n }\n });\n }\n // 只有1帧复制出来变成2帧方便运行\n if(list.length === 1) {\n list[0] = clone(list[0]);\n if(list[0].offset === 1) {\n list.unshift({\n offset: 0,\n });\n }\n else {\n let copy = clone(list[0]);\n copy.offset = 1;\n list.push(copy);\n }\n }\n // 强制clone防止同引用\n else {\n list.forEach((item, i) => {\n list[i] = clone(item);\n });\n }\n // 首尾时间偏移强制为[0, 1],不是的话前后加空帧\n let first = list[0];\n if(first.hasOwnProperty('offset') && first.offset > 0) {\n first = {\n offset: 0,\n };\n list.unshift(first);\n }\n else {\n first.offset = 0;\n }\n let last = list[list.length - 1];\n if(last.hasOwnProperty('offset') && last.offset < 1) {\n last = {\n offset: 1,\n };\n list.push(last);\n }\n else {\n last.offset = 1;\n }\n // 计算没有设置offset的时间\n for(let i = 1, len = list.length; i < len; i++) {\n let start = list[i];\n // 从i=1开始offset一定>0,找到下一个有offset的,均分中间无声明的\n if(!start.hasOwnProperty('offset')) {\n let end;\n let j = i + 1;\n for(; j < len; j++) {\n end = list[j];\n if(end.hasOwnProperty('offset')) {\n break;\n }\n }\n let num = j - i + 1;\n start = list[i - 1];\n let per = (end.offset - start.offset) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.offset = start.offset + per * (k + 1 - i);\n }\n i = j;\n }\n }\n let frames = [];\n // 换算每一关键帧样式标准化\n list.forEach(item => {\n frames.push(framing(item, duration, easing));\n });\n // 为方便两帧之间计算变化,强制统一所有帧的css属性相同,没有写的为节点的当前样式currentStyle\n let keys = unify(frames, target);\n inherit(frames, keys, target);\n let framesR = clone(frames).reverse();\n // 存储原本样式以便恢复用\n let { style, props } = target;\n let originStyle = {};\n keys.forEach(k => {\n if(isGeom(tagName, k)) {\n originStyle[k] = props[k];\n }\n originStyle[k] = style[k];\n });\n // 再计算两帧之间的变化,存入transition属性\n let length = frames.length;\n let prev = frames[0];\n for(let i = 1; i < length; i++) {\n let next = frames[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n // 反向存储帧的倒排结果\n framesR.forEach(item => {\n item[FRAME_TIME] = duration - item[FRAME_TIME];\n item[FRAME_TRANSITION] = [];\n });\n prev = framesR[0];\n for(let i = 1; i < length; i++) {\n let next = framesR[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n return [frames, framesR, keys, originStyle];\n }\n\n __clean(isFinish) {\n let __config = this.__config;\n this.__cancelTask();\n __config[I_NEXT_TIME] = 0;\n let restore;\n let style = __config[I_STYLE];\n let keys = __config[I_KEYS];\n let target = __config[I_TARGET];\n if(isFinish) {\n __config[I_CURRENT_TIME] = __config[I_DELAY] + __config[I_DURATION] + __config[I_END_DELAY];\n if(__config[I_PLAY_STATE] === 'finish') {\n return;\n }\n __config[I_PLAY_STATE] = 'finish';\n // cancel需要清除finish根据情况保留\n if(!__config[I_STAY_END]) {\n __config[I_STYLE] = {};\n restore = true;\n }\n }\n else {\n __config[I_PLAY_COUNT] = __config[I_CURRENT_TIME] = 0;\n if(__config[I_PLAY_STATE] === 'idle') {\n return;\n }\n __config[I_PLAY_STATE] = 'idle';\n __config[I_STYLE] = {};\n restore = true;\n }\n // 动画取消结束不停留在最后一帧需要还原target原本的样式,需要对比目前是否是由本动画赋值的\n if(restore) {\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n if(target.__currentProps[k] === style[k]) {\n target.__currentProps[k] = target.props[k];\n }\n }\n else {\n if(target.__currentStyle[k] === style[k]) {\n target.__currentStyle[k] = target.style[k];\n }\n }\n });\n }\n }\n\n __frameCb(__config, diff, isDelay) {\n this.emit(Event.FRAME, diff, isDelay);\n if(__config[I_FIRST_PLAY]) {\n __config[I_FIRST_PLAY] = false;\n this.emit(Event.PLAY);\n }\n if(isFunction(__config[I_PLAY_CB])) {\n __config[I_PLAY_CB].call(this, diff, isDelay);\n __config[I_PLAY_CB] = null;\n }\n }\n\n __calDiffTime(__config, diff) {\n let playbackRate = __config[I_PLAYBACK_RATE];\n let spfLimit = __config[I_SPF_LIMIT];\n let fps = __config[I_FPS];\n let v = __config[I_CURRENT_TIME] = __config[I_NEXT_TIME];\n // 定帧限制每帧时间间隔最大为spf\n if(spfLimit) {\n if(spfLimit === true) {\n diff = Math.min(diff, 1000 / fps);\n }\n else if(spfLimit > 0) {\n diff = Math.min(diff, spfLimit);\n }\n }\n // 播放时间累加,并且考虑播放速度加成\n if(playbackRate !== 1 && playbackRate > 0) {\n diff *= playbackRate;\n }\n __config[I_NEXT_TIME] += diff;\n return [v, diff];\n }\n\n play(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n if(playState === 'running') {\n return this;\n }\n this.__cancelTask();\n __config[I_PLAY_CB] = cb;\n __config[I_PLAY_STATE] = 'running';\n // 每次play调用标识第一次运行,需响应play事件和回调\n __config[I_FIRST_PLAY] = true;\n // 防止finish/cancel事件重复触发,每次播放重置\n this.__hasFin = false;\n this.__hasCancel = false;\n // 只有第一次调用会进初始化,另外finish/cancel视为销毁也会重新初始化\n if(!__config[I_ENTER_FRAME]) {\n __config[I_ENTER_FRAME] = true;\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n // 初始化根据方向确定帧序列\n __config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction) ? framesR : frames;\n __config[I_CURRENT_TIME] = __config[I_NEXT_TIME] = __config[I_FPS_TIME] = 0;\n }\n // 添加每帧回调且立刻执行,本次执行调用refreshTask也是下一帧再渲染,frame的每帧都是下一帧\n frame.offFrame(this);\n frame.onFrame(this);\n __config[I_START_TIME] = frame.__now;\n __config[I_END] = false;\n return this;\n }\n\n __before(diff) {\n let __config = this.__config;\n __config[I_TIME_STAMP] = frame.__now;\n let target = __config[I_TARGET];\n let fps = __config[I_FPS];\n let playCount = __config[I_PLAY_COUNT];\n let currentFrames = __config[I_CURRENT_FRAMES];\n let iterations = __config[I_ITERATIONS];\n let stayBegin = __config[I_STAY_BEGIN];\n let stayEnd = __config[I_STAY_END];\n let delay = __config[I_DELAY];\n let root = __config[I_ROOT];\n let is2 = __config[I_IS2];\n let endTime = __config[I_END_TIME];\n let duration = __config[I_DURATION];\n let endDelay = __config[I_END_DELAY];\n let length = currentFrames.length;\n // 用本帧和上帧时间差,计算累加运行时间currentTime,以便定位当前应该处于哪个时刻\n let [currentTime, d] = __config[I_CAL_DIFF_TIME](__config, diff);\n diff = d;\n // 增加的fps功能,当<60时计算跳帧,每帧运行依旧累加时间,达到fps时重置,第一帧强制不跳\n if(!__config[I_FIRST_ENTER] && fps < 60) {\n diff = __config[I_FPS_TIME] += diff;\n if(diff < 1000 / fps) {\n __config[I_IN_FPS] = true;\n return;\n }\n __config[I_FPS_TIME] = 0;\n }\n __config[I_FIRST_ENTER] = false;\n // delay仅第一次生效\n if(playCount === 0 && currentTime < delay) {\n if(stayBegin) {\n let currentFrame = __config[I_CURRENT_FRAME] = currentFrames[0];\n let current = currentFrame[FRAME_STYLE];\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n }\n // 即便不刷新,依旧执行帧回调,同时标明让后续第一帧响应begin\n __config[I_OUT_BEGIN_DELAY] = true;\n __config[I_IS_DELAY] = true;\n return;\n }\n // 减去delay,计算在哪一帧,仅首轮\n if(playCount === 0) {\n currentTime -= delay;\n }\n if(currentTime === 0 || __config[I_OUT_BEGIN_DELAY]) {\n __config[I_OUT_BEGIN_DELAY] = false;\n __config[I_BEGIN] = true;\n }\n // 超过duration非尾轮需处理回到开头,触发新一轮动画事件,这里可能时间间隔非常大直接跳过几轮\n let round;\n while(currentTime >= duration && playCount < iterations - 1) {\n currentTime -= duration;\n __config[I_NEXT_TIME] -= duration;\n playCount = ++__config[I_PLAY_COUNT];\n __config[I_BEGIN] = true;\n round = true;\n }\n // 如果发生轮换,需重新确定正反向\n if(round) {\n let direction = __config[I_DIRECTION];\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let isAlternate = {\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction);\n // 有正反向播放需要重设帧序列\n if(isAlternate) {\n let isEven = playCount % 2 === 0;\n if(direction === 'alternate') {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n }\n let isLastCount = playCount >= iterations - 1;\n // 只有2帧可优化,否则2分查找当前帧\n let i, frameTime;\n if(is2) {\n i = currentTime < endTime ? 0 : 1;\n frameTime = endTime;\n }\n else {\n i = binarySearch(0, length - 1, currentTime, currentFrames);\n frameTime = currentFrames[i][FRAME_TIME];\n }\n // 最后一帧结束动画,仅最后一轮才会进入,需处理endDelay\n let isLastFrame = isLastCount && i === length - 1;\n let percent = 0;\n if(isLastFrame) {\n // 无需任何处理\n }\n // 否则根据目前到下一帧的时间差,计算百分比,再反馈到变化数值上\n else if(is2) {\n percent = currentTime / duration;\n }\n else {\n let total = currentFrames[i + 1][FRAME_TIME] - frameTime;\n percent = (currentTime - frameTime) / total;\n }\n let inEndDelay, currentFrame = currentFrames[i], current;\n __config[I_CURRENT_FRAME] = currentFrame;\n /** 这里要考虑全几种场景:\n * 1. 单次播放无endDelay且fill不停留(有/无差异,下同)\n * 2. 单次播放无endDelay且fill停留\n * 3. 单次播放有endDelay且fill不停留\n * 4. 单次播放有endDelay且fill停留\n * 5. 多次播放无endDelay且fill不停留(尾次/非尾次,下同)\n * 6. 多次播放无endDelay且fill停留\n * 7. 多次播放有endDelay且fill不停留\n * 8. 多次播放有endDelay且fill停留\n */\n let needClean;\n if(isLastFrame) {\n inEndDelay = currentTime < duration + endDelay;\n // 停留对比最后一帧,endDelay可能会多次进入这里,第二次进入样式相等不再重绘\n if(stayEnd) {\n current = cloneStyle(currentFrame[FRAME_STYLE], __config[I_KEYS]);\n }\n // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里\n else {\n current = cloneStyle(__config[I_ORIGIN_STYLE], __config[I_KEYS]);\n }\n // 进入endDelay或结束阶段触发end事件,注意只触发一次,防重在触发的地方做\n __config[I_NEXT_END] = true;\n if(!inEndDelay) {\n __config[I_PLAY_COUNT]++;\n __config[I_FINISHED] = true;\n frame.offFrame(this);\n needClean = true;\n __config[I_NEXT_TIME] = 0;\n }\n }\n else {\n current = calIntermediateStyle(currentFrame, __config[I_KEYS], percent, target);\n }\n // 无论两帧之间是否有变化,都生成计算结果赋给style,去重在root做\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n if(needClean) {\n 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 __config[I_FRAME_CB].call(this, __config, diff, __config[I_IS_DELAY]);\n __config[I_IS_DELAY] = false;\n if(__config[I_BEGIN]) {\n __config[I_BEGIN] = false;\n this.emit(Event.BEGIN, __config[I_PLAY_COUNT]);\n }\n // end事件只触发一次,末轮进入endDelay或直接结束时\n if(__config[I_NEXT_END] && !__config[I_END]) {\n __config[I_END] = true;\n this.emit(Event.END, __config[I_PLAY_COUNT] - 1);\n }\n if(__config[I_FINISHED]) {\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n __config[I_PLAY_STATE] = 'finished';\n this.emit(Event.FINISH);\n }\n }\n\n pause(silence) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let { pending } = this;\n if(isDestroyed || duration <= 0 || pending) {\n return this;\n }\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(!silence) {\n this.emit(Event.PAUSE);\n }\n return this;\n }\n\n resume(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n if(isDestroyed || duration <= 0 || playState !== 'paused') {\n return this;\n }\n return this.play(cb);\n }\n\n finish(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1 || playState === 'finished' || playState === 'idle') {\n return self;\n }\n // 先清除所有回调任务,多次调用finish也会清除只留最后一次\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n let current;\n // 停留在最后一帧\n if(__config[I_STAY_END]) {\n __config[I_CURRENT_FRAME] = frames[frames.length - 1];\n current = frames[frames.length - 1][FRAME_STYLE];\n }\n else {\n current = originStyle;\n }\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(current, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean(true);\n },\n __after(diff) {\n if(!self.__hasFin) {\n self.__hasFin = true;\n __config[I_ASSIGNING] = false;\n __config[I_FRAME_CB].call(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.FINISH);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n cancel(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || playState === 'idle' || frames.length < 1) {\n return self;\n }\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(originStyle, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean();\n },\n __after(diff) {\n if(!self.__hasCancel) {\n self.__hasCancel = true;\n __config[I_ASSIGNING] = false;\n __config[I_FRAME_CB].call(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.CANCEL);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n gotoAndPlay(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n // 计算出时间点直接累加播放\n this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n return this.play(cb);\n }\n\n gotoAndStop(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n v = this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n // 先play一帧,回调里模拟暂停\n return this.play(diff => {\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isFunction(cb)) {\n cb.call(this, diff);\n }\n });\n }\n\n // 同步赋予,用在extendAnimate\n assignCurrentStyle() {\n let __config = this.__config;\n let style = __config[I_STYLE];\n let target = __config[I_TARGET];\n let keys = __config[I_KEYS];\n keys.forEach(i => {\n if(style.hasOwnProperty(i)) {\n let v = style[i];\n // geom的属性变化\n if(GEOM.hasOwnProperty(i)) {\n target.currentProps[i] = v;\n }\n // 样式\n else {\n // 将动画样式直接赋给currentStyle\n target.currentStyle[i] = v;\n }\n }\n });\n }\n\n __goto(v, isFrame, excludeDelay) {\n let __config = this.__config;\n let duration = __config[I_DURATION];\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isNaN(v) || v < 0) {\n throw new Error('Param of gotoAnd(Play/Stop) is illegal: ' + v);\n }\n if(isFrame) {\n v = (v - 1) / this.spf;\n }\n if(excludeDelay) {\n v += __config[I_DELAY];\n }\n // 超过一轮去掉delay\n if(v > duration + __config[I_DELAY]) {\n v -= __config[I_DELAY];\n }\n // 超过时间长度需要累加次数\n __config[I_PLAY_COUNT] = 0;\n while(v > duration && __config[I_PLAY_COUNT] < __config[I_ITERATIONS] - 1) {\n __config[I_PLAY_COUNT]++;\n v -= duration;\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n __config[I_NEXT_TIME] = v;\n // 防止play()重置时间和当前帧组,提前计算好\n __config[I_ENTER_FRAME] = true;\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n if({\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction)) {\n let isEven = __config[I_PLAY_COUNT] % 2 === 0;\n if(direction === 'alternate') {\n __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n return v;\n }\n\n addControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.add(this);\n }\n }\n\n removeControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.remove(this);\n }\n }\n\n __stayBegin() {\n return {\n backwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __stayEnd() {\n return {\n forwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __setTarget(target) {\n this.__target = target;\n this.__config[I_TARGET] = target;\n this.__config[I_NODE_CONFIG] = target.__config;\n }\n\n __cancelTask() {\n frame.offFrame(this);\n this.__config[I_PLAY_CB] = null;\n }\n\n __destroy(sync) {\n let self = this;\n let __config = self.__config;\n if(__config[I_DESTROYED]) {\n return;\n }\n self.removeControl();\n // clean异步执行,因为里面的样式还原需要等到下一帧,否则同步执行清除后,紧接着的新同步动画获取不到currentStyle\n if(sync) {\n self.__clean();\n __config[I_TARGET] = null;\n }\n else {\n frame.nextFrame({\n __before() {\n self.__clean();\n __config[I_TARGET] = null;\n },\n });\n }\n __config[I_START_TIME] = 0;\n __config[I_DESTROYED] = true;\n }\n\n __checkModify() {\n let __config = this.__config;\n if(__config[I_PLAY_STATE] !== 'idle' && __config[I_PLAY_STATE] !== 'finished') {\n inject.warn('Modification will not come into effect when animation is running');\n }\n }\n\n get id() {\n return this.__id;\n }\n\n get target() {\n return this.__config[I_TARGET];\n }\n\n get root() {\n return this.__config[I_ROOT];\n }\n\n get keys() {\n return this.__config[I_KEYS];\n }\n\n get style() {\n return this.__config[I_STYLE];\n }\n\n get options() {\n return this.__options;\n }\n\n get duration() {\n return this.__config[I_DURATION];\n }\n\n set duration(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DURATION] !== v) {\n __config[I_DURATION] = v;\n __config[I_END_TIME] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get delay() {\n return this.__config[I_DELAY];\n }\n\n set delay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DELAY] !== v) {\n __config[I_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get endDelay() {\n return this.__config[I_END_DELAY];\n }\n\n set endDelay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_END_DELAY] !== v) {\n __config[I_END_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get fps() {\n return this.__config[I_FPS];\n }\n\n set fps(v) {\n v = parseInt(v) || 60;\n let __config = this.__config;\n if(__config[I_FPS] !== v) {\n if(v <= 0) {\n v = 60;\n }\n __config[I_FPS] = v;\n }\n return v;\n }\n\n get spf() {\n return 1 / this.fps;\n }\n\n get iterations() {\n return this.__config[I_ITERATIONS];\n }\n\n set iterations(v) {\n if(v === Infinity || util.isString(v) && v.toLowerCase() === 'infinity') {\n v = Infinity;\n }\n else {\n v = parseInt(v);\n if(isNaN(v) || v < 0) {\n v = 1;\n }\n }\n let __config = this.__config;\n if(__config[I_ITERATIONS] !== v) {\n __config[I_ITERATIONS] = v;\n }\n return v;\n }\n\n get fill() {\n return this.__config[I_FILL];\n }\n\n set fill(v) {\n v = v || 'none';\n let __config = this.__config;\n if(__config[I_FILL] !== v) {\n __config[I_FILL] = v;\n this.__checkModify();\n }\n __config[I_STAY_BEGIN] = {\n backwards: true,\n both: true,\n }.hasOwnProperty(v);\n __config[I_STAY_END] = {\n forwards: true,\n both: true,\n }.hasOwnProperty(v);\n return v;\n }\n\n get direction() {\n return this.__config[I_DIRECTION];\n }\n\n set direction(v) {\n v = v || 'normal';\n let __config = this.__config;\n if(__config[I_DIRECTION] !== v) {\n __config[I_DIRECTION] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get frames() {\n return this.__config[I_FRAMES];\n }\n\n get framesR() {\n return this.__config[I_FRAMES_R];\n }\n\n get playbackRate() {\n return this.__config[I_PLAYBACK_RATE];\n }\n\n set playbackRate(v) {\n v = parseFloat(v) || 1;\n if(v <= 0) {\n v = 1;\n }\n let __config = this.__config;\n if(__config[I_PLAYBACK_RATE] !== v) {\n __config[I_PLAYBACK_RATE] = v;\n }\n return v;\n }\n\n get easing() {\n return this.__config[I_EASING];\n }\n\n get startTime() {\n return this.__config[I_START_TIME];\n }\n\n get currentTime() {\n return this.__config[I_CURRENT_TIME];\n }\n\n set currentTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_CURRENT_TIME] !== v) {\n __config[I_CURRENT_TIME] = v;\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get nextTime() {\n return this.__config[I_NEXT_TIME];\n }\n\n set nextTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_NEXT_TIME] !== v) {\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get timestamp() {\n return this.__config[I_TIME_STAMP];\n }\n\n get pending() {\n return this.__config[I_PLAY_STATE] !== 'running';\n }\n\n get finished() {\n return this.__config[I_PLAY_STATE] === 'finished';\n }\n\n get playState() {\n return this.__config[I_PLAY_STATE];\n }\n\n get playCount() {\n return this.__config[I_PLAY_COUNT];\n }\n\n set playCount(v) {\n v = Math.max(0, parseInt(v) || 0);\n let __config = this.__config;\n if(__config[I_PLAY_COUNT] !== v) {\n __config[I_PLAY_COUNT] = v;\n }\n return v;\n }\n\n get isDestroyed() {\n return this.__config[I_DESTROYED];\n }\n\n get animating() {\n let __config = this.__config;\n let playState = __config[I_PLAY_STATE];\n if(playState === 'idle') {\n return false;\n }\n return playState !== 'finished' || __config[I_STAY_END] || __config[I_STAY_BEGIN];\n }\n\n get spfLimit() {\n let __config = this.__config;\n return __config[I_SPF_LIMIT];\n }\n\n set spfLimit(v) {\n if(util.isNumber(v) || /^\\d/.test(v)) {\n v = Math.max(0, parseInt(v) || 0);\n }\n else {\n v = !!v;\n }\n let __config = this.__config;\n if(__config[I_SPF_LIMIT] !== v) {\n __config[I_SPF_LIMIT] = v;\n }\n return v;\n }\n\n get assigning() {\n return this.__config[I_ASSIGNING];\n }\n}\n\nexport default Animation;\n","import mode from '../node/mode';\nimport geom from '../math/geom';\nimport blur from '../math/blur';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\n\nconst {\n NODE_KEY: {\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { int2rgba } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nfunction renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h, 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 } = 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, isDirectItem) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w, !isDirectItem)\n + this.__calMp(marginRight, w, !isDirectItem)\n + this.__calMp(paddingLeft, w, !isDirectItem)\n + this.__calMp(paddingRight, w, !isDirectItem);\n if(borderLeftWidth[1] === PX) {\n mp += borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n mp += borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n mp += borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n mp += borderLeftWidth[0] * this.root.height * 0.01;\n }\n 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 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;\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 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.tagName === 'img') && marginLeft[1] === AUTO && marginRight[1] === AUTO) {\n let ow = this.outerWidth;\n if(ow < data.w) {\n this.__offsetX((data.w - ow) * 0.5, true);\n }\n }\n }\n\n __calMatrix(lv, __cacheStyle, currentStyle, computedStyle, __config, sx1, sy1, offsetWidth, offsetHeight) {\n if(__config[NODE_IS_INLINE]) {\n computedStyle[TRANSFORM_ORIGIN] = [sx1, sy1];\n return __cacheStyle[MATRIX] = mx.identity();\n }\n let matrixCache = __cacheStyle[MATRIX];\n // tx/ty变化特殊优化\n if(matrixCache && lv < REFLOW && !contain(lv, TF)) {\n let x = 0, y = 0, z = 0;\n if(contain(lv, TX)) {\n let v = currentStyle[TRANSLATE_X];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else 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 * @param lv\n * @param ctx canvas/svg/webgl共用\n * @param cache 是否是局部根节点缓存模式下的绘制\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 this.__bbox = null;\n if(isDestroyed) {\n return { isDestroyed, break: true };\n }\n let virtualDom;\n // svg设置vd上的lv属性标明lineHeight的话,另外特殊字体如arial拥有lineGap也会产生间隙,背景色不绘制这个间隙\n * x轴根据contentBox的范围坐标,y则固定和font/lineHeight相关\n * 圆角发生在首尾lineBox处,中间不会有,bgi则产生类似bgc作为mask的效果\n * 另外要注意多个时的顺序,必须依次渲染,后面的bb可能会覆盖前面行的\n */\n if(isRealInline) {\n let contentBoxList = this.contentBoxList;\n let length = contentBoxList.length;\n let hasBgi = backgroundImage.some(item => item);\n if(length) {\n let {\n [FONT_SIZE]: fontSize,\n [FONT_FAMILY]: fontFamily,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let iw = 0, ih = 0;\n let offscreen, svgBgSymbol = [];\n // bgi视作inline排满一行绘制,然后按分行拆开给每行\n if(hasBgi) {\n iw = inline.getInlineWidth(this, contentBoxList);\n ih = lineHeight;\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n iw += paddingLeft + paddingRight;\n ih += paddingTop + paddingBottom;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n iw += paddingLeft + paddingRight + borderLeftWidth + borderRightWidth;\n ih += paddingTop + paddingBottom + borderTopWidth + borderBottomWidth;\n }\n if(renderMode === CANVAS || renderMode === WEBGL) {\n offscreen = inject.getCacheCanvas(iw, ih, '__$$INLINE_BGI$$__');\n }\n let length = backgroundImage.length;\n backgroundImage.slice(0).reverse().forEach((bgi, i) => {\n if(!bgi) {\n return;\n }\n i = length - 1 - i;\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i];\n if(loadBgi.url === backgroundImage[i]) {\n let uuid = bg.renderImage(this, renderMode, offscreen && offscreen.ctx || ctx, loadBgi,\n 0, 0, iw, ih, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, true, 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.delRefreshTask(this.__loadBgi.cb);\n root.delRefreshTask(this.__task);\n this.__task = null;\n this.__root = null;\n this.clearCache();\n }\n\n // 先查找到注册了事件的节点,再捕获冒泡判断增加性能\n __emitEvent(e, force) {\n let { isDestroyed, computedStyle, isMask } = this;\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || e.__stopPropagation || isMask) {\n return;\n }\n let { event: { type } } = e;\n let { listener, __hasMask } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // touchmove之类强制的直接由Root通知即可\n if(force) {\n if(computedStyle[POINTER_EVENTS] !== 'none' && util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n // 非force的判断事件坐标是否在节点内\n if(this.willResponseEvent(e)) {\n // 如果有mask,点在mask上才行,点在clip外才行\n if(__hasMask) {\n let next = this.next;\n let isClip = next.isClip;\n let hasEmitMask;\n while(next && next.isMask) {\n if(next.willResponseEvent(e, true)) {\n hasEmitMask = true;\n break;\n }\n next = next.next;\n }\n if(!isClip && !hasEmitMask) {\n return;\n }\n }\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n\n willResponseEvent(e, ignore) {\n let { x, y } = e;\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent, computedStyle } = this;\n if(computedStyle[POINTER_EVENTS] === 'none') {\n return;\n }\n let inThis = geom.pointInQuadrilateral(\n x, y,\n __sx1, __sy1,\n __sx1 + offsetWidth, __sy1,\n __sx1 + offsetWidth, __sy1 + offsetHeight,\n __sx1, __sy1 + offsetHeight,\n matrixEvent\n );\n if(inThis) {\n if(!e.target && !ignore) {\n e.target = this;\n // 缓存target给move用\n if(e.event.type === 'touchstart') {\n this.root && (this.root.__touchstartTarget = this);\n }\n }\n return true;\n }\n }\n\n __gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi, 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(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, formatStyle);\n if(util.isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n // 传入格式化好key/value的样式\n updateFormatStyle(style, cb) {\n let node = this;\n let { root, __config } = node;\n if(root) {\n root.addRefreshTask(node.__task = {\n __before() {\n node.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(__config[NODE_IS_DESTROYED]) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n res[UPDATE_CONFIG] = __config;\n root.__addUpdate(node, __config, root, root.__config, res);\n },\n __after(diff) {\n if(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, style);\n if(util.isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n animate(list, options = {}) {\n let animation = new Animation(this, list, options);\n if(this.isDestroyed) {\n animation.__destroy(true);\n return animation;\n }\n this.animationList.push(animation);\n if(options.autoPlay === false) {\n return animation;\n }\n return animation.play();\n }\n\n removeAnimate(o) {\n if(o instanceof Animation) {\n let i = this.animationList.indexOf(o);\n if(i > -1) {\n o.cancel();\n o.__destroy();\n this.animationList.splice(i, 1);\n }\n }\n }\n\n clearAnimate() {\n this.animationList.splice(0).forEach(o => {\n o.cancel();\n o.__destroy();\n });\n }\n\n frameAnimate(cb) {\n if(util.isFunction(cb)) {\n let list = this.__frameAnimateList;\n // 防止重复\n for(let i = 0, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n return cb;\n }\n }\n let enter = {\n __after(diff) {\n cb(diff);\n },\n __karasFramecb: cb,\n };\n list.push(enter);\n frame.onFrame(enter);\n return cb;\n }\n }\n\n removeFrameAnimate(cb) {\n for(let i = 0, list = this.__frameAnimateList, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n list.splice(i, 1);\n frame.offFrame(cb);\n return;\n }\n }\n }\n\n clearFrameAnimate() {\n this.__frameAnimateList.splice(0).forEach(o => {\n frame.offFrame(o);\n });\n }\n\n __computeMeasure(renderMode, ctx, cb) {\n css.computeMeasure(this);\n if(util.isFunction(cb)) {\n cb(this);\n }\n }\n\n __deepScan(cb, options) {\n return cb(this, options);\n }\n\n // isLayout为false时,为relative/margin/flex/vertical等\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.__layoutData.x += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sx1 += diff;\n this.__sx2 += diff;\n this.__sx3 += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.__layoutData.y += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sy1 += diff;\n this.__sy2 += diff;\n this.__sy3 += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n }\n\n __resizeX(diff, lv) {\n this.computedStyle.width = this.__width += diff;\n this.__clientWidth += diff;\n this.__offsetWidth += diff;\n this.__outerWidth += diff;\n this.__layoutData.w += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __resizeY(diff, lv) {\n this.computedStyle.height = this.__height += diff;\n this.__clientHeight += diff;\n this.__offsetHeight += diff;\n this.__outerHeight += diff;\n this.__layoutData.h += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __spreadBbox(boxShadow) {\n let ox = 0, oy = 0;\n if(Array.isArray(boxShadow)) {\n boxShadow.forEach(item => {\n let [x, y, sigma, spread, , inset] = item;\n if(inset !== 'inset') {\n let d = blur.outerSize(sigma);\n d += spread;\n ox = Math.max(ox, x + d);\n oy = Math.max(oy, y + d);\n }\n });\n }\n return [ox, oy];\n }\n\n __releaseWhenEmpty(__cache) {\n if(__cache && __cache.available) {\n __cache.release();\n }\n return true;\n }\n\n getComputedStyle(key) {\n let computedStyle = this.computedStyle;\n let res = {};\n let keys;\n if(key) {\n if(Array.isArray(key)) {\n keys = key;\n }\n else {\n keys = [key];\n }\n keys = keys.map(s => {\n return STYLE_KEY[style2Upper(s)];\n });\n }\n else {\n keys = Object.keys(computedStyle);\n }\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n res[k] = computedStyle[k];\n }\n else {\n res[STYLE_RV_KEY[k]] = computedStyle[k];\n }\n });\n return res;\n }\n\n getBoundingClientRect() {\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent } = this;\n let p1 = point2d(mx.calPoint([__sx1, __sy1], matrixEvent));\n let p2 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1], matrixEvent));\n let p3 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1 + offsetHeight], matrixEvent));\n let p4 = point2d(mx.calPoint([__sx1, __sy1 + offsetHeight], matrixEvent));\n return {\n left: Math.min(p1[0], Math.min(p2[0], Math.min(p3[0], p4[0]))),\n top: Math.min(p1[1], Math.min(p2[1], Math.min(p3[1], p4[1]))),\n right: Math.max(p1[0], Math.max(p2[0], Math.max(p3[0], p4[0]))),\n bottom: Math.max(p1[1], Math.max(p2[1], Math.max(p3[1], p4[1]))),\n points: [p1, p2, p3, p4],\n };\n }\n\n // img和geom返回false,在inline布局时判断是否是真的inline\n __isRealInline() {\n return true;\n }\n\n remove(cb) {\n let self = this;\n if(self.isDestroyed) {\n inject.warn('Remove target is destroyed.');\n if(util.isFunction(cb)) {\n cb();\n }\n return;\n }\n let { root, domParent } = self;\n let target = self.isShadowRoot ? self.hostRoot : self;\n // 特殊情况连续append/remove时候,还未被添加进来找不到所以无需删除\n if(domParent.children.indexOf(target) === -1) {\n if(util.isFunction(cb)) {\n cb();\n }\n return;\n }\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n let pJson = domParent.__json;\n let i = pJson.children.indexOf(self.isShadowRoot ? self.hostRoot.__json : self.__json);\n let zChildren = domParent.zIndexChildren;\n let j = zChildren.indexOf(self.isShadowRoot ? self.hostRoot : self);\n if(i === -1 || j === -1) {\n throw new Error('Remove index Exception.')\n }\n pJson.children.splice(i, 1);\n domParent.children.splice(i, 1);\n zChildren.splice(j, 1);\n if(self.__prev) {\n self.__prev.__next = self.__next;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_REMOVE_DOM] = true;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after(diff) {\n self.isShadowRoot ? self.hostRoot.__destroy() : self.__destroy();\n if(util.isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get sx() {\n return this.__sx;\n }\n\n get sy() {\n return this.__sy;\n }\n\n get clientWidth() {\n return this.__clientWidth || 0;\n }\n\n get clientHeight() {\n return this.__clientHeight || 0;\n }\n\n get offsetWidth() {\n return this.__offsetWidth || 0;\n }\n\n get offsetHeight() {\n return this.__offsetHeight || 0;\n }\n\n get outerWidth() {\n return this.__outerWidth || 0;\n }\n\n get outerHeight() {\n return this.__outerHeight || 0;\n }\n\n // 不考虑margin的范围,>=REPAINT渲染或个别有影响的渲染改变(如blur)清空缓存\n get bbox() {\n if(!this.__bbox) {\n let {\n __sx1, __sy1, clientWidth, clientHeight,\n currentStyle: {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BOX_SHADOW]: boxShadow,\n },\n } = this;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n clientWidth += borderLeftWidth[0] + borderRightWidth[0];\n clientHeight += borderTopWidth[0] + borderBottomWidth[0];\n let half = 1;\n this.__bbox = [__sx1 - ox - half, __sy1 - oy - half, __sx1 + clientWidth + ox + half, __sy1 + clientHeight + oy + half];\n }\n return this.__bbox;\n }\n\n get listener() {\n return this.__listener;\n }\n\n get matrix() {\n return this.__config[NODE_MATRIX];\n }\n\n get matrixEvent() {\n return this.__config[NODE_MATRIX_EVENT];\n }\n\n get perspectiveMatrix() {\n return this.__config[NODE_PERSPECTIVE_MATRIX];\n }\n\n get style() {\n return this.__style;\n }\n\n get computedStyle() {\n return this.__computedStyle;\n }\n\n get animationList() {\n return this.__animationList;\n }\n\n get currentStyle() {\n return this.__currentStyle;\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get contentBoxList() {\n return this.__contentBoxList;\n }\n\n get baseLine() {\n return this.offsetHeight;\n }\n\n get firstBaseLine() {\n return this.offsetHeight;\n }\n\n get isMask() {\n return this.__isMask;\n }\n\n get isClip() {\n return this.__isClip;\n }\n\n 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 n = this.baseLine;\n // 只有1个也需要对齐,因为可能内嵌了空inline使得baseLine发生变化\n if(this.list.length) {\n this.list.forEach(item => {\n let m = item.baseLine;\n if(m !== n) {\n item.__offsetY(n - m);\n }\n });\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n /**\n * 防止非行首空inline,每当遇到inline就设置当前lineBox的lineHeight/baseLine,这样有最小值兜底\n * @param l\n * @param b\n * @private\n */\n __setLB(l, b) {\n this.__lineHeight = Math.max(l, this.__lineHeight);\n this.__baseLine = Math.max(b, this.__baseLine);\n }\n\n get list() {\n return this.__list;\n }\n\n get size() {\n return this.__list.length;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endY() {\n return this.y + this.height;\n }\n\n get width() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let first = list[0];\n let last = list[length - 1];\n let x1 = first.x;\n let dom = first instanceof TextBox ? first.parent.domParent : first.domParent;\n // 因为inline可以嵌套inline,所以一直向上查找到非inline为止,每层inline如果是首个则减去左侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [PADDING_LEFT]: paddingLeft,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[0]) {\n x1 -= marginLeft + borderLeftWidth + paddingLeft;\n }\n dom = dom.domParent;\n }\n let x2 = last.x + last.outerWidth;\n dom = last instanceof TextBox ? last.parent.domParent : last.domParent;\n // 同向上查非inline,每层inline如果是最后一个则加上右侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_RIGHT]: paddingRight,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[list.length - 1]) {\n x2 += marginRight + borderRightWidth + paddingRight;\n }\n dom = dom.domParent;\n }\n return x2 - x1;\n }\n return 0;\n }\n\n get height() {\n return this.lineHeight;\n }\n\n get baseLine() {\n let baseLine = 0;\n this.list.forEach(item => {\n baseLine = Math.max(baseLine, item.baseLine);\n });\n return Math.max(this.__baseLine, baseLine);\n }\n\n get lineHeight() {\n let lineHeight = 0;\n // 只有TextBox和InlineBlock\n this.list.forEach(item => {\n lineHeight = Math.max(lineHeight, item.outerHeight);\n });\n return Math.max(this.__lineHeight, lineHeight);\n }\n}\n\nexport default LineBox;\n","import LineBox from './LineBox';\n\n/**\n * 维护一个上下文的LineBox,向LineBox中添加Item以及新增下一行的LineBox,多个LineBox组成一个区域\n * 一个block/inlineBlock拥有一个本类对象,上下文即对应这个dom流,而inline则复用最近非inline父元素的\n * 同时LineBox可能连续也可能不连续,不连续的是中间有block之类的隔离开来\n */\nclass LineBoxManager {\n constructor(x, y, lineHeight, baseLine) {\n this.__x = this.__lastX = x; // last存储目前最后一行LineBox的结尾位置,供后续inline使用\n this.__y = this.__lastY = y;\n this.__maxX = x;\n this.__domList = [];\n this.__domStack = [];\n this.__list = []; // 包含若干LineBox\n this.__isNewLine = true; // 区域内是否是新行,容器dom(block)开头肯定是\n this.__lineHeight = lineHeight;\n this.__baseLine = baseLine;\n this.__isEnd = true; // 在dom中是否一个区域处在结尾,外部控制\n }\n\n /**\n * 每次换行时重新生成LineBox存入列表,同时由于flow流当前一定是流(dom)的结尾,设置isEnd\n * @returns {LineBox}\n */\n genLineBox(x, y) {\n let lineBox = new LineBox(x, y, this.__lineHeight, this.__baseLine);\n this.list.push(lineBox);\n this.__isEnd = true;\n return lineBox;\n }\n\n /**\n * inline的特殊调用,防止空内容但有mbp的inline不占位,放入一个有lineHeight的空lineBox\n * 只有新行开头时需要,后面的无论是否有内容都会影响lineHeight\n * @param x\n * @param y\n * @param l\n * @param b\n * @returns {LineBox}\n */\n genLineBoxByInlineIfNewLine(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseLine = Math.max(this.__baseLine, b);\n if(this.__isNewLine) {\n let lineBox = new LineBox(x, y, lineHeight, baseLine);\n this.list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n }\n\n setLbOrGenLineBoxByInline(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseLine = Math.max(this.__baseLine, b);\n let lineBox;\n let list = this.list;\n if(this.__isNewLine) {\n lineBox = new LineBox(x, y, lineHeight, baseLine);\n list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n else {\n let length = list.length;\n lineBox = list[length - 1];\n lineBox.__setLB(l, b);\n }\n }\n\n /**\n * 外部设置为结尾,如一个LineBox后出现一个block,此时会被隔断,不再作为流的末尾\n */\n setNotEnd() {\n this.__isEnd = false;\n }\n\n /**\n * 外部设置新行,下次新生成LineBox\n */\n setNewLine() {\n this.__isNewLine = true;\n }\n\n /**\n * 当前LineBox放入一个新项,当新行时(如第一行)产生一个新的LineBox并存入列表\n * 是否新区域和新行都是可以被外部控制,默认第一行是新\n * 当被隔断后会被外部重置新行,这样会生成新的来作为新加项的LineBox\n * 当换行时外部也会调用新行,这样再次添加Item时会自动生成新的LineBox而不是用之前的\n * @param o TextBox/Inline/InlineBlock\n * @param nextNewLine 是否设置newLine,标明下次添加新生成LineBox\n * @returns {LineBox}\n */\n addItem(o, nextNewLine) {\n let lineBox;\n if(this.__isNewLine) {\n this.__isNewLine = false;\n lineBox = this.genLineBox(o.x, o.y);\n }\n else {\n let list = this.list;\n let length = list.length;\n lineBox = list[length - 1];\n }\n // inline递归过程中所有inline父子顺序列表,每个dom都需要对当前内容保存\n this.__domStack.forEach(item => {\n item.__contentBoxList.push(o);\n });\n lineBox.add(o);\n // 设置结束x的位置给next的inline标记用,o可能是TextBox或inlineBlock,当next新行时注意位置\n if(nextNewLine) {\n this.__isNewLine = true;\n this.__lastX = o.x;\n this.__lastY = o.y + o.outerHeight;\n }\n else {\n this.__lastX = o.x + o.outerWidth;\n this.__lastY = o.y;\n }\n this.__maxX = Math.max(this.__maxX, o.x + o.outerWidth);\n return lineBox;\n }\n\n horizonAlign(w, textAlign) {\n this.list.forEach(lineBox => {\n let diff = w - lineBox.width;\n if(diff > 0) {\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n lineBox.__offsetX(diff);\n lineBox.list.forEach(item => {\n item.__offsetX(diff, true);\n });\n }\n });\n }\n\n verticalAlign() {\n this.list.forEach(lineBox => {\n lineBox.verticalAlign();\n });\n }\n\n addX(n) {\n this.__lastX += n;\n }\n\n /**\n * inline递归过程中布局调用,不断出入栈dom对象,获取当前行状态下有哪些dom还在\n * @param dom\n */\n pushContentBoxList(dom) {\n this.__domList.push(dom);\n this.__domStack.push(dom);\n }\n\n popContentBoxList() {\n this.__domStack.pop();\n }\n\n __offsetX(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetX(diff);\n });\n }\n\n __offsetY(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetY(diff);\n });\n }\n\n /**\n * inline的特殊调用,非行首无论是否有内容都设置lineBox的lineHeight\n * @param l\n * @param b\n * @private\n */\n setLbByInlineIfNotNewLine(l, b) {\n let length = this.list.length;\n if(length && !this.isNewLine) {\n this.list[length - 1].__setLB(l, b);\n }\n }\n\n get size() {\n return this.list.length;\n }\n\n get lastX() {\n return this.__lastX;\n }\n\n get lastY() {\n return this.__lastY;\n }\n\n get endY() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[length - 1].endY;\n }\n return this.__y;\n }\n\n get isEnd() {\n return this.__isEnd;\n }\n\n get isNewLine() {\n return this.__isNewLine;\n }\n\n get breakLine() {\n return this.list.length > 1;\n }\n\n get domList() {\n return this.__domList;\n }\n\n get baseLine() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let n = 0;\n for(let i = 0; i < length - 1; i++) {\n n += list[i].height;\n }\n return n + list[length - 1].baseLine;\n }\n return 0;\n }\n\n get firstBaseLine() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[0].baseLine;\n }\n return 0;\n }\n\n get lineHeight() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1].lineHeight;\n }\n return 0;\n }\n\n get lineBox() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1];\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get width() {\n let w = 0;\n this.list.forEach(item => {\n w = Math.max(w, item.width);\n });\n return w;\n }\n}\n\nexport default LineBoxManager;\n","const TAG_NAME = {\n 'div': true,\n 'p': true,\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst INLINE = {\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst BOLD = {\n 'b': true,\n 'strong': true,\n}\n\nexport default {\n TAG_NAME,\n INLINE,\n BOLD,\n};\n","import enums from '../util/enums';\nimport unit from '../style/unit';\nimport level from './level';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n TOP,\n BOTTOM,\n POSITION,\n HEIGHT,\n },\n} = enums;\nconst { AUTO, PX, PERCENT } = unit;\nconst { REFLOW } = level;\n\nfunction offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) {\n if(dy) {\n let last;\n do {\n // component的sr没有next兄弟,视为component的next\n while(node.isShadowRoot) {\n node = node.host;\n }\n last = node;\n let isContainer, parent = node.domParent;\n if(parent) {\n let cs = parent.computedStyle;\n let ps = cs[POSITION];\n isContainer = parent === root || parent.isShadowRoot || ps === 'relative' || ps === 'absolute';\n }\n // 先偏移next,忽略有定位的absolute,本身非container也忽略\n let next = node.next;\n let container;\n while(next) {\n if(next.currentStyle[DISPLAY] !== 'none') {\n if(next.currentStyle[POSITION] === 'absolute') {\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = next.currentStyle;\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO || bottom[1] === PX) {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n }\n else if(top[1] === PERCENT) {\n let v = top[0] * 0.01 * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, null, next);\n }\n else {\n if(!container) {\n container = parent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, next]);\n }\n }\n }\n else {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n }\n next = next.next;\n }\n // root本身没domParent\n if(!parent) {\n break;\n }\n node = parent;\n // parent判断是否要resize\n let { currentStyle } = node;\n let isAbs = currentStyle[POSITION] === 'absolute';\n let need;\n if(isAbs) {\n if(currentStyle[HEIGHT][1] === AUTO\n && (currentStyle[TOP][1] === AUTO || currentStyle[BOTTOM][1] === AUTO)) {\n need = true;\n }\n }\n // height不定则需要\n else if(currentStyle[HEIGHT][1] === AUTO) {\n need = true;\n }\n if(need) {\n node.__resizeY(dy, REFLOW);\n node.clearCache();\n }\n // abs或者高度不需要继续向上调整提前跳出\n else {\n break;\n }\n if(node === root) {\n break;\n }\n }\n while(true);\n // 最后一个递归向上取消总缓存,防止过程中重复next多次无用递归\n while(last) {\n last.clearCache(true);\n last = last.domParent;\n }\n }\n}\n\nfunction clearUniqueReflowId(hash) {\n for(let i in hash) {\n if(hash.hasOwnProperty(i)) {\n let { node } = hash[i];\n delete node.__uniqueReflowId;\n }\n }\n}\n\nfunction getMergeMarginTB(topList, bottomList) {\n let total = 0;\n let max = topList[0];\n let min = topList[0];\n topList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n bottomList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n // 正数取最大,负数取最小,正负则相加\n let diff = 0;\n if(max > 0 && min > 0) {\n diff = Math.max(max, min) - total;\n }\n else if(max < 0 && min < 0) {\n diff = Math.min(max, min) - total;\n }\n else if(max !== 0 || min !== 0) {\n diff = max + min - total;\n }\n return diff;\n}\n\nexport default {\n offsetAndResizeByNodeOnY,\n clearUniqueReflowId,\n getMergeMarginTB,\n};\n","import Xom from './Xom';\nimport Text from './Text';\nimport mode from './mode';\nimport LineBoxManager from './LineBoxManager';\nimport Component from './Component';\nimport tag from './tag';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport $$type from '../util/$$type';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport reflow from '../refresh/reflow';\nimport builder from '../util/builder';\nimport level from '../refresh/level';\n\nconst {\n STYLE_KEY: {\n POSITION,\n DISPLAY,\n FONT_WEIGHT,\n MARGIN_LEFT,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n PADDING_LEFT,\n PADDING_BOTTOM,\n PADDING_RIGHT,\n PADDING_TOP,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n TOP,\n RIGHT,\n BOTTOM,\n LEFT,\n WIDTH,\n HEIGHT,\n TEXT_ALIGN,\n FLEX_DIRECTION,\n FLEX_BASIS,\n FLEX_SHRINK,\n FLEX_GROW,\n ALIGN_SELF,\n ALIGN_ITEMS,\n JUSTIFY_CONTENT,\n Z_INDEX,\n WHITE_SPACE,\n LINE_HEIGHT,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n OVERFLOW,\n FONT_SIZE,\n // PERSPECTIVE,\n // TRANSFORM,\n },\n NODE_KEY: {\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_STRUCT,\n NODE_DOM_PARENT,\n NODE_IS_INLINE,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_ADD_DOM,\n UPDATE_CONFIG,\n UPDATE_MEASURE,\n },\n STRUCT_KEY: {\n STRUCT_NUM,\n STRUCT_LV,\n STRUCT_TOTAL,\n STRUCT_CHILD_INDEX,\n STRUCT_INDEX,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH, 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 // 只绝对值生效,%不生效,依旧要判断\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 if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n }\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n else if(display === 'block') {\n let countMin = 0, countMax = 0;\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n countMin = countMax = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n }\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n else {\n if(display === 'inlineBlock' || display === 'inline-block') {\n lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n }\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n if(isDirectionRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else if(isDirectionRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n });\n }\n }\n return [display, this.__addMp(isDirectionRow, w, currentStyle, [min, max])];\n }\n\n /**\n * flex布局时,计算basis尺寸,如果有固定声明则以其为标准,content为内容最大尺寸,auto依赖w/h或降级content\n * basis要考虑相加直接item的mpb,非绝对值单位以container为基准,basis为内容时为max值\n * item的孩子为孙子节点需递归,不参与basis计算,只参与min/max,尺寸和mpb均只考虑绝对值\n * 自动计算时影响尺寸的只有换行的text,以及一组inline,均按其中最大尺寸的一个计算\n * auto自动计算递归进行,如果是普通row方向,按最大text的charWidth为准\n * 如果是column方向,则虚拟布局后看text的height\n * 在abs下时进入特殊状态,无论是row/column,都会按row方向尝试最大尺寸,直到舞台边缘或容器声明的w折行\n * 返回b,声明则按css值,否则是auto/content\n * 返回min为最小宽度,遇到字符/inline则单列排版后需要的最大宽度\n * 返回max为最大宽度,理想情况一排最大值,在abs时isVirtual状态参与计算,文本抵达边界才进行换行\n * @param isDirectionRow\n * @param data\n * @param isVirtual abs非固定尺寸时先进行虚拟布局标识\n * @private\n */\n __calBasis(isDirectionRow, data, isVirtual) {\n css.computeReflow(this, this.isShadowRoot);\n let b = 0;\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h } = data;\n // 计算需考虑style的属性\n let {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n [FLEX_BASIS]: flexBasis,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content\n let isAuto = flexBasis[1] === AUTO;\n let isFixed = [PX, PERCENT, REM, VW, VH, 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 // flex的item还是flex时\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n }\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n // flex的item是block/inline时,inline也会变成block统一对待\n else {\n let countMin = 0, countMax = 0;\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n countMin = countMax = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n }\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n if(fixedSize) {\n max = Math.max(fixedSize, max);\n }\n if(isContent) {\n b = max;\n }\n // 直接item的mpb影响basis\n return this.__addMp(isDirectionRow, w, currentStyle, [b, min, max], true);\n }\n\n __layoutNone() {\n super.__layoutNone();\n let { children } = this;\n children.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n item.__layoutNone();\n }\n });\n }\n\n /**\n * block布局,本身固定尺寸优先,否则看内容从上往下从左往右flow流排布\n * 内部inline和inlineBlock组成LineBox,通过LineBoxManager来管理混排的现象\n * LineBoxManager只有block和inlineBlock内部生成,inline会复用最近父级的\n * 内部的block在垂直方向要考虑margin合并的问题,强制所有节点为bfc,精简逻辑\n * @param data\n * @param isVirtual abs无尺寸时提前虚拟布局计算尺寸\n * @private\n */\n __layoutBlock(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n // 虚线管理一个block内部的LineBox列表,使得inline的元素可以中途衔接处理折行\n // 内部维护inline结束的各种坐标来达到目的,遇到block时中断并处理换行坐标\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n // 因精度问题,统计宽度均从0开始累加每行,最后取最大值,仅在abs布局时isVirtual生效\n let maxW = 0;\n let cw = 0;\n // 连续block(flex相同,下面都是)的上下margin合并值记录,合并时从列表中取\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isImg = item.tagName === 'img';\n // 每次循环开始前,这次不是block的话,看之前遗留待合并margin,并重置\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n if(isXom) {\n // inline和inlineBlock的细节不同之处,ib除了w/h之外,更想像block一样占据一行\n // 比如2个inline前面占一半后面比一半多但还是会从一半开始然后第2行换行继续,但ib放不下则重开一行\n // inline和ib能互相嵌套,形成的LineBox中则是TextBox和节点混合\n if(isInlineBlock || isInline) {\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || isInline && whiteSpace === 'nowrap') {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager, // ib内部新生成会内部判断,这里不管统一传入\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样\n if(item.__isIbFull) {\n x = data.x;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // abs统计宽度\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下,内部判断了inline/ib,ib要考虑是否有width\n let fw = item.__tryLayInline(w + data.x - x, w);\n // 放得下继续,奇怪的精度问题,加上阈值\n if(fw >= (-1e-10)) {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n x = data.x;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n if(isVirtual) {\n cw += item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n // block/flex先处理之前可能遗留的最后一行LineBox,然后递归时不传lineBoxManager,其内部生成新的\n else {\n // 非开头,说明之前的text未换行,需要增加行数\n if(x !== data.x && flowChildren[i - 1] instanceof Text) {\n lineClampCount++;\n }\n x = data.x;\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n let isNone = item.currentStyle[DISPLAY] === 'none';\n // 自身无内容\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n y += item.outerHeight;\n lineBoxManager.__lastY = y;\n // absolute/flex前置虚拟计算\n if(isVirtual) {\n maxW = Math.max(maxW, item.outerWidth);\n cw = 0;\n }\n // 空block要留下轮循环看,除非是最后一个,此处非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n item.__offsetY(diff, true);\n y += diff;\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n }\n }\n // 文字和inline类似\n else {\n // lineClamp作用域为block下的inline(同LineBox上下文)\n if(lineClamp && lineClampCount >= lineClamp) {\n return;\n }\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.width;\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x);\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, item.width);\n cw = 0;\n }\n }\n if(isVirtual) {\n cw += item.width;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n });\n // 结束后如果是以LineBox结尾,则需要设置y到这里,否则流布局中block会设置\n // 当以block换行时,新行是true,否则是false即结尾\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n }\n let tw = this.__width = (fixedWidth || !isVirtual) ? w : maxW;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // 非abs提前的虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐\n if(!isVirtual) {\n lineBoxManager.verticalAlign();\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // 所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n this.__marginAuto(currentStyle, data);\n }\n }\n\n // 弹性布局时的计算位置\n __layoutFlex(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle, __flexLine } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n // 每次布局情况多行内容\n __flexLine.splice(0);\n let {\n [FLEX_DIRECTION]: flexDirection,\n [JUSTIFY_CONTENT]: justifyContent,\n [ALIGN_ITEMS]: alignItems,\n [LINE_CLAMP]: lineClamp,\n [FLEX_WRAP]: flexWrap,\n [ALIGN_CONTENT]: alignContent,\n [LINE_HEIGHT]: lineHeight,\n [TEXT_ALIGN]: textAlign,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n let maxX = 0;\n let isDirectionRow = ['column', 'column-reverse', 'columnReverse'].indexOf(flexDirection) === -1;\n // 计算伸缩基数\n let growList = [];\n let shrinkList = [];\n let basisList = [];\n let maxList = [];\n let minList = [];\n let orderChildren = genOrderChildren(flowChildren);\n orderChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n // abs虚拟布局计算时纵向也是看横向宽度\n let [b, min, max] = item.__calBasis(isVirtual ? true : isDirectionRow, { x, y, w, h }, isVirtual);\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += max;\n }\n else {\n maxX = Math.max(maxX, max);\n }\n return;\n }\n let { [FLEX_GROW]: flexGrow, [FLEX_SHRINK]: flexShrink } = currentStyle;\n computedStyle[FLEX_BASIS] = b;\n growList.push(flexGrow);\n shrinkList.push(flexShrink);\n // 根据basis不同,计算方式不同\n basisList.push(b);\n maxList.push(max);\n minList.push(min);\n }\n // 文本\n else {\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += item.textWidth;\n }\n else {\n maxX = Math.max(maxX, item.textWidth);\n }\n return;\n }\n growList.push(0);\n shrinkList.push(1);\n if(isDirectionRow) {\n let cw = item.charWidth;\n let tw = item.textWidth;\n basisList.push(tw);\n maxList.push(tw);\n minList.push(cw);\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n });\n let h = item.height;\n basisList.push(h);\n minList.push(h);\n }\n }\n });\n // abs时,只需关注宽度即可,无需真正布局\n if(isVirtual) {\n let tw = this.__width = Math.min(maxX, w);\n this.__ioSize(tw, this.height);\n return;\n }\n let containerSize = isDirectionRow ? w : h;\n let isMultiLine = flexWrap === 'wrap' || ['wrap-reverse', 'wrapReverse'].indexOf(flexWrap) > -1;\n /**\n * 判断是否需要分行,根据假设主尺寸来统计尺寸和计算,假设主尺寸是clamp(min_main_size, flex_base_size, max_main_size)\n * 当多行时,由于每行一定有最小限制,所以每行一般情况都不是shrink状态,\n * 但也有极端情况,比如一行只能放下1个元素时,且此元素比容器小,会是shrink\n */\n let line = [], sum = 0, hypotheticalList = [];\n basisList.forEach((item, i) => {\n let min = minList[i], max = maxList[i];\n let hypothetical;\n if(item < min) {\n hypothetical = min;\n }\n else if(item > max) {\n hypothetical = max;\n }\n else {\n hypothetical = item;\n }\n hypotheticalList.push(hypothetical);\n if(isMultiLine) {\n // 超过尺寸时,要防止sum为0即1个也会超过尺寸\n if(sum + hypothetical > containerSize) {\n if(sum) {\n __flexLine.push(line);\n line = [orderChildren[i]];\n sum = hypothetical;\n }\n else {\n line.push(orderChildren[i]);\n __flexLine.push(line);\n line = [];\n sum = 0;\n }\n }\n else {\n line.push(orderChildren[i]);\n sum += hypothetical;\n }\n }\n else {\n line.push(orderChildren[i]);\n }\n });\n if(line.length) {\n __flexLine.push(line);\n }\n let offset = 0, clone = { x, y, w, h };\n let maxCrossList = [];\n __flexLine.forEach(item => {\n let length = item.length;\n let end = offset + length;\n let [x1, y1, maxCross] = this.__layoutFlexLine(clone, isDirectionRow, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, orderChildren.slice(offset, end), item, textAlign,\n growList.slice(offset, end), shrinkList.slice(offset, end), basisList.slice(offset, end),\n hypotheticalList.slice(offset, end), minList.slice(offset, end));\n // 下一行/列更新坐标\n if(isDirectionRow) {\n clone.y = y1;\n }\n else {\n clone.x = x1;\n }\n x = Math.max(x, x1);\n y = Math.max(y, y1);\n maxCrossList.push(maxCross);\n offset += length;\n });\n let tw = this.__width = w;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // flexDirection当有reverse时交换每line的主轴序\n if(flexDirection === 'row-reverse' || flexDirection === 'rowReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = tw - item.outerWidth - (item.x - data.x) * 2;\n if(diff) {\n item.__offsetX(diff, true);\n }\n });\n });\n }\n else if(flexDirection === 'column-reverse' || flexDirection === 'columnReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = th - item.outerHeight - (item.y - data.y) * 2;\n if(diff) {\n item.__offsetY(diff, true);\n }\n });\n });\n }\n // wrap-reverse且多轴线时交换轴线序,需要2行及以上才行\n let length = __flexLine.length;\n if(['wrapReverse', 'wrap-reverse'].indexOf(flexWrap) > -1 && length > 1) {\n let crossSum = 0, crossSumList = [];\n maxCrossList.forEach(item => {\n crossSumList.push(crossSum);\n crossSum += item;\n });\n let count = 0;\n for(let i = length - 1; i >= 0; i--) {\n let line = __flexLine[i];\n let source = crossSumList[i];\n let diff = count - source;\n if(diff) {\n line.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n count += maxCrossList[i];\n }\n __flexLine.reverse();\n }\n // 侧轴对齐分flexLine做,要考虑整体的alignContent的stretch和每行的alignItems的stretch\n // 先做整体的,得出交叉轴空白再均分给每一行做单行的,整体的只有1行忽略\n let per;\n if(!isVirtual && length > 1 && (fixedHeight && isDirectionRow || !isDirectionRow)) {\n let diff = isDirectionRow ? th - (y - data.y) : tw - (x - data.x);\n // 有空余时才进行对齐\n if(diff > 0) {\n if(alignContent === 'center') {\n let per = diff * 0.5;\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per, true);\n }\n else {\n item.__offsetX(per, true);\n }\n });\n }\n else if(alignContent === 'flex-start' || alignContent === 'flexStart') {}\n else if(alignContent === 'flex-end' || alignContent === 'flexEnd') {\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n else if(alignContent === 'space-between' || alignContent === 'spaceBetween') {\n let between = diff / (length - 1);\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(between, true);\n }\n else {\n item.__offsetX(between, true);\n }\n });\n }\n });\n }\n else if(alignContent === 'space-around' || alignContent === 'spaceAround') {\n let around = diff / (length + 1);\n __flexLine.forEach((item, i) => {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(around * (i + 1), true);\n }\n else {\n item.__offsetX(around * (i + 1), true);\n }\n });\n });\n }\n // 默认stretch\n else {\n per = diff / length;\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per * i, true);\n }\n else {\n item.__offsetX(per * i, true);\n }\n });\n }\n });\n }\n }\n }\n // 每行再进行cross对齐,在alignContent为stretch时计算每行的高度\n if(!isVirtual) {\n if(length > 1) {\n __flexLine.forEach((item, i) => {\n let maxCross = maxCrossList[i];\n if(per) {\n maxCross += per;\n }\n this.__crossAlign(item, alignItems, isDirectionRow, maxCross);\n });\n }\n else if(length) {\n let maxCross = maxCrossList[0];\n if(isDirectionRow) {\n if(fixedHeight) {\n maxCross = h;\n }\n }\n else {\n maxCross = w;\n }\n this.__crossAlign(__flexLine[0], alignItems, isDirectionRow, maxCross);\n }\n }\n this.__marginAuto(currentStyle, data);\n }\n\n /**\n * 计算获取子元素的b/min/max完毕后,尝试进行flex每行布局\n * https://www.w3.org/TR/css-flexbox-1/#layout-algorithm\n * 假想主尺寸,其为clamp(min_main_size, flex_base_size, max_main_size)\n * 随后按算法一步步来 https://zhuanlan.zhihu.com/p/354567655\n * 规范没提到mpb,item的要计算,孙子的只考虑绝对值\n * 先收集basis和假设主尺寸\n */\n __layoutFlexLine(data, isDirectionRow, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, orderChildren, flexLine, textAlign,\n growList, shrinkList, basisList, hypotheticalList, minList) {\n let { x, y, w, h } = data;\n let hypotheticalSum = 0;\n hypotheticalList.forEach(item => {\n hypotheticalSum += item;\n });\n // 根据假设尺寸确定使用grow还是shrink,冻结非弹性项并设置target尺寸,确定剩余未冻结数量\n let isOverflow = hypotheticalSum >= containerSize;\n let targetMainList = [];\n basisList.forEach((item, i) => {\n if(isOverflow) {\n if(!shrinkList[i] || (basisList[i] < hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n else {\n if(!growList[i] || (basisList[i] > hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n });\n // 初始可用空间,冻结使用确定的target尺寸,未冻结使用假想\n let free = 0;\n basisList.forEach((item, i) => {\n if(targetMainList[i] !== undefined) {\n free += targetMainList[i];\n }\n else {\n free += item;\n }\n });\n let total = Infinity;\n if(isDirectionRow) {\n total = w;\n }\n else if(fixedHeight) {\n total = h;\n }\n else {\n total = free;\n }\n free = Math.abs(total - free);\n // 循环,文档算法不够简练,其合并了grow和shrink,实际拆开写更简单\n let factorSum = 0;\n if(isOverflow) {\n // 计算真正的因子占比,同时得出缩小尺寸数值\n // 还需判断每个item收缩不能 {\n if(targetMainList[i] === undefined) {\n let n = item * basisList[i];\n factorSum += n;\n return n;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要收缩的尺寸\n let n = basisList[i] - s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n else {\n let factorList = growList.map((item, i) => {\n if(targetMainList[i] === undefined) {\n factorSum += item;\n return item;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要扩展的尺寸\n let n = basisList[i] + s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n let maxCross = 0;\n let lbmList = [];\n orderChildren.forEach((item, i) => {\n let main = targetMainList[i];\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n if(isDirectionRow) {\n item.__layout({\n x,\n y,\n w: main,\n h,\n w3: main, // w3假设固定宽度,忽略原始style中的设置\n });\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h: main,\n h3: main, // 同w2\n });\n }\n }\n else {\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n lbmList.push(lineBoxManager);\n item.__layout({\n x,\n y,\n w: isDirectionRow ? main : w,\n h: isDirectionRow ? h : main,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n });\n }\n if(isDirectionRow) {\n x += item.outerWidth;\n maxCross = Math.max(maxCross, item.outerHeight);\n }\n else {\n y += item.outerHeight;\n maxCross = Math.max(maxCross, item.outerWidth);\n }\n });\n // 计算主轴剩余时要用真实剩余空间而不能用伸缩剩余空间\n let diff = isDirectionRow ? (w - x + data.x) : (h - y + data.y);\n // 主轴对齐方式\n if(diff > 0) {\n let len = orderChildren.length;\n if(justifyContent === 'flexEnd' || justifyContent === 'flex-end') {\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(diff, true) : child.__offsetY(diff, true);\n }\n }\n else if(justifyContent === 'center') {\n let center = diff * 0.5;\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(center, true) : child.__offsetY(center, true);\n }\n }\n else if(justifyContent === 'spaceBetween' || justifyContent === 'space-between') {\n let between = diff / (len - 1);\n for(let i = 1; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(between * i, true) : child.__offsetY(between * i, true);\n }\n }\n else if(justifyContent === 'spaceAround' || justifyContent === 'space-around') {\n let around = diff / (len + 1);\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(around * (i + 1), true) : child.__offsetY(around * (i + 1), true);\n }\n }\n }\n if(isDirectionRow) {\n y += maxCross;\n }\n else {\n x += maxCross;\n }\n // flex的直接text对齐比较特殊\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lbmList.forEach(item => {\n item.horizonAlign(item.width, textAlign);\n })\n }\n return [x, y, maxCross];\n }\n\n // 每个flexLine的侧轴对齐,单行时就是一行对齐\n __crossAlign(line, alignItems, isDirectionRow, maxCross) {\n let baseLine = 0;\n line.forEach(item => {\n baseLine = Math.max(baseLine, item.firstBaseLine);\n });\n line.forEach(item => {\n let { currentStyle: { [ALIGN_SELF]: alignSelf } } = item;\n if(isDirectionRow) {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [HEIGHT]: height } } = item;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = item.__height = computedStyle[HEIGHT] = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n else if(alignSelf === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [HEIGHT]: height,\n } } = item;\n // row的孩子还是flex且column且不定高时,如果高度<侧轴拉伸高度则重新布局\n if(isDirectionRow && display === 'flex' && flexDirection === 'column' && height[1] === AUTO && item.outerHeight < maxCross) {\n item.__layout(Object.assign(item.__layoutData, { h3: maxCross }));\n }\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n }\n }\n // column\n else {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [WIDTH]: width } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [WIDTH]: width,\n } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n }\n }\n });\n }\n\n /**\n * inline比较特殊,先简单顶部对其,后续还需根据vertical和lineHeight计算y偏移\n * inlineBlock复用逻辑,可以设置w/h,在混排时表现不同,inlineBlock换行限制在规定的矩形内,\n * 且ib会在没设置width且换行的时候撑满上一行,即便内部尺寸没抵达边界\n * 而inline换行则会从父容器start处开始,且首尾可能占用矩形不同\n * 嵌套inline情况十分复杂,尾部mpb空白可能产生叠加情况,因此endSpace表示自身,\n * 然后根据是否在最后一个元素进行叠加父元素的,多层嵌套则多层尾部叠加,均以最后一个元素为依据判断\n * Text获取这个叠加的endSpace值即可,无需感知是否最后一个,外层(此处)进行逻辑封装\n * @param data\n * @param isVirtual\n * @param isInline\n * @private\n */\n __layoutInline(data, isVirtual, isInline) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h, lx,\n lineBoxManager, nowrap, endSpace, selfEndSpace } = this.__preLayout(data, isInline);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n let {\n [WIDTH]: width,\n } = currentStyle;\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n } = computedStyle;\n let lineClampCount = data.lineClampCount || 0;\n if(isInline && !this.__isRealInline()) {\n isInline = false;\n }\n // 只有inline的孩子需要考虑换行后从行首开始,而ib不需要,因此重置行首标识lx为x,末尾空白为0\n // 而inline的LineBoxManager复用最近非inline父dom的,ib需要重新生成,末尾空白叠加\n if(isInline) {\n this.__config[NODE_IS_INLINE] = true;\n this.__lineBoxManager = lineBoxManager;\n let baseLine = css.getBaseLine(computedStyle);\n // 特殊inline调用,有内容的话(如左右mbp),默认生成一个lineBox,即便是空,也要形成占位,只有开头时需要\n if(marginLeft || marginRight\n || paddingLeft || paddingRight\n || borderLeftWidth || borderRightWidth) {\n if(lineBoxManager.isNewLine) {\n lineBoxManager.genLineBoxByInlineIfNewLine(x, y, lineHeight, baseLine);\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseLine);\n }\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseLine);\n }\n lineClamp = data.lineClamp || 0;\n }\n else {\n lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n lx = x;\n endSpace = selfEndSpace = lineClampCount = 0;\n }\n // 存LineBox里的内容列表专用,布局过程中由lineBoxManager存入,递归情况每个inline节点都保存contentBox\n let contentBoxList;\n if(isInline) {\n contentBoxList = this.__contentBoxList = [];\n lineBoxManager.pushContentBoxList(this);\n }\n let isIbFull = false; // ib时不限定w情况下发生折行则撑满行,即便内容没有撑满边界\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline2 = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock2 = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isRealInline = isXom && item.__isRealInline();\n // 最后一个元素会产生最后一行,叠加父元素的尾部mpb\n let isEnd = isInline && (i === length - 1);\n if(isEnd) {\n endSpace += selfEndSpace;\n }\n if(isXom) {\n if(!isInline2 && !isInlineBlock2) {\n item.currentStyle[DISPLAY] = item.computedStyle[DISPLAY] = 'inlineBlock';\n isInlineBlock2 = true;\n inject.warn('Inline can not contain block/flex');\n }\n // x开头,不用考虑是否放得下直接放,i为0强制不换行\n if(x === lx || !i || isInline2 && whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样\n if(item.__isIbFull) {\n isInlineBlock2 && (w[1] === AUTO) && (isIbFull = true);\n lineBoxManager.addItem(item);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中,以计算宽度\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n }\n else {\n // 不换行继续排,换行非开头先尝试是否放得下,结尾要考虑mpb因此减去endSpace\n let fw = (whiteSpace === 'nowrap') ? 0 : item.__tryLayInline(w - x + lx, w - (isEnd ? endSpace : 0));\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n nowrap: whiteSpace === 'nowrap',\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n isInline2 && lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n lineBoxManager.addItem(item);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n }\n }\n }\n // inline里的其它只有文本,可能开始紧跟着之前的x,也可能换行后从lx行头开始\n // 紧跟着x可能出现在前面有节点换行后第2行,此时不一定放得下,因此不能作为判断依据,开头仅有lx\n else {\n let n = lineBoxManager.size;\n // i为0时强制不换行\n if(x === lx || !i || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行,且非定宽\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n }\n else {\n // 非开头先尝试是否放得下,如果放得下再看是否end,加end且只有1个字时放不下要换行,否则可以放,换行由text内部做\n // 第一个Text且父元素声明了nowrap也强制不换行,非第一个则看本身whiteSpace声明\n let focusNoWrap = (!i && nowrap) || whiteSpace === 'nowrap';\n let fw = focusNoWrap ? 0 : item.__tryLayInline(w + lx - x);\n if(!focusNoWrap && fw >= 0 && isEnd && endSpace && item.content.length === 1) {\n let fw2 = fw - endSpace;\n if(fw2 < 0) {\n fw = fw2;\n }\n }\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // 这里ib放得下一定是要么没换行要么固定宽度,所以无需判断isIbFull\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n }\n }\n }\n });\n // 同block结尾,不过这里一定是lineBox结束,无需判断\n y = lineBoxManager.endY;\n // 标识ib情况同block一样占满行\n this.__isIbFull = isIbFull;\n // 元素的width在固定情况或者ibFull情况已被计算出来,否则为最大延展尺寸,inline没有固定尺寸概念\n let tw, th;\n if(isInline) {\n // inline最后的x要算上右侧mpb,为next行元素提供x坐标基准,同时其尺寸计算比较特殊\n if(selfEndSpace) {\n lineBoxManager.addX(selfEndSpace);\n }\n // 如果没有内容,空白还要加上开头即左侧mpb\n if(!flowChildren.length) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = computedStyle;\n lineBoxManager.addX(marginLeft + paddingLeft + borderLeftWidth);\n }\n // 结束出栈contentBox,递归情况结束子inline获取contentBox,父inline继续\n lineBoxManager.popContentBoxList();\n // abs非固定w时预计算,本来是最近非inline父层统一计算,但在abs时不算,\n if(isVirtual) {\n this.__inlineSize();\n }\n }\n else {\n // ib在满时很特殊,取最大值,可能w本身很小不足排下1个字符,此时要用maxW\n let maxW = lineBoxManager.__maxX - data.x;\n tw = this.__width = fixedWidth ? w : (isIbFull ? Math.max(w, maxW) : maxW);\n th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n }\n // 非abs提前虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐,inline会被父级调用这里只看ib\n if(!isVirtual && !isInline) {\n lineBoxManager.verticalAlign();\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // block的所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n }\n // inlineBlock新开上下文,但父级block遇到要处理换行\n return isInline ? lineClampCount : 0;\n }\n\n /**\n * inline的尺寸计算非常特殊,并非一个矩形区域,而是由字体行高结合节点下多个LineBox中的内容决定,\n * 且这个尺寸又并非真实LineBox中的内容直接合并计算而来,比如包含了个更大尺寸的ib却不会计入\n * 具体方法为遍历持有的LineBox下的内容,x取两侧极值,同时首尾要考虑mpb,y值取上下极值,同样首尾考虑mpb\n * 首尾行LineBox可能不是不是占满一行,比如前后都有同行inline的情况,非首尾行则肯定占满\n * 绘制内容(如背景色)的区域也很特殊,每行LineBox根据lineHeight对齐baseLine得来,并非LineBox全部\n * 当LineBox只有直属Text时如果font没有lineGap则等价于全部,如有则需减去\n * 另外其client/offset/outer的w/h尺寸计算也很特殊,皆因首尾x方向的mpb导致\n * @private\n */\n __inlineSize(tw, textAlign) {\n let { contentBoxList, computedStyle, __ox, __oy } = this;\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // x/clientX/offsetX/outerX\n let maxX, maxY, minX, minY, maxCX, maxCY, minCX, minCY, maxFX, maxFY, minFX, minFY, maxOX, maxOY, minOX, minOY;\n let length = contentBoxList.length;\n if(length) {\n // 遍历contentBox,里面存的是LineBox内容,根据父LineBox引用判断是否换行\n contentBoxList.forEach((item, i) => {\n // 非第一个除了minY不用看其它都要,minX是换行导致,而maxX在最后一个要考虑右侧mpb,中间的无需考虑嵌套inline的mpb\n if(i) {\n minX = Math.min(minX, item.x);\n minCX = Math.min(minCX, item.x);\n minFX = Math.min(minFX, item.x);\n minOX = Math.min(minOX, item.x);\n if(i === length - 1) {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n maxY = maxCY = maxFY = maxOY = Math.max(maxY, item.y + item.outerHeight);\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n else {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n }\n }\n // 第一个初始化\n else {\n minX = item.x;\n minY = item.y;\n minCX = minX - paddingLeft;\n minCY = minY - paddingTop;\n minFX = minCX - borderLeftWidth;\n minFY = minCY - borderTopWidth;\n minOX = minFX - marginLeft;\n minOY = minFY - marginTop;\n maxX = maxCX = maxFX = maxOX = item.x + item.outerWidth;\n maxY = maxCY = maxFY = maxOY = item.y + item.outerHeight;\n if(i === length - 1) {\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n }\n });\n this.__x = minOX;\n this.__y = minOY;\n this.__width = computedStyle[WIDTH] = maxX - minX;\n // 防止比自己最小高度lineHeight还小,比如内容是个小字体\n this.__height = computedStyle[HEIGHT] = Math.max(lineHeight, maxY - minY);\n this.__clientWidth = maxCX - minCX;\n this.__clientHeight = maxCY - minCY;\n this.__offsetWidth = maxFX - minFX;\n this.__offsetHeight = maxFY - minFY;\n this.__outerWidth = maxOX - minOX;\n this.__outerHeight = maxOY - minOY;\n this.__sx = minOX + __ox;\n this.__sy = minOY + __oy;\n this.__sx1 = minFX + __ox;\n this.__sy1 = minFY + __oy;\n this.__sx2 = minCX + __ox;\n this.__sy2 = minCY + __oy;\n this.__sx3 = minX + __ox;\n this.__sy3 = minY + __oy;\n this.__sx4 = maxX + __ox;\n this.__sy4 = maxY + __oy;\n this.__sx5 = maxCX + __ox;\n this.__sy5 = maxCY + __oy;\n this.__sx6 = maxFX + __ox;\n this.__sy6 = maxFY + __oy;\n // inline的text整体设置相同\n if(['center', 'right'].indexOf(textAlign) > -1) {\n this.children.forEach(item => {\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n }\n // 如果没有内容,宽度为0高度为lineHeight,对齐也特殊处理,lineBoxManager不会处理\n else {\n if(['center', 'right'].indexOf(textAlign) > -1) {\n let diff = tw;\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n if(diff) {\n this.__offsetX(diff, true);\n }\n }\n this.__width = computedStyle[WIDTH] = 0;\n let th = this.__height = computedStyle[HEIGHT] = lineHeight;\n this.__ioSize(0, th);\n this.__sy -= marginTop + paddingTop + borderTopWidth;\n this.__sx1 = this.sx + marginLeft;\n this.__sy1 = this.sy + marginTop;\n this.__sx2 = this.__sx1 + borderLeftWidth;\n this.__sy2 = this.__sy1 + borderTopWidth;\n this.__sx4 = this.__sx3 = this.__sx2 + paddingLeft;\n this.__sy4 = this.__sy3 = this.__sy2 + paddingTop;\n this.__sx5 = this.__sx4 + paddingRight;\n this.__sy5 = this.__sy4 + th + paddingBottom;\n this.__sx6 = this.__sx5 + borderRightWidth;\n this.__sy6 = this.__sy5 + borderBottomWidth;\n this.__clientWidth = this.__sx5 - this.__sx2;\n this.__clientHeight = this.__sy5 - this.__sy2;\n this.__offsetWidth = this.__sx6 - this.__sx1;\n this.__offsetHeight = this.__sy6 - this.__sy1;\n this.__outerWidth = this.__offsetWidth + marginLeft + marginRight;\n this.__outerHeight = this.__offsetHeight + marginTop + marginBottom;\n }\n }\n\n /**\n * 只针对绝对定位children布局\n * @param container\n * @param data\n * @param target 可选,只针对某个abs的child特定布局,在局部更新时用\n * @private\n */\n __layoutAbs(container, data, target) {\n let { sx: x, sy: y, clientWidth, clientHeight, computedStyle } = container;\n let { isDestroyed, children, absChildren } = this;\n let {\n [DISPLAY]: display,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n } = computedStyle;\n if(isDestroyed || display === 'none') {\n this.__layoutNone();\n return;\n }\n x += marginLeft + borderLeftWidth;\n y += marginTop + borderTopWidth;\n // 对absolute的元素进行相对容器布局\n absChildren.forEach(item => {\n if(target) {\n // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr\n let node = item;\n if(node instanceof Component) {\n node = item.shadowRoot;\n }\n // 所以得2个都对比\n if(target !== node && target !== item) {\n return;\n }\n }\n let { currentStyle, computedStyle } = item;\n if(currentStyle[DISPLAY] === 'none') {\n item.__layoutNone();\n return;\n }\n // 先根据容器宽度计算margin/padding\n item.__mp(currentStyle, computedStyle, clientWidth);\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let { [LEFT]: left, [TOP]: top, [RIGHT]: right,\n [BOTTOM]: bottom, [WIDTH]: width, [HEIGHT]: height, [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection } = currentStyle;\n let x2, y2, w2, h2;\n let onlyRight;\n let onlyBottom;\n let fixedTop;\n let fixedRight;\n let fixedBottom;\n let fixedLeft;\n // 判断何种方式的定位,比如左+宽度,左+右之类\n if(left[1] !== AUTO) {\n fixedLeft = true;\n computedStyle[LEFT] = calAbsolute(currentStyle, 'left', left, clientWidth, this.root);\n }\n else {\n computedStyle[LEFT] = 'auto';\n }\n if(right[1] !== AUTO) {\n fixedRight = true;\n computedStyle[RIGHT] = calAbsolute(currentStyle, 'right', right, clientWidth, this.root);\n }\n else {\n computedStyle[RIGHT] = 'auto';\n }\n if(top[1] !== AUTO) {\n fixedTop = true;\n computedStyle[TOP] = calAbsolute(currentStyle, 'top', top, clientHeight, this.root);\n }\n else {\n computedStyle[TOP] = 'auto';\n }\n if(bottom[1] !== AUTO) {\n fixedBottom = true;\n computedStyle[BOTTOM] = calAbsolute(currentStyle, 'bottom', bottom, clientHeight, this.root);\n }\n else {\n computedStyle[BOTTOM] = 'auto';\n }\n // 优先级最高left+right,其次left+width,再次right+width,再次仅申明单个,最次全部auto\n if(fixedLeft && fixedRight) {\n x2 = x + computedStyle[LEFT];\n w2 = x + clientWidth - computedStyle[RIGHT] - x2;\n }\n else if(fixedLeft) {\n x2 = x + computedStyle[LEFT];\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else 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 else {\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 unit from '../style/unit';\nimport image from '../style/image';\nimport border from '../style/border';\nimport enums from '../util/enums';\nimport level from '../refresh/level';\nimport mx from '../math/matrix';\n\nconst {\n STYLE_KEY: {\n WIDTH,\n HEIGHT,\n DISPLAY,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n VISIBILITY,\n BACKGROUND_IMAGE,\n BACKGROUND_COLOR,\n BOX_SHADOW,\n MIX_BLEND_MODE,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n FONT_SIZE,\n FLEX_BASIS,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_CONFIG,\n },\n NODE_KEY: {\n NODE_CACHE,\n NODE_DEFS_CACHE,\n NODE_IS_MASK,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH, 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 ctx.arc(cx, cy, r, 0, 2 * Math.PI);\n ctx.fill();\n ctx.closePath();\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for(let i = 1, len = pts.length; i < len; i++) {\n let point = pts[i];\n ctx.lineTo(point[0], point[1]);\n }\n ctx.lineTo(pts[0][0], pts[0][1]);\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n this.__addGeom('rect', [\n ['x', originX],\n ['y', originY],\n ['width', width],\n ['height', height],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ['fill', 'rgba(0,0,0,0)']\n ]);\n this.__addGeom('circle', [\n ['cx', cx],\n ['cy', cy],\n ['r', r],\n ['fill', fill],\n ]);\n let s = '';\n for(let i = 0, len = pts.length; i < len; i++) {\n let point = pts[i];\n if(i) {\n s += ' ';\n }\n s += point[0] + ',' + point[1];\n }\n this.__addGeom('polygon', [\n ['points', s],\n ['fill', fill]\n ]);\n }\n }\n else if(source) {\n // 圆角需要生成一个mask\n let list = border.calRadius(originX, originY, width, height,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n // 有border-radius需模拟遮罩裁剪\n if(list) {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list, dx, dy);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(source, originX, originY, width, height);\n ctx.restore();\n }\n else {\n ctx.drawImage(source, originX, originY, width, height);\n }\n }\n else if(renderMode === mode.SVG) {\n // img没有变化无需diff,直接用上次的vd\n if(loadImg.cache) {\n loadImg.cache.cache = true;\n virtualDom.children = [loadImg.cache];\n // 但是还是要校验是否有borderRadius变化,引发img的圆角遮罩\n if(!virtualDom.cache && list) {\n let d = svgPolygon(list);\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF'],\n ],\n }\n ],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.conClip = 'url(#' + id + ')';\n }\n return;\n }\n // 缩放图片,无需考虑原先矩阵,xom里对父层已经变换过了\n let matrix;\n if(width !== loadImg.width || height !== loadImg.height) {\n matrix = image.matrixResize(loadImg.width, loadImg.height, width, height, originX, originY, width, height);\n }\n let props = [\n ['xlink:href', loadImg.error ? placeholder : loadImg.src],\n ['x', originX],\n ['y', originY],\n ['width', loadImg.width],\n ['height', loadImg.height]\n ];\n if(list) {\n let d = svgPolygon(list);\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF']\n ],\n }\n ],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.conClip = 'url(#' + id + ')';\n delete virtualDom.cache;\n }\n if(matrix && !mx.isE(matrix)) {\n props.push(['transform', 'matrix(' + util.joinArr(mx.m2m6(matrix), ',') + ')']);\n }\n let vd = {\n type: 'img',\n tagName: 'image',\n props,\n };\n virtualDom.children = [vd];\n loadImg.cache = vd;\n }\n }\n return res;\n }\n\n // img没加载时,清空,这样Xom就认为没内容不生成cache,防止img先绘制cache再绘制主屏,重复\n __releaseWhenEmpty(__cache) {\n if(!this.__loadImg.error && !this.__loadImg.source) {\n return super.__releaseWhenEmpty(__cache);\n }\n }\n\n __isRealInline() {\n return false;\n }\n\n // overwrite\n __tryLayInline(w, total) {\n let { currentStyle: {\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n let loadImg = this.__loadImg;\n // 加载成功计算缩放后的宽度\n if(loadImg.source) {\n if(height[1] === PX) {\n w -= loadImg.width * height[0] / loadImg.height;\n }\n else if(height[1] === PERCENT) {\n w -= loadImg.width * height[0] * total * 0.01 / loadImg.height;\n }\n else if(height[1] === REM) {\n w -= loadImg.width * height[0] * this.root.computedStyle[FONT_SIZE] / loadImg.height;\n }\n else if(height[1] === VW) {\n w -= loadImg.width * height[0] * this.root.width * 0.01 / loadImg.height;\n }\n else if(height[1] === VH) {\n w -= loadImg.width * height[0] * this.root.height * 0.01 / loadImg.height;\n }\n else if(height[1] === VMAX) {\n w -= height[0] * Math.max(this.root.width, this.root.height) * 0.01 / loadImg.height;\n }\n else if(height[1] === VMIN) {\n w -= height[0] * Math.min(this.root.width, this.root.height) * 0.01 / loadImg.height;\n }\n else {\n w -= loadImg.width;\n }\n }\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n else if(marginLeft[1] === VMAX) {\n w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginLeft[1] === VMIN) {\n w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n else if(paddingLeft[1] === VMAX) {\n w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingLeft[1] === VMIN) {\n w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n else if(borderLeftWidth[1] === VMAX) {\n w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderLeftWidth[1] === VMIN) {\n w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n else if(marginRight[1] === VMAX) {\n w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginRight[1] === VMIN) {\n w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n else if(paddingRight[1] === VMAX) {\n w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingRight[1] === VMIN) {\n w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n else if(borderRightWidth[1] === VMAX) {\n w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderRightWidth[1] === VMIN) {\n w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return w;\n }\n\n __calBasis(isDirectionRow, 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 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 = __loadImg.width / __loadImg.height;\n b = max = min = isDirectionRow ? cross * ratio : cross / ratio;\n }\n else {\n b = max = min = isDirectionRow ? __loadImg.width : __loadImg.height;\n }\n }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\n }\n\n __loadAndRefresh(loadImg, root, ctx, placeholder, computedStyle, width, height, cb) {\n let self = this;\n // 先清空之前可能的\n if(loadImg.source || loadImg.error) {\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n });\n loadImg.source = null;\n }\n loadImg.loading = true;\n // 再测量,可能瞬间完成替换掉上面的\n inject.measureImg(loadImg.src, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败走error绘制\n if(data.url === loadImg.src && !self.isDestroyed) {\n loadImg.cache && (loadImg.cache.cache = false);\n loadImg.loading = false;\n function reload() {\n let { currentStyle: { [WIDTH]: width, [HEIGHT]: height } } = self;\n root.delRefreshTask(self.__task);\n if(width[1] !== AUTO && height[1] !== AUTO) {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REPAINT;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n else {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n }\n if(data.success) {\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n }\n else if(placeholder) {\n inject.measureImg(placeholder, data => {\n if(data.success) {\n loadImg.error = true;\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n reload();\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n return;\n }\n else {\n loadImg.error = true;\n }\n // 可见状态进行刷新操作,visibility某些情况需要刷新,可能宽高未定义要重新布局\n if(computedStyle[DISPLAY] !== 'none') {\n reload();\n }\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n }\n\n updateSrc(v, cb) {\n let self = this;\n let loadImg = self.__loadImg;\n let root = this.root;\n // 相等或空且当前error直接返回\n if(v === loadImg.src || !v && loadImg.error) {\n if(isFunction(cb)) {\n cb(-1);\n }\n }\n else if(v) {\n loadImg.src = v;\n self.__loadAndRefresh(loadImg, root, root.ctx, self.props.placeholder, self.computedStyle, self.width, self.height, cb);\n }\n else {\n loadImg.src = v;\n loadImg.source = null;\n loadImg.error = true;\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, self.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb(diff);\n }\n },\n });\n }\n }\n\n appendChild() {\n inject.error('Img can not appendChild.');\n }\n\n get src() {\n return this.__loadImg.src;\n }\n\n static showError = true;\n}\n\nexport default Img;\n","class Defs {\n constructor(uuid) {\n this.id = uuid;\n this.count = 0;\n this.list = [];\n this.cacheHash = {}; // 每次svg渲染前重置,存储前次渲染不变的缓存id\n }\n add(data) {\n let uuid = this.count;\n let hash = this.cacheHash;\n while(hash.hasOwnProperty(uuid)) {\n uuid++;\n }\n this.count = uuid + 1;\n data.id = uuid;\n data.uuid = 'karas-defs-' + this.id + '-' + uuid;\n data.index = this.list.length;\n this.list.push(data);\n return data.uuid;\n }\n addCache(data) {\n data.index = this.list.length;\n this.list.push(data);\n this.cacheHash[data.id] = true;\n return data.uuid;\n }\n clear() {\n this.list = [];\n this.count = 0;\n this.cacheHash = {};\n }\n removeCache(data) {\n let list = this.list;\n let i = data.index;\n // 一般情况index即位置,但每次渲染过程中,可能会删掉一些,此时位置会往前,但index不变,因此遍历\n for(; i >= 0; i--) {\n if(list[i] === data) {\n list.splice(i, 1);\n return;\n }\n }\n }\n\n get value() {\n return this.list;\n }\n\n static getInstance(uuid) {\n return new Defs(uuid);\n }\n}\n\nexport default Defs;\n","import Xom from '../Xom';\nimport reset from '../../style/reset';\nimport css from '../../style/css';\nimport unit from '../../style/unit';\nimport enums from '../../util/enums';\nimport mode from '../mode';\nimport util from '../../util/util';\nimport painter from '../../util/painter';\nimport transform from '../../style/transform';\nimport mx from '../../math/matrix';\nimport inject from '../../util/inject';\nimport gradient from '../../math/gradient';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n WIDTH,\n HEIGHT,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n FILL,\n STROKE,\n STROKE_MITERLIMIT,\n STROKE_WIDTH,\n STROKE_LINECAP,\n STROKE_LINEJOIN,\n STROKE_DASHARRAY,\n STROKE_DASHARRAY_STR,\n FILL_RULE,\n VISIBILITY,\n FONT_SIZE,\n FLEX_BASIS,\n },\n NODE_KEY: {\n NODE_CACHE_PROPS,\n NODE_CURRENT_PROPS,\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit;\nconst { int2rgba, isNil, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nconst REGISTER = {};\n\nclass Geom extends Xom {\n constructor(tagName, props) {\n super(tagName, props);\n this.__isMulti = !!this.props.multi;\n this.__style = css.normalize(this.style, reset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET));\n this.__currentStyle = util.extend({}, this.__style);\n this.__currentProps = util.clone(this.props);\n let config = this.__config;\n config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n config[NODE_CURRENT_PROPS] = this.__currentProps;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_STYLE] = this.__style;\n }\n\n __tryLayInline(w, total) {\n // 无children,直接以style的width为宽度,不定义则为0\n let { currentStyle: {\n [WIDTH]: width,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n 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 let min = 0;\n let max = 0;\n let { currentStyle } = this;\n // 计算需考虑style的属性\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n [DISPLAY]: display,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n 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 return [display, this.__addMp(isDirectionRow, data.w, currentStyle, [min, max])];\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH, 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 return [b, min, max];\n }\n\n __layoutBlock(data, isVirtual) {\n let { fixedWidth, fixedHeight, w, h } = this.__preLayout(data);\n this.__height = fixedHeight ? h : 0;\n if(isVirtual) {\n this.__width = fixedWidth ? w : 0;\n return;\n }\n this.__width = w;\n this.__ioSize(w, this.height);\n this.__marginAuto(this.currentStyle, data);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __layoutFlex(data) {\n // 无children所以等同于block\n this.__layoutBlock(data);\n }\n\n __layoutInline(data) {\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // 元素的width不能超过父元素w\n let tw = this.__width = fixedWidth ? w : x - data.x;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6) {\n let res = super.__calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6);\n if(isNil(__cacheStyle[STROKE_WIDTH])) {\n __cacheStyle[STROKE_WIDTH] = true;\n let strokeWidth = currentStyle[STROKE_WIDTH] || [];\n let w = this.width;\n computedStyle[STROKE_WIDTH] = strokeWidth.map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n else if(item[1] === PERCENT) {\n return item[0] * w * 0.01;\n }\n else if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n else if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n else 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 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() {}\n\n // offset/resize时要多一步清空props上记录的缓存\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeX(diff, lv) {\n super.__resizeX(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeY(diff, lv) {\n super.__resizeY(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n getProps(k) {\n let v = this.currentProps[k];\n if(!isNil(v)) {\n return v;\n }\n return this['__' + k];\n }\n\n __isRealInline() {\n return false;\n }\n\n get isMulti() {\n return this.__isMulti;\n }\n\n get currentProps() {\n return this.__currentProps;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$') {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Geom has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$'\n || !obj.prototype || !(obj.prototype instanceof Geom)) {\n throw new Error('Invalid param');\n }\n if(Geom.hasRegister(name)) {\n throw new Error(`Geom has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Geom.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nexport default Geom;\n","import Xom from '../node/Xom';\nimport Dom from '../node/Dom';\nimport Component from '../node/Component';\nimport util from './util';\nimport inject from './inject';\nimport flatten from './flatten';\nimport $$type from './$$type';\nimport enums from './enums';\n\nconst {\n NODE_KEY: {\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_DOM_PARENT,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n NODE_STRUCT,\n },\n} = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet updateList = [];\nlet removeList = [];\n\nconst KEY_FLAG = {};\n\n/**\n * setState后刷新前先根遍历检查组件开始进行shouldComponentUpdate判断\n */\nfunction check(vd) {\n if(vd instanceof Dom) {\n vd.children.forEach(child => {\n if(child instanceof Dom) {\n check(child);\n }\n // 当组件有setState更新时,从叶子到根链路会标识__hasUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasUpdate) {\n child.__hasUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n // 高阶组件会进入此分支,被父组件调用\n else if(vd instanceof Component && vd.__hasUpdate) {\n vd.__hasUpdate = false;\n checkCp(vd, vd.props);\n }\n}\n\n/**\n * 检查cp是否有state变更,注意递归检查时需要看shadow不能看shadowRoot,\n * 否则高阶组件会被跳过,其更新无法触发update生命周期\n * @param cp\n * @param nextProps\n * @param forceCheckUpdate,被render()后的json的二级组件,发现props有变更强制检查更新,否则可以跳过\n */\nfunction checkCp(cp, nextProps, forceCheckUpdate) {\n if(cp.__nextState || forceCheckUpdate) {\n let shouldUpdate;\n if(util.isFunction(cp.shouldComponentUpdate)) {\n shouldUpdate = cp.shouldComponentUpdate(nextProps, cp.__nextState || cp.state);\n }\n else {\n // 没有默认更新\n shouldUpdate = true;\n }\n if(shouldUpdate) {\n updateCp(cp, nextProps, cp.__nextState || cp.state);\n }\n // 不更新则递归检查子tree的cp\n else {\n cp.props = nextProps;\n cp.state = cp.__nextState || cp.state;\n check(cp.shadow);\n }\n }\n else {\n check(cp.shadow);\n }\n}\n\n/**\n * 更新组件的props和state,清空__nextState\n * @param cp\n * @param props\n * @param state\n */\nfunction updateCp(cp, props, state) {\n cp.props = props;\n cp.state = state;\n cp.__nextState = null; // 同步在refresh前清除component的新state标识,这样frame动画在after回调中可以新设\n let oldS = cp.shadow;\n let oldSr = cp.shadowRoot;\n let oldJson = cp.__cd;\n let json = flatten(cp.render());\n // 对比新老render()返回的内容,更新后重新生成sr\n diffSr(oldS, oldJson, json);\n cp.__init(json);\n // 为了局部dom布局需要知道老的css信息\n let sr = cp.shadowRoot;\n if(sr instanceof Xom) {\n [\n '__outerWidth',\n '__outerHeight',\n '__sx',\n '__sy',\n '__sx2',\n '__sx3',\n '__sx4',\n '__sx5',\n '__sx6',\n '__sy2',\n '__sy3',\n '__sy4',\n '__sy5',\n '__sy6',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__computedStyle = sr.__config[NODE_COMPUTED_STYLE] = oldSr.computedStyle;\n }\n else {\n let domParent = cp.domParent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n sr.__config[k] = domParent.__config[k];\n });\n }\n [\n '__x',\n '__y',\n '__width',\n '__height',\n '__sx1', // text和xom\n '__sy1',\n '__layoutData',\n '__parent',\n '__domParent',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__config[NODE_DOM_PARENT] = oldSr.domParent;\n sr.__config[NODE_STRUCT] = oldSr.__config[NODE_STRUCT];\n updateList.push(cp);\n // 老的需回收,diff会生成新的dom,唯一列外是cp直接返回一个没变化的cp\n if(!util.isObject(json) || !json.__placeholder) {\n removeList.push(oldS);\n }\n // 子组件使用老的json时标识,更新后删除,render()返回空会没json对象\n if(json && json.__placeholder) {\n delete json.__placeholder;\n }\n if(json && json.__inheritAnimate) {\n delete json.__inheritAnimate;\n }\n if(json && json.__animateRecords) {\n delete json.__animateRecords;\n }\n // 高阶组件时需判断,子组件更新后生成新的sr,父组件的sr/host需要同时更新引用\n let host = cp.host;\n while(host) {\n if(host.shadow === cp) {\n host.__shadowRoot = sr;\n sr.__hostRoot = host;\n cp = host;\n host = host.host;\n }\n else {\n break;\n }\n }\n}\n\n/**\n * 非一级组件sr进行对比,key相同的无需重新生成且继承动画\n * @param vd\n * @param oj oldJson\n * @param nj\n */\nfunction diffSr(vd, oj, nj) {\n // 先遍历检查key相同的,将没有变化的key暂存下来,深度优先,这样叶子节点出现在前面,当key的叶子也有key时,确保叶子先对比\n let ojk = getKeyHash(oj, {}, vd);\n let njk = getKeyHash(nj, {});\n let keyList = [];\n let cpList = [];\n // 先对比key对应的节点,如果新老有一方对不上则落空\n Object.keys(ojk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n if(!n) {\n o.json.key = KEY_FLAG;\n }\n });\n Object.keys(njk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n // 有可能老的没有这个key,新key落空\n if(!o) {\n n.json.key = KEY_FLAG;\n return;\n }\n let oj = o.json;\n let nj = n.json;\n let vd = o.vd;\n // 相同class的组件进行对比替换\n if(oj.$$type === TYPE_CP && nj.$$type === TYPE_CP) {\n if(oj.klass === nj.klass) {\n // 对比props和children看是否全等,是则直接替换新json类型为占位符,引用老vd,否则强制更新\n diffCp(oj, nj, vd);\n // 标识对比过了\n oj.key = nj.key = KEY_FLAG;\n // 老的sr里需删除这个vd,因为老sr会回收\n cpList.push(vd);\n }\n }\n // 相同类型的vd进行对比继承动画\n else if(oj.$$type === nj.$$type && oj.tagName === nj.tagName) {\n // 需判断矢量标签mutil是否相等\n if(nj.$$type !== TYPE_GM || oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n oj.key = nj.key = KEY_FLAG;\n // key相同的dom暂存下来\n if(nj.$$type === TYPE_VD) {\n keyList.push({\n vd,\n oj,\n nj,\n });\n }\n }\n });\n // key相同的dom对比children,下面非key逻辑就不做了\n keyList.forEach(item => {\n diffChildren(item.vd, item.oj, item.nj);\n });\n // 整体tree进行对比\n diffChild(vd, oj, nj);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的\n cpList.forEach(vd => {\n removeCpFromOldTree(vd);\n });\n}\n\n/**\n * 递归检查dom的children,相同的无需重新生成,用PL类型占位符代替直接返回老vd\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChild(vd, oj, nj) {\n if(util.isObject(nj)) {\n if(nj.$$type === TYPE_CP) {\n // key对比过了忽略\n if(nj.key === KEY_FLAG) {\n return;\n }\n // 相同class的组件处理\n if(oj && oj.$$type === nj.$$type && oj.klass === nj.klass) {\n diffCp(oj, nj, vd);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收\n removeCpFromOldTree(vd);\n }\n }\n else if(nj.$$type === TYPE_GM && oj && oj.$$type === TYPE_GM) {\n // $geom的multi必须一致\n if(oj.tagName === nj.tagName && oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n }\n // dom类型递归children\n else if(nj.$$type === TYPE_VD && oj && oj.$$type === TYPE_VD) {\n if(oj.tagName === nj.tagName) {\n nj.__inheritAnimate = vd;\n }\n diffChildren(vd, oj, nj);\n }\n }\n}\n\n/**\n * dom类型的vd对比children\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChildren(vd, oj, nj) {\n let oc = oj.children;\n let nc = nj.children;\n let ol = oc.length;\n let nl = nc.length;\n let children = vd.children;\n for(let i = 0, of = 0, nf = 0, len = Math.min(ol, nl); i < len; i++) {\n let o = oc[i + of];\n let n = nc[i + nf];\n // 新老都是key直接跳过\n if(o.key === KEY_FLAG && n.key === KEY_FLAG) {\n }\n // 其中一个是key对比过了调整索引和长度\n else if(o.key === KEY_FLAG) {\n of++;\n i--;\n ol--;\n len = Math.min(ol, nl);\n }\n else if(n.key === KEY_FLAG) {\n nf++;\n i--;\n nl--;\n len = Math.min(ol, nl);\n }\n else {\n diffChild(children[i + of], o, n);\n }\n }\n // 长度不同增减的无需关注,新json创建cp有didMount,老vd会调用cp的destroy\n}\n\n/**\n * 根据json对比看cp如何更新,被render()后的json的二级组件对比才会出现\n * @param oj\n * @param nj\n * @param vd\n */\nfunction diffCp(oj, nj, vd) {\n // props全等,直接替换新json类型为占位符,引用老vd内容,无需重新创建,暂时存在json的placeholder上\n // 否则需要强制触发组件更新,包含setState内容\n nj.__placeholder = vd;\n let sr = vd.shadowRoot;\n // 对比需忽略on开头的事件,直接改老的引用到新的上,这样只变了on的话无需更新\n let exist = {};\n Object.keys(oj.props).forEach(k => {\n let v = oj.props[k];\n exist[k] = v;\n });\n Object.keys(nj.props).forEach(k => {\n let v = nj.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n vd.off(k, exist[k]);\n vd.on(k, v);\n }\n delete exist[k];\n }\n else {\n k = k.slice(2).toLowerCase();\n vd.on(k, v);\n }\n }\n });\n // 新的少的事件取消\n Object.keys(exist).forEach(k => {\n let v = exist[k];\n if(/^on[a-zA-Z]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n delete sr.listener[k];\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n vd.off(k, v);\n }\n });\n checkCp(vd, nj.props, !util.equal(oj.props, nj.props));\n}\n\n/**\n * 深度优先遍历json,将有key的记录在hash中,如果传入根vd,同步递归保存对应位置的vd\n * @param json\n * @param hash\n * @param vd\n * @returns {*}\n */\nfunction getKeyHash(json, hash, vd) {\n if(Array.isArray(json)) {\n json.forEach((item, i) => getKeyHash(item, hash, vd && vd[i]));\n }\n else if(util.isObject(json)) {\n if(json.$$type === TYPE_VD || json.$$type === TYPE_GM || json.$$type === TYPE_CP) {\n // 深度优先\n if(json.$$type === TYPE_VD) {\n getKeyHash(json.children, hash, vd && vd.children);\n }\n let key = json.props.key;\n if(!util.isNil(key) && key !== '') {\n // 重复key错误警告\n if(hash.hasOwnProperty(key)) {\n inject.warn('Component ' + vd.tagName + ' has duplicate key: ' + key);\n }\n hash[key] = {\n json,\n vd,\n };\n }\n }\n }\n return hash;\n}\n\n/**\n * 非一级组件diff发生更新时,其需要从sr的tree中移除,因为sr会销毁\n */\nfunction removeCpFromOldTree(vd) {\n // root下的一级组件不会发生回收情况,忽略\n if(!vd.host) {\n return;\n }\n let parent = vd.parent;\n if(parent) {\n let i = parent.children.indexOf(vd);\n if(i > -1) {\n parent.children[i] = null;\n }\n else {\n throw new Error('Can not find child: ' + vd.tagName);\n }\n }\n}\n\n/**\n * 执行componentDidUpdate/destroy\n */\nfunction did() {\n updateList.forEach(item => {\n if(util.isFunction(item.componentDidUpdate)) {\n item.componentDidUpdate();\n }\n });\n updateList.splice(0);\n removeList.forEach(item => {\n item.__destroy();\n });\n removeList = [];\n}\n\nexport default {\n updateList,\n check,\n did,\n};\n","import util from './util';\nimport level from '../refresh/level';\n\nconst { joinVd, joinDef } = util;\nconst { contain, NONE, TRANSFORM_ALL, OPACITY, FILTER, MIX_BLEND_MODE } = level;\n\nfunction diff(elem, ovd, nvd) {\n let cns = elem.childNodes;\n diffDefs(cns[0], ovd.defs, nvd.defs);\n // = i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinDef(nd[i]));\n }\n }\n}\n\nfunction diffDef(elem, od, nd) {\n if(od.tagName !== nd.tagName) {\n insertAdjacentHTML(elem, 'beforebegin', joinDef(nd));\n // elem.insertAdjacentHTML('beforebegin', joinDef(nd));\n elem.parentNode.removeChild(elem);\n }\n else {\n if(od.uuid !== nd.uuid) {\n elem.setAttribute('id', nd.uuid);\n }\n let op = {};\n for(let i = 0, len = (od.props || []).length; i < len; i++) {\n let prop = od.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nd.props || []).length; i < len; i++) {\n let prop = nd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n let cns = elem.childNodes;\n let ol = od.children.length;\n let nl = nd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, od.children[i], nd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nd.children[i]));\n }\n }\n }\n}\n\nfunction diffChild(elem, ovd, nvd) {\n if(ovd.type === 'dom') {\n if(nvd.type === 'dom') {\n diffD2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffD2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'text') {\n if(nvd.type === 'text') {\n diffT2T(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'geom') {\n if(nvd.type === 'dom') {\n diffG2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffG2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'img') {\n if(nvd.type === 'img') {\n diffItemSelf(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n}\n\nfunction diffX2X(elem, ovd, nvd) {\n let { transform, opacity, visibility, mask, overflow, filter, mixBlendMode, conClip } = nvd;\n if(ovd.transform !== transform) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(ovd.opacity !== opacity) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(ovd.visibility !== visibility) {\n elem.setAttribute('visibility', visibility);\n }\n if(ovd.mask !== mask) {\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n }\n if(ovd.filter !== filter || ovd.mixBlendMode !== mixBlendMode) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('filter');\n }\n }\n // if(ovd.filter !== filter) {\n // if(filter) {\n // elem.setAttribute('filter', filter);\n // }\n // else {\n // elem.removeAttribute('filter');\n // }\n // }\n if(ovd.overflow !== overflow) {\n if(overflow) {\n elem.setAttribute('clipPath', overflow);\n }\n else {\n elem.removeAttribute('overflow');\n }\n }\n if(ovd.conClip !== conClip) {\n if(conClip) {\n elem.childNodes[1].setAttribute('clip-path', conClip);\n }\n else {\n elem.childNodes[1].removeAttribute('clip-path');\n }\n }\n}\n\nfunction diffByLessLv(elem, ovd, nvd, lv) {\n let { transform, opacity, mask, filter, mixBlendMode } = nvd;\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n if(lv === NONE) {\n return;\n }\n if(contain(lv, TRANSFORM_ALL)) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(contain(lv, OPACITY)) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(contain(lv, FILTER) || contain(lv, MIX_BLEND_MODE)) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('style');\n }\n }\n}\n\nfunction diffD2D(elem, ovd, nvd, root) {\n // cache表明children无变化缓存,一定是REPAINT以下的,只需看自身的lv以及mask\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffD2G(elem, ovd, nvd) {\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n replaceWith(cns[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffT2T(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, ovd.children[i], nvd.children[i], true);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffG2D(elem, ovd, nvd) {\n diffD2G(elem, ovd, nvd);\n}\n\nfunction diffG2G(elem, ovd, nvd) {\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n }\n}\n\nfunction diffBb(elem, obb, nbb) {\n let ol = obb.length;\n let nl = nbb.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, obb[i], nbb[i]);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nbb[i]));\n }\n }\n}\n\nfunction diffItem(elem, i, ovd, nvd, isText) {\n let cns = elem.childNodes;\n if(ovd.tagName !== nvd.tagName) {\n replaceWith(cns[i], nvd);\n }\n else {\n diffItemSelf(cns[i], ovd, nvd);\n if(isText && ovd.content !== nvd.content) {\n cns[i].innerHTML = nvd.content;\n }\n }\n}\n\nfunction diffItemSelf(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let op = {};\n for(let i = 0, len = (ovd.props || []).length; i < len; i++) {\n let prop = ovd.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nvd.props || []).length; i < len; i++) {\n let prop = nvd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n}\n\nfunction replaceWith(elem, vd) {\n let res;\n if(Array.isArray(vd)) {\n res = '';\n vd.forEach(item => {\n res += joinVd(item);\n });\n }\n else {\n res = joinVd(vd);\n }\n insertAdjacentHTML(elem, 'beforebegin', res);\n // elem.insertAdjacentHTML('beforebegin', res);\n elem.parentNode.removeChild(elem);\n}\n\nfunction insertAt(elem, cns, index, html) {\n if(index >= cns.length) {\n insertAdjacentHTML(elem, 'beforeend', html);\n // elem.insertAdjacentHTML('beforeend', html);\n }\n else {\n insertAdjacentHTML(cns[index], 'beforebegin', html);\n // cns[index].insertAdjacentHTML('beforebegin', html);\n }\n}\n\nfunction removeAt(elem, cns, index) {\n if(cns[index]) {\n elem.removeChild(cns[index]);\n }\n}\n\nlet svg;\nfunction insertAdjacentHTML(elem, where, content) {\n if(elem.insertAdjacentHTML) {\n elem.insertAdjacentHTML(where, content);\n }\n else {\n switch(where) {\n case 'beforeend':\n elem.innerHTML += content;\n break;\n case 'beforebegin':\n svg = svg || document.createElement('svg');\n svg.innerHTML = content;\n elem.parentNode.insertBefore(svg.childNodes[0], elem);\n break;\n }\n }\n}\n\nexport default diff;\n","import util from '../util/util';\n\nconst { isFunction } = util;\n\nclass Controller {\n constructor() {\n this.__records = []; // 默认记录和自动记录\n this.__records2 = []; // 非自动播放的动画记录\n this.__list = [] // 默认初始化播放列表,自动播放也存这里\n this.__list2 = []; // json中autoPlay为false的初始化存入这里\n this.__onList = []; // list中已存在的侦听事件,list2初始化时也需要增加上\n this.__lastTime = {}; // 每个类型的上次触发时间,防止重复emit\n }\n\n add(v, list = this.list) {\n if(list.indexOf(v) === -1) {\n list.push(v);\n }\n }\n\n remove(v) {\n let i = this.list.indexOf(v);\n if(i > -1) {\n this.list.splice(i, 1);\n }\n }\n\n __destroy() {\n this.__records = [];\n this.__records2 = [];\n this.__list = [];\n this.__list2 = [];\n }\n\n __action(k, args) {\n this.list.forEach(item => {\n item[k].apply(item, args);\n });\n }\n\n init(records = this.__records, list = this.list) {\n // 检查尚未初始化的record,并初始化,后面才能调用各种控制方法\n if(records.length) {\n // 清除防止重复调用,并且新的json还会进入整体逻辑\n records.splice(0).forEach(item => {\n let { target, animate } = item;\n if(target.isDestroyed) {\n return;\n }\n if(Array.isArray(animate)) {\n animate.forEach(animate => {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n });\n }\n else {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n }\n });\n }\n // 非自动播放后初始化需检测事件,给非自动播放添加上,并清空本次\n if(records === this.__records2) {\n let onList = this.__onList;\n let list2 = this.list2;\n if(list2.length && onList.length) {\n list2.forEach(item => {\n onList.forEach(arr => {\n item.off(arr[0], arr[1]);\n item.on(arr[0], arr[1]);\n });\n });\n }\n }\n }\n\n __playAuto() {\n this.init();\n this.__action('play');\n }\n\n play(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('play', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n pause() {\n this.__action('pause');\n }\n\n resume(cb) {\n let once = true;\n this.__action('resume', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n __mergeAuto() {\n this.init();\n this.init(this.__records2);\n if(this.__list2.length) {\n this.__list = this.__list.concat(this.__list2);\n this.__list2 = [];\n }\n }\n\n cancel(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('cancel', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n finish(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('finish', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndStop(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('gotoAndStop', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndPlay(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('gotoAndPlay', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.__on(id[i], handle);\n }\n this.__onList.push([id, handle]);\n }\n else {\n this.__on(id, handle);\n this.__onList.push([id, handle]);\n }\n }\n\n __on(id, handle) {\n this.list.forEach(item => {\n let cb = () => {\n let time = item.timestamp;\n if(time !== this.__lastTime[id]) {\n this.__lastTime[id] = time;\n handle();\n }\n };\n cb.__karasEventCb = handle;\n item.on(id, cb);\n });\n }\n\n off(id, handle) {\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.off(id[i], handle);\n }\n }\n else {\n this.list.forEach(item => {\n item.off(id, handle);\n });\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get list2() {\n return this.__list2;\n }\n\n __set(key, value) {\n this.list.forEach(item => {\n item[key] = value;\n });\n }\n\n set playbackRate(v) {\n this.__set('playbackRate', v);\n }\n\n set iterations(v) {\n this.__set('iterations', v);\n }\n\n set playCount(v) {\n this.__set('playCount', v);\n }\n\n set fps(v) {\n this.__set('fps', v);\n }\n\n set currentTime(v) {\n this.__set('currentTime', v);\n }\n\n set spfLimit(v) {\n this.__set('spfLimit', v);\n }\n\n set delay(v) {\n this.__set('delay', v);\n }\n\n set endDelay(v) {\n this.__set('endDelay', v);\n }\n\n set fill(v) {\n this.__set('fill', v);\n }\n\n set direction(v) {\n this.__set('direction', v);\n }\n}\n\nexport default Controller;\n","import 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 Geom from '../node/geom/Geom';\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;\n }\n // 局部根节点如有perspective,则计算pm,这里不会出现嵌套,因为每个出现都会生成局部根节点\n let pm;\n if(perspective) {\n pm = tf.calPerspectiveMatrix(perspective, perspectiveOrigin);\n }\n // 广度遍历,不断一层层循环下去,用2个hash暂存每层的父matrix和opacity,blur只需记住顶层,因为子的如果有一定是cacheFilter\n let list = [index];\n let d = 0;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n d = blur.outerSize(v);\n }\n });\n opacityHash[index] = 1;\n // opacity可以保存下来层级相乘结果供外部使用,但matrix不可以,因为这里按画布原点为坐标系计算,外部合并局部根节点以bbox左上角为原点\n let matrixHash = {};\n while(list.length) {\n let arr = list.splice(0);\n for(let i = 0, len = arr.length; i < len; i++) {\n let parentIndex = arr[i];\n let total = __structs[parentIndex][STRUCT_TOTAL] || 0;\n for(let i = parentIndex + 1, len = parentIndex + total + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node2,\n [STRUCT_TOTAL]: total,\n } = __structs[i];\n // mask也不占bbox位置\n if(node2.isMask) {\n continue;\n }\n let {\n __sx1,\n __sy1,\n __config: {\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [OPACITY]: opacity,\n },\n },\n } = node2;\n // webgl不能跳过超限\n if(limitCache && !includeLimitCache) {\n return;\n }\n // display:none跳过整个节点树,visibility只跳过自身\n if(display === 'none') {\n i += total || 0;\n continue;\n }\n if(visibility === 'hidden') {\n continue;\n }\n parentIndexHash[i] = parentIndex;\n opacityHash[i] = opacityHash[parentIndex] * opacity;\n // 防止text的情况,其一定属于某个node,其bbox被计算过,text不应该计算\n if(node2 instanceof Text) {\n continue;\n }\n let bbox, dx = 0, dy = 0, hasTotal;\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n bbox = target.bbox.slice(0);\n dx = target.dbx;\n dy = target.dby;\n i += total || 0;\n hasTotal = true;\n }\n else if(__cache && __cache.available) {\n bbox = __cache.bbox.slice(0);\n dx = __cache.dbx;\n dy = __cache.dby;\n }\n else {\n bbox = node2.bbox;\n }\n // 可能Xom没有内容\n if(bbox) {\n bbox[0] -= sx1;\n bbox[1] -= sy1;\n bbox[2] -= sx1;\n bbox[3] -= sy1;\n let matrix = matrixHash[parentIndex];\n // 父级matrix初始化E为null,自身不为E时才运算,可以加速\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n tfo[0] += __sx1 - sx1 + dx;\n tfo[1] += __sy1 - sy1 + dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(pm) {\n matrix = multiply(pm, matrix);\n }\n bbox = 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);\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);\n texCache.refresh(gl, cx, cy);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n // 因为cacheTotal不总是以左上角原点为开始,所以必须每个节点重算matrix,合并box时计算的无法用到\n let matrixHash = {};\n // 先序遍历汇总到total\n for(let i = index + 1, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n let parentIndex = parentIndexHash[i];\n let matrix = matrixHash[parentIndex]; // 父节点的在每个节点计算后保存,第一个为top的默认为E(空)\n let opacity = opacityHash[i]; // opacity在合并box时已经计算可以直接用\n // 先看text,visibility会在内部判断,display会被parent判断\n if(node instanceof Text) {\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n texCache.addTexAndDrawWhenLimit(gl, __config[NODE_CACHE], opacity, matrix, cx, cy, dx, dy);\n }\n // 再看total缓存/cache,都没有的是无内容的Xom节点\n else {\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_IS_MASK]: isMask,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // mask和不可见不能被汇总到top上\n if(visibility === 'hidden' || isMask) {\n continue;\n }\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n if(__cache && __cache.available) {\n tfo[0] += __cache.sx1;\n tfo[1] += __cache.sy1;\n }\n else {\n tfo[0] += node.__sx1;\n tfo[1] += node.__sy1;\n }\n let dx = -sx1 + dbx;\n let dy = -sy1 + dby;\n tfo[0] += dx;\n tfo[1] += dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n if(target) {\n // 局部的mbm和主画布一样,先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成\n if(isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy);\n texCache.refresh(gl, cx, cy);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前fbo作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy);\n }\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n // 绘制到fbo的纹理对象上并删除fbo恢复\n texCache.refresh(gl, cx, cy);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 生成的纹理对象本身已绑定一个纹理单元了,释放lock的同时可以给texCache的channel缓存,避免重复上传\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bboxTotal);\n texCache.releaseLockChannel(n, mockCache.page);\n return [limitCache || totalLimitCache, mockCache];\n}\n\nfunction genFilterWebgl(gl, texCache, node, cache, filter, W, H) {\n let { sx1, sy1, width, height, bbox } = cache;\n let mockCache = cache;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n let res = genBlurWebgl(gl, texCache, mockCache, v, width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'hue-rotate') {\n let rotation = geom.d2r(v % 360);\n let cosR = Math.cos(rotation);\n let sinR = Math.sin(rotation);\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + cosR * 0.787 - sinR * 0.213, 0.715 - cosR * 0.715 - sinR * 0.715, 0.072 - cosR * 0.072 + sinR * 0.928, 0, 0,\n 0.213 - cosR * 0.213 + sinR * 0.143, 0.715 + cosR * 0.285 + sinR * 0.140, 0.072 - cosR * 0.072 - sinR * 0.283, 0, 0,\n 0.213 - cosR * 0.213 - sinR * 0.787, 0.715 - cosR * 0.715 + sinR * 0.715, 0.072 + cosR * 0.928 + sinR * 0.072, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'saturate' && v !== 100) {\n let amount = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + 0.787 * amount, 0.715 - 0.715 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 + 0.285 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 - 0.715 * amount, 0.072 + 0.928 * amount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'brightness' && v !== 100) {\n let b = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'grayscale' && v > 0) {\n let oneMinusAmount = 1 - v * 0.01;\n if(oneMinusAmount < 0) {\n oneMinusAmount = 0;\n }\n else if(oneMinusAmount > 1) {\n oneMinusAmount = 1;\n }\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.2126 + 0.7874 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 + 0.2848 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 + 0.9278 * oneMinusAmount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'contrast' && v !== 100) {\n let amount = v * 0.01;\n let o = -0.5 * amount;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n amount, 0, 0, 0, o,\n 0, amount, 0, 0, o,\n 0, 0, amount, 0, o,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n });\n // 切换回主程序\n gl.useProgram(gl.program);\n gl.viewport(0, 0, W, H);\n return mockCache;\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核d扩大3倍性能慢\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * 先动态生成gl程序,默认3核源码示例已注释,根据sigma获得d(一定奇数),再计算权重\n * 然后将d尺寸和权重拼接成真正程序并编译成program,再开始绘制\n */\nfunction genBlurWebgl(gl, texCache, cache, sigma, width, height, sx1, sy1, bbox) {\n let d = blur.kernelSize(sigma);\n let max = Math.max(15, gl.getParameter(gl.MAX_VARYING_VECTORS));\n while(d > max) {\n d -= 2;\n }\n let spread = blur.outerSizeByD(d);\n width += spread * 2;\n height += spread * 2;\n // 防止超限,webgl最大纹理尺寸限制\n let limit = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n if(width > limit || height > limit) {\n return;\n }\n bbox = bbox.slice(0);\n bbox[0] -= spread;\n bbox[1] -= spread;\n bbox[2] += spread;\n bbox[3] += spread;\n let cx = width * 0.5, cy = height * 0.5;\n let weights = blur.gaussianWeight(sigma, d);\n let vert = '';\n let frag = '';\n let r = Math.floor(d * 0.5);\n for(let i = 0; i < r; i++) {\n let c = (r - i) * 0.01;\n vert += `\\nv_texCoordsBlur[${i}] = a_texCoords + vec2(-${c}, -${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i}]) * ${weights[i]};`;\n }\n vert += `\\nv_texCoordsBlur[${r}] = a_texCoords;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${r}]) * ${weights[r]};`;\n for(let i = 0; i < r; i++) {\n let c = (i + 1) * 0.01;\n vert += `\\nv_texCoordsBlur[${i + r + 1}] = a_texCoords + vec2(${c}, ${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i + r + 1}]) * ${weights[i + r + 1]};`;\n }\n vert = vertexBlur.replace('[3]', '[' + d + ']').replace(/}$/, vert + '}');\n frag = fragmentBlur.replace('[3]', '[' + d + ']').replace(/}$/, frag + '}');\n let program = webgl.initShaders(gl, vert, frag);\n gl.useProgram(program);\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n texture = webgl.drawBlur(gl, program, frameBuffer, texCache, texture, cache.page.texture, i, j,\n width, height, cx, cy, spread, d, sigma);\n // 销毁这个临时program\n gl.deleteShader(program.vertexShader);\n gl.deleteShader(program.fragmentShader);\n gl.deleteProgram(program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n texCache.releaseLockChannel(j);\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox);\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genColorMatrixWebgl(gl, texCache, cache, m, width, height, sx1, sy1, bbox) {\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n gl.useProgram(gl.programCm);\n webgl.drawCm(gl, gl.programCm, j, m);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox.slice(0));\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genOverflowWebgl(gl, texCache, node, cache, W, H) {\n let sbox = node.bbox.slice(0);\n let bbox = cache.bbox;\n // 没超过无需生成\n if(bbox[0] >= sbox[0] && bbox[1] >= sbox[1] && bbox[2] <= sbox[2] && bbox[3] <= sbox[3]) {\n return;\n }\n let width = sbox[2] - sbox[0], height = sbox[3] - sbox[1];\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n // 绘制,根据坐标裁剪使用原本纹理的一部分\n gl.useProgram(gl.programOverflow);\n webgl.drawOverflow(gl, j, sbox[0] - bbox[0], sbox[1] - bbox[1], width, height, cache.width, cache.height);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let overflowCache = new MockCache(gl, texture, cache.sx1, cache.sy1, width, height, sbox);\n texCache.releaseLockChannel(i, overflowCache.page);\n return overflowCache;\n}\n\nfunction genMaskWebgl(gl, texCache, node, __config, cache, W, H, 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);console.log(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 // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n assignMatrix(m, matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n // node本身有或者父有perspective都认为需要生成3d渲染上下文\n if(tf.isPerspectiveMatrix(matrix) || parentPm) {\n if(hasRecordAsMask) {\n hasRecordAsMask[9] = true;\n }\n else {\n hasRecordAsMask = [i, lv, total, node, __config, null, null, null, null, true];\n }\n }\n // 先左乘perspective的矩阵,再左乘父级的总矩阵\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n 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 }\n else {\n mergeList.push([i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective]);\n }\n }\n }\n let limitHash = {};\n // 根据收集的需要合并局部根的索引,尝试合并,按照层级从大到小,索引从大到小的顺序,\n // 这样保证子节点在前,后节点在前,后节点是为了mask先应用自身如filter之后再进行遮罩\n if(mergeList.length) {\n mergeList.sort(function(a, b) {\n if(a[1] === b[1]) {\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n mergeList.forEach(item => {\n let [i, lv, total, node, __config, limitCache, hasMask, filter, overflow] = item;\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n } = __config;\n let needGen;\n // 可能没变化,比如被遮罩节点、filter变更等\n if(!__cacheTotal || !__cacheTotal.available) {\n let [limit, res] = genTotalWebgl(gl, texCache, node, __config, i, total || 0, __structs, __cache, limitCache, 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 target = genOverflowWebgl(gl, texCache, node, target, width, height);\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n if(filter.length) {\n if(!__cacheFilter || !__cacheFilter.available || needGen) {\n let old = target;\n target = genFilterWebgl(gl, texCache, node, target, filter, width, height);\n if(target !== old) {\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n }\n if(hasMask && (!__cacheMask || !__cacheMask.available || needGen)) {\n target = genMaskWebgl(gl, texCache, node, __config, target, width, height, 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 m = mx.m2Mat4(matrixEvent, cx, cy);\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 }\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[0] !== page || page.update) {\n // page可能为一个已有纹理,或者贴图\n if(page instanceof MockPage) {\n webgl.bindTexture(gl, page.texture, i);\n channels[i] = page;\n }\n else {\n // 可能老的先删除\n if(last) {\n gl.deleteTexture(last.texture);\n }\n page.texture = webgl.createTexture(gl, page.canvas, i);\n channels[i] = page;\n }\n hash[page.uuid] = i;\n }\n else {\n hash[page.uuid] = i;\n }\n // 标识没有更新,以及最后使用时间\n page.update = false;\n page.time = inject.now();\n }\n // 再次遍历开始本次渲染并清空\n webgl.drawTextureCache(gl, list, hash, cx, cy, revertY);\n pages.splice(0);\n list.splice(0);\n }\n }\n\n findExistTexChannel(page) {\n return this.channels.indexOf(page);\n }\n\n /**\n * 获取并锁定一个纹理单元优先使用空的,其次最久未使用的\n * @returns {number|*}\n */\n lockOneChannel() {\n // 优先返回空单元\n let channels = this.channels;\n let locks = this.locks;\n for(let i = 0; i < this.__units; i++) {\n if(!channels[i] && !locks[i]) {\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n }\n // 根据NRU返回最久未使用的\n let units = this.__units;\n let cl = [];\n for(let i = 0; i < units; i++) {\n if(!locks[i]) {\n cl.push([i, channels[i]]);\n }\n }\n if(cl.length) {\n cl.sort(function(a, b) {\n if(a[1].time !== b[1].time) {\n return (a[1].time || 0) - (b[1].time || 0);\n }\n if(a[1].fullSize !== b[1].fullSize) {\n return a[1].fullSize - b[1].fullSize;\n }\n return a[0] - b[0];\n });\n let i = cl[0][0];\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n throw new Error('No free texture unit');\n }\n\n /**\n * 释放掉i单元,并且设置内容到缓存channel中\n * @param i\n * @param setToChannel\n */\n releaseLockChannel(i, setToChannel) {\n if(this.locks[i]) {\n this.locks[i] = false;\n this.__lockUnits--;\n if(setToChannel) {\n this.channels[i] = setToChannel;\n }\n }\n }\n\n // 指定锁定一个单元\n lockChannel(i) {\n let channels = this.channels;\n let locks = this.locks;\n if(!locks[i]) {\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n }\n }\n\n /**\n * 释放纹理单元\n * @param gl\n */\n release(gl) {\n this.channels.forEach(item => {\n if(item) {\n gl.deleteTexture(item.texture);\n }\n });\n }\n\n get channels() {\n return this.__channels;\n }\n\n get locks() {\n return this.__locks;\n }\n\n 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 // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d');\n this.__renderMode = mode.CANVAS;\n }\n else if(this.tagName === 'svg') {\n this.__renderMode = mode.SVG;\n }\n else if(this.tagName === 'webgl') {\n let gl = this.__ctx = this.__dom.getContext('webgl', ca);\n this.__renderMode = mode.WEBGL;\n gl.program = webgl.initShaders(gl, vertex, fragment);\n gl.programMask = webgl.initShaders(gl, vertexMask, fragmentMask);\n gl.programClip = webgl.initShaders(gl, vertexMask, fragmentClip);\n gl.programOverflow = webgl.initShaders(gl, vertexMask, fragmentOverflow);\n gl.programCm = webgl.initShaders(gl, vertexCm, fragmentCm);\n gl.useProgram(gl.program);\n // 第一次渲染生成纹理缓存管理对象,收集渲染过程中生成的纹理并在gl纹理单元满了时进行绘制和清空,减少texImage2d耗时问题\n const MAX_TEXTURE_IMAGE_UNITS = Math.min(16, gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));\n this.__texCache = new TexCache(MAX_TEXTURE_IMAGE_UNITS);\n }\n this.refresh(null, true);\n // 第一次节点没有__root,渲染一次就有了才能diff\n if(this.dom.__root && this.dom.__root instanceof Root) {\n this.dom.__root.destroy();\n }\n this.__eventCbList = initEvent(this.dom, Root);\n this.dom.__root = this;\n }\n\n refresh(cb, isFirst) {\n this.__hookTask = null;\n let { isDestroyed, renderMode, ctx, defs, width, height } = this;\n if(isDestroyed) {\n return;\n }\n defs.clear();\n // 首次递归测量整树的继承,后续更改各自更新机制做,防止每次整树遍历;root检查首次直接做,后续在checkUpdate()中插入\n if(isFirst) {\n this.__checkRoot(renderMode, width, height);\n this.__computeMeasure(renderMode, ctx);\n }\n // 非首次刷新如果没有更新则无需继续\n else if(!this.__checkUpdate(renderMode, ctx, width, height)) {\n return;\n }\n // 获取所有字体和大小测量,仅svg需要,canvas直接做\n inject.measureText();\n this.__checkReflow(width, height);\n if(renderMode === mode.CANVAS && !this.props.noRender) {\n this.__clear(ctx, renderMode);\n 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 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 let hasUpdate;\n // root更新特殊提前,因为有继承因素\n if(updateRoot) {\n root.__updateRoot = null;\n hasUpdate = parseUpdate(renderMode, root, updateRoot,\n reflowList, measureList, cacheHash, cacheList);\n // 此时做root检查,防止root出现继承等无效样式,或者发生resize()\n if(hasUpdate) {\n root.__checkRoot(renderMode, width, height);\n }\n }\n // 汇总处理每个节点,k是递增数字直接循环遍历\n let keys = Object.keys(updateHash);\n for(let i = 0, len = keys.length; i < len; i++) {\n let t = parseUpdate(renderMode, root, updateHash[keys[i]],\n reflowList, measureList, cacheHash, cacheList, zHash, zList);\n hasUpdate = hasUpdate || t;\n }\n // 先做一部分reset避免下面measureList干扰,cacheList的是专门收集新增的额外节点\n root.__reflowList = reflowList;\n uniqueUpdateId = 0;\n root.__updateHash = root.__config[NODE_UPDATE_HASH] = {};\n cacheList.forEach(__config => {\n delete __config[NODE_UNIQUE_UPDATE_ID];\n });\n // zIndex改变的汇总修改,防止重复操作\n zList.forEach(item => {\n if(item.hasOwnProperty('__uniqueZId')) {\n delete item.__uniqueZId;\n item.__updateStruct(root.__structs);\n }\n });\n /**\n * 遍历每项节点,计算测量信息,节点向上向下查找继承信息,如果parent也是继承,先计算parent的\n * 过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n */\n let measureHash = {};\n measureList.forEach(node => {\n let { __config:{ [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId, [NODE_DOM_PARENT]: parent } } = node;\n // 在root下的component变更时root会进入,但其没有__uniqueUpdateId\n if(node !== root) {\n if(measureHash.hasOwnProperty(__uniqueUpdateId)) {\n return;\n }\n measureHash[__uniqueUpdateId] = true;\n }\n let last = node;\n // 检查measure的属性是否是inherit,在root下的component变更时root会进入,但其没有__uniqueUpdateId\n // 另外dom标识表明有dom变更强制进入\n let isInherit = node !== root\n && (updateHash[__uniqueUpdateId][UPDATE_ADD_DOM]\n || change.isMeasureInherit(updateHash[__uniqueUpdateId][UPDATE_STYLE]));\n // 是inherit,需要向上查找,从顶部向下递归计算继承信息\n if(isInherit) {\n while(parent && parent !== root) {\n let { __config: {\n [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId,\n }, currentStyle } = parent;\n let isInherit;\n if(parent.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n let style = updateHash[__uniqueUpdateId][UPDATE_STYLE];\n measureHash[__uniqueUpdateId] = true;\n let temp = change.measureInheritList(style);\n isInherit = !!temp.length;\n }\n else {\n isInherit = change.isMeasureInherit(currentStyle);\n }\n // 如果parent有inherit存入列表且继续向上,否则跳出循环\n if(isInherit) {\n last = parent;\n }\n else {\n break;\n }\n // 考虑component下的继续往上继承\n parent = parent.domParent;\n }\n }\n // 自顶向下查找inherit的,利用已有的方法+回调,当递归包含重复时标记防止重复\n last.__computeMeasure(renderMode, ctx, function(target) {\n if(target.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n measureHash[target.__config[NODE_UNIQUE_UPDATE_ID]] = true;\n }\n });\n });\n // 做完清空留待下次刷新重来\n for(let i = 0, len = keys.length; i < len; i++) {\n delete updateHash[keys[i]][UPDATE_CONFIG][NODE_UNIQUE_UPDATE_ID];\n }\n return hasUpdate;\n }\n\n /**\n * 除首次外每次刷新前检查reflow列表,计算需要reflow的节点局部重新布局\n * 当一个元素absolute不变时,其变化不会影响父元素和兄弟元素,直接自己重新局部LAYOUT包含子节点\n * 当absolute发生改变时,其变化会影响父和兄弟,视作父重新布局\n * 当inline变化时,视为其最近block/flex父变化\n * 当block变化时,往上查找最上层flex视为其变化,如不是则影响后面兄弟offset和父resize\n * 当flex变化时,往上查找最上层flex视为其变化,如不是则影响所有递归子节点layout和父resize\n * 以上3种情况向上查找时遇到absolute父均提前跳出,并标记absolute父LAYOUT\n * 上面所有情况即便结束还得额外看是否处于absolute中,是还是标记absolute重新布局\n * 当relative只变化left/top/right/bottom时,自己重新layout\n * 检测节点时记录影响的所有节点,最终形成一棵或n棵局部树\n * 需要重新布局的记作LAYOUT,被兄弟影响只需偏移的记作OFFSET,OFFSET可能会重复变为LAYOUT\n * 上述情况倘若发生包含重复,去掉子树,因子树视为被包含的重新布局\n * 如果有从root开始的,直接重新布局像首次那样即可\n * 如果非root,所有树根按先根顺序记录下来,依次执行局部布局\n * =========================\n * addDom比较特殊,是向已有节点中添加新的节点,检查影响与普通domDiff变化不同\n * @private\n */\n __checkReflow(width, height) {\n let { __reflowList: reflowList } = this;\n if(!reflowList.length) {\n return;\n }\n let root = this;\n let uniqueList = [];\n let hasRoot;\n __uniqueReflowId = 0;\n let reflowHash = {};\n // 遍历检查发生布局改变的节点列表,此时computedStyle还是老的,currentStyle是新的\n for(let i = 0, len = reflowList.length; i < len; i++) {\n let item = reflowList[i];\n let { node, component, addDom, removeDom } = item;\n // root提前跳出,完全重新布局\n if(node === this) {\n hasRoot = true;\n break;\n }\n // 添加时如果是cp则node取sr来布局\n if(addDom && node instanceof Component) {\n node = node.shadowRoot;\n }\n // 每个节点生成唯一的布局识别id存入hash防止重复\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n reflowHash[__uniqueReflowId++] = item;\n }\n // 每个节点都向上检查影响,以及是否从root开始完全重新,remove特殊对待,影响父节点视为普通父节点relay\n if(checkInfluence(root, reflowHash, node, component, addDom)) {\n hasRoot = true;\n if(addDom) {\n this.__zIndexChildren = null;\n }\n break;\n }\n // remove的要特殊对待,因为提前删除了父子兄弟关系,下面deepScan不会出现\n else if(removeDom) {\n uniqueList.push(item);\n }\n }\n __uniqueReflowId = 0;\n this.__reflowList = [];\n // 有root提前跳出\n if(hasRoot) {\n reflow.clearUniqueReflowId(reflowHash);\n // 布局分为两步,普通流和定位流,互相递归\n this.__layout({\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n // 绝对布局需要从根开始保存相对坐标系的容器引用,并根据relative/absolute情况变更\n this.__layoutAbs(this, {\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n this.__structs = this.__structure(0, 0);\n return true;\n }\n /**\n * 修剪树,自顶向下深度遍历\n * LAYOUT节点作为局部根,其递归子节点无需重复任何操作,直接去重\n * OFFSET节点作为局部根,其递归子节点先执行任何操作,后续根节点再偏移一次\n */\n else {\n this.__deepScan(function(node, options) {\n if(node.hasOwnProperty('__uniqueReflowId')) {\n let o = reflowHash[node.__uniqueReflowId];\n options.uniqueList.push(o);\n // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行\n return true;\n }\n // reflowHash没有记录则无返回继续递归执行\n }, { uniqueList });\n /**\n * 按顺序执行列表即可,上层LAYOUT先执行且停止递归子节点,上层OFFSET后执行等子节点先LAYOUT/OFFSET\n * 同级按先后顺序排列,过程中记录diff在结束后进行structs更新\n * 这里要注意margin合并的逻辑,因为最终都是block(flex等同),需要进行合并\n * 在处理一个block时,先判断是否是空block,同时看后面紧邻的有没有在uniqueList的下一个\n * 单独空block处理、2个相邻的非block处理直接可以进行判断\n * 中间的空block(即非空block的下一个是空block,且下一个不是最后一个),先记录下来list,合并后一并offset\n * 合并margin和Dom的逻辑一样,抽离共有方法\n **/\n let diffList = [];\n let diffI = 0;\n let mergeOffsetList = [];\n let __uniqueMergeOffsetId = 0;\n uniqueList.forEach(item => {\n let { node, component, addDom, removeDom } = item;\n // 重新layout的w/h数据使用之前parent暂存的,x使用parent,y使用prev或者parent的\n let cps = node.computedStyle, cts = node.currentStyle;\n let zIndex = cps[Z_INDEX], position = cps[POSITION], display = cps[DISPLAY];\n let isLastAbs = position === 'absolute';\n let isNowAbs = cts[POSITION] === 'absolute';\n let isLastNone = display === 'none';\n let isNowNone = cts[DISPLAY] === 'none';\n // none不可见布局无效可以无视\n if(isLastNone && isNowNone) {\n return;\n }\n let parent = node.domParent;\n let { __layoutData: { x, y, h }, width, computedStyle } = parent;\n let current = node;\n // cp的shadowRoot要向上到cp本身,考虑高阶组件在内到真正的顶层cp\n if(current.isShadowRoot) {\n current = current.hostRoot;\n }\n // y使用prev或者parent的,首个节点无prev,prev要忽略absolute的和display:none的\n let ref = current.prev;\n let hasFlowPrev;\n while(ref) {\n if(ref instanceof Text\n || (ref.computedStyle[POSITION] !== 'absolute' && ref.computedStyle[DISPLAY] !== 'none')) {\n y = ref.y + ref.outerHeight;\n hasFlowPrev = true;\n break;\n }\n ref = ref.prev;\n }\n // 找不到prev以parent为基准,找到则增加自身,排除remove\n if(!removeDom) {\n if(!hasFlowPrev) {\n y += computedStyle[MARGIN_TOP] + computedStyle[BORDER_TOP_WIDTH] + computedStyle[PADDING_TOP];\n }\n x += computedStyle[MARGIN_LEFT] + computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT];\n }\n // 找到最上层容器,如果是组件的子节点,以sr为container,sr本身往上找\n let container = node;\n // remove的节点本身无需再次布局\n if(!removeDom) {\n if(isNowAbs) {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n if(!container) {\n container = root;\n }\n // 由setState引发的要检查是cp自身还是更上层,如果cp被abs包含,那么node是cp的父亲,否则node是cp的sr\n // 而这种情况下传cp或node都一样,所以最终统一传node\n parent.__layoutAbs(container, null, node);\n // 优先判断dom变更\n if(addDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n return;\n }\n // 前后都是abs无需偏移后面兄弟和parent调整,component变化节点需更新struct\n else if(isLastAbs) {\n if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n }\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n return;\n }\n // 标识flow变abs,可能引发zIndex变更,重设struct和svg\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // 现在是普通流,不管之前是啥直接布局,排除remove删除的\n else {\n node.__layout({\n x,\n y,\n w: width,\n h,\n });\n y += node.outerHeight;\n if(component) {\n container = node;\n }\n else {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n }\n if(!container) {\n container = root;\n }\n // 防止geom\n if(node instanceof Dom) {\n node.__layoutAbs(container, {\n x,\n y,\n w: width,\n h,\n });\n }\n }\n }\n\n // 向上查找最近的parent是relative,需再次累加ox/oy,无需继续向上递归,因为parent已经递归包含了\n // 这样node重新布局后再次设置其使用parent的偏移\n let p = node;\n while(p && p !== root) {\n p = p.domParent;\n computedStyle = p.computedStyle;\n if(computedStyle[POSITION] === 'relative') {\n let { ox, oy } = p;\n ox && node.__offsetX(ox);\n oy && node.__offsetY(oy);\n break;\n }\n }\n\n // 向下调整next的flow位置,遇到重复LAYOUT的跳出等待其调用并处理其next,忽视掉abs,margin和abs在merge中做\n if(node.isShadowRoot) {\n node = node.hostRoot;\n }\n let next = node.next;\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n if(next.computedStyle[POSITION] === 'absolute') {\n next = next.next;\n continue;\n }\n let { y: oy } = next;\n let diff = y - oy;\n if(diff) {\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n let target = next;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let cs = target.computedStyle;\n if(cs[POSITION] !== 'absolute' && cs[DISPLAY] !== 'none') {\n target.__offsetY(diff, true, REPAINT);\n }\n next = next.next;\n }\n }\n break;\n }\n\n // 去重防止abs并记录parent,整个结束后按先序顺序进行margin合并以及偏移,注意忽略有display:none变block同时为absolute的\n if(!parent.hasOwnProperty('__uniqueMergeOffsetId') && !(isNowAbs && isLastNone)) {\n parent.__uniqueMergeOffsetId = __uniqueMergeOffsetId++;\n mergeOffsetList.push(parent);\n }\n\n // add和remove都需父节点重新生成struct,zIndexChildren已在对应api操作的before()侦听做了\n if(addDom || removeDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // component未知dom变化,所以强制重新struct,text则为其父节点,同时防止zIndex变更影响父节点\n else if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n node.domParent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(node.domParent);\n }\n }\n }\n // display有none变化,重置struct和zIndexChildren\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n });\n /**\n * mergeMargin后续调整,记录的是变更节点的父节点,因此每个节点内部直接遍历孩子进行\n * 由于保持先根遍历的顺序,因此会从最上最里的节点开始,先进行margin合并\n * 由于之前忽略掉abs节点,因此再检查直接abs是否要调整\n * 完成后对此父节点的后续兄弟节点进行调整,多次不会干扰影响\n * 然后继续往上循环,直到root结束\n */\n let inDirectAbsList = [];\n mergeOffsetList.forEach(parent => {\n delete parent.__uniqueMergeOffsetId;\n let flowChildren = parent.flowChildren, absChildren = parent.absChildren;\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length, lastChild;\n let isStart, startIndex, startNode;\n // 遍历flow孩子,从开始变化的节点开始,看变化造成的影响,对其后面节点进行偏移,并统计总偏移量\n for(let i = 0; i < length; i++) {\n let item = flowChildren[i];\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n let isXom = item instanceof Xom;\n // 忽略掉前面没有变更的节点,不能合并\n if(!isStart && isXom) {\n if(item.hasOwnProperty('__uniqueReflowId')) {\n isStart = true;\n startIndex = i;\n startNode = item;\n }\n }\n // 开始变更的节点,至少不是第0个\n let cs = isXom && item.currentStyle;\n let isInline = isXom && cs[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(cs[DISPLAY]) > -1;\n lastChild = item;\n // 每次循环开始前,这次不是block的话,看之前遗留的,可能是以空block结束,需要特殊处理,单独一个空block也包含\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length && isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n // 和普通布局类似,只是不用重新布局只需处理合并margin再根据差值偏移\n if(isXom && !isInline) {\n let isNone = isXom && cs[DISPLAY] === 'none';\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n // 空block要留下轮循环看,除非是最后一个,非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n if(isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n // 需要合并的情况,根据记录数和索引向上向下遍历节点设置偏移,同时设置总偏移量供父级使用\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0,最后一个一定有不必判断isStart\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n }\n // 先检查parent的尺寸是否发生了变化,从而决定是否调整next以及向上递归调整\n let cs = parent.currentStyle;\n let height = cs[HEIGHT];\n let isContainer = parent === root || parent.isShadowRoot || cs[POSITION] === 'absolute' || cs[POSITION] === 'relative';\n if(height[1] === AUTO && lastChild) {\n let oldH = parent.height + parent.computedStyle[PADDING_TOP];\n let nowH = lastChild.y + lastChild.outerHeight - parent.y;\n let diff = nowH - oldH;\n // 调整next以及非固定PX的abs,再递归向上\n if(diff) {\n parent.__resizeY(diff, REPAINT);\n let container;\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = item.currentStyle;\n // 是容器,所有的都调整,不是容器,其偏移是上级parent的某一个,根据情况具体不同\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n else if(bottom[1] === PX) {\n item.__offsetY(diff, true, REPAINT);\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n else if(top[1] === PERCENT) {\n if(isContainer) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n // 非容器的特殊处理\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n if(container.currentStyle[HEIGHT][1] !== PX) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, null, item);\n }\n // 不在容器内说明在上级,存入等结束后统一重新布局\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, item]);\n }\n }\n }\n reflow.offsetAndResizeByNodeOnY(parent, root, reflowHash, diff, inDirectAbsList);\n return;\n }\n }\n // 没有diff变化或者固定尺寸,可能内部发生变化,调整AUTO的abs,不递归向上\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom } = item.currentStyle;\n if(top[1] === AUTO && bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n }\n });\n // merge过程中需要重新布局的abs\n inDirectAbsList.forEach(arr => {\n arr[0].__layoutAbs(arr[1], null, arr[2]);\n });\n\n // 调整因reflow造成的原struct数据索引数量偏差,纯zIndex的已经在repaint里面重新生成过了\n // 这里因为和update保持一致的顺序,因此一定是先根顺序且互不包含\n let diff = 0, lastIndex = 0, isFirst = true, structs = root.__structs;\n diffList.forEach(item => {\n let [ns, d] = item;\n // 第一个有变化的,及后面无论有无变化都需更新\n // 第1个变化区域无需更改前面一段\n if(isFirst) {\n isFirst = false;\n lastIndex = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1;\n diff += d;\n }\n // 第2+个变化区域看是否和前面一个相连,有不变的段则先偏移它,然后再偏移自己\n else {\n let j = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1 + diff;\n for(let i = lastIndex; i < j; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n lastIndex = j;\n diff += d;\n }\n });\n // 后面的要根据偏移量校正索引\n if(diff) {\n for(let i = lastIndex, len = structs.length; i < len; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n }\n // 清除id\n reflow.clearUniqueReflowId(reflowHash);\n }\n }\n\n // 特殊覆盖方法,不需要super()计算自己,因为放在每次checkRoot()做过了\n __computeMeasure(renderMode, ctx) {\n css.computeMeasure(this, true);\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx);\n });\n }\n\n // 每个root拥有一个刷新hook,多个root塞到frame的__hookTask里\n // frame在所有的帧刷新逻辑执行后检查hook列表,进行root刷新操作\n __frameHook() {\n if(!this.__hookTask) {\n let r = this.__hookTask = (() => {\n this.refresh();\n });\n frame.__hookTask.push(r);\n }\n }\n\n __clear(ctx, renderMode) {\n if(renderMode === mode.CANVAS) {\n // 可能会调整宽高,所以每次清除用最大值\n this.__mw = Math.max(this.__mw, this.width);\n this.__mh = Math.max(this.__mh, this.height);\n // 清除前得恢复默认matrix,防止每次布局改变了属性\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, this.__mw, this.__mh);\n }\n else if(renderMode === mode.WEBGL) {\n ctx.clearColor(0, 0, 0, 0);\n ctx.clear(ctx.COLOR_BUFFER_BIT);\n }\n }\n\n get dom() {\n return this.__dom;\n }\n\n get uuid() {\n return this.__uuid;\n }\n\n get renderMode() {\n return this.__renderMode;\n }\n\n get ctx() {\n return this.__ctx;\n }\n\n get defs() {\n return this.__defs;\n }\n\n get taskUp() {\n return this.__taskUp;\n }\n\n get taskCp() {\n return this.__taskCp;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get animateController() {\n return this.__animateController;\n }\n\n get texCache() {\n return this.__texCache;\n }\n}\n\nexport default Root;\n","import Geom from './Geom';\nimport mode from '../mode';\nimport painter from '../../util/painter';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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.length >= 2) {\n num++;\n }\n if(controlB.length >= 2) {\n num += 2;\n }\n return num;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getNewPoint(x1, y1, x2, y2, controlA, controlB, num, start = 0, end = 1) {\n if(start > 0 || end < 1) {\n if(num === 3) {\n [[x1, y1], controlA, controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, controlB, [x2, y2]], start, end);\n }\n else if(num === 2) {\n [[x1, y1], controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlB, [x2, y2]], start, end);\n }\n else if(num === 1) {\n [[x1, y1], controlA, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, [x2, y2]], start, end);\n }\n else {\n let a = Math.abs(x1 - x2);\n let b = Math.abs(y1 - y2);\n x1 += a * start;\n y1 += b * start;\n x2 -= a * (1 - end);\n y2 -= b * (1 - end);\n }\n }\n return [x1, y1, x2, y2, controlA, controlB];\n}\n\nclass Line extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // x1,y1和x2,y2表明线段的首尾坐标,control表明控制点坐标\n if(this.isMulti) {\n this.__x1 = [0];\n this.__y1 = [0];\n this.__x2 = [1];\n this.__y2 = [1];\n this.__controlA = [[]];\n this.__controlB = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.x1)) {\n this.__x1 = props.x1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x1)) {\n this.__x1 = [parseFloat(props.x1) || 0];\n }\n if(Array.isArray(props.y1)) {\n this.__y1 = props.y1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y1)) {\n this.__y1 = [parseFloat(props.y1) || 0];\n }\n if(Array.isArray(props.x2)) {\n this.__x2 = props.x2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x2)) {\n this.__x2 = [parseFloat(props.x2) || 0];\n }\n if(Array.isArray(props.y2)) {\n this.__y2 = props.y2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y2)) {\n this.__y2 = [parseFloat(props.y2) || 0];\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__x1.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__x1.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__x1.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__x1.map(() => v);\n }\n }\n else {\n this.__x1 = this.__y1 = this.__start = 0;\n this.__x2 = this.__y2 = this.__end = 1;\n this.__controlA = [];\n this.__controlB = [];\n if(!isNil(props.x1)) {\n this.__x1 = parseFloat(props.x1) || 0;\n }\n if(!isNil(props.y1)) {\n this.__y1 = parseFloat(props.y1) || 0;\n }\n if(!isNil(props.x2)) {\n this.__x2 = parseFloat(props.x2) || 0;\n }\n if(!isNil(props.y2)) {\n this.__y2 = parseFloat(props.y2) || 0;\n }\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA;\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB;\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, __cacheProps, isMulti } = this;\n let rebuild;\n ['x1', 'x2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originX, width, isMulti);\n }\n });\n ['y1', 'y2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originY, height, isMulti);\n }\n });\n ['controlA', 'controlB'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuildC(this[k], originX, originY, width, height, isMulti);\n }\n });\n ['start', 'end'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = this[k];\n }\n });\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 },\n } = this;\n this.buildCache(originX, originY);\n let { x1, y1, x2, y2, controlA, controlB } = __cacheProps;\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n if(!isMulti) {\n x1 = [x1];\n x2 = [x2];\n y1 = [y1];\n y2 = [y2];\n controlA = [controlA];\n controlB = [controlB];\n }\n x1.forEach((xa, i) => {\n let ya = y1[i];\n let xb = x2[i];\n let yb = y2[i];\n let ca = controlA[i];\n let cb = controlB[i];\n if((isNil(ca) || ca.length < 2) && (isNil(cb) || cb.length < 2)) {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[0] = Math.min(bbox[0], xb - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[1] = Math.min(bbox[1], yb - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[2] = Math.max(bbox[2], xb + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n bbox[3] = Math.max(bbox[3], yb + oy);\n }\n else if(isNil(ca) || ca.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(isNil(cb) || cb.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n });\n return bbox;\n }\n}\n\nexport default Line;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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 limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getLength(list, isMulti) {\n let res = [];\n let total = 0;\n let increase = [];\n if(isMulti) {\n total = [];\n list.forEach(list => {\n let temp = getLength(list);\n res.push(temp.list);\n total.push(temp.total);\n increase.push([0].concat(temp.increase));\n });\n }\n else if(Array.isArray(list)) {\n total = 0;\n increase.push(0);\n let start = 0;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item)) {\n start = i;\n break;\n }\n }\n let prev = list[start];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n let a = Math.abs(item[0] - prev[0]);\n let b = Math.abs(item[1] - prev[1]);\n let c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n res.push(c);\n total += c;\n increase.push(total);\n prev = item;\n }\n else if(item.length === 4) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]]], 2);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[2], item[3]];\n }\n else if(item.length === 6) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]], [item[4], item[5]]], 3);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[4], item[5]];\n }\n }\n }\n return {\n list: res,\n total,\n increase,\n };\n}\n\nfunction getIndex(list, t, i, j) {\n if(i === j) {\n if(list[i] > t) {\n return i - 1;\n }\n return i;\n }\n let middle = i + ((j - i) >> 1);\n if(list[middle] === t) {\n return middle;\n }\n else if(list[middle] > t) {\n return getIndex(list, t, i, Math.max(middle - 1, i));\n }\n else {\n return getIndex(list, t, Math.min(middle + 1, j), j);\n }\n}\n\nfunction getNewList(list, len, start = 0, end = 1) {\n if(start === 0 && end === 1) {\n return list;\n }\n if(start >= end) {\n return [];\n }\n let i = 0, j = list.length - 1;\n if(start > 0) {\n i = getIndex(len.increase, start * len.total, i, j);\n }\n if(end < 1) {\n j = getIndex(len.increase, end * len.total, i, j);\n }\n list = util.clone(list);\n end *= len.total;\n let prePercent = 1;\n if(end > len.increase[j]) {\n let prev = list[j].slice(list[j].length - 2); // 最后2个点是x,y,前面是control\n let current = list[j + 1];\n let l = len.list[j];\n let diff = end - len.increase[j];\n let t = diff / l;\n prePercent = t;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[j + 1] = [current[1] - (1 - t) * a, current[1] - (1 - t) * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], res[3][0], res[3][1]];\n }\n }\n start *= len.total;\n if(start > len.increase[i]) {\n let prev = list[i].slice(list[i].length - 2);\n let current = list[i + 1];\n let l = len.list[i];\n // 同一条线段时如果有end裁剪,会影响start长度\n if(i === j && prePercent !== 1) {\n l *= prePercent;\n }\n let diff = start - len.increase[i];\n let t = diff / l;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[i] = [prev[0] + t * a, prev[1] + t * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([[current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([[current[4], current[5]], [current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], current[4], current[5]];\n }\n }\n if(j < list.length - 2) {\n list = list.slice(0, j + 2);\n }\n if(i > 0) {\n list = list.slice(i);\n }\n return list;\n}\n\nclass Polyline extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 所有点的列表\n if(this.isMulti) {\n this.__points = [[]];\n this.__controls = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__points.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__points.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__points.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__points.map(() => v);\n }\n }\n else {\n this.__points = [];\n // 控制点\n this.__controls = [];\n this.__start = 0;\n this.__end = 1;\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n }\n if(Array.isArray(props.controls)) {\n this.__controls = props.controls;\n }\n if(Array.isArray(props.points)) {\n this.__points = props.points;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n return points.map((item, i) => {\n if(!Array.isArray(item)) {\n return;\n }\n let len = item.length;\n if(isControl) {\n if(len !== 0 && len !== 2 && len !== 4) {\n return;\n }\n }\n else {\n if(len !== 0 && len !== 2) {\n return;\n }\n }\n let res = [];\n for(let i = 0; i < len; i++) {\n if(i % 2 === 0) {\n res.push(originX + item[i] * width);\n }\n else {\n res.push(originY + item[i] * height);\n }\n }\n return res;\n });\n }\n\n // 供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 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 },\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let { points, controls } = __cacheProps;\n if(!isMulti) {\n points = [points];\n controls = [controls];\n }\n points.forEach((pointList, i) => {\n if(!pointList || pointList.length < 2 || pointList[0].length < 2 || pointList[1].length < 2) {\n return;\n }\n let controlList = controls[i] || [];\n let [xa, ya] = pointList[0];\n for(let i = 1, len = pointList.length; i < len; i++) {\n let [xb, yb] = pointList[i];\n let c = controlList[i - 1];\n if(c && c.length === 4) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], c[2], c[3], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(c && c.length === 2) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n }\n xa = xb;\n ya = yb;\n }\n });\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Polyline;\n","import Polyline from './Polyline';\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} } = 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Sector;\n","import Geom from './Geom';\nimport util from \"../../util/util\";\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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 }\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n bbox[0] = Math.min(bbox[0], originX - ox);\n bbox[1] = Math.min(bbox[1], originY - oy);\n bbox[2] = Math.max(bbox[2], originX + width + ox);\n bbox[3] = Math.max(bbox[3], originY + height + oy);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Rect;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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));\n }\n else {\n __cacheProps.r = r * width * 0.5;\n __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Circle;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let rx = 0, ry = 0;\n if(isMulti) {\n let mx = 0, my = 0;\n __cacheProps.rx.forEach((rx, i) => {\n mx = Math.max(rx, mx);\n my = Math.max(ry, __cacheProps.ry[i]);\n });\n rx = mx;\n ry = my;\n }\n else {\n rx = __cacheProps.rx;\n ry = __cacheProps.ry;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - rx - ox;\n let xb = cx + rx + ox;\n let ya = cy - ry - oy;\n let yb = cy + ry + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Ellipse;\n","import reset from '../style/reset';\n\nlet fullCssProperty = {\n skewX: 'kx',\n skewY: 'ky',\n transform: 'tf',\n fontSize: 'fz',\n offset: 'os',\n easing: 'e',\n filter: 'ft',\n boxShadow: 'bd',\n overflow: 'of',\n backgroundClip: 'bp',\n textOverflow: 'tof',\n flexWrap: 'fp',\n perspective: 'ppt',\n rotate3d: 'r3',\n};\n\nlet abbrCssProperty = {\n os: 'offset', // 非css属性不会被下面反向遍历插入,手动\n e: 'easing',\n};\n\nlet fullAnimate = {\n value: 'v',\n options: 'o',\n};\n\nlet abbrAnimate = {};\n\nlet fullAnimateOption = {\n duration: 'dt',\n delay: 'd',\n endDelay: 'ed',\n iterations: 'i',\n direction: 'dc',\n fill: 'f',\n fps: 'fp',\n playbackRate: 'p',\n spfLimit: 'sl',\n};\n\nlet abbrAnimateOption = {};\n\nreset.DOM_KEY_SET.concat(reset.GEOM_KEY_SET).forEach(k => {\n if(fullCssProperty.hasOwnProperty(k)) {\n abbrCssProperty[fullCssProperty[k]] = k;\n return;\n }\n let v = k.charAt(0) + k.replace(/[a-z]/g, '').toLowerCase();\n fullCssProperty[k] = v;\n abbrCssProperty[v] = k;\n});\n\nObject.keys(fullAnimate).forEach(k => {\n abbrAnimate[fullAnimate[k]] = k;\n});\n\nObject.keys(fullAnimateOption).forEach(k => {\n abbrAnimateOption[fullAnimateOption[k]] = k;\n});\n\nexport default {\n fullCssProperty,\n abbrCssProperty,\n fullAnimate,\n abbrAnimate,\n fullAnimateOption,\n abbrAnimateOption,\n};\n","import abbr from './abbr';\nimport Node from '../node/Node';\nimport Component from '../node/Component';\nimport $$type from '../util/$$type';\nimport util from '../util/util';\nimport inject from '../util/inject';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet { isNil, isFunction, isPrimitive, clone, extend } = util;\nlet { abbrCssProperty, abbrAnimateOption, abbrAnimate } = abbr;\n\n/**\n * 还原缩写到全称,涉及样式和动画属性\n * @param target 还原的对象\n * @param hash 缩写映射\n */\nfunction abbr2full(target, hash) {\n // 也许节点没写样式\n if(target) {\n Object.keys(target).forEach(k => {\n // var-attr格式特殊考虑,仅映射attr部分,var-还要保留\n if(k.indexOf('var-') === 0) {\n let k2 = k.slice(4);\n if(hash.hasOwnProperty(k2)) {\n let fk = hash[k2];\n target['var-' + fk] = target[k];\n // delete target[k];\n }\n }\n // 普通样式缩写还原\n else if(hash.hasOwnProperty(k)) {\n let fk = hash[k];\n target[fk] = target[k];\n // 删除以免二次解析\n delete target[k];\n }\n });\n }\n}\n\nfunction replaceVars(json, vars) {\n if(json && vars) {\n // 新版vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // 排除特殊的library\n if(Array.isArray(member) && member.length && member[0] !== 'library' && vars.hasOwnProperty(id)) {\n let target = json;\n for(let i = 0, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // undefined和null意义不同\n if(v === undefined) {\n return;\n }\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n target[k] = v;\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Slot miss ' + k);\n return;\n }\n }\n }\n });\n }\n }\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-') === 0) {\n let v = json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(4);\n // 有id且变量里面传入了替换的值,值可为null,因为某些情况下空为自动\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n // undefined和null意义不同\n if(value === undefined) {\n return;\n }\n let target = json;\n // 如果有.则特殊处理子属性\n if(k2.indexOf('.') > -1) {\n let list = k2.split('.');\n let len = list.length;\n for(let i = 0; i < len - 1; i++) {\n k2 = list[i];\n // 避免异常\n if(target[k2]) {\n target = target[k2];\n }\n else {\n inject.warn('parseJson vars is not exist: ' + v.id + ', ' + k + ', ' + list.slice(0, i).join('.'));\n return;\n }\n }\n k2 = list[len - 1];\n }\n // 支持函数模式和值模式\n if(isFunction(value)) {\n value = value(v);\n }\n target[k2] = value;\n }\n }\n });\n }\n }\n}\n\nfunction replaceLibraryVars(json, hash, vars) {\n if(vars) {\n // 新版同级vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // library.xxx,需要>=2的长度\n if(Array.isArray(member) && member.length > 1 && vars.hasOwnProperty(id)) {\n if(member[0] === 'library') {\n let target = hash;\n for(let i = 1, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n let old = target[k];\n // 直接替换library的子对象,需补充id和tagName\n if(i === 1) {\n target[k] = Object.assign({ id: old.id, tagName: old.tagName }, v);\n }\n // 替换library中子对象的一个属性直接赋值\n else {\n target[k] = v;\n }\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Library slot miss ' + k);\n return;\n }\n }\n }\n }\n });\n }\n }\n // 兼容老版var-\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-library.') === 0) {\n let v = json[k];\n // 直接移除library插槽,防止下面调用replaceVars(json, vars)时报错\n delete json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(12);\n // 有id且变量里面传入了替换的值\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n if(isFunction(value)) {\n value = value(v);\n }\n // 替换图层的值必须是一个有tagName的对象\n if(!value || !value.tagName) {\n return;\n }\n // library对象也要加上id,与正常的library保持一致\n hash[k2] = Object.assign({ id: k2 }, value);\n }\n }\n });\n }\n }\n}\n\n/**\n * 遍历一遍library的一级,将一级的id存到hash上,无需递归二级,\n * 因为顺序前提要求排好且无循环依赖,所以被用到的一定在前面出现,\n * 一般是无children的元件在前,包含children的div在后\n * 即便library中的元素有children或library,在linkChild时将其link过去,parse递归会继续处理\n * @param item:library的一级孩子\n * @param hash:存放library的key/value引用\n */\nfunction linkLibrary(item, hash) {\n let id = item.id;\n // library中一定有id,因为是一级,二级+特殊需求才会出现放开\n if(isNil(id)) {\n throw new Error('Library item miss id: ' + JSON.stringify(item));\n }\n else {\n hash[id] = item;\n }\n}\n\n/**\n * 链接child到library文件,\n * props需要是clone的,因为防止多个child使用同一个库文件\n * children则直接引用,无需担心多个使用同一个\n * library也需要带上,在library直接子元素还包含library时会用到\n * @param child\n * @param libraryItem\n */\nfunction linkChild(child, libraryItem) {\n // 规定图层child只有init和动画,属性和子图层来自库\n child.tagName = libraryItem.tagName;\n child.props = clone(libraryItem.props);\n child.children = libraryItem.children;\n child.library = libraryItem.library;\n // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况\n Object.keys(libraryItem).forEach(k => {\n if(k.indexOf('var-') === 0 && !child.hasOwnProperty(k)) {\n child[k] = libraryItem[k];\n }\n });\n // 删除以免二次解析\n child.libraryId = null;\n // 规定图层实例化的属性和样式在init上,优先使用init,然后才取原型链的props\n let { init } = child;\n if(init) {\n let props = child.props = child.props || {};\n let style = props.style;\n extend(props, init);\n // style特殊处理,防止被上面覆盖丢失原始值\n if(style) {\n extend(style, init.style);\n props.style = style;\n }\n // 删除以免二次解析\n child.init = null;\n }\n}\n\nfunction parse(karas, json, animateRecords, opt, hash = {}) {\n if(isPrimitive(json) || json instanceof Node || json instanceof Component) {\n return json;\n }\n if(Array.isArray(json)) {\n return json.map(item => {\n return parse(karas, item, animateRecords, opt, hash);\n });\n }\n // 先判断是否是个链接到库的节点,是则进行链接操作\n let libraryId = json.libraryId;\n if(!isNil(libraryId)) {\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,tagName和属性和子图层来自库\n if(libraryItem) {\n linkChild(json, libraryItem);\n }\n else {\n throw new Error('Link library miss id: ' + libraryId);\n }\n json.libraryId = null;\n }\n // 再判断是否有library形成一个新的作用域,会出现library下的library使得一个链接节点链接后出现library的情况\n let library = json.library;\n if(Array.isArray(library)) {\n hash = {};\n library.forEach(item => {\n linkLibrary(item, hash);\n });\n // 替换library插槽\n replaceLibraryVars(json, hash, opt.vars);\n json.library = null;\n }\n let { tagName, props = {}, children = [], animate = [] } = json;\n if(!tagName) {\n throw new Error('Dom must have a tagName: ' + JSON.stringify(json));\n }\n let style = props.style;\n (opt.abbr !== false) && abbr2full(style, abbrCssProperty);\n // 先替换style的\n replaceVars(style, opt.vars);\n // 再替换静态属性,style也作为属性的一种,目前尚未被设计为被替换\n replaceVars(props, opt.vars);\n // 替换children里的内容,如文字,无法直接替换tagName/props/children/animate本身,因为下方用的还是原引用\n replaceVars(json, opt.vars);\n 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 let animationRecord;\n if(animate) {\n if(Array.isArray(animate)) {\n let has;\n animate.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrAnimate);\n let { value, options } = item;\n // 忽略空动画\n if(Array.isArray(value) && value.length) {\n has = true;\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n });\n if(has) {\n animationRecord = {\n animate,\n target: vd,\n };\n }\n }\n else {\n (opt.abbr !== false) && abbr2full(animate, abbrAnimate);\n let { value, options } = animate;\n if(Array.isArray(value) && value.length) {\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n animationRecord = {\n animate,\n target: vd,\n };\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n }\n }\n // 产生实际动画运行才存入列表供root调用执行\n if(animationRecord) {\n animateRecords.push(animationRecord);\n }\n return vd;\n}\n\nexport default parse;\n","import parse from './parse';\nimport abbr from './abbr';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport font from '../style/font';\nimport Controller from '../animate/Controller';\n\nlet o = {\n parse(karas, json, dom, options = {}) {\n // 特殊单例声明无需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';\n\nexport default {\n css,\n reset,\n unit,\n font,\n abbr,\n};\n","import Animation from './Animation';\nimport Controller from './Controller';\nimport easing from './easing';\nimport frame from './frame';\n\nexport default {\n Animation,\n Controller,\n easing,\n frame,\n};\n","import level from './level';\nimport change from './change';\nimport Page from './Page';\nimport Cache from './Cache';\n\nexport default {\n level,\n change,\n Page,\n Cache,\n};\n","import Node from './node/Node';\nimport Text from './node/Text';\nimport Xom from './node/Xom';\nimport Dom from './node/Dom';\nimport Img from './node/Img';\nimport Root from './node/Root';\nimport tag from './node/tag';\nimport mode from './node/mode';\nimport Geom from './node/geom/Geom';\nimport Line from './node/geom/Line';\nimport Polyline from './node/geom/Polyline';\nimport Polygon from './node/geom/Polygon';\nimport Sector from './node/geom/Sector';\nimport Rect from './node/geom/Rect';\nimport Circle from './node/geom/Circle';\nimport Ellipse from './node/geom/Ellipse';\nimport Component from './node/Component';\nimport Event from './util/Event';\nimport util from './util/util';\nimport $$type from './util/$$type';\nimport builder from './util/builder';\nimport updater from './util/updater';\nimport inject from './util/inject';\nimport enums from './util/enums';\nimport debug from './util/debug';\nimport parser from './parser/index';\nimport style from './style/index';\nimport animate from './animate/index';\nimport math from './math/index';\nimport refresh from './refresh/index';\nimport { version } from '../package.json';\n\nGeom.register('$line', Line);\nGeom.register('$polyline', Polyline);\nGeom.register('$polygon', Polygon);\nGeom.register('$sector', Sector);\nGeom.register('$rect', Rect);\nGeom.register('$circle', Circle);\nGeom.register('$ellipse', Ellipse);\n\nlet karas = {\n version,\n render(root, dom) {\n if(!(root instanceof Root)) {\n throw new Error('Render dom must be canvas/svg');\n }\n if(dom) {\n root.appendTo(dom);\n }\n return root;\n },\n createElement(tagName, props) {\n props = props || {};\n let children = [];\n for(let i = 2, len = arguments.length; i < len; i++) {\n children.push(arguments[i]);\n }\n if(util.isString(tagName)) {\n if(tagName.charAt(0) === '$') {\n return this.createGm(tagName, props);\n }\n else {\n return this.createVd(tagName, props, children);\n }\n }\n else if(tagName) {\n return this.createCp(tagName, props, children);\n }\n },\n createVd(tagName, props, children = []) {\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n if(tag.TAG_NAME.hasOwnProperty(tagName)) {\n return {\n tagName,\n props,\n children,\n $$type: $$type.TYPE_VD,\n };\n }\n throw new Error(`Can not use <${tagName}>`);\n },\n createGm(tagName, props) {\n return {\n tagName,\n props,\n $$type: $$type.TYPE_GM,\n };\n },\n createCp(klass, props, children = []) {\n props.children = children;\n return {\n klass,\n props,\n $$type: $$type.TYPE_CP,\n };\n },\n parse(json, dom, options) {\n return parser.parse(this, json, dom, options);\n },\n loadAndParse(json, dom, options) {\n return parser.loadAndParse(this, json, dom, options);\n },\n mode,\n Component,\n Node,\n Text,\n Geom,\n Xom,\n Dom,\n Img,\n Root,\n Event,\n util,\n inject,\n style,\n parser,\n animate,\n math,\n builder,\n updater,\n refresh,\n enums,\n set debug(v) {\n debug.flag = !!v;\n },\n};\n\nbuilder.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\n\nif(typeof window !== 'undefined') {\n window.karas = karas;\n}\nelse if(typeof self !== 'undefined') {\n self.karas = karas;\n}\n\nexport default karas;\n"],"names":["STYLE_KEY","POSITION","DISPLAY","TOP","RIGHT","BOTTOM","LEFT","MARGIN_TOP","MARGIN_RIGHT","MARGIN_BOTTOM","MARGIN_LEFT","PADDING_TOP","PADDING_RIGHT","PADDING_BOTTOM","PADDING_LEFT","FONT_SIZE","FONT_FAMILY","COLOR","FONT_STYLE","FONT_WEIGHT","LINE_HEIGHT","BACKGROUND_IMAGE","BACKGROUND_COLOR","BACKGROUND_SIZE","BACKGROUND_REPEAT","BACKGROUND_POSITION_X","BACKGROUND_POSITION_Y","BORDER_TOP_WIDTH","BORDER_RIGHT_WIDTH","BORDER_BOTTOM_WIDTH","BORDER_LEFT_WIDTH","BORDER_TOP_COLOR","BORDER_RIGHT_COLOR","BORDER_BOTTOM_COLOR","BORDER_LEFT_COLOR","BORDER_TOP_STYLE","BORDER_RIGHT_STYLE","BORDER_BOTTOM_STYLE","BORDER_LEFT_STYLE","BORDER_TOP_LEFT_RADIUS","BORDER_TOP_RIGHT_RADIUS","BORDER_BOTTOM_RIGHT_RADIUS","BORDER_BOTTOM_LEFT_RADIUS","WIDTH","HEIGHT","FLEX_GROW","FLEX_SHRINK","FLEX_BASIS","FLEX_DIRECTION","JUSTIFY_CONTENT","ALIGN_ITEMS","ALIGN_SELF","TEXT_ALIGN","TRANSFORM_ORIGIN","VISIBILITY","OPACITY","Z_INDEX","TRANSFORM","TRANSLATE_X","TRANSLATE_Y","TRANSLATE_Z","SCALE_X","SCALE_Y","SCALE_Z","SKEW_X","SKEW_Y","ROTATE_X","ROTATE_Y","ROTATE_Z","ROTATE_3D","PERSPECTIVE","PERSPECTIVE_ORIGIN","FILTER","BOX_SHADOW","POINTER_EVENTS","OVERFLOW","MIX_BLEND_MODE","BACKGROUND_CLIP","WHITE_SPACE","TEXT_OVERFLOW","LETTER_SPACING","LINE_CLAMP","ORDER","FLEX_WRAP","ALIGN_CONTENT","TEXT_STROKE_WIDTH","TEXT_STROKE_COLOR","TEXT_STROKE_OVER","FILL","STROKE","STROKE_WIDTH","STROKE_DASHARRAY","STROKE_DASHARRAY_STR","STROKE_LINECAP","STROKE_LINEJOIN","STROKE_MITERLIMIT","FILL_RULE","MATRIX","BORDER_TOP","BORDER_RIGHT","BORDER_BOTTOM","BORDER_LEFT","TRANSLATE_PATH","STYLE2LOWER_MAP","style2Lower","s","toLowerCase","replace","$0","$1","toUpperCase","STYLE2UPPER_MAP","style2Upper","$2","STYLE_R_KEY","STYLE_RV_KEY","STYLE_V_KEY","Object","keys","forEach","k","k2","l","UPDATE_KEY","UPDATE_NODE","UPDATE_STYLE","UPDATE_FOCUS","UPDATE_MEASURE","UPDATE_COMPONENT","UPDATE_OVERWRITE","UPDATE_KEYS","UPDATE_LIST","UPDATE_CONFIG","UPDATE_ADD_DOM","UPDATE_REMOVE_DOM","KEY_FRAME_KEY","FRAME_STYLE","FRAME_TIME","FRAME_EASING","FRAME_TRANSITION","NODE_KEY","NODE_DOM_PARENT","NODE_OPACITY","NODE_MATRIX","NODE_MATRIX_EVENT","NODE_CACHE","NODE_CACHE_TOTAL","NODE_CACHE_FILTER","NODE_CACHE_MASK","NODE_CACHE_OVERFLOW","NODE_STRUCT","NODE_TAG_NAME","NODE_CURRENT_STYLE","NODE_CURRENT_PROPS","NODE_COMPUTED_STYLE","NODE_CACHE_STYLE","NODE_CACHE_PROPS","NODE_LIMIT_CACHE","NODE_IS_MASK","NODE_IS_INLINE","NODE_HAS_CONTENT","NODE_REFRESH_LV","NODE_IS_DESTROYED","NODE_STYLE","NODE_UPDATE_HASH","NODE_UNIQUE_UPDATE_ID","NODE_DEFS_CACHE","NODE_PERSPECTIVE_MATRIX","NODE_VIRTUAL_DOM","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_FRAME_CB","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_CAL_DIFF_TIME","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","__width","__height","__baseLine","__config","i","lv","j","root","struct","diff","isLayout","__sx","__sy","x","ox","y","oy","__prev","__next","__parent","__domParent","__root","__host","__hostRoot","__virtualDom","CANVAS","SVG","WEBGL","o","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","REM","EM","VW","VH","VMAX","VMIN","calUnit","v","n","parseFloat","test","info","arial","lhr","blr","lgr","padding","f","verdana","tahoma","S","T","Z","c","t","georgia","simsun","support","fontFamily","hasOwnProperty","register","name","emSquare","ascent","descent","lineGap","addPadding","assign","position","gradient","img","identity","multiply","a","b","isE","a0","a1","a2","a3","calPoint","point","m","z","w","undefined","length","b1","c1","d1","b2","c2","d2","b3","c3","d3","a4","b4","c4","d4","d","e","inverse","inverse4","divisor","inv","det","m2m6","point2d","slice","dotProduct","x1","y1","x2","y2","crossProduct","H","Math","sqrt","vector","mx","h","deg","cos","sin","pointInPolygon","vertexes","xmax","ymax","xmin","ymin","len","max","min","pointInQuadrilateral","x4","y4","x3","y3","matrix","w1","w2","w3","w4","angleBySide","theta","pow","acos","sideByAngle","alpha","pointsDistance","triangleIncentre","ellipsePoints","sectorPoints","r","begin","end","list","floor","h2","d2r","abs","atan","rx","ry","p1","p2","p4","p3","push","concat","temp","res","getRectsIntersection","isRectsOverlap","ax1","ay1","ax4","ay4","bx1","by1","bx4","by4","isRectsInside","calCoordsInNode","px","py","node","computedStyle","width","height","calPercentInNode","ds","Infinity","PI","dt","r2d","bboxBezier2","x0","y0","minX","minY","maxX","maxY","tx","ty","sx","sy","qx","qy","bboxBezier3","cx","cy","bx","by","ax","ay","hx","hy","q","bboxBezier","arguments","norm","order","sum","reduce","simpson38","derivativeFunc","middleL","middleR","adaptiveSimpson38","eps","mid","st","sl","sr","ans","bezierLength","points","startT","endT","at","at3","p0","at2","bezierOrder","derivativeOrder","pointAtBezier","percent","maxIteration","pointAtBezierWithLength","targetLen","approachLen","approachT","preApproachT","derivative1","derivative2","numerator","denominator","sliceBezier","x12","y12","x23","y23","x123","y123","x34","y34","x234","y234","x1234","y1234","sliceBezier2Both","start","reverse","pointOnCircle","getConicGradientImage","originX","originY","stop","data","Error","getAngle","dx","dy","increasingList","map","item","color","angle","factor","idx","canvasPolygon","ctx","Array","isArray","moveTo","lineTo","quadraticCurveTo","bezierCurveTo","svgPolygon","canvasLine","controlA","controlB","num","svgLine","canvasFilter","filter","svgFilter","geom","unit","painter","calFitDashed","total","bs","be","smin","smax","dmin","dmax","ps","pd","outer","per","free","mo","calDashed","style","m1","m2","m3","m4","bw","calPoints","borderWidth","borderStyle","deg1","deg2","direction","beginRadius","endRadius","indexOf","isLast","main1","main2","cross1","cross2","tan","calTopRadiusPoints","calRightRadiusPoints","calBottomRadiusPoints","calLeftRadiusPoints","pointsList","brx","bry","erx","ery","oxl","oxr","beginList","centerList","endList","ya","yb","beginLength","needInner","crossDeg","rx1","ry1","sx1","oyl","rx2","ry2","sx2","xa","xb","ca","calBezierTopLeft","cb","controls1","controls2","limit","pop","endLength","oyr","calBezierTopRight","isStart","crossDx","p1x","p1y","p2x","p2y","dx1","dsx1","dx2","dsx2","cpx2","cpy2","cpx1","cpy1","crossDsx","beta","tanBetaDiv2Sqrt","tanAlphaHalf","degTg","degTg1","cdx1","cdy1","cx1","cy1","degTg2","cdx2","cdy2","cx2","cy2","isEnd","oyt","oyb","oxt","calBezierRightTop","oxb","calBezierRightBottom","calBezierBottomLeft","calBezierBottomRight","calBezierLeftTop","calBezierLeftBottom","calRadius","btlr","btrr","bbrr","bblr","need","btlx","btly","btrx","btry","bbrx","bbry","bblx","bbly","BR_KS","calBorderRadius","currentStyle","noRadius","target","prev","next","half","calBorderRadiusInline","contentBoxList","first","last","outerWidth","outerHeight","renderBorder","xom","renderMode","mode","beginPath","fillStyle","fill","closePath","virtualDom","bb","type","tagName","props","TYPE_VD","_","TYPE_GM","TYPE_CP","toString","isType","obj","call","isObject","isString","isFunction","isNumber","isBoolean","isDate","hasOwn","fnToString","ObjectFunctionString","isNil","joinSourceArray","arr","stringify","encodeHtml","prop","joinVirtualDom","vd","defs","joinDef","joinVd","conClip","children","isMask","content","opacity","transform","visibility","mask","overflow","mixBlendMode","def","uuid","joinItem","rgba2int","charAt","parseInt","match","int2rgba","joinArr","int2invert","arr2hash","hash","hash2arr","clone","$$type","util","Date","isPlainObject","equalArr","ai","bi","isArrayA","isArrayB","equal","getTime","extend","source","split","extendAnimate","ovd","nvd","__animationList","animationList","splice","__setTarget","assigning","finished","__stayEnd","assignCurrentStyle","__frameAnimateList","transformBbox","bbox","proto","getPrototypeOf","Ctor","constructor","assignMatrix","isPrimitive","isAuto","flag","charWidth","ELLIPSIS","antialias","premultipliedAlpha","preserveDrawingBuffer","initShaders","gl","vshader","fshader","program","createProgram","enable","BLEND","blendFunc","ONE","ONE_MINUS_SRC_ALPHA","vertexShader","loadShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","attachShader","linkProgram","linked","getProgramParameter","LINK_STATUS","error","getProgramInfoLog","deleteProgram","deleteShader","shader","createShader","shaderSource","compileShader","compiled","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","convertCoords2Gl","revertY","createTexture","tex","texture","bindTexture","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","texImage2D","TEXTURE_2D","UNSIGNED_BYTE","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","LINEAR","TEXTURE_MAG_FILTER","activeTexture","drawTextureCache","vtPoint","vtTex","vtOpacity","lastChannel","record","stack","cache","channel","page","tx1","ty1","tx2","ty2","pointBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","Float32Array","STATIC_DRAW","a_position","getAttribLocation","vertexAttribPointer","FLOAT","enableVertexAttribArray","texBuffer","a_texCoords","opacityBuffer","a_opacity","u_texture","getUniformLocation","count","uniform1i","drawArrays","TRIANGLES","deleteBuffer","disableVertexAttribArray","drawBlur","frameBuffer","texCache","tex1","tex2","spread","sigma","u_direction","uniform2f","ratio","recycle","tex3","framebufferTexture2D","FRAMEBUFFER","COLOR_ATTACHMENT0","tex4","deleteTexture","drawCm","u_m","uniform1fv","drawOverflow","programOverflow","drawMask","u_texture1","u_texture2","drawMbm","W","SPF","CANVAS_LIST","WEBGL_LIST","SUPPORT_OFFSCREEN_CANVAS","OffscreenCanvas","prototype","getContext","defaultFontFamilyData","key","message","debug","document","createElement","setAttribute","body","appendChild","canvas","draw","enabled","available","release","cacheCanvas","cacheWebgl","IMG","INIT","LOADING","LOADED","FONT","COMPONENT","inject","measureText","textCache","html","lengths","chars","ff","fs","fw","inline","char","div","left","top","innerHTML","cns","childNodes","index","css","window","getComputedStyle","text","__measureCb","removeChild","measureTextSync","measureImg","url","state","success","task","Image","onload","onerror","substr","host","exec","location","hostname","crossOrigin","src","warn","console","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","id","clearTimeout","now","performance","hasCacheCanvas","getCacheCanvas","releaseCacheCanvas","delCacheCanvas","hasCacheWebgl","getCacheWebgl","releaseCacheWebgl","delCacheWebgl","isDom","Element","self","getElementsByTagName","isWebGLTexture","WebGLTexture","checkSupportFontFamily","font","checked","context","textAlign","textBaseline","clearRect","fillText","getImageData","loadFont","FontFace","load","then","loadComponent","script","async","head","getLinearDeg","getRadialPosition","center","right","bottom","getColorStop","firstColor","p","dr","dg","db","da","unshift","calLinearCoords","calCircleCentre","iw","ih","positionX","positionY","calRadialRadius","shape","size","xl","yl","asin","parseGradient","reg","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","log","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","__hasUpdate","__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","Animation","__id","nl","__options","op","config","__frameCb","__calDiffTime","iterations","framesR","originStyle","fps","spfLimit","delay","endDelay","playbackRate","isFinish","__cancelTask","__currentProps","__currentStyle","isDelay","FRAME","PLAY","playState","__hasFin","__hasCancel","playCount","currentFrames","stayBegin","stayEnd","is2","endTime","currentTime","currentFrame","round","isAlternate","alternate","isEven","isLastCount","frameTime","isLastFrame","inEndDelay","needClean","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","isDirectItem","__calMp","isVirtual","fromAbs","isShadowRoot","clearCache","__layoutData","__layoutNone","__mp","__isRealInline","__layoutFlex","__layoutInline","__layoutBlock","__sx2","__sx3","__sx4","__sx5","__sx6","__sy2","__sy3","__sy4","__sy5","__sy6","__execAr","ar","controller","autoPlay","__records2","init","list2","__records","__playAuto","h3","nowrap","fixedWidth","fixedHeight","selfEndSpace","offsetWidth","offsetHeight","matrixCache","isScale","clientHeight","x5","x6","y5","y6","__calFilter","bg","bgI","item2","kw","__bx1","__bx2","__by1","__by2","rebuild","__hasContent","isRealInline","sx4","sx5","sx6","sy4","sy5","sy6","hasContent","__calContent","__calPerspective","__calMatrix","__releaseWhenEmpty","limitCache","__calCache","perspectiveMatrix","offscreenBlend","offscreenMask","hasFilter","offscreenFilter","offscreenOverflow","borderList","hasBgi","some","svgBgSymbol","__gradient","isFirst","lastContentBox","lastLineBox","parentLineBox","countW","ix1","iy1","ix2","iy2","symbol","clearAnimate","clearFrameAnimate","__stopPropagation","__stopImmediatePropagation","willResponseEvent","hasEmitMask","ignore","inThis","__touchstartTarget","__getLg","__getRg","__getCg","lg","createLinearGradient","addColorStop","rg","createRadialGradient","ec","dc","pc","cur","onlyTotal","__cacheTotal","__cacheFilter","__cacheMask","__cacheOverflow","formatStyle","animation","cancel","enter","hostRoot","pJson","zChildren","zIndexChildren","__spreadBbox","LineBox","__list","__lineHeight","LineBoxManager","__lastX","__lastY","__maxX","__domList","__domStack","__isNewLine","__isEnd","__setLB","nextNewLine","genLineBox","verticalAlign","isNewLine","TAG_NAME","INLINE","BOLD","offsetAndResizeByNodeOnY","reflowHash","inDirectAbsList","isContainer","cs","__layoutAbs","isAbs","__resizeY","clearUniqueReflowId","__uniqueReflowId","getMergeMarginTB","topList","bottomList","genZIndexChildren","hasMc","mcHash","lastMaskIndex","__iIndex","__zIndex","__aIndex","genOrderChildren","__order","block","inlineBlock","none","tag","__flexLine","__zIndexChildren","__structure","nss","__structs","structs","needSort","__tryLayInline","firstCharWidth","main","isRow","__calMinMax","min2","max2","countMin","countMax","setNotEnd","__addMp","isFixed","isContent","fixedSize","__lineBoxManager","__preLayout","__ioSize","mergeMarginBottomList","mergeMarginTopList","isXom","isInlineBlock","isImg","reflow","__isIbFull","lastX","lastY","isNone","isEmptyBlock","tw","th","horizonAlign","__inlineSize","domList","__marginAuto","growList","shrinkList","basisList","maxList","minList","orderChildren","__calBasis","containerSize","isMultiLine","line","hypotheticalList","hypothetical","maxCrossList","__layoutFlexLine","maxCross","crossSum","crossSumList","between","around","__crossAlign","flexLine","hypotheticalSum","targetMainList","factorSum","factorList","needReset","factorSum2","lbmList","firstBaseLine","genLineBoxByInlineIfNewLine","setLbByInlineIfNotNewLine","pushContentBoxList","isIbFull","isInline2","isInlineBlock2","focusNoWrap","fw2","addX","popContentBoxList","maxCX","maxCY","minCX","minCY","maxFX","maxFY","minFX","minFY","maxOX","maxOY","minOX","minOY","absChildren","onlyRight","onlyBottom","fixedTop","fixedRight","fixedBottom","fixedLeft","needCalWidth","wl","hl","__computeMeasure","__deepScan","loadImg","__loadImg","placeholder","loading","__loadAndRefresh","showError","pts","arc","__addGeom","reload","Defs","cacheHash","__isMulti","multi","__cacheProps","strokeDasharrayStr","lineCap","lineJoin","miterLimit","getLineDash","setLineDash","preData","__preSet","fills","fillRules","strokes","strokeWidths","strokeDasharrays","strokeDasharrayStrs","strokeLinecaps","strokeLinejoins","strokeMiterlimits","__renderOnePolygon","isFillCE","isStrokeCE","isFillRE","isStrokeRE","__conicGradient","__drawPolygon","__radialEllipse","isFill","isStroke","__preSetCanvas","__propsStrokeStyle","__inversePtList","updateList","removeList","KEY_FLAG","check","checkCp","nextProps","forceCheckUpdate","shouldUpdate","shouldComponentUpdate","updateCp","oldS","oldSr","oldJson","diffSr","oj","nj","ojk","getKeyHash","njk","keyList","cpList","diffCp","diffChildren","diffChild","removeCpFromOldTree","oc","ol","of","nf","exist","ex","did","componentDidUpdate","elem","diffDefs","diffBb","diffD2D","od","nd","diffDef","removeAt","insertAt","insertAdjacentHTML","parentNode","removeAttribute","diffItem","diffD2G","replaceWith","diffT2T","diffG2D","diffG2G","diffItemSelf","diffX2X","diffByLessLv","firstChild","lastChild","obb","nbb","isText","svg","where","insertBefore","Controller","__list2","__onList","__lastTime","args","records","animate","onList","__action","__mergeAuto","__on","timestamp","__set","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","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","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","__ctx","__renderMode","vertex","fragment","vertexMask","fragmentMask","fragmentClip","fragmentOverflow","vertexCm","fragmentCm","MAX_TEXTURE_IMAGE_UNITS","__texCache","destroy","__eventCbList","__checkRoot","__checkUpdate","__checkReflow","noRender","__clear","__vd","domDiff","updateStyle","taskUp","__nextFrameCp","updater","includeIgnore","scan","path","zPath","__index__","karas","path2","zPath2","nodeConfig","rootConfig","updateHash","__updateRoot","updateRoot","hasUpdate","__updateStruct","measureHash","__uniqueUpdateId","isInherit","uniqueList","hasRoot","diffList","diffI","mergeOffsetList","__uniqueMergeOffsetId","cps","cts","isLastAbs","isNowAbs","isLastNone","isNowNone","hasFlowPrev","__modifyStruct","startIndex","startNode","oldH","nowH","lastIndex","ns","reBuild","base","reBuildC","curveNum","limitStartEnd","getNewPoint","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","__start","__end","dy2","buildCache","curve","bezierBox","concatPointAndControl","control","getLength","increase","getIndex","getNewList","prePercent","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","replaceLibraryVars","linkLibrary","JSON","linkChild","libraryItem","library","libraryId","parse","animateRecords","opt","createGm","createCp","createVd","animationRecord","singleton","fonts","loadAndParse","components","imgs","list1","list3","version","appendTo","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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G,EAAHA,KAFU;EAGVC,EAAAA,GAAG,EAAHA,KAHU;EAIVC,EAAAA,IAAI,EAAJA,MAJU;EAKVC,EAAAA,SAAS,EAATA;EALU,CAAZ;;EAQA,IAAG,OAAO1uB,MAAP,KAAkB,WAArB,EAAkC;EAChCA,EAAAA,MAAM,CAACurD,KAAP,GAAeA,OAAf;EACD,CAFD,MAGK,IAAG,OAAO9oD,IAAP,KAAgB,WAAnB,EAAgC;EACnCA,EAAAA,IAAI,CAAC8oD,KAAL,GAAaA,OAAb;EACD;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["src/util/enums.js","src/node/Node.js","src/node/mode.js","src/style/unit.js","src/style/font.js","src/style/reg.js","src/math/matrix.js","src/math/vector.js","src/math/geom.js","src/math/gradient.js","src/util/painter.js","src/style/border.js","src/util/$$type.js","src/util/util.js","src/util/debug.js","src/node/textCache.js","src/gl/ca.js","src/gl/webgl.js","src/util/inject.js","src/style/gradient.js","src/style/reset.js","src/style/abbr.js","src/animate/key.js","src/refresh/change.js","src/style/css.js","src/node/TextBox.js","src/refresh/Page.js","src/math/tar.js","src/math/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_FRAME_CB: 8,\n I_PLAY_CB: 9,\n I_TARGET: 10,\n I_ROOT: 11,\n I_FRAMES: 12,\n I_FRAMES_R: 13,\n I_CURRENT_TIME: 14,\n I_NEXT_TIME: 15,\n I_STYLE: 16,\n I_DURATION: 17,\n I_ITERATIONS: 18,\n I_FILL: 19,\n I_PLAYBACK_RATE: 20,\n I_PLAY_COUNT: 21,\n I_PLAY_STATE: 22,\n I_DESTROYED: 23,\n I_START_TIME: 24,\n I_FPS_TIME: 25,\n I_EASING: 26,\n I_ENTER_FRAME: 27,\n I_DELAY: 28,\n I_END_DELAY: 29,\n I_KEYS: 30,\n I_ORIGIN_STYLE: 31,\n I_CURRENT_FRAMES: 32,\n I_CURRENT_FRAME: 33,\n I_SPF_LIMIT: 34,\n I_FPS: 35,\n I_DIRECTION: 36,\n I_CAL_DIFF_TIME: 37,\n I_FIRST_ENTER: 38,\n I_STAY_BEGIN: 39,\n I_STAY_END: 40,\n I_IS2: 41,\n I_END_TIME: 42,\n I_NODE_CONFIG: 43,\n I_ROOT_CONFIG: 44,\n I_OUT_BEGIN_DELAY: 45,\n I_TIME_STAMP: 46,\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.__width = 0;\n this.__height = 0;\n this.__baseLine = 0;\n this.__config = {};\n // 默认undefined\n // this.__prev = undefined;\n // this.__next = undefined;\n // this.__parent = undefined;\n // this.__domParent = undefined;\n // this.__root = undefined;\n // this.__host = undefined;\n }\n\n __structure(i, lv, j) {\n return this.__config[NODE_STRUCT] = {\n [STRUCT_NODE]: this,\n [STRUCT_INDEX]: i,\n [STRUCT_CHILD_INDEX]: j,\n [STRUCT_LV]: lv,\n };\n }\n\n __modifyStruct(root, offset = 0) {\n let struct = this.__config[NODE_STRUCT];\n return [struct, 0];\n }\n\n __offsetX(diff, isLayout) {\n if(isLayout) {\n this.__x += diff;\n }\n else {\n this.__ox += diff;\n }\n this.__sx += diff;\n }\n\n __offsetY(diff, isLayout) {\n if(isLayout) {\n this.__y += diff;\n }\n else {\n this.__oy += diff;\n }\n this.__sy += diff;\n }\n\n __destroy() {\n this.__config[NODE_IS_DESTROYED] = true;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get ox() {\n return this.__ox;\n }\n\n get oy() {\n return this.__oy;\n }\n\n get sx() {\n return this.x + this.ox;\n }\n\n get sy() {\n return this.y + this.oy;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n // canvas/svg根节点\n get root() {\n return this.__root;\n }\n\n // component根节点\n get host() {\n return this.__host;\n }\n\n // 考虑高阶组件在内的component根节点\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get baseLine() {\n return this.__baseLine;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get isDestroyed() {\n return this.__config[NODE_IS_DESTROYED];\n }\n}\n\nexport default Node;\n","export default {\n CANVAS: 0,\n SVG: 1,\n WEBGL: 2,\n};\n","let o = {\n AUTO: 0,\n PX: 1,\n PERCENT: 2,\n NUMBER: 3,\n INHERIT: 4,\n DEG: 5,\n STRING: 6,\n RGBA: 7,\n REM: 8,\n EM: 9,\n VW: 10,\n VH: 11,\n 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 verdana: {\n lhr: 1.21533203125, // (0+2059+430)/2048\n blr: 1.00537109375, // 2059/2048\n },\n tahoma: {\n lhr: 1.20703125, // (0+2049+423)/2048\n blr: 1.00048828125, // 2049/2048\n padding: {\n S: 1,\n T: 1,\n Z: 1,\n c: 1,\n f: 0.7,\n i: 1,\n l: 1,\n t: 0.9,\n },\n },\n georgia: {\n lhr: 1.13623046875, // (0+1878+449)/2048\n blr: 0.9169921875, // 1878/2048\n },\n 'courier new': {\n lhr: 1.1328125, // (0+1705+615)/2048\n blr: 0.83251953125, // 1705/2048\n },\n 'pingfang sc': {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06, // 1060/1000\n padding: {\n f: 0.5,\n },\n },\n simsun: {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06,\n padding: {\n f: 0.5,\n },\n },\n },\n support(fontFamily) {\n return this.info.hasOwnProperty(fontFamily);\n },\n register(name, info) {\n let { emSquare = 2048, ascent = 1854, descent = 434, lineGap = 67, padding = {} } = info || {};\n this.info[name.toLowerCase()] = {\n lhr: (ascent + descent + lineGap) / emSquare,\n blr: ascent / emSquare,\n padding,\n };\n },\n addPadding(name, padding) {\n Object.assign(this.info[name.toLowerCase()].padding, padding);\n },\n};\n\no.info['宋体'] = o.info.simsun;\n\nexport default o;\n","export default {\n position: /(([-+]?[\\d.]+[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') {\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(['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 = { _: 1 };\nconst TYPE_GM = { _: 2 };\nconst TYPE_CP = { _: 3 };\n\nexport default {\n TYPE_VD,\n TYPE_GM,\n TYPE_CP,\n};\n","import $$type from './$$type';\nimport mx from '../math/matrix';\n\nlet toString = {}.toString;\nfunction isType(type) {\n return function(obj) {\n return toString.call(obj) === '[object ' + type + ']';\n }\n}\n\nlet isObject = isType('Object');\nlet isString = isType('String');\nlet isFunction = isType('Function');\nlet isNumber = isType('Number');\nlet isBoolean = isType('Boolean');\nlet isDate = isType('Date');\n\nlet hasOwn = {}.hasOwnProperty;\nlet fnToString = hasOwn.toString;\nlet ObjectFunctionString = fnToString.call(Object);\n\nfunction isNil(v) {\n return v === undefined || v === null;\n}\n\nfunction joinSourceArray(arr) {\n let res = '';\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n res += joinSourceArray(item);\n }\n else {\n res += stringify(item);\n }\n }\n return res;\n}\n\nfunction stringify(s) {\n if(isNil(s)) {\n return '';\n }\n return s.toString();\n}\n\nfunction encodeHtml(s, prop) {\n if(prop) {\n return s.replace(/\"/g, '"');\n }\n return s.replace(/&/g, '&').replace(/ {\n s += joinDef(item);\n });\n s += '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n return s;\n}\n\n// 普通元素\nfunction joinVd(vd) {\n if(vd.type === 'item' || vd.type === 'img') {\n let s = '';\n (vd.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n if(vd.tagName === 'text') {\n return '' + vd.content + '';\n }\n return '<' + vd.tagName + s + '/>';\n }\n else if(vd.type === 'text') {\n let s = ``;\n // text有许多lineBox\n (vd.children || []).forEach(item => {\n s += joinVd(item);\n });\n return '' + s + '';\n }\n else if(vd.type === 'dom' || vd.type === 'geom') {\n let s = '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n let { opacity, transform, visibility, mask, overflow, filter, mixBlendMode } = vd;\n return '' + s + '';\n }\n}\n\nfunction joinDef(def) {\n let s = '<' + def.tagName + ' id=\"' + def.uuid + '\"';\n if(def.tagName === 'mask' || def.tagName === 'clipPath') {\n // s += ' maskUnits=\"userSpaceOnUse\"';\n }\n else if(def.tagName === 'filter') {\n // s += ' filterUnits=\"userSpaceOnUse\"';\n }\n else {\n s += ' gradientUnits=\"userSpaceOnUse\"';\n }\n (def.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n (def.children || []).forEach(item => {\n s += joinItem(item);\n });\n s += '';\n return s;\n}\n\nfunction joinItem(item) {\n let s = '<' + item.tagName;\n (item.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n return s;\n}\n\nfunction rgba2int(color) {\n if(Array.isArray(color)) {\n return color;\n }\n let res = [];\n if(!color || color === 'transparent') {\n res = [0, 0, 0, 0];\n }\n else if(color.charAt(0) === '#') {\n color = color.slice(1);\n if(color.length === 3) {\n res.push(parseInt(color.charAt(0) + color.charAt(0), 16));\n res.push(parseInt(color.charAt(1) + color.charAt(1), 16));\n res.push(parseInt(color.charAt(2) + color.charAt(2), 16));\n res[3] = 1;\n }\n else if(color.length === 6) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4), 16));\n res[3] = 1;\n }\n else if(color.length === 8) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4, 6), 16));\n res.push(parseInt(color.slice(6), 16) / 255);\n }\n else {\n res[0] = res[1] = res[2] = 0;\n res[3] = 1;\n }\n }\n else {\n let c = color.match(/rgba?\\s*\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*,\\s*([\\d.]+)(?:\\s*,\\s*([\\d.]+))?\\s*\\)/i);\n if(c) {\n res = [parseInt(c[1]), parseInt(c[2]), parseInt(c[3])];\n if(!isNil(c[4])) {\n res[3] = parseFloat(c[4]);\n }\n else {\n res[3] = 1;\n }\n }\n else {\n res = [0, 0, 0, 0];\n }\n }\n return res;\n}\n\nfunction int2rgba(color) {\n if(Array.isArray(color)) {\n if(color.length === 4) {\n color = color.map((c, i) => i === 3 ? c : Math.floor(Math.max(0, c)));\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n color = color.map(c => Math.floor(c));\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return color || 'rgba(0,0,0,0)';\n}\n\nfunction int2invert(color) {\n if(Array.isArray(color)) {\n color = color.slice(0);\n color[0] = 255 - color[0];\n color[1] = 255 - color[1];\n color[2] = 255 - color[2];\n if(color.length === 4) {\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return 'rgba(0,0,0,0)';\n}\n\nfunction arr2hash(arr) {\n let hash = {};\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n hash[item[0]] = item[1];\n }\n else {\n for(let list = Object.keys(item), j = list.length - 1; j >= 0; j--) {\n let k = list[j];\n hash[k] = item[k];\n }\n }\n }\n return hash;\n}\n\nfunction hash2arr(hash) {\n if(Array.isArray(hash)) {\n return hash;\n }\n let arr = [];\n for(let list = Object.keys(hash), i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n arr.push([k, hash[k]]);\n }\n return arr;\n}\n\nfunction clone(obj) {\n if(isNil(obj) || typeof obj !== 'object') {\n return obj;\n }\n // parse递归会出现内部先返回解析好的json,外部parse不能clone\n if(obj.$$type === $$type.TYPE_VD\n || obj.$$type === $$type.TYPE_GM\n || obj.$$type === $$type.TYPE_CP) {\n return obj;\n }\n if(util.isDate(obj)) {\n return new Date(obj);\n }\n if(!isPlainObject(obj) && !Array.isArray(obj)) {\n return obj;\n }\n let n = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(i => {\n n[i] = clone(obj[i]);\n });\n return n;\n}\n\n/**\n * 简化的arr对比,arr中只有arr和其它类型,其它类型对比值或引用,arr递归\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equalArr(a, b) {\n if(!a || !b) {\n return a === b;\n }\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let ai = a[i];\n let bi = b[i];\n let isArrayA = Array.isArray(ai);\n let isArrayB = Array.isArray(bi);\n if(isArrayA && isArrayB) {\n if(!equalArr(ai, bi)) {\n return false;\n }\n }\n else if(isArrayA || isArrayB) {\n return false;\n }\n else if(ai !== bi) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 深度对比对象\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equal(a, b) {\n if(a === b) {\n return true;\n }\n if(isObject(a) && isObject(b)) {\n let hash = {};\n for(let i = 0, arr = Object.keys(a), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!b.hasOwnProperty(k) || !equal(a[k], b[k])) {\n return false;\n }\n hash[k] = true;\n }\n // a没有b有则false\n for(let i = 0, arr = Object.keys(b), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!hash.hasOwnProperty(k)) {\n return false;\n }\n }\n }\n else if(isDate(a) && isDate(b)) {\n return a.getTime() === b.getTime();\n }\n else if(Array.isArray(a) && Array.isArray(b)) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equal(a[i], b[i])) {\n return false;\n }\n }\n }\n else {\n return a === b;\n }\n return true;\n}\n\nfunction extend(target, source, keys) {\n if(source === null || typeof source !== 'object') {\n return target;\n }\n if(!keys) {\n keys = Object.keys(source);\n }\n let i = 0;\n let len = keys.length;\n while(i < len) {\n let k = keys[i];\n target[k] = source[k];\n i++;\n }\n return target;\n}\n\nfunction joinArr(arr, split) {\n let s = arr.length ? arr[0] : '';\n for(let i = 1, len = arr.length; i < len; i++) {\n s += split + arr[i];\n }\n return s;\n}\n\nfunction extendAnimate(ovd, nvd) {\n let list = nvd.__animationList = ovd.animationList.splice(0);\n list.forEach(item => {\n item.__setTarget(nvd);\n // 事件队列的缘故,可能动画本帧刚执行过,然后再继承,就会缺失,需再次赋值一遍;也有可能停留最后\n if(item.assigning || item.finished && item.__stayEnd()) {\n item.assignCurrentStyle();\n }\n });\n // 帧动画继承\n nvd.__frameAnimateList = ovd.__frameAnimateList.splice(0);\n}\n\nfunction transformBbox(bbox, matrix, dx = 0, dy = 0) {\n if(matrix && !mx.isE(matrix)) {\n let [x1, y1, x2, y2] = bbox;\n // 可能因filter的原因扩展范围\n if(dx) {\n x1 -= dx;\n x2 += dx;\n }\n if(dy) {\n y1 -= dy;\n y2 += dy;\n }\n let list = [x2, y1, x1, y2, x2, y2];\n let w;\n [x1, y1, , w] = mx.calPoint([x1, y1], matrix);\n if(w && w !== 1) {\n x1 /= w;\n y1 /= w;\n }\n let xa = x1, ya = y1, xb = x1, yb = y1;\n for(let i = 0; i < 6; i += 2) {\n let x = list[i], y = list[i + 1];\n [x, y, , w] = mx.calPoint([x, y], matrix);\n if(w && w !== 1) {\n x /= w;\n y /= w;\n }\n xa = Math.min(xa, x);\n xb = Math.max(xb, x);\n ya = Math.min(ya, y);\n yb = Math.max(yb, y);\n }\n bbox = [xa, ya, xb, yb];\n }\n else if(dx || dy) {\n bbox = bbox.slice(0);\n bbox[0] -= dx;\n bbox[1] -= dy;\n bbox[2] += dx;\n bbox[3] += dy;\n }\n return bbox;\n}\n\nfunction isPlainObject(obj) {\n if(!obj || toString.call(obj) !== '[object Object]') {\n return false;\n }\n let proto = Object.getPrototypeOf(obj);\n if(!proto) {\n return true;\n }\n let Ctor = hasOwn.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor === 'function' && fnToString.call(Ctor) === ObjectFunctionString;\n}\n\nfunction assignMatrix(t, v) {\n t[0] = v[0];\n t[1] = v[1];\n t[2] = v[2];\n t[3] = v[3];\n t[4] = v[4];\n t[5] = v[5];\n t[6] = v[6];\n t[7] = v[7];\n t[8] = v[8];\n t[9] = v[9];\n t[10] = v[10];\n t[11] = v[11];\n t[12] = v[12];\n t[13] = v[13];\n t[14] = v[14];\n t[15] = v[15];\n return t;\n}\n\nlet util = {\n isObject,\n isString,\n isFunction,\n isNumber,\n isBoolean,\n isDate,\n isNil,\n isPrimitive(v) {\n return util.isNil(v) || util.isBoolean(v) || util.isString(v) || util.isNumber(v);\n },\n // css中常用undefined/null表示auto本身\n isAuto(v) {\n return isNil(v) || v === 'auto';\n },\n isPlainObject,\n stringify,\n joinSourceArray(arr) {\n return joinSourceArray(arr);\n },\n encodeHtml,\n joinVirtualDom,\n joinVd,\n joinDef,\n rgba2int,\n int2rgba,\n int2invert,\n arr2hash,\n hash2arr,\n clone,\n equalArr,\n equal,\n extend,\n joinArr,\n extendAnimate,\n transformBbox,\n assignMatrix,\n};\n\nexport default util;\n","export default {\n flag: false,\n};\n","export default {\n list: [], // 每次渲染前的更新后,等待测量的文字对象列表\n data: {}, // Text中存入的特殊等待测量的信息,字体+字号+粗细为key\n charWidth: {}, // key的文字宽度hash\n padding: {}, // key的文字宽度偏移,少量字体的少量文字有\n ELLIPSIS: '…',\n};\n","export default {\n alpha: true,\n antialias: true,\n premultipliedAlpha: true,\n preserveDrawingBuffer: true,\n // depth: true,\n // stencil: true,\n};\n","import mx from '../math/matrix';\n\nconst calPoint = mx.calPoint;\n\n/**\n * 初始化 shader\n * @param gl GL context\n * @param vshader vertex shader (string)\n * @param fshader fragment shader (string)\n * @return program, if the program object was created and successfully made current\n */\nfunction initShaders(gl, vshader, fshader) {\n let program = createProgram(gl, vshader, fshader);\n if(!program) {\n throw new Error('Failed to create program');\n }\n\n // 要开启透明度,用以绘制透明的图形\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n return program;\n}\n\n/**\n * Create the linked program object\n * @param gl GL context\n * @param vshader a vertex shader program (string)\n * @param fshader a fragment shader program (string)\n * @return created program object, or null if the creation has failed\n */\nfunction createProgram(gl, vshader, fshader) {\n // Create shader object\n let vertexShader = loadShader(gl, gl.VERTEX_SHADER, vshader);\n let fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fshader);\n if(!vertexShader || !fragmentShader) {\n return null;\n }\n\n // Create a program object\n let program = gl.createProgram();\n if(!program) {\n return null;\n }\n program.vertexShader = vertexShader;\n program.fragmentShader = fragmentShader;\n\n // Attach the shader objects\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n // Link the program object\n gl.linkProgram(program);\n\n // Check the result of linking\n let linked = gl.getProgramParameter(program, gl.LINK_STATUS);\n if(!linked) {\n let error = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n gl.deleteShader(fragmentShader);\n gl.deleteShader(vertexShader);\n throw new Error('Failed to link program: ' + error);\n }\n return program;\n}\n\n/**\n * Create a shader object\n * @param gl GL context\n * @param type the type of the shader object to be created\n * @param source shader program (string)\n * @return created shader object, or null if the creation has failed.\n */\nexport function loadShader(gl, type, source) {\n // Create shader object\n let shader = gl.createShader(type);\n if(shader == null) {\n throw new Error('unable to create shader');\n }\n\n // Set the shader program\n gl.shaderSource(shader, source);\n\n // Compile the shader\n gl.compileShader(shader);\n\n // Check the result of compilation\n let compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if(!compiled) {\n let error = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error('Failed to compile shader: ' + error);\n }\n\n return shader;\n}\n\nfunction convertCoords2Gl([x, y, z, w], cx, cy, revertY) {\n if(z === undefined) {\n z = 0;\n }\n if(w === undefined) {\n w = 1;\n }\n if(w && w !== 1) {\n x /= w;\n y /= w;\n z /= w;\n }\n if(x === cx) {\n x = 0;\n }\n else {\n x = (x - cx) / cx;\n }\n if(y === cy) {\n y = 0;\n }\n else {\n y = (y - cy) / cy;\n if(revertY) {\n y = -y;\n }\n }\n return [x * w, y * w, z * w, w];\n}\n\nfunction createTexture(gl, tex, n, width, height) {\n let texture = gl.createTexture();\n bindTexture(gl, texture, n);\n // gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, -1);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n // 传入高宽时是绑定fbo,且tex一定为null\n if(width && height) {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n // 普通将canvas对象作为纹理\n else {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n return texture;\n}\n\nfunction bindTexture(gl, texture, n) {\n gl.activeTexture(gl['TEXTURE' + n]);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n}\n\n/**\n * texCache集满纹理上传占用最多可用纹理单元后,进行批量顺序绘制\n * 将所有dom的矩形顶点(经过transform变换后的)、贴图坐标、透明度存入3个buffer中,\n * 然后相同纹理单元的形成一批,设置uniform的纹理单元号进行绘制,如此循环\n * @param gl\n * @param list\n * @param hash\n * @param cx\n * @param cy\n * @param revertY\n */\nfunction drawTextureCache(gl, list, hash, cx, cy, revertY) {\n let vtPoint = [], vtTex = [], vtOpacity = [];\n let lastChannel; // 上一个dom的单元号\n let record = [0]; // [num, channel]每一批的数量和单元号记录\n let stack = [record]; // 所有批的数据记录集合\n list.forEach((item, i) => {\n let [cache, opacity, matrix, dx, dy] = item;\n if(i) {\n let channel = hash[cache.page.uuid];\n // 和上一个单元号不同时,生成新的批次记录\n if(lastChannel !== channel) {\n lastChannel = channel;\n record = [0, lastChannel];\n stack.push(record);\n }\n }\n else {\n lastChannel = hash[cache.page.uuid];\n record[1] = lastChannel;\n }\n let { x, y, width, height, page, bbox } = cache;\n // 计算顶点坐标和纹理坐标,转换[0,1]对应关系\n let bx = bbox[0], by = bbox[1];\n let [xa, ya] = [bx + (dx || 0), by + height + (dy || 0)];\n let [xb, yb] = [bx + width + (dx || 0), by + (dy || 0)];\n let [x1, y1, , w1] = calPoint([xa, ya], matrix);\n let [x2, y2, , w2] = calPoint([xb, ya], matrix);\n let [x3, y3, , w3] = calPoint([xb, yb], matrix);\n let [x4, y4, , w4] = calPoint([xa, yb], matrix);\n [x1, y1] = convertCoords2Gl([x1, y1, 0, w1], cx, cy, revertY);\n [x2, y2] = convertCoords2Gl([x2, y2, 0, w2], cx, cy, revertY);\n [x3, y3] = convertCoords2Gl([x3, y3, 0, w3], cx, cy, revertY);\n [x4, y4] = convertCoords2Gl([x4, y4, 0, w4], cx, cy, revertY);\n vtPoint.push(x1, y1, 0, w1, x4, y4, 0, w4, x2, y2, 0, w2, x4, y4, 0, w4, x2, y2, 0, w2, x3, y3, 0, w3);\n let tx1 = x / page.width, ty1 = (y + height) / page.height;\n let tx2 = (x + width) / page.width, ty2 = y / page.height;\n vtTex.push(tx1, ty1, tx1, ty2, tx2, ty1, tx1, ty2, tx2, ty1, tx2, ty2);\n vtOpacity.push(opacity, opacity, opacity, opacity, opacity, opacity);\n record[0]++;\n });\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtPoint), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.program, 'a_position');\n gl.vertexAttribPointer(a_position, 4, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtTex), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // opacity buffer\n let opacityBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, opacityBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtOpacity), gl.STATIC_DRAW);\n let a_opacity = gl.getAttribLocation(gl.program, 'a_opacity');\n gl.vertexAttribPointer(a_opacity, 1, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_opacity);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.program, 'u_texture');\n let count = 0;\n // 循环按批次渲染\n stack.forEach(record => {\n let [num, channel] = record;\n gl.uniform1i(u_texture, channel);\n num *= 6;\n gl.drawArrays(gl.TRIANGLES, count, num);\n count += num;\n });\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.deleteBuffer(opacityBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n gl.disableVertexAttribArray(a_opacity);\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核扩大3倍性能慢\n * x/y方向分开执行,加速性能,计算次数由d*d变为d+d,d为卷积核大小\n * spread由d和sigma计算得出,d由sigma计算得出,sigma即css的blur()参数\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * i和j为total和filter的纹理单元,3次执行(x/y合起来算1次)需互换单元,来回执行源和结果\n * 由total变为filter时cache会各方向上扩展spread的大小到width/height\n * 因此第一次绘制时坐标非1,后面则固定1\n * @param gl\n * @param program\n * @param frameBuffer\n * @param texCache\n * @param tex1 初次绘制目标纹理\n * @param tex2 初次绘制源纹理\n * @param i 初次绘制目标纹理单元\n * @param j 初次绘制源纹理单元\n * @param width\n * @param height\n * @param cx\n * @param cy\n * @param spread\n * @param d\n * @param sigma\n */\nfunction drawBlur(gl, program, frameBuffer, texCache, tex1, tex2, i, j, width, height, cx, cy, spread, d, sigma) {\n // 第一次将total绘制到blur上,此时尺寸存在spread差值,因此不加模糊防止坐标计算问题,仅作为扩展纹理尺寸\n let [x1, y2] = convertCoords2Gl([spread, height - spread], cx, cy);\n let [x2, y1] = convertCoords2Gl([width - spread, spread], cx, cy);\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // direction全0,即无模糊,此时只是进行扩展尺寸操作,还没到模糊所以传0\n let u_direction = gl.getUniformLocation(program, 'u_direction');\n gl.uniform2f(u_direction, 0, 0);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // fbo绑定切换纹理对象和单元索引,同时注意不能向源纹理绘制,因为源是cacheTotal,需要重新生成一个,y方向再来一次\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n /**\n * 反复执行共3次,坐标等均不变,只是切换fbo绑定对象和纹理单元\n * 注意max和ratio的设置,当是100尺寸的正方形时,传给direction的始终为1\n * 当正方形<100时,direction相应地要扩大相对于100的倍数,反之则缩小,如此为了取相邻点坐标时是+-1\n * 当非正方形时,长轴一端为基准值不变,短的要二次扩大比例倍数\n */\n let max = 100 / Math.max(width, height);\n let ratio = width / height;\n let recycle = []; // 3次过程中新生成的中间纹理需要回收\n for(let k = 0; k < 3; k++) {\n let tex3 = createTexture(gl, null, j, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex3, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, max, 0);\n }\n else {\n gl.uniform2f(u_direction, max * ratio, 0);\n }\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n recycle.push(tex1);\n let tex4 = createTexture(gl, null, i, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex4, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, 0, max * ratio);\n }\n else {\n gl.uniform2f(u_direction, 0, max);\n }\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n tex1 = tex4;\n recycle.push(tex3);\n }\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n recycle.forEach(item => gl.deleteTexture(item));\n return tex1;\n}\n\nfunction drawCm(gl, program, i, m) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, i);\n // matrix\n let u_m = gl.getUniformLocation(program, 'u_m');\n gl.uniform1fv(u_m, new Float32Array(m));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\n/**\n * 根据total/filter生成overflow\n * @param gl\n * @param i 输入纹理单元\n * @param dx 二者偏移值\n * @param dy\n * @param width 最终大小\n * @param height\n * @param w 输入纹理大小\n * @param h\n */\nfunction drawOverflow(gl, i, dx, dy, width, height, w, h) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.programOverflow, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer,原本大小width/height,使用其中的w/h\n let x1 = dx / w, y1 = dy / h, x2 = (width + dx) / w, y2 = (height + dy) /h;\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.programOverflow, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.programOverflow, 'u_texture');\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n}\n\nfunction drawMask(gl, i, j, program) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, j);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nfunction drawMbm(gl, program, i, j, W, H) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, i);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nexport default {\n initShaders,\n createTexture,\n bindTexture,\n drawTextureCache,\n drawBlur,\n drawOverflow,\n drawMask,\n drawMbm,\n drawCm,\n};\n","import util from './util';\nimport debug from './debug';\nimport textCache from '../node/textCache';\nimport font from '../style/font';\nimport ca from '../gl/ca';\nimport webgl from '../gl/webgl';\n\nconst SPF = 1000 / 60;\n\nconst CANVAS = {};\nconst WEBGL = {};\nconst CANVAS_LIST = [];\nconst WEBGL_LIST = [];\nconst SUPPORT_OFFSCREEN_CANVAS = typeof OffscreenCanvas === 'function' && util.isFunction(OffscreenCanvas.prototype.getContext);\n\nlet defaultFontFamilyData;\n\nfunction cache(key, width, height, hash, message) {\n let o;\n if(!key) {\n let target = hash === CANVAS ? CANVAS_LIST : WEBGL_LIST;\n if(target.length) {\n o = target.pop();\n }\n else {\n o = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n }\n else if(!hash[key]) {\n o = hash[key] = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n else {\n o = hash[key];\n }\n o.width = width;\n o.height = height;\n if(debug.flag) {\n o.style.width = width + 'px';\n o.style.height = height + 'px';\n o.setAttribute('type', hash === CANVAS ? 'canvas' : 'webgl');\n if(key) {\n o.setAttribute('key', key);\n }\n if(message) {\n o.setAttribute('message', message);\n }\n document.body.appendChild(o);\n }\n let ctx;\n if(hash === CANVAS) {\n ctx = o.getContext('2d');\n }\n else {\n ctx = o.getContext('webgl', ca) || o.getContext('experimental-webgl', ca);\n }\n return {\n canvas: o,\n ctx,\n draw() {\n // 空函数,仅对小程序提供hook特殊处理,flush缓冲\n },\n enabled: true,\n available: true,\n release() {\n if(!key && this.available) {\n if(hash === CANVAS) {\n CANVAS_LIST.push(this.canvas);\n }\n else {\n WEBGL_LIST.push(this.canvas);\n }\n }\n this.available = false;\n },\n };\n}\n\nfunction cacheCanvas(key, width, height, message) {\n return cache(key, width, height, CANVAS, message);\n}\n\nfunction cacheWebgl(key, width, height, message) {\n return cache(key, width, height, WEBGL, message);\n}\n\nconst IMG = {};\nconst INIT = 0;\nconst LOADING = 1;\nconst LOADED = 2;\nconst FONT = {};\nconst COMPONENT = {};\n\nlet inject = {\n measureText() {\n let { list, data } = textCache;\n let html = '';\n let keys = [];\n let lengths = [];\n let chars = [];\n Object.keys(data).forEach(key => {\n let { ff, fs, fw, s } = data[key];\n if(s) {\n keys.push(key);\n lengths.push(s.length);\n let inline = `position:absolute;font-family:${ff};font-size:${fs}px;font-weight:${fw}`;\n for(let i = 0, len = s.length; i < len; i++) {\n let char = s.charAt(i);\n chars.push(char);\n html += `${char.replace(/`;\n }\n data[key].s = '';\n }\n });\n if(!html) {\n return;\n }\n let div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n document.body.appendChild(div);\n div.innerHTML = html;\n let cns = div.childNodes;\n let { charWidth } = textCache;\n let count = 0, index = 0, key;\n for(let i = 0, len = cns.length; i < len; i++) {\n let node = cns[i];\n if(count === 0) {\n key = keys[index];\n }\n if(++count === lengths[index]) {\n index++;\n count = 0;\n }\n let char = chars[i];\n // clientWidth只返回ceil整数,精度必须用getComputedStyle\n let css = window.getComputedStyle(node, null);\n charWidth[key][char] = parseFloat(css.width);\n }\n list.forEach(text => text.__measureCb());\n textCache.list = [];\n textCache.data = {};\n if(!debug.flag) {\n document.body.removeChild(div);\n }\n },\n measureTextSync(key, ff, fs, fw, char) {\n let inline = `position:absolute;font-family:${ff};font-size:${fs}px;font-weight:${fw}`;\n let html = `${char}${char}${char}`;\n let div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n document.body.appendChild(div);\n div.innerHTML = html;\n let cns = div.childNodes;\n let w1 = parseFloat(window.getComputedStyle(cns[0], null).width);\n let w2 = parseFloat(window.getComputedStyle(cns[1], null).width);\n return w1 * 2 - w2;\n },\n IMG,\n INIT,\n LOADED,\n LOADING,\n measureImg(url, cb) {\n if(Array.isArray(url)) {\n if(!url.length) {\n return cb();\n }\n let count = 0;\n let len = url.length;\n let list = [];\n url.forEach((item, i) => {\n inject.measureImg(item, function(cache) {\n list[i] = cache;\n if(++count === len) {\n cb(list);\n }\n });\n });\n return;\n }\n else if(!url || !util.isString(url)) {\n inject.error('Measure img invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\n }\n let cache = IMG[url] = IMG[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb && cb(cache);\n }\n else if(cache.state === LOADING) {\n cb && cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cb && cache.task.push(cb);\n let img = new Image();\n img.onload = function() {\n cache.state = LOADED;\n cache.success = true;\n cache.width = img.width;\n cache.height = img.height;\n cache.source = img;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n img.onerror = function(e) {\n cache.state = LOADED;\n cache.success = false;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n if(url.substr(0, 5) !== 'data:') {\n let host = /^(?:\\w+:)?\\/\\/([^/:]+)/.exec(url);\n if(host) {\n if(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%]+)?/ig) || [];\n o.v = v.map(item => {\n let color = /((?:#[0-9a-f]{3,8})|(?:rgba?\\s*\\(.+?\\)))/i.exec(item);\n let arr = [rgba2int(color[1])];\n let percent = /[-+]?[\\d.]+[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: '#000',\n borderRightColor: '#000',\n borderBottomColor: '#000',\n borderLeftColor: '#000',\n borderTopStyle: 'solid',\n borderRightStyle: 'solid',\n borderBottomStyle: 'solid',\n borderLeftStyle: 'solid',\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomLeftRadius: 0,\n width: 'auto',\n height: 'auto',\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto',\n flexDirection: 'row',\n flexWrap: 'nowrap',\n order: 0,\n justifyContent: 'flexStart',\n alignItems: 'stretch',\n alignSelf: 'auto',\n alignContent: 'stretch',\n textAlign: 'inherit',\n letterSpacing: 'inherit',\n transformOrigin: 'center',\n visibility: 'inherit',\n opacity: 1,\n zIndex: 0,\n transform: null,\n translateX: 0,\n translateY: 0,\n translateZ: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n skewX: 0,\n skewY: 0,\n rotateX: 0,\n rotateY: 0,\n rotateZ: 0,\n rotate3d: '0, 0, 0, 0',\n perspective: 0,\n perspectiveOrigin: 'center',\n filter: null,\n boxShadow: null,\n pointerEvents: 'inherit',\n overflow: 'visible',\n mixBlendMode: 'normal',\n whiteSpace: 'inherit',\n textOverflow: 'clip',\n lineClamp: 0,\n textStrokeWidth: 'inherit',\n textStrokeColor: 'inherit',\n textStrokeOver: 'inherit',\n};\n\nconst GEOM = {\n fill: 'transparent',\n stroke: '#000',\n strokeWidth: 1,\n strokeDasharray: '',\n strokeLinecap: 'butt',\n strokeLinejoin: 'miter',\n strokeMiterlimit: 4,\n fillRule: 'nonzero',\n};\n\nlet DOM_ENTRY_SET = [];\nlet DOM_KEY_SET = [];\nObject.keys(DOM).forEach(k => {\n DOM_KEY_SET.push(k);\n let v = DOM[k];\n DOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet GEOM_ENTRY_SET = [];\nlet GEOM_KEY_SET = [];\nObject.keys(GEOM).forEach(k => {\n GEOM_KEY_SET.push(k);\n let v = GEOM[k];\n GEOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet INHERIT = {\n fontFamily: 'arial',\n fontSize: 16,\n fontWeight: 400,\n fontStyle: 'normal',\n color: '#000',\n textAlign: 'left',\n visibility: 'visible',\n pointerEvents: 'auto',\n textStrokeColor: '#000',\n textStrokeWidth: 1,\n textStrokeOver: 'none',\n};\n\nlet INHERIT_KEY_SET = [];\nObject.keys(INHERIT).forEach(k => {\n INHERIT_KEY_SET.push(k);\n});\n\nexport default {\n DOM,\n GEOM,\n isValid(i) {\n return DOM.hasOwnProperty(i) || GEOM.hasOwnProperty(i);\n },\n DOM_KEY_SET,\n GEOM_KEY_SET,\n DOM_ENTRY_SET,\n GEOM_ENTRY_SET,\n INHERIT,\n INHERIT_KEY_SET,\n};\n","import reg from './reg';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction parseFlex(style, grow, shrink, basis) {\n if(isNil(style.flexGrow)) {\n style.flexGrow = grow || 0;\n }\n if(isNil(style.flexShrink)) {\n style.flexShrink = shrink || 0;\n }\n if(isNil(style.flexBasis)) {\n style.flexBasis = basis || 0;\n }\n}\n\nfunction parseMarginPadding(style, key, list) {\n let temp = style[key];\n if(!isNil(temp)) {\n let match = temp.toString().match(/([-+]?[\\d.]+[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 // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform\n ['translate', 'scale', 'skew', 'translate3d', 'scale3d', 'rotate'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n abbr.toFull(style, k);\n }\n });\n // 扩展的不能和transform混用,给出警告\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate3d',\n ].forEach(k => {\n let v = style[k];\n if(!isNil(v) && style.transform) {\n inject.warn(`Can not use expand style \"${k}\" with transform`);\n }\n });\n // 默认reset,根据传入不同,当style为空时覆盖\n reset.forEach(item => {\n let { k, v } = item;\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n // 背景图\n temp = style.backgroundImage;\n if(temp !== undefined) {\n if(!temp) {\n res[BACKGROUND_IMAGE] = [null];\n }\n else if(Array.isArray(temp)) {\n res[BACKGROUND_IMAGE] = temp.map(item => {\n if(!item) {\n return null;\n }\n if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n if(reg.img.test(item)) {\n return reg.img.exec(item)[2];\n }\n return null;\n });\n }\n // 区分是渐变色还是图\n else if(reg.gradient.test(temp)) {\n res[BACKGROUND_IMAGE] = [gradient.parseGradient(temp)];\n }\n else if(reg.img.test(temp)) {\n res[BACKGROUND_IMAGE] = [reg.img.exec(temp)[2]];\n }\n else {\n res[BACKGROUND_IMAGE] = [null];\n }\n }\n temp = style.backgroundColor;\n if(temp) {\n // 先赋值默认透明,后续操作有合法值覆盖\n let bgc = /^#[0-9a-f]{3,8}/i.exec(temp);\n if(bgc && [4, 7, 9].indexOf(bgc[0].length) > -1) {\n res[BACKGROUND_COLOR] = [rgba2int(bgc[0]), RGBA];\n }\n else {\n bgc = /rgba?\\s*\\(.+\\)/i.exec(temp);\n res[BACKGROUND_COLOR] = [rgba2int(bgc ? bgc[0] : [0, 0, 0, 0]), RGBA];\n }\n }\n ['backgroundPositionX', 'backgroundPositionY'].forEach((k, i) => {\n temp = style[k];\n if(!isNil(temp)) {\n k = i ? BACKGROUND_POSITION_Y : BACKGROUND_POSITION_X;\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[k] = temp.map(item => {\n if(/^[-+]?[\\d.]/.test(item)) {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item] || 0,\n PERCENT,\n ];\n }\n });\n }\n });\n // 背景尺寸\n temp = style.backgroundSize;\n if(temp) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[BACKGROUND_SIZE] = temp.map(item => {\n if(!item) {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n let match = item.toString().match(/\\b(?:([-+]?[\\d.]+[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(!isNil(v)) {\n res[STYLE_KEY[style2Upper(k)]] = [rgba2int(v), RGBA];\n }\n });\n // border-radius\n ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'].forEach(k => {\n k = 'border' + k + 'Radius';\n let v = style[k];\n if(!isNil(v)) {\n let arr = v.toString().split(/\\s+/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = arr[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n if(n[0] < 0) {\n n[0] = 0;\n }\n arr[i] = n;\n }\n else {\n arr[i] = [0, PX];\n }\n }\n res[STYLE_KEY[style2Upper(k)]] = arr;\n }\n });\n temp = style.transform;\n if(temp) {\n let transform = res[TRANSFORM] = [];\n let match = (temp || '').toString().match(/\\w+\\(.+?\\)/g);\n if(match) {\n match.forEach(item => {\n let i = item.indexOf('(');\n let k = item.slice(0, i);\n let v = item.slice(i + 1, item.length - 1);\n if(k === 'matrix') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 6) {\n arr = arr.slice(0, 6);\n }\n if(arr.length === 6) {\n transform.push([MATRIX, [\n arr[0], arr[1], 0, 0, arr[2], arr[3], 0, 0, 0, 0, 1, 0, arr[4], arr[5], 0, 1,\n ]]);\n }\n }\n else if(k === 'matrix3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 16) {\n arr = arr.slice(0, 16);\n }\n if(arr.length === 16) {\n transform.push([MATRIX, arr]);\n }\n }\n else if(k === 'perspective') {\n let arr = calUnit(v);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n transform.push([PERSPECTIVE, arr]);\n }\n else if(k === 'rotate3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n transform.push([ROTATE_3D, arr]);\n }\n }\n else if(TRANSFORM_HASH.hasOwnProperty(k)) {\n let k2 = TRANSFORM_HASH[k];\n let arr = calUnit(v);\n compatibleTransform(k2, arr);\n transform.push([k2, arr]);\n }\n else if({ translate: true, scale: true, skew: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale' ? arr[0] : [0];\n }\n if(arr.length === 2) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n }\n }\n else if({ translate3d: true, scale3d: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale3d' ? [1] : [0];\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n if(arr.length === 3) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let k3 = STYLE_KEY[style2Upper(k + 'Z')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n let arr3 = calUnit(arr[2]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n compatibleTransform(k3, arr3);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n transform.push([k3, arr3]);\n }\n }\n });\n }\n }\n temp = style.perspective;\n if(!isNil(temp)) {\n let arr = calUnit(temp);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n res[PERSPECTIVE] = arr;\n }\n ['perspectiveOrigin', 'transformOrigin'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n let arr = res[STYLE_KEY[style2Upper(k)]] = [];\n let match = temp.toString().match(reg.position);\n if(match) {\n if(match.length === 1) {\n match[1] = match[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n arr.push(n);\n }\n else {\n arr.push([\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item],\n PERCENT,\n ]);\n // 不规范的写法变默认值50%\n if(isNil(arr[i][0])) {\n arr[i][0] = 50;\n }\n }\n }\n }\n else {\n arr.push([50, PERCENT]);\n arr.push([50, PERCENT]);\n }\n }\n });\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n let k2 = TRANSFORM_HASH[k];\n let n = calUnit(v);\n // 没有单位或默认值处理单位\n compatibleTransform(k2, n);\n res[k2] = n;\n });\n temp = style.rotate3d;\n if(temp) {\n let arr = temp.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n res[ROTATE_3D] = arr;\n }\n }\n temp = style.opacity;\n if(!isNil(temp)) {\n temp = parseFloat(temp);\n if(!isNaN(temp)) {\n temp = Math.max(temp, 0);\n temp = Math.min(temp, 1);\n res[OPACITY] = temp;\n }\n else {\n res[OPACITY] = 1;\n }\n }\n temp = style.zIndex;\n if(!isNil(temp)) {\n res[Z_INDEX] = parseInt(temp) || 0;\n }\n // 转化不同单位值为对象标准化,不写单位的变成number单位转化为px\n [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'width',\n 'height',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n if(v === 'auto') {\n v = [0, AUTO];\n }\n else {\n v = calUnit(v);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n let k2 = STYLE_KEY[style2Upper(k)];\n res[k2] = v;\n // 限制padding/border为正数\n if({\n paddingTop: true,\n paddingRight: true,\n paddingBottom: true,\n paddingLeft: true,\n borderTopWidth: true,\n borderRightWidth: true,\n borderBottomWidth: true,\n borderLeftWidth: true,\n width: true,\n height: true,\n }.hasOwnProperty(k) && v[0] < 0) {\n v[0] = 0;\n }\n });\n temp = style.flexBasis;\n if(!isNil(temp)) {\n if(temp === 'content') {\n res[FLEX_BASIS] = [temp, STRING];\n }\n else if(/^[\\d.]/.test(temp)) {\n let v = res[FLEX_BASIS] = calUnit(temp);\n v[0] = Math.max(v[0], 0);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n else {\n res[FLEX_BASIS] = [0, AUTO];\n }\n }\n temp = style.order;\n if(!isNil(temp)) {\n res[ORDER] = parseInt(temp) || 0;\n }\n temp = style.color;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[COLOR] = [[], INHERIT];\n }\n else {\n res[COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.textStrokeColor;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_COLOR] = [[], INHERIT];\n }\n else {\n res[TEXT_STROKE_COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.fontSize;\n if(temp || temp === 0) {\n if(temp === 'inherit') {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // fontSize不能为负数,否则为继承\n if(v < 0) {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[FONT_SIZE] = v;\n }\n }\n }\n temp = style.textStrokeWidth;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // textStrokeWidth不能为负数,否则为继承\n if(v < 0) {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG, PERCENT].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[TEXT_STROKE_WIDTH] = v;\n }\n }\n }\n temp = style.textStrokeOver;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_OVER] = [0, INHERIT];\n }\n else {\n let v = temp.toString();\n if(v !== 'none' && v !== 'fill') {\n v = 'none';\n }\n res[TEXT_STROKE_OVER] = [v, STRING];\n }\n }\n temp = style.fontWeight;\n if(!isNil(temp)) {\n if(temp === 'bold') {\n res[FONT_WEIGHT] = [700, NUMBER];\n }\n else if(temp === 'normal') {\n res[FONT_WEIGHT] = [400, NUMBER];\n }\n else if(temp === 'lighter') {\n res[FONT_WEIGHT] = [200, NUMBER];\n }\n else if(temp === 'inherit') {\n res[FONT_WEIGHT] = [0, INHERIT];\n }\n else {\n res[FONT_WEIGHT] = [Math.max(0, parseInt(temp)) || 400, NUMBER];\n }\n }\n temp = style.fontStyle;\n if(temp) {\n if(temp === 'inherit') {\n res[FONT_STYLE] = [0, INHERIT];\n }\n else {\n res[FONT_STYLE] = [temp, STRING];\n }\n }\n temp = style.fontFamily;\n if(temp) {\n if(temp === 'inherit') {\n res[FONT_FAMILY] = [0, INHERIT];\n }\n else {\n // 统一文字声明格式\n res[FONT_FAMILY] = [temp.toString().toLowerCase().replace(/['\"]/, '').replace(/\\s*,\\s*/g, ','), STRING];\n }\n }\n temp = style.textAlign;\n if(temp) {\n if(temp === 'inherit') {\n res[TEXT_ALIGN] = [0, INHERIT];\n }\n else {\n res[TEXT_ALIGN] = [temp, STRING];\n }\n }\n temp = style.lineHeight;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LINE_HEIGHT] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LINE_HEIGHT] = [0, AUTO];\n }\n // lineHeight默认数字,想要px必须强制带单位\n else if(/^[\\d.]+/i.test(temp)) {\n let v = calUnit(temp);\n if([DEG].indexOf(v[1]) > -1) {\n v[1] = NUMBER;\n }\n res[LINE_HEIGHT] = v;\n }\n else {\n let n = Math.max(0, parseFloat(temp)) || 'normal';\n // 非法数字\n if(n === 'normal') {\n res[LINE_HEIGHT] = [null, AUTO];\n }\n else {\n res[LINE_HEIGHT] = [n, NUMBER];\n }\n }\n }\n temp = style.letterSpacing;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LETTER_SPACING] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LETTER_SPACING] = [0, PX];\n }\n else if(/^[-+]?[\\d.]/.test(temp)) {\n let v = calUnit(temp);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[LETTER_SPACING] = v;\n }\n else {\n res[LETTER_SPACING] = [parseFloat(temp) || 0, PX];\n }\n }\n temp = style.whiteSpace;\n if(temp) {\n if(temp === 'inherit') {\n res[WHITE_SPACE] = [0, INHERIT];\n }\n else {\n res[WHITE_SPACE] = [temp, STRING];\n }\n }\n temp = style.lineClamp;\n if(temp !== undefined) {\n temp = parseInt(temp) || 0;\n res[LINE_CLAMP] = Math.max(0, temp);\n }\n // fill和stroke为渐变时特殊处理,fillRule无需处理字符串\n temp = style.fill;\n if(temp !== undefined) {\n if(!temp) {\n res[FILL] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[FILL] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[FILL] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[FILL] = [gradient.parseGradient(temp)];\n }\n else {\n res[FILL] = [rgba2int(temp)];\n }\n }\n temp = style.stroke;\n if(temp !== undefined) {\n if(!temp) {\n res[STROKE] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[STROKE] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[STROKE] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[STROKE] = [gradient.parseGradient(temp)];\n }\n else {\n res[STROKE] = [rgba2int(temp)];\n }\n }\n temp = style.strokeWidth;\n if(!isNil(temp)) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[STROKE_WIDTH] = temp.map(item => {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n v[0] = Math.max(v[0], 0);\n return v;\n });\n }\n temp = style.strokeDasharray;\n if(!isNil(temp)) {\n if(Array.isArray(temp)) {\n res[STROKE_DASHARRAY] = temp.map(item => {\n let match = item.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n return match;\n }\n return [];\n });\n }\n else {\n let match = temp.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n res[STROKE_DASHARRAY] = [match];\n }\n else {\n res[STROKE_DASHARRAY] = [[]];\n }\n }\n }\n temp = style.filter;\n if(temp !== undefined) {\n let match = (temp || '').toString().match(/\\b[\\w-]+\\s*\\(\\s*[-+]?[\\d.]+\\s*[pxremvwhdg%]*\\s*\\)\\s*/ig);\n let f = null;\n if(match) {\n f = [];\n match.forEach(item => {\n let m2 = /([\\w-]+)\\s*\\(\\s*([-+]?[\\d.]+\\s*[pxremvwhdg%]*)\\s*\\)\\s*/i.exec(item);\n if(m2) {\n let k = m2[1].toLowerCase(), v = calUnit(m2[2]);\n if(k === 'blur') {\n if(v[0] <= 0 || [DEG, PERCENT].indexOf(v[1]) > -1) {\n return;\n }\n if(v[1] === NUMBER) {\n v[1] = PX;\n }\n f.push([k, v]);\n }\n else if(k === 'hue-rotate') {\n if([NUMBER, DEG].indexOf(v[1]) === -1) {\n return;\n }\n v[1] = DEG;\n f.push([k, v]);\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'grayscale' || k === 'contrast') {\n if([NUMBER, PERCENT].indexOf(v[1]) === -1) {\n return;\n }\n v[0] = Math.max(v[0], 0);\n v[1] = PERCENT;\n f.push([k, v]);\n }\n }\n });\n }\n res[FILTER] = f;\n }\n temp = style.visibility;\n if(temp) {\n if(temp === 'inherit') {\n res[VISIBILITY] = [0, INHERIT];\n }\n else {\n res[VISIBILITY] = [temp, STRING];\n }\n }\n temp = style.pointerEvents;\n if(temp) {\n if(temp === 'inherit') {\n res[POINTER_EVENTS] = [0, INHERIT];\n }\n else {\n res[POINTER_EVENTS] = [temp, STRING];\n }\n }\n temp = style.boxShadow;\n if(temp !== undefined) {\n let bs = null;\n let match = (temp || '').match(/([-+]?[\\d.]+[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(!isNil(temp)) {\n res[Z_INDEX] = parseFloat(temp) || 0;\n }\n // 这些支持多个的用数组表示\n [\n 'backgroundRepeat',\n 'strokeLinecap',\n 'strokeLinejoin',\n 'strokeMiterlimit',\n 'fillRule',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n let v = style[k];\n res[STYLE_KEY[style2Upper(k)]] = Array.isArray(v) ? v : [v];\n }\n });\n GEOM_KEY_SET.forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[k] = style[k];\n }\n });\n return res;\n}\n\n/**\n * 第一次和REFLOW等级下,刷新前首先执行,生成computedStyle\n * 影响文字测量的只有字体和大小和重量,需要提前处理\n * 继承相关的计算\n * @param node 对象节点\n * @param isRoot 是否是根节点,无继承需使用默认值\n */\nfunction computeMeasure(node, isRoot) {\n let { currentStyle, computedStyle, domParent } = node;\n let parentComputedStyle = !isRoot && domParent.computedStyle;\n MEASURE_KEY_SET.forEach(k => {\n let v = currentStyle[k];\n // ff特殊处理\n if(k === FONT_FAMILY) {\n if(v[1] === INHERIT) {\n computedStyle[k] = getFontFamily(isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k]);\n }\n else {\n computedStyle[k] = getFontFamily(v[0]);\n }\n }\n else if(v[1] === INHERIT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k];\n }\n // 只有fontSize会有%\n else if(v[1] === PERCENT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (parentComputedStyle[k] * v[0] * 0.01);\n }\n else if(v[1] === REM) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.computedStyle[FONT_SIZE] * v[0]);\n }\n else if(v[1] === VW) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.width * 0.01 * v[0]);\n }\n else if(v[1] === VH) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.height * 0.01 * v[0]);\n }\n else 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];\n return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' '\n + fontSize + 'px/' + fontSize + 'px ' + (style[FONT_FAMILY] || 'arial');\n}\n\nfunction getFontFamily(str) {\n let ff = str.split(',');\n let f = 'arial';\n for(let i = 0, len = ff.length; i < len; i++) {\n if(font.support(ff[i])) {\n f = ff[i];\n break;\n }\n }\n return f;\n}\n\nfunction getBaseLine(style) {\n let fontSize = style[FONT_SIZE];\n let ff = getFontFamily(style[FONT_FAMILY]);\n let normal = fontSize * (font.info[ff] || font.info.arial).lhr;\n return (style[LINE_HEIGHT] - normal) * 0.5 + fontSize * (font.info[ff] || font.info.arial).blr;\n}\n\nfunction calNormalLineHeight(style) {\n let ff = getFontFamily(style[FONT_FAMILY]);\n return style[FONT_SIZE] * (font.info[ff] || font.info.arial).lhr;\n}\n\nfunction calRelativePercent(n, parent, k) {\n n *= 0.01;\n while(parent) {\n let style = parent.currentStyle[k];\n if(style[1] === AUTO) {\n if(k === WIDTH) {\n parent = parent.domParent;\n }\n else {\n break;\n }\n }\n else if(style[1] === PX) {\n return n * style[0];\n }\n else if(style[1] === PERCENT) {\n n *= style[0] * 0.01;\n parent = parent.domParent;\n }\n else if(style[1] === REM) {\n return n * style[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(style[1] === VW) {\n return n * style[0] * parent.root.width * 0.01;\n }\n else if(style[1] === VH) {\n return n * style[0] * parent.root.height * 0.01;\n }\n 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\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 DISPLAY,\n VISIBILITY,\n },\n NODE_KEY: {\n NODE_OPACITY,\n NODE_CACHE_TOTAL,\n NODE_CACHE_FILTER,\n NODE_CACHE_OVERFLOW,\n NODE_HAS_CONTENT,\n NODE_COMPUTED_STYLE,\n },\n} = enums;\n\n// 根据一个共享cache的信息,生成一个独立的离屏canvas,一般是filter,mask用\nfunction genSingle(cache, message) {\n let { size, sx1, sy1, width, height, bbox } = cache;\n let offscreen = inject.getCacheCanvas(width, height, null, message);\n offscreen.x = 0;\n offscreen.y = 0;\n offscreen.bbox = bbox;\n offscreen.size = size;\n offscreen.sx1 = sx1;\n offscreen.sy1 = sy1;\n offscreen.dx = cache.dx;\n offscreen.dy = cache.dy;\n offscreen.dbx = cache.dbx;\n offscreen.dby = cache.dby;\n offscreen.width = width;\n offscreen.height = height;\n return offscreen;\n}\n\nclass Cache {\n constructor(w, h, bbox, page, pos, x1, y1) {\n this.__init(w, h, bbox, page, pos, x1, y1);\n }\n\n __init(w, h, bbox, page, pos, x1, y1) {\n this.__width = w;\n this.__height = h;\n this.__bbox = bbox;\n this.__page = page;\n this.__pos = pos;\n let [x, y] = page.getCoords(pos);\n this.__x = x;\n this.__y = y;\n this.__appendData(x1, y1);\n 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 },\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') {\n bp = bp.domParent;\n }\n this.__bp = bp;\n let parentComputedStyle = bp.computedStyle;\n let pff = 'arial';\n for(let i = 0, pffs = parentComputedStyle[FONT_FAMILY].split(','), len = pffs.length; i < len; i++) {\n if(inject.checkSupportFontFamily(pffs[i])) {\n ff = ffs[i];\n break;\n }\n }\n let pfs = parentComputedStyle[FONT_SIZE];\n let pfw = parentComputedStyle[FONT_WEIGHT];\n let pKey = this.__pKey = pfs + ',' + pff + ',' + pfw;\n let parentCache = textCache.charWidth[pKey] = textCache.charWidth[pKey] || {};\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(renderMode === mode.WEBGL) {\n ctx = inject.getCacheCanvas(16, 16, '__$$CHECK_SUPPORT_FONT_FAMILY$$__').ctx;\n }\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n ctx.font = css.setFontStyle(parentComputedStyle);\n parentCache[ELLIPSIS] = ctx.measureText(ELLIPSIS).width;\n }\n ctx.font = css.setFontStyle(computedStyle);\n }\n else if(renderMode === mode.SVG) {\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n parentCache[ELLIPSIS] = 0;\n let wait = textCache.data[pKey] = textCache.data[pKey] || {\n ff: pff,\n fs: pfs,\n fw: pfw,\n hash: {},\n s: '',\n };\n wait.s += ELLIPSIS;\n needMeasure = true;\n }\n }\n // 逐字测量,canvas可瞬间得到信息,svg先预存统一进行\n for(let i = 0, length = content.length; i < length; i++) {\n let char = content.charAt(i);\n let mw;\n if(cache.hasOwnProperty(char)) {\n mw = cache[char];\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n mw = cache[char] = ctx.measureText(char).width;\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else {\n if(!wait.hash.hasOwnProperty(char)) {\n wait.s += char;\n }\n wait.hash[char] = true;\n // 先预存标识位-1,测量完后替换它\n charWidthList.push(-1);\n needMeasure = true;\n }\n }\n this.__textWidth = sum;\n if(needMeasure) {\n textCache.list.push(this);\n }\n }\n\n __measureCb() {\n let { content, charWidthList } = this;\n let key = this.__key;\n let cache = textCache.charWidth[key];\n let sum = 0;\n for(let i = 0, len = charWidthList.length; i < len; i++) {\n if(charWidthList[i] < 0) {\n let mw = charWidthList[i] = cache[content.charAt(i)];\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n }\n this.__textWidth = sum;\n }\n\n /**\n * text在virtual时和普通一样,无需特殊处理\n * endSpace由外界inline布局控制,末尾最后一行的空白mpb,包含递归情况,递归为多个嵌套末尾节点的空白mpb之和\n * 即便宽度不足,每行还是强制渲染一个字符,换行依据lx开始,因为x可能是从中间开始的,非inline则两个相等\n * 最后一个字符排版时要考虑末尾mpb,排不下的话回退删掉这个字符,如果最后一个字符另起开头,排不下也强制排,每行至少1个字符\n * 在textOverflow时很特殊,多个inline同行,回退可能到前一个inline节点,这个通过x和lx判断是否行首,决定至少1个字符规则\n * @param data\n * @private\n */\n __layout(data) {\n let __cache = this.__config[NODE_CACHE];\n if(__cache) {\n __cache.release();\n }\n let { x, y, w, lx = x, lineBoxManager, endSpace = 0, lineClamp = 0, lineClampCount = 0 } = data;\n this.__x = this.__sx1 = x;\n this.__y = this.__sy1 = y;\n let { isDestroyed, content, currentStyle, computedStyle, textBoxes, charWidthList, root, __ff, __key } = this;\n textBoxes.splice(0);\n let __config = this.__config;\n __config[NODE_LIMIT_CACHE] = false;\n // 空内容w/h都为0可以提前跳出\n if(isDestroyed || currentStyle[DISPLAY] === 'none' || !content) {\n return lineClampCount;\n }\n this.__ox = this.__oy = 0;\n // 顺序尝试分割字符串为TextBox,形成多行,begin为每行起始索引,i是当前字符索引\n let begin = 0;\n let i = 0;\n let beginSpace = x - lx; // x>=lx,当第一行非起始处时前面被prev节点占据,这个差值可认为是count宽度\n let count = beginSpace;\n let length = content.length;\n let maxW = 0;\n let {\n [LINE_HEIGHT]: lineHeight,\n [LETTER_SPACING]: letterSpacing,\n [WHITE_SPACE]: whiteSpace,\n [FONT_SIZE]: fontSize,\n [FONT_WEIGHT]: fontWeight,\n } = computedStyle;\n // 特殊字体中特殊字符连续时需减少一定的padding量\n let padding = font.info[__ff].padding;\n let needReduce = !!padding;\n let lastChar;\n let ew = textCache.charWidth[this.__pKey][ELLIPSIS];\n let lineCount = 0;\n // 不换行特殊对待,同时考虑overflow和textOverflow\n if(whiteSpace === 'nowrap') {\n let isTextOverflow;\n // block的overflow:hidden和textOverflow:clip/ellipsis才生效,inline要看最近非inline父元素\n let bp = this.__bp;\n let {\n [DISPLAY]: display,\n [OVERFLOW]: overflow,\n [WIDTH]: width,\n [TEXT_OVERFLOW]: textOverflow,\n } = bp.currentStyle;\n // 只要是overflow隐藏,不管textOverflow如何(默认是clip等同于overflow:hidden的功能)都截取\n if(overflow === 'hidden') {\n while(i < length) {\n count += charWidthList[i] + letterSpacing;\n if(count > w) {\n // block/flex无需宽度,inline-block需要设置宽度才生效\n if(display === 'block' || display === 'flex') {\n isTextOverflow = true;\n }\n else if(width[1] !== AUTO) {\n isTextOverflow = true;\n }\n break;\n }\n i++;\n }\n }\n else {\n while(i < length) {\n count += charWidthList[i++] + letterSpacing;\n }\n }\n // ellipsis生效情况,本节点开始向前回退查找,尝试放下一部分字符\n if(isTextOverflow && textOverflow === 'ellipsis') {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n }\n // 默认clip跟随overflow:hidden,无需感知\n else {\n let textBox = new TextBox(this, textBoxes.length, x, y, count - beginSpace, lineHeight,\n content, charWidthList);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n maxW = count - beginSpace;\n y += lineHeight;\n }\n }\n // 普通换行,注意x和lx的区别,可能相同(block起始处)可能不同(非起始处),第1行从x开始,第2行及以后都从lx开始\n // 然后第一次换行还有特殊之处,可能同一行前半部行高很大,此时y增加并非自身的lineHeight,而是整体LineBox的\n else {\n while(i < length) {\n let cw = charWidthList[i] + letterSpacing;\n count += cw;\n // 连续字符减少padding,除了连续还需判断char是否在padding的hash中\n if(needReduce) {\n let char = content[i];\n if(char === lastChar && padding.hasOwnProperty(char) && padding[char]) {\n let hasCache, p = textCache.padding[__key] = textCache.padding[__key] || {};\n if(textCache.padding.hasOwnProperty(__key)) {\n if(p.hasOwnProperty(char)) {\n hasCache = true;\n count -= p[char];\n }\n }\n if(!hasCache) {\n let n = 0;\n if(root.renderMode === mode.CANVAS) {\n root.ctx.font = css.setFontStyle(computedStyle);\n let w1 = root.ctx.measureText(char).width;\n let w2 = root.ctx.measureText(char + char).width;\n n = w1 * 2 - w2;\n n *= padding[char];\n }\n else if(root.renderMode === mode.SVG) {\n n = inject.measureTextSync(__key, __ff, fontSize, fontWeight, char);\n n *= padding[char];\n }\n count -= n;\n p[char] = n;\n }\n }\n lastChar = char;\n }\n // 忽略零宽字符\n if(cw === 0) {\n i++;\n continue;\n }\n // 换行都要判断i不是0的时候,第1个字符强制不换行\n if(count === w) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n let textBox;\n // 特殊情况,恰好最后一行最后一个排满,此时查看末尾mpb,要防止i为0的情况首个字符特殊不回退,无需看开头mpb\n if(i === length - 1 && count > w - endSpace && i) {\n count -= charWidthList[i--];\n }\n i++;\n if(!lineCount) {\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, count);\n }\n // 必须先添加再设置y,当有diff的lineHeight时,第一个换行不影响,再换行时第2个换行即第3行会被第1行影响\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null; // 换行后连续字符reduce不生效重新计数\n }\n // 奇怪的精度问题,暂时不用相等判断,而是为原本w宽度加一点点冗余1e-10\n else if(count > w + (1e-10)) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n // 普通非多行文本阶段逻辑\n let width;\n // 宽度不足时无法跳出循环,至少也要塞个字符形成一行,无需判断第1行,因为是否放得下逻辑在dom中做过了,\n // 如果第1行放不下,一定会另起一行,此时作为开头再放不下才会进这里,这个if只有0或1个字符的情况\n if(i <= begin) {\n width = count;\n }\n // 超过2个字符回退1个\n else {\n width = count - charWidthList[i--];\n }\n i++;\n // 根据是否第一行分开处理行首空白\n let textBox;\n if(!lineCount) {\n maxW = width - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, width);\n }\n // 必须先添加再设置y,同上\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null;\n }\n else {\n i++;\n }\n }\n // 换行后Text的x重设为lx\n if(lineCount) {\n this.__x = this.__sx1 = lx;\n }\n // 最后一行,只有一行未满时也进这里,需查看末尾mpb,排不下回退一个字符\n // 声明了lineClamp时特殊考虑,这里一定是最后一行,要对比行数不能超过,超过忽略掉这些文本\n if(begin < length && (!lineClamp || lineCount + lineClampCount < lineClamp)) {\n let textBox;\n if(!lineCount) {\n let needBack;\n // 防止开头第一个begin=0时回退,这在inline有padding且是第一个child时会发生\n if(begin && count > w - endSpace) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n else {\n let needBack;\n // 防止begin在结尾时回退,必须要有个字符,这在最后一行1个字符排不下时会出现\n if(count > w - endSpace && begin < length - 1) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n maxW = Math.max(maxW, count);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n }\n }\n this.__width = maxW;\n this.__height = y - data.y;\n this.__baseLine = css.getBaseLine(computedStyle);\n return lineCount;\n }\n\n // 末尾行因ellipsis的缘故向前回退字符生成textBox,可能会因不满足宽度导致无法生成,此时向前继续回退TextBox\n __lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount, lineHeight, lx, x, y, maxW,\n textBoxes, content, charWidthList, lineBoxManager) {\n for(; i >= begin; i--) {\n count -= charWidthList[i] + letterSpacing;\n if(count + ew + endSpace <= w) {\n // 至少1个字符不用回退,到0也没找到需要回退\n if(i) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n break;\n }\n }\n }\n // 最后也没找到,看是否要查找前一个inline节点,还是本身是行首兜底首字母\n if(i < 0) {\n let lineBox = lineBoxManager.lineBox;\n // lineBox为空是行首,至少放1个字符\n if(!lineBox.size) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.charAt(begin), charWidthList.slice(begin, begin + 1));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n }\n // 向前查找inline节点,可能会有前面inline嵌套,因此直接用lineBox,不会出现inlineBlock,\n // 这里和css不同,ib强制超限换行不会同行\n else {\n let list = lineBox.list;\n outer:\n for(let j = list.length - 1; j >= 0; j--) {\n let tb = list[j];\n let { content, wList, width } = tb;\n // 整体减去可以说明可能在这个tb中,只要最后发现不是空文本节点就行,否则继续;第0个强制进入保证1字符\n if(count - width + ew <= w || !j) {\n // 找到可以跳出outer循环,找不到继续,注意第0个且1个字符判断\n for(let k = wList.length - 1; k >= 0; k--) {\n if(!k && !j || count + ew <= w) {\n tb.__content = content;\n tb.__width = width;\n tb.parent.__ellipsis = true;\n break outer;\n }\n else {\n let w2 = wList[k];\n tb.__endY -= w2;\n width -= w2;\n content = content.slice(0, k);\n count -= w2;\n wList.pop();\n }\n }\n }\n // 不够则看前一个tb并且删掉这个\n else {\n count -= width;\n }\n list.pop();\n tb.parent.textBoxes.pop();\n }\n }\n }\n return [y, maxW];\n }\n\n __offsetX(diff, isLayout) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetX(diff);\n });\n }\n this.__sx1 += diff;\n }\n\n __offsetY(diff, isLayout) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetY(diff);\n });\n }\n this.__sy1 += diff;\n }\n\n __tryLayInline(w) {\n return w - this.charWidthList[0];\n }\n\n __inlineSize() {\n let minX, maxX;\n this.textBoxes.forEach((item, i) => {\n if(i) {\n minX = Math.min(minX, item.x);\n maxX = Math.max(maxX, item.x + item.width);\n }\n else {\n minX = item.x;\n maxX = item.x + item.width;\n }\n });\n this.__x = minX;\n this.__sx = this.__sx1 = minX + this.ox;console.log(22222)\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] * 0.5, half);\n }\n else if(textStrokeWidth[1] === VW) {\n half = Math.max(textStrokeWidth[0] * root.width * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VH) {\n half = Math.max(textStrokeWidth[0] * root.height * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VMAX) {\n half = Math.max(textStrokeWidth[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VMIN) {\n half = Math.max(textStrokeWidth[0] * Math.min(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(textStrokeWidth[0] * 0.5, half);\n }\n half += 1;\n return [sx - half, sy - half, sx + width + half, sy + height + half];\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get matrix() {\n return this.domParent.matrix;\n }\n\n get matrixEvent() {\n return this.domParent.matrixEvent;\n }\n}\n\nText.prototype.__renderByMask = Text.prototype.render;\n\nexport default Text;\n","import util from './util';\nimport $$type from './$$type';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\n/**\n * 2. 打平children中的数组,变成一维\n * 3. 合并相连的Text节点,即string内容\n */\nfunction flattenJson(parent) {\n if(Array.isArray(parent)) {\n return parent.map(item => flattenJson(item));\n }\n else if(!parent || [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) {\n return parent;\n }\n let list = [];\n traverseJson(list, parent.children, {\n lastText: null,\n });\n parent.children = list;\n return parent;\n}\n\nfunction traverseJson(list, children, options) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n traverseJson(list, item, options);\n });\n }\n else if(children && (children.$$type === TYPE_VD || children.$$type === TYPE_GM)) {\n if(['canvas', 'svg', 'webgl'].indexOf(children.tagName) > -1) {\n throw new Error('Can not nest canvas/svg/webgl');\n }\n if(children.$$type === TYPE_VD) {\n flattenJson(children);\n }\n list.push(children);\n options.lastText = null;\n }\n else if(children && children.$$type === TYPE_CP) {\n list.push(children);\n // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做\n options.lastText = null;\n }\n // 排除掉空的文本,连续的text合并\n else if(!util.isNil(children) && children !== '') {\n if(options.lastText !== null) {\n list[list.length - 1] = options.lastText += children;\n }\n else {\n list.push(children);\n }\n }\n}\n\nexport default flattenJson;\n","import Text from '../node/Text';\nimport util from './util';\nimport $$type from './$$type';\nimport enums from './enums';\nimport flatten from './flatten';\n\nconst { NODE_KEY: {\n NODE_DOM_PARENT,\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n} } = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nfunction initRoot(cd, root) {\n let c = flatten({\n tagName: root.tagName,\n props: {},\n children: cd,\n $$type: TYPE_VD,\n });\n root.__json = c;\n root.__host = root;\n let children = build(c.children, root, root);\n return relation(root, children);\n}\n\nfunction initDom(json, root, host, parent) {\n let vd = build(json, root, host);\n return relation(parent, vd);\n}\n\nfunction initCp(json, root, host) {\n if(util.isObject(json)) {\n // cp的flatten在__init中自己做\n return build(json, root, host);\n }\n // text的relation会由上层如Root设置\n else {\n return new Text(json);\n }\n}\n\nfunction initCp2(json, root, host, parent) {\n let vd = new json.klass(json.props);\n vd.__tagName = json.tagName || vd.__tagName;\n vd.__root = root;\n vd.__host = host;\n vd.__json = json;\n vd.__init();\n return relation(parent, vd);\n}\n\n/**\n * 将初始json文件生成virtualDom\n * @param json\n * @param root\n * @param host\n * @param hasP 出现过p标签\n * @returns vd\n */\nfunction build(json, root, host, hasP) {\n if(Array.isArray(json)) {\n return json.map(item => build(item, root, host, hasP));\n }\n let vd;\n if(util.isObject(json) && json.$$type) {\n let { tagName, props, children, klass, $$type, __inheritAnimate, __animateRecords } = json;\n // 更新过程中无变化的cp直接使用原来生成的\n if($$type === TYPE_CP && json.__placeholder) {\n return json.__placeholder;\n }\n if($$type === TYPE_VD) {\n if(tagName === 'img') {\n vd = new Img(tagName, props);\n if(Array.isArray(children) && children.length) {\n throw new Error('Img can not contain children');\n }\n }\n else {\n vd = new Dom(tagName, props);\n }\n // 检查p不能包含div\n if(tagName === 'p') {\n hasP = true;\n }\n else if(tagName === 'div' && hasP) {\n throw new Error('Markup p can not contain div');\n }\n if(Array.isArray(children)) {\n children = relation(vd, build(children, root, host, hasP));\n }\n else {\n children = [];\n }\n vd.__children = children;\n }\n else if($$type === TYPE_GM) {\n let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\n }\n else if($$type === TYPE_CP) {\n vd = new klass(props);\n vd.__tagName = tagName || vd.__tagName;\n }\n else {\n return new Text(json);\n }\n // 根parse需要用到真正的vd引用,然后vd也要引用json,用以做domApi\n json.vd = vd;\n vd.__json = json;\n // 递归parse中的动画记录需特殊处理,将target改为真正的vd引用\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n __animateRecords.list.forEach(item => {\n item.target = item.target.vd;\n });\n delete json.__animateRecords;\n }\n // 更新过程中key相同或者普通相同的vd继承动画\n if(__inheritAnimate) {\n util.extendAnimate(__inheritAnimate, vd);\n delete json.__inheritAnimate;\n }\n vd.__root = root;\n vd.__host = host;\n if($$type === TYPE_CP) {\n vd.__init();\n }\n let ref = props.ref;\n if(util.isString(ref) && ref || util.isNumber(ref)) {\n host.ref[ref] = vd;\n }\n else if(util.isFunction(ref)) {\n ref(vd);\n }\n return vd;\n }\n return new Text(json);\n}\n\n/**\n * 设置关系,父子和兄弟\n * @param parent\n * @param children\n * @param options\n * @returns {Xom|Text|Component}\n */\nfunction relation(parent, children, options = {}) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n relation(parent, item, options);\n });\n }\n else if(children instanceof Xom || children instanceof Component || children instanceof Text) {\n children.__parent = parent;\n children.__domParent = parent;\n // 极为恶心,为了v8的性能优化,text复用parent的__config部分,但domParent重设\n if(children instanceof Text) {\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n if(children.__config) {\n children.__config[NODE_DOM_PARENT] = parent;\n }\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n // 文字视作为父节点的直接文字子节点\n if(children instanceof Component) {\n let sr = children.shadowRoot;\n if(sr instanceof Text) {\n sr.__parent = parent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n sr.__domParent = parent;\n if(sr.__config) {\n sr.__config[NODE_DOM_PARENT] = parent;\n }\n }\n }\n return children;\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n initRoot,\n initDom,\n initCp,\n initCp2,\n relation,\n};\n","import util from './util';\n\nconst { isFunction } = util;\n\nclass Event {\n constructor() {\n this.__eHash = {};\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.on(id[i], handle);\n }\n }\n else {\n if(!self.__eHash.hasOwnProperty(id)) {\n self.__eHash[id] = [];\n }\n // 遍历防止此handle被侦听过了\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n if(item[i] === handle) {\n return self;\n }\n }\n self.__eHash[id].push(handle);\n }\n return self;\n }\n\n once(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n function cb(...data) {\n handle.apply(self, data);\n self.off(id, cb);\n }\n\n cb.__karasEventCb = handle;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.once(id[i], handle);\n }\n }\n else if(handle) {\n self.on(id, cb);\n }\n return this;\n }\n\n off(id, handle) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.off(id[i], handle);\n }\n }\n else if(self.__eHash.hasOwnProperty(id)) {\n if(handle) {\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n // 需考虑once包裹的引用对比\n if(item[i] === handle || item[i].__karasEventCb === handle) {\n item.splice(i, 1);\n break;\n }\n }\n }\n // 未定义为全部清除\n else {\n delete self.__eHash[id];\n }\n }\n return this;\n }\n\n emit(id, ...data) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.emit(id[i], data);\n }\n }\n else {\n if(self.__eHash.hasOwnProperty(id)) {\n let list = self.__eHash[id];\n if(list.length) {\n list = list.slice();\n for(let i = 0, len = list.length; i < len; i++) {\n let cb = list[i];\n if(isFunction(cb)) {\n cb.apply(self, data);\n }\n }\n }\n }\n }\n return this;\n }\n\n static mix(...obj) {\n for(let i = obj.length - 1; i >= 0; i--) {\n let o = obj[i];\n let event = new Event();\n o.__eHash = {};\n let fns = ['on', 'once', 'off', 'emit'];\n for(let j = fns.length - 1; j >= 0; j--) {\n let fn = fns[j];\n o[fn] = event[fn];\n }\n }\n }\n\n static REFRESH = 'refresh';\n static PAUSE = 'pause';\n static PLAY = 'play';\n static FRAME = 'frame';\n static FINISH = 'finish';\n static CANCEL = 'cancel';\n static BEGIN = 'begin';\n static END = 'end';\n}\n\nexport default Event;\n","import Node from './Node';\nimport Text from './Text';\nimport builder from '../util/builder';\nimport Event from '../util/Event';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport flatten from '../util/flatten';\nimport css from '../style/css';\nimport change from '../refresh/change';\n\nconst { isNil, isFunction, clone, extend } = util;\n\nconst REGISTER = {};\n\n/**\n * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归\n * 在check时树递归会用到,判断是否需要查找cp更新\n * @param cp\n */\nfunction setUpdateFlag(cp) {\n // 去重\n if(cp.__hasUpdate) {\n return;\n }\n cp.__hasUpdate = true;\n let host = cp.host;\n if(host) {\n setUpdateFlag(host);\n }\n}\n\nclass Component extends Event {\n constructor(props = {}) {\n super();\n this.__tagName = /(?:function|class)\\s+([\\w$]+)/.exec(this.constructor.toString())[1];\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__parent = null;\n this.__host = null;\n this.__ref = {};\n this.state = {};\n this.__isMounted = false;\n this.__taskList = [];\n }\n\n setState(n, cb) {\n let self = this;\n if(isNil(n)) {\n n = {};\n }\n else if(isFunction(n)) {\n return;\n }\n else {\n if(Object.keys(n).length === 0) {\n if(isFunction(cb)) {\n cb.call(self);\n }\n return;\n }\n let state = clone(self.state);\n n = extend(state, n);\n }\n let root = self.root;\n if(root && self.__isMounted) {\n // 一帧之内多次调用,需合并\n if(self.__nextState) {\n Object.assign(self.__nextState, n);\n self.__taskList.push(cb);\n }\n else {\n self.__nextState = n;\n self.__taskList = [cb];\n // 回调更新列表,before执行时splice出来供after执行,防止中途产生的后续setState干扰\n let list = [];\n let t = self.__task = {\n __before: () => {\n list = self.__taskList.splice(0);\n // 标识更新\n setUpdateFlag(this);\n },\n __after: () => {\n // self.__nextState = null; 由updater.js每次refresh前同步执行清空,这里不能异步清除,否则frame动画会乱序\n list.forEach(cb => {\n if(isFunction(cb)) {\n cb.call(self);\n }\n });\n },\n };\n root.addRefreshCp(t);\n }\n }\n // 构造函数中调用还未render,\n else if(isFunction(cb)) {\n self.state = n;\n cb.call(self);\n }\n }\n\n /**\n * build中调用初始化,json有值时是update过程才有,且处理过flatten\n * @param json\n * @private\n */\n __init(json) {\n this.__ref = {};\n let root = this.root;\n let cd = json || flatten(this.render());\n let sr = builder.initCp(cd, root, this);\n this.__cd = cd;\n if(sr instanceof Text) {\n // 文字视作为父节点的直接文字子节点,在builder里做\n }\n else if(sr instanceof Node) {\n let style = css.normalize(this.props.style);\n let keys = Object.keys(style);\n extend(sr.style, style, keys);\n extend(sr.currentStyle, style, keys);\n // 事件添加到sr\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n });\n }\n else if(!(sr instanceof Component)) {\n // 本身build是递归的,子cp已经初始化了\n throw new Error('Component render() must return a dom/text: ' + this);\n }\n // 自定义事件无视返回强制添加\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n k = k.slice(3);\n this.on(k, v);\n }\n });\n // shadow指向直接renderRoot,shadowRoot考虑到返回Component的递归即hoc高阶组件\n // host是直接所属,hostRoot同考虑到高阶组件\n this.__shadow = sr;\n sr.__host = this;\n // 递归下去,多层级时执行顺序由里到外,最终会被最上层执行替换\n while(sr instanceof Component) {\n sr.__hostRoot = this;\n sr.shadow.__host = sr;\n sr = sr.shadow;\n }\n this.__shadowRoot = sr;\n sr.__hostRoot = this;\n if(!this.__isMounted) {\n this.__isMounted = true;\n if(isFunction(this.componentDidMount)) {\n root.once(Event.REFRESH, () => {\n this.componentDidMount();\n });\n }\n }\n }\n\n render() {\n inject.warn('Component must implement render()');\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.__isDestroyed = true;\n this.__isMounted = false;\n if(isFunction(this.componentWillUnmount)) {\n this.componentWillUnmount();\n }\n this.root.delRefreshTask(this.__task);\n if(this.shadowRoot) {\n this.shadowRoot.__destroy();\n }\n this.__parent = null;\n }\n\n __emitEvent(e, force) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n return;\n }\n let res = sr.__emitEvent(e, force);\n if(res) {\n e.target = this;\n return true;\n }\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get shadow() {\n return this.__shadow;\n }\n\n get shadowRoot() {\n return this.__shadowRoot;\n }\n\n get root() {\n return this.__root;\n }\n\n get host() {\n return this.__host;\n }\n\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n get state() {\n return this.__state;\n }\n\n set state(v) {\n this.__state = v;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)) {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Component has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)\n || !obj.prototype || !(obj.prototype instanceof Component)) {\n throw new Error('Invalid param: Component register');\n }\n if(Component.hasRegister(name)) {\n throw new Error(`Component has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Component.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nObject.keys(change.GEOM).concat([\n 'x',\n 'y',\n 'ox',\n 'oy',\n 'sx',\n 'sy',\n // '__sx1',\n // '__sx2',\n // '__sx3',\n // '__sx4',\n // '__sx5',\n // '__sx6',\n // '__sy1',\n // '__sy2',\n // '__sy3',\n // '__sy4',\n // '__sy5',\n // '__sy6',\n 'width',\n 'height',\n 'outerWidth',\n 'outerHeight',\n 'clientWidth',\n 'clientHeight',\n 'offsetWidth',\n 'offsetHeight',\n 'style',\n 'animationList',\n 'animateStyle',\n 'currentStyle',\n 'computedStyle',\n 'currentProps',\n 'baseLine',\n 'virtualDom',\n 'mask',\n 'maskId',\n 'textWidth',\n 'content',\n 'lineBoxes',\n 'charWidthList',\n 'charWidth',\n '__layoutData',\n 'availableAnimating',\n 'effectiveAnimating',\n 'displayAnimating',\n 'visibilityAnimating',\n 'bbox',\n '__config',\n 'contentBoxList',\n 'listener',\n 'matrix',\n 'matrixEvent',\n]).forEach(fn => {\n Object.defineProperty(Component.prototype, fn, {\n get() {\n let sr = this.shadowRoot;\n if(sr) {\n return sr[fn];\n }\n },\n });\n});\n\n[\n '__layout',\n '__layoutAbs',\n '__layoutNone',\n '__tryLayInline',\n '__offsetX',\n '__offsetY',\n '__calAutoBasis',\n '__calMp',\n '__calAbs',\n '__renderAsMask',\n '__renderByMask',\n '__mp',\n 'animate',\n 'removeAnimate',\n 'clearAnimate',\n 'updateStyle',\n 'getBoundingClientRect',\n 'getComputedStyle',\n '__deepScan',\n 'clearCache',\n '__structure',\n '__modifyStruct',\n '__updateStruct',\n 'flowChildren',\n 'absChildren',\n '__isRealInline',\n '__calBasis',\n '__calMinMax',\n '__computeMeasure',\n 'appendChild',\n 'prependChild',\n 'insertBefore',\n 'insertAfter',\n 'removeChild',\n 'remove',\n].forEach(fn => {\n Component.prototype[fn] = function() {\n let sr = this.shadowRoot;\n if(sr && isFunction(sr[fn])) {\n return sr[fn].apply(sr, arguments);\n }\n };\n});\n\nexport default Component;\n","import unit from './unit';\nimport transform from './transform';\nimport enums from '../util/enums';\n\nconst { STYLE_KEY: { SCALE_X, SCALE_Y } } = enums;\nconst { PERCENT, NUMBER } = unit;\n\nfunction matrixResize(imgWidth, imgHeight, targetWidth, targetHeight, x, y, w, h) {\n if(imgWidth === targetWidth && imgHeight === targetHeight) {\n return;\n }\n let list = [\n [SCALE_X, [targetWidth / imgWidth, NUMBER]],\n [SCALE_Y, [targetHeight / imgHeight, NUMBER]],\n ];\n let tfo = transform.calOrigin([[0, PERCENT], [0, PERCENT]], w, h);\n tfo[0] += x;\n tfo[1] += y;\n return transform.calMatrixWithOrigin(list, tfo, w, h);\n}\n\nexport default {\n matrixResize,\n};\n","import border from './border';\nimport transform from './transform';\nimport mx from '../math/matrix';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\nimport unit from './unit';\nimport enums from '../util/enums';\nimport image from './image';\n\nconst {\n STYLE_KEY: {\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\nconst { clone, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { AUTO, PX, PERCENT, STRING, REM, VW, VH, 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_FRAME_CB,\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_CAL_DIFF_TIME,\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') {\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') {\n let n = v[k].slice(0);\n n[0] = 100 + n[0] * percent;\n st.push([k, n]);\n }\n }\n });\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n for(let i = 0; i < 2; i++) {\n st[i][0] += v[i] * percent;\n }\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n if(v[0] !== 0) {\n st[0][0] += v[0] * percent;\n }\n if(v[1] !== 0) {\n st[1][0] += v[1] * percent;\n }\n }\n else if(k === BOX_SHADOW) {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n st[i][j] += v[i][j] * percent;\n }\n // rgba\n for(let j = 0; j < 4; j++) {\n st[i][4][j] += v[i][4][j] * percent;\n }\n }\n }\n else if(k === BACKGROUND_SIZE) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0][0] += v[i][0] * percent;\n item[1][0] += v[i][1] * percent;\n }\n });\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0] += v[i] * percent;\n }\n });\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n st.forEach((st2, i) => {\n let v2 = v[i];\n if(!v2) {\n return;\n }\n let [c, d, p, z] = v2;\n if(GRADIENT_TYPE.hasOwnProperty(st2.k)) {\n for(let i = 0, len = Math.min(st2.v.length, c.length); i < len; i++) {\n let a = st2.v[i];\n let b = c[i];\n a[0][0] += b[0][0] * percent;\n a[0][1] += b[0][1] * percent;\n a[0][2] += b[0][2] * percent;\n a[0][3] += b[0][3] * percent;\n if(a[1] && b[1]) {\n a[1][0] += b[1] * percent;\n }\n }\n if(st2.k === 'linear' && st2.d !== undefined && d !== undefined) {\n if(Array.isArray(d)) {\n st2.d[0] += d[0] * percent;\n st2.d[1] += d[1] * percent;\n st2.d[2] += d[2] * percent;\n st2.d[3] += d[3] * percent;\n }\n else {\n st2.d += d * percent;\n }\n }\n if(st2.k === 'radial') {\n if(st2.z !== undefined && z !== undefined) {\n st2.z[0] += z[0] * percent;\n st2.z[1] += z[1] * percent;\n st2.z[2] += z[2] * percent;\n st2.z[3] += z[3] * percent;\n st2.z[4] += z[4] * percent;\n }\n else if(st2.p !== undefined && p !== undefined) {\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n else if(st2.k === 'conic' && st2.d !== undefined && d !== undefined) {\n st2.d += d * percent;\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n // fill纯色\n else {\n st2[0] += c[0] * percent;\n st2[1] += c[1] * percent;\n st2[2] += c[2] * percent;\n st2[3] += c[3] * percent;\n }\n });\n }\n // color可能超限[0,255],但浏览器已经做了限制,无需关心\n else if(COLOR_HASH.hasOwnProperty(k)) {\n st = st[0];\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n else if(GEOM.hasOwnProperty(k)) {\n let st = style[k];\n let tagName = target.tagName;\n if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calIncrease)) {\n let fn = GEOM[k][tagName].calIncrease;\n if(target.isMulti) {\n style[k] = st.map((item, i) => {\n return fn(item, v[i], percent);\n });\n }\n else {\n style[k] = fn(st, v, percent);\n }\n }\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n let o2 = o[j];\n let n2 = n[j];\n if(!isNil(o2) && !isNil(n2)) {\n for(let k = 0, len3 = Math.min(o2.length, n2.length); k < len3; k++) {\n if(!isNil(o2[k]) && !isNil(n2[k])) {\n o2[k] += n2[k] * percent;\n }\n }\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n v.forEach((item, i) => {\n let st2 = st[i];\n if(!isNil(item) && !isNil(st2)) {\n for(let i = 0, len = Math.min(st2.length, item.length); i < len; i++) {\n let o = st2[i];\n let n = item[i];\n if(!isNil(o) && !isNil(n)) {\n st2[i] += n * percent;\n }\n }\n }\n });\n }\n else {\n v.forEach((item, i) => {\n if(!isNil(item) && !isNil(st[i])) {\n st[i] += item * percent;\n }\n });\n }\n }\n else {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n if(!isNil(o[j]) && !isNil(n[j])) {\n o[j] += n[j] * percent;\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(!isNil(st[0]) && !isNil(v[0])) {\n st[0] += v[0] * percent;\n }\n if(!isNil(st[1]) && !isNil(v[1])) {\n st[1] += v[1] * percent;\n }\n }\n else {\n if(!isNil(st) && !isNil(v)) {\n style[k] += v * percent;\n }\n }\n }\n }\n else if(k === OPACITY || k === Z_INDEX) {\n style[k] += v * percent;\n // 精度问题可能会超过[0,1]区间\n if(k === OPACITY) {\n if(style[k] < 0) {\n style[k] = 0;\n }\n else if(style[k] > 1) {\n style[k] = 1;\n }\n }\n }\n }\n return style;\n}\n\nfunction gotoOverload(options, cb) {\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n return [options || {}, cb];\n}\n\nlet uuid = 0;\n\nclass Animation extends Event {\n constructor(target, list, options) {\n super();\n this.__id = uuid++;\n list = clone(list || []);\n if(Array.isArray(list)) {\n list = list.filter(item => item && isObject(item));\n }\n // 动画过程另外一种形式,object描述k-v形式\n else if(list && isObject(list)) {\n let nl = [];\n Object.keys(list).forEach(k => {\n let v = list[k];\n if(Array.isArray(v)) {\n for(let i = 0, len = v.length; i < len; i++) {\n let o = nl[i] = nl[i] || {\n offset: i / (len - 1),\n };\n o[k] = v[i];\n }\n }\n });\n list = nl;\n }\n else {\n list = [];\n }\n if(isNumber(options)) {\n this.__options = {\n duration: options,\n };\n options = this.__options;\n }\n let op = this.__options = options || {\n duration: 0,\n };\n let root = target.root;\n let config = this.__config = [\n false, // assigning\n false, // inFps\n false, // isDelay\n false, // begin\n false, // end\n false, // finished\n false, // nextBegin\n true, // firstPlay\n this.__frameCb,\n null, // playCb\n target,\n root,\n null, // frames\n null, // framesR\n 0, // currentTime\n 0, // nextTime\n {}, // style\n 0, // duration\n 1, // iterations\n 'none', // fill\n 1, // playbackRate\n 0, // playCount\n 'idle',\n false, // destroy\n 0, // startTime\n 0, // fpsTime\n op.easing,\n false, // enterFrame\n 0, // delay\n 0, // endDelay\n null, // keys,\n null, // originStyle,\n null, // currentFrames\n null, // currentFrame\n false, // spfLimit\n 60, // fps\n 'normal', // direction\n this.__calDiffTime,\n true, // firstEnter,\n false, // stayBegin\n false, // stayEnd\n false, // is2\n 0, // endTime\n target.__config, // nodeConfig\n root && root.__config, // rootConfig,destroy后root可能为空\n false, // outBeginDelay\n ];\n let iterations = this.iterations = op.iterations;\n let duration = this.duration = op.duration;\n let [frames, framesR, keys, originStyle] = this.__init(list, iterations, duration, op.easing, target);\n config[I_FRAMES] = frames;\n config[I_FRAMES_R] = framesR;\n config[I_KEYS] = keys;\n config[I_ORIGIN_STYLE] = originStyle;\n if(frames.length === 2) {\n config[I_IS2] = true;\n config[I_END_TIME] = frames[1][FRAME_TIME];\n }\n let fps = parseInt(op.fps) || 0;\n if(fps <= 0) {\n fps = 60;\n }\n this.fps = fps;\n this.spfLimit = op.spfLimit;\n this.delay = op.delay;\n this.endDelay = op.endDelay;\n this.playbackRate = op.playbackRate;\n this.fill = op.fill;\n this.iterations = op.iterations;\n this.direction = op.direction;\n config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(op.direction) ? framesR : frames;\n // 时间戳\n config[I_TIME_STAMP] = frame.__now;\n // 性能优化访问\n this[0] = this.__before;\n this[1] = this.__after;\n }\n\n __init(list, iterations, duration, easing, target) {\n if(list.length < 1) {\n return [[], [], [], {}];\n }\n // 过滤时间非法的,过滤后续offset<=前面的\n let offset = -1;\n let tagName = target.tagName;\n for(let i = 0, len = list.length; i < len; i++) {\n let current = list[i];\n if(current.hasOwnProperty('offset')) {\n current.offset = parseFloat(current.offset) || 0;\n current.offset = Math.max(0, current.offset);\n current.offset = Math.min(1, current.offset);\n // 超过区间[0,1]\n if(isNaN(current.offset) || current.offset < 0 || current.offset > 1) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n // <=前面的\n else if(current.offset <= offset) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n }\n // 缩写处理\n Object.keys(current).forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(current, k);\n }\n });\n // 检查key合法性\n Object.keys(current).forEach(k => {\n if(k !== 'easing' && k !== 'offset' && !change.isValid(tagName, k)) {\n delete current[k];\n }\n });\n }\n // 只有1帧复制出来变成2帧方便运行\n if(list.length === 1) {\n list[0] = clone(list[0]);\n if(list[0].offset === 1) {\n list.unshift({\n offset: 0,\n });\n }\n else {\n let copy = clone(list[0]);\n copy.offset = 1;\n list.push(copy);\n }\n }\n // 强制clone防止同引用\n else {\n list.forEach((item, i) => {\n list[i] = clone(item);\n });\n }\n // 首尾时间偏移强制为[0, 1],不是的话前后加空帧\n let first = list[0];\n if(first.hasOwnProperty('offset') && first.offset > 0) {\n first = {\n offset: 0,\n };\n list.unshift(first);\n }\n else {\n first.offset = 0;\n }\n let last = list[list.length - 1];\n if(last.hasOwnProperty('offset') && last.offset < 1) {\n last = {\n offset: 1,\n };\n list.push(last);\n }\n else {\n last.offset = 1;\n }\n // 计算没有设置offset的时间\n for(let i = 1, len = list.length; i < len; i++) {\n let start = list[i];\n // 从i=1开始offset一定>0,找到下一个有offset的,均分中间无声明的\n if(!start.hasOwnProperty('offset')) {\n let end;\n let j = i + 1;\n for(; j < len; j++) {\n end = list[j];\n if(end.hasOwnProperty('offset')) {\n break;\n }\n }\n let num = j - i + 1;\n start = list[i - 1];\n let per = (end.offset - start.offset) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.offset = start.offset + per * (k + 1 - i);\n }\n i = j;\n }\n }\n let frames = [];\n // 换算每一关键帧样式标准化\n list.forEach(item => {\n frames.push(framing(item, duration, easing));\n });\n // 为方便两帧之间计算变化,强制统一所有帧的css属性相同,没有写的为节点的当前样式currentStyle\n let keys = unify(frames, target);\n inherit(frames, keys, target);\n let framesR = clone(frames).reverse();\n // 存储原本样式以便恢复用\n let { style, props } = target;\n let originStyle = {};\n keys.forEach(k => {\n if(isGeom(tagName, k)) {\n originStyle[k] = props[k];\n }\n originStyle[k] = style[k];\n });\n // 再计算两帧之间的变化,存入transition属性\n let length = frames.length;\n let prev = frames[0];\n for(let i = 1; i < length; i++) {\n let next = frames[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n // 反向存储帧的倒排结果\n framesR.forEach(item => {\n item[FRAME_TIME] = duration - item[FRAME_TIME];\n item[FRAME_TRANSITION] = [];\n });\n prev = framesR[0];\n for(let i = 1; i < length; i++) {\n let next = framesR[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n return [frames, framesR, keys, originStyle];\n }\n\n __clean(isFinish) {\n let __config = this.__config;\n this.__cancelTask();\n __config[I_NEXT_TIME] = 0;\n let restore;\n let style = __config[I_STYLE];\n let keys = __config[I_KEYS];\n let target = __config[I_TARGET];\n if(isFinish) {\n __config[I_CURRENT_TIME] = __config[I_DELAY] + __config[I_DURATION] + __config[I_END_DELAY];\n if(__config[I_PLAY_STATE] === 'finish') {\n return;\n }\n __config[I_PLAY_STATE] = 'finish';\n // cancel需要清除finish根据情况保留\n if(!__config[I_STAY_END]) {\n __config[I_STYLE] = {};\n restore = true;\n }\n }\n else {\n __config[I_PLAY_COUNT] = __config[I_CURRENT_TIME] = 0;\n if(__config[I_PLAY_STATE] === 'idle') {\n return;\n }\n __config[I_PLAY_STATE] = 'idle';\n __config[I_STYLE] = {};\n restore = true;\n }\n // 动画取消结束不停留在最后一帧需要还原target原本的样式,需要对比目前是否是由本动画赋值的\n if(restore) {\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n if(target.__currentProps[k] === style[k]) {\n target.__currentProps[k] = target.props[k];\n }\n }\n else {\n if(target.__currentStyle[k] === style[k]) {\n target.__currentStyle[k] = target.style[k];\n }\n }\n });\n }\n }\n\n __frameCb(__config, diff, isDelay) {\n this.emit(Event.FRAME, diff, isDelay);\n if(__config[I_FIRST_PLAY]) {\n __config[I_FIRST_PLAY] = false;\n this.emit(Event.PLAY);\n }\n if(isFunction(__config[I_PLAY_CB])) {\n __config[I_PLAY_CB].call(this, diff, isDelay);\n __config[I_PLAY_CB] = null;\n }\n }\n\n __calDiffTime(__config, diff) {\n let playbackRate = __config[I_PLAYBACK_RATE];\n let spfLimit = __config[I_SPF_LIMIT];\n let fps = __config[I_FPS];\n let v = __config[I_CURRENT_TIME] = __config[I_NEXT_TIME];\n // 定帧限制每帧时间间隔最大为spf\n if(spfLimit) {\n if(spfLimit === true) {\n diff = Math.min(diff, 1000 / fps);\n }\n else if(spfLimit > 0) {\n diff = Math.min(diff, spfLimit);\n }\n }\n // 播放时间累加,并且考虑播放速度加成\n if(playbackRate !== 1 && playbackRate > 0) {\n diff *= playbackRate;\n }\n __config[I_NEXT_TIME] += diff;\n return [v, diff];\n }\n\n play(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n if(playState === 'running') {\n return this;\n }\n this.__cancelTask();\n __config[I_PLAY_CB] = cb;\n __config[I_PLAY_STATE] = 'running';\n // 每次play调用标识第一次运行,需响应play事件和回调\n __config[I_FIRST_PLAY] = true;\n // 防止finish/cancel事件重复触发,每次播放重置\n this.__hasFin = false;\n this.__hasCancel = false;\n // 只有第一次调用会进初始化,另外finish/cancel视为销毁也会重新初始化\n if(!__config[I_ENTER_FRAME]) {\n __config[I_ENTER_FRAME] = true;\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n // 初始化根据方向确定帧序列\n __config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction) ? framesR : frames;\n __config[I_CURRENT_TIME] = __config[I_NEXT_TIME] = __config[I_FPS_TIME] = 0;\n }\n // 添加每帧回调且立刻执行,本次执行调用refreshTask也是下一帧再渲染,frame的每帧都是下一帧\n frame.offFrame(this);\n frame.onFrame(this);\n __config[I_START_TIME] = frame.__now;\n __config[I_END] = false;\n return this;\n }\n\n __before(diff) {\n let __config = this.__config;\n __config[I_TIME_STAMP] = frame.__now;\n let target = __config[I_TARGET];\n let fps = __config[I_FPS];\n let playCount = __config[I_PLAY_COUNT];\n let currentFrames = __config[I_CURRENT_FRAMES];\n let iterations = __config[I_ITERATIONS];\n let stayBegin = __config[I_STAY_BEGIN];\n let stayEnd = __config[I_STAY_END];\n let delay = __config[I_DELAY];\n let root = __config[I_ROOT];\n let is2 = __config[I_IS2];\n let endTime = __config[I_END_TIME];\n let duration = __config[I_DURATION];\n let endDelay = __config[I_END_DELAY];\n let length = currentFrames.length;\n // 用本帧和上帧时间差,计算累加运行时间currentTime,以便定位当前应该处于哪个时刻\n let [currentTime, d] = __config[I_CAL_DIFF_TIME](__config, diff);\n diff = d;\n // 增加的fps功能,当<60时计算跳帧,每帧运行依旧累加时间,达到fps时重置,第一帧强制不跳\n if(!__config[I_FIRST_ENTER] && fps < 60) {\n diff = __config[I_FPS_TIME] += diff;\n if(diff < 1000 / fps) {\n __config[I_IN_FPS] = true;\n return;\n }\n __config[I_FPS_TIME] = 0;\n }\n __config[I_FIRST_ENTER] = false;\n // delay仅第一次生效\n if(playCount === 0 && currentTime < delay) {\n if(stayBegin) {\n let currentFrame = __config[I_CURRENT_FRAME] = currentFrames[0];\n let current = currentFrame[FRAME_STYLE];\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n }\n // 即便不刷新,依旧执行帧回调,同时标明让后续第一帧响应begin\n __config[I_OUT_BEGIN_DELAY] = true;\n __config[I_IS_DELAY] = true;\n return;\n }\n // 减去delay,计算在哪一帧,仅首轮\n if(playCount === 0) {\n currentTime -= delay;\n }\n if(currentTime === 0 || __config[I_OUT_BEGIN_DELAY]) {\n __config[I_OUT_BEGIN_DELAY] = false;\n __config[I_BEGIN] = true;\n }\n // 超过duration非尾轮需处理回到开头,触发新一轮动画事件,这里可能时间间隔非常大直接跳过几轮\n let round;\n while(currentTime >= duration && playCount < iterations - 1) {\n currentTime -= duration;\n __config[I_NEXT_TIME] -= duration;\n playCount = ++__config[I_PLAY_COUNT];\n __config[I_BEGIN] = true;\n round = true;\n }\n // 如果发生轮换,需重新确定正反向\n if(round) {\n let direction = __config[I_DIRECTION];\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let isAlternate = {\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction);\n // 有正反向播放需要重设帧序列\n if(isAlternate) {\n let isEven = playCount % 2 === 0;\n if(direction === 'alternate') {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n }\n let isLastCount = playCount >= iterations - 1;\n // 只有2帧可优化,否则2分查找当前帧\n let i, frameTime;\n if(is2) {\n i = currentTime < endTime ? 0 : 1;\n frameTime = endTime;\n }\n else {\n i = binarySearch(0, length - 1, currentTime, currentFrames);\n frameTime = currentFrames[i][FRAME_TIME];\n }\n // 最后一帧结束动画,仅最后一轮才会进入,需处理endDelay\n let isLastFrame = isLastCount && i === length - 1;\n let percent = 0;\n if(isLastFrame) {\n // 无需任何处理\n }\n // 否则根据目前到下一帧的时间差,计算百分比,再反馈到变化数值上\n else if(is2) {\n percent = currentTime / duration;\n }\n else {\n let total = currentFrames[i + 1][FRAME_TIME] - frameTime;\n percent = (currentTime - frameTime) / total;\n }\n let inEndDelay, currentFrame = currentFrames[i], current;\n __config[I_CURRENT_FRAME] = currentFrame;\n /** 这里要考虑全几种场景:\n * 1. 单次播放无endDelay且fill不停留(有/无差异,下同)\n * 2. 单次播放无endDelay且fill停留\n * 3. 单次播放有endDelay且fill不停留\n * 4. 单次播放有endDelay且fill停留\n * 5. 多次播放无endDelay且fill不停留(尾次/非尾次,下同)\n * 6. 多次播放无endDelay且fill停留\n * 7. 多次播放有endDelay且fill不停留\n * 8. 多次播放有endDelay且fill停留\n */\n let needClean;\n if(isLastFrame) {\n inEndDelay = currentTime < duration + endDelay;\n // 停留对比最后一帧,endDelay可能会多次进入这里,第二次进入样式相等不再重绘\n if(stayEnd) {\n current = cloneStyle(currentFrame[FRAME_STYLE], __config[I_KEYS]);\n }\n // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里\n else {\n current = cloneStyle(__config[I_ORIGIN_STYLE], __config[I_KEYS]);\n }\n // 进入endDelay或结束阶段触发end事件,注意只触发一次,防重在触发的地方做\n __config[I_NEXT_END] = true;\n if(!inEndDelay) {\n __config[I_PLAY_COUNT]++;\n __config[I_FINISHED] = true;\n frame.offFrame(this);\n needClean = true;\n __config[I_NEXT_TIME] = 0;\n }\n }\n else {\n current = calIntermediateStyle(currentFrame, __config[I_KEYS], percent, target);\n }\n // 无论两帧之间是否有变化,都生成计算结果赋给style,去重在root做\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n if(needClean) {\n 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 __config[I_FRAME_CB].call(this, __config, diff, __config[I_IS_DELAY]);\n __config[I_IS_DELAY] = false;\n if(__config[I_BEGIN]) {\n __config[I_BEGIN] = false;\n this.emit(Event.BEGIN, __config[I_PLAY_COUNT]);\n }\n // end事件只触发一次,末轮进入endDelay或直接结束时\n if(__config[I_NEXT_END] && !__config[I_END]) {\n __config[I_END] = true;\n this.emit(Event.END, __config[I_PLAY_COUNT] - 1);\n }\n if(__config[I_FINISHED]) {\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n __config[I_PLAY_STATE] = 'finished';\n this.emit(Event.FINISH);\n }\n }\n\n pause(silence) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let { pending } = this;\n if(isDestroyed || duration <= 0 || pending) {\n return this;\n }\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(!silence) {\n this.emit(Event.PAUSE);\n }\n return this;\n }\n\n resume(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n if(isDestroyed || duration <= 0 || playState !== 'paused') {\n return this;\n }\n return this.play(cb);\n }\n\n finish(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1 || playState === 'finished' || playState === 'idle') {\n return self;\n }\n // 先清除所有回调任务,多次调用finish也会清除只留最后一次\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n let current;\n // 停留在最后一帧\n if(__config[I_STAY_END]) {\n __config[I_CURRENT_FRAME] = frames[frames.length - 1];\n current = frames[frames.length - 1][FRAME_STYLE];\n }\n else {\n current = originStyle;\n }\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(current, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean(true);\n },\n __after(diff) {\n if(!self.__hasFin) {\n self.__hasFin = true;\n __config[I_ASSIGNING] = false;\n __config[I_FRAME_CB].call(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.FINISH);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n cancel(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || playState === 'idle' || frames.length < 1) {\n return self;\n }\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(originStyle, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean();\n },\n __after(diff) {\n if(!self.__hasCancel) {\n self.__hasCancel = true;\n __config[I_ASSIGNING] = false;\n __config[I_FRAME_CB].call(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.CANCEL);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n gotoAndPlay(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n // 计算出时间点直接累加播放\n this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n return this.play(cb);\n }\n\n gotoAndStop(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n v = this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n // 先play一帧,回调里模拟暂停\n return this.play(diff => {\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isFunction(cb)) {\n cb.call(this, diff);\n }\n });\n }\n\n // 同步赋予,用在extendAnimate\n assignCurrentStyle() {\n let __config = this.__config;\n let style = __config[I_STYLE];\n let target = __config[I_TARGET];\n let keys = __config[I_KEYS];\n keys.forEach(i => {\n if(style.hasOwnProperty(i)) {\n let v = style[i];\n // geom的属性变化\n if(GEOM.hasOwnProperty(i)) {\n target.currentProps[i] = v;\n }\n // 样式\n else {\n // 将动画样式直接赋给currentStyle\n target.currentStyle[i] = v;\n }\n }\n });\n }\n\n __goto(v, isFrame, excludeDelay) {\n let __config = this.__config;\n let duration = __config[I_DURATION];\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isNaN(v) || v < 0) {\n throw new Error('Param of gotoAnd(Play/Stop) is illegal: ' + v);\n }\n if(isFrame) {\n v = (v - 1) / this.spf;\n }\n if(excludeDelay) {\n v += __config[I_DELAY];\n }\n // 超过一轮去掉delay\n if(v > duration + __config[I_DELAY]) {\n v -= __config[I_DELAY];\n }\n // 超过时间长度需要累加次数\n __config[I_PLAY_COUNT] = 0;\n while(v > duration && __config[I_PLAY_COUNT] < __config[I_ITERATIONS] - 1) {\n __config[I_PLAY_COUNT]++;\n v -= duration;\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n __config[I_NEXT_TIME] = v;\n // 防止play()重置时间和当前帧组,提前计算好\n __config[I_ENTER_FRAME] = true;\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n if({\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction)) {\n let isEven = __config[I_PLAY_COUNT] % 2 === 0;\n if(direction === 'alternate') {\n __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n return v;\n }\n\n addControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.add(this);\n }\n }\n\n removeControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.remove(this);\n }\n }\n\n __stayBegin() {\n return {\n backwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __stayEnd() {\n return {\n forwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __setTarget(target) {\n this.__target = target;\n this.__config[I_TARGET] = target;\n this.__config[I_NODE_CONFIG] = target.__config;\n }\n\n __cancelTask() {\n frame.offFrame(this);\n this.__config[I_PLAY_CB] = null;\n }\n\n __destroy(sync) {\n let self = this;\n let __config = self.__config;\n if(__config[I_DESTROYED]) {\n return;\n }\n self.removeControl();\n // clean异步执行,因为里面的样式还原需要等到下一帧,否则同步执行清除后,紧接着的新同步动画获取不到currentStyle\n if(sync) {\n self.__clean();\n __config[I_TARGET] = null;\n }\n else {\n frame.nextFrame({\n __before() {\n self.__clean();\n __config[I_TARGET] = null;\n },\n });\n }\n __config[I_START_TIME] = 0;\n __config[I_DESTROYED] = true;\n }\n\n __checkModify() {\n let __config = this.__config;\n if(__config[I_PLAY_STATE] !== 'idle' && __config[I_PLAY_STATE] !== 'finished') {\n inject.warn('Modification will not come into effect when animation is running');\n }\n }\n\n get id() {\n return this.__id;\n }\n\n get target() {\n return this.__config[I_TARGET];\n }\n\n get root() {\n return this.__config[I_ROOT];\n }\n\n get keys() {\n return this.__config[I_KEYS];\n }\n\n get style() {\n return this.__config[I_STYLE];\n }\n\n get options() {\n return this.__options;\n }\n\n get duration() {\n return this.__config[I_DURATION];\n }\n\n set duration(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DURATION] !== v) {\n __config[I_DURATION] = v;\n __config[I_END_TIME] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get delay() {\n return this.__config[I_DELAY];\n }\n\n set delay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DELAY] !== v) {\n __config[I_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get endDelay() {\n return this.__config[I_END_DELAY];\n }\n\n set endDelay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_END_DELAY] !== v) {\n __config[I_END_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get fps() {\n return this.__config[I_FPS];\n }\n\n set fps(v) {\n v = parseInt(v) || 60;\n let __config = this.__config;\n if(__config[I_FPS] !== v) {\n if(v <= 0) {\n v = 60;\n }\n __config[I_FPS] = v;\n }\n return v;\n }\n\n get spf() {\n return 1 / this.fps;\n }\n\n get iterations() {\n return this.__config[I_ITERATIONS];\n }\n\n set iterations(v) {\n if(v === Infinity || util.isString(v) && v.toLowerCase() === 'infinity') {\n v = Infinity;\n }\n else {\n v = parseInt(v);\n if(isNaN(v) || v < 0) {\n v = 1;\n }\n }\n let __config = this.__config;\n if(__config[I_ITERATIONS] !== v) {\n __config[I_ITERATIONS] = v;\n }\n return v;\n }\n\n get fill() {\n return this.__config[I_FILL];\n }\n\n set fill(v) {\n v = v || 'none';\n let __config = this.__config;\n if(__config[I_FILL] !== v) {\n __config[I_FILL] = v;\n this.__checkModify();\n }\n __config[I_STAY_BEGIN] = {\n backwards: true,\n both: true,\n }.hasOwnProperty(v);\n __config[I_STAY_END] = {\n forwards: true,\n both: true,\n }.hasOwnProperty(v);\n return v;\n }\n\n get direction() {\n return this.__config[I_DIRECTION];\n }\n\n set direction(v) {\n v = v || 'normal';\n let __config = this.__config;\n if(__config[I_DIRECTION] !== v) {\n __config[I_DIRECTION] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get frames() {\n return this.__config[I_FRAMES];\n }\n\n get framesR() {\n return this.__config[I_FRAMES_R];\n }\n\n get playbackRate() {\n return this.__config[I_PLAYBACK_RATE];\n }\n\n set playbackRate(v) {\n v = parseFloat(v) || 1;\n if(v <= 0) {\n v = 1;\n }\n let __config = this.__config;\n if(__config[I_PLAYBACK_RATE] !== v) {\n __config[I_PLAYBACK_RATE] = v;\n }\n return v;\n }\n\n get easing() {\n return this.__config[I_EASING];\n }\n\n get startTime() {\n return this.__config[I_START_TIME];\n }\n\n get currentTime() {\n return this.__config[I_CURRENT_TIME];\n }\n\n set currentTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_CURRENT_TIME] !== v) {\n __config[I_CURRENT_TIME] = v;\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get nextTime() {\n return this.__config[I_NEXT_TIME];\n }\n\n set nextTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_NEXT_TIME] !== v) {\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get timestamp() {\n return this.__config[I_TIME_STAMP];\n }\n\n get pending() {\n return this.__config[I_PLAY_STATE] !== 'running';\n }\n\n get finished() {\n return this.__config[I_PLAY_STATE] === 'finished';\n }\n\n get playState() {\n return this.__config[I_PLAY_STATE];\n }\n\n get playCount() {\n return this.__config[I_PLAY_COUNT];\n }\n\n set playCount(v) {\n v = Math.max(0, parseInt(v) || 0);\n let __config = this.__config;\n if(__config[I_PLAY_COUNT] !== v) {\n __config[I_PLAY_COUNT] = v;\n }\n return v;\n }\n\n get isDestroyed() {\n return this.__config[I_DESTROYED];\n }\n\n get animating() {\n let __config = this.__config;\n let playState = __config[I_PLAY_STATE];\n if(playState === 'idle') {\n return false;\n }\n return playState !== 'finished' || __config[I_STAY_END] || __config[I_STAY_BEGIN];\n }\n\n get spfLimit() {\n let __config = this.__config;\n return __config[I_SPF_LIMIT];\n }\n\n set spfLimit(v) {\n if(util.isNumber(v) || /^\\d/.test(v)) {\n v = Math.max(0, parseInt(v) || 0);\n }\n else {\n v = !!v;\n }\n let __config = this.__config;\n if(__config[I_SPF_LIMIT] !== v) {\n __config[I_SPF_LIMIT] = v;\n }\n return v;\n }\n\n get assigning() {\n return this.__config[I_ASSIGNING];\n }\n}\n\nexport default Animation;\n","import mode from '../node/mode';\nimport geom from '../math/geom';\nimport blur from '../math/blur';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\n\nconst {\n NODE_KEY: {\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { int2rgba } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nfunction renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h, 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 } = 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, isDirectItem) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w, !isDirectItem)\n + this.__calMp(marginRight, w, !isDirectItem)\n + this.__calMp(paddingLeft, w, !isDirectItem)\n + this.__calMp(paddingRight, w, !isDirectItem);\n if(borderLeftWidth[1] === PX) {\n mp += borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n mp += borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n mp += borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n mp += borderLeftWidth[0] * this.root.height * 0.01;\n }\n 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 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;\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 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.tagName === 'img') && marginLeft[1] === AUTO && marginRight[1] === AUTO) {\n let ow = this.outerWidth;\n if(ow < data.w) {\n this.__offsetX((data.w - ow) * 0.5, true);\n }\n }\n }\n\n __calMatrix(lv, __cacheStyle, currentStyle, computedStyle, __config, sx1, sy1, offsetWidth, offsetHeight) {\n if(__config[NODE_IS_INLINE]) {\n computedStyle[TRANSFORM_ORIGIN] = [sx1, sy1];\n return __cacheStyle[MATRIX] = mx.identity();\n }\n let matrixCache = __cacheStyle[MATRIX];\n // tx/ty变化特殊优化\n if(matrixCache && lv < REFLOW && !contain(lv, TF)) {\n let x = 0, y = 0, z = 0;\n if(contain(lv, TX)) {\n let v = currentStyle[TRANSLATE_X];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else 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 * @param lv\n * @param ctx canvas/svg/webgl共用\n * @param cache 是否是局部根节点缓存模式下的绘制\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 this.__bbox = null;\n if(isDestroyed) {\n return { isDestroyed, break: true };\n }\n let virtualDom;\n // svg设置vd上的lv属性标明lineHeight的话,另外特殊字体如arial拥有lineGap也会产生间隙,背景色不绘制这个间隙\n * x轴根据contentBox的范围坐标,y则固定和font/lineHeight相关\n * 圆角发生在首尾lineBox处,中间不会有,bgi则产生类似bgc作为mask的效果\n * 另外要注意多个时的顺序,必须依次渲染,后面的bb可能会覆盖前面行的\n */\n if(isRealInline) {\n let contentBoxList = this.contentBoxList;\n let length = contentBoxList.length;\n let hasBgi = backgroundImage.some(item => item);\n if(length) {\n let {\n [FONT_SIZE]: fontSize,\n [FONT_FAMILY]: fontFamily,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let iw = 0, ih = 0;\n let offscreen, svgBgSymbol = [];\n // bgi视作inline排满一行绘制,然后按分行拆开给每行\n if(hasBgi) {\n iw = inline.getInlineWidth(this, contentBoxList);\n ih = lineHeight;\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n iw += paddingLeft + paddingRight;\n ih += paddingTop + paddingBottom;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n iw += paddingLeft + paddingRight + borderLeftWidth + borderRightWidth;\n ih += paddingTop + paddingBottom + borderTopWidth + borderBottomWidth;\n }\n if(renderMode === CANVAS || renderMode === WEBGL) {\n offscreen = inject.getCacheCanvas(iw, ih, '__$$INLINE_BGI$$__');\n }\n let length = backgroundImage.length;\n backgroundImage.slice(0).reverse().forEach((bgi, i) => {\n if(!bgi) {\n return;\n }\n i = length - 1 - i;\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i];\n if(loadBgi.url === backgroundImage[i]) {\n let uuid = bg.renderImage(this, renderMode, offscreen && offscreen.ctx || ctx, loadBgi,\n 0, 0, iw, ih, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, true, 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.delRefreshTask(this.__loadBgi.cb);\n root.delRefreshTask(this.__task);\n this.__task = null;\n this.__root = null;\n this.clearCache();\n }\n\n // 先查找到注册了事件的节点,再捕获冒泡判断增加性能\n __emitEvent(e, force) {\n let { isDestroyed, computedStyle, isMask } = this;\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || e.__stopPropagation || isMask) {\n return;\n }\n let { event: { type } } = e;\n let { listener, __hasMask } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // touchmove之类强制的直接由Root通知即可\n if(force) {\n if(computedStyle[POINTER_EVENTS] !== 'none' && util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n // 非force的判断事件坐标是否在节点内\n if(this.willResponseEvent(e)) {\n // 如果有mask,点在mask上才行,点在clip外才行\n if(__hasMask) {\n let next = this.next;\n let isClip = next.isClip;\n let hasEmitMask;\n while(next && next.isMask) {\n if(next.willResponseEvent(e, true)) {\n hasEmitMask = true;\n break;\n }\n next = next.next;\n }\n if(!isClip && !hasEmitMask) {\n return;\n }\n }\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n\n willResponseEvent(e, ignore) {\n let { x, y } = e;\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent, computedStyle } = this;\n if(computedStyle[POINTER_EVENTS] === 'none') {\n return;\n }\n let inThis = geom.pointInQuadrilateral(\n x, y,\n __sx1, __sy1,\n __sx1 + offsetWidth, __sy1,\n __sx1 + offsetWidth, __sy1 + offsetHeight,\n __sx1, __sy1 + offsetHeight,\n matrixEvent\n );\n if(inThis) {\n if(!e.target && !ignore) {\n e.target = this;\n // 缓存target给move用\n if(e.event.type === 'touchstart') {\n this.root && (this.root.__touchstartTarget = this);\n }\n }\n return true;\n }\n }\n\n __gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi, 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(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, formatStyle);\n if(util.isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n // 传入格式化好key/value的样式\n updateFormatStyle(style, cb) {\n let node = this;\n let { root, __config } = node;\n if(root) {\n root.addRefreshTask(node.__task = {\n __before() {\n node.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(__config[NODE_IS_DESTROYED]) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n res[UPDATE_CONFIG] = __config;\n root.__addUpdate(node, __config, root, root.__config, res);\n },\n __after(diff) {\n if(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, style);\n if(util.isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n animate(list, options = {}) {\n let animation = new Animation(this, list, options);\n if(this.isDestroyed) {\n animation.__destroy(true);\n return animation;\n }\n this.animationList.push(animation);\n if(options.autoPlay === false) {\n return animation;\n }\n return animation.play();\n }\n\n removeAnimate(o) {\n if(o instanceof Animation) {\n let i = this.animationList.indexOf(o);\n if(i > -1) {\n o.cancel();\n o.__destroy();\n this.animationList.splice(i, 1);\n }\n }\n }\n\n clearAnimate() {\n this.animationList.splice(0).forEach(o => {\n o.cancel();\n o.__destroy();\n });\n }\n\n frameAnimate(cb) {\n if(util.isFunction(cb)) {\n let list = this.__frameAnimateList;\n // 防止重复\n for(let i = 0, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n return cb;\n }\n }\n let enter = {\n __after(diff) {\n cb(diff);\n },\n __karasFramecb: cb,\n };\n list.push(enter);\n frame.onFrame(enter);\n return cb;\n }\n }\n\n removeFrameAnimate(cb) {\n for(let i = 0, list = this.__frameAnimateList, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n list.splice(i, 1);\n frame.offFrame(cb);\n return;\n }\n }\n }\n\n clearFrameAnimate() {\n this.__frameAnimateList.splice(0).forEach(o => {\n frame.offFrame(o);\n });\n }\n\n __computeMeasure(renderMode, ctx, cb) {\n css.computeMeasure(this);\n if(util.isFunction(cb)) {\n cb(this);\n }\n }\n\n __deepScan(cb, options) {\n return cb(this, options);\n }\n\n // isLayout为false时,为relative/margin/flex/vertical等\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.__layoutData.x += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sx1 += diff;\n this.__sx2 += diff;\n this.__sx3 += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.__layoutData.y += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sy1 += diff;\n this.__sy2 += diff;\n this.__sy3 += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n }\n\n __resizeX(diff, lv) {\n this.computedStyle.width = this.__width += diff;\n this.__clientWidth += diff;\n this.__offsetWidth += diff;\n this.__outerWidth += diff;\n this.__layoutData.w += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __resizeY(diff, lv) {\n this.computedStyle.height = this.__height += diff;\n this.__clientHeight += diff;\n this.__offsetHeight += diff;\n this.__outerHeight += diff;\n this.__layoutData.h += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __spreadBbox(boxShadow) {\n let ox = 0, oy = 0;\n if(Array.isArray(boxShadow)) {\n boxShadow.forEach(item => {\n let [x, y, sigma, spread, , inset] = item;\n if(inset !== 'inset') {\n let d = blur.outerSize(sigma);\n d += spread;\n ox = Math.max(ox, x + d);\n oy = Math.max(oy, y + d);\n }\n });\n }\n return [ox, oy];\n }\n\n __releaseWhenEmpty(__cache) {\n if(__cache && __cache.available) {\n __cache.release();\n }\n return true;\n }\n\n getComputedStyle(key) {\n let computedStyle = this.computedStyle;\n let res = {};\n let keys;\n if(key) {\n if(Array.isArray(key)) {\n keys = key;\n }\n else {\n keys = [key];\n }\n keys = keys.map(s => {\n return STYLE_KEY[style2Upper(s)];\n });\n }\n else {\n keys = Object.keys(computedStyle);\n }\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n res[k] = computedStyle[k];\n }\n else {\n res[STYLE_RV_KEY[k]] = computedStyle[k];\n }\n });\n return res;\n }\n\n getBoundingClientRect() {\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent } = this;\n let p1 = point2d(mx.calPoint([__sx1, __sy1], matrixEvent));\n let p2 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1], matrixEvent));\n let p3 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1 + offsetHeight], matrixEvent));\n let p4 = point2d(mx.calPoint([__sx1, __sy1 + offsetHeight], matrixEvent));\n return {\n left: Math.min(p1[0], Math.min(p2[0], Math.min(p3[0], p4[0]))),\n top: Math.min(p1[1], Math.min(p2[1], Math.min(p3[1], p4[1]))),\n right: Math.max(p1[0], Math.max(p2[0], Math.max(p3[0], p4[0]))),\n bottom: Math.max(p1[1], Math.max(p2[1], Math.max(p3[1], p4[1]))),\n points: [p1, p2, p3, p4],\n };\n }\n\n // img和geom返回false,在inline布局时判断是否是真的inline\n __isRealInline() {\n return true;\n }\n\n remove(cb) {\n let self = this;\n if(self.isDestroyed) {\n inject.warn('Remove target is destroyed.');\n if(util.isFunction(cb)) {\n cb();\n }\n return;\n }\n let { root, domParent } = self;\n let target = self.isShadowRoot ? self.hostRoot : self;\n // 特殊情况连续append/remove时候,还未被添加进来找不到所以无需删除\n if(domParent.children.indexOf(target) === -1) {\n if(util.isFunction(cb)) {\n cb();\n }\n return;\n }\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n let pJson = domParent.__json;\n let i = pJson.children.indexOf(self.isShadowRoot ? self.hostRoot.__json : self.__json);\n let zChildren = domParent.zIndexChildren;\n let j = zChildren.indexOf(self.isShadowRoot ? self.hostRoot : self);\n if(i === -1 || j === -1) {\n throw new Error('Remove index Exception.')\n }\n pJson.children.splice(i, 1);\n domParent.children.splice(i, 1);\n zChildren.splice(j, 1);\n if(self.__prev) {\n self.__prev.__next = self.__next;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_REMOVE_DOM] = true;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after(diff) {\n self.isShadowRoot ? self.hostRoot.__destroy() : self.__destroy();\n if(util.isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get sx() {\n return this.__sx;\n }\n\n get sy() {\n return this.__sy;\n }\n\n get clientWidth() {\n return this.__clientWidth || 0;\n }\n\n get clientHeight() {\n return this.__clientHeight || 0;\n }\n\n get offsetWidth() {\n return this.__offsetWidth || 0;\n }\n\n get offsetHeight() {\n return this.__offsetHeight || 0;\n }\n\n get outerWidth() {\n return this.__outerWidth || 0;\n }\n\n get outerHeight() {\n return this.__outerHeight || 0;\n }\n\n // 不考虑margin的范围,>=REPAINT渲染或个别有影响的渲染改变(如blur)清空缓存\n get bbox() {\n if(!this.__bbox) {\n let {\n __sx1, __sy1, clientWidth, clientHeight,\n currentStyle: {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BOX_SHADOW]: boxShadow,\n },\n } = this;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n clientWidth += borderLeftWidth[0] + borderRightWidth[0];\n clientHeight += borderTopWidth[0] + borderBottomWidth[0];\n let half = 1;\n this.__bbox = [__sx1 - ox - half, __sy1 - oy - half, __sx1 + clientWidth + ox + half, __sy1 + clientHeight + oy + half];\n }\n return this.__bbox;\n }\n\n get listener() {\n return this.__listener;\n }\n\n get matrix() {\n return this.__config[NODE_MATRIX];\n }\n\n get matrixEvent() {\n return this.__config[NODE_MATRIX_EVENT];\n }\n\n get perspectiveMatrix() {\n return this.__config[NODE_PERSPECTIVE_MATRIX];\n }\n\n get style() {\n return this.__style;\n }\n\n get computedStyle() {\n return this.__computedStyle;\n }\n\n get animationList() {\n return this.__animationList;\n }\n\n get currentStyle() {\n return this.__currentStyle;\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get contentBoxList() {\n return this.__contentBoxList;\n }\n\n get baseLine() {\n return this.offsetHeight;\n }\n\n get firstBaseLine() {\n return this.offsetHeight;\n }\n\n get isMask() {\n return this.__isMask;\n }\n\n get isClip() {\n return this.__isClip;\n }\n\n 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 n = this.baseLine;\n // 只有1个也需要对齐,因为可能内嵌了空inline使得baseLine发生变化\n if(this.list.length) {\n this.list.forEach(item => {\n let m = item.baseLine;\n if(m !== n) {\n item.__offsetY(n - m);\n }\n });\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n /**\n * 防止非行首空inline,每当遇到inline就设置当前lineBox的lineHeight/baseLine,这样有最小值兜底\n * @param l\n * @param b\n * @private\n */\n __setLB(l, b) {\n this.__lineHeight = Math.max(l, this.__lineHeight);\n this.__baseLine = Math.max(b, this.__baseLine);\n }\n\n get list() {\n return this.__list;\n }\n\n get size() {\n return this.__list.length;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endY() {\n return this.y + this.height;\n }\n\n get width() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let first = list[0];\n let last = list[length - 1];\n let x1 = first.x;\n let dom = first instanceof TextBox ? first.parent.domParent : first.domParent;\n // 因为inline可以嵌套inline,所以一直向上查找到非inline为止,每层inline如果是首个则减去左侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [PADDING_LEFT]: paddingLeft,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[0]) {\n x1 -= marginLeft + borderLeftWidth + paddingLeft;\n }\n dom = dom.domParent;\n }\n let x2 = last.x + last.outerWidth;\n dom = last instanceof TextBox ? last.parent.domParent : last.domParent;\n // 同向上查非inline,每层inline如果是最后一个则加上右侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_RIGHT]: paddingRight,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[list.length - 1]) {\n x2 += marginRight + borderRightWidth + paddingRight;\n }\n dom = dom.domParent;\n }\n return x2 - x1;\n }\n return 0;\n }\n\n get height() {\n return this.lineHeight;\n }\n\n get baseLine() {\n let baseLine = 0;\n this.list.forEach(item => {\n baseLine = Math.max(baseLine, item.baseLine);\n });\n return Math.max(this.__baseLine, baseLine);\n }\n\n get lineHeight() {\n let lineHeight = 0;\n // 只有TextBox和InlineBlock\n this.list.forEach(item => {\n lineHeight = Math.max(lineHeight, item.outerHeight);\n });\n return Math.max(this.__lineHeight, lineHeight);\n }\n}\n\nexport default LineBox;\n","import LineBox from './LineBox';\n\n/**\n * 维护一个上下文的LineBox,向LineBox中添加Item以及新增下一行的LineBox,多个LineBox组成一个区域\n * 一个block/inlineBlock拥有一个本类对象,上下文即对应这个dom流,而inline则复用最近非inline父元素的\n * 同时LineBox可能连续也可能不连续,不连续的是中间有block之类的隔离开来\n */\nclass LineBoxManager {\n constructor(x, y, lineHeight, baseLine) {\n this.__x = this.__lastX = x; // last存储目前最后一行LineBox的结尾位置,供后续inline使用\n this.__y = this.__lastY = y;\n this.__maxX = x;\n this.__domList = [];\n this.__domStack = [];\n this.__list = []; // 包含若干LineBox\n this.__isNewLine = true; // 区域内是否是新行,容器dom(block)开头肯定是\n this.__lineHeight = lineHeight;\n this.__baseLine = baseLine;\n this.__isEnd = true; // 在dom中是否一个区域处在结尾,外部控制\n }\n\n /**\n * 每次换行时重新生成LineBox存入列表,同时由于flow流当前一定是流(dom)的结尾,设置isEnd\n * @returns {LineBox}\n */\n genLineBox(x, y) {\n let lineBox = new LineBox(x, y, this.__lineHeight, this.__baseLine);\n this.list.push(lineBox);\n this.__isEnd = true;\n return lineBox;\n }\n\n /**\n * inline的特殊调用,防止空内容但有mbp的inline不占位,放入一个有lineHeight的空lineBox\n * 只有新行开头时需要,后面的无论是否有内容都会影响lineHeight\n * @param x\n * @param y\n * @param l\n * @param b\n * @returns {LineBox}\n */\n genLineBoxByInlineIfNewLine(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseLine = Math.max(this.__baseLine, b);\n if(this.__isNewLine) {\n let lineBox = new LineBox(x, y, lineHeight, baseLine);\n this.list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n }\n\n setLbOrGenLineBoxByInline(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseLine = Math.max(this.__baseLine, b);\n let lineBox;\n let list = this.list;\n if(this.__isNewLine) {\n lineBox = new LineBox(x, y, lineHeight, baseLine);\n list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n else {\n let length = list.length;\n lineBox = list[length - 1];\n lineBox.__setLB(l, b);\n }\n }\n\n /**\n * 外部设置为结尾,如一个LineBox后出现一个block,此时会被隔断,不再作为流的末尾\n */\n setNotEnd() {\n this.__isEnd = false;\n }\n\n /**\n * 外部设置新行,下次新生成LineBox\n */\n setNewLine() {\n this.__isNewLine = true;\n }\n\n /**\n * 当前LineBox放入一个新项,当新行时(如第一行)产生一个新的LineBox并存入列表\n * 是否新区域和新行都是可以被外部控制,默认第一行是新\n * 当被隔断后会被外部重置新行,这样会生成新的来作为新加项的LineBox\n * 当换行时外部也会调用新行,这样再次添加Item时会自动生成新的LineBox而不是用之前的\n * @param o TextBox/Inline/InlineBlock\n * @param nextNewLine 是否设置newLine,标明下次添加新生成LineBox\n * @returns {LineBox}\n */\n addItem(o, nextNewLine) {\n let lineBox;\n if(this.__isNewLine) {\n this.__isNewLine = false;\n lineBox = this.genLineBox(o.x, o.y);\n }\n else {\n let list = this.list;\n let length = list.length;\n lineBox = list[length - 1];\n }\n // inline递归过程中所有inline父子顺序列表,每个dom都需要对当前内容保存\n this.__domStack.forEach(item => {\n item.__contentBoxList.push(o);\n });\n lineBox.add(o);\n // 设置结束x的位置给next的inline标记用,o可能是TextBox或inlineBlock,当next新行时注意位置\n if(nextNewLine) {\n this.__isNewLine = true;\n this.__lastX = o.x;\n this.__lastY = o.y + o.outerHeight;\n }\n else {\n this.__lastX = o.x + o.outerWidth;\n this.__lastY = o.y;\n }\n this.__maxX = Math.max(this.__maxX, o.x + o.outerWidth);\n return lineBox;\n }\n\n horizonAlign(w, textAlign) {\n this.list.forEach(lineBox => {\n let diff = w - lineBox.width;\n if(diff > 0) {\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n lineBox.__offsetX(diff);\n lineBox.list.forEach(item => {\n item.__offsetX(diff, true);\n });\n }\n });\n }\n\n verticalAlign() {\n this.list.forEach(lineBox => {\n lineBox.verticalAlign();\n });\n }\n\n addX(n) {\n this.__lastX += n;\n }\n\n /**\n * inline递归过程中布局调用,不断出入栈dom对象,获取当前行状态下有哪些dom还在\n * @param dom\n */\n pushContentBoxList(dom) {\n this.__domList.push(dom);\n this.__domStack.push(dom);\n }\n\n popContentBoxList() {\n this.__domStack.pop();\n }\n\n __offsetX(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetX(diff);\n });\n }\n\n __offsetY(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetY(diff);\n });\n }\n\n /**\n * inline的特殊调用,非行首无论是否有内容都设置lineBox的lineHeight\n * @param l\n * @param b\n * @private\n */\n setLbByInlineIfNotNewLine(l, b) {\n let length = this.list.length;\n if(length && !this.isNewLine) {\n this.list[length - 1].__setLB(l, b);\n }\n }\n\n get size() {\n return this.list.length;\n }\n\n get lastX() {\n return this.__lastX;\n }\n\n get lastY() {\n return this.__lastY;\n }\n\n get endY() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[length - 1].endY;\n }\n return this.__y;\n }\n\n get isEnd() {\n return this.__isEnd;\n }\n\n get isNewLine() {\n return this.__isNewLine;\n }\n\n get breakLine() {\n return this.list.length > 1;\n }\n\n get domList() {\n return this.__domList;\n }\n\n get baseLine() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let n = 0;\n for(let i = 0; i < length - 1; i++) {\n n += list[i].height;\n }\n return n + list[length - 1].baseLine;\n }\n return 0;\n }\n\n get firstBaseLine() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[0].baseLine;\n }\n return 0;\n }\n\n get lineHeight() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1].lineHeight;\n }\n return 0;\n }\n\n get lineBox() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1];\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get width() {\n let w = 0;\n this.list.forEach(item => {\n w = Math.max(w, item.width);\n });\n return w;\n }\n}\n\nexport default LineBoxManager;\n","const TAG_NAME = {\n 'div': true,\n 'p': true,\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst INLINE = {\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst BOLD = {\n 'b': true,\n 'strong': true,\n}\n\nexport default {\n TAG_NAME,\n INLINE,\n BOLD,\n};\n","import enums from '../util/enums';\nimport unit from '../style/unit';\nimport level from './level';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n TOP,\n BOTTOM,\n POSITION,\n HEIGHT,\n },\n} = enums;\nconst { AUTO, PX, PERCENT } = unit;\nconst { REFLOW } = level;\n\nfunction offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) {\n if(dy) {\n let last;\n do {\n // component的sr没有next兄弟,视为component的next\n while(node.isShadowRoot) {\n node = node.host;\n }\n last = node;\n let isContainer, parent = node.domParent;\n if(parent) {\n let cs = parent.computedStyle;\n let ps = cs[POSITION];\n isContainer = parent === root || parent.isShadowRoot || ps === 'relative' || ps === 'absolute';\n }\n // 先偏移next,忽略有定位的absolute,本身非container也忽略\n let next = node.next;\n let container;\n while(next) {\n if(next.currentStyle[DISPLAY] !== 'none') {\n if(next.currentStyle[POSITION] === 'absolute') {\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = next.currentStyle;\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO || bottom[1] === PX) {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n }\n else if(top[1] === PERCENT) {\n let v = top[0] * 0.01 * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, null, next);\n }\n else {\n if(!container) {\n container = parent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, next]);\n }\n }\n }\n else {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n }\n next = next.next;\n }\n // root本身没domParent\n if(!parent) {\n break;\n }\n node = parent;\n // parent判断是否要resize\n let { currentStyle } = node;\n let isAbs = currentStyle[POSITION] === 'absolute';\n let need;\n if(isAbs) {\n if(currentStyle[HEIGHT][1] === AUTO\n && (currentStyle[TOP][1] === AUTO || currentStyle[BOTTOM][1] === AUTO)) {\n need = true;\n }\n }\n // height不定则需要\n else if(currentStyle[HEIGHT][1] === AUTO) {\n need = true;\n }\n if(need) {\n node.__resizeY(dy, REFLOW);\n node.clearCache();\n }\n // abs或者高度不需要继续向上调整提前跳出\n else {\n break;\n }\n if(node === root) {\n break;\n }\n }\n while(true);\n // 最后一个递归向上取消总缓存,防止过程中重复next多次无用递归\n while(last) {\n last.clearCache(true);\n last = last.domParent;\n }\n }\n}\n\nfunction clearUniqueReflowId(hash) {\n for(let i in hash) {\n if(hash.hasOwnProperty(i)) {\n let { node } = hash[i];\n delete node.__uniqueReflowId;\n }\n }\n}\n\nfunction getMergeMarginTB(topList, bottomList) {\n let total = 0;\n let max = topList[0];\n let min = topList[0];\n topList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n bottomList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n // 正数取最大,负数取最小,正负则相加\n let diff = 0;\n if(max > 0 && min > 0) {\n diff = Math.max(max, min) - total;\n }\n else if(max < 0 && min < 0) {\n diff = Math.min(max, min) - total;\n }\n else if(max !== 0 || min !== 0) {\n diff = max + min - total;\n }\n return diff;\n}\n\nexport default {\n offsetAndResizeByNodeOnY,\n clearUniqueReflowId,\n getMergeMarginTB,\n};\n","import Xom from './Xom';\nimport Text from './Text';\nimport mode from './mode';\nimport LineBoxManager from './LineBoxManager';\nimport Component from './Component';\nimport tag from './tag';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport $$type from '../util/$$type';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport reflow from '../refresh/reflow';\nimport builder from '../util/builder';\nimport level from '../refresh/level';\n\nconst {\n STYLE_KEY: {\n POSITION,\n DISPLAY,\n FONT_WEIGHT,\n MARGIN_LEFT,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n PADDING_LEFT,\n PADDING_BOTTOM,\n PADDING_RIGHT,\n PADDING_TOP,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n TOP,\n RIGHT,\n BOTTOM,\n LEFT,\n WIDTH,\n HEIGHT,\n TEXT_ALIGN,\n FLEX_DIRECTION,\n FLEX_BASIS,\n FLEX_SHRINK,\n FLEX_GROW,\n ALIGN_SELF,\n ALIGN_ITEMS,\n JUSTIFY_CONTENT,\n Z_INDEX,\n WHITE_SPACE,\n LINE_HEIGHT,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n OVERFLOW,\n FONT_SIZE,\n // PERSPECTIVE,\n // TRANSFORM,\n },\n NODE_KEY: {\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_STRUCT,\n NODE_DOM_PARENT,\n NODE_IS_INLINE,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_ADD_DOM,\n UPDATE_CONFIG,\n UPDATE_MEASURE,\n },\n STRUCT_KEY: {\n STRUCT_NUM,\n STRUCT_LV,\n STRUCT_TOTAL,\n STRUCT_CHILD_INDEX,\n STRUCT_INDEX,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH, 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 // 只绝对值生效,%不生效,依旧要判断\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 if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n }\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n else if(display === 'block') {\n let countMin = 0, countMax = 0;\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n countMin = countMax = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n }\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n else {\n if(display === 'inlineBlock' || display === 'inline-block') {\n lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n }\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n if(isDirectionRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else if(isDirectionRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n });\n }\n }\n return [display, this.__addMp(isDirectionRow, w, currentStyle, [min, max])];\n }\n\n /**\n * flex布局时,计算basis尺寸,如果有固定声明则以其为标准,content为内容最大尺寸,auto依赖w/h或降级content\n * basis要考虑相加直接item的mpb,非绝对值单位以container为基准,basis为内容时为max值\n * item的孩子为孙子节点需递归,不参与basis计算,只参与min/max,尺寸和mpb均只考虑绝对值\n * 自动计算时影响尺寸的只有换行的text,以及一组inline,均按其中最大尺寸的一个计算\n * auto自动计算递归进行,如果是普通row方向,按最大text的charWidth为准\n * 如果是column方向,则虚拟布局后看text的height\n * 在abs下时进入特殊状态,无论是row/column,都会按row方向尝试最大尺寸,直到舞台边缘或容器声明的w折行\n * 返回b,声明则按css值,否则是auto/content\n * 返回min为最小宽度,遇到字符/inline则单列排版后需要的最大宽度\n * 返回max为最大宽度,理想情况一排最大值,在abs时isVirtual状态参与计算,文本抵达边界才进行换行\n * @param isDirectionRow\n * @param data\n * @param isVirtual abs非固定尺寸时先进行虚拟布局标识\n * @private\n */\n __calBasis(isDirectionRow, data, isVirtual) {\n css.computeReflow(this, this.isShadowRoot);\n let b = 0;\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h } = data;\n // 计算需考虑style的属性\n let {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n [FLEX_BASIS]: flexBasis,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content\n let isAuto = flexBasis[1] === AUTO;\n let isFixed = [PX, PERCENT, REM, VW, VH, 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 // flex的item还是flex时\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n }\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n // flex的item是block/inline时,inline也会变成block统一对待\n else {\n let countMin = 0, countMax = 0;\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n countMin = countMax = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n }\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n if(fixedSize) {\n max = Math.max(fixedSize, max);\n }\n if(isContent) {\n b = max;\n }\n // 直接item的mpb影响basis\n return this.__addMp(isDirectionRow, w, currentStyle, [b, min, max], true);\n }\n\n __layoutNone() {\n super.__layoutNone();\n let { children } = this;\n children.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n item.__layoutNone();\n }\n });\n }\n\n /**\n * block布局,本身固定尺寸优先,否则看内容从上往下从左往右flow流排布\n * 内部inline和inlineBlock组成LineBox,通过LineBoxManager来管理混排的现象\n * LineBoxManager只有block和inlineBlock内部生成,inline会复用最近父级的\n * 内部的block在垂直方向要考虑margin合并的问题,强制所有节点为bfc,精简逻辑\n * @param data\n * @param isVirtual abs无尺寸时提前虚拟布局计算尺寸\n * @private\n */\n __layoutBlock(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n // 虚线管理一个block内部的LineBox列表,使得inline的元素可以中途衔接处理折行\n // 内部维护inline结束的各种坐标来达到目的,遇到block时中断并处理换行坐标\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n // 因精度问题,统计宽度均从0开始累加每行,最后取最大值,仅在abs布局时isVirtual生效\n let maxW = 0;\n let cw = 0;\n // 连续block(flex相同,下面都是)的上下margin合并值记录,合并时从列表中取\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isImg = item.tagName === 'img';\n // 每次循环开始前,这次不是block的话,看之前遗留待合并margin,并重置\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n if(isXom) {\n // inline和inlineBlock的细节不同之处,ib除了w/h之外,更想像block一样占据一行\n // 比如2个inline前面占一半后面比一半多但还是会从一半开始然后第2行换行继续,但ib放不下则重开一行\n // inline和ib能互相嵌套,形成的LineBox中则是TextBox和节点混合\n if(isInlineBlock || isInline) {\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || isInline && whiteSpace === 'nowrap') {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager, // ib内部新生成会内部判断,这里不管统一传入\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样\n if(item.__isIbFull) {\n x = data.x;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // abs统计宽度\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下,内部判断了inline/ib,ib要考虑是否有width\n let fw = item.__tryLayInline(w + data.x - x, w);\n // 放得下继续,奇怪的精度问题,加上阈值\n if(fw >= (-1e-10)) {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n x = data.x;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n if(isVirtual) {\n cw += item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n // block/flex先处理之前可能遗留的最后一行LineBox,然后递归时不传lineBoxManager,其内部生成新的\n else {\n // 非开头,说明之前的text未换行,需要增加行数\n if(x !== data.x && flowChildren[i - 1] instanceof Text) {\n lineClampCount++;\n }\n x = data.x;\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n let isNone = item.currentStyle[DISPLAY] === 'none';\n // 自身无内容\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n y += item.outerHeight;\n lineBoxManager.__lastY = y;\n // absolute/flex前置虚拟计算\n if(isVirtual) {\n maxW = Math.max(maxW, item.outerWidth);\n cw = 0;\n }\n // 空block要留下轮循环看,除非是最后一个,此处非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n item.__offsetY(diff, true);\n y += diff;\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n }\n }\n // 文字和inline类似\n else {\n // lineClamp作用域为block下的inline(同LineBox上下文)\n if(lineClamp && lineClampCount >= lineClamp) {\n return;\n }\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.width;\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x);\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, item.width);\n cw = 0;\n }\n }\n if(isVirtual) {\n cw += item.width;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n });\n // 结束后如果是以LineBox结尾,则需要设置y到这里,否则流布局中block会设置\n // 当以block换行时,新行是true,否则是false即结尾\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n }\n let tw = this.__width = (fixedWidth || !isVirtual) ? w : maxW;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // 非abs提前的虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐\n if(!isVirtual) {\n lineBoxManager.verticalAlign();\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // 所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n this.__marginAuto(currentStyle, data);\n }\n }\n\n // 弹性布局时的计算位置\n __layoutFlex(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle, __flexLine } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n // 每次布局情况多行内容\n __flexLine.splice(0);\n let {\n [FLEX_DIRECTION]: flexDirection,\n [JUSTIFY_CONTENT]: justifyContent,\n [ALIGN_ITEMS]: alignItems,\n [LINE_CLAMP]: lineClamp,\n [FLEX_WRAP]: flexWrap,\n [ALIGN_CONTENT]: alignContent,\n [LINE_HEIGHT]: lineHeight,\n [TEXT_ALIGN]: textAlign,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n let maxX = 0;\n let isDirectionRow = ['column', 'column-reverse', 'columnReverse'].indexOf(flexDirection) === -1;\n // 计算伸缩基数\n let growList = [];\n let shrinkList = [];\n let basisList = [];\n let maxList = [];\n let minList = [];\n let orderChildren = genOrderChildren(flowChildren);\n orderChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n // abs虚拟布局计算时纵向也是看横向宽度\n let [b, min, max] = item.__calBasis(isVirtual ? true : isDirectionRow, { x, y, w, h }, isVirtual);\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += max;\n }\n else {\n maxX = Math.max(maxX, max);\n }\n return;\n }\n let { [FLEX_GROW]: flexGrow, [FLEX_SHRINK]: flexShrink } = currentStyle;\n computedStyle[FLEX_BASIS] = b;\n growList.push(flexGrow);\n shrinkList.push(flexShrink);\n // 根据basis不同,计算方式不同\n basisList.push(b);\n maxList.push(max);\n minList.push(min);\n }\n // 文本\n else {\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += item.textWidth;\n }\n else {\n maxX = Math.max(maxX, item.textWidth);\n }\n return;\n }\n growList.push(0);\n shrinkList.push(1);\n if(isDirectionRow) {\n let cw = item.charWidth;\n let tw = item.textWidth;\n basisList.push(tw);\n maxList.push(tw);\n minList.push(cw);\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n });\n let h = item.height;\n basisList.push(h);\n minList.push(h);\n }\n }\n });\n // abs时,只需关注宽度即可,无需真正布局\n if(isVirtual) {\n let tw = this.__width = Math.min(maxX, w);\n this.__ioSize(tw, this.height);\n return;\n }\n let containerSize = isDirectionRow ? w : h;\n let isMultiLine = flexWrap === 'wrap' || ['wrap-reverse', 'wrapReverse'].indexOf(flexWrap) > -1;\n /**\n * 判断是否需要分行,根据假设主尺寸来统计尺寸和计算,假设主尺寸是clamp(min_main_size, flex_base_size, max_main_size)\n * 当多行时,由于每行一定有最小限制,所以每行一般情况都不是shrink状态,\n * 但也有极端情况,比如一行只能放下1个元素时,且此元素比容器小,会是shrink\n */\n let line = [], sum = 0, hypotheticalList = [];\n basisList.forEach((item, i) => {\n let min = minList[i], max = maxList[i];\n let hypothetical;\n if(item < min) {\n hypothetical = min;\n }\n else if(item > max) {\n hypothetical = max;\n }\n else {\n hypothetical = item;\n }\n hypotheticalList.push(hypothetical);\n if(isMultiLine) {\n // 超过尺寸时,要防止sum为0即1个也会超过尺寸\n if(sum + hypothetical > containerSize) {\n if(sum) {\n __flexLine.push(line);\n line = [orderChildren[i]];\n sum = hypothetical;\n }\n else {\n line.push(orderChildren[i]);\n __flexLine.push(line);\n line = [];\n sum = 0;\n }\n }\n else {\n line.push(orderChildren[i]);\n sum += hypothetical;\n }\n }\n else {\n line.push(orderChildren[i]);\n }\n });\n if(line.length) {\n __flexLine.push(line);\n }\n let offset = 0, clone = { x, y, w, h };\n let maxCrossList = [];\n __flexLine.forEach(item => {\n let length = item.length;\n let end = offset + length;\n let [x1, y1, maxCross] = this.__layoutFlexLine(clone, isDirectionRow, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, orderChildren.slice(offset, end), item, textAlign,\n growList.slice(offset, end), shrinkList.slice(offset, end), basisList.slice(offset, end),\n hypotheticalList.slice(offset, end), minList.slice(offset, end));\n // 下一行/列更新坐标\n if(isDirectionRow) {\n clone.y = y1;\n }\n else {\n clone.x = x1;\n }\n x = Math.max(x, x1);\n y = Math.max(y, y1);\n maxCrossList.push(maxCross);\n offset += length;\n });\n let tw = this.__width = w;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // flexDirection当有reverse时交换每line的主轴序\n if(flexDirection === 'row-reverse' || flexDirection === 'rowReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = tw - item.outerWidth - (item.x - data.x) * 2;\n if(diff) {\n item.__offsetX(diff, true);\n }\n });\n });\n }\n else if(flexDirection === 'column-reverse' || flexDirection === 'columnReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = th - item.outerHeight - (item.y - data.y) * 2;\n if(diff) {\n item.__offsetY(diff, true);\n }\n });\n });\n }\n // wrap-reverse且多轴线时交换轴线序,需要2行及以上才行\n let length = __flexLine.length;\n if(['wrapReverse', 'wrap-reverse'].indexOf(flexWrap) > -1 && length > 1) {\n let crossSum = 0, crossSumList = [];\n maxCrossList.forEach(item => {\n crossSumList.push(crossSum);\n crossSum += item;\n });\n let count = 0;\n for(let i = length - 1; i >= 0; i--) {\n let line = __flexLine[i];\n let source = crossSumList[i];\n let diff = count - source;\n if(diff) {\n line.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n count += maxCrossList[i];\n }\n __flexLine.reverse();\n }\n // 侧轴对齐分flexLine做,要考虑整体的alignContent的stretch和每行的alignItems的stretch\n // 先做整体的,得出交叉轴空白再均分给每一行做单行的,整体的只有1行忽略\n let per;\n if(!isVirtual && length > 1 && (fixedHeight && isDirectionRow || !isDirectionRow)) {\n let diff = isDirectionRow ? th - (y - data.y) : tw - (x - data.x);\n // 有空余时才进行对齐\n if(diff > 0) {\n if(alignContent === 'center') {\n let per = diff * 0.5;\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per, true);\n }\n else {\n item.__offsetX(per, true);\n }\n });\n }\n else if(alignContent === 'flex-start' || alignContent === 'flexStart') {}\n else if(alignContent === 'flex-end' || alignContent === 'flexEnd') {\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n else if(alignContent === 'space-between' || alignContent === 'spaceBetween') {\n let between = diff / (length - 1);\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(between, true);\n }\n else {\n item.__offsetX(between, true);\n }\n });\n }\n });\n }\n else if(alignContent === 'space-around' || alignContent === 'spaceAround') {\n let around = diff / (length + 1);\n __flexLine.forEach((item, i) => {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(around * (i + 1), true);\n }\n else {\n item.__offsetX(around * (i + 1), true);\n }\n });\n });\n }\n // 默认stretch\n else {\n per = diff / length;\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per * i, true);\n }\n else {\n item.__offsetX(per * i, true);\n }\n });\n }\n });\n }\n }\n }\n // 每行再进行cross对齐,在alignContent为stretch时计算每行的高度\n if(!isVirtual) {\n if(length > 1) {\n __flexLine.forEach((item, i) => {\n let maxCross = maxCrossList[i];\n if(per) {\n maxCross += per;\n }\n this.__crossAlign(item, alignItems, isDirectionRow, maxCross);\n });\n }\n else if(length) {\n let maxCross = maxCrossList[0];\n if(isDirectionRow) {\n if(fixedHeight) {\n maxCross = h;\n }\n }\n else {\n maxCross = w;\n }\n this.__crossAlign(__flexLine[0], alignItems, isDirectionRow, maxCross);\n }\n }\n this.__marginAuto(currentStyle, data);\n }\n\n /**\n * 计算获取子元素的b/min/max完毕后,尝试进行flex每行布局\n * https://www.w3.org/TR/css-flexbox-1/#layout-algorithm\n * 假想主尺寸,其为clamp(min_main_size, flex_base_size, max_main_size)\n * 随后按算法一步步来 https://zhuanlan.zhihu.com/p/354567655\n * 规范没提到mpb,item的要计算,孙子的只考虑绝对值\n * 先收集basis和假设主尺寸\n */\n __layoutFlexLine(data, isDirectionRow, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, orderChildren, flexLine, textAlign,\n growList, shrinkList, basisList, hypotheticalList, minList) {\n let { x, y, w, h } = data;\n let hypotheticalSum = 0;\n hypotheticalList.forEach(item => {\n hypotheticalSum += item;\n });\n // 根据假设尺寸确定使用grow还是shrink,冻结非弹性项并设置target尺寸,确定剩余未冻结数量\n let isOverflow = hypotheticalSum >= containerSize;\n let targetMainList = [];\n basisList.forEach((item, i) => {\n if(isOverflow) {\n if(!shrinkList[i] || (basisList[i] < hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n else {\n if(!growList[i] || (basisList[i] > hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n });\n // 初始可用空间,冻结使用确定的target尺寸,未冻结使用假想\n let free = 0;\n basisList.forEach((item, i) => {\n if(targetMainList[i] !== undefined) {\n free += targetMainList[i];\n }\n else {\n free += item;\n }\n });\n let total = Infinity;\n if(isDirectionRow) {\n total = w;\n }\n else if(fixedHeight) {\n total = h;\n }\n else {\n total = free;\n }\n free = Math.abs(total - free);\n // 循环,文档算法不够简练,其合并了grow和shrink,实际拆开写更简单\n let factorSum = 0;\n if(isOverflow) {\n // 计算真正的因子占比,同时得出缩小尺寸数值\n // 还需判断每个item收缩不能 {\n if(targetMainList[i] === undefined) {\n let n = item * basisList[i];\n factorSum += n;\n return n;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要收缩的尺寸\n let n = basisList[i] - s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n else {\n let factorList = growList.map((item, i) => {\n if(targetMainList[i] === undefined) {\n factorSum += item;\n return item;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要扩展的尺寸\n let n = basisList[i] + s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n let maxCross = 0;\n let lbmList = [];\n orderChildren.forEach((item, i) => {\n let main = targetMainList[i];\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n if(isDirectionRow) {\n item.__layout({\n x,\n y,\n w: main,\n h,\n w3: main, // w3假设固定宽度,忽略原始style中的设置\n });\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h: main,\n h3: main, // 同w2\n });\n }\n }\n else {\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n lbmList.push(lineBoxManager);\n item.__layout({\n x,\n y,\n w: isDirectionRow ? main : w,\n h: isDirectionRow ? h : main,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n });\n }\n if(isDirectionRow) {\n x += item.outerWidth;\n maxCross = Math.max(maxCross, item.outerHeight);\n }\n else {\n y += item.outerHeight;\n maxCross = Math.max(maxCross, item.outerWidth);\n }\n });\n // 计算主轴剩余时要用真实剩余空间而不能用伸缩剩余空间\n let diff = isDirectionRow ? (w - x + data.x) : (h - y + data.y);\n // 主轴对齐方式\n if(diff > 0) {\n let len = orderChildren.length;\n if(justifyContent === 'flexEnd' || justifyContent === 'flex-end') {\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(diff, true) : child.__offsetY(diff, true);\n }\n }\n else if(justifyContent === 'center') {\n let center = diff * 0.5;\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(center, true) : child.__offsetY(center, true);\n }\n }\n else if(justifyContent === 'spaceBetween' || justifyContent === 'space-between') {\n let between = diff / (len - 1);\n for(let i = 1; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(between * i, true) : child.__offsetY(between * i, true);\n }\n }\n else if(justifyContent === 'spaceAround' || justifyContent === 'space-around') {\n let around = diff / (len + 1);\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(around * (i + 1), true) : child.__offsetY(around * (i + 1), true);\n }\n }\n }\n if(isDirectionRow) {\n y += maxCross;\n }\n else {\n x += maxCross;\n }\n // flex的直接text对齐比较特殊\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lbmList.forEach(item => {\n item.horizonAlign(item.width, textAlign);\n })\n }\n return [x, y, maxCross];\n }\n\n // 每个flexLine的侧轴对齐,单行时就是一行对齐\n __crossAlign(line, alignItems, isDirectionRow, maxCross) {\n let baseLine = 0;\n line.forEach(item => {\n baseLine = Math.max(baseLine, item.firstBaseLine);\n });\n line.forEach(item => {\n let { currentStyle: { [ALIGN_SELF]: alignSelf } } = item;\n if(isDirectionRow) {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [HEIGHT]: height } } = item;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = item.__height = computedStyle[HEIGHT] = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n else if(alignSelf === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [HEIGHT]: height,\n } } = item;\n // row的孩子还是flex且column且不定高时,如果高度<侧轴拉伸高度则重新布局\n if(isDirectionRow && display === 'flex' && flexDirection === 'column' && height[1] === AUTO && item.outerHeight < maxCross) {\n item.__layout(Object.assign(item.__layoutData, { h3: maxCross }));\n }\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n }\n }\n // column\n else {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [WIDTH]: width } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [WIDTH]: width,\n } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n }\n }\n });\n }\n\n /**\n * inline比较特殊,先简单顶部对其,后续还需根据vertical和lineHeight计算y偏移\n * inlineBlock复用逻辑,可以设置w/h,在混排时表现不同,inlineBlock换行限制在规定的矩形内,\n * 且ib会在没设置width且换行的时候撑满上一行,即便内部尺寸没抵达边界\n * 而inline换行则会从父容器start处开始,且首尾可能占用矩形不同\n * 嵌套inline情况十分复杂,尾部mpb空白可能产生叠加情况,因此endSpace表示自身,\n * 然后根据是否在最后一个元素进行叠加父元素的,多层嵌套则多层尾部叠加,均以最后一个元素为依据判断\n * Text获取这个叠加的endSpace值即可,无需感知是否最后一个,外层(此处)进行逻辑封装\n * @param data\n * @param isVirtual\n * @param isInline\n * @private\n */\n __layoutInline(data, isVirtual, isInline) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h, lx,\n lineBoxManager, nowrap, endSpace, selfEndSpace } = this.__preLayout(data, isInline);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n let {\n [WIDTH]: width,\n } = currentStyle;\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n } = computedStyle;\n let lineClampCount = data.lineClampCount || 0;\n if(isInline && !this.__isRealInline()) {\n isInline = false;\n }\n // 只有inline的孩子需要考虑换行后从行首开始,而ib不需要,因此重置行首标识lx为x,末尾空白为0\n // 而inline的LineBoxManager复用最近非inline父dom的,ib需要重新生成,末尾空白叠加\n if(isInline) {\n this.__config[NODE_IS_INLINE] = true;\n this.__lineBoxManager = lineBoxManager;\n let baseLine = css.getBaseLine(computedStyle);\n // 特殊inline调用,有内容的话(如左右mbp),默认生成一个lineBox,即便是空,也要形成占位,只有开头时需要\n if(marginLeft || marginRight\n || paddingLeft || paddingRight\n || borderLeftWidth || borderRightWidth) {\n if(lineBoxManager.isNewLine) {\n lineBoxManager.genLineBoxByInlineIfNewLine(x, y, lineHeight, baseLine);\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseLine);\n }\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseLine);\n }\n lineClamp = data.lineClamp || 0;\n }\n else {\n lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n lx = x;\n endSpace = selfEndSpace = lineClampCount = 0;\n }\n // 存LineBox里的内容列表专用,布局过程中由lineBoxManager存入,递归情况每个inline节点都保存contentBox\n let contentBoxList;\n if(isInline) {\n contentBoxList = this.__contentBoxList = [];\n lineBoxManager.pushContentBoxList(this);\n }\n let isIbFull = false; // ib时不限定w情况下发生折行则撑满行,即便内容没有撑满边界\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline2 = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock2 = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isRealInline = isXom && item.__isRealInline();\n // 最后一个元素会产生最后一行,叠加父元素的尾部mpb\n let isEnd = isInline && (i === length - 1);\n if(isEnd) {\n endSpace += selfEndSpace;\n }\n if(isXom) {\n if(!isInline2 && !isInlineBlock2) {\n item.currentStyle[DISPLAY] = item.computedStyle[DISPLAY] = 'inlineBlock';\n isInlineBlock2 = true;\n inject.warn('Inline can not contain block/flex');\n }\n // x开头,不用考虑是否放得下直接放,i为0强制不换行\n if(x === lx || !i || isInline2 && whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样\n if(item.__isIbFull) {\n isInlineBlock2 && (w[1] === AUTO) && (isIbFull = true);\n lineBoxManager.addItem(item);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中,以计算宽度\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n }\n else {\n // 不换行继续排,换行非开头先尝试是否放得下,结尾要考虑mpb因此减去endSpace\n let fw = (whiteSpace === 'nowrap') ? 0 : item.__tryLayInline(w - x + lx, w - (isEnd ? endSpace : 0));\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n nowrap: whiteSpace === 'nowrap',\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n isInline2 && lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n lineBoxManager.addItem(item);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n }\n }\n }\n // inline里的其它只有文本,可能开始紧跟着之前的x,也可能换行后从lx行头开始\n // 紧跟着x可能出现在前面有节点换行后第2行,此时不一定放得下,因此不能作为判断依据,开头仅有lx\n else {\n let n = lineBoxManager.size;\n // i为0时强制不换行\n if(x === lx || !i || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行,且非定宽\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n }\n else {\n // 非开头先尝试是否放得下,如果放得下再看是否end,加end且只有1个字时放不下要换行,否则可以放,换行由text内部做\n // 第一个Text且父元素声明了nowrap也强制不换行,非第一个则看本身whiteSpace声明\n let focusNoWrap = (!i && nowrap) || whiteSpace === 'nowrap';\n let fw = focusNoWrap ? 0 : item.__tryLayInline(w + lx - x);\n if(!focusNoWrap && fw >= 0 && isEnd && endSpace && item.content.length === 1) {\n let fw2 = fw - endSpace;\n if(fw2 < 0) {\n fw = fw2;\n }\n }\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // 这里ib放得下一定是要么没换行要么固定宽度,所以无需判断isIbFull\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n }\n }\n }\n });\n // 同block结尾,不过这里一定是lineBox结束,无需判断\n y = lineBoxManager.endY;\n // 标识ib情况同block一样占满行\n this.__isIbFull = isIbFull;\n // 元素的width在固定情况或者ibFull情况已被计算出来,否则为最大延展尺寸,inline没有固定尺寸概念\n let tw, th;\n if(isInline) {\n // inline最后的x要算上右侧mpb,为next行元素提供x坐标基准,同时其尺寸计算比较特殊\n if(selfEndSpace) {\n lineBoxManager.addX(selfEndSpace);\n }\n // 如果没有内容,空白还要加上开头即左侧mpb\n if(!flowChildren.length) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = computedStyle;\n lineBoxManager.addX(marginLeft + paddingLeft + borderLeftWidth);\n }\n // 结束出栈contentBox,递归情况结束子inline获取contentBox,父inline继续\n lineBoxManager.popContentBoxList();\n // abs非固定w时预计算,本来是最近非inline父层统一计算,但在abs时不算,\n if(isVirtual) {\n this.__inlineSize();\n }\n }\n else {\n // ib在满时很特殊,取最大值,可能w本身很小不足排下1个字符,此时要用maxW\n let maxW = lineBoxManager.__maxX - data.x;\n tw = this.__width = fixedWidth ? w : (isIbFull ? Math.max(w, maxW) : maxW);\n th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n }\n // 非abs提前虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐,inline会被父级调用这里只看ib\n if(!isVirtual && !isInline) {\n lineBoxManager.verticalAlign();\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // block的所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n }\n // inlineBlock新开上下文,但父级block遇到要处理换行\n return isInline ? lineClampCount : 0;\n }\n\n /**\n * inline的尺寸计算非常特殊,并非一个矩形区域,而是由字体行高结合节点下多个LineBox中的内容决定,\n * 且这个尺寸又并非真实LineBox中的内容直接合并计算而来,比如包含了个更大尺寸的ib却不会计入\n * 具体方法为遍历持有的LineBox下的内容,x取两侧极值,同时首尾要考虑mpb,y值取上下极值,同样首尾考虑mpb\n * 首尾行LineBox可能不是不是占满一行,比如前后都有同行inline的情况,非首尾行则肯定占满\n * 绘制内容(如背景色)的区域也很特殊,每行LineBox根据lineHeight对齐baseLine得来,并非LineBox全部\n * 当LineBox只有直属Text时如果font没有lineGap则等价于全部,如有则需减去\n * 另外其client/offset/outer的w/h尺寸计算也很特殊,皆因首尾x方向的mpb导致\n * @private\n */\n __inlineSize(tw, textAlign) {\n let { contentBoxList, computedStyle, __ox, __oy } = this;\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // x/clientX/offsetX/outerX\n let maxX, maxY, minX, minY, maxCX, maxCY, minCX, minCY, maxFX, maxFY, minFX, minFY, maxOX, maxOY, minOX, minOY;\n let length = contentBoxList.length;\n if(length) {\n // 遍历contentBox,里面存的是LineBox内容,根据父LineBox引用判断是否换行\n contentBoxList.forEach((item, i) => {\n // 非第一个除了minY不用看其它都要,minX是换行导致,而maxX在最后一个要考虑右侧mpb,中间的无需考虑嵌套inline的mpb\n if(i) {\n minX = Math.min(minX, item.x);\n minCX = Math.min(minCX, item.x);\n minFX = Math.min(minFX, item.x);\n minOX = Math.min(minOX, item.x);\n if(i === length - 1) {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n maxY = maxCY = maxFY = maxOY = Math.max(maxY, item.y + item.outerHeight);\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n else {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n }\n }\n // 第一个初始化\n else {\n minX = item.x;\n minY = item.y;\n minCX = minX - paddingLeft;\n minCY = minY - paddingTop;\n minFX = minCX - borderLeftWidth;\n minFY = minCY - borderTopWidth;\n minOX = minFX - marginLeft;\n minOY = minFY - marginTop;\n maxX = maxCX = maxFX = maxOX = item.x + item.outerWidth;\n maxY = maxCY = maxFY = maxOY = item.y + item.outerHeight;\n if(i === length - 1) {\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n }\n });\n this.__x = minOX;\n this.__y = minOY;\n this.__width = computedStyle[WIDTH] = maxX - minX;\n // 防止比自己最小高度lineHeight还小,比如内容是个小字体\n this.__height = computedStyle[HEIGHT] = Math.max(lineHeight, maxY - minY);\n this.__clientWidth = maxCX - minCX;\n this.__clientHeight = maxCY - minCY;\n this.__offsetWidth = maxFX - minFX;\n this.__offsetHeight = maxFY - minFY;\n this.__outerWidth = maxOX - minOX;\n this.__outerHeight = maxOY - minOY;\n this.__sx = minOX + __ox;\n this.__sy = minOY + __oy;\n this.__sx1 = minFX + __ox;\n this.__sy1 = minFY + __oy;\n this.__sx2 = minCX + __ox;\n this.__sy2 = minCY + __oy;\n this.__sx3 = minX + __ox;\n this.__sy3 = minY + __oy;\n this.__sx4 = maxX + __ox;\n this.__sy4 = maxY + __oy;\n this.__sx5 = maxCX + __ox;\n this.__sy5 = maxCY + __oy;\n this.__sx6 = maxFX + __ox;\n this.__sy6 = maxFY + __oy;\n // inline的text整体设置相同\n if(['center', 'right'].indexOf(textAlign) > -1) {\n this.children.forEach(item => {\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n }\n // 如果没有内容,宽度为0高度为lineHeight,对齐也特殊处理,lineBoxManager不会处理\n else {\n if(['center', 'right'].indexOf(textAlign) > -1) {\n let diff = tw;\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n if(diff) {\n this.__offsetX(diff, true);\n }\n }\n this.__width = computedStyle[WIDTH] = 0;\n let th = this.__height = computedStyle[HEIGHT] = lineHeight;\n this.__ioSize(0, th);\n this.__sy -= marginTop + paddingTop + borderTopWidth;\n this.__sx1 = this.sx + marginLeft;\n this.__sy1 = this.sy + marginTop;\n this.__sx2 = this.__sx1 + borderLeftWidth;\n this.__sy2 = this.__sy1 + borderTopWidth;\n this.__sx4 = this.__sx3 = this.__sx2 + paddingLeft;\n this.__sy4 = this.__sy3 = this.__sy2 + paddingTop;\n this.__sx5 = this.__sx4 + paddingRight;\n this.__sy5 = this.__sy4 + th + paddingBottom;\n this.__sx6 = this.__sx5 + borderRightWidth;\n this.__sy6 = this.__sy5 + borderBottomWidth;\n this.__clientWidth = this.__sx5 - this.__sx2;\n this.__clientHeight = this.__sy5 - this.__sy2;\n this.__offsetWidth = this.__sx6 - this.__sx1;\n this.__offsetHeight = this.__sy6 - this.__sy1;\n this.__outerWidth = this.__offsetWidth + marginLeft + marginRight;\n this.__outerHeight = this.__offsetHeight + marginTop + marginBottom;\n }\n }\n\n /**\n * 只针对绝对定位children布局\n * @param container\n * @param data\n * @param target 可选,只针对某个abs的child特定布局,在局部更新时用\n * @private\n */\n __layoutAbs(container, data, target) {\n let { sx: x, sy: y, clientWidth, clientHeight, computedStyle } = container;\n let { isDestroyed, children, absChildren } = this;\n let {\n [DISPLAY]: display,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n } = computedStyle;\n if(isDestroyed || display === 'none') {\n this.__layoutNone();\n return;\n }\n x += marginLeft + borderLeftWidth;\n y += marginTop + borderTopWidth;\n // 对absolute的元素进行相对容器布局\n absChildren.forEach(item => {\n if(target) {\n // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr\n let node = item;\n if(node instanceof Component) {\n node = item.shadowRoot;\n }\n // 所以得2个都对比\n if(target !== node && target !== item) {\n return;\n }\n }\n let { currentStyle, computedStyle } = item;\n if(currentStyle[DISPLAY] === 'none') {\n item.__layoutNone();\n return;\n }\n // 先根据容器宽度计算margin/padding\n item.__mp(currentStyle, computedStyle, clientWidth);\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let { [LEFT]: left, [TOP]: top, [RIGHT]: right,\n [BOTTOM]: bottom, [WIDTH]: width, [HEIGHT]: height, [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection } = currentStyle;\n let x2, y2, w2, h2;\n let onlyRight;\n let onlyBottom;\n let fixedTop;\n let fixedRight;\n let fixedBottom;\n let fixedLeft;\n // 判断何种方式的定位,比如左+宽度,左+右之类\n if(left[1] !== AUTO) {\n fixedLeft = true;\n computedStyle[LEFT] = calAbsolute(currentStyle, 'left', left, clientWidth, this.root);\n }\n else {\n computedStyle[LEFT] = 'auto';\n }\n if(right[1] !== AUTO) {\n fixedRight = true;\n computedStyle[RIGHT] = calAbsolute(currentStyle, 'right', right, clientWidth, this.root);\n }\n else {\n computedStyle[RIGHT] = 'auto';\n }\n if(top[1] !== AUTO) {\n fixedTop = true;\n computedStyle[TOP] = calAbsolute(currentStyle, 'top', top, clientHeight, this.root);\n }\n else {\n computedStyle[TOP] = 'auto';\n }\n if(bottom[1] !== AUTO) {\n fixedBottom = true;\n computedStyle[BOTTOM] = calAbsolute(currentStyle, 'bottom', bottom, clientHeight, this.root);\n }\n else {\n computedStyle[BOTTOM] = 'auto';\n }\n // 优先级最高left+right,其次left+width,再次right+width,再次仅申明单个,最次全部auto\n if(fixedLeft && fixedRight) {\n x2 = x + computedStyle[LEFT];\n w2 = x + clientWidth - computedStyle[RIGHT] - x2;\n }\n else if(fixedLeft) {\n x2 = x + computedStyle[LEFT];\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else 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 unit from '../style/unit';\nimport image from '../style/image';\nimport border from '../style/border';\nimport enums from '../util/enums';\nimport level from '../refresh/level';\nimport mx from '../math/matrix';\n\nconst {\n STYLE_KEY: {\n WIDTH,\n HEIGHT,\n DISPLAY,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n VISIBILITY,\n BACKGROUND_IMAGE,\n BACKGROUND_COLOR,\n BOX_SHADOW,\n MIX_BLEND_MODE,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n FONT_SIZE,\n FLEX_BASIS,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_CONFIG,\n },\n NODE_KEY: {\n NODE_CACHE,\n NODE_DEFS_CACHE,\n NODE_IS_MASK,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH, 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 ctx.arc(cx, cy, r, 0, 2 * Math.PI);\n ctx.fill();\n ctx.closePath();\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for(let i = 1, len = pts.length; i < len; i++) {\n let point = pts[i];\n ctx.lineTo(point[0], point[1]);\n }\n ctx.lineTo(pts[0][0], pts[0][1]);\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n this.__addGeom('rect', [\n ['x', originX],\n ['y', originY],\n ['width', width],\n ['height', height],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ['fill', 'rgba(0,0,0,0)']\n ]);\n this.__addGeom('circle', [\n ['cx', cx],\n ['cy', cy],\n ['r', r],\n ['fill', fill],\n ]);\n let s = '';\n for(let i = 0, len = pts.length; i < len; i++) {\n let point = pts[i];\n if(i) {\n s += ' ';\n }\n s += point[0] + ',' + point[1];\n }\n this.__addGeom('polygon', [\n ['points', s],\n ['fill', fill]\n ]);\n }\n }\n else if(source) {\n // 圆角需要生成一个mask\n let list = border.calRadius(originX, originY, width, height,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n // 有border-radius需模拟遮罩裁剪\n if(list) {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list, dx, dy);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(source, originX, originY, width, height);\n ctx.restore();\n }\n else {\n ctx.drawImage(source, originX, originY, width, height);\n }\n }\n else if(renderMode === mode.SVG) {\n // img没有变化无需diff,直接用上次的vd\n if(loadImg.cache) {\n loadImg.cache.cache = true;\n virtualDom.children = [loadImg.cache];\n // 但是还是要校验是否有borderRadius变化,引发img的圆角遮罩\n if(!virtualDom.cache && list) {\n let d = svgPolygon(list);\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF'],\n ],\n }\n ],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.conClip = 'url(#' + id + ')';\n }\n return;\n }\n // 缩放图片,无需考虑原先矩阵,xom里对父层已经变换过了\n let matrix;\n if(width !== loadImg.width || height !== loadImg.height) {\n matrix = image.matrixResize(loadImg.width, loadImg.height, width, height, originX, originY, width, height);\n }\n let props = [\n ['xlink:href', loadImg.error ? placeholder : loadImg.src],\n ['x', originX],\n ['y', originY],\n ['width', loadImg.width],\n ['height', loadImg.height]\n ];\n if(list) {\n let d = svgPolygon(list);\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF']\n ],\n }\n ],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.conClip = 'url(#' + id + ')';\n delete virtualDom.cache;\n }\n if(matrix && !mx.isE(matrix)) {\n props.push(['transform', 'matrix(' + util.joinArr(mx.m2m6(matrix), ',') + ')']);\n }\n let vd = {\n type: 'img',\n tagName: 'image',\n props,\n };\n virtualDom.children = [vd];\n loadImg.cache = vd;\n }\n }\n return res;\n }\n\n // img没加载时,清空,这样Xom就认为没内容不生成cache,防止img先绘制cache再绘制主屏,重复\n __releaseWhenEmpty(__cache) {\n if(!this.__loadImg.error && !this.__loadImg.source) {\n return super.__releaseWhenEmpty(__cache);\n }\n }\n\n __isRealInline() {\n return false;\n }\n\n // overwrite\n __tryLayInline(w, total) {\n let { currentStyle: {\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n let loadImg = this.__loadImg;\n // 加载成功计算缩放后的宽度\n if(loadImg.source) {\n if(height[1] === PX) {\n w -= loadImg.width * height[0] / loadImg.height;\n }\n else if(height[1] === PERCENT) {\n w -= loadImg.width * height[0] * total * 0.01 / loadImg.height;\n }\n else if(height[1] === REM) {\n w -= loadImg.width * height[0] * this.root.computedStyle[FONT_SIZE] / loadImg.height;\n }\n else if(height[1] === VW) {\n w -= loadImg.width * height[0] * this.root.width * 0.01 / loadImg.height;\n }\n else if(height[1] === VH) {\n w -= loadImg.width * height[0] * this.root.height * 0.01 / loadImg.height;\n }\n else if(height[1] === VMAX) {\n w -= height[0] * Math.max(this.root.width, this.root.height) * 0.01 / loadImg.height;\n }\n else if(height[1] === VMIN) {\n w -= height[0] * Math.min(this.root.width, this.root.height) * 0.01 / loadImg.height;\n }\n else {\n w -= loadImg.width;\n }\n }\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n else if(marginLeft[1] === VMAX) {\n w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginLeft[1] === VMIN) {\n w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n else if(paddingLeft[1] === VMAX) {\n w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingLeft[1] === VMIN) {\n w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n else if(borderLeftWidth[1] === VMAX) {\n w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderLeftWidth[1] === VMIN) {\n w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n else if(marginRight[1] === VMAX) {\n w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginRight[1] === VMIN) {\n w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n else if(paddingRight[1] === VMAX) {\n w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingRight[1] === VMIN) {\n w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n else if(borderRightWidth[1] === VMAX) {\n w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderRightWidth[1] === VMIN) {\n w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return w;\n }\n\n __calBasis(isDirectionRow, 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 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 = __loadImg.width / __loadImg.height;\n b = max = min = isDirectionRow ? cross * ratio : cross / ratio;\n }\n else {\n b = max = min = isDirectionRow ? __loadImg.width : __loadImg.height;\n }\n }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\n }\n\n __loadAndRefresh(loadImg, root, ctx, placeholder, computedStyle, width, height, cb) {\n let self = this;\n // 先清空之前可能的\n if(loadImg.source || loadImg.error) {\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n });\n loadImg.source = null;\n }\n loadImg.loading = true;\n // 再测量,可能瞬间完成替换掉上面的\n inject.measureImg(loadImg.src, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败走error绘制\n if(data.url === loadImg.src && !self.isDestroyed) {\n loadImg.cache && (loadImg.cache.cache = false);\n loadImg.loading = false;\n function reload() {\n let { currentStyle: { [WIDTH]: width, [HEIGHT]: height } } = self;\n root.delRefreshTask(self.__task);\n if(width[1] !== AUTO && height[1] !== AUTO) {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REPAINT;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n else {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n }\n if(data.success) {\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n }\n else if(placeholder) {\n inject.measureImg(placeholder, data => {\n if(data.success) {\n loadImg.error = true;\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n reload();\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n return;\n }\n else {\n loadImg.error = true;\n }\n // 可见状态进行刷新操作,visibility某些情况需要刷新,可能宽高未定义要重新布局\n if(computedStyle[DISPLAY] !== 'none') {\n reload();\n }\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n }\n\n updateSrc(v, cb) {\n let self = this;\n let loadImg = self.__loadImg;\n let root = this.root;\n // 相等或空且当前error直接返回\n if(v === loadImg.src || !v && loadImg.error) {\n if(isFunction(cb)) {\n cb(-1);\n }\n }\n else if(v) {\n loadImg.src = v;\n self.__loadAndRefresh(loadImg, root, root.ctx, self.props.placeholder, self.computedStyle, self.width, self.height, cb);\n }\n else {\n loadImg.src = v;\n loadImg.source = null;\n loadImg.error = true;\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, self.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb(diff);\n }\n },\n });\n }\n }\n\n appendChild() {\n inject.error('Img can not appendChild.');\n }\n\n get src() {\n return this.__loadImg.src;\n }\n\n static showError = true;\n}\n\nexport default Img;\n","class Defs {\n constructor(uuid) {\n this.id = uuid;\n this.count = 0;\n this.list = [];\n this.cacheHash = {}; // 每次svg渲染前重置,存储前次渲染不变的缓存id\n }\n add(data) {\n let uuid = this.count;\n let hash = this.cacheHash;\n while(hash.hasOwnProperty(uuid)) {\n uuid++;\n }\n this.count = uuid + 1;\n data.id = uuid;\n data.uuid = 'karas-defs-' + this.id + '-' + uuid;\n data.index = this.list.length;\n this.list.push(data);\n return data.uuid;\n }\n addCache(data) {\n data.index = this.list.length;\n this.list.push(data);\n this.cacheHash[data.id] = true;\n return data.uuid;\n }\n clear() {\n this.list = [];\n this.count = 0;\n this.cacheHash = {};\n }\n removeCache(data) {\n let list = this.list;\n let i = data.index;\n // 一般情况index即位置,但每次渲染过程中,可能会删掉一些,此时位置会往前,但index不变,因此遍历\n for(; i >= 0; i--) {\n if(list[i] === data) {\n list.splice(i, 1);\n return;\n }\n }\n }\n\n get value() {\n return this.list;\n }\n\n static getInstance(uuid) {\n return new Defs(uuid);\n }\n}\n\nexport default Defs;\n","import Xom from '../Xom';\nimport reset from '../../style/reset';\nimport css from '../../style/css';\nimport unit from '../../style/unit';\nimport enums from '../../util/enums';\nimport mode from '../mode';\nimport util from '../../util/util';\nimport painter from '../../util/painter';\nimport transform from '../../style/transform';\nimport mx from '../../math/matrix';\nimport inject from '../../util/inject';\nimport gradient from '../../math/gradient';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n WIDTH,\n HEIGHT,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n FILL,\n STROKE,\n STROKE_MITERLIMIT,\n STROKE_WIDTH,\n STROKE_LINECAP,\n STROKE_LINEJOIN,\n STROKE_DASHARRAY,\n STROKE_DASHARRAY_STR,\n FILL_RULE,\n VISIBILITY,\n FONT_SIZE,\n FLEX_BASIS,\n },\n NODE_KEY: {\n NODE_CACHE_PROPS,\n NODE_CURRENT_PROPS,\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit;\nconst { int2rgba, isNil, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nconst REGISTER = {};\n\nclass Geom extends Xom {\n constructor(tagName, props) {\n super(tagName, props);\n this.__isMulti = !!this.props.multi;\n this.__style = css.normalize(this.style, reset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET));\n this.__currentStyle = util.extend({}, this.__style);\n this.__currentProps = util.clone(this.props);\n let config = this.__config;\n config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n config[NODE_CURRENT_PROPS] = this.__currentProps;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_STYLE] = this.__style;\n }\n\n __tryLayInline(w, total) {\n // 无children,直接以style的width为宽度,不定义则为0\n let { currentStyle: {\n [WIDTH]: width,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n 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 let min = 0;\n let max = 0;\n let { currentStyle } = this;\n // 计算需考虑style的属性\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n [DISPLAY]: display,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n 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 return [display, this.__addMp(isDirectionRow, data.w, currentStyle, [min, max])];\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH, 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 return [b, min, max];\n }\n\n __layoutBlock(data, isVirtual) {\n let { fixedWidth, fixedHeight, w, h } = this.__preLayout(data);\n this.__height = fixedHeight ? h : 0;\n if(isVirtual) {\n this.__width = fixedWidth ? w : 0;\n return;\n }\n this.__width = w;\n this.__ioSize(w, this.height);\n this.__marginAuto(this.currentStyle, data);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __layoutFlex(data) {\n // 无children所以等同于block\n this.__layoutBlock(data);\n }\n\n __layoutInline(data) {\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // 元素的width不能超过父元素w\n let tw = this.__width = fixedWidth ? w : x - data.x;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6) {\n let res = super.__calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6);\n if(isNil(__cacheStyle[STROKE_WIDTH])) {\n __cacheStyle[STROKE_WIDTH] = true;\n let strokeWidth = currentStyle[STROKE_WIDTH] || [];\n let w = this.width;\n computedStyle[STROKE_WIDTH] = strokeWidth.map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n else if(item[1] === PERCENT) {\n return item[0] * w * 0.01;\n }\n else if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n else if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n else 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 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() {}\n\n // offset/resize时要多一步清空props上记录的缓存\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeX(diff, lv) {\n super.__resizeX(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeY(diff, lv) {\n super.__resizeY(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n getProps(k) {\n let v = this.currentProps[k];\n if(!isNil(v)) {\n return v;\n }\n return this['__' + k];\n }\n\n __isRealInline() {\n return false;\n }\n\n get isMulti() {\n return this.__isMulti;\n }\n\n get currentProps() {\n return this.__currentProps;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$') {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Geom has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$'\n || !obj.prototype || !(obj.prototype instanceof Geom)) {\n throw new Error('Invalid param');\n }\n if(Geom.hasRegister(name)) {\n throw new Error(`Geom has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Geom.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nexport default Geom;\n","import Xom from '../node/Xom';\nimport Dom from '../node/Dom';\nimport Component from '../node/Component';\nimport util from './util';\nimport inject from './inject';\nimport flatten from './flatten';\nimport $$type from './$$type';\nimport enums from './enums';\n\nconst {\n NODE_KEY: {\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_DOM_PARENT,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n NODE_STRUCT,\n },\n} = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet updateList = [];\nlet removeList = [];\n\nconst KEY_FLAG = {};\n\n/**\n * setState后刷新前先根遍历检查组件开始进行shouldComponentUpdate判断\n */\nfunction check(vd) {\n if(vd instanceof Dom) {\n vd.children.forEach(child => {\n if(child instanceof Dom) {\n check(child);\n }\n // 当组件有setState更新时,从叶子到根链路会标识__hasUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasUpdate) {\n child.__hasUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n // 高阶组件会进入此分支,被父组件调用\n else if(vd instanceof Component && vd.__hasUpdate) {\n vd.__hasUpdate = false;\n checkCp(vd, vd.props);\n }\n}\n\n/**\n * 检查cp是否有state变更,注意递归检查时需要看shadow不能看shadowRoot,\n * 否则高阶组件会被跳过,其更新无法触发update生命周期\n * @param cp\n * @param nextProps\n * @param forceCheckUpdate,被render()后的json的二级组件,发现props有变更强制检查更新,否则可以跳过\n */\nfunction checkCp(cp, nextProps, forceCheckUpdate) {\n if(cp.__nextState || forceCheckUpdate) {\n let shouldUpdate;\n if(util.isFunction(cp.shouldComponentUpdate)) {\n shouldUpdate = cp.shouldComponentUpdate(nextProps, cp.__nextState || cp.state);\n }\n else {\n // 没有默认更新\n shouldUpdate = true;\n }\n if(shouldUpdate) {\n updateCp(cp, nextProps, cp.__nextState || cp.state);\n }\n // 不更新则递归检查子tree的cp\n else {\n cp.props = nextProps;\n cp.state = cp.__nextState || cp.state;\n check(cp.shadow);\n }\n }\n else {\n check(cp.shadow);\n }\n}\n\n/**\n * 更新组件的props和state,清空__nextState\n * @param cp\n * @param props\n * @param state\n */\nfunction updateCp(cp, props, state) {\n cp.props = props;\n cp.state = state;\n cp.__nextState = null; // 同步在refresh前清除component的新state标识,这样frame动画在after回调中可以新设\n let oldS = cp.shadow;\n let oldSr = cp.shadowRoot;\n let oldJson = cp.__cd;\n let json = flatten(cp.render());\n // 对比新老render()返回的内容,更新后重新生成sr\n diffSr(oldS, oldJson, json);\n cp.__init(json);\n // 为了局部dom布局需要知道老的css信息\n let sr = cp.shadowRoot;\n if(sr instanceof Xom) {\n [\n '__outerWidth',\n '__outerHeight',\n '__sx',\n '__sy',\n '__sx2',\n '__sx3',\n '__sx4',\n '__sx5',\n '__sx6',\n '__sy2',\n '__sy3',\n '__sy4',\n '__sy5',\n '__sy6',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__computedStyle = sr.__config[NODE_COMPUTED_STYLE] = oldSr.computedStyle;\n }\n else {\n let domParent = cp.domParent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n sr.__config[k] = domParent.__config[k];\n });\n }\n [\n '__x',\n '__y',\n '__width',\n '__height',\n '__sx1', // text和xom\n '__sy1',\n '__layoutData',\n '__parent',\n '__domParent',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__config[NODE_DOM_PARENT] = oldSr.domParent;\n sr.__config[NODE_STRUCT] = oldSr.__config[NODE_STRUCT];\n updateList.push(cp);\n // 老的需回收,diff会生成新的dom,唯一列外是cp直接返回一个没变化的cp\n if(!util.isObject(json) || !json.__placeholder) {\n removeList.push(oldS);\n }\n // 子组件使用老的json时标识,更新后删除,render()返回空会没json对象\n if(json && json.__placeholder) {\n delete json.__placeholder;\n }\n if(json && json.__inheritAnimate) {\n delete json.__inheritAnimate;\n }\n if(json && json.__animateRecords) {\n delete json.__animateRecords;\n }\n // 高阶组件时需判断,子组件更新后生成新的sr,父组件的sr/host需要同时更新引用\n let host = cp.host;\n while(host) {\n if(host.shadow === cp) {\n host.__shadowRoot = sr;\n sr.__hostRoot = host;\n cp = host;\n host = host.host;\n }\n else {\n break;\n }\n }\n}\n\n/**\n * 非一级组件sr进行对比,key相同的无需重新生成且继承动画\n * @param vd\n * @param oj oldJson\n * @param nj\n */\nfunction diffSr(vd, oj, nj) {\n // 先遍历检查key相同的,将没有变化的key暂存下来,深度优先,这样叶子节点出现在前面,当key的叶子也有key时,确保叶子先对比\n let ojk = getKeyHash(oj, {}, vd);\n let njk = getKeyHash(nj, {});\n let keyList = [];\n let cpList = [];\n // 先对比key对应的节点,如果新老有一方对不上则落空\n Object.keys(ojk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n if(!n) {\n o.json.key = KEY_FLAG;\n }\n });\n Object.keys(njk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n // 有可能老的没有这个key,新key落空\n if(!o) {\n n.json.key = KEY_FLAG;\n return;\n }\n let oj = o.json;\n let nj = n.json;\n let vd = o.vd;\n // 相同class的组件进行对比替换\n if(oj.$$type === TYPE_CP && nj.$$type === TYPE_CP) {\n if(oj.klass === nj.klass) {\n // 对比props和children看是否全等,是则直接替换新json类型为占位符,引用老vd,否则强制更新\n diffCp(oj, nj, vd);\n // 标识对比过了\n oj.key = nj.key = KEY_FLAG;\n // 老的sr里需删除这个vd,因为老sr会回收\n cpList.push(vd);\n }\n }\n // 相同类型的vd进行对比继承动画\n else if(oj.$$type === nj.$$type && oj.tagName === nj.tagName) {\n // 需判断矢量标签mutil是否相等\n if(nj.$$type !== TYPE_GM || oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n oj.key = nj.key = KEY_FLAG;\n // key相同的dom暂存下来\n if(nj.$$type === TYPE_VD) {\n keyList.push({\n vd,\n oj,\n nj,\n });\n }\n }\n });\n // key相同的dom对比children,下面非key逻辑就不做了\n keyList.forEach(item => {\n diffChildren(item.vd, item.oj, item.nj);\n });\n // 整体tree进行对比\n diffChild(vd, oj, nj);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的\n cpList.forEach(vd => {\n removeCpFromOldTree(vd);\n });\n}\n\n/**\n * 递归检查dom的children,相同的无需重新生成,用PL类型占位符代替直接返回老vd\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChild(vd, oj, nj) {\n if(util.isObject(nj)) {\n if(nj.$$type === TYPE_CP) {\n // key对比过了忽略\n if(nj.key === KEY_FLAG) {\n return;\n }\n // 相同class的组件处理\n if(oj && oj.$$type === nj.$$type && oj.klass === nj.klass) {\n diffCp(oj, nj, vd);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收\n removeCpFromOldTree(vd);\n }\n }\n else if(nj.$$type === TYPE_GM && oj && oj.$$type === TYPE_GM) {\n // $geom的multi必须一致\n if(oj.tagName === nj.tagName && oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n }\n // dom类型递归children\n else if(nj.$$type === TYPE_VD && oj && oj.$$type === TYPE_VD) {\n if(oj.tagName === nj.tagName) {\n nj.__inheritAnimate = vd;\n }\n diffChildren(vd, oj, nj);\n }\n }\n}\n\n/**\n * dom类型的vd对比children\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChildren(vd, oj, nj) {\n let oc = oj.children;\n let nc = nj.children;\n let ol = oc.length;\n let nl = nc.length;\n let children = vd.children;\n for(let i = 0, of = 0, nf = 0, len = Math.min(ol, nl); i < len; i++) {\n let o = oc[i + of];\n let n = nc[i + nf];\n // 新老都是key直接跳过\n if(o.key === KEY_FLAG && n.key === KEY_FLAG) {\n }\n // 其中一个是key对比过了调整索引和长度\n else if(o.key === KEY_FLAG) {\n of++;\n i--;\n ol--;\n len = Math.min(ol, nl);\n }\n else if(n.key === KEY_FLAG) {\n nf++;\n i--;\n nl--;\n len = Math.min(ol, nl);\n }\n else {\n diffChild(children[i + of], o, n);\n }\n }\n // 长度不同增减的无需关注,新json创建cp有didMount,老vd会调用cp的destroy\n}\n\n/**\n * 根据json对比看cp如何更新,被render()后的json的二级组件对比才会出现\n * @param oj\n * @param nj\n * @param vd\n */\nfunction diffCp(oj, nj, vd) {\n // props全等,直接替换新json类型为占位符,引用老vd内容,无需重新创建,暂时存在json的placeholder上\n // 否则需要强制触发组件更新,包含setState内容\n nj.__placeholder = vd;\n let sr = vd.shadowRoot;\n // 对比需忽略on开头的事件,直接改老的引用到新的上,这样只变了on的话无需更新\n let exist = {};\n Object.keys(oj.props).forEach(k => {\n let v = oj.props[k];\n exist[k] = v;\n });\n Object.keys(nj.props).forEach(k => {\n let v = nj.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n vd.off(k, exist[k]);\n vd.on(k, v);\n }\n delete exist[k];\n }\n else {\n k = k.slice(2).toLowerCase();\n vd.on(k, v);\n }\n }\n });\n // 新的少的事件取消\n Object.keys(exist).forEach(k => {\n let v = exist[k];\n if(/^on[a-zA-Z]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n delete sr.listener[k];\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n vd.off(k, v);\n }\n });\n checkCp(vd, nj.props, !util.equal(oj.props, nj.props));\n}\n\n/**\n * 深度优先遍历json,将有key的记录在hash中,如果传入根vd,同步递归保存对应位置的vd\n * @param json\n * @param hash\n * @param vd\n * @returns {*}\n */\nfunction getKeyHash(json, hash, vd) {\n if(Array.isArray(json)) {\n json.forEach((item, i) => getKeyHash(item, hash, vd && vd[i]));\n }\n else if(util.isObject(json)) {\n if(json.$$type === TYPE_VD || json.$$type === TYPE_GM || json.$$type === TYPE_CP) {\n // 深度优先\n if(json.$$type === TYPE_VD) {\n getKeyHash(json.children, hash, vd && vd.children);\n }\n let key = json.props.key;\n if(!util.isNil(key) && key !== '') {\n // 重复key错误警告\n if(hash.hasOwnProperty(key)) {\n inject.warn('Component ' + vd.tagName + ' has duplicate key: ' + key);\n }\n hash[key] = {\n json,\n vd,\n };\n }\n }\n }\n return hash;\n}\n\n/**\n * 非一级组件diff发生更新时,其需要从sr的tree中移除,因为sr会销毁\n */\nfunction removeCpFromOldTree(vd) {\n // root下的一级组件不会发生回收情况,忽略\n if(!vd.host) {\n return;\n }\n let parent = vd.parent;\n if(parent) {\n let i = parent.children.indexOf(vd);\n if(i > -1) {\n parent.children[i] = null;\n }\n else {\n throw new Error('Can not find child: ' + vd.tagName);\n }\n }\n}\n\n/**\n * 执行componentDidUpdate/destroy\n */\nfunction did() {\n updateList.forEach(item => {\n if(util.isFunction(item.componentDidUpdate)) {\n item.componentDidUpdate();\n }\n });\n updateList.splice(0);\n removeList.forEach(item => {\n item.__destroy();\n });\n removeList = [];\n}\n\nexport default {\n updateList,\n check,\n did,\n};\n","import util from './util';\nimport level from '../refresh/level';\n\nconst { joinVd, joinDef } = util;\nconst { contain, NONE, TRANSFORM_ALL, OPACITY, FILTER, MIX_BLEND_MODE } = level;\n\nfunction diff(elem, ovd, nvd) {\n let cns = elem.childNodes;\n diffDefs(cns[0], ovd.defs, nvd.defs);\n // = i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinDef(nd[i]));\n }\n }\n}\n\nfunction diffDef(elem, od, nd) {\n if(od.tagName !== nd.tagName) {\n insertAdjacentHTML(elem, 'beforebegin', joinDef(nd));\n // elem.insertAdjacentHTML('beforebegin', joinDef(nd));\n elem.parentNode.removeChild(elem);\n }\n else {\n if(od.uuid !== nd.uuid) {\n elem.setAttribute('id', nd.uuid);\n }\n let op = {};\n for(let i = 0, len = (od.props || []).length; i < len; i++) {\n let prop = od.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nd.props || []).length; i < len; i++) {\n let prop = nd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n let cns = elem.childNodes;\n let ol = od.children.length;\n let nl = nd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, od.children[i], nd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nd.children[i]));\n }\n }\n }\n}\n\nfunction diffChild(elem, ovd, nvd) {\n if(ovd.type === 'dom') {\n if(nvd.type === 'dom') {\n diffD2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffD2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'text') {\n if(nvd.type === 'text') {\n diffT2T(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'geom') {\n if(nvd.type === 'dom') {\n diffG2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffG2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'img') {\n if(nvd.type === 'img') {\n diffItemSelf(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n}\n\nfunction diffX2X(elem, ovd, nvd) {\n let { transform, opacity, visibility, mask, overflow, filter, mixBlendMode, conClip } = nvd;\n if(ovd.transform !== transform) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(ovd.opacity !== opacity) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(ovd.visibility !== visibility) {\n elem.setAttribute('visibility', visibility);\n }\n if(ovd.mask !== mask) {\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n }\n if(ovd.filter !== filter || ovd.mixBlendMode !== mixBlendMode) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('filter');\n }\n }\n // if(ovd.filter !== filter) {\n // if(filter) {\n // elem.setAttribute('filter', filter);\n // }\n // else {\n // elem.removeAttribute('filter');\n // }\n // }\n if(ovd.overflow !== overflow) {\n if(overflow) {\n elem.setAttribute('clipPath', overflow);\n }\n else {\n elem.removeAttribute('overflow');\n }\n }\n if(ovd.conClip !== conClip) {\n if(conClip) {\n elem.childNodes[1].setAttribute('clip-path', conClip);\n }\n else {\n elem.childNodes[1].removeAttribute('clip-path');\n }\n }\n}\n\nfunction diffByLessLv(elem, ovd, nvd, lv) {\n let { transform, opacity, mask, filter, mixBlendMode } = nvd;\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n if(lv === NONE) {\n return;\n }\n if(contain(lv, TRANSFORM_ALL)) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(contain(lv, OPACITY)) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(contain(lv, FILTER) || contain(lv, MIX_BLEND_MODE)) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('style');\n }\n }\n}\n\nfunction diffD2D(elem, ovd, nvd, root) {\n // cache表明children无变化缓存,一定是REPAINT以下的,只需看自身的lv以及mask\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffD2G(elem, ovd, nvd) {\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n replaceWith(cns[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffT2T(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, ovd.children[i], nvd.children[i], true);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffG2D(elem, ovd, nvd) {\n diffD2G(elem, ovd, nvd);\n}\n\nfunction diffG2G(elem, ovd, nvd) {\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n }\n}\n\nfunction diffBb(elem, obb, nbb) {\n let ol = obb.length;\n let nl = nbb.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, obb[i], nbb[i]);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nbb[i]));\n }\n }\n}\n\nfunction diffItem(elem, i, ovd, nvd, isText) {\n let cns = elem.childNodes;\n if(ovd.tagName !== nvd.tagName) {\n replaceWith(cns[i], nvd);\n }\n else {\n diffItemSelf(cns[i], ovd, nvd);\n if(isText && ovd.content !== nvd.content) {\n cns[i].innerHTML = nvd.content;\n }\n }\n}\n\nfunction diffItemSelf(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let op = {};\n for(let i = 0, len = (ovd.props || []).length; i < len; i++) {\n let prop = ovd.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nvd.props || []).length; i < len; i++) {\n let prop = nvd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n}\n\nfunction replaceWith(elem, vd) {\n let res;\n if(Array.isArray(vd)) {\n res = '';\n vd.forEach(item => {\n res += joinVd(item);\n });\n }\n else {\n res = joinVd(vd);\n }\n insertAdjacentHTML(elem, 'beforebegin', res);\n // elem.insertAdjacentHTML('beforebegin', res);\n elem.parentNode.removeChild(elem);\n}\n\nfunction insertAt(elem, cns, index, html) {\n if(index >= cns.length) {\n insertAdjacentHTML(elem, 'beforeend', html);\n // elem.insertAdjacentHTML('beforeend', html);\n }\n else {\n insertAdjacentHTML(cns[index], 'beforebegin', html);\n // cns[index].insertAdjacentHTML('beforebegin', html);\n }\n}\n\nfunction removeAt(elem, cns, index) {\n if(cns[index]) {\n elem.removeChild(cns[index]);\n }\n}\n\nlet svg;\nfunction insertAdjacentHTML(elem, where, content) {\n if(elem.insertAdjacentHTML) {\n elem.insertAdjacentHTML(where, content);\n }\n else {\n switch(where) {\n case 'beforeend':\n elem.innerHTML += content;\n break;\n case 'beforebegin':\n svg = svg || document.createElement('svg');\n svg.innerHTML = content;\n elem.parentNode.insertBefore(svg.childNodes[0], elem);\n break;\n }\n }\n}\n\nexport default diff;\n","import util from '../util/util';\n\nconst { isFunction } = util;\n\nclass Controller {\n constructor() {\n this.__records = []; // 默认记录和自动记录\n this.__records2 = []; // 非自动播放的动画记录\n this.__list = [] // 默认初始化播放列表,自动播放也存这里\n this.__list2 = []; // json中autoPlay为false的初始化存入这里\n this.__onList = []; // list中已存在的侦听事件,list2初始化时也需要增加上\n this.__lastTime = {}; // 每个类型的上次触发时间,防止重复emit\n }\n\n add(v, list = this.list) {\n if(list.indexOf(v) === -1) {\n list.push(v);\n }\n }\n\n remove(v) {\n let i = this.list.indexOf(v);\n if(i > -1) {\n this.list.splice(i, 1);\n }\n }\n\n __destroy() {\n this.__records = [];\n this.__records2 = [];\n this.__list = [];\n this.__list2 = [];\n }\n\n __action(k, args) {\n this.list.forEach(item => {\n item[k].apply(item, args);\n });\n }\n\n init(records = this.__records, list = this.list) {\n // 检查尚未初始化的record,并初始化,后面才能调用各种控制方法\n if(records.length) {\n // 清除防止重复调用,并且新的json还会进入整体逻辑\n records.splice(0).forEach(item => {\n let { target, animate } = item;\n if(target.isDestroyed) {\n return;\n }\n if(Array.isArray(animate)) {\n animate.forEach(animate => {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n });\n }\n else {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n }\n });\n }\n // 非自动播放后初始化需检测事件,给非自动播放添加上,并清空本次\n if(records === this.__records2) {\n let onList = this.__onList;\n let list2 = this.list2;\n if(list2.length && onList.length) {\n list2.forEach(item => {\n onList.forEach(arr => {\n item.off(arr[0], arr[1]);\n item.on(arr[0], arr[1]);\n });\n });\n }\n }\n }\n\n __playAuto() {\n this.init();\n this.__action('play');\n }\n\n play(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('play', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n pause() {\n this.__action('pause');\n }\n\n resume(cb) {\n let once = true;\n this.__action('resume', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n __mergeAuto() {\n this.init();\n this.init(this.__records2);\n if(this.__list2.length) {\n this.__list = this.__list.concat(this.__list2);\n this.__list2 = [];\n }\n }\n\n cancel(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('cancel', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n finish(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('finish', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndStop(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('gotoAndStop', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndPlay(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('gotoAndPlay', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.__on(id[i], handle);\n }\n this.__onList.push([id, handle]);\n }\n else {\n this.__on(id, handle);\n this.__onList.push([id, handle]);\n }\n }\n\n __on(id, handle) {\n this.list.forEach(item => {\n let cb = () => {\n let time = item.timestamp;\n if(time !== this.__lastTime[id]) {\n this.__lastTime[id] = time;\n handle();\n }\n };\n cb.__karasEventCb = handle;\n item.on(id, cb);\n });\n }\n\n off(id, handle) {\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.off(id[i], handle);\n }\n }\n else {\n this.list.forEach(item => {\n item.off(id, handle);\n });\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get list2() {\n return this.__list2;\n }\n\n __set(key, value) {\n this.list.forEach(item => {\n item[key] = value;\n });\n }\n\n set playbackRate(v) {\n this.__set('playbackRate', v);\n }\n\n set iterations(v) {\n this.__set('iterations', v);\n }\n\n set playCount(v) {\n this.__set('playCount', v);\n }\n\n set fps(v) {\n this.__set('fps', v);\n }\n\n set currentTime(v) {\n this.__set('currentTime', v);\n }\n\n set spfLimit(v) {\n this.__set('spfLimit', v);\n }\n\n set delay(v) {\n this.__set('delay', v);\n }\n\n set endDelay(v) {\n this.__set('endDelay', v);\n }\n\n set fill(v) {\n this.__set('fill', v);\n }\n\n set direction(v) {\n this.__set('direction', v);\n }\n}\n\nexport default Controller;\n","import 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 Geom from '../node/geom/Geom';\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;\n }\n // 局部根节点如有perspective,则计算pm,这里不会出现嵌套,因为每个出现都会生成局部根节点\n let pm;\n if(perspective) {\n pm = tf.calPerspectiveMatrix(perspective, perspectiveOrigin);\n }\n // 广度遍历,不断一层层循环下去,用2个hash暂存每层的父matrix和opacity,blur只需记住顶层,因为子的如果有一定是cacheFilter\n let list = [index];\n let d = 0;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n d = blur.outerSize(v);\n }\n });\n opacityHash[index] = 1;\n // opacity可以保存下来层级相乘结果供外部使用,但matrix不可以,因为这里按画布原点为坐标系计算,外部合并局部根节点以bbox左上角为原点\n let matrixHash = {};\n while(list.length) {\n let arr = list.splice(0);\n for(let i = 0, len = arr.length; i < len; i++) {\n let parentIndex = arr[i];\n let total = __structs[parentIndex][STRUCT_TOTAL] || 0;\n for(let i = parentIndex + 1, len = parentIndex + total + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node2,\n [STRUCT_TOTAL]: total,\n } = __structs[i];\n // mask也不占bbox位置\n if(node2.isMask) {\n continue;\n }\n let {\n __sx1,\n __sy1,\n __config: {\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [OPACITY]: opacity,\n },\n },\n } = node2;\n // webgl不能跳过超限\n if(limitCache && !includeLimitCache) {\n return;\n }\n // display:none跳过整个节点树,visibility只跳过自身\n if(display === 'none') {\n i += total || 0;\n continue;\n }\n if(visibility === 'hidden') {\n continue;\n }\n parentIndexHash[i] = parentIndex;\n opacityHash[i] = opacityHash[parentIndex] * opacity;\n // 防止text的情况,其一定属于某个node,其bbox被计算过,text不应该计算\n if(node2 instanceof Text) {\n continue;\n }\n let bbox, dx = 0, dy = 0, hasTotal;\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n bbox = target.bbox.slice(0);\n dx = target.dbx;\n dy = target.dby;\n i += total || 0;\n hasTotal = true;\n }\n else if(__cache && __cache.available) {\n bbox = __cache.bbox.slice(0);\n dx = __cache.dbx;\n dy = __cache.dby;\n }\n else {\n bbox = node2.bbox;\n }\n // 可能Xom没有内容\n if(bbox) {\n bbox[0] -= sx1;\n bbox[1] -= sy1;\n bbox[2] -= sx1;\n bbox[3] -= sy1;\n let matrix = matrixHash[parentIndex];\n // 父级matrix初始化E为null,自身不为E时才运算,可以加速\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n tfo[0] += __sx1 - sx1 + dx;\n tfo[1] += __sy1 - sy1 + dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(pm) {\n matrix = multiply(pm, matrix);\n }\n bbox = 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);\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);\n texCache.refresh(gl, cx, cy);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n // 因为cacheTotal不总是以左上角原点为开始,所以必须每个节点重算matrix,合并box时计算的无法用到\n let matrixHash = {};\n // 先序遍历汇总到total\n for(let i = index + 1, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n let parentIndex = parentIndexHash[i];\n let matrix = matrixHash[parentIndex]; // 父节点的在每个节点计算后保存,第一个为top的默认为E(空)\n let opacity = opacityHash[i]; // opacity在合并box时已经计算可以直接用\n // 先看text,visibility会在内部判断,display会被parent判断\n if(node instanceof Text) {\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n texCache.addTexAndDrawWhenLimit(gl, __config[NODE_CACHE], opacity, matrix, cx, cy, dx, dy);\n }\n // 再看total缓存/cache,都没有的是无内容的Xom节点\n else {\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_IS_MASK]: isMask,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // mask和不可见不能被汇总到top上\n if(visibility === 'hidden' || isMask) {\n continue;\n }\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n if(__cache && __cache.available) {\n tfo[0] += __cache.sx1;\n tfo[1] += __cache.sy1;\n }\n else {\n tfo[0] += node.__sx1;\n tfo[1] += node.__sy1;\n }\n let dx = -sx1 + dbx;\n let dy = -sy1 + dby;\n tfo[0] += dx;\n tfo[1] += dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n if(target) {\n // 局部的mbm和主画布一样,先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成\n if(isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy);\n texCache.refresh(gl, cx, cy);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前fbo作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy);\n }\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n // 绘制到fbo的纹理对象上并删除fbo恢复\n texCache.refresh(gl, cx, cy);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 生成的纹理对象本身已绑定一个纹理单元了,释放lock的同时可以给texCache的channel缓存,避免重复上传\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bboxTotal);\n texCache.releaseLockChannel(n, mockCache.page);\n return [limitCache || totalLimitCache, mockCache];\n}\n\nfunction genFilterWebgl(gl, texCache, node, cache, filter, W, H) {\n let { sx1, sy1, width, height, bbox } = cache;\n let mockCache = cache;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n let res = genBlurWebgl(gl, texCache, mockCache, v, width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'hue-rotate') {\n let rotation = geom.d2r(v % 360);\n let cosR = Math.cos(rotation);\n let sinR = Math.sin(rotation);\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + cosR * 0.787 - sinR * 0.213, 0.715 - cosR * 0.715 - sinR * 0.715, 0.072 - cosR * 0.072 + sinR * 0.928, 0, 0,\n 0.213 - cosR * 0.213 + sinR * 0.143, 0.715 + cosR * 0.285 + sinR * 0.140, 0.072 - cosR * 0.072 - sinR * 0.283, 0, 0,\n 0.213 - cosR * 0.213 - sinR * 0.787, 0.715 - cosR * 0.715 + sinR * 0.715, 0.072 + cosR * 0.928 + sinR * 0.072, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'saturate' && v !== 100) {\n let amount = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + 0.787 * amount, 0.715 - 0.715 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 + 0.285 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 - 0.715 * amount, 0.072 + 0.928 * amount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'brightness' && v !== 100) {\n let b = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'grayscale' && v > 0) {\n let oneMinusAmount = 1 - v * 0.01;\n if(oneMinusAmount < 0) {\n oneMinusAmount = 0;\n }\n else if(oneMinusAmount > 1) {\n oneMinusAmount = 1;\n }\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.2126 + 0.7874 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 + 0.2848 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 + 0.9278 * oneMinusAmount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'contrast' && v !== 100) {\n let amount = v * 0.01;\n let o = -0.5 * amount;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n amount, 0, 0, 0, o,\n 0, amount, 0, 0, o,\n 0, 0, amount, 0, o,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n });\n // 切换回主程序\n gl.useProgram(gl.program);\n gl.viewport(0, 0, W, H);\n return mockCache;\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核d扩大3倍性能慢\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * 先动态生成gl程序,默认3核源码示例已注释,根据sigma获得d(一定奇数),再计算权重\n * 然后将d尺寸和权重拼接成真正程序并编译成program,再开始绘制\n */\nfunction genBlurWebgl(gl, texCache, cache, sigma, width, height, sx1, sy1, bbox) {\n let d = blur.kernelSize(sigma);\n let max = Math.max(15, gl.getParameter(gl.MAX_VARYING_VECTORS));\n while(d > max) {\n d -= 2;\n }\n let spread = blur.outerSizeByD(d);\n width += spread * 2;\n height += spread * 2;\n // 防止超限,webgl最大纹理尺寸限制\n let limit = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n if(width > limit || height > limit) {\n return;\n }\n bbox = bbox.slice(0);\n bbox[0] -= spread;\n bbox[1] -= spread;\n bbox[2] += spread;\n bbox[3] += spread;\n let cx = width * 0.5, cy = height * 0.5;\n let weights = blur.gaussianWeight(sigma, d);\n let vert = '';\n let frag = '';\n let r = Math.floor(d * 0.5);\n for(let i = 0; i < r; i++) {\n let c = (r - i) * 0.01;\n vert += `\\nv_texCoordsBlur[${i}] = a_texCoords + vec2(-${c}, -${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i}]) * ${weights[i]};`;\n }\n vert += `\\nv_texCoordsBlur[${r}] = a_texCoords;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${r}]) * ${weights[r]};`;\n for(let i = 0; i < r; i++) {\n let c = (i + 1) * 0.01;\n vert += `\\nv_texCoordsBlur[${i + r + 1}] = a_texCoords + vec2(${c}, ${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i + r + 1}]) * ${weights[i + r + 1]};`;\n }\n vert = vertexBlur.replace('[3]', '[' + d + ']').replace(/}$/, vert + '}');\n frag = fragmentBlur.replace('[3]', '[' + d + ']').replace(/}$/, frag + '}');\n let program = webgl.initShaders(gl, vert, frag);\n gl.useProgram(program);\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n texture = webgl.drawBlur(gl, program, frameBuffer, texCache, texture, cache.page.texture, i, j,\n width, height, cx, cy, spread, d, sigma);\n // 销毁这个临时program\n gl.deleteShader(program.vertexShader);\n gl.deleteShader(program.fragmentShader);\n gl.deleteProgram(program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n texCache.releaseLockChannel(j);\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox);\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genColorMatrixWebgl(gl, texCache, cache, m, width, height, sx1, sy1, bbox) {\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n gl.useProgram(gl.programCm);\n webgl.drawCm(gl, gl.programCm, j, m);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox.slice(0));\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genOverflowWebgl(gl, texCache, node, cache, W, H) {\n let sbox = node.bbox.slice(0);\n let bbox = cache.bbox;\n // 没超过无需生成\n if(bbox[0] >= sbox[0] && bbox[1] >= sbox[1] && bbox[2] <= sbox[2] && bbox[3] <= sbox[3]) {\n return;\n }\n let width = sbox[2] - sbox[0], height = sbox[3] - sbox[1];\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n // 绘制,根据坐标裁剪使用原本纹理的一部分\n gl.useProgram(gl.programOverflow);\n webgl.drawOverflow(gl, j, sbox[0] - bbox[0], sbox[1] - bbox[1], width, height, cache.width, cache.height);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let overflowCache = new MockCache(gl, texture, cache.sx1, cache.sy1, width, height, sbox);\n texCache.releaseLockChannel(i, overflowCache.page);\n return overflowCache;\n}\n\nfunction genMaskWebgl(gl, texCache, node, __config, cache, W, H, 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);console.log(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 // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n assignMatrix(m, matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n // node本身有或者父有perspective都认为需要生成3d渲染上下文\n if(tf.isPerspectiveMatrix(matrix) || parentPm) {\n if(hasRecordAsMask) {\n hasRecordAsMask[9] = true;\n }\n else {\n hasRecordAsMask = [i, lv, total, node, __config, null, null, null, null, true];\n }\n }\n // 先左乘perspective的矩阵,再左乘父级的总矩阵\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n 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 }\n else {\n mergeList.push([i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective]);\n }\n }\n }\n let limitHash = {};\n // 根据收集的需要合并局部根的索引,尝试合并,按照层级从大到小,索引从大到小的顺序,\n // 这样保证子节点在前,后节点在前,后节点是为了mask先应用自身如filter之后再进行遮罩\n if(mergeList.length) {\n mergeList.sort(function(a, b) {\n if(a[1] === b[1]) {\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n mergeList.forEach(item => {\n let [i, lv, total, node, __config, limitCache, hasMask, filter, overflow] = item;\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n } = __config;\n let needGen;\n // 可能没变化,比如被遮罩节点、filter变更等\n if(!__cacheTotal || !__cacheTotal.available) {\n let [limit, res] = genTotalWebgl(gl, texCache, node, __config, i, total || 0, __structs, __cache, limitCache, 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 target = genOverflowWebgl(gl, texCache, node, target, width, height);\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n if(filter.length) {\n if(!__cacheFilter || !__cacheFilter.available || needGen) {\n let old = target;\n target = genFilterWebgl(gl, texCache, node, target, filter, width, height);\n if(target !== old) {\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n }\n if(hasMask && (!__cacheMask || !__cacheMask.available || needGen)) {\n target = genMaskWebgl(gl, texCache, node, __config, target, width, height, 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 m = mx.m2Mat4(matrixEvent, cx, cy);\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 }\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[0] !== page || page.update) {\n // page可能为一个已有纹理,或者贴图\n if(page instanceof MockPage) {\n webgl.bindTexture(gl, page.texture, i);\n channels[i] = page;\n }\n else {\n // 可能老的先删除\n if(last) {\n gl.deleteTexture(last.texture);\n }\n page.texture = webgl.createTexture(gl, page.canvas, i);\n channels[i] = page;\n }\n hash[page.uuid] = i;\n }\n else {\n hash[page.uuid] = i;\n }\n // 标识没有更新,以及最后使用时间\n page.update = false;\n page.time = inject.now();\n }\n // 再次遍历开始本次渲染并清空\n webgl.drawTextureCache(gl, list, hash, cx, cy, revertY);\n pages.splice(0);\n list.splice(0);\n }\n }\n\n findExistTexChannel(page) {\n return this.channels.indexOf(page);\n }\n\n /**\n * 获取并锁定一个纹理单元优先使用空的,其次最久未使用的\n * @returns {number|*}\n */\n lockOneChannel() {\n // 优先返回空单元\n let channels = this.channels;\n let locks = this.locks;\n for(let i = 0; i < this.__units; i++) {\n if(!channels[i] && !locks[i]) {\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n }\n // 根据NRU返回最久未使用的\n let units = this.__units;\n let cl = [];\n for(let i = 0; i < units; i++) {\n if(!locks[i]) {\n cl.push([i, channels[i]]);\n }\n }\n if(cl.length) {\n cl.sort(function(a, b) {\n if(a[1].time !== b[1].time) {\n return (a[1].time || 0) - (b[1].time || 0);\n }\n if(a[1].fullSize !== b[1].fullSize) {\n return a[1].fullSize - b[1].fullSize;\n }\n return a[0] - b[0];\n });\n let i = cl[0][0];\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n throw new Error('No free texture unit');\n }\n\n /**\n * 释放掉i单元,并且设置内容到缓存channel中\n * @param i\n * @param setToChannel\n */\n releaseLockChannel(i, setToChannel) {\n if(this.locks[i]) {\n this.locks[i] = false;\n this.__lockUnits--;\n if(setToChannel) {\n this.channels[i] = setToChannel;\n }\n }\n }\n\n // 指定锁定一个单元\n lockChannel(i) {\n let channels = this.channels;\n let locks = this.locks;\n if(!locks[i]) {\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n }\n }\n\n /**\n * 释放纹理单元\n * @param gl\n */\n release(gl) {\n this.channels.forEach(item => {\n if(item) {\n gl.deleteTexture(item.texture);\n }\n });\n }\n\n get channels() {\n return this.__channels;\n }\n\n get locks() {\n return this.__locks;\n }\n\n 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 // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d');\n this.__renderMode = mode.CANVAS;\n }\n else if(this.tagName === 'svg') {\n this.__renderMode = mode.SVG;\n }\n else if(this.tagName === 'webgl') {\n let gl = this.__ctx = this.__dom.getContext('webgl', ca);\n this.__renderMode = mode.WEBGL;\n gl.program = webgl.initShaders(gl, vertex, fragment);\n gl.programMask = webgl.initShaders(gl, vertexMask, fragmentMask);\n gl.programClip = webgl.initShaders(gl, vertexMask, fragmentClip);\n gl.programOverflow = webgl.initShaders(gl, vertexMask, fragmentOverflow);\n gl.programCm = webgl.initShaders(gl, vertexCm, fragmentCm);\n gl.useProgram(gl.program);\n // 第一次渲染生成纹理缓存管理对象,收集渲染过程中生成的纹理并在gl纹理单元满了时进行绘制和清空,减少texImage2d耗时问题\n const MAX_TEXTURE_IMAGE_UNITS = Math.min(16, gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));\n this.__texCache = new TexCache(MAX_TEXTURE_IMAGE_UNITS);\n }\n this.refresh(null, true);\n // 第一次节点没有__root,渲染一次就有了才能diff\n if(this.dom.__root && this.dom.__root instanceof Root) {\n this.dom.__root.destroy();\n }\n this.__eventCbList = initEvent(this.dom, Root);\n this.dom.__root = this;\n }\n\n refresh(cb, isFirst) {\n this.__hookTask = null;\n let { isDestroyed, renderMode, ctx, defs, width, height } = this;\n if(isDestroyed) {\n return;\n }\n defs.clear();\n // 首次递归测量整树的继承,后续更改各自更新机制做,防止每次整树遍历;root检查首次直接做,后续在checkUpdate()中插入\n if(isFirst) {\n this.__checkRoot(renderMode, width, height);\n this.__computeMeasure(renderMode, ctx);\n }\n // 非首次刷新如果没有更新则无需继续\n else if(!this.__checkUpdate(renderMode, ctx, width, height)) {\n return;\n }\n // 获取所有字体和大小测量,仅svg需要,canvas直接做\n inject.measureText();\n this.__checkReflow(width, height);\n if(renderMode === mode.CANVAS && !this.props.noRender) {\n this.__clear(ctx, renderMode);\n 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 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 let hasUpdate;\n // root更新特殊提前,因为有继承因素\n if(updateRoot) {\n root.__updateRoot = null;\n hasUpdate = parseUpdate(renderMode, root, updateRoot,\n reflowList, measureList, cacheHash, cacheList);\n // 此时做root检查,防止root出现继承等无效样式,或者发生resize()\n if(hasUpdate) {\n root.__checkRoot(renderMode, width, height);\n }\n }\n // 汇总处理每个节点,k是递增数字直接循环遍历\n let keys = Object.keys(updateHash);\n for(let i = 0, len = keys.length; i < len; i++) {\n let t = parseUpdate(renderMode, root, updateHash[keys[i]],\n reflowList, measureList, cacheHash, cacheList, zHash, zList);\n hasUpdate = hasUpdate || t;\n }\n // 先做一部分reset避免下面measureList干扰,cacheList的是专门收集新增的额外节点\n root.__reflowList = reflowList;\n uniqueUpdateId = 0;\n root.__updateHash = root.__config[NODE_UPDATE_HASH] = {};\n cacheList.forEach(__config => {\n delete __config[NODE_UNIQUE_UPDATE_ID];\n });\n // zIndex改变的汇总修改,防止重复操作\n zList.forEach(item => {\n if(item.hasOwnProperty('__uniqueZId')) {\n delete item.__uniqueZId;\n item.__updateStruct(root.__structs);\n }\n });\n /**\n * 遍历每项节点,计算测量信息,节点向上向下查找继承信息,如果parent也是继承,先计算parent的\n * 过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n */\n let measureHash = {};\n measureList.forEach(node => {\n let { __config:{ [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId, [NODE_DOM_PARENT]: parent } } = node;\n // 在root下的component变更时root会进入,但其没有__uniqueUpdateId\n if(node !== root) {\n if(measureHash.hasOwnProperty(__uniqueUpdateId)) {\n return;\n }\n measureHash[__uniqueUpdateId] = true;\n }\n let last = node;\n // 检查measure的属性是否是inherit,在root下的component变更时root会进入,但其没有__uniqueUpdateId\n // 另外dom标识表明有dom变更强制进入\n let isInherit = node !== root\n && (updateHash[__uniqueUpdateId][UPDATE_ADD_DOM]\n || change.isMeasureInherit(updateHash[__uniqueUpdateId][UPDATE_STYLE]));\n // 是inherit,需要向上查找,从顶部向下递归计算继承信息\n if(isInherit) {\n while(parent && parent !== root) {\n let { __config: {\n [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId,\n }, currentStyle } = parent;\n let isInherit;\n if(parent.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n let style = updateHash[__uniqueUpdateId][UPDATE_STYLE];\n measureHash[__uniqueUpdateId] = true;\n let temp = change.measureInheritList(style);\n isInherit = !!temp.length;\n }\n else {\n isInherit = change.isMeasureInherit(currentStyle);\n }\n // 如果parent有inherit存入列表且继续向上,否则跳出循环\n if(isInherit) {\n last = parent;\n }\n else {\n break;\n }\n // 考虑component下的继续往上继承\n parent = parent.domParent;\n }\n }\n // 自顶向下查找inherit的,利用已有的方法+回调,当递归包含重复时标记防止重复\n last.__computeMeasure(renderMode, ctx, function(target) {\n if(target.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n measureHash[target.__config[NODE_UNIQUE_UPDATE_ID]] = true;\n }\n });\n });\n // 做完清空留待下次刷新重来\n for(let i = 0, len = keys.length; i < len; i++) {\n delete updateHash[keys[i]][UPDATE_CONFIG][NODE_UNIQUE_UPDATE_ID];\n }\n return hasUpdate;\n }\n\n /**\n * 除首次外每次刷新前检查reflow列表,计算需要reflow的节点局部重新布局\n * 当一个元素absolute不变时,其变化不会影响父元素和兄弟元素,直接自己重新局部LAYOUT包含子节点\n * 当absolute发生改变时,其变化会影响父和兄弟,视作父重新布局\n * 当inline变化时,视为其最近block/flex父变化\n * 当block变化时,往上查找最上层flex视为其变化,如不是则影响后面兄弟offset和父resize\n * 当flex变化时,往上查找最上层flex视为其变化,如不是则影响所有递归子节点layout和父resize\n * 以上3种情况向上查找时遇到absolute父均提前跳出,并标记absolute父LAYOUT\n * 上面所有情况即便结束还得额外看是否处于absolute中,是还是标记absolute重新布局\n * 当relative只变化left/top/right/bottom时,自己重新layout\n * 检测节点时记录影响的所有节点,最终形成一棵或n棵局部树\n * 需要重新布局的记作LAYOUT,被兄弟影响只需偏移的记作OFFSET,OFFSET可能会重复变为LAYOUT\n * 上述情况倘若发生包含重复,去掉子树,因子树视为被包含的重新布局\n * 如果有从root开始的,直接重新布局像首次那样即可\n * 如果非root,所有树根按先根顺序记录下来,依次执行局部布局\n * =========================\n * addDom比较特殊,是向已有节点中添加新的节点,检查影响与普通domDiff变化不同\n * @private\n */\n __checkReflow(width, height) {\n let { __reflowList: reflowList } = this;\n if(!reflowList.length) {\n return;\n }\n let root = this;\n let uniqueList = [];\n let hasRoot;\n __uniqueReflowId = 0;\n let reflowHash = {};\n // 遍历检查发生布局改变的节点列表,此时computedStyle还是老的,currentStyle是新的\n for(let i = 0, len = reflowList.length; i < len; i++) {\n let item = reflowList[i];\n let { node, component, addDom, removeDom } = item;\n // root提前跳出,完全重新布局\n if(node === this) {\n hasRoot = true;\n break;\n }\n // 添加时如果是cp则node取sr来布局\n if(addDom && node instanceof Component) {\n node = node.shadowRoot;\n }\n // 每个节点生成唯一的布局识别id存入hash防止重复\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n reflowHash[__uniqueReflowId++] = item;\n }\n // 每个节点都向上检查影响,以及是否从root开始完全重新,remove特殊对待,影响父节点视为普通父节点relay\n if(checkInfluence(root, reflowHash, node, component, addDom)) {\n hasRoot = true;\n if(addDom) {\n this.__zIndexChildren = null;\n }\n break;\n }\n // remove的要特殊对待,因为提前删除了父子兄弟关系,下面deepScan不会出现\n else if(removeDom) {\n uniqueList.push(item);\n }\n }\n __uniqueReflowId = 0;\n this.__reflowList = [];\n // 有root提前跳出\n if(hasRoot) {\n reflow.clearUniqueReflowId(reflowHash);\n // 布局分为两步,普通流和定位流,互相递归\n this.__layout({\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n // 绝对布局需要从根开始保存相对坐标系的容器引用,并根据relative/absolute情况变更\n this.__layoutAbs(this, {\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n this.__structs = this.__structure(0, 0);\n return true;\n }\n /**\n * 修剪树,自顶向下深度遍历\n * LAYOUT节点作为局部根,其递归子节点无需重复任何操作,直接去重\n * OFFSET节点作为局部根,其递归子节点先执行任何操作,后续根节点再偏移一次\n */\n else {\n this.__deepScan(function(node, options) {\n if(node.hasOwnProperty('__uniqueReflowId')) {\n let o = reflowHash[node.__uniqueReflowId];\n options.uniqueList.push(o);\n // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行\n return true;\n }\n // reflowHash没有记录则无返回继续递归执行\n }, { uniqueList });\n /**\n * 按顺序执行列表即可,上层LAYOUT先执行且停止递归子节点,上层OFFSET后执行等子节点先LAYOUT/OFFSET\n * 同级按先后顺序排列,过程中记录diff在结束后进行structs更新\n * 这里要注意margin合并的逻辑,因为最终都是block(flex等同),需要进行合并\n * 在处理一个block时,先判断是否是空block,同时看后面紧邻的有没有在uniqueList的下一个\n * 单独空block处理、2个相邻的非block处理直接可以进行判断\n * 中间的空block(即非空block的下一个是空block,且下一个不是最后一个),先记录下来list,合并后一并offset\n * 合并margin和Dom的逻辑一样,抽离共有方法\n **/\n let diffList = [];\n let diffI = 0;\n let mergeOffsetList = [];\n let __uniqueMergeOffsetId = 0;\n uniqueList.forEach(item => {\n let { node, component, addDom, removeDom } = item;\n // 重新layout的w/h数据使用之前parent暂存的,x使用parent,y使用prev或者parent的\n let cps = node.computedStyle, cts = node.currentStyle;\n let zIndex = cps[Z_INDEX], position = cps[POSITION], display = cps[DISPLAY];\n let isLastAbs = position === 'absolute';\n let isNowAbs = cts[POSITION] === 'absolute';\n let isLastNone = display === 'none';\n let isNowNone = cts[DISPLAY] === 'none';\n // none不可见布局无效可以无视\n if(isLastNone && isNowNone) {\n return;\n }\n let parent = node.domParent;\n let { __layoutData: { x, y, h }, width, computedStyle } = parent;\n let current = node;\n // cp的shadowRoot要向上到cp本身,考虑高阶组件在内到真正的顶层cp\n if(current.isShadowRoot) {\n current = current.hostRoot;\n }\n // y使用prev或者parent的,首个节点无prev,prev要忽略absolute的和display:none的\n let ref = current.prev;\n let hasFlowPrev;\n while(ref) {\n if(ref instanceof Text\n || (ref.computedStyle[POSITION] !== 'absolute' && ref.computedStyle[DISPLAY] !== 'none')) {\n y = ref.y + ref.outerHeight;\n hasFlowPrev = true;\n break;\n }\n ref = ref.prev;\n }\n // 找不到prev以parent为基准,找到则增加自身,排除remove\n if(!removeDom) {\n if(!hasFlowPrev) {\n y += computedStyle[MARGIN_TOP] + computedStyle[BORDER_TOP_WIDTH] + computedStyle[PADDING_TOP];\n }\n x += computedStyle[MARGIN_LEFT] + computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT];\n }\n // 找到最上层容器,如果是组件的子节点,以sr为container,sr本身往上找\n let container = node;\n // remove的节点本身无需再次布局\n if(!removeDom) {\n if(isNowAbs) {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n if(!container) {\n container = root;\n }\n // 由setState引发的要检查是cp自身还是更上层,如果cp被abs包含,那么node是cp的父亲,否则node是cp的sr\n // 而这种情况下传cp或node都一样,所以最终统一传node\n parent.__layoutAbs(container, null, node);\n // 优先判断dom变更\n if(addDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n return;\n }\n // 前后都是abs无需偏移后面兄弟和parent调整,component变化节点需更新struct\n else if(isLastAbs) {\n if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n }\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n return;\n }\n // 标识flow变abs,可能引发zIndex变更,重设struct和svg\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // 现在是普通流,不管之前是啥直接布局,排除remove删除的\n else {\n node.__layout({\n x,\n y,\n w: width,\n h,\n });\n y += node.outerHeight;\n if(component) {\n container = node;\n }\n else {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n }\n if(!container) {\n container = root;\n }\n // 防止geom\n if(node instanceof Dom) {\n node.__layoutAbs(container, {\n x,\n y,\n w: width,\n h,\n });\n }\n }\n }\n\n // 向上查找最近的parent是relative,需再次累加ox/oy,无需继续向上递归,因为parent已经递归包含了\n // 这样node重新布局后再次设置其使用parent的偏移\n let p = node;\n while(p && p !== root) {\n p = p.domParent;\n computedStyle = p.computedStyle;\n if(computedStyle[POSITION] === 'relative') {\n let { ox, oy } = p;\n ox && node.__offsetX(ox);\n oy && node.__offsetY(oy);\n break;\n }\n }\n\n // 向下调整next的flow位置,遇到重复LAYOUT的跳出等待其调用并处理其next,忽视掉abs,margin和abs在merge中做\n if(node.isShadowRoot) {\n node = node.hostRoot;\n }\n let next = node.next;\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n if(next.computedStyle[POSITION] === 'absolute') {\n next = next.next;\n continue;\n }\n let { y: oy } = next;\n let diff = y - oy;\n if(diff) {\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n let target = next;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let cs = target.computedStyle;\n if(cs[POSITION] !== 'absolute' && cs[DISPLAY] !== 'none') {\n target.__offsetY(diff, true, REPAINT);\n }\n next = next.next;\n }\n }\n break;\n }\n\n // 去重防止abs并记录parent,整个结束后按先序顺序进行margin合并以及偏移,注意忽略有display:none变block同时为absolute的\n if(!parent.hasOwnProperty('__uniqueMergeOffsetId') && !(isNowAbs && isLastNone)) {\n parent.__uniqueMergeOffsetId = __uniqueMergeOffsetId++;\n mergeOffsetList.push(parent);\n }\n\n // add和remove都需父节点重新生成struct,zIndexChildren已在对应api操作的before()侦听做了\n if(addDom || removeDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // component未知dom变化,所以强制重新struct,text则为其父节点,同时防止zIndex变更影响父节点\n else if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n node.domParent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(node.domParent);\n }\n }\n }\n // display有none变化,重置struct和zIndexChildren\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n });\n /**\n * mergeMargin后续调整,记录的是变更节点的父节点,因此每个节点内部直接遍历孩子进行\n * 由于保持先根遍历的顺序,因此会从最上最里的节点开始,先进行margin合并\n * 由于之前忽略掉abs节点,因此再检查直接abs是否要调整\n * 完成后对此父节点的后续兄弟节点进行调整,多次不会干扰影响\n * 然后继续往上循环,直到root结束\n */\n let inDirectAbsList = [];\n mergeOffsetList.forEach(parent => {\n delete parent.__uniqueMergeOffsetId;\n let flowChildren = parent.flowChildren, absChildren = parent.absChildren;\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length, lastChild;\n let isStart, startIndex, startNode;\n // 遍历flow孩子,从开始变化的节点开始,看变化造成的影响,对其后面节点进行偏移,并统计总偏移量\n for(let i = 0; i < length; i++) {\n let item = flowChildren[i];\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n let isXom = item instanceof Xom;\n // 忽略掉前面没有变更的节点,不能合并\n if(!isStart && isXom) {\n if(item.hasOwnProperty('__uniqueReflowId')) {\n isStart = true;\n startIndex = i;\n startNode = item;\n }\n }\n // 开始变更的节点,至少不是第0个\n let cs = isXom && item.currentStyle;\n let isInline = isXom && cs[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(cs[DISPLAY]) > -1;\n lastChild = item;\n // 每次循环开始前,这次不是block的话,看之前遗留的,可能是以空block结束,需要特殊处理,单独一个空block也包含\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length && isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n // 和普通布局类似,只是不用重新布局只需处理合并margin再根据差值偏移\n if(isXom && !isInline) {\n let isNone = isXom && cs[DISPLAY] === 'none';\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n // 空block要留下轮循环看,除非是最后一个,非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n if(isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n // 需要合并的情况,根据记录数和索引向上向下遍历节点设置偏移,同时设置总偏移量供父级使用\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0,最后一个一定有不必判断isStart\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n }\n // 先检查parent的尺寸是否发生了变化,从而决定是否调整next以及向上递归调整\n let cs = parent.currentStyle;\n let height = cs[HEIGHT];\n let isContainer = parent === root || parent.isShadowRoot || cs[POSITION] === 'absolute' || cs[POSITION] === 'relative';\n if(height[1] === AUTO && lastChild) {\n let oldH = parent.height + parent.computedStyle[PADDING_TOP];\n let nowH = lastChild.y + lastChild.outerHeight - parent.y;\n let diff = nowH - oldH;\n // 调整next以及非固定PX的abs,再递归向上\n if(diff) {\n parent.__resizeY(diff, REPAINT);\n let container;\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = item.currentStyle;\n // 是容器,所有的都调整,不是容器,其偏移是上级parent的某一个,根据情况具体不同\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n else if(bottom[1] === PX) {\n item.__offsetY(diff, true, REPAINT);\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n else if(top[1] === PERCENT) {\n if(isContainer) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n // 非容器的特殊处理\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n if(container.currentStyle[HEIGHT][1] !== PX) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, null, item);\n }\n // 不在容器内说明在上级,存入等结束后统一重新布局\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, item]);\n }\n }\n }\n reflow.offsetAndResizeByNodeOnY(parent, root, reflowHash, diff, inDirectAbsList);\n return;\n }\n }\n // 没有diff变化或者固定尺寸,可能内部发生变化,调整AUTO的abs,不递归向上\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom } = item.currentStyle;\n if(top[1] === AUTO && bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n }\n });\n // merge过程中需要重新布局的abs\n inDirectAbsList.forEach(arr => {\n arr[0].__layoutAbs(arr[1], null, arr[2]);\n });\n\n // 调整因reflow造成的原struct数据索引数量偏差,纯zIndex的已经在repaint里面重新生成过了\n // 这里因为和update保持一致的顺序,因此一定是先根顺序且互不包含\n let diff = 0, lastIndex = 0, isFirst = true, structs = root.__structs;\n diffList.forEach(item => {\n let [ns, d] = item;\n // 第一个有变化的,及后面无论有无变化都需更新\n // 第1个变化区域无需更改前面一段\n if(isFirst) {\n isFirst = false;\n lastIndex = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1;\n diff += d;\n }\n // 第2+个变化区域看是否和前面一个相连,有不变的段则先偏移它,然后再偏移自己\n else {\n let j = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1 + diff;\n for(let i = lastIndex; i < j; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n lastIndex = j;\n diff += d;\n }\n });\n // 后面的要根据偏移量校正索引\n if(diff) {\n for(let i = lastIndex, len = structs.length; i < len; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n }\n // 清除id\n reflow.clearUniqueReflowId(reflowHash);\n }\n }\n\n // 特殊覆盖方法,不需要super()计算自己,因为放在每次checkRoot()做过了\n __computeMeasure(renderMode, ctx) {\n css.computeMeasure(this, true);\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx);\n });\n }\n\n // 每个root拥有一个刷新hook,多个root塞到frame的__hookTask里\n // frame在所有的帧刷新逻辑执行后检查hook列表,进行root刷新操作\n __frameHook() {\n if(!this.__hookTask) {\n let r = this.__hookTask = (() => {\n this.refresh();\n });\n frame.__hookTask.push(r);\n }\n }\n\n __clear(ctx, renderMode) {\n if(renderMode === mode.CANVAS) {\n // 可能会调整宽高,所以每次清除用最大值\n this.__mw = Math.max(this.__mw, this.width);\n this.__mh = Math.max(this.__mh, this.height);\n // 清除前得恢复默认matrix,防止每次布局改变了属性\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, this.__mw, this.__mh);\n }\n else if(renderMode === mode.WEBGL) {\n ctx.clearColor(0, 0, 0, 0);\n ctx.clear(ctx.COLOR_BUFFER_BIT);\n }\n }\n\n get dom() {\n return this.__dom;\n }\n\n get uuid() {\n return this.__uuid;\n }\n\n get renderMode() {\n return this.__renderMode;\n }\n\n get ctx() {\n return this.__ctx;\n }\n\n get defs() {\n return this.__defs;\n }\n\n get taskUp() {\n return this.__taskUp;\n }\n\n get taskCp() {\n return this.__taskCp;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get animateController() {\n return this.__animateController;\n }\n\n get texCache() {\n return this.__texCache;\n }\n}\n\nexport default Root;\n","import Geom from './Geom';\nimport mode from '../mode';\nimport painter from '../../util/painter';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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.length >= 2) {\n num++;\n }\n if(controlB.length >= 2) {\n num += 2;\n }\n return num;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getNewPoint(x1, y1, x2, y2, controlA, controlB, num, start = 0, end = 1) {\n if(start > 0 || end < 1) {\n if(num === 3) {\n [[x1, y1], controlA, controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, controlB, [x2, y2]], start, end);\n }\n else if(num === 2) {\n [[x1, y1], controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlB, [x2, y2]], start, end);\n }\n else if(num === 1) {\n [[x1, y1], controlA, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, [x2, y2]], start, end);\n }\n else {\n let a = Math.abs(x1 - x2);\n let b = Math.abs(y1 - y2);\n x1 += a * start;\n y1 += b * start;\n x2 -= a * (1 - end);\n y2 -= b * (1 - end);\n }\n }\n return [x1, y1, x2, y2, controlA, controlB];\n}\n\nclass Line extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // x1,y1和x2,y2表明线段的首尾坐标,control表明控制点坐标\n if(this.isMulti) {\n this.__x1 = [0];\n this.__y1 = [0];\n this.__x2 = [1];\n this.__y2 = [1];\n this.__controlA = [[]];\n this.__controlB = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.x1)) {\n this.__x1 = props.x1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x1)) {\n this.__x1 = [parseFloat(props.x1) || 0];\n }\n if(Array.isArray(props.y1)) {\n this.__y1 = props.y1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y1)) {\n this.__y1 = [parseFloat(props.y1) || 0];\n }\n if(Array.isArray(props.x2)) {\n this.__x2 = props.x2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x2)) {\n this.__x2 = [parseFloat(props.x2) || 0];\n }\n if(Array.isArray(props.y2)) {\n this.__y2 = props.y2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y2)) {\n this.__y2 = [parseFloat(props.y2) || 0];\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__x1.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__x1.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__x1.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__x1.map(() => v);\n }\n }\n else {\n this.__x1 = this.__y1 = this.__start = 0;\n this.__x2 = this.__y2 = this.__end = 1;\n this.__controlA = [];\n this.__controlB = [];\n if(!isNil(props.x1)) {\n this.__x1 = parseFloat(props.x1) || 0;\n }\n if(!isNil(props.y1)) {\n this.__y1 = parseFloat(props.y1) || 0;\n }\n if(!isNil(props.x2)) {\n this.__x2 = parseFloat(props.x2) || 0;\n }\n if(!isNil(props.y2)) {\n this.__y2 = parseFloat(props.y2) || 0;\n }\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA;\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB;\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, __cacheProps, isMulti } = this;\n let rebuild;\n ['x1', 'x2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originX, width, isMulti);\n }\n });\n ['y1', 'y2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originY, height, isMulti);\n }\n });\n ['controlA', 'controlB'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuildC(this[k], originX, originY, width, height, isMulti);\n }\n });\n ['start', 'end'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = this[k];\n }\n });\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 },\n } = this;\n this.buildCache(originX, originY);\n let { x1, y1, x2, y2, controlA, controlB } = __cacheProps;\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n if(!isMulti) {\n x1 = [x1];\n x2 = [x2];\n y1 = [y1];\n y2 = [y2];\n controlA = [controlA];\n controlB = [controlB];\n }\n x1.forEach((xa, i) => {\n let ya = y1[i];\n let xb = x2[i];\n let yb = y2[i];\n let ca = controlA[i];\n let cb = controlB[i];\n if((isNil(ca) || ca.length < 2) && (isNil(cb) || cb.length < 2)) {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[0] = Math.min(bbox[0], xb - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[1] = Math.min(bbox[1], yb - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[2] = Math.max(bbox[2], xb + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n bbox[3] = Math.max(bbox[3], yb + oy);\n }\n else if(isNil(ca) || ca.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(isNil(cb) || cb.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n });\n return bbox;\n }\n}\n\nexport default Line;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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 limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getLength(list, isMulti) {\n let res = [];\n let total = 0;\n let increase = [];\n if(isMulti) {\n total = [];\n list.forEach(list => {\n let temp = getLength(list);\n res.push(temp.list);\n total.push(temp.total);\n increase.push([0].concat(temp.increase));\n });\n }\n else if(Array.isArray(list)) {\n total = 0;\n increase.push(0);\n let start = 0;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item)) {\n start = i;\n break;\n }\n }\n let prev = list[start];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n let a = Math.abs(item[0] - prev[0]);\n let b = Math.abs(item[1] - prev[1]);\n let c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n res.push(c);\n total += c;\n increase.push(total);\n prev = item;\n }\n else if(item.length === 4) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]]], 2);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[2], item[3]];\n }\n else if(item.length === 6) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]], [item[4], item[5]]], 3);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[4], item[5]];\n }\n }\n }\n return {\n list: res,\n total,\n increase,\n };\n}\n\nfunction getIndex(list, t, i, j) {\n if(i === j) {\n if(list[i] > t) {\n return i - 1;\n }\n return i;\n }\n let middle = i + ((j - i) >> 1);\n if(list[middle] === t) {\n return middle;\n }\n else if(list[middle] > t) {\n return getIndex(list, t, i, Math.max(middle - 1, i));\n }\n else {\n return getIndex(list, t, Math.min(middle + 1, j), j);\n }\n}\n\nfunction getNewList(list, len, start = 0, end = 1) {\n if(start === 0 && end === 1) {\n return list;\n }\n if(start >= end) {\n return [];\n }\n let i = 0, j = list.length - 1;\n if(start > 0) {\n i = getIndex(len.increase, start * len.total, i, j);\n }\n if(end < 1) {\n j = getIndex(len.increase, end * len.total, i, j);\n }\n list = util.clone(list);\n end *= len.total;\n let prePercent = 1;\n if(end > len.increase[j]) {\n let prev = list[j].slice(list[j].length - 2); // 最后2个点是x,y,前面是control\n let current = list[j + 1];\n let l = len.list[j];\n let diff = end - len.increase[j];\n let t = diff / l;\n prePercent = t;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[j + 1] = [current[1] - (1 - t) * a, current[1] - (1 - t) * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], res[3][0], res[3][1]];\n }\n }\n start *= len.total;\n if(start > len.increase[i]) {\n let prev = list[i].slice(list[i].length - 2);\n let current = list[i + 1];\n let l = len.list[i];\n // 同一条线段时如果有end裁剪,会影响start长度\n if(i === j && prePercent !== 1) {\n l *= prePercent;\n }\n let diff = start - len.increase[i];\n let t = diff / l;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[i] = [prev[0] + t * a, prev[1] + t * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([[current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([[current[4], current[5]], [current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], current[4], current[5]];\n }\n }\n if(j < list.length - 2) {\n list = list.slice(0, j + 2);\n }\n if(i > 0) {\n list = list.slice(i);\n }\n return list;\n}\n\nclass Polyline extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 所有点的列表\n if(this.isMulti) {\n this.__points = [[]];\n this.__controls = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__points.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__points.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__points.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__points.map(() => v);\n }\n }\n else {\n this.__points = [];\n // 控制点\n this.__controls = [];\n this.__start = 0;\n this.__end = 1;\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n }\n if(Array.isArray(props.controls)) {\n this.__controls = props.controls;\n }\n if(Array.isArray(props.points)) {\n this.__points = props.points;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n return points.map((item, i) => {\n if(!Array.isArray(item)) {\n return;\n }\n let len = item.length;\n if(isControl) {\n if(len !== 0 && len !== 2 && len !== 4) {\n return;\n }\n }\n else {\n if(len !== 0 && len !== 2) {\n return;\n }\n }\n let res = [];\n for(let i = 0; i < len; i++) {\n if(i % 2 === 0) {\n res.push(originX + item[i] * width);\n }\n else {\n res.push(originY + item[i] * height);\n }\n }\n return res;\n });\n }\n\n // 供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 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 },\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let { points, controls } = __cacheProps;\n if(!isMulti) {\n points = [points];\n controls = [controls];\n }\n points.forEach((pointList, i) => {\n if(!pointList || pointList.length < 2 || pointList[0].length < 2 || pointList[1].length < 2) {\n return;\n }\n let controlList = controls[i] || [];\n let [xa, ya] = pointList[0];\n for(let i = 1, len = pointList.length; i < len; i++) {\n let [xb, yb] = pointList[i];\n let c = controlList[i - 1];\n if(c && c.length === 4) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], c[2], c[3], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(c && c.length === 2) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n }\n xa = xb;\n ya = yb;\n }\n });\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Polyline;\n","import Polyline from './Polyline';\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} } = 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Sector;\n","import Geom from './Geom';\nimport util from \"../../util/util\";\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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 }\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n bbox[0] = Math.min(bbox[0], originX - ox);\n bbox[1] = Math.min(bbox[1], originY - oy);\n bbox[2] = Math.max(bbox[2], originX + width + ox);\n bbox[3] = Math.max(bbox[3], originY + height + oy);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Rect;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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));\n }\n else {\n __cacheProps.r = r * width * 0.5;\n __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Circle;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let rx = 0, ry = 0;\n if(isMulti) {\n let mx = 0, my = 0;\n __cacheProps.rx.forEach((rx, i) => {\n mx = Math.max(rx, mx);\n my = Math.max(ry, __cacheProps.ry[i]);\n });\n rx = mx;\n ry = my;\n }\n else {\n rx = __cacheProps.rx;\n ry = __cacheProps.ry;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - rx - ox;\n let xb = cx + rx + ox;\n let ya = cy - ry - oy;\n let yb = cy + ry + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Ellipse;\n","import reset from '../style/reset';\n\nlet fullCssProperty = {\n skewX: 'kx',\n skewY: 'ky',\n transform: 'tf',\n fontSize: 'fz',\n offset: 'os',\n easing: 'e',\n filter: 'ft',\n boxShadow: 'bd',\n overflow: 'of',\n backgroundClip: 'bp',\n textOverflow: 'tof',\n flexWrap: 'fp',\n perspective: 'ppt',\n rotate3d: 'r3',\n};\n\nlet abbrCssProperty = {\n os: 'offset', // 非css属性不会被下面反向遍历插入,手动\n e: 'easing',\n};\n\nlet fullAnimate = {\n value: 'v',\n options: 'o',\n};\n\nlet abbrAnimate = {};\n\nlet fullAnimateOption = {\n duration: 'dt',\n delay: 'd',\n endDelay: 'ed',\n iterations: 'i',\n direction: 'dc',\n fill: 'f',\n fps: 'fp',\n playbackRate: 'p',\n spfLimit: 'sl',\n};\n\nlet abbrAnimateOption = {};\n\nreset.DOM_KEY_SET.concat(reset.GEOM_KEY_SET).forEach(k => {\n if(fullCssProperty.hasOwnProperty(k)) {\n abbrCssProperty[fullCssProperty[k]] = k;\n return;\n }\n let v = k.charAt(0) + k.replace(/[a-z]/g, '').toLowerCase();\n fullCssProperty[k] = v;\n abbrCssProperty[v] = k;\n});\n\nObject.keys(fullAnimate).forEach(k => {\n abbrAnimate[fullAnimate[k]] = k;\n});\n\nObject.keys(fullAnimateOption).forEach(k => {\n abbrAnimateOption[fullAnimateOption[k]] = k;\n});\n\nexport default {\n fullCssProperty,\n abbrCssProperty,\n fullAnimate,\n abbrAnimate,\n fullAnimateOption,\n abbrAnimateOption,\n};\n","import abbr from './abbr';\nimport Node from '../node/Node';\nimport Component from '../node/Component';\nimport $$type from '../util/$$type';\nimport util from '../util/util';\nimport inject from '../util/inject';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet { isNil, isFunction, isPrimitive, clone, extend } = util;\nlet { abbrCssProperty, abbrAnimateOption, abbrAnimate } = abbr;\n\n/**\n * 还原缩写到全称,涉及样式和动画属性\n * @param target 还原的对象\n * @param hash 缩写映射\n */\nfunction abbr2full(target, hash) {\n // 也许节点没写样式\n if(target) {\n Object.keys(target).forEach(k => {\n // var-attr格式特殊考虑,仅映射attr部分,var-还要保留\n if(k.indexOf('var-') === 0) {\n let k2 = k.slice(4);\n if(hash.hasOwnProperty(k2)) {\n let fk = hash[k2];\n target['var-' + fk] = target[k];\n // delete target[k];\n }\n }\n // 普通样式缩写还原\n else if(hash.hasOwnProperty(k)) {\n let fk = hash[k];\n target[fk] = target[k];\n // 删除以免二次解析\n delete target[k];\n }\n });\n }\n}\n\nfunction replaceVars(json, vars) {\n if(json && vars) {\n // 新版vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // 排除特殊的library\n if(Array.isArray(member) && member.length && member[0] !== 'library' && vars.hasOwnProperty(id)) {\n let target = json;\n for(let i = 0, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // undefined和null意义不同\n if(v === undefined) {\n return;\n }\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n target[k] = v;\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Slot miss ' + k);\n return;\n }\n }\n }\n });\n }\n }\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-') === 0) {\n let v = json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(4);\n // 有id且变量里面传入了替换的值,值可为null,因为某些情况下空为自动\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n // undefined和null意义不同\n if(value === undefined) {\n return;\n }\n let target = json;\n // 如果有.则特殊处理子属性\n if(k2.indexOf('.') > -1) {\n let list = k2.split('.');\n let len = list.length;\n for(let i = 0; i < len - 1; i++) {\n k2 = list[i];\n // 避免异常\n if(target[k2]) {\n target = target[k2];\n }\n else {\n inject.warn('parseJson vars is not exist: ' + v.id + ', ' + k + ', ' + list.slice(0, i).join('.'));\n return;\n }\n }\n k2 = list[len - 1];\n }\n // 支持函数模式和值模式\n if(isFunction(value)) {\n value = value(v);\n }\n target[k2] = value;\n }\n }\n });\n }\n }\n}\n\nfunction replaceLibraryVars(json, hash, vars) {\n if(vars) {\n // 新版同级vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // library.xxx,需要>=2的长度\n if(Array.isArray(member) && member.length > 1 && vars.hasOwnProperty(id)) {\n if(member[0] === 'library') {\n let target = hash;\n for(let i = 1, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n let old = target[k];\n // 直接替换library的子对象,需补充id和tagName\n if(i === 1) {\n target[k] = Object.assign({ id: old.id, tagName: old.tagName }, v);\n }\n // 替换library中子对象的一个属性直接赋值\n else {\n target[k] = v;\n }\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Library slot miss ' + k);\n return;\n }\n }\n }\n }\n });\n }\n }\n // 兼容老版var-\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-library.') === 0) {\n let v = json[k];\n // 直接移除library插槽,防止下面调用replaceVars(json, vars)时报错\n delete json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(12);\n // 有id且变量里面传入了替换的值\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n if(isFunction(value)) {\n value = value(v);\n }\n // 替换图层的值必须是一个有tagName的对象\n if(!value || !value.tagName) {\n return;\n }\n // library对象也要加上id,与正常的library保持一致\n hash[k2] = Object.assign({ id: k2 }, value);\n }\n }\n });\n }\n }\n}\n\n/**\n * 遍历一遍library的一级,将一级的id存到hash上,无需递归二级,\n * 因为顺序前提要求排好且无循环依赖,所以被用到的一定在前面出现,\n * 一般是无children的元件在前,包含children的div在后\n * 即便library中的元素有children或library,在linkChild时将其link过去,parse递归会继续处理\n * @param item:library的一级孩子\n * @param hash:存放library的key/value引用\n */\nfunction linkLibrary(item, hash) {\n let id = item.id;\n // library中一定有id,因为是一级,二级+特殊需求才会出现放开\n if(isNil(id)) {\n throw new Error('Library item miss id: ' + JSON.stringify(item));\n }\n else {\n hash[id] = item;\n }\n}\n\n/**\n * 链接child到library文件,\n * props需要是clone的,因为防止多个child使用同一个库文件\n * children则直接引用,无需担心多个使用同一个\n * library也需要带上,在library直接子元素还包含library时会用到\n * @param child\n * @param libraryItem\n */\nfunction linkChild(child, libraryItem) {\n // 规定图层child只有init和动画,属性和子图层来自库\n child.tagName = libraryItem.tagName;\n child.props = clone(libraryItem.props);\n child.children = libraryItem.children;\n child.library = libraryItem.library;\n // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况\n Object.keys(libraryItem).forEach(k => {\n if(k.indexOf('var-') === 0 && !child.hasOwnProperty(k)) {\n child[k] = libraryItem[k];\n }\n });\n // 删除以免二次解析\n child.libraryId = null;\n // 规定图层实例化的属性和样式在init上,优先使用init,然后才取原型链的props\n let { init } = child;\n if(init) {\n let props = child.props = child.props || {};\n let style = props.style;\n extend(props, init);\n // style特殊处理,防止被上面覆盖丢失原始值\n if(style) {\n extend(style, init.style);\n props.style = style;\n }\n // 删除以免二次解析\n child.init = null;\n }\n}\n\nfunction parse(karas, json, animateRecords, opt, hash = {}) {\n if(isPrimitive(json) || json instanceof Node || json instanceof Component) {\n return json;\n }\n if(Array.isArray(json)) {\n return json.map(item => {\n return parse(karas, item, animateRecords, opt, hash);\n });\n }\n // 先判断是否是个链接到库的节点,是则进行链接操作\n let libraryId = json.libraryId;\n if(!isNil(libraryId)) {\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,tagName和属性和子图层来自库\n if(libraryItem) {\n linkChild(json, libraryItem);\n }\n else {\n throw new Error('Link library miss id: ' + libraryId);\n }\n json.libraryId = null;\n }\n // 再判断是否有library形成一个新的作用域,会出现library下的library使得一个链接节点链接后出现library的情况\n let library = json.library;\n if(Array.isArray(library)) {\n hash = {};\n library.forEach(item => {\n linkLibrary(item, hash);\n });\n // 替换library插槽\n replaceLibraryVars(json, hash, opt.vars);\n json.library = null;\n }\n let { tagName, props = {}, children = [], animate = [] } = json;\n if(!tagName) {\n throw new Error('Dom must have a tagName: ' + JSON.stringify(json));\n }\n let style = props.style;\n (opt.abbr !== false) && abbr2full(style, abbrCssProperty);\n // 先替换style的\n replaceVars(style, opt.vars);\n // 再替换静态属性,style也作为属性的一种,目前尚未被设计为被替换\n replaceVars(props, opt.vars);\n // 替换children里的内容,如文字,无法直接替换tagName/props/children/animate本身,因为下方用的还是原引用\n replaceVars(json, opt.vars);\n 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 let animationRecord;\n if(animate) {\n if(Array.isArray(animate)) {\n let has;\n animate.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrAnimate);\n let { value, options } = item;\n // 忽略空动画\n if(Array.isArray(value) && value.length) {\n has = true;\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n });\n if(has) {\n animationRecord = {\n animate,\n target: vd,\n };\n }\n }\n else {\n (opt.abbr !== false) && abbr2full(animate, abbrAnimate);\n let { value, options } = animate;\n if(Array.isArray(value) && value.length) {\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n animationRecord = {\n animate,\n target: vd,\n };\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n }\n }\n // 产生实际动画运行才存入列表供root调用执行\n if(animationRecord) {\n animateRecords.push(animationRecord);\n }\n return vd;\n}\n\nexport default parse;\n","import parse from './parse';\nimport abbr from './abbr';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport font from '../style/font';\nimport Controller from '../animate/Controller';\n\nlet o = {\n parse(karas, json, dom, options = {}) {\n // 特殊单例声明无需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';\n\nexport default {\n css,\n reset,\n unit,\n font,\n abbr,\n};\n","import Animation from './Animation';\nimport Controller from './Controller';\nimport easing from './easing';\nimport frame from './frame';\n\nexport default {\n Animation,\n Controller,\n easing,\n frame,\n};\n","import level from './level';\nimport change from './change';\nimport Page from './Page';\nimport Cache from './Cache';\n\nexport default {\n level,\n change,\n Page,\n Cache,\n};\n","import Node from './node/Node';\nimport Text from './node/Text';\nimport Xom from './node/Xom';\nimport Dom from './node/Dom';\nimport Img from './node/Img';\nimport Root from './node/Root';\nimport tag from './node/tag';\nimport mode from './node/mode';\nimport Geom from './node/geom/Geom';\nimport Line from './node/geom/Line';\nimport Polyline from './node/geom/Polyline';\nimport Polygon from './node/geom/Polygon';\nimport Sector from './node/geom/Sector';\nimport Rect from './node/geom/Rect';\nimport Circle from './node/geom/Circle';\nimport Ellipse from './node/geom/Ellipse';\nimport Component from './node/Component';\nimport Event from './util/Event';\nimport util from './util/util';\nimport $$type from './util/$$type';\nimport builder from './util/builder';\nimport updater from './util/updater';\nimport inject from './util/inject';\nimport enums from './util/enums';\nimport debug from './util/debug';\nimport parser from './parser/index';\nimport style from './style/index';\nimport animate from './animate/index';\nimport math from './math/index';\nimport refresh from './refresh/index';\nimport { version } from '../package.json';\n\nGeom.register('$line', Line);\nGeom.register('$polyline', Polyline);\nGeom.register('$polygon', Polygon);\nGeom.register('$sector', Sector);\nGeom.register('$rect', Rect);\nGeom.register('$circle', Circle);\nGeom.register('$ellipse', Ellipse);\n\nlet karas = {\n version,\n render(root, dom) {\n if(!(root instanceof Root)) {\n throw new Error('Render dom must be canvas/svg');\n }\n if(dom) {\n root.appendTo(dom);\n }\n return root;\n },\n createElement(tagName, props) {\n props = props || {};\n let children = [];\n for(let i = 2, len = arguments.length; i < len; i++) {\n children.push(arguments[i]);\n }\n if(util.isString(tagName)) {\n if(tagName.charAt(0) === '$') {\n return this.createGm(tagName, props);\n }\n else {\n return this.createVd(tagName, props, children);\n }\n }\n else if(tagName) {\n return this.createCp(tagName, props, children);\n }\n },\n createVd(tagName, props, children = []) {\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n if(tag.TAG_NAME.hasOwnProperty(tagName)) {\n return {\n tagName,\n props,\n children,\n $$type: $$type.TYPE_VD,\n };\n }\n throw new Error(`Can not use <${tagName}>`);\n },\n createGm(tagName, props) {\n return {\n tagName,\n props,\n $$type: $$type.TYPE_GM,\n };\n },\n createCp(klass, props, children = []) {\n props.children = children;\n return {\n klass,\n props,\n $$type: $$type.TYPE_CP,\n };\n },\n parse(json, dom, options) {\n return parser.parse(this, json, dom, options);\n },\n loadAndParse(json, dom, options) {\n return parser.loadAndParse(this, json, dom, options);\n },\n mode,\n Component,\n Node,\n Text,\n Geom,\n Xom,\n Dom,\n Img,\n Root,\n Event,\n util,\n inject,\n style,\n parser,\n animate,\n math,\n builder,\n updater,\n refresh,\n enums,\n set debug(v) {\n debug.flag = !!v;\n },\n};\n\nbuilder.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\n\nif(typeof window !== 'undefined') {\n window.karas = karas;\n}\nelse if(typeof self !== 'undefined') {\n self.karas = karas;\n}\n\nexport default karas;\n"],"names":["STYLE_KEY","POSITION","DISPLAY","TOP","RIGHT","BOTTOM","LEFT","MARGIN_TOP","MARGIN_RIGHT","MARGIN_BOTTOM","MARGIN_LEFT","PADDING_TOP","PADDING_RIGHT","PADDING_BOTTOM","PADDING_LEFT","FONT_SIZE","FONT_FAMILY","COLOR","FONT_STYLE","FONT_WEIGHT","LINE_HEIGHT","BACKGROUND_IMAGE","BACKGROUND_COLOR","BACKGROUND_SIZE","BACKGROUND_REPEAT","BACKGROUND_POSITION_X","BACKGROUND_POSITION_Y","BORDER_TOP_WIDTH","BORDER_RIGHT_WIDTH","BORDER_BOTTOM_WIDTH","BORDER_LEFT_WIDTH","BORDER_TOP_COLOR","BORDER_RIGHT_COLOR","BORDER_BOTTOM_COLOR","BORDER_LEFT_COLOR","BORDER_TOP_STYLE","BORDER_RIGHT_STYLE","BORDER_BOTTOM_STYLE","BORDER_LEFT_STYLE","BORDER_TOP_LEFT_RADIUS","BORDER_TOP_RIGHT_RADIUS","BORDER_BOTTOM_RIGHT_RADIUS","BORDER_BOTTOM_LEFT_RADIUS","WIDTH","HEIGHT","FLEX_GROW","FLEX_SHRINK","FLEX_BASIS","FLEX_DIRECTION","JUSTIFY_CONTENT","ALIGN_ITEMS","ALIGN_SELF","TEXT_ALIGN","TRANSFORM_ORIGIN","VISIBILITY","OPACITY","Z_INDEX","TRANSFORM","TRANSLATE_X","TRANSLATE_Y","TRANSLATE_Z","SCALE_X","SCALE_Y","SCALE_Z","SKEW_X","SKEW_Y","ROTATE_X","ROTATE_Y","ROTATE_Z","ROTATE_3D","PERSPECTIVE","PERSPECTIVE_ORIGIN","FILTER","BOX_SHADOW","POINTER_EVENTS","OVERFLOW","MIX_BLEND_MODE","BACKGROUND_CLIP","WHITE_SPACE","TEXT_OVERFLOW","LETTER_SPACING","LINE_CLAMP","ORDER","FLEX_WRAP","ALIGN_CONTENT","TEXT_STROKE_WIDTH","TEXT_STROKE_COLOR","TEXT_STROKE_OVER","FILL","STROKE","STROKE_WIDTH","STROKE_DASHARRAY","STROKE_DASHARRAY_STR","STROKE_LINECAP","STROKE_LINEJOIN","STROKE_MITERLIMIT","FILL_RULE","MATRIX","BORDER_TOP","BORDER_RIGHT","BORDER_BOTTOM","BORDER_LEFT","TRANSLATE_PATH","STYLE2LOWER_MAP","style2Lower","s","toLowerCase","replace","$0","$1","toUpperCase","STYLE2UPPER_MAP","style2Upper","$2","STYLE_R_KEY","STYLE_RV_KEY","STYLE_V_KEY","Object","keys","forEach","k","k2","l","UPDATE_KEY","UPDATE_NODE","UPDATE_STYLE","UPDATE_FOCUS","UPDATE_MEASURE","UPDATE_COMPONENT","UPDATE_OVERWRITE","UPDATE_KEYS","UPDATE_LIST","UPDATE_CONFIG","UPDATE_ADD_DOM","UPDATE_REMOVE_DOM","KEY_FRAME_KEY","FRAME_STYLE","FRAME_TIME","FRAME_EASING","FRAME_TRANSITION","NODE_KEY","NODE_DOM_PARENT","NODE_OPACITY","NODE_MATRIX","NODE_MATRIX_EVENT","NODE_CACHE","NODE_CACHE_TOTAL","NODE_CACHE_FILTER","NODE_CACHE_MASK","NODE_CACHE_OVERFLOW","NODE_STRUCT","NODE_TAG_NAME","NODE_CURRENT_STYLE","NODE_CURRENT_PROPS","NODE_COMPUTED_STYLE","NODE_CACHE_STYLE","NODE_CACHE_PROPS","NODE_LIMIT_CACHE","NODE_IS_MASK","NODE_IS_INLINE","NODE_HAS_CONTENT","NODE_REFRESH_LV","NODE_IS_DESTROYED","NODE_STYLE","NODE_UPDATE_HASH","NODE_UNIQUE_UPDATE_ID","NODE_DEFS_CACHE","NODE_PERSPECTIVE_MATRIX","NODE_VIRTUAL_DOM","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_FRAME_CB","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_CAL_DIFF_TIME","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","__width","__height","__baseLine","__config","i","lv","j","root","struct","diff","isLayout","__sx","__sy","x","ox","y","oy","__prev","__next","__parent","__domParent","__root","__host","__hostRoot","__virtualDom","CANVAS","SVG","WEBGL","o","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","REM","EM","VW","VH","VMAX","VMIN","calUnit","v","n","parseFloat","test","info","arial","lhr","blr","lgr","padding","f","verdana","tahoma","S","T","Z","c","t","georgia","simsun","support","fontFamily","hasOwnProperty","register","name","emSquare","ascent","descent","lineGap","addPadding","assign","position","gradient","img","identity","multiply","a","b","isE","a0","a1","a2","a3","calPoint","point","m","z","w","undefined","length","b1","c1","d1","b2","c2","d2","b3","c3","d3","a4","b4","c4","d4","d","e","inverse","inverse4","divisor","inv","det","m2m6","point2d","slice","dotProduct","x1","y1","x2","y2","crossProduct","H","Math","sqrt","vector","mx","h","deg","cos","sin","pointInPolygon","vertexes","xmax","ymax","xmin","ymin","len","max","min","pointInQuadrilateral","x4","y4","x3","y3","matrix","w1","w2","w3","w4","angleBySide","theta","pow","acos","sideByAngle","alpha","pointsDistance","triangleIncentre","ellipsePoints","sectorPoints","r","begin","end","list","floor","h2","d2r","abs","atan","rx","ry","p1","p2","p4","p3","push","concat","temp","res","getRectsIntersection","isRectsOverlap","ax1","ay1","ax4","ay4","bx1","by1","bx4","by4","isRectsInside","calCoordsInNode","px","py","node","computedStyle","width","height","calPercentInNode","ds","Infinity","PI","dt","r2d","bboxBezier2","x0","y0","minX","minY","maxX","maxY","tx","ty","sx","sy","qx","qy","bboxBezier3","cx","cy","bx","by","ax","ay","hx","hy","q","bboxBezier","arguments","norm","order","sum","reduce","simpson38","derivativeFunc","middleL","middleR","adaptiveSimpson38","eps","mid","st","sl","sr","ans","bezierLength","points","startT","endT","at","at3","p0","at2","bezierOrder","derivativeOrder","pointAtBezier","percent","maxIteration","pointAtBezierWithLength","targetLen","approachLen","approachT","preApproachT","derivative1","derivative2","numerator","denominator","sliceBezier","x12","y12","x23","y23","x123","y123","x34","y34","x234","y234","x1234","y1234","sliceBezier2Both","start","reverse","pointOnCircle","getConicGradientImage","originX","originY","stop","data","Error","getAngle","dx","dy","increasingList","map","item","color","angle","factor","idx","canvasPolygon","ctx","Array","isArray","moveTo","lineTo","quadraticCurveTo","bezierCurveTo","svgPolygon","canvasLine","controlA","controlB","num","svgLine","canvasFilter","filter","svgFilter","geom","unit","painter","calFitDashed","total","bs","be","smin","smax","dmin","dmax","ps","pd","outer","per","free","mo","calDashed","style","m1","m2","m3","m4","bw","calPoints","borderWidth","borderStyle","deg1","deg2","direction","beginRadius","endRadius","indexOf","isLast","main1","main2","cross1","cross2","tan","calTopRadiusPoints","calRightRadiusPoints","calBottomRadiusPoints","calLeftRadiusPoints","pointsList","brx","bry","erx","ery","oxl","oxr","beginList","centerList","endList","ya","yb","beginLength","needInner","crossDeg","rx1","ry1","sx1","oyl","rx2","ry2","sx2","xa","xb","ca","calBezierTopLeft","cb","controls1","controls2","limit","pop","endLength","oyr","calBezierTopRight","isStart","crossDx","p1x","p1y","p2x","p2y","dx1","dsx1","dx2","dsx2","cpx2","cpy2","cpx1","cpy1","crossDsx","beta","tanBetaDiv2Sqrt","tanAlphaHalf","degTg","degTg1","cdx1","cdy1","cx1","cy1","degTg2","cdx2","cdy2","cx2","cy2","isEnd","oyt","oyb","oxt","calBezierRightTop","oxb","calBezierRightBottom","calBezierBottomLeft","calBezierBottomRight","calBezierLeftTop","calBezierLeftBottom","calRadius","btlr","btrr","bbrr","bblr","need","btlx","btly","btrx","btry","bbrx","bbry","bblx","bbly","BR_KS","calBorderRadius","currentStyle","noRadius","target","prev","next","half","calBorderRadiusInline","contentBoxList","first","last","outerWidth","outerHeight","renderBorder","xom","renderMode","mode","beginPath","fillStyle","fill","closePath","virtualDom","bb","type","tagName","props","TYPE_VD","_","TYPE_GM","TYPE_CP","toString","isType","obj","call","isObject","isString","isFunction","isNumber","isBoolean","isDate","hasOwn","fnToString","ObjectFunctionString","isNil","joinSourceArray","arr","stringify","encodeHtml","prop","joinVirtualDom","vd","defs","joinDef","joinVd","conClip","children","isMask","content","opacity","transform","visibility","mask","overflow","mixBlendMode","def","uuid","joinItem","rgba2int","charAt","parseInt","match","int2rgba","joinArr","int2invert","arr2hash","hash","hash2arr","clone","$$type","util","Date","isPlainObject","equalArr","ai","bi","isArrayA","isArrayB","equal","getTime","extend","source","split","extendAnimate","ovd","nvd","__animationList","animationList","splice","__setTarget","assigning","finished","__stayEnd","assignCurrentStyle","__frameAnimateList","transformBbox","bbox","proto","getPrototypeOf","Ctor","constructor","assignMatrix","isPrimitive","isAuto","flag","charWidth","ELLIPSIS","antialias","premultipliedAlpha","preserveDrawingBuffer","initShaders","gl","vshader","fshader","program","createProgram","enable","BLEND","blendFunc","ONE","ONE_MINUS_SRC_ALPHA","vertexShader","loadShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","attachShader","linkProgram","linked","getProgramParameter","LINK_STATUS","error","getProgramInfoLog","deleteProgram","deleteShader","shader","createShader","shaderSource","compileShader","compiled","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","convertCoords2Gl","revertY","createTexture","tex","texture","bindTexture","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","texImage2D","TEXTURE_2D","UNSIGNED_BYTE","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","LINEAR","TEXTURE_MAG_FILTER","activeTexture","drawTextureCache","vtPoint","vtTex","vtOpacity","lastChannel","record","stack","cache","channel","page","tx1","ty1","tx2","ty2","pointBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","Float32Array","STATIC_DRAW","a_position","getAttribLocation","vertexAttribPointer","FLOAT","enableVertexAttribArray","texBuffer","a_texCoords","opacityBuffer","a_opacity","u_texture","getUniformLocation","count","uniform1i","drawArrays","TRIANGLES","deleteBuffer","disableVertexAttribArray","drawBlur","frameBuffer","texCache","tex1","tex2","spread","sigma","u_direction","uniform2f","ratio","recycle","tex3","framebufferTexture2D","FRAMEBUFFER","COLOR_ATTACHMENT0","tex4","deleteTexture","drawCm","u_m","uniform1fv","drawOverflow","programOverflow","drawMask","u_texture1","u_texture2","drawMbm","W","SPF","CANVAS_LIST","WEBGL_LIST","SUPPORT_OFFSCREEN_CANVAS","OffscreenCanvas","prototype","getContext","defaultFontFamilyData","key","message","debug","document","createElement","setAttribute","body","appendChild","canvas","draw","enabled","available","release","cacheCanvas","cacheWebgl","IMG","INIT","LOADING","LOADED","FONT","COMPONENT","inject","measureText","textCache","html","lengths","chars","ff","fs","fw","inline","char","div","left","top","innerHTML","cns","childNodes","index","css","window","getComputedStyle","text","__measureCb","removeChild","measureTextSync","measureImg","url","state","success","task","Image","onload","onerror","substr","host","exec","location","hostname","crossOrigin","src","warn","console","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","id","clearTimeout","now","performance","hasCacheCanvas","getCacheCanvas","releaseCacheCanvas","delCacheCanvas","hasCacheWebgl","getCacheWebgl","releaseCacheWebgl","delCacheWebgl","isDom","Element","self","getElementsByTagName","isWebGLTexture","WebGLTexture","checkSupportFontFamily","font","checked","context","textAlign","textBaseline","clearRect","fillText","getImageData","loadFont","FontFace","load","then","loadComponent","script","async","head","getLinearDeg","getRadialPosition","center","right","bottom","getColorStop","firstColor","p","dr","dg","db","da","unshift","calLinearCoords","calCircleCentre","iw","ih","positionX","positionY","calRadialRadius","shape","size","xl","yl","asin","parseGradient","reg","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","log","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","__hasUpdate","__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","Animation","__id","nl","__options","op","config","__frameCb","__calDiffTime","iterations","framesR","originStyle","fps","spfLimit","delay","endDelay","playbackRate","isFinish","__cancelTask","__currentProps","__currentStyle","isDelay","FRAME","PLAY","playState","__hasFin","__hasCancel","playCount","currentFrames","stayBegin","stayEnd","is2","endTime","currentTime","currentFrame","round","isAlternate","alternate","isEven","isLastCount","frameTime","isLastFrame","inEndDelay","needClean","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","isDirectItem","__calMp","isVirtual","fromAbs","isShadowRoot","clearCache","__layoutData","__layoutNone","__mp","__isRealInline","__layoutFlex","__layoutInline","__layoutBlock","__sx2","__sx3","__sx4","__sx5","__sx6","__sy2","__sy3","__sy4","__sy5","__sy6","__execAr","ar","controller","autoPlay","__records2","init","list2","__records","__playAuto","h3","nowrap","fixedWidth","fixedHeight","selfEndSpace","offsetWidth","offsetHeight","matrixCache","isScale","clientHeight","x5","x6","y5","y6","__calFilter","bg","bgI","item2","kw","__bx1","__bx2","__by1","__by2","rebuild","__hasContent","isRealInline","sx4","sx5","sx6","sy4","sy5","sy6","hasContent","__calContent","__calPerspective","__calMatrix","__releaseWhenEmpty","limitCache","__calCache","perspectiveMatrix","offscreenBlend","offscreenMask","hasFilter","offscreenFilter","offscreenOverflow","borderList","hasBgi","some","svgBgSymbol","__gradient","isFirst","lastContentBox","lastLineBox","parentLineBox","countW","ix1","iy1","ix2","iy2","symbol","clearAnimate","clearFrameAnimate","__stopPropagation","__stopImmediatePropagation","willResponseEvent","hasEmitMask","ignore","inThis","__touchstartTarget","__getLg","__getRg","__getCg","lg","createLinearGradient","addColorStop","rg","createRadialGradient","ec","dc","pc","cur","onlyTotal","__cacheTotal","__cacheFilter","__cacheMask","__cacheOverflow","formatStyle","animation","cancel","enter","hostRoot","pJson","zChildren","zIndexChildren","__spreadBbox","LineBox","__list","__lineHeight","LineBoxManager","__lastX","__lastY","__maxX","__domList","__domStack","__isNewLine","__isEnd","__setLB","nextNewLine","genLineBox","verticalAlign","isNewLine","TAG_NAME","INLINE","BOLD","offsetAndResizeByNodeOnY","reflowHash","inDirectAbsList","isContainer","cs","__layoutAbs","isAbs","__resizeY","clearUniqueReflowId","__uniqueReflowId","getMergeMarginTB","topList","bottomList","genZIndexChildren","hasMc","mcHash","lastMaskIndex","__iIndex","__zIndex","__aIndex","genOrderChildren","__order","block","inlineBlock","none","tag","__flexLine","__zIndexChildren","__structure","nss","__structs","structs","needSort","__tryLayInline","firstCharWidth","main","isRow","__calMinMax","min2","max2","countMin","countMax","setNotEnd","__addMp","isFixed","isContent","fixedSize","__lineBoxManager","__preLayout","__ioSize","mergeMarginBottomList","mergeMarginTopList","isXom","isInlineBlock","isImg","reflow","__isIbFull","lastX","lastY","isNone","isEmptyBlock","tw","th","horizonAlign","__inlineSize","domList","__marginAuto","growList","shrinkList","basisList","maxList","minList","orderChildren","__calBasis","containerSize","isMultiLine","line","hypotheticalList","hypothetical","maxCrossList","__layoutFlexLine","maxCross","crossSum","crossSumList","between","around","__crossAlign","flexLine","hypotheticalSum","targetMainList","factorSum","factorList","needReset","factorSum2","lbmList","firstBaseLine","genLineBoxByInlineIfNewLine","setLbByInlineIfNotNewLine","pushContentBoxList","isIbFull","isInline2","isInlineBlock2","focusNoWrap","fw2","addX","popContentBoxList","maxCX","maxCY","minCX","minCY","maxFX","maxFY","minFX","minFY","maxOX","maxOY","minOX","minOY","absChildren","onlyRight","onlyBottom","fixedTop","fixedRight","fixedBottom","fixedLeft","needCalWidth","wl","hl","__computeMeasure","__deepScan","loadImg","__loadImg","placeholder","loading","__loadAndRefresh","showError","pts","arc","__addGeom","reload","Defs","cacheHash","__isMulti","multi","__cacheProps","strokeDasharrayStr","lineCap","lineJoin","miterLimit","getLineDash","setLineDash","preData","__preSet","fills","fillRules","strokes","strokeWidths","strokeDasharrays","strokeDasharrayStrs","strokeLinecaps","strokeLinejoins","strokeMiterlimits","__renderOnePolygon","isFillCE","isStrokeCE","isFillRE","isStrokeRE","__conicGradient","__drawPolygon","__radialEllipse","isFill","isStroke","__preSetCanvas","__propsStrokeStyle","__inversePtList","updateList","removeList","KEY_FLAG","check","checkCp","nextProps","forceCheckUpdate","shouldUpdate","shouldComponentUpdate","updateCp","oldS","oldSr","oldJson","diffSr","oj","nj","ojk","getKeyHash","njk","keyList","cpList","diffCp","diffChildren","diffChild","removeCpFromOldTree","oc","ol","of","nf","exist","ex","did","componentDidUpdate","elem","diffDefs","diffBb","diffD2D","od","nd","diffDef","removeAt","insertAt","insertAdjacentHTML","parentNode","removeAttribute","diffItem","diffD2G","replaceWith","diffT2T","diffG2D","diffG2G","diffItemSelf","diffX2X","diffByLessLv","firstChild","lastChild","obb","nbb","isText","svg","where","insertBefore","Controller","__list2","__onList","__lastTime","args","records","animate","onList","__action","__mergeAuto","__on","timestamp","__set","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","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","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","__ctx","__renderMode","vertex","fragment","vertexMask","fragmentMask","fragmentClip","fragmentOverflow","vertexCm","fragmentCm","MAX_TEXTURE_IMAGE_UNITS","__texCache","destroy","__eventCbList","__checkRoot","__checkUpdate","__checkReflow","noRender","__clear","__vd","domDiff","updateStyle","taskUp","__nextFrameCp","updater","includeIgnore","scan","path","zPath","__index__","karas","path2","zPath2","nodeConfig","rootConfig","updateHash","__updateRoot","updateRoot","hasUpdate","__updateStruct","measureHash","__uniqueUpdateId","isInherit","uniqueList","hasRoot","diffList","diffI","mergeOffsetList","__uniqueMergeOffsetId","cps","cts","isLastAbs","isNowAbs","isLastNone","isNowNone","hasFlowPrev","__modifyStruct","startIndex","startNode","oldH","nowH","lastIndex","ns","reBuild","base","reBuildC","curveNum","limitStartEnd","getNewPoint","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","__start","__end","dy2","buildCache","curve","bezierBox","concatPointAndControl","control","getLength","increase","getIndex","getNewList","prePercent","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","replaceLibraryVars","linkLibrary","JSON","linkChild","libraryItem","library","libraryId","parse","animateRecords","opt","createGm","createCp","createVd","animationRecord","singleton","fonts","loadAndParse","components","imgs","list1","list3","version","appendTo","parser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,SAAS,EAATA;EALU,CAAZ;;EAQA,IAAG,OAAO1uB,MAAP,KAAkB,WAArB,EAAkC;EAChCA,EAAAA,MAAM,CAACurD,KAAP,GAAeA,OAAf;EACD,CAFD,MAGK,IAAG,OAAO9oD,IAAP,KAAgB,WAAnB,EAAgC;EACnCA,EAAAA,IAAI,CAAC8oD,KAAL,GAAaA,OAAb;EACD;;;;;;;;"} \ No newline at end of file diff --git a/src/node/Dom.js b/src/node/Dom.js index 81b64a382..f0b273778 100644 --- a/src/node/Dom.js +++ b/src/node/Dom.js @@ -2801,7 +2801,8 @@ class Dom extends Xom { else if(height[1] === VMIN) { h2 = height[0] * Math.min(this.root.width, this.root.height) * 0.01; } - else { + // 特殊必须声明防止AUTO + else if(height[1] === PX) { h2 = height[0]; } } diff --git a/src/style/bg.js b/src/style/bg.js index 5abef2be7..f71f5e7d5 100644 --- a/src/style/bg.js +++ b/src/style/bg.js @@ -169,10 +169,10 @@ function calBackgroundPosition(position, container, size, root) { return position[0] * root.height * 0.01; } else if(position[1] === VMAX) { - res.push(position[0] * Math.max(root.width, root.height) * 0.01); + return position[0] * Math.max(root.width, root.height) * 0.01; } else if(position[1] === VMIN) { - res.push(position[0] * Math.min(root.width, root.height) * 0.01); + return position[0] * Math.min(root.width, root.height) * 0.01; } } return 0; diff --git a/test/group4/vmax-svg/index.html b/test/group4/vmax-svg/index.html new file mode 100644 index 000000000..3942a86d0 --- /dev/null +++ b/test/group4/vmax-svg/index.html @@ -0,0 +1,15 @@ + + + + + + test + + +
+
+ + + + + diff --git a/test/group4/vmax-svg/script.jsx b/test/group4/vmax-svg/script.jsx new file mode 100644 index 000000000..1cc8496f9 --- /dev/null +++ b/test/group4/vmax-svg/script.jsx @@ -0,0 +1,25 @@ +let o = karas.render( + +
ab
+ , + '#test' +); +o.on('refresh', function() { + let input = document.querySelector('#base64'); + input.value = JSON.stringify(o.virtualDom); +}); diff --git a/test/group4/vmax-svg/test.js b/test/group4/vmax-svg/test.js new file mode 100644 index 000000000..db442751a --- /dev/null +++ b/test/group4/vmax-svg/test.js @@ -0,0 +1,13 @@ +let path = require('path'); +let fs = require('fs'); + +module.exports = { + 'init': function(browser) { + browser + .url('file://' + path.join(__dirname, 'index.html')) + .waitForElementVisible('body', 1000) + .pause(20) + .assert.value('input', '{"bb":[],"children":[{"bb":[{"type":"img","tagName":"image","props":[["xlink:href","../../image.png"],["x",54],["y",54],["width",100],["height",100],["transform","matrix(0.9,0,0,0.9,5.399999999999999,5.399999999999999)"]]},{"type":"item","tagName":"path","props":[["d","M37.05441558772843,37.05441558772843C37.72954655014136,36.379284625315506 38.64522063657764,36 39.6,36L39.6,39.6L36,36M39.6,36L54,36L54,54L39.6,39.6M54,36L180,36L180,54L54,54M180,36L194.4,36L194.4,39.599999999999994L180,54M194.4,36C195.35477936342235,36 196.27045344985865,36.379284625315506 196.9455844122716,37.05441558772843L198,36L194.4,39.599999999999994"],["fill","rgba(255,0,0,1)"]]},{"type":"item","tagName":"path","props":[["d","M196.9455844122716,37.05441558772843C197.6207153746845,37.72954655014136 198,38.64522063657764 198,39.6L194.4,39.6L198,36M194.4,39.6L198,39.6L198,54L180,54M180,54L198,54L198,180L180,180M180,180L198,180L198,194.4L194.4,194.4M198,194.4C198,195.35477936342235 197.6207153746845,196.27045344985865 196.9455844122716,196.9455844122716L198,198L194.4,194.4"],["fill","rgba(255,0,0,1)"]]},{"type":"item","tagName":"path","props":[["d","M37.05441558772843,196.9455844122716C37.72954655014136,197.6207153746845 38.64522063657764,198 39.6,198L39.6,194.4L36,198M39.6,194.4L54,180L54,198L39.6,198M54,180L180,180L180,198L54,198M180,180L194.4,194.4L194.4,198L180,198M194.4,198C195.35477936342235,198 196.27045344985865,197.6207153746845 196.9455844122716,196.9455844122716L198,198L194.4,194.4"],["fill","rgba(255,0,0,1)"]]},{"type":"item","tagName":"path","props":[["d","M37.05441558772843,37.05441558772843C36.379284625315506,37.72954655014136 36,38.64522063657764 36,39.6L39.6,39.6L36,36M36,39.6L39.6,39.6L54,54L36,54M36,54L54,54L54,180L36,180M36,180L54,180L39.599999999999994,194.4L36,194.4M36,194.4C36,195.35477936342235 36.379284625315506,196.27045344985865 37.05441558772843,196.9455844122716L36,198L39.599999999999994,194.4"],["fill","rgba(255,0,0,1)"]]}],"children":[{"type":"text","children":[{"type":"item","tagName":"text","props":[["x",72],["y",128.8916015625],["fill","rgba(0,0,0,1)"],["font-family","arial"],["font-weight",400],["font-style","normal"],["font-size","36px"],["letter-spacing",18]],"content":"ab"}]}],"visibility":"visible","type":"dom"}],"visibility":"visible","type":"dom","defs":[],"lv":0}') + .end(); + } +}; From d267490763a5b2d28f5da483672502f4a32e05f8 Mon Sep 17 00:00:00 2001 From: army8735 Date: Mon, 29 Nov 2021 15:16:46 +0800 Subject: [PATCH 5/5] chore: 0.66 #194 --- csx.md | 26 +++ index.es.js | 522 ++++++++++++++++++++++++++++++++++++++++++++---- index.es.js.map | 2 +- index.js | 2 +- package.json | 2 +- 5 files changed, 513 insertions(+), 41 deletions(-) diff --git a/csx.md b/csx.md index 4f84a7ee3..34b9975f1 100755 --- a/csx.md +++ b/csx.md @@ -40,6 +40,8 @@ * rem * vw * vh + * vmax + * vmin * marginTop/marginRight/marginBottom/marginLeft * auto 默认 * px @@ -47,6 +49,8 @@ * rem * vw * vh + * vmax + * vmin * paddingTop/paddingRight/paddingBottom/paddingLeft * auto 默认 * px @@ -54,6 +58,8 @@ * rem * vw * vh + * vmax + * vmin * width/height * auto 默认 * px @@ -61,6 +67,8 @@ * rem * vw * vh + * vmax + * vmin * flexGrow * 0 默认 * number @@ -74,6 +82,8 @@ * rem * vw * vh + * vmax + * vmin * flexWrap * nowrap 默认 * wrap @@ -131,6 +141,8 @@ * rem * vw * vh + * vmax + * vmin * number * textAlign * left 默认 @@ -167,6 +179,8 @@ * rem * vw * vh + * vmax + * vmin * backgroundPositionY * 0 默认,可以是数组形式设置多个 * px @@ -174,6 +188,8 @@ * rem * vw * vh + * vmax + * vmin * contain/cover * backgroundRepeat * noRepeat 默认,可以是数组形式设置多个 @@ -186,6 +202,8 @@ * rem * vw * vh + * vmax + * vmin * contain/cover * backgroundClip * borderBox 默认 @@ -224,6 +242,8 @@ * rem * vw * vh + * vmax + * vmin * visibility * inherit 默认 * visible @@ -276,6 +296,8 @@ * rem * vw * vh + * vmax + * vmin * fill * transparent 默认,可以是数组形式设置多个 * \#rgb/rgb/rgba @@ -300,6 +322,8 @@ * rem * vw * vh + * vmax + * vmin * strokeDasharray * null 默认,可以是数组形式设置多个 * Array\ @@ -326,6 +350,8 @@ * rem * vw * vh + * vmax + * vmin * scaleX/scaleY * 1 默认 * Number[0,∞) diff --git a/index.es.js b/index.es.js index 13f8d10b1..2d63887b4 100644 --- a/index.es.js +++ b/index.es.js @@ -696,6 +696,8 @@ var o = { EM: 9, VW: 10, VH: 11, + VMAX: 12, + VMIN: 13, /** * 通用的格式化计算数值单位的方法,百分比/像素/REM/VW/auto和纯数字 @@ -723,6 +725,10 @@ var o = { return [n, o.VW]; } else if (/vh$/i.test(v)) { return [n, o.VH]; + } else if (/vmax$/i.test(v)) { + return [n, o.VMAX]; + } else if (/vmin$/i.test(v)) { + return [n, o.VMIN]; } return [n, o.NUMBER]; @@ -827,7 +833,7 @@ var o$1 = { o$1.info['宋体'] = o$1.info.simsun; var reg = { - position: /(([-+]?[\d.]+[pxremvwh%]*)|(left|top|right|bottom|center)){1,2}/ig, + position: /(([-+]?[\d.]+[pxremvwhina%]*)|(left|top|right|bottom|center)){1,2}/ig, // tfo: /((-?[\d.]+(px|%)?)|(left|top|right|bottom|center)){1,2}/ig, gradient: /\b(\w+)-?gradient\((.+)\)/i, img: /(?:\burl\((['"]?)(.*?)\1\))|(?:\b((data:)))/i @@ -2364,7 +2370,9 @@ var PX = o.PX, PERCENT = o.PERCENT, REM = o.REM, VW = o.VW, - VH = o.VH; + VH = o.VH, + VMAX = o.VMAX, + VMIN = o.VMIN; var canvasPolygon$1 = painter.canvasPolygon, svgPolygon$1 = painter.svgPolygon; var _enums$STYLE_KEY$1 = enums.STYLE_KEY, @@ -4613,6 +4621,10 @@ function calBorderRadius(w, h, currentStyle, computedStyle, root) { return Math.max(0, item[0] * root.width * 0.01); } else if (item[1] === VH) { return Math.max(0, item[0] * root.height * 0.01); + } else if (item[1] === VMAX) { + return Math.max(0, item[0] * Math.max(root.width, root.height) * 0.01); + } else if (item[1] === VMIN) { + return Math.max(0, item[0] * Math.min(root.width, root.height) * 0.01); } return 0; @@ -6507,6 +6519,8 @@ var PX$1 = o.PX, REM$1 = o.REM, VW$1 = o.VW, VH$1 = o.VH, + VMAX$1 = o.VMAX, + VMIN$1 = o.VMIN, calUnit = o.calUnit; var d2r$1 = geom.d2r; var canvasPolygon$2 = painter.canvasPolygon, @@ -6582,6 +6596,10 @@ function getColorStop(v, length, root) { list.push([item[0], p[0] * root.width / length]); } else if (p[1] === VH$1) { list.push([item[0], p[0] * root.height / length]); + } else if (p[1] === VMAX$1) { + list.push([item[0], p[0] * Math.max(root.width, root.height) / length]); + } else if (p[1] === VMIN$1) { + list.push([item[0], p[0] * Math.min(root.width, root.height) / length]); } else { list.push([item[0], p[0] / length]); } @@ -6768,6 +6786,10 @@ function calCircleCentre(position, x1, y1, iw, ih, root) { cx = x1 + positionX[0] * root.width * 0.01; } else if (positionX[1] === VH$1) { cx = x1 + positionX[0] * root.height * 0.01; + } else if (positionX[1] === VMAX$1) { + cx = x1 + positionX[0] * Math.max(root.width, root.height) * 0.01; + } else if (positionX[1] === VMIN$1) { + cx = x1 + positionX[0] * Math.min(root.width, root.height) * 0.01; } else { cx = x1 + positionX[0]; } @@ -6780,6 +6802,10 @@ function calCircleCentre(position, x1, y1, iw, ih, root) { cy = y1 + positionY[0] * root.width * 0.01; } else if (positionY[1] === VH$1) { cy = y1 + positionY[0] * root.height * 0.01; + } else if (positionY[1] === VH$1) { + cy = y1 + positionY[0] * Math.max(root.width, root.height) * 0.01; + } else if (positionY[1] === VH$1) { + cy = y1 + positionY[0] * Math.min(root.width, root.height) * 0.01; } else { cy = y1 + positionY[0]; } @@ -6987,7 +7013,7 @@ function parseGradient(s) { } } - var position = /at\s+((?:[-+]?[\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\s+((?:[-+]?[\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]); + var position = /at\s+((?:[-+]?[\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center))(?:\s+((?:[-+]?[\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]); if (position) { var x = getRadialPosition(position[1]); @@ -7005,7 +7031,7 @@ function parseGradient(s) { o.d = 0; } - var _position = /at\s+((?:[-+]?[\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\s+((?:[-+]?[\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]); + var _position = /at\s+((?:[-+]?[\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center))(?:\s+((?:[-+]?[\d.]+[pxremvwhina%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]); if (_position) { var _x = getRadialPosition(_position[1]); @@ -7018,11 +7044,11 @@ function parseGradient(s) { } } - var v = gradient[2].match(/([-+]?[\d.]+[pxremvwh%]+)?\s*((#[0-9a-f]{3,8})|(rgba?\s*\(.+?\)))\s*([-+]?[\d.]+[pxremvwh%]+)?/ig) || []; + var v = gradient[2].match(/([-+]?[\d.]+[pxremvwhina%]+)?\s*((#[0-9a-f]{3,8})|(rgba?\s*\(.+?\)))\s*([-+]?[\d.]+[pxremvwhina%]+)?/ig) || []; o.v = v.map(function (item) { var color = /((?:#[0-9a-f]{3,8})|(?:rgba?\s*\(.+?\)))/i.exec(item); var arr = [rgba2int$1(color[1])]; - var percent = /[-+]?[\d.]+[pxremvwh%]+/.exec(item); + var percent = /[-+]?[\d.]+[pxremvwhina%]+/.exec(item); if (percent) { var _v = calUnit(percent[0]); @@ -7453,7 +7479,7 @@ function parseMarginPadding(style, key, list) { var temp = style[key]; if (!isNil$2(temp)) { - var match = temp.toString().match(/([-+]?[\d.]+[pxremvwh%]*)|(auto)/ig); + var match = temp.toString().match(/([-+]?[\d.]+[pxremvwhina%]*)|(auto)/ig); if (match) { if (match.length === 1) { @@ -7483,7 +7509,7 @@ function parseOneBorder(style, k) { if (isNil$2(style[k + 'Width'])) { - var w = /\b[\d.]+[pxremvwh%]*\b/i.exec(v); + var w = /\b[\d.]+[pxremvwhina%]*\b/i.exec(v); style[k + 'Width'] = w ? w[0] : 0; } @@ -7647,7 +7673,7 @@ var abbr = { } else if (/^[\d.]+\s+[\d.]+\s+(auto|none|content)/.test(v)) { var arr = v.split(/\s+/); parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]); - } else if (/^[\d.]+\s+[\d.]+\s+[\d.]+[pxremvwh%]*/.test(v)) { + } else if (/^[\d.]+\s+[\d.]+\s+[\d.]+[pxremvwhina%]*/.test(v)) { var _arr = v.split(/\s+/); parseFlex(style, parseFloat(_arr[0]), parseFloat(_arr[1]), _arr[2]); @@ -7655,13 +7681,13 @@ var abbr = { var _arr2 = v.split(/\s+/); parseFlex(style, parseFloat(_arr2[0]), parseFloat(_arr2[1]), 0); - } else if (/^[\d.]+\s+[\d.]+[pxremvwh%]+/.test(v)) { + } else if (/^[\d.]+\s+[\d.]+[pxremvwhina%]+/.test(v)) { var _arr3 = v.split(/\s+/); parseFlex(style, parseFloat(_arr3[0]), 1, _arr3[1]); } else if (/^[\d.]+$/.test(v)) { parseFlex(style, parseFloat(v), 1, 0); - } else if (/^[\d.]+[pxremvwh%]+/i.test(v)) { + } else if (/^[\d.]+[pxremvwhina%]+/i.test(v)) { parseFlex(style, 1, 1, v); } else { parseFlex(style, 0, 1, 'auto'); @@ -7760,7 +7786,7 @@ var abbr = { } else if (/^border((Top)|(Right)|(Bottom)|(Left))$/.test(k)) { parseOneBorder(style, k); } else if (k === 'textStroke') { - var w = /(?:^|\s)([-+]?[\d.]+[pxremvwh%]*)/.exec(v); + var w = /(?:^|\s)([-+]?[\d.]+[pxremvwhina%]*)/.exec(v); if (w) { style.textStrokeWidth = w[1]; @@ -8026,6 +8052,8 @@ var AUTO = o.AUTO, REM$2 = o.REM, VW$2 = o.VW, VH$2 = o.VH, + VMAX$2 = o.VMAX, + VMIN$2 = o.VMIN, calUnit$1 = o.calUnit; var isNil$3 = util.isNil, rgba2int$2 = util.rgba2int, @@ -8284,7 +8312,7 @@ function normalize(style) { return [[0, AUTO], [0, AUTO]]; } - var match = item.toString().match(/\b(?:([-+]?[\d.]+[pxremvwh%]*)|(contain|cover|auto))/ig); + var match = item.toString().match(/\b(?:([-+]?[\d.]+[pxremvwhina%]*)|(contain|cover|auto))/ig); if (match) { if (match.length === 1) { @@ -9032,11 +9060,11 @@ function normalize(style) { if (temp !== undefined) { var bs = null; - var _match4 = (temp || '').match(/([-+]?[\d.]+[pxremvwh%]*)\s*([-+]?[\d.]+[pxremvwh%]*)\s*([-+]?[\d.]+[pxremvwh%]*\s*)?([-+]?[\d.]+[pxremvwh%]*\s*)?(((transparent)|(#[0-9a-f]{3,8})|(rgba?\(.+?\)))\s*)?(inset|outset)?\s*,?/ig); + var _match4 = (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); if (_match4) { _match4.forEach(function (item) { - var boxShadow = /([-+]?[\d.]+[pxremvwh%]*)\s*([-+]?[\d.]+[pxremvwh%]*)\s*([-+]?[\d.]+[pxremvwh%]*\s*)?([-+]?[\d.]+[pxremvwh%]*\s*)?(?:((?:transparent)|(?:#[0-9a-f]{3,8})|(?:rgba?\(.+\)))\s*)?(inset|outset)?/i.exec(item); + var 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); if (boxShadow) { bs = bs || []; @@ -9135,6 +9163,10 @@ function computeMeasure(node, isRoot) { computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : node.root.width * 0.01 * v[0]; } else if (v[1] === VH$2) { computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : node.root.height * 0.01 * v[0]; + } else if (v[1] === VMAX$2) { + computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : Math.max(node.root.width, node.root.height) * 0.01 * v[0]; + } else if (v[1] === VMIN$2) { + computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY$1[k]] : Math.min(node.root.width, node.root.height) * 0.01 * v[0]; } else { computedStyle[k] = v[0]; } @@ -9167,6 +9199,10 @@ function computeReflow(node, isHost) { computedStyle[k] = item[0] * root.width * 0.01; } else if (item[1] === VH$2) { computedStyle[k] = item[0] * root.height * 0.01; + } else if (item[1] === VMAX$2) { + computedStyle[k] = item[0] * Math.max(root.width, root.height) * 0.01; + } else if (item[1] === VMIN$2) { + computedStyle[k] = item[0] * Math.min(root.width, root.height) * 0.01; } else { computedStyle[k] = 0; } @@ -9224,6 +9260,10 @@ function computeReflow(node, isHost) { computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.width * 0.01, 0) || calNormalLineHeight(computedStyle); } else if (lineHeight[1] === VH$2) { computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.height * 0.01, 0) || calNormalLineHeight(computedStyle); + } else if (lineHeight[1] === VMAX$2) { + computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * Math.max(root.width, root.height) * 0.01, 0) || calNormalLineHeight(computedStyle); + } else if (lineHeight[1] === VMIN$2) { + computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * Math.min(root.width, root.height) * 0.01, 0) || calNormalLineHeight(computedStyle); } else if (lineHeight[1] === NUMBER$1) { computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) * fontSize || calNormalLineHeight(computedStyle); } // normal或auto @@ -9243,6 +9283,10 @@ function computeReflow(node, isHost) { computedStyle[LETTER_SPACING] = root.width * 0.01 * letterSpacing[0]; } else if (letterSpacing[1] === VH$2) { computedStyle[LETTER_SPACING] = root.height * 0.01 * letterSpacing[0]; + } else if (letterSpacing[1] === VMAX$2) { + computedStyle[LETTER_SPACING] = Math.max(root.width, root.height) * 0.01 * letterSpacing[0]; + } else if (letterSpacing[1] === VMIN$2) { + computedStyle[LETTER_SPACING] = Math.min(root.width, root.height) * 0.01 * letterSpacing[0]; } else { computedStyle[LETTER_SPACING] = letterSpacing[0]; } //whiteSpace @@ -9311,6 +9355,10 @@ function calRelativePercent(n, parent, k) { return n * style[0] * parent.root.width * 0.01; } else if (style[1] === VH$2) { return n * style[0] * parent.root.height * 0.01; + } else if (style[1] === VMAX$2) { + return n * style[0] * Math.max(parent.root.width, parent.root.height) * 0.01; + } else if (style[1] === VMIN$2) { + return n * style[0] * Math.min(parent.root.width, parent.root.height) * 0.01; } } @@ -9334,6 +9382,10 @@ function calRelative(currentStyle, k, v, parent, isWidth) { v = v[0] * parent.root.width * 0.01; } else if (v[1] === VH$2) { v = v[0] * parent.root.height * 0.01; + } else if (v[1] === VMAX$2) { + v = v[0] * Math.max(parent.root.width, parent.root.height) * 0.01; + } else if (v[1] === VMIN$2) { + v = v[0] * Math.min(parent.root.width, parent.root.height) * 0.01; } return v; @@ -9352,6 +9404,10 @@ function calAbsolute(currentStyle, k, v, size, root) { v = v[0] * root.width * 0.01; } else if (v[1] === VH$2) { v = v[0] * root.height * 0.01; + } else if (v[1] === VMAX$2) { + v = v[0] * Math.max(root.width, root.height) * 0.01; + } else if (v[1] === VMIN$2) { + v = v[0] * Math.min(root.width, root.height) * 0.01; } return v; @@ -12724,7 +12780,9 @@ var PX$3 = o.PX, PERCENT$3 = o.PERCENT, REM$3 = o.REM, VW$3 = o.VW, - VH$3 = o.VH; + VH$3 = o.VH, + VMAX$3 = o.VMAX, + VMIN$3 = o.VMIN; var matrix = math.matrix, geom$1 = math.geom; var identity$1 = matrix.identity, @@ -12907,6 +12965,10 @@ function normalizeSingle(k, v, ow, oh, root) { return v[0] * root.width * 0.01; } else if (v[1] === VH$3) { return v[0] * root.height * 0.01; + } else if (v[1] === VMAX$3) { + return v[0] * Math.max(root.width, root.height) * 0.01; + } else if (v[1] === VMIN$3) { + return v[0] * Math.min(root.width, root.height) * 0.01; } } else if (k === TRANSLATE_Y$1) { if (v[1] === PERCENT$3) { @@ -12917,6 +12979,10 @@ function normalizeSingle(k, v, ow, oh, root) { return v[0] * root.width * 0.01; } else if (v[1] === VH$3) { return v[0] * root.height * 0.01; + } else if (v[1] === VMAX$3) { + return v[0] * Math.max(root.width, root.height) * 0.01; + } else if (v[1] === VMIN$3) { + return v[0] * Math.min(root.width, root.height) * 0.01; } } else if (k === MATRIX$1) { return v; @@ -12952,6 +13018,10 @@ function calOrigin(transformOrigin, w, h, root) { tfo.push(item[0] * root.width * 0.01); } else if (item[1] === VH$3) { tfo.push(item[0] * root.height * 0.01); + } else if (item[1] === VMAX$3) { + tfo.push(item[0] * Math.max(root.width, root.height) * 0.01); + } else if (item[1] === VMIN$3) { + tfo.push(item[0] * Math.min(root.width, root.height) * 0.01); } }); return tfo; @@ -13680,7 +13750,9 @@ var ELLIPSIS = textCache.ELLIPSIS; var AUTO$1 = o.AUTO, REM$4 = o.REM, VW$4 = o.VW, - VH$4 = o.VH; + VH$4 = o.VH, + VMAX$4 = o.VMAX, + VMIN$4 = o.VMIN; var Text = /*#__PURE__*/function (_Node) { _inherits(Text, _Node); @@ -14587,6 +14659,10 @@ var Text = /*#__PURE__*/function (_Node) { half = Math.max(textStrokeWidth[0] * root.width * 0.01 * 0.5, half); } else if (textStrokeWidth[1] === VH$4) { half = Math.max(textStrokeWidth[0] * root.height * 0.01 * 0.5, half); + } else if (textStrokeWidth[1] === VMAX$4) { + half = Math.max(textStrokeWidth[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else if (textStrokeWidth[1] === VMIN$4) { + half = Math.max(textStrokeWidth[0] * Math.min(root.width, root.height) * 0.01 * 0.5, half); } else { half = Math.max(textStrokeWidth[0] * 0.5, half); } @@ -15481,7 +15557,9 @@ var AUTO$2 = o.AUTO, STRING$1 = o.STRING, REM$5 = o.REM, VW$5 = o.VW, - VH$5 = o.VH; + VH$5 = o.VH, + VMAX$5 = o.VMAX, + VMIN$5 = o.VMIN; function renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bbrr, bblr) { var method = arguments.length > 13 && arguments[13] !== undefined ? arguments[13] : 'fill'; @@ -15593,6 +15671,10 @@ function calBackgroundSize(value, w, h, root) { res.push(item[0] * root.width * 0.01); } else if (item[1] === VH$5) { res.push(item[0] * root.height * 0.01); + } else if (item[1] === VMAX$5) { + res.push(item[0] * Math.max(root.width, root.height) * 0.01); + } else if (item[1] === VMIN$5) { + res.push(item[0] * Math.min(root.width, root.height) * 0.01); } else if (item[1] === AUTO$2) { res.push(-1); } else if (item[1] === STRING$1) { @@ -15614,6 +15696,10 @@ function calBackgroundPosition(position, container, size, root) { return position[0] * root.width * 0.01; } else if (position[1] === VH$5) { return position[0] * root.height * 0.01; + } else if (position[1] === VMAX$5) { + return position[0] * Math.max(root.width, root.height) * 0.01; + } else if (position[1] === VMIN$5) { + return position[0] * Math.min(root.width, root.height) * 0.01; } } @@ -16406,6 +16492,8 @@ var AUTO$3 = o.AUTO, REM$6 = o.REM, VW$6 = o.VW, VH$6 = o.VH, + VMAX$6 = o.VMAX, + VMIN$6 = o.VMIN, calUnit$2 = o.calUnit; var isNil$5 = util.isNil, isFunction$4 = util.isFunction, @@ -16579,6 +16667,10 @@ function calByUnit(p, n, container, root) { return n[0] * root.width * 0.01 - p[0]; } else if (n[1] === VH$6) { return n[0] * root.height * 0.01 - p[0]; + } else if (n[1] === VMAX$6) { + return n[0] * Math.max(root.width, root.height) * 0.01 - p[0]; + } else if (n[1] === VMIN$6) { + return n[0] * Math.min(root.width, root.height) * 0.01 - p[0]; } } else if (p[1] === PERCENT$6) { if (n[1] === PX$5) { @@ -16589,6 +16681,10 @@ function calByUnit(p, n, container, root) { return n[0] * root.width / container - p[0]; } else if (n[1] === VH$6) { return n[0] * root.height / container - p[0]; + } else if (n[1] === VMAX$6) { + return n[0] * Math.max(root.width, root.height) / container - p[0]; + } else if (n[1] === VMIN$6) { + return n[0] * Math.min(root.width, root.height) / container - p[0]; } } else if (p[1] === REM$6) { if (n[1] === PX$5) { @@ -16599,6 +16695,10 @@ function calByUnit(p, n, container, root) { return n[0] * root.width * 0.01 / root.computedStyle[FONT_SIZE$7] - p[0]; } else if (n[1] === VH$6) { return n[0] * root.height * 0.01 / root.computedStyle[FONT_SIZE$7] - p[0]; + } else if (n[1] === VMAX$6) { + return n[0] * Math.max(root.width, root.height) * 0.01 / root.computedStyle[FONT_SIZE$7] - p[0]; + } else if (n[1] === VMIN$6) { + return n[0] * Math.min(root.width, root.height) * 0.01 / root.computedStyle[FONT_SIZE$7] - p[0]; } } else if (p[1] === VW$6) { if (n[1] === PX$5) { @@ -16609,6 +16709,10 @@ function calByUnit(p, n, container, root) { return n[0] * container / root.width - p[0]; } else if (n[1] === VH$6) { return n[0] * root.height / root.width - p[0]; + } else if (n[1] === VMAX$6) { + return n[0] * Math.max(root.width, root.height) / root.width - p[0]; + } else if (n[1] === VMIN$6) { + return n[0] * Math.min(root.width, root.height) / root.width - p[0]; } } else if (p[1] === VH$6) { if (n[1] === PX$5) { @@ -16619,6 +16723,38 @@ function calByUnit(p, n, container, root) { return n[0] * root.width / root.height - p[0]; } else if (n[1] === PERCENT$6) { return n[0] * container / root.height - p[0]; + } else if (n[1] === VMAX$6) { + return n[0] * Math.max(root.width, root.height) / root.height - p[0]; + } else if (n[1] === VMIN$6) { + return n[0] * Math.min(root.width, root.height) / root.height - p[0]; + } + } else if (p[1] === VMAX$6) { + if (n[1] === PX$5) { + return n[0] * 100 / Math.max(root.width, root.height) - p[0]; + } else if (n[1] === REM$6) { + return n[0] * 100 * root.computedStyle[FONT_SIZE$7] / Math.max(root.width, root.height) - p[0]; + } else if (n[1] === PERCENT$6) { + return n[0] * container / Math.max(root.width, root.height) - p[0]; + } else if (n[1] === VW$6) { + return n[0] * root.width / Math.max(root.width, root.height) - p[0]; + } else if (n[1] === VH$6) { + return n[0] * root.height / Math.max(root.width, root.height) - p[0]; + } else if (n[1] === VMIN$6) { + return n[0] * Math.min(root.width, root.height) / Math.max(root.width, root.height) - p[0]; + } + } else if (p[1] === VMIN$6) { + if (n[1] === PX$5) { + return n[0] * 100 / Math.min(root.width, root.height) - p[0]; + } else if (n[1] === REM$6) { + return n[0] * 100 * root.computedStyle[FONT_SIZE$7] / Math.min(root.width, root.height) - p[0]; + } else if (n[1] === PERCENT$6) { + return n[0] * container / Math.min(root.width, root.height) - p[0]; + } else if (n[1] === VW$6) { + return n[0] * root.width / Math.min(root.width, root.height) - p[0]; + } else if (n[1] === VH$6) { + return n[0] * root.height / Math.min(root.width, root.height) - p[0]; + } else if (n[1] === VMAX$6) { + return n[0] * Math.max(root.width, root.height) / Math.min(root.width, root.height) - p[0]; } } } @@ -16694,7 +16830,7 @@ function calDiff(prev, next, k, target, tagName) { } var v = {}, - hasChange; // 只有blur支持px/rem/vw/vh,其余都是特殊固定单位 + hasChange; // 只有blur支持px/rem/vw/vh/vmax/vmin,其余都是特殊固定单位 Object.keys(keyHash).forEach(function (k) { if (k === 'blur') { @@ -17299,6 +17435,10 @@ function calDiff(prev, next, k, target, tagName) { return [(parseFloat(v) || 0) * 0.01 * root.width, PX$5]; } else if (u === VH$6) { return [(parseFloat(v) || 0) * 0.01 * root.height, PX$5]; + } else if (u === VMAX$6) { + return [(parseFloat(v) || 0) * 0.01 * Math.max(root.width, root.height), PX$5]; + } else if (u === VMIN$6) { + return [(parseFloat(v) || 0) * 0.01 * Math.min(root.width, root.height), PX$5]; } else { return [parseFloat(v) || 0, PX$5]; } @@ -19739,6 +19879,8 @@ var AUTO$4 = o.AUTO, REM$7 = o.REM, VW$7 = o.VW, VH$7 = o.VH, + VMAX$7 = o.VMAX, + VMIN$7 = o.VMIN, DEG$2 = o.DEG; var int2rgba$2 = util.int2rgba, rgba2int$3 = util.rgba2int, @@ -19908,6 +20050,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { return mp[0] * this.root.width * 0.01; } else if (mp[1] === VH$7) { return mp[0] * this.root.height * 0.01; + } else if (mp[1] === VMAX$7) { + return mp[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (mp[1] === VMIN$7) { + return mp[0] * Math.min(this.root.width, this.root.height) * 0.01; } return 0; @@ -19942,6 +20088,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { n += v[0] * this.root.width * 0.01; } else if (v[1] === VH$7) { n += v[0] * this.root.height * 0.01; + } else if (v[1] === VMAX$7) { + n += v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (v[1] === VMIN$7) { + n += v[0] * Math.min(this.root.width, this.root.height) * 0.01; } return n; @@ -19974,6 +20124,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { 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) { @@ -19984,6 +20138,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { 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; } res = res.map(function (item) { @@ -20000,6 +20158,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { _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) { @@ -20010,6 +20172,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { _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; } res = res.map(function (item) { @@ -20108,6 +20274,14 @@ var Xom$1 = /*#__PURE__*/function (_Node) { case VH$7: w = width[0] * this.root.height * 0.01; break; + + case VMAX$7: + w = width[0] * Math.max(this.root.width, this.root.height) * 0.01; + break; + + case VMIN$7: + w = width[0] * Math.min(this.root.width, this.root.height) * 0.01; + break; } } } @@ -20301,6 +20475,14 @@ var Xom$1 = /*#__PURE__*/function (_Node) { case VH$7: w = width[0] * this.root.height * 0.01; break; + + case VMAX$7: + w = width[0] * Math.max(this.root.width, this.root.height) * 0.01; + break; + + case VMIN$7: + w = width[0] * Math.min(this.root.width, this.root.height) * 0.01; + break; } } @@ -20333,6 +20515,14 @@ var Xom$1 = /*#__PURE__*/function (_Node) { case VH$7: h = height[0] * this.root.height * 0.01; break; + + case VMAX$7: + h = height[0] * Math.max(this.root.width, this.root.height) * 0.01; + break; + + case VMIN$7: + h = height[0] * Math.min(this.root.width, this.root.height) * 0.01; + break; } } // margin/padding/border影响x和y和尺寸,注意inline的y不受mpb影响 @@ -20426,6 +20616,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { v = v[0] * this.root.width * 0.01; } else if (v[1] === VH$7) { v = v[0] * this.root.height * 0.01; + } else if (v[1] === VMAX$7) { + v = v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (v[1] === VMIN$7) { + v = v[0] * Math.min(this.root.width, this.root.height) * 0.01; } else { v = v[0]; } @@ -20449,6 +20643,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { _v = _v[0] * this.root.width * 0.01; } else if (_v[1] === VH$7) { _v = _v[0] * this.root.height * 0.01; + } else if (_v[1] === VMAX$7) { + _v = _v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (_v[1] === VMIN$7) { + _v = _v[0] * Math.min(this.root.width, this.root.height) * 0.01; } else { _v = _v[0]; } @@ -20472,6 +20670,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { _v2 = _v2[0] * this.root.width * 0.01; } else if (_v2[1] === VH$7) { _v2 = _v2[0] * this.root.height * 0.01; + } else if (_v2[1] === VMAX$7) { + _v2 = _v2[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (_v2[1] === VMIN$7) { + _v2 = _v2[0] * Math.min(this.root.width, this.root.height) * 0.01; } else { _v2 = _v2[0]; } @@ -20560,6 +20762,18 @@ var Xom$1 = /*#__PURE__*/function (_Node) { } else if (k === TRANSLATE_Y$4) { computedStyle[k] = v[0] * _this3.root.height * 0.01; } + } else if (v[1] === VMAX$7) { + if (k === TRANSLATE_X$4 || k === TRANSLATE_Z$4) { + computedStyle[k] = v[0] * Math.max(_this3.root.width, _this3.root.height) * 0.01; + } else if (k === TRANSLATE_Y$4) { + computedStyle[k] = v[0] * Math.max(_this3.root.width, _this3.root.height) * 0.01; + } + } else if (v[1] === VMIN$7) { + if (k === TRANSLATE_X$4 || k === TRANSLATE_Z$4) { + computedStyle[k] = v[0] * Math.min(_this3.root.width, _this3.root.height) * 0.01; + } else if (k === TRANSLATE_Y$4) { + computedStyle[k] = v[0] * Math.min(_this3.root.width, _this3.root.height) * 0.01; + } } temp.push([k, v]); @@ -20680,6 +20894,14 @@ var Xom$1 = /*#__PURE__*/function (_Node) { return item[0] * _this4.root.height * 0.01; } + if (item[1] === VMAX$7) { + return item[0] * Math.max(_this4.root.width, _this4.root.height) * 0.01; + } + + if (item[1] === VMIN$7) { + return item[0] * Math.min(_this4.root.width, _this4.root.height) * 0.01; + } + if (item[1] === PERCENT$7) { return item[0] + '%'; } @@ -20706,6 +20928,14 @@ var Xom$1 = /*#__PURE__*/function (_Node) { return item[0] * _this4.root.height * 0.01; } + if (item[1] === VMAX$7) { + return item[0] * Math.max(_this4.root.width, _this4.root.height) * 0.01; + } + + if (item[1] === VMIN$7) { + return item[0] * Math.min(_this4.root.width, _this4.root.height) * 0.01; + } + if (item[1] === PERCENT$7) { return item[0] + '%'; } @@ -20799,6 +21029,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { v = v * _this4.root.width * 0.01; } else if (item2[1] === VH$7) { v = v * _this4.root.height * 0.01; + } else if (item2[1] === VMAX$7) { + v = v * Math.max(_this4.root.width, _this4.root.height) * 0.01; + } else if (item2[1] === VMIN$7) { + v = v * Math.min(_this4.root.width, _this4.root.height) * 0.01; } return v; @@ -20933,6 +21167,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { v = v[0] * this.root.width * 0.01; } else if (v[1] === VH$7) { v = v[0] * this.root.height * 0.01; + } else if (v[1] === VMAX$7) { + v = v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (v[1] === VMIN$7) { + v = v[0] * Math.min(this.root.width, this.root.height) * 0.01; } else { v = v[0]; } @@ -20985,6 +21223,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { ppt = v[0] * this.root.width * 0.01; } else if (v[1] === VH$7) { ppt = v[0] * this.root.height * 0.01; + } else if (v[1] === VMAX$7) { + ppt = v[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (v[1] === VMIN$7) { + ppt = v[0] * Math.min(this.root.width, this.root.height) * 0.01; } else { ppt = v[0]; } @@ -21029,6 +21271,10 @@ var Xom$1 = /*#__PURE__*/function (_Node) { v = v[0] * _this5.root.width * 0.01; } else if (v[1] === VH$7) { v = v[0] * _this5.root.height * 0.01; + } else if (v[1] === VMAX$7) { + v = v[0] * Math.max(_this5.root.width, _this5.root.height) * 0.01; + } else if (v[1] === VMIN$7) { + v = v[0] * Math.min(_this5.root.width, _this5.root.height) * 0.01; } return [k, v]; @@ -23664,7 +23910,9 @@ var AUTO$6 = o.AUTO, PERCENT$9 = o.PERCENT, REM$8 = o.REM, VW$8 = o.VW, - VH$8 = o.VH; + VH$8 = o.VH, + VMAX$8 = o.VMAX, + VMIN$8 = o.VMIN; var calAbsolute$1 = css.calAbsolute, isRelativeOrAbsolute$1 = css.isRelativeOrAbsolute; @@ -23982,6 +24230,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { w -= width[0] * this.root.width * 0.01; } else if (width[1] === VH$8) { w -= width[0] * this.root.height * 0.01; + } else if (width[1] === VMAX$8) { + w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (width[1] === VMIN$8) { + w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01; } else { for (var i = 0; i < flowChildren.length; i++) { // 当放不下时直接返回,无需继续多余的尝试计算 @@ -24015,6 +24267,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { w -= marginRight[0] * this.root.width * 0.01; } else if (marginRight[1] === VH$8) { w -= marginRight[0] * this.root.height * 0.01; + } else if (marginRight[1] === VMAX$8) { + w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (marginRight[1] === VMIN$8) { + w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (paddingRight[1] === PX$8) { @@ -24027,6 +24283,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { w -= paddingRight[0] * this.root.width * 0.01; } else if (paddingRight[1] === VH$8) { w -= paddingRight[0] * this.root.height * 0.01; + } else if (paddingRight[1] === VMAX$8) { + w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (paddingRight[1] === VMIN$8) { + w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (borderRightWidth[1] === PX$8) { @@ -24037,6 +24297,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { w -= borderRightWidth[0] * this.root.width * 0.01; } else if (borderRightWidth[1] === VH$8) { w -= borderRightWidth[0] * this.root.height * 0.01; + } else if (borderRightWidth[1] === VMAX$8) { + w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (borderRightWidth[1] === VMIN$8) { + w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; } } // 还要减去开头的mpb @@ -24051,6 +24315,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { w -= marginLeft[0] * this.root.width * 0.01; } else if (marginLeft[1] === VH$8) { w -= marginLeft[0] * this.root.height * 0.01; + } else if (marginLeft[1] === VMAX$8) { + w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (marginLeft[1] === VMIN$8) { + w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (paddingLeft[1] === PX$8) { @@ -24063,6 +24331,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { w -= paddingLeft[0] * this.root.width * 0.01; } else if (paddingLeft[1] === VH$8) { w -= paddingLeft[0] * this.root.height * 0.01; + } else if (paddingLeft[1] === VMAX$8) { + w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (paddingLeft[1] === VMIN$8) { + w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (borderLeftWidth[1] === PX$8) { @@ -24073,6 +24345,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { w -= borderLeftWidth[0] * this.root.width * 0.01; } else if (borderLeftWidth[1] === VH$8) { w -= borderLeftWidth[0] * this.root.height * 0.01; + } else if (borderLeftWidth[1] === VMAX$8) { + w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (borderLeftWidth[1] === VMIN$8) { + w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; } return w; @@ -24140,6 +24416,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { min = max = main[0] * this.root.width * 0.01; } else if (main[1] === VH$8) { min = max = main[0] * this.root.height * 0.01; + } else if (main[1] === VMAX$8) { + min = max = main[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (main[1] === VMIN$8) { + min = max = main[0] * Math.min(this.root.width, this.root.height) * 0.01; } else { if (display === 'flex') { var isRow = flexDirection !== 'column'; @@ -24381,7 +24661,7 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { var main = isDirectionRow ? width : height; // basis3种情况:auto、固定、content var isAuto = flexBasis[1] === AUTO$6; - var isFixed = [PX$8, PERCENT$9, REM$8, VW$8, VH$8].indexOf(flexBasis[1]) > -1; + var isFixed = [PX$8, PERCENT$9, REM$8, VW$8, VH$8, VMAX$8, VMIN$8].indexOf(flexBasis[1]) > -1; var isContent = !isAuto && !isFixed; var fixedSize; // flex的item固定basis计算 @@ -24396,9 +24676,13 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { b = fixedSize = flexBasis[0] * this.root.width * 0.01; } else if (flexBasis[1] === VH$8) { b = fixedSize = flexBasis[0] * this.root.height * 0.01; + } else if (flexBasis[1] === VMAX$8) { + b = fixedSize = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (flexBasis[1] === VMIN$8) { + b = fixedSize = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01; } } // 已声明主轴尺寸的,当basis是auto时为值 - else if ([PX$8, PERCENT$9, REM$8, VW$8, VH$8].indexOf(main[1]) > -1 && isAuto) { + else if ([PX$8, PERCENT$9, REM$8, VW$8, VH$8, VMAX$8, VMIN$8].indexOf(main[1]) > -1 && isAuto) { if (main[1] === PX$8) { b = fixedSize = main[0]; } else if (main[1] === PERCENT$9) { @@ -24409,6 +24693,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { b = fixedSize = main[0] * this.root.width * 0.01; } else if (main[1] === VH$8) { b = fixedSize = main[0] * this.root.height * 0.01; + } else if (main[1] === VMAX$8) { + b = fixedSize = main[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (main[1] === VMIN$8) { + b = fixedSize = main[0] * Math.min(this.root.width, this.root.height) * 0.01; } } // 非固定尺寸的basis为auto时降级为content else if (isAuto) { @@ -26422,6 +26710,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { w2 = width[0] * _this4.root.width * 0.01; } else if (width[1] === VH$8) { w2 = width[0] * _this4.root.height * 0.01; + } else if (width[1] === VMAX$8) { + w2 = width[0] * Math.max(_this4.root.width, _this4.root.height) * 0.01; + } else if (width[1] === VMIN$8) { + w2 = width[0] * Math.min(_this4.root.width, _this4.root.height) * 0.01; } else { w2 = width[0]; } @@ -26436,6 +26728,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { w2 = width[0] * _this4.root.width * 0.01; } else if (width[1] === VH$8) { w2 = width[0] * _this4.root.height * 0.01; + } else if (width[1] === VMAX$8) { + w2 = width[0] * Math.max(_this4.root.width, _this4.root.height) * 0.01; + } else if (width[1] === VMIN$8) { + w2 = width[0] * Math.min(_this4.root.width, _this4.root.height) * 0.01; } else { w2 = width[0]; } @@ -26463,6 +26759,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { w2 = width[0] * _this4.root.width * 0.01; } else if (width[1] === VH$8) { w2 = width[0] * _this4.root.height * 0.01; + } else if (width[1] === VMAX$8) { + w2 = width[0] * Math.max(_this4.root.width, _this4.root.height) * 0.01; + } else if (width[1] === VMIN$8) { + w2 = width[0] * Math.min(_this4.root.width, _this4.root.height) * 0.01; } else { w2 = width[0]; } @@ -26485,6 +26785,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { h2 = height[0] * _this4.root.width * 0.01; } else if (height[1] === VH$8) { h2 = height[0] * _this4.root.height * 0.01; + } else if (height[1] === VMAX$8) { + h2 = height[0] * Math.max(_this4.root.width, _this4.root.height) * 0.01; + } else if (height[1] === VMIN$8) { + h2 = height[0] * Math.min(_this4.root.width, _this4.root.height) * 0.01; } else { h2 = height[0]; } @@ -26499,6 +26803,10 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { h2 = height[0] * _this4.root.width * 0.01; } else if (height[1] === VH$8) { h2 = height[0] * _this4.root.height * 0.01; + } else if (height[1] === VMAX$8) { + h2 = height[0] * Math.max(_this4.root.width, _this4.root.height) * 0.01; + } else if (height[1] === VMIN$8) { + h2 = height[0] * Math.min(_this4.root.width, _this4.root.height) * 0.01; } else { h2 = height[0]; } @@ -26537,9 +26845,14 @@ var Dom$1 = /*#__PURE__*/function (_Xom) { h2 = height[0] * _this4.root.width * 0.01; } else if (height[1] === VH$8) { h2 = height[0] * _this4.root.height * 0.01; - } else if (height[1] === PX$8) { - h2 = height[0]; - } + } else if (height[1] === VMAX$8) { + h2 = height[0] * Math.max(_this4.root.width, _this4.root.height) * 0.01; + } else if (height[1] === VMIN$8) { + h2 = height[0] * Math.min(_this4.root.width, _this4.root.height) * 0.01; + } // 特殊必须声明防止AUTO + else if (height[1] === PX$8) { + h2 = height[0]; + } } // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局 @@ -27160,6 +27473,8 @@ var AUTO$7 = o.AUTO, REM$9 = o.REM, VW$9 = o.VW, VH$9 = o.VH, + VMAX$9 = o.VMAX, + VMIN$9 = o.VMIN, RGBA$2 = o.RGBA; var canvasPolygon$5 = painter.canvasPolygon, svgPolygon$6 = painter.svgPolygon; @@ -27553,6 +27868,10 @@ var Img$1 = /*#__PURE__*/function (_Dom) { w -= width[0] * this.root.width * 0.01; } else if (width[1] === VH$9) { w -= width[0] * this.root.height * 0.01; + } else if (width[1] === VMAX$9) { + w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (width[1] === VMIN$9) { + w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01; } else { var loadImg = this.__loadImg; // 加载成功计算缩放后的宽度 @@ -27567,6 +27886,10 @@ var Img$1 = /*#__PURE__*/function (_Dom) { w -= loadImg.width * height[0] * this.root.width * 0.01 / loadImg.height; } else if (height[1] === VH$9) { w -= loadImg.width * height[0] * this.root.height * 0.01 / loadImg.height; + } else if (height[1] === VMAX$9) { + w -= height[0] * Math.max(this.root.width, this.root.height) * 0.01 / loadImg.height; + } else if (height[1] === VMIN$9) { + w -= height[0] * Math.min(this.root.width, this.root.height) * 0.01 / loadImg.height; } else { w -= loadImg.width; } @@ -27584,6 +27907,10 @@ var Img$1 = /*#__PURE__*/function (_Dom) { w -= marginLeft[0] * this.root.width * 0.01; } else if (marginLeft[1] === VH$9) { w -= marginLeft[0] * this.root.height * 0.01; + } else if (marginLeft[1] === VMAX$9) { + w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (marginLeft[1] === VMIN$9) { + w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (paddingLeft[1] === PX$9) { @@ -27596,6 +27923,10 @@ var Img$1 = /*#__PURE__*/function (_Dom) { w -= paddingLeft[0] * this.root.width * 0.01; } else if (paddingLeft[1] === VH$9) { w -= paddingLeft[0] * this.root.height * 0.01; + } else if (paddingLeft[1] === VMAX$9) { + w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (paddingLeft[1] === VMIN$9) { + w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (borderLeftWidth[1] === PX$9) { @@ -27606,6 +27937,10 @@ var Img$1 = /*#__PURE__*/function (_Dom) { w -= borderLeftWidth[0] * this.root.width * 0.01; } else if (borderLeftWidth[1] === VH$9) { w -= borderLeftWidth[0] * this.root.height * 0.01; + } else if (borderLeftWidth[1] === VMAX$9) { + w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (borderLeftWidth[1] === VMIN$9) { + w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (marginRight[1] === PX$9) { @@ -27618,6 +27953,10 @@ var Img$1 = /*#__PURE__*/function (_Dom) { w -= marginRight[0] * this.root.width * 0.01; } else if (marginRight[1] === VH$9) { w -= marginRight[0] * this.root.height * 0.01; + } else if (marginRight[1] === VMAX$9) { + w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (marginRight[1] === VMIN$9) { + w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (paddingRight[1] === PX$9) { @@ -27630,6 +27969,10 @@ var Img$1 = /*#__PURE__*/function (_Dom) { w -= paddingRight[0] * this.root.width * 0.01; } else if (paddingRight[1] === VH$9) { w -= paddingRight[0] * this.root.height * 0.01; + } else if (paddingRight[1] === VMAX$9) { + w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (paddingRight[1] === VMIN$9) { + w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (borderRightWidth[1] === PX$9) { @@ -27640,6 +27983,10 @@ var Img$1 = /*#__PURE__*/function (_Dom) { w -= borderRightWidth[0] * this.root.width * 0.01; } else if (borderRightWidth[1] === VH$9) { w -= borderRightWidth[0] * this.root.height * 0.01; + } else if (borderRightWidth[1] === VMAX$9) { + w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (borderRightWidth[1] === VMIN$9) { + w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; } return w; @@ -27673,7 +28020,7 @@ var Img$1 = /*#__PURE__*/function (_Dom) { var main = isDirectionRow ? width : height; var cross = isDirectionRow ? height : width; // basis3种情况:auto、固定、content,只区分固定和其它 - var isFixed = [PX$9, PERCENT$a, REM$9, VW$9, VH$9].indexOf(flexBasis[1]) > -1; + var isFixed = [PX$9, PERCENT$a, REM$9, VW$9, VH$9, VMAX$9, VMIN$9].indexOf(flexBasis[1]) > -1; if (isFixed) { if (flexBasis[1] === PX$9) { @@ -27686,8 +28033,12 @@ var Img$1 = /*#__PURE__*/function (_Dom) { b = max = min = flexBasis[0] * this.root.width * 0.01; } else if (flexBasis[1] === VH$9) { b = max = min = flexBasis[0] * this.root.height * 0.01; + } else if (flexBasis[1] === VMAX$9) { + b = max = min = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (flexBasis[1] === VMIN$9) { + b = max = min = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01; } - } else if ([PX$9, PERCENT$a, REM$9, VW$9, VH$9].indexOf(main[1]) > -1) { + } else if ([PX$9, PERCENT$a, REM$9, VW$9, VH$9, VMAX$9, VMIN$9].indexOf(main[1]) > -1) { if (main[1] === PX$9) { b = max = min = main[0]; } else if (main[1] === PERCENT$a) { @@ -27698,6 +28049,10 @@ var Img$1 = /*#__PURE__*/function (_Dom) { b = max = min = main[0] * this.root.width * 0.01; } else if (main[1] === VH$9) { b = max = min = main[0] * this.root.height * 0.01; + } else if (main[1] === VMAX$9) { + b = max = min = main[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (main[1] === VMIN$9) { + b = max = min = main[0] * Math.min(this.root.width, this.root.height) * 0.01; } } // auto和content固定尺寸比例计算 else if (__loadImg.source || __loadImg.error) { @@ -27712,6 +28067,10 @@ var Img$1 = /*#__PURE__*/function (_Dom) { cross = cross[0] * this.root.width * 0.01; } else if (cross[1] === VH$9) { cross = cross[0] * this.root.height * 0.01; + } else if (cross[1] === VMAX$9) { + cross = cross[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (cross[1] === VMIN$9) { + cross = cross[0] * Math.min(this.root.width, this.root.height) * 0.01; } var ratio = __loadImg.width / __loadImg.height; @@ -28036,7 +28395,9 @@ var PX$a = o.PX, PERCENT$b = o.PERCENT, REM$a = o.REM, VW$a = o.VW, - VH$a = o.VH; + VH$a = o.VH, + VMAX$a = o.VMAX, + VMIN$a = o.VMIN; var int2rgba$3 = util.int2rgba, isNil$7 = util.isNil, joinArr$3 = util.joinArr; @@ -28090,6 +28451,10 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { w -= width[0] * this.root.width * 0.01; } else if (width[1] === VH$a) { w -= width[0] * this.root.height * 0.01; + } else if (width[1] === VMAX$a) { + w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (width[1] === VMIN$a) { + w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01; } // 减去水平mbp @@ -28103,6 +28468,10 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { w -= marginLeft[0] * this.root.width * 0.01; } else if (marginLeft[1] === VH$a) { w -= marginLeft[0] * this.root.height * 0.01; + } else if (marginLeft[1] === VMAX$a) { + w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (marginLeft[1] === VMIN$a) { + w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (paddingLeft[1] === PX$a) { @@ -28115,6 +28484,10 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { w -= paddingLeft[0] * this.root.width * 0.01; } else if (paddingLeft[1] === VH$a) { w -= paddingLeft[0] * this.root.height * 0.01; + } else if (paddingLeft[1] === VMAX$a) { + w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (paddingLeft[1] === VMIN$a) { + w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (borderLeftWidth[1] === PX$a) { @@ -28125,6 +28498,10 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { w -= borderLeftWidth[0] * this.root.width * 0.01; } else if (borderLeftWidth[1] === VH$a) { w -= borderLeftWidth[0] * this.root.height * 0.01; + } else if (borderLeftWidth[1] === VMAX$a) { + w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (borderLeftWidth[1] === VMIN$a) { + w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (marginRight[1] === PX$a) { @@ -28137,6 +28514,10 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { w -= marginRight[0] * this.root.width * 0.01; } else if (marginRight[1] === VH$a) { w -= marginRight[0] * this.root.height * 0.01; + } else if (marginRight[1] === VMAX$a) { + w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (marginRight[1] === VMIN$a) { + w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (paddingRight[1] === PX$a) { @@ -28149,6 +28530,10 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { w -= paddingRight[0] * this.root.width * 0.01; } else if (paddingRight[1] === VH$a) { w -= paddingRight[0] * this.root.height * 0.01; + } else if (paddingRight[1] === VMAX$a) { + w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (paddingRight[1] === VMIN$a) { + w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01; } if (borderRightWidth[1] === PX$a) { @@ -28159,6 +28544,10 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { w -= borderRightWidth[0] * this.root.width * 0.01; } else if (borderRightWidth[1] === VH$a) { w -= borderRightWidth[0] * this.root.height * 0.01; + } else if (borderRightWidth[1] === VMAX$a) { + w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (borderRightWidth[1] === VMIN$a) { + w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01; } return w; @@ -28184,6 +28573,10 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { min = max = main[0] * this.root.width * 0.01; } else if (main[1] === VH$a) { min = max = main[0] * this.root.height * 0.01; + } else if (main[1] === VMAX$a) { + min = max = main[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (main[1] === VMIN$a) { + min = max = main[0] * Math.min(this.root.width, this.root.height) * 0.01; } return [display, this.__addMp(isDirectionRow, data.w, currentStyle, [min, max])]; @@ -28215,7 +28608,7 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { borderLeftWidth = currentStyle[BORDER_LEFT_WIDTH$7]; var main = isDirectionRow ? width : height; // basis3种情况:auto、固定、content,只区分固定和其它 - var isFixed = [PX$a, PERCENT$b, REM$a, VW$a, VH$a].indexOf(flexBasis[1]) > -1; + var isFixed = [PX$a, PERCENT$b, REM$a, VW$a, VH$a, VMAX$a, VMIN$a].indexOf(flexBasis[1]) > -1; if (isFixed) { if (flexBasis[1] === PX$a) { @@ -28228,8 +28621,12 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { b = max = min = flexBasis[0] * this.root.width * 0.01; } else if (flexBasis[1] === VH$a) { b = max = min = flexBasis[0] * this.root.height * 0.01; + } else if (flexBasis[1] === VMAX$a) { + b = max = min = flexBasis[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (flexBasis[1] === VMIN$a) { + b = max = min = flexBasis[0] * Math.min(this.root.width, this.root.height) * 0.01; } - } else if ([PX$a, PERCENT$b, REM$a, VW$a, VH$a].indexOf(main[1]) > -1) { + } else if ([PX$a, PERCENT$b, REM$a, VW$a, VH$a, VMAX$a, VMIN$a].indexOf(main[1]) > -1) { if (main[1] === PX$a) { b = max = min = main[0]; } else if (main[1] === PERCENT$b) { @@ -28240,6 +28637,10 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { b = max = min = main[0] * this.root.width * 0.01; } else if (main[1] === VH$a) { b = max = min = main[0] * this.root.height * 0.01; + } else if (main[1] === VMAX$a) { + b = max = min = main[0] * Math.max(this.root.width, this.root.height) * 0.01; + } else if (main[1] === VMIN$a) { + b = max = min = main[0] * Math.min(this.root.width, this.root.height) * 0.01; } } // border也得计算在内 @@ -28333,6 +28734,10 @@ var Geom$1 = /*#__PURE__*/function (_Xom) { return item[0] * _this2.root.width * 0.01; } else if (item[1] === VH$a) { return item[0] * _this2.root.height * 0.01; + } else if (item[1] === VMAX$a) { + return item[0] * Math.max(_this2.root.width, _this2.root.height) * 0.01; + } else if (item[1] === VMIN$a) { + return item[0] * Math.min(_this2.root.width, _this2.root.height) * 0.01; } else { return 0; } @@ -36321,7 +36726,9 @@ var _enums$STYLE_KEY$k = enums.STYLE_KEY, var isNil$9 = util.isNil; var REM$b = o.REM, VW$b = o.VW, - VH$b = o.VH; + VH$b = o.VH, + VMAX$b = o.VMAX, + VMIN$b = o.VMIN; function reBuild(target, origin, base, isMulti) { if (isMulti) { @@ -36884,6 +37291,10 @@ var Line = /*#__PURE__*/function (_Geom) { half = Math.max(item[0] * root.width * 0.01 * 0.5, half); } else if (item[1] === VH$b) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); + } else if (item[1] === VMAX$b) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else if (item[1] === VMIN$b) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); } @@ -36971,7 +37382,9 @@ var _enums$STYLE_KEY$l = enums.STYLE_KEY, var isNil$a = util.isNil; var REM$c = o.REM, VW$c = o.VW, - VH$c = o.VH; + VH$c = o.VH, + VMAX$c = o.VMAX, + VMIN$c = o.VMIN; function concatPointAndControl(point, control) { if (Array.isArray(control) && (control.length === 2 || control.length === 4) && Array.isArray(point) && point.length === 2) { @@ -37501,6 +37914,10 @@ var Polyline = /*#__PURE__*/function (_Geom) { half = Math.max(item[0] * root.width * 0.01 * 0.5, half); } else if (item[1] === VH$c) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); + } else if (item[1] === VMAX$c) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else if (item[1] === VMIN$c) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); } @@ -37741,7 +38158,9 @@ var isNil$b = util.isNil; var sectorPoints$1 = geom.sectorPoints; var REM$d = o.REM, VW$d = o.VW, - VH$d = o.VH; + VH$d = o.VH, + VMAX$d = o.VMAX, + VMIN$d = o.VMIN; function getR(v, dft) { v = parseFloat(v); @@ -38155,6 +38574,10 @@ var Sector = /*#__PURE__*/function (_Geom) { half = Math.max(item[0] * root.width * 0.01 * 0.5, half); } else if (item[1] === VH$d) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); + } else if (item[1] === VMAX$d) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else if (item[1] === VMIN$d) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); } @@ -38193,7 +38616,9 @@ var _enums$STYLE_KEY$n = enums.STYLE_KEY, var isNil$c = util.isNil; var REM$e = o.REM, VW$e = o.VW, - VH$e = o.VH; + VH$e = o.VH, + VMAX$e = o.VMAX, + VMIN$e = o.VMIN; function genVertex(x, y, width, height) { var rx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; @@ -38360,6 +38785,10 @@ var Rect = /*#__PURE__*/function (_Geom) { half = Math.max(item[0] * root.width * 0.01 * 0.5, half); } else if (item[1] === VH$e) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); + } else if (item[1] === VMAX$e) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else if (item[1] === VMIN$e) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); } @@ -38394,7 +38823,9 @@ var _enums$STYLE_KEY$o = enums.STYLE_KEY, var isNil$d = util.isNil; var REM$f = o.REM, VW$f = o.VW, - VH$f = o.VH; + VH$f = o.VH, + VMAX$f = o.VMAX, + VMIN$f = o.VMIN; function getR$2(v) { v = parseFloat(v); @@ -38523,6 +38954,10 @@ var Circle = /*#__PURE__*/function (_Geom) { half = Math.max(item[0] * root.width * 0.01 * 0.5, half); } else if (item[1] === VH$f) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); + } else if (item[1] === VMAX$f) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else if (item[1] === VMIN$f) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); } @@ -38561,7 +38996,9 @@ var _enums$STYLE_KEY$p = enums.STYLE_KEY, var isNil$e = util.isNil; var REM$g = o.REM, VW$g = o.VW, - VH$g = o.VH; + VH$g = o.VH, + VMAX$g = o.VMAX, + VMIN$g = o.VMIN; function getR$3(v) { v = parseFloat(v); @@ -38743,6 +39180,10 @@ var Ellipse = /*#__PURE__*/function (_Geom) { half = Math.max(item[0] * root.width * 0.01 * 0.5, half); } else if (item[1] === VH$g) { half = Math.max(item[0] * root.height * 0.01 * 0.5, half); + } else if (item[1] === VMAX$g) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); + } else if (item[1] === VMIN$g) { + half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half); } else { half = Math.max(item[0] * 0.5, half); } @@ -39289,7 +39730,12 @@ function parse(karas, json, animateRecords, opt) { var o$4 = { parse: function parse$1(karas, json, dom) { var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - json = util.clone(json); // 根节点的fonts字段定义字体信息 + + // 特殊单例声明无需clone加速解析 + if (!options.singleton && !json.singleton) { + json = util.clone(json); + } // 根节点的fonts字段定义字体信息 + var fonts = json.fonts; @@ -39499,7 +39945,7 @@ var refresh = { Cache: Cache }; -var version = "0.65.4"; +var version = "0.66.0"; Geom$1.register('$line', Line); Geom$1.register('$polyline', Polyline); diff --git a/index.es.js.map b/index.es.js.map index 67fa2218a..6e3633a28 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_FRAME_CB: 8,\n I_PLAY_CB: 9,\n I_TARGET: 10,\n I_ROOT: 11,\n I_FRAMES: 12,\n I_FRAMES_R: 13,\n I_CURRENT_TIME: 14,\n I_NEXT_TIME: 15,\n I_STYLE: 16,\n I_DURATION: 17,\n I_ITERATIONS: 18,\n I_FILL: 19,\n I_PLAYBACK_RATE: 20,\n I_PLAY_COUNT: 21,\n I_PLAY_STATE: 22,\n I_DESTROYED: 23,\n I_START_TIME: 24,\n I_FPS_TIME: 25,\n I_EASING: 26,\n I_ENTER_FRAME: 27,\n I_DELAY: 28,\n I_END_DELAY: 29,\n I_KEYS: 30,\n I_ORIGIN_STYLE: 31,\n I_CURRENT_FRAMES: 32,\n I_CURRENT_FRAME: 33,\n I_SPF_LIMIT: 34,\n I_FPS: 35,\n I_DIRECTION: 36,\n I_CAL_DIFF_TIME: 37,\n I_FIRST_ENTER: 38,\n I_STAY_BEGIN: 39,\n I_STAY_END: 40,\n I_IS2: 41,\n I_END_TIME: 42,\n I_NODE_CONFIG: 43,\n I_ROOT_CONFIG: 44,\n I_OUT_BEGIN_DELAY: 45,\n I_TIME_STAMP: 46,\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.__width = 0;\n this.__height = 0;\n this.__baseLine = 0;\n this.__config = {};\n // 默认undefined\n // this.__prev = undefined;\n // this.__next = undefined;\n // this.__parent = undefined;\n // this.__domParent = undefined;\n // this.__root = undefined;\n // this.__host = undefined;\n }\n\n __structure(i, lv, j) {\n return this.__config[NODE_STRUCT] = {\n [STRUCT_NODE]: this,\n [STRUCT_INDEX]: i,\n [STRUCT_CHILD_INDEX]: j,\n [STRUCT_LV]: lv,\n };\n }\n\n __modifyStruct(root, offset = 0) {\n let struct = this.__config[NODE_STRUCT];\n return [struct, 0];\n }\n\n __offsetX(diff, isLayout) {\n if(isLayout) {\n this.__x += diff;\n }\n else {\n this.__ox += diff;\n }\n this.__sx += diff;\n }\n\n __offsetY(diff, isLayout) {\n if(isLayout) {\n this.__y += diff;\n }\n else {\n this.__oy += diff;\n }\n this.__sy += diff;\n }\n\n __destroy() {\n this.__config[NODE_IS_DESTROYED] = true;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get ox() {\n return this.__ox;\n }\n\n get oy() {\n return this.__oy;\n }\n\n get sx() {\n return this.x + this.ox;\n }\n\n get sy() {\n return this.y + this.oy;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n // canvas/svg根节点\n get root() {\n return this.__root;\n }\n\n // component根节点\n get host() {\n return this.__host;\n }\n\n // 考虑高阶组件在内的component根节点\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get baseLine() {\n return this.__baseLine;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get isDestroyed() {\n return this.__config[NODE_IS_DESTROYED];\n }\n}\n\nexport default Node;\n","export default {\n CANVAS: 0,\n SVG: 1,\n WEBGL: 2,\n};\n","let o = {\n AUTO: 0,\n PX: 1,\n PERCENT: 2,\n NUMBER: 3,\n INHERIT: 4,\n DEG: 5,\n STRING: 6,\n RGBA: 7,\n REM: 8,\n EM: 9,\n VW: 10,\n VH: 11,\n /**\n * 通用的格式化计算数值单位的方法,百分比/像素/REM/VW/auto和纯数字\n * @param v value\n * @returns 格式化好的[number, unit]\n */\n calUnit(v) {\n let n = parseFloat(v) || 0;\n if(/%$/.test(v)) {\n return [n, o.PERCENT];\n }\n else if(/px$/i.test(v)) {\n return [n, o.PX];\n }\n else if(/deg$/i.test(v)) {\n return [n, o.DEG];\n }\n else if(/rem$/i.test(v)) {\n return [n, o.REM];\n }\n else if(/vw$/i.test(v)) {\n return [n, o.VW];\n }\n else if(/vh$/i.test(v)) {\n return [n, o.VH];\n }\n else if(/em$/i.test(v)) {\n return [n, o.EM];\n }\n else if(/vw$/i.test(v)) {\n return [n, o.VW];\n }\n else if(/vh$/i.test(v)) {\n return [n, o.VH];\n }\n return [n, o.NUMBER];\n },\n};\n\nexport default o;\n","'use strict';\n\nlet o = {\n info: {\n arial: {\n lhr: 1.14990234375, // 默认line-height ratio,(67+1854+434)/2048\n // car: 1.1171875, // content-area ratio,(1854+434)/2048\n blr: 0.9052734375, // base-line ratio,1854/2048\n // mdr: 0.64599609375, // middle ratio,(1854-1062/2)/2048\n lgr: 0.03271484375, // line-gap ratio,67/2048,默认0\n // 个别字符误差,初次之外误差还有根据经验得的比例系数,https://github.com/karasjs/karas/issues/145\n padding: {\n 1: 1,\n f: 0.9,\n },\n },\n verdana: {\n lhr: 1.21533203125, // (0+2059+430)/2048\n blr: 1.00537109375, // 2059/2048\n },\n tahoma: {\n lhr: 1.20703125, // (0+2049+423)/2048\n blr: 1.00048828125, // 2049/2048\n padding: {\n S: 1,\n T: 1,\n Z: 1,\n c: 1,\n f: 0.7,\n i: 1,\n l: 1,\n t: 0.9,\n },\n },\n georgia: {\n lhr: 1.13623046875, // (0+1878+449)/2048\n blr: 0.9169921875, // 1878/2048\n },\n 'courier new': {\n lhr: 1.1328125, // (0+1705+615)/2048\n blr: 0.83251953125, // 1705/2048\n },\n 'pingfang sc': {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06, // 1060/1000\n padding: {\n f: 0.5,\n },\n },\n simsun: {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06,\n padding: {\n f: 0.5,\n },\n },\n },\n support(fontFamily) {\n return this.info.hasOwnProperty(fontFamily);\n },\n register(name, info) {\n let { emSquare = 2048, ascent = 1854, descent = 434, lineGap = 67, padding = {} } = info || {};\n this.info[name.toLowerCase()] = {\n lhr: (ascent + descent + lineGap) / emSquare,\n blr: ascent / emSquare,\n padding,\n };\n },\n addPadding(name, padding) {\n Object.assign(this.info[name.toLowerCase()].padding, padding);\n },\n};\n\no.info['宋体'] = o.info.simsun;\n\nexport default o;\n","export default {\n position: /(([-+]?[\\d.]+[pxremvwh%]*)|(left|top|right|bottom|center)){1,2}/ig,\n // tfo: /((-?[\\d.]+(px|%)?)|(left|top|right|bottom|center)){1,2}/ig,\n gradient: /\\b(\\w+)-?gradient\\((.+)\\)/i,\n img: /(?:\\burl\\((['\"]?)(.*?)\\1\\))|(?:\\b((data:)))/i,\n};\n","// 生成4*4单位矩阵\nfunction identity() {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n}\n\n// 矩阵a*b,固定两个matrix都是长度16\nfunction multiply(a, b) {\n if(isE(a)) {\n return b;\n }\n if(isE(b)) {\n return a;\n }\n let c = [];\n for(let i = 0; i < 4; i++) {\n let a0 = a[i] || 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') {\n s += `${k}(${v}%)`;\n }\n });\n return s;\n}\n\nexport default {\n canvasPolygon,\n svgPolygon,\n canvasLine,\n svgLine,\n canvasFilter,\n svgFilter: canvasFilter,\n};\n","import geom from '../math/geom';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\nimport unit from './unit';\n\nconst { H } = geom;\nconst { PX, PERCENT, REM, VW, VH } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\nconst {\n STYLE_KEY: {\n BORDER_LEFT_WIDTH,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n PADDING_LEFT,\n PADDING_BOTTOM,\n PADDING_TOP,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n FONT_SIZE,\n },\n} = enums;\n\n/* 获取合适的虚线实体空白宽度ps/pd和数量n\n * 总长total,start边长bs,end边长be,内容长w,\n * 实体长范围[smin,smax],空白长范围[dmin,dmax]\n */\nfunction calFitDashed(total, bs, be, w, smin, smax, dmin, dmax) {\n let n = 1;\n let ps = 1;\n let pd = 1;\n // 从最大实体空白长开始尝试\n outer:\n for(let i = smax; i >= smin; i--) {\n for(let j = dmax; j >= dmin; j--) {\n // 已知实体空白长度,n实体和n-1空白组成total,计算获取n数量\n let per = i + j;\n let num = Math.floor((total + j) / per);\n let k = j;\n // 可能除不尽,此时扩展空白长\n if(num * per < j + total) {\n let free = total - num * i;\n k = free / (num - 1);\n if(k > dmax) {\n continue;\n }\n }\n per = i + k;\n // bs比实体大才有效,因为小的话必定和第一个实体完整相连\n if(bs > 1 && bs > i) {\n let mo = bs % per;\n if(mo > i) {\n continue;\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n }\n if(be > 1) {\n let mo = (bs + w) % per;\n if(mo > i) {\n continue;\n }\n }\n if(num > 0) {\n n = num;\n ps = i;\n pd = k;\n }\n break outer;\n }\n }\n return {\n n,\n ps,\n pd,\n };\n}\n\n// dashed时n个实线和n-1虚线默认以3:1宽度组成,dotted则是n和n以1:1组成\nfunction calDashed(style, m1, m2, m3, m4, bw) {\n let total = m4 - m1;\n let w = m3 - m2;\n let bs = m2 - m1;\n let be = m4 - m3;\n if(style === 'dotted') {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n else {\n let { n, ps, pd } = calFitDashed(total, bs, be, w, bw, bw * 3, Math.max(1, bw * 0.25), bw * 2);\n if(n === 1) {\n return calFitDashed(total, bs, be, w, bw, bw, Math.max(1, bw * 0.25), bw * 2);\n }\n // 降级为dotted\n return { n, ps, pd };\n }\n}\n\n// 获取边框分割为几块的坐标,虚线分割为若干四边形、三边型、五边形\n// 三边形重复内外边交点形成四边形,五边形进行切割形成2个四边形\n// direction为上右下左0123\nfunction calPoints(borderWidth, borderStyle, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, direction, beginRadius, endRadius) {\n let points = [];\n if(['dashed', 'dotted'].indexOf(borderStyle) > -1) {\n // 寻找一个合适的虚线线段长度和之间空白边距长度\n let { n, ps, pd } = (direction === 0 || direction === 2)\n ? calDashed(borderStyle, x1, x2, x3, x4, borderWidth)\n : calDashed(borderStyle, y1, y2, y3, y4, borderWidth);\n if(n > 1) {\n for(let i = 0; i < n; i++) {\n // 最后一个可能没有到底,延长之\n let isLast = i === n - 1;\n let main1;\n let main2;\n let cross1;\n let cross2;\n if(direction === 0 || direction === 2) {\n main1 = i ? (x1 + ps * i + pd * i) : x1;\n }\n else {\n main1 = i ? (y1 + ps * i + pd * i) : y1;\n }\n main2 = main1 + ps;\n if(direction === 0) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x4, y1],\n [x3, y2],\n [x2, y2]\n ]);\n }\n else {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n cross2 = y1 + (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y1 + (x4 - main1) * Math.tan(deg2);\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x4, y1],\n [main1, cross1]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, cross2],\n [main1, cross1]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross1]\n ]);\n if(isLast) {\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x2, y2]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y1 + (x4 - main2) * Math.tan(deg2);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross2],\n [x3, y2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y1],\n [main2, y1],\n [main2, y2],\n [x2, y2]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y1 + (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y1 + (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, y1],\n [x2, y1],\n [x2, y2],\n [main1, cross2]\n ]);\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y1],\n [x3, y1],\n [x3, y2],\n [main1, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n else {\n points.push([\n [x3, y1],\n [main2, y1],\n [main2, cross1],\n [x3, y2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y1],\n [x4, y1],\n [x3, y2],\n [main1, y2]\n ]);\n }\n else {\n points.push([\n [main1, y1],\n [main2, y1],\n [main2, y2],\n [main1, y2]\n ]);\n }\n }\n }\n }\n else if(direction === 1) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n cross1 = x4 - (main1 - y1) * Math.tan(deg1);\n cross2 = x4 - (main2 - y1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2],\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x3 + (main1 - y3) * Math.tan(deg2);\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross1, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n if(isLast) {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x3 + (main2 - y3) * Math.tan(deg2);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross2, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x3 + (main2 - y3) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x3 + (y2 - main1) * Math.tan(deg1);\n points.push([\n [cross2, main1],\n [x4, main1],\n [x4, y2],\n [x3, y2]\n ]);\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, x4],\n [x4, x4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y3],\n [x3, y3]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, main2],\n [cross1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, y4],\n [x3, y3]\n ]);\n }\n else {\n points.push([\n [x3, main1],\n [x4, main1],\n [x4, main2],\n [x3, main2]\n ]);\n }\n }\n }\n }\n else if(direction === 2) {\n // 整个和borderLeft重叠\n if(main2 <= x2) {\n if(isLast) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x3, y3],\n [x4, y4]\n ]);\n }\n else {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n cross2 = y4 - (main2 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 整个和borderRight重叠\n else if(main1 >= x3) {\n cross1 = y4 - (x4 - main1) * Math.tan(deg2);\n cross2 = y4 - (x4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [main1, cross1],\n [x4, y4],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, cross1],\n [main2, cross2],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross1 = y4 - (main1 - x1) * Math.tan(deg1);\n points.push([\n [main1, cross1],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n // 下部分和borderRight重叠\n if(main2 > x3) {\n cross2 = y4 - (main2 - x3) * Math.tan(deg2);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n points.push([\n [x3, y3],\n [main2, cross2],\n [main2, y4],\n [x3, y4]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x2, y3],\n [main2, y3],\n [main2, y4],\n [x2, y4]\n ]);\n }\n }\n }\n // 下部分和borderRight重叠\n else if(main2 > x3) {\n cross1 = y4 - (x4 - main2) * Math.tan(deg2);\n // 上部分和borderLeft重叠\n if(main1 < x2) {\n cross2 = y4 - (main1 - x3) * Math.tan(deg1);\n points.push([\n [main1, cross2],\n [x2, y3],\n [x2, y4],\n [main1, y4]\n ]);\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [main1, y3],\n [x3, y3],\n [x3, y4],\n [main1, y4]\n ]);\n if(isLast) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n else {\n points.push([\n [x3, y3],\n [main2, cross1],\n [main2, y4],\n [x3, y4]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [main1, y3],\n [x3, y3],\n [x4, y4],\n [main1, y4]\n ]);\n }\n else {\n points.push([\n [main1, y3],\n [main2, y3],\n [main2, y4],\n [main1, y4]\n ]);\n }\n }\n }\n }\n else if(direction === 3) {\n // 整个和borderTop重叠\n if(main2 <= y2) {\n if(isLast) {\n points.push([\n [x1, y1],\n [x2, y2],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n cross2 = x1 + (main2 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 整个和borderBottom重叠\n else if(main1 >= y3) {\n cross1 = x1 + (y4 - main1) * Math.tan(deg2);\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n if(isLast) {\n points.push([\n [x1, main1],\n [cross1, main1],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [cross1, main1],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n }\n // 不被整个重叠的情况再细分\n else {\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross1 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross1, main1],\n [x2, y2],\n [x1, y2]\n ]);\n if(isLast) {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4],\n ]);\n }\n else {\n // 下部分和borderBottom重叠\n if(main2 > y3) {\n cross2 = x1 + (y4 - main2) * Math.tan(deg2);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n points.push([\n [x1, y3],\n [x2, y3],\n [cross2, main2],\n [x1, main2]\n ]);\n }\n // 下部独立\n else {\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 下部分和borderBottom重叠\n else if(main2 > y3) {\n cross1 = x1 + (y4 - main2) * Math.tan(deg2);\n // 上部分和borderTop重叠\n if(main1 < y2) {\n cross2 = x1 + (main1 - y1) * Math.tan(deg1);\n points.push([\n [x1, main1],\n [cross2, main1],\n [x2, y2],\n [x1, y1]\n ]);\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n // 上部独立\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y3]\n ]);\n if(isLast) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, y3],\n [x2, y3],\n [cross1, main2],\n [x1, main2]\n ]);\n }\n }\n }\n // 完全独立\n else {\n if(isLast) {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, y3],\n [x1, y4]\n ]);\n }\n else {\n points.push([\n [x1, main1],\n [x2, main1],\n [x2, main2],\n [x1, main2]\n ]);\n }\n }\n }\n }\n }\n if(direction === 0) {\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n }\n }\n // 兜底返回实线\n if(direction === 0) {\n if(x2 > x1) {\n points.push([\n [x1, y1],\n [x2, y1],\n [x2, y2],\n [x1, y1]\n ]);\n }\n points.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y1],\n [x4, y1],\n [x4, y1],\n [x3, y2]\n ]);\n }\n return calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 1) {\n if(y2 > y1) {\n points.push([\n [x4, y1],\n [x4, y1],\n [x4, y2],\n [x3, y2]\n ]);\n }\n points.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x3, y3],\n [x4, y3],\n [x4, y4],\n [x4, y4]\n ]);\n }\n return calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 2) {\n if(x2 > x1) {\n points.push([\n [x1, y4],\n [x2, y3],\n [x2, y4],\n [x1, y4]\n ]);\n }\n points.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4]\n ]);\n if(x4 > x3) {\n points.push([\n [x3, y3],\n [x4, y4],\n [x4, y4],\n [x3, y4]\n ]);\n }\n return calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n else if(direction === 3) {\n if(y2 > y1) {\n points.push([\n [x1, y1],\n [x1, y1],\n [x2, y2],\n [x1, y2]\n ]);\n }\n points.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3]\n ]);\n if(y4 > y3) {\n points.push([\n [x1, y3],\n [x2, y3],\n [x1, y4],\n [x1, y4]\n ]);\n }\n return calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, points, beginRadius, endRadius);\n }\n}\n\nfunction calTopRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[1][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[0][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[1][0] > oxr && points[0][0] < oxl) {\n let ya = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, ya],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y1],\n [oxr, y1],\n [oxr, y2],\n [oxl, y2],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y1],\n [x3, y1],\n [x3, y2],\n [oxl, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [oxr, y1],\n [oxr, y2],\n [x2, y2],\n ]);\n }\n else {\n centerList.push([\n [oxl, y1],\n [x2, y1],\n [x2, y2],\n [oxl, ya]\n ]);\n centerList.push([\n [x2, y1],\n [x3, y1],\n [x3, y2],\n [x2, y2],\n ]);\n centerList.push([\n [x3, y1],\n [oxr, y1],\n [oxr, yb],\n [x3, y2]\n ]);\n }\n }\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, yb]\n ]);\n }\n // 跨越右圆角\n else if(points[1][0] > oxr) {\n let y = oxr > x3 ? (y1 + Math.tan(deg2) * (x4 - oxr)) : y2;\n centerList.push([\n points[0],\n [oxr, y1],\n [oxr, y],\n points[3]\n ]);\n endList.push([\n [oxr, y1],\n points[1],\n points[2],\n [oxr, y]\n ]);\n }\n // 跨越左圆角\n else if(points[0][0] < oxl) {\n let y = oxl < x2 ? (y1 + Math.tan(deg1) * (oxl - x1)) : y2;\n beginList.push([\n points[0],\n [oxl, y1],\n [oxl, y],\n points[3]\n ]);\n centerList.push([\n [oxl, y1],\n points[1],\n points[2],\n [oxl, y],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y1 + bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierTopLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopLeft(points[0], points[1], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopLeft(points[3], points[2], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 0);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 0);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y1 + ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierTopRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierTopRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierTopRight(points[0], points[1], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierTopRight(points[3], points[2], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 1);\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 1);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierTopLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(p1x, p1y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(p2x, p2y, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierTopRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (oy - p1y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy - Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy - Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (oy - p2y));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy - Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calRightRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[2][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[1][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[2][1] > oyb && points[1][1] < oyt) {\n let xa = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n let xb = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [xa, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x3, oyt],\n [x4, oyt],\n [x4, oyb],\n [x3, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, oyb],\n [x3, oyb],\n ]);\n }\n else {\n centerList.push([\n [xa, oyt],\n [x4, oyt],\n [x4, y2],\n [x3, y2],\n ]);\n centerList.push([\n [x3, y2],\n [x4, y2],\n [x4, y3],\n [x3, y3],\n ]);\n centerList.push([\n [x3, y3],\n [x4, y3],\n [x4, oyb],\n [xb, oyb],\n ]);\n }\n }\n endList.push([\n [xb, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[2][1] > oyb) {\n let x = oyb > y3 ? (x3 + Math.tan(deg1) * (oyb - y3)) : x3;\n centerList.push([\n points[0],\n points[1],\n [x4, oyb],\n [x, oyb]\n ]);\n endList.push([\n [x, oyb],\n [x4, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x3 + Math.tan(deg2) * (y2 - oyt)) : x3;\n beginList.push([\n points[0],\n points[1],\n [x4, oyt],\n [x, oyt]\n ]);\n centerList.push([\n [x, oyt],\n [x4, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x4 - x3) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x4 - brx;\n let rx2 = brx - (x4 - x3);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightTop(beginList[0][1], beginList[0][2], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierRightTop(beginList[0][0], beginList[0][3], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightTop(points[1], points[2], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightTop(points[0], points[3], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 2);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 2);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x4 - erx;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierRightBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierRightBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierRightBottom(points[1], points[2], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierRightBottom(points[0], points[3], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 3);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 3);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[2] = points[3];\n points[3] = points[0];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierRightTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox + Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox + Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox + Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierRightBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBottomRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,左圆角、右圆角、中间矩形,3个区域2个坐标;当左右圆角相接时中间矩形为0即中间2个坐标相等\n let oxl = x2 + brx - (x2 - x1);\n let oxr = x3 - erx + (x4 - x3);\n // 先拆分,当一块四边形跨越左右圆角和中间非圆角时被拆为3份,只跨一边圆角拆2份,不跨不处理\n // 也有可能左右圆角相接,跨越的只分为左右2份\n // 最终左圆角内的存入begin,右圆角内的存入end,中间center\n let beginList = [];\n let centerList = [];\n let endList = [];\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在左圆角\n if(points[2][0] < oxl) {\n beginList.push(points);\n }\n // 全在右圆角\n else if(points[3][0] > oxr) {\n endList.push(points);\n }\n // 跨越左右圆角\n else if(points[2][0] > oxr && points[3][0] < oxl) {\n let ya = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y2;\n let yb = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n beginList.push([\n points[0],\n [oxl, ya],\n [oxl, y4],\n points[3]\n ]);\n if(oxl < oxr) {\n if(oxl > x2 && oxr < x3) {\n centerList.push([\n [oxl, y3],\n [oxr, y3],\n [oxr, y4],\n [oxl, y4],\n ]);\n }\n else if(oxl > x2) {\n centerList.push([\n [oxl, y3],\n [x3, y3],\n [x3, y4],\n [oxl, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n else if(oxr < x3) {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [oxr, y3],\n [oxr, y4],\n [x2, y4],\n ]);\n }\n else {\n centerList.push([\n [oxl, ya],\n [x2, y3],\n [x2, y4],\n [oxl, y4]\n ]);\n centerList.push([\n [x2, y3],\n [x3, y3],\n [x3, y4],\n [x2, y4],\n ]);\n centerList.push([\n [x3, y3],\n [oxr, yb],\n [oxr, y4],\n [x3, y4]\n ]);\n }\n }\n endList.push([\n [oxr, yb],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越右圆角\n else if(points[2][0] > oxr) {\n let y = oxr > x3 ? (y4 - Math.tan(deg2) * (x4 - oxr)) : y3;\n centerList.push([\n points[0],\n [oxr, y],\n [oxr, y4],\n points[3]\n ]);\n endList.push([\n [oxr, y],\n points[1],\n points[2],\n [oxr, y4]\n ]);\n }\n // 跨越左圆角\n else if(points[3][0] < oxl) {\n let y = oxl < x2 ? (y4 - Math.tan(deg1) * (oxl - x1)) : y3;\n beginList.push([\n points[0],\n [oxl, y],\n [oxl, y4],\n points[3]\n ]);\n centerList.push([\n [oxl, y],\n points[1],\n points[2],\n [oxl, y4],\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = brx > (x2 - x1) && borderWidth < bry;\n // 算这个角度是为了头部和上条边相交线的延长线\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oyl = y4 - bry;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomLeft(beginList[0][3], beginList[0][2], oxl, oyl, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierBottomLeft(beginList[0][0], beginList[0][1], oxl, oyl, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomLeft(points[3], points[2], oxl, oyl, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomLeft(points[0], points[1], oxl, oyl, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 4);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 4);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n // 边宽可能大于圆角尺寸,边的里面无需圆弧化\n let needInner = erx > (x4 - x3) && borderWidth < ery;\n // 算这个角度是为了最后和下条边相交线的延长线\n let crossDeg = Math.atan((x4 - x3) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oyr = y4 - ery;\n let rx2 = erx - (x4 - x3);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierBottomRight(endList[endLength - 1][3], endList[endLength - 1][2], oxr, oyr, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierBottomRight(endList[endLength - 1][0], endList[endLength - 1][1], oxr, oyr, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierBottomRight(points[3], points[2], oxr, oyr, sx1, ry1);\n if(needInner) {\n controls2 = calBezierBottomRight(points[0], points[1], oxr, oyr, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 5);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 5);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[3];\n points[3] = controls2[2].concat(controls2[1]).concat(controls2[0]);\n }\n }\n else {\n points[2] = points[1];\n points[3] = points[0];\n }\n points[0] = controls1[0];\n points[1] = controls1[1].concat(controls1[2]).concat(controls1[3]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierBottomLeft(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = -p1x + ox;\n let dsx1 = dx1 * sx;\n let dx2 = -p2x + ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (p2y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy + Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n // 最初的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy + Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (p1y - oy));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy + Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calBezierBottomRight(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = p1x - ox;\n let dsx1 = dx1 * sx;\n let dx2 = p2x - ox;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox + Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n // 最后的是两条border的交界线,需要特殊求交界线延长和椭圆的交点,不能直连圆心求交点\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox + Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox + Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox + cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox + cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx1, cpy1],\n [cx1, cy1],\n [cx2, cy2],\n [cpx2, cpy2]\n ];\n}\n\nfunction calLeftRadiusPoints(borderWidth, deg1, deg2, x1, x2, x3, x4, y1, y2, y3, y4, pointsList, beginRadius, endRadius) {\n let [brx, bry] = beginRadius;\n let [erx, ery] = endRadius;\n // 一条边的两侧圆角均为0时无效\n if((!brx || !bry) && (!erx || !ery)) {\n return pointsList;\n }\n // 分界坐标圆心,上圆角、下圆角、中间矩形,3个区域2个坐标;当上下圆角相接时中间矩形为0即中间2个坐标相等\n let oyt = y2 + bry - (y2 - y1);\n let oyb = y3 - ery + (y4 - y3);\n let beginList = [];\n let centerList = [];\n let endList = [];\n // 同borderTop拆分\n for(let i = 0, len = pointsList.length; i < len; i++) {\n let points = pointsList[i];\n // 全在上圆角\n if(points[3][1] < oyt) {\n beginList.push(points);\n }\n // 全在下圆角\n else if(points[0][1] > oyb) {\n endList.push(points);\n }\n // 跨越上下圆角\n else if(points[3][1] > oyb && points[0][1] < oyt) {\n let xa = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n let xb = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n beginList.push([\n points[0],\n points[1],\n [xa, oyt],\n [x1, oyt]\n ]);\n if(oyt < oyb) {\n if(oyb < y3 && oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, oyb],\n [x1, oyb]\n ]);\n }\n else if(oyt > y2) {\n centerList.push([\n [x1, oyt],\n [x2, oyt],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n else if(oyb < y3) {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, oyb],\n [x1, oyb],\n ]);\n }\n else {\n centerList.push([\n [x1, oyt],\n [xa, oyt],\n [x2, y2],\n [x1, y2],\n ]);\n centerList.push([\n [x1, y2],\n [x2, y2],\n [x2, y3],\n [x1, y3],\n ]);\n centerList.push([\n [x1, y3],\n [x2, y3],\n [xb, oyb],\n [x1, oyb],\n ]);\n }\n }\n endList.push([\n [x1, oyb],\n [xb, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越下圆角\n else if(points[3][1] > oyb) {\n let x = oyb > y3 ? (x2 - Math.tan(deg1) * (oyb - y3)) : x2;\n centerList.push([\n points[0],\n points[1],\n [x, oyb],\n [x1, oyb]\n ]);\n endList.push([\n [x1, oyb],\n [x, oyb],\n points[2],\n points[3]\n ]);\n }\n // 跨越上圆角\n else if(points[1][1] < oyt) {\n let x = oyt < y2 ? (x2 - Math.tan(deg2) * (y2 - oyt)) : x2;\n beginList.push([\n points[0],\n points[1],\n [x, oyt],\n [x1, oyt]\n ]);\n centerList.push([\n [x1, oyt],\n [x, oyt],\n points[2],\n points[3]\n ]);\n }\n else {\n centerList.push(points);\n }\n }\n let beginLength = beginList.length;\n if(beginLength) {\n let needInner = bry > (y2 - y1) && borderWidth < brx;\n let crossDeg = Math.atan((x2 - x1) / (y2 - y1));\n let rx1 = brx;\n let ry1 = bry;\n let sx1 = ry1 / rx1;\n let oxt = x1 + brx;\n let rx2 = brx - (x2 - x1);\n let ry2 = bry - (y2 - y1);\n let sx2 = ry2 / rx2;\n // 先计算第一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftTop(beginList[0][0], beginList[0][3], oxt, oyt, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[ca.length - 1];\n let cb;\n if(needInner) {\n cb = calBezierLeftTop(beginList[0][1], beginList[0][2], oxt, oyt, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[cb.length - 1];\n }\n beginList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === 0) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftTop(points[0], points[3], oxt, oyt, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftTop(points[1], points[2], oxt, oyt, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 6);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 6);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n let endLength = endList.length;\n if(endLength) {\n let needInner = ery > (y4 - y3) && borderWidth < erx;\n let crossDeg = Math.atan((x2 - x1) / (y4 - y3));\n let rx1 = erx;\n let ry1 = ery;\n let sx1 = ry1 / rx1;\n let oxb = x1 + erx;\n let rx2 = erx - (x2 - x1);\n let ry2 = ery - (y4 - y3);\n let sx2 = ry2 / rx2;\n // 先计算最后一个块,确定x/y边界,防止因为划分原因导致出现超过边界情况交叉\n let xa, ya, xb, yb;\n let ca = calBezierLeftBottom(endList[endLength - 1][0], endList[endLength - 1][3], oxb, oyb, sx1, ry1, true, Math.tan(crossDeg) * ry1);\n [xa, ya] = ca[0];\n let cb;\n if(needInner) {\n cb = calBezierLeftBottom(endList[endLength - 1][1], endList[endLength - 1][2], oxb, oyb, sx2, ry2, true, Math.tan(crossDeg) * ry2);\n [xb, yb] = cb[0];\n }\n endList.forEach((points, i) => {\n let controls1;\n let controls2;\n if(i === endLength - 1) {\n controls1 = ca;\n if(needInner) {\n controls2 = cb;\n }\n }\n else {\n controls1 = calBezierLeftBottom(points[0], points[3], oxb, oyb, sx1, ry1);\n if(needInner) {\n controls2 = calBezierLeftBottom(points[1], points[2], oxb, oyb, sx2, ry2);\n }\n }\n for(let i = 0, len = controls1.length; i < len; i++) {\n limit(controls1[i], xa, ya, 7);\n }\n if(needInner) {\n for(let i = 0, len = controls2.length; i < len; i++) {\n limit(controls2[i], xb, yb, 7);\n }\n if(controls2.length === 1) {\n points[2] = controls2[0];\n points.pop();\n }\n else {\n points[2] = controls2[0];\n points[3] = controls2[1].concat(controls2[2]).concat(controls2[3]);\n }\n }\n else {\n points[3] = points[1];\n }\n points[0] = controls1[3];\n points[1] = controls1[2].concat(controls1[1]).concat(controls1[0]);\n });\n }\n return beginList.concat(centerList).concat(endList);\n}\n\nfunction calBezierLeftTop(p1, p2, ox, oy, sx, r, isStart, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg2 = Math.atan(dsx2 / (oy - p2y));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx2 = ox - Math.sin(deg2) * r / sx;\n let cpy2 = oy - Math.cos(deg2) * r;\n let deg1;\n let cpx1;\n let cpy1;\n if(isStart) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg1 = Math.PI * 0.5 - alpha;\n cpx1 = ox - Math.cos(alpha) * r / sx;\n cpy1 = oy - Math.sin(alpha) * r;\n }\n else {\n deg1 = Math.atan(dsx1 / (oy - p1y));\n cpx1 = ox - Math.sin(deg1) * r / sx;\n cpy1 = oy - Math.cos(deg1) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 + degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy - cdy1;\n let degTg2 = deg2 - degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy - cdy2;\n // window.ctx.fillStyle = '#000';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\nfunction calBezierLeftBottom(p1, p2, ox, oy, sx, r, isEnd, crossDx) {\n // 先缩放x轴,椭圆变圆,2个点x坐标相应变化,y不变\n let [p1x, p1y] = p1;\n let [p2x, p2y] = p2;\n let dx1 = ox - p1x;\n let dsx1 = dx1 * sx;\n let dx2 = ox - p2x;\n let dsx2 = dx2 * sx;\n // 求2个点和1/4圆弧的交点坐标,和圆心连线,反三角函数求出夹角\n let deg1 = Math.atan(dsx1 / (p1y - oy));\n // 根据角和半径再三角函数求交点坐标,可以直接缩放x轴恢复原本椭圆坐标,求贝塞尔控制点用不到交点\n let cpx1 = ox - Math.sin(deg1) * r / sx;\n let cpy1 = oy + Math.cos(deg1) * r;\n let deg2;\n let cpx2;\n let cpy2;\n if(isEnd) {\n // 交界线和y轴夹角beta以及交点的x坐标都会受缩放影响,先化圆好求交点坐标\n let crossDsx = crossDx * sx;\n let beta = Math.atan(crossDsx / r);\n // 公式计算可得beta和交点连圆心的角alpha关系\n let tanBetaDiv2Sqrt = Math.sqrt(Math.tan(beta) / 2);\n let tanAlphaHalf = tanBetaDiv2Sqrt / (1 + tanBetaDiv2Sqrt);\n let alpha = Math.atan(tanAlphaHalf) * 2;\n // 获得alpha后直接根据半径求出交点坐标\n deg2 = Math.PI * 0.5 - alpha;\n cpx2 = ox - Math.cos(alpha) * r / sx;\n cpy2 = oy + Math.sin(alpha) * r;\n }\n else {\n deg2 = Math.atan(dsx2 / (p2y - oy));\n cpx2 = ox - Math.sin(deg2) * r / sx;\n cpy2 = oy + Math.cos(deg2) * r;\n }\n // 首尾只有3个点情况下重复了顶点形成4边形,同时圆角x/y相等有inner时\n // 使得交点相同角度相同无法计算,直接返回1个点即可\n if(deg1 === deg2) {\n return [\n [cpx1, cpy1]\n ];\n }\n // 根据夹角求贝塞尔拟合圆弧长度\n let h = geom.h(Math.abs(deg1 - deg2));\n let d = h * r;\n // 过交点做切线,知道切线段长度d,求切线上从交点延长d的坐标,即为控制点\n // 圆心交点控制点连成直角三角形,获得斜边即圆心到控制点距离c\n // 求切线角,用上面夹角减去切线角可得控制点和圆心连线的角,从而获得坐标\n let c = Math.sqrt(Math.pow(r, 2) + Math.pow(d, 2));\n let degTg = Math.atan(d / r);\n let degTg1 = deg1 - degTg;\n let cdx1 = Math.sin(degTg1) * c;\n let cdy1 = Math.cos(degTg1) * c;\n let cx1 = ox - cdx1 / sx;\n let cy1 = oy + cdy1;\n let degTg2 = deg2 + degTg;\n let cdx2 = Math.sin(degTg2) * c;\n let cdy2 = Math.cos(degTg2) * c;\n let cx2 = ox - cdx2 / sx;\n let cy2 = oy + cdy2;\n // window.ctx.fillStyle = '#F90';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx1, cpy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0FF';\n // window.ctx.beginPath();\n // window.ctx.arc(cx1, cy1, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#00F';\n // window.ctx.beginPath();\n // window.ctx.arc(cx2, cy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.fillStyle = '#0F0';\n // window.ctx.beginPath();\n // window.ctx.arc(cpx2, cpy2, 1,0, 2 * Math.PI);\n // window.ctx.fill();\n // window.ctx.closePath();\n return [\n [cpx2, cpy2],\n [cx2, cy2],\n [cx1, cy1],\n [cpx1, cpy1]\n ];\n}\n\n/**\n * 简单计算椭圆的圆化坐标控制点,视作重合位置,外面判断backgroundClip并调整坐标\n * @param x 起始x\n * @param y 起始y\n * @param w 宽\n * @param h 高\n * @param btlr borderTopLeftRadius\n * @param btrr borderTopRightRadius\n * @param bbrr borderBottomRightRadius\n * @param bblr borderBottomLeftRadius\n * @returns {[]} 多边形的顶点和曲线控制点\n */\nfunction calRadius(x, y, w, h, btlr, btrr, bbrr, bblr) {\n let need;\n let [btlx, btly] = btlr;\n let [btrx, btry] = btrr;\n let [bbrx, bbry] = bbrr;\n let [bblx, bbly] = bblr;\n btlx = Math.max(btlx, 0);\n btly = Math.max(btly, 0);\n btrx = Math.max(btrx, 0);\n btry = Math.max(btry, 0);\n bbrx = Math.max(bbrx, 0);\n bbry = Math.max(bbry, 0);\n bblx = Math.max(bblx, 0);\n bbly = Math.max(bbly, 0);\n // 圆角必须x/y都>0才有效,否则视为不绘制\n if(btlx > 0 && btly > 0 || btrx > 0 && btry > 0 || bbrx > 0 && bbry > 0 || bblx > 0 && bbly > 0) {\n need = true;\n }\n if(need) {\n let list = [];\n if(btlx > 0 && btly > 0) {\n list.push([x, y + btly]);\n list.push([x, y + (btly) * (1 - H), x + btlx * (1 - H), y, x + btlx, y]);\n }\n else {\n list.push([x, y]);\n }\n if(btrx > 0 && btry > 0) {\n list.push([x + w - btrx, y]);\n list.push([x + w - btrx * (1 - H), y, x + w, y + btry * (1 - H), x + w, y + btry]);\n }\n else {\n list.push([x + w, y]);\n }\n if(bbrx > 0 && bbry > 0) {\n list.push([x + w, y + h - bbry]);\n list.push([x + w, y + h - bbry * (1 - H), x + w - bbrx * (1 - H), y + h, x + w - bbrx, y + h]);\n }\n else {\n list.push([x + w, y + h]);\n }\n if(bblx > 0 && bbly > 0) {\n list.push([x + bblx, y + h]);\n list.push([x + bblx * (1 - H), y + h, x, y + h - bbly * (1 - H), x, y + h - bbly]);\n }\n else {\n list.push([x, y + h]);\n }\n return list;\n }\n}\n\nfunction limit(points, x, y, direction) {\n if(direction === 0) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 1) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 2) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 3) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n else if(direction === 4) {\n points[0] = Math.max(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 5) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 6) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.max(points[1], y);\n }\n else if(direction === 7) {\n points[0] = Math.min(points[0], x);\n points[1] = Math.min(points[1], y);\n }\n}\n\nconst BR_KS = [BORDER_TOP_LEFT_RADIUS, BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS];\nfunction calBorderRadius(w, h, currentStyle, computedStyle, root) {\n let noRadius = true;\n BR_KS.forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n if(item[0] > 0) {\n noRadius = false;\n }\n else {\n return 0;\n }\n if(item[1] === PX) {\n return Math.max(0, item[0]);\n }\n else if(item[1] === PERCENT) {\n return Math.max(0, item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n return Math.max(0, item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n return Math.max(0, item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n return Math.max(0, item[0] * root.height * 0.01);\n }\n return 0;\n });\n });\n // 优化提前跳出\n if(noRadius) {\n return;\n }\n // radius限制,相交的2个之和不能超过边长,如果2个都超过中点取中点,只有1个超过取交点,这包含了单个不能超过总长的逻辑\n BR_KS.forEach((k, i) => {\n let j = i % 2 === 0 ? 0 : 1;\n let target = j ? h : w;\n let prev = computedStyle[k];\n let next = computedStyle[BR_KS[(i + 1) % 4]];\n // 相加超过边长则是相交\n if(prev[j] + next[j] > target) {\n let half = target * 0.5;\n // 都超过一半中点取中点\n if(prev[j] >= half && next[j] >= half) {\n prev[j] = next[j] = half;\n }\n // 仅1个超过中点,因相交用总长减去另一方即可\n else if(prev[j] > half) {\n prev[j] = target - next[j];\n }\n else if(next[j] > half) {\n next[j] = target - prev[j];\n }\n }\n });\n}\n\nfunction calBorderRadiusInline(contentBoxList, currentStyle, computedStyle) {\n let first, last;\n if(contentBoxList.length) {\n first = contentBoxList[0];\n last = contentBoxList[contentBoxList.length - 1]\n }\n // 先看first的左侧\n let w = first ? first.outerWidth : 0, h = first ? first.outerHeight : 0;\n w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT];\n h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH]\n + computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM];\n [BORDER_TOP_LEFT_RADIUS, BORDER_BOTTOM_LEFT_RADIUS].forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n let v;\n if(item[1] === PX) {\n v = Math.max(0, item[0]);\n v = Math.min(i ? h : w, v);\n }\n else {\n v = Math.max(0, item[0] * (i ? h : w) * 0.01);\n v = Math.min(i ? h : w, v);\n }\n return v;\n });\n });\n // 再看end的右侧\n w = last ? last.outerWidth : 0;\n h = last ? last.outerHeight : 0;\n [BORDER_TOP_RIGHT_RADIUS, BORDER_BOTTOM_RIGHT_RADIUS].forEach(k => {\n computedStyle[k] = currentStyle[k].map((item, i) => {\n let v;\n if(item[1] === PX) {\n v = Math.max(0, item[0]);\n v = Math.min(i ? h : w, v);\n }\n else {\n v = Math.max(0, item[0] * (i ? h : w) * 0.01);\n v = Math.min(i ? h : w, v);\n }\n return v;\n });\n });\n}\n\nfunction renderBorder(xom, renderMode, ctx, points, color, dx, dy) {\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n ctx.beginPath();\n if(ctx.fillStyle !== color) {\n ctx.fillStyle = color;\n }\n points.forEach(point => {\n canvasPolygon(ctx, point, dx, dy);\n });\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n let s = '';\n points.forEach(point => {\n s += svgPolygon(point);\n });\n xom.virtualDom.bb.push({\n type: 'item',\n tagName: 'path',\n props: [\n ['d', s],\n ['fill', color],\n ],\n });\n }\n}\n\nexport default {\n calPoints,\n calRadius,\n calBorderRadius,\n calBorderRadiusInline,\n renderBorder,\n};\n","// 类型为引用防止json仿造\nconst TYPE_VD = { _: 1 };\nconst TYPE_GM = { _: 2 };\nconst TYPE_CP = { _: 3 };\n\nexport default {\n TYPE_VD,\n TYPE_GM,\n TYPE_CP,\n};\n","import $$type from './$$type';\nimport mx from '../math/matrix';\n\nlet toString = {}.toString;\nfunction isType(type) {\n return function(obj) {\n return toString.call(obj) === '[object ' + type + ']';\n }\n}\n\nlet isObject = isType('Object');\nlet isString = isType('String');\nlet isFunction = isType('Function');\nlet isNumber = isType('Number');\nlet isBoolean = isType('Boolean');\nlet isDate = isType('Date');\n\nlet hasOwn = {}.hasOwnProperty;\nlet fnToString = hasOwn.toString;\nlet ObjectFunctionString = fnToString.call(Object);\n\nfunction isNil(v) {\n return v === undefined || v === null;\n}\n\nfunction joinSourceArray(arr) {\n let res = '';\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n res += joinSourceArray(item);\n }\n else {\n res += stringify(item);\n }\n }\n return res;\n}\n\nfunction stringify(s) {\n if(isNil(s)) {\n return '';\n }\n return s.toString();\n}\n\nfunction encodeHtml(s, prop) {\n if(prop) {\n return s.replace(/\"/g, '"');\n }\n return s.replace(/&/g, '&').replace(/ {\n s += joinDef(item);\n });\n s += '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '
';\n return s;\n}\n\n// 普通元素\nfunction joinVd(vd) {\n if(vd.type === 'item' || vd.type === 'img') {\n let s = '';\n (vd.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n if(vd.tagName === 'text') {\n return '' + vd.content + '';\n }\n return '<' + vd.tagName + s + '/>';\n }\n else if(vd.type === 'text') {\n let s = ``;\n // text有许多lineBox\n (vd.children || []).forEach(item => {\n s += joinVd(item);\n });\n return '' + s + '';\n }\n else if(vd.type === 'dom' || vd.type === 'geom') {\n let s = '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n let { opacity, transform, visibility, mask, overflow, filter, mixBlendMode } = vd;\n return '' + s + '';\n }\n}\n\nfunction joinDef(def) {\n let s = '<' + def.tagName + ' id=\"' + def.uuid + '\"';\n if(def.tagName === 'mask' || def.tagName === 'clipPath') {\n // s += ' maskUnits=\"userSpaceOnUse\"';\n }\n else if(def.tagName === 'filter') {\n // s += ' filterUnits=\"userSpaceOnUse\"';\n }\n else {\n s += ' gradientUnits=\"userSpaceOnUse\"';\n }\n (def.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n (def.children || []).forEach(item => {\n s += joinItem(item);\n });\n s += '';\n return s;\n}\n\nfunction joinItem(item) {\n let s = '<' + item.tagName;\n (item.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n return s;\n}\n\nfunction rgba2int(color) {\n if(Array.isArray(color)) {\n return color;\n }\n let res = [];\n if(!color || color === 'transparent') {\n res = [0, 0, 0, 0];\n }\n else if(color.charAt(0) === '#') {\n color = color.slice(1);\n if(color.length === 3) {\n res.push(parseInt(color.charAt(0) + color.charAt(0), 16));\n res.push(parseInt(color.charAt(1) + color.charAt(1), 16));\n res.push(parseInt(color.charAt(2) + color.charAt(2), 16));\n res[3] = 1;\n }\n else if(color.length === 6) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4), 16));\n res[3] = 1;\n }\n else if(color.length === 8) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4, 6), 16));\n res.push(parseInt(color.slice(6), 16) / 255);\n }\n else {\n res[0] = res[1] = res[2] = 0;\n res[3] = 1;\n }\n }\n else {\n let c = color.match(/rgba?\\s*\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*,\\s*([\\d.]+)(?:\\s*,\\s*([\\d.]+))?\\s*\\)/i);\n if(c) {\n res = [parseInt(c[1]), parseInt(c[2]), parseInt(c[3])];\n if(!isNil(c[4])) {\n res[3] = parseFloat(c[4]);\n }\n else {\n res[3] = 1;\n }\n }\n else {\n res = [0, 0, 0, 0];\n }\n }\n return res;\n}\n\nfunction int2rgba(color) {\n if(Array.isArray(color)) {\n if(color.length === 4) {\n color = color.map((c, i) => i === 3 ? c : Math.floor(Math.max(0, c)));\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n color = color.map(c => Math.floor(c));\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return color || 'rgba(0,0,0,0)';\n}\n\nfunction int2invert(color) {\n if(Array.isArray(color)) {\n color = color.slice(0);\n color[0] = 255 - color[0];\n color[1] = 255 - color[1];\n color[2] = 255 - color[2];\n if(color.length === 4) {\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return 'rgba(0,0,0,0)';\n}\n\nfunction arr2hash(arr) {\n let hash = {};\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n hash[item[0]] = item[1];\n }\n else {\n for(let list = Object.keys(item), j = list.length - 1; j >= 0; j--) {\n let k = list[j];\n hash[k] = item[k];\n }\n }\n }\n return hash;\n}\n\nfunction hash2arr(hash) {\n if(Array.isArray(hash)) {\n return hash;\n }\n let arr = [];\n for(let list = Object.keys(hash), i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n arr.push([k, hash[k]]);\n }\n return arr;\n}\n\nfunction clone(obj) {\n if(isNil(obj) || typeof obj !== 'object') {\n return obj;\n }\n // parse递归会出现内部先返回解析好的json,外部parse不能clone\n if(obj.$$type === $$type.TYPE_VD\n || obj.$$type === $$type.TYPE_GM\n || obj.$$type === $$type.TYPE_CP) {\n return obj;\n }\n if(util.isDate(obj)) {\n return new Date(obj);\n }\n if(!isPlainObject(obj) && !Array.isArray(obj)) {\n return obj;\n }\n let n = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(i => {\n n[i] = clone(obj[i]);\n });\n return n;\n}\n\n/**\n * 简化的arr对比,arr中只有arr和其它类型,其它类型对比值或引用,arr递归\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equalArr(a, b) {\n if(!a || !b) {\n return a === b;\n }\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let ai = a[i];\n let bi = b[i];\n let isArrayA = Array.isArray(ai);\n let isArrayB = Array.isArray(bi);\n if(isArrayA && isArrayB) {\n if(!equalArr(ai, bi)) {\n return false;\n }\n }\n else if(isArrayA || isArrayB) {\n return false;\n }\n else if(ai !== bi) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 深度对比对象\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equal(a, b) {\n if(a === b) {\n return true;\n }\n if(isObject(a) && isObject(b)) {\n let hash = {};\n for(let i = 0, arr = Object.keys(a), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!b.hasOwnProperty(k) || !equal(a[k], b[k])) {\n return false;\n }\n hash[k] = true;\n }\n // a没有b有则false\n for(let i = 0, arr = Object.keys(b), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!hash.hasOwnProperty(k)) {\n return false;\n }\n }\n }\n else if(isDate(a) && isDate(b)) {\n return a.getTime() === b.getTime();\n }\n else if(Array.isArray(a) && Array.isArray(b)) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equal(a[i], b[i])) {\n return false;\n }\n }\n }\n else {\n return a === b;\n }\n return true;\n}\n\nfunction extend(target, source, keys) {\n if(source === null || typeof source !== 'object') {\n return target;\n }\n if(!keys) {\n keys = Object.keys(source);\n }\n let i = 0;\n let len = keys.length;\n while(i < len) {\n let k = keys[i];\n target[k] = source[k];\n i++;\n }\n return target;\n}\n\nfunction joinArr(arr, split) {\n let s = arr.length ? arr[0] : '';\n for(let i = 1, len = arr.length; i < len; i++) {\n s += split + arr[i];\n }\n return s;\n}\n\nfunction extendAnimate(ovd, nvd) {\n let list = nvd.__animationList = ovd.animationList.splice(0);\n list.forEach(item => {\n item.__setTarget(nvd);\n // 事件队列的缘故,可能动画本帧刚执行过,然后再继承,就会缺失,需再次赋值一遍;也有可能停留最后\n if(item.assigning || item.finished && item.__stayEnd()) {\n item.assignCurrentStyle();\n }\n });\n // 帧动画继承\n nvd.__frameAnimateList = ovd.__frameAnimateList.splice(0);\n}\n\nfunction transformBbox(bbox, matrix, dx = 0, dy = 0) {\n if(matrix && !mx.isE(matrix)) {\n let [x1, y1, x2, y2] = bbox;\n // 可能因filter的原因扩展范围\n if(dx) {\n x1 -= dx;\n x2 += dx;\n }\n if(dy) {\n y1 -= dy;\n y2 += dy;\n }\n let list = [x2, y1, x1, y2, x2, y2];\n let w;\n [x1, y1, , w] = mx.calPoint([x1, y1], matrix);\n if(w && w !== 1) {\n x1 /= w;\n y1 /= w;\n }\n let xa = x1, ya = y1, xb = x1, yb = y1;\n for(let i = 0; i < 6; i += 2) {\n let x = list[i], y = list[i + 1];\n [x, y, , w] = mx.calPoint([x, y], matrix);\n if(w && w !== 1) {\n x /= w;\n y /= w;\n }\n xa = Math.min(xa, x);\n xb = Math.max(xb, x);\n ya = Math.min(ya, y);\n yb = Math.max(yb, y);\n }\n bbox = [xa, ya, xb, yb];\n }\n else if(dx || dy) {\n bbox = bbox.slice(0);\n bbox[0] -= dx;\n bbox[1] -= dy;\n bbox[2] += dx;\n bbox[3] += dy;\n }\n return bbox;\n}\n\nfunction isPlainObject(obj) {\n if(!obj || toString.call(obj) !== '[object Object]') {\n return false;\n }\n let proto = Object.getPrototypeOf(obj);\n if(!proto) {\n return true;\n }\n let Ctor = hasOwn.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor === 'function' && fnToString.call(Ctor) === ObjectFunctionString;\n}\n\nfunction assignMatrix(t, v) {\n t[0] = v[0];\n t[1] = v[1];\n t[2] = v[2];\n t[3] = v[3];\n t[4] = v[4];\n t[5] = v[5];\n t[6] = v[6];\n t[7] = v[7];\n t[8] = v[8];\n t[9] = v[9];\n t[10] = v[10];\n t[11] = v[11];\n t[12] = v[12];\n t[13] = v[13];\n t[14] = v[14];\n t[15] = v[15];\n return t;\n}\n\nlet util = {\n isObject,\n isString,\n isFunction,\n isNumber,\n isBoolean,\n isDate,\n isNil,\n isPrimitive(v) {\n return util.isNil(v) || util.isBoolean(v) || util.isString(v) || util.isNumber(v);\n },\n // css中常用undefined/null表示auto本身\n isAuto(v) {\n return isNil(v) || v === 'auto';\n },\n isPlainObject,\n stringify,\n joinSourceArray(arr) {\n return joinSourceArray(arr);\n },\n encodeHtml,\n joinVirtualDom,\n joinVd,\n joinDef,\n rgba2int,\n int2rgba,\n int2invert,\n arr2hash,\n hash2arr,\n clone,\n equalArr,\n equal,\n extend,\n joinArr,\n extendAnimate,\n transformBbox,\n assignMatrix,\n};\n\nexport default util;\n","export default {\n flag: false,\n};\n","export default {\n list: [], // 每次渲染前的更新后,等待测量的文字对象列表\n data: {}, // Text中存入的特殊等待测量的信息,字体+字号+粗细为key\n charWidth: {}, // key的文字宽度hash\n padding: {}, // key的文字宽度偏移,少量字体的少量文字有\n ELLIPSIS: '…',\n};\n","export default {\n alpha: true,\n antialias: true,\n premultipliedAlpha: true,\n preserveDrawingBuffer: true,\n // depth: true,\n // stencil: true,\n};\n","import mx from '../math/matrix';\n\nconst calPoint = mx.calPoint;\n\n/**\n * 初始化 shader\n * @param gl GL context\n * @param vshader vertex shader (string)\n * @param fshader fragment shader (string)\n * @return program, if the program object was created and successfully made current\n */\nfunction initShaders(gl, vshader, fshader) {\n let program = createProgram(gl, vshader, fshader);\n if(!program) {\n throw new Error('Failed to create program');\n }\n\n // 要开启透明度,用以绘制透明的图形\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n return program;\n}\n\n/**\n * Create the linked program object\n * @param gl GL context\n * @param vshader a vertex shader program (string)\n * @param fshader a fragment shader program (string)\n * @return created program object, or null if the creation has failed\n */\nfunction createProgram(gl, vshader, fshader) {\n // Create shader object\n let vertexShader = loadShader(gl, gl.VERTEX_SHADER, vshader);\n let fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fshader);\n if(!vertexShader || !fragmentShader) {\n return null;\n }\n\n // Create a program object\n let program = gl.createProgram();\n if(!program) {\n return null;\n }\n program.vertexShader = vertexShader;\n program.fragmentShader = fragmentShader;\n\n // Attach the shader objects\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n // Link the program object\n gl.linkProgram(program);\n\n // Check the result of linking\n let linked = gl.getProgramParameter(program, gl.LINK_STATUS);\n if(!linked) {\n let error = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n gl.deleteShader(fragmentShader);\n gl.deleteShader(vertexShader);\n throw new Error('Failed to link program: ' + error);\n }\n return program;\n}\n\n/**\n * Create a shader object\n * @param gl GL context\n * @param type the type of the shader object to be created\n * @param source shader program (string)\n * @return created shader object, or null if the creation has failed.\n */\nexport function loadShader(gl, type, source) {\n // Create shader object\n let shader = gl.createShader(type);\n if(shader == null) {\n throw new Error('unable to create shader');\n }\n\n // Set the shader program\n gl.shaderSource(shader, source);\n\n // Compile the shader\n gl.compileShader(shader);\n\n // Check the result of compilation\n let compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if(!compiled) {\n let error = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error('Failed to compile shader: ' + error);\n }\n\n return shader;\n}\n\nfunction convertCoords2Gl([x, y, z, w], cx, cy, revertY) {\n if(z === undefined) {\n z = 0;\n }\n if(w === undefined) {\n w = 1;\n }\n if(w && w !== 1) {\n x /= w;\n y /= w;\n z /= w;\n }\n if(x === cx) {\n x = 0;\n }\n else {\n x = (x - cx) / cx;\n }\n if(y === cy) {\n y = 0;\n }\n else {\n y = (y - cy) / cy;\n if(revertY) {\n y = -y;\n }\n }\n return [x * w, y * w, z * w, w];\n}\n\nfunction createTexture(gl, tex, n, width, height) {\n let texture = gl.createTexture();\n bindTexture(gl, texture, n);\n // gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, -1);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n // 传入高宽时是绑定fbo,且tex一定为null\n if(width && height) {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n // 普通将canvas对象作为纹理\n else {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n return texture;\n}\n\nfunction bindTexture(gl, texture, n) {\n gl.activeTexture(gl['TEXTURE' + n]);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n}\n\n/**\n * texCache集满纹理上传占用最多可用纹理单元后,进行批量顺序绘制\n * 将所有dom的矩形顶点(经过transform变换后的)、贴图坐标、透明度存入3个buffer中,\n * 然后相同纹理单元的形成一批,设置uniform的纹理单元号进行绘制,如此循环\n * @param gl\n * @param list\n * @param hash\n * @param cx\n * @param cy\n * @param revertY\n */\nfunction drawTextureCache(gl, list, hash, cx, cy, revertY) {\n let vtPoint = [], vtTex = [], vtOpacity = [];\n let lastChannel; // 上一个dom的单元号\n let record = [0]; // [num, channel]每一批的数量和单元号记录\n let stack = [record]; // 所有批的数据记录集合\n list.forEach((item, i) => {\n let [cache, opacity, matrix, dx, dy] = item;\n if(i) {\n let channel = hash[cache.page.uuid];\n // 和上一个单元号不同时,生成新的批次记录\n if(lastChannel !== channel) {\n lastChannel = channel;\n record = [0, lastChannel];\n stack.push(record);\n }\n }\n else {\n lastChannel = hash[cache.page.uuid];\n record[1] = lastChannel;\n }\n let { x, y, width, height, page, bbox } = cache;\n // 计算顶点坐标和纹理坐标,转换[0,1]对应关系\n let bx = bbox[0], by = bbox[1];\n let [xa, ya] = [bx + (dx || 0), by + height + (dy || 0)];\n let [xb, yb] = [bx + width + (dx || 0), by + (dy || 0)];\n let [x1, y1, , w1] = calPoint([xa, ya], matrix);\n let [x2, y2, , w2] = calPoint([xb, ya], matrix);\n let [x3, y3, , w3] = calPoint([xb, yb], matrix);\n let [x4, y4, , w4] = calPoint([xa, yb], matrix);\n [x1, y1] = convertCoords2Gl([x1, y1, 0, w1], cx, cy, revertY);\n [x2, y2] = convertCoords2Gl([x2, y2, 0, w2], cx, cy, revertY);\n [x3, y3] = convertCoords2Gl([x3, y3, 0, w3], cx, cy, revertY);\n [x4, y4] = convertCoords2Gl([x4, y4, 0, w4], cx, cy, revertY);\n vtPoint.push(x1, y1, 0, w1, x4, y4, 0, w4, x2, y2, 0, w2, x4, y4, 0, w4, x2, y2, 0, w2, x3, y3, 0, w3);\n let tx1 = x / page.width, ty1 = (y + height) / page.height;\n let tx2 = (x + width) / page.width, ty2 = y / page.height;\n vtTex.push(tx1, ty1, tx1, ty2, tx2, ty1, tx1, ty2, tx2, ty1, tx2, ty2);\n vtOpacity.push(opacity, opacity, opacity, opacity, opacity, opacity);\n record[0]++;\n });\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtPoint), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.program, 'a_position');\n gl.vertexAttribPointer(a_position, 4, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtTex), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // opacity buffer\n let opacityBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, opacityBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtOpacity), gl.STATIC_DRAW);\n let a_opacity = gl.getAttribLocation(gl.program, 'a_opacity');\n gl.vertexAttribPointer(a_opacity, 1, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_opacity);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.program, 'u_texture');\n let count = 0;\n // 循环按批次渲染\n stack.forEach(record => {\n let [num, channel] = record;\n gl.uniform1i(u_texture, channel);\n num *= 6;\n gl.drawArrays(gl.TRIANGLES, count, num);\n count += num;\n });\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.deleteBuffer(opacityBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n gl.disableVertexAttribArray(a_opacity);\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核扩大3倍性能慢\n * x/y方向分开执行,加速性能,计算次数由d*d变为d+d,d为卷积核大小\n * spread由d和sigma计算得出,d由sigma计算得出,sigma即css的blur()参数\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * i和j为total和filter的纹理单元,3次执行(x/y合起来算1次)需互换单元,来回执行源和结果\n * 由total变为filter时cache会各方向上扩展spread的大小到width/height\n * 因此第一次绘制时坐标非1,后面则固定1\n * @param gl\n * @param program\n * @param frameBuffer\n * @param texCache\n * @param tex1 初次绘制目标纹理\n * @param tex2 初次绘制源纹理\n * @param i 初次绘制目标纹理单元\n * @param j 初次绘制源纹理单元\n * @param width\n * @param height\n * @param cx\n * @param cy\n * @param spread\n * @param d\n * @param sigma\n */\nfunction drawBlur(gl, program, frameBuffer, texCache, tex1, tex2, i, j, width, height, cx, cy, spread, d, sigma) {\n // 第一次将total绘制到blur上,此时尺寸存在spread差值,因此不加模糊防止坐标计算问题,仅作为扩展纹理尺寸\n let [x1, y2] = convertCoords2Gl([spread, height - spread], cx, cy);\n let [x2, y1] = convertCoords2Gl([width - spread, spread], cx, cy);\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // direction全0,即无模糊,此时只是进行扩展尺寸操作,还没到模糊所以传0\n let u_direction = gl.getUniformLocation(program, 'u_direction');\n gl.uniform2f(u_direction, 0, 0);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // fbo绑定切换纹理对象和单元索引,同时注意不能向源纹理绘制,因为源是cacheTotal,需要重新生成一个,y方向再来一次\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n /**\n * 反复执行共3次,坐标等均不变,只是切换fbo绑定对象和纹理单元\n * 注意max和ratio的设置,当是100尺寸的正方形时,传给direction的始终为1\n * 当正方形<100时,direction相应地要扩大相对于100的倍数,反之则缩小,如此为了取相邻点坐标时是+-1\n * 当非正方形时,长轴一端为基准值不变,短的要二次扩大比例倍数\n */\n let max = 100 / Math.max(width, height);\n let ratio = width / height;\n let recycle = []; // 3次过程中新生成的中间纹理需要回收\n for(let k = 0; k < 3; k++) {\n let tex3 = createTexture(gl, null, j, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex3, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, max, 0);\n }\n else {\n gl.uniform2f(u_direction, max * ratio, 0);\n }\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n recycle.push(tex1);\n let tex4 = createTexture(gl, null, i, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex4, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, 0, max * ratio);\n }\n else {\n gl.uniform2f(u_direction, 0, max);\n }\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n tex1 = tex4;\n recycle.push(tex3);\n }\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n recycle.forEach(item => gl.deleteTexture(item));\n return tex1;\n}\n\nfunction drawCm(gl, program, i, m) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, i);\n // matrix\n let u_m = gl.getUniformLocation(program, 'u_m');\n gl.uniform1fv(u_m, new Float32Array(m));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\n/**\n * 根据total/filter生成overflow\n * @param gl\n * @param i 输入纹理单元\n * @param dx 二者偏移值\n * @param dy\n * @param width 最终大小\n * @param height\n * @param w 输入纹理大小\n * @param h\n */\nfunction drawOverflow(gl, i, dx, dy, width, height, w, h) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.programOverflow, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer,原本大小width/height,使用其中的w/h\n let x1 = dx / w, y1 = dy / h, x2 = (width + dx) / w, y2 = (height + dy) /h;\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.programOverflow, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.programOverflow, 'u_texture');\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n}\n\nfunction drawMask(gl, i, j, program) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, j);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nfunction drawMbm(gl, program, i, j, W, H) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, i);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nexport default {\n initShaders,\n createTexture,\n bindTexture,\n drawTextureCache,\n drawBlur,\n drawOverflow,\n drawMask,\n drawMbm,\n drawCm,\n};\n","import util from './util';\nimport debug from './debug';\nimport textCache from '../node/textCache';\nimport font from '../style/font';\nimport ca from '../gl/ca';\nimport webgl from '../gl/webgl';\n\nconst SPF = 1000 / 60;\n\nconst CANVAS = {};\nconst WEBGL = {};\nconst CANVAS_LIST = [];\nconst WEBGL_LIST = [];\nconst SUPPORT_OFFSCREEN_CANVAS = typeof OffscreenCanvas === 'function' && util.isFunction(OffscreenCanvas.prototype.getContext);\n\nlet defaultFontFamilyData;\n\nfunction cache(key, width, height, hash, message) {\n let o;\n if(!key) {\n let target = hash === CANVAS ? CANVAS_LIST : WEBGL_LIST;\n if(target.length) {\n o = target.pop();\n }\n else {\n o = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n }\n else if(!hash[key]) {\n o = hash[key] = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n else {\n o = hash[key];\n }\n o.width = width;\n o.height = height;\n if(debug.flag) {\n o.style.width = width + 'px';\n o.style.height = height + 'px';\n o.setAttribute('type', hash === CANVAS ? 'canvas' : 'webgl');\n if(key) {\n o.setAttribute('key', key);\n }\n if(message) {\n o.setAttribute('message', message);\n }\n document.body.appendChild(o);\n }\n let ctx;\n if(hash === CANVAS) {\n ctx = o.getContext('2d');\n }\n else {\n ctx = o.getContext('webgl', ca) || o.getContext('experimental-webgl', ca);\n }\n return {\n canvas: o,\n ctx,\n draw() {\n // 空函数,仅对小程序提供hook特殊处理,flush缓冲\n },\n enabled: true,\n available: true,\n release() {\n if(!key && this.available) {\n if(hash === CANVAS) {\n CANVAS_LIST.push(this.canvas);\n }\n else {\n WEBGL_LIST.push(this.canvas);\n }\n }\n this.available = false;\n },\n };\n}\n\nfunction cacheCanvas(key, width, height, message) {\n return cache(key, width, height, CANVAS, message);\n}\n\nfunction cacheWebgl(key, width, height, message) {\n return cache(key, width, height, WEBGL, message);\n}\n\nconst IMG = {};\nconst INIT = 0;\nconst LOADING = 1;\nconst LOADED = 2;\nconst FONT = {};\nconst COMPONENT = {};\n\nlet inject = {\n measureText() {\n let { list, data } = textCache;\n let html = '';\n let keys = [];\n let lengths = [];\n let chars = [];\n Object.keys(data).forEach(key => {\n let { ff, fs, fw, s } = data[key];\n if(s) {\n keys.push(key);\n lengths.push(s.length);\n let inline = `position:absolute;font-family:${ff};font-size:${fs}px;font-weight:${fw}`;\n for(let i = 0, len = s.length; i < len; i++) {\n let char = s.charAt(i);\n chars.push(char);\n html += `${char.replace(/`;\n }\n data[key].s = '';\n }\n });\n if(!html) {\n return;\n }\n let div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n document.body.appendChild(div);\n div.innerHTML = html;\n let cns = div.childNodes;\n let { charWidth } = textCache;\n let count = 0, index = 0, key;\n for(let i = 0, len = cns.length; i < len; i++) {\n let node = cns[i];\n if(count === 0) {\n key = keys[index];\n }\n if(++count === lengths[index]) {\n index++;\n count = 0;\n }\n let char = chars[i];\n // clientWidth只返回ceil整数,精度必须用getComputedStyle\n let css = window.getComputedStyle(node, null);\n charWidth[key][char] = parseFloat(css.width);\n }\n list.forEach(text => text.__measureCb());\n textCache.list = [];\n textCache.data = {};\n if(!debug.flag) {\n document.body.removeChild(div);\n }\n },\n measureTextSync(key, ff, fs, fw, char) {\n let inline = `position:absolute;font-family:${ff};font-size:${fs}px;font-weight:${fw}`;\n let html = `${char}${char}${char}`;\n let div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n document.body.appendChild(div);\n div.innerHTML = html;\n let cns = div.childNodes;\n let w1 = parseFloat(window.getComputedStyle(cns[0], null).width);\n let w2 = parseFloat(window.getComputedStyle(cns[1], null).width);\n return w1 * 2 - w2;\n },\n IMG,\n INIT,\n LOADED,\n LOADING,\n measureImg(url, cb) {\n if(Array.isArray(url)) {\n if(!url.length) {\n return cb();\n }\n let count = 0;\n let len = url.length;\n let list = [];\n url.forEach((item, i) => {\n inject.measureImg(item, function(cache) {\n list[i] = cache;\n if(++count === len) {\n cb(list);\n }\n });\n });\n return;\n }\n else if(!url || !util.isString(url)) {\n inject.error('Measure img invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\n }\n let cache = IMG[url] = IMG[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb && cb(cache);\n }\n else if(cache.state === LOADING) {\n cb && cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cb && cache.task.push(cb);\n let img = new Image();\n img.onload = function() {\n cache.state = LOADED;\n cache.success = true;\n cache.width = img.width;\n cache.height = img.height;\n cache.source = img;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n img.onerror = function(e) {\n cache.state = LOADED;\n cache.success = false;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n if(url.substr(0, 5) !== 'data:') {\n let host = /^(?:\\w+:)?\\/\\/([^/:]+)/.exec(url);\n if(host) {\n if(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, calUnit } = unit;\nconst { d2r } = geom;\nconst { canvasPolygon, svgPolygon } = painter;\nconst {\n STYLE_KEY: {\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\n\nfunction getLinearDeg(v) {\n let deg = 180;\n if(v === 'to top') {\n deg = 0;\n }\n else if(v === 'to top right') {\n deg = 45;\n }\n else if(v === 'to right') {\n deg = 90;\n }\n else if(v === 'to bottom right') {\n deg = 135;\n }\n else if(v === 'to bottom') {\n }\n else if(v === 'to bottom left') {\n deg = 225;\n }\n else if(v === 'to left') {\n deg = 270;\n }\n else if(v === 'to top left') {\n deg = 315;\n }\n // 数字角度,没有的话取默认角度\n else {\n let match = /([-+]?[\\d.]+)deg/.exec(v);\n if(match) {\n deg = parseFloat(match[1]);\n }\n }\n return deg % 360;\n}\n\nfunction getRadialPosition(data) {\n if(/^[-+]?[\\d.]/.test(data)) {\n let v = calUnit(data);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[data] || 50,\n PERCENT,\n ];\n }\n}\n\n// 获取color-stop区间范围,去除无用值\nfunction getColorStop(v, length, root) {\n let list = [];\n let firstColor = v[0][0];\n // 先把已经声明距离的换算成[0,1]以数组形式存入,未声明的原样存入\n for(let i = 0, len = v.length; i < len; i++) {\n let item = v[i];\n // 考虑是否声明了位置\n if(item.length > 1) {\n let p = item[1];\n if(p[1] === PERCENT) {\n list.push([item[0], p[0] * 0.01]);\n }\n else if(p[1] === REM) {\n list.push([item[0], p[0] * root.computedStyle[FONT_SIZE] / length]);\n }\n else if(p[1] === VW) {\n list.push([item[0], p[0] * root.width / length]);\n }\n else if(p[1] === VH) {\n list.push([item[0], p[0] * root.height / length]);\n }\n else {\n list.push([item[0], p[0] / length]);\n }\n }\n else {\n list.push([item[0]]);\n }\n }\n if(list.length === 1) {\n list.push(util.clone(list[0]));\n }\n // 首尾不声明默认为[0, 1]\n if(list[0].length === 1) {\n list[0].push(0);\n }\n if(list.length > 1) {\n let i = list.length - 1;\n if(list[i].length === 1) {\n list[i].push(1);\n }\n }\n // 找到未声明位置的,需区间计算,找到连续的未声明的,前后的区间平分\n let start = list[0][1];\n for(let i = 1, len = list.length; i < len - 1; i++) {\n let item = list[i];\n if(item.length > 1) {\n start = item[1];\n }\n else {\n let j = i + 1;\n let end = list[list.length - 1][1];\n for(; j < len - 1; j++) {\n let item = list[j];\n if(item.length > 1) {\n end = item[1];\n break;\n }\n }\n let num = j - i + 1;\n let per = (end - start) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.push(start + per * (k + 1 - i));\n }\n i = j;\n }\n }\n // 每个不能小于前面的,canvas/svg不能兼容这种情况,需处理\n for(let i = 1, len = list.length; i < len; i++) {\n let item = list[i];\n let prev = list[i - 1];\n if(item[1] < prev[1]) {\n item[1] = prev[1];\n }\n }\n // 0之前的和1之后的要过滤掉\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item[1] > 1) {\n list.splice(i);\n let prev = list[i - 1];\n if(prev && prev[1] < 1) {\n let dr = item[0][0] - prev[0][0];\n let dg = item[0][1] - prev[0][1];\n let db = item[0][2] - prev[0][2];\n let da = item[0][3] - prev[0][3];\n let p = (1 - prev[1]) / (item[1] - prev[1]);\n list.push([\n [\n item[0][0] + dr * p,\n item[0][1] + dg * p,\n item[0][2] + db * p,\n item[0][3] + da * p,\n ],\n 1],\n );\n }\n break;\n }\n }\n for(let i = list.length - 1; i >= 0; i--) {\n let item = list[i];\n if(item[1] < 0) {\n list.splice(0, i + 1);\n let next = list[i];\n if(next && next[1] > 0) {\n let dr = next[0][0] - item[0][0];\n let dg = next[0][1] - item[0][1];\n let db = next[0][2] - item[0][2];\n let da = next[0][3] - item[0][3];\n let p = (-item[1]) / (next[1] - item[1]);\n list.unshift([\n [\n item[0][0] + dr * p,\n item[0][1] + dg * p,\n item[0][2] + db * p,\n item[0][3] + da * p,\n ],\n 0],\n );\n }\n break;\n }\n }\n // 可能存在超限情况,如在使用px单位超过len或 {\n // item[0] = int2rgba(item[0]);\n if(item[1] < 0) {\n item[1] = 0;\n }\n else if(item[1] > 1) {\n item[1] = 1;\n }\n });\n // 都超限时,第一个颜色兜底\n if(!list.length) {\n list.push([firstColor, 0]);\n }\n return list;\n}\n\n// 根据角度和圆心获取渐变的4个点坐标\nfunction calLinearCoords(deg, length, cx, cy) {\n let x0;\n let y0;\n let x1;\n let y1;\n if(deg >= 270) {\n let r = d2r(360 - deg);\n x0 = cx + Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n else if(deg >= 180) {\n let r = d2r(deg - 180);\n x0 = cx + Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx - Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else if(deg >= 90) {\n let r = d2r(180 - deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy - Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy + Math.cos(r) * length;\n }\n else {\n let r = d2r(deg);\n x0 = cx - Math.sin(r) * length;\n y0 = cy + Math.cos(r) * length;\n x1 = cx + Math.sin(r) * length;\n y1 = cy - Math.cos(r) * length;\n }\n return [x0, y0, x1, y1];\n}\n\nfunction calCircleCentre(position, x1, y1, iw, ih, root) {\n let cx, cy;\n let positionX = position[0], positionY = position[1];\n if(positionX[1] === PERCENT) {\n cx = x1 + positionX[0] * iw * 0.01;\n }\n else if(positionX[1] === REM) {\n cx = x1 + positionX[0] * root.computedStyle[FONT_SIZE];\n }\n else if(positionX[1] === VW) {\n cx = x1 + positionX[0] * root.width * 0.01;\n }\n else if(positionX[1] === VH) {\n cx = x1 + positionX[0] * root.height * 0.01;\n }\n else {\n cx = x1 + positionX[0];\n }\n if(positionY[1] === PERCENT) {\n cy = y1 + positionY[0] * ih * 0.01;\n }\n else if(positionY[1] === REM) {\n cy = y1 + positionY[0] * root.computedStyle[FONT_SIZE];\n }\n else if(positionY[1] === VW) {\n cy = y1 + positionY[0] * root.width * 0.01;\n }\n else if(positionY[1] === VH) {\n cy = y1 + positionY[0] * root.height * 0.01;\n }\n else {\n cy = y1 + positionY[0];\n }\n return [cx, cy];\n}\n\n// 获取径向渐变圆心半径\nfunction calRadialRadius(shape, size, position, iw, ih, x1, y1, x2, y2, root) {\n let cx, cy, xl, yl, r, 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.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]);\n if(position) {\n let x = getRadialPosition(position[1]);\n let y = position[2] ? getRadialPosition(position[2]) : x;\n o.p = [x, y];\n }\n else {\n o.p = [[50, PERCENT], [50, PERCENT]];\n }\n }\n else if(o.k === 'conic') {\n let deg = /([-+]?[\\d.]+deg)/i.exec(gradient[2]);\n if(deg) {\n o.d = parseFloat(deg[0]) % 360;\n }\n else {\n o.d = 0;\n }\n let position = /at\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center))(?:\\s+((?:[-+]?[\\d.]+[pxremvwh%]*)|(?:left|top|right|bottom|center)))?/i.exec(gradient[2]);\n if(position) {\n let x = getRadialPosition(position[1]);\n let y = position[2] ? getRadialPosition(position[2]) : x;\n o.p = [x, y];\n }\n else {\n o.p = [[50, PERCENT], [50, PERCENT]];\n }\n }\n let v = gradient[2].match(/([-+]?[\\d.]+[pxremvwh%]+)?\\s*((#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))\\s*([-+]?[\\d.]+[pxremvwh%]+)?/ig) || [];\n o.v = v.map(item => {\n let color = /((?:#[0-9a-f]{3,8})|(?:rgba?\\s*\\(.+?\\)))/i.exec(item);\n let arr = [rgba2int(color[1])];\n let percent = /[-+]?[\\d.]+[pxremvwh%]+/.exec(item);\n if(percent) {\n let v = calUnit(percent[0]);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n arr[1] = v;\n }\n return arr;\n });\n return o;\n }\n}\n\nfunction getLinear(v, d, ox, oy, cx, cy, w, h, root, 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: '#000',\n borderRightColor: '#000',\n borderBottomColor: '#000',\n borderLeftColor: '#000',\n borderTopStyle: 'solid',\n borderRightStyle: 'solid',\n borderBottomStyle: 'solid',\n borderLeftStyle: 'solid',\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomLeftRadius: 0,\n width: 'auto',\n height: 'auto',\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto',\n flexDirection: 'row',\n flexWrap: 'nowrap',\n order: 0,\n justifyContent: 'flexStart',\n alignItems: 'stretch',\n alignSelf: 'auto',\n alignContent: 'stretch',\n textAlign: 'inherit',\n letterSpacing: 'inherit',\n transformOrigin: 'center',\n visibility: 'inherit',\n opacity: 1,\n zIndex: 0,\n transform: null,\n translateX: 0,\n translateY: 0,\n translateZ: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n skewX: 0,\n skewY: 0,\n rotateX: 0,\n rotateY: 0,\n rotateZ: 0,\n rotate3d: '0, 0, 0, 0',\n perspective: 0,\n perspectiveOrigin: 'center',\n filter: null,\n boxShadow: null,\n pointerEvents: 'inherit',\n overflow: 'visible',\n mixBlendMode: 'normal',\n whiteSpace: 'inherit',\n textOverflow: 'clip',\n lineClamp: 0,\n textStrokeWidth: 'inherit',\n textStrokeColor: 'inherit',\n textStrokeOver: 'inherit',\n};\n\nconst GEOM = {\n fill: 'transparent',\n stroke: '#000',\n strokeWidth: 1,\n strokeDasharray: '',\n strokeLinecap: 'butt',\n strokeLinejoin: 'miter',\n strokeMiterlimit: 4,\n fillRule: 'nonzero',\n};\n\nlet DOM_ENTRY_SET = [];\nlet DOM_KEY_SET = [];\nObject.keys(DOM).forEach(k => {\n DOM_KEY_SET.push(k);\n let v = DOM[k];\n DOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet GEOM_ENTRY_SET = [];\nlet GEOM_KEY_SET = [];\nObject.keys(GEOM).forEach(k => {\n GEOM_KEY_SET.push(k);\n let v = GEOM[k];\n GEOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet INHERIT = {\n fontFamily: 'arial',\n fontSize: 16,\n fontWeight: 400,\n fontStyle: 'normal',\n color: '#000',\n textAlign: 'left',\n visibility: 'visible',\n pointerEvents: 'auto',\n textStrokeColor: '#000',\n textStrokeWidth: 1,\n textStrokeOver: 'none',\n};\n\nlet INHERIT_KEY_SET = [];\nObject.keys(INHERIT).forEach(k => {\n INHERIT_KEY_SET.push(k);\n});\n\nexport default {\n DOM,\n GEOM,\n isValid(i) {\n return DOM.hasOwnProperty(i) || GEOM.hasOwnProperty(i);\n },\n DOM_KEY_SET,\n GEOM_KEY_SET,\n DOM_ENTRY_SET,\n GEOM_ENTRY_SET,\n INHERIT,\n INHERIT_KEY_SET,\n};\n","import reg from './reg';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction parseFlex(style, grow, shrink, basis) {\n if(isNil(style.flexGrow)) {\n style.flexGrow = grow || 0;\n }\n if(isNil(style.flexShrink)) {\n style.flexShrink = shrink || 0;\n }\n if(isNil(style.flexBasis)) {\n style.flexBasis = basis || 0;\n }\n}\n\nfunction parseMarginPadding(style, key, list) {\n let temp = style[key];\n if(!isNil(temp)) {\n let match = temp.toString().match(/([-+]?[\\d.]+[pxremvwh%]*)|(auto)/ig);\n if(match) {\n if(match.length === 1) {\n match[3] = match[2] = match[1] = match[0];\n }\n else if(match.length === 2) {\n match[2] = match[0];\n match[3] = match[1];\n }\n else if(match.length === 3) {\n match[3] = match[1];\n }\n list.forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = match[i];\n }\n });\n }\n }\n}\n\nfunction parseOneBorder(style, k) {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n // 后面会统一格式化处理\n if(isNil(style[k + 'Width'])) {\n let w = /\\b[\\d.]+[pxremvwh%]*\\b/i.exec(v);\n style[k + 'Width'] = w ? w[0] : 0;\n }\n if(isNil(style[k + 'Style'])) {\n let s = /\\b(solid|dashed|dotted)\\b/i.exec(v);\n style[k + 'Style'] = s ? s[1] : 'solid';\n }\n if(isNil(style[k + 'Color'])) {\n let c = /#[0-9a-f]{3,8}/i.exec(v);\n if(c && [4, 7, 9].indexOf(c[0].length) > -1) {\n style[k + 'Color'] = c[0];\n }\n else if(/\\btransparent\\b/i.test(v)) {\n style[k + 'Color'] = 'transparent';\n }\n else {\n c = /rgba?\\s*\\(.+\\)/i.exec(v);\n style[k + 'Color'] = c ? c[0] : 'transparent';\n }\n }\n}\n\nexport default {\n margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'],\n padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n border: ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'],\n borderTop: ['borderTopWidth', 'borderTopStyle', 'borderTopColor'],\n borderRight: ['borderRightWidth', 'borderRightStyle', 'borderRightColor'],\n borderBottom: ['borderBottomWidth', 'borderBottomStyle', 'borderBottomColor'],\n borderLeft: ['borderLeftWidth', 'borderLeftStyle', 'borderLeftColor'],\n borderWidth: ['borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth'],\n borderColor: ['borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor'],\n borderStyle: ['borderTopStyle', 'borderRightStyle', 'borderBottomStyle', 'borderLeftStyle'],\n borderRadius: ['borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'],\n background: ['backgroundColor', 'backgroundImage', 'backgroundRepeat', 'backgroundPosition'],\n backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n flex: ['flexGrow', 'flexShrink', 'flexBasis'],\n translate: ['translateX', 'translateY'],\n translate3d: ['translateX', 'translateY', 'translateY'],\n scale: ['scaleX', 'scaleY'],\n scale3d: ['scaleX', 'scaleY', 'scaleZ'],\n rotate: ['rotateZ'],\n skew: ['skewX', 'skewY'],\n textStroke: ['textStrokeWidth', 'textStrokeColor', 'textStrokeOver'],\n\n toFull(style, k) {\n let v = style[k];\n if(k === 'background') {\n // bg缩写多个时有color则必须是最后一个\n if(Array.isArray(v)) {\n let length = v.length;\n if(isNil(style.backgroundColor)) {\n let bgc = /^\\s*((transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\)))/i.exec(v[length - 1]);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.slice(0, length - 1);\n }\n }\n let bgi = [];\n let bgr = [];\n let bgp = [];\n v.forEach(item => {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(item);\n if(gd) {\n bgi.push(gd[0]);\n item = item.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n bgi.push(img[0]);\n item = item.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-?)?repeat(-?[xy])?/i.exec(item);\n if(repeat) {\n bgr.push(repeat[0].toLowerCase());\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = item.match(reg.position);\n if(position) {\n bgp.push(position.join(' '));\n }\n }\n });\n if(bgi.length) {\n style.backgroundImage = bgi;\n }\n if(bgr.length) {\n style.backgroundRepeat = bgr;\n }\n if(bgp.length) {\n style.backgroundPosition = bgp;\n this.toFull(style, 'backgroundPosition');\n }\n }\n else {\n if(isNil(style.backgroundImage)) {\n let gd = reg.gradient.exec(v);\n if(gd) {\n style.backgroundImage = gd[0];\n v = v.replace(gd[0], '');\n }\n else {\n let img = reg.img.exec(v);\n if(img) {\n style.backgroundImage = img[0];\n v = v.replace(img[0], '');\n }\n }\n }\n if(isNil(style.backgroundRepeat)) {\n let repeat = /(no-?)?repeat(-?[xy])?/i.exec(v);\n if(repeat) {\n style.backgroundRepeat = repeat[0].toLowerCase();\n }\n }\n if(isNil(style.backgroundColor)) {\n let bgc = /^(transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\))/i.exec(v);\n if(bgc) {\n style.backgroundColor = bgc[0];\n v = v.replace(bgc[0], '');\n }\n }\n if(isNil(style.backgroundPosition)) {\n let position = v.match(reg.position);\n if(position) {\n style.backgroundPosition = position.join(' ');\n this.toFull(style, 'backgroundPosition');\n }\n }\n }\n }\n else if(k === 'flex') {\n if(v === 'none') {\n parseFlex(style, 0, 0, 'auto');\n }\n else if(v === 'auto') {\n parseFlex(style, 1, 1, 'auto');\n }\n else if(/^[\\d.]+\\s+[\\d.]+\\s+(auto|none|content)/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]);\n }\n else if(/^[\\d.]+\\s+[\\d.]+\\s+[\\d.]+[pxremvwh%]*/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), arr[2]);\n }\n else if(/^[\\d.]+\\s+[\\d.]+$/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), parseFloat(arr[1]), 0);\n }\n else if(/^[\\d.]+\\s+[\\d.]+[pxremvwh%]+/.test(v)) {\n let arr = v.split(/\\s+/);\n parseFlex(style, parseFloat(arr[0]), 1, arr[1]);\n }\n else if(/^[\\d.]+$/.test(v)) {\n parseFlex(style, parseFloat(v), 1, 0);\n }\n else if(/^[\\d.]+[pxremvwh%]+/i.test(v)) {\n parseFlex(style, 1, 1, v);\n }\n else {\n parseFlex(style, 0, 1, 'auto');\n }\n }\n else if(k === 'flexFlow') {\n v = v.toString().split(/\\s+/);\n if(v.length) {\n if(isNil(style.flexDirection)) {\n }\n style.flexDirection = v[0];\n if(v.length > 1) {\n style.flexWrap = v[1];\n }\n }\n }\n else if(k === 'borderRadius') {\n // borderRadius缩写很特殊,/分隔x/y,然后上右下左4个\n v = v.toString().split('/');\n if(v.length === 1) {\n v[1] = v[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = v[i].toString().split(/\\s+/);\n if(item.length === 0) {\n v[i] = [0, 0, 0, 0];\n }\n else if(item.length === 1) {\n v[i] = [item[0], item[0], item[0], item[0]];\n }\n else if(item.length === 2) {\n v[i] = [item[0], item[1], item[0], item[1]];\n }\n else if(item.length === 3) {\n v[i] = [item[0], item[1], item[2], item[1]];\n }\n else {\n v[i] = item.slice(0, 4);\n }\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = v[0][i] + ' ' + v[1][i];\n }\n });\n }\n else if(k === 'backgroundPosition') {\n if(!Array.isArray(v)) {\n v = [v];\n }\n let isEmpty = this[k].map(k2 => isNil(style[k2]));\n v.forEach(v2 => {\n v2 = v2.toString().split(/\\s+/);\n if(v2.length === 1) {\n v2[1] = '50%';\n }\n this[k].forEach((k2, i) => {\n if(isEmpty[i]) {\n style[k2] = style[k2] || [];\n style[k2].push(v2[i]);\n }\n });\n });\n }\n else if(['translate', 'scale', 'skew'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(['translate3d', 'scale3d'].indexOf(k) > -1) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[2] = arr[1] = arr[0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? 1 : 0;\n }\n this[k].forEach((k, i) => {\n if(isNil(style[k])) {\n style[k] = arr[i];\n }\n });\n }\n else if(k === 'margin' || k === 'padding') {\n parseMarginPadding(style, k, this[k]);\n }\n else if(/^border((Top)|(Right)|(Bottom)|(Left))$/.test(k)) {\n parseOneBorder(style, k);\n }\n else if(k === 'textStroke') {\n let w = /(?:^|\\s)([-+]?[\\d.]+[pxremvwh%]*)/.exec(v);\n if(w) {\n style.textStrokeWidth = w[1];\n }\n let c = /(transparent)|(#[0-9a-f]{3,8})|(rgba?\\s*\\(.+?\\))/i.exec(v);\n if(c) {\n style.textStrokeColor = c[0];\n }\n if(/\\bfill\\b/i.test(v)) {\n style.textStrokeOver = 'fill';\n }\n else {\n style.textStrokeOver = 'none';\n }\n }\n else if(this[k]) {\n this[k].forEach(k => {\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n }\n return style;\n }\n};\n","import enums from '../util/enums';\n\nconst { STYLE_KEY } = enums;\n\nconst KEY_COLOR = [\n [STYLE_KEY.BACKGROUND_COLOR],\n [STYLE_KEY.BORDER_BOTTOM_COLOR],\n [STYLE_KEY.BORDER_LEFT_COLOR],\n [STYLE_KEY.BORDER_RIGHT_COLOR],\n [STYLE_KEY.BORDER_TOP_COLOR],\n [STYLE_KEY.COLOR],\n [STYLE_KEY.TEXT_STROKE_COLOR],\n];\n\nconst KEY_LENGTH = [\n [STYLE_KEY.FONT_SIZE],\n [STYLE_KEY.BORDER_BOTTOM_WIDTH],\n [STYLE_KEY.BORDER_LEFT_WIDTH],\n [STYLE_KEY.BORDER_RIGHT_WIDTH],\n [STYLE_KEY.BORDER_TOP_WIDTH],\n [STYLE_KEY.LEFT],\n [STYLE_KEY.TOP],\n [STYLE_KEY.RIGHT],\n [STYLE_KEY.BOTTOM],\n [STYLE_KEY.FLEX_BASIS],\n [STYLE_KEY.WIDTH],\n [STYLE_KEY.HEIGHT],\n [STYLE_KEY.LINE_HEIGHT],\n [STYLE_KEY.MARGIN_BOTTOM],\n [STYLE_KEY.MARGIN_LEFT],\n [STYLE_KEY.MARGIN_TOP],\n [STYLE_KEY.MARGIN_RIGHT],\n [STYLE_KEY.PADDING_TOP],\n [STYLE_KEY.PADDING_RIGHT],\n [STYLE_KEY.PADDING_BOTTOM],\n [STYLE_KEY.PADDING_LEFT],\n [STYLE_KEY.STROKE_WIDTH],\n [STYLE_KEY.STROKE_MITERLIMIT],\n [STYLE_KEY.LETTER_SPACING],\n [STYLE_KEY.PERSPECTIVE],\n [STYLE_KEY.TEXT_STROKE_WIDTH],\n];\n\nconst KEY_GRADIENT = [\n [STYLE_KEY.BACKGROUND_IMAGE],\n [STYLE_KEY.FILL],\n [STYLE_KEY.STROKE],\n];\n\nconst KEY_RADIUS = [\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS],\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS],\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS],\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS],\n];\n\nconst COLOR_HASH = {};\nKEY_COLOR.forEach(k => {\n COLOR_HASH[k] = true;\n});\n\nconst LENGTH_HASH = {};\nKEY_LENGTH.forEach(k => {\n LENGTH_HASH[k] = true;\n});\n\nconst RADIUS_HASH = {};\nKEY_RADIUS.forEach(k => {\n RADIUS_HASH[k] = true;\n});\n\nconst GRADIENT_HASH = {};\nKEY_GRADIENT.forEach(k => {\n GRADIENT_HASH[k] = true;\n});\n\nconst GRADIENT_TYPE = {\n linear: true,\n radial: true,\n conic: true,\n};\n\nconst KEY_EXPAND = [\n [STYLE_KEY.TRANSLATE_X],\n [STYLE_KEY.TRANSLATE_Y],\n [STYLE_KEY.TRANSLATE_Z],\n [STYLE_KEY.SKEW_X],\n [STYLE_KEY.SKEW_Y],\n [STYLE_KEY.SCALE_X],\n [STYLE_KEY.SCALE_Y],\n [STYLE_KEY.SCALE_Z],\n [STYLE_KEY.ROTATE_X],\n [STYLE_KEY.ROTATE_Y],\n [STYLE_KEY.ROTATE_Z],\n];\n\nconst EXPAND_HASH = {};\nKEY_EXPAND.forEach(k => {\n EXPAND_HASH[k] = true;\n});\n\nexport default {\n KEY_COLOR,\n KEY_EXPAND,\n KEY_GRADIENT,\n KEY_LENGTH,\n KEY_RADIUS,\n COLOR_HASH,\n EXPAND_HASH,\n GRADIENT_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_TYPE,\n};\n","import reset from '../style/reset';\nimport unit from '../style/unit';\nimport enums from '../util/enums';\n\nconst { DOM: RESET_DOM, GEOM: RESET_GEOM } = reset;\nconst { INHERIT } = unit;\nconst { STYLE_KEY } = enums;\n\nconst GEOM = {};\nconst GEOM_KEY_SET = [];\nconst IGNORE = {\n [STYLE_KEY.POINTER_EVENTS]: true,\n};\nconst REPAINT = {\n [STYLE_KEY.TRANSFORM]: true,\n [STYLE_KEY.TRANSLATE_X]: true,\n [STYLE_KEY.TRANSLATE_Y]: true,\n [STYLE_KEY.SKEW_X]: true,\n [STYLE_KEY.SKEW_Y]: true,\n [STYLE_KEY.SCALE_X]: true,\n [STYLE_KEY.SCALE_Y]: true,\n [STYLE_KEY.ROTATE_Z]: true,\n [STYLE_KEY.COLOR]: true,\n [STYLE_KEY.FONT_STYLE]: true,\n [STYLE_KEY.STROKE_WIDTH]: true,\n [STYLE_KEY.FILL]: true,\n [STYLE_KEY.STROKE_DASHARRAY]: true,\n [STYLE_KEY.STROKE_LINECAP]: true,\n [STYLE_KEY.STROKE_LINEJOIN]: true,\n [STYLE_KEY.STROKE_MITERLIMIT]: true,\n [STYLE_KEY.BACKGROUND_COLOR]: true,\n [STYLE_KEY.BACKGROUND_IMAGE]: true,\n [STYLE_KEY.BACKGROUND_POSITION_X]: true,\n [STYLE_KEY.BACKGROUND_POSITION_Y]: true,\n [STYLE_KEY.BACKGROUND_REPEAT]: true,\n [STYLE_KEY.BACKGROUND_SIZE]: true,\n [STYLE_KEY.STROKE]: true,\n [STYLE_KEY.BORDER_BOTTOM_COLOR]: true,\n [STYLE_KEY.BORDER_LEFT_COLOR]: true,\n [STYLE_KEY.BORDER_RIGHT_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS]: true,\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS]: true,\n [STYLE_KEY.VISIBILITY]: true,\n [STYLE_KEY.OPACITY]: true,\n [STYLE_KEY.Z_INDEX]: true,\n [STYLE_KEY.FILTER]: true,\n [STYLE_KEY.BOX_SHADOW]: true,\n [STYLE_KEY.OVERFLOW]: true,\n [STYLE_KEY.BACKGROUND_CLIP]: true,\n [STYLE_KEY.TEXT_STROKE_WIDTH]: true,\n [STYLE_KEY.TEXT_STROKE_COLOR]: true,\n [STYLE_KEY.TEXT_STROKE_OVER]: true,\n};\nconst MEASURE = {\n [STYLE_KEY.FONT_SIZE]: true,\n [STYLE_KEY.FONT_WEIGHT]: true,\n [STYLE_KEY.FONT_FAMILY]: true,\n};\n\nlet o = {\n GEOM,\n GEOM_KEY_SET,\n IGNORE,\n REPAINT,\n MEASURE,\n addGeom(tagName, ks, cb) {\n if(Array.isArray(ks)) {\n ks.forEach(k => {\n o.addGeom(tagName, k, cb);\n });\n }\n else if(ks) {\n if(!GEOM.hasOwnProperty(ks)) {\n GEOM_KEY_SET.push(ks);\n }\n let hash = GEOM[ks] = GEOM[ks] || {};\n hash[tagName] = cb || true;\n }\n },\n 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, calUnit } = unit;\nconst { isNil, rgba2int, equalArr } = util;\nconst { MEASURE_KEY_SET, isGeom, GEOM, GEOM_KEY_SET } = change;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nconst TRANSFORM_HASH = {\n translateX: TRANSLATE_X,\n translateY: TRANSLATE_Y,\n translateZ: TRANSLATE_Z,\n scaleX: SCALE_X,\n scaleY: SCALE_Y,\n scaleZ: SCALE_Z,\n skewX: SKEW_X,\n skewY: SKEW_Y,\n rotateX: ROTATE_X,\n rotateY: ROTATE_Y,\n rotateZ: ROTATE_Z,\n rotate: ROTATE_Z,\n};\n\nfunction compatibleTransform(k, arr) {\n if(k === SCALE_X || k === SCALE_Y || k === SCALE_Z) {\n arr[1] = NUMBER;\n }\n else if(k === TRANSLATE_X || k === TRANSLATE_Y || k === TRANSLATE_Z) {\n if(arr[1] === NUMBER) {\n arr[1] = PX;\n }\n }\n else if(k === PERSPECTIVE) {\n if([NUMBER, PERCENT, DEG].indexOf(arr[1]) > -1) {\n arr[1] = PX;\n }\n }\n else {\n if(arr[1] === NUMBER) {\n arr[1] = DEG;\n }\n }\n}\n\n/**\n * 将传入的手写style标准化,并且用reset默认值覆盖其中为空的\n * @param style 手写的style样式\n * @param reset 默认样式,可选\n * @returns Object 标准化的枚举数组结构样式\n */\nfunction normalize(style, reset = []) {\n if(!util.isObject(style)) {\n return {};\n }\n let res = {};\n // style只有单层无需深度clone\n style = util.extend({}, style);\n // 缩写提前处理,因为reset里没有缩写\n let temp = style.border;\n if(temp) {\n abbr.toFull(style, 'border');\n }\n ['borderTop', 'borderRight', 'borderBottom', 'borderLeft'].forEach(k => {\n abbr.toFull(style, k);\n });\n temp = style.borderWidth;\n if(temp) {\n abbr.toFull(style, 'borderWidth');\n }\n temp = style.borderColor;\n if(temp) {\n abbr.toFull(style, 'borderColor');\n }\n temp = style.borderStyle;\n if(temp) {\n abbr.toFull(style, 'borderStyle');\n }\n temp = style.borderRadius;\n if(temp) {\n abbr.toFull(style, 'borderRadius');\n }\n temp = style.background;\n // 处理渐变背景缩写\n if(temp) {\n abbr.toFull(style, 'background');\n }\n // 背景位置\n temp = style.backgroundPosition;\n if(!isNil(temp)) {\n abbr.toFull(style, 'backgroundPosition');\n }\n // flex\n temp = style.flex;\n if(temp) {\n abbr.toFull(style, 'flex');\n }\n // flex-flow\n temp = style.flexFlow;\n if(temp) {\n abbr.toFull(style, 'flexFlow');\n }\n temp = style.margin;\n if(!isNil(temp)) {\n abbr.toFull(style, 'margin');\n }\n temp = style.padding;\n if(!isNil(temp)) {\n abbr.toFull(style, 'padding');\n }\n temp = style.textStroke;\n if(temp) {\n abbr.toFull(style, 'textStroke');\n }\n // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform\n ['translate', 'scale', 'skew', 'translate3d', 'scale3d', 'rotate'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n abbr.toFull(style, k);\n }\n });\n // 扩展的不能和transform混用,给出警告\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate3d',\n ].forEach(k => {\n let v = style[k];\n if(!isNil(v) && style.transform) {\n inject.warn(`Can not use expand style \"${k}\" with transform`);\n }\n });\n // 默认reset,根据传入不同,当style为空时覆盖\n reset.forEach(item => {\n let { k, v } = item;\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n // 背景图\n temp = style.backgroundImage;\n if(temp !== undefined) {\n if(!temp) {\n res[BACKGROUND_IMAGE] = [null];\n }\n else if(Array.isArray(temp)) {\n res[BACKGROUND_IMAGE] = temp.map(item => {\n if(!item) {\n return null;\n }\n if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n if(reg.img.test(item)) {\n return reg.img.exec(item)[2];\n }\n return null;\n });\n }\n // 区分是渐变色还是图\n else if(reg.gradient.test(temp)) {\n res[BACKGROUND_IMAGE] = [gradient.parseGradient(temp)];\n }\n else if(reg.img.test(temp)) {\n res[BACKGROUND_IMAGE] = [reg.img.exec(temp)[2]];\n }\n else {\n res[BACKGROUND_IMAGE] = [null];\n }\n }\n temp = style.backgroundColor;\n if(temp) {\n // 先赋值默认透明,后续操作有合法值覆盖\n let bgc = /^#[0-9a-f]{3,8}/i.exec(temp);\n if(bgc && [4, 7, 9].indexOf(bgc[0].length) > -1) {\n res[BACKGROUND_COLOR] = [rgba2int(bgc[0]), RGBA];\n }\n else {\n bgc = /rgba?\\s*\\(.+\\)/i.exec(temp);\n res[BACKGROUND_COLOR] = [rgba2int(bgc ? bgc[0] : [0, 0, 0, 0]), RGBA];\n }\n }\n ['backgroundPositionX', 'backgroundPositionY'].forEach((k, i) => {\n temp = style[k];\n if(!isNil(temp)) {\n k = i ? BACKGROUND_POSITION_Y : BACKGROUND_POSITION_X;\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[k] = temp.map(item => {\n if(/^[-+]?[\\d.]/.test(item)) {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item] || 0,\n PERCENT,\n ];\n }\n });\n }\n });\n // 背景尺寸\n temp = style.backgroundSize;\n if(temp) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[BACKGROUND_SIZE] = temp.map(item => {\n if(!item) {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n let match = item.toString().match(/\\b(?:([-+]?[\\d.]+[pxremvwh%]*)|(contain|cover|auto))/ig);\n if(match) {\n if(match.length === 1) {\n if(match[0] === 'contain' || match[0] === 'cover') {\n match[1] = match[0];\n }\n else {\n match[1] = 'auto';\n }\n }\n let v = [];\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n v.push(n);\n }\n else if(item === 'contain' || item === 'cover') {\n v.push([item, STRING]);\n }\n else {\n v.push([0, AUTO]);\n }\n }\n return v;\n }\n else {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n });\n }\n // border-color\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k + 'Color';\n let v = style[k];\n if(!isNil(v)) {\n res[STYLE_KEY[style2Upper(k)]] = [rgba2int(v), RGBA];\n }\n });\n // border-radius\n ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'].forEach(k => {\n k = 'border' + k + 'Radius';\n let v = style[k];\n if(!isNil(v)) {\n let arr = v.toString().split(/\\s+/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = arr[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n if(n[0] < 0) {\n n[0] = 0;\n }\n arr[i] = n;\n }\n else {\n arr[i] = [0, PX];\n }\n }\n res[STYLE_KEY[style2Upper(k)]] = arr;\n }\n });\n temp = style.transform;\n if(temp) {\n let transform = res[TRANSFORM] = [];\n let match = (temp || '').toString().match(/\\w+\\(.+?\\)/g);\n if(match) {\n match.forEach(item => {\n let i = item.indexOf('(');\n let k = item.slice(0, i);\n let v = item.slice(i + 1, item.length - 1);\n if(k === 'matrix') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 6) {\n arr = arr.slice(0, 6);\n }\n if(arr.length === 6) {\n transform.push([MATRIX, [\n arr[0], arr[1], 0, 0, arr[2], arr[3], 0, 0, 0, 0, 1, 0, arr[4], arr[5], 0, 1,\n ]]);\n }\n }\n else if(k === 'matrix3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 16) {\n arr = arr.slice(0, 16);\n }\n if(arr.length === 16) {\n transform.push([MATRIX, arr]);\n }\n }\n else if(k === 'perspective') {\n let arr = calUnit(v);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n transform.push([PERSPECTIVE, arr]);\n }\n else if(k === 'rotate3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n transform.push([ROTATE_3D, arr]);\n }\n }\n else if(TRANSFORM_HASH.hasOwnProperty(k)) {\n let k2 = TRANSFORM_HASH[k];\n let arr = calUnit(v);\n compatibleTransform(k2, arr);\n transform.push([k2, arr]);\n }\n else if({ translate: true, scale: true, skew: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale' ? arr[0] : [0];\n }\n if(arr.length === 2) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n }\n }\n else if({ translate3d: true, scale3d: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale3d' ? [1] : [0];\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n if(arr.length === 3) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let k3 = STYLE_KEY[style2Upper(k + 'Z')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n let arr3 = calUnit(arr[2]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n compatibleTransform(k3, arr3);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n transform.push([k3, arr3]);\n }\n }\n });\n }\n }\n temp = style.perspective;\n if(!isNil(temp)) {\n let arr = calUnit(temp);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n res[PERSPECTIVE] = arr;\n }\n ['perspectiveOrigin', 'transformOrigin'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n let arr = res[STYLE_KEY[style2Upper(k)]] = [];\n let match = temp.toString().match(reg.position);\n if(match) {\n if(match.length === 1) {\n match[1] = match[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n arr.push(n);\n }\n else {\n arr.push([\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item],\n PERCENT,\n ]);\n // 不规范的写法变默认值50%\n if(isNil(arr[i][0])) {\n arr[i][0] = 50;\n }\n }\n }\n }\n else {\n arr.push([50, PERCENT]);\n arr.push([50, PERCENT]);\n }\n }\n });\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n let k2 = TRANSFORM_HASH[k];\n let n = calUnit(v);\n // 没有单位或默认值处理单位\n compatibleTransform(k2, n);\n res[k2] = n;\n });\n temp = style.rotate3d;\n if(temp) {\n let arr = temp.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n res[ROTATE_3D] = arr;\n }\n }\n temp = style.opacity;\n if(!isNil(temp)) {\n temp = parseFloat(temp);\n if(!isNaN(temp)) {\n temp = Math.max(temp, 0);\n temp = Math.min(temp, 1);\n res[OPACITY] = temp;\n }\n else {\n res[OPACITY] = 1;\n }\n }\n temp = style.zIndex;\n if(!isNil(temp)) {\n res[Z_INDEX] = parseInt(temp) || 0;\n }\n // 转化不同单位值为对象标准化,不写单位的变成number单位转化为px\n [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'width',\n 'height',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n if(v === 'auto') {\n v = [0, AUTO];\n }\n else {\n v = calUnit(v);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n let k2 = STYLE_KEY[style2Upper(k)];\n res[k2] = v;\n // 限制padding/border为正数\n if({\n paddingTop: true,\n paddingRight: true,\n paddingBottom: true,\n paddingLeft: true,\n borderTopWidth: true,\n borderRightWidth: true,\n borderBottomWidth: true,\n borderLeftWidth: true,\n width: true,\n height: true,\n }.hasOwnProperty(k) && v[0] < 0) {\n v[0] = 0;\n }\n });\n temp = style.flexBasis;\n if(!isNil(temp)) {\n if(temp === 'content') {\n res[FLEX_BASIS] = [temp, STRING];\n }\n else if(/^[\\d.]/.test(temp)) {\n let v = res[FLEX_BASIS] = calUnit(temp);\n v[0] = Math.max(v[0], 0);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n else {\n res[FLEX_BASIS] = [0, AUTO];\n }\n }\n temp = style.order;\n if(!isNil(temp)) {\n res[ORDER] = parseInt(temp) || 0;\n }\n temp = style.color;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[COLOR] = [[], INHERIT];\n }\n else {\n res[COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.textStrokeColor;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_COLOR] = [[], INHERIT];\n }\n else {\n res[TEXT_STROKE_COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.fontSize;\n if(temp || temp === 0) {\n if(temp === 'inherit') {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // fontSize不能为负数,否则为继承\n if(v < 0) {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[FONT_SIZE] = v;\n }\n }\n }\n temp = style.textStrokeWidth;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // textStrokeWidth不能为负数,否则为继承\n if(v < 0) {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG, PERCENT].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[TEXT_STROKE_WIDTH] = v;\n }\n }\n }\n temp = style.textStrokeOver;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_OVER] = [0, INHERIT];\n }\n else {\n let v = temp.toString();\n if(v !== 'none' && v !== 'fill') {\n v = 'none';\n }\n res[TEXT_STROKE_OVER] = [v, STRING];\n }\n }\n temp = style.fontWeight;\n if(!isNil(temp)) {\n if(temp === 'bold') {\n res[FONT_WEIGHT] = [700, NUMBER];\n }\n else if(temp === 'normal') {\n res[FONT_WEIGHT] = [400, NUMBER];\n }\n else if(temp === 'lighter') {\n res[FONT_WEIGHT] = [200, NUMBER];\n }\n else if(temp === 'inherit') {\n res[FONT_WEIGHT] = [0, INHERIT];\n }\n else {\n res[FONT_WEIGHT] = [Math.max(0, parseInt(temp)) || 400, NUMBER];\n }\n }\n temp = style.fontStyle;\n if(temp) {\n if(temp === 'inherit') {\n res[FONT_STYLE] = [0, INHERIT];\n }\n else {\n res[FONT_STYLE] = [temp, STRING];\n }\n }\n temp = style.fontFamily;\n if(temp) {\n if(temp === 'inherit') {\n res[FONT_FAMILY] = [0, INHERIT];\n }\n else {\n // 统一文字声明格式\n res[FONT_FAMILY] = [temp.toString().toLowerCase().replace(/['\"]/, '').replace(/\\s*,\\s*/g, ','), STRING];\n }\n }\n temp = style.textAlign;\n if(temp) {\n if(temp === 'inherit') {\n res[TEXT_ALIGN] = [0, INHERIT];\n }\n else {\n res[TEXT_ALIGN] = [temp, STRING];\n }\n }\n temp = style.lineHeight;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LINE_HEIGHT] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LINE_HEIGHT] = [0, AUTO];\n }\n // lineHeight默认数字,想要px必须强制带单位\n else if(/^[\\d.]+/i.test(temp)) {\n let v = calUnit(temp);\n if([DEG].indexOf(v[1]) > -1) {\n v[1] = NUMBER;\n }\n res[LINE_HEIGHT] = v;\n }\n else {\n let n = Math.max(0, parseFloat(temp)) || 'normal';\n // 非法数字\n if(n === 'normal') {\n res[LINE_HEIGHT] = [null, AUTO];\n }\n else {\n res[LINE_HEIGHT] = [n, NUMBER];\n }\n }\n }\n temp = style.letterSpacing;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LETTER_SPACING] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LETTER_SPACING] = [0, PX];\n }\n else if(/^[-+]?[\\d.]/.test(temp)) {\n let v = calUnit(temp);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[LETTER_SPACING] = v;\n }\n else {\n res[LETTER_SPACING] = [parseFloat(temp) || 0, PX];\n }\n }\n temp = style.whiteSpace;\n if(temp) {\n if(temp === 'inherit') {\n res[WHITE_SPACE] = [0, INHERIT];\n }\n else {\n res[WHITE_SPACE] = [temp, STRING];\n }\n }\n temp = style.lineClamp;\n if(temp !== undefined) {\n temp = parseInt(temp) || 0;\n res[LINE_CLAMP] = Math.max(0, temp);\n }\n // fill和stroke为渐变时特殊处理,fillRule无需处理字符串\n temp = style.fill;\n if(temp !== undefined) {\n if(!temp) {\n res[FILL] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[FILL] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[FILL] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[FILL] = [gradient.parseGradient(temp)];\n }\n else {\n res[FILL] = [rgba2int(temp)];\n }\n }\n temp = style.stroke;\n if(temp !== undefined) {\n if(!temp) {\n res[STROKE] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[STROKE] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[STROKE] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[STROKE] = [gradient.parseGradient(temp)];\n }\n else {\n res[STROKE] = [rgba2int(temp)];\n }\n }\n temp = style.strokeWidth;\n if(!isNil(temp)) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[STROKE_WIDTH] = temp.map(item => {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n v[0] = Math.max(v[0], 0);\n return v;\n });\n }\n temp = style.strokeDasharray;\n if(!isNil(temp)) {\n if(Array.isArray(temp)) {\n res[STROKE_DASHARRAY] = temp.map(item => {\n let match = item.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n return match;\n }\n return [];\n });\n }\n else {\n let match = temp.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n res[STROKE_DASHARRAY] = [match];\n }\n else {\n res[STROKE_DASHARRAY] = [[]];\n }\n }\n }\n temp = style.filter;\n if(temp !== undefined) {\n let match = (temp || '').toString().match(/\\b[\\w-]+\\s*\\(\\s*[-+]?[\\d.]+\\s*[pxremvwhdg%]*\\s*\\)\\s*/ig);\n let f = null;\n if(match) {\n f = [];\n match.forEach(item => {\n let m2 = /([\\w-]+)\\s*\\(\\s*([-+]?[\\d.]+\\s*[pxremvwhdg%]*)\\s*\\)\\s*/i.exec(item);\n if(m2) {\n let k = m2[1].toLowerCase(), v = calUnit(m2[2]);\n if(k === 'blur') {\n if(v[0] <= 0 || [DEG, PERCENT].indexOf(v[1]) > -1) {\n return;\n }\n if(v[1] === NUMBER) {\n v[1] = PX;\n }\n f.push([k, v]);\n }\n else if(k === 'hue-rotate') {\n if([NUMBER, DEG].indexOf(v[1]) === -1) {\n return;\n }\n v[1] = DEG;\n f.push([k, v]);\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'grayscale' || k === 'contrast') {\n if([NUMBER, PERCENT].indexOf(v[1]) === -1) {\n return;\n }\n v[0] = Math.max(v[0], 0);\n v[1] = PERCENT;\n f.push([k, v]);\n }\n }\n });\n }\n res[FILTER] = f;\n }\n temp = style.visibility;\n if(temp) {\n if(temp === 'inherit') {\n res[VISIBILITY] = [0, INHERIT];\n }\n else {\n res[VISIBILITY] = [temp, STRING];\n }\n }\n temp = style.pointerEvents;\n if(temp) {\n if(temp === 'inherit') {\n res[POINTER_EVENTS] = [0, INHERIT];\n }\n else {\n res[POINTER_EVENTS] = [temp, STRING];\n }\n }\n temp = style.boxShadow;\n if(temp !== undefined) {\n let bs = null;\n let match = (temp || '').match(/([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*\\s*)?([-+]?[\\d.]+[pxremvwh%]*\\s*)?(((transparent)|(#[0-9a-f]{3,8})|(rgba?\\(.+?\\)))\\s*)?(inset|outset)?\\s*,?/ig);\n if(match) {\n match.forEach(item => {\n let boxShadow = /([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*)\\s*([-+]?[\\d.]+[pxremvwh%]*\\s*)?([-+]?[\\d.]+[pxremvwh%]*\\s*)?(?:((?:transparent)|(?:#[0-9a-f]{3,8})|(?:rgba?\\(.+\\)))\\s*)?(inset|outset)?/i.exec(item);\n if(boxShadow) {\n bs = bs || [];\n let res = [];\n // v,h,blur,spread,color,inset\n for(let i = 0; i < 4; i++) {\n let v = calUnit(boxShadow[i + 1]);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n // x/y可以负,blur和spread不行\n if(i > 1 && v[0] < 0) {\n v = 0;\n }\n res.push(v);\n }\n res.push(rgba2int(boxShadow[5]));\n res.push(boxShadow[6] || 'outset');\n bs.push(res);\n }\n });\n }\n res[BOX_SHADOW] = bs;\n }\n // 直接赋值的string类型\n [\n 'position',\n 'display',\n 'flexDirection',\n 'flexWrap',\n 'justifyContent',\n 'alignItems',\n 'alignSelf',\n 'alignContent',\n 'overflow',\n 'mixBlendMode',\n 'borderTopStyle',\n 'borderRightStyle',\n 'borderBottomStyle',\n 'borderLeftStyle',\n 'backgroundClip',\n 'textOverflow',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[STYLE_KEY[style2Upper(k)]] = style[k];\n }\n });\n // 直接赋值的number类型\n [\n 'flexGrow',\n 'flexShrink',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[STYLE_KEY[style2Upper(k)]] = Math.max(parseFloat(style[k]) || 0, 0);\n }\n });\n temp = style.zIndex;\n if(!isNil(temp)) {\n res[Z_INDEX] = parseFloat(temp) || 0;\n }\n // 这些支持多个的用数组表示\n [\n 'backgroundRepeat',\n 'strokeLinecap',\n 'strokeLinejoin',\n 'strokeMiterlimit',\n 'fillRule',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n let v = style[k];\n res[STYLE_KEY[style2Upper(k)]] = Array.isArray(v) ? v : [v];\n }\n });\n GEOM_KEY_SET.forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[k] = style[k];\n }\n });\n return res;\n}\n\n/**\n * 第一次和REFLOW等级下,刷新前首先执行,生成computedStyle\n * 影响文字测量的只有字体和大小和重量,需要提前处理\n * 继承相关的计算\n * @param node 对象节点\n * @param isRoot 是否是根节点,无继承需使用默认值\n */\nfunction computeMeasure(node, isRoot) {\n let { currentStyle, computedStyle, domParent } = node;\n let parentComputedStyle = !isRoot && domParent.computedStyle;\n MEASURE_KEY_SET.forEach(k => {\n let v = currentStyle[k];\n // ff特殊处理\n if(k === FONT_FAMILY) {\n if(v[1] === INHERIT) {\n computedStyle[k] = getFontFamily(isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k]);\n }\n else {\n computedStyle[k] = getFontFamily(v[0]);\n }\n }\n else if(v[1] === INHERIT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k];\n }\n // 只有fontSize会有%\n else if(v[1] === PERCENT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (parentComputedStyle[k] * v[0] * 0.01);\n }\n else if(v[1] === REM) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.computedStyle[FONT_SIZE] * v[0]);\n }\n else if(v[1] === VW) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.width * 0.01 * v[0]);\n }\n else if(v[1] === VH) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.height * 0.01 * v[0]);\n }\n else {\n computedStyle[k] = v[0];\n }\n });\n}\n\n/**\n * 每次布局前需要计算的reflow相关的computedStyle\n * @param node 对象节点\n * @param isHost 是否是根节点或组件节点这种局部根节点,无继承需使用默认值\n */\nfunction computeReflow(node, isHost) {\n let { currentStyle, computedStyle, domParent: parent, root } = node;\n let rem = root.computedStyle[FONT_SIZE];\n let isRoot = !parent;\n let parentComputedStyle = parent && parent.computedStyle;\n [\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n ].forEach(k => {\n // border-width不支持百分比\n let item = currentStyle[k];\n if(item[1] === PX) {\n computedStyle[k] = item[0];\n }\n else if(item[1] === REM) {\n computedStyle[k] = item[0] * rem;\n }\n else if(item[1] === VW) {\n computedStyle[k] = item[0] * root.width * 0.01;\n }\n else if(item[1] === VH) {\n computedStyle[k] = item[0] * root.height * 0.01;\n }\n else {\n computedStyle[k] = 0;\n }\n });\n [\n POSITION,\n DISPLAY,\n FLEX_DIRECTION,\n JUSTIFY_CONTENT,\n ALIGN_ITEMS,\n ALIGN_SELF,\n FLEX_GROW,\n FLEX_SHRINK,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n let textAlign = currentStyle[TEXT_ALIGN];\n if(textAlign[1] === INHERIT) {\n computedStyle[TEXT_ALIGN] = isRoot ? 'left' : parentComputedStyle[TEXT_ALIGN];\n }\n else {\n computedStyle[TEXT_ALIGN] = textAlign[0];\n }\n let fontSize = computedStyle[FONT_SIZE];\n let lineHeight = currentStyle[LINE_HEIGHT];\n // lineHeight继承很特殊,数字和normal不同于普通单位\n if(lineHeight[1] === INHERIT) {\n if(isRoot) {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n else {\n let p = parent;\n let ph;\n while(p) {\n ph = p.currentStyle[LINE_HEIGHT];\n if(ph[1] !== INHERIT) {\n break;\n }\n p = p.domParent;\n }\n // 到root还是inherit或normal,或者中途遇到了normal,使用normal\n if([AUTO, INHERIT].indexOf(ph[1]) > -1) {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n // 数字继承\n else if(ph[1] === NUMBER) {\n computedStyle[LINE_HEIGHT] = Math.max(ph[0], 0) * fontSize;\n }\n // 单位继承\n else {\n computedStyle[LINE_HEIGHT] = parentComputedStyle[LINE_HEIGHT];\n }\n }\n }\n // 防止为0\n else if(lineHeight[1] === PX) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === PERCENT) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * fontSize * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === REM) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * rem, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VW) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.width * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === VH) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0] * root.height * 0.01, 0) || calNormalLineHeight(computedStyle);\n }\n else if(lineHeight[1] === NUMBER) {\n computedStyle[LINE_HEIGHT] = Math.max(lineHeight[0], 0) * fontSize || calNormalLineHeight(computedStyle);\n }\n // normal或auto\n else {\n computedStyle[LINE_HEIGHT] = calNormalLineHeight(computedStyle);\n }\n let letterSpacing = currentStyle[LETTER_SPACING];\n if(letterSpacing[1] === INHERIT) {\n computedStyle[LETTER_SPACING] = isRoot ? 0 : parentComputedStyle[LETTER_SPACING];\n }\n else if(letterSpacing[1] === PERCENT) {\n computedStyle[LETTER_SPACING] = fontSize * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === REM) {\n computedStyle[LETTER_SPACING] = rem * letterSpacing[0];\n }\n else if(letterSpacing[1] === VW) {\n computedStyle[LETTER_SPACING] = root.width * 0.01 * letterSpacing[0];\n }\n else if(letterSpacing[1] === VH) {\n computedStyle[LETTER_SPACING] = root.height * 0.01 * letterSpacing[0];\n }\n else {\n computedStyle[LETTER_SPACING] = letterSpacing[0];\n }\n //whiteSpace\n let whiteSpace = currentStyle[WHITE_SPACE];\n if(whiteSpace[1] === INHERIT) {\n computedStyle[WHITE_SPACE] = isRoot ? 'normal' : parentComputedStyle[WHITE_SPACE];\n }\n else {\n computedStyle[WHITE_SPACE] = whiteSpace[0];\n }\n}\n\nfunction setFontStyle(style) {\n let fontSize = style[FONT_SIZE];\n return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' '\n + fontSize + 'px/' + fontSize + 'px ' + (style[FONT_FAMILY] || 'arial');\n}\n\nfunction getFontFamily(str) {\n let ff = str.split(',');\n let f = 'arial';\n for(let i = 0, len = ff.length; i < len; i++) {\n if(font.support(ff[i])) {\n f = ff[i];\n break;\n }\n }\n return f;\n}\n\nfunction getBaseLine(style) {\n let fontSize = style[FONT_SIZE];\n let ff = getFontFamily(style[FONT_FAMILY]);\n let normal = fontSize * (font.info[ff] || font.info.arial).lhr;\n return (style[LINE_HEIGHT] - normal) * 0.5 + fontSize * (font.info[ff] || font.info.arial).blr;\n}\n\nfunction calNormalLineHeight(style) {\n let ff = getFontFamily(style[FONT_FAMILY]);\n return style[FONT_SIZE] * (font.info[ff] || font.info.arial).lhr;\n}\n\nfunction calRelativePercent(n, parent, k) {\n n *= 0.01;\n while(parent) {\n let style = parent.currentStyle[k];\n if(style[1] === AUTO) {\n if(k === WIDTH) {\n parent = parent.domParent;\n }\n else {\n break;\n }\n }\n else if(style[1] === PX) {\n return n * style[0];\n }\n else if(style[1] === PERCENT) {\n n *= style[0] * 0.01;\n parent = parent.domParent;\n }\n else if(style[1] === REM) {\n return n * style[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(style[1] === VW) {\n return n * style[0] * parent.root.width * 0.01;\n }\n else if(style[1] === VH) {\n return n * style[0] * parent.root.height * 0.01;\n }\n }\n return n;\n}\n\nfunction calRelative(currentStyle, k, v, parent, isWidth) {\n if(v[1] === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER].indexOf(v[1]) > -1) {\n v = v[0];\n }\n else if(v[1] === PERCENT) {\n if(isWidth) {\n v = calRelativePercent(v[0], parent, WIDTH);\n }\n else {\n v = calRelativePercent(v[0], parent, HEIGHT);\n }\n }\n else if(v[1] === REM) {\n v = v[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * parent.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * parent.root.height * 0.01;\n }\n return v;\n}\n\nfunction calAbsolute(currentStyle, k, v, size, root) {\n if(v[1] === AUTO) {\n v = 0;\n }\n else if([PX, NUMBER, DEG, RGBA, STRING].indexOf(v[1]) > -1) {\n v = v[0];\n }\n else if(v[1] === PERCENT) {\n v = v[0] * size * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * root.height * 0.01;\n }\n return v;\n}\n\nfunction equalStyle(k, a, b, target) {\n if(!a || !b) {\n return a === b;\n }\n if(k === TRANSFORM) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let oa = a[i];\n let ob = b[i];\n if(oa[0] !== ob[0]) {\n return false;\n }\n // translate/matrix等都是数组\n if(!equalArr(oa[1], ob[1])) {\n return false;\n }\n }\n return true;\n }\n if(k === FILTER) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equalArr(a[i], b[i])) {\n return false;\n }\n }\n }\n if(k === BACKGROUND_SIZE) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let aa = a[i], bb = b[i];\n if(aa[0][0] !== bb[0][0] || aa[0][1] !== bb[0][1] || aa[1][0] !== bb[1][0] || aa[1][1] !== bb[1][1]) {\n return false;\n }\n }\n return true;\n }\n if(k === TRANSFORM_ORIGIN || RADIUS_HASH.hasOwnProperty(k)) {\n return a[0][0] === b[0][0] && a[0][1] === b[0][1]\n && a[1][0] === b[1][0] && a[1][1] === b[1][1];\n }\n if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y\n || LENGTH_HASH.hasOwnProperty(k) || EXPAND_HASH.hasOwnProperty(k)) {\n return a[0] === b[0] && a[1] === b[1];\n }\n if(k === BOX_SHADOW) {\n return equalArr(a, b);\n }\n if(COLOR_HASH.hasOwnProperty(k)) {\n return a[1] === b[1] && equalArr(a[0], b[0]);\n }\n if(GRADIENT_HASH.hasOwnProperty(k) && a.k === b.k && GRADIENT_TYPE.hasOwnProperty(a.k)) {\n let av = a.v;\n let bv = b.v;\n if(a.d !== b.d || av.length !== bv.length) {\n return false;\n }\n for(let i = 0, len = av.length; i < len; i++) {\n let ai = av[i];\n let bi = bv[i];\n if(ai.length !== bi.length) {\n return false;\n }\n for(let j = 0; j < 4; j++) {\n if(ai[0][j] !== bi[0][j]) {\n return false;\n }\n }\n if(ai.length > 1) {\n if(ai[1][0] !== bi[1][0] || ai[1][1] !== bi[1][1]) {\n return false;\n }\n }\n }\n return true;\n }\n // multi都是纯值数组,equalArr本身即递归,非multi根据类型判断\n if(isGeom(target.tagName, k) && (target.isMulti || Array.isArray(a) && Array.isArray(b))) {\n return equalArr(a, b);\n }\n return a === b;\n}\n\nfunction isRelativeOrAbsolute(node) {\n let position = node.currentStyle[POSITION];\n return position === 'relative' || position === 'absolute';\n}\n\nconst VALUE = {\n [POSITION]: true,\n [DISPLAY]: true,\n [STYLE_KEY.BACKGROUND_REPEAT]: true,\n [FLEX_DIRECTION]: true,\n [FLEX_GROW]: true,\n [FLEX_SHRINK]: true,\n [FLEX_WRAP]: true,\n [JUSTIFY_CONTENT]: true,\n [ALIGN_ITEMS]: true,\n [ALIGN_SELF]: true,\n [STYLE_KEY.OVERFLOW]: true,\n [STYLE_KEY.MIX_BLEND_MODE]: true,\n [STYLE_KEY.STROKE_LINECAP]: true,\n [STYLE_KEY.STROKE_LINEJOIN]: true,\n [STYLE_KEY.STROKE_MITERLIMIT]: true,\n [STYLE_KEY.FILL_RULE]: true,\n [OPACITY]: true,\n [Z_INDEX]: true,\n [BACKGROUND_CLIP]: true,\n [TEXT_OVERFLOW]: true,\n [LINE_CLAMP]: true,\n};\n// 仅1维数组\nconst ARRAY_0 = {\n [COLOR]: true,\n [TEXT_STROKE_COLOR]: true,\n [BACKGROUND_COLOR]: true,\n [STYLE_KEY.BORDER_TOP_COLOR]: true,\n [STYLE_KEY.BORDER_RIGHT_COLOR]: true,\n [STYLE_KEY.BORDER_BOTTOM_COLOR]: true,\n [STYLE_KEY.BORDER_LEFT_COLOR]: true,\n};\n// 仅2维数组且只有2个值\nconst ARRAY_0_1 = {\n [STYLE_KEY.BORDER_TOP_LEFT_RADIUS]: true,\n [STYLE_KEY.BORDER_TOP_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_RIGHT_RADIUS]: true,\n [STYLE_KEY.BORDER_BOTTOM_LEFT_RADIUS]: true,\n [TRANSFORM_ORIGIN]: true,\n [PERSPECTIVE_ORIGIN]: true,\n};\nfunction cloneStyle(style, keys) {\n if(!keys) {\n keys = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n }\n let res = {};\n for(let i = 0, len = keys.length; i < len; i++) {\n let k = keys[i];\n let v = style[k];\n // 渐变特殊处理\n if(k === BACKGROUND_IMAGE) {\n res[k] = v.map(item => {\n // 可能为null\n if(item && item.k) {\n return util.clone(item);\n }\n else {\n return item;\n }\n });\n }\n else if(k === FILL || k === STROKE) {\n res[k] = v.map(item => {\n // 渐变\n // 可能非法为空\n if(item && item.k) {\n return util.clone(item);\n }\n // 颜色\n else {\n return item.slice(0);\n }\n });\n }\n else if(k === TRANSFORM || k === FILTER) {\n if(v) {\n let n = v.slice(0);\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n n[i][1] = n[i][1].slice(0);\n }\n res[k] = n;\n }\n }\n else if(k === BOX_SHADOW) {\n if(v) {\n v = v.map(item => {\n let n = item.slice(0);\n n[4] = n[4].slice(0);\n return n;\n });\n res[k] = v;\n }\n }\n else if(k === TRANSLATE_PATH) {\n if(v) {\n res[k] = v.map(item => item.slice(0));\n }\n }\n // position等直接值类型赋值\n else if(VALUE.hasOwnProperty(k)) {\n res[k] = v;\n }\n // geom自定义属性\n else if(GEOM.hasOwnProperty(k)) {\n res[k] = util.clone(v);\n }\n // 其余皆是数组或空,默认是一维数组只需slice即可\n else if(v) {\n let n = res[k] = v.slice(0);\n // 特殊引用里数组某项再次clone\n if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n }\n }\n else if(k === BACKGROUND_SIZE) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n n[i][0] = n[i][0].slice(0);\n n[i][1] = n[i][1].slice(0);\n }\n }\n else if(ARRAY_0.hasOwnProperty(k)) {\n n[0] = n[0].slice(0);\n }\n else if(ARRAY_0_1.hasOwnProperty(k)) {\n n[0] = n[0].slice(0);\n n[1] = n[1].slice(0);\n }\n else if(k === TRANSFORM) {\n for(let i = 0, len = n.length; i < len; i++) {\n n[i] = n[i].slice(0);\n }\n }\n else if(k === ROTATE_3D) {\n n[3] = n[3].slice(0);\n }\n }\n }\n return res;\n}\n\nexport default {\n normalize,\n computeMeasure,\n computeReflow,\n setFontStyle,\n getFontFamily,\n getBaseLine,\n calRelative,\n calAbsolute,\n equalStyle,\n isRelativeOrAbsolute,\n cloneStyle,\n};\n","import mode from './mode';\nimport css from '../style/css';\nimport enums from '../util/enums';\nimport util from '../util/util';\n\nconst { STYLE_KEY: {\n COLOR,\n FONT_WEIGHT,\n FONT_FAMILY,\n FONT_SIZE,\n FONT_STYLE,\n LETTER_SPACING,\n TEXT_STROKE_COLOR,\n TEXT_STROKE_WIDTH,\n TEXT_STROKE_OVER,\n} } = enums;\n\n/**\n * 表示一行文本的类,保存它的位置、内容、从属信息,在布局阶段生成,并在渲染阶段被Text调用render()\n * 关系上直属于Text类,一个Text类可能因为换行原因导致有多个TextBox,一行内容中也可能有不同Text从而不同TextBox\n * 另外本类还会被LineBoxManager添加到LineBox里,LineBox为一行中的inline/文本组合,之间需要进行垂直对齐\n * 在textOverflow为ellipsis时,可能会收到后面节点的向前回退(后面不足放下…),使得省略号发生在本节点\n */\nclass TextBox {\n constructor(parent, index, x, y, w, h, content, wList) {\n this.__parent = parent;\n this.__index = index;\n this.__x = x;\n this.__y = y;\n this.__width = w;\n this.__height = h;\n this.__content = content;\n this.__wList = wList;\n this.__virtualDom = {};\n }\n\n /**\n * 渲染阶段被Text类调用,多行Text会有多个TextBox,内容被分拆开\n * @param renderMode\n * @param ctx\n * @param computedStyle\n * @param cacheStyle Text父节点Dom的缓存样式,相比computedStyle可以直接用,比如color被缓存为style字符串\n * @param dx\n * @param dy\n */\n render(renderMode, ctx, computedStyle, cacheStyle, dx, dy) {\n let { content, x, y, parent, wList, width } = this;\n let { ox, oy } = parent;\n y += css.getBaseLine(computedStyle);\n x += ox + dx;\n y += oy + dy;\n this.__endX = x + width;\n this.__endY = y;\n let {\n [LETTER_SPACING]: letterSpacing,\n [TEXT_STROKE_WIDTH]: textStrokeWidth,\n [TEXT_STROKE_COLOR]: textStrokeColor,\n } = computedStyle;\n let i = 0, length = content.length;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n let overFill = computedStyle[TEXT_STROKE_OVER] === 'fill';\n if(letterSpacing) {\n for(; i < length; i++) {\n if(overFill) {\n ctx.fillText(content.charAt(i), x, y);\n }\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n ctx.strokeText(content.charAt(i), x, y);\n }\n if(!overFill) {\n ctx.fillText(content.charAt(i), x, y);\n }\n x += wList[i] + letterSpacing;\n }\n }\n else {\n if(overFill) {\n ctx.fillText(content, x, y);\n }\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n ctx.strokeText(content, x, y);\n }\n if(!overFill) {\n ctx.fillText(content, x, y);\n }\n }\n }\n else if(renderMode === mode.SVG) {\n let props = [\n ['x', x],\n ['y', y],\n ['fill', cacheStyle[COLOR]],\n ['font-family', computedStyle[FONT_FAMILY]],\n ['font-weight', computedStyle[FONT_WEIGHT]],\n ['font-style', computedStyle[FONT_STYLE]],\n ['font-size', computedStyle[FONT_SIZE] + 'px'],\n ];\n // svg无法定义stroke的over\n if(textStrokeWidth && (textStrokeColor[3] > 0 || textStrokeColor.length === 3)) {\n props.push(['stroke', cacheStyle[TEXT_STROKE_COLOR]]);\n props.push(['stroke-width', computedStyle[TEXT_STROKE_WIDTH]]);\n }\n if(letterSpacing) {\n props.push(['letter-spacing', letterSpacing]);\n }\n this.__virtualDom = {\n type: 'item',\n tagName: 'text',\n props,\n content: util.encodeHtml(content),\n };\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endX() {\n return this.__endX;\n }\n\n get endY() {\n return this.__endY;\n }\n\n get width() {\n return this.__width;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get content() {\n return this.__content;\n }\n\n get baseLine() {\n return this.parent.baseLine;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get parentLineBox() {\n return this.__parentLineBox;\n }\n\n get wList() {\n return this.__wList;\n }\n}\n\nexport default TextBox;\n","import inject from '../util/inject';\n\nlet SIZE = [8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192];\nlet NUMBER = [128, 64, 32, 16, 8, 4, 2, 1, 1, 1, 1];\nlet MAX = SIZE[SIZE.length - 1];\nconst HASH_CANVAS = {};\n\nlet uuid = 0;\n\nclass Page {\n constructor(size, number) {\n this.__size = size;\n this.__number = number;\n this.__free = this.__total = number * number;\n size *= number;\n this.__width = size;\n this.__height = size;\n let offscreen = this.__canvas = inject.getCacheCanvas(size, size, null, number);\n if(offscreen) {\n this.__offscreen = offscreen;\n }\n // 1/0标识n*n个单元格是否空闲可用,一维数组表示\n this.__grid = [];\n for(let i = 0; i < this.__total; i++) {\n this.__grid.push(1);\n }\n this.__uuid = uuid++;\n // webgl贴图缓存使用,一旦更新则标识记录,绑定某号纹理单元查看变化才更新贴图\n this.__update = false;\n this.time = 0;\n }\n\n add() {\n let { number, grid } = this;\n for(let i = 0; i < number; i++) {\n for(let j = 0; j < number; j++) {\n let index = i * number + j;\n if(grid[index]) {\n grid[index] = 0;\n this.__free--;\n return index;\n }\n }\n }\n // 理论不可能进入,除非bug\n throw new Error('Can not find free page');\n }\n\n del(pos) {\n if(!this.grid[pos]) {\n this.grid[pos] = 1;\n this.__free++;\n }\n }\n\n getCoords(pos) {\n let { size, number } = this;\n let x = pos % number;\n let y = Math.floor(pos / number);\n return [x * size, y * size];\n }\n\n get uuid() {\n return this.__uuid;\n }\n\n get size() {\n return this.__size;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get number() {\n return this.__number;\n }\n\n get total() {\n return this.__total;\n }\n\n get free() {\n return this.__free;\n }\n\n get grid() {\n return this.__grid;\n }\n\n get offscreen() {\n return this.__offscreen;\n }\n\n get canvas() {\n return this.offscreen.canvas;\n }\n\n get ctx() {\n return this.offscreen.ctx;\n }\n\n get update() {\n return this.__update;\n }\n\n set update(v) {\n this.__update = v;\n }\n\n static getInstance(size) {\n if(size > MAX) {\n return;\n }\n let s = SIZE[0];\n let n = NUMBER[0];\n // 使用刚好满足的尺寸\n for(let i = 0, len = SIZE.length; i < len; i++) {\n s = SIZE[i];\n n = NUMBER[i];\n if(SIZE[i] >= size) {\n break;\n }\n }\n let list = HASH_CANVAS[s] = HASH_CANVAS[s] || [];\n // 从hash列表中尝试取可用的一页,找不到就生成新的页\n let page;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(item.free) {\n page = item;\n break;\n }\n }\n if(!page) {\n page = new Page(s, n);\n if(!page.offscreen) {\n inject.error('Can not create off-screen for page');\n return;\n }\n list.push(page);\n }\n let pos = page.add();\n return { page, pos };\n }\n\n static set CONFIG(v) {\n if(!v || !Array.isArray(v.SIZE) || !Array.isArray(v.NUMBER)) {\n return;\n }\n SIZE = v.SIZE;\n NUMBER = v.NUMBER;\n MAX = SIZE[SIZE.length - 1];\n }\n\n static get CONFIG() {\n return {\n SIZE,\n NUMBER,\n };\n }\n\n static get MAX() {\n return MAX;\n }\n\n static genUuid() {\n return uuid++;\n }\n}\n\nexport default Page;\n","import matrix from './matrix';\nimport geom from './geom';\n\n// 一条边相对于自己开始点的x向量角度,即从x到此边旋转,0~180和-180~0,需要判断象限\nfunction calDeg(x1, y1, x2, y2) {\n let dx = x2 - x1;\n let dy = y2 - y1;\n let atan = Math.atan(Math.abs(dy) / Math.abs(dx));\n // 2象限\n if(dx < 0 && dy >= 0) {\n return Math.PI - atan;\n }\n // 3象限\n if(dx < 0 && dy < 0) {\n return atan - Math.PI;\n }\n // 1象限\n if(dx >= 0 && dy >= 0) {\n return atan;\n }\n // 4象限,顺时针正好\n return -atan;\n}\n\nfunction rotate(theta) {\n let sin = Math.sin(theta);\n let cos = Math.cos(theta);\n let t = matrix.identity();\n t[0] = t[5] = cos;\n t[1] = sin;\n t[4] = -sin;\n return t;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param points\n */\nfunction pointIndex(points) {\n let [x1, y1, x2, y2, x3, y3] = points;\n let index = [0, 1, 2];\n // 将a点放入最左\n if(x2 < x1 && x2 < x3) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n index[0] = 1;\n index[1] = 0;\n }\n else if(x3 < x2 && x3 < x1) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n index[0] = 2;\n index[2] = 0;\n }\n // 有可能出现2个并列的情况,判断取上面那个\n if(x1 === x2) {\n if(y1 > y2) {\n [x1, y1, x2, y2] = [x2, y2, x1, y1];\n let t = index[0];\n index[0] = index[1];\n index[1] = t;\n }\n }\n else if(x1 === x3) {\n if(y1 > y3) {\n [x1, y1, x3, y3] = [x3, y3, x1, y1];\n let t = index[0];\n index[0] = index[2];\n index[2] = t;\n }\n }\n // ab到ac要顺时针旋转,即2个向量夹角为正,用向量叉乘判断正负\n let cross = (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1);\n if(cross < 0) {\n [x2, y2, x3, y3] = [x3, y3, x2, y2];\n let t = index[1];\n index[1] = index[2];\n index[2] = t;\n }\n return [x1, y1, x2, y2, x3, y3, index];\n}\n\n/**\n * 第2个点根据第一个点的交换顺序交换\n * @param points\n * @param index\n * @returns {[]}\n */\nfunction pointByIndex(points, index) {\n let res = [];\n for(let i = 0, len = index.length; i < len; i++) {\n let j = index[i];\n res.push(points[j * 2]);\n res.push(points[j * 2 + 1]);\n }\n return res;\n}\n\n/**\n * 确保3个点中,a点在三角形左上方,b/c在右方,同时ab到ac要顺时针旋转\n * @param source 源3个点\n * @param target 目标3个点\n * @returns 交换顺序后的点坐标\n */\nfunction exchangeOrder(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3, index] = pointIndex(source);\n let [tx1, ty1, tx2, ty2, tx3, ty3] = pointByIndex(target, index);\n return [\n [sx1, sy1, sx2, sy2, sx3, sy3],\n [tx1, ty1, tx2, ty2, tx3, ty3]\n ];\n}\n\n/**\n * 存在一种情况,变换结果使得三角形镜像相反了,即顶点a越过bc线,判断是否溢出\n * @param source\n * @param target\n * @returns {boolean}是否溢出\n */\nfunction isOverflow(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n let cross1 = (sx2 - sx1) * (sy3 - sy1) - (sx3 - sx1) * (sy2 - sy1);\n let cross2 = (tx2 - tx1) * (ty3 - ty1) - (tx3 - tx1) * (ty2 - ty1);\n return cross1 > 0 && cross2 < 0 || cross1 < 0 && cross2 > 0;\n}\n\nfunction transform(source, target) {\n let [sx1, sy1, sx2, sy2, sx3, sy3] = source;\n let [tx1, ty1, tx2, ty2, tx3, ty3] = target;\n // 记录翻转\n let overflow = isOverflow(source, target);\n // 第0步,将源三角第1个a点移到原点\n let m = matrix.identity();\n m[12] = -sx1;\n m[13] = -sy1;\n let t;\n // 第1步,以第1条边ab为基准,将其贴合x轴上,为后续倾斜不干扰做准备\n let theta = calDeg(sx1, sy1, sx2, sy2);\n if(theta !== 0) {\n t = rotate(-theta);\n m = matrix.multiply(t, m);\n }\n // 第2步,以第1条边AB为基准,缩放x轴ab至目标相同长度,可与4步合并\n let ls = geom.pointsDistance(sx1, sy1, sx2, sy2);\n let lt = geom.pointsDistance(tx1, ty1, tx2, ty2);\n // if(ls !== lt) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[0] = scale;\n // m = matrix.multiply(t, m);\n // }\n // 第3步,缩放y,先将目标三角形旋转到x轴平行,再变换坐标计算\n let n = matrix.identity();\n n[12] = -tx1;\n n[13] = -ty1;\n theta = calDeg(tx1, ty1, tx2, ty2);\n // 记录下这个旋转角度,后面源三角形要反向旋转\n let alpha = theta;\n if(theta !== 0) {\n t = rotate(-theta);\n n = matrix.multiply(t, n);\n }\n // 目标三角反向旋转至x轴后的坐标\n // 源三角目前的第3点坐标y值即为长度,因为a点在原点0无需减去\n let ls2 = Math.abs(matrix.calPoint([sx3, sy3], m)[1]);\n let lt2 = Math.abs(matrix.calPoint([tx3, ty3], n)[1]);\n // 缩放y\n // if(ls2 !== lt2) {\n // let scale = lt / ls;\n // t = matrix.identity();\n // t[3] = scale;\n // m = matrix.multiply(t, m);\n // }\n if(ls !== lt || ls2 !== lt2) {\n t = matrix.identity();\n if(ls !== lt) {\n t[0] = lt / ls;\n }\n if(ls2 !== lt2) {\n t[5] = lt2 / ls2;\n }\n m = matrix.multiply(t, m);\n }\n // 第4步,x轴倾斜,用余弦定理求目前a和A的夹角\n n = m;\n let [ax1, ay1] = matrix.calPoint([sx1, sy1], n);\n let [ax2, ay2] = matrix.calPoint([sx2, sy2], n);\n let [ax3, ay3] = matrix.calPoint([sx3, sy3], n);\n let ab = geom.pointsDistance(ax1, ay1, ax2, ay2);\n let ac = geom.pointsDistance(ax1, ay1, ax3, ay3);\n let bc = geom.pointsDistance(ax3, ay3, ax2, ay2);\n let AB = geom.pointsDistance(tx1, ty1, tx2, ty2);\n let AC = geom.pointsDistance(tx1, ty1, tx3, ty3);\n let BC = geom.pointsDistance(tx3, ty3, tx2, ty2);\n let a = geom.angleBySide(bc, ab, ac);\n let A = geom.angleBySide(BC, AB, AC);\n // 先至90°,再旋转至目标角,可以合并成tan相加,不知道为什么不能直接tan倾斜差值角度\n if(a !== A) {\n t = matrix.identity();\n t[4] = Math.tan(a - Math.PI * 0.5) + Math.tan(Math.PI * 0.5 - A);\n m = matrix.multiply(t, m);\n }\n // 发生翻转时特殊处理按x轴垂直翻转\n if(overflow) {\n m[1] = -m[1];\n m[5] = -m[5];\n m[13] = -m[13];\n }\n // 第5步,再次旋转,角度为目标旋转到x轴的负值,可与下步合并\n if(alpha !== 0) {\n t = rotate(alpha);\n // m = matrix.multiply(t, m);\n }\n else {\n t = matrix.identity();\n }\n // 第6步,移动第一个点的差值\n // t = matrix.identity();\n t[12] = tx1;\n t[13] = ty1;\n return matrix.multiply(t, m);\n}\n\nexport default {\n exchangeOrder,\n isOverflow,\n transform,\n};\n","/**\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 } = unit;\nconst { matrix, geom } = math;\nconst { identity, multiply, isE } = matrix;\nconst { d2r } = geom;\n\nfunction calSingle(t, k, v) {\n if(k === TRANSLATE_X) {\n t[12] = v;\n }\n else if(k === TRANSLATE_Y) {\n t[13] = v;\n }\n else if(k === TRANSLATE_Z) {\n t[14] = v;\n }\n else if(k === SCALE_X) {\n t[0] = v;\n }\n else if(k === SCALE_Y) {\n t[5] = v;\n }\n else if(k === SCALE_Z) {\n t[10] = v;\n }\n else if(k === SKEW_X) {\n v = d2r(v);\n t[4] = Math.tan(v);\n }\n else if(k === SKEW_Y) {\n v = d2r(v);\n t[1] = Math.tan(v);\n }\n else if(k === ROTATE_X) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[5] = t[10] = cos;\n t[6] = sin;\n t[9] = -sin;\n }\n else if(k === ROTATE_Y) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[10] = cos;\n t[8] = sin;\n t[2] = -sin;\n }\n else if(k === ROTATE_Z) {\n v = d2r(v);\n let sin = Math.sin(v);\n let cos = Math.cos(v);\n t[0] = t[5] = cos;\n t[1] = sin;\n t[4] = -sin;\n }\n else if(k === ROTATE_3D) {\n let [x, y, z, r] = v;\n r = d2r(r[0]);\n let s = Math.sin(r);\n let c = Math.cos(r);\n if(x && !y && !z) {\n if(x < 0) {\n s = -s;\n }\n t[5] = c;\n t[9] = -s;\n t[6] = s;\n t[10] = c;\n }\n else if(y && !x && !z) {\n if(y < 0) {\n s = -s;\n }\n t[0] = c;\n t[8] = s;\n t[2] = -s;\n t[10] = c;\n }\n else if(z && !x && !y) {\n if(z < 0) {\n s = -s;\n }\n t[0] = c;\n t[4] = -s;\n t[1] = s;\n t[5] = c;\n }\n else {\n let len = Math.sqrt(x * x + y * y + z * z);\n if(len !== 1) {\n let rlen = 1 / len;\n x *= rlen;\n y *= rlen;\n z *= rlen;\n }\n let nc = 1 - c;\n let xy = x * y;\n let yz = y * z;\n let zx = z * x;\n let xs = x * s;\n let ys = y * s;\n let zs = z * s;\n\n t[0] = x * x * nc + c;\n t[1] = xy * nc + zs;\n t[2] = zx * nc - ys;\n t[3] = 0;\n\n t[4] = xy * nc - zs;\n t[5] = y * y * nc + c;\n t[6] = yz * nc + xs;\n t[7] = 0;\n\n t[8] = zx * nc + ys;\n t[9] = yz * nc - xs;\n t[10] = z * z * nc + c;\n t[11] = 0;\n\n t[12] = 0;\n t[13] = 0;\n t[14] = 0;\n t[15] = 1;\n }\n }\n else if(k === PERSPECTIVE && v > 0) {\n v = Math.max(v, 1);\n t[11] = -1 / v;\n }\n else if(k === MATRIX) {\n util.assignMatrix(t, v);\n }\n}\n\nfunction calMatrix(transform, ow, oh, root) {\n let list = normalize(transform, ow, oh, root);\n let m = identity();\n list.forEach(item => {\n let [k, v] = item;\n let t = identity();\n calSingle(t, k, v);\n m = multiply(m, t);\n });\n return m;\n}\n\n// 已有计算好的变换矩阵,根据tfo原点计算最终的matrix\nfunction calMatrixByOrigin(m, transformOrigin) {\n let [ox, oy] = transformOrigin;\n let res = m.slice(0);\n if(ox === 0 && oy === 0 || isE(m)) {\n return res;\n }\n res = multiply([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ox, oy, 0, 1], res);\n res = multiply(res, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -ox, -oy, 0, 1]);\n return res;\n}\n\n// img缩放svg下专用,无rem\nfunction calMatrixWithOrigin(transform, transformOrigin, ow, oh) {\n let m = calMatrix(transform, ow, oh);\n return calMatrixByOrigin(m, transformOrigin);\n}\n\nfunction normalizeSingle(k, v, ow, oh, root) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n if(v[1] === PERCENT) {\n return v[0] * ow * 0.01;\n }\n else if(v[1] === REM) {\n return v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n return v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n return v[0] * root.height * 0.01;\n }\n }\n else if(k === TRANSLATE_Y) {\n if(v[1] === PERCENT) {\n return v[0] * oh * 0.01;\n }\n else if(v[1] === REM) {\n return v[0] * root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n return v[0] * root.width * 0.01;\n }\n else if(v[1] === VH) {\n return v[0] * root.height * 0.01;\n }\n }\n else if(k === MATRIX) {\n return v;\n }\n else if(k === ROTATE_3D) {\n return v;\n }\n return v[0];\n}\n\nfunction normalize(transform, ow, oh, root) {\n let res = [];\n transform.forEach(item => {\n let [k, v] = item;\n res.push([k, normalizeSingle(k, v, ow, oh, root)]);\n });\n return res;\n}\n\nfunction calOrigin(transformOrigin, w, h, root) {\n let tfo = [];\n transformOrigin.forEach((item, i) => {\n if(item[1] === PX) {\n tfo.push(item[0]);\n }\n else if(item[1] === PERCENT) {\n tfo.push(item[0] * (i ? h : w) * 0.01);\n }\n else if(item[1] === REM) {\n tfo.push(item[0] * root.computedStyle[FONT_SIZE]);\n }\n else if(item[1] === VW) {\n tfo.push(item[0] * root.width * 0.01);\n }\n else if(item[1] === VH) {\n tfo.push(item[0] * root.height * 0.01);\n }\n });\n return tfo;\n}\n\nfunction calMatrixByPerspective(m, pm) {\n if(!isE(pm)) {\n m = multiply(pm, m);\n }\n return m;\n}\n\nfunction calPerspectiveMatrix(ppt, po) {\n if(ppt && ppt > 0) {\n let res = identity();\n ppt = Math.max(ppt, 1);\n res[11] = -1 / ppt;\n let [ox, oy] = po;\n if(ox || oy) {\n res = multiply([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ox, oy, 0, 1], res);\n res = multiply(res, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -ox, -oy, 0, 1]);\n }\n return res;\n }\n}\n\n// 是否有透视矩阵应用\nfunction isPerspectiveMatrix(m) {\n if(!m) {\n return;\n }\n return !!(m[3] || m[7] || m[11]);\n}\n\nexport default {\n calMatrix,\n calOrigin,\n calMatrixByPerspective,\n calPerspectiveMatrix,\n calMatrixByOrigin,\n calMatrixWithOrigin,\n isPerspectiveMatrix,\n};\n","/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据模糊参数sigma求卷积核尺寸\n * @param sigma\n * @returns {number}\n */\nfunction kernelSize(sigma) {\n if(sigma <= 0) {\n return 0;\n }\n let d = Math.floor(sigma * 3 * Math.sqrt(2 * Math.PI) / 4 + 0.5);\n if(d < 2) {\n d = 2;\n }\n if(d % 2 === 0) {\n d++;\n }\n return d;\n}\n\n/**\n * 根据sigma求模糊扩展尺寸,卷积核求得后为d,再求半径/2,然后因为算法要执行3次,所以*3\n * 比如本来d为5,半径2.5算上自身像素点则各方向扩展2,*3则扩展6\n * @param sigma\n * @returns {number}\n */\nfunction outerSize(sigma) {\n let d = kernelSize(sigma);\n return outerSizeByD(d);\n}\n\nfunction outerSizeByD(d) {\n return Math.floor(d * 0.5) * 3;\n}\n\n/**\n * 一维高斯正态分布,根据标准差和卷积核尺寸返回一维权重数组\n * @param sigma\n * @param d\n */\nfunction gaussianWeight(sigma, d) {\n let list = [];\n let len = Math.floor(d * 0.5);\n let total = 0;\n for(let i = len; i >= 0; i--) {\n let n = Math.pow(Math.E, -Math.pow(i, 2) / (2 * Math.pow(sigma, 2)))\n / (sigma * Math.sqrt(2 * Math.PI));\n list.push(n);\n total += n;\n }\n for(let i = 1; i <= len; i++) {\n let n = Math.pow(Math.E, -Math.pow(i, 2) / (2 * Math.pow(sigma, 2)))\n / (sigma * Math.sqrt(2 * Math.PI));\n list.push(n);\n total += n;\n }\n if(total !== 1) {\n for(let i = 0; i < d; i++) {\n list[i] /= total;\n }\n }\n return list;\n}\n\nexport default {\n kernelSize,\n outerSize,\n outerSizeByD,\n gaussianWeight,\n};\n","import Page from './Page';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport enums from '../util/enums';\nimport painter from '../util/painter';\nimport debug from '../util/debug';\nimport tf from '../style/transform';\nimport mx from '../math/matrix';\nimport blur from '../math/blur';\n\nconst {\n STYLE_KEY: {\n TRANSFORM_ORIGIN,\n TRANSFORM,\n DISPLAY,\n VISIBILITY,\n },\n NODE_KEY: {\n NODE_OPACITY,\n NODE_CACHE_TOTAL,\n NODE_CACHE_FILTER,\n NODE_CACHE_OVERFLOW,\n NODE_HAS_CONTENT,\n NODE_COMPUTED_STYLE,\n },\n} = enums;\n\n// 根据一个共享cache的信息,生成一个独立的离屏canvas,一般是filter,mask用\nfunction genSingle(cache, message) {\n let { size, sx1, sy1, width, height, bbox } = cache;\n let offscreen = inject.getCacheCanvas(width, height, null, message);\n offscreen.x = 0;\n offscreen.y = 0;\n offscreen.bbox = bbox;\n offscreen.size = size;\n offscreen.sx1 = sx1;\n offscreen.sy1 = sy1;\n offscreen.dx = cache.dx;\n offscreen.dy = cache.dy;\n offscreen.dbx = cache.dbx;\n offscreen.dby = cache.dby;\n offscreen.width = width;\n offscreen.height = height;\n return offscreen;\n}\n\nclass Cache {\n constructor(w, h, bbox, page, pos, x1, y1) {\n this.__init(w, h, bbox, page, pos, x1, y1);\n }\n\n __init(w, h, bbox, page, pos, x1, y1) {\n this.__width = w;\n this.__height = h;\n this.__bbox = bbox;\n this.__page = page;\n this.__pos = pos;\n let [x, y] = page.getCoords(pos);\n this.__x = x;\n this.__y = y;\n this.__appendData(x1, y1);\n 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 },\n NODE_KEY: {\n NODE_CACHE,\n NODE_LIMIT_CACHE,\n NODE_DOM_PARENT,\n NODE_MATRIX_EVENT,\n NODE_OPACITY,\n NODE_VIRTUAL_DOM,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_MEASURE,\n UPDATE_FOCUS,\n UPDATE_CONFIG,\n },\n} = enums;\n\nconst ELLIPSIS = textCache.ELLIPSIS;\nconst { AUTO, REM, VW, VH } = unit;\n\nclass Text extends Node {\n constructor(content) {\n super();\n this.__content = util.isNil(content) ? '' : content.toString();\n this.__textBoxes = [];\n this.__charWidthList = [];\n this.__charWidth = 0;\n this.__textWidth = 0;\n }\n\n /**\n * 预先计算每个字的宽度,在每次布局渲染前做\n * @param renderMode\n * @param ctx\n * @private\n */\n __computeMeasure(renderMode, ctx) {\n let { content, computedStyle, charWidthList } = this;\n // 每次都要清空重新计算,计算会有缓存\n charWidthList.splice(0);\n let ffs = computedStyle[FONT_FAMILY].split(',');\n let ff = 'arial';\n for(let i = 0, len = ffs.length; i < len; i++) {\n if(inject.checkSupportFontFamily(ffs[i])) {\n ff = ffs[i];\n break;\n }\n }\n this.__ff = ff;\n let fs = computedStyle[FONT_SIZE];\n let fw = computedStyle[FONT_WEIGHT];\n let key = this.__key = computedStyle[FONT_SIZE] + ',' + ff + ',' + fw;\n let wait = textCache.data[key] = textCache.data[key] || {\n ff,\n fs,\n fw,\n hash: {},\n s: '',\n };\n let cache = textCache.charWidth[key] = textCache.charWidth[key] || {};\n let sum = 0;\n let needMeasure = false;\n // text-overflow:ellipse需要,即便没有也要先测量,其基于最近非inline父节点的字体\n let bp = this.domParent;\n while(bp.currentStyle[DISPLAY] === 'inline') {\n bp = bp.domParent;\n }\n this.__bp = bp;\n let parentComputedStyle = bp.computedStyle;\n let pff = 'arial';\n for(let i = 0, pffs = parentComputedStyle[FONT_FAMILY].split(','), len = pffs.length; i < len; i++) {\n if(inject.checkSupportFontFamily(pffs[i])) {\n ff = ffs[i];\n break;\n }\n }\n let pfs = parentComputedStyle[FONT_SIZE];\n let pfw = parentComputedStyle[FONT_WEIGHT];\n let pKey = this.__pKey = pfs + ',' + pff + ',' + pfw;\n let parentCache = textCache.charWidth[pKey] = textCache.charWidth[pKey] || {};\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(renderMode === mode.WEBGL) {\n ctx = inject.getCacheCanvas(16, 16, '__$$CHECK_SUPPORT_FONT_FAMILY$$__').ctx;\n }\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n ctx.font = css.setFontStyle(parentComputedStyle);\n parentCache[ELLIPSIS] = ctx.measureText(ELLIPSIS).width;\n }\n ctx.font = css.setFontStyle(computedStyle);\n }\n else if(renderMode === mode.SVG) {\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n parentCache[ELLIPSIS] = 0;\n let wait = textCache.data[pKey] = textCache.data[pKey] || {\n ff: pff,\n fs: pfs,\n fw: pfw,\n hash: {},\n s: '',\n };\n wait.s += ELLIPSIS;\n needMeasure = true;\n }\n }\n // 逐字测量,canvas可瞬间得到信息,svg先预存统一进行\n for(let i = 0, length = content.length; i < length; i++) {\n let char = content.charAt(i);\n let mw;\n if(cache.hasOwnProperty(char)) {\n mw = cache[char];\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n mw = cache[char] = ctx.measureText(char).width;\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else {\n if(!wait.hash.hasOwnProperty(char)) {\n wait.s += char;\n }\n wait.hash[char] = true;\n // 先预存标识位-1,测量完后替换它\n charWidthList.push(-1);\n needMeasure = true;\n }\n }\n this.__textWidth = sum;\n if(needMeasure) {\n textCache.list.push(this);\n }\n }\n\n __measureCb() {\n let { content, charWidthList } = this;\n let key = this.__key;\n let cache = textCache.charWidth[key];\n let sum = 0;\n for(let i = 0, len = charWidthList.length; i < len; i++) {\n if(charWidthList[i] < 0) {\n let mw = charWidthList[i] = cache[content.charAt(i)];\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n }\n this.__textWidth = sum;\n }\n\n /**\n * text在virtual时和普通一样,无需特殊处理\n * endSpace由外界inline布局控制,末尾最后一行的空白mpb,包含递归情况,递归为多个嵌套末尾节点的空白mpb之和\n * 即便宽度不足,每行还是强制渲染一个字符,换行依据lx开始,因为x可能是从中间开始的,非inline则两个相等\n * 最后一个字符排版时要考虑末尾mpb,排不下的话回退删掉这个字符,如果最后一个字符另起开头,排不下也强制排,每行至少1个字符\n * 在textOverflow时很特殊,多个inline同行,回退可能到前一个inline节点,这个通过x和lx判断是否行首,决定至少1个字符规则\n * @param data\n * @private\n */\n __layout(data) {\n let __cache = this.__config[NODE_CACHE];\n if(__cache) {\n __cache.release();\n }\n let { x, y, w, lx = x, lineBoxManager, endSpace = 0, lineClamp = 0, lineClampCount = 0 } = data;\n this.__x = this.__sx1 = x;\n this.__y = this.__sy1 = y;\n let { isDestroyed, content, currentStyle, computedStyle, textBoxes, charWidthList, root, __ff, __key } = this;\n textBoxes.splice(0);\n let __config = this.__config;\n __config[NODE_LIMIT_CACHE] = false;\n // 空内容w/h都为0可以提前跳出\n if(isDestroyed || currentStyle[DISPLAY] === 'none' || !content) {\n return lineClampCount;\n }\n this.__ox = this.__oy = 0;\n // 顺序尝试分割字符串为TextBox,形成多行,begin为每行起始索引,i是当前字符索引\n let begin = 0;\n let i = 0;\n let beginSpace = x - lx; // x>=lx,当第一行非起始处时前面被prev节点占据,这个差值可认为是count宽度\n let count = beginSpace;\n let length = content.length;\n let maxW = 0;\n let {\n [LINE_HEIGHT]: lineHeight,\n [LETTER_SPACING]: letterSpacing,\n [WHITE_SPACE]: whiteSpace,\n [FONT_SIZE]: fontSize,\n [FONT_WEIGHT]: fontWeight,\n } = computedStyle;\n // 特殊字体中特殊字符连续时需减少一定的padding量\n let padding = font.info[__ff].padding;\n let needReduce = !!padding;\n let lastChar;\n let ew = textCache.charWidth[this.__pKey][ELLIPSIS];\n let lineCount = 0;\n // 不换行特殊对待,同时考虑overflow和textOverflow\n if(whiteSpace === 'nowrap') {\n let isTextOverflow;\n // block的overflow:hidden和textOverflow:clip/ellipsis才生效,inline要看最近非inline父元素\n let bp = this.__bp;\n let {\n [DISPLAY]: display,\n [OVERFLOW]: overflow,\n [WIDTH]: width,\n [TEXT_OVERFLOW]: textOverflow,\n } = bp.currentStyle;\n // 只要是overflow隐藏,不管textOverflow如何(默认是clip等同于overflow:hidden的功能)都截取\n if(overflow === 'hidden') {\n while(i < length) {\n count += charWidthList[i] + letterSpacing;\n if(count > w) {\n // block/flex无需宽度,inline-block需要设置宽度才生效\n if(display === 'block' || display === 'flex') {\n isTextOverflow = true;\n }\n else if(width[1] !== AUTO) {\n isTextOverflow = true;\n }\n break;\n }\n i++;\n }\n }\n else {\n while(i < length) {\n count += charWidthList[i++] + letterSpacing;\n }\n }\n // ellipsis生效情况,本节点开始向前回退查找,尝试放下一部分字符\n if(isTextOverflow && textOverflow === 'ellipsis') {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n }\n // 默认clip跟随overflow:hidden,无需感知\n else {\n let textBox = new TextBox(this, textBoxes.length, x, y, count - beginSpace, lineHeight,\n content, charWidthList);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n maxW = count - beginSpace;\n y += lineHeight;\n }\n }\n // 普通换行,注意x和lx的区别,可能相同(block起始处)可能不同(非起始处),第1行从x开始,第2行及以后都从lx开始\n // 然后第一次换行还有特殊之处,可能同一行前半部行高很大,此时y增加并非自身的lineHeight,而是整体LineBox的\n else {\n while(i < length) {\n let cw = charWidthList[i] + letterSpacing;\n count += cw;\n // 连续字符减少padding,除了连续还需判断char是否在padding的hash中\n if(needReduce) {\n let char = content[i];\n if(char === lastChar && padding.hasOwnProperty(char) && padding[char]) {\n let hasCache, p = textCache.padding[__key] = textCache.padding[__key] || {};\n if(textCache.padding.hasOwnProperty(__key)) {\n if(p.hasOwnProperty(char)) {\n hasCache = true;\n count -= p[char];\n }\n }\n if(!hasCache) {\n let n = 0;\n if(root.renderMode === mode.CANVAS) {\n root.ctx.font = css.setFontStyle(computedStyle);\n let w1 = root.ctx.measureText(char).width;\n let w2 = root.ctx.measureText(char + char).width;\n n = w1 * 2 - w2;\n n *= padding[char];\n }\n else if(root.renderMode === mode.SVG) {\n n = inject.measureTextSync(__key, __ff, fontSize, fontWeight, char);\n n *= padding[char];\n }\n count -= n;\n p[char] = n;\n }\n }\n lastChar = char;\n }\n // 忽略零宽字符\n if(cw === 0) {\n i++;\n continue;\n }\n // 换行都要判断i不是0的时候,第1个字符强制不换行\n if(count === w) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n let textBox;\n // 特殊情况,恰好最后一行最后一个排满,此时查看末尾mpb,要防止i为0的情况首个字符特殊不回退,无需看开头mpb\n if(i === length - 1 && count > w - endSpace && i) {\n count -= charWidthList[i--];\n }\n i++;\n if(!lineCount) {\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, count);\n }\n // 必须先添加再设置y,当有diff的lineHeight时,第一个换行不影响,再换行时第2个换行即第3行会被第1行影响\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null; // 换行后连续字符reduce不生效重新计数\n }\n // 奇怪的精度问题,暂时不用相等判断,而是为原本w宽度加一点点冗余1e-10\n else if(count > w + (1e-10)) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n // 普通非多行文本阶段逻辑\n let width;\n // 宽度不足时无法跳出循环,至少也要塞个字符形成一行,无需判断第1行,因为是否放得下逻辑在dom中做过了,\n // 如果第1行放不下,一定会另起一行,此时作为开头再放不下才会进这里,这个if只有0或1个字符的情况\n if(i <= begin) {\n width = count;\n }\n // 超过2个字符回退1个\n else {\n width = count - charWidthList[i--];\n }\n i++;\n // 根据是否第一行分开处理行首空白\n let textBox;\n if(!lineCount) {\n maxW = width - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, width);\n }\n // 必须先添加再设置y,同上\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null;\n }\n else {\n i++;\n }\n }\n // 换行后Text的x重设为lx\n if(lineCount) {\n this.__x = this.__sx1 = lx;\n }\n // 最后一行,只有一行未满时也进这里,需查看末尾mpb,排不下回退一个字符\n // 声明了lineClamp时特殊考虑,这里一定是最后一行,要对比行数不能超过,超过忽略掉这些文本\n if(begin < length && (!lineClamp || lineCount + lineClampCount < lineClamp)) {\n let textBox;\n if(!lineCount) {\n let needBack;\n // 防止开头第一个begin=0时回退,这在inline有padding且是第一个child时会发生\n if(begin && count > w - endSpace) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n else {\n let needBack;\n // 防止begin在结尾时回退,必须要有个字符,这在最后一行1个字符排不下时会出现\n if(count > w - endSpace && begin < length - 1) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n maxW = Math.max(maxW, count);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n }\n }\n this.__width = maxW;\n this.__height = y - data.y;\n this.__baseLine = css.getBaseLine(computedStyle);\n return lineCount;\n }\n\n // 末尾行因ellipsis的缘故向前回退字符生成textBox,可能会因不满足宽度导致无法生成,此时向前继续回退TextBox\n __lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount, lineHeight, lx, x, y, maxW,\n textBoxes, content, charWidthList, lineBoxManager) {\n for(; i >= begin; i--) {\n count -= charWidthList[i] + letterSpacing;\n if(count + ew + endSpace <= w) {\n // 至少1个字符不用回退,到0也没找到需要回退\n if(i) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n break;\n }\n }\n }\n // 最后也没找到,看是否要查找前一个inline节点,还是本身是行首兜底首字母\n if(i < 0) {\n let lineBox = lineBoxManager.lineBox;\n // lineBox为空是行首,至少放1个字符\n if(!lineBox.size) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.charAt(begin), charWidthList.slice(begin, begin + 1));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n }\n // 向前查找inline节点,可能会有前面inline嵌套,因此直接用lineBox,不会出现inlineBlock,\n // 这里和css不同,ib强制超限换行不会同行\n else {\n let list = lineBox.list;\n outer:\n for(let j = list.length - 1; j >= 0; j--) {\n let tb = list[j];\n let { content, wList, width } = tb;\n // 整体减去可以说明可能在这个tb中,只要最后发现不是空文本节点就行,否则继续;第0个强制进入保证1字符\n if(count - width + ew <= w || !j) {\n // 找到可以跳出outer循环,找不到继续,注意第0个且1个字符判断\n for(let k = wList.length - 1; k >= 0; k--) {\n if(!k && !j || count + ew <= w) {\n tb.__content = content;\n tb.__width = width;\n tb.parent.__ellipsis = true;\n break outer;\n }\n else {\n let w2 = wList[k];\n tb.__endY -= w2;\n width -= w2;\n content = content.slice(0, k);\n count -= w2;\n wList.pop();\n }\n }\n }\n // 不够则看前一个tb并且删掉这个\n else {\n count -= width;\n }\n list.pop();\n tb.parent.textBoxes.pop();\n }\n }\n }\n return [y, maxW];\n }\n\n __offsetX(diff, isLayout) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetX(diff);\n });\n }\n this.__sx1 += diff;\n }\n\n __offsetY(diff, isLayout) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetY(diff);\n });\n }\n this.__sy1 += diff;\n }\n\n __tryLayInline(w) {\n return w - this.charWidthList[0];\n }\n\n __inlineSize() {\n let minX, maxX;\n this.textBoxes.forEach((item, i) => {\n if(i) {\n minX = Math.min(minX, item.x);\n maxX = Math.max(maxX, item.x + item.width);\n }\n else {\n minX = item.x;\n maxX = item.x + item.width;\n }\n });\n this.__x = minX;\n this.__sx = this.__sx1 = minX + this.ox;console.log(22222)\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] * 0.5, half);\n }\n else if(textStrokeWidth[1] === VW) {\n half = Math.max(textStrokeWidth[0] * root.width * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VH) {\n half = Math.max(textStrokeWidth[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(textStrokeWidth[0] * 0.5, half);\n }\n half += 1;\n return [sx - half, sy - half, sx + width + half, sy + height + half];\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get matrix() {\n return this.domParent.matrix;\n }\n\n get matrixEvent() {\n return this.domParent.matrixEvent;\n }\n}\n\nText.prototype.__renderByMask = Text.prototype.render;\n\nexport default Text;\n","import util from './util';\nimport $$type from './$$type';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\n/**\n * 2. 打平children中的数组,变成一维\n * 3. 合并相连的Text节点,即string内容\n */\nfunction flattenJson(parent) {\n if(Array.isArray(parent)) {\n return parent.map(item => flattenJson(item));\n }\n else if(!parent || [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) {\n return parent;\n }\n let list = [];\n traverseJson(list, parent.children, {\n lastText: null,\n });\n parent.children = list;\n return parent;\n}\n\nfunction traverseJson(list, children, options) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n traverseJson(list, item, options);\n });\n }\n else if(children && (children.$$type === TYPE_VD || children.$$type === TYPE_GM)) {\n if(['canvas', 'svg', 'webgl'].indexOf(children.tagName) > -1) {\n throw new Error('Can not nest canvas/svg/webgl');\n }\n if(children.$$type === TYPE_VD) {\n flattenJson(children);\n }\n list.push(children);\n options.lastText = null;\n }\n else if(children && children.$$type === TYPE_CP) {\n list.push(children);\n // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做\n options.lastText = null;\n }\n // 排除掉空的文本,连续的text合并\n else if(!util.isNil(children) && children !== '') {\n if(options.lastText !== null) {\n list[list.length - 1] = options.lastText += children;\n }\n else {\n list.push(children);\n }\n }\n}\n\nexport default flattenJson;\n","import Text from '../node/Text';\nimport util from './util';\nimport $$type from './$$type';\nimport enums from './enums';\nimport flatten from './flatten';\n\nconst { NODE_KEY: {\n NODE_DOM_PARENT,\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n} } = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nfunction initRoot(cd, root) {\n let c = flatten({\n tagName: root.tagName,\n props: {},\n children: cd,\n $$type: TYPE_VD,\n });\n root.__json = c;\n root.__host = root;\n let children = build(c.children, root, root);\n return relation(root, children);\n}\n\nfunction initDom(json, root, host, parent) {\n let vd = build(json, root, host);\n return relation(parent, vd);\n}\n\nfunction initCp(json, root, host) {\n if(util.isObject(json)) {\n // cp的flatten在__init中自己做\n return build(json, root, host);\n }\n // text的relation会由上层如Root设置\n else {\n return new Text(json);\n }\n}\n\nfunction initCp2(json, root, host, parent) {\n let vd = new json.klass(json.props);\n vd.__tagName = json.tagName || vd.__tagName;\n vd.__root = root;\n vd.__host = host;\n vd.__json = json;\n vd.__init();\n return relation(parent, vd);\n}\n\n/**\n * 将初始json文件生成virtualDom\n * @param json\n * @param root\n * @param host\n * @param hasP 出现过p标签\n * @returns vd\n */\nfunction build(json, root, host, hasP) {\n if(Array.isArray(json)) {\n return json.map(item => build(item, root, host, hasP));\n }\n let vd;\n if(util.isObject(json) && json.$$type) {\n let { tagName, props, children, klass, $$type, __inheritAnimate, __animateRecords } = json;\n // 更新过程中无变化的cp直接使用原来生成的\n if($$type === TYPE_CP && json.__placeholder) {\n return json.__placeholder;\n }\n if($$type === TYPE_VD) {\n if(tagName === 'img') {\n vd = new Img(tagName, props);\n if(Array.isArray(children) && children.length) {\n throw new Error('Img can not contain children');\n }\n }\n else {\n vd = new Dom(tagName, props);\n }\n // 检查p不能包含div\n if(tagName === 'p') {\n hasP = true;\n }\n else if(tagName === 'div' && hasP) {\n throw new Error('Markup p can not contain div');\n }\n if(Array.isArray(children)) {\n children = relation(vd, build(children, root, host, hasP));\n }\n else {\n children = [];\n }\n vd.__children = children;\n }\n else if($$type === TYPE_GM) {\n let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\n }\n else if($$type === TYPE_CP) {\n vd = new klass(props);\n vd.__tagName = tagName || vd.__tagName;\n }\n else {\n return new Text(json);\n }\n // 根parse需要用到真正的vd引用,然后vd也要引用json,用以做domApi\n json.vd = vd;\n vd.__json = json;\n // 递归parse中的动画记录需特殊处理,将target改为真正的vd引用\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n __animateRecords.list.forEach(item => {\n item.target = item.target.vd;\n });\n delete json.__animateRecords;\n }\n // 更新过程中key相同或者普通相同的vd继承动画\n if(__inheritAnimate) {\n util.extendAnimate(__inheritAnimate, vd);\n delete json.__inheritAnimate;\n }\n vd.__root = root;\n vd.__host = host;\n if($$type === TYPE_CP) {\n vd.__init();\n }\n let ref = props.ref;\n if(util.isString(ref) && ref || util.isNumber(ref)) {\n host.ref[ref] = vd;\n }\n else if(util.isFunction(ref)) {\n ref(vd);\n }\n return vd;\n }\n return new Text(json);\n}\n\n/**\n * 设置关系,父子和兄弟\n * @param parent\n * @param children\n * @param options\n * @returns {Xom|Text|Component}\n */\nfunction relation(parent, children, options = {}) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n relation(parent, item, options);\n });\n }\n else if(children instanceof Xom || children instanceof Component || children instanceof Text) {\n children.__parent = parent;\n children.__domParent = parent;\n // 极为恶心,为了v8的性能优化,text复用parent的__config部分,但domParent重设\n if(children instanceof Text) {\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n if(children.__config) {\n children.__config[NODE_DOM_PARENT] = parent;\n }\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n // 文字视作为父节点的直接文字子节点\n if(children instanceof Component) {\n let sr = children.shadowRoot;\n if(sr instanceof Text) {\n sr.__parent = parent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n sr.__domParent = parent;\n if(sr.__config) {\n sr.__config[NODE_DOM_PARENT] = parent;\n }\n }\n }\n return children;\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n initRoot,\n initDom,\n initCp,\n initCp2,\n relation,\n};\n","import util from './util';\n\nconst { isFunction } = util;\n\nclass Event {\n constructor() {\n this.__eHash = {};\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.on(id[i], handle);\n }\n }\n else {\n if(!self.__eHash.hasOwnProperty(id)) {\n self.__eHash[id] = [];\n }\n // 遍历防止此handle被侦听过了\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n if(item[i] === handle) {\n return self;\n }\n }\n self.__eHash[id].push(handle);\n }\n return self;\n }\n\n once(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n function cb(...data) {\n handle.apply(self, data);\n self.off(id, cb);\n }\n\n cb.__karasEventCb = handle;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.once(id[i], handle);\n }\n }\n else if(handle) {\n self.on(id, cb);\n }\n return this;\n }\n\n off(id, handle) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.off(id[i], handle);\n }\n }\n else if(self.__eHash.hasOwnProperty(id)) {\n if(handle) {\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n // 需考虑once包裹的引用对比\n if(item[i] === handle || item[i].__karasEventCb === handle) {\n item.splice(i, 1);\n break;\n }\n }\n }\n // 未定义为全部清除\n else {\n delete self.__eHash[id];\n }\n }\n return this;\n }\n\n emit(id, ...data) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.emit(id[i], data);\n }\n }\n else {\n if(self.__eHash.hasOwnProperty(id)) {\n let list = self.__eHash[id];\n if(list.length) {\n list = list.slice();\n for(let i = 0, len = list.length; i < len; i++) {\n let cb = list[i];\n if(isFunction(cb)) {\n cb.apply(self, data);\n }\n }\n }\n }\n }\n return this;\n }\n\n static mix(...obj) {\n for(let i = obj.length - 1; i >= 0; i--) {\n let o = obj[i];\n let event = new Event();\n o.__eHash = {};\n let fns = ['on', 'once', 'off', 'emit'];\n for(let j = fns.length - 1; j >= 0; j--) {\n let fn = fns[j];\n o[fn] = event[fn];\n }\n }\n }\n\n static REFRESH = 'refresh';\n static PAUSE = 'pause';\n static PLAY = 'play';\n static FRAME = 'frame';\n static FINISH = 'finish';\n static CANCEL = 'cancel';\n static BEGIN = 'begin';\n static END = 'end';\n}\n\nexport default Event;\n","import Node from './Node';\nimport Text from './Text';\nimport builder from '../util/builder';\nimport Event from '../util/Event';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport flatten from '../util/flatten';\nimport css from '../style/css';\nimport change from '../refresh/change';\n\nconst { isNil, isFunction, clone, extend } = util;\n\nconst REGISTER = {};\n\n/**\n * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归\n * 在check时树递归会用到,判断是否需要查找cp更新\n * @param cp\n */\nfunction setUpdateFlag(cp) {\n // 去重\n if(cp.__hasUpdate) {\n return;\n }\n cp.__hasUpdate = true;\n let host = cp.host;\n if(host) {\n setUpdateFlag(host);\n }\n}\n\nclass Component extends Event {\n constructor(props = {}) {\n super();\n this.__tagName = /(?:function|class)\\s+([\\w$]+)/.exec(this.constructor.toString())[1];\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__parent = null;\n this.__host = null;\n this.__ref = {};\n this.state = {};\n this.__isMounted = false;\n this.__taskList = [];\n }\n\n setState(n, cb) {\n let self = this;\n if(isNil(n)) {\n n = {};\n }\n else if(isFunction(n)) {\n return;\n }\n else {\n if(Object.keys(n).length === 0) {\n if(isFunction(cb)) {\n cb.call(self);\n }\n return;\n }\n let state = clone(self.state);\n n = extend(state, n);\n }\n let root = self.root;\n if(root && self.__isMounted) {\n // 一帧之内多次调用,需合并\n if(self.__nextState) {\n Object.assign(self.__nextState, n);\n self.__taskList.push(cb);\n }\n else {\n self.__nextState = n;\n self.__taskList = [cb];\n // 回调更新列表,before执行时splice出来供after执行,防止中途产生的后续setState干扰\n let list = [];\n let t = self.__task = {\n __before: () => {\n list = self.__taskList.splice(0);\n // 标识更新\n setUpdateFlag(this);\n },\n __after: () => {\n // self.__nextState = null; 由updater.js每次refresh前同步执行清空,这里不能异步清除,否则frame动画会乱序\n list.forEach(cb => {\n if(isFunction(cb)) {\n cb.call(self);\n }\n });\n },\n };\n root.addRefreshCp(t);\n }\n }\n // 构造函数中调用还未render,\n else if(isFunction(cb)) {\n self.state = n;\n cb.call(self);\n }\n }\n\n /**\n * build中调用初始化,json有值时是update过程才有,且处理过flatten\n * @param json\n * @private\n */\n __init(json) {\n this.__ref = {};\n let root = this.root;\n let cd = json || flatten(this.render());\n let sr = builder.initCp(cd, root, this);\n this.__cd = cd;\n if(sr instanceof Text) {\n // 文字视作为父节点的直接文字子节点,在builder里做\n }\n else if(sr instanceof Node) {\n let style = css.normalize(this.props.style);\n let keys = Object.keys(style);\n extend(sr.style, style, keys);\n extend(sr.currentStyle, style, keys);\n // 事件添加到sr\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n });\n }\n else if(!(sr instanceof Component)) {\n // 本身build是递归的,子cp已经初始化了\n throw new Error('Component render() must return a dom/text: ' + this);\n }\n // 自定义事件无视返回强制添加\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n k = k.slice(3);\n this.on(k, v);\n }\n });\n // shadow指向直接renderRoot,shadowRoot考虑到返回Component的递归即hoc高阶组件\n // host是直接所属,hostRoot同考虑到高阶组件\n this.__shadow = sr;\n sr.__host = this;\n // 递归下去,多层级时执行顺序由里到外,最终会被最上层执行替换\n while(sr instanceof Component) {\n sr.__hostRoot = this;\n sr.shadow.__host = sr;\n sr = sr.shadow;\n }\n this.__shadowRoot = sr;\n sr.__hostRoot = this;\n if(!this.__isMounted) {\n this.__isMounted = true;\n if(isFunction(this.componentDidMount)) {\n root.once(Event.REFRESH, () => {\n this.componentDidMount();\n });\n }\n }\n }\n\n render() {\n inject.warn('Component must implement render()');\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.__isDestroyed = true;\n this.__isMounted = false;\n if(isFunction(this.componentWillUnmount)) {\n this.componentWillUnmount();\n }\n this.root.delRefreshTask(this.__task);\n if(this.shadowRoot) {\n this.shadowRoot.__destroy();\n }\n this.__parent = null;\n }\n\n __emitEvent(e, force) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n return;\n }\n let res = sr.__emitEvent(e, force);\n if(res) {\n e.target = this;\n return true;\n }\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get shadow() {\n return this.__shadow;\n }\n\n get shadowRoot() {\n return this.__shadowRoot;\n }\n\n get root() {\n return this.__root;\n }\n\n get host() {\n return this.__host;\n }\n\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n get state() {\n return this.__state;\n }\n\n set state(v) {\n this.__state = v;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)) {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Component has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)\n || !obj.prototype || !(obj.prototype instanceof Component)) {\n throw new Error('Invalid param: Component register');\n }\n if(Component.hasRegister(name)) {\n throw new Error(`Component has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Component.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nObject.keys(change.GEOM).concat([\n 'x',\n 'y',\n 'ox',\n 'oy',\n 'sx',\n 'sy',\n // '__sx1',\n // '__sx2',\n // '__sx3',\n // '__sx4',\n // '__sx5',\n // '__sx6',\n // '__sy1',\n // '__sy2',\n // '__sy3',\n // '__sy4',\n // '__sy5',\n // '__sy6',\n 'width',\n 'height',\n 'outerWidth',\n 'outerHeight',\n 'clientWidth',\n 'clientHeight',\n 'offsetWidth',\n 'offsetHeight',\n 'style',\n 'animationList',\n 'animateStyle',\n 'currentStyle',\n 'computedStyle',\n 'currentProps',\n 'baseLine',\n 'virtualDom',\n 'mask',\n 'maskId',\n 'textWidth',\n 'content',\n 'lineBoxes',\n 'charWidthList',\n 'charWidth',\n '__layoutData',\n 'availableAnimating',\n 'effectiveAnimating',\n 'displayAnimating',\n 'visibilityAnimating',\n 'bbox',\n '__config',\n 'contentBoxList',\n 'listener',\n 'matrix',\n 'matrixEvent',\n]).forEach(fn => {\n Object.defineProperty(Component.prototype, fn, {\n get() {\n let sr = this.shadowRoot;\n if(sr) {\n return sr[fn];\n }\n },\n });\n});\n\n[\n '__layout',\n '__layoutAbs',\n '__layoutNone',\n '__tryLayInline',\n '__offsetX',\n '__offsetY',\n '__calAutoBasis',\n '__calMp',\n '__calAbs',\n '__renderAsMask',\n '__renderByMask',\n '__mp',\n 'animate',\n 'removeAnimate',\n 'clearAnimate',\n 'updateStyle',\n 'getBoundingClientRect',\n 'getComputedStyle',\n '__deepScan',\n 'clearCache',\n '__structure',\n '__modifyStruct',\n '__updateStruct',\n 'flowChildren',\n 'absChildren',\n '__isRealInline',\n '__calBasis',\n '__calMinMax',\n '__computeMeasure',\n 'appendChild',\n 'prependChild',\n 'insertBefore',\n 'insertAfter',\n 'removeChild',\n 'remove',\n].forEach(fn => {\n Component.prototype[fn] = function() {\n let sr = this.shadowRoot;\n if(sr && isFunction(sr[fn])) {\n return sr[fn].apply(sr, arguments);\n }\n };\n});\n\nexport default Component;\n","import unit from './unit';\nimport transform from './transform';\nimport enums from '../util/enums';\n\nconst { STYLE_KEY: { SCALE_X, SCALE_Y } } = enums;\nconst { PERCENT, NUMBER } = unit;\n\nfunction matrixResize(imgWidth, imgHeight, targetWidth, targetHeight, x, y, w, h) {\n if(imgWidth === targetWidth && imgHeight === targetHeight) {\n return;\n }\n let list = [\n [SCALE_X, [targetWidth / imgWidth, NUMBER]],\n [SCALE_Y, [targetHeight / imgHeight, NUMBER]],\n ];\n let tfo = transform.calOrigin([[0, PERCENT], [0, PERCENT]], w, h);\n tfo[0] += x;\n tfo[1] += y;\n return transform.calMatrixWithOrigin(list, tfo, w, h);\n}\n\nexport default {\n matrixResize,\n};\n","import border from './border';\nimport transform from './transform';\nimport mx from '../math/matrix';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\nimport unit from './unit';\nimport enums from '../util/enums';\nimport image from './image';\n\nconst {\n STYLE_KEY: {\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\nconst { clone, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { AUTO, PX, PERCENT, STRING, REM, VW, VH } = unit;\n\nfunction renderBgc(xom, renderMode, ctx, color, list, x, y, w, h, btlr, btrr, bbrr, bblr,\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] === AUTO) {\n res.push(-1);\n }\n else if(item[1] === STRING) {\n res.push(item[0] === 'contain' ? -2 : -3);\n }\n });\n return res;\n}\n\nfunction calBackgroundPosition(position, container, size, root) {\n if(Array.isArray(position)) {\n if(position[1] === PX) {\n return position[0];\n }\n else if(position[1] === PERCENT) {\n return (container - size) * position[0] * 0.01;\n }\n else if(position[1] === REM) {\n return position[0] * root.computedStyle[FONT_SIZE];\n }\n else if(position[1] === VW) {\n return position[0] * root.width * 0.01;\n }\n else if(position[1] === VH) {\n return position[0] * root.height * 0.01;\n }\n }\n return 0;\n}\n\nfunction renderImage(xom, renderMode, ctx, loadBgi,\n bx1, by1, bx2, by2, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, isInline,\n 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_FRAME_CB,\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_CAL_DIFF_TIME,\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, calUnit } = unit;\nconst { isNil, isFunction, isNumber, isObject, isString, clone, equalArr } = util;\nconst { linear } = easing;\nconst { cloneStyle } = css;\nconst { isGeom, GEOM } = change;\n\nconst {\n COLOR_HASH,\n LENGTH_HASH,\n RADIUS_HASH,\n GRADIENT_HASH,\n EXPAND_HASH,\n GRADIENT_TYPE,\n} = key;\n\nconst NUM_CAL_HASH = {\n};\nObject.assign(NUM_CAL_HASH, LENGTH_HASH);\nObject.assign(NUM_CAL_HASH, EXPAND_HASH);\n\nfunction unify(frames, target) {\n let hash = {};\n let keys = [];\n // 获取所有关键帧的属性\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n Object.keys(style).forEach(k => {\n let v = style[k];\n // 未定义的过滤掉,null空有意义\n if(v !== undefined && !hash.hasOwnProperty(k)) {\n hash[k] = true;\n // geom为属性字符串,style都为枚举int\n if(!GEOM.hasOwnProperty(k)) {\n k = parseInt(k);\n }\n // path动画要转为translateXY,所以手动添加,使2帧之间存在过渡,有可能之前已存在这个动画,可忽视\n if(k === TRANSLATE_PATH) {\n if(!hash.hasOwnProperty(TRANSLATE_X)) {\n keys.push(TRANSLATE_X);\n }\n if(!hash.hasOwnProperty(TRANSLATE_Y)) {\n keys.push(TRANSLATE_Y);\n }\n hash[TRANSLATE_X] = hash[TRANSLATE_Y] = true;\n }\n keys.push(k);\n }\n });\n });\n // 添补没有声明完全的关键帧属性为节点当前值\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n keys.forEach(k => {\n if(!style.hasOwnProperty(k) || isNil(style[k])) {\n if(GEOM.hasOwnProperty(k)) {\n style[k] = target.getProps(k);\n }\n else {\n style[k] = target.currentStyle[k];\n }\n }\n });\n });\n return keys;\n}\n\n// 每次初始化时处理继承值,以及转换transform为单matrix矩阵\nfunction inherit(frames, keys, target) {\n let computedStyle = target.computedStyle;\n frames.forEach(item => {\n let style = item[FRAME_STYLE];\n keys.forEach(k => {\n let v = style[k];\n // geom的属性可能在帧中没有\n if(isNil(v)) {\n return;\n }\n if(k === TRANSFORM) {\n let ow = target.outerWidth;\n let oh = target.outerHeight;\n let m = tf.calMatrix(v, ow, oh);\n style[k] = [[MATRIX, m]];\n }\n else if(v[1] === INHERIT) {\n if(k === COLOR || k === TEXT_STROKE_COLOR) {\n style[k] = [util.rgba2int(computedStyle[k]), RGBA];\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n style[k] = [computedStyle[k], PX];\n }\n else if(k === FONT_WEIGHT) {\n style[k] = [computedStyle[k], NUMBER];\n }\n else if(k === FONT_STYLE || k === FONT_FAMILY || k === TEXT_ALIGN || k === TEXT_STROKE_OVER) {\n style[k] = [computedStyle[k], STRING];\n }\n }\n });\n });\n}\n\n/**\n * 通知root更新当前动画,需要根据frame的状态来决定是否是同步插入\n * 在异步时,因为动画本身是异步,需要addRefreshTask\n * 而如果此时frame在执行before过程中,说明帧动画本身是在before计算的,需要同步插入\n * @param style\n * @param keys 样式所有的key\n * @param __config\n * @param root\n * @param node\n */\nfunction genBeforeRefresh(style, keys, __config, root, node) {\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = keys;\n res[UPDATE_CONFIG] = __config[I_NODE_CONFIG];\n root.__addUpdate(node, __config[I_NODE_CONFIG], root, __config[I_ROOT_CONFIG], res);\n __config[I_STYLE] = style;\n __config[I_ASSIGNING] = true;\n // frame每帧回调时,下方先执行计算好变更的样式,这里特殊插入一个hook,让root增加一个刷新操作\n // 多个动画调用因为相同root也只会插入一个,这样在所有动画执行完毕后frame里检查同步进行刷新,解决单异步问题\n root.__frameHook();\n}\n\n/**\n * 将每帧的样式格式化,提取出offset属性并转化为时间,提取出缓动曲线easing\n * @param style 关键帧样式\n * @param duration 动画时间长度\n * @param es options的easing曲线控制,frame没有自定义则使用全局的\n * @returns {{style: *, time: number, easing: *, transition: []}}\n */\nfunction framing(style, duration, es) {\n let { offset, easing } = style;\n // 这两个特殊值提出来存储不干扰style\n delete style.offset;\n delete style.easing;\n // translatePath特殊对待,ae的曲线运动动画\n let translatePath = style.translatePath;\n style = css.normalize(style);\n if(Array.isArray(translatePath) && [6, 8].indexOf(translatePath.length) > -1) {\n style[TRANSLATE_PATH] = translatePath.map(item => calUnit(item));\n }\n let res = [];\n res[FRAME_STYLE] = style;\n res[FRAME_TIME] = offset * duration;\n res[FRAME_EASING] = easing || es;\n res[FRAME_TRANSITION] = [];\n return res;\n}\n\nfunction calByUnit(p, n, container, root) {\n if(p[1] === PX) {\n if(n[1] === PERCENT) {\n return n[0] * 0.01 * container - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width * 0.01 - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height * 0.01 - p[0];\n }\n }\n else if(p[1] === PERCENT) {\n if(n[1] === PX) {\n return n[0] * 100 / container - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * root.computedStyle[FONT_SIZE] * 100 / container - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / container - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / container - p[0];\n }\n }\n else if(p[1] === REM) {\n if(n[1] === PX) {\n return n[0] / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * 0.01 * container / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height * 0.01 / root.computedStyle[FONT_SIZE] - p[0];\n }\n }\n else if(p[1] === VW) {\n if(n[1] === PX) {\n return n[0] * 100 / root.width - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / root.width - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / root.width - p[0];\n }\n else if(n[1] === VH) {\n return n[0] * root.height / root.width - p[0];\n }\n }\n else if(p[1] === VH) {\n if(n[1] === PX) {\n return n[0] * 100 / root.height - p[0];\n }\n else if(n[1] === REM) {\n return n[0] * 100 * root.computedStyle[FONT_SIZE] / root.height - p[0];\n }\n else if(n[1] === VW) {\n return n[0] * root.width / root.height - p[0];\n }\n else if(n[1] === PERCENT) {\n return n[0] * container / root.height - p[0];\n }\n }\n}\n\n/**\n * 计算两帧之间的差,单位不同的以后面为准,返回的v表示差值\n * 没有变化返回空\n * auto等无法比较的不参与计算,不返回来标识无过度效果\n * @param prev 上一帧样式\n * @param next 下一帧样式\n * @param k 比较的样式名\n * @param target dom对象\n * @param tagName dom名\n * @returns {{k: *, v: *}}\n */\nfunction calDiff(prev, next, k, target, tagName) {\n let res = [k];\n let p = prev[k];\n let n = next[k];\n if(k === TRANSFORM) {\n // transform因默认值null很特殊,不存在时需给默认矩阵\n if(!p && !n) {\n return;\n }\n let pm, nm;\n if(p) {\n pm = p[0][1];\n }\n else {\n pm = mx.identity();\n }\n if(n) {\n nm = n[0][1];\n }\n else {\n nm = mx.identity();\n }\n // transform特殊被初始化转成matrix矩阵,直接计算差值\n if(equalArr(pm, nm)) {\n return;\n }\n res[1] = [\n nm[0] - pm[0],\n nm[1] - pm[1],\n nm[2] - pm[2],\n nm[3] - pm[3],\n nm[4] - pm[4],\n nm[5] - pm[5],\n nm[6] - pm[6],\n nm[7] - pm[7],\n nm[8] - pm[8],\n nm[9] - pm[9],\n nm[10] - pm[10],\n nm[11] - pm[11],\n nm[12] - pm[12],\n nm[13] - pm[13],\n nm[14] - pm[14],\n nm[15] - pm[15],\n ];\n return res;\n }\n else if(k === ROTATE_3D) {\n if(equalArr(p, n)) {\n return;\n }\n res[1] = [n[0] - n[0], n[1] - p[1], n[2] - p[2], [n[3][0] - p[3][0], n[3][1]]];\n }\n else if(k === FILTER) {\n // filter很特殊,里面有多个滤镜,忽视顺序按hash计算,为空视为默认值,如blur默认0,brightness默认1\n let pHash = {}, nHash = {}, keyHash = {};\n if(p) {\n p.forEach(item => {\n keyHash[item[0]] = true;\n pHash[item[0]] = item[1];\n });\n }\n if(n) {\n n.forEach(item => {\n keyHash[item[0]] = true;\n nHash[item[0]] = item[1];\n })\n }\n let v = {}, hasChange;\n // 只有blur支持px/rem/vw/vh,其余都是特殊固定单位\n Object.keys(keyHash).forEach(k => {\n if(k === 'blur') {\n if(!pHash[k]) {\n v[k] = nHash[k].slice(0);\n hasChange = true;\n }\n else if(!nHash[k]) {\n v[k] = [-pHash[k][0], pHash[k][1]];\n hasChange = true;\n }\n else {\n let v2 = calByUnit(pHash[k], nHash[k], 0, target.root);\n v[k] = [v2, pHash[k][1]];\n hasChange = true;\n }\n }\n else if(k === 'hue-rotate') {\n let nv = isNil(nHash[k]) ? 0 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 0 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'contrast') {\n let nv = isNil(nHash[k]) ? 100 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 100 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n else if(k === 'grayscale') {\n let nv = isNil(nHash[k]) ? 0 : nHash[k][0];\n let pv = isNil(pHash[k]) ? 0 : pHash[k][0];\n if(pv !== nv) {\n v[k] = [nv - pv, PERCENT];\n hasChange = true;\n }\n }\n });\n if(!hasChange) {\n return;\n }\n res[1] = v;\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n res[1] = [];\n for(let i = 0; i < 2; i++) {\n let pi = p[i];\n let ni = n[i];\n if(pi[1] === ni[1]) {\n res[1].push(ni[0] - pi[0]);\n }\n else {\n let v = calByUnit(pi, ni, target[i ? 'outerHeight' : 'outerWidth'], target.root);\n res[1].push(v || 0);\n }\n }\n if(equalArr(res[1], [0, 0])) {\n return;\n }\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n res[1] = [];\n let length = Math.min(p.length, n.length);\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni) {\n res[1].push(null);\n continue;\n }\n if(pi[1] === ni[1]) {\n let v = ni[0] - pi[0];\n if(!v) {\n res[1].push(null);\n return;\n }\n res[1].push(v);\n }\n else {\n let k2 = k === BACKGROUND_POSITION_X ? 'offsetWidth' : 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = k === BACKGROUND_POSITION_X ? 'clientWidth' : 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = k === BACKGROUND_POSITION_X ? 'width' : 'height';\n }\n let v = calByUnit(pi, ni, target[k2], target.root);\n if(!v) {\n res[1].push(null);\n return;\n }\n res[1].push(v);\n }\n }\n }\n else if(k === BOX_SHADOW) {\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let a = p[i];\n let b = n[i];\n let v = [];\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n v.push(b[j] - a[j]);\n }\n // rgba\n let c = [];\n for(let j = 0; j < 4; j++) {\n c.push(b[4][j] - a[4][j]);\n }\n v.push(c);\n res[1].push(v);\n }\n }\n else if(EXPAND_HASH.hasOwnProperty(k)) {\n if(p[1] === n[1]) {\n let v = n[0] - p[0];\n if(v === 0) {\n return;\n }\n res[1] = v;\n }\n else {\n let v = calByUnit(p, n, target[k === TRANSLATE_X || k === TRANSLATE_Z ? 'outerWidth' : 'outerHeight'], target.root);\n if(!v) {\n return;\n }\n res[1] = v;\n }\n }\n else if(k === BACKGROUND_SIZE) {\n res[1] = [];\n let length = Math.min(p.length, n.length);\n let has;\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni) {\n res[1].push(null);\n continue;\n }\n let temp = [];\n for(let j = 0; j < 2; j++) {\n let pp = pi[j], nn = ni[j];\n if(pp[1] === nn[1]) {\n temp.push(nn[0] - pp[0]);\n }\n else {\n let k2 = i ? 'offsetWidth' : 'offsetHeight';\n if(['padding-box', 'paddingBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = i ? 'clientWidth' : 'clientHeight';\n }\n else if(['content-box', 'contentBox'].indexOf(target.computedStyle[BACKGROUND_CLIP]) > -1) {\n k2 = i ? 'width' : 'height';\n }\n let v = calByUnit(pp, nn, target[k2], target.root);\n temp.push(v || 0);\n }\n }\n if(equalArr(temp, [0, 0])) {\n res[1].push(null);\n }\n else {\n res[1].push(temp);\n has = true;\n }\n }\n if(!has) {\n return;\n }\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n // backgroundImage发生了渐变色和图片的变化,fill发生渐变色和纯色的变化等\n res[1] = [];\n let length = Math.min(p.length, n.length);\n for(let i = 0; i < length; i++) {\n let pi = p[i], ni = n[i];\n if(!pi || !ni || isString(pi) || isString(ni)) {\n res[1].push(null);\n continue;\n }\n if(pi.k !== ni.k) {\n res[1].push(null);\n continue;\n }\n let temp = [];\n // 渐变\n if(pi.k === 'linear' || pi.k === 'radial' || pi.k === 'conic') {\n let pv = pi.v;\n let nv = ni.v;\n temp[0] = [];\n let { clientWidth } = target;\n let eq = equalArr(pv, nv);\n for(let i = 0, len = Math.min(pv.length, nv.length); i < len; i++) {\n let a = pv[i];\n let b = nv[i];\n let t = [];\n t.push([\n b[0][0] - a[0][0],\n b[0][1] - a[0][1],\n b[0][2] - a[0][2],\n b[0][3] - a[0][3],\n ]);\n if(a[1] && b[1]) {\n if(a[1][1] === b[1][1]) {\n t.push(b[1][0] - a[1][0]);\n }\n else {\n let v = calByUnit(a[1], b[1], clientWidth, target.root);\n t.push(v || 0);\n }\n }\n temp[0].push(t);\n }\n // 线性渐变有角度差值变化\n if(pi.k === 'linear') {\n let isArrP = Array.isArray(pi.d);\n let isArrN = Array.isArray(ni.d);\n if(isArrN !== isArrP) {\n res[1].push(null);\n continue;\n }\n if(isArrP) {\n let v = [ni.d[0] - pi.d[0], ni.d[1] - pi.d[1], ni.d[2] - pi.d[2], ni.d[3] - pi.d[3]];\n if(eq && equalArr(v, [0, 0, 0, 0])) {\n res[1].push(null);\n continue;\n }\n temp[1] = v;\n }\n else {\n let v = ni.d - pi.d;\n if(eq && v === 0) {\n res[1].push(null);\n continue;\n }\n temp[1] = v;\n }\n }\n // 径向渐变的位置\n else if(pi.k === 'radial') {\n let isArrP = Array.isArray(pi.z);\n let isArrN = Array.isArray(ni.z);\n if(isArrN !== isArrP) {\n res[1].push(null);\n continue;\n }\n if(isArrP) {\n temp[2] = [];\n for(let i = 0; i < 5; i++) {\n let pz = pi.z[i];\n // 半径比例省略为1\n if(pz === undefined) {\n pz = 1;\n }\n let nz = ni.z[i];\n if(nz === undefined) {\n nz = 1;\n }\n temp[2].push(nz - pz);\n }\n if(eq && equalArr(res[4], [0, 0, 0, 0, 0])) {\n res[1].push(null);\n }\n }\n else {\n temp[2] = [];\n for(let i = 0; i < 2; i++) {\n let pp = pi.p[i];\n let np = ni.p[i];\n if(pp[1] === np[1]) {\n temp[2].push(np[0] - pp[0]);\n }\n else {\n let v = calByUnit(pp, np, target[i ? 'clientWidth' : 'clientHeight'], target.root);\n temp[2].push(v || 0);\n }\n }\n if(eq && equalArr(res[3], [0, 0])) {\n res[1].push(null);\n }\n }\n }\n else if(pi.k === 'conic') {\n temp[1].push(n.d - p.d);\n temp[2] = [];\n for(let i = 0; i < 2; i++) {\n let pp = p.p[i];\n let np = n.p[i];\n if(pp[1] === np[1]) {\n temp[2].push(np[0] - pp[0]);\n }\n else {\n let v = calByUnit(pp, np, target[i ? 'clientWidth' : 'clientHeight'], target.root);\n temp[2].push(v || 0);\n }\n }\n if(eq && res[2] !== 0 && equalArr(res[3], [0, 0])) {\n res[1].push(null);\n }\n }\n }\n // 纯色\n else {\n if(equalArr(n, pi)) {\n res[1].push(null);\n }\n temp[0] = [\n ni[0] - pi[0],\n ni[1] - pi[1],\n ni[2] - pi[2],\n ni[3] - pi[3]\n ];\n }\n res[1].push(temp);\n }\n }\n else if(COLOR_HASH.hasOwnProperty(k)) {\n n = n[0];\n p = p[0];\n if(equalArr(n, p) || n[3] === 0 && p[3] === 0) {\n return;\n }\n res[1] = [\n n[0] - p[0],\n n[1] - p[1],\n n[2] - p[2],\n n[3] - p[3]\n ];\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n // x/y都相等无需\n if(n[0][0] === p[0][0] && n[0][1] === p[0][1]\n && n[1][0] === p[1][0] && n[1][1] === p[1][1]) {\n return;\n }\n res[1] = [];\n for(let i = 0; i < 2; i++) {\n if(n[i][1] === p[i][1]) {\n res[1].push(n[i][0] - p[i][0]);\n }\n else {\n let v = calByUnit(p[i], n[i], target[i ? 'outerHeight' : 'outerWidth'], target.root);\n res[1].push(v || 0);\n }\n }\n }\n else if(LENGTH_HASH.hasOwnProperty(k)) {\n // auto不做动画\n if(p[1] === AUTO || n[1] === AUTO) {\n return;\n }\n let computedStyle = target.computedStyle;\n let parentComputedStyle = (target.domParent || target).computedStyle;\n let diff = 0;\n if(p[1] === n[1]) {\n diff = n[0] - p[0];\n }\n // lineHeight奇怪的单位变化,%相对于fontSize\n else if(k === LINE_HEIGHT) {\n diff = calByUnit(p, n, computedStyle[FONT_SIZE], target.root);\n }\n // fontSize的%相对于parent的\n else if(k === FONT_SIZE) {\n diff = calByUnit(p, n, parentComputedStyle[FONT_SIZE], target.root);\n }\n // 相对于父height的特殊属性\n else if(k === FLEX_BASIS\n && ['column', 'column-reverse', 'columnReverse'].indexOf(computedStyle[FLEX_DIRECTION]) > -1\n || [HEIGHT, TOP, BOTTOM].indexOf(k) > -1) {\n if(p[1] !== AUTO && n[1] !== AUTO) {\n diff = calByUnit(p, n, parentComputedStyle[HEIGHT], target.root);\n }\n }\n // 其余都是相对于父width的\n else {\n if(p[1] !== AUTO && n[1] !== AUTO) {\n diff = calByUnit(p, n, parentComputedStyle[WIDTH], target.root);\n }\n }\n // 兜底NaN非法\n if(diff === 0 || isNaN(diff)) {\n return;\n }\n res[1] = diff;\n }\n else if(GEOM.hasOwnProperty(k)) {\n if(isNil(p)) {\n return;\n }\n else if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calDiff)) {\n let fn = GEOM[k][tagName].calDiff;\n if(target.isMulti) {\n let arr = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n arr.push(fn(p[i], n[i]));\n }\n return arr;\n }\n else {\n res[1] = fn(p, n);\n }\n }\n // 特殊处理multi\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n let v2 = [];\n for(let j = 0, len2 = Math.min(pv.length, nv.length); j < len2; j++) {\n let pv2 = pv[j];\n let nv2 = nv[j];\n if(isNil(pv2) || isNil(nv2)) {\n v2.push(null);\n }\n else {\n let v3 = [];\n for(let k = 0, len3 = Math.max(pv2.length, nv2.length); k < len3; k++) {\n let pv3 = pv2[k];\n let nv3 = nv2[k];\n // control由4点变2点\n if(isNil(pv3) || isNil(nv3)) {\n v3.push(0);\n }\n else {\n v3.push(nv3 - pv3);\n }\n }\n v2.push(v3);\n }\n }\n res[1].push(v2);\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(isNil(n) || !n.length || isNil(p) || !p.length || equalArr(p, n)) {\n return;\n }\n res[1] = [];\n for(let i = 0, len = Math.min(p.length, n.length); i < len; i++) {\n let pv = p[i];\n let nv = n[i];\n if(isNil(pv) || !pv.length || isNil(nv) || !nv.length) {\n res[1].push(null);\n }\n else {\n res[1].push([\n nv[0] - pv[0],\n nv[1] - pv[1],\n ]);\n }\n }\n }\n else {\n if(n === p || equalArr(n, p) || k === 'edge' || k === 'closure' || 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 {\n return [parseFloat(v) || 0, PX];\n }\n });\n }\n // display等不能有增量过程的\n else {\n return;\n }\n return res;\n}\n\n// 计算两帧之间不相同的变化,存入transition,相同的忽略\nfunction calFrame(prev, next, keys, target, tagName) {\n keys.forEach(k => {\n let ts = calDiff(prev[FRAME_STYLE], next[FRAME_STYLE], k, target, tagName);\n // 可以形成过渡的才会产生结果返回\n if(ts) {\n prev[FRAME_TRANSITION].push(ts);\n }\n });\n return next;\n}\n\nfunction binarySearch(i, j, time, frames) {\n if(i === j) {\n let frame = frames[i];\n if(frame[FRAME_TIME] > time) {\n return i - 1;\n }\n return i;\n }\n else {\n let middle = i + ((j - i) >> 1);\n let frame = frames[middle];\n if(frame[FRAME_TIME] === time) {\n return middle;\n }\n else if(frame[FRAME_TIME] > time) {\n return binarySearch(i, Math.max(middle - 1, i), time, frames);\n }\n else {\n return binarySearch(Math.min(middle + 1, j), j, time, frames);\n }\n }\n}\n\nfunction getEasing(ea) {\n let timingFunction;\n if(ea) {\n if((timingFunction = /^\\s*steps\\s*\\(\\s*(\\d+)(?:\\s*,\\s*(\\w+))?\\s*\\)/i.exec(ea))) {\n let steps = parseInt(timingFunction[1]);\n let stepsD = timingFunction[2];\n timingFunction = function(percent) {\n // steps有效定义正整数\n if(steps && steps > 0) {\n let per = 1 / steps;\n let n = stepsD === 'start' ? Math.ceil(percent / per) : Math.floor(percent / per);\n return n / steps;\n }\n return percent;\n };\n }\n else {\n timingFunction = easing.getEasing(ea);\n }\n }\n return timingFunction;\n}\n\n/**\n * 根据百分比和缓动函数计算中间态样式\n * 当easing定义为steps时,优先计算\n * @param frame 当前帧\n * @param keys 所有样式key\n * @param percent 到下一帧时间的百分比\n * @param target vd\n * @returns {*}\n */\nfunction calIntermediateStyle(frame, keys, percent, target) {\n let style = cloneStyle(frame[FRAME_STYLE], keys);\n let timingFunction = getEasing(frame[FRAME_EASING]);\n if(timingFunction && timingFunction !== linear) {\n percent = timingFunction(percent);\n }\n let transition = frame[FRAME_TRANSITION];\n for(let i = 0, len = transition.length; i < len; i++) {\n let [k, v] = transition[i];\n let st = style[k];\n // transform特殊处理,只有1个matrix,有可能不存在,需给默认矩阵\n if(k === TRANSFORM) {\n if(!st) {\n st = style[k] = [[MATRIX, mx.identity()]];\n }\n for(let i = 0; i < 16; i++) {\n st[0][1][i] += v[i] * percent;\n }\n }\n // 特殊的曲线运动计算,转换为translateXY,出现在最后一定会覆盖原本的translate防重\n else if(k === TRANSLATE_PATH) {\n let t = 1 - percent;\n if(v.length === 8) {\n style[TRANSLATE_X] = [\n v[0][0] * t * t * t\n + 3 * v[2][0] * percent * t * t\n + 3 * v[4][0] * percent * percent * t\n + v[6][0] * percent * percent * percent,\n PX,\n ];\n style[TRANSLATE_Y] = [\n v[1][0] * t * t * t\n + 3 * v[3][0] * percent * t * t\n + 3 * v[5][0] * percent * percent * t\n + v[7][0] * percent * percent * percent,\n PX,\n ];\n }\n else if(v.length === 6) {\n style[TRANSLATE_X] = [\n v[0][0] * t * t\n + 2 * v[2][0] * percent * t\n + v[4][0] * percent * percent,\n PX,\n ];\n style[TRANSLATE_Y] = [\n v[1][0] * t * t\n + 3 * v[3][0] * percent * t\n + v[5][0] * percent * percent,\n PX,\n ];\n }\n }\n else if(k === ROTATE_3D) {\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3][0] += v[3][0] * percent;\n }\n else if(NUM_CAL_HASH.hasOwnProperty(k)) {\n if(v) {\n st[0] += v * percent;\n }\n }\n else if(k === FILTER) {\n // 只有1个样式声明了filter另外一个为空,会造成无样式,需初始化数组并在下面计算出样式存入\n if(!st) {\n st = style[k] = [];\n }\n // 将已有的样式按key存入引用来操作\n let hash = {};\n st.forEach(item => {\n hash[item[0]] = item[1];\n });\n Object.keys(v).forEach(k => {\n if(hash.hasOwnProperty(k)) {\n hash[k][0] += v[k][0] * percent;\n }\n else {\n // 2个关键帧中有1个未声明,需新建样式存入\n if(k === 'blur' || k === 'hue-rotate' || k === 'grayscale') {\n let n = v[k].slice(0);\n n[0] *= percent;\n st.push([k, n]);\n }\n // 默认值是1而非0\n else if(k === 'saturate' || k === 'brightness' || k === 'contrast') {\n let n = v[k].slice(0);\n n[0] = 100 + n[0] * percent;\n st.push([k, n]);\n }\n }\n });\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n for(let i = 0; i < 2; i++) {\n st[i][0] += v[i] * percent;\n }\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n if(v[0] !== 0) {\n st[0][0] += v[0] * percent;\n }\n if(v[1] !== 0) {\n st[1][0] += v[1] * percent;\n }\n }\n else if(k === BOX_SHADOW) {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n st[i][j] += v[i][j] * percent;\n }\n // rgba\n for(let j = 0; j < 4; j++) {\n st[i][4][j] += v[i][4][j] * percent;\n }\n }\n }\n else if(k === BACKGROUND_SIZE) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0][0] += v[i][0] * percent;\n item[1][0] += v[i][1] * percent;\n }\n });\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0] += v[i] * percent;\n }\n });\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n st.forEach((st2, i) => {\n let v2 = v[i];\n if(!v2) {\n return;\n }\n let [c, d, p, z] = v2;\n if(GRADIENT_TYPE.hasOwnProperty(st2.k)) {\n for(let i = 0, len = Math.min(st2.v.length, c.length); i < len; i++) {\n let a = st2.v[i];\n let b = c[i];\n a[0][0] += b[0][0] * percent;\n a[0][1] += b[0][1] * percent;\n a[0][2] += b[0][2] * percent;\n a[0][3] += b[0][3] * percent;\n if(a[1] && b[1]) {\n a[1][0] += b[1] * percent;\n }\n }\n if(st2.k === 'linear' && st2.d !== undefined && d !== undefined) {\n if(Array.isArray(d)) {\n st2.d[0] += d[0] * percent;\n st2.d[1] += d[1] * percent;\n st2.d[2] += d[2] * percent;\n st2.d[3] += d[3] * percent;\n }\n else {\n st2.d += d * percent;\n }\n }\n if(st2.k === 'radial') {\n if(st2.z !== undefined && z !== undefined) {\n st2.z[0] += z[0] * percent;\n st2.z[1] += z[1] * percent;\n st2.z[2] += z[2] * percent;\n st2.z[3] += z[3] * percent;\n st2.z[4] += z[4] * percent;\n }\n else if(st2.p !== undefined && p !== undefined) {\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n else if(st2.k === 'conic' && st2.d !== undefined && d !== undefined) {\n st2.d += d * percent;\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n // fill纯色\n else {\n st2[0] += c[0] * percent;\n st2[1] += c[1] * percent;\n st2[2] += c[2] * percent;\n st2[3] += c[3] * percent;\n }\n });\n }\n // color可能超限[0,255],但浏览器已经做了限制,无需关心\n else if(COLOR_HASH.hasOwnProperty(k)) {\n st = st[0];\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n else if(GEOM.hasOwnProperty(k)) {\n let st = style[k];\n let tagName = target.tagName;\n if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calIncrease)) {\n let fn = GEOM[k][tagName].calIncrease;\n if(target.isMulti) {\n style[k] = st.map((item, i) => {\n return fn(item, v[i], percent);\n });\n }\n else {\n style[k] = fn(st, v, percent);\n }\n }\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n let o2 = o[j];\n let n2 = n[j];\n if(!isNil(o2) && !isNil(n2)) {\n for(let k = 0, len3 = Math.min(o2.length, n2.length); k < len3; k++) {\n if(!isNil(o2[k]) && !isNil(n2[k])) {\n o2[k] += n2[k] * percent;\n }\n }\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n v.forEach((item, i) => {\n let st2 = st[i];\n if(!isNil(item) && !isNil(st2)) {\n for(let i = 0, len = Math.min(st2.length, item.length); i < len; i++) {\n let o = st2[i];\n let n = item[i];\n if(!isNil(o) && !isNil(n)) {\n st2[i] += n * percent;\n }\n }\n }\n });\n }\n else {\n v.forEach((item, i) => {\n if(!isNil(item) && !isNil(st[i])) {\n st[i] += item * percent;\n }\n });\n }\n }\n else {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n if(!isNil(o[j]) && !isNil(n[j])) {\n o[j] += n[j] * percent;\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(!isNil(st[0]) && !isNil(v[0])) {\n st[0] += v[0] * percent;\n }\n if(!isNil(st[1]) && !isNil(v[1])) {\n st[1] += v[1] * percent;\n }\n }\n else {\n if(!isNil(st) && !isNil(v)) {\n style[k] += v * percent;\n }\n }\n }\n }\n else if(k === OPACITY || k === Z_INDEX) {\n style[k] += v * percent;\n // 精度问题可能会超过[0,1]区间\n if(k === OPACITY) {\n if(style[k] < 0) {\n style[k] = 0;\n }\n else if(style[k] > 1) {\n style[k] = 1;\n }\n }\n }\n }\n return style;\n}\n\nfunction gotoOverload(options, cb) {\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n return [options || {}, cb];\n}\n\nlet uuid = 0;\n\nclass Animation extends Event {\n constructor(target, list, options) {\n super();\n this.__id = uuid++;\n list = clone(list || []);\n if(Array.isArray(list)) {\n list = list.filter(item => item && isObject(item));\n }\n // 动画过程另外一种形式,object描述k-v形式\n else if(list && isObject(list)) {\n let nl = [];\n Object.keys(list).forEach(k => {\n let v = list[k];\n if(Array.isArray(v)) {\n for(let i = 0, len = v.length; i < len; i++) {\n let o = nl[i] = nl[i] || {\n offset: i / (len - 1),\n };\n o[k] = v[i];\n }\n }\n });\n list = nl;\n }\n else {\n list = [];\n }\n if(isNumber(options)) {\n this.__options = {\n duration: options,\n };\n options = this.__options;\n }\n let op = this.__options = options || {\n duration: 0,\n };\n let root = target.root;\n let config = this.__config = [\n false, // assigning\n false, // inFps\n false, // isDelay\n false, // begin\n false, // end\n false, // finished\n false, // nextBegin\n true, // firstPlay\n this.__frameCb,\n null, // playCb\n target,\n root,\n null, // frames\n null, // framesR\n 0, // currentTime\n 0, // nextTime\n {}, // style\n 0, // duration\n 1, // iterations\n 'none', // fill\n 1, // playbackRate\n 0, // playCount\n 'idle',\n false, // destroy\n 0, // startTime\n 0, // fpsTime\n op.easing,\n false, // enterFrame\n 0, // delay\n 0, // endDelay\n null, // keys,\n null, // originStyle,\n null, // currentFrames\n null, // currentFrame\n false, // spfLimit\n 60, // fps\n 'normal', // direction\n this.__calDiffTime,\n true, // firstEnter,\n false, // stayBegin\n false, // stayEnd\n false, // is2\n 0, // endTime\n target.__config, // nodeConfig\n root && root.__config, // rootConfig,destroy后root可能为空\n false, // outBeginDelay\n ];\n let iterations = this.iterations = op.iterations;\n let duration = this.duration = op.duration;\n let [frames, framesR, keys, originStyle] = this.__init(list, iterations, duration, op.easing, target);\n config[I_FRAMES] = frames;\n config[I_FRAMES_R] = framesR;\n config[I_KEYS] = keys;\n config[I_ORIGIN_STYLE] = originStyle;\n if(frames.length === 2) {\n config[I_IS2] = true;\n config[I_END_TIME] = frames[1][FRAME_TIME];\n }\n let fps = parseInt(op.fps) || 0;\n if(fps <= 0) {\n fps = 60;\n }\n this.fps = fps;\n this.spfLimit = op.spfLimit;\n this.delay = op.delay;\n this.endDelay = op.endDelay;\n this.playbackRate = op.playbackRate;\n this.fill = op.fill;\n this.iterations = op.iterations;\n this.direction = op.direction;\n config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(op.direction) ? framesR : frames;\n // 时间戳\n config[I_TIME_STAMP] = frame.__now;\n // 性能优化访问\n this[0] = this.__before;\n this[1] = this.__after;\n }\n\n __init(list, iterations, duration, easing, target) {\n if(list.length < 1) {\n return [[], [], [], {}];\n }\n // 过滤时间非法的,过滤后续offset<=前面的\n let offset = -1;\n let tagName = target.tagName;\n for(let i = 0, len = list.length; i < len; i++) {\n let current = list[i];\n if(current.hasOwnProperty('offset')) {\n current.offset = parseFloat(current.offset) || 0;\n current.offset = Math.max(0, current.offset);\n current.offset = Math.min(1, current.offset);\n // 超过区间[0,1]\n if(isNaN(current.offset) || current.offset < 0 || current.offset > 1) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n // <=前面的\n else if(current.offset <= offset) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n }\n // 缩写处理\n Object.keys(current).forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(current, k);\n }\n });\n // 检查key合法性\n Object.keys(current).forEach(k => {\n if(k !== 'easing' && k !== 'offset' && !change.isValid(tagName, k)) {\n delete current[k];\n }\n });\n }\n // 只有1帧复制出来变成2帧方便运行\n if(list.length === 1) {\n list[0] = clone(list[0]);\n if(list[0].offset === 1) {\n list.unshift({\n offset: 0,\n });\n }\n else {\n let copy = clone(list[0]);\n copy.offset = 1;\n list.push(copy);\n }\n }\n // 强制clone防止同引用\n else {\n list.forEach((item, i) => {\n list[i] = clone(item);\n });\n }\n // 首尾时间偏移强制为[0, 1],不是的话前后加空帧\n let first = list[0];\n if(first.hasOwnProperty('offset') && first.offset > 0) {\n first = {\n offset: 0,\n };\n list.unshift(first);\n }\n else {\n first.offset = 0;\n }\n let last = list[list.length - 1];\n if(last.hasOwnProperty('offset') && last.offset < 1) {\n last = {\n offset: 1,\n };\n list.push(last);\n }\n else {\n last.offset = 1;\n }\n // 计算没有设置offset的时间\n for(let i = 1, len = list.length; i < len; i++) {\n let start = list[i];\n // 从i=1开始offset一定>0,找到下一个有offset的,均分中间无声明的\n if(!start.hasOwnProperty('offset')) {\n let end;\n let j = i + 1;\n for(; j < len; j++) {\n end = list[j];\n if(end.hasOwnProperty('offset')) {\n break;\n }\n }\n let num = j - i + 1;\n start = list[i - 1];\n let per = (end.offset - start.offset) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.offset = start.offset + per * (k + 1 - i);\n }\n i = j;\n }\n }\n let frames = [];\n // 换算每一关键帧样式标准化\n list.forEach(item => {\n frames.push(framing(item, duration, easing));\n });\n // 为方便两帧之间计算变化,强制统一所有帧的css属性相同,没有写的为节点的当前样式currentStyle\n let keys = unify(frames, target);\n inherit(frames, keys, target);\n let framesR = clone(frames).reverse();\n // 存储原本样式以便恢复用\n let { style, props } = target;\n let originStyle = {};\n keys.forEach(k => {\n if(isGeom(tagName, k)) {\n originStyle[k] = props[k];\n }\n originStyle[k] = style[k];\n });\n // 再计算两帧之间的变化,存入transition属性\n let length = frames.length;\n let prev = frames[0];\n for(let i = 1; i < length; i++) {\n let next = frames[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n // 反向存储帧的倒排结果\n framesR.forEach(item => {\n item[FRAME_TIME] = duration - item[FRAME_TIME];\n item[FRAME_TRANSITION] = [];\n });\n prev = framesR[0];\n for(let i = 1; i < length; i++) {\n let next = framesR[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n return [frames, framesR, keys, originStyle];\n }\n\n __clean(isFinish) {\n let __config = this.__config;\n this.__cancelTask();\n __config[I_NEXT_TIME] = 0;\n let restore;\n let style = __config[I_STYLE];\n let keys = __config[I_KEYS];\n let target = __config[I_TARGET];\n if(isFinish) {\n __config[I_CURRENT_TIME] = __config[I_DELAY] + __config[I_DURATION] + __config[I_END_DELAY];\n if(__config[I_PLAY_STATE] === 'finish') {\n return;\n }\n __config[I_PLAY_STATE] = 'finish';\n // cancel需要清除finish根据情况保留\n if(!__config[I_STAY_END]) {\n __config[I_STYLE] = {};\n restore = true;\n }\n }\n else {\n __config[I_PLAY_COUNT] = __config[I_CURRENT_TIME] = 0;\n if(__config[I_PLAY_STATE] === 'idle') {\n return;\n }\n __config[I_PLAY_STATE] = 'idle';\n __config[I_STYLE] = {};\n restore = true;\n }\n // 动画取消结束不停留在最后一帧需要还原target原本的样式,需要对比目前是否是由本动画赋值的\n if(restore) {\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n if(target.__currentProps[k] === style[k]) {\n target.__currentProps[k] = target.props[k];\n }\n }\n else {\n if(target.__currentStyle[k] === style[k]) {\n target.__currentStyle[k] = target.style[k];\n }\n }\n });\n }\n }\n\n __frameCb(__config, diff, isDelay) {\n this.emit(Event.FRAME, diff, isDelay);\n if(__config[I_FIRST_PLAY]) {\n __config[I_FIRST_PLAY] = false;\n this.emit(Event.PLAY);\n }\n if(isFunction(__config[I_PLAY_CB])) {\n __config[I_PLAY_CB].call(this, diff, isDelay);\n __config[I_PLAY_CB] = null;\n }\n }\n\n __calDiffTime(__config, diff) {\n let playbackRate = __config[I_PLAYBACK_RATE];\n let spfLimit = __config[I_SPF_LIMIT];\n let fps = __config[I_FPS];\n let v = __config[I_CURRENT_TIME] = __config[I_NEXT_TIME];\n // 定帧限制每帧时间间隔最大为spf\n if(spfLimit) {\n if(spfLimit === true) {\n diff = Math.min(diff, 1000 / fps);\n }\n else if(spfLimit > 0) {\n diff = Math.min(diff, spfLimit);\n }\n }\n // 播放时间累加,并且考虑播放速度加成\n if(playbackRate !== 1 && playbackRate > 0) {\n diff *= playbackRate;\n }\n __config[I_NEXT_TIME] += diff;\n return [v, diff];\n }\n\n play(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n if(playState === 'running') {\n return this;\n }\n this.__cancelTask();\n __config[I_PLAY_CB] = cb;\n __config[I_PLAY_STATE] = 'running';\n // 每次play调用标识第一次运行,需响应play事件和回调\n __config[I_FIRST_PLAY] = true;\n // 防止finish/cancel事件重复触发,每次播放重置\n this.__hasFin = false;\n this.__hasCancel = false;\n // 只有第一次调用会进初始化,另外finish/cancel视为销毁也会重新初始化\n if(!__config[I_ENTER_FRAME]) {\n __config[I_ENTER_FRAME] = true;\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n // 初始化根据方向确定帧序列\n __config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction) ? framesR : frames;\n __config[I_CURRENT_TIME] = __config[I_NEXT_TIME] = __config[I_FPS_TIME] = 0;\n }\n // 添加每帧回调且立刻执行,本次执行调用refreshTask也是下一帧再渲染,frame的每帧都是下一帧\n frame.offFrame(this);\n frame.onFrame(this);\n __config[I_START_TIME] = frame.__now;\n __config[I_END] = false;\n return this;\n }\n\n __before(diff) {\n let __config = this.__config;\n __config[I_TIME_STAMP] = frame.__now;\n let target = __config[I_TARGET];\n let fps = __config[I_FPS];\n let playCount = __config[I_PLAY_COUNT];\n let currentFrames = __config[I_CURRENT_FRAMES];\n let iterations = __config[I_ITERATIONS];\n let stayBegin = __config[I_STAY_BEGIN];\n let stayEnd = __config[I_STAY_END];\n let delay = __config[I_DELAY];\n let root = __config[I_ROOT];\n let is2 = __config[I_IS2];\n let endTime = __config[I_END_TIME];\n let duration = __config[I_DURATION];\n let endDelay = __config[I_END_DELAY];\n let length = currentFrames.length;\n // 用本帧和上帧时间差,计算累加运行时间currentTime,以便定位当前应该处于哪个时刻\n let [currentTime, d] = __config[I_CAL_DIFF_TIME](__config, diff);\n diff = d;\n // 增加的fps功能,当<60时计算跳帧,每帧运行依旧累加时间,达到fps时重置,第一帧强制不跳\n if(!__config[I_FIRST_ENTER] && fps < 60) {\n diff = __config[I_FPS_TIME] += diff;\n if(diff < 1000 / fps) {\n __config[I_IN_FPS] = true;\n return;\n }\n __config[I_FPS_TIME] = 0;\n }\n __config[I_FIRST_ENTER] = false;\n // delay仅第一次生效\n if(playCount === 0 && currentTime < delay) {\n if(stayBegin) {\n let currentFrame = __config[I_CURRENT_FRAME] = currentFrames[0];\n let current = currentFrame[FRAME_STYLE];\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n }\n // 即便不刷新,依旧执行帧回调,同时标明让后续第一帧响应begin\n __config[I_OUT_BEGIN_DELAY] = true;\n __config[I_IS_DELAY] = true;\n return;\n }\n // 减去delay,计算在哪一帧,仅首轮\n if(playCount === 0) {\n currentTime -= delay;\n }\n if(currentTime === 0 || __config[I_OUT_BEGIN_DELAY]) {\n __config[I_OUT_BEGIN_DELAY] = false;\n __config[I_BEGIN] = true;\n }\n // 超过duration非尾轮需处理回到开头,触发新一轮动画事件,这里可能时间间隔非常大直接跳过几轮\n let round;\n while(currentTime >= duration && playCount < iterations - 1) {\n currentTime -= duration;\n __config[I_NEXT_TIME] -= duration;\n playCount = ++__config[I_PLAY_COUNT];\n __config[I_BEGIN] = true;\n round = true;\n }\n // 如果发生轮换,需重新确定正反向\n if(round) {\n let direction = __config[I_DIRECTION];\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let isAlternate = {\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction);\n // 有正反向播放需要重设帧序列\n if(isAlternate) {\n let isEven = playCount % 2 === 0;\n if(direction === 'alternate') {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n }\n let isLastCount = playCount >= iterations - 1;\n // 只有2帧可优化,否则2分查找当前帧\n let i, frameTime;\n if(is2) {\n i = currentTime < endTime ? 0 : 1;\n frameTime = endTime;\n }\n else {\n i = binarySearch(0, length - 1, currentTime, currentFrames);\n frameTime = currentFrames[i][FRAME_TIME];\n }\n // 最后一帧结束动画,仅最后一轮才会进入,需处理endDelay\n let isLastFrame = isLastCount && i === length - 1;\n let percent = 0;\n if(isLastFrame) {\n // 无需任何处理\n }\n // 否则根据目前到下一帧的时间差,计算百分比,再反馈到变化数值上\n else if(is2) {\n percent = currentTime / duration;\n }\n else {\n let total = currentFrames[i + 1][FRAME_TIME] - frameTime;\n percent = (currentTime - frameTime) / total;\n }\n let inEndDelay, currentFrame = currentFrames[i], current;\n __config[I_CURRENT_FRAME] = currentFrame;\n /** 这里要考虑全几种场景:\n * 1. 单次播放无endDelay且fill不停留(有/无差异,下同)\n * 2. 单次播放无endDelay且fill停留\n * 3. 单次播放有endDelay且fill不停留\n * 4. 单次播放有endDelay且fill停留\n * 5. 多次播放无endDelay且fill不停留(尾次/非尾次,下同)\n * 6. 多次播放无endDelay且fill停留\n * 7. 多次播放有endDelay且fill不停留\n * 8. 多次播放有endDelay且fill停留\n */\n let needClean;\n if(isLastFrame) {\n inEndDelay = currentTime < duration + endDelay;\n // 停留对比最后一帧,endDelay可能会多次进入这里,第二次进入样式相等不再重绘\n if(stayEnd) {\n current = cloneStyle(currentFrame[FRAME_STYLE], __config[I_KEYS]);\n }\n // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里\n else {\n current = cloneStyle(__config[I_ORIGIN_STYLE], __config[I_KEYS]);\n }\n // 进入endDelay或结束阶段触发end事件,注意只触发一次,防重在触发的地方做\n __config[I_NEXT_END] = true;\n if(!inEndDelay) {\n __config[I_PLAY_COUNT]++;\n __config[I_FINISHED] = true;\n frame.offFrame(this);\n needClean = true;\n __config[I_NEXT_TIME] = 0;\n }\n }\n else {\n current = calIntermediateStyle(currentFrame, __config[I_KEYS], percent, target);\n }\n // 无论两帧之间是否有变化,都生成计算结果赋给style,去重在root做\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n if(needClean) {\n 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 __config[I_FRAME_CB].call(this, __config, diff, __config[I_IS_DELAY]);\n __config[I_IS_DELAY] = false;\n if(__config[I_BEGIN]) {\n __config[I_BEGIN] = false;\n this.emit(Event.BEGIN, __config[I_PLAY_COUNT]);\n }\n // end事件只触发一次,末轮进入endDelay或直接结束时\n if(__config[I_NEXT_END] && !__config[I_END]) {\n __config[I_END] = true;\n this.emit(Event.END, __config[I_PLAY_COUNT] - 1);\n }\n if(__config[I_FINISHED]) {\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n __config[I_PLAY_STATE] = 'finished';\n this.emit(Event.FINISH);\n }\n }\n\n pause(silence) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let { pending } = this;\n if(isDestroyed || duration <= 0 || pending) {\n return this;\n }\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(!silence) {\n this.emit(Event.PAUSE);\n }\n return this;\n }\n\n resume(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n if(isDestroyed || duration <= 0 || playState !== 'paused') {\n return this;\n }\n return this.play(cb);\n }\n\n finish(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1 || playState === 'finished' || playState === 'idle') {\n return self;\n }\n // 先清除所有回调任务,多次调用finish也会清除只留最后一次\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n let current;\n // 停留在最后一帧\n if(__config[I_STAY_END]) {\n __config[I_CURRENT_FRAME] = frames[frames.length - 1];\n current = frames[frames.length - 1][FRAME_STYLE];\n }\n else {\n current = originStyle;\n }\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(current, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean(true);\n },\n __after(diff) {\n if(!self.__hasFin) {\n self.__hasFin = true;\n __config[I_ASSIGNING] = false;\n __config[I_FRAME_CB].call(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.FINISH);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n cancel(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || playState === 'idle' || frames.length < 1) {\n return self;\n }\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(originStyle, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean();\n },\n __after(diff) {\n if(!self.__hasCancel) {\n self.__hasCancel = true;\n __config[I_ASSIGNING] = false;\n __config[I_FRAME_CB].call(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.CANCEL);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n gotoAndPlay(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n // 计算出时间点直接累加播放\n this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n return this.play(cb);\n }\n\n gotoAndStop(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n v = this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n // 先play一帧,回调里模拟暂停\n return this.play(diff => {\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isFunction(cb)) {\n cb.call(this, diff);\n }\n });\n }\n\n // 同步赋予,用在extendAnimate\n assignCurrentStyle() {\n let __config = this.__config;\n let style = __config[I_STYLE];\n let target = __config[I_TARGET];\n let keys = __config[I_KEYS];\n keys.forEach(i => {\n if(style.hasOwnProperty(i)) {\n let v = style[i];\n // geom的属性变化\n if(GEOM.hasOwnProperty(i)) {\n target.currentProps[i] = v;\n }\n // 样式\n else {\n // 将动画样式直接赋给currentStyle\n target.currentStyle[i] = v;\n }\n }\n });\n }\n\n __goto(v, isFrame, excludeDelay) {\n let __config = this.__config;\n let duration = __config[I_DURATION];\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isNaN(v) || v < 0) {\n throw new Error('Param of gotoAnd(Play/Stop) is illegal: ' + v);\n }\n if(isFrame) {\n v = (v - 1) / this.spf;\n }\n if(excludeDelay) {\n v += __config[I_DELAY];\n }\n // 超过一轮去掉delay\n if(v > duration + __config[I_DELAY]) {\n v -= __config[I_DELAY];\n }\n // 超过时间长度需要累加次数\n __config[I_PLAY_COUNT] = 0;\n while(v > duration && __config[I_PLAY_COUNT] < __config[I_ITERATIONS] - 1) {\n __config[I_PLAY_COUNT]++;\n v -= duration;\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n __config[I_NEXT_TIME] = v;\n // 防止play()重置时间和当前帧组,提前计算好\n __config[I_ENTER_FRAME] = true;\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n if({\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction)) {\n let isEven = __config[I_PLAY_COUNT] % 2 === 0;\n if(direction === 'alternate') {\n __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n return v;\n }\n\n addControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.add(this);\n }\n }\n\n removeControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.remove(this);\n }\n }\n\n __stayBegin() {\n return {\n backwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __stayEnd() {\n return {\n forwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __setTarget(target) {\n this.__target = target;\n this.__config[I_TARGET] = target;\n this.__config[I_NODE_CONFIG] = target.__config;\n }\n\n __cancelTask() {\n frame.offFrame(this);\n this.__config[I_PLAY_CB] = null;\n }\n\n __destroy(sync) {\n let self = this;\n let __config = self.__config;\n if(__config[I_DESTROYED]) {\n return;\n }\n self.removeControl();\n // clean异步执行,因为里面的样式还原需要等到下一帧,否则同步执行清除后,紧接着的新同步动画获取不到currentStyle\n if(sync) {\n self.__clean();\n __config[I_TARGET] = null;\n }\n else {\n frame.nextFrame({\n __before() {\n self.__clean();\n __config[I_TARGET] = null;\n },\n });\n }\n __config[I_START_TIME] = 0;\n __config[I_DESTROYED] = true;\n }\n\n __checkModify() {\n let __config = this.__config;\n if(__config[I_PLAY_STATE] !== 'idle' && __config[I_PLAY_STATE] !== 'finished') {\n inject.warn('Modification will not come into effect when animation is running');\n }\n }\n\n get id() {\n return this.__id;\n }\n\n get target() {\n return this.__config[I_TARGET];\n }\n\n get root() {\n return this.__config[I_ROOT];\n }\n\n get keys() {\n return this.__config[I_KEYS];\n }\n\n get style() {\n return this.__config[I_STYLE];\n }\n\n get options() {\n return this.__options;\n }\n\n get duration() {\n return this.__config[I_DURATION];\n }\n\n set duration(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DURATION] !== v) {\n __config[I_DURATION] = v;\n __config[I_END_TIME] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get delay() {\n return this.__config[I_DELAY];\n }\n\n set delay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DELAY] !== v) {\n __config[I_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get endDelay() {\n return this.__config[I_END_DELAY];\n }\n\n set endDelay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_END_DELAY] !== v) {\n __config[I_END_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get fps() {\n return this.__config[I_FPS];\n }\n\n set fps(v) {\n v = parseInt(v) || 60;\n let __config = this.__config;\n if(__config[I_FPS] !== v) {\n if(v <= 0) {\n v = 60;\n }\n __config[I_FPS] = v;\n }\n return v;\n }\n\n get spf() {\n return 1 / this.fps;\n }\n\n get iterations() {\n return this.__config[I_ITERATIONS];\n }\n\n set iterations(v) {\n if(v === Infinity || util.isString(v) && v.toLowerCase() === 'infinity') {\n v = Infinity;\n }\n else {\n v = parseInt(v);\n if(isNaN(v) || v < 0) {\n v = 1;\n }\n }\n let __config = this.__config;\n if(__config[I_ITERATIONS] !== v) {\n __config[I_ITERATIONS] = v;\n }\n return v;\n }\n\n get fill() {\n return this.__config[I_FILL];\n }\n\n set fill(v) {\n v = v || 'none';\n let __config = this.__config;\n if(__config[I_FILL] !== v) {\n __config[I_FILL] = v;\n this.__checkModify();\n }\n __config[I_STAY_BEGIN] = {\n backwards: true,\n both: true,\n }.hasOwnProperty(v);\n __config[I_STAY_END] = {\n forwards: true,\n both: true,\n }.hasOwnProperty(v);\n return v;\n }\n\n get direction() {\n return this.__config[I_DIRECTION];\n }\n\n set direction(v) {\n v = v || 'normal';\n let __config = this.__config;\n if(__config[I_DIRECTION] !== v) {\n __config[I_DIRECTION] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get frames() {\n return this.__config[I_FRAMES];\n }\n\n get framesR() {\n return this.__config[I_FRAMES_R];\n }\n\n get playbackRate() {\n return this.__config[I_PLAYBACK_RATE];\n }\n\n set playbackRate(v) {\n v = parseFloat(v) || 1;\n if(v <= 0) {\n v = 1;\n }\n let __config = this.__config;\n if(__config[I_PLAYBACK_RATE] !== v) {\n __config[I_PLAYBACK_RATE] = v;\n }\n return v;\n }\n\n get easing() {\n return this.__config[I_EASING];\n }\n\n get startTime() {\n return this.__config[I_START_TIME];\n }\n\n get currentTime() {\n return this.__config[I_CURRENT_TIME];\n }\n\n set currentTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_CURRENT_TIME] !== v) {\n __config[I_CURRENT_TIME] = v;\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get nextTime() {\n return this.__config[I_NEXT_TIME];\n }\n\n set nextTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_NEXT_TIME] !== v) {\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get timestamp() {\n return this.__config[I_TIME_STAMP];\n }\n\n get pending() {\n return this.__config[I_PLAY_STATE] !== 'running';\n }\n\n get finished() {\n return this.__config[I_PLAY_STATE] === 'finished';\n }\n\n get playState() {\n return this.__config[I_PLAY_STATE];\n }\n\n get playCount() {\n return this.__config[I_PLAY_COUNT];\n }\n\n set playCount(v) {\n v = Math.max(0, parseInt(v) || 0);\n let __config = this.__config;\n if(__config[I_PLAY_COUNT] !== v) {\n __config[I_PLAY_COUNT] = v;\n }\n return v;\n }\n\n get isDestroyed() {\n return this.__config[I_DESTROYED];\n }\n\n get animating() {\n let __config = this.__config;\n let playState = __config[I_PLAY_STATE];\n if(playState === 'idle') {\n return false;\n }\n return playState !== 'finished' || __config[I_STAY_END] || __config[I_STAY_BEGIN];\n }\n\n get spfLimit() {\n let __config = this.__config;\n return __config[I_SPF_LIMIT];\n }\n\n set spfLimit(v) {\n if(util.isNumber(v) || /^\\d/.test(v)) {\n v = Math.max(0, parseInt(v) || 0);\n }\n else {\n v = !!v;\n }\n let __config = this.__config;\n if(__config[I_SPF_LIMIT] !== v) {\n __config[I_SPF_LIMIT] = v;\n }\n return v;\n }\n\n get assigning() {\n return this.__config[I_ASSIGNING];\n }\n}\n\nexport default Animation;\n","import mode from '../node/mode';\nimport geom from '../math/geom';\nimport blur from '../math/blur';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\n\nconst {\n NODE_KEY: {\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { int2rgba } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nfunction renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h, 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, DEG } = unit;\nconst { int2rgba, rgba2int, joinArr, isNil } = util;\nconst { calRelative } = css;\nconst { GEOM } = change;\nconst { mbmName, isValidMbm } = mbm;\nconst { point2d } = mx;\n\nconst {\n contain,\n NONE,\n TRANSFORM: TF,\n REFLOW,\n REPAINT,\n TRANSLATE_X: TX,\n TRANSLATE_Y: TY,\n TRANSLATE_Z: TZ,\n} = level;\n\nfunction getFirstEmptyInlineWidth(xom) {\n let n = 0;\n let flowChildren = xom.flowChildren;\n let length = flowChildren.length;\n for(let i = 0; i < length; i++) {\n let child = flowChildren[i];\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.flowChildren.length) {\n n += getFirstEmptyInlineWidth(child);\n break;\n }\n else if(child.__config[NODE_IS_INLINE]) {\n n += child.outerWidth;\n }\n }\n else {\n break;\n }\n }\n return n;\n}\n\nfunction getLastEmptyInlineWidth(xom) {\n let n = 0;\n let flowChildren = xom.flowChildren;\n let length = flowChildren.length;\n for(let i = length - 1; i >= 0; i--) {\n let child = flowChildren[i];\n if(child instanceof Xom || child instanceof Component && child.shadowRoot instanceof Xom) {\n if(child.flowChildren.length) {\n n += getLastEmptyInlineWidth(child);\n break;\n }\n else {\n n += child.outerWidth;\n }\n }\n else {\n break;\n }\n }\n return n;\n}\n\nclass Xom extends Node {\n constructor(tagName, props = {}) {\n super();\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__tagName = tagName;\n this.__style = this.props.style || {}; // style被解析后的k-v形式\n this.__currentStyle = {}; // 动画过程中绘制一开始会merge动画样式\n this.__computedStyle = {}; // 类似getComputedStyle()将currentStyle计算好数值赋给\n this.__listener = {};\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n this.listener[k] = v;\n }\n });\n this.__animationList = [];\n this.__loadBgi = {\n // 刷新回调函数,用以destroy取消用\n cb: function() {\n },\n };\n this.__cacheStyle = {}; // 是否缓存重新计算computedStyle的样式key\n this.__cacheDefs = []; // svg专用,缓存渲染时使用已有的defs,diff过程用,否则会defs被清空\n let isClip = this.__isClip = !!this.props.clip;\n let isMask = this.__isMask = isClip || !!this.props.mask;\n let config = this.__config;\n config[NODE_TAG_NAME] = tagName;\n config[NODE_CACHE_STYLE] = this.__cacheStyle;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_COMPUTED_STYLE] = this.__computedStyle;\n config[NODE_REFRESH_LV] = REFLOW;\n config[NODE_STYLE] = this.__style;\n config[NODE_MATRIX] = [];\n config[NODE_MATRIX_EVENT] = [];\n config[NODE_DEFS_CACHE] = this.__cacheDefs;\n config[NODE_IS_MASK] = isMask;\n this.__frameAnimateList = [];\n this.__contentBoxList = []; // inline存储内容用\n // this.__json domApi需要获取生成时的json引用,builder过程添加,如appendChild时json也需要跟着变更\n 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 return 0;\n }\n\n // dom常用的几种尺寸赋值\n __ioSize(w, h) {\n let computedStyle = this.computedStyle;\n this.__clientWidth = w += computedStyle[PADDING_LEFT] + computedStyle[PADDING_RIGHT];\n this.__clientHeight = h += computedStyle[PADDING_TOP] + computedStyle[PADDING_BOTTOM];\n this.__offsetWidth = w += computedStyle[BORDER_LEFT_WIDTH] + computedStyle[BORDER_RIGHT_WIDTH];\n this.__offsetHeight = h += computedStyle[BORDER_TOP_WIDTH] + computedStyle[BORDER_BOTTOM_WIDTH];\n this.__outerWidth = w + computedStyle[MARGIN_LEFT] + computedStyle[MARGIN_RIGHT];\n this.__outerHeight = h + computedStyle[MARGIN_TOP] + computedStyle[MARGIN_BOTTOM];\n }\n\n // 换算margin/padding为px单位,onlyFixedValue只考虑绝对值,不考虑百分比等\n __calMp(v, w, onlyFixedValue) {\n let n = 0;\n if(v[1] === PX) {\n n += v[0];\n }\n else if(v[1] === PERCENT && !onlyFixedValue) {\n v[0] *= w * 0.01;\n v[1] = PX;\n n += v[0];\n }\n else if(v[1] === REM) {\n n += v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n n += v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n n += v[0] * this.root.height * 0.01;\n }\n return n;\n }\n\n // 为basis的b/min/max添加mpb,只有当b未显示指定等于w/content时才加,同时返回mpb值\n __addMp(isDirectionRow, w, currentStyle, res, isDirectItem) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w, !isDirectItem)\n + this.__calMp(marginRight, w, !isDirectItem)\n + this.__calMp(paddingLeft, w, !isDirectItem)\n + this.__calMp(paddingRight, w, !isDirectItem);\n if(borderLeftWidth[1] === PX) {\n mp += borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n mp += borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n mp += borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n mp += borderLeftWidth[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n mp += borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n mp += borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n mp += borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n mp += borderRightWidth[0] * this.root.height * 0.01;\n }\n res = res.map(item => item + mp);\n }\n else {\n let mp = this.__calMp(marginTop, w, !isDirectItem)\n + this.__calMp(marginBottom, w, !isDirectItem)\n + this.__calMp(paddingTop, w, !isDirectItem)\n + this.__calMp(paddingBottom, w, !isDirectItem);\n if(borderTopWidth[1] === PX) {\n mp += borderTopWidth[0];\n }\n else if(borderTopWidth[1] === REM) {\n mp += borderTopWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderTopWidth[1] === VW) {\n mp += borderTopWidth[0] * this.root.width * 0.01;\n }\n else if(borderTopWidth[1] === VH) {\n mp += borderTopWidth[0] * this.root.height * 0.01;\n }\n if(borderBottomWidth[1] === PX) {\n mp += borderBottomWidth[0];\n }\n else if(borderBottomWidth[1] === REM) {\n mp += borderBottomWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderBottomWidth[1] === VW) {\n mp += borderBottomWidth[0] * this.root.width * 0.01;\n }\n else if(borderBottomWidth[1] === VH) {\n mp += borderBottomWidth[0] * this.root.height * 0.01;\n }\n res = res.map(item => item + mp);\n }\n return res;\n }\n\n // absolute且无尺寸时,isVirtual标明先假布局一次计算尺寸,还有flex列计算时\n // fromAbs为absolute节点特有省略计算标识,本节点是abs时真正布局传入\n __layout(data, isVirtual, fromAbs) {\n css.computeReflow(this, this.isShadowRoot);\n let { w } = data;\n let { isDestroyed, currentStyle, computedStyle, __config } = this;\n let {\n [DISPLAY]: display,\n } = computedStyle;\n let {\n [WIDTH]: width,\n [POSITION]: position,\n } = currentStyle;\n this.clearCache();\n this.__layoutData = {\n x: data.x,\n y: data.y,\n w: data.w,\n h: data.h,\n lx: data.lx,\n };\n __config[NODE_REFRESH_LV] = REFLOW;\n __config[NODE_LIMIT_CACHE] = false;\n __config[NODE_IS_INLINE] = false;\n // 防止display:none不统计mask,isVirtual忽略,abs布局后续会真正来走一遍\n if(!isVirtual) {\n let { next } = this;\n // mask关系只有布局才会变更,普通渲染关系不会改变,clip也是mask的一种\n if(!this.isMask && next && (next.isMask)) {\n let count = 0;\n while(next) {\n if(next.isMask) {\n count++;\n }\n else {\n break;\n }\n next = next.next;\n }\n this.__hasMask = count;\n }\n }\n this.__ox = this.__oy = 0;\n if(isDestroyed || display === 'none') {\n this.__width = this.__height\n = this.__clientWidth = this.__clientHeight\n = this.__offsetWidth = this.__offsetHeight\n = this.__outerWidth = this.__outerHeight\n = computedStyle[WIDTH] = computedStyle[HEIGHT] = 0;\n this.__x = data.x;\n this.__y = data.y;\n this.__layoutNone();\n return;\n }\n // margin/padding在abs前已经计算过了,无需二次计算\n if(!fromAbs) {\n this.__mp(currentStyle, computedStyle, w);\n }\n // inline的width/height无效,其它有效\n if(width[1] !== AUTO) {\n if(this.__isRealInline() && currentStyle[DISPLAY] === 'inline') {\n width[0] = 0;\n width[1] = AUTO;\n }\n else {\n switch(width[1]) {\n case PX:\n w = width[0];\n break;\n case PERCENT:\n w *= width[0] * 0.01;\n break;\n case REM:\n w = width[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n w = width[0] * this.root.width * 0.01;\n break;\n case VH:\n w = width[0] * this.root.height * 0.01;\n break;\n }\n }\n }\n let lineClampCount = 0;\n // 4种布局,默认block,inlineBlock基本可以复用inline逻辑,除了尺寸\n if(display === 'flex') {\n this.__layoutFlex(data, isVirtual);\n }\n else if(display === 'inlineBlock' || display === 'inline-block') {\n lineClampCount = this.__layoutInline(data, isVirtual);\n }\n else if(display === 'inline') {\n lineClampCount = this.__layoutInline(data, isVirtual, true);\n }\n else {\n this.__layoutBlock(data, isVirtual);\n }\n // relative渲染时做偏移,百分比基于父元素,若父元素没有定高则为0\n if(position === 'relative') {\n let { [TOP]: top, [RIGHT]: right, [BOTTOM]: bottom, [LEFT]: left } = currentStyle;\n let { parent } = this;\n if(top[1] !== AUTO) {\n let n = calRelative(currentStyle, TOP, top, parent);\n this.__offsetY(n);\n computedStyle[TOP] = n;\n computedStyle[BOTTOM] = 'auto';\n }\n else if(bottom[1] !== AUTO) {\n let n = calRelative(currentStyle, BOTTOM, bottom, parent);\n this.__offsetY(-n);\n computedStyle[BOTTOM] = n;\n computedStyle[TOP] = 'auto';\n }\n else {\n computedStyle[TOP] = computedStyle[BOTTOM] = 'auto';\n }\n if(left[1] !== AUTO) {\n let n = calRelative(currentStyle, LEFT, left, parent, true);\n this.__offsetX(n);\n computedStyle[LEFT] = n;\n computedStyle[RIGHT] = 'auto';\n }\n else if(right[1] !== AUTO) {\n let n = calRelative(currentStyle, RIGHT, right, parent, true);\n this.__offsetX(-n);\n computedStyle[RIGHT] = n;\n computedStyle[LEFT] = 'auto';\n }\n else {\n computedStyle[LEFT] = computedStyle[RIGHT] = 'auto';\n }\n }\n else if(position !== 'absolute') {\n computedStyle[TOP] = computedStyle[BOTTOM] = computedStyle[LEFT] = computedStyle[RIGHT] = 'auto';\n }\n // 计算结果存入computedStyle和6个坐标,inline在其inlineSize特殊处理\n let x = this.__sx = this.x + this.ox;\n let y = this.__sy = this.y + this.oy;\n if(!__config[NODE_IS_INLINE]) {\n x = this.__sx1 = x + computedStyle[MARGIN_LEFT];\n x = this.__sx2 = x + computedStyle[BORDER_LEFT_WIDTH];\n x = this.__sx3 = x + computedStyle[PADDING_LEFT];\n x = this.__sx4 = x + this.width;\n x = this.__sx5 = x + computedStyle[PADDING_RIGHT];\n this.__sx6 = x + computedStyle[BORDER_RIGHT_WIDTH];\n y = this.__sy1 = y + computedStyle[MARGIN_TOP];\n y = this.__sy2 = y + computedStyle[BORDER_TOP_WIDTH];\n y = this.__sy3 = y + computedStyle[PADDING_TOP];\n y = this.__sy4 = y + this.height;\n y = this.__sy5 = y + computedStyle[PADDING_BOTTOM];\n this.__sy6 = y + computedStyle[BORDER_BOTTOM_WIDTH];\n }\n computedStyle[WIDTH] = this.width;\n computedStyle[HEIGHT] = this.height;\n // abs布局的不执行,在__layoutAbs末尾做,防止未布局没有尺寸从而动画计算错误\n if(!fromAbs) {\n this.__execAr();\n }\n return lineClampCount;\n }\n\n __execAr() {\n // 动态json引用时动画暂存,第一次布局时处理这些动画到root的animateController上\n let ar = this.__animateRecords;\n if(ar) {\n this.__animateRecords = null;\n // parse没有dom时,animate的target引用都是json,vd后生成需重新赋值\n ar.list.forEach(item => {\n if(item.target.vd instanceof Xom) {\n item.target = item.target.vd;\n }\n });\n let ac = ar.controller || this.root.animateController;\n // 不自动播放进入记录列表,初始化并等待手动调用\n if(ar.options && ar.options.autoPlay === false) {\n ac.__records2 = ac.__records2.concat(ar.list);\n ac.init(ac.__records2, ac.list2);\n }\n else {\n ac.__records = ac.__records.concat(ar.list);\n ac.__playAuto();\n }\n }\n }\n\n __layoutNone() {\n let { computedStyle } = this;\n computedStyle[DISPLAY] = 'none';\n computedStyle[MARGIN_TOP]\n = computedStyle[MARGIN_RIGHT]\n = computedStyle[MARGIN_BOTTOM]\n = computedStyle[MARGIN_LEFT]\n = computedStyle[PADDING_TOP]\n = computedStyle[PADDING_RIGHT]\n = computedStyle[PADDING_BOTTOM]\n = computedStyle[PADDING_LEFT]\n = 0;\n }\n\n // 预先计算是否是固定宽高,布局点位和尺寸考虑margin/border/padding\n __preLayout(data, isInline) {\n let { x, y, w, h, w2, h2, w3, h3, lx, nowrap, lineBoxManager, endSpace = 0 } = data;\n this.__x = x;\n this.__y = y;\n let { currentStyle, computedStyle } = this;\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n // 除了auto外都是固定宽高度\n let fixedWidth;\n let fixedHeight;\n // 绝对定位是left+right这种其实等于定义了width,但不能修改原始style,存入特殊变量标识\n if(w2 !== undefined) {\n fixedWidth = true;\n w = w2;\n }\n // flex时也会用到,子级得出目标主尺寸后按这个来\n else if(w3 !== undefined) {\n fixedWidth = true;\n w = w3;\n }\n else if(width[1] !== AUTO) {\n fixedWidth = true;\n switch(width[1]) {\n case PX:\n w = width[0];\n break;\n case PERCENT:\n w *= width[0] * 0.01;\n break;\n case REM:\n w = width[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n w = width[0] * this.root.width * 0.01;\n break;\n case VH:\n w = width[0] * this.root.height * 0.01;\n break;\n }\n }\n if(h2 !== undefined) {\n fixedHeight = true;\n h = h2;\n }\n else if(h3 !== undefined) {\n fixedHeight = true;\n h = h3;\n }\n else if(height[1] !== AUTO) {\n fixedHeight = true;\n switch(height[1]) {\n case PX:\n h = height[0];\n break;\n case PERCENT:\n h *= height[0] * 0.01;\n break;\n case REM:\n h = height[0] * this.root.computedStyle[FONT_SIZE];\n break;\n case VW:\n h = height[0] * this.root.width * 0.01;\n break;\n case VH:\n h = height[0] * this.root.height * 0.01;\n break;\n }\n }\n // margin/padding/border影响x和y和尺寸,注意inline的y不受mpb影响\n x += borderLeftWidth + marginLeft + paddingLeft;\n data.x = x;\n if(!isInline) {\n y += borderTopWidth + marginTop + paddingTop;\n }\n data.y = y;\n // inline的w/h很特殊,需不考虑inline自身水平的mpb以便换行,因为mpb只在首尾行生效,所以首尾需特殊处理中间忽略\n // 当嵌套inline时更加复杂,假如inline有尾部mpb,最后一行需考虑,如果此inline是父的最后一个且父有mpb需叠加\n let selfEndSpace = 0;\n if(isInline) {\n selfEndSpace = paddingRight + borderRightWidth + marginRight;\n }\n // 传入w3/h3时,flex的item已知目标主尺寸,需减去mpb,其一定是block和inline互斥\n if(!isInline) {\n if(width[1] === AUTO || w3 !== undefined) {\n w -= borderLeftWidth + borderRightWidth + marginLeft + marginRight + paddingLeft + paddingRight;\n }\n if(height[1] === AUTO || h3 !== undefined) {\n h -= borderTopWidth + borderBottomWidth + marginTop + marginBottom + paddingTop + paddingBottom;\n }\n }\n return {\n fixedWidth,\n fixedHeight,\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n nowrap,\n endSpace,\n selfEndSpace,\n };\n }\n\n // 处理margin:xx auto居中对齐或右对齐\n __marginAuto(style, data) {\n let {\n [POSITION]: position,\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [WIDTH]: width,\n } = style;\n if(position !== 'absolute' && (display === 'block' || display === 'flex')\n && (width[1] !== AUTO || this.tagName === 'img') && marginLeft[1] === AUTO && marginRight[1] === AUTO) {\n let ow = this.outerWidth;\n if(ow < data.w) {\n this.__offsetX((data.w - ow) * 0.5, true);\n }\n }\n }\n\n __calMatrix(lv, __cacheStyle, currentStyle, computedStyle, __config, sx1, sy1, offsetWidth, offsetHeight) {\n if(__config[NODE_IS_INLINE]) {\n computedStyle[TRANSFORM_ORIGIN] = [sx1, sy1];\n return __cacheStyle[MATRIX] = mx.identity();\n }\n let matrixCache = __cacheStyle[MATRIX];\n // tx/ty变化特殊优化\n if(matrixCache && lv < REFLOW && !contain(lv, TF)) {\n let x = 0, y = 0, z = 0;\n if(contain(lv, TX)) {\n let v = currentStyle[TRANSLATE_X];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else {\n v = v[0];\n }\n x = v - (computedStyle[TRANSLATE_X] || 0);\n computedStyle[TRANSLATE_X] = v;\n computedStyle[TRANSFORM][12] += x;\n matrixCache[12] += x;\n }\n if(contain(lv, TY)) {\n let v = currentStyle[TRANSLATE_Y];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetHeight * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else {\n v = v[0];\n }\n y = v - (computedStyle[TRANSLATE_Y] || 0);\n computedStyle[TRANSLATE_Y] = v;\n computedStyle[TRANSFORM][13] += y;\n matrixCache[13] += y;\n }\n if(contain(lv, TZ)) {\n let v = currentStyle[TRANSLATE_Z];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else {\n v = v[0];\n }\n z = v - (computedStyle[TRANSLATE_Z] || 0);\n computedStyle[TRANSLATE_Z] = v;\n computedStyle[TRANSFORM][14] += z;\n matrixCache[14] += z;\n }\n __cacheStyle[MATRIX] = matrixCache;\n }\n // 先根据cache计算需要重新计算的computedStyle\n else {\n if(sx1 === undefined) {\n sx1 = this.__sx1;\n sy1 = this.__sy1;\n offsetWidth = this.offsetWidth;\n offsetHeight = this.offsetHeight;\n }\n if(__cacheStyle[TRANSFORM_ORIGIN] === undefined) {\n __cacheStyle[TRANSFORM_ORIGIN] = true;\n matrixCache = null;\n computedStyle[TRANSFORM_ORIGIN] = tf.calOrigin(currentStyle[TRANSFORM_ORIGIN], offsetWidth, offsetHeight, this.root);\n }\n if(__cacheStyle[TRANSFORM] === undefined\n || __cacheStyle[TRANSLATE_X] === undefined\n || __cacheStyle[TRANSLATE_Y] === undefined\n || __cacheStyle[TRANSLATE_Z] === undefined\n || __cacheStyle[ROTATE_X] === undefined\n || __cacheStyle[ROTATE_Y] === undefined\n || __cacheStyle[ROTATE_Z] === undefined\n || __cacheStyle[ROTATE_3D] === undefined\n || __cacheStyle[SCALE_X] === undefined\n || __cacheStyle[SCALE_Y] === undefined\n || __cacheStyle[SCALE_Z] === undefined\n || __cacheStyle[SKEW_X] === undefined\n || __cacheStyle[SKEW_Y] === undefined) {\n __cacheStyle[TRANSFORM]\n = __cacheStyle[TRANSLATE_X]\n = __cacheStyle[TRANSLATE_Y]\n = __cacheStyle[TRANSLATE_Z]\n = __cacheStyle[ROTATE_X]\n = __cacheStyle[ROTATE_Y]\n = __cacheStyle[ROTATE_Z]\n = __cacheStyle[SCALE_X]\n = __cacheStyle[SCALE_Y]\n = __cacheStyle[SCALE_Z]\n = __cacheStyle[SKEW_X]\n = __cacheStyle[SKEW_Y]\n = true;\n matrixCache = null;\n let matrix;\n // transform相对于自身\n if(currentStyle[TRANSFORM]) {\n matrix = tf.calMatrix(currentStyle[TRANSFORM], offsetWidth, offsetHeight, this.root);\n }\n // 没有transform则看是否有扩展的css独立变换属性\n else {\n let temp = [];\n [\n TRANSLATE_X,\n TRANSLATE_Y,\n TRANSLATE_Z,\n ROTATE_X,\n ROTATE_Y,\n ROTATE_Z,\n ROTATE_3D,\n SKEW_X,\n SKEW_Y,\n SCALE_X,\n SCALE_Y,\n SCALE_Z,\n ].forEach(k => {\n // 删除之前遗留的\n delete computedStyle[k];\n let v = currentStyle[k];\n if(isNil(v)) {\n return;\n }\n if(k === ROTATE_3D) {\n computedStyle[k] = [v[0], v[1], v[2], v[3][0]];\n if(v[3][0] === 0) {\n return;\n }\n temp.push([k, v]);\n return;\n }\n computedStyle[k] = v[0];\n // scale为1和其它为0避免计算浪费\n let isScale = k === SCALE_X || k === SCALE_Y || k === SCALE_Z;\n if(v[0] === 1 && isScale || !isScale && v[0] === 0) {\n return;\n }\n if(v[1] === PERCENT) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * offsetWidth * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * offsetHeight * 0.01;\n }\n }\n else if(v[1] === REM) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n }\n else if(v[1] === VW) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.width * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.width * 0.01;\n }\n }\n else if(v[1] === VH) {\n if(k === TRANSLATE_X || k === TRANSLATE_Z) {\n computedStyle[k] = v[0] * this.root.height * 0.01;\n }\n else if(k === TRANSLATE_Y) {\n computedStyle[k] = v[0] * this.root.height * 0.01;\n }\n }\n temp.push([k, v]);\n });\n if(temp.length) {\n matrix = tf.calMatrix(temp, offsetWidth, offsetHeight, this.root);\n }\n }\n computedStyle[TRANSFORM] = matrix || mx.identity();\n }\n if(!matrixCache) {\n let m = computedStyle[TRANSFORM];\n let tfo = computedStyle[TRANSFORM_ORIGIN].slice(0);\n tfo[0] += sx1 || 0;\n tfo[1] += sy1 || 0;\n matrixCache = __cacheStyle[MATRIX] = tf.calMatrixByOrigin(m, tfo);\n }\n }\n return matrixCache;\n }\n\n /**\n * 将currentStyle计算为computedStyle,同时存入cacheStyle可缓存的结果防止无变更重复计算\n * @param renderMode\n * @param ctx\n * @param parent\n * @param __cacheStyle\n * @param currentStyle\n * @param computedStyle\n * @param clientWidth\n * @param clientHeight\n * @param offsetWidth\n * @param offsetHeight\n * @param borderTopWidth\n * @param borderRightWidth\n * @param borderBottomWidth\n * @param borderLeftWidth\n * @param paddingTop\n * @param paddingRight\n * @param paddingBottom\n * @param paddingLeft\n * @param x1\n * @param x2\n * @param x3\n * @param x4\n * @param x5\n * @param x6\n * @param y1\n * @param y2\n * @param y3\n * @param y4\n * @param y5\n * @param y6\n * @returns {*[]}\n * @private\n */\n __calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6) {\n let bx1 = x1, by1 = y1, bx2 = x6, by2 = y6;\n let backgroundClip = computedStyle[BACKGROUND_CLIP] = currentStyle[BACKGROUND_CLIP];\n // 默认border-box\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n bx1 = x2;\n by1 = y2;\n bx2 = x5;\n by2 = y5;\n }\n else if(backgroundClip === 'contentBox' || backgroundClip === 'content-box') {\n bx1 = x3;\n by1 = y3;\n bx2 = x4;\n by2 = y4;\n }\n let isInline = this.__config[NODE_IS_INLINE];\n if(isInline && !this.contentBoxList.length) {\n isInline = false;\n }\n // 这些直接赋值的不需要再算缓存\n [\n OPACITY,\n Z_INDEX,\n BORDER_TOP_STYLE,\n BORDER_RIGHT_STYLE,\n BORDER_BOTTOM_STYLE,\n BORDER_LEFT_STYLE,\n BACKGROUND_REPEAT,\n OVERFLOW,\n MIX_BLEND_MODE,\n TEXT_OVERFLOW,\n BACKGROUND_CLIP,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n if(isNil(__cacheStyle[FILTER])) {\n __cacheStyle[FILTER] = true;\n this.__calFilter(currentStyle, computedStyle);\n }\n if(isNil(__cacheStyle[BACKGROUND_POSITION_X])) {\n __cacheStyle[BACKGROUND_POSITION_X] = true;\n let {\n [BACKGROUND_POSITION_X]: bgX,\n } = currentStyle;\n computedStyle[BACKGROUND_POSITION_X] = (bgX || []).map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n if(item[1] === PERCENT) {\n return item[0] + '%';\n }\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_POSITION_Y])) {\n __cacheStyle[BACKGROUND_POSITION_Y] = true;\n let {\n [BACKGROUND_POSITION_Y]: bgY,\n } = currentStyle;\n computedStyle[BACKGROUND_POSITION_Y] = (bgY || []).map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n if(item[1] === PERCENT) {\n return item[0] + '%';\n }\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_SIZE])) {\n __cacheStyle[BACKGROUND_SIZE] = true;\n computedStyle[BACKGROUND_SIZE] = (currentStyle[BACKGROUND_SIZE] || []).map(item => {\n return bg.calBackgroundSize(item, bx2 - bx1, by2 - by1, this.root);\n });\n }\n if(isNil(__cacheStyle[BACKGROUND_IMAGE])) {\n let bgI = computedStyle[BACKGROUND_IMAGE] = currentStyle[BACKGROUND_IMAGE].slice(0);\n __cacheStyle[BACKGROUND_IMAGE] = bgI.map((bgi, i) => {\n if(!bgi) {\n return null;\n }\n // 防止隐藏不加载背景图\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i] = this.__loadBgi[i] || {};\n let cache = inject.IMG[BACKGROUND_IMAGE];\n if(cache && cache.state === inject.LOADED) {\n loadBgi.url = BACKGROUND_IMAGE;\n loadBgi.source = cache.source;\n loadBgi.width = cache.width;\n loadBgi.height = cache.height;\n }\n else if(loadBgi.url !== bgi) {\n // 可能改变导致多次加载,每次清空,成功后还要比对url是否相同\n loadBgi.url = bgi;\n loadBgi.source = null;\n let node = this;\n let root = node.root;\n inject.measureImg(bgi, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败不绘制bgi\n if(data.success && data.url === loadBgi.url && !this.isDestroyed) {\n loadBgi.source = data.source;\n loadBgi.width = data.width;\n loadBgi.height = data.height;\n root.delRefreshTask(loadBgi.cb);\n root.addRefreshTask(loadBgi.cb = {\n __before() {\n __cacheStyle[BACKGROUND_IMAGE] = undefined;\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_FOCUS] = REPAINT;\n res[UPDATE_CONFIG] = node.__config;\n root.__addUpdate(node, node.__config, root, root.__config, res);\n },\n });\n }\n }, {\n ctx,\n root,\n width: bx2 - bx1,\n height: by2 - by1,\n });\n }\n return true;\n }\n else if(!isInline && bgi.k) {\n // gradient在渲染时才生成\n return true;\n }\n });\n }\n if(isNil(__cacheStyle[BOX_SHADOW])) {\n __cacheStyle[BOX_SHADOW] = true;\n computedStyle[BOX_SHADOW] = (currentStyle[BOX_SHADOW] || []).map(item => {\n return item.map((item2, i) => {\n if(i > 3) {\n return item2;\n }\n let v = item2[0];\n if(item2[1] === PERCENT) {\n if(i % 2 === 0) {\n v *= 0.01 * (bx2 - bx1);\n }\n else {\n v *= 0.01 * (by2 - by1);\n }\n }\n else if(item2[1] === REM) {\n v = v * this.root.computedStyle[FONT_SIZE];\n }\n else if(item2[1] === VW) {\n v = v * this.root.width * 0.01;\n }\n else if(item2[1] === VH) {\n v = v * this.root.height * 0.01;\n }\n return v;\n });\n });\n }\n [\n BACKGROUND_COLOR,\n BORDER_TOP_COLOR,\n BORDER_RIGHT_COLOR,\n BORDER_BOTTOM_COLOR,\n BORDER_LEFT_COLOR,\n ].forEach(k => {\n if(isNil(__cacheStyle[k])) {\n __cacheStyle[k] = int2rgba(computedStyle[k] = currentStyle[k][0]);\n }\n });\n // 圆角边计算\n if(isNil(__cacheStyle[BORDER_TOP_LEFT_RADIUS])\n || isNil(__cacheStyle[BORDER_TOP_RIGHT_RADIUS])\n || isNil(__cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS])\n || isNil(__cacheStyle[BORDER_BOTTOM_LEFT_RADIUS])) {\n __cacheStyle[BORDER_TOP_LEFT_RADIUS]\n = __cacheStyle[BORDER_TOP_RIGHT_RADIUS]\n = __cacheStyle[BORDER_BOTTOM_RIGHT_RADIUS]\n = __cacheStyle[BORDER_BOTTOM_LEFT_RADIUS]\n = true;\n // 非替代的inline计算看contentBox首尾\n if(isInline) {\n border.calBorderRadiusInline(this.contentBoxList, currentStyle, computedStyle, this.root);\n }\n // 普通block整体计算\n else {\n border.calBorderRadius(offsetWidth, offsetHeight, currentStyle, computedStyle, this.root);\n }\n }\n // width/style/radius影响border,color不影响渲染缓存\n let btlr = computedStyle[BORDER_TOP_LEFT_RADIUS];\n let btrr = computedStyle[BORDER_TOP_RIGHT_RADIUS];\n let bbrr = computedStyle[BORDER_BOTTOM_RIGHT_RADIUS];\n let bblr = computedStyle[BORDER_BOTTOM_LEFT_RADIUS];\n ['Top', 'Right', 'Bottom', 'Left'].forEach(k => {\n k = 'border' + k;\n let k2 = STYLE_KEY[style2Upper(k)];\n let kw = STYLE_KEY[style2Upper(k + 'Width')];\n let ks = STYLE_KEY[style2Upper(k + 'Style')];\n // width/style变更影响border重新计算\n if(isNil(__cacheStyle[kw])) {\n __cacheStyle[kw] = true;\n __cacheStyle[k2] = undefined;\n }\n if(isNil(__cacheStyle[ks])) {\n __cacheStyle[ks] = true;\n __cacheStyle[k2] = undefined;\n }\n if(isNil(__cacheStyle[k2])) {\n if(k2 === BORDER_TOP) {\n if(borderTopWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderTopWidth / borderLeftWidth);\n let deg2 = Math.atan(borderTopWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderTopWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 0, btlr, btrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_RIGHT) {\n if(borderRightWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderRightWidth / borderTopWidth);\n let deg2 = Math.atan(borderRightWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderRightWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 1, btrr, bbrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_BOTTOM) {\n if(borderBottomWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderBottomWidth / borderLeftWidth);\n let deg2 = Math.atan(borderBottomWidth / borderRightWidth);\n __cacheStyle[k2] = border.calPoints(borderBottomWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 2, bblr, bbrr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n else if(k2 === BORDER_LEFT) {\n if(borderLeftWidth > 0) {\n if(!isInline) {\n let deg1 = Math.atan(borderLeftWidth / borderTopWidth);\n let deg2 = Math.atan(borderLeftWidth / borderBottomWidth);\n __cacheStyle[k2] = border.calPoints(borderLeftWidth, computedStyle[ks], deg1, deg2,\n x1, x2, x5, x6, y1, y2, y5, y6, 3, btlr, bblr);\n }\n }\n else {\n __cacheStyle[k2] = [];\n }\n }\n }\n });\n // 强制计算继承性的\n let parentComputedStyle = parent && parent.computedStyle;\n if(currentStyle[FONT_STYLE][1] === INHERIT) {\n computedStyle[FONT_STYLE] = parent ? parentComputedStyle[FONT_STYLE] : 'normal';\n }\n else if(isNil(__cacheStyle[FONT_STYLE])) {\n computedStyle[FONT_STYLE] = currentStyle[FONT_STYLE][0];\n }\n __cacheStyle[FONT_STYLE] = computedStyle[FONT_STYLE];\n if(currentStyle[COLOR][1] === INHERIT) {\n computedStyle[COLOR] = parent ? parentComputedStyle[COLOR] : [0, 0, 0, 1];\n __cacheStyle[COLOR] = int2rgba(computedStyle[COLOR]);\n }\n else if(isNil(__cacheStyle[COLOR])) {\n computedStyle[COLOR] = rgba2int(currentStyle[COLOR][0]);\n __cacheStyle[COLOR] = int2rgba(computedStyle[COLOR]);\n }\n if(currentStyle[TEXT_STROKE_COLOR][1] === INHERIT) {\n computedStyle[TEXT_STROKE_COLOR] = parent ? parentComputedStyle[TEXT_STROKE_COLOR] : [0, 0, 0, 1];\n __cacheStyle[TEXT_STROKE_COLOR] = int2rgba(computedStyle[TEXT_STROKE_COLOR]);\n }\n else if(isNil(__cacheStyle[TEXT_STROKE_COLOR])) {\n computedStyle[TEXT_STROKE_COLOR] = rgba2int(currentStyle[TEXT_STROKE_COLOR][0]);\n __cacheStyle[TEXT_STROKE_COLOR] = int2rgba(computedStyle[TEXT_STROKE_COLOR]);\n }\n if(currentStyle[TEXT_STROKE_WIDTH][1] === INHERIT) {\n computedStyle[TEXT_STROKE_WIDTH] = parent ? parentComputedStyle[TEXT_STROKE_WIDTH] : 0;\n __cacheStyle[TEXT_STROKE_WIDTH] = true;\n }\n else if(isNil(__cacheStyle[TEXT_STROKE_WIDTH])) {\n let v = currentStyle[TEXT_STROKE_WIDTH];\n if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else {\n v = v[0];\n }\n computedStyle[TEXT_STROKE_WIDTH] = v;\n __cacheStyle[TEXT_STROKE_WIDTH] = true;\n }\n if(currentStyle[TEXT_STROKE_OVER][1] === INHERIT) {\n __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = parent ? parentComputedStyle[TEXT_STROKE_OVER] : 'none';\n }\n else {\n __cacheStyle[TEXT_STROKE_OVER] = computedStyle[TEXT_STROKE_OVER] = currentStyle[TEXT_STROKE_OVER][0];\n }\n if(currentStyle[VISIBILITY][1] === INHERIT) {\n computedStyle[VISIBILITY] = parent ? parentComputedStyle[VISIBILITY] : 'visible';\n }\n else if(isNil(__cacheStyle[VISIBILITY])) {\n computedStyle[VISIBILITY] = currentStyle[VISIBILITY][0];\n }\n __cacheStyle[VISIBILITY] = computedStyle[VISIBILITY];\n if(currentStyle[POINTER_EVENTS][1] === INHERIT) {\n computedStyle[POINTER_EVENTS] = parent ? parentComputedStyle[POINTER_EVENTS] : 'auto';\n }\n else if(isNil(__cacheStyle[POINTER_EVENTS])) {\n computedStyle[POINTER_EVENTS] = currentStyle[POINTER_EVENTS][0];\n }\n __cacheStyle[POINTER_EVENTS] = computedStyle[POINTER_EVENTS];\n 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 {\n ppt = v[0];\n }\n computedStyle[PERSPECTIVE] = ppt;\n }\n if(isNil(__cacheStyle[PERSPECTIVE_ORIGIN])) {\n __cacheStyle[PERSPECTIVE_ORIGIN] = true;\n rebuild = true;\n computedStyle[PERSPECTIVE_ORIGIN] = tf.calOrigin(currentStyle[PERSPECTIVE_ORIGIN], this.offsetWidth, this.offsetHeight, this.root);\n }\n if(rebuild) {\n if(sx1 === undefined) {\n sx1 = this.__sx1;\n sy1 = this.__sy1;\n }\n let po = computedStyle[PERSPECTIVE_ORIGIN].slice(0);\n po[0] += sx1 || 0;\n po[1] += sy1 || 0;\n __config[NODE_PERSPECTIVE_MATRIX] = tf.calPerspectiveMatrix(computedStyle[PERSPECTIVE], po);\n }\n }\n\n __calFilter(currentStyle, computedStyle) {\n return computedStyle[FILTER] = (currentStyle[FILTER] || []).map(item => {\n let [k, v] = item;\n // 部分%单位的滤镜强制使用数字\n if(v[1] === PX || v[1] === DEG || v[1] === PERCENT || v[1] === NUMBER) {\n v = v[0];\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n return [k, v];\n });\n }\n\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n if(renderMode === CANVAS || renderMode === WEBGL) {\n if(lv < REPAINT) {\n return this.__hasContent;\n }\n let visibility = currentStyle[VISIBILITY];\n if(visibility !== 'hidden') {\n let bgI = currentStyle[BACKGROUND_IMAGE];\n if(Array.isArray(bgI)) {\n for(let i = 0, len = bgI.length; i < len; i++) {\n if(bgI[i]) {\n return true;\n }\n }\n }\n if(currentStyle[BACKGROUND_COLOR][0][3] > 0) {\n let width = computedStyle[WIDTH], height = computedStyle[HEIGHT],\n paddingTop = computedStyle[PADDING_TOP], paddingRight = computedStyle[PADDING_RIGHT],\n paddingBottom = computedStyle[PADDING_BOTTOM], paddingLeft = computedStyle[PADDING_LEFT];\n if(width && height || paddingTop || paddingRight || paddingBottom || paddingLeft) {\n return true;\n }\n }\n for(let list = ['Top', 'Right', 'Bottom', 'Left'], i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n if(computedStyle[STYLE_KEY[style2Upper('border' + k + 'Width')]] > 0\n && currentStyle[STYLE_KEY[style2Upper('border' + k + 'Color')]][0][3] > 0) {\n return true;\n }\n }\n let bs = currentStyle[BOX_SHADOW];\n if(Array.isArray(bs)) {\n for(let i = 0, len = bs.length; i < len; i++) {\n let item = bs[i];\n if(item && (item[2] > 0 || item[3] > 0)) {\n return true;\n }\n }\n }\n }\n }\n return false;\n }\n\n /**\n * 渲染基础方法,Dom/Geom公用\n * @param renderMode\n * @param lv\n * @param ctx canvas/svg/webgl共用\n * @param cache 是否是局部根节点缓存模式下的绘制\n * @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 this.__bbox = null;\n if(isDestroyed) {\n return { isDestroyed, break: true };\n }\n let virtualDom;\n // svg设置vd上的lv属性标明lineHeight的话,另外特殊字体如arial拥有lineGap也会产生间隙,背景色不绘制这个间隙\n * x轴根据contentBox的范围坐标,y则固定和font/lineHeight相关\n * 圆角发生在首尾lineBox处,中间不会有,bgi则产生类似bgc作为mask的效果\n * 另外要注意多个时的顺序,必须依次渲染,后面的bb可能会覆盖前面行的\n */\n if(isRealInline) {\n let contentBoxList = this.contentBoxList;\n let length = contentBoxList.length;\n let hasBgi = backgroundImage.some(item => item);\n if(length) {\n let {\n [FONT_SIZE]: fontSize,\n [FONT_FAMILY]: fontFamily,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let iw = 0, ih = 0;\n let offscreen, svgBgSymbol = [];\n // bgi视作inline排满一行绘制,然后按分行拆开给每行\n if(hasBgi) {\n iw = inline.getInlineWidth(this, contentBoxList);\n ih = lineHeight;\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n iw += paddingLeft + paddingRight;\n ih += paddingTop + paddingBottom;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n iw += paddingLeft + paddingRight + borderLeftWidth + borderRightWidth;\n ih += paddingTop + paddingBottom + borderTopWidth + borderBottomWidth;\n }\n if(renderMode === CANVAS || renderMode === WEBGL) {\n offscreen = inject.getCacheCanvas(iw, ih, '__$$INLINE_BGI$$__');\n }\n let length = backgroundImage.length;\n backgroundImage.slice(0).reverse().forEach((bgi, i) => {\n if(!bgi) {\n return;\n }\n i = length - 1 - i;\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i];\n if(loadBgi.url === backgroundImage[i]) {\n let uuid = bg.renderImage(this, renderMode, offscreen && offscreen.ctx || ctx, loadBgi,\n 0, 0, iw, ih, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, true, 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.delRefreshTask(this.__loadBgi.cb);\n root.delRefreshTask(this.__task);\n this.__task = null;\n this.__root = null;\n this.clearCache();\n }\n\n // 先查找到注册了事件的节点,再捕获冒泡判断增加性能\n __emitEvent(e, force) {\n let { isDestroyed, computedStyle, isMask } = this;\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || e.__stopPropagation || isMask) {\n return;\n }\n let { event: { type } } = e;\n let { listener, __hasMask } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // touchmove之类强制的直接由Root通知即可\n if(force) {\n if(computedStyle[POINTER_EVENTS] !== 'none' && util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n // 非force的判断事件坐标是否在节点内\n if(this.willResponseEvent(e)) {\n // 如果有mask,点在mask上才行,点在clip外才行\n if(__hasMask) {\n let next = this.next;\n let isClip = next.isClip;\n let hasEmitMask;\n while(next && next.isMask) {\n if(next.willResponseEvent(e, true)) {\n hasEmitMask = true;\n break;\n }\n next = next.next;\n }\n if(!isClip && !hasEmitMask) {\n return;\n }\n }\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n\n willResponseEvent(e, ignore) {\n let { x, y } = e;\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent, computedStyle } = this;\n if(computedStyle[POINTER_EVENTS] === 'none') {\n return;\n }\n let inThis = geom.pointInQuadrilateral(\n x, y,\n __sx1, __sy1,\n __sx1 + offsetWidth, __sy1,\n __sx1 + offsetWidth, __sy1 + offsetHeight,\n __sx1, __sy1 + offsetHeight,\n matrixEvent\n );\n if(inThis) {\n if(!e.target && !ignore) {\n e.target = this;\n // 缓存target给move用\n if(e.event.type === 'touchstart') {\n this.root && (this.root.__touchstartTarget = this);\n }\n }\n return true;\n }\n }\n\n __gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi, 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(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, formatStyle);\n if(util.isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n // 传入格式化好key/value的样式\n updateFormatStyle(style, cb) {\n let node = this;\n let { root, __config } = node;\n if(root) {\n root.addRefreshTask(node.__task = {\n __before() {\n node.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(__config[NODE_IS_DESTROYED]) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n res[UPDATE_CONFIG] = __config;\n root.__addUpdate(node, __config, root, root.__config, res);\n },\n __after(diff) {\n if(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, style);\n if(util.isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n animate(list, options = {}) {\n let animation = new Animation(this, list, options);\n if(this.isDestroyed) {\n animation.__destroy(true);\n return animation;\n }\n this.animationList.push(animation);\n if(options.autoPlay === false) {\n return animation;\n }\n return animation.play();\n }\n\n removeAnimate(o) {\n if(o instanceof Animation) {\n let i = this.animationList.indexOf(o);\n if(i > -1) {\n o.cancel();\n o.__destroy();\n this.animationList.splice(i, 1);\n }\n }\n }\n\n clearAnimate() {\n this.animationList.splice(0).forEach(o => {\n o.cancel();\n o.__destroy();\n });\n }\n\n frameAnimate(cb) {\n if(util.isFunction(cb)) {\n let list = this.__frameAnimateList;\n // 防止重复\n for(let i = 0, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n return cb;\n }\n }\n let enter = {\n __after(diff) {\n cb(diff);\n },\n __karasFramecb: cb,\n };\n list.push(enter);\n frame.onFrame(enter);\n return cb;\n }\n }\n\n removeFrameAnimate(cb) {\n for(let i = 0, list = this.__frameAnimateList, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n list.splice(i, 1);\n frame.offFrame(cb);\n return;\n }\n }\n }\n\n clearFrameAnimate() {\n this.__frameAnimateList.splice(0).forEach(o => {\n frame.offFrame(o);\n });\n }\n\n __computeMeasure(renderMode, ctx, cb) {\n css.computeMeasure(this);\n if(util.isFunction(cb)) {\n cb(this);\n }\n }\n\n __deepScan(cb, options) {\n return cb(this, options);\n }\n\n // isLayout为false时,为relative/margin/flex/vertical等\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.__layoutData.x += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sx1 += diff;\n this.__sx2 += diff;\n this.__sx3 += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.__layoutData.y += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sy1 += diff;\n this.__sy2 += diff;\n this.__sy3 += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n }\n\n __resizeX(diff, lv) {\n this.computedStyle.width = this.__width += diff;\n this.__clientWidth += diff;\n this.__offsetWidth += diff;\n this.__outerWidth += diff;\n this.__layoutData.w += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __resizeY(diff, lv) {\n this.computedStyle.height = this.__height += diff;\n this.__clientHeight += diff;\n this.__offsetHeight += diff;\n this.__outerHeight += diff;\n this.__layoutData.h += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __spreadBbox(boxShadow) {\n let ox = 0, oy = 0;\n if(Array.isArray(boxShadow)) {\n boxShadow.forEach(item => {\n let [x, y, sigma, spread, , inset] = item;\n if(inset !== 'inset') {\n let d = blur.outerSize(sigma);\n d += spread;\n ox = Math.max(ox, x + d);\n oy = Math.max(oy, y + d);\n }\n });\n }\n return [ox, oy];\n }\n\n __releaseWhenEmpty(__cache) {\n if(__cache && __cache.available) {\n __cache.release();\n }\n return true;\n }\n\n getComputedStyle(key) {\n let computedStyle = this.computedStyle;\n let res = {};\n let keys;\n if(key) {\n if(Array.isArray(key)) {\n keys = key;\n }\n else {\n keys = [key];\n }\n keys = keys.map(s => {\n return STYLE_KEY[style2Upper(s)];\n });\n }\n else {\n keys = Object.keys(computedStyle);\n }\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n res[k] = computedStyle[k];\n }\n else {\n res[STYLE_RV_KEY[k]] = computedStyle[k];\n }\n });\n return res;\n }\n\n getBoundingClientRect() {\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent } = this;\n let p1 = point2d(mx.calPoint([__sx1, __sy1], matrixEvent));\n let p2 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1], matrixEvent));\n let p3 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1 + offsetHeight], matrixEvent));\n let p4 = point2d(mx.calPoint([__sx1, __sy1 + offsetHeight], matrixEvent));\n return {\n left: Math.min(p1[0], Math.min(p2[0], Math.min(p3[0], p4[0]))),\n top: Math.min(p1[1], Math.min(p2[1], Math.min(p3[1], p4[1]))),\n right: Math.max(p1[0], Math.max(p2[0], Math.max(p3[0], p4[0]))),\n bottom: Math.max(p1[1], Math.max(p2[1], Math.max(p3[1], p4[1]))),\n points: [p1, p2, p3, p4],\n };\n }\n\n // img和geom返回false,在inline布局时判断是否是真的inline\n __isRealInline() {\n return true;\n }\n\n remove(cb) {\n let self = this;\n if(self.isDestroyed) {\n inject.warn('Remove target is destroyed.');\n if(util.isFunction(cb)) {\n cb();\n }\n return;\n }\n let { root, domParent } = self;\n let target = self.isShadowRoot ? self.hostRoot : self;\n // 特殊情况连续append/remove时候,还未被添加进来找不到所以无需删除\n if(domParent.children.indexOf(target) === -1) {\n if(util.isFunction(cb)) {\n cb();\n }\n return;\n }\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n let pJson = domParent.__json;\n let i = pJson.children.indexOf(self.isShadowRoot ? self.hostRoot.__json : self.__json);\n let zChildren = domParent.zIndexChildren;\n let j = zChildren.indexOf(self.isShadowRoot ? self.hostRoot : self);\n if(i === -1 || j === -1) {\n throw new Error('Remove index Exception.')\n }\n pJson.children.splice(i, 1);\n domParent.children.splice(i, 1);\n zChildren.splice(j, 1);\n if(self.__prev) {\n self.__prev.__next = self.__next;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_REMOVE_DOM] = true;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after(diff) {\n self.isShadowRoot ? self.hostRoot.__destroy() : self.__destroy();\n if(util.isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get sx() {\n return this.__sx;\n }\n\n get sy() {\n return this.__sy;\n }\n\n get clientWidth() {\n return this.__clientWidth || 0;\n }\n\n get clientHeight() {\n return this.__clientHeight || 0;\n }\n\n get offsetWidth() {\n return this.__offsetWidth || 0;\n }\n\n get offsetHeight() {\n return this.__offsetHeight || 0;\n }\n\n get outerWidth() {\n return this.__outerWidth || 0;\n }\n\n get outerHeight() {\n return this.__outerHeight || 0;\n }\n\n // 不考虑margin的范围,>=REPAINT渲染或个别有影响的渲染改变(如blur)清空缓存\n get bbox() {\n if(!this.__bbox) {\n let {\n __sx1, __sy1, clientWidth, clientHeight,\n currentStyle: {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BOX_SHADOW]: boxShadow,\n },\n } = this;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n clientWidth += borderLeftWidth[0] + borderRightWidth[0];\n clientHeight += borderTopWidth[0] + borderBottomWidth[0];\n let half = 1;\n this.__bbox = [__sx1 - ox - half, __sy1 - oy - half, __sx1 + clientWidth + ox + half, __sy1 + clientHeight + oy + half];\n }\n return this.__bbox;\n }\n\n get listener() {\n return this.__listener;\n }\n\n get matrix() {\n return this.__config[NODE_MATRIX];\n }\n\n get matrixEvent() {\n return this.__config[NODE_MATRIX_EVENT];\n }\n\n get perspectiveMatrix() {\n return this.__config[NODE_PERSPECTIVE_MATRIX];\n }\n\n get style() {\n return this.__style;\n }\n\n get computedStyle() {\n return this.__computedStyle;\n }\n\n get animationList() {\n return this.__animationList;\n }\n\n get currentStyle() {\n return this.__currentStyle;\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get contentBoxList() {\n return this.__contentBoxList;\n }\n\n get baseLine() {\n return this.offsetHeight;\n }\n\n get firstBaseLine() {\n return this.offsetHeight;\n }\n\n get isMask() {\n return this.__isMask;\n }\n\n get isClip() {\n return this.__isClip;\n }\n\n 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 n = this.baseLine;\n // 只有1个也需要对齐,因为可能内嵌了空inline使得baseLine发生变化\n if(this.list.length) {\n this.list.forEach(item => {\n let m = item.baseLine;\n if(m !== n) {\n item.__offsetY(n - m);\n }\n });\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n /**\n * 防止非行首空inline,每当遇到inline就设置当前lineBox的lineHeight/baseLine,这样有最小值兜底\n * @param l\n * @param b\n * @private\n */\n __setLB(l, b) {\n this.__lineHeight = Math.max(l, this.__lineHeight);\n this.__baseLine = Math.max(b, this.__baseLine);\n }\n\n get list() {\n return this.__list;\n }\n\n get size() {\n return this.__list.length;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endY() {\n return this.y + this.height;\n }\n\n get width() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let first = list[0];\n let last = list[length - 1];\n let x1 = first.x;\n let dom = first instanceof TextBox ? first.parent.domParent : first.domParent;\n // 因为inline可以嵌套inline,所以一直向上查找到非inline为止,每层inline如果是首个则减去左侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [PADDING_LEFT]: paddingLeft,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[0]) {\n x1 -= marginLeft + borderLeftWidth + paddingLeft;\n }\n dom = dom.domParent;\n }\n let x2 = last.x + last.outerWidth;\n dom = last instanceof TextBox ? last.parent.domParent : last.domParent;\n // 同向上查非inline,每层inline如果是最后一个则加上右侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_RIGHT]: paddingRight,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[list.length - 1]) {\n x2 += marginRight + borderRightWidth + paddingRight;\n }\n dom = dom.domParent;\n }\n return x2 - x1;\n }\n return 0;\n }\n\n get height() {\n return this.lineHeight;\n }\n\n get baseLine() {\n let baseLine = 0;\n this.list.forEach(item => {\n baseLine = Math.max(baseLine, item.baseLine);\n });\n return Math.max(this.__baseLine, baseLine);\n }\n\n get lineHeight() {\n let lineHeight = 0;\n // 只有TextBox和InlineBlock\n this.list.forEach(item => {\n lineHeight = Math.max(lineHeight, item.outerHeight);\n });\n return Math.max(this.__lineHeight, lineHeight);\n }\n}\n\nexport default LineBox;\n","import LineBox from './LineBox';\n\n/**\n * 维护一个上下文的LineBox,向LineBox中添加Item以及新增下一行的LineBox,多个LineBox组成一个区域\n * 一个block/inlineBlock拥有一个本类对象,上下文即对应这个dom流,而inline则复用最近非inline父元素的\n * 同时LineBox可能连续也可能不连续,不连续的是中间有block之类的隔离开来\n */\nclass LineBoxManager {\n constructor(x, y, lineHeight, baseLine) {\n this.__x = this.__lastX = x; // last存储目前最后一行LineBox的结尾位置,供后续inline使用\n this.__y = this.__lastY = y;\n this.__maxX = x;\n this.__domList = [];\n this.__domStack = [];\n this.__list = []; // 包含若干LineBox\n this.__isNewLine = true; // 区域内是否是新行,容器dom(block)开头肯定是\n this.__lineHeight = lineHeight;\n this.__baseLine = baseLine;\n this.__isEnd = true; // 在dom中是否一个区域处在结尾,外部控制\n }\n\n /**\n * 每次换行时重新生成LineBox存入列表,同时由于flow流当前一定是流(dom)的结尾,设置isEnd\n * @returns {LineBox}\n */\n genLineBox(x, y) {\n let lineBox = new LineBox(x, y, this.__lineHeight, this.__baseLine);\n this.list.push(lineBox);\n this.__isEnd = true;\n return lineBox;\n }\n\n /**\n * inline的特殊调用,防止空内容但有mbp的inline不占位,放入一个有lineHeight的空lineBox\n * 只有新行开头时需要,后面的无论是否有内容都会影响lineHeight\n * @param x\n * @param y\n * @param l\n * @param b\n * @returns {LineBox}\n */\n genLineBoxByInlineIfNewLine(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseLine = Math.max(this.__baseLine, b);\n if(this.__isNewLine) {\n let lineBox = new LineBox(x, y, lineHeight, baseLine);\n this.list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n }\n\n setLbOrGenLineBoxByInline(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseLine = Math.max(this.__baseLine, b);\n let lineBox;\n let list = this.list;\n if(this.__isNewLine) {\n lineBox = new LineBox(x, y, lineHeight, baseLine);\n list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n else {\n let length = list.length;\n lineBox = list[length - 1];\n lineBox.__setLB(l, b);\n }\n }\n\n /**\n * 外部设置为结尾,如一个LineBox后出现一个block,此时会被隔断,不再作为流的末尾\n */\n setNotEnd() {\n this.__isEnd = false;\n }\n\n /**\n * 外部设置新行,下次新生成LineBox\n */\n setNewLine() {\n this.__isNewLine = true;\n }\n\n /**\n * 当前LineBox放入一个新项,当新行时(如第一行)产生一个新的LineBox并存入列表\n * 是否新区域和新行都是可以被外部控制,默认第一行是新\n * 当被隔断后会被外部重置新行,这样会生成新的来作为新加项的LineBox\n * 当换行时外部也会调用新行,这样再次添加Item时会自动生成新的LineBox而不是用之前的\n * @param o TextBox/Inline/InlineBlock\n * @param nextNewLine 是否设置newLine,标明下次添加新生成LineBox\n * @returns {LineBox}\n */\n addItem(o, nextNewLine) {\n let lineBox;\n if(this.__isNewLine) {\n this.__isNewLine = false;\n lineBox = this.genLineBox(o.x, o.y);\n }\n else {\n let list = this.list;\n let length = list.length;\n lineBox = list[length - 1];\n }\n // inline递归过程中所有inline父子顺序列表,每个dom都需要对当前内容保存\n this.__domStack.forEach(item => {\n item.__contentBoxList.push(o);\n });\n lineBox.add(o);\n // 设置结束x的位置给next的inline标记用,o可能是TextBox或inlineBlock,当next新行时注意位置\n if(nextNewLine) {\n this.__isNewLine = true;\n this.__lastX = o.x;\n this.__lastY = o.y + o.outerHeight;\n }\n else {\n this.__lastX = o.x + o.outerWidth;\n this.__lastY = o.y;\n }\n this.__maxX = Math.max(this.__maxX, o.x + o.outerWidth);\n return lineBox;\n }\n\n horizonAlign(w, textAlign) {\n this.list.forEach(lineBox => {\n let diff = w - lineBox.width;\n if(diff > 0) {\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n lineBox.__offsetX(diff);\n lineBox.list.forEach(item => {\n item.__offsetX(diff, true);\n });\n }\n });\n }\n\n verticalAlign() {\n this.list.forEach(lineBox => {\n lineBox.verticalAlign();\n });\n }\n\n addX(n) {\n this.__lastX += n;\n }\n\n /**\n * inline递归过程中布局调用,不断出入栈dom对象,获取当前行状态下有哪些dom还在\n * @param dom\n */\n pushContentBoxList(dom) {\n this.__domList.push(dom);\n this.__domStack.push(dom);\n }\n\n popContentBoxList() {\n this.__domStack.pop();\n }\n\n __offsetX(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetX(diff);\n });\n }\n\n __offsetY(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetY(diff);\n });\n }\n\n /**\n * inline的特殊调用,非行首无论是否有内容都设置lineBox的lineHeight\n * @param l\n * @param b\n * @private\n */\n setLbByInlineIfNotNewLine(l, b) {\n let length = this.list.length;\n if(length && !this.isNewLine) {\n this.list[length - 1].__setLB(l, b);\n }\n }\n\n get size() {\n return this.list.length;\n }\n\n get lastX() {\n return this.__lastX;\n }\n\n get lastY() {\n return this.__lastY;\n }\n\n get endY() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[length - 1].endY;\n }\n return this.__y;\n }\n\n get isEnd() {\n return this.__isEnd;\n }\n\n get isNewLine() {\n return this.__isNewLine;\n }\n\n get breakLine() {\n return this.list.length > 1;\n }\n\n get domList() {\n return this.__domList;\n }\n\n get baseLine() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let n = 0;\n for(let i = 0; i < length - 1; i++) {\n n += list[i].height;\n }\n return n + list[length - 1].baseLine;\n }\n return 0;\n }\n\n get firstBaseLine() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[0].baseLine;\n }\n return 0;\n }\n\n get lineHeight() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1].lineHeight;\n }\n return 0;\n }\n\n get lineBox() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1];\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get width() {\n let w = 0;\n this.list.forEach(item => {\n w = Math.max(w, item.width);\n });\n return w;\n }\n}\n\nexport default LineBoxManager;\n","const TAG_NAME = {\n 'div': true,\n 'p': true,\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst INLINE = {\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst BOLD = {\n 'b': true,\n 'strong': true,\n}\n\nexport default {\n TAG_NAME,\n INLINE,\n BOLD,\n};\n","import enums from '../util/enums';\nimport unit from '../style/unit';\nimport level from './level';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n TOP,\n BOTTOM,\n POSITION,\n HEIGHT,\n },\n} = enums;\nconst { AUTO, PX, PERCENT } = unit;\nconst { REFLOW } = level;\n\nfunction offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) {\n if(dy) {\n let last;\n do {\n // component的sr没有next兄弟,视为component的next\n while(node.isShadowRoot) {\n node = node.host;\n }\n last = node;\n let isContainer, parent = node.domParent;\n if(parent) {\n let cs = parent.computedStyle;\n let ps = cs[POSITION];\n isContainer = parent === root || parent.isShadowRoot || ps === 'relative' || ps === 'absolute';\n }\n // 先偏移next,忽略有定位的absolute,本身非container也忽略\n let next = node.next;\n let container;\n while(next) {\n if(next.currentStyle[DISPLAY] !== 'none') {\n if(next.currentStyle[POSITION] === 'absolute') {\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = next.currentStyle;\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO || bottom[1] === PX) {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n }\n else if(top[1] === PERCENT) {\n let v = top[0] * 0.01 * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, null, next);\n }\n else {\n if(!container) {\n container = parent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, next]);\n }\n }\n }\n else {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n }\n next = next.next;\n }\n // root本身没domParent\n if(!parent) {\n break;\n }\n node = parent;\n // parent判断是否要resize\n let { currentStyle } = node;\n let isAbs = currentStyle[POSITION] === 'absolute';\n let need;\n if(isAbs) {\n if(currentStyle[HEIGHT][1] === AUTO\n && (currentStyle[TOP][1] === AUTO || currentStyle[BOTTOM][1] === AUTO)) {\n need = true;\n }\n }\n // height不定则需要\n else if(currentStyle[HEIGHT][1] === AUTO) {\n need = true;\n }\n if(need) {\n node.__resizeY(dy, REFLOW);\n node.clearCache();\n }\n // abs或者高度不需要继续向上调整提前跳出\n else {\n break;\n }\n if(node === root) {\n break;\n }\n }\n while(true);\n // 最后一个递归向上取消总缓存,防止过程中重复next多次无用递归\n while(last) {\n last.clearCache(true);\n last = last.domParent;\n }\n }\n}\n\nfunction clearUniqueReflowId(hash) {\n for(let i in hash) {\n if(hash.hasOwnProperty(i)) {\n let { node } = hash[i];\n delete node.__uniqueReflowId;\n }\n }\n}\n\nfunction getMergeMarginTB(topList, bottomList) {\n let total = 0;\n let max = topList[0];\n let min = topList[0];\n topList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n bottomList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n // 正数取最大,负数取最小,正负则相加\n let diff = 0;\n if(max > 0 && min > 0) {\n diff = Math.max(max, min) - total;\n }\n else if(max < 0 && min < 0) {\n diff = Math.min(max, min) - total;\n }\n else if(max !== 0 || min !== 0) {\n diff = max + min - total;\n }\n return diff;\n}\n\nexport default {\n offsetAndResizeByNodeOnY,\n clearUniqueReflowId,\n getMergeMarginTB,\n};\n","import Xom from './Xom';\nimport Text from './Text';\nimport mode from './mode';\nimport LineBoxManager from './LineBoxManager';\nimport Component from './Component';\nimport tag from './tag';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport $$type from '../util/$$type';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport reflow from '../refresh/reflow';\nimport builder from '../util/builder';\nimport level from '../refresh/level';\n\nconst {\n STYLE_KEY: {\n POSITION,\n DISPLAY,\n FONT_WEIGHT,\n MARGIN_LEFT,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n PADDING_LEFT,\n PADDING_BOTTOM,\n PADDING_RIGHT,\n PADDING_TOP,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n TOP,\n RIGHT,\n BOTTOM,\n LEFT,\n WIDTH,\n HEIGHT,\n TEXT_ALIGN,\n FLEX_DIRECTION,\n FLEX_BASIS,\n FLEX_SHRINK,\n FLEX_GROW,\n ALIGN_SELF,\n ALIGN_ITEMS,\n JUSTIFY_CONTENT,\n Z_INDEX,\n WHITE_SPACE,\n LINE_HEIGHT,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n OVERFLOW,\n FONT_SIZE,\n // PERSPECTIVE,\n // TRANSFORM,\n },\n NODE_KEY: {\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_STRUCT,\n NODE_DOM_PARENT,\n NODE_IS_INLINE,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_ADD_DOM,\n UPDATE_CONFIG,\n UPDATE_MEASURE,\n },\n STRUCT_KEY: {\n STRUCT_NUM,\n STRUCT_LV,\n STRUCT_TOTAL,\n STRUCT_CHILD_INDEX,\n STRUCT_INDEX,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH } = unit;\nconst { calAbsolute, isRelativeOrAbsolute } = css;\n\nfunction genZIndexChildren(dom) {\n let normal = [];\n let hasMc;\n let mcHash = {};\n let lastMaskIndex;\n let children = dom.children;\n children.forEach((item, i) => {\n let child = item;\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n // 遮罩单独保存后特殊排序\n if(item instanceof Xom && item.isMask) {\n // 开头的mc忽略,后续的连续mc以第一次出现为准\n if(lastMaskIndex !== undefined) {\n mcHash[lastMaskIndex].push(item);\n }\n else if(i) {\n lastMaskIndex = i - 1;\n children[lastMaskIndex].__iIndex = lastMaskIndex;\n mcHash[lastMaskIndex] = [item];\n hasMc = true;\n }\n }\n else {\n lastMaskIndex = undefined;\n if(item instanceof Xom) {\n child.__zIndex = item.currentStyle[Z_INDEX];\n if(isRelativeOrAbsolute(item)) {\n // 临时变量为排序使用\n child.__aIndex = true;\n normal.push(child);\n }\n else {\n normal.push(child);\n }\n }\n else {\n child.__zIndex = 0;\n normal.push(child);\n }\n child.__iIndex = i;\n }\n });\n normal.sort(function(a, b) {\n if(a.__zIndex !== b.__zIndex) {\n return a.__zIndex - b.__zIndex;\n }\n // zIndex相等时abs优先flow\n if(a.__aIndex !== b.__aIndex) {\n if(a.__aIndex) {\n return 1;\n }\n return -1;\n }\n // 都相等看索引\n return a.__iIndex - b.__iIndex;\n });\n // 将遮罩插入到对应顺序上\n if(hasMc) {\n for(let i = normal.length - 1; i >= 0; i--) {\n let idx = normal[i].__iIndex;\n if(mcHash.hasOwnProperty(idx)) {\n normal.splice(i + 1, 0, ...mcHash[idx]);\n }\n }\n }\n return normal;\n}\n\n// flex布局阶段顺序,不是渲染也和struct结构无关,可以无视mask\nfunction genOrderChildren(flowChildren) {\n let normal = [];\n flowChildren.forEach((item, i) => {\n let child = item;\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Xom) {\n child.__order = item.currentStyle[ORDER];\n }\n else {\n child.__order = 0;\n }\n normal.push(child);\n child.__iIndex = i;\n });\n normal.sort(function(a, b) {\n if(a.__order !== b.__order) {\n return a.__order - b.__order;\n }\n // order相等时看节点索引\n return a.__iIndex - b.__iIndex;\n });\n return normal;\n}\n\nclass Dom extends Xom {\n constructor(tagName, props, children) {\n super(tagName, props);\n let { style } = this;\n if(!style.display || !{\n flex: true,\n block: true,\n inline: true,\n inlineBlock: true,\n 'inline-block': true,\n none: true,\n }.hasOwnProperty(style.display)) {\n if(tag.INLINE.hasOwnProperty(this.tagName)) {\n style.display = 'inline';\n }\n else {\n style.display = 'block';\n }\n }\n if(!style[FONT_WEIGHT] && tag.BOLD.hasOwnProperty(tagName)) {\n style.fontWeight = 700;\n }\n this.__style = css.normalize(style, reset.DOM_ENTRY_SET);\n // currentStyle/currentProps不深度clone,继承一层即可,动画时也是extend这样只改一层引用不动原始静态style\n this.__currentStyle = util.extend({}, this.__style);\n this.__children = children || [];\n this.__flexLine = []; // flex布局多行模式时存储行\n let config = this.__config;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_STYLE] = this.__style;\n }\n\n __structure(i, lv, j) {\n let res = super.__structure(i++, lv, j);\n let arr = [res];\n let zIndexChildren = this.__zIndexChildren = this.__zIndexChildren || genZIndexChildren(this);\n zIndexChildren.forEach((child, j) => {\n let temp = child.__structure(i, lv + 1, j);\n if(Array.isArray(temp)) {\n i += temp.length;\n arr = arr.concat(temp);\n }\n else {\n i++;\n arr.push(temp);\n }\n });\n let total = arr.length - 1;\n res[STRUCT_NUM] = zIndexChildren.length;\n res[STRUCT_TOTAL] = total;\n return arr;\n }\n\n __modifyStruct(root, offset = 0) {\n let __config = this.__config;\n let struct = __config[NODE_STRUCT];\n let total = struct[STRUCT_TOTAL] || 0;\n // 新生成了struct,引用也变了\n let nss = this.__structure(struct[STRUCT_INDEX], struct[STRUCT_LV], struct[STRUCT_CHILD_INDEX]);\n root.__structs.splice(struct[STRUCT_INDEX] + offset, total + 1, ...nss);\n let d = 0;\n if(this !== root) {\n struct = __config[NODE_STRUCT];\n d = (struct[STRUCT_TOTAL] || 0) - total;\n let ps = __config[NODE_DOM_PARENT].__config[NODE_STRUCT];\n ps[STRUCT_TOTAL] = ps[STRUCT_TOTAL] || 0;\n ps[STRUCT_TOTAL] += d;\n }\n return [struct, d];\n }\n\n /**\n * 因为zIndex/abs的变化造成的更新,只需重排这一段顺序即可\n * 即便包含component造成的dom变化也不影响,component作为子节点reflow会再执行,这里重排老的vd\n * @param structs\n * @private\n */\n __updateStruct(structs) {\n let { [STRUCT_INDEX]: index, [STRUCT_TOTAL]: total = 0 } = this.__config[NODE_STRUCT];\n let zIndexChildren = this.__zIndexChildren = genZIndexChildren(this);\n let length = zIndexChildren.length;\n if(length === 1) {\n return;\n }\n zIndexChildren.forEach((child, i) => {\n child.__config[NODE_STRUCT][STRUCT_CHILD_INDEX] = i;\n });\n // 按直接子节点划分为相同数量的若干段进行排序\n let arr = [];\n let source = [];\n for(let i = index + 1; i <= index + total; i++) {\n let child = structs[i];\n let o = {\n child,\n list: structs.slice(child[STRUCT_INDEX], child[STRUCT_INDEX] + child[STRUCT_TOTAL] + 1),\n };\n arr.push(o);\n source.push(o);\n i += child[STRUCT_TOTAL] || 0;\n }\n arr.sort(function(a, b) {\n return a.child[STRUCT_CHILD_INDEX] - b.child[STRUCT_CHILD_INDEX];\n });\n // 是否有变更,有才进行重新计算\n let needSort;\n for(let i = 0, len = source.length; i < len; i++) {\n if(source[i] !== arr[i]) {\n needSort = true;\n break;\n }\n }\n if(needSort) {\n let list = [];\n arr.forEach(item => {\n list = list.concat(item.list);\n });\n list.forEach((struct, i) => {\n struct[STRUCT_INDEX] = index + i + 1;\n })\n structs.splice(index + 1, total, ...list);\n }\n }\n\n /**\n * 给定父宽度情况下,尝试行内放下后的剩余宽度,为负数即放不下,这里只会出现行内级即inline(Block)\n * 调用前提是非行开头的inline尝试计算是否放得下,开头无需且禁止判断,防止出现永远放不下一个字符卡死\n * 返回非负数就是放得下,这样一些尺寸为0的也算\n * @param w 剩余宽度\n * @param total 容器尺寸\n * @returns {number|*}\n * @private\n */\n __tryLayInline(w, total) {\n let { flowChildren, currentStyle: {\n [DISPLAY]: display,\n [WIDTH]: width,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n // inline没w/h,并且尝试孩子第一个能放下即可,如果是文字就是第一个字符\n if(display === 'inline') {\n if(flowChildren.length) {\n let first = flowChildren[0];\n if(first instanceof Component) {\n first = first.shadowRoot;\n }\n if(first instanceof Xom) {\n w = first.__tryLayInline(w, total);\n }\n else {\n w -= first.firstCharWidth;\n }\n }\n }\n // inlineBlock尝试所有孩子在一行上\n else {\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n else {\n for(let i = 0; i < flowChildren.length; i++) {\n // 当放不下时直接返回,无需继续多余的尝试计算\n if(w < 0) {\n return w;\n }\n let item = flowChildren[i];\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Xom) {\n w = item.__tryLayInline(w, total);\n }\n // text强制一行,否则非头就是放不下,需从头开始\n else {\n w -= item.textWidth;\n }\n }\n }\n // ib要减去末尾mpb\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n }\n // 还要减去开头的mpb\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n return w;\n }\n\n // 设置y偏移值,递归包括children,此举在justify-content/margin-auto等对齐用\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n // 记得偏移LineBox\n if(isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) {\n this.lineBoxManager.__offsetX(diff);\n }\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetX(diff, isLayout, lv);\n }\n });\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n if(isLayout && !this.__config[NODE_IS_INLINE] && this.lineBoxManager) {\n this.lineBoxManager.__offsetY(diff);\n }\n this.flowChildren.forEach(item => {\n if(item) {\n item.__offsetY(diff, isLayout, lv);\n }\n });\n }\n\n // item的递归子节点求min/max,只考虑固定值单位,忽略百分比,同时按方向和display\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this, this.isShadowRoot);\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h, lineBoxManager } = data;\n // 计算需考虑style的属性\n let {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n else {\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n }\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n else if(display === 'block') {\n let countMin = 0, countMax = 0;\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n countMin = countMax = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n }\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n else {\n if(display === 'inlineBlock' || display === 'inline-block') {\n lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n }\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n if(isDirectionRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else if(isDirectionRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n });\n }\n }\n return [display, this.__addMp(isDirectionRow, w, currentStyle, [min, max])];\n }\n\n /**\n * flex布局时,计算basis尺寸,如果有固定声明则以其为标准,content为内容最大尺寸,auto依赖w/h或降级content\n * basis要考虑相加直接item的mpb,非绝对值单位以container为基准,basis为内容时为max值\n * item的孩子为孙子节点需递归,不参与basis计算,只参与min/max,尺寸和mpb均只考虑绝对值\n * 自动计算时影响尺寸的只有换行的text,以及一组inline,均按其中最大尺寸的一个计算\n * auto自动计算递归进行,如果是普通row方向,按最大text的charWidth为准\n * 如果是column方向,则虚拟布局后看text的height\n * 在abs下时进入特殊状态,无论是row/column,都会按row方向尝试最大尺寸,直到舞台边缘或容器声明的w折行\n * 返回b,声明则按css值,否则是auto/content\n * 返回min为最小宽度,遇到字符/inline则单列排版后需要的最大宽度\n * 返回max为最大宽度,理想情况一排最大值,在abs时isVirtual状态参与计算,文本抵达边界才进行换行\n * @param isDirectionRow\n * @param data\n * @param isVirtual abs非固定尺寸时先进行虚拟布局标识\n * @private\n */\n __calBasis(isDirectionRow, data, isVirtual) {\n css.computeReflow(this, this.isShadowRoot);\n let b = 0;\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h } = data;\n // 计算需考虑style的属性\n let {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n [FLEX_BASIS]: flexBasis,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content\n let isAuto = flexBasis[1] === AUTO;\n let isFixed = [PX, PERCENT, REM, VW, VH].indexOf(flexBasis[1]) > -1;\n let isContent = !isAuto && !isFixed;\n let fixedSize;\n // flex的item固定basis计算\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = fixedSize = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = fixedSize = (isDirectionRow ? w : h) * flexBasis[0] * 0.01;\n }\n else if(flexBasis[1] === REM) {\n b = fixedSize = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = fixedSize = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = fixedSize = flexBasis[0] * this.root.height * 0.01;\n }\n }\n // 已声明主轴尺寸的,当basis是auto时为值\n else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1) && isAuto) {\n if(main[1] === PX) {\n b = fixedSize = main[0];\n }\n else if(main[1] === PERCENT) {\n b = fixedSize = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = fixedSize = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = fixedSize = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = fixedSize = main[0] * this.root.height * 0.01;\n }\n }\n // 非固定尺寸的basis为auto时降级为content\n else if(isAuto) {\n isContent = true;\n }\n // flex的item还是flex时\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n }\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n // flex的item是block/inline时,inline也会变成block统一对待\n else {\n let countMin = 0, countMax = 0;\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n countMin = countMax = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n }\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n if(fixedSize) {\n max = Math.max(fixedSize, max);\n }\n if(isContent) {\n b = max;\n }\n // 直接item的mpb影响basis\n return this.__addMp(isDirectionRow, w, currentStyle, [b, min, max], true);\n }\n\n __layoutNone() {\n super.__layoutNone();\n let { children } = this;\n children.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n item.__layoutNone();\n }\n });\n }\n\n /**\n * block布局,本身固定尺寸优先,否则看内容从上往下从左往右flow流排布\n * 内部inline和inlineBlock组成LineBox,通过LineBoxManager来管理混排的现象\n * LineBoxManager只有block和inlineBlock内部生成,inline会复用最近父级的\n * 内部的block在垂直方向要考虑margin合并的问题,强制所有节点为bfc,精简逻辑\n * @param data\n * @param isVirtual abs无尺寸时提前虚拟布局计算尺寸\n * @private\n */\n __layoutBlock(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n // 虚线管理一个block内部的LineBox列表,使得inline的元素可以中途衔接处理折行\n // 内部维护inline结束的各种坐标来达到目的,遇到block时中断并处理换行坐标\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n // 因精度问题,统计宽度均从0开始累加每行,最后取最大值,仅在abs布局时isVirtual生效\n let maxW = 0;\n let cw = 0;\n // 连续block(flex相同,下面都是)的上下margin合并值记录,合并时从列表中取\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isImg = item.tagName === 'img';\n // 每次循环开始前,这次不是block的话,看之前遗留待合并margin,并重置\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n if(isXom) {\n // inline和inlineBlock的细节不同之处,ib除了w/h之外,更想像block一样占据一行\n // 比如2个inline前面占一半后面比一半多但还是会从一半开始然后第2行换行继续,但ib放不下则重开一行\n // inline和ib能互相嵌套,形成的LineBox中则是TextBox和节点混合\n if(isInlineBlock || isInline) {\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || isInline && whiteSpace === 'nowrap') {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager, // ib内部新生成会内部判断,这里不管统一传入\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样\n if(item.__isIbFull) {\n x = data.x;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // abs统计宽度\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下,内部判断了inline/ib,ib要考虑是否有width\n let fw = item.__tryLayInline(w + data.x - x, w);\n // 放得下继续,奇怪的精度问题,加上阈值\n if(fw >= (-1e-10)) {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n x = data.x;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n if(isVirtual) {\n cw += item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n // block/flex先处理之前可能遗留的最后一行LineBox,然后递归时不传lineBoxManager,其内部生成新的\n else {\n // 非开头,说明之前的text未换行,需要增加行数\n if(x !== data.x && flowChildren[i - 1] instanceof Text) {\n lineClampCount++;\n }\n x = data.x;\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n let isNone = item.currentStyle[DISPLAY] === 'none';\n // 自身无内容\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n y += item.outerHeight;\n lineBoxManager.__lastY = y;\n // absolute/flex前置虚拟计算\n if(isVirtual) {\n maxW = Math.max(maxW, item.outerWidth);\n cw = 0;\n }\n // 空block要留下轮循环看,除非是最后一个,此处非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n item.__offsetY(diff, true);\n y += diff;\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n }\n }\n // 文字和inline类似\n else {\n // lineClamp作用域为block下的inline(同LineBox上下文)\n if(lineClamp && lineClampCount >= lineClamp) {\n return;\n }\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.width;\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x);\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, item.width);\n cw = 0;\n }\n }\n if(isVirtual) {\n cw += item.width;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n });\n // 结束后如果是以LineBox结尾,则需要设置y到这里,否则流布局中block会设置\n // 当以block换行时,新行是true,否则是false即结尾\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n }\n let tw = this.__width = (fixedWidth || !isVirtual) ? w : maxW;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // 非abs提前的虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐\n if(!isVirtual) {\n lineBoxManager.verticalAlign();\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // 所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n this.__marginAuto(currentStyle, data);\n }\n }\n\n // 弹性布局时的计算位置\n __layoutFlex(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle, __flexLine } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n // 每次布局情况多行内容\n __flexLine.splice(0);\n let {\n [FLEX_DIRECTION]: flexDirection,\n [JUSTIFY_CONTENT]: justifyContent,\n [ALIGN_ITEMS]: alignItems,\n [LINE_CLAMP]: lineClamp,\n [FLEX_WRAP]: flexWrap,\n [ALIGN_CONTENT]: alignContent,\n [LINE_HEIGHT]: lineHeight,\n [TEXT_ALIGN]: textAlign,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n let maxX = 0;\n let isDirectionRow = ['column', 'column-reverse', 'columnReverse'].indexOf(flexDirection) === -1;\n // 计算伸缩基数\n let growList = [];\n let shrinkList = [];\n let basisList = [];\n let maxList = [];\n let minList = [];\n let orderChildren = genOrderChildren(flowChildren);\n orderChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n // abs虚拟布局计算时纵向也是看横向宽度\n let [b, min, max] = item.__calBasis(isVirtual ? true : isDirectionRow, { x, y, w, h }, isVirtual);\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += max;\n }\n else {\n maxX = Math.max(maxX, max);\n }\n return;\n }\n let { [FLEX_GROW]: flexGrow, [FLEX_SHRINK]: flexShrink } = currentStyle;\n computedStyle[FLEX_BASIS] = b;\n growList.push(flexGrow);\n shrinkList.push(flexShrink);\n // 根据basis不同,计算方式不同\n basisList.push(b);\n maxList.push(max);\n minList.push(min);\n }\n // 文本\n else {\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += item.textWidth;\n }\n else {\n maxX = Math.max(maxX, item.textWidth);\n }\n return;\n }\n growList.push(0);\n shrinkList.push(1);\n if(isDirectionRow) {\n let cw = item.charWidth;\n let tw = item.textWidth;\n basisList.push(tw);\n maxList.push(tw);\n minList.push(cw);\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n });\n let h = item.height;\n basisList.push(h);\n minList.push(h);\n }\n }\n });\n // abs时,只需关注宽度即可,无需真正布局\n if(isVirtual) {\n let tw = this.__width = Math.min(maxX, w);\n this.__ioSize(tw, this.height);\n return;\n }\n let containerSize = isDirectionRow ? w : h;\n let isMultiLine = flexWrap === 'wrap' || ['wrap-reverse', 'wrapReverse'].indexOf(flexWrap) > -1;\n /**\n * 判断是否需要分行,根据假设主尺寸来统计尺寸和计算,假设主尺寸是clamp(min_main_size, flex_base_size, max_main_size)\n * 当多行时,由于每行一定有最小限制,所以每行一般情况都不是shrink状态,\n * 但也有极端情况,比如一行只能放下1个元素时,且此元素比容器小,会是shrink\n */\n let line = [], sum = 0, hypotheticalList = [];\n basisList.forEach((item, i) => {\n let min = minList[i], max = maxList[i];\n let hypothetical;\n if(item < min) {\n hypothetical = min;\n }\n else if(item > max) {\n hypothetical = max;\n }\n else {\n hypothetical = item;\n }\n hypotheticalList.push(hypothetical);\n if(isMultiLine) {\n // 超过尺寸时,要防止sum为0即1个也会超过尺寸\n if(sum + hypothetical > containerSize) {\n if(sum) {\n __flexLine.push(line);\n line = [orderChildren[i]];\n sum = hypothetical;\n }\n else {\n line.push(orderChildren[i]);\n __flexLine.push(line);\n line = [];\n sum = 0;\n }\n }\n else {\n line.push(orderChildren[i]);\n sum += hypothetical;\n }\n }\n else {\n line.push(orderChildren[i]);\n }\n });\n if(line.length) {\n __flexLine.push(line);\n }\n let offset = 0, clone = { x, y, w, h };\n let maxCrossList = [];\n __flexLine.forEach(item => {\n let length = item.length;\n let end = offset + length;\n let [x1, y1, maxCross] = this.__layoutFlexLine(clone, isDirectionRow, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, orderChildren.slice(offset, end), item, textAlign,\n growList.slice(offset, end), shrinkList.slice(offset, end), basisList.slice(offset, end),\n hypotheticalList.slice(offset, end), minList.slice(offset, end));\n // 下一行/列更新坐标\n if(isDirectionRow) {\n clone.y = y1;\n }\n else {\n clone.x = x1;\n }\n x = Math.max(x, x1);\n y = Math.max(y, y1);\n maxCrossList.push(maxCross);\n offset += length;\n });\n let tw = this.__width = w;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // flexDirection当有reverse时交换每line的主轴序\n if(flexDirection === 'row-reverse' || flexDirection === 'rowReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = tw - item.outerWidth - (item.x - data.x) * 2;\n if(diff) {\n item.__offsetX(diff, true);\n }\n });\n });\n }\n else if(flexDirection === 'column-reverse' || flexDirection === 'columnReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = th - item.outerHeight - (item.y - data.y) * 2;\n if(diff) {\n item.__offsetY(diff, true);\n }\n });\n });\n }\n // wrap-reverse且多轴线时交换轴线序,需要2行及以上才行\n let length = __flexLine.length;\n if(['wrapReverse', 'wrap-reverse'].indexOf(flexWrap) > -1 && length > 1) {\n let crossSum = 0, crossSumList = [];\n maxCrossList.forEach(item => {\n crossSumList.push(crossSum);\n crossSum += item;\n });\n let count = 0;\n for(let i = length - 1; i >= 0; i--) {\n let line = __flexLine[i];\n let source = crossSumList[i];\n let diff = count - source;\n if(diff) {\n line.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n count += maxCrossList[i];\n }\n __flexLine.reverse();\n }\n // 侧轴对齐分flexLine做,要考虑整体的alignContent的stretch和每行的alignItems的stretch\n // 先做整体的,得出交叉轴空白再均分给每一行做单行的,整体的只有1行忽略\n let per;\n if(!isVirtual && length > 1 && (fixedHeight && isDirectionRow || !isDirectionRow)) {\n let diff = isDirectionRow ? th - (y - data.y) : tw - (x - data.x);\n // 有空余时才进行对齐\n if(diff > 0) {\n if(alignContent === 'center') {\n let per = diff * 0.5;\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per, true);\n }\n else {\n item.__offsetX(per, true);\n }\n });\n }\n else if(alignContent === 'flex-start' || alignContent === 'flexStart') {}\n else if(alignContent === 'flex-end' || alignContent === 'flexEnd') {\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n else if(alignContent === 'space-between' || alignContent === 'spaceBetween') {\n let between = diff / (length - 1);\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(between, true);\n }\n else {\n item.__offsetX(between, true);\n }\n });\n }\n });\n }\n else if(alignContent === 'space-around' || alignContent === 'spaceAround') {\n let around = diff / (length + 1);\n __flexLine.forEach((item, i) => {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(around * (i + 1), true);\n }\n else {\n item.__offsetX(around * (i + 1), true);\n }\n });\n });\n }\n // 默认stretch\n else {\n per = diff / length;\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per * i, true);\n }\n else {\n item.__offsetX(per * i, true);\n }\n });\n }\n });\n }\n }\n }\n // 每行再进行cross对齐,在alignContent为stretch时计算每行的高度\n if(!isVirtual) {\n if(length > 1) {\n __flexLine.forEach((item, i) => {\n let maxCross = maxCrossList[i];\n if(per) {\n maxCross += per;\n }\n this.__crossAlign(item, alignItems, isDirectionRow, maxCross);\n });\n }\n else if(length) {\n let maxCross = maxCrossList[0];\n if(isDirectionRow) {\n if(fixedHeight) {\n maxCross = h;\n }\n }\n else {\n maxCross = w;\n }\n this.__crossAlign(__flexLine[0], alignItems, isDirectionRow, maxCross);\n }\n }\n this.__marginAuto(currentStyle, data);\n }\n\n /**\n * 计算获取子元素的b/min/max完毕后,尝试进行flex每行布局\n * https://www.w3.org/TR/css-flexbox-1/#layout-algorithm\n * 假想主尺寸,其为clamp(min_main_size, flex_base_size, max_main_size)\n * 随后按算法一步步来 https://zhuanlan.zhihu.com/p/354567655\n * 规范没提到mpb,item的要计算,孙子的只考虑绝对值\n * 先收集basis和假设主尺寸\n */\n __layoutFlexLine(data, isDirectionRow, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, orderChildren, flexLine, textAlign,\n growList, shrinkList, basisList, hypotheticalList, minList) {\n let { x, y, w, h } = data;\n let hypotheticalSum = 0;\n hypotheticalList.forEach(item => {\n hypotheticalSum += item;\n });\n // 根据假设尺寸确定使用grow还是shrink,冻结非弹性项并设置target尺寸,确定剩余未冻结数量\n let isOverflow = hypotheticalSum >= containerSize;\n let targetMainList = [];\n basisList.forEach((item, i) => {\n if(isOverflow) {\n if(!shrinkList[i] || (basisList[i] < hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n else {\n if(!growList[i] || (basisList[i] > hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n });\n // 初始可用空间,冻结使用确定的target尺寸,未冻结使用假想\n let free = 0;\n basisList.forEach((item, i) => {\n if(targetMainList[i] !== undefined) {\n free += targetMainList[i];\n }\n else {\n free += item;\n }\n });\n let total = Infinity;\n if(isDirectionRow) {\n total = w;\n }\n else if(fixedHeight) {\n total = h;\n }\n else {\n total = free;\n }\n free = Math.abs(total - free);\n // 循环,文档算法不够简练,其合并了grow和shrink,实际拆开写更简单\n let factorSum = 0;\n if(isOverflow) {\n // 计算真正的因子占比,同时得出缩小尺寸数值\n // 还需判断每个item收缩不能 {\n if(targetMainList[i] === undefined) {\n let n = item * basisList[i];\n factorSum += n;\n return n;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要收缩的尺寸\n let n = basisList[i] - s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n else {\n let factorList = growList.map((item, i) => {\n if(targetMainList[i] === undefined) {\n factorSum += item;\n return item;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要扩展的尺寸\n let n = basisList[i] + s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n let maxCross = 0;\n let lbmList = [];\n orderChildren.forEach((item, i) => {\n let main = targetMainList[i];\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n if(isDirectionRow) {\n item.__layout({\n x,\n y,\n w: main,\n h,\n w3: main, // w3假设固定宽度,忽略原始style中的设置\n });\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h: main,\n h3: main, // 同w2\n });\n }\n }\n else {\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n lbmList.push(lineBoxManager);\n item.__layout({\n x,\n y,\n w: isDirectionRow ? main : w,\n h: isDirectionRow ? h : main,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n });\n }\n if(isDirectionRow) {\n x += item.outerWidth;\n maxCross = Math.max(maxCross, item.outerHeight);\n }\n else {\n y += item.outerHeight;\n maxCross = Math.max(maxCross, item.outerWidth);\n }\n });\n // 计算主轴剩余时要用真实剩余空间而不能用伸缩剩余空间\n let diff = isDirectionRow ? (w - x + data.x) : (h - y + data.y);\n // 主轴对齐方式\n if(diff > 0) {\n let len = orderChildren.length;\n if(justifyContent === 'flexEnd' || justifyContent === 'flex-end') {\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(diff, true) : child.__offsetY(diff, true);\n }\n }\n else if(justifyContent === 'center') {\n let center = diff * 0.5;\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(center, true) : child.__offsetY(center, true);\n }\n }\n else if(justifyContent === 'spaceBetween' || justifyContent === 'space-between') {\n let between = diff / (len - 1);\n for(let i = 1; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(between * i, true) : child.__offsetY(between * i, true);\n }\n }\n else if(justifyContent === 'spaceAround' || justifyContent === 'space-around') {\n let around = diff / (len + 1);\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(around * (i + 1), true) : child.__offsetY(around * (i + 1), true);\n }\n }\n }\n if(isDirectionRow) {\n y += maxCross;\n }\n else {\n x += maxCross;\n }\n // flex的直接text对齐比较特殊\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lbmList.forEach(item => {\n item.horizonAlign(item.width, textAlign);\n })\n }\n return [x, y, maxCross];\n }\n\n // 每个flexLine的侧轴对齐,单行时就是一行对齐\n __crossAlign(line, alignItems, isDirectionRow, maxCross) {\n let baseLine = 0;\n line.forEach(item => {\n baseLine = Math.max(baseLine, item.firstBaseLine);\n });\n line.forEach(item => {\n let { currentStyle: { [ALIGN_SELF]: alignSelf } } = item;\n if(isDirectionRow) {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [HEIGHT]: height } } = item;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = item.__height = computedStyle[HEIGHT] = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n else if(alignSelf === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [HEIGHT]: height,\n } } = item;\n // row的孩子还是flex且column且不定高时,如果高度<侧轴拉伸高度则重新布局\n if(isDirectionRow && display === 'flex' && flexDirection === 'column' && height[1] === AUTO && item.outerHeight < maxCross) {\n item.__layout(Object.assign(item.__layoutData, { h3: maxCross }));\n }\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n }\n }\n // column\n else {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [WIDTH]: width } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [WIDTH]: width,\n } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n }\n }\n });\n }\n\n /**\n * inline比较特殊,先简单顶部对其,后续还需根据vertical和lineHeight计算y偏移\n * inlineBlock复用逻辑,可以设置w/h,在混排时表现不同,inlineBlock换行限制在规定的矩形内,\n * 且ib会在没设置width且换行的时候撑满上一行,即便内部尺寸没抵达边界\n * 而inline换行则会从父容器start处开始,且首尾可能占用矩形不同\n * 嵌套inline情况十分复杂,尾部mpb空白可能产生叠加情况,因此endSpace表示自身,\n * 然后根据是否在最后一个元素进行叠加父元素的,多层嵌套则多层尾部叠加,均以最后一个元素为依据判断\n * Text获取这个叠加的endSpace值即可,无需感知是否最后一个,外层(此处)进行逻辑封装\n * @param data\n * @param isVirtual\n * @param isInline\n * @private\n */\n __layoutInline(data, isVirtual, isInline) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h, lx,\n lineBoxManager, nowrap, endSpace, selfEndSpace } = this.__preLayout(data, isInline);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n let {\n [WIDTH]: width,\n } = currentStyle;\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n } = computedStyle;\n let lineClampCount = data.lineClampCount || 0;\n if(isInline && !this.__isRealInline()) {\n isInline = false;\n }\n // 只有inline的孩子需要考虑换行后从行首开始,而ib不需要,因此重置行首标识lx为x,末尾空白为0\n // 而inline的LineBoxManager复用最近非inline父dom的,ib需要重新生成,末尾空白叠加\n if(isInline) {\n this.__config[NODE_IS_INLINE] = true;\n this.__lineBoxManager = lineBoxManager;\n let baseLine = css.getBaseLine(computedStyle);\n // 特殊inline调用,有内容的话(如左右mbp),默认生成一个lineBox,即便是空,也要形成占位,只有开头时需要\n if(marginLeft || marginRight\n || paddingLeft || paddingRight\n || borderLeftWidth || borderRightWidth) {\n if(lineBoxManager.isNewLine) {\n lineBoxManager.genLineBoxByInlineIfNewLine(x, y, lineHeight, baseLine);\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseLine);\n }\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseLine);\n }\n lineClamp = data.lineClamp || 0;\n }\n else {\n lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n lx = x;\n endSpace = selfEndSpace = lineClampCount = 0;\n }\n // 存LineBox里的内容列表专用,布局过程中由lineBoxManager存入,递归情况每个inline节点都保存contentBox\n let contentBoxList;\n if(isInline) {\n contentBoxList = this.__contentBoxList = [];\n lineBoxManager.pushContentBoxList(this);\n }\n let isIbFull = false; // ib时不限定w情况下发生折行则撑满行,即便内容没有撑满边界\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline2 = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock2 = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isRealInline = isXom && item.__isRealInline();\n // 最后一个元素会产生最后一行,叠加父元素的尾部mpb\n let isEnd = isInline && (i === length - 1);\n if(isEnd) {\n endSpace += selfEndSpace;\n }\n if(isXom) {\n if(!isInline2 && !isInlineBlock2) {\n item.currentStyle[DISPLAY] = item.computedStyle[DISPLAY] = 'inlineBlock';\n isInlineBlock2 = true;\n inject.warn('Inline can not contain block/flex');\n }\n // x开头,不用考虑是否放得下直接放,i为0强制不换行\n if(x === lx || !i || isInline2 && whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样\n if(item.__isIbFull) {\n isInlineBlock2 && (w[1] === AUTO) && (isIbFull = true);\n lineBoxManager.addItem(item);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中,以计算宽度\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n }\n else {\n // 不换行继续排,换行非开头先尝试是否放得下,结尾要考虑mpb因此减去endSpace\n let fw = (whiteSpace === 'nowrap') ? 0 : item.__tryLayInline(w - x + lx, w - (isEnd ? endSpace : 0));\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n nowrap: whiteSpace === 'nowrap',\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n isInline2 && lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n lineBoxManager.addItem(item);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n }\n }\n }\n // inline里的其它只有文本,可能开始紧跟着之前的x,也可能换行后从lx行头开始\n // 紧跟着x可能出现在前面有节点换行后第2行,此时不一定放得下,因此不能作为判断依据,开头仅有lx\n else {\n let n = lineBoxManager.size;\n // i为0时强制不换行\n if(x === lx || !i || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行,且非定宽\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n }\n else {\n // 非开头先尝试是否放得下,如果放得下再看是否end,加end且只有1个字时放不下要换行,否则可以放,换行由text内部做\n // 第一个Text且父元素声明了nowrap也强制不换行,非第一个则看本身whiteSpace声明\n let focusNoWrap = (!i && nowrap) || whiteSpace === 'nowrap';\n let fw = focusNoWrap ? 0 : item.__tryLayInline(w + lx - x);\n if(!focusNoWrap && fw >= 0 && isEnd && endSpace && item.content.length === 1) {\n let fw2 = fw - endSpace;\n if(fw2 < 0) {\n fw = fw2;\n }\n }\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // 这里ib放得下一定是要么没换行要么固定宽度,所以无需判断isIbFull\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n }\n }\n }\n });\n // 同block结尾,不过这里一定是lineBox结束,无需判断\n y = lineBoxManager.endY;\n // 标识ib情况同block一样占满行\n this.__isIbFull = isIbFull;\n // 元素的width在固定情况或者ibFull情况已被计算出来,否则为最大延展尺寸,inline没有固定尺寸概念\n let tw, th;\n if(isInline) {\n // inline最后的x要算上右侧mpb,为next行元素提供x坐标基准,同时其尺寸计算比较特殊\n if(selfEndSpace) {\n lineBoxManager.addX(selfEndSpace);\n }\n // 如果没有内容,空白还要加上开头即左侧mpb\n if(!flowChildren.length) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = computedStyle;\n lineBoxManager.addX(marginLeft + paddingLeft + borderLeftWidth);\n }\n // 结束出栈contentBox,递归情况结束子inline获取contentBox,父inline继续\n lineBoxManager.popContentBoxList();\n // abs非固定w时预计算,本来是最近非inline父层统一计算,但在abs时不算,\n if(isVirtual) {\n this.__inlineSize();\n }\n }\n else {\n // ib在满时很特殊,取最大值,可能w本身很小不足排下1个字符,此时要用maxW\n let maxW = lineBoxManager.__maxX - data.x;\n tw = this.__width = fixedWidth ? w : (isIbFull ? Math.max(w, maxW) : maxW);\n th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n }\n // 非abs提前虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐,inline会被父级调用这里只看ib\n if(!isVirtual && !isInline) {\n lineBoxManager.verticalAlign();\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // block的所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n }\n // inlineBlock新开上下文,但父级block遇到要处理换行\n return isInline ? lineClampCount : 0;\n }\n\n /**\n * inline的尺寸计算非常特殊,并非一个矩形区域,而是由字体行高结合节点下多个LineBox中的内容决定,\n * 且这个尺寸又并非真实LineBox中的内容直接合并计算而来,比如包含了个更大尺寸的ib却不会计入\n * 具体方法为遍历持有的LineBox下的内容,x取两侧极值,同时首尾要考虑mpb,y值取上下极值,同样首尾考虑mpb\n * 首尾行LineBox可能不是不是占满一行,比如前后都有同行inline的情况,非首尾行则肯定占满\n * 绘制内容(如背景色)的区域也很特殊,每行LineBox根据lineHeight对齐baseLine得来,并非LineBox全部\n * 当LineBox只有直属Text时如果font没有lineGap则等价于全部,如有则需减去\n * 另外其client/offset/outer的w/h尺寸计算也很特殊,皆因首尾x方向的mpb导致\n * @private\n */\n __inlineSize(tw, textAlign) {\n let { contentBoxList, computedStyle, __ox, __oy } = this;\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // x/clientX/offsetX/outerX\n let maxX, maxY, minX, minY, maxCX, maxCY, minCX, minCY, maxFX, maxFY, minFX, minFY, maxOX, maxOY, minOX, minOY;\n let length = contentBoxList.length;\n if(length) {\n // 遍历contentBox,里面存的是LineBox内容,根据父LineBox引用判断是否换行\n contentBoxList.forEach((item, i) => {\n // 非第一个除了minY不用看其它都要,minX是换行导致,而maxX在最后一个要考虑右侧mpb,中间的无需考虑嵌套inline的mpb\n if(i) {\n minX = Math.min(minX, item.x);\n minCX = Math.min(minCX, item.x);\n minFX = Math.min(minFX, item.x);\n minOX = Math.min(minOX, item.x);\n if(i === length - 1) {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n maxY = maxCY = maxFY = maxOY = Math.max(maxY, item.y + item.outerHeight);\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n else {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n }\n }\n // 第一个初始化\n else {\n minX = item.x;\n minY = item.y;\n minCX = minX - paddingLeft;\n minCY = minY - paddingTop;\n minFX = minCX - borderLeftWidth;\n minFY = minCY - borderTopWidth;\n minOX = minFX - marginLeft;\n minOY = minFY - marginTop;\n maxX = maxCX = maxFX = maxOX = item.x + item.outerWidth;\n maxY = maxCY = maxFY = maxOY = item.y + item.outerHeight;\n if(i === length - 1) {\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n }\n });\n this.__x = minOX;\n this.__y = minOY;\n this.__width = computedStyle[WIDTH] = maxX - minX;\n // 防止比自己最小高度lineHeight还小,比如内容是个小字体\n this.__height = computedStyle[HEIGHT] = Math.max(lineHeight, maxY - minY);\n this.__clientWidth = maxCX - minCX;\n this.__clientHeight = maxCY - minCY;\n this.__offsetWidth = maxFX - minFX;\n this.__offsetHeight = maxFY - minFY;\n this.__outerWidth = maxOX - minOX;\n this.__outerHeight = maxOY - minOY;\n this.__sx = minOX + __ox;\n this.__sy = minOY + __oy;\n this.__sx1 = minFX + __ox;\n this.__sy1 = minFY + __oy;\n this.__sx2 = minCX + __ox;\n this.__sy2 = minCY + __oy;\n this.__sx3 = minX + __ox;\n this.__sy3 = minY + __oy;\n this.__sx4 = maxX + __ox;\n this.__sy4 = maxY + __oy;\n this.__sx5 = maxCX + __ox;\n this.__sy5 = maxCY + __oy;\n this.__sx6 = maxFX + __ox;\n this.__sy6 = maxFY + __oy;\n // inline的text整体设置相同\n if(['center', 'right'].indexOf(textAlign) > -1) {\n this.children.forEach(item => {\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n }\n // 如果没有内容,宽度为0高度为lineHeight,对齐也特殊处理,lineBoxManager不会处理\n else {\n if(['center', 'right'].indexOf(textAlign) > -1) {\n let diff = tw;\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n if(diff) {\n this.__offsetX(diff, true);\n }\n }\n this.__width = computedStyle[WIDTH] = 0;\n let th = this.__height = computedStyle[HEIGHT] = lineHeight;\n this.__ioSize(0, th);\n this.__sy -= marginTop + paddingTop + borderTopWidth;\n this.__sx1 = this.sx + marginLeft;\n this.__sy1 = this.sy + marginTop;\n this.__sx2 = this.__sx1 + borderLeftWidth;\n this.__sy2 = this.__sy1 + borderTopWidth;\n this.__sx4 = this.__sx3 = this.__sx2 + paddingLeft;\n this.__sy4 = this.__sy3 = this.__sy2 + paddingTop;\n this.__sx5 = this.__sx4 + paddingRight;\n this.__sy5 = this.__sy4 + th + paddingBottom;\n this.__sx6 = this.__sx5 + borderRightWidth;\n this.__sy6 = this.__sy5 + borderBottomWidth;\n this.__clientWidth = this.__sx5 - this.__sx2;\n this.__clientHeight = this.__sy5 - this.__sy2;\n this.__offsetWidth = this.__sx6 - this.__sx1;\n this.__offsetHeight = this.__sy6 - this.__sy1;\n this.__outerWidth = this.__offsetWidth + marginLeft + marginRight;\n this.__outerHeight = this.__offsetHeight + marginTop + marginBottom;\n }\n }\n\n /**\n * 只针对绝对定位children布局\n * @param container\n * @param data\n * @param target 可选,只针对某个abs的child特定布局,在局部更新时用\n * @private\n */\n __layoutAbs(container, data, target) {\n let { sx: x, sy: y, clientWidth, clientHeight, computedStyle } = container;\n let { isDestroyed, children, absChildren } = this;\n let {\n [DISPLAY]: display,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n } = computedStyle;\n if(isDestroyed || display === 'none') {\n this.__layoutNone();\n return;\n }\n x += marginLeft + borderLeftWidth;\n y += marginTop + borderTopWidth;\n // 对absolute的元素进行相对容器布局\n absChildren.forEach(item => {\n if(target) {\n // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr\n let node = item;\n if(node instanceof Component) {\n node = item.shadowRoot;\n }\n // 所以得2个都对比\n if(target !== node && target !== item) {\n return;\n }\n }\n let { currentStyle, computedStyle } = item;\n if(currentStyle[DISPLAY] === 'none') {\n item.__layoutNone();\n return;\n }\n // 先根据容器宽度计算margin/padding\n item.__mp(currentStyle, computedStyle, clientWidth);\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let { [LEFT]: left, [TOP]: top, [RIGHT]: right,\n [BOTTOM]: bottom, [WIDTH]: width, [HEIGHT]: height, [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection } = currentStyle;\n let x2, y2, w2, h2;\n let onlyRight;\n let onlyBottom;\n let fixedTop;\n let fixedRight;\n let fixedBottom;\n let fixedLeft;\n // 判断何种方式的定位,比如左+宽度,左+右之类\n if(left[1] !== AUTO) {\n fixedLeft = true;\n computedStyle[LEFT] = calAbsolute(currentStyle, 'left', left, clientWidth, this.root);\n }\n else {\n computedStyle[LEFT] = 'auto';\n }\n if(right[1] !== AUTO) {\n fixedRight = true;\n computedStyle[RIGHT] = calAbsolute(currentStyle, 'right', right, clientWidth, this.root);\n }\n else {\n computedStyle[RIGHT] = 'auto';\n }\n if(top[1] !== AUTO) {\n fixedTop = true;\n computedStyle[TOP] = calAbsolute(currentStyle, 'top', top, clientHeight, this.root);\n }\n else {\n computedStyle[TOP] = 'auto';\n }\n if(bottom[1] !== AUTO) {\n fixedBottom = true;\n computedStyle[BOTTOM] = calAbsolute(currentStyle, 'bottom', bottom, clientHeight, this.root);\n }\n else {\n computedStyle[BOTTOM] = 'auto';\n }\n // 优先级最高left+right,其次left+width,再次right+width,再次仅申明单个,最次全部auto\n if(fixedLeft && fixedRight) {\n x2 = x + computedStyle[LEFT];\n w2 = x + clientWidth - computedStyle[RIGHT] - x2;\n }\n else if(fixedLeft) {\n x2 = x + computedStyle[LEFT];\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n }\n else if(fixedRight) {\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n else {\n onlyRight = true;\n }\n x2 = x + clientWidth - computedStyle[RIGHT] - (w2 || 0);\n // 右对齐有尺寸时还需减去margin/border/padding的\n x2 -= computedStyle[MARGIN_LEFT];\n x2 -= computedStyle[MARGIN_RIGHT];\n x2 -= computedStyle[PADDING_LEFT];\n x2 -= computedStyle[PADDING_RIGHT];\n x2 -= currentStyle[BORDER_LEFT_WIDTH][0];\n x2 -= currentStyle[BORDER_RIGHT_WIDTH][0];\n }\n else {\n x2 = x + paddingLeft;\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else {\n w2 = width[0];\n }\n }\n }\n // top/bottom/height优先级同上\n if(fixedTop && fixedBottom) {\n y2 = y + computedStyle[TOP];\n h2 = y + clientHeight - computedStyle[BOTTOM] - y2;\n }\n else if(fixedTop) {\n y2 = y + computedStyle[TOP];\n if(height[1] !== AUTO) {\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else {\n h2 = height[0];\n }\n }\n }\n else if(fixedBottom) {\n if(height[1] !== AUTO) {\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else {\n h2 = height[0];\n }\n }\n else {\n onlyBottom = true;\n }\n y2 = y + clientHeight - computedStyle[BOTTOM] - (h2 || 0);\n // 底对齐有尺寸时y值还需减去margin/border/padding的\n y2 -= computedStyle[MARGIN_TOP];\n y2 -= computedStyle[MARGIN_BOTTOM];\n y2 -= computedStyle[PADDING_TOP];\n y2 -= computedStyle[PADDING_BOTTOM];\n y2 -= currentStyle[BORDER_TOP_WIDTH][0];\n y2 -= currentStyle[BORDER_BOTTOM_WIDTH][0];\n }\n // 未声明y的找到之前的流布局child,紧随其下\n else {\n y2 = y + paddingTop;\n let prev = item.prev;\n while(prev) {\n // 目前不考虑margin合并,直接以前面的flow的最近的prev末尾为准\n if(prev instanceof Text || prev.computedStyle[POSITION] !== 'absolute') {\n y2 = prev.y + prev.outerHeight;\n break;\n }\n prev = prev.prev;\n }\n if(height[1] === PERCENT) {\n h2 = height[0] * clientHeight * 0.01;\n }\n else if(height[1] === REM) {\n h2 = height[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(height[1] === VW) {\n h2 = height[0] * this.root.width * 0.01;\n }\n else if(height[1] === VH) {\n h2 = height[0] * this.root.height * 0.01;\n }\n else if(height[1] === PX) {\n h2 = height[0];\n }\n }\n // 没设宽高,需手动计算获取最大宽高后,赋给样式再布局\n let needCalWidth;\n if((display === 'block' || ['inlineBlock', 'inline-block'].indexOf(display) > -1) && w2 === undefined) {\n needCalWidth = true;\n }\n else if(display === 'flex') {\n if(w2 === undefined) {\n needCalWidth = true;\n }\n else if(flexDirection === 'column' && h2 === undefined) {\n needCalWidth = true;\n }\n }\n // onlyRight时做的布局其实是以那个点位为left/top布局然后offset,limit要特殊计算,从本点向左侧为边界\n let wl = onlyRight ? x2 - x : clientWidth + x - x2;\n // onlyBottom相同,正常情况是左上到右下的尺寸限制\n let hl = onlyBottom ? y2 - y : clientHeight + y - y2;\n // 未直接或间接定义尺寸,取孩子宽度最大值\n if(needCalWidth) {\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n }, true, true);\n wl = item.outerWidth;\n }\n // needCalWidth传入,因为自适应尺寸上面已经计算过一次margin/padding了\n item.__layout({\n x: x2,\n y: y2,\n w: wl,\n h: hl,\n w2, // left+right这种等于有宽度,但不能修改style,继续传入到__preLayout中特殊对待\n h2,\n }, false, true);\n if(onlyRight) {\n item.__offsetX(-item.outerWidth, true);\n }\n if(onlyBottom) {\n item.__offsetY(-item.outerHeight, true);\n }\n });\n // 递归进行,遇到absolute/relative/component的设置新容器\n children.forEach(item => {\n if(target) {\n // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr\n let node = item;\n if(node instanceof Component) {\n node = item.shadowRoot;\n }\n // 所以得2个都对比\n if(target !== node && target !== item) {\n return;\n }\n }\n if(item instanceof Dom) {\n item.__layoutAbs(isRelativeOrAbsolute(item) ? item : container, data);\n }\n else if(item instanceof Component) {\n let sr = item.shadowRoot;\n if(sr instanceof Dom) {\n sr.__layoutAbs(sr, data);\n }\n }\n });\n this.__execAr();\n }\n\n /**\n * 布局前检查继承的样式以及统计字体测量信息\n * 首次检查为整树遍历,后续检查是节点自发局部检查,不再进入\n * @param renderMode\n * @param ctx\n * @param cb\n * @private\n */\n __computeMeasure(renderMode, ctx, cb) {\n super.__computeMeasure(renderMode, ctx, cb);\n // 即便自己不需要计算,但children还要继续递归检查\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx, cb);\n });\n }\n\n render(renderMode, lv, ctx, cache, 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 unit from '../style/unit';\nimport image from '../style/image';\nimport border from '../style/border';\nimport enums from '../util/enums';\nimport level from '../refresh/level';\nimport mx from '../math/matrix';\n\nconst {\n STYLE_KEY: {\n WIDTH,\n HEIGHT,\n DISPLAY,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n VISIBILITY,\n BACKGROUND_IMAGE,\n BACKGROUND_COLOR,\n BOX_SHADOW,\n MIX_BLEND_MODE,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n FONT_SIZE,\n FLEX_BASIS,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_CONFIG,\n },\n NODE_KEY: {\n NODE_CACHE,\n NODE_DEFS_CACHE,\n NODE_IS_MASK,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH, RGBA } = unit;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { isFunction } = util;\n\nclass Img extends Dom {\n constructor(tagName, props) {\n super(tagName, props);\n let src = this.props.src;\n let loadImg = this.__loadImg = {\n src,\n };\n // 空url用错误图代替\n if(!src) {\n loadImg.error = true;\n }\n let config = this.__config;\n if(config[NODE_IS_MASK]) {\n let { style, currentStyle } = this;\n style[BACKGROUND_IMAGE] = currentStyle[BACKGROUND_IMAGE] = [null];\n style[BACKGROUND_COLOR] = currentStyle[BACKGROUND_COLOR] = [[0, 0, 0, 0], RGBA];\n style[BORDER_TOP_WIDTH] = currentStyle[BORDER_TOP_WIDTH] = [0, PX];\n style[BORDER_RIGHT_WIDTH] = currentStyle[BORDER_RIGHT_WIDTH] = [0, PX];\n style[BORDER_LEFT_WIDTH] = currentStyle[BORDER_LEFT_WIDTH] = [0, PX];\n style[BORDER_BOTTOM_WIDTH] = currentStyle[BORDER_BOTTOM_WIDTH] = [0, PX];\n style[BOX_SHADOW] = currentStyle[BOX_SHADOW] = null;\n style[MIX_BLEND_MODE] = currentStyle[MIX_BLEND_MODE] = 'normal';\n }\n }\n\n /**\n * 覆盖xom的方法,在__layout3个分支中会首先被调用\n * 当样式中固定宽高时,图片按样式尺寸,加载后重新绘制即可\n * 只固定宽高一个时,加载完要计算缩放比,重新布局绘制\n * 都没有固定,按照图片尺寸,重新布局绘制\n * 这里计算非固定的情况,将其改为固定供布局渲染使用,未加载完成为0\n * @param data\n * @returns {{fixedWidth: boolean, w: *, x: *, h: *, y: *, fixedHeight: boolean}}\n * @private\n */\n __preLayout(data) {\n let res = super.__preLayout(data);\n let loadImg = this.__loadImg;\n // 可能已提前加载好了,或有缓存,为减少刷新直接使用\n if(!loadImg.error) {\n let src = loadImg.src;\n let cache = inject.IMG[src];\n if(cache && cache.state === inject.LOADED) {\n loadImg.source = cache.source;\n loadImg.width = cache.width;\n loadImg.height = cache.height;\n }\n loadImg.cache = false;\n }\n if(res.fixedWidth && res.fixedHeight) {\n return res;\n }\n if(loadImg.error && !this.props.placeholder) {\n if(res.fixedWidth) {\n res.h = res.w;\n }\n else if(res.fixedHeight) {\n res.w = res.h;\n }\n else {\n res.w = res.h = 32;\n }\n }\n else if(loadImg.source) {\n if(res.fixedWidth) {\n res.h = res.w * loadImg.height / loadImg.width;\n }\n else if(res.fixedHeight) {\n res.w = res.h * loadImg.width / loadImg.height;\n }\n else {\n res.w = loadImg.width;\n res.h = loadImg.height;\n }\n }\n else {\n res.w = res.h = 0;\n }\n res.fixedWidth = true;\n res.fixedHeight = true;\n return res;\n }\n\n __addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n __destroy() {\n this.root.delRefreshTask(this.__task);\n super.__destroy();\n this.__task = null;\n }\n\n // img根据加载情况更新__hasContent\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n let res = super.__calContent(renderMode, lv, currentStyle, computedStyle);\n if(!res) {\n let {\n __loadImg: loadImg,\n } = this;\n if(computedStyle[VISIBILITY] !== 'hidden' && (computedStyle[WIDTH] || computedStyle[HEIGHT])\n && loadImg.source) {\n res = true;\n }\n }\n return res;\n }\n\n render(renderMode, lv, ctx, cache, 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 ctx.arc(cx, cy, r, 0, 2 * Math.PI);\n ctx.fill();\n ctx.closePath();\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for(let i = 1, len = pts.length; i < len; i++) {\n let point = pts[i];\n ctx.lineTo(point[0], point[1]);\n }\n ctx.lineTo(pts[0][0], pts[0][1]);\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n this.__addGeom('rect', [\n ['x', originX],\n ['y', originY],\n ['width', width],\n ['height', height],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ['fill', 'rgba(0,0,0,0)']\n ]);\n this.__addGeom('circle', [\n ['cx', cx],\n ['cy', cy],\n ['r', r],\n ['fill', fill],\n ]);\n let s = '';\n for(let i = 0, len = pts.length; i < len; i++) {\n let point = pts[i];\n if(i) {\n s += ' ';\n }\n s += point[0] + ',' + point[1];\n }\n this.__addGeom('polygon', [\n ['points', s],\n ['fill', fill]\n ]);\n }\n }\n else if(source) {\n // 圆角需要生成一个mask\n let list = border.calRadius(originX, originY, width, height,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n // 有border-radius需模拟遮罩裁剪\n if(list) {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list, 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 {\n let loadImg = this.__loadImg;\n // 加载成功计算缩放后的宽度\n if(loadImg.source) {\n if(height[1] === PX) {\n w -= loadImg.width * height[0] / loadImg.height;\n }\n else if(height[1] === PERCENT) {\n w -= loadImg.width * height[0] * total * 0.01 / loadImg.height;\n }\n else if(height[1] === REM) {\n w -= loadImg.width * height[0] * this.root.computedStyle[FONT_SIZE] / loadImg.height;\n }\n else if(height[1] === VW) {\n w -= loadImg.width * height[0] * this.root.width * 0.01 / loadImg.height;\n }\n else if(height[1] === VH) {\n w -= loadImg.width * height[0] * this.root.height * 0.01 / loadImg.height;\n }\n else {\n w -= loadImg.width;\n }\n }\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n return w;\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle, __loadImg } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n let cross = isDirectionRow ? height : width;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH].indexOf(flexBasis[1]) > -1;\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = max = min = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = max = min = flexBasis[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(flexBasis[1] === REM) {\n b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = max = min = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = max = min = flexBasis[0] * this.root.height * 0.01;\n }\n }\n else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1)) {\n if(main[1] === PX) {\n b = max = min = main[0];\n }\n else if(main[1] === PERCENT) {\n b = max = min = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = max = min = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = max = min = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = max = min = main[0] * this.root.height * 0.01;\n }\n }\n // auto和content固定尺寸比例计算\n else if(__loadImg.source || __loadImg.error) {\n if(cross[1] !== AUTO) {\n if(cross[1] === PX) {\n cross = cross[0];\n }\n else if(cross[1] === PERCENT) {\n cross = cross[0] * 0.01 * (isDirectionRow ? h : w);\n }\n else if(cross[1] === REM) {\n cross = cross[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(cross[1] === VW) {\n cross = cross[0] * this.root.width * 0.01;\n }\n else if(cross[1] === VH) {\n cross = cross[0] * this.root.height * 0.01;\n }\n let ratio = __loadImg.width / __loadImg.height;\n b = max = min = isDirectionRow ? cross * ratio : cross / ratio;\n }\n else {\n b = max = min = isDirectionRow ? __loadImg.width : __loadImg.height;\n }\n }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\n }\n\n __loadAndRefresh(loadImg, root, ctx, placeholder, computedStyle, width, height, cb) {\n let self = this;\n // 先清空之前可能的\n if(loadImg.source || loadImg.error) {\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n });\n loadImg.source = null;\n }\n loadImg.loading = true;\n // 再测量,可能瞬间完成替换掉上面的\n inject.measureImg(loadImg.src, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败走error绘制\n if(data.url === loadImg.src && !self.isDestroyed) {\n loadImg.cache && (loadImg.cache.cache = false);\n loadImg.loading = false;\n function reload() {\n let { currentStyle: { [WIDTH]: width, [HEIGHT]: height } } = self;\n root.delRefreshTask(self.__task);\n if(width[1] !== AUTO && height[1] !== AUTO) {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REPAINT;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n else {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n }\n if(data.success) {\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n }\n else if(placeholder) {\n inject.measureImg(placeholder, data => {\n if(data.success) {\n loadImg.error = true;\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n reload();\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n return;\n }\n else {\n loadImg.error = true;\n }\n // 可见状态进行刷新操作,visibility某些情况需要刷新,可能宽高未定义要重新布局\n if(computedStyle[DISPLAY] !== 'none') {\n reload();\n }\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n }\n\n updateSrc(v, cb) {\n let self = this;\n let loadImg = self.__loadImg;\n let root = this.root;\n // 相等或空且当前error直接返回\n if(v === loadImg.src || !v && loadImg.error) {\n if(isFunction(cb)) {\n cb(-1);\n }\n }\n else if(v) {\n loadImg.src = v;\n self.__loadAndRefresh(loadImg, root, root.ctx, self.props.placeholder, self.computedStyle, self.width, self.height, cb);\n }\n else {\n loadImg.src = v;\n loadImg.source = null;\n loadImg.error = true;\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, self.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb(diff);\n }\n },\n });\n }\n }\n\n appendChild() {\n inject.error('Img can not appendChild.');\n }\n\n get src() {\n return this.__loadImg.src;\n }\n\n static showError = true;\n}\n\nexport default Img;\n","class Defs {\n constructor(uuid) {\n this.id = uuid;\n this.count = 0;\n this.list = [];\n this.cacheHash = {}; // 每次svg渲染前重置,存储前次渲染不变的缓存id\n }\n add(data) {\n let uuid = this.count;\n let hash = this.cacheHash;\n while(hash.hasOwnProperty(uuid)) {\n uuid++;\n }\n this.count = uuid + 1;\n data.id = uuid;\n data.uuid = 'karas-defs-' + this.id + '-' + uuid;\n data.index = this.list.length;\n this.list.push(data);\n return data.uuid;\n }\n addCache(data) {\n data.index = this.list.length;\n this.list.push(data);\n this.cacheHash[data.id] = true;\n return data.uuid;\n }\n clear() {\n this.list = [];\n this.count = 0;\n this.cacheHash = {};\n }\n removeCache(data) {\n let list = this.list;\n let i = data.index;\n // 一般情况index即位置,但每次渲染过程中,可能会删掉一些,此时位置会往前,但index不变,因此遍历\n for(; i >= 0; i--) {\n if(list[i] === data) {\n list.splice(i, 1);\n return;\n }\n }\n }\n\n get value() {\n return this.list;\n }\n\n static getInstance(uuid) {\n return new Defs(uuid);\n }\n}\n\nexport default Defs;\n","import Xom from '../Xom';\nimport reset from '../../style/reset';\nimport css from '../../style/css';\nimport unit from '../../style/unit';\nimport enums from '../../util/enums';\nimport mode from '../mode';\nimport util from '../../util/util';\nimport painter from '../../util/painter';\nimport transform from '../../style/transform';\nimport mx from '../../math/matrix';\nimport inject from '../../util/inject';\nimport gradient from '../../math/gradient';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n WIDTH,\n HEIGHT,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n FILL,\n STROKE,\n STROKE_MITERLIMIT,\n STROKE_WIDTH,\n STROKE_LINECAP,\n STROKE_LINEJOIN,\n STROKE_DASHARRAY,\n STROKE_DASHARRAY_STR,\n FILL_RULE,\n VISIBILITY,\n FONT_SIZE,\n FLEX_BASIS,\n },\n NODE_KEY: {\n NODE_CACHE_PROPS,\n NODE_CURRENT_PROPS,\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { PX, PERCENT, REM, VW, VH } = unit;\nconst { int2rgba, isNil, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nconst REGISTER = {};\n\nclass Geom extends Xom {\n constructor(tagName, props) {\n super(tagName, props);\n this.__isMulti = !!this.props.multi;\n this.__style = css.normalize(this.style, reset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET));\n this.__currentStyle = util.extend({}, this.__style);\n this.__currentProps = util.clone(this.props);\n let config = this.__config;\n config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n config[NODE_CURRENT_PROPS] = this.__currentProps;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_STYLE] = this.__style;\n }\n\n __tryLayInline(w, total) {\n // 无children,直接以style的width为宽度,不定义则为0\n let { currentStyle: {\n [WIDTH]: width,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n return w;\n }\n\n __calMinMax(isDirectionRow, data) {\n css.computeReflow(this, this.isShadowRoot);\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n // 计算需考虑style的属性\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n [DISPLAY]: display,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n return [display, this.__addMp(isDirectionRow, data.w, currentStyle, [min, max])];\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH].indexOf(flexBasis[1]) > -1;\n if(isFixed) {\n if(flexBasis[1] === PX) {\n b = max = min = flexBasis[0];\n }\n else if(flexBasis[1] === PERCENT) {\n b = max = min = flexBasis[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(flexBasis[1] === REM) {\n b = max = min = flexBasis[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(flexBasis[1] === VW) {\n b = max = min = flexBasis[0] * this.root.width * 0.01;\n }\n else if(flexBasis[1] === VH) {\n b = max = min = flexBasis[0] * this.root.height * 0.01;\n }\n }\n else if(([PX, PERCENT, REM, VW, VH].indexOf(main[1]) > -1)) {\n if(main[1] === PX) {\n b = max = min = main[0];\n }\n else if(main[1] === PERCENT) {\n b = max = min = main[0] * 0.01 * (isDirectionRow ? w : h);\n }\n else if(main[1] === REM) {\n b = max = min = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n b = max = min = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n b = max = min = main[0] * this.root.height * 0.01;\n }\n }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\n }\n\n __layoutBlock(data, isVirtual) {\n let { fixedWidth, fixedHeight, w, h } = this.__preLayout(data);\n this.__height = fixedHeight ? h : 0;\n if(isVirtual) {\n this.__width = fixedWidth ? w : 0;\n return;\n }\n this.__width = w;\n this.__ioSize(w, this.height);\n this.__marginAuto(this.currentStyle, data);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __layoutFlex(data) {\n // 无children所以等同于block\n this.__layoutBlock(data);\n }\n\n __layoutInline(data) {\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // 元素的width不能超过父元素w\n let tw = this.__width = fixedWidth ? w : x - data.x;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6) {\n let res = super.__calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6);\n if(isNil(__cacheStyle[STROKE_WIDTH])) {\n __cacheStyle[STROKE_WIDTH] = true;\n let strokeWidth = currentStyle[STROKE_WIDTH] || [];\n let w = this.width;\n computedStyle[STROKE_WIDTH] = strokeWidth.map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n else if(item[1] === PERCENT) {\n return item[0] * w * 0.01;\n }\n else if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n else if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n else {\n return 0;\n }\n });\n }\n if(isNil(__cacheStyle[STROKE_DASHARRAY])) {\n __cacheStyle[STROKE_DASHARRAY] = true;\n computedStyle[STROKE_DASHARRAY] = currentStyle[STROKE_DASHARRAY] || [];\n __cacheStyle[STROKE_DASHARRAY_STR] = computedStyle[STROKE_DASHARRAY].map(item => joinArr(item, ','));\n }\n // 直接赋值的\n [\n STROKE_LINECAP,\n STROKE_LINEJOIN,\n STROKE_MITERLIMIT,\n FILL_RULE,\n ].forEach(k => {\n computedStyle[k] = currentStyle[k];\n });\n // stroke/fll移至render里处理,因为cache涉及渐变坐标偏移\n [STROKE, FILL].forEach(k => {\n if(isNil(__cacheStyle[k])) {\n let v = currentStyle[k];\n computedStyle[k] = v;\n let res = [];\n if(Array.isArray(v)) {\n v.forEach(item => {\n if(item && (item.k === 'linear' || item.k === 'radial' || item.k === 'conic')) {\n res.push(this.__gradient(renderMode, ctx, x3, y3, x4, y4, item));\n }\n else if(item[3] > 0) {\n res.push(int2rgba(item));\n }\n else {\n res.push('none');\n }\n });\n }\n __cacheStyle[k] = res;\n }\n });\n return res;\n }\n\n __calContent(renderMode, lv, currentStyle, computedStyle) {\n // Geom强制有内容\n return computedStyle[VISIBILITY] !== 'hidden';\n }\n\n __preSet(res) {\n let { width, height, __cacheStyle, computedStyle } = this;\n let cx = res.sx3 + width * 0.5;\n let cy = res.sy3 + height * 0.5;\n let {\n [FILL]: fill,\n [STROKE]: stroke,\n [STROKE_DASHARRAY_STR]: strokeDasharrayStr,\n } = __cacheStyle;\n let {\n [STROKE_WIDTH]: strokeWidth,\n [STROKE_LINECAP]: strokeLinecap,\n [STROKE_LINEJOIN]: strokeLinejoin,\n [STROKE_MITERLIMIT]: strokeMiterlimit,\n [STROKE_DASHARRAY]: strokeDasharray,\n [FILL_RULE]: fillRule,\n } = computedStyle;\n return {\n cx,\n cy,\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeDasharrayStr,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n fillRule,\n };\n }\n\n __preSetCanvas(renderMode, ctx, res) {\n let {\n stroke,\n strokeWidth,\n strokeDasharray,\n strokeLinecap,\n strokeLinejoin,\n strokeMiterlimit,\n fill,\n } = res;\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(fill) {\n if(fill.k === 'linear') {\n ctx.fillStyle = fill.v;\n }\n else if(fill.k === 'radial' && !Array.isArray(fill.v)) {\n ctx.fillStyle = fill.v;\n }\n else if(fill.k === 'conic') {\n //\n }\n else if(!fill.k && ctx.fillStyle !== fill) {\n ctx.fillStyle = fill;\n }\n }\n if(stroke) {\n if(stroke.k === 'linear') {\n ctx.strokeStyle = stroke.v;\n }\n else if(stroke.k === 'radial' && !Array.isArray(stroke.v)) {\n ctx.strokeStyle = stroke.v;\n }\n else if(stroke.k === 'conic') {\n //\n }\n else if(!stroke.k && ctx.strokeStyle !== stroke) {\n ctx.strokeStyle = stroke;\n }\n }\n if(strokeWidth !== undefined && ctx.lineWidth !== strokeWidth) {\n ctx.lineWidth = strokeWidth;\n }\n if(strokeLinecap !== undefined && ctx.lineCap !== strokeLinecap) {\n ctx.lineCap = strokeLinecap;\n }\n if(strokeLinejoin !== undefined && ctx.lineJoin !== strokeLinejoin) {\n ctx.lineJoin = strokeLinejoin;\n }\n if(strokeMiterlimit !== undefined && ctx.miterLimit !== strokeMiterlimit) {\n ctx.miterLimit = strokeMiterlimit;\n }\n // 小程序没这个方法\n if(util.isFunction(ctx.getLineDash)) {\n if(strokeDasharray && !util.equalArr(ctx.getLineDash(), strokeDasharray)) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n else if(strokeDasharray) {\n ctx.setLineDash(strokeDasharray);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, 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() {}\n\n // offset/resize时要多一步清空props上记录的缓存\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeX(diff, lv) {\n super.__resizeX(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeY(diff, lv) {\n super.__resizeY(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n getProps(k) {\n let v = this.currentProps[k];\n if(!isNil(v)) {\n return v;\n }\n return this['__' + k];\n }\n\n __isRealInline() {\n return false;\n }\n\n get isMulti() {\n return this.__isMulti;\n }\n\n get currentProps() {\n return this.__currentProps;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$') {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Geom has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$'\n || !obj.prototype || !(obj.prototype instanceof Geom)) {\n throw new Error('Invalid param');\n }\n if(Geom.hasRegister(name)) {\n throw new Error(`Geom has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Geom.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nexport default Geom;\n","import Xom from '../node/Xom';\nimport Dom from '../node/Dom';\nimport Component from '../node/Component';\nimport util from './util';\nimport inject from './inject';\nimport flatten from './flatten';\nimport $$type from './$$type';\nimport enums from './enums';\n\nconst {\n NODE_KEY: {\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_DOM_PARENT,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n NODE_STRUCT,\n },\n} = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet updateList = [];\nlet removeList = [];\n\nconst KEY_FLAG = {};\n\n/**\n * setState后刷新前先根遍历检查组件开始进行shouldComponentUpdate判断\n */\nfunction check(vd) {\n if(vd instanceof Dom) {\n vd.children.forEach(child => {\n if(child instanceof Dom) {\n check(child);\n }\n // 当组件有setState更新时,从叶子到根链路会标识__hasUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasUpdate) {\n child.__hasUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n // 高阶组件会进入此分支,被父组件调用\n else if(vd instanceof Component && vd.__hasUpdate) {\n vd.__hasUpdate = false;\n checkCp(vd, vd.props);\n }\n}\n\n/**\n * 检查cp是否有state变更,注意递归检查时需要看shadow不能看shadowRoot,\n * 否则高阶组件会被跳过,其更新无法触发update生命周期\n * @param cp\n * @param nextProps\n * @param forceCheckUpdate,被render()后的json的二级组件,发现props有变更强制检查更新,否则可以跳过\n */\nfunction checkCp(cp, nextProps, forceCheckUpdate) {\n if(cp.__nextState || forceCheckUpdate) {\n let shouldUpdate;\n if(util.isFunction(cp.shouldComponentUpdate)) {\n shouldUpdate = cp.shouldComponentUpdate(nextProps, cp.__nextState || cp.state);\n }\n else {\n // 没有默认更新\n shouldUpdate = true;\n }\n if(shouldUpdate) {\n updateCp(cp, nextProps, cp.__nextState || cp.state);\n }\n // 不更新则递归检查子tree的cp\n else {\n cp.props = nextProps;\n cp.state = cp.__nextState || cp.state;\n check(cp.shadow);\n }\n }\n else {\n check(cp.shadow);\n }\n}\n\n/**\n * 更新组件的props和state,清空__nextState\n * @param cp\n * @param props\n * @param state\n */\nfunction updateCp(cp, props, state) {\n cp.props = props;\n cp.state = state;\n cp.__nextState = null; // 同步在refresh前清除component的新state标识,这样frame动画在after回调中可以新设\n let oldS = cp.shadow;\n let oldSr = cp.shadowRoot;\n let oldJson = cp.__cd;\n let json = flatten(cp.render());\n // 对比新老render()返回的内容,更新后重新生成sr\n diffSr(oldS, oldJson, json);\n cp.__init(json);\n // 为了局部dom布局需要知道老的css信息\n let sr = cp.shadowRoot;\n if(sr instanceof Xom) {\n [\n '__outerWidth',\n '__outerHeight',\n '__sx',\n '__sy',\n '__sx2',\n '__sx3',\n '__sx4',\n '__sx5',\n '__sx6',\n '__sy2',\n '__sy3',\n '__sy4',\n '__sy5',\n '__sy6',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__computedStyle = sr.__config[NODE_COMPUTED_STYLE] = oldSr.computedStyle;\n }\n else {\n let domParent = cp.domParent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n sr.__config[k] = domParent.__config[k];\n });\n }\n [\n '__x',\n '__y',\n '__width',\n '__height',\n '__sx1', // text和xom\n '__sy1',\n '__layoutData',\n '__parent',\n '__domParent',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__config[NODE_DOM_PARENT] = oldSr.domParent;\n sr.__config[NODE_STRUCT] = oldSr.__config[NODE_STRUCT];\n updateList.push(cp);\n // 老的需回收,diff会生成新的dom,唯一列外是cp直接返回一个没变化的cp\n if(!util.isObject(json) || !json.__placeholder) {\n removeList.push(oldS);\n }\n // 子组件使用老的json时标识,更新后删除,render()返回空会没json对象\n if(json && json.__placeholder) {\n delete json.__placeholder;\n }\n if(json && json.__inheritAnimate) {\n delete json.__inheritAnimate;\n }\n if(json && json.__animateRecords) {\n delete json.__animateRecords;\n }\n // 高阶组件时需判断,子组件更新后生成新的sr,父组件的sr/host需要同时更新引用\n let host = cp.host;\n while(host) {\n if(host.shadow === cp) {\n host.__shadowRoot = sr;\n sr.__hostRoot = host;\n cp = host;\n host = host.host;\n }\n else {\n break;\n }\n }\n}\n\n/**\n * 非一级组件sr进行对比,key相同的无需重新生成且继承动画\n * @param vd\n * @param oj oldJson\n * @param nj\n */\nfunction diffSr(vd, oj, nj) {\n // 先遍历检查key相同的,将没有变化的key暂存下来,深度优先,这样叶子节点出现在前面,当key的叶子也有key时,确保叶子先对比\n let ojk = getKeyHash(oj, {}, vd);\n let njk = getKeyHash(nj, {});\n let keyList = [];\n let cpList = [];\n // 先对比key对应的节点,如果新老有一方对不上则落空\n Object.keys(ojk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n if(!n) {\n o.json.key = KEY_FLAG;\n }\n });\n Object.keys(njk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n // 有可能老的没有这个key,新key落空\n if(!o) {\n n.json.key = KEY_FLAG;\n return;\n }\n let oj = o.json;\n let nj = n.json;\n let vd = o.vd;\n // 相同class的组件进行对比替换\n if(oj.$$type === TYPE_CP && nj.$$type === TYPE_CP) {\n if(oj.klass === nj.klass) {\n // 对比props和children看是否全等,是则直接替换新json类型为占位符,引用老vd,否则强制更新\n diffCp(oj, nj, vd);\n // 标识对比过了\n oj.key = nj.key = KEY_FLAG;\n // 老的sr里需删除这个vd,因为老sr会回收\n cpList.push(vd);\n }\n }\n // 相同类型的vd进行对比继承动画\n else if(oj.$$type === nj.$$type && oj.tagName === nj.tagName) {\n // 需判断矢量标签mutil是否相等\n if(nj.$$type !== TYPE_GM || oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n oj.key = nj.key = KEY_FLAG;\n // key相同的dom暂存下来\n if(nj.$$type === TYPE_VD) {\n keyList.push({\n vd,\n oj,\n nj,\n });\n }\n }\n });\n // key相同的dom对比children,下面非key逻辑就不做了\n keyList.forEach(item => {\n diffChildren(item.vd, item.oj, item.nj);\n });\n // 整体tree进行对比\n diffChild(vd, oj, nj);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的\n cpList.forEach(vd => {\n removeCpFromOldTree(vd);\n });\n}\n\n/**\n * 递归检查dom的children,相同的无需重新生成,用PL类型占位符代替直接返回老vd\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChild(vd, oj, nj) {\n if(util.isObject(nj)) {\n if(nj.$$type === TYPE_CP) {\n // key对比过了忽略\n if(nj.key === KEY_FLAG) {\n return;\n }\n // 相同class的组件处理\n if(oj && oj.$$type === nj.$$type && oj.klass === nj.klass) {\n diffCp(oj, nj, vd);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收\n removeCpFromOldTree(vd);\n }\n }\n else if(nj.$$type === TYPE_GM && oj && oj.$$type === TYPE_GM) {\n // $geom的multi必须一致\n if(oj.tagName === nj.tagName && oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n }\n // dom类型递归children\n else if(nj.$$type === TYPE_VD && oj && oj.$$type === TYPE_VD) {\n if(oj.tagName === nj.tagName) {\n nj.__inheritAnimate = vd;\n }\n diffChildren(vd, oj, nj);\n }\n }\n}\n\n/**\n * dom类型的vd对比children\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChildren(vd, oj, nj) {\n let oc = oj.children;\n let nc = nj.children;\n let ol = oc.length;\n let nl = nc.length;\n let children = vd.children;\n for(let i = 0, of = 0, nf = 0, len = Math.min(ol, nl); i < len; i++) {\n let o = oc[i + of];\n let n = nc[i + nf];\n // 新老都是key直接跳过\n if(o.key === KEY_FLAG && n.key === KEY_FLAG) {\n }\n // 其中一个是key对比过了调整索引和长度\n else if(o.key === KEY_FLAG) {\n of++;\n i--;\n ol--;\n len = Math.min(ol, nl);\n }\n else if(n.key === KEY_FLAG) {\n nf++;\n i--;\n nl--;\n len = Math.min(ol, nl);\n }\n else {\n diffChild(children[i + of], o, n);\n }\n }\n // 长度不同增减的无需关注,新json创建cp有didMount,老vd会调用cp的destroy\n}\n\n/**\n * 根据json对比看cp如何更新,被render()后的json的二级组件对比才会出现\n * @param oj\n * @param nj\n * @param vd\n */\nfunction diffCp(oj, nj, vd) {\n // props全等,直接替换新json类型为占位符,引用老vd内容,无需重新创建,暂时存在json的placeholder上\n // 否则需要强制触发组件更新,包含setState内容\n nj.__placeholder = vd;\n let sr = vd.shadowRoot;\n // 对比需忽略on开头的事件,直接改老的引用到新的上,这样只变了on的话无需更新\n let exist = {};\n Object.keys(oj.props).forEach(k => {\n let v = oj.props[k];\n exist[k] = v;\n });\n Object.keys(nj.props).forEach(k => {\n let v = nj.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n vd.off(k, exist[k]);\n vd.on(k, v);\n }\n delete exist[k];\n }\n else {\n k = k.slice(2).toLowerCase();\n vd.on(k, v);\n }\n }\n });\n // 新的少的事件取消\n Object.keys(exist).forEach(k => {\n let v = exist[k];\n if(/^on[a-zA-Z]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n delete sr.listener[k];\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n vd.off(k, v);\n }\n });\n checkCp(vd, nj.props, !util.equal(oj.props, nj.props));\n}\n\n/**\n * 深度优先遍历json,将有key的记录在hash中,如果传入根vd,同步递归保存对应位置的vd\n * @param json\n * @param hash\n * @param vd\n * @returns {*}\n */\nfunction getKeyHash(json, hash, vd) {\n if(Array.isArray(json)) {\n json.forEach((item, i) => getKeyHash(item, hash, vd && vd[i]));\n }\n else if(util.isObject(json)) {\n if(json.$$type === TYPE_VD || json.$$type === TYPE_GM || json.$$type === TYPE_CP) {\n // 深度优先\n if(json.$$type === TYPE_VD) {\n getKeyHash(json.children, hash, vd && vd.children);\n }\n let key = json.props.key;\n if(!util.isNil(key) && key !== '') {\n // 重复key错误警告\n if(hash.hasOwnProperty(key)) {\n inject.warn('Component ' + vd.tagName + ' has duplicate key: ' + key);\n }\n hash[key] = {\n json,\n vd,\n };\n }\n }\n }\n return hash;\n}\n\n/**\n * 非一级组件diff发生更新时,其需要从sr的tree中移除,因为sr会销毁\n */\nfunction removeCpFromOldTree(vd) {\n // root下的一级组件不会发生回收情况,忽略\n if(!vd.host) {\n return;\n }\n let parent = vd.parent;\n if(parent) {\n let i = parent.children.indexOf(vd);\n if(i > -1) {\n parent.children[i] = null;\n }\n else {\n throw new Error('Can not find child: ' + vd.tagName);\n }\n }\n}\n\n/**\n * 执行componentDidUpdate/destroy\n */\nfunction did() {\n updateList.forEach(item => {\n if(util.isFunction(item.componentDidUpdate)) {\n item.componentDidUpdate();\n }\n });\n updateList.splice(0);\n removeList.forEach(item => {\n item.__destroy();\n });\n removeList = [];\n}\n\nexport default {\n updateList,\n check,\n did,\n};\n","import util from './util';\nimport level from '../refresh/level';\n\nconst { joinVd, joinDef } = util;\nconst { contain, NONE, TRANSFORM_ALL, OPACITY, FILTER, MIX_BLEND_MODE } = level;\n\nfunction diff(elem, ovd, nvd) {\n let cns = elem.childNodes;\n diffDefs(cns[0], ovd.defs, nvd.defs);\n // = i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinDef(nd[i]));\n }\n }\n}\n\nfunction diffDef(elem, od, nd) {\n if(od.tagName !== nd.tagName) {\n insertAdjacentHTML(elem, 'beforebegin', joinDef(nd));\n // elem.insertAdjacentHTML('beforebegin', joinDef(nd));\n elem.parentNode.removeChild(elem);\n }\n else {\n if(od.uuid !== nd.uuid) {\n elem.setAttribute('id', nd.uuid);\n }\n let op = {};\n for(let i = 0, len = (od.props || []).length; i < len; i++) {\n let prop = od.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nd.props || []).length; i < len; i++) {\n let prop = nd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n let cns = elem.childNodes;\n let ol = od.children.length;\n let nl = nd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, od.children[i], nd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nd.children[i]));\n }\n }\n }\n}\n\nfunction diffChild(elem, ovd, nvd) {\n if(ovd.type === 'dom') {\n if(nvd.type === 'dom') {\n diffD2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffD2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'text') {\n if(nvd.type === 'text') {\n diffT2T(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'geom') {\n if(nvd.type === 'dom') {\n diffG2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffG2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'img') {\n if(nvd.type === 'img') {\n diffItemSelf(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n}\n\nfunction diffX2X(elem, ovd, nvd) {\n let { transform, opacity, visibility, mask, overflow, filter, mixBlendMode, conClip } = nvd;\n if(ovd.transform !== transform) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(ovd.opacity !== opacity) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(ovd.visibility !== visibility) {\n elem.setAttribute('visibility', visibility);\n }\n if(ovd.mask !== mask) {\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n }\n if(ovd.filter !== filter || ovd.mixBlendMode !== mixBlendMode) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('filter');\n }\n }\n // if(ovd.filter !== filter) {\n // if(filter) {\n // elem.setAttribute('filter', filter);\n // }\n // else {\n // elem.removeAttribute('filter');\n // }\n // }\n if(ovd.overflow !== overflow) {\n if(overflow) {\n elem.setAttribute('clipPath', overflow);\n }\n else {\n elem.removeAttribute('overflow');\n }\n }\n if(ovd.conClip !== conClip) {\n if(conClip) {\n elem.childNodes[1].setAttribute('clip-path', conClip);\n }\n else {\n elem.childNodes[1].removeAttribute('clip-path');\n }\n }\n}\n\nfunction diffByLessLv(elem, ovd, nvd, lv) {\n let { transform, opacity, mask, filter, mixBlendMode } = nvd;\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n if(lv === NONE) {\n return;\n }\n if(contain(lv, TRANSFORM_ALL)) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(contain(lv, OPACITY)) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(contain(lv, FILTER) || contain(lv, MIX_BLEND_MODE)) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('style');\n }\n }\n}\n\nfunction diffD2D(elem, ovd, nvd, root) {\n // cache表明children无变化缓存,一定是REPAINT以下的,只需看自身的lv以及mask\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffD2G(elem, ovd, nvd) {\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n replaceWith(cns[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffT2T(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, ovd.children[i], nvd.children[i], true);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffG2D(elem, ovd, nvd) {\n diffD2G(elem, ovd, nvd);\n}\n\nfunction diffG2G(elem, ovd, nvd) {\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n }\n}\n\nfunction diffBb(elem, obb, nbb) {\n let ol = obb.length;\n let nl = nbb.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, obb[i], nbb[i]);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nbb[i]));\n }\n }\n}\n\nfunction diffItem(elem, i, ovd, nvd, isText) {\n let cns = elem.childNodes;\n if(ovd.tagName !== nvd.tagName) {\n replaceWith(cns[i], nvd);\n }\n else {\n diffItemSelf(cns[i], ovd, nvd);\n if(isText && ovd.content !== nvd.content) {\n cns[i].innerHTML = nvd.content;\n }\n }\n}\n\nfunction diffItemSelf(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let op = {};\n for(let i = 0, len = (ovd.props || []).length; i < len; i++) {\n let prop = ovd.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nvd.props || []).length; i < len; i++) {\n let prop = nvd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n}\n\nfunction replaceWith(elem, vd) {\n let res;\n if(Array.isArray(vd)) {\n res = '';\n vd.forEach(item => {\n res += joinVd(item);\n });\n }\n else {\n res = joinVd(vd);\n }\n insertAdjacentHTML(elem, 'beforebegin', res);\n // elem.insertAdjacentHTML('beforebegin', res);\n elem.parentNode.removeChild(elem);\n}\n\nfunction insertAt(elem, cns, index, html) {\n if(index >= cns.length) {\n insertAdjacentHTML(elem, 'beforeend', html);\n // elem.insertAdjacentHTML('beforeend', html);\n }\n else {\n insertAdjacentHTML(cns[index], 'beforebegin', html);\n // cns[index].insertAdjacentHTML('beforebegin', html);\n }\n}\n\nfunction removeAt(elem, cns, index) {\n if(cns[index]) {\n elem.removeChild(cns[index]);\n }\n}\n\nlet svg;\nfunction insertAdjacentHTML(elem, where, content) {\n if(elem.insertAdjacentHTML) {\n elem.insertAdjacentHTML(where, content);\n }\n else {\n switch(where) {\n case 'beforeend':\n elem.innerHTML += content;\n break;\n case 'beforebegin':\n svg = svg || document.createElement('svg');\n svg.innerHTML = content;\n elem.parentNode.insertBefore(svg.childNodes[0], elem);\n break;\n }\n }\n}\n\nexport default diff;\n","import util from '../util/util';\n\nconst { isFunction } = util;\n\nclass Controller {\n constructor() {\n this.__records = []; // 默认记录和自动记录\n this.__records2 = []; // 非自动播放的动画记录\n this.__list = [] // 默认初始化播放列表,自动播放也存这里\n this.__list2 = []; // json中autoPlay为false的初始化存入这里\n this.__onList = []; // list中已存在的侦听事件,list2初始化时也需要增加上\n this.__lastTime = {}; // 每个类型的上次触发时间,防止重复emit\n }\n\n add(v, list = this.list) {\n if(list.indexOf(v) === -1) {\n list.push(v);\n }\n }\n\n remove(v) {\n let i = this.list.indexOf(v);\n if(i > -1) {\n this.list.splice(i, 1);\n }\n }\n\n __destroy() {\n this.__records = [];\n this.__records2 = [];\n this.__list = [];\n this.__list2 = [];\n }\n\n __action(k, args) {\n this.list.forEach(item => {\n item[k].apply(item, args);\n });\n }\n\n init(records = this.__records, list = this.list) {\n // 检查尚未初始化的record,并初始化,后面才能调用各种控制方法\n if(records.length) {\n // 清除防止重复调用,并且新的json还会进入整体逻辑\n records.splice(0).forEach(item => {\n let { target, animate } = item;\n if(target.isDestroyed) {\n return;\n }\n if(Array.isArray(animate)) {\n animate.forEach(animate => {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n });\n }\n else {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n }\n });\n }\n // 非自动播放后初始化需检测事件,给非自动播放添加上,并清空本次\n if(records === this.__records2) {\n let onList = this.__onList;\n let list2 = this.list2;\n if(list2.length && onList.length) {\n list2.forEach(item => {\n onList.forEach(arr => {\n item.off(arr[0], arr[1]);\n item.on(arr[0], arr[1]);\n });\n });\n }\n }\n }\n\n __playAuto() {\n this.init();\n this.__action('play');\n }\n\n play(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('play', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n pause() {\n this.__action('pause');\n }\n\n resume(cb) {\n let once = true;\n this.__action('resume', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n __mergeAuto() {\n this.init();\n this.init(this.__records2);\n if(this.__list2.length) {\n this.__list = this.__list.concat(this.__list2);\n this.__list2 = [];\n }\n }\n\n cancel(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('cancel', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n finish(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('finish', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndStop(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('gotoAndStop', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndPlay(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('gotoAndPlay', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.__on(id[i], handle);\n }\n this.__onList.push([id, handle]);\n }\n else {\n this.__on(id, handle);\n this.__onList.push([id, handle]);\n }\n }\n\n __on(id, handle) {\n this.list.forEach(item => {\n let cb = () => {\n let time = item.timestamp;\n if(time !== this.__lastTime[id]) {\n this.__lastTime[id] = time;\n handle();\n }\n };\n cb.__karasEventCb = handle;\n item.on(id, cb);\n });\n }\n\n off(id, handle) {\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.off(id[i], handle);\n }\n }\n else {\n this.list.forEach(item => {\n item.off(id, handle);\n });\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get list2() {\n return this.__list2;\n }\n\n __set(key, value) {\n this.list.forEach(item => {\n item[key] = value;\n });\n }\n\n set playbackRate(v) {\n this.__set('playbackRate', v);\n }\n\n set iterations(v) {\n this.__set('iterations', v);\n }\n\n set playCount(v) {\n this.__set('playCount', v);\n }\n\n set fps(v) {\n this.__set('fps', v);\n }\n\n set currentTime(v) {\n this.__set('currentTime', v);\n }\n\n set spfLimit(v) {\n this.__set('spfLimit', v);\n }\n\n set delay(v) {\n this.__set('delay', v);\n }\n\n set endDelay(v) {\n this.__set('endDelay', v);\n }\n\n set fill(v) {\n this.__set('fill', v);\n }\n\n set direction(v) {\n this.__set('direction', v);\n }\n}\n\nexport default Controller;\n","import 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 Geom from '../node/geom/Geom';\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;\n }\n // 局部根节点如有perspective,则计算pm,这里不会出现嵌套,因为每个出现都会生成局部根节点\n let pm;\n if(perspective) {\n pm = tf.calPerspectiveMatrix(perspective, perspectiveOrigin);\n }\n // 广度遍历,不断一层层循环下去,用2个hash暂存每层的父matrix和opacity,blur只需记住顶层,因为子的如果有一定是cacheFilter\n let list = [index];\n let d = 0;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n d = blur.outerSize(v);\n }\n });\n opacityHash[index] = 1;\n // opacity可以保存下来层级相乘结果供外部使用,但matrix不可以,因为这里按画布原点为坐标系计算,外部合并局部根节点以bbox左上角为原点\n let matrixHash = {};\n while(list.length) {\n let arr = list.splice(0);\n for(let i = 0, len = arr.length; i < len; i++) {\n let parentIndex = arr[i];\n let total = __structs[parentIndex][STRUCT_TOTAL] || 0;\n for(let i = parentIndex + 1, len = parentIndex + total + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node2,\n [STRUCT_TOTAL]: total,\n } = __structs[i];\n // mask也不占bbox位置\n if(node2.isMask) {\n continue;\n }\n let {\n __sx1,\n __sy1,\n __config: {\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [OPACITY]: opacity,\n },\n },\n } = node2;\n // webgl不能跳过超限\n if(limitCache && !includeLimitCache) {\n return;\n }\n // display:none跳过整个节点树,visibility只跳过自身\n if(display === 'none') {\n i += total || 0;\n continue;\n }\n if(visibility === 'hidden') {\n continue;\n }\n parentIndexHash[i] = parentIndex;\n opacityHash[i] = opacityHash[parentIndex] * opacity;\n // 防止text的情况,其一定属于某个node,其bbox被计算过,text不应该计算\n if(node2 instanceof Text) {\n continue;\n }\n let bbox, dx = 0, dy = 0, hasTotal;\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n bbox = target.bbox.slice(0);\n dx = target.dbx;\n dy = target.dby;\n i += total || 0;\n hasTotal = true;\n }\n else if(__cache && __cache.available) {\n bbox = __cache.bbox.slice(0);\n dx = __cache.dbx;\n dy = __cache.dby;\n }\n else {\n bbox = node2.bbox;\n }\n // 可能Xom没有内容\n if(bbox) {\n bbox[0] -= sx1;\n bbox[1] -= sy1;\n bbox[2] -= sx1;\n bbox[3] -= sy1;\n let matrix = matrixHash[parentIndex];\n // 父级matrix初始化E为null,自身不为E时才运算,可以加速\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n tfo[0] += __sx1 - sx1 + dx;\n tfo[1] += __sy1 - sy1 + dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(pm) {\n matrix = multiply(pm, matrix);\n }\n bbox = 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);\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);\n texCache.refresh(gl, cx, cy);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n // 因为cacheTotal不总是以左上角原点为开始,所以必须每个节点重算matrix,合并box时计算的无法用到\n let matrixHash = {};\n // 先序遍历汇总到total\n for(let i = index + 1, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n let parentIndex = parentIndexHash[i];\n let matrix = matrixHash[parentIndex]; // 父节点的在每个节点计算后保存,第一个为top的默认为E(空)\n let opacity = opacityHash[i]; // opacity在合并box时已经计算可以直接用\n // 先看text,visibility会在内部判断,display会被parent判断\n if(node instanceof Text) {\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n texCache.addTexAndDrawWhenLimit(gl, __config[NODE_CACHE], opacity, matrix, cx, cy, dx, dy);\n }\n // 再看total缓存/cache,都没有的是无内容的Xom节点\n else {\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_IS_MASK]: isMask,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // mask和不可见不能被汇总到top上\n if(visibility === 'hidden' || isMask) {\n continue;\n }\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n if(__cache && __cache.available) {\n tfo[0] += __cache.sx1;\n tfo[1] += __cache.sy1;\n }\n else {\n tfo[0] += node.__sx1;\n tfo[1] += node.__sy1;\n }\n let dx = -sx1 + dbx;\n let dy = -sy1 + dby;\n tfo[0] += dx;\n tfo[1] += dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n if(target) {\n // 局部的mbm和主画布一样,先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成\n if(isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy);\n texCache.refresh(gl, cx, cy);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前fbo作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy);\n }\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n // 绘制到fbo的纹理对象上并删除fbo恢复\n texCache.refresh(gl, cx, cy);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 生成的纹理对象本身已绑定一个纹理单元了,释放lock的同时可以给texCache的channel缓存,避免重复上传\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bboxTotal);\n texCache.releaseLockChannel(n, mockCache.page);\n return [limitCache || totalLimitCache, mockCache];\n}\n\nfunction genFilterWebgl(gl, texCache, node, cache, filter, W, H) {\n let { sx1, sy1, width, height, bbox } = cache;\n let mockCache = cache;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n let res = genBlurWebgl(gl, texCache, mockCache, v, width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'hue-rotate') {\n let rotation = geom.d2r(v % 360);\n let cosR = Math.cos(rotation);\n let sinR = Math.sin(rotation);\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + cosR * 0.787 - sinR * 0.213, 0.715 - cosR * 0.715 - sinR * 0.715, 0.072 - cosR * 0.072 + sinR * 0.928, 0, 0,\n 0.213 - cosR * 0.213 + sinR * 0.143, 0.715 + cosR * 0.285 + sinR * 0.140, 0.072 - cosR * 0.072 - sinR * 0.283, 0, 0,\n 0.213 - cosR * 0.213 - sinR * 0.787, 0.715 - cosR * 0.715 + sinR * 0.715, 0.072 + cosR * 0.928 + sinR * 0.072, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'saturate' && v !== 100) {\n let amount = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + 0.787 * amount, 0.715 - 0.715 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 + 0.285 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 - 0.715 * amount, 0.072 + 0.928 * amount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'brightness' && v !== 100) {\n let b = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'grayscale' && v > 0) {\n let oneMinusAmount = 1 - v * 0.01;\n if(oneMinusAmount < 0) {\n oneMinusAmount = 0;\n }\n else if(oneMinusAmount > 1) {\n oneMinusAmount = 1;\n }\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.2126 + 0.7874 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 + 0.2848 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 + 0.9278 * oneMinusAmount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'contrast' && v !== 100) {\n let amount = v * 0.01;\n let o = -0.5 * amount;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n amount, 0, 0, 0, o,\n 0, amount, 0, 0, o,\n 0, 0, amount, 0, o,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n });\n // 切换回主程序\n gl.useProgram(gl.program);\n gl.viewport(0, 0, W, H);\n return mockCache;\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核d扩大3倍性能慢\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * 先动态生成gl程序,默认3核源码示例已注释,根据sigma获得d(一定奇数),再计算权重\n * 然后将d尺寸和权重拼接成真正程序并编译成program,再开始绘制\n */\nfunction genBlurWebgl(gl, texCache, cache, sigma, width, height, sx1, sy1, bbox) {\n let d = blur.kernelSize(sigma);\n let max = Math.max(15, gl.getParameter(gl.MAX_VARYING_VECTORS));\n while(d > max) {\n d -= 2;\n }\n let spread = blur.outerSizeByD(d);\n width += spread * 2;\n height += spread * 2;\n // 防止超限,webgl最大纹理尺寸限制\n let limit = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n if(width > limit || height > limit) {\n return;\n }\n bbox = bbox.slice(0);\n bbox[0] -= spread;\n bbox[1] -= spread;\n bbox[2] += spread;\n bbox[3] += spread;\n let cx = width * 0.5, cy = height * 0.5;\n let weights = blur.gaussianWeight(sigma, d);\n let vert = '';\n let frag = '';\n let r = Math.floor(d * 0.5);\n for(let i = 0; i < r; i++) {\n let c = (r - i) * 0.01;\n vert += `\\nv_texCoordsBlur[${i}] = a_texCoords + vec2(-${c}, -${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i}]) * ${weights[i]};`;\n }\n vert += `\\nv_texCoordsBlur[${r}] = a_texCoords;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${r}]) * ${weights[r]};`;\n for(let i = 0; i < r; i++) {\n let c = (i + 1) * 0.01;\n vert += `\\nv_texCoordsBlur[${i + r + 1}] = a_texCoords + vec2(${c}, ${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i + r + 1}]) * ${weights[i + r + 1]};`;\n }\n vert = vertexBlur.replace('[3]', '[' + d + ']').replace(/}$/, vert + '}');\n frag = fragmentBlur.replace('[3]', '[' + d + ']').replace(/}$/, frag + '}');\n let program = webgl.initShaders(gl, vert, frag);\n gl.useProgram(program);\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n texture = webgl.drawBlur(gl, program, frameBuffer, texCache, texture, cache.page.texture, i, j,\n width, height, cx, cy, spread, d, sigma);\n // 销毁这个临时program\n gl.deleteShader(program.vertexShader);\n gl.deleteShader(program.fragmentShader);\n gl.deleteProgram(program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n texCache.releaseLockChannel(j);\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox);\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genColorMatrixWebgl(gl, texCache, cache, m, width, height, sx1, sy1, bbox) {\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n gl.useProgram(gl.programCm);\n webgl.drawCm(gl, gl.programCm, j, m);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox.slice(0));\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genOverflowWebgl(gl, texCache, node, cache, W, H) {\n let sbox = node.bbox.slice(0);\n let bbox = cache.bbox;\n // 没超过无需生成\n if(bbox[0] >= sbox[0] && bbox[1] >= sbox[1] && bbox[2] <= sbox[2] && bbox[3] <= sbox[3]) {\n return;\n }\n let width = sbox[2] - sbox[0], height = sbox[3] - sbox[1];\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n // 绘制,根据坐标裁剪使用原本纹理的一部分\n gl.useProgram(gl.programOverflow);\n webgl.drawOverflow(gl, j, sbox[0] - bbox[0], sbox[1] - bbox[1], width, height, cache.width, cache.height);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let overflowCache = new MockCache(gl, texture, cache.sx1, cache.sy1, width, height, sbox);\n texCache.releaseLockChannel(i, overflowCache.page);\n return overflowCache;\n}\n\nfunction genMaskWebgl(gl, texCache, node, __config, cache, W, H, 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);console.log(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 // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n assignMatrix(m, matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n // node本身有或者父有perspective都认为需要生成3d渲染上下文\n if(tf.isPerspectiveMatrix(matrix) || parentPm) {\n if(hasRecordAsMask) {\n hasRecordAsMask[9] = true;\n }\n else {\n hasRecordAsMask = [i, lv, total, node, __config, null, null, null, null, true];\n }\n }\n // 先左乘perspective的矩阵,再左乘父级的总矩阵\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n 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 }\n else {\n mergeList.push([i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective]);\n }\n }\n }\n let limitHash = {};\n // 根据收集的需要合并局部根的索引,尝试合并,按照层级从大到小,索引从大到小的顺序,\n // 这样保证子节点在前,后节点在前,后节点是为了mask先应用自身如filter之后再进行遮罩\n if(mergeList.length) {\n mergeList.sort(function(a, b) {\n if(a[1] === b[1]) {\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n mergeList.forEach(item => {\n let [i, lv, total, node, __config, limitCache, hasMask, filter, overflow] = item;\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n } = __config;\n let needGen;\n // 可能没变化,比如被遮罩节点、filter变更等\n if(!__cacheTotal || !__cacheTotal.available) {\n let [limit, res] = genTotalWebgl(gl, texCache, node, __config, i, total || 0, __structs, __cache, limitCache, 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 target = genOverflowWebgl(gl, texCache, node, target, width, height);\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n if(filter.length) {\n if(!__cacheFilter || !__cacheFilter.available || needGen) {\n let old = target;\n target = genFilterWebgl(gl, texCache, node, target, filter, width, height);\n if(target !== old) {\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n }\n if(hasMask && (!__cacheMask || !__cacheMask.available || needGen)) {\n target = genMaskWebgl(gl, texCache, node, __config, target, width, height, 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 m = mx.m2Mat4(matrixEvent, cx, cy);\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 }\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[0] !== page || page.update) {\n // page可能为一个已有纹理,或者贴图\n if(page instanceof MockPage) {\n webgl.bindTexture(gl, page.texture, i);\n channels[i] = page;\n }\n else {\n // 可能老的先删除\n if(last) {\n gl.deleteTexture(last.texture);\n }\n page.texture = webgl.createTexture(gl, page.canvas, i);\n channels[i] = page;\n }\n hash[page.uuid] = i;\n }\n else {\n hash[page.uuid] = i;\n }\n // 标识没有更新,以及最后使用时间\n page.update = false;\n page.time = inject.now();\n }\n // 再次遍历开始本次渲染并清空\n webgl.drawTextureCache(gl, list, hash, cx, cy, revertY);\n pages.splice(0);\n list.splice(0);\n }\n }\n\n findExistTexChannel(page) {\n return this.channels.indexOf(page);\n }\n\n /**\n * 获取并锁定一个纹理单元优先使用空的,其次最久未使用的\n * @returns {number|*}\n */\n lockOneChannel() {\n // 优先返回空单元\n let channels = this.channels;\n let locks = this.locks;\n for(let i = 0; i < this.__units; i++) {\n if(!channels[i] && !locks[i]) {\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n }\n // 根据NRU返回最久未使用的\n let units = this.__units;\n let cl = [];\n for(let i = 0; i < units; i++) {\n if(!locks[i]) {\n cl.push([i, channels[i]]);\n }\n }\n if(cl.length) {\n cl.sort(function(a, b) {\n if(a[1].time !== b[1].time) {\n return (a[1].time || 0) - (b[1].time || 0);\n }\n if(a[1].fullSize !== b[1].fullSize) {\n return a[1].fullSize - b[1].fullSize;\n }\n return a[0] - b[0];\n });\n let i = cl[0][0];\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n throw new Error('No free texture unit');\n }\n\n /**\n * 释放掉i单元,并且设置内容到缓存channel中\n * @param i\n * @param setToChannel\n */\n releaseLockChannel(i, setToChannel) {\n if(this.locks[i]) {\n this.locks[i] = false;\n this.__lockUnits--;\n if(setToChannel) {\n this.channels[i] = setToChannel;\n }\n }\n }\n\n // 指定锁定一个单元\n lockChannel(i) {\n let channels = this.channels;\n let locks = this.locks;\n if(!locks[i]) {\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n }\n }\n\n /**\n * 释放纹理单元\n * @param gl\n */\n release(gl) {\n this.channels.forEach(item => {\n if(item) {\n gl.deleteTexture(item.texture);\n }\n });\n }\n\n get channels() {\n return this.__channels;\n }\n\n get locks() {\n return this.__locks;\n }\n\n 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 // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d');\n this.__renderMode = mode.CANVAS;\n }\n else if(this.tagName === 'svg') {\n this.__renderMode = mode.SVG;\n }\n else if(this.tagName === 'webgl') {\n let gl = this.__ctx = this.__dom.getContext('webgl', ca);\n this.__renderMode = mode.WEBGL;\n gl.program = webgl.initShaders(gl, vertex, fragment);\n gl.programMask = webgl.initShaders(gl, vertexMask, fragmentMask);\n gl.programClip = webgl.initShaders(gl, vertexMask, fragmentClip);\n gl.programOverflow = webgl.initShaders(gl, vertexMask, fragmentOverflow);\n gl.programCm = webgl.initShaders(gl, vertexCm, fragmentCm);\n gl.useProgram(gl.program);\n // 第一次渲染生成纹理缓存管理对象,收集渲染过程中生成的纹理并在gl纹理单元满了时进行绘制和清空,减少texImage2d耗时问题\n const MAX_TEXTURE_IMAGE_UNITS = Math.min(16, gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));\n this.__texCache = new TexCache(MAX_TEXTURE_IMAGE_UNITS);\n }\n this.refresh(null, true);\n // 第一次节点没有__root,渲染一次就有了才能diff\n if(this.dom.__root && this.dom.__root instanceof Root) {\n this.dom.__root.destroy();\n }\n this.__eventCbList = initEvent(this.dom, Root);\n this.dom.__root = this;\n }\n\n refresh(cb, isFirst) {\n this.__hookTask = null;\n let { isDestroyed, renderMode, ctx, defs, width, height } = this;\n if(isDestroyed) {\n return;\n }\n defs.clear();\n // 首次递归测量整树的继承,后续更改各自更新机制做,防止每次整树遍历;root检查首次直接做,后续在checkUpdate()中插入\n if(isFirst) {\n this.__checkRoot(renderMode, width, height);\n this.__computeMeasure(renderMode, ctx);\n }\n // 非首次刷新如果没有更新则无需继续\n else if(!this.__checkUpdate(renderMode, ctx, width, height)) {\n return;\n }\n // 获取所有字体和大小测量,仅svg需要,canvas直接做\n inject.measureText();\n this.__checkReflow(width, height);\n if(renderMode === mode.CANVAS && !this.props.noRender) {\n this.__clear(ctx, renderMode);\n 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 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 let hasUpdate;\n // root更新特殊提前,因为有继承因素\n if(updateRoot) {\n root.__updateRoot = null;\n hasUpdate = parseUpdate(renderMode, root, updateRoot,\n reflowList, measureList, cacheHash, cacheList);\n // 此时做root检查,防止root出现继承等无效样式,或者发生resize()\n if(hasUpdate) {\n root.__checkRoot(renderMode, width, height);\n }\n }\n // 汇总处理每个节点,k是递增数字直接循环遍历\n let keys = Object.keys(updateHash);\n for(let i = 0, len = keys.length; i < len; i++) {\n let t = parseUpdate(renderMode, root, updateHash[keys[i]],\n reflowList, measureList, cacheHash, cacheList, zHash, zList);\n hasUpdate = hasUpdate || t;\n }\n // 先做一部分reset避免下面measureList干扰,cacheList的是专门收集新增的额外节点\n root.__reflowList = reflowList;\n uniqueUpdateId = 0;\n root.__updateHash = root.__config[NODE_UPDATE_HASH] = {};\n cacheList.forEach(__config => {\n delete __config[NODE_UNIQUE_UPDATE_ID];\n });\n // zIndex改变的汇总修改,防止重复操作\n zList.forEach(item => {\n if(item.hasOwnProperty('__uniqueZId')) {\n delete item.__uniqueZId;\n item.__updateStruct(root.__structs);\n }\n });\n /**\n * 遍历每项节点,计算测量信息,节点向上向下查找继承信息,如果parent也是继承,先计算parent的\n * 过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n */\n let measureHash = {};\n measureList.forEach(node => {\n let { __config:{ [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId, [NODE_DOM_PARENT]: parent } } = node;\n // 在root下的component变更时root会进入,但其没有__uniqueUpdateId\n if(node !== root) {\n if(measureHash.hasOwnProperty(__uniqueUpdateId)) {\n return;\n }\n measureHash[__uniqueUpdateId] = true;\n }\n let last = node;\n // 检查measure的属性是否是inherit,在root下的component变更时root会进入,但其没有__uniqueUpdateId\n // 另外dom标识表明有dom变更强制进入\n let isInherit = node !== root\n && (updateHash[__uniqueUpdateId][UPDATE_ADD_DOM]\n || change.isMeasureInherit(updateHash[__uniqueUpdateId][UPDATE_STYLE]));\n // 是inherit,需要向上查找,从顶部向下递归计算继承信息\n if(isInherit) {\n while(parent && parent !== root) {\n let { __config: {\n [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId,\n }, currentStyle } = parent;\n let isInherit;\n if(parent.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n let style = updateHash[__uniqueUpdateId][UPDATE_STYLE];\n measureHash[__uniqueUpdateId] = true;\n let temp = change.measureInheritList(style);\n isInherit = !!temp.length;\n }\n else {\n isInherit = change.isMeasureInherit(currentStyle);\n }\n // 如果parent有inherit存入列表且继续向上,否则跳出循环\n if(isInherit) {\n last = parent;\n }\n else {\n break;\n }\n // 考虑component下的继续往上继承\n parent = parent.domParent;\n }\n }\n // 自顶向下查找inherit的,利用已有的方法+回调,当递归包含重复时标记防止重复\n last.__computeMeasure(renderMode, ctx, function(target) {\n if(target.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n measureHash[target.__config[NODE_UNIQUE_UPDATE_ID]] = true;\n }\n });\n });\n // 做完清空留待下次刷新重来\n for(let i = 0, len = keys.length; i < len; i++) {\n delete updateHash[keys[i]][UPDATE_CONFIG][NODE_UNIQUE_UPDATE_ID];\n }\n return hasUpdate;\n }\n\n /**\n * 除首次外每次刷新前检查reflow列表,计算需要reflow的节点局部重新布局\n * 当一个元素absolute不变时,其变化不会影响父元素和兄弟元素,直接自己重新局部LAYOUT包含子节点\n * 当absolute发生改变时,其变化会影响父和兄弟,视作父重新布局\n * 当inline变化时,视为其最近block/flex父变化\n * 当block变化时,往上查找最上层flex视为其变化,如不是则影响后面兄弟offset和父resize\n * 当flex变化时,往上查找最上层flex视为其变化,如不是则影响所有递归子节点layout和父resize\n * 以上3种情况向上查找时遇到absolute父均提前跳出,并标记absolute父LAYOUT\n * 上面所有情况即便结束还得额外看是否处于absolute中,是还是标记absolute重新布局\n * 当relative只变化left/top/right/bottom时,自己重新layout\n * 检测节点时记录影响的所有节点,最终形成一棵或n棵局部树\n * 需要重新布局的记作LAYOUT,被兄弟影响只需偏移的记作OFFSET,OFFSET可能会重复变为LAYOUT\n * 上述情况倘若发生包含重复,去掉子树,因子树视为被包含的重新布局\n * 如果有从root开始的,直接重新布局像首次那样即可\n * 如果非root,所有树根按先根顺序记录下来,依次执行局部布局\n * =========================\n * addDom比较特殊,是向已有节点中添加新的节点,检查影响与普通domDiff变化不同\n * @private\n */\n __checkReflow(width, height) {\n let { __reflowList: reflowList } = this;\n if(!reflowList.length) {\n return;\n }\n let root = this;\n let uniqueList = [];\n let hasRoot;\n __uniqueReflowId = 0;\n let reflowHash = {};\n // 遍历检查发生布局改变的节点列表,此时computedStyle还是老的,currentStyle是新的\n for(let i = 0, len = reflowList.length; i < len; i++) {\n let item = reflowList[i];\n let { node, component, addDom, removeDom } = item;\n // root提前跳出,完全重新布局\n if(node === this) {\n hasRoot = true;\n break;\n }\n // 添加时如果是cp则node取sr来布局\n if(addDom && node instanceof Component) {\n node = node.shadowRoot;\n }\n // 每个节点生成唯一的布局识别id存入hash防止重复\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n reflowHash[__uniqueReflowId++] = item;\n }\n // 每个节点都向上检查影响,以及是否从root开始完全重新,remove特殊对待,影响父节点视为普通父节点relay\n if(checkInfluence(root, reflowHash, node, component, addDom)) {\n hasRoot = true;\n if(addDom) {\n this.__zIndexChildren = null;\n }\n break;\n }\n // remove的要特殊对待,因为提前删除了父子兄弟关系,下面deepScan不会出现\n else if(removeDom) {\n uniqueList.push(item);\n }\n }\n __uniqueReflowId = 0;\n this.__reflowList = [];\n // 有root提前跳出\n if(hasRoot) {\n reflow.clearUniqueReflowId(reflowHash);\n // 布局分为两步,普通流和定位流,互相递归\n this.__layout({\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n // 绝对布局需要从根开始保存相对坐标系的容器引用,并根据relative/absolute情况变更\n this.__layoutAbs(this, {\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n this.__structs = this.__structure(0, 0);\n return true;\n }\n /**\n * 修剪树,自顶向下深度遍历\n * LAYOUT节点作为局部根,其递归子节点无需重复任何操作,直接去重\n * OFFSET节点作为局部根,其递归子节点先执行任何操作,后续根节点再偏移一次\n */\n else {\n this.__deepScan(function(node, options) {\n if(node.hasOwnProperty('__uniqueReflowId')) {\n let o = reflowHash[node.__uniqueReflowId];\n options.uniqueList.push(o);\n // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行\n return true;\n }\n // reflowHash没有记录则无返回继续递归执行\n }, { uniqueList });\n /**\n * 按顺序执行列表即可,上层LAYOUT先执行且停止递归子节点,上层OFFSET后执行等子节点先LAYOUT/OFFSET\n * 同级按先后顺序排列,过程中记录diff在结束后进行structs更新\n * 这里要注意margin合并的逻辑,因为最终都是block(flex等同),需要进行合并\n * 在处理一个block时,先判断是否是空block,同时看后面紧邻的有没有在uniqueList的下一个\n * 单独空block处理、2个相邻的非block处理直接可以进行判断\n * 中间的空block(即非空block的下一个是空block,且下一个不是最后一个),先记录下来list,合并后一并offset\n * 合并margin和Dom的逻辑一样,抽离共有方法\n **/\n let diffList = [];\n let diffI = 0;\n let mergeOffsetList = [];\n let __uniqueMergeOffsetId = 0;\n uniqueList.forEach(item => {\n let { node, component, addDom, removeDom } = item;\n // 重新layout的w/h数据使用之前parent暂存的,x使用parent,y使用prev或者parent的\n let cps = node.computedStyle, cts = node.currentStyle;\n let zIndex = cps[Z_INDEX], position = cps[POSITION], display = cps[DISPLAY];\n let isLastAbs = position === 'absolute';\n let isNowAbs = cts[POSITION] === 'absolute';\n let isLastNone = display === 'none';\n let isNowNone = cts[DISPLAY] === 'none';\n // none不可见布局无效可以无视\n if(isLastNone && isNowNone) {\n return;\n }\n let parent = node.domParent;\n let { __layoutData: { x, y, h }, width, computedStyle } = parent;\n let current = node;\n // cp的shadowRoot要向上到cp本身,考虑高阶组件在内到真正的顶层cp\n if(current.isShadowRoot) {\n current = current.hostRoot;\n }\n // y使用prev或者parent的,首个节点无prev,prev要忽略absolute的和display:none的\n let ref = current.prev;\n let hasFlowPrev;\n while(ref) {\n if(ref instanceof Text\n || (ref.computedStyle[POSITION] !== 'absolute' && ref.computedStyle[DISPLAY] !== 'none')) {\n y = ref.y + ref.outerHeight;\n hasFlowPrev = true;\n break;\n }\n ref = ref.prev;\n }\n // 找不到prev以parent为基准,找到则增加自身,排除remove\n if(!removeDom) {\n if(!hasFlowPrev) {\n y += computedStyle[MARGIN_TOP] + computedStyle[BORDER_TOP_WIDTH] + computedStyle[PADDING_TOP];\n }\n x += computedStyle[MARGIN_LEFT] + computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT];\n }\n // 找到最上层容器,如果是组件的子节点,以sr为container,sr本身往上找\n let container = node;\n // remove的节点本身无需再次布局\n if(!removeDom) {\n if(isNowAbs) {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n if(!container) {\n container = root;\n }\n // 由setState引发的要检查是cp自身还是更上层,如果cp被abs包含,那么node是cp的父亲,否则node是cp的sr\n // 而这种情况下传cp或node都一样,所以最终统一传node\n parent.__layoutAbs(container, null, node);\n // 优先判断dom变更\n if(addDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n return;\n }\n // 前后都是abs无需偏移后面兄弟和parent调整,component变化节点需更新struct\n else if(isLastAbs) {\n if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n }\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n return;\n }\n // 标识flow变abs,可能引发zIndex变更,重设struct和svg\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // 现在是普通流,不管之前是啥直接布局,排除remove删除的\n else {\n node.__layout({\n x,\n y,\n w: width,\n h,\n });\n y += node.outerHeight;\n if(component) {\n container = node;\n }\n else {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n }\n if(!container) {\n container = root;\n }\n // 防止geom\n if(node instanceof Dom) {\n node.__layoutAbs(container, {\n x,\n y,\n w: width,\n h,\n });\n }\n }\n }\n\n // 向上查找最近的parent是relative,需再次累加ox/oy,无需继续向上递归,因为parent已经递归包含了\n // 这样node重新布局后再次设置其使用parent的偏移\n let p = node;\n while(p && p !== root) {\n p = p.domParent;\n computedStyle = p.computedStyle;\n if(computedStyle[POSITION] === 'relative') {\n let { ox, oy } = p;\n ox && node.__offsetX(ox);\n oy && node.__offsetY(oy);\n break;\n }\n }\n\n // 向下调整next的flow位置,遇到重复LAYOUT的跳出等待其调用并处理其next,忽视掉abs,margin和abs在merge中做\n if(node.isShadowRoot) {\n node = node.hostRoot;\n }\n let next = node.next;\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n if(next.computedStyle[POSITION] === 'absolute') {\n next = next.next;\n continue;\n }\n let { y: oy } = next;\n let diff = y - oy;\n if(diff) {\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n let target = next;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let cs = target.computedStyle;\n if(cs[POSITION] !== 'absolute' && cs[DISPLAY] !== 'none') {\n target.__offsetY(diff, true, REPAINT);\n }\n next = next.next;\n }\n }\n break;\n }\n\n // 去重防止abs并记录parent,整个结束后按先序顺序进行margin合并以及偏移,注意忽略有display:none变block同时为absolute的\n if(!parent.hasOwnProperty('__uniqueMergeOffsetId') && !(isNowAbs && isLastNone)) {\n parent.__uniqueMergeOffsetId = __uniqueMergeOffsetId++;\n mergeOffsetList.push(parent);\n }\n\n // add和remove都需父节点重新生成struct,zIndexChildren已在对应api操作的before()侦听做了\n if(addDom || removeDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // component未知dom变化,所以强制重新struct,text则为其父节点,同时防止zIndex变更影响父节点\n else if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n node.domParent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(node.domParent);\n }\n }\n }\n // display有none变化,重置struct和zIndexChildren\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n });\n /**\n * mergeMargin后续调整,记录的是变更节点的父节点,因此每个节点内部直接遍历孩子进行\n * 由于保持先根遍历的顺序,因此会从最上最里的节点开始,先进行margin合并\n * 由于之前忽略掉abs节点,因此再检查直接abs是否要调整\n * 完成后对此父节点的后续兄弟节点进行调整,多次不会干扰影响\n * 然后继续往上循环,直到root结束\n */\n let inDirectAbsList = [];\n mergeOffsetList.forEach(parent => {\n delete parent.__uniqueMergeOffsetId;\n let flowChildren = parent.flowChildren, absChildren = parent.absChildren;\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length, lastChild;\n let isStart, startIndex, startNode;\n // 遍历flow孩子,从开始变化的节点开始,看变化造成的影响,对其后面节点进行偏移,并统计总偏移量\n for(let i = 0; i < length; i++) {\n let item = flowChildren[i];\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n let isXom = item instanceof Xom;\n // 忽略掉前面没有变更的节点,不能合并\n if(!isStart && isXom) {\n if(item.hasOwnProperty('__uniqueReflowId')) {\n isStart = true;\n startIndex = i;\n startNode = item;\n }\n }\n // 开始变更的节点,至少不是第0个\n let cs = isXom && item.currentStyle;\n let isInline = isXom && cs[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(cs[DISPLAY]) > -1;\n lastChild = item;\n // 每次循环开始前,这次不是block的话,看之前遗留的,可能是以空block结束,需要特殊处理,单独一个空block也包含\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length && isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n // 和普通布局类似,只是不用重新布局只需处理合并margin再根据差值偏移\n if(isXom && !isInline) {\n let isNone = isXom && cs[DISPLAY] === 'none';\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n // 空block要留下轮循环看,除非是最后一个,非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n if(isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n // 需要合并的情况,根据记录数和索引向上向下遍历节点设置偏移,同时设置总偏移量供父级使用\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0,最后一个一定有不必判断isStart\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n }\n // 先检查parent的尺寸是否发生了变化,从而决定是否调整next以及向上递归调整\n let cs = parent.currentStyle;\n let height = cs[HEIGHT];\n let isContainer = parent === root || parent.isShadowRoot || cs[POSITION] === 'absolute' || cs[POSITION] === 'relative';\n if(height[1] === AUTO && lastChild) {\n let oldH = parent.height + parent.computedStyle[PADDING_TOP];\n let nowH = lastChild.y + lastChild.outerHeight - parent.y;\n let diff = nowH - oldH;\n // 调整next以及非固定PX的abs,再递归向上\n if(diff) {\n parent.__resizeY(diff, REPAINT);\n let container;\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = item.currentStyle;\n // 是容器,所有的都调整,不是容器,其偏移是上级parent的某一个,根据情况具体不同\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n else if(bottom[1] === PX) {\n item.__offsetY(diff, true, REPAINT);\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n else if(top[1] === PERCENT) {\n if(isContainer) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n // 非容器的特殊处理\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n if(container.currentStyle[HEIGHT][1] !== PX) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, null, item);\n }\n // 不在容器内说明在上级,存入等结束后统一重新布局\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, item]);\n }\n }\n }\n reflow.offsetAndResizeByNodeOnY(parent, root, reflowHash, diff, inDirectAbsList);\n return;\n }\n }\n // 没有diff变化或者固定尺寸,可能内部发生变化,调整AUTO的abs,不递归向上\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom } = item.currentStyle;\n if(top[1] === AUTO && bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n }\n });\n // merge过程中需要重新布局的abs\n inDirectAbsList.forEach(arr => {\n arr[0].__layoutAbs(arr[1], null, arr[2]);\n });\n\n // 调整因reflow造成的原struct数据索引数量偏差,纯zIndex的已经在repaint里面重新生成过了\n // 这里因为和update保持一致的顺序,因此一定是先根顺序且互不包含\n let diff = 0, lastIndex = 0, isFirst = true, structs = root.__structs;\n diffList.forEach(item => {\n let [ns, d] = item;\n // 第一个有变化的,及后面无论有无变化都需更新\n // 第1个变化区域无需更改前面一段\n if(isFirst) {\n isFirst = false;\n lastIndex = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1;\n diff += d;\n }\n // 第2+个变化区域看是否和前面一个相连,有不变的段则先偏移它,然后再偏移自己\n else {\n let j = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1 + diff;\n for(let i = lastIndex; i < j; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n lastIndex = j;\n diff += d;\n }\n });\n // 后面的要根据偏移量校正索引\n if(diff) {\n for(let i = lastIndex, len = structs.length; i < len; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n }\n // 清除id\n reflow.clearUniqueReflowId(reflowHash);\n }\n }\n\n // 特殊覆盖方法,不需要super()计算自己,因为放在每次checkRoot()做过了\n __computeMeasure(renderMode, ctx) {\n css.computeMeasure(this, true);\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx);\n });\n }\n\n // 每个root拥有一个刷新hook,多个root塞到frame的__hookTask里\n // frame在所有的帧刷新逻辑执行后检查hook列表,进行root刷新操作\n __frameHook() {\n if(!this.__hookTask) {\n let r = this.__hookTask = (() => {\n this.refresh();\n });\n frame.__hookTask.push(r);\n }\n }\n\n __clear(ctx, renderMode) {\n if(renderMode === mode.CANVAS) {\n // 可能会调整宽高,所以每次清除用最大值\n this.__mw = Math.max(this.__mw, this.width);\n this.__mh = Math.max(this.__mh, this.height);\n // 清除前得恢复默认matrix,防止每次布局改变了属性\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, this.__mw, this.__mh);\n }\n else if(renderMode === mode.WEBGL) {\n ctx.clearColor(0, 0, 0, 0);\n ctx.clear(ctx.COLOR_BUFFER_BIT);\n }\n }\n\n get dom() {\n return this.__dom;\n }\n\n get uuid() {\n return this.__uuid;\n }\n\n get renderMode() {\n return this.__renderMode;\n }\n\n get ctx() {\n return this.__ctx;\n }\n\n get defs() {\n return this.__defs;\n }\n\n get taskUp() {\n return this.__taskUp;\n }\n\n get taskCp() {\n return this.__taskCp;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get animateController() {\n return this.__animateController;\n }\n\n get texCache() {\n return this.__texCache;\n }\n}\n\nexport default Root;\n","import Geom from './Geom';\nimport mode from '../mode';\nimport painter from '../../util/painter';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction reBuild(target, origin, base, isMulti) {\n if(isMulti) {\n return target.map(item => origin + item * base);\n }\n else {\n return origin + target * base;\n }\n}\n\nfunction reBuildC(target, originX, originY, width, height, isMulti) {\n if(isMulti) {\n if(target) {\n return target.map(item => reBuildC(item, originX, originY, width, height));\n }\n }\n else {\n if(target && target.length >= 2) {\n return [\n originX + target[0] * width,\n originY + target[1] * height,\n ];\n }\n }\n return [];\n}\n\nfunction curveNum(controlA, controlB) {\n let num = 0;\n if(controlA.length >= 2) {\n num++;\n }\n if(controlB.length >= 2) {\n num += 2;\n }\n return num;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getNewPoint(x1, y1, x2, y2, controlA, controlB, num, start = 0, end = 1) {\n if(start > 0 || end < 1) {\n if(num === 3) {\n [[x1, y1], controlA, controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, controlB, [x2, y2]], start, end);\n }\n else if(num === 2) {\n [[x1, y1], controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlB, [x2, y2]], start, end);\n }\n else if(num === 1) {\n [[x1, y1], controlA, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, [x2, y2]], start, end);\n }\n else {\n let a = Math.abs(x1 - x2);\n let b = Math.abs(y1 - y2);\n x1 += a * start;\n y1 += b * start;\n x2 -= a * (1 - end);\n y2 -= b * (1 - end);\n }\n }\n return [x1, y1, x2, y2, controlA, controlB];\n}\n\nclass Line extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // x1,y1和x2,y2表明线段的首尾坐标,control表明控制点坐标\n if(this.isMulti) {\n this.__x1 = [0];\n this.__y1 = [0];\n this.__x2 = [1];\n this.__y2 = [1];\n this.__controlA = [[]];\n this.__controlB = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.x1)) {\n this.__x1 = props.x1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x1)) {\n this.__x1 = [parseFloat(props.x1) || 0];\n }\n if(Array.isArray(props.y1)) {\n this.__y1 = props.y1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y1)) {\n this.__y1 = [parseFloat(props.y1) || 0];\n }\n if(Array.isArray(props.x2)) {\n this.__x2 = props.x2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x2)) {\n this.__x2 = [parseFloat(props.x2) || 0];\n }\n if(Array.isArray(props.y2)) {\n this.__y2 = props.y2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y2)) {\n this.__y2 = [parseFloat(props.y2) || 0];\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__x1.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__x1.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__x1.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__x1.map(() => v);\n }\n }\n else {\n this.__x1 = this.__y1 = this.__start = 0;\n this.__x2 = this.__y2 = this.__end = 1;\n this.__controlA = [];\n this.__controlB = [];\n if(!isNil(props.x1)) {\n this.__x1 = parseFloat(props.x1) || 0;\n }\n if(!isNil(props.y1)) {\n this.__y1 = parseFloat(props.y1) || 0;\n }\n if(!isNil(props.x2)) {\n this.__x2 = parseFloat(props.x2) || 0;\n }\n if(!isNil(props.y2)) {\n this.__y2 = parseFloat(props.y2) || 0;\n }\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA;\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB;\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, __cacheProps, isMulti } = this;\n let rebuild;\n ['x1', 'x2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originX, width, isMulti);\n }\n });\n ['y1', 'y2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originY, height, isMulti);\n }\n });\n ['controlA', 'controlB'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuildC(this[k], originX, originY, width, height, isMulti);\n }\n });\n ['start', 'end'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = this[k];\n }\n });\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 },\n } = this;\n this.buildCache(originX, originY);\n let { x1, y1, x2, y2, controlA, controlB } = __cacheProps;\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n if(!isMulti) {\n x1 = [x1];\n x2 = [x2];\n y1 = [y1];\n y2 = [y2];\n controlA = [controlA];\n controlB = [controlB];\n }\n x1.forEach((xa, i) => {\n let ya = y1[i];\n let xb = x2[i];\n let yb = y2[i];\n let ca = controlA[i];\n let cb = controlB[i];\n if((isNil(ca) || ca.length < 2) && (isNil(cb) || cb.length < 2)) {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[0] = Math.min(bbox[0], xb - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[1] = Math.min(bbox[1], yb - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[2] = Math.max(bbox[2], xb + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n bbox[3] = Math.max(bbox[3], yb + oy);\n }\n else if(isNil(ca) || ca.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(isNil(cb) || cb.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n });\n return bbox;\n }\n}\n\nexport default Line;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction concatPointAndControl(point, control) {\n if(Array.isArray(control) && (control.length === 2 || control.length === 4)\n && Array.isArray(point) && point.length === 2) {\n return control.concat(point);\n }\n return point;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getLength(list, isMulti) {\n let res = [];\n let total = 0;\n let increase = [];\n if(isMulti) {\n total = [];\n list.forEach(list => {\n let temp = getLength(list);\n res.push(temp.list);\n total.push(temp.total);\n increase.push([0].concat(temp.increase));\n });\n }\n else if(Array.isArray(list)) {\n total = 0;\n increase.push(0);\n let start = 0;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item)) {\n start = i;\n break;\n }\n }\n let prev = list[start];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n let a = Math.abs(item[0] - prev[0]);\n let b = Math.abs(item[1] - prev[1]);\n let c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n res.push(c);\n total += c;\n increase.push(total);\n prev = item;\n }\n else if(item.length === 4) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]]], 2);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[2], item[3]];\n }\n else if(item.length === 6) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]], [item[4], item[5]]], 3);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[4], item[5]];\n }\n }\n }\n return {\n list: res,\n total,\n increase,\n };\n}\n\nfunction getIndex(list, t, i, j) {\n if(i === j) {\n if(list[i] > t) {\n return i - 1;\n }\n return i;\n }\n let middle = i + ((j - i) >> 1);\n if(list[middle] === t) {\n return middle;\n }\n else if(list[middle] > t) {\n return getIndex(list, t, i, Math.max(middle - 1, i));\n }\n else {\n return getIndex(list, t, Math.min(middle + 1, j), j);\n }\n}\n\nfunction getNewList(list, len, start = 0, end = 1) {\n if(start === 0 && end === 1) {\n return list;\n }\n if(start >= end) {\n return [];\n }\n let i = 0, j = list.length - 1;\n if(start > 0) {\n i = getIndex(len.increase, start * len.total, i, j);\n }\n if(end < 1) {\n j = getIndex(len.increase, end * len.total, i, j);\n }\n list = util.clone(list);\n end *= len.total;\n let prePercent = 1;\n if(end > len.increase[j]) {\n let prev = list[j].slice(list[j].length - 2); // 最后2个点是x,y,前面是control\n let current = list[j + 1];\n let l = len.list[j];\n let diff = end - len.increase[j];\n let t = diff / l;\n prePercent = t;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[j + 1] = [current[1] - (1 - t) * a, current[1] - (1 - t) * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], res[3][0], res[3][1]];\n }\n }\n start *= len.total;\n if(start > len.increase[i]) {\n let prev = list[i].slice(list[i].length - 2);\n let current = list[i + 1];\n let l = len.list[i];\n // 同一条线段时如果有end裁剪,会影响start长度\n if(i === j && prePercent !== 1) {\n l *= prePercent;\n }\n let diff = start - len.increase[i];\n let t = diff / l;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[i] = [prev[0] + t * a, prev[1] + t * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([[current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([[current[4], current[5]], [current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], current[4], current[5]];\n }\n }\n if(j < list.length - 2) {\n list = list.slice(0, j + 2);\n }\n if(i > 0) {\n list = list.slice(i);\n }\n return list;\n}\n\nclass Polyline extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 所有点的列表\n if(this.isMulti) {\n this.__points = [[]];\n this.__controls = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__points.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__points.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__points.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__points.map(() => v);\n }\n }\n else {\n this.__points = [];\n // 控制点\n this.__controls = [];\n this.__start = 0;\n this.__end = 1;\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n }\n if(Array.isArray(props.controls)) {\n this.__controls = props.controls;\n }\n if(Array.isArray(props.points)) {\n this.__points = props.points;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n return points.map((item, i) => {\n if(!Array.isArray(item)) {\n return;\n }\n let len = item.length;\n if(isControl) {\n if(len !== 0 && len !== 2 && len !== 4) {\n return;\n }\n }\n else {\n if(len !== 0 && len !== 2) {\n return;\n }\n }\n let res = [];\n for(let i = 0; i < len; i++) {\n if(i % 2 === 0) {\n res.push(originX + item[i] * width);\n }\n else {\n res.push(originY + item[i] * height);\n }\n }\n return res;\n });\n }\n\n // 供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 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 },\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let { points, controls } = __cacheProps;\n if(!isMulti) {\n points = [points];\n controls = [controls];\n }\n points.forEach((pointList, i) => {\n if(!pointList || pointList.length < 2 || pointList[0].length < 2 || pointList[1].length < 2) {\n return;\n }\n let controlList = controls[i] || [];\n let [xa, ya] = pointList[0];\n for(let i = 1, len = pointList.length; i < len; i++) {\n let [xb, yb] = pointList[i];\n let c = controlList[i - 1];\n if(c && c.length === 4) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], c[2], c[3], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(c && c.length === 2) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n }\n xa = xb;\n ya = yb;\n }\n });\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Polyline;\n","import Polyline from './Polyline';\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} } = enums;\nconst { isNil } = util;\nconst { sectorPoints } = geom;\nconst { REM, VW, VH } = unit;\n\nfunction getR(v, dft) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = dft;\n }\n return v;\n}\n\nclass Sector extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 角度\n if(this.isMulti) {\n this.__begin = [0];\n this.__end = [0];\n this.__r = [1];\n if(Array.isArray(props.begin)) {\n this.__begin = props.begin.map(i => getR(i, 0));\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => getR(i, 0));\n }\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i, 1));\n }\n if(Array.isArray(props.edge)) {\n this.__edge = props.edge.map(i => !!i);\n }\n if(Array.isArray(props.closure)) {\n this.__closure = props.closure.map(i => !!i);\n }\n }\n else {\n this.__begin = this.__end = 0;\n // 半径[0, ∞),默认1\n this.__r = 1;\n // 扇形两侧是否有边\n this.__edge = false;\n // 扇形大于180°时,是否闭合两端\n this.__closure = false;\n if(!isNil(props.begin)) {\n this.__begin = getR(props.begin, 0);\n }\n if(!isNil(props.end)) {\n this.__end = getR(props.end, 0);\n }\n if(!isNil(props.r)) {\n this.__r = getR(props.r, 1);\n }\n if(!isNil(props.edge)) {\n this.__edge = !!props.edge;\n }\n if(!isNil(props.closure)) {\n this.__closure = !!props.closure;\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, begin, end, r, edge, closure, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.begin) || focus) {\n rebuild = true;\n __cacheProps.begin = (begin || 0) % 360;\n }\n if(isNil(__cacheProps.end) || focus) {\n rebuild = true;\n __cacheProps.end = (end || 0) % 360;\n }\n if(isNil(__cacheProps.r) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.r = r.map(r => r * width * 0.5);\n }\n else {\n __cacheProps.r = r * width * 0.5;\n }\n }\n r = __cacheProps.r;\n if(isNil(__cacheProps.edge) || focus) {\n rebuild = true;\n __cacheProps.edge = edge;\n }\n if(isNil(__cacheProps.closure) || focus) {\n rebuild = true;\n __cacheProps.closure = closure;\n }\n if(rebuild) {\n if(isMulti) {\n __cacheProps.list = [];\n __cacheProps.sList = [];\n begin.forEach((begin, i) => {\n let r2 = isNil(r[i]) ? width * 0.5 : r[i];\n let list = sectorPoints(cx, cy, r2, parseFloat(begin || 0) % 360, parseFloat(end[i] || 0) % 360);\n let sList = list.slice(0);\n if(closure[i]) {\n list.push(list[0].slice(0));\n if(edge) {\n sList.push(sList[0].slice(0));\n }\n }\n else {\n list.unshift([cx, cy]);\n list.push([cx, cy]);\n if(edge) {\n sList.unshift([cx, cy]);\n sList.push([cx, cy]);\n }\n }\n __cacheProps.list.push(list);\n __cacheProps.sList.push(sList);\n });\n }\n else {\n let list = sectorPoints(cx, cy, r, parseFloat(begin || 0), parseFloat(end || 0));\n let sList = list.slice(0);\n if(closure) {\n list.push(list[0].slice(0));\n if(edge) {\n sList.push(sList[0].slice(0));\n }\n }\n else {\n list.unshift([cx, cy]);\n list.push([cx, cy]);\n if(edge) {\n sList.unshift([cx, cy]);\n sList.push([cx, cy]);\n }\n }\n __cacheProps.list = list;\n __cacheProps.sList = sList;\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Sector;\n","import Geom from './Geom';\nimport util from \"../../util/util\";\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction genVertex(x, y, width, height, rx = 0, ry = 0) {\n if(rx === 0 || ry === 0) {\n return [\n [x, y],\n [x + width, y],\n [x + width, y + height],\n [x, y + height],\n [x, y],\n ];\n }\n let ox = rx * geom.H;\n let oy = ry * geom.H;\n return [\n [x + rx, y],\n [x + width - rx, y],\n [x + width + ox - rx, y, x + width, y + ry - oy, x + width, y + ry],\n [x + width, y + height - ry],\n [x + width, y + height + oy - ry, x + width + ox - rx, y + height, x + width - rx, y + height],\n [x + rx, y + height],\n [x + rx - ox, y + height, x, y + height + oy - ry, x, y + height - ry],\n [x, y + ry],\n [x, y + ry - oy, x + rx - ox, y, x + rx, y]\n ];\n}\n\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 0;\n }\n return v;\n}\n\nclass Rect extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 圆角\n if(this.isMulti) {\n this.__rx = [0];\n this.__ry = [0];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n }\n else {\n this.__rx = this.__ry = 0;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(rx => Math.min(rx, 0.5) * width);\n }\n else {\n __cacheProps.rx = Math.min(rx, 0.5) * width;\n }\n }\n if(isNil(__cacheProps.ry) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = rx.map(ry => Math.min(ry, 0.5) * height);\n }\n else {\n __cacheProps.ry = Math.min(ry, 0.5) * height;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => genVertex(originX, originY, width, height, rx, ry[i]));\n }\n else {\n __cacheProps.list = genVertex(originX, originY, width, height, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n bbox[0] = Math.min(bbox[0], originX - ox);\n bbox[1] = Math.min(bbox[1], originY - oy);\n bbox[2] = Math.max(bbox[2], originX + width + ox);\n bbox[3] = Math.max(bbox[3], originY + height + oy);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Rect;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Circle extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__r = [1];\n if(Array.isArray(props.r)) {\n this.__r = props.r.map(i => getR(i));\n }\n else if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n else {\n this.__r = 1;\n if(!isNil(props.r)) {\n this.__r = getR(props.r);\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, r, __cacheProps, isMulti } = this;\n if(isNil(__cacheProps.r) || focus) {\n if(isMulti) {\n __cacheProps.r = r.map(i => i * width * 0.5);\n __cacheProps.list = __cacheProps.r.map(r => geom.ellipsePoints(cx, cy, r));\n }\n else {\n __cacheProps.r = r * width * 0.5;\n __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Circle;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH } = unit;\n\nfunction getR(v) {\n v = parseFloat(v);\n if(isNaN(v)) {\n v = 1;\n }\n return v;\n}\n\nclass Ellipse extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 半径[0, ∞),默认1\n if(this.isMulti) {\n this.__rx = [1];\n this.__ry = [1];\n if(Array.isArray(props.rx)) {\n this.__rx = props.rx.map(i => getR(i));\n }\n else if(!isNil(props.rx)) {\n this.__rx = [getR(props.rx)];\n }\n if(Array.isArray(props.ry)) {\n this.__ry = props.ry.map(i => getR(i));\n }\n else if(!isNil(props.ry)) {\n this.__ry = [getR(props.ry)];\n }\n }\n else {\n this.__rx = 1;\n if(!isNil(props.rx)) {\n this.__rx = getR(props.rx);\n }\n this.__ry = 1;\n if(!isNil(props.ry)) {\n this.__ry = getR(props.ry);\n }\n }\n }\n\n buildCache(cx, cy, focus) {\n let { width, height, rx, ry, __cacheProps, isMulti } = this;\n let rebuild;\n if(isNil(__cacheProps.rx) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.rx = rx.map(i => i * width * 0.5);\n }\n else {\n __cacheProps.rx = rx * width * 0.5;\n }\n }\n if(isNil(__cacheProps.ry) || focus) {\n rebuild = true;\n if(isMulti) {\n __cacheProps.ry = ry.map(i => i * height * 0.5);\n }\n else {\n __cacheProps.ry = ry * height * 0.5;\n }\n }\n if(rebuild) {\n let { rx, ry } = __cacheProps;\n if(isMulti) {\n __cacheProps.list = rx.map((rx, i) => geom.ellipsePoints(cx, cy, rx, ry[i]));\n }\n else {\n __cacheProps.list = geom.ellipsePoints(cx, cy, rx, ry);\n }\n }\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let rx = 0, ry = 0;\n if(isMulti) {\n let mx = 0, my = 0;\n __cacheProps.rx.forEach((rx, i) => {\n mx = Math.max(rx, mx);\n my = Math.max(ry, __cacheProps.ry[i]);\n });\n rx = mx;\n ry = my;\n }\n else {\n rx = __cacheProps.rx;\n ry = __cacheProps.ry;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - rx - ox;\n let xb = cx + rx + ox;\n let ya = cy - ry - oy;\n let yb = cy + ry + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Ellipse;\n","import reset from '../style/reset';\n\nlet fullCssProperty = {\n skewX: 'kx',\n skewY: 'ky',\n transform: 'tf',\n fontSize: 'fz',\n offset: 'os',\n easing: 'e',\n filter: 'ft',\n boxShadow: 'bd',\n overflow: 'of',\n backgroundClip: 'bp',\n textOverflow: 'tof',\n flexWrap: 'fp',\n perspective: 'ppt',\n rotate3d: 'r3',\n};\n\nlet abbrCssProperty = {\n os: 'offset', // 非css属性不会被下面反向遍历插入,手动\n e: 'easing',\n};\n\nlet fullAnimate = {\n value: 'v',\n options: 'o',\n};\n\nlet abbrAnimate = {};\n\nlet fullAnimateOption = {\n duration: 'dt',\n delay: 'd',\n endDelay: 'ed',\n iterations: 'i',\n direction: 'dc',\n fill: 'f',\n fps: 'fp',\n playbackRate: 'p',\n spfLimit: 'sl',\n};\n\nlet abbrAnimateOption = {};\n\nreset.DOM_KEY_SET.concat(reset.GEOM_KEY_SET).forEach(k => {\n if(fullCssProperty.hasOwnProperty(k)) {\n abbrCssProperty[fullCssProperty[k]] = k;\n return;\n }\n let v = k.charAt(0) + k.replace(/[a-z]/g, '').toLowerCase();\n fullCssProperty[k] = v;\n abbrCssProperty[v] = k;\n});\n\nObject.keys(fullAnimate).forEach(k => {\n abbrAnimate[fullAnimate[k]] = k;\n});\n\nObject.keys(fullAnimateOption).forEach(k => {\n abbrAnimateOption[fullAnimateOption[k]] = k;\n});\n\nexport default {\n fullCssProperty,\n abbrCssProperty,\n fullAnimate,\n abbrAnimate,\n fullAnimateOption,\n abbrAnimateOption,\n};\n","import abbr from './abbr';\nimport Node from '../node/Node';\nimport Component from '../node/Component';\nimport $$type from '../util/$$type';\nimport util from '../util/util';\nimport inject from '../util/inject';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet { isNil, isFunction, isPrimitive, clone, extend } = util;\nlet { abbrCssProperty, abbrAnimateOption, abbrAnimate } = abbr;\n\n/**\n * 还原缩写到全称,涉及样式和动画属性\n * @param target 还原的对象\n * @param hash 缩写映射\n */\nfunction abbr2full(target, hash) {\n // 也许节点没写样式\n if(target) {\n Object.keys(target).forEach(k => {\n // var-attr格式特殊考虑,仅映射attr部分,var-还要保留\n if(k.indexOf('var-') === 0) {\n let k2 = k.slice(4);\n if(hash.hasOwnProperty(k2)) {\n let fk = hash[k2];\n target['var-' + fk] = target[k];\n // delete target[k];\n }\n }\n // 普通样式缩写还原\n else if(hash.hasOwnProperty(k)) {\n let fk = hash[k];\n target[fk] = target[k];\n // 删除以免二次解析\n delete target[k];\n }\n });\n }\n}\n\nfunction replaceVars(json, vars) {\n if(json && vars) {\n // 新版vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // 排除特殊的library\n if(Array.isArray(member) && member.length && member[0] !== 'library' && vars.hasOwnProperty(id)) {\n let target = json;\n for(let i = 0, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // undefined和null意义不同\n if(v === undefined) {\n return;\n }\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n target[k] = v;\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Slot miss ' + k);\n return;\n }\n }\n }\n });\n }\n }\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-') === 0) {\n let v = json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(4);\n // 有id且变量里面传入了替换的值,值可为null,因为某些情况下空为自动\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n // undefined和null意义不同\n if(value === undefined) {\n return;\n }\n let target = json;\n // 如果有.则特殊处理子属性\n if(k2.indexOf('.') > -1) {\n let list = k2.split('.');\n let len = list.length;\n for(let i = 0; i < len - 1; i++) {\n k2 = list[i];\n // 避免异常\n if(target[k2]) {\n target = target[k2];\n }\n else {\n inject.warn('parseJson vars is not exist: ' + v.id + ', ' + k + ', ' + list.slice(0, i).join('.'));\n return;\n }\n }\n k2 = list[len - 1];\n }\n // 支持函数模式和值模式\n if(isFunction(value)) {\n value = value(v);\n }\n target[k2] = value;\n }\n }\n });\n }\n }\n}\n\nfunction replaceLibraryVars(json, hash, vars) {\n if(vars) {\n // 新版同级vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // library.xxx,需要>=2的长度\n if(Array.isArray(member) && member.length > 1 && vars.hasOwnProperty(id)) {\n if(member[0] === 'library') {\n let target = hash;\n for(let i = 1, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n let old = target[k];\n // 直接替换library的子对象,需补充id和tagName\n if(i === 1) {\n target[k] = Object.assign({ id: old.id, tagName: old.tagName }, v);\n }\n // 替换library中子对象的一个属性直接赋值\n else {\n target[k] = v;\n }\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Library slot miss ' + k);\n return;\n }\n }\n }\n }\n });\n }\n }\n // 兼容老版var-\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-library.') === 0) {\n let v = json[k];\n // 直接移除library插槽,防止下面调用replaceVars(json, vars)时报错\n delete json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(12);\n // 有id且变量里面传入了替换的值\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n if(isFunction(value)) {\n value = value(v);\n }\n // 替换图层的值必须是一个有tagName的对象\n if(!value || !value.tagName) {\n return;\n }\n // library对象也要加上id,与正常的library保持一致\n hash[k2] = Object.assign({ id: k2 }, value);\n }\n }\n });\n }\n }\n}\n\n/**\n * 遍历一遍library的一级,将一级的id存到hash上,无需递归二级,\n * 因为顺序前提要求排好且无循环依赖,所以被用到的一定在前面出现,\n * 一般是无children的元件在前,包含children的div在后\n * 即便library中的元素有children或library,在linkChild时将其link过去,parse递归会继续处理\n * @param item:library的一级孩子\n * @param hash:存放library的key/value引用\n */\nfunction linkLibrary(item, hash) {\n let id = item.id;\n // library中一定有id,因为是一级,二级+特殊需求才会出现放开\n if(isNil(id)) {\n throw new Error('Library item miss id: ' + JSON.stringify(item));\n }\n else {\n hash[id] = item;\n }\n}\n\n/**\n * 链接child到library文件,\n * props需要是clone的,因为防止多个child使用同一个库文件\n * children则直接引用,无需担心多个使用同一个\n * library也需要带上,在library直接子元素还包含library时会用到\n * @param child\n * @param libraryItem\n */\nfunction linkChild(child, libraryItem) {\n // 规定图层child只有init和动画,属性和子图层来自库\n child.tagName = libraryItem.tagName;\n child.props = clone(libraryItem.props);\n child.children = libraryItem.children;\n child.library = libraryItem.library;\n // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况\n Object.keys(libraryItem).forEach(k => {\n if(k.indexOf('var-') === 0 && !child.hasOwnProperty(k)) {\n child[k] = libraryItem[k];\n }\n });\n // 删除以免二次解析\n child.libraryId = null;\n // 规定图层实例化的属性和样式在init上,优先使用init,然后才取原型链的props\n let { init } = child;\n if(init) {\n let props = child.props = child.props || {};\n let style = props.style;\n extend(props, init);\n // style特殊处理,防止被上面覆盖丢失原始值\n if(style) {\n extend(style, init.style);\n props.style = style;\n }\n // 删除以免二次解析\n child.init = null;\n }\n}\n\nfunction parse(karas, json, animateRecords, opt, hash = {}) {\n if(isPrimitive(json) || json instanceof Node || json instanceof Component) {\n return json;\n }\n if(Array.isArray(json)) {\n return json.map(item => {\n return parse(karas, item, animateRecords, opt, hash);\n });\n }\n // 先判断是否是个链接到库的节点,是则进行链接操作\n let libraryId = json.libraryId;\n if(!isNil(libraryId)) {\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,tagName和属性和子图层来自库\n if(libraryItem) {\n linkChild(json, libraryItem);\n }\n else {\n throw new Error('Link library miss id: ' + libraryId);\n }\n json.libraryId = null;\n }\n // 再判断是否有library形成一个新的作用域,会出现library下的library使得一个链接节点链接后出现library的情况\n let library = json.library;\n if(Array.isArray(library)) {\n hash = {};\n library.forEach(item => {\n linkLibrary(item, hash);\n });\n // 替换library插槽\n replaceLibraryVars(json, hash, opt.vars);\n json.library = null;\n }\n let { tagName, props = {}, children = [], animate = [] } = json;\n if(!tagName) {\n throw new Error('Dom must have a tagName: ' + JSON.stringify(json));\n }\n let style = props.style;\n (opt.abbr !== false) && abbr2full(style, abbrCssProperty);\n // 先替换style的\n replaceVars(style, opt.vars);\n // 再替换静态属性,style也作为属性的一种,目前尚未被设计为被替换\n replaceVars(props, opt.vars);\n // 替换children里的内容,如文字,无法直接替换tagName/props/children/animate本身,因为下方用的还是原引用\n replaceVars(json, opt.vars);\n 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 let animationRecord;\n if(animate) {\n if(Array.isArray(animate)) {\n let has;\n animate.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrAnimate);\n let { value, options } = item;\n // 忽略空动画\n if(Array.isArray(value) && value.length) {\n has = true;\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n });\n if(has) {\n animationRecord = {\n animate,\n target: vd,\n };\n }\n }\n else {\n (opt.abbr !== false) && abbr2full(animate, abbrAnimate);\n let { value, options } = animate;\n if(Array.isArray(value) && value.length) {\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n animationRecord = {\n animate,\n target: vd,\n };\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n }\n }\n // 产生实际动画运行才存入列表供root调用执行\n if(animationRecord) {\n animateRecords.push(animationRecord);\n }\n return vd;\n}\n\nexport default parse;\n","import parse from './parse';\nimport abbr from './abbr';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport font from '../style/font';\nimport Controller from '../animate/Controller';\n\nlet o = {\n parse(karas, json, dom, options = {}) {\n json = util.clone(json);\n // 根节点的fonts字段定义字体信息\n let fonts = json.fonts;\n if(fonts) {\n if(!Array.isArray(fonts)) {\n fonts = [fonts];\n }\n fonts.forEach(item => {\n let { fontFamily, data } = item;\n if(fontFamily && data) {\n font.register(fontFamily, data);\n }\n });\n }\n // json中定义无abbr\n if(json.abbr === false) {\n options.abbr = false;\n }\n if(options.abbr !== false) {\n inject.warn('Abbr in json is deprecated');\n }\n // 重载,在确定dom传入选择器字符串或html节点对象时作为渲染功能,否则仅创建vd返回\n if(!inject.isDom(dom)) {\n options = dom || {};\n dom = null;\n }\n // 暂存所有动画声明,等root的生成后开始执行\n let animateRecords = [];\n let vd = parse(karas, json, animateRecords, options);\n // 有dom时parse作为根方法渲染\n if(dom) {\n let { tagName } = json;\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) === -1) {\n throw new Error('Parse dom must be canvas/svg');\n }\n // parse直接(非递归)的动画记录\n let ac = options.controller instanceof Controller ? options.controller : vd.animateController;\n // 第一次render,收集递归json里面的animateRecords,它在xom的__layout最后生成\n karas.render(vd, dom);\n // 由于vd首先生成的都是json,根parse要特殊处理将target指向真正的vd引用,json的vd在builder中赋值\n animateRecords.forEach(item => {\n item.target = item.target.vd;\n });\n // 直接的json里的animateRecords,再加上递归的parse的json的(第一次render布局时处理)动画一并播放\n if(options.autoPlay !== false) {\n ac.__records = ac.__records.concat(animateRecords);\n ac.__playAuto();\n }\n // 不自动播放进入记录列表,初始化并等待手动调用\n else {\n ac.__records2 = ac.__records2.concat(animateRecords);\n ac.init(ac.__records2, ac.list2);\n }\n }\n // 递归的parse,如果有动画,此时还没root,先暂存下来,等上面的root的render第一次布局时收集\n else {\n if(animateRecords.length) {\n vd.__animateRecords = {\n options,\n list: animateRecords,\n controller: options.controller instanceof Controller ? options.controller : null,\n };\n }\n }\n return vd;\n },\n loadAndParse(karas, json, dom, options) {\n let { fonts, components, imgs } = json;\n let list1 = [];\n let list2 = [];\n let list3 = [];\n if(fonts) {\n if(!Array.isArray(fonts)) {\n fonts = [fonts];\n }\n fonts.forEach(item => {\n let url = item.url;\n if(url) {\n list1.push(url);\n }\n });\n }\n if(components) {\n if(!Array.isArray(components)) {\n components = [components];\n }\n components.forEach(item => {\n let { tagName, url, reload } = item;\n // 如果没申明reload且已经被注册,则无需重复加载\n if(tagName && karas.Component.hasRegister(tagName) && !reload) {\n return;\n }\n // 即便没有tagName也要加载,可能组件内部执行了注册逻辑\n if(url) {\n list2.push(item);\n }\n });\n }\n if(imgs) {\n if(!Array.isArray(imgs)) {\n imgs = [imgs];\n }\n imgs.forEach(item => {\n let url = item.url;\n if(url) {\n list3.push(url);\n }\n });\n }\n let a = list1.length, b = list2.length, c = list3.length;\n if(a || b || c) {\n let count = 0;\n let cb = function() {\n if(count === a + b + c) {\n let res = o.parse(karas, json, dom, options);\n if(options && util.isFunction(options.callback)) {\n options.callback(res);\n }\n }\n };\n karas.inject.loadFont(list1, function() {\n count += a;\n cb();\n });\n karas.inject.loadComponent(list2.map(item => item.url), function() {\n count += b;\n // 默认约定加载的js组件会在全局变量申明同名tagName,已有不覆盖,防止组件代码内部本身有register\n list2.forEach(item => {\n let tagName = item.tagName;\n if(tagName && window[tagName] && !karas.Component.hasRegister(tagName)) {\n karas.Component.register(tagName, window[tagName]);\n }\n });\n cb();\n });\n karas.inject.measureImg(list3, function() {\n count += c;\n cb();\n });\n }\n else {\n let res = o.parse(karas, json, dom, options);\n if(options && util.isFunction(options.callback)) {\n options.callback(res);\n }\n return res;\n }\n },\n abbr,\n};\n\nexport default o;\n","import css from './css';\nimport reset from './reset';\nimport unit from './unit';\nimport font from './font';\nimport abbr from './abbr';\n\nexport default {\n css,\n reset,\n unit,\n font,\n abbr,\n};\n","import Animation from './Animation';\nimport Controller from './Controller';\nimport easing from './easing';\nimport frame from './frame';\n\nexport default {\n Animation,\n Controller,\n easing,\n frame,\n};\n","import level from './level';\nimport change from './change';\nimport Page from './Page';\nimport Cache from './Cache';\n\nexport default {\n level,\n change,\n Page,\n Cache,\n};\n","import Node from './node/Node';\nimport Text from './node/Text';\nimport Xom from './node/Xom';\nimport Dom from './node/Dom';\nimport Img from './node/Img';\nimport Root from './node/Root';\nimport tag from './node/tag';\nimport mode from './node/mode';\nimport Geom from './node/geom/Geom';\nimport Line from './node/geom/Line';\nimport Polyline from './node/geom/Polyline';\nimport Polygon from './node/geom/Polygon';\nimport Sector from './node/geom/Sector';\nimport Rect from './node/geom/Rect';\nimport Circle from './node/geom/Circle';\nimport Ellipse from './node/geom/Ellipse';\nimport Component from './node/Component';\nimport Event from './util/Event';\nimport util from './util/util';\nimport $$type from './util/$$type';\nimport builder from './util/builder';\nimport updater from './util/updater';\nimport inject from './util/inject';\nimport enums from './util/enums';\nimport debug from './util/debug';\nimport parser from './parser/index';\nimport style from './style/index';\nimport animate from './animate/index';\nimport math from './math/index';\nimport refresh from './refresh/index';\nimport { version } from '../package.json';\n\nGeom.register('$line', Line);\nGeom.register('$polyline', Polyline);\nGeom.register('$polygon', Polygon);\nGeom.register('$sector', Sector);\nGeom.register('$rect', Rect);\nGeom.register('$circle', Circle);\nGeom.register('$ellipse', Ellipse);\n\nlet karas = {\n version,\n render(root, dom) {\n if(!(root instanceof Root)) {\n throw new Error('Render dom must be canvas/svg');\n }\n if(dom) {\n root.appendTo(dom);\n }\n return root;\n },\n createElement(tagName, props) {\n props = props || {};\n let children = [];\n for(let i = 2, len = arguments.length; i < len; i++) {\n children.push(arguments[i]);\n }\n if(util.isString(tagName)) {\n if(tagName.charAt(0) === '$') {\n return this.createGm(tagName, props);\n }\n else {\n return this.createVd(tagName, props, children);\n }\n }\n else if(tagName) {\n return this.createCp(tagName, props, children);\n }\n },\n createVd(tagName, props, children = []) {\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n if(tag.TAG_NAME.hasOwnProperty(tagName)) {\n return {\n tagName,\n props,\n children,\n $$type: $$type.TYPE_VD,\n };\n }\n throw new Error(`Can not use <${tagName}>`);\n },\n createGm(tagName, props) {\n return {\n tagName,\n props,\n $$type: $$type.TYPE_GM,\n };\n },\n createCp(klass, props, children = []) {\n props.children = children;\n return {\n klass,\n props,\n $$type: $$type.TYPE_CP,\n };\n },\n parse(json, dom, options) {\n return parser.parse(this, json, dom, options);\n },\n loadAndParse(json, dom, options) {\n return parser.loadAndParse(this, json, dom, options);\n },\n mode,\n Component,\n Node,\n Text,\n Geom,\n Xom,\n Dom,\n Img,\n Root,\n Event,\n util,\n inject,\n style,\n parser,\n animate,\n math,\n builder,\n updater,\n refresh,\n enums,\n set debug(v) {\n debug.flag = !!v;\n },\n};\n\nbuilder.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\n\nif(typeof window !== 'undefined') {\n window.karas = karas;\n}\nelse if(typeof self !== 'undefined') {\n self.karas = karas;\n}\n\nexport default karas;\n"],"names":["STYLE_KEY","POSITION","DISPLAY","TOP","RIGHT","BOTTOM","LEFT","MARGIN_TOP","MARGIN_RIGHT","MARGIN_BOTTOM","MARGIN_LEFT","PADDING_TOP","PADDING_RIGHT","PADDING_BOTTOM","PADDING_LEFT","FONT_SIZE","FONT_FAMILY","COLOR","FONT_STYLE","FONT_WEIGHT","LINE_HEIGHT","BACKGROUND_IMAGE","BACKGROUND_COLOR","BACKGROUND_SIZE","BACKGROUND_REPEAT","BACKGROUND_POSITION_X","BACKGROUND_POSITION_Y","BORDER_TOP_WIDTH","BORDER_RIGHT_WIDTH","BORDER_BOTTOM_WIDTH","BORDER_LEFT_WIDTH","BORDER_TOP_COLOR","BORDER_RIGHT_COLOR","BORDER_BOTTOM_COLOR","BORDER_LEFT_COLOR","BORDER_TOP_STYLE","BORDER_RIGHT_STYLE","BORDER_BOTTOM_STYLE","BORDER_LEFT_STYLE","BORDER_TOP_LEFT_RADIUS","BORDER_TOP_RIGHT_RADIUS","BORDER_BOTTOM_RIGHT_RADIUS","BORDER_BOTTOM_LEFT_RADIUS","WIDTH","HEIGHT","FLEX_GROW","FLEX_SHRINK","FLEX_BASIS","FLEX_DIRECTION","JUSTIFY_CONTENT","ALIGN_ITEMS","ALIGN_SELF","TEXT_ALIGN","TRANSFORM_ORIGIN","VISIBILITY","OPACITY","Z_INDEX","TRANSFORM","TRANSLATE_X","TRANSLATE_Y","TRANSLATE_Z","SCALE_X","SCALE_Y","SCALE_Z","SKEW_X","SKEW_Y","ROTATE_X","ROTATE_Y","ROTATE_Z","ROTATE_3D","PERSPECTIVE","PERSPECTIVE_ORIGIN","FILTER","BOX_SHADOW","POINTER_EVENTS","OVERFLOW","MIX_BLEND_MODE","BACKGROUND_CLIP","WHITE_SPACE","TEXT_OVERFLOW","LETTER_SPACING","LINE_CLAMP","ORDER","FLEX_WRAP","ALIGN_CONTENT","TEXT_STROKE_WIDTH","TEXT_STROKE_COLOR","TEXT_STROKE_OVER","FILL","STROKE","STROKE_WIDTH","STROKE_DASHARRAY","STROKE_DASHARRAY_STR","STROKE_LINECAP","STROKE_LINEJOIN","STROKE_MITERLIMIT","FILL_RULE","MATRIX","BORDER_TOP","BORDER_RIGHT","BORDER_BOTTOM","BORDER_LEFT","TRANSLATE_PATH","STYLE2LOWER_MAP","style2Lower","s","toLowerCase","replace","$0","$1","toUpperCase","STYLE2UPPER_MAP","style2Upper","$2","STYLE_R_KEY","STYLE_RV_KEY","STYLE_V_KEY","Object","keys","forEach","k","k2","l","UPDATE_KEY","UPDATE_NODE","UPDATE_STYLE","UPDATE_FOCUS","UPDATE_MEASURE","UPDATE_COMPONENT","UPDATE_OVERWRITE","UPDATE_KEYS","UPDATE_LIST","UPDATE_CONFIG","UPDATE_ADD_DOM","UPDATE_REMOVE_DOM","KEY_FRAME_KEY","FRAME_STYLE","FRAME_TIME","FRAME_EASING","FRAME_TRANSITION","NODE_KEY","NODE_DOM_PARENT","NODE_OPACITY","NODE_MATRIX","NODE_MATRIX_EVENT","NODE_CACHE","NODE_CACHE_TOTAL","NODE_CACHE_FILTER","NODE_CACHE_MASK","NODE_CACHE_OVERFLOW","NODE_STRUCT","NODE_TAG_NAME","NODE_CURRENT_STYLE","NODE_CURRENT_PROPS","NODE_COMPUTED_STYLE","NODE_CACHE_STYLE","NODE_CACHE_PROPS","NODE_LIMIT_CACHE","NODE_IS_MASK","NODE_IS_INLINE","NODE_HAS_CONTENT","NODE_REFRESH_LV","NODE_IS_DESTROYED","NODE_STYLE","NODE_UPDATE_HASH","NODE_UNIQUE_UPDATE_ID","NODE_DEFS_CACHE","NODE_PERSPECTIVE_MATRIX","NODE_VIRTUAL_DOM","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_FRAME_CB","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_CAL_DIFF_TIME","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","__width","__height","__baseLine","__config","i","lv","j","root","struct","diff","isLayout","__sx","__sy","x","ox","y","oy","__prev","__next","__parent","__domParent","__root","__host","__hostRoot","__virtualDom","CANVAS","SVG","WEBGL","o","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","REM","EM","VW","VH","calUnit","v","n","parseFloat","test","info","arial","lhr","blr","lgr","padding","f","verdana","tahoma","S","T","Z","c","t","georgia","simsun","support","fontFamily","hasOwnProperty","register","name","emSquare","ascent","descent","lineGap","addPadding","assign","position","gradient","img","identity","multiply","a","b","isE","a0","a1","a2","a3","calPoint","point","m","z","w","undefined","length","b1","c1","d1","b2","c2","d2","b3","c3","d3","a4","b4","c4","d4","d","e","inverse","inverse4","divisor","inv","det","m2m6","point2d","slice","dotProduct","x1","y1","x2","y2","crossProduct","H","Math","sqrt","vector","mx","h","deg","cos","sin","pointInPolygon","vertexes","xmax","ymax","xmin","ymin","len","max","min","pointInQuadrilateral","x4","y4","x3","y3","matrix","w1","w2","w3","w4","angleBySide","theta","pow","acos","sideByAngle","alpha","pointsDistance","triangleIncentre","ellipsePoints","sectorPoints","r","begin","end","list","floor","h2","d2r","abs","atan","rx","ry","p1","p2","p4","p3","push","concat","temp","res","getRectsIntersection","isRectsOverlap","ax1","ay1","ax4","ay4","bx1","by1","bx4","by4","isRectsInside","calCoordsInNode","px","py","node","computedStyle","width","height","calPercentInNode","ds","Infinity","PI","dt","r2d","bboxBezier2","x0","y0","minX","minY","maxX","maxY","tx","ty","sx","sy","qx","qy","bboxBezier3","cx","cy","bx","by","ax","ay","hx","hy","q","bboxBezier","arguments","norm","order","sum","reduce","simpson38","derivativeFunc","middleL","middleR","adaptiveSimpson38","eps","mid","st","sl","sr","ans","bezierLength","points","startT","endT","at","at3","p0","at2","bezierOrder","derivativeOrder","pointAtBezier","percent","maxIteration","pointAtBezierWithLength","targetLen","approachLen","approachT","preApproachT","derivative1","derivative2","numerator","denominator","sliceBezier","x12","y12","x23","y23","x123","y123","x34","y34","x234","y234","x1234","y1234","sliceBezier2Both","start","reverse","pointOnCircle","getConicGradientImage","originX","originY","stop","data","Error","getAngle","dx","dy","increasingList","map","item","color","angle","factor","idx","canvasPolygon","ctx","Array","isArray","moveTo","lineTo","quadraticCurveTo","bezierCurveTo","svgPolygon","canvasLine","controlA","controlB","num","svgLine","canvasFilter","filter","svgFilter","geom","unit","painter","calFitDashed","total","bs","be","smin","smax","dmin","dmax","ps","pd","outer","per","free","mo","calDashed","style","m1","m2","m3","m4","bw","calPoints","borderWidth","borderStyle","deg1","deg2","direction","beginRadius","endRadius","indexOf","isLast","main1","main2","cross1","cross2","tan","calTopRadiusPoints","calRightRadiusPoints","calBottomRadiusPoints","calLeftRadiusPoints","pointsList","brx","bry","erx","ery","oxl","oxr","beginList","centerList","endList","ya","yb","beginLength","needInner","crossDeg","rx1","ry1","sx1","oyl","rx2","ry2","sx2","xa","xb","ca","calBezierTopLeft","cb","controls1","controls2","limit","pop","endLength","oyr","calBezierTopRight","isStart","crossDx","p1x","p1y","p2x","p2y","dx1","dsx1","dx2","dsx2","cpx2","cpy2","cpx1","cpy1","crossDsx","beta","tanBetaDiv2Sqrt","tanAlphaHalf","degTg","degTg1","cdx1","cdy1","cx1","cy1","degTg2","cdx2","cdy2","cx2","cy2","isEnd","oyt","oyb","oxt","calBezierRightTop","oxb","calBezierRightBottom","calBezierBottomLeft","calBezierBottomRight","calBezierLeftTop","calBezierLeftBottom","calRadius","btlr","btrr","bbrr","bblr","need","btlx","btly","btrx","btry","bbrx","bbry","bblx","bbly","BR_KS","calBorderRadius","currentStyle","noRadius","target","prev","next","half","calBorderRadiusInline","contentBoxList","first","last","outerWidth","outerHeight","renderBorder","xom","renderMode","mode","beginPath","fillStyle","fill","closePath","virtualDom","bb","type","tagName","props","TYPE_VD","_","TYPE_GM","TYPE_CP","toString","isType","obj","call","isObject","isString","isFunction","isNumber","isBoolean","isDate","hasOwn","fnToString","ObjectFunctionString","isNil","joinSourceArray","arr","stringify","encodeHtml","prop","joinVirtualDom","vd","defs","joinDef","joinVd","conClip","children","isMask","content","opacity","transform","visibility","mask","overflow","mixBlendMode","def","uuid","joinItem","rgba2int","charAt","parseInt","match","int2rgba","joinArr","int2invert","arr2hash","hash","hash2arr","clone","$$type","util","Date","isPlainObject","equalArr","ai","bi","isArrayA","isArrayB","equal","getTime","extend","source","split","extendAnimate","ovd","nvd","__animationList","animationList","splice","__setTarget","assigning","finished","__stayEnd","assignCurrentStyle","__frameAnimateList","transformBbox","bbox","proto","getPrototypeOf","Ctor","constructor","assignMatrix","isPrimitive","isAuto","flag","charWidth","ELLIPSIS","antialias","premultipliedAlpha","preserveDrawingBuffer","initShaders","gl","vshader","fshader","program","createProgram","enable","BLEND","blendFunc","ONE","ONE_MINUS_SRC_ALPHA","vertexShader","loadShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","attachShader","linkProgram","linked","getProgramParameter","LINK_STATUS","error","getProgramInfoLog","deleteProgram","deleteShader","shader","createShader","shaderSource","compileShader","compiled","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","convertCoords2Gl","revertY","createTexture","tex","texture","bindTexture","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","texImage2D","TEXTURE_2D","UNSIGNED_BYTE","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","LINEAR","TEXTURE_MAG_FILTER","activeTexture","drawTextureCache","vtPoint","vtTex","vtOpacity","lastChannel","record","stack","cache","channel","page","tx1","ty1","tx2","ty2","pointBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","Float32Array","STATIC_DRAW","a_position","getAttribLocation","vertexAttribPointer","FLOAT","enableVertexAttribArray","texBuffer","a_texCoords","opacityBuffer","a_opacity","u_texture","getUniformLocation","count","uniform1i","drawArrays","TRIANGLES","deleteBuffer","disableVertexAttribArray","drawBlur","frameBuffer","texCache","tex1","tex2","spread","sigma","u_direction","uniform2f","ratio","recycle","tex3","framebufferTexture2D","FRAMEBUFFER","COLOR_ATTACHMENT0","tex4","deleteTexture","drawCm","u_m","uniform1fv","drawOverflow","programOverflow","drawMask","u_texture1","u_texture2","drawMbm","W","SPF","CANVAS_LIST","WEBGL_LIST","SUPPORT_OFFSCREEN_CANVAS","OffscreenCanvas","prototype","getContext","defaultFontFamilyData","key","message","debug","document","createElement","setAttribute","body","appendChild","canvas","draw","enabled","available","release","cacheCanvas","cacheWebgl","IMG","INIT","LOADING","LOADED","FONT","COMPONENT","inject","measureText","textCache","html","lengths","chars","ff","fs","fw","inline","char","div","left","top","innerHTML","cns","childNodes","index","css","window","getComputedStyle","text","__measureCb","removeChild","measureTextSync","measureImg","url","state","success","task","Image","onload","onerror","substr","host","exec","location","hostname","crossOrigin","src","warn","console","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","id","clearTimeout","now","performance","hasCacheCanvas","getCacheCanvas","releaseCacheCanvas","delCacheCanvas","hasCacheWebgl","getCacheWebgl","releaseCacheWebgl","delCacheWebgl","isDom","Element","self","getElementsByTagName","isWebGLTexture","WebGLTexture","checkSupportFontFamily","font","checked","context","textAlign","textBaseline","clearRect","fillText","getImageData","loadFont","FontFace","load","then","loadComponent","script","async","head","getLinearDeg","getRadialPosition","center","right","bottom","getColorStop","firstColor","p","dr","dg","db","da","unshift","calLinearCoords","calCircleCentre","iw","ih","positionX","positionY","calRadialRadius","shape","size","xl","yl","asin","parseGradient","reg","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","log","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","__hasUpdate","__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","Animation","__id","nl","__options","op","config","__frameCb","__calDiffTime","iterations","framesR","originStyle","fps","spfLimit","delay","endDelay","playbackRate","isFinish","__cancelTask","__currentProps","__currentStyle","isDelay","FRAME","PLAY","playState","__hasFin","__hasCancel","playCount","currentFrames","stayBegin","stayEnd","is2","endTime","currentTime","currentFrame","round","isAlternate","alternate","isEven","isLastCount","frameTime","isLastFrame","inEndDelay","needClean","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","isDirectItem","__calMp","isVirtual","fromAbs","isShadowRoot","clearCache","__layoutData","__layoutNone","__mp","__isRealInline","__layoutFlex","__layoutInline","__layoutBlock","__sx2","__sx3","__sx4","__sx5","__sx6","__sy2","__sy3","__sy4","__sy5","__sy6","__execAr","ar","controller","autoPlay","__records2","init","list2","__records","__playAuto","h3","nowrap","fixedWidth","fixedHeight","selfEndSpace","offsetWidth","offsetHeight","matrixCache","isScale","clientHeight","x5","x6","y5","y6","__calFilter","bg","bgI","item2","kw","__bx1","__bx2","__by1","__by2","rebuild","__hasContent","isRealInline","sx4","sx5","sx6","sy4","sy5","sy6","hasContent","__calContent","__calPerspective","__calMatrix","__releaseWhenEmpty","limitCache","__calCache","perspectiveMatrix","offscreenBlend","offscreenMask","hasFilter","offscreenFilter","offscreenOverflow","borderList","hasBgi","some","svgBgSymbol","__gradient","isFirst","lastContentBox","lastLineBox","parentLineBox","countW","ix1","iy1","ix2","iy2","symbol","clearAnimate","clearFrameAnimate","__stopPropagation","__stopImmediatePropagation","willResponseEvent","hasEmitMask","ignore","inThis","__touchstartTarget","__getLg","__getRg","__getCg","lg","createLinearGradient","addColorStop","rg","createRadialGradient","ec","dc","pc","cur","onlyTotal","__cacheTotal","__cacheFilter","__cacheMask","__cacheOverflow","formatStyle","animation","cancel","enter","hostRoot","pJson","zChildren","zIndexChildren","__spreadBbox","LineBox","__list","__lineHeight","LineBoxManager","__lastX","__lastY","__maxX","__domList","__domStack","__isNewLine","__isEnd","__setLB","nextNewLine","genLineBox","verticalAlign","isNewLine","TAG_NAME","INLINE","BOLD","offsetAndResizeByNodeOnY","reflowHash","inDirectAbsList","isContainer","cs","__layoutAbs","isAbs","__resizeY","clearUniqueReflowId","__uniqueReflowId","getMergeMarginTB","topList","bottomList","genZIndexChildren","hasMc","mcHash","lastMaskIndex","__iIndex","__zIndex","__aIndex","genOrderChildren","__order","block","inlineBlock","none","tag","__flexLine","__zIndexChildren","__structure","nss","__structs","structs","needSort","__tryLayInline","firstCharWidth","main","isRow","__calMinMax","min2","max2","countMin","countMax","setNotEnd","__addMp","isFixed","isContent","fixedSize","__lineBoxManager","__preLayout","__ioSize","mergeMarginBottomList","mergeMarginTopList","isXom","isInlineBlock","isImg","reflow","__isIbFull","lastX","lastY","isNone","isEmptyBlock","tw","th","horizonAlign","__inlineSize","domList","__marginAuto","growList","shrinkList","basisList","maxList","minList","orderChildren","__calBasis","containerSize","isMultiLine","line","hypotheticalList","hypothetical","maxCrossList","__layoutFlexLine","maxCross","crossSum","crossSumList","between","around","__crossAlign","flexLine","hypotheticalSum","targetMainList","factorSum","factorList","needReset","factorSum2","lbmList","firstBaseLine","genLineBoxByInlineIfNewLine","setLbByInlineIfNotNewLine","pushContentBoxList","isIbFull","isInline2","isInlineBlock2","focusNoWrap","fw2","addX","popContentBoxList","maxCX","maxCY","minCX","minCY","maxFX","maxFY","minFX","minFY","maxOX","maxOY","minOX","minOY","absChildren","onlyRight","onlyBottom","fixedTop","fixedRight","fixedBottom","fixedLeft","needCalWidth","wl","hl","__computeMeasure","__deepScan","loadImg","__loadImg","placeholder","loading","__loadAndRefresh","showError","pts","arc","__addGeom","reload","Defs","cacheHash","__isMulti","multi","__cacheProps","strokeDasharrayStr","lineCap","lineJoin","miterLimit","getLineDash","setLineDash","preData","__preSet","fills","fillRules","strokes","strokeWidths","strokeDasharrays","strokeDasharrayStrs","strokeLinecaps","strokeLinejoins","strokeMiterlimits","__renderOnePolygon","isFillCE","isStrokeCE","isFillRE","isStrokeRE","__conicGradient","__drawPolygon","__radialEllipse","isFill","isStroke","__preSetCanvas","__propsStrokeStyle","__inversePtList","updateList","removeList","KEY_FLAG","check","checkCp","nextProps","forceCheckUpdate","shouldUpdate","shouldComponentUpdate","updateCp","oldS","oldSr","oldJson","diffSr","oj","nj","ojk","getKeyHash","njk","keyList","cpList","diffCp","diffChildren","diffChild","removeCpFromOldTree","oc","ol","of","nf","exist","ex","did","componentDidUpdate","elem","diffDefs","diffBb","diffD2D","od","nd","diffDef","removeAt","insertAt","insertAdjacentHTML","parentNode","removeAttribute","diffItem","diffD2G","replaceWith","diffT2T","diffG2D","diffG2G","diffItemSelf","diffX2X","diffByLessLv","firstChild","lastChild","obb","nbb","isText","svg","where","insertBefore","Controller","__list2","__onList","__lastTime","args","records","animate","onList","__action","__mergeAuto","__on","timestamp","__set","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","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","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","__ctx","__renderMode","vertex","fragment","vertexMask","fragmentMask","fragmentClip","fragmentOverflow","vertexCm","fragmentCm","MAX_TEXTURE_IMAGE_UNITS","__texCache","destroy","__eventCbList","__checkRoot","__checkUpdate","__checkReflow","noRender","__clear","__vd","domDiff","updateStyle","taskUp","__nextFrameCp","updater","includeIgnore","scan","path","zPath","__index__","karas","path2","zPath2","nodeConfig","rootConfig","updateHash","__updateRoot","updateRoot","hasUpdate","__updateStruct","measureHash","__uniqueUpdateId","isInherit","uniqueList","hasRoot","diffList","diffI","mergeOffsetList","__uniqueMergeOffsetId","cps","cts","isLastAbs","isNowAbs","isLastNone","isNowNone","hasFlowPrev","__modifyStruct","startIndex","startNode","oldH","nowH","lastIndex","ns","reBuild","base","reBuildC","curveNum","limitStartEnd","getNewPoint","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","__start","__end","dy2","buildCache","curve","bezierBox","concatPointAndControl","control","getLength","increase","getIndex","getNewList","prePercent","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","replaceLibraryVars","linkLibrary","JSON","linkChild","libraryItem","library","libraryId","parse","animateRecords","opt","createGm","createCp","createVd","animationRecord","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,EAAE,CATC;AAUhBC,EAAAA,WAAW,EAAE,CAVG;AAWhBC,EAAAA,WAAW,EAAE,EAXG;AAYhBC,EAAAA,aAAa,EAAE,EAZC;AAahBC,EAAAA,cAAc,EAAE,EAbA;AAchBC,EAAAA,YAAY,EAAE,EAdE;AAehBC,EAAAA,SAAS,EAAE,EAfK;AAgBhBC,EAAAA,WAAW,EAAE,EAhBG;AAiBhBC,EAAAA,KAAK,EAAE,EAjBS;AAkBhBC,EAAAA,UAAU,EAAE,EAlBI;AAmBhBC,EAAAA,WAAW,EAAE,EAnBG;AAoBhBC,EAAAA,WAAW,EAAE,EApBG;AAqBhBC,EAAAA,gBAAgB,EAAE,EArBF;AAsBhBC,EAAAA,gBAAgB,EAAE,EAtBF;AAuBhBC,EAAAA,eAAe,EAAE,EAvBD;AAwBhBC,EAAAA,iBAAiB,EAAE,EAxBH;AAyBhBC,E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AAqEVH,EAAAA,GAAG,EAAHA,KArEU;AAsEVC,EAAAA,GAAG,EAAHA,KAtEU;AAuEVC,EAAAA,GAAG,EAAHA,KAvEU;AAwEVk3B,EAAAA,IAAI,EAAJA,IAxEU;AAyEV31B,EAAAA,KAAK,EAALA,KAzEU;AA0EV58B,EAAAA,IAAI,EAAJA,IA1EU;AA2EV0L,EAAAA,MAAM,EAANA,MA3EU;AA4EV3X,EAAAA,KAAK,EAALA,KA5EU;AA6EVqsE,EAAAA,MAAM,EAANA,GA7EU;AA8EVrY,EAAAA,OAAO,EAAPA,OA9EU;AA+EVl2B,EAAAA,IAAI,EAAJA,IA/EU;AAgFVkM,EAAAA,OAAO,EAAPA,OAhFU;AAiFV+5B,EAAAA,OAAO,EAAPA,OAjFU;AAkFVlL,EAAAA,OAAO,EAAPA,OAlFU;AAmFV/tE,EAAAA,KAAK,EAALA,KAnFU;;AAoFV,MAAI0rB,KAAJ,CAAU1oB,CAAV,EAAa;AACX0oB,IAAAA,KAAK,CAACrI,IAAN,GAAa,CAAC,CAACrgB,CAAf;AACD;;AAtFS,CAAZ;AAyFAk8C,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,OAAO1uB,MAAP,KAAkB,WAArB,EAAkC;AAChCA,EAAAA,MAAM,CAACurD,KAAP,GAAeA,OAAf;AACD,CAFD,MAGK,IAAG,OAAO9oD,IAAP,KAAgB,WAAnB,EAAgC;AACnCA,EAAAA,IAAI,CAAC8oD,KAAL,GAAaA,OAAb;AACD;;;;"} \ No newline at end of file +{"version":3,"file":"index.es.js","sources":["src/util/enums.js","src/node/Node.js","src/node/mode.js","src/style/unit.js","src/style/font.js","src/style/reg.js","src/math/matrix.js","src/math/vector.js","src/math/geom.js","src/math/gradient.js","src/util/painter.js","src/style/border.js","src/util/$$type.js","src/util/util.js","src/util/debug.js","src/node/textCache.js","src/gl/ca.js","src/gl/webgl.js","src/util/inject.js","src/style/gradient.js","src/style/reset.js","src/style/abbr.js","src/animate/key.js","src/refresh/change.js","src/style/css.js","src/node/TextBox.js","src/refresh/Page.js","src/math/tar.js","src/math/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_FRAME_CB: 8,\n I_PLAY_CB: 9,\n I_TARGET: 10,\n I_ROOT: 11,\n I_FRAMES: 12,\n I_FRAMES_R: 13,\n I_CURRENT_TIME: 14,\n I_NEXT_TIME: 15,\n I_STYLE: 16,\n I_DURATION: 17,\n I_ITERATIONS: 18,\n I_FILL: 19,\n I_PLAYBACK_RATE: 20,\n I_PLAY_COUNT: 21,\n I_PLAY_STATE: 22,\n I_DESTROYED: 23,\n I_START_TIME: 24,\n I_FPS_TIME: 25,\n I_EASING: 26,\n I_ENTER_FRAME: 27,\n I_DELAY: 28,\n I_END_DELAY: 29,\n I_KEYS: 30,\n I_ORIGIN_STYLE: 31,\n I_CURRENT_FRAMES: 32,\n I_CURRENT_FRAME: 33,\n I_SPF_LIMIT: 34,\n I_FPS: 35,\n I_DIRECTION: 36,\n I_CAL_DIFF_TIME: 37,\n I_FIRST_ENTER: 38,\n I_STAY_BEGIN: 39,\n I_STAY_END: 40,\n I_IS2: 41,\n I_END_TIME: 42,\n I_NODE_CONFIG: 43,\n I_ROOT_CONFIG: 44,\n I_OUT_BEGIN_DELAY: 45,\n I_TIME_STAMP: 46,\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.__width = 0;\n this.__height = 0;\n this.__baseLine = 0;\n this.__config = {};\n // 默认undefined\n // this.__prev = undefined;\n // this.__next = undefined;\n // this.__parent = undefined;\n // this.__domParent = undefined;\n // this.__root = undefined;\n // this.__host = undefined;\n }\n\n __structure(i, lv, j) {\n return this.__config[NODE_STRUCT] = {\n [STRUCT_NODE]: this,\n [STRUCT_INDEX]: i,\n [STRUCT_CHILD_INDEX]: j,\n [STRUCT_LV]: lv,\n };\n }\n\n __modifyStruct(root, offset = 0) {\n let struct = this.__config[NODE_STRUCT];\n return [struct, 0];\n }\n\n __offsetX(diff, isLayout) {\n if(isLayout) {\n this.__x += diff;\n }\n else {\n this.__ox += diff;\n }\n this.__sx += diff;\n }\n\n __offsetY(diff, isLayout) {\n if(isLayout) {\n this.__y += diff;\n }\n else {\n this.__oy += diff;\n }\n this.__sy += diff;\n }\n\n __destroy() {\n this.__config[NODE_IS_DESTROYED] = true;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get ox() {\n return this.__ox;\n }\n\n get oy() {\n return this.__oy;\n }\n\n get sx() {\n return this.x + this.ox;\n }\n\n get sy() {\n return this.y + this.oy;\n }\n\n get width() {\n return this.__width;\n }\n\n get height() {\n return this.__height;\n }\n\n get outerWidth() {\n return this.__width;\n }\n\n get outerHeight() {\n return this.__height;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n // canvas/svg根节点\n get root() {\n return this.__root;\n }\n\n // component根节点\n get host() {\n return this.__host;\n }\n\n // 考虑高阶组件在内的component根节点\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get baseLine() {\n return this.__baseLine;\n }\n\n get virtualDom() {\n return this.__virtualDom;\n }\n\n get isDestroyed() {\n return this.__config[NODE_IS_DESTROYED];\n }\n}\n\nexport default Node;\n","export default {\n CANVAS: 0,\n SVG: 1,\n WEBGL: 2,\n};\n","let o = {\n AUTO: 0,\n PX: 1,\n PERCENT: 2,\n NUMBER: 3,\n INHERIT: 4,\n DEG: 5,\n STRING: 6,\n RGBA: 7,\n REM: 8,\n EM: 9,\n VW: 10,\n VH: 11,\n 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 verdana: {\n lhr: 1.21533203125, // (0+2059+430)/2048\n blr: 1.00537109375, // 2059/2048\n },\n tahoma: {\n lhr: 1.20703125, // (0+2049+423)/2048\n blr: 1.00048828125, // 2049/2048\n padding: {\n S: 1,\n T: 1,\n Z: 1,\n c: 1,\n f: 0.7,\n i: 1,\n l: 1,\n t: 0.9,\n },\n },\n georgia: {\n lhr: 1.13623046875, // (0+1878+449)/2048\n blr: 0.9169921875, // 1878/2048\n },\n 'courier new': {\n lhr: 1.1328125, // (0+1705+615)/2048\n blr: 0.83251953125, // 1705/2048\n },\n 'pingfang sc': {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06, // 1060/1000\n padding: {\n f: 0.5,\n },\n },\n simsun: {\n lhr: 1.4, // (0+1060+340)/1000\n blr: 1.06,\n padding: {\n f: 0.5,\n },\n },\n },\n support(fontFamily) {\n return this.info.hasOwnProperty(fontFamily);\n },\n register(name, info) {\n let { emSquare = 2048, ascent = 1854, descent = 434, lineGap = 67, padding = {} } = info || {};\n this.info[name.toLowerCase()] = {\n lhr: (ascent + descent + lineGap) / emSquare,\n blr: ascent / emSquare,\n padding,\n };\n },\n addPadding(name, padding) {\n Object.assign(this.info[name.toLowerCase()].padding, padding);\n },\n};\n\no.info['宋体'] = o.info.simsun;\n\nexport default o;\n","export default {\n position: /(([-+]?[\\d.]+[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') {\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(['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 = { _: 1 };\nconst TYPE_GM = { _: 2 };\nconst TYPE_CP = { _: 3 };\n\nexport default {\n TYPE_VD,\n TYPE_GM,\n TYPE_CP,\n};\n","import $$type from './$$type';\nimport mx from '../math/matrix';\n\nlet toString = {}.toString;\nfunction isType(type) {\n return function(obj) {\n return toString.call(obj) === '[object ' + type + ']';\n }\n}\n\nlet isObject = isType('Object');\nlet isString = isType('String');\nlet isFunction = isType('Function');\nlet isNumber = isType('Number');\nlet isBoolean = isType('Boolean');\nlet isDate = isType('Date');\n\nlet hasOwn = {}.hasOwnProperty;\nlet fnToString = hasOwn.toString;\nlet ObjectFunctionString = fnToString.call(Object);\n\nfunction isNil(v) {\n return v === undefined || v === null;\n}\n\nfunction joinSourceArray(arr) {\n let res = '';\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n res += joinSourceArray(item);\n }\n else {\n res += stringify(item);\n }\n }\n return res;\n}\n\nfunction stringify(s) {\n if(isNil(s)) {\n return '';\n }\n return s.toString();\n}\n\nfunction encodeHtml(s, prop) {\n if(prop) {\n return s.replace(/\"/g, '"');\n }\n return s.replace(/&/g, '&').replace(/ {\n s += joinDef(item);\n });\n s += '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n return s;\n}\n\n// 普通元素\nfunction joinVd(vd) {\n if(vd.type === 'item' || vd.type === 'img') {\n let s = '';\n (vd.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n if(vd.tagName === 'text') {\n return '' + vd.content + '';\n }\n return '<' + vd.tagName + s + '/>';\n }\n else if(vd.type === 'text') {\n let s = ``;\n // text有许多lineBox\n (vd.children || []).forEach(item => {\n s += joinVd(item);\n });\n return '' + s + '';\n }\n else if(vd.type === 'dom' || vd.type === 'geom') {\n let s = '';\n vd.bb.forEach(item => {\n s += joinVd(item);\n });\n s += ' {\n if(item.isMask) {\n return;\n }\n s += joinVd(item);\n });\n s += '';\n let { opacity, transform, visibility, mask, overflow, filter, mixBlendMode } = vd;\n return '' + s + '';\n }\n}\n\nfunction joinDef(def) {\n let s = '<' + def.tagName + ' id=\"' + def.uuid + '\"';\n if(def.tagName === 'mask' || def.tagName === 'clipPath') {\n // s += ' maskUnits=\"userSpaceOnUse\"';\n }\n else if(def.tagName === 'filter') {\n // s += ' filterUnits=\"userSpaceOnUse\"';\n }\n else {\n s += ' gradientUnits=\"userSpaceOnUse\"';\n }\n (def.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n (def.children || []).forEach(item => {\n s += joinItem(item);\n });\n s += '';\n return s;\n}\n\nfunction joinItem(item) {\n let s = '<' + item.tagName;\n (item.props || []).forEach(item => {\n s += ' ' + item[0] + '=\"' + item[1] + '\"';\n });\n s += '>';\n return s;\n}\n\nfunction rgba2int(color) {\n if(Array.isArray(color)) {\n return color;\n }\n let res = [];\n if(!color || color === 'transparent') {\n res = [0, 0, 0, 0];\n }\n else if(color.charAt(0) === '#') {\n color = color.slice(1);\n if(color.length === 3) {\n res.push(parseInt(color.charAt(0) + color.charAt(0), 16));\n res.push(parseInt(color.charAt(1) + color.charAt(1), 16));\n res.push(parseInt(color.charAt(2) + color.charAt(2), 16));\n res[3] = 1;\n }\n else if(color.length === 6) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4), 16));\n res[3] = 1;\n }\n else if(color.length === 8) {\n res.push(parseInt(color.slice(0, 2), 16));\n res.push(parseInt(color.slice(2, 4), 16));\n res.push(parseInt(color.slice(4, 6), 16));\n res.push(parseInt(color.slice(6), 16) / 255);\n }\n else {\n res[0] = res[1] = res[2] = 0;\n res[3] = 1;\n }\n }\n else {\n let c = color.match(/rgba?\\s*\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*,\\s*([\\d.]+)(?:\\s*,\\s*([\\d.]+))?\\s*\\)/i);\n if(c) {\n res = [parseInt(c[1]), parseInt(c[2]), parseInt(c[3])];\n if(!isNil(c[4])) {\n res[3] = parseFloat(c[4]);\n }\n else {\n res[3] = 1;\n }\n }\n else {\n res = [0, 0, 0, 0];\n }\n }\n return res;\n}\n\nfunction int2rgba(color) {\n if(Array.isArray(color)) {\n if(color.length === 4) {\n color = color.map((c, i) => i === 3 ? c : Math.floor(Math.max(0, c)));\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n color = color.map(c => Math.floor(c));\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return color || 'rgba(0,0,0,0)';\n}\n\nfunction int2invert(color) {\n if(Array.isArray(color)) {\n color = color.slice(0);\n color[0] = 255 - color[0];\n color[1] = 255 - color[1];\n color[2] = 255 - color[2];\n if(color.length === 4) {\n return 'rgba(' + joinArr(color, ',') + ')';\n }\n else if(color.length === 3) {\n return 'rgba(' + joinArr(color, ',') + ',1)';\n }\n }\n return 'rgba(0,0,0,0)';\n}\n\nfunction arr2hash(arr) {\n let hash = {};\n for(let i = 0, len = arr.length; i < len; i++) {\n let item = arr[i];\n if(Array.isArray(item)) {\n hash[item[0]] = item[1];\n }\n else {\n for(let list = Object.keys(item), j = list.length - 1; j >= 0; j--) {\n let k = list[j];\n hash[k] = item[k];\n }\n }\n }\n return hash;\n}\n\nfunction hash2arr(hash) {\n if(Array.isArray(hash)) {\n return hash;\n }\n let arr = [];\n for(let list = Object.keys(hash), i = 0, len = list.length; i < len; i++) {\n let k = list[i];\n arr.push([k, hash[k]]);\n }\n return arr;\n}\n\nfunction clone(obj) {\n if(isNil(obj) || typeof obj !== 'object') {\n return obj;\n }\n // parse递归会出现内部先返回解析好的json,外部parse不能clone\n if(obj.$$type === $$type.TYPE_VD\n || obj.$$type === $$type.TYPE_GM\n || obj.$$type === $$type.TYPE_CP) {\n return obj;\n }\n if(util.isDate(obj)) {\n return new Date(obj);\n }\n if(!isPlainObject(obj) && !Array.isArray(obj)) {\n return obj;\n }\n let n = Array.isArray(obj) ? [] : {};\n Object.keys(obj).forEach(i => {\n n[i] = clone(obj[i]);\n });\n return n;\n}\n\n/**\n * 简化的arr对比,arr中只有arr和其它类型,其它类型对比值或引用,arr递归\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equalArr(a, b) {\n if(!a || !b) {\n return a === b;\n }\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n let ai = a[i];\n let bi = b[i];\n let isArrayA = Array.isArray(ai);\n let isArrayB = Array.isArray(bi);\n if(isArrayA && isArrayB) {\n if(!equalArr(ai, bi)) {\n return false;\n }\n }\n else if(isArrayA || isArrayB) {\n return false;\n }\n else if(ai !== bi) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * 深度对比对象\n * @param a\n * @param b\n * @returns {boolean}\n */\nfunction equal(a, b) {\n if(a === b) {\n return true;\n }\n if(isObject(a) && isObject(b)) {\n let hash = {};\n for(let i = 0, arr = Object.keys(a), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!b.hasOwnProperty(k) || !equal(a[k], b[k])) {\n return false;\n }\n hash[k] = true;\n }\n // a没有b有则false\n for(let i = 0, arr = Object.keys(b), len = arr.length; i < len; i++) {\n let k = arr[i];\n if(!hash.hasOwnProperty(k)) {\n return false;\n }\n }\n }\n else if(isDate(a) && isDate(b)) {\n return a.getTime() === b.getTime();\n }\n else if(Array.isArray(a) && Array.isArray(b)) {\n if(a.length !== b.length) {\n return false;\n }\n for(let i = 0, len = a.length; i < len; i++) {\n if(!equal(a[i], b[i])) {\n return false;\n }\n }\n }\n else {\n return a === b;\n }\n return true;\n}\n\nfunction extend(target, source, keys) {\n if(source === null || typeof source !== 'object') {\n return target;\n }\n if(!keys) {\n keys = Object.keys(source);\n }\n let i = 0;\n let len = keys.length;\n while(i < len) {\n let k = keys[i];\n target[k] = source[k];\n i++;\n }\n return target;\n}\n\nfunction joinArr(arr, split) {\n let s = arr.length ? arr[0] : '';\n for(let i = 1, len = arr.length; i < len; i++) {\n s += split + arr[i];\n }\n return s;\n}\n\nfunction extendAnimate(ovd, nvd) {\n let list = nvd.__animationList = ovd.animationList.splice(0);\n list.forEach(item => {\n item.__setTarget(nvd);\n // 事件队列的缘故,可能动画本帧刚执行过,然后再继承,就会缺失,需再次赋值一遍;也有可能停留最后\n if(item.assigning || item.finished && item.__stayEnd()) {\n item.assignCurrentStyle();\n }\n });\n // 帧动画继承\n nvd.__frameAnimateList = ovd.__frameAnimateList.splice(0);\n}\n\nfunction transformBbox(bbox, matrix, dx = 0, dy = 0) {\n if(matrix && !mx.isE(matrix)) {\n let [x1, y1, x2, y2] = bbox;\n // 可能因filter的原因扩展范围\n if(dx) {\n x1 -= dx;\n x2 += dx;\n }\n if(dy) {\n y1 -= dy;\n y2 += dy;\n }\n let list = [x2, y1, x1, y2, x2, y2];\n let w;\n [x1, y1, , w] = mx.calPoint([x1, y1], matrix);\n if(w && w !== 1) {\n x1 /= w;\n y1 /= w;\n }\n let xa = x1, ya = y1, xb = x1, yb = y1;\n for(let i = 0; i < 6; i += 2) {\n let x = list[i], y = list[i + 1];\n [x, y, , w] = mx.calPoint([x, y], matrix);\n if(w && w !== 1) {\n x /= w;\n y /= w;\n }\n xa = Math.min(xa, x);\n xb = Math.max(xb, x);\n ya = Math.min(ya, y);\n yb = Math.max(yb, y);\n }\n bbox = [xa, ya, xb, yb];\n }\n else if(dx || dy) {\n bbox = bbox.slice(0);\n bbox[0] -= dx;\n bbox[1] -= dy;\n bbox[2] += dx;\n bbox[3] += dy;\n }\n return bbox;\n}\n\nfunction isPlainObject(obj) {\n if(!obj || toString.call(obj) !== '[object Object]') {\n return false;\n }\n let proto = Object.getPrototypeOf(obj);\n if(!proto) {\n return true;\n }\n let Ctor = hasOwn.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor === 'function' && fnToString.call(Ctor) === ObjectFunctionString;\n}\n\nfunction assignMatrix(t, v) {\n t[0] = v[0];\n t[1] = v[1];\n t[2] = v[2];\n t[3] = v[3];\n t[4] = v[4];\n t[5] = v[5];\n t[6] = v[6];\n t[7] = v[7];\n t[8] = v[8];\n t[9] = v[9];\n t[10] = v[10];\n t[11] = v[11];\n t[12] = v[12];\n t[13] = v[13];\n t[14] = v[14];\n t[15] = v[15];\n return t;\n}\n\nlet util = {\n isObject,\n isString,\n isFunction,\n isNumber,\n isBoolean,\n isDate,\n isNil,\n isPrimitive(v) {\n return util.isNil(v) || util.isBoolean(v) || util.isString(v) || util.isNumber(v);\n },\n // css中常用undefined/null表示auto本身\n isAuto(v) {\n return isNil(v) || v === 'auto';\n },\n isPlainObject,\n stringify,\n joinSourceArray(arr) {\n return joinSourceArray(arr);\n },\n encodeHtml,\n joinVirtualDom,\n joinVd,\n joinDef,\n rgba2int,\n int2rgba,\n int2invert,\n arr2hash,\n hash2arr,\n clone,\n equalArr,\n equal,\n extend,\n joinArr,\n extendAnimate,\n transformBbox,\n assignMatrix,\n};\n\nexport default util;\n","export default {\n flag: false,\n};\n","export default {\n list: [], // 每次渲染前的更新后,等待测量的文字对象列表\n data: {}, // Text中存入的特殊等待测量的信息,字体+字号+粗细为key\n charWidth: {}, // key的文字宽度hash\n padding: {}, // key的文字宽度偏移,少量字体的少量文字有\n ELLIPSIS: '…',\n};\n","export default {\n alpha: true,\n antialias: true,\n premultipliedAlpha: true,\n preserveDrawingBuffer: true,\n // depth: true,\n // stencil: true,\n};\n","import mx from '../math/matrix';\n\nconst calPoint = mx.calPoint;\n\n/**\n * 初始化 shader\n * @param gl GL context\n * @param vshader vertex shader (string)\n * @param fshader fragment shader (string)\n * @return program, if the program object was created and successfully made current\n */\nfunction initShaders(gl, vshader, fshader) {\n let program = createProgram(gl, vshader, fshader);\n if(!program) {\n throw new Error('Failed to create program');\n }\n\n // 要开启透明度,用以绘制透明的图形\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n return program;\n}\n\n/**\n * Create the linked program object\n * @param gl GL context\n * @param vshader a vertex shader program (string)\n * @param fshader a fragment shader program (string)\n * @return created program object, or null if the creation has failed\n */\nfunction createProgram(gl, vshader, fshader) {\n // Create shader object\n let vertexShader = loadShader(gl, gl.VERTEX_SHADER, vshader);\n let fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fshader);\n if(!vertexShader || !fragmentShader) {\n return null;\n }\n\n // Create a program object\n let program = gl.createProgram();\n if(!program) {\n return null;\n }\n program.vertexShader = vertexShader;\n program.fragmentShader = fragmentShader;\n\n // Attach the shader objects\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n // Link the program object\n gl.linkProgram(program);\n\n // Check the result of linking\n let linked = gl.getProgramParameter(program, gl.LINK_STATUS);\n if(!linked) {\n let error = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n gl.deleteShader(fragmentShader);\n gl.deleteShader(vertexShader);\n throw new Error('Failed to link program: ' + error);\n }\n return program;\n}\n\n/**\n * Create a shader object\n * @param gl GL context\n * @param type the type of the shader object to be created\n * @param source shader program (string)\n * @return created shader object, or null if the creation has failed.\n */\nexport function loadShader(gl, type, source) {\n // Create shader object\n let shader = gl.createShader(type);\n if(shader == null) {\n throw new Error('unable to create shader');\n }\n\n // Set the shader program\n gl.shaderSource(shader, source);\n\n // Compile the shader\n gl.compileShader(shader);\n\n // Check the result of compilation\n let compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n if(!compiled) {\n let error = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error('Failed to compile shader: ' + error);\n }\n\n return shader;\n}\n\nfunction convertCoords2Gl([x, y, z, w], cx, cy, revertY) {\n if(z === undefined) {\n z = 0;\n }\n if(w === undefined) {\n w = 1;\n }\n if(w && w !== 1) {\n x /= w;\n y /= w;\n z /= w;\n }\n if(x === cx) {\n x = 0;\n }\n else {\n x = (x - cx) / cx;\n }\n if(y === cy) {\n y = 0;\n }\n else {\n y = (y - cy) / cy;\n if(revertY) {\n y = -y;\n }\n }\n return [x * w, y * w, z * w, w];\n}\n\nfunction createTexture(gl, tex, n, width, height) {\n let texture = gl.createTexture();\n bindTexture(gl, texture, n);\n // gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, -1);\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n // 传入高宽时是绑定fbo,且tex一定为null\n if(width && height) {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n // 普通将canvas对象作为纹理\n else {\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, tex);\n }\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n return texture;\n}\n\nfunction bindTexture(gl, texture, n) {\n gl.activeTexture(gl['TEXTURE' + n]);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n}\n\n/**\n * texCache集满纹理上传占用最多可用纹理单元后,进行批量顺序绘制\n * 将所有dom的矩形顶点(经过transform变换后的)、贴图坐标、透明度存入3个buffer中,\n * 然后相同纹理单元的形成一批,设置uniform的纹理单元号进行绘制,如此循环\n * @param gl\n * @param list\n * @param hash\n * @param cx\n * @param cy\n * @param revertY\n */\nfunction drawTextureCache(gl, list, hash, cx, cy, revertY) {\n let vtPoint = [], vtTex = [], vtOpacity = [];\n let lastChannel; // 上一个dom的单元号\n let record = [0]; // [num, channel]每一批的数量和单元号记录\n let stack = [record]; // 所有批的数据记录集合\n list.forEach((item, i) => {\n let [cache, opacity, matrix, dx, dy] = item;\n if(i) {\n let channel = hash[cache.page.uuid];\n // 和上一个单元号不同时,生成新的批次记录\n if(lastChannel !== channel) {\n lastChannel = channel;\n record = [0, lastChannel];\n stack.push(record);\n }\n }\n else {\n lastChannel = hash[cache.page.uuid];\n record[1] = lastChannel;\n }\n let { x, y, width, height, page, bbox } = cache;\n // 计算顶点坐标和纹理坐标,转换[0,1]对应关系\n let bx = bbox[0], by = bbox[1];\n let [xa, ya] = [bx + (dx || 0), by + height + (dy || 0)];\n let [xb, yb] = [bx + width + (dx || 0), by + (dy || 0)];\n let [x1, y1, , w1] = calPoint([xa, ya], matrix);\n let [x2, y2, , w2] = calPoint([xb, ya], matrix);\n let [x3, y3, , w3] = calPoint([xb, yb], matrix);\n let [x4, y4, , w4] = calPoint([xa, yb], matrix);\n [x1, y1] = convertCoords2Gl([x1, y1, 0, w1], cx, cy, revertY);\n [x2, y2] = convertCoords2Gl([x2, y2, 0, w2], cx, cy, revertY);\n [x3, y3] = convertCoords2Gl([x3, y3, 0, w3], cx, cy, revertY);\n [x4, y4] = convertCoords2Gl([x4, y4, 0, w4], cx, cy, revertY);\n vtPoint.push(x1, y1, 0, w1, x4, y4, 0, w4, x2, y2, 0, w2, x4, y4, 0, w4, x2, y2, 0, w2, x3, y3, 0, w3);\n let tx1 = x / page.width, ty1 = (y + height) / page.height;\n let tx2 = (x + width) / page.width, ty2 = y / page.height;\n vtTex.push(tx1, ty1, tx1, ty2, tx2, ty1, tx1, ty2, tx2, ty1, tx2, ty2);\n vtOpacity.push(opacity, opacity, opacity, opacity, opacity, opacity);\n record[0]++;\n });\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtPoint), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.program, 'a_position');\n gl.vertexAttribPointer(a_position, 4, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtTex), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // opacity buffer\n let opacityBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, opacityBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vtOpacity), gl.STATIC_DRAW);\n let a_opacity = gl.getAttribLocation(gl.program, 'a_opacity');\n gl.vertexAttribPointer(a_opacity, 1, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_opacity);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.program, 'u_texture');\n let count = 0;\n // 循环按批次渲染\n stack.forEach(record => {\n let [num, channel] = record;\n gl.uniform1i(u_texture, channel);\n num *= 6;\n gl.drawArrays(gl.TRIANGLES, count, num);\n count += num;\n });\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.deleteBuffer(opacityBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n gl.disableVertexAttribArray(a_opacity);\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核扩大3倍性能慢\n * x/y方向分开执行,加速性能,计算次数由d*d变为d+d,d为卷积核大小\n * spread由d和sigma计算得出,d由sigma计算得出,sigma即css的blur()参数\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * i和j为total和filter的纹理单元,3次执行(x/y合起来算1次)需互换单元,来回执行源和结果\n * 由total变为filter时cache会各方向上扩展spread的大小到width/height\n * 因此第一次绘制时坐标非1,后面则固定1\n * @param gl\n * @param program\n * @param frameBuffer\n * @param texCache\n * @param tex1 初次绘制目标纹理\n * @param tex2 初次绘制源纹理\n * @param i 初次绘制目标纹理单元\n * @param j 初次绘制源纹理单元\n * @param width\n * @param height\n * @param cx\n * @param cy\n * @param spread\n * @param d\n * @param sigma\n */\nfunction drawBlur(gl, program, frameBuffer, texCache, tex1, tex2, i, j, width, height, cx, cy, spread, d, sigma) {\n // 第一次将total绘制到blur上,此时尺寸存在spread差值,因此不加模糊防止坐标计算问题,仅作为扩展纹理尺寸\n let [x1, y2] = convertCoords2Gl([spread, height - spread], cx, cy);\n let [x2, y1] = convertCoords2Gl([width - spread, spread], cx, cy);\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // direction全0,即无模糊,此时只是进行扩展尺寸操作,还没到模糊所以传0\n let u_direction = gl.getUniformLocation(program, 'u_direction');\n gl.uniform2f(u_direction, 0, 0);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // fbo绑定切换纹理对象和单元索引,同时注意不能向源纹理绘制,因为源是cacheTotal,需要重新生成一个,y方向再来一次\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n /**\n * 反复执行共3次,坐标等均不变,只是切换fbo绑定对象和纹理单元\n * 注意max和ratio的设置,当是100尺寸的正方形时,传给direction的始终为1\n * 当正方形<100时,direction相应地要扩大相对于100的倍数,反之则缩小,如此为了取相邻点坐标时是+-1\n * 当非正方形时,长轴一端为基准值不变,短的要二次扩大比例倍数\n */\n let max = 100 / Math.max(width, height);\n let ratio = width / height;\n let recycle = []; // 3次过程中新生成的中间纹理需要回收\n for(let k = 0; k < 3; k++) {\n let tex3 = createTexture(gl, null, j, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex3, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, max, 0);\n }\n else {\n gl.uniform2f(u_direction, max * ratio, 0);\n }\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n recycle.push(tex1);\n let tex4 = createTexture(gl, null, i, width, height);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex4, 0);\n if(width >= height) {\n gl.uniform2f(u_direction, 0, max * ratio);\n }\n else {\n gl.uniform2f(u_direction, 0, max);\n }\n gl.uniform1i(u_texture, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n tex1 = tex4;\n recycle.push(tex3);\n }\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n recycle.forEach(item => gl.deleteTexture(item));\n return tex1;\n}\n\nfunction drawCm(gl, program, i, m) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(program, 'u_texture');\n gl.uniform1i(u_texture, i);\n // matrix\n let u_m = gl.getUniformLocation(program, 'u_m');\n gl.uniform1fv(u_m, new Float32Array(m));\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n // 回收\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\n/**\n * 根据total/filter生成overflow\n * @param gl\n * @param i 输入纹理单元\n * @param dx 二者偏移值\n * @param dy\n * @param width 最终大小\n * @param height\n * @param w 输入纹理大小\n * @param h\n */\nfunction drawOverflow(gl, i, dx, dy, width, height, w, h) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(gl.programOverflow, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer,原本大小width/height,使用其中的w/h\n let x1 = dx / w, y1 = dy / h, x2 = (width + dx) / w, y2 = (height + dy) /h;\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n x1, y1,\n x1, y2,\n x2, y1,\n x1, y2,\n x2, y1,\n x2, y2,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(gl.programOverflow, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture = gl.getUniformLocation(gl.programOverflow, 'u_texture');\n gl.uniform1i(u_texture, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n}\n\nfunction drawMask(gl, i, j, program) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, j);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, i);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nfunction drawMbm(gl, program, i, j, W, H) {\n // 顶点buffer\n let pointBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pointBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n -1, -1,\n -1, 1,\n 1, -1,\n -1, 1,\n 1, -1,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_position = gl.getAttribLocation(program, 'a_position');\n gl.vertexAttribPointer(a_position, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_position);\n // 纹理buffer\n let texBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, texBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n 0, 0,\n 0, 1,\n 1, 0,\n 0, 1,\n 1, 0,\n 1, 1,\n ]), gl.STATIC_DRAW);\n let a_texCoords = gl.getAttribLocation(program, 'a_texCoords');\n gl.vertexAttribPointer(a_texCoords, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(a_texCoords);\n // 纹理单元\n let u_texture1 = gl.getUniformLocation(program, 'u_texture1');\n gl.uniform1i(u_texture1, i);\n let u_texture2 = gl.getUniformLocation(program, 'u_texture2');\n gl.uniform1i(u_texture2, j);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.deleteBuffer(pointBuffer);\n gl.deleteBuffer(texBuffer);\n gl.disableVertexAttribArray(a_position);\n gl.disableVertexAttribArray(a_texCoords);\n}\n\nexport default {\n initShaders,\n createTexture,\n bindTexture,\n drawTextureCache,\n drawBlur,\n drawOverflow,\n drawMask,\n drawMbm,\n drawCm,\n};\n","import util from './util';\nimport debug from './debug';\nimport textCache from '../node/textCache';\nimport font from '../style/font';\nimport ca from '../gl/ca';\nimport webgl from '../gl/webgl';\n\nconst SPF = 1000 / 60;\n\nconst CANVAS = {};\nconst WEBGL = {};\nconst CANVAS_LIST = [];\nconst WEBGL_LIST = [];\nconst SUPPORT_OFFSCREEN_CANVAS = typeof OffscreenCanvas === 'function' && util.isFunction(OffscreenCanvas.prototype.getContext);\n\nlet defaultFontFamilyData;\n\nfunction cache(key, width, height, hash, message) {\n let o;\n if(!key) {\n let target = hash === CANVAS ? CANVAS_LIST : WEBGL_LIST;\n if(target.length) {\n o = target.pop();\n }\n else {\n o = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n }\n else if(!hash[key]) {\n o = hash[key] = !debug.flag && SUPPORT_OFFSCREEN_CANVAS ? new OffscreenCanvas(width, height) : document.createElement('canvas');\n }\n else {\n o = hash[key];\n }\n o.width = width;\n o.height = height;\n if(debug.flag) {\n o.style.width = width + 'px';\n o.style.height = height + 'px';\n o.setAttribute('type', hash === CANVAS ? 'canvas' : 'webgl');\n if(key) {\n o.setAttribute('key', key);\n }\n if(message) {\n o.setAttribute('message', message);\n }\n document.body.appendChild(o);\n }\n let ctx;\n if(hash === CANVAS) {\n ctx = o.getContext('2d');\n }\n else {\n ctx = o.getContext('webgl', ca) || o.getContext('experimental-webgl', ca);\n }\n return {\n canvas: o,\n ctx,\n draw() {\n // 空函数,仅对小程序提供hook特殊处理,flush缓冲\n },\n enabled: true,\n available: true,\n release() {\n if(!key && this.available) {\n if(hash === CANVAS) {\n CANVAS_LIST.push(this.canvas);\n }\n else {\n WEBGL_LIST.push(this.canvas);\n }\n }\n this.available = false;\n },\n };\n}\n\nfunction cacheCanvas(key, width, height, message) {\n return cache(key, width, height, CANVAS, message);\n}\n\nfunction cacheWebgl(key, width, height, message) {\n return cache(key, width, height, WEBGL, message);\n}\n\nconst IMG = {};\nconst INIT = 0;\nconst LOADING = 1;\nconst LOADED = 2;\nconst FONT = {};\nconst COMPONENT = {};\n\nlet inject = {\n measureText() {\n let { list, data } = textCache;\n let html = '';\n let keys = [];\n let lengths = [];\n let chars = [];\n Object.keys(data).forEach(key => {\n let { ff, fs, fw, s } = data[key];\n if(s) {\n keys.push(key);\n lengths.push(s.length);\n let inline = `position:absolute;font-family:${ff};font-size:${fs}px;font-weight:${fw}`;\n for(let i = 0, len = s.length; i < len; i++) {\n let char = s.charAt(i);\n chars.push(char);\n html += `${char.replace(/`;\n }\n data[key].s = '';\n }\n });\n if(!html) {\n return;\n }\n let div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n document.body.appendChild(div);\n div.innerHTML = html;\n let cns = div.childNodes;\n let { charWidth } = textCache;\n let count = 0, index = 0, key;\n for(let i = 0, len = cns.length; i < len; i++) {\n let node = cns[i];\n if(count === 0) {\n key = keys[index];\n }\n if(++count === lengths[index]) {\n index++;\n count = 0;\n }\n let char = chars[i];\n // clientWidth只返回ceil整数,精度必须用getComputedStyle\n let css = window.getComputedStyle(node, null);\n charWidth[key][char] = parseFloat(css.width);\n }\n list.forEach(text => text.__measureCb());\n textCache.list = [];\n textCache.data = {};\n if(!debug.flag) {\n document.body.removeChild(div);\n }\n },\n measureTextSync(key, ff, fs, fw, char) {\n let inline = `position:absolute;font-family:${ff};font-size:${fs}px;font-weight:${fw}`;\n let html = `${char}${char}${char}`;\n let div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '99999px';\n div.style.top = '-99999px';\n div.style.visibility = 'hidden';\n document.body.appendChild(div);\n div.innerHTML = html;\n let cns = div.childNodes;\n let w1 = parseFloat(window.getComputedStyle(cns[0], null).width);\n let w2 = parseFloat(window.getComputedStyle(cns[1], null).width);\n return w1 * 2 - w2;\n },\n IMG,\n INIT,\n LOADED,\n LOADING,\n measureImg(url, cb) {\n if(Array.isArray(url)) {\n if(!url.length) {\n return cb();\n }\n let count = 0;\n let len = url.length;\n let list = [];\n url.forEach((item, i) => {\n inject.measureImg(item, function(cache) {\n list[i] = cache;\n if(++count === len) {\n cb(list);\n }\n });\n });\n return;\n }\n else if(!url || !util.isString(url)) {\n inject.error('Measure img invalid: ' + url);\n cb && cb({\n state: LOADED,\n success: false,\n url,\n });\n return;\n }\n let cache = IMG[url] = IMG[url] || {\n state: INIT,\n task: [],\n };\n if(cache.state === LOADED) {\n cb && cb(cache);\n }\n else if(cache.state === LOADING) {\n cb && cache.task.push(cb);\n }\n else {\n cache.state = LOADING;\n cb && cache.task.push(cb);\n let img = new Image();\n img.onload = function() {\n cache.state = LOADED;\n cache.success = true;\n cache.width = img.width;\n cache.height = img.height;\n cache.source = img;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n img.onerror = function(e) {\n cache.state = LOADED;\n cache.success = false;\n cache.url = url;\n let list = cache.task.splice(0);\n list.forEach(cb => cb(cache));\n };\n if(url.substr(0, 5) !== 'data:') {\n let host = /^(?:\\w+:)?\\/\\/([^/:]+)/.exec(url);\n if(host) {\n if(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%]+)?/ig) || [];\n o.v = v.map(item => {\n let color = /((?:#[0-9a-f]{3,8})|(?:rgba?\\s*\\(.+?\\)))/i.exec(item);\n let arr = [rgba2int(color[1])];\n let percent = /[-+]?[\\d.]+[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: '#000',\n borderRightColor: '#000',\n borderBottomColor: '#000',\n borderLeftColor: '#000',\n borderTopStyle: 'solid',\n borderRightStyle: 'solid',\n borderBottomStyle: 'solid',\n borderLeftStyle: 'solid',\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n borderBottomLeftRadius: 0,\n width: 'auto',\n height: 'auto',\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto',\n flexDirection: 'row',\n flexWrap: 'nowrap',\n order: 0,\n justifyContent: 'flexStart',\n alignItems: 'stretch',\n alignSelf: 'auto',\n alignContent: 'stretch',\n textAlign: 'inherit',\n letterSpacing: 'inherit',\n transformOrigin: 'center',\n visibility: 'inherit',\n opacity: 1,\n zIndex: 0,\n transform: null,\n translateX: 0,\n translateY: 0,\n translateZ: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n skewX: 0,\n skewY: 0,\n rotateX: 0,\n rotateY: 0,\n rotateZ: 0,\n rotate3d: '0, 0, 0, 0',\n perspective: 0,\n perspectiveOrigin: 'center',\n filter: null,\n boxShadow: null,\n pointerEvents: 'inherit',\n overflow: 'visible',\n mixBlendMode: 'normal',\n whiteSpace: 'inherit',\n textOverflow: 'clip',\n lineClamp: 0,\n textStrokeWidth: 'inherit',\n textStrokeColor: 'inherit',\n textStrokeOver: 'inherit',\n};\n\nconst GEOM = {\n fill: 'transparent',\n stroke: '#000',\n strokeWidth: 1,\n strokeDasharray: '',\n strokeLinecap: 'butt',\n strokeLinejoin: 'miter',\n strokeMiterlimit: 4,\n fillRule: 'nonzero',\n};\n\nlet DOM_ENTRY_SET = [];\nlet DOM_KEY_SET = [];\nObject.keys(DOM).forEach(k => {\n DOM_KEY_SET.push(k);\n let v = DOM[k];\n DOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet GEOM_ENTRY_SET = [];\nlet GEOM_KEY_SET = [];\nObject.keys(GEOM).forEach(k => {\n GEOM_KEY_SET.push(k);\n let v = GEOM[k];\n GEOM_ENTRY_SET.push({\n k,\n v,\n });\n});\n\nlet INHERIT = {\n fontFamily: 'arial',\n fontSize: 16,\n fontWeight: 400,\n fontStyle: 'normal',\n color: '#000',\n textAlign: 'left',\n visibility: 'visible',\n pointerEvents: 'auto',\n textStrokeColor: '#000',\n textStrokeWidth: 1,\n textStrokeOver: 'none',\n};\n\nlet INHERIT_KEY_SET = [];\nObject.keys(INHERIT).forEach(k => {\n INHERIT_KEY_SET.push(k);\n});\n\nexport default {\n DOM,\n GEOM,\n isValid(i) {\n return DOM.hasOwnProperty(i) || GEOM.hasOwnProperty(i);\n },\n DOM_KEY_SET,\n GEOM_KEY_SET,\n DOM_ENTRY_SET,\n GEOM_ENTRY_SET,\n INHERIT,\n INHERIT_KEY_SET,\n};\n","import reg from './reg';\nimport util from '../util/util';\n\nlet { isNil } = util;\n\nfunction parseFlex(style, grow, shrink, basis) {\n if(isNil(style.flexGrow)) {\n style.flexGrow = grow || 0;\n }\n if(isNil(style.flexShrink)) {\n style.flexShrink = shrink || 0;\n }\n if(isNil(style.flexBasis)) {\n style.flexBasis = basis || 0;\n }\n}\n\nfunction parseMarginPadding(style, key, list) {\n let temp = style[key];\n if(!isNil(temp)) {\n let match = temp.toString().match(/([-+]?[\\d.]+[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 // 扩展css,将transform几个值拆分为独立的css为动画准备,同时不能使用transform\n ['translate', 'scale', 'skew', 'translate3d', 'scale3d', 'rotate'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n abbr.toFull(style, k);\n }\n });\n // 扩展的不能和transform混用,给出警告\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate3d',\n ].forEach(k => {\n let v = style[k];\n if(!isNil(v) && style.transform) {\n inject.warn(`Can not use expand style \"${k}\" with transform`);\n }\n });\n // 默认reset,根据传入不同,当style为空时覆盖\n reset.forEach(item => {\n let { k, v } = item;\n if(isNil(style[k])) {\n style[k] = v;\n }\n });\n // 背景图\n temp = style.backgroundImage;\n if(temp !== undefined) {\n if(!temp) {\n res[BACKGROUND_IMAGE] = [null];\n }\n else if(Array.isArray(temp)) {\n res[BACKGROUND_IMAGE] = temp.map(item => {\n if(!item) {\n return null;\n }\n if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n if(reg.img.test(item)) {\n return reg.img.exec(item)[2];\n }\n return null;\n });\n }\n // 区分是渐变色还是图\n else if(reg.gradient.test(temp)) {\n res[BACKGROUND_IMAGE] = [gradient.parseGradient(temp)];\n }\n else if(reg.img.test(temp)) {\n res[BACKGROUND_IMAGE] = [reg.img.exec(temp)[2]];\n }\n else {\n res[BACKGROUND_IMAGE] = [null];\n }\n }\n temp = style.backgroundColor;\n if(temp) {\n // 先赋值默认透明,后续操作有合法值覆盖\n let bgc = /^#[0-9a-f]{3,8}/i.exec(temp);\n if(bgc && [4, 7, 9].indexOf(bgc[0].length) > -1) {\n res[BACKGROUND_COLOR] = [rgba2int(bgc[0]), RGBA];\n }\n else {\n bgc = /rgba?\\s*\\(.+\\)/i.exec(temp);\n res[BACKGROUND_COLOR] = [rgba2int(bgc ? bgc[0] : [0, 0, 0, 0]), RGBA];\n }\n }\n ['backgroundPositionX', 'backgroundPositionY'].forEach((k, i) => {\n temp = style[k];\n if(!isNil(temp)) {\n k = i ? BACKGROUND_POSITION_Y : BACKGROUND_POSITION_X;\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[k] = temp.map(item => {\n if(/^[-+]?[\\d.]/.test(item)) {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n return v;\n }\n else {\n return [\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item] || 0,\n PERCENT,\n ];\n }\n });\n }\n });\n // 背景尺寸\n temp = style.backgroundSize;\n if(temp) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[BACKGROUND_SIZE] = temp.map(item => {\n if(!item) {\n return [\n [0, AUTO],\n [0, AUTO],\n ];\n }\n let match = item.toString().match(/\\b(?:([-+]?[\\d.]+[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(!isNil(v)) {\n res[STYLE_KEY[style2Upper(k)]] = [rgba2int(v), RGBA];\n }\n });\n // border-radius\n ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'].forEach(k => {\n k = 'border' + k + 'Radius';\n let v = style[k];\n if(!isNil(v)) {\n let arr = v.toString().split(/\\s+/);\n if(arr.length === 1) {\n arr[1] = arr[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = arr[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n if(n[0] < 0) {\n n[0] = 0;\n }\n arr[i] = n;\n }\n else {\n arr[i] = [0, PX];\n }\n }\n res[STYLE_KEY[style2Upper(k)]] = arr;\n }\n });\n temp = style.transform;\n if(temp) {\n let transform = res[TRANSFORM] = [];\n let match = (temp || '').toString().match(/\\w+\\(.+?\\)/g);\n if(match) {\n match.forEach(item => {\n let i = item.indexOf('(');\n let k = item.slice(0, i);\n let v = item.slice(i + 1, item.length - 1);\n if(k === 'matrix') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 6) {\n arr = arr.slice(0, 6);\n }\n if(arr.length === 6) {\n transform.push([MATRIX, [\n arr[0], arr[1], 0, 0, arr[2], arr[3], 0, 0, 0, 0, 1, 0, arr[4], arr[5], 0, 1,\n ]]);\n }\n }\n else if(k === 'matrix3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n arr = arr.map(item => parseFloat(item));\n if(arr.length > 16) {\n arr = arr.slice(0, 16);\n }\n if(arr.length === 16) {\n transform.push([MATRIX, arr]);\n }\n }\n else if(k === 'perspective') {\n let arr = calUnit(v);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n transform.push([PERSPECTIVE, arr]);\n }\n else if(k === 'rotate3d') {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n transform.push([ROTATE_3D, arr]);\n }\n }\n else if(TRANSFORM_HASH.hasOwnProperty(k)) {\n let k2 = TRANSFORM_HASH[k];\n let arr = calUnit(v);\n compatibleTransform(k2, arr);\n transform.push([k2, arr]);\n }\n else if({ translate: true, scale: true, skew: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale' ? arr[0] : [0];\n }\n if(arr.length === 2) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n }\n }\n else if({ translate3d: true, scale3d: true }.hasOwnProperty(k)) {\n let arr = v.toString().split(/\\s*,\\s*/);\n if(arr.length === 1) {\n arr[1] = k === 'scale3d' ? [1] : [0];\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n else if(arr.length === 2) {\n arr[2] = k === 'scale3d' ? [1] : [0];\n }\n if(arr.length === 3) {\n let k1 = STYLE_KEY[style2Upper(k + 'X')];\n let k2 = STYLE_KEY[style2Upper(k + 'Y')];\n let k3 = STYLE_KEY[style2Upper(k + 'Z')];\n let arr1 = calUnit(arr[0]);\n let arr2 = calUnit(arr[1]);\n let arr3 = calUnit(arr[2]);\n compatibleTransform(k1, arr1);\n compatibleTransform(k2, arr2);\n compatibleTransform(k3, arr3);\n transform.push([k1, arr1]);\n transform.push([k2, arr2]);\n transform.push([k3, arr3]);\n }\n }\n });\n }\n }\n temp = style.perspective;\n if(!isNil(temp)) {\n let arr = calUnit(temp);\n if(arr[0] < 0) {\n arr[0] = 0;\n }\n compatibleTransform(PERSPECTIVE, arr);\n res[PERSPECTIVE] = arr;\n }\n ['perspectiveOrigin', 'transformOrigin'].forEach(k => {\n temp = style[k];\n if(!isNil(temp)) {\n let arr = res[STYLE_KEY[style2Upper(k)]] = [];\n let match = temp.toString().match(reg.position);\n if(match) {\n if(match.length === 1) {\n match[1] = match[0];\n }\n for(let i = 0; i < 2; i++) {\n let item = match[i];\n if(/^[-+]?[\\d.]/.test(item)) {\n let n = calUnit(item);\n if([NUMBER, DEG].indexOf(n[1]) > -1) {\n n[1] = PX;\n }\n arr.push(n);\n }\n else {\n arr.push([\n {\n top: 0,\n left: 0,\n center: 50,\n right: 100,\n bottom: 100,\n }[item],\n PERCENT,\n ]);\n // 不规范的写法变默认值50%\n if(isNil(arr[i][0])) {\n arr[i][0] = 50;\n }\n }\n }\n }\n else {\n arr.push([50, PERCENT]);\n arr.push([50, PERCENT]);\n }\n }\n });\n [\n 'translateX',\n 'translateY',\n 'translateZ',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skewX',\n 'skewY',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'rotate',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n let k2 = TRANSFORM_HASH[k];\n let n = calUnit(v);\n // 没有单位或默认值处理单位\n compatibleTransform(k2, n);\n res[k2] = n;\n });\n temp = style.rotate3d;\n if(temp) {\n let arr = temp.toString().split(/\\s*,\\s*/);\n if(arr.length === 4) {\n let deg = calUnit(arr[3]);\n compatibleTransform(ROTATE_3D, deg);\n arr[0] = parseFloat(arr[0]);\n arr[1] = parseFloat(arr[1]);\n arr[2] = parseFloat(arr[2]);\n arr[3] = deg;\n res[ROTATE_3D] = arr;\n }\n }\n temp = style.opacity;\n if(!isNil(temp)) {\n temp = parseFloat(temp);\n if(!isNaN(temp)) {\n temp = Math.max(temp, 0);\n temp = Math.min(temp, 1);\n res[OPACITY] = temp;\n }\n else {\n res[OPACITY] = 1;\n }\n }\n temp = style.zIndex;\n if(!isNil(temp)) {\n res[Z_INDEX] = parseInt(temp) || 0;\n }\n // 转化不同单位值为对象标准化,不写单位的变成number单位转化为px\n [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'width',\n 'height',\n ].forEach(k => {\n let v = style[k];\n if(isNil(v)) {\n return;\n }\n if(v === 'auto') {\n v = [0, AUTO];\n }\n else {\n v = calUnit(v);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n let k2 = STYLE_KEY[style2Upper(k)];\n res[k2] = v;\n // 限制padding/border为正数\n if({\n paddingTop: true,\n paddingRight: true,\n paddingBottom: true,\n paddingLeft: true,\n borderTopWidth: true,\n borderRightWidth: true,\n borderBottomWidth: true,\n borderLeftWidth: true,\n width: true,\n height: true,\n }.hasOwnProperty(k) && v[0] < 0) {\n v[0] = 0;\n }\n });\n temp = style.flexBasis;\n if(!isNil(temp)) {\n if(temp === 'content') {\n res[FLEX_BASIS] = [temp, STRING];\n }\n else if(/^[\\d.]/.test(temp)) {\n let v = res[FLEX_BASIS] = calUnit(temp);\n v[0] = Math.max(v[0], 0);\n // 无单位视为px\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n }\n else {\n res[FLEX_BASIS] = [0, AUTO];\n }\n }\n temp = style.order;\n if(!isNil(temp)) {\n res[ORDER] = parseInt(temp) || 0;\n }\n temp = style.color;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[COLOR] = [[], INHERIT];\n }\n else {\n res[COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.textStrokeColor;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_COLOR] = [[], INHERIT];\n }\n else {\n res[TEXT_STROKE_COLOR] = [rgba2int(temp), RGBA];\n }\n }\n temp = style.fontSize;\n if(temp || temp === 0) {\n if(temp === 'inherit') {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // fontSize不能为负数,否则为继承\n if(v < 0) {\n res[FONT_SIZE] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[FONT_SIZE] = v;\n }\n }\n }\n temp = style.textStrokeWidth;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n let v = calUnit(temp);\n // textStrokeWidth不能为负数,否则为继承\n if(v < 0) {\n res[TEXT_STROKE_WIDTH] = [0, INHERIT];\n }\n else {\n if([NUMBER, DEG, PERCENT].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[TEXT_STROKE_WIDTH] = v;\n }\n }\n }\n temp = style.textStrokeOver;\n if(!isNil(temp)) {\n if(temp === 'inherit') {\n res[TEXT_STROKE_OVER] = [0, INHERIT];\n }\n else {\n let v = temp.toString();\n if(v !== 'none' && v !== 'fill') {\n v = 'none';\n }\n res[TEXT_STROKE_OVER] = [v, STRING];\n }\n }\n temp = style.fontWeight;\n if(!isNil(temp)) {\n if(temp === 'bold') {\n res[FONT_WEIGHT] = [700, NUMBER];\n }\n else if(temp === 'normal') {\n res[FONT_WEIGHT] = [400, NUMBER];\n }\n else if(temp === 'lighter') {\n res[FONT_WEIGHT] = [200, NUMBER];\n }\n else if(temp === 'inherit') {\n res[FONT_WEIGHT] = [0, INHERIT];\n }\n else {\n res[FONT_WEIGHT] = [Math.max(0, parseInt(temp)) || 400, NUMBER];\n }\n }\n temp = style.fontStyle;\n if(temp) {\n if(temp === 'inherit') {\n res[FONT_STYLE] = [0, INHERIT];\n }\n else {\n res[FONT_STYLE] = [temp, STRING];\n }\n }\n temp = style.fontFamily;\n if(temp) {\n if(temp === 'inherit') {\n res[FONT_FAMILY] = [0, INHERIT];\n }\n else {\n // 统一文字声明格式\n res[FONT_FAMILY] = [temp.toString().toLowerCase().replace(/['\"]/, '').replace(/\\s*,\\s*/g, ','), STRING];\n }\n }\n temp = style.textAlign;\n if(temp) {\n if(temp === 'inherit') {\n res[TEXT_ALIGN] = [0, INHERIT];\n }\n else {\n res[TEXT_ALIGN] = [temp, STRING];\n }\n }\n temp = style.lineHeight;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LINE_HEIGHT] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LINE_HEIGHT] = [0, AUTO];\n }\n // lineHeight默认数字,想要px必须强制带单位\n else if(/^[\\d.]+/i.test(temp)) {\n let v = calUnit(temp);\n if([DEG].indexOf(v[1]) > -1) {\n v[1] = NUMBER;\n }\n res[LINE_HEIGHT] = v;\n }\n else {\n let n = Math.max(0, parseFloat(temp)) || 'normal';\n // 非法数字\n if(n === 'normal') {\n res[LINE_HEIGHT] = [null, AUTO];\n }\n else {\n res[LINE_HEIGHT] = [n, NUMBER];\n }\n }\n }\n temp = style.letterSpacing;\n if(temp !== undefined) {\n if(temp === 'inherit') {\n res[LETTER_SPACING] = [0, INHERIT];\n }\n else if(temp === 'normal') {\n res[LETTER_SPACING] = [0, PX];\n }\n else if(/^[-+]?[\\d.]/.test(temp)) {\n let v = calUnit(temp);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n res[LETTER_SPACING] = v;\n }\n else {\n res[LETTER_SPACING] = [parseFloat(temp) || 0, PX];\n }\n }\n temp = style.whiteSpace;\n if(temp) {\n if(temp === 'inherit') {\n res[WHITE_SPACE] = [0, INHERIT];\n }\n else {\n res[WHITE_SPACE] = [temp, STRING];\n }\n }\n temp = style.lineClamp;\n if(temp !== undefined) {\n temp = parseInt(temp) || 0;\n res[LINE_CLAMP] = Math.max(0, temp);\n }\n // fill和stroke为渐变时特殊处理,fillRule无需处理字符串\n temp = style.fill;\n if(temp !== undefined) {\n if(!temp) {\n res[FILL] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[FILL] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[FILL] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[FILL] = [gradient.parseGradient(temp)];\n }\n else {\n res[FILL] = [rgba2int(temp)];\n }\n }\n temp = style.stroke;\n if(temp !== undefined) {\n if(!temp) {\n res[STROKE] = ['none'];\n }\n else if(Array.isArray(temp)) {\n if(temp.length) {\n res[STROKE] = temp.map(item => {\n if(!item) {\n return 'none';\n }\n else if(reg.gradient.test(item)) {\n return gradient.parseGradient(item);\n }\n else {\n return rgba2int(item);\n }\n });\n }\n else {\n res[STROKE] = ['none'];\n }\n }\n else if(reg.gradient.test(temp)) {\n res[STROKE] = [gradient.parseGradient(temp)];\n }\n else {\n res[STROKE] = [rgba2int(temp)];\n }\n }\n temp = style.strokeWidth;\n if(!isNil(temp)) {\n if(!Array.isArray(temp)) {\n temp = [temp];\n }\n res[STROKE_WIDTH] = temp.map(item => {\n let v = calUnit(item);\n if([NUMBER, DEG].indexOf(v[1]) > -1) {\n v[1] = PX;\n }\n v[0] = Math.max(v[0], 0);\n return v;\n });\n }\n temp = style.strokeDasharray;\n if(!isNil(temp)) {\n if(Array.isArray(temp)) {\n res[STROKE_DASHARRAY] = temp.map(item => {\n let match = item.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n return match;\n }\n return [];\n });\n }\n else {\n let match = temp.toString().match(/[\\d.]+/g);\n if(match) {\n match = match.map(item => parseFloat(item));\n if(match.length % 2 === 1) {\n match.push(match[match.length - 1]);\n }\n res[STROKE_DASHARRAY] = [match];\n }\n else {\n res[STROKE_DASHARRAY] = [[]];\n }\n }\n }\n temp = style.filter;\n if(temp !== undefined) {\n let match = (temp || '').toString().match(/\\b[\\w-]+\\s*\\(\\s*[-+]?[\\d.]+\\s*[pxremvwhdg%]*\\s*\\)\\s*/ig);\n let f = null;\n if(match) {\n f = [];\n match.forEach(item => {\n let m2 = /([\\w-]+)\\s*\\(\\s*([-+]?[\\d.]+\\s*[pxremvwhdg%]*)\\s*\\)\\s*/i.exec(item);\n if(m2) {\n let k = m2[1].toLowerCase(), v = calUnit(m2[2]);\n if(k === 'blur') {\n if(v[0] <= 0 || [DEG, PERCENT].indexOf(v[1]) > -1) {\n return;\n }\n if(v[1] === NUMBER) {\n v[1] = PX;\n }\n f.push([k, v]);\n }\n else if(k === 'hue-rotate') {\n if([NUMBER, DEG].indexOf(v[1]) === -1) {\n return;\n }\n v[1] = DEG;\n f.push([k, v]);\n }\n else if(k === 'saturate' || k === 'brightness' || k === 'grayscale' || k === 'contrast') {\n if([NUMBER, PERCENT].indexOf(v[1]) === -1) {\n return;\n }\n v[0] = Math.max(v[0], 0);\n v[1] = PERCENT;\n f.push([k, v]);\n }\n }\n });\n }\n res[FILTER] = f;\n }\n temp = style.visibility;\n if(temp) {\n if(temp === 'inherit') {\n res[VISIBILITY] = [0, INHERIT];\n }\n else {\n res[VISIBILITY] = [temp, STRING];\n }\n }\n temp = style.pointerEvents;\n if(temp) {\n if(temp === 'inherit') {\n res[POINTER_EVENTS] = [0, INHERIT];\n }\n else {\n res[POINTER_EVENTS] = [temp, STRING];\n }\n }\n temp = style.boxShadow;\n if(temp !== undefined) {\n let bs = null;\n let match = (temp || '').match(/([-+]?[\\d.]+[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(!isNil(temp)) {\n res[Z_INDEX] = parseFloat(temp) || 0;\n }\n // 这些支持多个的用数组表示\n [\n 'backgroundRepeat',\n 'strokeLinecap',\n 'strokeLinejoin',\n 'strokeMiterlimit',\n 'fillRule',\n ].forEach(k => {\n if(style.hasOwnProperty(k)) {\n let v = style[k];\n res[STYLE_KEY[style2Upper(k)]] = Array.isArray(v) ? v : [v];\n }\n });\n GEOM_KEY_SET.forEach(k => {\n if(style.hasOwnProperty(k)) {\n res[k] = style[k];\n }\n });\n return res;\n}\n\n/**\n * 第一次和REFLOW等级下,刷新前首先执行,生成computedStyle\n * 影响文字测量的只有字体和大小和重量,需要提前处理\n * 继承相关的计算\n * @param node 对象节点\n * @param isRoot 是否是根节点,无继承需使用默认值\n */\nfunction computeMeasure(node, isRoot) {\n let { currentStyle, computedStyle, domParent } = node;\n let parentComputedStyle = !isRoot && domParent.computedStyle;\n MEASURE_KEY_SET.forEach(k => {\n let v = currentStyle[k];\n // ff特殊处理\n if(k === FONT_FAMILY) {\n if(v[1] === INHERIT) {\n computedStyle[k] = getFontFamily(isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k]);\n }\n else {\n computedStyle[k] = getFontFamily(v[0]);\n }\n }\n else if(v[1] === INHERIT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : parentComputedStyle[k];\n }\n // 只有fontSize会有%\n else if(v[1] === PERCENT) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (parentComputedStyle[k] * v[0] * 0.01);\n }\n else if(v[1] === REM) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.computedStyle[FONT_SIZE] * v[0]);\n }\n else if(v[1] === VW) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.width * 0.01 * v[0]);\n }\n else if(v[1] === VH) {\n computedStyle[k] = isRoot ? reset.INHERIT[STYLE_RV_KEY[k]] : (node.root.height * 0.01 * v[0]);\n }\n else 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];\n return (style[FONT_STYLE] || 'normal') + ' ' + (style[FONT_WEIGHT] || '400') + ' '\n + fontSize + 'px/' + fontSize + 'px ' + (style[FONT_FAMILY] || 'arial');\n}\n\nfunction getFontFamily(str) {\n let ff = str.split(',');\n let f = 'arial';\n for(let i = 0, len = ff.length; i < len; i++) {\n if(font.support(ff[i])) {\n f = ff[i];\n break;\n }\n }\n return f;\n}\n\nfunction getBaseLine(style) {\n let fontSize = style[FONT_SIZE];\n let ff = getFontFamily(style[FONT_FAMILY]);\n let normal = fontSize * (font.info[ff] || font.info.arial).lhr;\n return (style[LINE_HEIGHT] - normal) * 0.5 + fontSize * (font.info[ff] || font.info.arial).blr;\n}\n\nfunction calNormalLineHeight(style) {\n let ff = getFontFamily(style[FONT_FAMILY]);\n return style[FONT_SIZE] * (font.info[ff] || font.info.arial).lhr;\n}\n\nfunction calRelativePercent(n, parent, k) {\n n *= 0.01;\n while(parent) {\n let style = parent.currentStyle[k];\n if(style[1] === AUTO) {\n if(k === WIDTH) {\n parent = parent.domParent;\n }\n else {\n break;\n }\n }\n else if(style[1] === PX) {\n return n * style[0];\n }\n else if(style[1] === PERCENT) {\n n *= style[0] * 0.01;\n parent = parent.domParent;\n }\n else if(style[1] === REM) {\n return n * style[0] * parent.root.computedStyle[FONT_SIZE];\n }\n else if(style[1] === VW) {\n return n * style[0] * parent.root.width * 0.01;\n }\n else if(style[1] === VH) {\n return n * style[0] * parent.root.height * 0.01;\n }\n 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\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 DISPLAY,\n VISIBILITY,\n },\n NODE_KEY: {\n NODE_OPACITY,\n NODE_CACHE_TOTAL,\n NODE_CACHE_FILTER,\n NODE_CACHE_OVERFLOW,\n NODE_HAS_CONTENT,\n NODE_COMPUTED_STYLE,\n },\n} = enums;\n\n// 根据一个共享cache的信息,生成一个独立的离屏canvas,一般是filter,mask用\nfunction genSingle(cache, message) {\n let { size, sx1, sy1, width, height, bbox } = cache;\n let offscreen = inject.getCacheCanvas(width, height, null, message);\n offscreen.x = 0;\n offscreen.y = 0;\n offscreen.bbox = bbox;\n offscreen.size = size;\n offscreen.sx1 = sx1;\n offscreen.sy1 = sy1;\n offscreen.dx = cache.dx;\n offscreen.dy = cache.dy;\n offscreen.dbx = cache.dbx;\n offscreen.dby = cache.dby;\n offscreen.width = width;\n offscreen.height = height;\n return offscreen;\n}\n\nclass Cache {\n constructor(w, h, bbox, page, pos, x1, y1) {\n this.__init(w, h, bbox, page, pos, x1, y1);\n }\n\n __init(w, h, bbox, page, pos, x1, y1) {\n this.__width = w;\n this.__height = h;\n this.__bbox = bbox;\n this.__page = page;\n this.__pos = pos;\n let [x, y] = page.getCoords(pos);\n this.__x = x;\n this.__y = y;\n this.__appendData(x1, y1);\n 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 },\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') {\n bp = bp.domParent;\n }\n this.__bp = bp;\n let parentComputedStyle = bp.computedStyle;\n let pff = 'arial';\n for(let i = 0, pffs = parentComputedStyle[FONT_FAMILY].split(','), len = pffs.length; i < len; i++) {\n if(inject.checkSupportFontFamily(pffs[i])) {\n ff = ffs[i];\n break;\n }\n }\n let pfs = parentComputedStyle[FONT_SIZE];\n let pfw = parentComputedStyle[FONT_WEIGHT];\n let pKey = this.__pKey = pfs + ',' + pff + ',' + pfw;\n let parentCache = textCache.charWidth[pKey] = textCache.charWidth[pKey] || {};\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n if(renderMode === mode.WEBGL) {\n ctx = inject.getCacheCanvas(16, 16, '__$$CHECK_SUPPORT_FONT_FAMILY$$__').ctx;\n }\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n ctx.font = css.setFontStyle(parentComputedStyle);\n parentCache[ELLIPSIS] = ctx.measureText(ELLIPSIS).width;\n }\n ctx.font = css.setFontStyle(computedStyle);\n }\n else if(renderMode === mode.SVG) {\n if(!parentCache.hasOwnProperty(ELLIPSIS)) {\n parentCache[ELLIPSIS] = 0;\n let wait = textCache.data[pKey] = textCache.data[pKey] || {\n ff: pff,\n fs: pfs,\n fw: pfw,\n hash: {},\n s: '',\n };\n wait.s += ELLIPSIS;\n needMeasure = true;\n }\n }\n // 逐字测量,canvas可瞬间得到信息,svg先预存统一进行\n for(let i = 0, length = content.length; i < length; i++) {\n let char = content.charAt(i);\n let mw;\n if(cache.hasOwnProperty(char)) {\n mw = cache[char];\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n mw = cache[char] = ctx.measureText(char).width;\n charWidthList.push(mw);\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n else {\n if(!wait.hash.hasOwnProperty(char)) {\n wait.s += char;\n }\n wait.hash[char] = true;\n // 先预存标识位-1,测量完后替换它\n charWidthList.push(-1);\n needMeasure = true;\n }\n }\n this.__textWidth = sum;\n if(needMeasure) {\n textCache.list.push(this);\n }\n }\n\n __measureCb() {\n let { content, charWidthList } = this;\n let key = this.__key;\n let cache = textCache.charWidth[key];\n let sum = 0;\n for(let i = 0, len = charWidthList.length; i < len; i++) {\n if(charWidthList[i] < 0) {\n let mw = charWidthList[i] = cache[content.charAt(i)];\n sum += mw;\n this.__charWidth = Math.max(this.charWidth, mw);\n }\n }\n this.__textWidth = sum;\n }\n\n /**\n * text在virtual时和普通一样,无需特殊处理\n * endSpace由外界inline布局控制,末尾最后一行的空白mpb,包含递归情况,递归为多个嵌套末尾节点的空白mpb之和\n * 即便宽度不足,每行还是强制渲染一个字符,换行依据lx开始,因为x可能是从中间开始的,非inline则两个相等\n * 最后一个字符排版时要考虑末尾mpb,排不下的话回退删掉这个字符,如果最后一个字符另起开头,排不下也强制排,每行至少1个字符\n * 在textOverflow时很特殊,多个inline同行,回退可能到前一个inline节点,这个通过x和lx判断是否行首,决定至少1个字符规则\n * @param data\n * @private\n */\n __layout(data) {\n let __cache = this.__config[NODE_CACHE];\n if(__cache) {\n __cache.release();\n }\n let { x, y, w, lx = x, lineBoxManager, endSpace = 0, lineClamp = 0, lineClampCount = 0 } = data;\n this.__x = this.__sx1 = x;\n this.__y = this.__sy1 = y;\n let { isDestroyed, content, currentStyle, computedStyle, textBoxes, charWidthList, root, __ff, __key } = this;\n textBoxes.splice(0);\n let __config = this.__config;\n __config[NODE_LIMIT_CACHE] = false;\n // 空内容w/h都为0可以提前跳出\n if(isDestroyed || currentStyle[DISPLAY] === 'none' || !content) {\n return lineClampCount;\n }\n this.__ox = this.__oy = 0;\n // 顺序尝试分割字符串为TextBox,形成多行,begin为每行起始索引,i是当前字符索引\n let begin = 0;\n let i = 0;\n let beginSpace = x - lx; // x>=lx,当第一行非起始处时前面被prev节点占据,这个差值可认为是count宽度\n let count = beginSpace;\n let length = content.length;\n let maxW = 0;\n let {\n [LINE_HEIGHT]: lineHeight,\n [LETTER_SPACING]: letterSpacing,\n [WHITE_SPACE]: whiteSpace,\n [FONT_SIZE]: fontSize,\n [FONT_WEIGHT]: fontWeight,\n } = computedStyle;\n // 特殊字体中特殊字符连续时需减少一定的padding量\n let padding = font.info[__ff].padding;\n let needReduce = !!padding;\n let lastChar;\n let ew = textCache.charWidth[this.__pKey][ELLIPSIS];\n let lineCount = 0;\n // 不换行特殊对待,同时考虑overflow和textOverflow\n if(whiteSpace === 'nowrap') {\n let isTextOverflow;\n // block的overflow:hidden和textOverflow:clip/ellipsis才生效,inline要看最近非inline父元素\n let bp = this.__bp;\n let {\n [DISPLAY]: display,\n [OVERFLOW]: overflow,\n [WIDTH]: width,\n [TEXT_OVERFLOW]: textOverflow,\n } = bp.currentStyle;\n // 只要是overflow隐藏,不管textOverflow如何(默认是clip等同于overflow:hidden的功能)都截取\n if(overflow === 'hidden') {\n while(i < length) {\n count += charWidthList[i] + letterSpacing;\n if(count > w) {\n // block/flex无需宽度,inline-block需要设置宽度才生效\n if(display === 'block' || display === 'flex') {\n isTextOverflow = true;\n }\n else if(width[1] !== AUTO) {\n isTextOverflow = true;\n }\n break;\n }\n i++;\n }\n }\n else {\n while(i < length) {\n count += charWidthList[i++] + letterSpacing;\n }\n }\n // ellipsis生效情况,本节点开始向前回退查找,尝试放下一部分字符\n if(isTextOverflow && textOverflow === 'ellipsis') {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n }\n // 默认clip跟随overflow:hidden,无需感知\n else {\n let textBox = new TextBox(this, textBoxes.length, x, y, count - beginSpace, lineHeight,\n content, charWidthList);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n maxW = count - beginSpace;\n y += lineHeight;\n }\n }\n // 普通换行,注意x和lx的区别,可能相同(block起始处)可能不同(非起始处),第1行从x开始,第2行及以后都从lx开始\n // 然后第一次换行还有特殊之处,可能同一行前半部行高很大,此时y增加并非自身的lineHeight,而是整体LineBox的\n else {\n while(i < length) {\n let cw = charWidthList[i] + letterSpacing;\n count += cw;\n // 连续字符减少padding,除了连续还需判断char是否在padding的hash中\n if(needReduce) {\n let char = content[i];\n if(char === lastChar && padding.hasOwnProperty(char) && padding[char]) {\n let hasCache, p = textCache.padding[__key] = textCache.padding[__key] || {};\n if(textCache.padding.hasOwnProperty(__key)) {\n if(p.hasOwnProperty(char)) {\n hasCache = true;\n count -= p[char];\n }\n }\n if(!hasCache) {\n let n = 0;\n if(root.renderMode === mode.CANVAS) {\n root.ctx.font = css.setFontStyle(computedStyle);\n let w1 = root.ctx.measureText(char).width;\n let w2 = root.ctx.measureText(char + char).width;\n n = w1 * 2 - w2;\n n *= padding[char];\n }\n else if(root.renderMode === mode.SVG) {\n n = inject.measureTextSync(__key, __ff, fontSize, fontWeight, char);\n n *= padding[char];\n }\n count -= n;\n p[char] = n;\n }\n }\n lastChar = char;\n }\n // 忽略零宽字符\n if(cw === 0) {\n i++;\n continue;\n }\n // 换行都要判断i不是0的时候,第1个字符强制不换行\n if(count === w) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n let textBox;\n // 特殊情况,恰好最后一行最后一个排满,此时查看末尾mpb,要防止i为0的情况首个字符特殊不回退,无需看开头mpb\n if(i === length - 1 && count > w - endSpace && i) {\n count -= charWidthList[i--];\n }\n i++;\n if(!lineCount) {\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, count);\n }\n // 必须先添加再设置y,当有diff的lineHeight时,第一个换行不影响,再换行时第2个换行即第3行会被第1行影响\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null; // 换行后连续字符reduce不生效重新计数\n }\n // 奇怪的精度问题,暂时不用相等判断,而是为原本w宽度加一点点冗余1e-10\n else if(count > w + (1e-10)) {\n // 多行文本截断,这里肯定需要回退\n if(lineClamp && lineCount + lineClampCount >= lineClamp - 1) {\n [y, maxW] = this.__lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount,\n lineHeight, lx, x, y, maxW, textBoxes, content, charWidthList, lineBoxManager);\n lineCount++;\n break;\n }\n // 普通非多行文本阶段逻辑\n let width;\n // 宽度不足时无法跳出循环,至少也要塞个字符形成一行,无需判断第1行,因为是否放得下逻辑在dom中做过了,\n // 如果第1行放不下,一定会另起一行,此时作为开头再放不下才会进这里,这个if只有0或1个字符的情况\n if(i <= begin) {\n width = count;\n }\n // 超过2个字符回退1个\n else {\n width = count - charWidthList[i--];\n }\n i++;\n // 根据是否第一行分开处理行首空白\n let textBox;\n if(!lineCount) {\n maxW = width - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n }\n else {\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n maxW = Math.max(maxW, width);\n }\n // 必须先添加再设置y,同上\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n begin = i;\n count = 0;\n lineCount++;\n lastChar = null;\n }\n else {\n i++;\n }\n }\n // 换行后Text的x重设为lx\n if(lineCount) {\n this.__x = this.__sx1 = lx;\n }\n // 最后一行,只有一行未满时也进这里,需查看末尾mpb,排不下回退一个字符\n // 声明了lineClamp时特殊考虑,这里一定是最后一行,要对比行数不能超过,超过忽略掉这些文本\n if(begin < length && (!lineClamp || lineCount + lineClampCount < lineClamp)) {\n let textBox;\n if(!lineCount) {\n let needBack;\n // 防止开头第一个begin=0时回退,这在inline有padding且是第一个child时会发生\n if(begin && count > w - endSpace) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n maxW = count - beginSpace;\n textBox = new TextBox(this, textBoxes.length, x, y, maxW, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n else {\n let needBack;\n // 防止begin在结尾时回退,必须要有个字符,这在最后一行1个字符排不下时会出现\n if(count > w - endSpace && begin < length - 1) {\n needBack = true;\n count -= charWidthList[length - 1];\n }\n textBox = new TextBox(this, textBoxes.length, lx, y, count, lineHeight,\n content.slice(begin, needBack ? length - 1 : length), charWidthList.slice(begin, needBack ? length - 1 : length));\n maxW = Math.max(maxW, count);\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n if(needBack) {\n let width = charWidthList[length - 1];\n textBox = new TextBox(this, textBoxes.length, lx, y, width, lineHeight,\n content.slice(length - 1), charWidthList.slice(length - 1));\n maxW = Math.max(maxW, width);\n textBoxes.push(textBox);\n lineBoxManager.setNewLine();\n lineBoxManager.addItem(textBox);\n y += lineHeight;\n lineCount++;\n }\n }\n }\n }\n this.__width = maxW;\n this.__height = y - data.y;\n this.__baseLine = css.getBaseLine(computedStyle);\n return lineCount;\n }\n\n // 末尾行因ellipsis的缘故向前回退字符生成textBox,可能会因不满足宽度导致无法生成,此时向前继续回退TextBox\n __lineBack(count, w, beginSpace, endSpace, ew, letterSpacing, begin, i, length, lineCount, lineHeight, lx, x, y, maxW,\n textBoxes, content, charWidthList, lineBoxManager) {\n for(; i >= begin; i--) {\n count -= charWidthList[i] + letterSpacing;\n if(count + ew + endSpace <= w) {\n // 至少1个字符不用回退,到0也没找到需要回退\n if(i) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.slice(begin, i), charWidthList.slice(begin, i));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n break;\n }\n }\n }\n // 最后也没找到,看是否要查找前一个inline节点,还是本身是行首兜底首字母\n if(i < 0) {\n let lineBox = lineBoxManager.lineBox;\n // lineBox为空是行首,至少放1个字符\n if(!lineBox.size) {\n maxW = count - (lineCount ? 0 : beginSpace);\n let textBox = new TextBox(this, textBoxes.length, lineCount ? lx : x, y, maxW, lineHeight,\n content.charAt(begin), charWidthList.slice(begin, begin + 1));\n textBoxes.push(textBox);\n lineBoxManager.addItem(textBox, true);\n y += Math.max(lineHeight, lineBoxManager.lineHeight);\n this.__ellipsis = true;\n }\n // 向前查找inline节点,可能会有前面inline嵌套,因此直接用lineBox,不会出现inlineBlock,\n // 这里和css不同,ib强制超限换行不会同行\n else {\n let list = lineBox.list;\n outer:\n for(let j = list.length - 1; j >= 0; j--) {\n let tb = list[j];\n let { content, wList, width } = tb;\n // 整体减去可以说明可能在这个tb中,只要最后发现不是空文本节点就行,否则继续;第0个强制进入保证1字符\n if(count - width + ew <= w || !j) {\n // 找到可以跳出outer循环,找不到继续,注意第0个且1个字符判断\n for(let k = wList.length - 1; k >= 0; k--) {\n if(!k && !j || count + ew <= w) {\n tb.__content = content;\n tb.__width = width;\n tb.parent.__ellipsis = true;\n break outer;\n }\n else {\n let w2 = wList[k];\n tb.__endY -= w2;\n width -= w2;\n content = content.slice(0, k);\n count -= w2;\n wList.pop();\n }\n }\n }\n // 不够则看前一个tb并且删掉这个\n else {\n count -= width;\n }\n list.pop();\n tb.parent.textBoxes.pop();\n }\n }\n }\n return [y, maxW];\n }\n\n __offsetX(diff, isLayout) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetX(diff);\n });\n }\n this.__sx1 += diff;\n }\n\n __offsetY(diff, isLayout) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.textBoxes.forEach(item => {\n item.__offsetY(diff);\n });\n }\n this.__sy1 += diff;\n }\n\n __tryLayInline(w) {\n return w - this.charWidthList[0];\n }\n\n __inlineSize() {\n let minX, maxX;\n this.textBoxes.forEach((item, i) => {\n if(i) {\n minX = Math.min(minX, item.x);\n maxX = Math.max(maxX, item.x + item.width);\n }\n else {\n minX = item.x;\n maxX = item.x + item.width;\n }\n });\n this.__x = minX;\n this.__sx = this.__sx1 = minX + this.ox;console.log(22222)\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] * 0.5, half);\n }\n else if(textStrokeWidth[1] === VW) {\n half = Math.max(textStrokeWidth[0] * root.width * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VH) {\n half = Math.max(textStrokeWidth[0] * root.height * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VMAX) {\n half = Math.max(textStrokeWidth[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(textStrokeWidth[1] === VMIN) {\n half = Math.max(textStrokeWidth[0] * Math.min(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(textStrokeWidth[0] * 0.5, half);\n }\n half += 1;\n return [sx - half, sy - half, sx + width + half, sy + height + half];\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get matrix() {\n return this.domParent.matrix;\n }\n\n get matrixEvent() {\n return this.domParent.matrixEvent;\n }\n}\n\nText.prototype.__renderByMask = Text.prototype.render;\n\nexport default Text;\n","import util from './util';\nimport $$type from './$$type';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\n/**\n * 2. 打平children中的数组,变成一维\n * 3. 合并相连的Text节点,即string内容\n */\nfunction flattenJson(parent) {\n if(Array.isArray(parent)) {\n return parent.map(item => flattenJson(item));\n }\n else if(!parent || [TYPE_VD, TYPE_GM, TYPE_CP].indexOf(parent.$$type) === -1 || !Array.isArray(parent.children)) {\n return parent;\n }\n let list = [];\n traverseJson(list, parent.children, {\n lastText: null,\n });\n parent.children = list;\n return parent;\n}\n\nfunction traverseJson(list, children, options) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n traverseJson(list, item, options);\n });\n }\n else if(children && (children.$$type === TYPE_VD || children.$$type === TYPE_GM)) {\n if(['canvas', 'svg', 'webgl'].indexOf(children.tagName) > -1) {\n throw new Error('Can not nest canvas/svg/webgl');\n }\n if(children.$$type === TYPE_VD) {\n flattenJson(children);\n }\n list.push(children);\n options.lastText = null;\n }\n else if(children && children.$$type === TYPE_CP) {\n list.push(children);\n // 强制component即便返回text也形成一个独立的节点,合并在layout布局中做\n options.lastText = null;\n }\n // 排除掉空的文本,连续的text合并\n else if(!util.isNil(children) && children !== '') {\n if(options.lastText !== null) {\n list[list.length - 1] = options.lastText += children;\n }\n else {\n list.push(children);\n }\n }\n}\n\nexport default flattenJson;\n","import Text from '../node/Text';\nimport util from './util';\nimport $$type from './$$type';\nimport enums from './enums';\nimport flatten from './flatten';\n\nconst { NODE_KEY: {\n NODE_DOM_PARENT,\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n} } = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet Xom, Dom, Img, Geom, Component;\n\nfunction initRoot(cd, root) {\n let c = flatten({\n tagName: root.tagName,\n props: {},\n children: cd,\n $$type: TYPE_VD,\n });\n root.__json = c;\n root.__host = root;\n let children = build(c.children, root, root);\n return relation(root, children);\n}\n\nfunction initDom(json, root, host, parent) {\n let vd = build(json, root, host);\n return relation(parent, vd);\n}\n\nfunction initCp(json, root, host) {\n if(util.isObject(json)) {\n // cp的flatten在__init中自己做\n return build(json, root, host);\n }\n // text的relation会由上层如Root设置\n else {\n return new Text(json);\n }\n}\n\nfunction initCp2(json, root, host, parent) {\n let vd = new json.klass(json.props);\n vd.__tagName = json.tagName || vd.__tagName;\n vd.__root = root;\n vd.__host = host;\n vd.__json = json;\n vd.__init();\n return relation(parent, vd);\n}\n\n/**\n * 将初始json文件生成virtualDom\n * @param json\n * @param root\n * @param host\n * @param hasP 出现过p标签\n * @returns vd\n */\nfunction build(json, root, host, hasP) {\n if(Array.isArray(json)) {\n return json.map(item => build(item, root, host, hasP));\n }\n let vd;\n if(util.isObject(json) && json.$$type) {\n let { tagName, props, children, klass, $$type, __inheritAnimate, __animateRecords } = json;\n // 更新过程中无变化的cp直接使用原来生成的\n if($$type === TYPE_CP && json.__placeholder) {\n return json.__placeholder;\n }\n if($$type === TYPE_VD) {\n if(tagName === 'img') {\n vd = new Img(tagName, props);\n if(Array.isArray(children) && children.length) {\n throw new Error('Img can not contain children');\n }\n }\n else {\n vd = new Dom(tagName, props);\n }\n // 检查p不能包含div\n if(tagName === 'p') {\n hasP = true;\n }\n else if(tagName === 'div' && hasP) {\n throw new Error('Markup p can not contain div');\n }\n if(Array.isArray(children)) {\n children = relation(vd, build(children, root, host, hasP));\n }\n else {\n children = [];\n }\n vd.__children = children;\n }\n else if($$type === TYPE_GM) {\n let klass = Geom.getRegister(tagName);\n vd = new klass(tagName, props);\n }\n else if($$type === TYPE_CP) {\n vd = new klass(props);\n vd.__tagName = tagName || vd.__tagName;\n }\n else {\n return new Text(json);\n }\n // 根parse需要用到真正的vd引用,然后vd也要引用json,用以做domApi\n json.vd = vd;\n vd.__json = json;\n // 递归parse中的动画记录需特殊处理,将target改为真正的vd引用\n if(__animateRecords) {\n vd.__animateRecords = __animateRecords;\n __animateRecords.list.forEach(item => {\n item.target = item.target.vd;\n });\n delete json.__animateRecords;\n }\n // 更新过程中key相同或者普通相同的vd继承动画\n if(__inheritAnimate) {\n util.extendAnimate(__inheritAnimate, vd);\n delete json.__inheritAnimate;\n }\n vd.__root = root;\n vd.__host = host;\n if($$type === TYPE_CP) {\n vd.__init();\n }\n let ref = props.ref;\n if(util.isString(ref) && ref || util.isNumber(ref)) {\n host.ref[ref] = vd;\n }\n else if(util.isFunction(ref)) {\n ref(vd);\n }\n return vd;\n }\n return new Text(json);\n}\n\n/**\n * 设置关系,父子和兄弟\n * @param parent\n * @param children\n * @param options\n * @returns {Xom|Text|Component}\n */\nfunction relation(parent, children, options = {}) {\n if(Array.isArray(children)) {\n children.forEach(item => {\n relation(parent, item, options);\n });\n }\n else if(children instanceof Xom || children instanceof Component || children instanceof Text) {\n children.__parent = parent;\n children.__domParent = parent;\n // 极为恶心,为了v8的性能优化,text复用parent的__config部分,但domParent重设\n if(children instanceof Text) {\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n if(children.__config) {\n children.__config[NODE_DOM_PARENT] = parent;\n }\n if(options.prev) {\n options.prev.__next = children;\n children.__prev = options.prev;\n }\n options.prev = children;\n // 文字视作为父节点的直接文字子节点\n if(children instanceof Component) {\n let sr = children.shadowRoot;\n if(sr instanceof Text) {\n sr.__parent = parent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n children.__config[k] = parent.__config[k];\n });\n }\n sr.__domParent = parent;\n if(sr.__config) {\n sr.__config[NODE_DOM_PARENT] = parent;\n }\n }\n }\n return children;\n}\n\nexport default {\n ref(o) {\n Xom = o.Xom;\n Dom = o.Dom;\n Img = o.Img;\n Geom = o.Geom;\n Component = o.Component;\n },\n initRoot,\n initDom,\n initCp,\n initCp2,\n relation,\n};\n","import util from './util';\n\nconst { isFunction } = util;\n\nclass Event {\n constructor() {\n this.__eHash = {};\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.on(id[i], handle);\n }\n }\n else {\n if(!self.__eHash.hasOwnProperty(id)) {\n self.__eHash[id] = [];\n }\n // 遍历防止此handle被侦听过了\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n if(item[i] === handle) {\n return self;\n }\n }\n self.__eHash[id].push(handle);\n }\n return self;\n }\n\n once(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n let self = this;\n\n // 包裹一层会导致添加后删除对比引用删不掉,需保存原有引用进行对比\n function cb(...data) {\n handle.apply(self, data);\n self.off(id, cb);\n }\n\n cb.__karasEventCb = handle;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.once(id[i], handle);\n }\n }\n else if(handle) {\n self.on(id, cb);\n }\n return this;\n }\n\n off(id, handle) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.off(id[i], handle);\n }\n }\n else if(self.__eHash.hasOwnProperty(id)) {\n if(handle) {\n for(let i = 0, item = self.__eHash[id], len = item.length; i < len; i++) {\n // 需考虑once包裹的引用对比\n if(item[i] === handle || item[i].__karasEventCb === handle) {\n item.splice(i, 1);\n break;\n }\n }\n }\n // 未定义为全部清除\n else {\n delete self.__eHash[id];\n }\n }\n return this;\n }\n\n emit(id, ...data) {\n let self = this;\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n self.emit(id[i], data);\n }\n }\n else {\n if(self.__eHash.hasOwnProperty(id)) {\n let list = self.__eHash[id];\n if(list.length) {\n list = list.slice();\n for(let i = 0, len = list.length; i < len; i++) {\n let cb = list[i];\n if(isFunction(cb)) {\n cb.apply(self, data);\n }\n }\n }\n }\n }\n return this;\n }\n\n static mix(...obj) {\n for(let i = obj.length - 1; i >= 0; i--) {\n let o = obj[i];\n let event = new Event();\n o.__eHash = {};\n let fns = ['on', 'once', 'off', 'emit'];\n for(let j = fns.length - 1; j >= 0; j--) {\n let fn = fns[j];\n o[fn] = event[fn];\n }\n }\n }\n\n static REFRESH = 'refresh';\n static PAUSE = 'pause';\n static PLAY = 'play';\n static FRAME = 'frame';\n static FINISH = 'finish';\n static CANCEL = 'cancel';\n static BEGIN = 'begin';\n static END = 'end';\n}\n\nexport default Event;\n","import Node from './Node';\nimport Text from './Text';\nimport builder from '../util/builder';\nimport Event from '../util/Event';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport flatten from '../util/flatten';\nimport css from '../style/css';\nimport change from '../refresh/change';\n\nconst { isNil, isFunction, clone, extend } = util;\n\nconst REGISTER = {};\n\n/**\n * 向上设置cp类型叶子节点,表明从root到本节点这条链路有更新,使得无链路更新的节约递归\n * 在check时树递归会用到,判断是否需要查找cp更新\n * @param cp\n */\nfunction setUpdateFlag(cp) {\n // 去重\n if(cp.__hasUpdate) {\n return;\n }\n cp.__hasUpdate = true;\n let host = cp.host;\n if(host) {\n setUpdateFlag(host);\n }\n}\n\nclass Component extends Event {\n constructor(props = {}) {\n super();\n this.__tagName = /(?:function|class)\\s+([\\w$]+)/.exec(this.constructor.toString())[1];\n // 构建工具中都是arr,手写可能出现hash情况\n if(Array.isArray(props)) {\n this.props = util.arr2hash(props);\n }\n else {\n this.props = props;\n }\n this.__parent = null;\n this.__host = null;\n this.__ref = {};\n this.state = {};\n this.__isMounted = false;\n this.__taskList = [];\n }\n\n setState(n, cb) {\n let self = this;\n if(isNil(n)) {\n n = {};\n }\n else if(isFunction(n)) {\n return;\n }\n else {\n if(Object.keys(n).length === 0) {\n if(isFunction(cb)) {\n cb.call(self);\n }\n return;\n }\n let state = clone(self.state);\n n = extend(state, n);\n }\n let root = self.root;\n if(root && self.__isMounted) {\n // 一帧之内多次调用,需合并\n if(self.__nextState) {\n Object.assign(self.__nextState, n);\n self.__taskList.push(cb);\n }\n else {\n self.__nextState = n;\n self.__taskList = [cb];\n // 回调更新列表,before执行时splice出来供after执行,防止中途产生的后续setState干扰\n let list = [];\n let t = self.__task = {\n __before: () => {\n list = self.__taskList.splice(0);\n // 标识更新\n setUpdateFlag(this);\n },\n __after: () => {\n // self.__nextState = null; 由updater.js每次refresh前同步执行清空,这里不能异步清除,否则frame动画会乱序\n list.forEach(cb => {\n if(isFunction(cb)) {\n cb.call(self);\n }\n });\n },\n };\n root.addRefreshCp(t);\n }\n }\n // 构造函数中调用还未render,\n else if(isFunction(cb)) {\n self.state = n;\n cb.call(self);\n }\n }\n\n /**\n * build中调用初始化,json有值时是update过程才有,且处理过flatten\n * @param json\n * @private\n */\n __init(json) {\n this.__ref = {};\n let root = this.root;\n let cd = json || flatten(this.render());\n let sr = builder.initCp(cd, root, this);\n this.__cd = cd;\n if(sr instanceof Text) {\n // 文字视作为父节点的直接文字子节点,在builder里做\n }\n else if(sr instanceof Node) {\n let style = css.normalize(this.props.style);\n let keys = Object.keys(style);\n extend(sr.style, style, keys);\n extend(sr.currentStyle, style, keys);\n // 事件添加到sr\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n });\n }\n else if(!(sr instanceof Component)) {\n // 本身build是递归的,子cp已经初始化了\n throw new Error('Component render() must return a dom/text: ' + this);\n }\n // 自定义事件无视返回强制添加\n Object.keys(this.props).forEach(k => {\n let v = this.props[k];\n if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n k = k.slice(3);\n this.on(k, v);\n }\n });\n // shadow指向直接renderRoot,shadowRoot考虑到返回Component的递归即hoc高阶组件\n // host是直接所属,hostRoot同考虑到高阶组件\n this.__shadow = sr;\n sr.__host = this;\n // 递归下去,多层级时执行顺序由里到外,最终会被最上层执行替换\n while(sr instanceof Component) {\n sr.__hostRoot = this;\n sr.shadow.__host = sr;\n sr = sr.shadow;\n }\n this.__shadowRoot = sr;\n sr.__hostRoot = this;\n if(!this.__isMounted) {\n this.__isMounted = true;\n if(isFunction(this.componentDidMount)) {\n root.once(Event.REFRESH, () => {\n this.componentDidMount();\n });\n }\n }\n }\n\n render() {\n inject.warn('Component must implement render()');\n }\n\n __destroy() {\n if(this.isDestroyed) {\n return;\n }\n this.__isDestroyed = true;\n this.__isMounted = false;\n if(isFunction(this.componentWillUnmount)) {\n this.componentWillUnmount();\n }\n this.root.delRefreshTask(this.__task);\n if(this.shadowRoot) {\n this.shadowRoot.__destroy();\n }\n this.__parent = null;\n }\n\n __emitEvent(e, force) {\n let sr = this.shadowRoot;\n if(sr instanceof Text) {\n return;\n }\n let res = sr.__emitEvent(e, force);\n if(res) {\n e.target = this;\n return true;\n }\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get shadow() {\n return this.__shadow;\n }\n\n get shadowRoot() {\n return this.__shadowRoot;\n }\n\n get root() {\n return this.__root;\n }\n\n get host() {\n return this.__host;\n }\n\n get hostRoot() {\n return this.__hostRoot;\n }\n\n get parent() {\n return this.__parent;\n }\n\n get prev() {\n return this.__prev;\n }\n\n get next() {\n return this.__next;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get domParent() {\n return this.__domParent;\n }\n\n get state() {\n return this.__state;\n }\n\n set state(v) {\n this.__state = v;\n }\n\n get isDestroyed() {\n return this.__isDestroyed;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)) {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Component has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || !/^[A-Z]/.test(name)\n || !obj.prototype || !(obj.prototype instanceof Component)) {\n throw new Error('Invalid param: Component register');\n }\n if(Component.hasRegister(name)) {\n throw new Error(`Component has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Component.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nObject.keys(change.GEOM).concat([\n 'x',\n 'y',\n 'ox',\n 'oy',\n 'sx',\n 'sy',\n // '__sx1',\n // '__sx2',\n // '__sx3',\n // '__sx4',\n // '__sx5',\n // '__sx6',\n // '__sy1',\n // '__sy2',\n // '__sy3',\n // '__sy4',\n // '__sy5',\n // '__sy6',\n 'width',\n 'height',\n 'outerWidth',\n 'outerHeight',\n 'clientWidth',\n 'clientHeight',\n 'offsetWidth',\n 'offsetHeight',\n 'style',\n 'animationList',\n 'animateStyle',\n 'currentStyle',\n 'computedStyle',\n 'currentProps',\n 'baseLine',\n 'virtualDom',\n 'mask',\n 'maskId',\n 'textWidth',\n 'content',\n 'lineBoxes',\n 'charWidthList',\n 'charWidth',\n '__layoutData',\n 'availableAnimating',\n 'effectiveAnimating',\n 'displayAnimating',\n 'visibilityAnimating',\n 'bbox',\n '__config',\n 'contentBoxList',\n 'listener',\n 'matrix',\n 'matrixEvent',\n]).forEach(fn => {\n Object.defineProperty(Component.prototype, fn, {\n get() {\n let sr = this.shadowRoot;\n if(sr) {\n return sr[fn];\n }\n },\n });\n});\n\n[\n '__layout',\n '__layoutAbs',\n '__layoutNone',\n '__tryLayInline',\n '__offsetX',\n '__offsetY',\n '__calAutoBasis',\n '__calMp',\n '__calAbs',\n '__renderAsMask',\n '__renderByMask',\n '__mp',\n 'animate',\n 'removeAnimate',\n 'clearAnimate',\n 'updateStyle',\n 'getBoundingClientRect',\n 'getComputedStyle',\n '__deepScan',\n 'clearCache',\n '__structure',\n '__modifyStruct',\n '__updateStruct',\n 'flowChildren',\n 'absChildren',\n '__isRealInline',\n '__calBasis',\n '__calMinMax',\n '__computeMeasure',\n 'appendChild',\n 'prependChild',\n 'insertBefore',\n 'insertAfter',\n 'removeChild',\n 'remove',\n].forEach(fn => {\n Component.prototype[fn] = function() {\n let sr = this.shadowRoot;\n if(sr && isFunction(sr[fn])) {\n return sr[fn].apply(sr, arguments);\n }\n };\n});\n\nexport default Component;\n","import unit from './unit';\nimport transform from './transform';\nimport enums from '../util/enums';\n\nconst { STYLE_KEY: { SCALE_X, SCALE_Y } } = enums;\nconst { PERCENT, NUMBER } = unit;\n\nfunction matrixResize(imgWidth, imgHeight, targetWidth, targetHeight, x, y, w, h) {\n if(imgWidth === targetWidth && imgHeight === targetHeight) {\n return;\n }\n let list = [\n [SCALE_X, [targetWidth / imgWidth, NUMBER]],\n [SCALE_Y, [targetHeight / imgHeight, NUMBER]],\n ];\n let tfo = transform.calOrigin([[0, PERCENT], [0, PERCENT]], w, h);\n tfo[0] += x;\n tfo[1] += y;\n return transform.calMatrixWithOrigin(list, tfo, w, h);\n}\n\nexport default {\n matrixResize,\n};\n","import border from './border';\nimport transform from './transform';\nimport mx from '../math/matrix';\nimport mode from '../node/mode';\nimport painter from '../util/painter';\nimport util from '../util/util';\nimport unit from './unit';\nimport enums from '../util/enums';\nimport image from './image';\n\nconst {\n STYLE_KEY: {\n BACKGROUND_POSITION_X,\n BACKGROUND_POSITION_Y,\n FONT_SIZE,\n },\n NODE_KEY: {\n NODE_DEFS_CACHE,\n },\n} = enums;\nconst { clone, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\nconst { AUTO, PX, PERCENT, STRING, REM, VW, VH, 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_FRAME_CB,\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_CAL_DIFF_TIME,\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') {\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') {\n let n = v[k].slice(0);\n n[0] = 100 + n[0] * percent;\n st.push([k, n]);\n }\n }\n });\n }\n else if(RADIUS_HASH.hasOwnProperty(k)) {\n for(let i = 0; i < 2; i++) {\n st[i][0] += v[i] * percent;\n }\n }\n else if(k === TRANSFORM_ORIGIN || k === PERSPECTIVE_ORIGIN) {\n if(v[0] !== 0) {\n st[0][0] += v[0] * percent;\n }\n if(v[1] !== 0) {\n st[1][0] += v[1] * percent;\n }\n }\n else if(k === BOX_SHADOW) {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n // x/y/blur/spread\n for(let j = 0; j < 4; j++) {\n st[i][j] += v[i][j] * percent;\n }\n // rgba\n for(let j = 0; j < 4; j++) {\n st[i][4][j] += v[i][4][j] * percent;\n }\n }\n }\n else if(k === BACKGROUND_SIZE) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0][0] += v[i][0] * percent;\n item[1][0] += v[i][1] * percent;\n }\n });\n }\n else if(k === BACKGROUND_POSITION_X || k === BACKGROUND_POSITION_Y) {\n st.forEach((item, i) => {\n if(v[i]) {\n item[0] += v[i] * percent;\n }\n });\n }\n else if(GRADIENT_HASH.hasOwnProperty(k)) {\n st.forEach((st2, i) => {\n let v2 = v[i];\n if(!v2) {\n return;\n }\n let [c, d, p, z] = v2;\n if(GRADIENT_TYPE.hasOwnProperty(st2.k)) {\n for(let i = 0, len = Math.min(st2.v.length, c.length); i < len; i++) {\n let a = st2.v[i];\n let b = c[i];\n a[0][0] += b[0][0] * percent;\n a[0][1] += b[0][1] * percent;\n a[0][2] += b[0][2] * percent;\n a[0][3] += b[0][3] * percent;\n if(a[1] && b[1]) {\n a[1][0] += b[1] * percent;\n }\n }\n if(st2.k === 'linear' && st2.d !== undefined && d !== undefined) {\n if(Array.isArray(d)) {\n st2.d[0] += d[0] * percent;\n st2.d[1] += d[1] * percent;\n st2.d[2] += d[2] * percent;\n st2.d[3] += d[3] * percent;\n }\n else {\n st2.d += d * percent;\n }\n }\n if(st2.k === 'radial') {\n if(st2.z !== undefined && z !== undefined) {\n st2.z[0] += z[0] * percent;\n st2.z[1] += z[1] * percent;\n st2.z[2] += z[2] * percent;\n st2.z[3] += z[3] * percent;\n st2.z[4] += z[4] * percent;\n }\n else if(st2.p !== undefined && p !== undefined) {\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n else if(st2.k === 'conic' && st2.d !== undefined && d !== undefined) {\n st2.d += d * percent;\n st2.p[0][0] += p[0] * percent;\n st2.p[1][0] += p[1] * percent;\n }\n }\n // fill纯色\n else {\n st2[0] += c[0] * percent;\n st2[1] += c[1] * percent;\n st2[2] += c[2] * percent;\n st2[3] += c[3] * percent;\n }\n });\n }\n // color可能超限[0,255],但浏览器已经做了限制,无需关心\n else if(COLOR_HASH.hasOwnProperty(k)) {\n st = st[0];\n st[0] += v[0] * percent;\n st[1] += v[1] * percent;\n st[2] += v[2] * percent;\n st[3] += v[3] * percent;\n }\n else if(GEOM.hasOwnProperty(k)) {\n let st = style[k];\n let tagName = target.tagName;\n if(GEOM[k][tagName] && isFunction(GEOM[k][tagName].calIncrease)) {\n let fn = GEOM[k][tagName].calIncrease;\n if(target.isMulti) {\n style[k] = st.map((item, i) => {\n return fn(item, v[i], percent);\n });\n }\n else {\n style[k] = fn(st, v, percent);\n }\n }\n else if(target.isMulti) {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n let o2 = o[j];\n let n2 = n[j];\n if(!isNil(o2) && !isNil(n2)) {\n for(let k = 0, len3 = Math.min(o2.length, n2.length); k < len3; k++) {\n if(!isNil(o2[k]) && !isNil(n2[k])) {\n o2[k] += n2[k] * percent;\n }\n }\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n v.forEach((item, i) => {\n let st2 = st[i];\n if(!isNil(item) && !isNil(st2)) {\n for(let i = 0, len = Math.min(st2.length, item.length); i < len; i++) {\n let o = st2[i];\n let n = item[i];\n if(!isNil(o) && !isNil(n)) {\n st2[i] += n * percent;\n }\n }\n }\n });\n }\n else {\n v.forEach((item, i) => {\n if(!isNil(item) && !isNil(st[i])) {\n st[i] += item * percent;\n }\n });\n }\n }\n else {\n if(k === 'points' || k === 'controls') {\n for(let i = 0, len = Math.min(st.length, v.length); i < len; i++) {\n let o = st[i];\n let n = v[i];\n if(!isNil(o) && !isNil(n)) {\n for(let j = 0, len2 = Math.min(o.length, n.length); j < len2; j++) {\n if(!isNil(o[j]) && !isNil(n[j])) {\n o[j] += n[j] * percent;\n }\n }\n }\n }\n }\n else if(k === 'controlA' || k === 'controlB') {\n if(!isNil(st[0]) && !isNil(v[0])) {\n st[0] += v[0] * percent;\n }\n if(!isNil(st[1]) && !isNil(v[1])) {\n st[1] += v[1] * percent;\n }\n }\n else {\n if(!isNil(st) && !isNil(v)) {\n style[k] += v * percent;\n }\n }\n }\n }\n else if(k === OPACITY || k === Z_INDEX) {\n style[k] += v * percent;\n // 精度问题可能会超过[0,1]区间\n if(k === OPACITY) {\n if(style[k] < 0) {\n style[k] = 0;\n }\n else if(style[k] > 1) {\n style[k] = 1;\n }\n }\n }\n }\n return style;\n}\n\nfunction gotoOverload(options, cb) {\n if(isFunction(options)) {\n cb = options;\n options = {};\n }\n return [options || {}, cb];\n}\n\nlet uuid = 0;\n\nclass Animation extends Event {\n constructor(target, list, options) {\n super();\n this.__id = uuid++;\n list = clone(list || []);\n if(Array.isArray(list)) {\n list = list.filter(item => item && isObject(item));\n }\n // 动画过程另外一种形式,object描述k-v形式\n else if(list && isObject(list)) {\n let nl = [];\n Object.keys(list).forEach(k => {\n let v = list[k];\n if(Array.isArray(v)) {\n for(let i = 0, len = v.length; i < len; i++) {\n let o = nl[i] = nl[i] || {\n offset: i / (len - 1),\n };\n o[k] = v[i];\n }\n }\n });\n list = nl;\n }\n else {\n list = [];\n }\n if(isNumber(options)) {\n this.__options = {\n duration: options,\n };\n options = this.__options;\n }\n let op = this.__options = options || {\n duration: 0,\n };\n let root = target.root;\n let config = this.__config = [\n false, // assigning\n false, // inFps\n false, // isDelay\n false, // begin\n false, // end\n false, // finished\n false, // nextBegin\n true, // firstPlay\n this.__frameCb,\n null, // playCb\n target,\n root,\n null, // frames\n null, // framesR\n 0, // currentTime\n 0, // nextTime\n {}, // style\n 0, // duration\n 1, // iterations\n 'none', // fill\n 1, // playbackRate\n 0, // playCount\n 'idle',\n false, // destroy\n 0, // startTime\n 0, // fpsTime\n op.easing,\n false, // enterFrame\n 0, // delay\n 0, // endDelay\n null, // keys,\n null, // originStyle,\n null, // currentFrames\n null, // currentFrame\n false, // spfLimit\n 60, // fps\n 'normal', // direction\n this.__calDiffTime,\n true, // firstEnter,\n false, // stayBegin\n false, // stayEnd\n false, // is2\n 0, // endTime\n target.__config, // nodeConfig\n root && root.__config, // rootConfig,destroy后root可能为空\n false, // outBeginDelay\n ];\n let iterations = this.iterations = op.iterations;\n let duration = this.duration = op.duration;\n let [frames, framesR, keys, originStyle] = this.__init(list, iterations, duration, op.easing, target);\n config[I_FRAMES] = frames;\n config[I_FRAMES_R] = framesR;\n config[I_KEYS] = keys;\n config[I_ORIGIN_STYLE] = originStyle;\n if(frames.length === 2) {\n config[I_IS2] = true;\n config[I_END_TIME] = frames[1][FRAME_TIME];\n }\n let fps = parseInt(op.fps) || 0;\n if(fps <= 0) {\n fps = 60;\n }\n this.fps = fps;\n this.spfLimit = op.spfLimit;\n this.delay = op.delay;\n this.endDelay = op.endDelay;\n this.playbackRate = op.playbackRate;\n this.fill = op.fill;\n this.iterations = op.iterations;\n this.direction = op.direction;\n config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(op.direction) ? framesR : frames;\n // 时间戳\n config[I_TIME_STAMP] = frame.__now;\n // 性能优化访问\n this[0] = this.__before;\n this[1] = this.__after;\n }\n\n __init(list, iterations, duration, easing, target) {\n if(list.length < 1) {\n return [[], [], [], {}];\n }\n // 过滤时间非法的,过滤后续offset<=前面的\n let offset = -1;\n let tagName = target.tagName;\n for(let i = 0, len = list.length; i < len; i++) {\n let current = list[i];\n if(current.hasOwnProperty('offset')) {\n current.offset = parseFloat(current.offset) || 0;\n current.offset = Math.max(0, current.offset);\n current.offset = Math.min(1, current.offset);\n // 超过区间[0,1]\n if(isNaN(current.offset) || current.offset < 0 || current.offset > 1) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n // <=前面的\n else if(current.offset <= offset) {\n list.splice(i, 1);\n i--;\n len--;\n continue;\n }\n }\n // 缩写处理\n Object.keys(current).forEach(k => {\n if(abbr.hasOwnProperty(k)) {\n abbr.toFull(current, k);\n }\n });\n // 检查key合法性\n Object.keys(current).forEach(k => {\n if(k !== 'easing' && k !== 'offset' && !change.isValid(tagName, k)) {\n delete current[k];\n }\n });\n }\n // 只有1帧复制出来变成2帧方便运行\n if(list.length === 1) {\n list[0] = clone(list[0]);\n if(list[0].offset === 1) {\n list.unshift({\n offset: 0,\n });\n }\n else {\n let copy = clone(list[0]);\n copy.offset = 1;\n list.push(copy);\n }\n }\n // 强制clone防止同引用\n else {\n list.forEach((item, i) => {\n list[i] = clone(item);\n });\n }\n // 首尾时间偏移强制为[0, 1],不是的话前后加空帧\n let first = list[0];\n if(first.hasOwnProperty('offset') && first.offset > 0) {\n first = {\n offset: 0,\n };\n list.unshift(first);\n }\n else {\n first.offset = 0;\n }\n let last = list[list.length - 1];\n if(last.hasOwnProperty('offset') && last.offset < 1) {\n last = {\n offset: 1,\n };\n list.push(last);\n }\n else {\n last.offset = 1;\n }\n // 计算没有设置offset的时间\n for(let i = 1, len = list.length; i < len; i++) {\n let start = list[i];\n // 从i=1开始offset一定>0,找到下一个有offset的,均分中间无声明的\n if(!start.hasOwnProperty('offset')) {\n let end;\n let j = i + 1;\n for(; j < len; j++) {\n end = list[j];\n if(end.hasOwnProperty('offset')) {\n break;\n }\n }\n let num = j - i + 1;\n start = list[i - 1];\n let per = (end.offset - start.offset) / num;\n for(let k = i; k < j; k++) {\n let item = list[k];\n item.offset = start.offset + per * (k + 1 - i);\n }\n i = j;\n }\n }\n let frames = [];\n // 换算每一关键帧样式标准化\n list.forEach(item => {\n frames.push(framing(item, duration, easing));\n });\n // 为方便两帧之间计算变化,强制统一所有帧的css属性相同,没有写的为节点的当前样式currentStyle\n let keys = unify(frames, target);\n inherit(frames, keys, target);\n let framesR = clone(frames).reverse();\n // 存储原本样式以便恢复用\n let { style, props } = target;\n let originStyle = {};\n keys.forEach(k => {\n if(isGeom(tagName, k)) {\n originStyle[k] = props[k];\n }\n originStyle[k] = style[k];\n });\n // 再计算两帧之间的变化,存入transition属性\n let length = frames.length;\n let prev = frames[0];\n for(let i = 1; i < length; i++) {\n let next = frames[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n // 反向存储帧的倒排结果\n framesR.forEach(item => {\n item[FRAME_TIME] = duration - item[FRAME_TIME];\n item[FRAME_TRANSITION] = [];\n });\n prev = framesR[0];\n for(let i = 1; i < length; i++) {\n let next = framesR[i];\n prev = calFrame(prev, next, keys, target, tagName);\n }\n return [frames, framesR, keys, originStyle];\n }\n\n __clean(isFinish) {\n let __config = this.__config;\n this.__cancelTask();\n __config[I_NEXT_TIME] = 0;\n let restore;\n let style = __config[I_STYLE];\n let keys = __config[I_KEYS];\n let target = __config[I_TARGET];\n if(isFinish) {\n __config[I_CURRENT_TIME] = __config[I_DELAY] + __config[I_DURATION] + __config[I_END_DELAY];\n if(__config[I_PLAY_STATE] === 'finish') {\n return;\n }\n __config[I_PLAY_STATE] = 'finish';\n // cancel需要清除finish根据情况保留\n if(!__config[I_STAY_END]) {\n __config[I_STYLE] = {};\n restore = true;\n }\n }\n else {\n __config[I_PLAY_COUNT] = __config[I_CURRENT_TIME] = 0;\n if(__config[I_PLAY_STATE] === 'idle') {\n return;\n }\n __config[I_PLAY_STATE] = 'idle';\n __config[I_STYLE] = {};\n restore = true;\n }\n // 动画取消结束不停留在最后一帧需要还原target原本的样式,需要对比目前是否是由本动画赋值的\n if(restore) {\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n if(target.__currentProps[k] === style[k]) {\n target.__currentProps[k] = target.props[k];\n }\n }\n else {\n if(target.__currentStyle[k] === style[k]) {\n target.__currentStyle[k] = target.style[k];\n }\n }\n });\n }\n }\n\n __frameCb(__config, diff, isDelay) {\n this.emit(Event.FRAME, diff, isDelay);\n if(__config[I_FIRST_PLAY]) {\n __config[I_FIRST_PLAY] = false;\n this.emit(Event.PLAY);\n }\n if(isFunction(__config[I_PLAY_CB])) {\n __config[I_PLAY_CB].call(this, diff, isDelay);\n __config[I_PLAY_CB] = null;\n }\n }\n\n __calDiffTime(__config, diff) {\n let playbackRate = __config[I_PLAYBACK_RATE];\n let spfLimit = __config[I_SPF_LIMIT];\n let fps = __config[I_FPS];\n let v = __config[I_CURRENT_TIME] = __config[I_NEXT_TIME];\n // 定帧限制每帧时间间隔最大为spf\n if(spfLimit) {\n if(spfLimit === true) {\n diff = Math.min(diff, 1000 / fps);\n }\n else if(spfLimit > 0) {\n diff = Math.min(diff, spfLimit);\n }\n }\n // 播放时间累加,并且考虑播放速度加成\n if(playbackRate !== 1 && playbackRate > 0) {\n diff *= playbackRate;\n }\n __config[I_NEXT_TIME] += diff;\n return [v, diff];\n }\n\n play(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n if(playState === 'running') {\n return this;\n }\n this.__cancelTask();\n __config[I_PLAY_CB] = cb;\n __config[I_PLAY_STATE] = 'running';\n // 每次play调用标识第一次运行,需响应play事件和回调\n __config[I_FIRST_PLAY] = true;\n // 防止finish/cancel事件重复触发,每次播放重置\n this.__hasFin = false;\n this.__hasCancel = false;\n // 只有第一次调用会进初始化,另外finish/cancel视为销毁也会重新初始化\n if(!__config[I_ENTER_FRAME]) {\n __config[I_ENTER_FRAME] = true;\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n // 初始化根据方向确定帧序列\n __config[I_CURRENT_FRAMES] = {\n reverse: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction) ? framesR : frames;\n __config[I_CURRENT_TIME] = __config[I_NEXT_TIME] = __config[I_FPS_TIME] = 0;\n }\n // 添加每帧回调且立刻执行,本次执行调用refreshTask也是下一帧再渲染,frame的每帧都是下一帧\n frame.offFrame(this);\n frame.onFrame(this);\n __config[I_START_TIME] = frame.__now;\n __config[I_END] = false;\n return this;\n }\n\n __before(diff) {\n let __config = this.__config;\n __config[I_TIME_STAMP] = frame.__now;\n let target = __config[I_TARGET];\n let fps = __config[I_FPS];\n let playCount = __config[I_PLAY_COUNT];\n let currentFrames = __config[I_CURRENT_FRAMES];\n let iterations = __config[I_ITERATIONS];\n let stayBegin = __config[I_STAY_BEGIN];\n let stayEnd = __config[I_STAY_END];\n let delay = __config[I_DELAY];\n let root = __config[I_ROOT];\n let is2 = __config[I_IS2];\n let endTime = __config[I_END_TIME];\n let duration = __config[I_DURATION];\n let endDelay = __config[I_END_DELAY];\n let length = currentFrames.length;\n // 用本帧和上帧时间差,计算累加运行时间currentTime,以便定位当前应该处于哪个时刻\n let [currentTime, d] = __config[I_CAL_DIFF_TIME](__config, diff);\n diff = d;\n // 增加的fps功能,当<60时计算跳帧,每帧运行依旧累加时间,达到fps时重置,第一帧强制不跳\n if(!__config[I_FIRST_ENTER] && fps < 60) {\n diff = __config[I_FPS_TIME] += diff;\n if(diff < 1000 / fps) {\n __config[I_IN_FPS] = true;\n return;\n }\n __config[I_FPS_TIME] = 0;\n }\n __config[I_FIRST_ENTER] = false;\n // delay仅第一次生效\n if(playCount === 0 && currentTime < delay) {\n if(stayBegin) {\n let currentFrame = __config[I_CURRENT_FRAME] = currentFrames[0];\n let current = currentFrame[FRAME_STYLE];\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n }\n // 即便不刷新,依旧执行帧回调,同时标明让后续第一帧响应begin\n __config[I_OUT_BEGIN_DELAY] = true;\n __config[I_IS_DELAY] = true;\n return;\n }\n // 减去delay,计算在哪一帧,仅首轮\n if(playCount === 0) {\n currentTime -= delay;\n }\n if(currentTime === 0 || __config[I_OUT_BEGIN_DELAY]) {\n __config[I_OUT_BEGIN_DELAY] = false;\n __config[I_BEGIN] = true;\n }\n // 超过duration非尾轮需处理回到开头,触发新一轮动画事件,这里可能时间间隔非常大直接跳过几轮\n let round;\n while(currentTime >= duration && playCount < iterations - 1) {\n currentTime -= duration;\n __config[I_NEXT_TIME] -= duration;\n playCount = ++__config[I_PLAY_COUNT];\n __config[I_BEGIN] = true;\n round = true;\n }\n // 如果发生轮换,需重新确定正反向\n if(round) {\n let direction = __config[I_DIRECTION];\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let isAlternate = {\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction);\n // 有正反向播放需要重设帧序列\n if(isAlternate) {\n let isEven = playCount % 2 === 0;\n if(direction === 'alternate') {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n currentFrames = __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n }\n let isLastCount = playCount >= iterations - 1;\n // 只有2帧可优化,否则2分查找当前帧\n let i, frameTime;\n if(is2) {\n i = currentTime < endTime ? 0 : 1;\n frameTime = endTime;\n }\n else {\n i = binarySearch(0, length - 1, currentTime, currentFrames);\n frameTime = currentFrames[i][FRAME_TIME];\n }\n // 最后一帧结束动画,仅最后一轮才会进入,需处理endDelay\n let isLastFrame = isLastCount && i === length - 1;\n let percent = 0;\n if(isLastFrame) {\n // 无需任何处理\n }\n // 否则根据目前到下一帧的时间差,计算百分比,再反馈到变化数值上\n else if(is2) {\n percent = currentTime / duration;\n }\n else {\n let total = currentFrames[i + 1][FRAME_TIME] - frameTime;\n percent = (currentTime - frameTime) / total;\n }\n let inEndDelay, currentFrame = currentFrames[i], current;\n __config[I_CURRENT_FRAME] = currentFrame;\n /** 这里要考虑全几种场景:\n * 1. 单次播放无endDelay且fill不停留(有/无差异,下同)\n * 2. 单次播放无endDelay且fill停留\n * 3. 单次播放有endDelay且fill不停留\n * 4. 单次播放有endDelay且fill停留\n * 5. 多次播放无endDelay且fill不停留(尾次/非尾次,下同)\n * 6. 多次播放无endDelay且fill停留\n * 7. 多次播放有endDelay且fill不停留\n * 8. 多次播放有endDelay且fill停留\n */\n let needClean;\n if(isLastFrame) {\n inEndDelay = currentTime < duration + endDelay;\n // 停留对比最后一帧,endDelay可能会多次进入这里,第二次进入样式相等不再重绘\n if(stayEnd) {\n current = cloneStyle(currentFrame[FRAME_STYLE], __config[I_KEYS]);\n }\n // 不停留或超过endDelay则计算还原,有endDelay且fill模式不停留会再次进入这里\n else {\n current = cloneStyle(__config[I_ORIGIN_STYLE], __config[I_KEYS]);\n }\n // 进入endDelay或结束阶段触发end事件,注意只触发一次,防重在触发的地方做\n __config[I_NEXT_END] = true;\n if(!inEndDelay) {\n __config[I_PLAY_COUNT]++;\n __config[I_FINISHED] = true;\n frame.offFrame(this);\n needClean = true;\n __config[I_NEXT_TIME] = 0;\n }\n }\n else {\n current = calIntermediateStyle(currentFrame, __config[I_KEYS], percent, target);\n }\n // 无论两帧之间是否有变化,都生成计算结果赋给style,去重在root做\n genBeforeRefresh(current, __config[I_KEYS], __config, root, target);\n if(needClean) {\n 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 __config[I_FRAME_CB].call(this, __config, diff, __config[I_IS_DELAY]);\n __config[I_IS_DELAY] = false;\n if(__config[I_BEGIN]) {\n __config[I_BEGIN] = false;\n this.emit(Event.BEGIN, __config[I_PLAY_COUNT]);\n }\n // end事件只触发一次,末轮进入endDelay或直接结束时\n if(__config[I_NEXT_END] && !__config[I_END]) {\n __config[I_END] = true;\n this.emit(Event.END, __config[I_PLAY_COUNT] - 1);\n }\n if(__config[I_FINISHED]) {\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n __config[I_PLAY_STATE] = 'finished';\n this.emit(Event.FINISH);\n }\n }\n\n pause(silence) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let { pending } = this;\n if(isDestroyed || duration <= 0 || pending) {\n return this;\n }\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(!silence) {\n this.emit(Event.PAUSE);\n }\n return this;\n }\n\n resume(cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n if(isDestroyed || duration <= 0 || playState !== 'paused') {\n return this;\n }\n return this.play(cb);\n }\n\n finish(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || frames.length < 1 || playState === 'finished' || playState === 'idle') {\n return self;\n }\n // 先清除所有回调任务,多次调用finish也会清除只留最后一次\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n let current;\n // 停留在最后一帧\n if(__config[I_STAY_END]) {\n __config[I_CURRENT_FRAME] = frames[frames.length - 1];\n current = frames[frames.length - 1][FRAME_STYLE];\n }\n else {\n current = originStyle;\n }\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(current, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean(true);\n },\n __after(diff) {\n if(!self.__hasFin) {\n self.__hasFin = true;\n __config[I_ASSIGNING] = false;\n __config[I_FRAME_CB].call(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.FINISH);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n cancel(cb) {\n let self = this;\n let __config = self.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let playState = __config[I_PLAY_STATE];\n let frames = __config[I_FRAMES];\n if(isDestroyed || duration <= 0 || playState === 'idle' || frames.length < 1) {\n return self;\n }\n self.__cancelTask();\n let root = __config[I_ROOT];\n let originStyle = __config[I_ORIGIN_STYLE];\n if(root) {\n root.addRefreshTask({\n __before() {\n __config[I_ASSIGNING] = true;\n genBeforeRefresh(originStyle, __config[I_KEYS], __config, root, __config[I_TARGET]);\n self.__clean();\n },\n __after(diff) {\n if(!self.__hasCancel) {\n self.__hasCancel = true;\n __config[I_ASSIGNING] = false;\n __config[I_FRAME_CB].call(self, __config, diff);\n __config[I_BEGIN] = __config[I_END] = __config[I_IS_DELAY] = __config[I_FINISHED]\n = __config[I_IN_FPS] = __config[I_ENTER_FRAME] = false;\n self.emit(Event.CANCEL);\n }\n if(isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n return self;\n }\n\n gotoAndPlay(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n // 计算出时间点直接累加播放\n this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n return this.play(cb);\n }\n\n gotoAndStop(v, options, cb) {\n let __config = this.__config;\n let isDestroyed = __config[I_DESTROYED];\n let duration = __config[I_DURATION];\n let frames = __config[I_FRAMES];\n let delay = __config[I_DELAY];\n let endDelay = __config[I_END_DELAY];\n if(isDestroyed || duration <= 0 || frames.length < 1) {\n return this;\n }\n [options, cb] = gotoOverload(options, cb);\n v = this.__goto(v, options.isFrame, options.excludeDelay);\n if(v > duration + delay + endDelay) {\n return this.finish(cb);\n }\n // 先play一帧,回调里模拟暂停\n return this.play(diff => {\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isFunction(cb)) {\n cb.call(this, diff);\n }\n });\n }\n\n // 同步赋予,用在extendAnimate\n assignCurrentStyle() {\n let __config = this.__config;\n let style = __config[I_STYLE];\n let target = __config[I_TARGET];\n let keys = __config[I_KEYS];\n keys.forEach(i => {\n if(style.hasOwnProperty(i)) {\n let v = style[i];\n // geom的属性变化\n if(GEOM.hasOwnProperty(i)) {\n target.currentProps[i] = v;\n }\n // 样式\n else {\n // 将动画样式直接赋给currentStyle\n target.currentStyle[i] = v;\n }\n }\n });\n }\n\n __goto(v, isFrame, excludeDelay) {\n let __config = this.__config;\n let duration = __config[I_DURATION];\n __config[I_PLAY_STATE] = 'paused';\n this.__cancelTask();\n if(isNaN(v) || v < 0) {\n throw new Error('Param of gotoAnd(Play/Stop) is illegal: ' + v);\n }\n if(isFrame) {\n v = (v - 1) / this.spf;\n }\n if(excludeDelay) {\n v += __config[I_DELAY];\n }\n // 超过一轮去掉delay\n if(v > duration + __config[I_DELAY]) {\n v -= __config[I_DELAY];\n }\n // 超过时间长度需要累加次数\n __config[I_PLAY_COUNT] = 0;\n while(v > duration && __config[I_PLAY_COUNT] < __config[I_ITERATIONS] - 1) {\n __config[I_PLAY_COUNT]++;\n v -= duration;\n }\n // 在时间范围内设置好时间,复用play直接跳到播放点\n __config[I_NEXT_TIME] = v;\n // 防止play()重置时间和当前帧组,提前计算好\n __config[I_ENTER_FRAME] = true;\n let frames = __config[I_FRAMES];\n let framesR = __config[I_FRAMES_R];\n let direction = __config[I_DIRECTION];\n if({\n alternate: true,\n 'alternate-reverse': true,\n }.hasOwnProperty(direction)) {\n let isEven = __config[I_PLAY_COUNT] % 2 === 0;\n if(direction === 'alternate') {\n __config[I_CURRENT_FRAMES] = isEven ? frames : framesR;\n }\n else {\n __config[I_CURRENT_FRAMES] = isEven ? framesR : frames;\n }\n }\n return v;\n }\n\n addControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.add(this);\n }\n }\n\n removeControl() {\n let ac = this.root.animateController;\n if(ac) {\n ac.remove(this);\n }\n }\n\n __stayBegin() {\n return {\n backwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __stayEnd() {\n return {\n forwards: true,\n both: true,\n }.hasOwnProperty(this.fill);\n }\n\n __setTarget(target) {\n this.__target = target;\n this.__config[I_TARGET] = target;\n this.__config[I_NODE_CONFIG] = target.__config;\n }\n\n __cancelTask() {\n frame.offFrame(this);\n this.__config[I_PLAY_CB] = null;\n }\n\n __destroy(sync) {\n let self = this;\n let __config = self.__config;\n if(__config[I_DESTROYED]) {\n return;\n }\n self.removeControl();\n // clean异步执行,因为里面的样式还原需要等到下一帧,否则同步执行清除后,紧接着的新同步动画获取不到currentStyle\n if(sync) {\n self.__clean();\n __config[I_TARGET] = null;\n }\n else {\n frame.nextFrame({\n __before() {\n self.__clean();\n __config[I_TARGET] = null;\n },\n });\n }\n __config[I_START_TIME] = 0;\n __config[I_DESTROYED] = true;\n }\n\n __checkModify() {\n let __config = this.__config;\n if(__config[I_PLAY_STATE] !== 'idle' && __config[I_PLAY_STATE] !== 'finished') {\n inject.warn('Modification will not come into effect when animation is running');\n }\n }\n\n get id() {\n return this.__id;\n }\n\n get target() {\n return this.__config[I_TARGET];\n }\n\n get root() {\n return this.__config[I_ROOT];\n }\n\n get keys() {\n return this.__config[I_KEYS];\n }\n\n get style() {\n return this.__config[I_STYLE];\n }\n\n get options() {\n return this.__options;\n }\n\n get duration() {\n return this.__config[I_DURATION];\n }\n\n set duration(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DURATION] !== v) {\n __config[I_DURATION] = v;\n __config[I_END_TIME] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get delay() {\n return this.__config[I_DELAY];\n }\n\n set delay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_DELAY] !== v) {\n __config[I_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get endDelay() {\n return this.__config[I_END_DELAY];\n }\n\n set endDelay(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_END_DELAY] !== v) {\n __config[I_END_DELAY] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get fps() {\n return this.__config[I_FPS];\n }\n\n set fps(v) {\n v = parseInt(v) || 60;\n let __config = this.__config;\n if(__config[I_FPS] !== v) {\n if(v <= 0) {\n v = 60;\n }\n __config[I_FPS] = v;\n }\n return v;\n }\n\n get spf() {\n return 1 / this.fps;\n }\n\n get iterations() {\n return this.__config[I_ITERATIONS];\n }\n\n set iterations(v) {\n if(v === Infinity || util.isString(v) && v.toLowerCase() === 'infinity') {\n v = Infinity;\n }\n else {\n v = parseInt(v);\n if(isNaN(v) || v < 0) {\n v = 1;\n }\n }\n let __config = this.__config;\n if(__config[I_ITERATIONS] !== v) {\n __config[I_ITERATIONS] = v;\n }\n return v;\n }\n\n get fill() {\n return this.__config[I_FILL];\n }\n\n set fill(v) {\n v = v || 'none';\n let __config = this.__config;\n if(__config[I_FILL] !== v) {\n __config[I_FILL] = v;\n this.__checkModify();\n }\n __config[I_STAY_BEGIN] = {\n backwards: true,\n both: true,\n }.hasOwnProperty(v);\n __config[I_STAY_END] = {\n forwards: true,\n both: true,\n }.hasOwnProperty(v);\n return v;\n }\n\n get direction() {\n return this.__config[I_DIRECTION];\n }\n\n set direction(v) {\n v = v || 'normal';\n let __config = this.__config;\n if(__config[I_DIRECTION] !== v) {\n __config[I_DIRECTION] = v;\n this.__checkModify();\n }\n return v;\n }\n\n get frames() {\n return this.__config[I_FRAMES];\n }\n\n get framesR() {\n return this.__config[I_FRAMES_R];\n }\n\n get playbackRate() {\n return this.__config[I_PLAYBACK_RATE];\n }\n\n set playbackRate(v) {\n v = parseFloat(v) || 1;\n if(v <= 0) {\n v = 1;\n }\n let __config = this.__config;\n if(__config[I_PLAYBACK_RATE] !== v) {\n __config[I_PLAYBACK_RATE] = v;\n }\n return v;\n }\n\n get easing() {\n return this.__config[I_EASING];\n }\n\n get startTime() {\n return this.__config[I_START_TIME];\n }\n\n get currentTime() {\n return this.__config[I_CURRENT_TIME];\n }\n\n set currentTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_CURRENT_TIME] !== v) {\n __config[I_CURRENT_TIME] = v;\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get nextTime() {\n return this.__config[I_NEXT_TIME];\n }\n\n set nextTime(v) {\n v = Math.max(0, parseFloat(v) || 0);\n let __config = this.__config;\n if(__config[I_NEXT_TIME] !== v) {\n __config[I_NEXT_TIME] = v;\n }\n return v;\n }\n\n get timestamp() {\n return this.__config[I_TIME_STAMP];\n }\n\n get pending() {\n return this.__config[I_PLAY_STATE] !== 'running';\n }\n\n get finished() {\n return this.__config[I_PLAY_STATE] === 'finished';\n }\n\n get playState() {\n return this.__config[I_PLAY_STATE];\n }\n\n get playCount() {\n return this.__config[I_PLAY_COUNT];\n }\n\n set playCount(v) {\n v = Math.max(0, parseInt(v) || 0);\n let __config = this.__config;\n if(__config[I_PLAY_COUNT] !== v) {\n __config[I_PLAY_COUNT] = v;\n }\n return v;\n }\n\n get isDestroyed() {\n return this.__config[I_DESTROYED];\n }\n\n get animating() {\n let __config = this.__config;\n let playState = __config[I_PLAY_STATE];\n if(playState === 'idle') {\n return false;\n }\n return playState !== 'finished' || __config[I_STAY_END] || __config[I_STAY_BEGIN];\n }\n\n get spfLimit() {\n let __config = this.__config;\n return __config[I_SPF_LIMIT];\n }\n\n set spfLimit(v) {\n if(util.isNumber(v) || /^\\d/.test(v)) {\n v = Math.max(0, parseInt(v) || 0);\n }\n else {\n v = !!v;\n }\n let __config = this.__config;\n if(__config[I_SPF_LIMIT] !== v) {\n __config[I_SPF_LIMIT] = v;\n }\n return v;\n }\n\n get assigning() {\n return this.__config[I_ASSIGNING];\n }\n}\n\nexport default Animation;\n","import mode from '../node/mode';\nimport geom from '../math/geom';\nimport blur from '../math/blur';\nimport util from '../util/util';\nimport painter from '../util/painter';\nimport enums from '../util/enums';\n\nconst {\n NODE_KEY: {\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { int2rgba } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nfunction renderBoxShadow(xom, renderMode, ctx, data, x1, y1, x2, y2, w, h, 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 } = 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, isDirectItem) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w, !isDirectItem)\n + this.__calMp(marginRight, w, !isDirectItem)\n + this.__calMp(paddingLeft, w, !isDirectItem)\n + this.__calMp(paddingRight, w, !isDirectItem);\n if(borderLeftWidth[1] === PX) {\n mp += borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n mp += borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n mp += borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n mp += borderLeftWidth[0] * this.root.height * 0.01;\n }\n 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 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;\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 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.tagName === 'img') && marginLeft[1] === AUTO && marginRight[1] === AUTO) {\n let ow = this.outerWidth;\n if(ow < data.w) {\n this.__offsetX((data.w - ow) * 0.5, true);\n }\n }\n }\n\n __calMatrix(lv, __cacheStyle, currentStyle, computedStyle, __config, sx1, sy1, offsetWidth, offsetHeight) {\n if(__config[NODE_IS_INLINE]) {\n computedStyle[TRANSFORM_ORIGIN] = [sx1, sy1];\n return __cacheStyle[MATRIX] = mx.identity();\n }\n let matrixCache = __cacheStyle[MATRIX];\n // tx/ty变化特殊优化\n if(matrixCache && lv < REFLOW && !contain(lv, TF)) {\n let x = 0, y = 0, z = 0;\n if(contain(lv, TX)) {\n let v = currentStyle[TRANSLATE_X];\n if(isNil(v)) {\n v = 0;\n }\n else if(v[1] === PERCENT) {\n v = v[0] * this.offsetWidth * 0.01;\n }\n else if(v[1] === REM) {\n v = v[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(v[1] === VW) {\n v = v[0] * this.root.width * 0.01;\n }\n else if(v[1] === VH) {\n v = v[0] * this.root.height * 0.01;\n }\n else 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 * @param lv\n * @param ctx canvas/svg/webgl共用\n * @param cache 是否是局部根节点缓存模式下的绘制\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 this.__bbox = null;\n if(isDestroyed) {\n return { isDestroyed, break: true };\n }\n let virtualDom;\n // svg设置vd上的lv属性标明lineHeight的话,另外特殊字体如arial拥有lineGap也会产生间隙,背景色不绘制这个间隙\n * x轴根据contentBox的范围坐标,y则固定和font/lineHeight相关\n * 圆角发生在首尾lineBox处,中间不会有,bgi则产生类似bgc作为mask的效果\n * 另外要注意多个时的顺序,必须依次渲染,后面的bb可能会覆盖前面行的\n */\n if(isRealInline) {\n let contentBoxList = this.contentBoxList;\n let length = contentBoxList.length;\n let hasBgi = backgroundImage.some(item => item);\n if(length) {\n let {\n [FONT_SIZE]: fontSize,\n [FONT_FAMILY]: fontFamily,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let iw = 0, ih = 0;\n let offscreen, svgBgSymbol = [];\n // bgi视作inline排满一行绘制,然后按分行拆开给每行\n if(hasBgi) {\n iw = inline.getInlineWidth(this, contentBoxList);\n ih = lineHeight;\n if(backgroundClip === 'paddingBox' || backgroundClip === 'padding-box') {\n iw += paddingLeft + paddingRight;\n ih += paddingTop + paddingBottom;\n }\n else if(backgroundClip !== 'contentBox' && backgroundClip !== 'content-box') {\n iw += paddingLeft + paddingRight + borderLeftWidth + borderRightWidth;\n ih += paddingTop + paddingBottom + borderTopWidth + borderBottomWidth;\n }\n if(renderMode === CANVAS || renderMode === WEBGL) {\n offscreen = inject.getCacheCanvas(iw, ih, '__$$INLINE_BGI$$__');\n }\n let length = backgroundImage.length;\n backgroundImage.slice(0).reverse().forEach((bgi, i) => {\n if(!bgi) {\n return;\n }\n i = length - 1 - i;\n if(util.isString(bgi)) {\n let loadBgi = this.__loadBgi[i];\n if(loadBgi.url === backgroundImage[i]) {\n let uuid = bg.renderImage(this, renderMode, offscreen && offscreen.ctx || ctx, loadBgi,\n 0, 0, iw, ih, btlr, btrr, bbrr, bblr,\n currentStyle, i, backgroundSize, backgroundRepeat, __config, true, 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.delRefreshTask(this.__loadBgi.cb);\n root.delRefreshTask(this.__task);\n this.__task = null;\n this.__root = null;\n this.clearCache();\n }\n\n // 先查找到注册了事件的节点,再捕获冒泡判断增加性能\n __emitEvent(e, force) {\n let { isDestroyed, computedStyle, isMask } = this;\n if(isDestroyed || computedStyle[DISPLAY] === 'none' || e.__stopPropagation || isMask) {\n return;\n }\n let { event: { type } } = e;\n let { listener, __hasMask } = this;\n let cb;\n if(listener.hasOwnProperty(type)) {\n cb = listener[type];\n }\n // touchmove之类强制的直接由Root通知即可\n if(force) {\n if(computedStyle[POINTER_EVENTS] !== 'none' && util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n // 非force的判断事件坐标是否在节点内\n if(this.willResponseEvent(e)) {\n // 如果有mask,点在mask上才行,点在clip外才行\n if(__hasMask) {\n let next = this.next;\n let isClip = next.isClip;\n let hasEmitMask;\n while(next && next.isMask) {\n if(next.willResponseEvent(e, true)) {\n hasEmitMask = true;\n break;\n }\n next = next.next;\n }\n if(!isClip && !hasEmitMask) {\n return;\n }\n }\n if(util.isFunction(cb) && !e.__stopImmediatePropagation) {\n cb.call(this, e);\n }\n return true;\n }\n }\n\n willResponseEvent(e, ignore) {\n let { x, y } = e;\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent, computedStyle } = this;\n if(computedStyle[POINTER_EVENTS] === 'none') {\n return;\n }\n let inThis = geom.pointInQuadrilateral(\n x, y,\n __sx1, __sy1,\n __sx1 + offsetWidth, __sy1,\n __sx1 + offsetWidth, __sy1 + offsetHeight,\n __sx1, __sy1 + offsetHeight,\n matrixEvent\n );\n if(inThis) {\n if(!e.target && !ignore) {\n e.target = this;\n // 缓存target给move用\n if(e.event.type === 'touchstart') {\n this.root && (this.root.__touchstartTarget = this);\n }\n }\n return true;\n }\n }\n\n __gradient(renderMode, ctx, bx1, by1, bx2, by2, bgi, 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(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, formatStyle);\n if(util.isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n // 传入格式化好key/value的样式\n updateFormatStyle(style, cb) {\n let node = this;\n let { root, __config } = node;\n if(root) {\n root.addRefreshTask(node.__task = {\n __before() {\n node.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(__config[NODE_IS_DESTROYED]) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = node;\n res[UPDATE_STYLE] = style;\n res[UPDATE_KEYS] = Object.keys(style).map(i => {\n if(!GEOM.hasOwnProperty(i)) {\n i = parseInt(i);\n }\n return i;\n });\n res[UPDATE_CONFIG] = __config;\n root.__addUpdate(node, __config, root, root.__config, res);\n },\n __after(diff) {\n if(util.isFunction(cb)) {\n cb.call(node, diff);\n }\n },\n });\n }\n // 没有是在如parse()还未添加的时候,可以直接同步覆盖\n else {\n Object.assign(this.currentStyle, style);\n if(util.isFunction(cb)) {\n cb.call(node, -1);\n }\n }\n }\n\n animate(list, options = {}) {\n let animation = new Animation(this, list, options);\n if(this.isDestroyed) {\n animation.__destroy(true);\n return animation;\n }\n this.animationList.push(animation);\n if(options.autoPlay === false) {\n return animation;\n }\n return animation.play();\n }\n\n removeAnimate(o) {\n if(o instanceof Animation) {\n let i = this.animationList.indexOf(o);\n if(i > -1) {\n o.cancel();\n o.__destroy();\n this.animationList.splice(i, 1);\n }\n }\n }\n\n clearAnimate() {\n this.animationList.splice(0).forEach(o => {\n o.cancel();\n o.__destroy();\n });\n }\n\n frameAnimate(cb) {\n if(util.isFunction(cb)) {\n let list = this.__frameAnimateList;\n // 防止重复\n for(let i = 0, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n return cb;\n }\n }\n let enter = {\n __after(diff) {\n cb(diff);\n },\n __karasFramecb: cb,\n };\n list.push(enter);\n frame.onFrame(enter);\n return cb;\n }\n }\n\n removeFrameAnimate(cb) {\n for(let i = 0, list = this.__frameAnimateList, len = list.length; i < len; i++) {\n if(list[i].__karasFramecb === cb) {\n list.splice(i, 1);\n frame.offFrame(cb);\n return;\n }\n }\n }\n\n clearFrameAnimate() {\n this.__frameAnimateList.splice(0).forEach(o => {\n frame.offFrame(o);\n });\n }\n\n __computeMeasure(renderMode, ctx, cb) {\n css.computeMeasure(this);\n if(util.isFunction(cb)) {\n cb(this);\n }\n }\n\n __deepScan(cb, options) {\n return cb(this, options);\n }\n\n // isLayout为false时,为relative/margin/flex/vertical等\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout);\n if(isLayout) {\n this.__layoutData.x += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sx1 += diff;\n this.__sx2 += diff;\n this.__sx3 += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout);\n if(isLayout) {\n this.__layoutData.y += diff;\n this.clearCache();\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.__sy1 += diff;\n this.__sy2 += diff;\n this.__sy3 += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n }\n\n __resizeX(diff, lv) {\n this.computedStyle.width = this.__width += diff;\n this.__clientWidth += diff;\n this.__offsetWidth += diff;\n this.__outerWidth += diff;\n this.__layoutData.w += diff;\n this.__sx4 += diff;\n this.__sx5 += diff;\n this.__sx6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __resizeY(diff, lv) {\n this.computedStyle.height = this.__height += diff;\n this.__clientHeight += diff;\n this.__offsetHeight += diff;\n this.__outerHeight += diff;\n this.__layoutData.h += diff;\n this.__sy4 += diff;\n this.__sy5 += diff;\n this.__sy6 += diff;\n if(diff < 0) {\n this.__config[NODE_LIMIT_CACHE] = false;\n }\n if(lv !== undefined) {\n this.__config[NODE_REFRESH_LV] |= lv;\n }\n this.clearCache();\n }\n\n __spreadBbox(boxShadow) {\n let ox = 0, oy = 0;\n if(Array.isArray(boxShadow)) {\n boxShadow.forEach(item => {\n let [x, y, sigma, spread, , inset] = item;\n if(inset !== 'inset') {\n let d = blur.outerSize(sigma);\n d += spread;\n ox = Math.max(ox, x + d);\n oy = Math.max(oy, y + d);\n }\n });\n }\n return [ox, oy];\n }\n\n __releaseWhenEmpty(__cache) {\n if(__cache && __cache.available) {\n __cache.release();\n }\n return true;\n }\n\n getComputedStyle(key) {\n let computedStyle = this.computedStyle;\n let res = {};\n let keys;\n if(key) {\n if(Array.isArray(key)) {\n keys = key;\n }\n else {\n keys = [key];\n }\n keys = keys.map(s => {\n return STYLE_KEY[style2Upper(s)];\n });\n }\n else {\n keys = Object.keys(computedStyle);\n }\n keys.forEach(k => {\n if(GEOM.hasOwnProperty(k)) {\n res[k] = computedStyle[k];\n }\n else {\n res[STYLE_RV_KEY[k]] = computedStyle[k];\n }\n });\n return res;\n }\n\n getBoundingClientRect() {\n let { __sx1, __sy1, offsetWidth, offsetHeight, matrixEvent } = this;\n let p1 = point2d(mx.calPoint([__sx1, __sy1], matrixEvent));\n let p2 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1], matrixEvent));\n let p3 = point2d(mx.calPoint([__sx1 + offsetWidth, __sy1 + offsetHeight], matrixEvent));\n let p4 = point2d(mx.calPoint([__sx1, __sy1 + offsetHeight], matrixEvent));\n return {\n left: Math.min(p1[0], Math.min(p2[0], Math.min(p3[0], p4[0]))),\n top: Math.min(p1[1], Math.min(p2[1], Math.min(p3[1], p4[1]))),\n right: Math.max(p1[0], Math.max(p2[0], Math.max(p3[0], p4[0]))),\n bottom: Math.max(p1[1], Math.max(p2[1], Math.max(p3[1], p4[1]))),\n points: [p1, p2, p3, p4],\n };\n }\n\n // img和geom返回false,在inline布局时判断是否是真的inline\n __isRealInline() {\n return true;\n }\n\n remove(cb) {\n let self = this;\n if(self.isDestroyed) {\n inject.warn('Remove target is destroyed.');\n if(util.isFunction(cb)) {\n cb();\n }\n return;\n }\n let { root, domParent } = self;\n let target = self.isShadowRoot ? self.hostRoot : self;\n // 特殊情况连续append/remove时候,还未被添加进来找不到所以无需删除\n if(domParent.children.indexOf(target) === -1) {\n if(util.isFunction(cb)) {\n cb();\n }\n return;\n }\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n let pJson = domParent.__json;\n let i = pJson.children.indexOf(self.isShadowRoot ? self.hostRoot.__json : self.__json);\n let zChildren = domParent.zIndexChildren;\n let j = zChildren.indexOf(self.isShadowRoot ? self.hostRoot : self);\n if(i === -1 || j === -1) {\n throw new Error('Remove index Exception.')\n }\n pJson.children.splice(i, 1);\n domParent.children.splice(i, 1);\n zChildren.splice(j, 1);\n if(self.__prev) {\n self.__prev.__next = self.__next;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_REMOVE_DOM] = true;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after(diff) {\n self.isShadowRoot ? self.hostRoot.__destroy() : self.__destroy();\n if(util.isFunction(cb)) {\n cb.call(self, diff);\n }\n },\n });\n }\n\n get tagName() {\n return this.__tagName;\n }\n\n get sx() {\n return this.__sx;\n }\n\n get sy() {\n return this.__sy;\n }\n\n get clientWidth() {\n return this.__clientWidth || 0;\n }\n\n get clientHeight() {\n return this.__clientHeight || 0;\n }\n\n get offsetWidth() {\n return this.__offsetWidth || 0;\n }\n\n get offsetHeight() {\n return this.__offsetHeight || 0;\n }\n\n get outerWidth() {\n return this.__outerWidth || 0;\n }\n\n get outerHeight() {\n return this.__outerHeight || 0;\n }\n\n // 不考虑margin的范围,>=REPAINT渲染或个别有影响的渲染改变(如blur)清空缓存\n get bbox() {\n if(!this.__bbox) {\n let {\n __sx1, __sy1, clientWidth, clientHeight,\n currentStyle: {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BOX_SHADOW]: boxShadow,\n },\n } = this;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n clientWidth += borderLeftWidth[0] + borderRightWidth[0];\n clientHeight += borderTopWidth[0] + borderBottomWidth[0];\n let half = 1;\n this.__bbox = [__sx1 - ox - half, __sy1 - oy - half, __sx1 + clientWidth + ox + half, __sy1 + clientHeight + oy + half];\n }\n return this.__bbox;\n }\n\n get listener() {\n return this.__listener;\n }\n\n get matrix() {\n return this.__config[NODE_MATRIX];\n }\n\n get matrixEvent() {\n return this.__config[NODE_MATRIX_EVENT];\n }\n\n get perspectiveMatrix() {\n return this.__config[NODE_PERSPECTIVE_MATRIX];\n }\n\n get style() {\n return this.__style;\n }\n\n get computedStyle() {\n return this.__computedStyle;\n }\n\n get animationList() {\n return this.__animationList;\n }\n\n get currentStyle() {\n return this.__currentStyle;\n }\n\n get isShadowRoot() {\n return !this.parent && this.host && this.host !== this.root;\n }\n\n get contentBoxList() {\n return this.__contentBoxList;\n }\n\n get baseLine() {\n return this.offsetHeight;\n }\n\n get firstBaseLine() {\n return this.offsetHeight;\n }\n\n get isMask() {\n return this.__isMask;\n }\n\n get isClip() {\n return this.__isClip;\n }\n\n 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 n = this.baseLine;\n // 只有1个也需要对齐,因为可能内嵌了空inline使得baseLine发生变化\n if(this.list.length) {\n this.list.forEach(item => {\n let m = item.baseLine;\n if(m !== n) {\n item.__offsetY(n - m);\n }\n });\n }\n }\n\n __offsetX(diff) {\n this.__x += diff;\n }\n\n __offsetY(diff) {\n this.__y += diff;\n }\n\n /**\n * 防止非行首空inline,每当遇到inline就设置当前lineBox的lineHeight/baseLine,这样有最小值兜底\n * @param l\n * @param b\n * @private\n */\n __setLB(l, b) {\n this.__lineHeight = Math.max(l, this.__lineHeight);\n this.__baseLine = Math.max(b, this.__baseLine);\n }\n\n get list() {\n return this.__list;\n }\n\n get size() {\n return this.__list.length;\n }\n\n get x() {\n return this.__x;\n }\n\n get y() {\n return this.__y;\n }\n\n get endY() {\n return this.y + this.height;\n }\n\n get width() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let first = list[0];\n let last = list[length - 1];\n let x1 = first.x;\n let dom = first instanceof TextBox ? first.parent.domParent : first.domParent;\n // 因为inline可以嵌套inline,所以一直向上查找到非inline为止,每层inline如果是首个则减去左侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_LEFT]: marginLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [PADDING_LEFT]: paddingLeft,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[0]) {\n x1 -= marginLeft + borderLeftWidth + paddingLeft;\n }\n dom = dom.domParent;\n }\n let x2 = last.x + last.outerWidth;\n dom = last instanceof TextBox ? last.parent.domParent : last.domParent;\n // 同向上查非inline,每层inline如果是最后一个则加上右侧mbp\n while(true) {\n let list = dom.contentBoxList;\n let {\n [DISPLAY]: display,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_RIGHT]: paddingRight,\n } = dom.computedStyle;\n if(display !== 'inline') {\n break;\n }\n if(first === list[list.length - 1]) {\n x2 += marginRight + borderRightWidth + paddingRight;\n }\n dom = dom.domParent;\n }\n return x2 - x1;\n }\n return 0;\n }\n\n get height() {\n return this.lineHeight;\n }\n\n get baseLine() {\n let baseLine = 0;\n this.list.forEach(item => {\n baseLine = Math.max(baseLine, item.baseLine);\n });\n return Math.max(this.__baseLine, baseLine);\n }\n\n get lineHeight() {\n let lineHeight = 0;\n // 只有TextBox和InlineBlock\n this.list.forEach(item => {\n lineHeight = Math.max(lineHeight, item.outerHeight);\n });\n return Math.max(this.__lineHeight, lineHeight);\n }\n}\n\nexport default LineBox;\n","import LineBox from './LineBox';\n\n/**\n * 维护一个上下文的LineBox,向LineBox中添加Item以及新增下一行的LineBox,多个LineBox组成一个区域\n * 一个block/inlineBlock拥有一个本类对象,上下文即对应这个dom流,而inline则复用最近非inline父元素的\n * 同时LineBox可能连续也可能不连续,不连续的是中间有block之类的隔离开来\n */\nclass LineBoxManager {\n constructor(x, y, lineHeight, baseLine) {\n this.__x = this.__lastX = x; // last存储目前最后一行LineBox的结尾位置,供后续inline使用\n this.__y = this.__lastY = y;\n this.__maxX = x;\n this.__domList = [];\n this.__domStack = [];\n this.__list = []; // 包含若干LineBox\n this.__isNewLine = true; // 区域内是否是新行,容器dom(block)开头肯定是\n this.__lineHeight = lineHeight;\n this.__baseLine = baseLine;\n this.__isEnd = true; // 在dom中是否一个区域处在结尾,外部控制\n }\n\n /**\n * 每次换行时重新生成LineBox存入列表,同时由于flow流当前一定是流(dom)的结尾,设置isEnd\n * @returns {LineBox}\n */\n genLineBox(x, y) {\n let lineBox = new LineBox(x, y, this.__lineHeight, this.__baseLine);\n this.list.push(lineBox);\n this.__isEnd = true;\n return lineBox;\n }\n\n /**\n * inline的特殊调用,防止空内容但有mbp的inline不占位,放入一个有lineHeight的空lineBox\n * 只有新行开头时需要,后面的无论是否有内容都会影响lineHeight\n * @param x\n * @param y\n * @param l\n * @param b\n * @returns {LineBox}\n */\n genLineBoxByInlineIfNewLine(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseLine = Math.max(this.__baseLine, b);\n if(this.__isNewLine) {\n let lineBox = new LineBox(x, y, lineHeight, baseLine);\n this.list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n }\n\n setLbOrGenLineBoxByInline(x, y, l, b) {\n let lineHeight = Math.max(this.__lineHeight, l);\n let baseLine = Math.max(this.__baseLine, b);\n let lineBox;\n let list = this.list;\n if(this.__isNewLine) {\n lineBox = new LineBox(x, y, lineHeight, baseLine);\n list.push(lineBox);\n this.__isEnd = true;\n this.__isNewLine = false;\n return lineBox;\n }\n else {\n let length = list.length;\n lineBox = list[length - 1];\n lineBox.__setLB(l, b);\n }\n }\n\n /**\n * 外部设置为结尾,如一个LineBox后出现一个block,此时会被隔断,不再作为流的末尾\n */\n setNotEnd() {\n this.__isEnd = false;\n }\n\n /**\n * 外部设置新行,下次新生成LineBox\n */\n setNewLine() {\n this.__isNewLine = true;\n }\n\n /**\n * 当前LineBox放入一个新项,当新行时(如第一行)产生一个新的LineBox并存入列表\n * 是否新区域和新行都是可以被外部控制,默认第一行是新\n * 当被隔断后会被外部重置新行,这样会生成新的来作为新加项的LineBox\n * 当换行时外部也会调用新行,这样再次添加Item时会自动生成新的LineBox而不是用之前的\n * @param o TextBox/Inline/InlineBlock\n * @param nextNewLine 是否设置newLine,标明下次添加新生成LineBox\n * @returns {LineBox}\n */\n addItem(o, nextNewLine) {\n let lineBox;\n if(this.__isNewLine) {\n this.__isNewLine = false;\n lineBox = this.genLineBox(o.x, o.y);\n }\n else {\n let list = this.list;\n let length = list.length;\n lineBox = list[length - 1];\n }\n // inline递归过程中所有inline父子顺序列表,每个dom都需要对当前内容保存\n this.__domStack.forEach(item => {\n item.__contentBoxList.push(o);\n });\n lineBox.add(o);\n // 设置结束x的位置给next的inline标记用,o可能是TextBox或inlineBlock,当next新行时注意位置\n if(nextNewLine) {\n this.__isNewLine = true;\n this.__lastX = o.x;\n this.__lastY = o.y + o.outerHeight;\n }\n else {\n this.__lastX = o.x + o.outerWidth;\n this.__lastY = o.y;\n }\n this.__maxX = Math.max(this.__maxX, o.x + o.outerWidth);\n return lineBox;\n }\n\n horizonAlign(w, textAlign) {\n this.list.forEach(lineBox => {\n let diff = w - lineBox.width;\n if(diff > 0) {\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n lineBox.__offsetX(diff);\n lineBox.list.forEach(item => {\n item.__offsetX(diff, true);\n });\n }\n });\n }\n\n verticalAlign() {\n this.list.forEach(lineBox => {\n lineBox.verticalAlign();\n });\n }\n\n addX(n) {\n this.__lastX += n;\n }\n\n /**\n * inline递归过程中布局调用,不断出入栈dom对象,获取当前行状态下有哪些dom还在\n * @param dom\n */\n pushContentBoxList(dom) {\n this.__domList.push(dom);\n this.__domStack.push(dom);\n }\n\n popContentBoxList() {\n this.__domStack.pop();\n }\n\n __offsetX(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetX(diff);\n });\n }\n\n __offsetY(diff) {\n this.list.forEach(lineBox => {\n lineBox.__offsetY(diff);\n });\n }\n\n /**\n * inline的特殊调用,非行首无论是否有内容都设置lineBox的lineHeight\n * @param l\n * @param b\n * @private\n */\n setLbByInlineIfNotNewLine(l, b) {\n let length = this.list.length;\n if(length && !this.isNewLine) {\n this.list[length - 1].__setLB(l, b);\n }\n }\n\n get size() {\n return this.list.length;\n }\n\n get lastX() {\n return this.__lastX;\n }\n\n get lastY() {\n return this.__lastY;\n }\n\n get endY() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[length - 1].endY;\n }\n return this.__y;\n }\n\n get isEnd() {\n return this.__isEnd;\n }\n\n get isNewLine() {\n return this.__isNewLine;\n }\n\n get breakLine() {\n return this.list.length > 1;\n }\n\n get domList() {\n return this.__domList;\n }\n\n get baseLine() {\n let list = this.list;\n let length = list.length;\n if(length) {\n let n = 0;\n for(let i = 0; i < length - 1; i++) {\n n += list[i].height;\n }\n return n + list[length - 1].baseLine;\n }\n return 0;\n }\n\n get firstBaseLine() {\n let list = this.list;\n let length = list.length;\n if(length) {\n return list[0].baseLine;\n }\n return 0;\n }\n\n get lineHeight() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1].lineHeight;\n }\n return 0;\n }\n\n get lineBox() {\n let list = this.list;\n if(list.length) {\n return list[list.length - 1];\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get width() {\n let w = 0;\n this.list.forEach(item => {\n w = Math.max(w, item.width);\n });\n return w;\n }\n}\n\nexport default LineBoxManager;\n","const TAG_NAME = {\n 'div': true,\n 'p': true,\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst INLINE = {\n 'span': true,\n 'img': true,\n 'b': true,\n 'strong': true,\n};\n\nconst BOLD = {\n 'b': true,\n 'strong': true,\n}\n\nexport default {\n TAG_NAME,\n INLINE,\n BOLD,\n};\n","import enums from '../util/enums';\nimport unit from '../style/unit';\nimport level from './level';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n TOP,\n BOTTOM,\n POSITION,\n HEIGHT,\n },\n} = enums;\nconst { AUTO, PX, PERCENT } = unit;\nconst { REFLOW } = level;\n\nfunction offsetAndResizeByNodeOnY(node, root, reflowHash, dy, inDirectAbsList) {\n if(dy) {\n let last;\n do {\n // component的sr没有next兄弟,视为component的next\n while(node.isShadowRoot) {\n node = node.host;\n }\n last = node;\n let isContainer, parent = node.domParent;\n if(parent) {\n let cs = parent.computedStyle;\n let ps = cs[POSITION];\n isContainer = parent === root || parent.isShadowRoot || ps === 'relative' || ps === 'absolute';\n }\n // 先偏移next,忽略有定位的absolute,本身非container也忽略\n let next = node.next;\n let container;\n while(next) {\n if(next.currentStyle[DISPLAY] !== 'none') {\n if(next.currentStyle[POSITION] === 'absolute') {\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = next.currentStyle;\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO || bottom[1] === PX) {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n }\n else if(top[1] === PERCENT) {\n let v = top[0] * 0.01 * dy;\n next.__offsetY(v, true, REFLOW);\n next.clearCache();\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, null, next);\n }\n else {\n if(!container) {\n container = parent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, next]);\n }\n }\n }\n else {\n next.__offsetY(dy, true, REFLOW);\n next.clearCache();\n }\n }\n next = next.next;\n }\n // root本身没domParent\n if(!parent) {\n break;\n }\n node = parent;\n // parent判断是否要resize\n let { currentStyle } = node;\n let isAbs = currentStyle[POSITION] === 'absolute';\n let need;\n if(isAbs) {\n if(currentStyle[HEIGHT][1] === AUTO\n && (currentStyle[TOP][1] === AUTO || currentStyle[BOTTOM][1] === AUTO)) {\n need = true;\n }\n }\n // height不定则需要\n else if(currentStyle[HEIGHT][1] === AUTO) {\n need = true;\n }\n if(need) {\n node.__resizeY(dy, REFLOW);\n node.clearCache();\n }\n // abs或者高度不需要继续向上调整提前跳出\n else {\n break;\n }\n if(node === root) {\n break;\n }\n }\n while(true);\n // 最后一个递归向上取消总缓存,防止过程中重复next多次无用递归\n while(last) {\n last.clearCache(true);\n last = last.domParent;\n }\n }\n}\n\nfunction clearUniqueReflowId(hash) {\n for(let i in hash) {\n if(hash.hasOwnProperty(i)) {\n let { node } = hash[i];\n delete node.__uniqueReflowId;\n }\n }\n}\n\nfunction getMergeMarginTB(topList, bottomList) {\n let total = 0;\n let max = topList[0];\n let min = topList[0];\n topList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n bottomList.forEach(item => {\n total += item;\n max = Math.max(max, item);\n min = Math.min(min, item);\n });\n // 正数取最大,负数取最小,正负则相加\n let diff = 0;\n if(max > 0 && min > 0) {\n diff = Math.max(max, min) - total;\n }\n else if(max < 0 && min < 0) {\n diff = Math.min(max, min) - total;\n }\n else if(max !== 0 || min !== 0) {\n diff = max + min - total;\n }\n return diff;\n}\n\nexport default {\n offsetAndResizeByNodeOnY,\n clearUniqueReflowId,\n getMergeMarginTB,\n};\n","import Xom from './Xom';\nimport Text from './Text';\nimport mode from './mode';\nimport LineBoxManager from './LineBoxManager';\nimport Component from './Component';\nimport tag from './tag';\nimport reset from '../style/reset';\nimport css from '../style/css';\nimport unit from '../style/unit';\nimport $$type from '../util/$$type';\nimport enums from '../util/enums';\nimport util from '../util/util';\nimport inject from '../util/inject';\nimport reflow from '../refresh/reflow';\nimport builder from '../util/builder';\nimport level from '../refresh/level';\n\nconst {\n STYLE_KEY: {\n POSITION,\n DISPLAY,\n FONT_WEIGHT,\n MARGIN_LEFT,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n PADDING_LEFT,\n PADDING_BOTTOM,\n PADDING_RIGHT,\n PADDING_TOP,\n BORDER_TOP_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n TOP,\n RIGHT,\n BOTTOM,\n LEFT,\n WIDTH,\n HEIGHT,\n TEXT_ALIGN,\n FLEX_DIRECTION,\n FLEX_BASIS,\n FLEX_SHRINK,\n FLEX_GROW,\n ALIGN_SELF,\n ALIGN_ITEMS,\n JUSTIFY_CONTENT,\n Z_INDEX,\n WHITE_SPACE,\n LINE_HEIGHT,\n LINE_CLAMP,\n ORDER,\n FLEX_WRAP,\n ALIGN_CONTENT,\n OVERFLOW,\n FONT_SIZE,\n // PERSPECTIVE,\n // TRANSFORM,\n },\n NODE_KEY: {\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_STRUCT,\n NODE_DOM_PARENT,\n NODE_IS_INLINE,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_ADD_DOM,\n UPDATE_CONFIG,\n UPDATE_MEASURE,\n },\n STRUCT_KEY: {\n STRUCT_NUM,\n STRUCT_LV,\n STRUCT_TOTAL,\n STRUCT_CHILD_INDEX,\n STRUCT_INDEX,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH, 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 // 只绝对值生效,%不生效,依旧要判断\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 if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n }\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n else if(display === 'block') {\n let countMin = 0, countMax = 0;\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n countMin = countMax = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n }\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n else {\n if(display === 'inlineBlock' || display === 'inline-block') {\n lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n }\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n if(isDirectionRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else if(isDirectionRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n });\n }\n }\n return [display, this.__addMp(isDirectionRow, w, currentStyle, [min, max])];\n }\n\n /**\n * flex布局时,计算basis尺寸,如果有固定声明则以其为标准,content为内容最大尺寸,auto依赖w/h或降级content\n * basis要考虑相加直接item的mpb,非绝对值单位以container为基准,basis为内容时为max值\n * item的孩子为孙子节点需递归,不参与basis计算,只参与min/max,尺寸和mpb均只考虑绝对值\n * 自动计算时影响尺寸的只有换行的text,以及一组inline,均按其中最大尺寸的一个计算\n * auto自动计算递归进行,如果是普通row方向,按最大text的charWidth为准\n * 如果是column方向,则虚拟布局后看text的height\n * 在abs下时进入特殊状态,无论是row/column,都会按row方向尝试最大尺寸,直到舞台边缘或容器声明的w折行\n * 返回b,声明则按css值,否则是auto/content\n * 返回min为最小宽度,遇到字符/inline则单列排版后需要的最大宽度\n * 返回max为最大宽度,理想情况一排最大值,在abs时isVirtual状态参与计算,文本抵达边界才进行换行\n * @param isDirectionRow\n * @param data\n * @param isVirtual abs非固定尺寸时先进行虚拟布局标识\n * @private\n */\n __calBasis(isDirectionRow, data, isVirtual) {\n css.computeReflow(this, this.isShadowRoot);\n let b = 0;\n let min = 0;\n let max = 0;\n let { flowChildren, currentStyle, computedStyle } = this;\n let { x, y, w, h } = data;\n // 计算需考虑style的属性\n let {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [WIDTH]: width,\n [HEIGHT]: height,\n [FLEX_BASIS]: flexBasis,\n } = currentStyle;\n let {\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content\n let isAuto = flexBasis[1] === AUTO;\n let isFixed = [PX, PERCENT, REM, VW, VH, 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 // flex的item还是flex时\n if(display === 'flex') {\n let isRow = flexDirection !== 'column';\n flowChildren = genOrderChildren(flowChildren);\n flowChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let [, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h });\n if(isDirectionRow) {\n if(isRow) {\n min += min2;\n max += max2;\n }\n else {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n }\n else {\n if(isRow) {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n }\n else {\n min += min2;\n max += max2;\n }\n }\n }\n else if(isDirectionRow) {\n if(isRow) {\n min += item.charWidth;\n max += item.textWidth;\n }\n else {\n min = Math.max(min, item.charWidth);\n max = Math.max(max, item.textWidth);\n }\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n if(isRow) {\n min = Math.max(min, item.height);\n max = Math.max(max, item.height);\n }\n else {\n min += item.height;\n max += item.height;\n }\n }\n });\n }\n // flex的item是block/inline时,inline也会变成block统一对待\n else {\n let countMin = 0, countMax = 0;\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let [display, [min2, max2]] = item.__calMinMax(isDirectionRow, { x, y, w, h, lineBoxManager });\n // 块级查看之前是否有行内元素,设置换行\n if((display === 'block' || display === 'flex') && lineBoxManager.isEnd) {\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n if(isDirectionRow) {\n if(display === 'block' || display === 'flex') {\n min = Math.max(min, min2);\n max = Math.max(max, max2);\n countMin = countMax = 0;\n }\n else {\n countMin += min2;\n countMax += max2;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n }\n else {\n if(display === 'block' || display === 'flex') {\n // 之前行积累的极值,并清空\n min += countMin;\n max += countMax;\n countMin = countMax = 0;\n // 本身的\n min += min2;\n max += max2;\n }\n else {\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, min2);\n countMax = Math.max(countMax, max2);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n }\n }\n else if(isDirectionRow) {\n countMin += item.charWidth;\n countMax += item.textWidth;\n min = Math.max(min, countMin);\n max = Math.max(max, countMax);\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n });\n // 行内取极值,最后一个记得应用\n countMin = Math.max(countMin, item.height);\n countMax = Math.max(countMax, item.height);\n if(i === length - 1) {\n min += countMin;\n max += countMax;\n }\n }\n });\n }\n if(fixedSize) {\n max = Math.max(fixedSize, max);\n }\n if(isContent) {\n b = max;\n }\n // 直接item的mpb影响basis\n return this.__addMp(isDirectionRow, w, currentStyle, [b, min, max], true);\n }\n\n __layoutNone() {\n super.__layoutNone();\n let { children } = this;\n children.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n item.__layoutNone();\n }\n });\n }\n\n /**\n * block布局,本身固定尺寸优先,否则看内容从上往下从左往右flow流排布\n * 内部inline和inlineBlock组成LineBox,通过LineBoxManager来管理混排的现象\n * LineBoxManager只有block和inlineBlock内部生成,inline会复用最近父级的\n * 内部的block在垂直方向要考虑margin合并的问题,强制所有节点为bfc,精简逻辑\n * @param data\n * @param isVirtual abs无尺寸时提前虚拟布局计算尺寸\n * @private\n */\n __layoutBlock(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n // 虚线管理一个block内部的LineBox列表,使得inline的元素可以中途衔接处理折行\n // 内部维护inline结束的各种坐标来达到目的,遇到block时中断并处理换行坐标\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n // 因精度问题,统计宽度均从0开始累加每行,最后取最大值,仅在abs布局时isVirtual生效\n let maxW = 0;\n let cw = 0;\n // 连续block(flex相同,下面都是)的上下margin合并值记录,合并时从列表中取\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isImg = item.tagName === 'img';\n // 每次循环开始前,这次不是block的话,看之前遗留待合并margin,并重置\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n if(isXom) {\n // inline和inlineBlock的细节不同之处,ib除了w/h之外,更想像block一样占据一行\n // 比如2个inline前面占一半后面比一半多但还是会从一半开始然后第2行换行继续,但ib放不下则重开一行\n // inline和ib能互相嵌套,形成的LineBox中则是TextBox和节点混合\n if(isInlineBlock || isInline) {\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || isInline && whiteSpace === 'nowrap') {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager, // ib内部新生成会内部判断,这里不管统一传入\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样\n if(item.__isIbFull) {\n x = data.x;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // abs统计宽度\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下,内部判断了inline/ib,ib要考虑是否有width\n let fw = item.__tryLayInline(w + data.x - x, w);\n // 放得下继续,奇怪的精度问题,加上阈值\n if(fw >= (-1e-10)) {\n item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n x = data.x;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock || isImg) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = 0;\n }\n }\n if(isVirtual) {\n cw += item.outerWidth;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n // block/flex先处理之前可能遗留的最后一行LineBox,然后递归时不传lineBoxManager,其内部生成新的\n else {\n // 非开头,说明之前的text未换行,需要增加行数\n if(x !== data.x && flowChildren[i - 1] instanceof Text) {\n lineClampCount++;\n }\n x = data.x;\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n lineBoxManager.setNotEnd();\n lineBoxManager.setNewLine();\n }\n item.__layout({\n x,\n y,\n w,\n h,\n }, isVirtual);\n let isNone = item.currentStyle[DISPLAY] === 'none';\n // 自身无内容\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n y += item.outerHeight;\n lineBoxManager.__lastY = y;\n // absolute/flex前置虚拟计算\n if(isVirtual) {\n maxW = Math.max(maxW, item.outerWidth);\n cw = 0;\n }\n // 空block要留下轮循环看,除非是最后一个,此处非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n item.__offsetY(diff, true);\n y += diff;\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n y += diff;\n }\n }\n }\n }\n // 文字和inline类似\n else {\n // lineClamp作用域为block下的inline(同LineBox上下文)\n if(lineClamp && lineClampCount >= lineClamp) {\n return;\n }\n // x开头,不用考虑是否放得下直接放\n if(x === data.x || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, cw);\n cw = item.width;\n maxW = Math.max(maxW, cw);\n }\n }\n else {\n // 非开头先尝试是否放得下\n let fw = item.__tryLayInline(w - x + data.x);\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = data.x;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx: data.x,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n if(isVirtual) {\n maxW = Math.max(maxW, item.width);\n cw = 0;\n }\n }\n if(isVirtual) {\n cw += item.width;\n maxW = Math.max(maxW, cw);\n }\n }\n }\n });\n // 结束后如果是以LineBox结尾,则需要设置y到这里,否则流布局中block会设置\n // 当以block换行时,新行是true,否则是false即结尾\n if(lineBoxManager.isEnd) {\n y = lineBoxManager.endY;\n }\n let tw = this.__width = (fixedWidth || !isVirtual) ? w : maxW;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // 非abs提前的虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐\n if(!isVirtual) {\n lineBoxManager.verticalAlign();\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // 所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n this.__marginAuto(currentStyle, data);\n }\n }\n\n // 弹性布局时的计算位置\n __layoutFlex(data, isVirtual) {\n let { flowChildren, currentStyle, computedStyle, __flexLine } = this;\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n // 每次布局情况多行内容\n __flexLine.splice(0);\n let {\n [FLEX_DIRECTION]: flexDirection,\n [JUSTIFY_CONTENT]: justifyContent,\n [ALIGN_ITEMS]: alignItems,\n [LINE_CLAMP]: lineClamp,\n [FLEX_WRAP]: flexWrap,\n [ALIGN_CONTENT]: alignContent,\n [LINE_HEIGHT]: lineHeight,\n [TEXT_ALIGN]: textAlign,\n } = computedStyle;\n // 只有>=1的正整数才有效\n lineClamp = lineClamp || 0;\n let lineClampCount = 0;\n let maxX = 0;\n let isDirectionRow = ['column', 'column-reverse', 'columnReverse'].indexOf(flexDirection) === -1;\n // 计算伸缩基数\n let growList = [];\n let shrinkList = [];\n let basisList = [];\n let maxList = [];\n let minList = [];\n let orderChildren = genOrderChildren(flowChildren);\n orderChildren.forEach(item => {\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n let { currentStyle, computedStyle } = item;\n // flex的child如果是inline,变为block,在计算autoBasis前就要\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n // abs虚拟布局计算时纵向也是看横向宽度\n let [b, min, max] = item.__calBasis(isVirtual ? true : isDirectionRow, { x, y, w, h }, isVirtual);\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += max;\n }\n else {\n maxX = Math.max(maxX, max);\n }\n return;\n }\n let { [FLEX_GROW]: flexGrow, [FLEX_SHRINK]: flexShrink } = currentStyle;\n computedStyle[FLEX_BASIS] = b;\n growList.push(flexGrow);\n shrinkList.push(flexShrink);\n // 根据basis不同,计算方式不同\n basisList.push(b);\n maxList.push(max);\n minList.push(min);\n }\n // 文本\n else {\n if(isVirtual) {\n if(isDirectionRow) {\n maxX += item.textWidth;\n }\n else {\n maxX = Math.max(maxX, item.textWidth);\n }\n return;\n }\n growList.push(0);\n shrinkList.push(1);\n if(isDirectionRow) {\n let cw = item.charWidth;\n let tw = item.textWidth;\n basisList.push(tw);\n maxList.push(tw);\n minList.push(cw);\n }\n else {\n let lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n item.__layout({\n x,\n y,\n w,\n h,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n });\n let h = item.height;\n basisList.push(h);\n minList.push(h);\n }\n }\n });\n // abs时,只需关注宽度即可,无需真正布局\n if(isVirtual) {\n let tw = this.__width = Math.min(maxX, w);\n this.__ioSize(tw, this.height);\n return;\n }\n let containerSize = isDirectionRow ? w : h;\n let isMultiLine = flexWrap === 'wrap' || ['wrap-reverse', 'wrapReverse'].indexOf(flexWrap) > -1;\n /**\n * 判断是否需要分行,根据假设主尺寸来统计尺寸和计算,假设主尺寸是clamp(min_main_size, flex_base_size, max_main_size)\n * 当多行时,由于每行一定有最小限制,所以每行一般情况都不是shrink状态,\n * 但也有极端情况,比如一行只能放下1个元素时,且此元素比容器小,会是shrink\n */\n let line = [], sum = 0, hypotheticalList = [];\n basisList.forEach((item, i) => {\n let min = minList[i], max = maxList[i];\n let hypothetical;\n if(item < min) {\n hypothetical = min;\n }\n else if(item > max) {\n hypothetical = max;\n }\n else {\n hypothetical = item;\n }\n hypotheticalList.push(hypothetical);\n if(isMultiLine) {\n // 超过尺寸时,要防止sum为0即1个也会超过尺寸\n if(sum + hypothetical > containerSize) {\n if(sum) {\n __flexLine.push(line);\n line = [orderChildren[i]];\n sum = hypothetical;\n }\n else {\n line.push(orderChildren[i]);\n __flexLine.push(line);\n line = [];\n sum = 0;\n }\n }\n else {\n line.push(orderChildren[i]);\n sum += hypothetical;\n }\n }\n else {\n line.push(orderChildren[i]);\n }\n });\n if(line.length) {\n __flexLine.push(line);\n }\n let offset = 0, clone = { x, y, w, h };\n let maxCrossList = [];\n __flexLine.forEach(item => {\n let length = item.length;\n let end = offset + length;\n let [x1, y1, maxCross] = this.__layoutFlexLine(clone, isDirectionRow, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, orderChildren.slice(offset, end), item, textAlign,\n growList.slice(offset, end), shrinkList.slice(offset, end), basisList.slice(offset, end),\n hypotheticalList.slice(offset, end), minList.slice(offset, end));\n // 下一行/列更新坐标\n if(isDirectionRow) {\n clone.y = y1;\n }\n else {\n clone.x = x1;\n }\n x = Math.max(x, x1);\n y = Math.max(y, y1);\n maxCrossList.push(maxCross);\n offset += length;\n });\n let tw = this.__width = w;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n // flexDirection当有reverse时交换每line的主轴序\n if(flexDirection === 'row-reverse' || flexDirection === 'rowReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = tw - item.outerWidth - (item.x - data.x) * 2;\n if(diff) {\n item.__offsetX(diff, true);\n }\n });\n });\n }\n else if(flexDirection === 'column-reverse' || flexDirection === 'columnReverse') {\n __flexLine.forEach(line => {\n line.forEach(item => {\n // 一个矩形内的子矩形进行镜像移动,用外w减去内w再减去开头空白的2倍即可\n let diff = th - item.outerHeight - (item.y - data.y) * 2;\n if(diff) {\n item.__offsetY(diff, true);\n }\n });\n });\n }\n // wrap-reverse且多轴线时交换轴线序,需要2行及以上才行\n let length = __flexLine.length;\n if(['wrapReverse', 'wrap-reverse'].indexOf(flexWrap) > -1 && length > 1) {\n let crossSum = 0, crossSumList = [];\n maxCrossList.forEach(item => {\n crossSumList.push(crossSum);\n crossSum += item;\n });\n let count = 0;\n for(let i = length - 1; i >= 0; i--) {\n let line = __flexLine[i];\n let source = crossSumList[i];\n let diff = count - source;\n if(diff) {\n line.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n count += maxCrossList[i];\n }\n __flexLine.reverse();\n }\n // 侧轴对齐分flexLine做,要考虑整体的alignContent的stretch和每行的alignItems的stretch\n // 先做整体的,得出交叉轴空白再均分给每一行做单行的,整体的只有1行忽略\n let per;\n if(!isVirtual && length > 1 && (fixedHeight && isDirectionRow || !isDirectionRow)) {\n let diff = isDirectionRow ? th - (y - data.y) : tw - (x - data.x);\n // 有空余时才进行对齐\n if(diff > 0) {\n if(alignContent === 'center') {\n let per = diff * 0.5;\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per, true);\n }\n else {\n item.__offsetX(per, true);\n }\n });\n }\n else if(alignContent === 'flex-start' || alignContent === 'flexStart') {}\n else if(alignContent === 'flex-end' || alignContent === 'flexEnd') {\n orderChildren.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(diff, true);\n }\n else {\n item.__offsetX(diff, true);\n }\n });\n }\n else if(alignContent === 'space-between' || alignContent === 'spaceBetween') {\n let between = diff / (length - 1);\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(between, true);\n }\n else {\n item.__offsetX(between, true);\n }\n });\n }\n });\n }\n else if(alignContent === 'space-around' || alignContent === 'spaceAround') {\n let around = diff / (length + 1);\n __flexLine.forEach((item, i) => {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(around * (i + 1), true);\n }\n else {\n item.__offsetX(around * (i + 1), true);\n }\n });\n });\n }\n // 默认stretch\n else {\n per = diff / length;\n // 除了第1行其它进行偏移\n __flexLine.forEach((item, i) => {\n if(i) {\n item.forEach(item => {\n if(isDirectionRow) {\n item.__offsetY(per * i, true);\n }\n else {\n item.__offsetX(per * i, true);\n }\n });\n }\n });\n }\n }\n }\n // 每行再进行cross对齐,在alignContent为stretch时计算每行的高度\n if(!isVirtual) {\n if(length > 1) {\n __flexLine.forEach((item, i) => {\n let maxCross = maxCrossList[i];\n if(per) {\n maxCross += per;\n }\n this.__crossAlign(item, alignItems, isDirectionRow, maxCross);\n });\n }\n else if(length) {\n let maxCross = maxCrossList[0];\n if(isDirectionRow) {\n if(fixedHeight) {\n maxCross = h;\n }\n }\n else {\n maxCross = w;\n }\n this.__crossAlign(__flexLine[0], alignItems, isDirectionRow, maxCross);\n }\n }\n this.__marginAuto(currentStyle, data);\n }\n\n /**\n * 计算获取子元素的b/min/max完毕后,尝试进行flex每行布局\n * https://www.w3.org/TR/css-flexbox-1/#layout-algorithm\n * 假想主尺寸,其为clamp(min_main_size, flex_base_size, max_main_size)\n * 随后按算法一步步来 https://zhuanlan.zhihu.com/p/354567655\n * 规范没提到mpb,item的要计算,孙子的只考虑绝对值\n * 先收集basis和假设主尺寸\n */\n __layoutFlexLine(data, isDirectionRow, containerSize,\n fixedWidth, fixedHeight, lineClamp, lineClampCount,\n lineHeight, computedStyle, justifyContent, alignItems, orderChildren, flexLine, textAlign,\n growList, shrinkList, basisList, hypotheticalList, minList) {\n let { x, y, w, h } = data;\n let hypotheticalSum = 0;\n hypotheticalList.forEach(item => {\n hypotheticalSum += item;\n });\n // 根据假设尺寸确定使用grow还是shrink,冻结非弹性项并设置target尺寸,确定剩余未冻结数量\n let isOverflow = hypotheticalSum >= containerSize;\n let targetMainList = [];\n basisList.forEach((item, i) => {\n if(isOverflow) {\n if(!shrinkList[i] || (basisList[i] < hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n else {\n if(!growList[i] || (basisList[i] > hypotheticalList[i])) {\n targetMainList[i] = hypotheticalList[i];\n }\n }\n });\n // 初始可用空间,冻结使用确定的target尺寸,未冻结使用假想\n let free = 0;\n basisList.forEach((item, i) => {\n if(targetMainList[i] !== undefined) {\n free += targetMainList[i];\n }\n else {\n free += item;\n }\n });\n let total = Infinity;\n if(isDirectionRow) {\n total = w;\n }\n else if(fixedHeight) {\n total = h;\n }\n else {\n total = free;\n }\n free = Math.abs(total - free);\n // 循环,文档算法不够简练,其合并了grow和shrink,实际拆开写更简单\n let factorSum = 0;\n if(isOverflow) {\n // 计算真正的因子占比,同时得出缩小尺寸数值\n // 还需判断每个item收缩不能 {\n if(targetMainList[i] === undefined) {\n let n = item * basisList[i];\n factorSum += n;\n return n;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要收缩的尺寸\n let n = basisList[i] - s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n else {\n let factorList = growList.map((item, i) => {\n if(targetMainList[i] === undefined) {\n factorSum += item;\n return item;\n }\n });\n while(true) {\n if(factorSum < 1) {\n free *= factorSum;\n }\n let needReset, factorSum2 = 0;\n factorList.forEach((item, i) => {\n if(item) {\n let r = item / factorSum;\n let s = r * free; // 需要扩展的尺寸\n let n = basisList[i] + s; // 实际尺寸\n // 比min还小设置为min,同时设0剔除\n if(n < minList[i]) {\n targetMainList[i] = minList[i];\n factorList[i] = 0;\n needReset = true;\n free -= basisList[i] - minList[i]; // 超出的尺寸也要减去实际收缩的尺寸\n }\n // 先按照没有超限的设置,正常情况直接跳出,如果有超限,记录sum2给下轮赋值重新计算\n else {\n targetMainList[i] = n;\n factorSum2 += item;\n }\n }\n });\n if(!needReset) {\n break;\n }\n factorSum = factorSum2;\n }\n }\n let maxCross = 0;\n let lbmList = [];\n orderChildren.forEach((item, i) => {\n let main = targetMainList[i];\n if(item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom) {\n if(isDirectionRow) {\n item.__layout({\n x,\n y,\n w: main,\n h,\n w3: main, // w3假设固定宽度,忽略原始style中的设置\n });\n }\n else {\n item.__layout({\n x,\n y,\n w,\n h: main,\n h3: main, // 同w2\n });\n }\n }\n else {\n let lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n lbmList.push(lineBoxManager);\n item.__layout({\n x,\n y,\n w: isDirectionRow ? main : w,\n h: isDirectionRow ? h : main,\n lineBoxManager,\n lineClamp,\n lineClampCount,\n });\n }\n if(isDirectionRow) {\n x += item.outerWidth;\n maxCross = Math.max(maxCross, item.outerHeight);\n }\n else {\n y += item.outerHeight;\n maxCross = Math.max(maxCross, item.outerWidth);\n }\n });\n // 计算主轴剩余时要用真实剩余空间而不能用伸缩剩余空间\n let diff = isDirectionRow ? (w - x + data.x) : (h - y + data.y);\n // 主轴对齐方式\n if(diff > 0) {\n let len = orderChildren.length;\n if(justifyContent === 'flexEnd' || justifyContent === 'flex-end') {\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(diff, true) : child.__offsetY(diff, true);\n }\n }\n else if(justifyContent === 'center') {\n let center = diff * 0.5;\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(center, true) : child.__offsetY(center, true);\n }\n }\n else if(justifyContent === 'spaceBetween' || justifyContent === 'space-between') {\n let between = diff / (len - 1);\n for(let i = 1; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(between * i, true) : child.__offsetY(between * i, true);\n }\n }\n else if(justifyContent === 'spaceAround' || justifyContent === 'space-around') {\n let around = diff / (len + 1);\n for(let i = 0; i < len; i++) {\n let child = orderChildren[i];\n isDirectionRow ? child.__offsetX(around * (i + 1), true) : child.__offsetY(around * (i + 1), true);\n }\n }\n }\n if(isDirectionRow) {\n y += maxCross;\n }\n else {\n x += maxCross;\n }\n // flex的直接text对齐比较特殊\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lbmList.forEach(item => {\n item.horizonAlign(item.width, textAlign);\n })\n }\n return [x, y, maxCross];\n }\n\n // 每个flexLine的侧轴对齐,单行时就是一行对齐\n __crossAlign(line, alignItems, isDirectionRow, maxCross) {\n let baseLine = 0;\n line.forEach(item => {\n baseLine = Math.max(baseLine, item.firstBaseLine);\n });\n line.forEach(item => {\n let { currentStyle: { [ALIGN_SELF]: alignSelf } } = item;\n if(isDirectionRow) {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [HEIGHT]: height } } = item;\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = item.__height = computedStyle[HEIGHT] = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n else if(alignSelf === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerHeight;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetY(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection,\n [HEIGHT]: height,\n } } = item;\n // row的孩子还是flex且column且不定高时,如果高度<侧轴拉伸高度则重新布局\n if(isDirectionRow && display === 'flex' && flexDirection === 'column' && height[1] === AUTO && item.outerHeight < maxCross) {\n item.__layout(Object.assign(item.__layoutData, { h3: maxCross }));\n }\n let {\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n } = computedStyle;\n if(height[1] === AUTO) {\n let old = item.height;\n let v = maxCross - marginTop - marginBottom - paddingTop - paddingBottom - borderTopWidth - borderBottomWidth;\n let d = v - old;\n item.__sy4 += d;\n item.__sy5 += d;\n item.__sy6 += d;\n item.__height += d;\n item.__clientHeight += d;\n item.__offsetHeight += d;\n item.__outerHeight += d;\n }\n }\n }\n }\n // column\n else {\n if(alignSelf === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignSelf === 'flexEnd' || alignSelf === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignSelf === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignSelf === 'stretch') {\n let { computedStyle, currentStyle: { [WIDTH]: width } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认auto,取alignItems\n else {\n if(alignItems === 'flexStart' || alignSelf === 'flex-start') {}\n else if(alignItems === 'center') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff * 0.5, true);\n }\n }\n else if(alignItems === 'flexEnd' || alignItems === 'flex-end') {\n let diff = maxCross - item.outerWidth;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n else if(alignItems === 'baseline') {\n let diff = baseLine - item.firstBaseLine;\n if(diff !== 0) {\n item.__offsetX(diff, true);\n }\n }\n // 默认stretch\n else {\n let { computedStyle, currentStyle: {\n [WIDTH]: width,\n } } = item;\n let {\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_LEFT]: paddingLeft,\n } = computedStyle;\n if(width[1] === AUTO) {\n let old = item.width;\n let v = item.__width = computedStyle[WIDTH] = maxCross - marginLeft - marginRight - paddingLeft - paddingRight - borderRightWidth - borderLeftWidth;\n let d = v - old;\n item.__sx4 += d;\n item.__sx5 += d;\n item.__sx6 += d;\n item.__width += d;\n item.__clientWidth += d;\n item.__offsetWidth += d;\n item.__outerWidth += d;\n }\n }\n }\n }\n });\n }\n\n /**\n * inline比较特殊,先简单顶部对其,后续还需根据vertical和lineHeight计算y偏移\n * inlineBlock复用逻辑,可以设置w/h,在混排时表现不同,inlineBlock换行限制在规定的矩形内,\n * 且ib会在没设置width且换行的时候撑满上一行,即便内部尺寸没抵达边界\n * 而inline换行则会从父容器start处开始,且首尾可能占用矩形不同\n * 嵌套inline情况十分复杂,尾部mpb空白可能产生叠加情况,因此endSpace表示自身,\n * 然后根据是否在最后一个元素进行叠加父元素的,多层嵌套则多层尾部叠加,均以最后一个元素为依据判断\n * Text获取这个叠加的endSpace值即可,无需感知是否最后一个,外层(此处)进行逻辑封装\n * @param data\n * @param isVirtual\n * @param isInline\n * @private\n */\n __layoutInline(data, isVirtual, isInline) {\n let { flowChildren, currentStyle, computedStyle } = this;\n let { fixedWidth, fixedHeight, x, y, w, h, lx,\n lineBoxManager, nowrap, endSpace, selfEndSpace } = this.__preLayout(data, isInline);\n // abs虚拟布局需预知width,固定可提前返回\n if(fixedWidth && isVirtual) {\n this.__width = w;\n this.__ioSize(w, this.height);\n return;\n }\n let {\n [WIDTH]: width,\n } = currentStyle;\n let {\n [TEXT_ALIGN]: textAlign,\n [WHITE_SPACE]: whiteSpace,\n [LINE_CLAMP]: lineClamp,\n [LINE_HEIGHT]: lineHeight,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n } = computedStyle;\n let lineClampCount = data.lineClampCount || 0;\n if(isInline && !this.__isRealInline()) {\n isInline = false;\n }\n // 只有inline的孩子需要考虑换行后从行首开始,而ib不需要,因此重置行首标识lx为x,末尾空白为0\n // 而inline的LineBoxManager复用最近非inline父dom的,ib需要重新生成,末尾空白叠加\n if(isInline) {\n this.__config[NODE_IS_INLINE] = true;\n this.__lineBoxManager = lineBoxManager;\n let baseLine = css.getBaseLine(computedStyle);\n // 特殊inline调用,有内容的话(如左右mbp),默认生成一个lineBox,即便是空,也要形成占位,只有开头时需要\n if(marginLeft || marginRight\n || paddingLeft || paddingRight\n || borderLeftWidth || borderRightWidth) {\n if(lineBoxManager.isNewLine) {\n lineBoxManager.genLineBoxByInlineIfNewLine(x, y, lineHeight, baseLine);\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseLine);\n }\n }\n else {\n lineBoxManager.setLbByInlineIfNotNewLine(lineHeight, baseLine);\n }\n lineClamp = data.lineClamp || 0;\n }\n else {\n lineBoxManager = this.__lineBoxManager = new LineBoxManager(x, y, lineHeight, css.getBaseLine(computedStyle));\n lx = x;\n endSpace = selfEndSpace = lineClampCount = 0;\n }\n // 存LineBox里的内容列表专用,布局过程中由lineBoxManager存入,递归情况每个inline节点都保存contentBox\n let contentBoxList;\n if(isInline) {\n contentBoxList = this.__contentBoxList = [];\n lineBoxManager.pushContentBoxList(this);\n }\n let isIbFull = false; // ib时不限定w情况下发生折行则撑满行,即便内容没有撑满边界\n let length = flowChildren.length;\n flowChildren.forEach((item, i) => {\n let isXom = item instanceof Xom || item instanceof Component && item.shadowRoot instanceof Xom;\n let isInline2 = isXom && item.currentStyle[DISPLAY] === 'inline';\n let isInlineBlock2 = isXom && ['inlineBlock', 'inline-block'].indexOf(item.currentStyle[DISPLAY]) > -1;\n let isRealInline = isXom && item.__isRealInline();\n // 最后一个元素会产生最后一行,叠加父元素的尾部mpb\n let isEnd = isInline && (i === length - 1);\n if(isEnd) {\n endSpace += selfEndSpace;\n }\n if(isXom) {\n if(!isInline2 && !isInlineBlock2) {\n item.currentStyle[DISPLAY] = item.computedStyle[DISPLAY] = 'inlineBlock';\n isInlineBlock2 = true;\n inject.warn('Inline can not contain block/flex');\n }\n // x开头,不用考虑是否放得下直接放,i为0强制不换行\n if(x === lx || !i || isInline2 && whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // inlineBlock的特殊之处,一旦w为auto且内部产生折行时,整个变成block独占一块区域,坐标计算和block一样\n if(item.__isIbFull) {\n isInlineBlock2 && (w[1] === AUTO) && (isIbFull = true);\n lineBoxManager.addItem(item);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中,以计算宽度\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n }\n else {\n // 不换行继续排,换行非开头先尝试是否放得下,结尾要考虑mpb因此减去endSpace\n let fw = (whiteSpace === 'nowrap') ? 0 : item.__tryLayInline(w - x + lx, w - (isEnd ? endSpace : 0));\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n nowrap: whiteSpace === 'nowrap',\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // ib放得下要么内部没有折行,要么声明了width限制,都需手动存入当前lb\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n isInline2 && lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n // 重新开头的ib和上面开头处一样逻辑\n if(item.__isIbFull) {\n lineBoxManager.addItem(item);\n x = lx;\n y += item.outerHeight;\n lineBoxManager.setNotEnd();\n }\n // inline和不折行的ib,其中ib需要手动存入当前lb中\n else {\n (isInlineBlock2 || !isRealInline) && lineBoxManager.addItem(item);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n }\n }\n }\n }\n // inline里的其它只有文本,可能开始紧跟着之前的x,也可能换行后从lx行头开始\n // 紧跟着x可能出现在前面有节点换行后第2行,此时不一定放得下,因此不能作为判断依据,开头仅有lx\n else {\n let n = lineBoxManager.size;\n // i为0时强制不换行\n if(x === lx || !i || whiteSpace === 'nowrap') {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行,且非定宽\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n }\n else {\n // 非开头先尝试是否放得下,如果放得下再看是否end,加end且只有1个字时放不下要换行,否则可以放,换行由text内部做\n // 第一个Text且父元素声明了nowrap也强制不换行,非第一个则看本身whiteSpace声明\n let focusNoWrap = (!i && nowrap) || whiteSpace === 'nowrap';\n let fw = focusNoWrap ? 0 : item.__tryLayInline(w + lx - x);\n if(!focusNoWrap && fw >= 0 && isEnd && endSpace && item.content.length === 1) {\n let fw2 = fw - endSpace;\n if(fw2 < 0) {\n fw = fw2;\n }\n }\n // 放得下继续\n if(fw >= (-1e-10)) {\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // 这里ib放得下一定是要么没换行要么固定宽度,所以无需判断isIbFull\n }\n // 放不下处理之前的lineBox,并重新开头\n else {\n lineClampCount++;\n x = lx;\n y = lineBoxManager.endY;\n lineBoxManager.setNewLine();\n lineClampCount = item.__layout({\n x,\n y,\n w,\n h,\n lx,\n lineBoxManager,\n endSpace,\n lineClamp,\n lineClampCount,\n }, isVirtual);\n x = lineBoxManager.lastX;\n y = lineBoxManager.lastY;\n // ib情况发生折行\n if(!isInline && (lineBoxManager.size - n) > 1 && width[1] === AUTO) {\n isIbFull = true;\n }\n }\n }\n }\n });\n // 同block结尾,不过这里一定是lineBox结束,无需判断\n y = lineBoxManager.endY;\n // 标识ib情况同block一样占满行\n this.__isIbFull = isIbFull;\n // 元素的width在固定情况或者ibFull情况已被计算出来,否则为最大延展尺寸,inline没有固定尺寸概念\n let tw, th;\n if(isInline) {\n // inline最后的x要算上右侧mpb,为next行元素提供x坐标基准,同时其尺寸计算比较特殊\n if(selfEndSpace) {\n lineBoxManager.addX(selfEndSpace);\n }\n // 如果没有内容,空白还要加上开头即左侧mpb\n if(!flowChildren.length) {\n let {\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = computedStyle;\n lineBoxManager.addX(marginLeft + paddingLeft + borderLeftWidth);\n }\n // 结束出栈contentBox,递归情况结束子inline获取contentBox,父inline继续\n lineBoxManager.popContentBoxList();\n // abs非固定w时预计算,本来是最近非inline父层统一计算,但在abs时不算,\n if(isVirtual) {\n this.__inlineSize();\n }\n }\n else {\n // ib在满时很特殊,取最大值,可能w本身很小不足排下1个字符,此时要用maxW\n let maxW = lineBoxManager.__maxX - data.x;\n tw = this.__width = fixedWidth ? w : (isIbFull ? Math.max(w, maxW) : maxW);\n th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n }\n // 非abs提前虚拟布局,真实布局情况下最后为所有行内元素进行2个方向上的对齐,inline会被父级调用这里只看ib\n if(!isVirtual && !isInline) {\n lineBoxManager.verticalAlign();\n if(['center', 'right'].indexOf(textAlign) > -1) {\n lineBoxManager.horizonAlign(tw, textAlign);\n // 直接text需计算size\n flowChildren.forEach(item => {\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n // block的所有inline计算size\n lineBoxManager.domList.forEach(item => {\n item.__inlineSize(tw, textAlign);\n });\n }\n // inlineBlock新开上下文,但父级block遇到要处理换行\n return isInline ? lineClampCount : 0;\n }\n\n /**\n * inline的尺寸计算非常特殊,并非一个矩形区域,而是由字体行高结合节点下多个LineBox中的内容决定,\n * 且这个尺寸又并非真实LineBox中的内容直接合并计算而来,比如包含了个更大尺寸的ib却不会计入\n * 具体方法为遍历持有的LineBox下的内容,x取两侧极值,同时首尾要考虑mpb,y值取上下极值,同样首尾考虑mpb\n * 首尾行LineBox可能不是不是占满一行,比如前后都有同行inline的情况,非首尾行则肯定占满\n * 绘制内容(如背景色)的区域也很特殊,每行LineBox根据lineHeight对齐baseLine得来,并非LineBox全部\n * 当LineBox只有直属Text时如果font没有lineGap则等价于全部,如有则需减去\n * 另外其client/offset/outer的w/h尺寸计算也很特殊,皆因首尾x方向的mpb导致\n * @private\n */\n __inlineSize(tw, textAlign) {\n let { contentBoxList, computedStyle, __ox, __oy } = this;\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [PADDING_LEFT]: paddingLeft,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [LINE_HEIGHT]: lineHeight,\n } = computedStyle;\n // x/clientX/offsetX/outerX\n let maxX, maxY, minX, minY, maxCX, maxCY, minCX, minCY, maxFX, maxFY, minFX, minFY, maxOX, maxOY, minOX, minOY;\n let length = contentBoxList.length;\n if(length) {\n // 遍历contentBox,里面存的是LineBox内容,根据父LineBox引用判断是否换行\n contentBoxList.forEach((item, i) => {\n // 非第一个除了minY不用看其它都要,minX是换行导致,而maxX在最后一个要考虑右侧mpb,中间的无需考虑嵌套inline的mpb\n if(i) {\n minX = Math.min(minX, item.x);\n minCX = Math.min(minCX, item.x);\n minFX = Math.min(minFX, item.x);\n minOX = Math.min(minOX, item.x);\n if(i === length - 1) {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n maxY = maxCY = maxFY = maxOY = Math.max(maxY, item.y + item.outerHeight);\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n else {\n maxX = maxCX = maxFX = maxOX = Math.max(maxX, item.x + item.outerWidth);\n }\n }\n // 第一个初始化\n else {\n minX = item.x;\n minY = item.y;\n minCX = minX - paddingLeft;\n minCY = minY - paddingTop;\n minFX = minCX - borderLeftWidth;\n minFY = minCY - borderTopWidth;\n minOX = minFX - marginLeft;\n minOY = minFY - marginTop;\n maxX = maxCX = maxFX = maxOX = item.x + item.outerWidth;\n maxY = maxCY = maxFY = maxOY = item.y + item.outerHeight;\n if(i === length - 1) {\n maxCX += paddingRight;\n maxCY += paddingBottom;\n maxFX += paddingRight + borderRightWidth;\n maxFY += paddingBottom + borderBottomWidth;\n maxOX += borderRightWidth + paddingRight + marginRight\n maxOY += borderBottomWidth + paddingBottom + marginBottom;\n }\n }\n });\n this.__x = minOX;\n this.__y = minOY;\n this.__width = computedStyle[WIDTH] = maxX - minX;\n // 防止比自己最小高度lineHeight还小,比如内容是个小字体\n this.__height = computedStyle[HEIGHT] = Math.max(lineHeight, maxY - minY);\n this.__clientWidth = maxCX - minCX;\n this.__clientHeight = maxCY - minCY;\n this.__offsetWidth = maxFX - minFX;\n this.__offsetHeight = maxFY - minFY;\n this.__outerWidth = maxOX - minOX;\n this.__outerHeight = maxOY - minOY;\n this.__sx = minOX + __ox;\n this.__sy = minOY + __oy;\n this.__sx1 = minFX + __ox;\n this.__sy1 = minFY + __oy;\n this.__sx2 = minCX + __ox;\n this.__sy2 = minCY + __oy;\n this.__sx3 = minX + __ox;\n this.__sy3 = minY + __oy;\n this.__sx4 = maxX + __ox;\n this.__sy4 = maxY + __oy;\n this.__sx5 = maxCX + __ox;\n this.__sy5 = maxCY + __oy;\n this.__sx6 = maxFX + __ox;\n this.__sy6 = maxFY + __oy;\n // inline的text整体设置相同\n if(['center', 'right'].indexOf(textAlign) > -1) {\n this.children.forEach(item => {\n if(item instanceof Text) {\n item.__inlineSize();\n }\n });\n }\n }\n // 如果没有内容,宽度为0高度为lineHeight,对齐也特殊处理,lineBoxManager不会处理\n else {\n if(['center', 'right'].indexOf(textAlign) > -1) {\n let diff = tw;\n if(textAlign === 'center') {\n diff *= 0.5;\n }\n if(diff) {\n this.__offsetX(diff, true);\n }\n }\n this.__width = computedStyle[WIDTH] = 0;\n let th = this.__height = computedStyle[HEIGHT] = lineHeight;\n this.__ioSize(0, th);\n this.__sy -= marginTop + paddingTop + borderTopWidth;\n this.__sx1 = this.sx + marginLeft;\n this.__sy1 = this.sy + marginTop;\n this.__sx2 = this.__sx1 + borderLeftWidth;\n this.__sy2 = this.__sy1 + borderTopWidth;\n this.__sx4 = this.__sx3 = this.__sx2 + paddingLeft;\n this.__sy4 = this.__sy3 = this.__sy2 + paddingTop;\n this.__sx5 = this.__sx4 + paddingRight;\n this.__sy5 = this.__sy4 + th + paddingBottom;\n this.__sx6 = this.__sx5 + borderRightWidth;\n this.__sy6 = this.__sy5 + borderBottomWidth;\n this.__clientWidth = this.__sx5 - this.__sx2;\n this.__clientHeight = this.__sy5 - this.__sy2;\n this.__offsetWidth = this.__sx6 - this.__sx1;\n this.__offsetHeight = this.__sy6 - this.__sy1;\n this.__outerWidth = this.__offsetWidth + marginLeft + marginRight;\n this.__outerHeight = this.__offsetHeight + marginTop + marginBottom;\n }\n }\n\n /**\n * 只针对绝对定位children布局\n * @param container\n * @param data\n * @param target 可选,只针对某个abs的child特定布局,在局部更新时用\n * @private\n */\n __layoutAbs(container, data, target) {\n let { sx: x, sy: y, clientWidth, clientHeight, computedStyle } = container;\n let { isDestroyed, children, absChildren } = this;\n let {\n [DISPLAY]: display,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [MARGIN_TOP]: marginTop,\n [MARGIN_LEFT]: marginLeft,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n } = computedStyle;\n if(isDestroyed || display === 'none') {\n this.__layoutNone();\n return;\n }\n x += marginLeft + borderLeftWidth;\n y += marginTop + borderTopWidth;\n // 对absolute的元素进行相对容器布局\n absChildren.forEach(item => {\n if(target) {\n // 传入target局部布局更新,这时候如果是Component引发的,当setState时是Cp自身,当layout时是sr\n let node = item;\n if(node instanceof Component) {\n node = item.shadowRoot;\n }\n // 所以得2个都对比\n if(target !== node && target !== item) {\n return;\n }\n }\n let { currentStyle, computedStyle } = item;\n if(currentStyle[DISPLAY] === 'none') {\n item.__layoutNone();\n return;\n }\n // 先根据容器宽度计算margin/padding\n item.__mp(currentStyle, computedStyle, clientWidth);\n if(currentStyle[DISPLAY] !== 'block' && currentStyle[DISPLAY] !== 'flex') {\n currentStyle[DISPLAY] = computedStyle[DISPLAY] = 'block';\n }\n let { [LEFT]: left, [TOP]: top, [RIGHT]: right,\n [BOTTOM]: bottom, [WIDTH]: width, [HEIGHT]: height, [DISPLAY]: display,\n [FLEX_DIRECTION]: flexDirection } = currentStyle;\n let x2, y2, w2, h2;\n let onlyRight;\n let onlyBottom;\n let fixedTop;\n let fixedRight;\n let fixedBottom;\n let fixedLeft;\n // 判断何种方式的定位,比如左+宽度,左+右之类\n if(left[1] !== AUTO) {\n fixedLeft = true;\n computedStyle[LEFT] = calAbsolute(currentStyle, 'left', left, clientWidth, this.root);\n }\n else {\n computedStyle[LEFT] = 'auto';\n }\n if(right[1] !== AUTO) {\n fixedRight = true;\n computedStyle[RIGHT] = calAbsolute(currentStyle, 'right', right, clientWidth, this.root);\n }\n else {\n computedStyle[RIGHT] = 'auto';\n }\n if(top[1] !== AUTO) {\n fixedTop = true;\n computedStyle[TOP] = calAbsolute(currentStyle, 'top', top, clientHeight, this.root);\n }\n else {\n computedStyle[TOP] = 'auto';\n }\n if(bottom[1] !== AUTO) {\n fixedBottom = true;\n computedStyle[BOTTOM] = calAbsolute(currentStyle, 'bottom', bottom, clientHeight, this.root);\n }\n else {\n computedStyle[BOTTOM] = 'auto';\n }\n // 优先级最高left+right,其次left+width,再次right+width,再次仅申明单个,最次全部auto\n if(fixedLeft && fixedRight) {\n x2 = x + computedStyle[LEFT];\n w2 = x + clientWidth - computedStyle[RIGHT] - x2;\n }\n else if(fixedLeft) {\n x2 = x + computedStyle[LEFT];\n if(width[1] !== AUTO) {\n if(width[1] === PERCENT) {\n w2 = width[0] * clientWidth * 0.01;\n }\n else if(width[1] === REM) {\n w2 = width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w2 = width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w2 = width[0] * this.root.height * 0.01;\n }\n else 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 unit from '../style/unit';\nimport image from '../style/image';\nimport border from '../style/border';\nimport enums from '../util/enums';\nimport level from '../refresh/level';\nimport mx from '../math/matrix';\n\nconst {\n STYLE_KEY: {\n WIDTH,\n HEIGHT,\n DISPLAY,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_LEFT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_TOP_LEFT_RADIUS,\n BORDER_TOP_RIGHT_RADIUS,\n BORDER_BOTTOM_RIGHT_RADIUS,\n BORDER_BOTTOM_LEFT_RADIUS,\n VISIBILITY,\n BACKGROUND_IMAGE,\n BACKGROUND_COLOR,\n BOX_SHADOW,\n MIX_BLEND_MODE,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n FONT_SIZE,\n FLEX_BASIS,\n },\n UPDATE_KEY: {\n UPDATE_NODE,\n UPDATE_FOCUS,\n UPDATE_CONFIG,\n },\n NODE_KEY: {\n NODE_CACHE,\n NODE_DEFS_CACHE,\n NODE_IS_MASK,\n },\n} = enums;\nconst { AUTO, PX, PERCENT, REM, VW, VH, 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 ctx.arc(cx, cy, r, 0, 2 * Math.PI);\n ctx.fill();\n ctx.closePath();\n ctx.beginPath();\n ctx.moveTo(pts[0][0], pts[0][1]);\n for(let i = 1, len = pts.length; i < len; i++) {\n let point = pts[i];\n ctx.lineTo(point[0], point[1]);\n }\n ctx.lineTo(pts[0][0], pts[0][1]);\n ctx.fill();\n ctx.closePath();\n }\n else if(renderMode === mode.SVG) {\n this.__addGeom('rect', [\n ['x', originX],\n ['y', originY],\n ['width', width],\n ['height', height],\n ['stroke', stroke],\n ['stroke-width', strokeWidth],\n ['fill', 'rgba(0,0,0,0)']\n ]);\n this.__addGeom('circle', [\n ['cx', cx],\n ['cy', cy],\n ['r', r],\n ['fill', fill],\n ]);\n let s = '';\n for(let i = 0, len = pts.length; i < len; i++) {\n let point = pts[i];\n if(i) {\n s += ' ';\n }\n s += point[0] + ',' + point[1];\n }\n this.__addGeom('polygon', [\n ['points', s],\n ['fill', fill]\n ]);\n }\n }\n else if(source) {\n // 圆角需要生成一个mask\n let list = border.calRadius(originX, originY, width, height,\n borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius);\n if(renderMode === mode.CANVAS || renderMode === mode.WEBGL) {\n // 有border-radius需模拟遮罩裁剪\n if(list) {\n ctx.save();\n ctx.beginPath();\n canvasPolygon(ctx, list, dx, dy);\n ctx.clip();\n ctx.closePath();\n ctx.drawImage(source, originX, originY, width, height);\n ctx.restore();\n }\n else {\n ctx.drawImage(source, originX, originY, width, height);\n }\n }\n else if(renderMode === mode.SVG) {\n // img没有变化无需diff,直接用上次的vd\n if(loadImg.cache) {\n loadImg.cache.cache = true;\n virtualDom.children = [loadImg.cache];\n // 但是还是要校验是否有borderRadius变化,引发img的圆角遮罩\n if(!virtualDom.cache && list) {\n let d = svgPolygon(list);\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF'],\n ],\n }\n ],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.conClip = 'url(#' + id + ')';\n }\n return;\n }\n // 缩放图片,无需考虑原先矩阵,xom里对父层已经变换过了\n let matrix;\n if(width !== loadImg.width || height !== loadImg.height) {\n matrix = image.matrixResize(loadImg.width, loadImg.height, width, height, originX, originY, width, height);\n }\n let props = [\n ['xlink:href', loadImg.error ? placeholder : loadImg.src],\n ['x', originX],\n ['y', originY],\n ['width', loadImg.width],\n ['height', loadImg.height]\n ];\n if(list) {\n let d = svgPolygon(list);\n let v = {\n tagName: 'clipPath',\n props: [],\n children: [\n {\n type: 'item',\n tagName: 'path',\n props: [\n ['d', d],\n ['fill', '#FFF']\n ],\n }\n ],\n };\n let id = ctx.add(v);\n __config[NODE_DEFS_CACHE].push(v);\n virtualDom.conClip = 'url(#' + id + ')';\n delete virtualDom.cache;\n }\n if(matrix && !mx.isE(matrix)) {\n props.push(['transform', 'matrix(' + util.joinArr(mx.m2m6(matrix), ',') + ')']);\n }\n let vd = {\n type: 'img',\n tagName: 'image',\n props,\n };\n virtualDom.children = [vd];\n loadImg.cache = vd;\n }\n }\n return res;\n }\n\n // img没加载时,清空,这样Xom就认为没内容不生成cache,防止img先绘制cache再绘制主屏,重复\n __releaseWhenEmpty(__cache) {\n if(!this.__loadImg.error && !this.__loadImg.source) {\n return super.__releaseWhenEmpty(__cache);\n }\n }\n\n __isRealInline() {\n return false;\n }\n\n // overwrite\n __tryLayInline(w, total) {\n let { currentStyle: {\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n else if(width[1] === VMAX) {\n w -= width[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(width[1] === VMIN) {\n w -= width[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n else {\n let loadImg = this.__loadImg;\n // 加载成功计算缩放后的宽度\n if(loadImg.source) {\n if(height[1] === PX) {\n w -= loadImg.width * height[0] / loadImg.height;\n }\n else if(height[1] === PERCENT) {\n w -= loadImg.width * height[0] * total * 0.01 / loadImg.height;\n }\n else if(height[1] === REM) {\n w -= loadImg.width * height[0] * this.root.computedStyle[FONT_SIZE] / loadImg.height;\n }\n else if(height[1] === VW) {\n w -= loadImg.width * height[0] * this.root.width * 0.01 / loadImg.height;\n }\n else if(height[1] === VH) {\n w -= loadImg.width * height[0] * this.root.height * 0.01 / loadImg.height;\n }\n else if(height[1] === VMAX) {\n w -= height[0] * Math.max(this.root.width, this.root.height) * 0.01 / loadImg.height;\n }\n else if(height[1] === VMIN) {\n w -= height[0] * Math.min(this.root.width, this.root.height) * 0.01 / loadImg.height;\n }\n else {\n w -= loadImg.width;\n }\n }\n }\n // 减去水平mbp\n if(marginLeft[1] === PX) {\n w -= marginLeft[0];\n }\n else if(marginLeft[1] === PERCENT) {\n w -= marginLeft[0] * total * 0.01;\n }\n else if(marginLeft[1] === REM) {\n w -= marginLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginLeft[1] === VW) {\n w -= marginLeft[0] * this.root.width * 0.01;\n }\n else if(marginLeft[1] === VH) {\n w -= marginLeft[0] * this.root.height * 0.01;\n }\n else if(marginLeft[1] === VMAX) {\n w -= marginLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginLeft[1] === VMIN) {\n w -= marginLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingLeft[1] === PX) {\n w -= paddingLeft[0];\n }\n else if(paddingLeft[1] === PERCENT) {\n w -= paddingLeft[0] * total * 0.01;\n }\n else if(paddingLeft[1] === REM) {\n w -= paddingLeft[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingLeft[1] === VW) {\n w -= paddingLeft[0] * this.root.width * 0.01;\n }\n else if(paddingLeft[1] === VH) {\n w -= paddingLeft[0] * this.root.height * 0.01;\n }\n else if(paddingLeft[1] === VMAX) {\n w -= paddingLeft[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingLeft[1] === VMIN) {\n w -= paddingLeft[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderLeftWidth[1] === PX) {\n w -= borderLeftWidth[0];\n }\n else if(borderLeftWidth[1] === REM) {\n w -= borderLeftWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderLeftWidth[1] === VW) {\n w -= borderLeftWidth[0] * this.root.width * 0.01;\n }\n else if(borderLeftWidth[1] === VH) {\n w -= borderLeftWidth[0] * this.root.height * 0.01;\n }\n else if(borderLeftWidth[1] === VMAX) {\n w -= borderLeftWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderLeftWidth[1] === VMIN) {\n w -= borderLeftWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(marginRight[1] === PX) {\n w -= marginRight[0];\n }\n else if(marginRight[1] === PERCENT) {\n w -= marginRight[0] * total * 0.01;\n }\n else if(marginRight[1] === REM) {\n w -= marginRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(marginRight[1] === VW) {\n w -= marginRight[0] * this.root.width * 0.01;\n }\n else if(marginRight[1] === VH) {\n w -= marginRight[0] * this.root.height * 0.01;\n }\n else if(marginRight[1] === VMAX) {\n w -= marginRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(marginRight[1] === VMIN) {\n w -= marginRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(paddingRight[1] === PX) {\n w -= paddingRight[0];\n }\n else if(paddingRight[1] === PERCENT) {\n w -= paddingRight[0] * total * 0.01;\n }\n else if(paddingRight[1] === REM) {\n w -= paddingRight[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(paddingRight[1] === VW) {\n w -= paddingRight[0] * this.root.width * 0.01;\n }\n else if(paddingRight[1] === VH) {\n w -= paddingRight[0] * this.root.height * 0.01;\n }\n else if(paddingRight[1] === VMAX) {\n w -= paddingRight[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(paddingRight[1] === VMIN) {\n w -= paddingRight[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n if(borderRightWidth[1] === PX) {\n w -= borderRightWidth[0];\n }\n else if(borderRightWidth[1] === REM) {\n w -= borderRightWidth[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(borderRightWidth[1] === VW) {\n w -= borderRightWidth[0] * this.root.width * 0.01;\n }\n else if(borderRightWidth[1] === VH) {\n w -= borderRightWidth[0] * this.root.height * 0.01;\n }\n else if(borderRightWidth[1] === VMAX) {\n w -= borderRightWidth[0] * Math.max(this.root.width, this.root.height) * 0.01;\n }\n else if(borderRightWidth[1] === VMIN) {\n w -= borderRightWidth[0] * Math.min(this.root.width, this.root.height) * 0.01;\n }\n return w;\n }\n\n __calBasis(isDirectionRow, 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 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 = __loadImg.width / __loadImg.height;\n b = max = min = isDirectionRow ? cross * ratio : cross / ratio;\n }\n else {\n b = max = min = isDirectionRow ? __loadImg.width : __loadImg.height;\n }\n }\n // border也得计算在内\n if(isDirectionRow) {\n let mp = this.__calMp(marginLeft, w)\n + this.__calMp(marginRight, w)\n + this.__calMp(paddingLeft, w)\n + this.__calMp(paddingRight, w);\n let w2 = borderLeftWidth[0] + borderRightWidth[0] + mp;\n b += w2;\n max += w2;\n min += w2;\n }\n else {\n let mp = this.__calMp(marginTop, w)\n + this.__calMp(marginBottom, w)\n + this.__calMp(paddingTop, w)\n + this.__calMp(paddingBottom, w);\n let h2 = borderTopWidth[0] + borderBottomWidth[0] + mp;\n b += h2;\n max += h2;\n min += h2;\n }\n return [b, min, max];\n }\n\n __loadAndRefresh(loadImg, root, ctx, placeholder, computedStyle, width, height, cb) {\n let self = this;\n // 先清空之前可能的\n if(loadImg.source || loadImg.error) {\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null; // 清除在before,防止after的回调增加新的task误删\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n });\n loadImg.source = null;\n }\n loadImg.loading = true;\n // 再测量,可能瞬间完成替换掉上面的\n inject.measureImg(loadImg.src, data => {\n // 还需判断url,防止重复加载时老的替换新的,失败走error绘制\n if(data.url === loadImg.src && !self.isDestroyed) {\n loadImg.cache && (loadImg.cache.cache = false);\n loadImg.loading = false;\n function reload() {\n let { currentStyle: { [WIDTH]: width, [HEIGHT]: height } } = self;\n root.delRefreshTask(self.__task);\n if(width[1] !== AUTO && height[1] !== AUTO) {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REPAINT;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n else {\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n // 刷新前统一赋值,由刷新逻辑计算最终值避免优先级覆盖问题\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW; // 没有样式变化但内容尺寸发生了变化强制执行\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, root.__config, res);\n },\n __after() {\n if(isFunction(cb)) {\n cb.call(self);\n }\n },\n });\n }\n }\n if(data.success) {\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n }\n else if(placeholder) {\n inject.measureImg(placeholder, data => {\n if(data.success) {\n loadImg.error = true;\n loadImg.source = data.source;\n loadImg.width = data.width;\n loadImg.height = data.height;\n reload();\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n return;\n }\n else {\n loadImg.error = true;\n }\n // 可见状态进行刷新操作,visibility某些情况需要刷新,可能宽高未定义要重新布局\n if(computedStyle[DISPLAY] !== 'none') {\n reload();\n }\n }\n }, {\n ctx,\n root,\n width,\n height,\n });\n }\n\n updateSrc(v, cb) {\n let self = this;\n let loadImg = self.__loadImg;\n let root = this.root;\n // 相等或空且当前error直接返回\n if(v === loadImg.src || !v && loadImg.error) {\n if(isFunction(cb)) {\n cb(-1);\n }\n }\n else if(v) {\n loadImg.src = v;\n self.__loadAndRefresh(loadImg, root, root.ctx, self.props.placeholder, self.computedStyle, self.width, self.height, cb);\n }\n else {\n loadImg.src = v;\n loadImg.source = null;\n loadImg.error = true;\n root.delRefreshTask(self.__task);\n root.addRefreshTask(self.__task = {\n __before() {\n self.__task = null;\n if(self.isDestroyed) {\n return;\n }\n let res = {};\n res[UPDATE_NODE] = self;\n res[UPDATE_FOCUS] = level.REFLOW;\n res[UPDATE_CONFIG] = self.__config;\n root.__addUpdate(self, self.__config, root, self.__config, res);\n },\n __after(diff) {\n if(isFunction(cb)) {\n cb(diff);\n }\n },\n });\n }\n }\n\n appendChild() {\n inject.error('Img can not appendChild.');\n }\n\n get src() {\n return this.__loadImg.src;\n }\n\n static showError = true;\n}\n\nexport default Img;\n","class Defs {\n constructor(uuid) {\n this.id = uuid;\n this.count = 0;\n this.list = [];\n this.cacheHash = {}; // 每次svg渲染前重置,存储前次渲染不变的缓存id\n }\n add(data) {\n let uuid = this.count;\n let hash = this.cacheHash;\n while(hash.hasOwnProperty(uuid)) {\n uuid++;\n }\n this.count = uuid + 1;\n data.id = uuid;\n data.uuid = 'karas-defs-' + this.id + '-' + uuid;\n data.index = this.list.length;\n this.list.push(data);\n return data.uuid;\n }\n addCache(data) {\n data.index = this.list.length;\n this.list.push(data);\n this.cacheHash[data.id] = true;\n return data.uuid;\n }\n clear() {\n this.list = [];\n this.count = 0;\n this.cacheHash = {};\n }\n removeCache(data) {\n let list = this.list;\n let i = data.index;\n // 一般情况index即位置,但每次渲染过程中,可能会删掉一些,此时位置会往前,但index不变,因此遍历\n for(; i >= 0; i--) {\n if(list[i] === data) {\n list.splice(i, 1);\n return;\n }\n }\n }\n\n get value() {\n return this.list;\n }\n\n static getInstance(uuid) {\n return new Defs(uuid);\n }\n}\n\nexport default Defs;\n","import Xom from '../Xom';\nimport reset from '../../style/reset';\nimport css from '../../style/css';\nimport unit from '../../style/unit';\nimport enums from '../../util/enums';\nimport mode from '../mode';\nimport util from '../../util/util';\nimport painter from '../../util/painter';\nimport transform from '../../style/transform';\nimport mx from '../../math/matrix';\nimport inject from '../../util/inject';\nimport gradient from '../../math/gradient';\n\nconst {\n STYLE_KEY: {\n DISPLAY,\n MARGIN_TOP,\n MARGIN_RIGHT,\n MARGIN_BOTTOM,\n MARGIN_LEFT,\n PADDING_TOP,\n PADDING_RIGHT,\n PADDING_BOTTOM,\n PADDING_LEFT,\n WIDTH,\n HEIGHT,\n BORDER_TOP_WIDTH,\n BORDER_RIGHT_WIDTH,\n BORDER_BOTTOM_WIDTH,\n BORDER_LEFT_WIDTH,\n FILL,\n STROKE,\n STROKE_MITERLIMIT,\n STROKE_WIDTH,\n STROKE_LINECAP,\n STROKE_LINEJOIN,\n STROKE_DASHARRAY,\n STROKE_DASHARRAY_STR,\n FILL_RULE,\n VISIBILITY,\n FONT_SIZE,\n FLEX_BASIS,\n },\n NODE_KEY: {\n NODE_CACHE_PROPS,\n NODE_CURRENT_PROPS,\n NODE_CURRENT_STYLE,\n NODE_STYLE,\n NODE_DEFS_CACHE,\n }\n} = enums;\nconst { PX, PERCENT, REM, VW, VH, VMAX, VMIN } = unit;\nconst { int2rgba, isNil, joinArr } = util;\nconst { canvasPolygon, svgPolygon } = painter;\n\nconst REGISTER = {};\n\nclass Geom extends Xom {\n constructor(tagName, props) {\n super(tagName, props);\n this.__isMulti = !!this.props.multi;\n this.__style = css.normalize(this.style, reset.DOM_ENTRY_SET.concat(reset.GEOM_ENTRY_SET));\n this.__currentStyle = util.extend({}, this.__style);\n this.__currentProps = util.clone(this.props);\n let config = this.__config;\n config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n config[NODE_CURRENT_PROPS] = this.__currentProps;\n config[NODE_CURRENT_STYLE] = this.__currentStyle;\n config[NODE_STYLE] = this.__style;\n }\n\n __tryLayInline(w, total) {\n // 无children,直接以style的width为宽度,不定义则为0\n let { currentStyle: {\n [WIDTH]: width,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_RIGHT]: marginRight,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_RIGHT]: paddingRight,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n } } = this;\n if(width[1] === PX) {\n w -= width[0];\n }\n else if(width[1] === PERCENT) {\n w -= total * width[0] * 0.01;\n }\n else if(width[1] === REM) {\n w -= width[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(width[1] === VW) {\n w -= width[0] * this.root.width * 0.01;\n }\n else if(width[1] === VH) {\n w -= width[0] * this.root.height * 0.01;\n }\n 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 let min = 0;\n let max = 0;\n let { currentStyle } = this;\n // 计算需考虑style的属性\n let {\n [WIDTH]: width,\n [HEIGHT]: height,\n [DISPLAY]: display,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // 只绝对值生效,%不生效,依旧要判断\n if(main[1] === PX) {\n min = max = main[0];\n }\n else if(main[1] === REM) {\n min = max = main[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(main[1] === VW) {\n min = max = main[0] * this.root.width * 0.01;\n }\n else if(main[1] === VH) {\n min = max = main[0] * this.root.height * 0.01;\n }\n 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 return [display, this.__addMp(isDirectionRow, data.w, currentStyle, [min, max])];\n }\n\n __calBasis(isDirectionRow, data) {\n let b = 0;\n let min = 0;\n let max = 0;\n let { currentStyle } = this;\n let { w, h } = data;\n // 计算需考虑style的属性\n let {\n [FLEX_BASIS]: flexBasis,\n [WIDTH]: width,\n [HEIGHT]: height,\n [MARGIN_LEFT]: marginLeft,\n [MARGIN_TOP]: marginTop,\n [MARGIN_RIGHT]: marginRight,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_LEFT]: paddingLeft,\n [PADDING_TOP]: paddingTop,\n [PADDING_RIGHT]: paddingRight,\n [PADDING_BOTTOM]: paddingBottom,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_RIGHT_WIDTH]: borderRightWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n [BORDER_LEFT_WIDTH]: borderLeftWidth,\n } = currentStyle;\n let main = isDirectionRow ? width : height;\n // basis3种情况:auto、固定、content,只区分固定和其它\n let isFixed = [PX, PERCENT, REM, VW, VH, 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 return [b, min, max];\n }\n\n __layoutBlock(data, isVirtual) {\n let { fixedWidth, fixedHeight, w, h } = this.__preLayout(data);\n this.__height = fixedHeight ? h : 0;\n if(isVirtual) {\n this.__width = fixedWidth ? w : 0;\n return;\n }\n this.__width = w;\n this.__ioSize(w, this.height);\n this.__marginAuto(this.currentStyle, data);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __layoutFlex(data) {\n // 无children所以等同于block\n this.__layoutBlock(data);\n }\n\n __layoutInline(data) {\n let { fixedWidth, fixedHeight, x, y, w, h } = this.__preLayout(data);\n // 元素的width不能超过父元素w\n let tw = this.__width = fixedWidth ? w : x - data.x;\n let th = this.__height = fixedHeight ? h : y - data.y;\n this.__ioSize(tw, th);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6) {\n let res = super.__calCache(renderMode, ctx, parent, __cacheStyle, currentStyle, computedStyle,\n clientWidth, clientHeight, offsetWidth, offsetHeight,\n borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,\n paddingTop, paddingRight, paddingBottom, paddingLeft,\n x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6);\n if(isNil(__cacheStyle[STROKE_WIDTH])) {\n __cacheStyle[STROKE_WIDTH] = true;\n let strokeWidth = currentStyle[STROKE_WIDTH] || [];\n let w = this.width;\n computedStyle[STROKE_WIDTH] = strokeWidth.map(item => {\n if(item[1] === PX) {\n return item[0];\n }\n else if(item[1] === PERCENT) {\n return item[0] * w * 0.01;\n }\n else if(item[1] === REM) {\n return item[0] * this.root.computedStyle[FONT_SIZE];\n }\n else if(item[1] === VW) {\n return item[0] * this.root.width * 0.01;\n }\n else if(item[1] === VH) {\n return item[0] * this.root.height * 0.01;\n }\n else 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 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() {}\n\n // offset/resize时要多一步清空props上记录的缓存\n __offsetX(diff, isLayout, lv) {\n super.__offsetX(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __offsetY(diff, isLayout, lv) {\n super.__offsetY(diff, isLayout, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeX(diff, lv) {\n super.__resizeX(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n __resizeY(diff, lv) {\n super.__resizeY(diff, lv);\n this.__config[NODE_CACHE_PROPS] = this.__cacheProps = {};\n }\n\n addGeom(tagName, props) {\n props = util.hash2arr(props);\n this.virtualDom.children.push({\n type: 'item',\n tagName,\n props,\n });\n }\n\n getProps(k) {\n let v = this.currentProps[k];\n if(!isNil(v)) {\n return v;\n }\n return this['__' + k];\n }\n\n __isRealInline() {\n return false;\n }\n\n get isMulti() {\n return this.__isMulti;\n }\n\n get currentProps() {\n return this.__currentProps;\n }\n\n static get REGISTER() {\n return REGISTER;\n }\n\n static getRegister(name) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$') {\n throw new Error('Invalid param');\n }\n if(!REGISTER.hasOwnProperty(name)) {\n throw new Error(`Geom has not register: ${name}`);\n }\n return REGISTER[name];\n }\n\n static register(name, obj) {\n if(!name || !util.isString(name) || name.charAt(0) !== '$'\n || !obj.prototype || !(obj.prototype instanceof Geom)) {\n throw new Error('Invalid param');\n }\n if(Geom.hasRegister(name)) {\n throw new Error(`Geom has already register: ${name}`);\n }\n REGISTER[name] = obj;\n }\n\n static hasRegister(name) {\n return name && REGISTER.hasOwnProperty(name);\n }\n\n static delRegister(name) {\n if(Geom.hasRegister(name)) {\n delete REGISTER[name];\n }\n }\n}\n\nexport default Geom;\n","import Xom from '../node/Xom';\nimport Dom from '../node/Dom';\nimport Component from '../node/Component';\nimport util from './util';\nimport inject from './inject';\nimport flatten from './flatten';\nimport $$type from './$$type';\nimport enums from './enums';\n\nconst {\n NODE_KEY: {\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_DOM_PARENT,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n NODE_STRUCT,\n },\n} = enums;\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet updateList = [];\nlet removeList = [];\n\nconst KEY_FLAG = {};\n\n/**\n * setState后刷新前先根遍历检查组件开始进行shouldComponentUpdate判断\n */\nfunction check(vd) {\n if(vd instanceof Dom) {\n vd.children.forEach(child => {\n if(child instanceof Dom) {\n check(child);\n }\n // 当组件有setState更新时,从叶子到根链路会标识__hasUpdate,以便节约遍历成本忽略那些没变化的链路\n else if(child instanceof Component && child.__hasUpdate) {\n child.__hasUpdate = false;\n checkCp(child, child.props);\n }\n });\n }\n // 高阶组件会进入此分支,被父组件调用\n else if(vd instanceof Component && vd.__hasUpdate) {\n vd.__hasUpdate = false;\n checkCp(vd, vd.props);\n }\n}\n\n/**\n * 检查cp是否有state变更,注意递归检查时需要看shadow不能看shadowRoot,\n * 否则高阶组件会被跳过,其更新无法触发update生命周期\n * @param cp\n * @param nextProps\n * @param forceCheckUpdate,被render()后的json的二级组件,发现props有变更强制检查更新,否则可以跳过\n */\nfunction checkCp(cp, nextProps, forceCheckUpdate) {\n if(cp.__nextState || forceCheckUpdate) {\n let shouldUpdate;\n if(util.isFunction(cp.shouldComponentUpdate)) {\n shouldUpdate = cp.shouldComponentUpdate(nextProps, cp.__nextState || cp.state);\n }\n else {\n // 没有默认更新\n shouldUpdate = true;\n }\n if(shouldUpdate) {\n updateCp(cp, nextProps, cp.__nextState || cp.state);\n }\n // 不更新则递归检查子tree的cp\n else {\n cp.props = nextProps;\n cp.state = cp.__nextState || cp.state;\n check(cp.shadow);\n }\n }\n else {\n check(cp.shadow);\n }\n}\n\n/**\n * 更新组件的props和state,清空__nextState\n * @param cp\n * @param props\n * @param state\n */\nfunction updateCp(cp, props, state) {\n cp.props = props;\n cp.state = state;\n cp.__nextState = null; // 同步在refresh前清除component的新state标识,这样frame动画在after回调中可以新设\n let oldS = cp.shadow;\n let oldSr = cp.shadowRoot;\n let oldJson = cp.__cd;\n let json = flatten(cp.render());\n // 对比新老render()返回的内容,更新后重新生成sr\n diffSr(oldS, oldJson, json);\n cp.__init(json);\n // 为了局部dom布局需要知道老的css信息\n let sr = cp.shadowRoot;\n if(sr instanceof Xom) {\n [\n '__outerWidth',\n '__outerHeight',\n '__sx',\n '__sy',\n '__sx2',\n '__sx3',\n '__sx4',\n '__sx5',\n '__sx6',\n '__sy2',\n '__sy3',\n '__sy4',\n '__sy5',\n '__sy6',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__computedStyle = sr.__config[NODE_COMPUTED_STYLE] = oldSr.computedStyle;\n }\n else {\n let domParent = cp.domParent;\n [\n NODE_STYLE,\n NODE_CURRENT_STYLE,\n NODE_COMPUTED_STYLE,\n NODE_MATRIX,\n NODE_MATRIX_EVENT,\n ].forEach(k => {\n sr.__config[k] = domParent.__config[k];\n });\n }\n [\n '__x',\n '__y',\n '__width',\n '__height',\n '__sx1', // text和xom\n '__sy1',\n '__layoutData',\n '__parent',\n '__domParent',\n ].forEach(k => {\n sr[k] = oldSr[k];\n });\n sr.__config[NODE_DOM_PARENT] = oldSr.domParent;\n sr.__config[NODE_STRUCT] = oldSr.__config[NODE_STRUCT];\n updateList.push(cp);\n // 老的需回收,diff会生成新的dom,唯一列外是cp直接返回一个没变化的cp\n if(!util.isObject(json) || !json.__placeholder) {\n removeList.push(oldS);\n }\n // 子组件使用老的json时标识,更新后删除,render()返回空会没json对象\n if(json && json.__placeholder) {\n delete json.__placeholder;\n }\n if(json && json.__inheritAnimate) {\n delete json.__inheritAnimate;\n }\n if(json && json.__animateRecords) {\n delete json.__animateRecords;\n }\n // 高阶组件时需判断,子组件更新后生成新的sr,父组件的sr/host需要同时更新引用\n let host = cp.host;\n while(host) {\n if(host.shadow === cp) {\n host.__shadowRoot = sr;\n sr.__hostRoot = host;\n cp = host;\n host = host.host;\n }\n else {\n break;\n }\n }\n}\n\n/**\n * 非一级组件sr进行对比,key相同的无需重新生成且继承动画\n * @param vd\n * @param oj oldJson\n * @param nj\n */\nfunction diffSr(vd, oj, nj) {\n // 先遍历检查key相同的,将没有变化的key暂存下来,深度优先,这样叶子节点出现在前面,当key的叶子也有key时,确保叶子先对比\n let ojk = getKeyHash(oj, {}, vd);\n let njk = getKeyHash(nj, {});\n let keyList = [];\n let cpList = [];\n // 先对比key对应的节点,如果新老有一方对不上则落空\n Object.keys(ojk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n if(!n) {\n o.json.key = KEY_FLAG;\n }\n });\n Object.keys(njk).forEach(k => {\n let o = ojk[k];\n let n = njk[k];\n // 有可能老的没有这个key,新key落空\n if(!o) {\n n.json.key = KEY_FLAG;\n return;\n }\n let oj = o.json;\n let nj = n.json;\n let vd = o.vd;\n // 相同class的组件进行对比替换\n if(oj.$$type === TYPE_CP && nj.$$type === TYPE_CP) {\n if(oj.klass === nj.klass) {\n // 对比props和children看是否全等,是则直接替换新json类型为占位符,引用老vd,否则强制更新\n diffCp(oj, nj, vd);\n // 标识对比过了\n oj.key = nj.key = KEY_FLAG;\n // 老的sr里需删除这个vd,因为老sr会回收\n cpList.push(vd);\n }\n }\n // 相同类型的vd进行对比继承动画\n else if(oj.$$type === nj.$$type && oj.tagName === nj.tagName) {\n // 需判断矢量标签mutil是否相等\n if(nj.$$type !== TYPE_GM || oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n oj.key = nj.key = KEY_FLAG;\n // key相同的dom暂存下来\n if(nj.$$type === TYPE_VD) {\n keyList.push({\n vd,\n oj,\n nj,\n });\n }\n }\n });\n // key相同的dom对比children,下面非key逻辑就不做了\n keyList.forEach(item => {\n diffChildren(item.vd, item.oj, item.nj);\n });\n // 整体tree进行对比\n diffChild(vd, oj, nj);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收,这里处理key的\n cpList.forEach(vd => {\n removeCpFromOldTree(vd);\n });\n}\n\n/**\n * 递归检查dom的children,相同的无需重新生成,用PL类型占位符代替直接返回老vd\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChild(vd, oj, nj) {\n if(util.isObject(nj)) {\n if(nj.$$type === TYPE_CP) {\n // key对比过了忽略\n if(nj.key === KEY_FLAG) {\n return;\n }\n // 相同class的组件处理\n if(oj && oj.$$type === nj.$$type && oj.klass === nj.klass) {\n diffCp(oj, nj, vd);\n // 已更新的cp需被老sr删除,因为老sr会回收,而此cp继续存在于新sr中不能回收\n removeCpFromOldTree(vd);\n }\n }\n else if(nj.$$type === TYPE_GM && oj && oj.$$type === TYPE_GM) {\n // $geom的multi必须一致\n if(oj.tagName === nj.tagName && oj.props.multi === nj.props.multi) {\n nj.__inheritAnimate = vd;\n }\n }\n // dom类型递归children\n else if(nj.$$type === TYPE_VD && oj && oj.$$type === TYPE_VD) {\n if(oj.tagName === nj.tagName) {\n nj.__inheritAnimate = vd;\n }\n diffChildren(vd, oj, nj);\n }\n }\n}\n\n/**\n * dom类型的vd对比children\n * @param vd\n * @param oj\n * @param nj\n */\nfunction diffChildren(vd, oj, nj) {\n let oc = oj.children;\n let nc = nj.children;\n let ol = oc.length;\n let nl = nc.length;\n let children = vd.children;\n for(let i = 0, of = 0, nf = 0, len = Math.min(ol, nl); i < len; i++) {\n let o = oc[i + of];\n let n = nc[i + nf];\n // 新老都是key直接跳过\n if(o.key === KEY_FLAG && n.key === KEY_FLAG) {\n }\n // 其中一个是key对比过了调整索引和长度\n else if(o.key === KEY_FLAG) {\n of++;\n i--;\n ol--;\n len = Math.min(ol, nl);\n }\n else if(n.key === KEY_FLAG) {\n nf++;\n i--;\n nl--;\n len = Math.min(ol, nl);\n }\n else {\n diffChild(children[i + of], o, n);\n }\n }\n // 长度不同增减的无需关注,新json创建cp有didMount,老vd会调用cp的destroy\n}\n\n/**\n * 根据json对比看cp如何更新,被render()后的json的二级组件对比才会出现\n * @param oj\n * @param nj\n * @param vd\n */\nfunction diffCp(oj, nj, vd) {\n // props全等,直接替换新json类型为占位符,引用老vd内容,无需重新创建,暂时存在json的placeholder上\n // 否则需要强制触发组件更新,包含setState内容\n nj.__placeholder = vd;\n let sr = vd.shadowRoot;\n // 对比需忽略on开头的事件,直接改老的引用到新的上,这样只变了on的话无需更新\n let exist = {};\n Object.keys(oj.props).forEach(k => {\n let v = oj.props[k];\n exist[k] = v;\n });\n Object.keys(nj.props).forEach(k => {\n let v = nj.props[k];\n if(/^on[a-zA-Z]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else {\n k = k.slice(2).toLowerCase();\n sr.listener[k] = v;\n }\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n oj.props[k] = v;\n let ex = exist[k];\n if(ex) {\n delete exist[k];\n if(ex !== v) {\n k = k.slice(2).toLowerCase();\n vd.off(k, exist[k]);\n vd.on(k, v);\n }\n delete exist[k];\n }\n else {\n k = k.slice(2).toLowerCase();\n vd.on(k, v);\n }\n }\n });\n // 新的少的事件取消\n Object.keys(exist).forEach(k => {\n let v = exist[k];\n if(/^on[a-zA-Z]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n delete sr.listener[k];\n }\n else if(/^on-[a-zA-Z\\d_$]/.test(k)) {\n nj.props[k] = v;\n k = k.slice(2).toLowerCase();\n vd.off(k, v);\n }\n });\n checkCp(vd, nj.props, !util.equal(oj.props, nj.props));\n}\n\n/**\n * 深度优先遍历json,将有key的记录在hash中,如果传入根vd,同步递归保存对应位置的vd\n * @param json\n * @param hash\n * @param vd\n * @returns {*}\n */\nfunction getKeyHash(json, hash, vd) {\n if(Array.isArray(json)) {\n json.forEach((item, i) => getKeyHash(item, hash, vd && vd[i]));\n }\n else if(util.isObject(json)) {\n if(json.$$type === TYPE_VD || json.$$type === TYPE_GM || json.$$type === TYPE_CP) {\n // 深度优先\n if(json.$$type === TYPE_VD) {\n getKeyHash(json.children, hash, vd && vd.children);\n }\n let key = json.props.key;\n if(!util.isNil(key) && key !== '') {\n // 重复key错误警告\n if(hash.hasOwnProperty(key)) {\n inject.warn('Component ' + vd.tagName + ' has duplicate key: ' + key);\n }\n hash[key] = {\n json,\n vd,\n };\n }\n }\n }\n return hash;\n}\n\n/**\n * 非一级组件diff发生更新时,其需要从sr的tree中移除,因为sr会销毁\n */\nfunction removeCpFromOldTree(vd) {\n // root下的一级组件不会发生回收情况,忽略\n if(!vd.host) {\n return;\n }\n let parent = vd.parent;\n if(parent) {\n let i = parent.children.indexOf(vd);\n if(i > -1) {\n parent.children[i] = null;\n }\n else {\n throw new Error('Can not find child: ' + vd.tagName);\n }\n }\n}\n\n/**\n * 执行componentDidUpdate/destroy\n */\nfunction did() {\n updateList.forEach(item => {\n if(util.isFunction(item.componentDidUpdate)) {\n item.componentDidUpdate();\n }\n });\n updateList.splice(0);\n removeList.forEach(item => {\n item.__destroy();\n });\n removeList = [];\n}\n\nexport default {\n updateList,\n check,\n did,\n};\n","import util from './util';\nimport level from '../refresh/level';\n\nconst { joinVd, joinDef } = util;\nconst { contain, NONE, TRANSFORM_ALL, OPACITY, FILTER, MIX_BLEND_MODE } = level;\n\nfunction diff(elem, ovd, nvd) {\n let cns = elem.childNodes;\n diffDefs(cns[0], ovd.defs, nvd.defs);\n // = i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinDef(nd[i]));\n }\n }\n}\n\nfunction diffDef(elem, od, nd) {\n if(od.tagName !== nd.tagName) {\n insertAdjacentHTML(elem, 'beforebegin', joinDef(nd));\n // elem.insertAdjacentHTML('beforebegin', joinDef(nd));\n elem.parentNode.removeChild(elem);\n }\n else {\n if(od.uuid !== nd.uuid) {\n elem.setAttribute('id', nd.uuid);\n }\n let op = {};\n for(let i = 0, len = (od.props || []).length; i < len; i++) {\n let prop = od.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nd.props || []).length; i < len; i++) {\n let prop = nd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n let cns = elem.childNodes;\n let ol = od.children.length;\n let nl = nd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, od.children[i], nd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nd.children[i]));\n }\n }\n }\n}\n\nfunction diffChild(elem, ovd, nvd) {\n if(ovd.type === 'dom') {\n if(nvd.type === 'dom') {\n diffD2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffD2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'text') {\n if(nvd.type === 'text') {\n diffT2T(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'geom') {\n if(nvd.type === 'dom') {\n diffG2D(elem, ovd, nvd);\n }\n else if(nvd.type === 'geom') {\n diffG2G(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n else if(ovd.type === 'img') {\n if(nvd.type === 'img') {\n diffItemSelf(elem, ovd, nvd);\n }\n else {\n replaceWith(elem, nvd);\n }\n }\n}\n\nfunction diffX2X(elem, ovd, nvd) {\n let { transform, opacity, visibility, mask, overflow, filter, mixBlendMode, conClip } = nvd;\n if(ovd.transform !== transform) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(ovd.opacity !== opacity) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(ovd.visibility !== visibility) {\n elem.setAttribute('visibility', visibility);\n }\n if(ovd.mask !== mask) {\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n }\n if(ovd.filter !== filter || ovd.mixBlendMode !== mixBlendMode) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('filter');\n }\n }\n // if(ovd.filter !== filter) {\n // if(filter) {\n // elem.setAttribute('filter', filter);\n // }\n // else {\n // elem.removeAttribute('filter');\n // }\n // }\n if(ovd.overflow !== overflow) {\n if(overflow) {\n elem.setAttribute('clipPath', overflow);\n }\n else {\n elem.removeAttribute('overflow');\n }\n }\n if(ovd.conClip !== conClip) {\n if(conClip) {\n elem.childNodes[1].setAttribute('clip-path', conClip);\n }\n else {\n elem.childNodes[1].removeAttribute('clip-path');\n }\n }\n}\n\nfunction diffByLessLv(elem, ovd, nvd, lv) {\n let { transform, opacity, mask, filter, mixBlendMode } = nvd;\n if(mask) {\n elem.setAttribute('mask', mask);\n }\n else {\n elem.removeAttribute('mask');\n }\n if(lv === NONE) {\n return;\n }\n if(contain(lv, TRANSFORM_ALL)) {\n if(transform) {\n elem.setAttribute('transform', transform);\n }\n else {\n elem.removeAttribute('transform');\n }\n }\n if(contain(lv, OPACITY)) {\n if(opacity !== 1 && opacity !== undefined) {\n elem.setAttribute('opacity', opacity);\n }\n else {\n elem.removeAttribute('opacity');\n }\n }\n if(contain(lv, FILTER) || contain(lv, MIX_BLEND_MODE)) {\n let s = (filter ? `filter:${filter};` : '') + (mixBlendMode ? `mix-blend-mode:${mixBlendMode};` : '');\n if(s) {\n elem.setAttribute('style', s);\n }\n else {\n elem.removeAttribute('style');\n }\n }\n}\n\nfunction diffD2D(elem, ovd, nvd, root) {\n // cache表明children无变化缓存,一定是REPAINT以下的,只需看自身的lv以及mask\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffD2G(elem, ovd, nvd) {\n diffX2X(elem, ovd, nvd);\n diffBb(elem.firstChild, ovd.bb, nvd.bb);\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n let lastChild = elem.lastChild;\n let cns = lastChild.childNodes;\n for(; i < Math.min(ol, nl); i++) {\n replaceWith(cns[i], nvd.children[i]);\n }\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffT2T(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let ol = ovd.children.length;\n let nl = nvd.children.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, ovd.children[i], nvd.children[i], true);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nvd.children[i]));\n }\n }\n}\n\nfunction diffG2D(elem, ovd, nvd) {\n diffD2G(elem, ovd, nvd);\n}\n\nfunction diffG2G(elem, ovd, nvd) {\n if(nvd.cache) {\n diffByLessLv(elem, ovd, nvd, nvd.lv);\n return;\n }\n // 无cache且= i; j--) {\n removeAt(lastChild, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(lastChild, cns, i, joinVd(nvd.children[i]));\n }\n }\n }\n}\n\nfunction diffBb(elem, obb, nbb) {\n let ol = obb.length;\n let nl = nbb.length;\n let i = 0;\n for(; i < Math.min(ol, nl); i++) {\n diffItem(elem, i, obb[i], nbb[i]);\n }\n let cns = elem.childNodes;\n if(i < ol) {\n for(let j = ol - 1; j >= i; j--) {\n removeAt(elem, cns, j);\n }\n }\n else if(i < nl) {\n for(; i < nl; i++) {\n insertAt(elem, cns, i, joinVd(nbb[i]));\n }\n }\n}\n\nfunction diffItem(elem, i, ovd, nvd, isText) {\n let cns = elem.childNodes;\n if(ovd.tagName !== nvd.tagName) {\n replaceWith(cns[i], nvd);\n }\n else {\n diffItemSelf(cns[i], ovd, nvd);\n if(isText && ovd.content !== nvd.content) {\n cns[i].innerHTML = nvd.content;\n }\n }\n}\n\nfunction diffItemSelf(elem, ovd, nvd) {\n if(nvd.cache) {\n return;\n }\n let op = {};\n for(let i = 0, len = (ovd.props || []).length; i < len; i++) {\n let prop = ovd.props[i];\n let [k, v] = prop;\n op[k] = v;\n }\n for(let i = 0, len = (nvd.props || []).length; i < len; i++) {\n let prop = nvd.props[i];\n let [k, v] = prop;\n // 已有不等更新,没有添加\n if(op.hasOwnProperty(k)) {\n if(op[k] !== v) {\n elem.setAttribute(k, v);\n }\n delete op[k];\n }\n else {\n elem.setAttribute(k, v);\n }\n }\n // 多余的删除\n Object.keys(op).forEach(i => {\n elem.removeAttribute(i);\n });\n}\n\nfunction replaceWith(elem, vd) {\n let res;\n if(Array.isArray(vd)) {\n res = '';\n vd.forEach(item => {\n res += joinVd(item);\n });\n }\n else {\n res = joinVd(vd);\n }\n insertAdjacentHTML(elem, 'beforebegin', res);\n // elem.insertAdjacentHTML('beforebegin', res);\n elem.parentNode.removeChild(elem);\n}\n\nfunction insertAt(elem, cns, index, html) {\n if(index >= cns.length) {\n insertAdjacentHTML(elem, 'beforeend', html);\n // elem.insertAdjacentHTML('beforeend', html);\n }\n else {\n insertAdjacentHTML(cns[index], 'beforebegin', html);\n // cns[index].insertAdjacentHTML('beforebegin', html);\n }\n}\n\nfunction removeAt(elem, cns, index) {\n if(cns[index]) {\n elem.removeChild(cns[index]);\n }\n}\n\nlet svg;\nfunction insertAdjacentHTML(elem, where, content) {\n if(elem.insertAdjacentHTML) {\n elem.insertAdjacentHTML(where, content);\n }\n else {\n switch(where) {\n case 'beforeend':\n elem.innerHTML += content;\n break;\n case 'beforebegin':\n svg = svg || document.createElement('svg');\n svg.innerHTML = content;\n elem.parentNode.insertBefore(svg.childNodes[0], elem);\n break;\n }\n }\n}\n\nexport default diff;\n","import util from '../util/util';\n\nconst { isFunction } = util;\n\nclass Controller {\n constructor() {\n this.__records = []; // 默认记录和自动记录\n this.__records2 = []; // 非自动播放的动画记录\n this.__list = [] // 默认初始化播放列表,自动播放也存这里\n this.__list2 = []; // json中autoPlay为false的初始化存入这里\n this.__onList = []; // list中已存在的侦听事件,list2初始化时也需要增加上\n this.__lastTime = {}; // 每个类型的上次触发时间,防止重复emit\n }\n\n add(v, list = this.list) {\n if(list.indexOf(v) === -1) {\n list.push(v);\n }\n }\n\n remove(v) {\n let i = this.list.indexOf(v);\n if(i > -1) {\n this.list.splice(i, 1);\n }\n }\n\n __destroy() {\n this.__records = [];\n this.__records2 = [];\n this.__list = [];\n this.__list2 = [];\n }\n\n __action(k, args) {\n this.list.forEach(item => {\n item[k].apply(item, args);\n });\n }\n\n init(records = this.__records, list = this.list) {\n // 检查尚未初始化的record,并初始化,后面才能调用各种控制方法\n if(records.length) {\n // 清除防止重复调用,并且新的json还会进入整体逻辑\n records.splice(0).forEach(item => {\n let { target, animate } = item;\n if(target.isDestroyed) {\n return;\n }\n if(Array.isArray(animate)) {\n animate.forEach(animate => {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n });\n }\n else {\n let { value, options } = animate;\n options.autoPlay = false;\n let o = target.animate(value, options);\n this.add(o, list);\n }\n });\n }\n // 非自动播放后初始化需检测事件,给非自动播放添加上,并清空本次\n if(records === this.__records2) {\n let onList = this.__onList;\n let list2 = this.list2;\n if(list2.length && onList.length) {\n list2.forEach(item => {\n onList.forEach(arr => {\n item.off(arr[0], arr[1]);\n item.on(arr[0], arr[1]);\n });\n });\n }\n }\n }\n\n __playAuto() {\n this.init();\n this.__action('play');\n }\n\n play(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('play', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n pause() {\n this.__action('pause');\n }\n\n resume(cb) {\n let once = true;\n this.__action('resume', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n __mergeAuto() {\n this.init();\n this.init(this.__records2);\n if(this.__list2.length) {\n this.__list = this.__list.concat(this.__list2);\n this.__list2 = [];\n }\n }\n\n cancel(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('cancel', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n finish(cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('finish', [cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndStop(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('gotoAndStop', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n gotoAndPlay(v, options, cb) {\n this.__mergeAuto();\n this.__onList = [];\n let once = true;\n this.__action('gotoAndPlay', [v, options, cb && function(diff) {\n if(once) {\n once = false;\n if(isFunction(cb)) {\n cb(diff);\n }\n }\n }]);\n }\n\n on(id, handle) {\n if(!isFunction(handle)) {\n return;\n }\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.__on(id[i], handle);\n }\n this.__onList.push([id, handle]);\n }\n else {\n this.__on(id, handle);\n this.__onList.push([id, handle]);\n }\n }\n\n __on(id, handle) {\n this.list.forEach(item => {\n let cb = () => {\n let time = item.timestamp;\n if(time !== this.__lastTime[id]) {\n this.__lastTime[id] = time;\n handle();\n }\n };\n cb.__karasEventCb = handle;\n item.on(id, cb);\n });\n }\n\n off(id, handle) {\n if(Array.isArray(id)) {\n for(let i = 0, len = id.length; i < len; i++) {\n this.off(id[i], handle);\n }\n }\n else {\n this.list.forEach(item => {\n item.off(id, handle);\n });\n }\n }\n\n get list() {\n return this.__list;\n }\n\n get list2() {\n return this.__list2;\n }\n\n __set(key, value) {\n this.list.forEach(item => {\n item[key] = value;\n });\n }\n\n set playbackRate(v) {\n this.__set('playbackRate', v);\n }\n\n set iterations(v) {\n this.__set('iterations', v);\n }\n\n set playCount(v) {\n this.__set('playCount', v);\n }\n\n set fps(v) {\n this.__set('fps', v);\n }\n\n set currentTime(v) {\n this.__set('currentTime', v);\n }\n\n set spfLimit(v) {\n this.__set('spfLimit', v);\n }\n\n set delay(v) {\n this.__set('delay', v);\n }\n\n set endDelay(v) {\n this.__set('endDelay', v);\n }\n\n set fill(v) {\n this.__set('fill', v);\n }\n\n set direction(v) {\n this.__set('direction', v);\n }\n}\n\nexport default Controller;\n","import 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 Geom from '../node/geom/Geom';\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;\n }\n // 局部根节点如有perspective,则计算pm,这里不会出现嵌套,因为每个出现都会生成局部根节点\n let pm;\n if(perspective) {\n pm = tf.calPerspectiveMatrix(perspective, perspectiveOrigin);\n }\n // 广度遍历,不断一层层循环下去,用2个hash暂存每层的父matrix和opacity,blur只需记住顶层,因为子的如果有一定是cacheFilter\n let list = [index];\n let d = 0;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur') {\n d = blur.outerSize(v);\n }\n });\n opacityHash[index] = 1;\n // opacity可以保存下来层级相乘结果供外部使用,但matrix不可以,因为这里按画布原点为坐标系计算,外部合并局部根节点以bbox左上角为原点\n let matrixHash = {};\n while(list.length) {\n let arr = list.splice(0);\n for(let i = 0, len = arr.length; i < len; i++) {\n let parentIndex = arr[i];\n let total = __structs[parentIndex][STRUCT_TOTAL] || 0;\n for(let i = parentIndex + 1, len = parentIndex + total + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node2,\n [STRUCT_TOTAL]: total,\n } = __structs[i];\n // mask也不占bbox位置\n if(node2.isMask) {\n continue;\n }\n let {\n __sx1,\n __sy1,\n __config: {\n [NODE_LIMIT_CACHE]: limitCache,\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [OPACITY]: opacity,\n },\n },\n } = node2;\n // webgl不能跳过超限\n if(limitCache && !includeLimitCache) {\n return;\n }\n // display:none跳过整个节点树,visibility只跳过自身\n if(display === 'none') {\n i += total || 0;\n continue;\n }\n if(visibility === 'hidden') {\n continue;\n }\n parentIndexHash[i] = parentIndex;\n opacityHash[i] = opacityHash[parentIndex] * opacity;\n // 防止text的情况,其一定属于某个node,其bbox被计算过,text不应该计算\n if(node2 instanceof Text) {\n continue;\n }\n let bbox, dx = 0, dy = 0, hasTotal;\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal]);\n if(target) {\n bbox = target.bbox.slice(0);\n dx = target.dbx;\n dy = target.dby;\n i += total || 0;\n hasTotal = true;\n }\n else if(__cache && __cache.available) {\n bbox = __cache.bbox.slice(0);\n dx = __cache.dbx;\n dy = __cache.dby;\n }\n else {\n bbox = node2.bbox;\n }\n // 可能Xom没有内容\n if(bbox) {\n bbox[0] -= sx1;\n bbox[1] -= sy1;\n bbox[2] -= sx1;\n bbox[3] -= sy1;\n let matrix = matrixHash[parentIndex];\n // 父级matrix初始化E为null,自身不为E时才运算,可以加速\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n tfo[0] += __sx1 - sx1 + dx;\n tfo[1] += __sy1 - sy1 + dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(pm) {\n matrix = multiply(pm, matrix);\n }\n bbox = 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);\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);\n texCache.refresh(gl, cx, cy);\n c.ctx.setTransform(1, 0, 0, 1, 0, 0);\n c.ctx.globalAlpha = 1;\n c.ctx.clearRect(0, 0, width, height);\n mockCache.release();\n texCache.releaseLockChannel(j);\n }\n // 因为cacheTotal不总是以左上角原点为开始,所以必须每个节点重算matrix,合并box时计算的无法用到\n let matrixHash = {};\n // 先序遍历汇总到total\n for(let i = index + 1, len = index + (total || 0) + 1; i < len; i++) {\n let {\n [STRUCT_NODE]: node,\n [STRUCT_TOTAL]: total,\n [STRUCT_HAS_MASK]: hasMask,\n } = __structs[i];\n let __config = node.__config;\n let parentIndex = parentIndexHash[i];\n let matrix = matrixHash[parentIndex]; // 父节点的在每个节点计算后保存,第一个为top的默认为E(空)\n let opacity = opacityHash[i]; // opacity在合并box时已经计算可以直接用\n // 先看text,visibility会在内部判断,display会被parent判断\n if(node instanceof Text) {\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n texCache.addTexAndDrawWhenLimit(gl, __config[NODE_CACHE], opacity, matrix, cx, cy, dx, dy);\n }\n // 再看total缓存/cache,都没有的是无内容的Xom节点\n else {\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n [NODE_IS_MASK]: isMask,\n [NODE_COMPUTED_STYLE]: {\n [DISPLAY]: display,\n [VISIBILITY]: visibility,\n [TRANSFORM]: transform,\n [TRANSFORM_ORIGIN]: transformOrigin,\n [MIX_BLEND_MODE]: mixBlendMode,\n },\n } = __config;\n if(display === 'none') {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n continue;\n }\n // mask和不可见不能被汇总到top上\n if(visibility === 'hidden' || isMask) {\n continue;\n }\n if(transform && !isE(transform)) {\n let tfo = transformOrigin.slice(0);\n // total下的节点tfo的计算,以total为原点,差值坐标即相对坐标\n if(__cache && __cache.available) {\n tfo[0] += __cache.sx1;\n tfo[1] += __cache.sy1;\n }\n else {\n tfo[0] += node.__sx1;\n tfo[1] += node.__sy1;\n }\n let dx = -sx1 + dbx;\n let dy = -sy1 + dby;\n tfo[0] += dx;\n tfo[1] += dy;\n let m = tf.calMatrixByOrigin(transform, tfo);\n if(matrix) {\n matrix = multiply(matrix, m);\n }\n else {\n matrix = m;\n }\n }\n if(matrix) {\n matrixHash[i] = matrix;\n }\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n let target = getCache([__cacheMask, __cacheFilter, __cacheOverflow, __cacheTotal, __cache]);\n if(target) {\n // 局部的mbm和主画布一样,先刷新当前fbo,然后把后面这个mbm节点绘入一个新的等画布尺寸的fbo中,再进行2者mbm合成\n if(isValidMbm(mixBlendMode)) {\n texCache.refresh(gl, cx, cy);\n let [n2, frameBuffer2, texture2] = genFrameBufferWithTexture(gl, texCache, width, height);\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy);\n texCache.refresh(gl, cx, cy);\n // 合成结果作为当前frameBuffer,以及纹理和单元,等于替代了当前fbo作为绘制对象\n [n, frameBuffer, texture] = genMbmWebgl(gl, texCache, n, n2, frameBuffer, texture, mbmName(mixBlendMode), width, height);\n gl.deleteFramebuffer(frameBuffer2);\n gl.deleteTexture(texture2);\n }\n else {\n texCache.addTexAndDrawWhenLimit(gl, target, opacity, matrix, cx, cy, dx, dy);\n }\n if(target !== __cache) {\n i += (total || 0) + countMaskNum(__structs, i + (total || 0) + 1, hasMask || 0);\n }\n }\n }\n }\n // 绘制到fbo的纹理对象上并删除fbo恢复\n texCache.refresh(gl, cx, cy);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 生成的纹理对象本身已绑定一个纹理单元了,释放lock的同时可以给texCache的channel缓存,避免重复上传\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bboxTotal);\n texCache.releaseLockChannel(n, mockCache.page);\n return [limitCache || totalLimitCache, mockCache];\n}\n\nfunction genFilterWebgl(gl, texCache, node, cache, filter, W, H) {\n let { sx1, sy1, width, height, bbox } = cache;\n let mockCache = cache;\n filter.forEach(item => {\n let [k, v] = item;\n if(k === 'blur' && v > 0) {\n let res = genBlurWebgl(gl, texCache, mockCache, v, width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'hue-rotate') {\n let rotation = geom.d2r(v % 360);\n let cosR = Math.cos(rotation);\n let sinR = Math.sin(rotation);\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + cosR * 0.787 - sinR * 0.213, 0.715 - cosR * 0.715 - sinR * 0.715, 0.072 - cosR * 0.072 + sinR * 0.928, 0, 0,\n 0.213 - cosR * 0.213 + sinR * 0.143, 0.715 + cosR * 0.285 + sinR * 0.140, 0.072 - cosR * 0.072 - sinR * 0.283, 0, 0,\n 0.213 - cosR * 0.213 - sinR * 0.787, 0.715 - cosR * 0.715 + sinR * 0.715, 0.072 + cosR * 0.928 + sinR * 0.072, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'saturate' && v !== 100) {\n let amount = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.213 + 0.787 * amount, 0.715 - 0.715 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 + 0.285 * amount, 0.072 - 0.072 * amount, 0, 0,\n 0.213 - 0.213 * amount, 0.715 - 0.715 * amount, 0.072 + 0.928 * amount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'brightness' && v !== 100) {\n let b = v * 0.01;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'grayscale' && v > 0) {\n let oneMinusAmount = 1 - v * 0.01;\n if(oneMinusAmount < 0) {\n oneMinusAmount = 0;\n }\n else if(oneMinusAmount > 1) {\n oneMinusAmount = 1;\n }\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n 0.2126 + 0.7874 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 + 0.2848 * oneMinusAmount, 0.0722 - 0.0722 * oneMinusAmount, 0, 0,\n 0.2126 - 0.2126 * oneMinusAmount, 0.7152 - 0.7152 * oneMinusAmount, 0.0722 + 0.9278 * oneMinusAmount, 0, 0,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n else if(k === 'contrast' && v !== 100) {\n let amount = v * 0.01;\n let o = -0.5 * amount;\n let res = genColorMatrixWebgl(gl, texCache, mockCache, [\n amount, 0, 0, 0, o,\n 0, amount, 0, 0, o,\n 0, 0, amount, 0, o,\n 0, 0, 0, 1, 0,\n ], width, height, sx1, sy1, bbox);\n if(res) {\n [mockCache, width, height, bbox] = res;\n }\n }\n });\n // 切换回主程序\n gl.useProgram(gl.program);\n gl.viewport(0, 0, W, H);\n return mockCache;\n}\n\n/**\n * https://www.w3.org/TR/2018/WD-filter-effects-1-20181218/#feGaussianBlurElement\n * 根据cacheTotal生成cacheFilter,按照css规范的优化方法执行3次,避免卷积核d扩大3倍性能慢\n * 规范的优化方法对d的值分奇偶优化,这里再次简化,d一定是奇数,即卷积核大小\n * 先动态生成gl程序,默认3核源码示例已注释,根据sigma获得d(一定奇数),再计算权重\n * 然后将d尺寸和权重拼接成真正程序并编译成program,再开始绘制\n */\nfunction genBlurWebgl(gl, texCache, cache, sigma, width, height, sx1, sy1, bbox) {\n let d = blur.kernelSize(sigma);\n let max = Math.max(15, gl.getParameter(gl.MAX_VARYING_VECTORS));\n while(d > max) {\n d -= 2;\n }\n let spread = blur.outerSizeByD(d);\n width += spread * 2;\n height += spread * 2;\n // 防止超限,webgl最大纹理尺寸限制\n let limit = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n if(width > limit || height > limit) {\n return;\n }\n bbox = bbox.slice(0);\n bbox[0] -= spread;\n bbox[1] -= spread;\n bbox[2] += spread;\n bbox[3] += spread;\n let cx = width * 0.5, cy = height * 0.5;\n let weights = blur.gaussianWeight(sigma, d);\n let vert = '';\n let frag = '';\n let r = Math.floor(d * 0.5);\n for(let i = 0; i < r; i++) {\n let c = (r - i) * 0.01;\n vert += `\\nv_texCoordsBlur[${i}] = a_texCoords + vec2(-${c}, -${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i}]) * ${weights[i]};`;\n }\n vert += `\\nv_texCoordsBlur[${r}] = a_texCoords;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${r}]) * ${weights[r]};`;\n for(let i = 0; i < r; i++) {\n let c = (i + 1) * 0.01;\n vert += `\\nv_texCoordsBlur[${i + r + 1}] = a_texCoords + vec2(${c}, ${c}) * u_direction;`;\n frag += `\\ngl_FragColor += texture2D(u_texture, v_texCoordsBlur[${i + r + 1}]) * ${weights[i + r + 1]};`;\n }\n vert = vertexBlur.replace('[3]', '[' + d + ']').replace(/}$/, vert + '}');\n frag = fragmentBlur.replace('[3]', '[' + d + ']').replace(/}$/, frag + '}');\n let program = webgl.initShaders(gl, vert, frag);\n gl.useProgram(program);\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n texture = webgl.drawBlur(gl, program, frameBuffer, texCache, texture, cache.page.texture, i, j,\n width, height, cx, cy, spread, d, sigma);\n // 销毁这个临时program\n gl.deleteShader(program.vertexShader);\n gl.deleteShader(program.fragmentShader);\n gl.deleteProgram(program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n texCache.releaseLockChannel(j);\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox);\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genColorMatrixWebgl(gl, texCache, cache, m, width, height, sx1, sy1, bbox) {\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n gl.useProgram(gl.programCm);\n webgl.drawCm(gl, gl.programCm, j, m);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let mockCache = new MockCache(gl, texture, sx1, sy1, width, height, bbox.slice(0));\n texCache.releaseLockChannel(i, mockCache.page);\n return [mockCache, width, height, bbox];\n}\n\nfunction genOverflowWebgl(gl, texCache, node, cache, W, H) {\n let sbox = node.bbox.slice(0);\n let bbox = cache.bbox;\n // 没超过无需生成\n if(bbox[0] >= sbox[0] && bbox[1] >= sbox[1] && bbox[2] <= sbox[2] && bbox[3] <= sbox[3]) {\n return;\n }\n let width = sbox[2] - sbox[0], height = sbox[3] - sbox[1];\n // 生成最终纹理,尺寸为被遮罩节点大小\n let [i, frameBuffer, texture] = genFrameBufferWithTexture(gl, texCache, width, height);\n // 将本身total的page纹理放入一个单元,一般刚生成已经在了,少部分情况变更引发的可能不在\n let j = texCache.findExistTexChannel(cache.page);\n if(j === -1) {\n // 直接绑定,因为一定是个mockCache\n j = texCache.lockOneChannel();\n webgl.bindTexture(gl, cache.page.texture, j);\n }\n else {\n texCache.lockChannel(j);\n }\n // 绘制,根据坐标裁剪使用原本纹理的一部分\n gl.useProgram(gl.programOverflow);\n webgl.drawOverflow(gl, j, sbox[0] - bbox[0], sbox[1] - bbox[1], width, height, cache.width, cache.height);\n texCache.releaseLockChannel(j);\n // 切回\n gl.useProgram(gl.program);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.viewport(0, 0, W, H);\n gl.deleteFramebuffer(frameBuffer);\n // 同total一样生成一个mockCache\n let overflowCache = new MockCache(gl, texture, cache.sx1, cache.sy1, width, height, sbox);\n texCache.releaseLockChannel(i, overflowCache.page);\n return overflowCache;\n}\n\nfunction genMaskWebgl(gl, texCache, node, __config, cache, W, H, 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);console.log(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 // 恶心的v8性能优化\n let m = __config[NODE_MATRIX];\n assignMatrix(m, matrix);\n }\n else {\n matrix = __config[NODE_MATRIX];\n }\n // node本身有或者父有perspective都认为需要生成3d渲染上下文\n if(tf.isPerspectiveMatrix(matrix) || parentPm) {\n if(hasRecordAsMask) {\n hasRecordAsMask[9] = true;\n }\n else {\n hasRecordAsMask = [i, lv, total, node, __config, null, null, null, null, true];\n }\n }\n // 先左乘perspective的矩阵,再左乘父级的总矩阵\n if(parentPm) {\n matrix = multiply(parentPm, matrix);\n }\n if(parentMatrix) {\n matrix = multiply(parentMatrix, matrix);\n }\n // 恶心的v8性能优化\n 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 }\n else {\n mergeList.push([i, lv, total, node, __config, limitCache, hasMask, filter, overflow, isPerspective]);\n }\n }\n }\n let limitHash = {};\n // 根据收集的需要合并局部根的索引,尝试合并,按照层级从大到小,索引从大到小的顺序,\n // 这样保证子节点在前,后节点在前,后节点是为了mask先应用自身如filter之后再进行遮罩\n if(mergeList.length) {\n mergeList.sort(function(a, b) {\n if(a[1] === b[1]) {\n return b[0] - a[0];\n }\n return b[1] - a[1];\n });\n mergeList.forEach(item => {\n let [i, lv, total, node, __config, limitCache, hasMask, filter, overflow] = item;\n let {\n [NODE_CACHE]: __cache,\n [NODE_CACHE_TOTAL]: __cacheTotal,\n [NODE_CACHE_FILTER]: __cacheFilter,\n [NODE_CACHE_MASK]: __cacheMask,\n [NODE_CACHE_OVERFLOW]: __cacheOverflow,\n } = __config;\n let needGen;\n // 可能没变化,比如被遮罩节点、filter变更等\n if(!__cacheTotal || !__cacheTotal.available) {\n let [limit, res] = genTotalWebgl(gl, texCache, node, __config, i, total || 0, __structs, __cache, limitCache, 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 target = genOverflowWebgl(gl, texCache, node, target, width, height);\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n if(filter.length) {\n if(!__cacheFilter || !__cacheFilter.available || needGen) {\n let old = target;\n target = genFilterWebgl(gl, texCache, node, target, filter, width, height);\n if(target !== old) {\n needGen = true;\n if(!limitCache) {\n __config[NODE_CACHE_FILTER] = target;\n }\n }\n }\n }\n if(hasMask && (!__cacheMask || !__cacheMask.available || needGen)) {\n target = genMaskWebgl(gl, texCache, node, __config, target, width, height, 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 m = mx.m2Mat4(matrixEvent, cx, cy);\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 }\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[0] !== page || page.update) {\n // page可能为一个已有纹理,或者贴图\n if(page instanceof MockPage) {\n webgl.bindTexture(gl, page.texture, i);\n channels[i] = page;\n }\n else {\n // 可能老的先删除\n if(last) {\n gl.deleteTexture(last.texture);\n }\n page.texture = webgl.createTexture(gl, page.canvas, i);\n channels[i] = page;\n }\n hash[page.uuid] = i;\n }\n else {\n hash[page.uuid] = i;\n }\n // 标识没有更新,以及最后使用时间\n page.update = false;\n page.time = inject.now();\n }\n // 再次遍历开始本次渲染并清空\n webgl.drawTextureCache(gl, list, hash, cx, cy, revertY);\n pages.splice(0);\n list.splice(0);\n }\n }\n\n findExistTexChannel(page) {\n return this.channels.indexOf(page);\n }\n\n /**\n * 获取并锁定一个纹理单元优先使用空的,其次最久未使用的\n * @returns {number|*}\n */\n lockOneChannel() {\n // 优先返回空单元\n let channels = this.channels;\n let locks = this.locks;\n for(let i = 0; i < this.__units; i++) {\n if(!channels[i] && !locks[i]) {\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n }\n // 根据NRU返回最久未使用的\n let units = this.__units;\n let cl = [];\n for(let i = 0; i < units; i++) {\n if(!locks[i]) {\n cl.push([i, channels[i]]);\n }\n }\n if(cl.length) {\n cl.sort(function(a, b) {\n if(a[1].time !== b[1].time) {\n return (a[1].time || 0) - (b[1].time || 0);\n }\n if(a[1].fullSize !== b[1].fullSize) {\n return a[1].fullSize - b[1].fullSize;\n }\n return a[0] - b[0];\n });\n let i = cl[0][0];\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n return i;\n }\n throw new Error('No free texture unit');\n }\n\n /**\n * 释放掉i单元,并且设置内容到缓存channel中\n * @param i\n * @param setToChannel\n */\n releaseLockChannel(i, setToChannel) {\n if(this.locks[i]) {\n this.locks[i] = false;\n this.__lockUnits--;\n if(setToChannel) {\n this.channels[i] = setToChannel;\n }\n }\n }\n\n // 指定锁定一个单元\n lockChannel(i) {\n let channels = this.channels;\n let locks = this.locks;\n if(!locks[i]) {\n channels[i] = null;\n locks[i] = true;\n this.__lockUnits++;\n }\n }\n\n /**\n * 释放纹理单元\n * @param gl\n */\n release(gl) {\n this.channels.forEach(item => {\n if(item) {\n gl.deleteTexture(item.texture);\n }\n });\n }\n\n get channels() {\n return this.__channels;\n }\n\n get locks() {\n return this.__locks;\n }\n\n 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 // 只有canvas有ctx,svg用真实dom\n if(this.tagName === 'canvas') {\n this.__ctx = this.__dom.getContext('2d');\n this.__renderMode = mode.CANVAS;\n }\n else if(this.tagName === 'svg') {\n this.__renderMode = mode.SVG;\n }\n else if(this.tagName === 'webgl') {\n let gl = this.__ctx = this.__dom.getContext('webgl', ca);\n this.__renderMode = mode.WEBGL;\n gl.program = webgl.initShaders(gl, vertex, fragment);\n gl.programMask = webgl.initShaders(gl, vertexMask, fragmentMask);\n gl.programClip = webgl.initShaders(gl, vertexMask, fragmentClip);\n gl.programOverflow = webgl.initShaders(gl, vertexMask, fragmentOverflow);\n gl.programCm = webgl.initShaders(gl, vertexCm, fragmentCm);\n gl.useProgram(gl.program);\n // 第一次渲染生成纹理缓存管理对象,收集渲染过程中生成的纹理并在gl纹理单元满了时进行绘制和清空,减少texImage2d耗时问题\n const MAX_TEXTURE_IMAGE_UNITS = Math.min(16, gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));\n this.__texCache = new TexCache(MAX_TEXTURE_IMAGE_UNITS);\n }\n this.refresh(null, true);\n // 第一次节点没有__root,渲染一次就有了才能diff\n if(this.dom.__root && this.dom.__root instanceof Root) {\n this.dom.__root.destroy();\n }\n this.__eventCbList = initEvent(this.dom, Root);\n this.dom.__root = this;\n }\n\n refresh(cb, isFirst) {\n this.__hookTask = null;\n let { isDestroyed, renderMode, ctx, defs, width, height } = this;\n if(isDestroyed) {\n return;\n }\n defs.clear();\n // 首次递归测量整树的继承,后续更改各自更新机制做,防止每次整树遍历;root检查首次直接做,后续在checkUpdate()中插入\n if(isFirst) {\n this.__checkRoot(renderMode, width, height);\n this.__computeMeasure(renderMode, ctx);\n }\n // 非首次刷新如果没有更新则无需继续\n else if(!this.__checkUpdate(renderMode, ctx, width, height)) {\n return;\n }\n // 获取所有字体和大小测量,仅svg需要,canvas直接做\n inject.measureText();\n this.__checkReflow(width, height);\n if(renderMode === mode.CANVAS && !this.props.noRender) {\n this.__clear(ctx, renderMode);\n 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 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 let hasUpdate;\n // root更新特殊提前,因为有继承因素\n if(updateRoot) {\n root.__updateRoot = null;\n hasUpdate = parseUpdate(renderMode, root, updateRoot,\n reflowList, measureList, cacheHash, cacheList);\n // 此时做root检查,防止root出现继承等无效样式,或者发生resize()\n if(hasUpdate) {\n root.__checkRoot(renderMode, width, height);\n }\n }\n // 汇总处理每个节点,k是递增数字直接循环遍历\n let keys = Object.keys(updateHash);\n for(let i = 0, len = keys.length; i < len; i++) {\n let t = parseUpdate(renderMode, root, updateHash[keys[i]],\n reflowList, measureList, cacheHash, cacheList, zHash, zList);\n hasUpdate = hasUpdate || t;\n }\n // 先做一部分reset避免下面measureList干扰,cacheList的是专门收集新增的额外节点\n root.__reflowList = reflowList;\n uniqueUpdateId = 0;\n root.__updateHash = root.__config[NODE_UPDATE_HASH] = {};\n cacheList.forEach(__config => {\n delete __config[NODE_UNIQUE_UPDATE_ID];\n });\n // zIndex改变的汇总修改,防止重复操作\n zList.forEach(item => {\n if(item.hasOwnProperty('__uniqueZId')) {\n delete item.__uniqueZId;\n item.__updateStruct(root.__structs);\n }\n });\n /**\n * 遍历每项节点,计算测量信息,节点向上向下查找继承信息,如果parent也是继承,先计算parent的\n * 过程中可能会出现重复,因此节点上记录一个临时标防止重复递归\n */\n let measureHash = {};\n measureList.forEach(node => {\n let { __config:{ [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId, [NODE_DOM_PARENT]: parent } } = node;\n // 在root下的component变更时root会进入,但其没有__uniqueUpdateId\n if(node !== root) {\n if(measureHash.hasOwnProperty(__uniqueUpdateId)) {\n return;\n }\n measureHash[__uniqueUpdateId] = true;\n }\n let last = node;\n // 检查measure的属性是否是inherit,在root下的component变更时root会进入,但其没有__uniqueUpdateId\n // 另外dom标识表明有dom变更强制进入\n let isInherit = node !== root\n && (updateHash[__uniqueUpdateId][UPDATE_ADD_DOM]\n || change.isMeasureInherit(updateHash[__uniqueUpdateId][UPDATE_STYLE]));\n // 是inherit,需要向上查找,从顶部向下递归计算继承信息\n if(isInherit) {\n while(parent && parent !== root) {\n let { __config: {\n [NODE_UNIQUE_UPDATE_ID]: __uniqueUpdateId,\n }, currentStyle } = parent;\n let isInherit;\n if(parent.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n let style = updateHash[__uniqueUpdateId][UPDATE_STYLE];\n measureHash[__uniqueUpdateId] = true;\n let temp = change.measureInheritList(style);\n isInherit = !!temp.length;\n }\n else {\n isInherit = change.isMeasureInherit(currentStyle);\n }\n // 如果parent有inherit存入列表且继续向上,否则跳出循环\n if(isInherit) {\n last = parent;\n }\n else {\n break;\n }\n // 考虑component下的继续往上继承\n parent = parent.domParent;\n }\n }\n // 自顶向下查找inherit的,利用已有的方法+回调,当递归包含重复时标记防止重复\n last.__computeMeasure(renderMode, ctx, function(target) {\n if(target.__config.hasOwnProperty(NODE_UNIQUE_UPDATE_ID)) {\n measureHash[target.__config[NODE_UNIQUE_UPDATE_ID]] = true;\n }\n });\n });\n // 做完清空留待下次刷新重来\n for(let i = 0, len = keys.length; i < len; i++) {\n delete updateHash[keys[i]][UPDATE_CONFIG][NODE_UNIQUE_UPDATE_ID];\n }\n return hasUpdate;\n }\n\n /**\n * 除首次外每次刷新前检查reflow列表,计算需要reflow的节点局部重新布局\n * 当一个元素absolute不变时,其变化不会影响父元素和兄弟元素,直接自己重新局部LAYOUT包含子节点\n * 当absolute发生改变时,其变化会影响父和兄弟,视作父重新布局\n * 当inline变化时,视为其最近block/flex父变化\n * 当block变化时,往上查找最上层flex视为其变化,如不是则影响后面兄弟offset和父resize\n * 当flex变化时,往上查找最上层flex视为其变化,如不是则影响所有递归子节点layout和父resize\n * 以上3种情况向上查找时遇到absolute父均提前跳出,并标记absolute父LAYOUT\n * 上面所有情况即便结束还得额外看是否处于absolute中,是还是标记absolute重新布局\n * 当relative只变化left/top/right/bottom时,自己重新layout\n * 检测节点时记录影响的所有节点,最终形成一棵或n棵局部树\n * 需要重新布局的记作LAYOUT,被兄弟影响只需偏移的记作OFFSET,OFFSET可能会重复变为LAYOUT\n * 上述情况倘若发生包含重复,去掉子树,因子树视为被包含的重新布局\n * 如果有从root开始的,直接重新布局像首次那样即可\n * 如果非root,所有树根按先根顺序记录下来,依次执行局部布局\n * =========================\n * addDom比较特殊,是向已有节点中添加新的节点,检查影响与普通domDiff变化不同\n * @private\n */\n __checkReflow(width, height) {\n let { __reflowList: reflowList } = this;\n if(!reflowList.length) {\n return;\n }\n let root = this;\n let uniqueList = [];\n let hasRoot;\n __uniqueReflowId = 0;\n let reflowHash = {};\n // 遍历检查发生布局改变的节点列表,此时computedStyle还是老的,currentStyle是新的\n for(let i = 0, len = reflowList.length; i < len; i++) {\n let item = reflowList[i];\n let { node, component, addDom, removeDom } = item;\n // root提前跳出,完全重新布局\n if(node === this) {\n hasRoot = true;\n break;\n }\n // 添加时如果是cp则node取sr来布局\n if(addDom && node instanceof Component) {\n node = node.shadowRoot;\n }\n // 每个节点生成唯一的布局识别id存入hash防止重复\n if(!node.hasOwnProperty('__uniqueReflowId')) {\n node.__uniqueReflowId = __uniqueReflowId;\n reflowHash[__uniqueReflowId++] = item;\n }\n // 每个节点都向上检查影响,以及是否从root开始完全重新,remove特殊对待,影响父节点视为普通父节点relay\n if(checkInfluence(root, reflowHash, node, component, addDom)) {\n hasRoot = true;\n if(addDom) {\n this.__zIndexChildren = null;\n }\n break;\n }\n // remove的要特殊对待,因为提前删除了父子兄弟关系,下面deepScan不会出现\n else if(removeDom) {\n uniqueList.push(item);\n }\n }\n __uniqueReflowId = 0;\n this.__reflowList = [];\n // 有root提前跳出\n if(hasRoot) {\n reflow.clearUniqueReflowId(reflowHash);\n // 布局分为两步,普通流和定位流,互相递归\n this.__layout({\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n // 绝对布局需要从根开始保存相对坐标系的容器引用,并根据relative/absolute情况变更\n this.__layoutAbs(this, {\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n this.__structs = this.__structure(0, 0);\n return true;\n }\n /**\n * 修剪树,自顶向下深度遍历\n * LAYOUT节点作为局部根,其递归子节点无需重复任何操作,直接去重\n * OFFSET节点作为局部根,其递归子节点先执行任何操作,后续根节点再偏移一次\n */\n else {\n this.__deepScan(function(node, options) {\n if(node.hasOwnProperty('__uniqueReflowId')) {\n let o = reflowHash[node.__uniqueReflowId];\n options.uniqueList.push(o);\n // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行\n return true;\n }\n // reflowHash没有记录则无返回继续递归执行\n }, { uniqueList });\n /**\n * 按顺序执行列表即可,上层LAYOUT先执行且停止递归子节点,上层OFFSET后执行等子节点先LAYOUT/OFFSET\n * 同级按先后顺序排列,过程中记录diff在结束后进行structs更新\n * 这里要注意margin合并的逻辑,因为最终都是block(flex等同),需要进行合并\n * 在处理一个block时,先判断是否是空block,同时看后面紧邻的有没有在uniqueList的下一个\n * 单独空block处理、2个相邻的非block处理直接可以进行判断\n * 中间的空block(即非空block的下一个是空block,且下一个不是最后一个),先记录下来list,合并后一并offset\n * 合并margin和Dom的逻辑一样,抽离共有方法\n **/\n let diffList = [];\n let diffI = 0;\n let mergeOffsetList = [];\n let __uniqueMergeOffsetId = 0;\n uniqueList.forEach(item => {\n let { node, component, addDom, removeDom } = item;\n // 重新layout的w/h数据使用之前parent暂存的,x使用parent,y使用prev或者parent的\n let cps = node.computedStyle, cts = node.currentStyle;\n let zIndex = cps[Z_INDEX], position = cps[POSITION], display = cps[DISPLAY];\n let isLastAbs = position === 'absolute';\n let isNowAbs = cts[POSITION] === 'absolute';\n let isLastNone = display === 'none';\n let isNowNone = cts[DISPLAY] === 'none';\n // none不可见布局无效可以无视\n if(isLastNone && isNowNone) {\n return;\n }\n let parent = node.domParent;\n let { __layoutData: { x, y, h }, width, computedStyle } = parent;\n let current = node;\n // cp的shadowRoot要向上到cp本身,考虑高阶组件在内到真正的顶层cp\n if(current.isShadowRoot) {\n current = current.hostRoot;\n }\n // y使用prev或者parent的,首个节点无prev,prev要忽略absolute的和display:none的\n let ref = current.prev;\n let hasFlowPrev;\n while(ref) {\n if(ref instanceof Text\n || (ref.computedStyle[POSITION] !== 'absolute' && ref.computedStyle[DISPLAY] !== 'none')) {\n y = ref.y + ref.outerHeight;\n hasFlowPrev = true;\n break;\n }\n ref = ref.prev;\n }\n // 找不到prev以parent为基准,找到则增加自身,排除remove\n if(!removeDom) {\n if(!hasFlowPrev) {\n y += computedStyle[MARGIN_TOP] + computedStyle[BORDER_TOP_WIDTH] + computedStyle[PADDING_TOP];\n }\n x += computedStyle[MARGIN_LEFT] + computedStyle[BORDER_LEFT_WIDTH] + computedStyle[PADDING_LEFT];\n }\n // 找到最上层容器,如果是组件的子节点,以sr为container,sr本身往上找\n let container = node;\n // remove的节点本身无需再次布局\n if(!removeDom) {\n if(isNowAbs) {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n if(!container) {\n container = root;\n }\n // 由setState引发的要检查是cp自身还是更上层,如果cp被abs包含,那么node是cp的父亲,否则node是cp的sr\n // 而这种情况下传cp或node都一样,所以最终统一传node\n parent.__layoutAbs(container, null, node);\n // 优先判断dom变更\n if(addDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n return;\n }\n // 前后都是abs无需偏移后面兄弟和parent调整,component变化节点需更新struct\n else if(isLastAbs) {\n if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n }\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n return;\n }\n // 标识flow变abs,可能引发zIndex变更,重设struct和svg\n parent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // 现在是普通流,不管之前是啥直接布局,排除remove删除的\n else {\n node.__layout({\n x,\n y,\n w: width,\n h,\n });\n y += node.outerHeight;\n if(component) {\n container = node;\n }\n else {\n container = container.domParent;\n while(container && container !== root) {\n if(isRelativeOrAbsolute(container)) {\n break;\n }\n // 不能用domParent,必须在组件环境内\n if(container.parent) {\n container = container.parent;\n }\n else if(container.host) {\n break;\n }\n }\n }\n if(!container) {\n container = root;\n }\n // 防止geom\n if(node instanceof Dom) {\n node.__layoutAbs(container, {\n x,\n y,\n w: width,\n h,\n });\n }\n }\n }\n\n // 向上查找最近的parent是relative,需再次累加ox/oy,无需继续向上递归,因为parent已经递归包含了\n // 这样node重新布局后再次设置其使用parent的偏移\n let p = node;\n while(p && p !== root) {\n p = p.domParent;\n computedStyle = p.computedStyle;\n if(computedStyle[POSITION] === 'relative') {\n let { ox, oy } = p;\n ox && node.__offsetX(ox);\n oy && node.__offsetY(oy);\n break;\n }\n }\n\n // 向下调整next的flow位置,遇到重复LAYOUT的跳出等待其调用并处理其next,忽视掉abs,margin和abs在merge中做\n if(node.isShadowRoot) {\n node = node.hostRoot;\n }\n let next = node.next;\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n if(next.computedStyle[POSITION] === 'absolute') {\n next = next.next;\n continue;\n }\n let { y: oy } = next;\n let diff = y - oy;\n if(diff) {\n while(next && !next.hasOwnProperty('__uniqueReflowId')) {\n let target = next;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let cs = target.computedStyle;\n if(cs[POSITION] !== 'absolute' && cs[DISPLAY] !== 'none') {\n target.__offsetY(diff, true, REPAINT);\n }\n next = next.next;\n }\n }\n break;\n }\n\n // 去重防止abs并记录parent,整个结束后按先序顺序进行margin合并以及偏移,注意忽略有display:none变block同时为absolute的\n if(!parent.hasOwnProperty('__uniqueMergeOffsetId') && !(isNowAbs && isLastNone)) {\n parent.__uniqueMergeOffsetId = __uniqueMergeOffsetId++;\n mergeOffsetList.push(parent);\n }\n\n // add和remove都需父节点重新生成struct,zIndexChildren已在对应api操作的before()侦听做了\n if(addDom || removeDom) {\n let arr = parent.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(parent);\n }\n }\n // component未知dom变化,所以强制重新struct,text则为其父节点,同时防止zIndex变更影响父节点\n else if(component) {\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n if((position !== cts[POSITION] && (position === 'static' || cts[POSITION] === 'static'))\n || zIndex !== cts[Z_INDEX]) {\n node.domParent.__updateStruct(root.__structs);\n if(this.renderMode === mode.SVG) {\n cleanSvgCache(node.domParent);\n }\n }\n }\n // display有none变化,重置struct和zIndexChildren\n else if(isLastNone || isNowNone) {\n node.__zIndexChildren = null;\n let arr = node.__modifyStruct(root, diffI);\n diffI += arr[1];\n diffList.push(arr);\n }\n });\n /**\n * mergeMargin后续调整,记录的是变更节点的父节点,因此每个节点内部直接遍历孩子进行\n * 由于保持先根遍历的顺序,因此会从最上最里的节点开始,先进行margin合并\n * 由于之前忽略掉abs节点,因此再检查直接abs是否要调整\n * 完成后对此父节点的后续兄弟节点进行调整,多次不会干扰影响\n * 然后继续往上循环,直到root结束\n */\n let inDirectAbsList = [];\n mergeOffsetList.forEach(parent => {\n delete parent.__uniqueMergeOffsetId;\n let flowChildren = parent.flowChildren, absChildren = parent.absChildren;\n let mergeMarginBottomList = [], mergeMarginTopList = [];\n let length = flowChildren.length, lastChild;\n let isStart, startIndex, startNode;\n // 遍历flow孩子,从开始变化的节点开始,看变化造成的影响,对其后面节点进行偏移,并统计总偏移量\n for(let i = 0; i < length; i++) {\n let item = flowChildren[i];\n if(item instanceof Component) {\n item = item.shadowRoot;\n }\n let isXom = item instanceof Xom;\n // 忽略掉前面没有变更的节点,不能合并\n if(!isStart && isXom) {\n if(item.hasOwnProperty('__uniqueReflowId')) {\n isStart = true;\n startIndex = i;\n startNode = item;\n }\n }\n // 开始变更的节点,至少不是第0个\n let cs = isXom && item.currentStyle;\n let isInline = isXom && cs[DISPLAY] === 'inline';\n let isInlineBlock = isXom && ['inlineBlock', 'inline-block'].indexOf(cs[DISPLAY]) > -1;\n lastChild = item;\n // 每次循环开始前,这次不是block的话,看之前遗留的,可能是以空block结束,需要特殊处理,单独一个空block也包含\n if((!isXom || isInline || isInlineBlock)) {\n if(mergeMarginBottomList.length && mergeMarginTopList.length && isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n mergeMarginTopList = [];\n mergeMarginBottomList = [];\n }\n // 和普通布局类似,只是不用重新布局只需处理合并margin再根据差值偏移\n if(isXom && !isInline) {\n let isNone = isXom && cs[DISPLAY] === 'none';\n let isEmptyBlock;\n if(!isNone && item.flowChildren && item.flowChildren.length === 0) {\n let {\n [MARGIN_TOP]: marginTop,\n [MARGIN_BOTTOM]: marginBottom,\n [PADDING_TOP]: paddingTop,\n [PADDING_BOTTOM]: paddingBottom,\n [HEIGHT]: height,\n [BORDER_TOP_WIDTH]: borderTopWidth,\n [BORDER_BOTTOM_WIDTH]: borderBottomWidth,\n } = item.computedStyle;\n // 无内容高度为0的空block特殊情况,记录2个margin下来等后续循环判断处理\n if(paddingTop <= 0 && paddingBottom <= 0 && height <= 0 && borderTopWidth <= 0 && borderBottomWidth <= 0) {\n mergeMarginBottomList.push(marginBottom);\n mergeMarginTopList.push(marginTop);\n isEmptyBlock = true;\n }\n }\n // 空block要留下轮循环看,除非是最后一个,非空本轮处理掉看是否要合并\n if(!isNone && !isEmptyBlock) {\n let { [MARGIN_TOP]: marginTop, [MARGIN_BOTTOM]: marginBottom } = item.computedStyle;\n // 有bottom值说明之前有紧邻的block,任意个甚至空block,自己有个top所以无需判断top\n // 如果是只有紧邻的2个非空block,也被包含在情况内,取上下各1合并\n if(mergeMarginBottomList.length) {\n mergeMarginTopList.push(marginTop);\n if(isStart) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n // 需要合并的情况,根据记录数和索引向上向下遍历节点设置偏移,同时设置总偏移量供父级使用\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n // 同时自己保存bottom,为后续block准备\n mergeMarginTopList = [];\n mergeMarginBottomList = [marginBottom];\n }\n // 最后一个空block当是正正和负负时要处理,正负在outHeight处理了结果是0,最后一个一定有不必判断isStart\n else if(i === length - 1) {\n let diff = reflow.getMergeMarginTB(mergeMarginTopList, mergeMarginBottomList);\n if(diff) {\n for(let j = Math.max(startIndex, i - mergeMarginBottomList.length + 1); j < length; j++) {\n flowChildren[j].__offsetY(diff, true, REPAINT);\n }\n }\n }\n }\n }\n // 先检查parent的尺寸是否发生了变化,从而决定是否调整next以及向上递归调整\n let cs = parent.currentStyle;\n let height = cs[HEIGHT];\n let isContainer = parent === root || parent.isShadowRoot || cs[POSITION] === 'absolute' || cs[POSITION] === 'relative';\n if(height[1] === AUTO && lastChild) {\n let oldH = parent.height + parent.computedStyle[PADDING_TOP];\n let nowH = lastChild.y + lastChild.outerHeight - parent.y;\n let diff = nowH - oldH;\n // 调整next以及非固定PX的abs,再递归向上\n if(diff) {\n parent.__resizeY(diff, REPAINT);\n let container;\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom, [HEIGHT]: height } = item.currentStyle;\n // 是容器,所有的都调整,不是容器,其偏移是上级parent的某一个,根据情况具体不同\n if(top[1] === AUTO) {\n if(bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n else if(bottom[1] === PX) {\n item.__offsetY(diff, true, REPAINT);\n }\n else if(bottom[1] === PERCENT) {\n let v = (1 - bottom[0] * 0.01) * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n else if(top[1] === PERCENT) {\n if(isContainer) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n // 非容器的特殊处理\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n if(container.currentStyle[HEIGHT][1] !== PX) {\n let v = top[0] * 0.01 * diff;\n item.__offsetY(v, true, REPAINT);\n }\n }\n }\n // 高度百分比需发生变化的重新布局,需要在容器内\n if(height[1] === PERCENT) {\n if(isContainer) {\n parent.__layoutAbs(parent, null, item);\n }\n // 不在容器内说明在上级,存入等结束后统一重新布局\n else {\n if(!container) {\n container = parent.domParent;\n while(container) {\n if(container === root || container.isShadowRoot) {\n break;\n }\n let cs = container.currentStyle;\n if(cs[POSITION] === 'absolute' || cs[POSITION] === 'relative') {\n break;\n }\n container = container.domParent;\n }\n }\n inDirectAbsList.push([parent, container, item]);\n }\n }\n }\n reflow.offsetAndResizeByNodeOnY(parent, root, reflowHash, diff, inDirectAbsList);\n return;\n }\n }\n // 没有diff变化或者固定尺寸,可能内部发生变化,调整AUTO的abs,不递归向上\n for(let i = 0, len = absChildren.length; i < len; i++) {\n let item = absChildren[i];\n let { [TOP]: top, [BOTTOM]: bottom } = item.currentStyle;\n if(top[1] === AUTO && bottom[1] === AUTO) {\n let prev = item.prev;\n while(prev) {\n let target = prev;\n if(target instanceof Component) {\n target = target.shadowRoot;\n }\n let isXom = target instanceof Xom;\n let cs = isXom && target.currentStyle;\n let isAbs = isXom && cs[POSITION] === 'absolute';\n if(!isAbs) {\n let y = target.y + target.outerHeight;\n let d = y - item.y;\n if(d) {\n item.__offsetY(d, true, REPAINT);\n }\n break;\n }\n prev = prev.prev;\n }\n }\n }\n });\n // merge过程中需要重新布局的abs\n inDirectAbsList.forEach(arr => {\n arr[0].__layoutAbs(arr[1], null, arr[2]);\n });\n\n // 调整因reflow造成的原struct数据索引数量偏差,纯zIndex的已经在repaint里面重新生成过了\n // 这里因为和update保持一致的顺序,因此一定是先根顺序且互不包含\n let diff = 0, lastIndex = 0, isFirst = true, structs = root.__structs;\n diffList.forEach(item => {\n let [ns, d] = item;\n // 第一个有变化的,及后面无论有无变化都需更新\n // 第1个变化区域无需更改前面一段\n if(isFirst) {\n isFirst = false;\n lastIndex = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1;\n diff += d;\n }\n // 第2+个变化区域看是否和前面一个相连,有不变的段则先偏移它,然后再偏移自己\n else {\n let j = ns[STRUCT_INDEX] + (ns[STRUCT_TOTAL] || 0) + 1 + diff;\n for(let i = lastIndex; i < j; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n lastIndex = j;\n diff += d;\n }\n });\n // 后面的要根据偏移量校正索引\n if(diff) {\n for(let i = lastIndex, len = structs.length; i < len; i++) {\n structs[i][STRUCT_INDEX] += diff;\n }\n }\n // 清除id\n reflow.clearUniqueReflowId(reflowHash);\n }\n }\n\n // 特殊覆盖方法,不需要super()计算自己,因为放在每次checkRoot()做过了\n __computeMeasure(renderMode, ctx) {\n css.computeMeasure(this, true);\n this.children.forEach(item => {\n item.__computeMeasure(renderMode, ctx);\n });\n }\n\n // 每个root拥有一个刷新hook,多个root塞到frame的__hookTask里\n // frame在所有的帧刷新逻辑执行后检查hook列表,进行root刷新操作\n __frameHook() {\n if(!this.__hookTask) {\n let r = this.__hookTask = (() => {\n this.refresh();\n });\n frame.__hookTask.push(r);\n }\n }\n\n __clear(ctx, renderMode) {\n if(renderMode === mode.CANVAS) {\n // 可能会调整宽高,所以每次清除用最大值\n this.__mw = Math.max(this.__mw, this.width);\n this.__mh = Math.max(this.__mh, this.height);\n // 清除前得恢复默认matrix,防止每次布局改变了属性\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, this.__mw, this.__mh);\n }\n else if(renderMode === mode.WEBGL) {\n ctx.clearColor(0, 0, 0, 0);\n ctx.clear(ctx.COLOR_BUFFER_BIT);\n }\n }\n\n get dom() {\n return this.__dom;\n }\n\n get uuid() {\n return this.__uuid;\n }\n\n get renderMode() {\n return this.__renderMode;\n }\n\n get ctx() {\n return this.__ctx;\n }\n\n get defs() {\n return this.__defs;\n }\n\n get taskUp() {\n return this.__taskUp;\n }\n\n get taskCp() {\n return this.__taskCp;\n }\n\n get ref() {\n return this.__ref;\n }\n\n get animateController() {\n return this.__animateController;\n }\n\n get texCache() {\n return this.__texCache;\n }\n}\n\nexport default Root;\n","import Geom from './Geom';\nimport mode from '../mode';\nimport painter from '../../util/painter';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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.length >= 2) {\n num++;\n }\n if(controlB.length >= 2) {\n num += 2;\n }\n return num;\n}\n\nfunction limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getNewPoint(x1, y1, x2, y2, controlA, controlB, num, start = 0, end = 1) {\n if(start > 0 || end < 1) {\n if(num === 3) {\n [[x1, y1], controlA, controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, controlB, [x2, y2]], start, end);\n }\n else if(num === 2) {\n [[x1, y1], controlB, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlB, [x2, y2]], start, end);\n }\n else if(num === 1) {\n [[x1, y1], controlA, [x2, y2]] = geom.sliceBezier2Both([[x1, y1], controlA, [x2, y2]], start, end);\n }\n else {\n let a = Math.abs(x1 - x2);\n let b = Math.abs(y1 - y2);\n x1 += a * start;\n y1 += b * start;\n x2 -= a * (1 - end);\n y2 -= b * (1 - end);\n }\n }\n return [x1, y1, x2, y2, controlA, controlB];\n}\n\nclass Line extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // x1,y1和x2,y2表明线段的首尾坐标,control表明控制点坐标\n if(this.isMulti) {\n this.__x1 = [0];\n this.__y1 = [0];\n this.__x2 = [1];\n this.__y2 = [1];\n this.__controlA = [[]];\n this.__controlB = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.x1)) {\n this.__x1 = props.x1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x1)) {\n this.__x1 = [parseFloat(props.x1) || 0];\n }\n if(Array.isArray(props.y1)) {\n this.__y1 = props.y1.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y1)) {\n this.__y1 = [parseFloat(props.y1) || 0];\n }\n if(Array.isArray(props.x2)) {\n this.__x2 = props.x2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.x2)) {\n this.__x2 = [parseFloat(props.x2) || 0];\n }\n if(Array.isArray(props.y2)) {\n this.__y2 = props.y2.map(i => parseFloat(i) || 0);\n }\n else if(!isNil(props.y2)) {\n this.__y2 = [parseFloat(props.y2) || 0];\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB.map(item => {\n if(Array.isArray(item)) {\n return item;\n }\n return [];\n });\n }\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__x1.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__x1.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__x1.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__x1.map(() => v);\n }\n }\n else {\n this.__x1 = this.__y1 = this.__start = 0;\n this.__x2 = this.__y2 = this.__end = 1;\n this.__controlA = [];\n this.__controlB = [];\n if(!isNil(props.x1)) {\n this.__x1 = parseFloat(props.x1) || 0;\n }\n if(!isNil(props.y1)) {\n this.__y1 = parseFloat(props.y1) || 0;\n }\n if(!isNil(props.x2)) {\n this.__x2 = parseFloat(props.x2) || 0;\n }\n if(!isNil(props.y2)) {\n this.__y2 = parseFloat(props.y2) || 0;\n }\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n if(Array.isArray(props.controlA)) {\n this.__controlA = props.controlA;\n }\n if(Array.isArray(props.controlB)) {\n this.__controlB = props.controlB;\n }\n }\n }\n\n buildCache(originX, originY, focus) {\n let { width, height, __cacheProps, isMulti } = this;\n let rebuild;\n ['x1', 'x2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originX, width, isMulti);\n }\n });\n ['y1', 'y2'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuild(this[k], originY, height, isMulti);\n }\n });\n ['controlA', 'controlB'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = reBuildC(this[k], originX, originY, width, height, isMulti);\n }\n });\n ['start', 'end'].forEach(k => {\n if(isNil(__cacheProps[k]) || focus) {\n rebuild = true;\n __cacheProps[k] = this[k];\n }\n });\n return rebuild;\n }\n\n render(renderMode, lv, ctx, cache, 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 },\n } = this;\n this.buildCache(originX, originY);\n let { x1, y1, x2, y2, controlA, controlB } = __cacheProps;\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n if(!isMulti) {\n x1 = [x1];\n x2 = [x2];\n y1 = [y1];\n y2 = [y2];\n controlA = [controlA];\n controlB = [controlB];\n }\n x1.forEach((xa, i) => {\n let ya = y1[i];\n let xb = x2[i];\n let yb = y2[i];\n let ca = controlA[i];\n let cb = controlB[i];\n if((isNil(ca) || ca.length < 2) && (isNil(cb) || cb.length < 2)) {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[0] = Math.min(bbox[0], xb - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[1] = Math.min(bbox[1], yb - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[2] = Math.max(bbox[2], xb + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n bbox[3] = Math.max(bbox[3], yb + oy);\n }\n else if(isNil(ca) || ca.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(isNil(cb) || cb.length < 2) {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n let bezierBox = geom.bboxBezier(xa, ya, ca[0], ca[1], cb[0], cb[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[0] = Math.min(bbox[0], bezierBox[2] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[1] = Math.min(bbox[1], bezierBox[3] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[0] + ox);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[1] + oy);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n });\n return bbox;\n }\n}\n\nexport default Line;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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 limitStartEnd(v) {\n if(v < 0) {\n v = 0;\n }\n else if(v > 1) {\n v = 1;\n }\n return v;\n}\n\nfunction getLength(list, isMulti) {\n let res = [];\n let total = 0;\n let increase = [];\n if(isMulti) {\n total = [];\n list.forEach(list => {\n let temp = getLength(list);\n res.push(temp.list);\n total.push(temp.total);\n increase.push([0].concat(temp.increase));\n });\n }\n else if(Array.isArray(list)) {\n total = 0;\n increase.push(0);\n let start = 0;\n for(let i = 0, len = list.length; i < len; i++) {\n let item = list[i];\n if(Array.isArray(item)) {\n start = i;\n break;\n }\n }\n let prev = list[start];\n for(let i = start + 1, len = list.length; i < len; i++) {\n let item = list[i];\n if(!Array.isArray(item)) {\n continue;\n }\n if(item.length === 2) {\n let a = Math.abs(item[0] - prev[0]);\n let b = Math.abs(item[1] - prev[1]);\n let c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n res.push(c);\n total += c;\n increase.push(total);\n prev = item;\n }\n else if(item.length === 4) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]]], 2);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[2], item[3]];\n }\n else if(item.length === 6) {\n let c = geom.bezierLength([prev, [item[0], item[1]], [item[2], item[3]], [item[4], item[5]]], 3);\n res.push(c);\n total += c;\n increase.push(total);\n prev = [item[4], item[5]];\n }\n }\n }\n return {\n list: res,\n total,\n increase,\n };\n}\n\nfunction getIndex(list, t, i, j) {\n if(i === j) {\n if(list[i] > t) {\n return i - 1;\n }\n return i;\n }\n let middle = i + ((j - i) >> 1);\n if(list[middle] === t) {\n return middle;\n }\n else if(list[middle] > t) {\n return getIndex(list, t, i, Math.max(middle - 1, i));\n }\n else {\n return getIndex(list, t, Math.min(middle + 1, j), j);\n }\n}\n\nfunction getNewList(list, len, start = 0, end = 1) {\n if(start === 0 && end === 1) {\n return list;\n }\n if(start >= end) {\n return [];\n }\n let i = 0, j = list.length - 1;\n if(start > 0) {\n i = getIndex(len.increase, start * len.total, i, j);\n }\n if(end < 1) {\n j = getIndex(len.increase, end * len.total, i, j);\n }\n list = util.clone(list);\n end *= len.total;\n let prePercent = 1;\n if(end > len.increase[j]) {\n let prev = list[j].slice(list[j].length - 2); // 最后2个点是x,y,前面是control\n let current = list[j + 1];\n let l = len.list[j];\n let diff = end - len.increase[j];\n let t = diff / l;\n prePercent = t;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[j + 1] = [current[1] - (1 - t) * a, current[1] - (1 - t) * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([prev, [current[0], current[1]], [current[2], current[3]], [current[4], current[5]]], t);\n list[j + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], res[3][0], res[3][1]];\n }\n }\n start *= len.total;\n if(start > len.increase[i]) {\n let prev = list[i].slice(list[i].length - 2);\n let current = list[i + 1];\n let l = len.list[i];\n // 同一条线段时如果有end裁剪,会影响start长度\n if(i === j && prePercent !== 1) {\n l *= prePercent;\n }\n let diff = start - len.increase[i];\n let t = diff / l;\n if(current.length === 2) {\n let a = Math.abs(current[0] - prev[0]);\n let b = Math.abs(current[1] - prev[1]);\n if(current[0] < prev[0]) {\n a = -a;\n }\n if(current[1] < prev[1]) {\n b = -b;\n }\n list[i] = [prev[0] + t * a, prev[1] + t * b];\n }\n else if(current.length === 4) {\n let res = geom.sliceBezier([[current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1]];\n }\n else if(current.length === 6) {\n let res = geom.sliceBezier([[current[4], current[5]], [current[2], current[3]], [current[0], current[1]], prev], 1 - t).reverse();\n list[i] = res[0];\n list[i + 1] = [res[1][0], res[1][1], res[2][0], res[2][1], current[4], current[5]];\n }\n }\n if(j < list.length - 2) {\n list = list.slice(0, j + 2);\n }\n if(i > 0) {\n list = list.slice(i);\n }\n return list;\n}\n\nclass Polyline extends Geom {\n constructor(tagName, props) {\n super(tagName, props);\n // 所有点的列表\n if(this.isMulti) {\n this.__points = [[]];\n this.__controls = [[]];\n this.__start = [0];\n this.__end = [1];\n if(Array.isArray(props.start)) {\n this.__start = props.start.map(i => limitStartEnd(parseFloat(i) || 0));\n for(let i = this.__start.length; i < this.__points.length; i++) {\n this.__start.push(0);\n }\n }\n else if(!isNil(props.start)) {\n let v = limitStartEnd(parseFloat(props.start) || 0);\n this.__start = this.__points.map(() => v);\n }\n if(Array.isArray(props.end)) {\n this.__end = props.end.map(i => {\n let v = parseFloat(i);\n if(isNaN(v)) {\n v = 1;\n }\n return limitStartEnd(v);\n });\n for(let i = this.__end.length; i < this.__points.length; i++) {\n this.__end.push(1);\n }\n }\n else if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n v = limitStartEnd(v);\n this.__end = this.__points.map(() => v);\n }\n }\n else {\n this.__points = [];\n // 控制点\n this.__controls = [];\n this.__start = 0;\n this.__end = 1;\n if(!isNil(props.start)) {\n this.__start = limitStartEnd(parseFloat(props.start) || 0);\n }\n if(!isNil(props.end)) {\n let v = parseFloat(props.end);\n if(isNaN(v)) {\n v = 1;\n }\n this.__end = limitStartEnd(v);\n }\n }\n if(Array.isArray(props.controls)) {\n this.__controls = props.controls;\n }\n if(Array.isArray(props.points)) {\n this.__points = props.points;\n }\n }\n\n __getPoints(originX, originY, width, height, points, isControl) {\n return points.map((item, i) => {\n if(!Array.isArray(item)) {\n return;\n }\n let len = item.length;\n if(isControl) {\n if(len !== 0 && len !== 2 && len !== 4) {\n return;\n }\n }\n else {\n if(len !== 0 && len !== 2) {\n return;\n }\n }\n let res = [];\n for(let i = 0; i < len; i++) {\n if(i % 2 === 0) {\n res.push(originX + item[i] * width);\n }\n else {\n res.push(originY + item[i] * height);\n }\n }\n return res;\n });\n }\n\n // 供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 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 },\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let { points, controls } = __cacheProps;\n if(!isMulti) {\n points = [points];\n controls = [controls];\n }\n points.forEach((pointList, i) => {\n if(!pointList || pointList.length < 2 || pointList[0].length < 2 || pointList[1].length < 2) {\n return;\n }\n let controlList = controls[i] || [];\n let [xa, ya] = pointList[0];\n for(let i = 1, len = pointList.length; i < len; i++) {\n let [xb, yb] = pointList[i];\n let c = controlList[i - 1];\n if(c && c.length === 4) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], c[2], c[3], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else if(c && c.length === 2) {\n let bezierBox = geom.bboxBezier(xa, ya, c[0], c[1], xb, yb);\n bbox[0] = Math.min(bbox[0], bezierBox[0] - ox);\n bbox[1] = Math.min(bbox[1], bezierBox[1] - oy);\n bbox[2] = Math.max(bbox[2], bezierBox[2] + ox);\n bbox[3] = Math.max(bbox[3], bezierBox[3] + oy);\n }\n else {\n bbox[0] = Math.min(bbox[0], xa - ox);\n bbox[1] = Math.min(bbox[1], ya - oy);\n bbox[2] = Math.max(bbox[2], xa + ox);\n bbox[3] = Math.max(bbox[3], ya + oy);\n }\n xa = xb;\n ya = yb;\n }\n });\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Polyline;\n","import Polyline from './Polyline';\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} } = 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Sector;\n","import Geom from './Geom';\nimport util from \"../../util/util\";\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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 }\n } = this;\n this.buildCache(originX, originY);\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n bbox[0] = Math.min(bbox[0], originX - ox);\n bbox[1] = Math.min(bbox[1], originY - oy);\n bbox[2] = Math.max(bbox[2], originX + width + ox);\n bbox[3] = Math.max(bbox[3], originY + height + oy);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Rect;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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));\n }\n else {\n __cacheProps.r = r * width * 0.5;\n __cacheProps.list = geom.ellipsePoints(cx, cy, __cacheProps.r);\n }\n }\n }\n\n render(renderMode, lv, ctx, cache, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let r = 0;\n if(isMulti) {\n let max = 0;\n __cacheProps.r.forEach(r => {\n max = Math.max(r, max);\n });\n r = max;\n }\n else {\n r = __cacheProps.r;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - r - ox;\n let xb = cx + r + ox;\n let ya = cy - r - oy;\n let yb = cy + r + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Circle;\n","import Geom from './Geom';\nimport util from '../../util/util';\nimport enums from '../../util/enums';\nimport geom from '../../math/geom';\nimport unit from '../../style/unit';\n\nconst { STYLE_KEY: {\n STROKE_WIDTH,\n BOX_SHADOW,\n FONT_SIZE,\n} } = enums;\nconst { isNil } = util;\nconst { REM, VW, VH, 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 }\n } = this;\n let cx = originX + width * 0.5;\n let cy = originY + height * 0.5;\n this.buildCache(cx, cy);\n let rx = 0, ry = 0;\n if(isMulti) {\n let mx = 0, my = 0;\n __cacheProps.rx.forEach((rx, i) => {\n mx = Math.max(rx, mx);\n my = Math.max(ry, __cacheProps.ry[i]);\n });\n rx = mx;\n ry = my;\n }\n else {\n rx = __cacheProps.rx;\n ry = __cacheProps.ry;\n }\n let bbox = super.bbox;\n let half = 0;\n strokeWidth.forEach(item => {\n if(item[1] === REM) {\n half = Math.max(item[0] * root.computedStyle[FONT_SIZE] * 0.5, half);\n }\n else if(item[1] === VW) {\n half = Math.max(item[0] * root.width * 0.01 * 0.5, half);\n }\n else if(item[1] === VH) {\n half = Math.max(item[0] * root.height * 0.01 * 0.5, half);\n }\n else if(item[1] === VMAX) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else if(item[1] === VMIN) {\n half = Math.max(item[0] * Math.max(root.width, root.height) * 0.01 * 0.5, half);\n }\n else {\n half = Math.max(item[0] * 0.5, half);\n }\n });\n half += 1;\n let [ox, oy] = this.__spreadBbox(boxShadow);\n ox += half;\n oy += half;\n let xa = cx - rx - ox;\n let xb = cx + rx + ox;\n let ya = cy - ry - oy;\n let yb = cy + ry + oy;\n bbox[0] = Math.min(bbox[0], xa);\n bbox[1] = Math.min(bbox[1], ya);\n bbox[2] = Math.max(bbox[2], xb);\n bbox[3] = Math.max(bbox[3], yb);\n this.__bbox = bbox;\n }\n return this.__bbox;\n }\n}\n\nexport default Ellipse;\n","import reset from '../style/reset';\n\nlet fullCssProperty = {\n skewX: 'kx',\n skewY: 'ky',\n transform: 'tf',\n fontSize: 'fz',\n offset: 'os',\n easing: 'e',\n filter: 'ft',\n boxShadow: 'bd',\n overflow: 'of',\n backgroundClip: 'bp',\n textOverflow: 'tof',\n flexWrap: 'fp',\n perspective: 'ppt',\n rotate3d: 'r3',\n};\n\nlet abbrCssProperty = {\n os: 'offset', // 非css属性不会被下面反向遍历插入,手动\n e: 'easing',\n};\n\nlet fullAnimate = {\n value: 'v',\n options: 'o',\n};\n\nlet abbrAnimate = {};\n\nlet fullAnimateOption = {\n duration: 'dt',\n delay: 'd',\n endDelay: 'ed',\n iterations: 'i',\n direction: 'dc',\n fill: 'f',\n fps: 'fp',\n playbackRate: 'p',\n spfLimit: 'sl',\n};\n\nlet abbrAnimateOption = {};\n\nreset.DOM_KEY_SET.concat(reset.GEOM_KEY_SET).forEach(k => {\n if(fullCssProperty.hasOwnProperty(k)) {\n abbrCssProperty[fullCssProperty[k]] = k;\n return;\n }\n let v = k.charAt(0) + k.replace(/[a-z]/g, '').toLowerCase();\n fullCssProperty[k] = v;\n abbrCssProperty[v] = k;\n});\n\nObject.keys(fullAnimate).forEach(k => {\n abbrAnimate[fullAnimate[k]] = k;\n});\n\nObject.keys(fullAnimateOption).forEach(k => {\n abbrAnimateOption[fullAnimateOption[k]] = k;\n});\n\nexport default {\n fullCssProperty,\n abbrCssProperty,\n fullAnimate,\n abbrAnimate,\n fullAnimateOption,\n abbrAnimateOption,\n};\n","import abbr from './abbr';\nimport Node from '../node/Node';\nimport Component from '../node/Component';\nimport $$type from '../util/$$type';\nimport util from '../util/util';\nimport inject from '../util/inject';\n\nconst { TYPE_VD, TYPE_GM, TYPE_CP } = $$type;\n\nlet { isNil, isFunction, isPrimitive, clone, extend } = util;\nlet { abbrCssProperty, abbrAnimateOption, abbrAnimate } = abbr;\n\n/**\n * 还原缩写到全称,涉及样式和动画属性\n * @param target 还原的对象\n * @param hash 缩写映射\n */\nfunction abbr2full(target, hash) {\n // 也许节点没写样式\n if(target) {\n Object.keys(target).forEach(k => {\n // var-attr格式特殊考虑,仅映射attr部分,var-还要保留\n if(k.indexOf('var-') === 0) {\n let k2 = k.slice(4);\n if(hash.hasOwnProperty(k2)) {\n let fk = hash[k2];\n target['var-' + fk] = target[k];\n // delete target[k];\n }\n }\n // 普通样式缩写还原\n else if(hash.hasOwnProperty(k)) {\n let fk = hash[k];\n target[fk] = target[k];\n // 删除以免二次解析\n delete target[k];\n }\n });\n }\n}\n\nfunction replaceVars(json, vars) {\n if(json && vars) {\n // 新版vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // 排除特殊的library\n if(Array.isArray(member) && member.length && member[0] !== 'library' && vars.hasOwnProperty(id)) {\n let target = json;\n for(let i = 0, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // undefined和null意义不同\n if(v === undefined) {\n return;\n }\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n target[k] = v;\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Slot miss ' + k);\n return;\n }\n }\n }\n });\n }\n }\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-') === 0) {\n let v = json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(4);\n // 有id且变量里面传入了替换的值,值可为null,因为某些情况下空为自动\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n // undefined和null意义不同\n if(value === undefined) {\n return;\n }\n let target = json;\n // 如果有.则特殊处理子属性\n if(k2.indexOf('.') > -1) {\n let list = k2.split('.');\n let len = list.length;\n for(let i = 0; i < len - 1; i++) {\n k2 = list[i];\n // 避免异常\n if(target[k2]) {\n target = target[k2];\n }\n else {\n inject.warn('parseJson vars is not exist: ' + v.id + ', ' + k + ', ' + list.slice(0, i).join('.'));\n return;\n }\n }\n k2 = list[len - 1];\n }\n // 支持函数模式和值模式\n if(isFunction(value)) {\n value = value(v);\n }\n target[k2] = value;\n }\n }\n });\n }\n }\n}\n\nfunction replaceLibraryVars(json, hash, vars) {\n if(vars) {\n // 新版同级vars语法\n if(json.hasOwnProperty('vars')) {\n let slot = json.vars;\n if(!Array.isArray(slot)) {\n slot = [slot];\n }\n if(Array.isArray(slot)) {\n slot.forEach(item => {\n let { id, member } = item;\n if(!Array.isArray(member)) {\n member = [member];\n }\n // library.xxx,需要>=2的长度\n if(Array.isArray(member) && member.length > 1 && vars.hasOwnProperty(id)) {\n if(member[0] === 'library') {\n let target = hash;\n for(let i = 1, len = member.length; i < len; i++) {\n let k = member[i];\n // 最后一个属性可以为空\n if(target.hasOwnProperty(k) || i === len - 1) {\n // 最后一个member表达式替换\n if(i === len - 1) {\n let v = vars[id];\n // 支持函数模式和值模式\n if(isFunction(v)) {\n v = v(target(k));\n }\n let old = target[k];\n // 直接替换library的子对象,需补充id和tagName\n if(i === 1) {\n target[k] = Object.assign({ id: old.id, tagName: old.tagName }, v);\n }\n // 替换library中子对象的一个属性直接赋值\n else {\n target[k] = v;\n }\n }\n else {\n target = target[k];\n }\n }\n else {\n inject.error('Library slot miss ' + k);\n return;\n }\n }\n }\n }\n });\n }\n }\n // 兼容老版var-\n else {\n Object.keys(json).forEach(k => {\n if(k.indexOf('var-library.') === 0) {\n let v = json[k];\n // 直接移除library插槽,防止下面调用replaceVars(json, vars)时报错\n delete json[k];\n if(!v) {\n return;\n }\n let k2 = k.slice(12);\n // 有id且变量里面传入了替换的值\n if(k2 && v.id && vars.hasOwnProperty(v.id)) {\n let value = vars[v.id];\n if(isFunction(value)) {\n value = value(v);\n }\n // 替换图层的值必须是一个有tagName的对象\n if(!value || !value.tagName) {\n return;\n }\n // library对象也要加上id,与正常的library保持一致\n hash[k2] = Object.assign({ id: k2 }, value);\n }\n }\n });\n }\n }\n}\n\n/**\n * 遍历一遍library的一级,将一级的id存到hash上,无需递归二级,\n * 因为顺序前提要求排好且无循环依赖,所以被用到的一定在前面出现,\n * 一般是无children的元件在前,包含children的div在后\n * 即便library中的元素有children或library,在linkChild时将其link过去,parse递归会继续处理\n * @param item:library的一级孩子\n * @param hash:存放library的key/value引用\n */\nfunction linkLibrary(item, hash) {\n let id = item.id;\n // library中一定有id,因为是一级,二级+特殊需求才会出现放开\n if(isNil(id)) {\n throw new Error('Library item miss id: ' + JSON.stringify(item));\n }\n else {\n hash[id] = item;\n }\n}\n\n/**\n * 链接child到library文件,\n * props需要是clone的,因为防止多个child使用同一个库文件\n * children则直接引用,无需担心多个使用同一个\n * library也需要带上,在library直接子元素还包含library时会用到\n * @param child\n * @param libraryItem\n */\nfunction linkChild(child, libraryItem) {\n // 规定图层child只有init和动画,属性和子图层来自库\n child.tagName = libraryItem.tagName;\n child.props = clone(libraryItem.props);\n child.children = libraryItem.children;\n child.library = libraryItem.library;\n // library的var-也要继承过来,本身的var-优先级更高,目前只有children会出现优先级情况\n Object.keys(libraryItem).forEach(k => {\n if(k.indexOf('var-') === 0 && !child.hasOwnProperty(k)) {\n child[k] = libraryItem[k];\n }\n });\n // 删除以免二次解析\n child.libraryId = null;\n // 规定图层实例化的属性和样式在init上,优先使用init,然后才取原型链的props\n let { init } = child;\n if(init) {\n let props = child.props = child.props || {};\n let style = props.style;\n extend(props, init);\n // style特殊处理,防止被上面覆盖丢失原始值\n if(style) {\n extend(style, init.style);\n props.style = style;\n }\n // 删除以免二次解析\n child.init = null;\n }\n}\n\nfunction parse(karas, json, animateRecords, opt, hash = {}) {\n if(isPrimitive(json) || json instanceof Node || json instanceof Component) {\n return json;\n }\n if(Array.isArray(json)) {\n return json.map(item => {\n return parse(karas, item, animateRecords, opt, hash);\n });\n }\n // 先判断是否是个链接到库的节点,是则进行链接操作\n let libraryId = json.libraryId;\n if(!isNil(libraryId)) {\n let libraryItem = hash[libraryId];\n // 规定图层child只有init和动画,tagName和属性和子图层来自库\n if(libraryItem) {\n linkChild(json, libraryItem);\n }\n else {\n throw new Error('Link library miss id: ' + libraryId);\n }\n json.libraryId = null;\n }\n // 再判断是否有library形成一个新的作用域,会出现library下的library使得一个链接节点链接后出现library的情况\n let library = json.library;\n if(Array.isArray(library)) {\n hash = {};\n library.forEach(item => {\n linkLibrary(item, hash);\n });\n // 替换library插槽\n replaceLibraryVars(json, hash, opt.vars);\n json.library = null;\n }\n let { tagName, props = {}, children = [], animate = [] } = json;\n if(!tagName) {\n throw new Error('Dom must have a tagName: ' + JSON.stringify(json));\n }\n let style = props.style;\n (opt.abbr !== false) && abbr2full(style, abbrCssProperty);\n // 先替换style的\n replaceVars(style, opt.vars);\n // 再替换静态属性,style也作为属性的一种,目前尚未被设计为被替换\n replaceVars(props, opt.vars);\n // 替换children里的内容,如文字,无法直接替换tagName/props/children/animate本身,因为下方用的还是原引用\n replaceVars(json, opt.vars);\n 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 let animationRecord;\n if(animate) {\n if(Array.isArray(animate)) {\n let has;\n animate.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrAnimate);\n let { value, options } = item;\n // 忽略空动画\n if(Array.isArray(value) && value.length) {\n has = true;\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n });\n if(has) {\n animationRecord = {\n animate,\n target: vd,\n };\n }\n }\n else {\n (opt.abbr !== false) && abbr2full(animate, abbrAnimate);\n let { value, options } = animate;\n if(Array.isArray(value) && value.length) {\n value.forEach(item => {\n (opt.abbr !== false) && abbr2full(item, abbrCssProperty);\n replaceVars(item, opt.vars);\n });\n animationRecord = {\n animate,\n target: vd,\n };\n }\n if(options) {\n (opt.abbr !== false) && abbr2full(options, abbrAnimateOption);\n replaceVars(options, opt.vars);\n }\n }\n }\n // 产生实际动画运行才存入列表供root调用执行\n if(animationRecord) {\n animateRecords.push(animationRecord);\n }\n return vd;\n}\n\nexport default parse;\n","import parse from './parse';\nimport abbr from './abbr';\nimport inject from '../util/inject';\nimport util from '../util/util';\nimport font from '../style/font';\nimport Controller from '../animate/Controller';\n\nlet o = {\n parse(karas, json, dom, options = {}) {\n // 特殊单例声明无需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';\n\nexport default {\n css,\n reset,\n unit,\n font,\n abbr,\n};\n","import Animation from './Animation';\nimport Controller from './Controller';\nimport easing from './easing';\nimport frame from './frame';\n\nexport default {\n Animation,\n Controller,\n easing,\n frame,\n};\n","import level from './level';\nimport change from './change';\nimport Page from './Page';\nimport Cache from './Cache';\n\nexport default {\n level,\n change,\n Page,\n Cache,\n};\n","import Node from './node/Node';\nimport Text from './node/Text';\nimport Xom from './node/Xom';\nimport Dom from './node/Dom';\nimport Img from './node/Img';\nimport Root from './node/Root';\nimport tag from './node/tag';\nimport mode from './node/mode';\nimport Geom from './node/geom/Geom';\nimport Line from './node/geom/Line';\nimport Polyline from './node/geom/Polyline';\nimport Polygon from './node/geom/Polygon';\nimport Sector from './node/geom/Sector';\nimport Rect from './node/geom/Rect';\nimport Circle from './node/geom/Circle';\nimport Ellipse from './node/geom/Ellipse';\nimport Component from './node/Component';\nimport Event from './util/Event';\nimport util from './util/util';\nimport $$type from './util/$$type';\nimport builder from './util/builder';\nimport updater from './util/updater';\nimport inject from './util/inject';\nimport enums from './util/enums';\nimport debug from './util/debug';\nimport parser from './parser/index';\nimport style from './style/index';\nimport animate from './animate/index';\nimport math from './math/index';\nimport refresh from './refresh/index';\nimport { version } from '../package.json';\n\nGeom.register('$line', Line);\nGeom.register('$polyline', Polyline);\nGeom.register('$polygon', Polygon);\nGeom.register('$sector', Sector);\nGeom.register('$rect', Rect);\nGeom.register('$circle', Circle);\nGeom.register('$ellipse', Ellipse);\n\nlet karas = {\n version,\n render(root, dom) {\n if(!(root instanceof Root)) {\n throw new Error('Render dom must be canvas/svg');\n }\n if(dom) {\n root.appendTo(dom);\n }\n return root;\n },\n createElement(tagName, props) {\n props = props || {};\n let children = [];\n for(let i = 2, len = arguments.length; i < len; i++) {\n children.push(arguments[i]);\n }\n if(util.isString(tagName)) {\n if(tagName.charAt(0) === '$') {\n return this.createGm(tagName, props);\n }\n else {\n return this.createVd(tagName, props, children);\n }\n }\n else if(tagName) {\n return this.createCp(tagName, props, children);\n }\n },\n createVd(tagName, props, children = []) {\n if(['canvas', 'svg', 'webgl'].indexOf(tagName) > -1) {\n return new Root(tagName, props, children);\n }\n if(tag.TAG_NAME.hasOwnProperty(tagName)) {\n return {\n tagName,\n props,\n children,\n $$type: $$type.TYPE_VD,\n };\n }\n throw new Error(`Can not use <${tagName}>`);\n },\n createGm(tagName, props) {\n return {\n tagName,\n props,\n $$type: $$type.TYPE_GM,\n };\n },\n createCp(klass, props, children = []) {\n props.children = children;\n return {\n klass,\n props,\n $$type: $$type.TYPE_CP,\n };\n },\n parse(json, dom, options) {\n return parser.parse(this, json, dom, options);\n },\n loadAndParse(json, dom, options) {\n return parser.loadAndParse(this, json, dom, options);\n },\n mode,\n Component,\n Node,\n Text,\n Geom,\n Xom,\n Dom,\n Img,\n Root,\n Event,\n util,\n inject,\n style,\n parser,\n animate,\n math,\n builder,\n updater,\n refresh,\n enums,\n set debug(v) {\n debug.flag = !!v;\n },\n};\n\nbuilder.ref({\n Xom,\n Dom,\n Img,\n Geom,\n Component,\n});\n\nif(typeof window !== 'undefined') {\n window.karas = karas;\n}\nelse if(typeof self !== 'undefined') {\n self.karas = karas;\n}\n\nexport default karas;\n"],"names":["STYLE_KEY","POSITION","DISPLAY","TOP","RIGHT","BOTTOM","LEFT","MARGIN_TOP","MARGIN_RIGHT","MARGIN_BOTTOM","MARGIN_LEFT","PADDING_TOP","PADDING_RIGHT","PADDING_BOTTOM","PADDING_LEFT","FONT_SIZE","FONT_FAMILY","COLOR","FONT_STYLE","FONT_WEIGHT","LINE_HEIGHT","BACKGROUND_IMAGE","BACKGROUND_COLOR","BACKGROUND_SIZE","BACKGROUND_REPEAT","BACKGROUND_POSITION_X","BACKGROUND_POSITION_Y","BORDER_TOP_WIDTH","BORDER_RIGHT_WIDTH","BORDER_BOTTOM_WIDTH","BORDER_LEFT_WIDTH","BORDER_TOP_COLOR","BORDER_RIGHT_COLOR","BORDER_BOTTOM_COLOR","BORDER_LEFT_COLOR","BORDER_TOP_STYLE","BORDER_RIGHT_STYLE","BORDER_BOTTOM_STYLE","BORDER_LEFT_STYLE","BORDER_TOP_LEFT_RADIUS","BORDER_TOP_RIGHT_RADIUS","BORDER_BOTTOM_RIGHT_RADIUS","BORDER_BOTTOM_LEFT_RADIUS","WIDTH","HEIGHT","FLEX_GROW","FLEX_SHRINK","FLEX_BASIS","FLEX_DIRECTION","JUSTIFY_CONTENT","ALIGN_ITEMS","ALIGN_SELF","TEXT_ALIGN","TRANSFORM_ORIGIN","VISIBILITY","OPACITY","Z_INDEX","TRANSFORM","TRANSLATE_X","TRANSLATE_Y","TRANSLATE_Z","SCALE_X","SCALE_Y","SCALE_Z","SKEW_X","SKEW_Y","ROTATE_X","ROTATE_Y","ROTATE_Z","ROTATE_3D","PERSPECTIVE","PERSPECTIVE_ORIGIN","FILTER","BOX_SHADOW","POINTER_EVENTS","OVERFLOW","MIX_BLEND_MODE","BACKGROUND_CLIP","WHITE_SPACE","TEXT_OVERFLOW","LETTER_SPACING","LINE_CLAMP","ORDER","FLEX_WRAP","ALIGN_CONTENT","TEXT_STROKE_WIDTH","TEXT_STROKE_COLOR","TEXT_STROKE_OVER","FILL","STROKE","STROKE_WIDTH","STROKE_DASHARRAY","STROKE_DASHARRAY_STR","STROKE_LINECAP","STROKE_LINEJOIN","STROKE_MITERLIMIT","FILL_RULE","MATRIX","BORDER_TOP","BORDER_RIGHT","BORDER_BOTTOM","BORDER_LEFT","TRANSLATE_PATH","STYLE2LOWER_MAP","style2Lower","s","toLowerCase","replace","$0","$1","toUpperCase","STYLE2UPPER_MAP","style2Upper","$2","STYLE_R_KEY","STYLE_RV_KEY","STYLE_V_KEY","Object","keys","forEach","k","k2","l","UPDATE_KEY","UPDATE_NODE","UPDATE_STYLE","UPDATE_FOCUS","UPDATE_MEASURE","UPDATE_COMPONENT","UPDATE_OVERWRITE","UPDATE_KEYS","UPDATE_LIST","UPDATE_CONFIG","UPDATE_ADD_DOM","UPDATE_REMOVE_DOM","KEY_FRAME_KEY","FRAME_STYLE","FRAME_TIME","FRAME_EASING","FRAME_TRANSITION","NODE_KEY","NODE_DOM_PARENT","NODE_OPACITY","NODE_MATRIX","NODE_MATRIX_EVENT","NODE_CACHE","NODE_CACHE_TOTAL","NODE_CACHE_FILTER","NODE_CACHE_MASK","NODE_CACHE_OVERFLOW","NODE_STRUCT","NODE_TAG_NAME","NODE_CURRENT_STYLE","NODE_CURRENT_PROPS","NODE_COMPUTED_STYLE","NODE_CACHE_STYLE","NODE_CACHE_PROPS","NODE_LIMIT_CACHE","NODE_IS_MASK","NODE_IS_INLINE","NODE_HAS_CONTENT","NODE_REFRESH_LV","NODE_IS_DESTROYED","NODE_STYLE","NODE_UPDATE_HASH","NODE_UNIQUE_UPDATE_ID","NODE_DEFS_CACHE","NODE_PERSPECTIVE_MATRIX","NODE_VIRTUAL_DOM","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_FRAME_CB","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_CAL_DIFF_TIME","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","__width","__height","__baseLine","__config","i","lv","j","root","struct","diff","isLayout","__sx","__sy","x","ox","y","oy","__prev","__next","__parent","__domParent","__root","__host","__hostRoot","__virtualDom","CANVAS","SVG","WEBGL","o","AUTO","PX","PERCENT","NUMBER","INHERIT","DEG","STRING","RGBA","REM","EM","VW","VH","VMAX","VMIN","calUnit","v","n","parseFloat","test","info","arial","lhr","blr","lgr","padding","f","verdana","tahoma","S","T","Z","c","t","georgia","simsun","support","fontFamily","hasOwnProperty","register","name","emSquare","ascent","descent","lineGap","addPadding","assign","position","gradient","img","identity","multiply","a","b","isE","a0","a1","a2","a3","calPoint","point","m","z","w","undefined","length","b1","c1","d1","b2","c2","d2","b3","c3","d3","a4","b4","c4","d4","d","e","inverse","inverse4","divisor","inv","det","m2m6","point2d","slice","dotProduct","x1","y1","x2","y2","crossProduct","H","Math","sqrt","vector","mx","h","deg","cos","sin","pointInPolygon","vertexes","xmax","ymax","xmin","ymin","len","max","min","pointInQuadrilateral","x4","y4","x3","y3","matrix","w1","w2","w3","w4","angleBySide","theta","pow","acos","sideByAngle","alpha","pointsDistance","triangleIncentre","ellipsePoints","sectorPoints","r","begin","end","list","floor","h2","d2r","abs","atan","rx","ry","p1","p2","p4","p3","push","concat","temp","res","getRectsIntersection","isRectsOverlap","ax1","ay1","ax4","ay4","bx1","by1","bx4","by4","isRectsInside","calCoordsInNode","px","py","node","computedStyle","width","height","calPercentInNode","ds","Infinity","PI","dt","r2d","bboxBezier2","x0","y0","minX","minY","maxX","maxY","tx","ty","sx","sy","qx","qy","bboxBezier3","cx","cy","bx","by","ax","ay","hx","hy","q","bboxBezier","arguments","norm","order","sum","reduce","simpson38","derivativeFunc","middleL","middleR","adaptiveSimpson38","eps","mid","st","sl","sr","ans","bezierLength","points","startT","endT","at","at3","p0","at2","bezierOrder","derivativeOrder","pointAtBezier","percent","maxIteration","pointAtBezierWithLength","targetLen","approachLen","approachT","preApproachT","derivative1","derivative2","numerator","denominator","sliceBezier","x12","y12","x23","y23","x123","y123","x34","y34","x234","y234","x1234","y1234","sliceBezier2Both","start","reverse","pointOnCircle","getConicGradientImage","originX","originY","stop","data","Error","getAngle","dx","dy","increasingList","map","item","color","angle","factor","idx","canvasPolygon","ctx","Array","isArray","moveTo","lineTo","quadraticCurveTo","bezierCurveTo","svgPolygon","canvasLine","controlA","controlB","num","svgLine","canvasFilter","filter","svgFilter","geom","unit","painter","calFitDashed","total","bs","be","smin","smax","dmin","dmax","ps","pd","outer","per","free","mo","calDashed","style","m1","m2","m3","m4","bw","calPoints","borderWidth","borderStyle","deg1","deg2","direction","beginRadius","endRadius","indexOf","isLast","main1","main2","cross1","cross2","tan","calTopRadiusPoints","calRightRadiusPoints","calBottomRadiusPoints","calLeftRadiusPoints","pointsList","brx","bry","erx","ery","oxl","oxr","beginList","centerList","endList","ya","yb","beginLength","needInner","crossDeg","rx1","ry1","sx1","oyl","rx2","ry2","sx2","xa","xb","ca","calBezierTopLeft","cb","controls1","controls2","limit","pop","endLength","oyr","calBezierTopRight","isStart","crossDx","p1x","p1y","p2x","p2y","dx1","dsx1","dx2","dsx2","cpx2","cpy2","cpx1","cpy1","crossDsx","beta","tanBetaDiv2Sqrt","tanAlphaHalf","degTg","degTg1","cdx1","cdy1","cx1","cy1","degTg2","cdx2","cdy2","cx2","cy2","isEnd","oyt","oyb","oxt","calBezierRightTop","oxb","calBezierRightBottom","calBezierBottomLeft","calBezierBottomRight","calBezierLeftTop","calBezierLeftBottom","calRadius","btlr","btrr","bbrr","bblr","need","btlx","btly","btrx","btry","bbrx","bbry","bblx","bbly","BR_KS","calBorderRadius","currentStyle","noRadius","target","prev","next","half","calBorderRadiusInline","contentBoxList","first","last","outerWidth","outerHeight","renderBorder","xom","renderMode","mode","beginPath","fillStyle","fill","closePath","virtualDom","bb","type","tagName","props","TYPE_VD","_","TYPE_GM","TYPE_CP","toString","isType","obj","call","isObject","isString","isFunction","isNumber","isBoolean","isDate","hasOwn","fnToString","ObjectFunctionString","isNil","joinSourceArray","arr","stringify","encodeHtml","prop","joinVirtualDom","vd","defs","joinDef","joinVd","conClip","children","isMask","content","opacity","transform","visibility","mask","overflow","mixBlendMode","def","uuid","joinItem","rgba2int","charAt","parseInt","match","int2rgba","joinArr","int2invert","arr2hash","hash","hash2arr","clone","$$type","util","Date","isPlainObject","equalArr","ai","bi","isArrayA","isArrayB","equal","getTime","extend","source","split","extendAnimate","ovd","nvd","__animationList","animationList","splice","__setTarget","assigning","finished","__stayEnd","assignCurrentStyle","__frameAnimateList","transformBbox","bbox","proto","getPrototypeOf","Ctor","constructor","assignMatrix","isPrimitive","isAuto","flag","charWidth","ELLIPSIS","antialias","premultipliedAlpha","preserveDrawingBuffer","initShaders","gl","vshader","fshader","program","createProgram","enable","BLEND","blendFunc","ONE","ONE_MINUS_SRC_ALPHA","vertexShader","loadShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","attachShader","linkProgram","linked","getProgramParameter","LINK_STATUS","error","getProgramInfoLog","deleteProgram","deleteShader","shader","createShader","shaderSource","compileShader","compiled","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","convertCoords2Gl","revertY","createTexture","tex","texture","bindTexture","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","texImage2D","TEXTURE_2D","UNSIGNED_BYTE","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","LINEAR","TEXTURE_MAG_FILTER","activeTexture","drawTextureCache","vtPoint","vtTex","vtOpacity","lastChannel","record","stack","cache","channel","page","tx1","ty1","tx2","ty2","pointBuffer","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","Float32Array","STATIC_DRAW","a_position","getAttribLocation","vertexAttribPointer","FLOAT","enableVertexAttribArray","texBuffer","a_texCoords","opacityBuffer","a_opacity","u_texture","getUniformLocation","count","uniform1i","drawArrays","TRIANGLES","deleteBuffer","disableVertexAttribArray","drawBlur","frameBuffer","texCache","tex1","tex2","spread","sigma","u_direction","uniform2f","ratio","recycle","tex3","framebufferTexture2D","FRAMEBUFFER","COLOR_ATTACHMENT0","tex4","deleteTexture","drawCm","u_m","uniform1fv","drawOverflow","programOverflow","drawMask","u_texture1","u_texture2","drawMbm","W","SPF","CANVAS_LIST","WEBGL_LIST","SUPPORT_OFFSCREEN_CANVAS","OffscreenCanvas","prototype","getContext","defaultFontFamilyData","key","message","debug","document","createElement","setAttribute","body","appendChild","canvas","draw","enabled","available","release","cacheCanvas","cacheWebgl","IMG","INIT","LOADING","LOADED","FONT","COMPONENT","inject","measureText","textCache","html","lengths","chars","ff","fs","fw","inline","char","div","left","top","innerHTML","cns","childNodes","index","css","window","getComputedStyle","text","__measureCb","removeChild","measureTextSync","measureImg","url","state","success","task","Image","onload","onerror","substr","host","exec","location","hostname","crossOrigin","src","warn","console","requestAnimationFrame","bind","setTimeout","cancelAnimationFrame","id","clearTimeout","now","performance","hasCacheCanvas","getCacheCanvas","releaseCacheCanvas","delCacheCanvas","hasCacheWebgl","getCacheWebgl","releaseCacheWebgl","delCacheWebgl","isDom","Element","self","getElementsByTagName","isWebGLTexture","WebGLTexture","checkSupportFontFamily","font","checked","context","textAlign","textBaseline","clearRect","fillText","getImageData","loadFont","FontFace","load","then","loadComponent","script","async","head","getLinearDeg","getRadialPosition","center","right","bottom","getColorStop","firstColor","p","dr","dg","db","da","unshift","calLinearCoords","calCircleCentre","iw","ih","positionX","positionY","calRadialRadius","shape","size","xl","yl","asin","parseGradient","reg","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","log","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","__hasUpdate","__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","Animation","__id","nl","__options","op","config","__frameCb","__calDiffTime","iterations","framesR","originStyle","fps","spfLimit","delay","endDelay","playbackRate","isFinish","__cancelTask","__currentProps","__currentStyle","isDelay","FRAME","PLAY","playState","__hasFin","__hasCancel","playCount","currentFrames","stayBegin","stayEnd","is2","endTime","currentTime","currentFrame","round","isAlternate","alternate","isEven","isLastCount","frameTime","isLastFrame","inEndDelay","needClean","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","isDirectItem","__calMp","isVirtual","fromAbs","isShadowRoot","clearCache","__layoutData","__layoutNone","__mp","__isRealInline","__layoutFlex","__layoutInline","__layoutBlock","__sx2","__sx3","__sx4","__sx5","__sx6","__sy2","__sy3","__sy4","__sy5","__sy6","__execAr","ar","controller","autoPlay","__records2","init","list2","__records","__playAuto","h3","nowrap","fixedWidth","fixedHeight","selfEndSpace","offsetWidth","offsetHeight","matrixCache","isScale","clientHeight","x5","x6","y5","y6","__calFilter","bg","bgI","item2","kw","__bx1","__bx2","__by1","__by2","rebuild","__hasContent","isRealInline","sx4","sx5","sx6","sy4","sy5","sy6","hasContent","__calContent","__calPerspective","__calMatrix","__releaseWhenEmpty","limitCache","__calCache","perspectiveMatrix","offscreenBlend","offscreenMask","hasFilter","offscreenFilter","offscreenOverflow","borderList","hasBgi","some","svgBgSymbol","__gradient","isFirst","lastContentBox","lastLineBox","parentLineBox","countW","ix1","iy1","ix2","iy2","symbol","clearAnimate","clearFrameAnimate","__stopPropagation","__stopImmediatePropagation","willResponseEvent","hasEmitMask","ignore","inThis","__touchstartTarget","__getLg","__getRg","__getCg","lg","createLinearGradient","addColorStop","rg","createRadialGradient","ec","dc","pc","cur","onlyTotal","__cacheTotal","__cacheFilter","__cacheMask","__cacheOverflow","formatStyle","animation","cancel","enter","hostRoot","pJson","zChildren","zIndexChildren","__spreadBbox","LineBox","__list","__lineHeight","LineBoxManager","__lastX","__lastY","__maxX","__domList","__domStack","__isNewLine","__isEnd","__setLB","nextNewLine","genLineBox","verticalAlign","isNewLine","TAG_NAME","INLINE","BOLD","offsetAndResizeByNodeOnY","reflowHash","inDirectAbsList","isContainer","cs","__layoutAbs","isAbs","__resizeY","clearUniqueReflowId","__uniqueReflowId","getMergeMarginTB","topList","bottomList","genZIndexChildren","hasMc","mcHash","lastMaskIndex","__iIndex","__zIndex","__aIndex","genOrderChildren","__order","block","inlineBlock","none","tag","__flexLine","__zIndexChildren","__structure","nss","__structs","structs","needSort","__tryLayInline","firstCharWidth","main","isRow","__calMinMax","min2","max2","countMin","countMax","setNotEnd","__addMp","isFixed","isContent","fixedSize","__lineBoxManager","__preLayout","__ioSize","mergeMarginBottomList","mergeMarginTopList","isXom","isInlineBlock","isImg","reflow","__isIbFull","lastX","lastY","isNone","isEmptyBlock","tw","th","horizonAlign","__inlineSize","domList","__marginAuto","growList","shrinkList","basisList","maxList","minList","orderChildren","__calBasis","containerSize","isMultiLine","line","hypotheticalList","hypothetical","maxCrossList","__layoutFlexLine","maxCross","crossSum","crossSumList","between","around","__crossAlign","flexLine","hypotheticalSum","targetMainList","factorSum","factorList","needReset","factorSum2","lbmList","firstBaseLine","genLineBoxByInlineIfNewLine","setLbByInlineIfNotNewLine","pushContentBoxList","isIbFull","isInline2","isInlineBlock2","focusNoWrap","fw2","addX","popContentBoxList","maxCX","maxCY","minCX","minCY","maxFX","maxFY","minFX","minFY","maxOX","maxOY","minOX","minOY","absChildren","onlyRight","onlyBottom","fixedTop","fixedRight","fixedBottom","fixedLeft","needCalWidth","wl","hl","__computeMeasure","__deepScan","loadImg","__loadImg","placeholder","loading","__loadAndRefresh","showError","pts","arc","__addGeom","reload","Defs","cacheHash","__isMulti","multi","__cacheProps","strokeDasharrayStr","lineCap","lineJoin","miterLimit","getLineDash","setLineDash","preData","__preSet","fills","fillRules","strokes","strokeWidths","strokeDasharrays","strokeDasharrayStrs","strokeLinecaps","strokeLinejoins","strokeMiterlimits","__renderOnePolygon","isFillCE","isStrokeCE","isFillRE","isStrokeRE","__conicGradient","__drawPolygon","__radialEllipse","isFill","isStroke","__preSetCanvas","__propsStrokeStyle","__inversePtList","updateList","removeList","KEY_FLAG","check","checkCp","nextProps","forceCheckUpdate","shouldUpdate","shouldComponentUpdate","updateCp","oldS","oldSr","oldJson","diffSr","oj","nj","ojk","getKeyHash","njk","keyList","cpList","diffCp","diffChildren","diffChild","removeCpFromOldTree","oc","ol","of","nf","exist","ex","did","componentDidUpdate","elem","diffDefs","diffBb","diffD2D","od","nd","diffDef","removeAt","insertAt","insertAdjacentHTML","parentNode","removeAttribute","diffItem","diffD2G","replaceWith","diffT2T","diffG2D","diffG2G","diffItemSelf","diffX2X","diffByLessLv","firstChild","lastChild","obb","nbb","isText","svg","where","insertBefore","Controller","__list2","__onList","__lastTime","args","records","animate","onList","__action","__mergeAuto","__on","timestamp","__set","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","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","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","__ctx","__renderMode","vertex","fragment","vertexMask","fragmentMask","fragmentClip","fragmentOverflow","vertexCm","fragmentCm","MAX_TEXTURE_IMAGE_UNITS","__texCache","destroy","__eventCbList","__checkRoot","__checkUpdate","__checkReflow","noRender","__clear","__vd","domDiff","updateStyle","taskUp","__nextFrameCp","updater","includeIgnore","scan","path","zPath","__index__","karas","path2","zPath2","nodeConfig","rootConfig","updateHash","__updateRoot","updateRoot","hasUpdate","__updateStruct","measureHash","__uniqueUpdateId","isInherit","uniqueList","hasRoot","diffList","diffI","mergeOffsetList","__uniqueMergeOffsetId","cps","cts","isLastAbs","isNowAbs","isLastNone","isNowNone","hasFlowPrev","__modifyStruct","startIndex","startNode","oldH","nowH","lastIndex","ns","reBuild","base","reBuildC","curveNum","limitStartEnd","getNewPoint","Line","__x1","__y1","__x2","__y2","__controlA","__controlB","__start","__end","dy2","buildCache","curve","bezierBox","concatPointAndControl","control","getLength","increase","getIndex","getNewList","prePercent","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","replaceLibraryVars","linkLibrary","JSON","linkChild","libraryItem","library","libraryId","parse","animateRecords","opt","createGm","createCp","createVd","animationRecord","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,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,EApB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AA,IAAI,EAAJA,IA/EU;AAgFVkM,EAAAA,OAAO,EAAPA,OAhFU;AAiFV+5B,EAAAA,OAAO,EAAPA,OAjFU;AAkFVlL,EAAAA,OAAO,EAAPA,OAlFU;AAmFVjuE,EAAAA,KAAK,EAALA,KAnFU;;AAoFV,MAAI4rB,KAAJ,CAAU1oB,CAAV,EAAa;AACX0oB,IAAAA,KAAK,CAACrI,IAAN,GAAa,CAAC,CAACrgB,CAAf;AACD;;AAtFS,CAAZ;AAyFAk8C,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,OAAO1uB,MAAP,KAAkB,WAArB,EAAkC;AAChCA,EAAAA,MAAM,CAACurD,KAAP,GAAeA,OAAf;AACD,CAFD,MAGK,IAAG,OAAO9oD,IAAP,KAAgB,WAAnB,EAAgC;AACnCA,EAAAA,IAAI,CAAC8oD,KAAL,GAAaA,OAAb;AACD;;;;"} \ No newline at end of file diff --git a/index.js b/index.js index 93b371c4a..c60849108 100644 --- a/index.js +++ b/index.js @@ -39951,7 +39951,7 @@ Cache: Cache }; - var version = "0.65.4"; + var version = "0.66.0"; Geom$1.register('$line', Line); Geom$1.register('$polyline', Polyline); diff --git a/package.json b/package.json index 760280205..14e537a76 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "karas", - "version": "0.65.4", + "version": "0.66.0", "description": "A flexible JavaScript framework for RIA on Canvas/Svg/Webgl.", "maintainers": [ {