Skip to content

Commit

Permalink
fix: relative #87
Browse files Browse the repository at this point in the history
  • Loading branch information
army8735 committed Sep 25, 2020
1 parent 3df994a commit d2c786a
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 117 deletions.
11 changes: 6 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14623,7 +14623,7 @@
node: self,
focus: o$1.REFLOW,
// 没有样式变化但内容尺寸发生了变化强制执行
img: true // 特殊标识强制布局即便没有style变化
img: true // 特殊标识强制布局即便没有style变化 TODO

});
}
Expand Down Expand Up @@ -16491,8 +16491,7 @@
var isRepaint = o$1.isRepaint(lv);

if (isRepaint) {
console.log(node.tagName); // zIndex变化需清空svg缓存

// zIndex变化需清空svg缓存
if (hasZ && renderMode === mode.SVG) {
node.__cancelCacheSvg(true);
} else {
Expand Down Expand Up @@ -16842,9 +16841,11 @@
uniqueList: _uniqueList
});

_uniqueList.push(_o);
_uniqueList.forEach(function (item) {
options.uniqueList.push(item);
});

options.uniqueList = options.uniqueList.concat(_uniqueList);
options.uniqueList.push(_o);
} // 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行


Expand Down
2 changes: 1 addition & 1 deletion index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/node/Img.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class Img extends Dom {
root.__addUpdate({
node: self,
focus: level.REFLOW, // 没有样式变化但内容尺寸发生了变化强制执行
img: true, // 特殊标识强制布局即便没有style变化
img: true, // 特殊标识强制布局即便没有style变化 TODO
});
},
});
Expand Down
8 changes: 5 additions & 3 deletions src/node/Root.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ class Root extends Dom {
}
// reflow/repaint/measure相关的记录下来
let isRepaint = level.isRepaint(lv);
if(isRepaint) { console.log(node.tagName);
if(isRepaint) {
// zIndex变化需清空svg缓存
if(hasZ && renderMode === mode.SVG) {
node.__cancelCacheSvg(true);
Expand Down Expand Up @@ -867,8 +867,10 @@ class Root extends Dom {
// OFFSET的话先递归看子节点,本身改变放在最后
let uniqueList = [];
node.deepScan(function(child, uniqueList) {}, { uniqueList });
uniqueList.push(o);
options.uniqueList = options.uniqueList.concat(uniqueList);
uniqueList.forEach(item => {
options.uniqueList.push(item);
});
options.uniqueList.push(o);

}
// 返回true即可提前结束深度遍历,在reflowHash有记录时提前跳出,子节点交由上面逻辑执行
Expand Down
14 changes: 0 additions & 14 deletions test/animate-level-reflow/index.html

This file was deleted.

28 changes: 0 additions & 28 deletions test/animate-level-reflow/script.jsx

This file was deleted.

13 changes: 0 additions & 13 deletions test/animate-level-reflow/test.js

This file was deleted.

14 changes: 0 additions & 14 deletions test/animate-level-repaint/index.html

This file was deleted.

23 changes: 0 additions & 23 deletions test/animate-level-repaint/script.jsx

This file was deleted.

13 changes: 0 additions & 13 deletions test/animate-level-repaint/test.js

This file was deleted.

2 changes: 1 addition & 1 deletion test/animate-mask-svg/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
.url('file://' + path.join(__dirname, 'index.html'))
.waitForElementVisible('body', 1000)
.pause(500)
.assert.value('input', '{"bb":[],"children":[{"bb":[],"children":[{"type":"text","children":[{"type":"item","tagName":"text","props":[["x",0],["y",14.484375],["fill","rgba(0,0,0,1)"],["font-family","arial"],["font-weight",400],["font-style","normal"],["font-size","16px"]],"content":"looooooooooooooong"}]}],"opacity":1,"type":"dom"},{"bb":[{"type":"item","tagName":"rect","props":[["x",5],["y",10],["width",100],["height",100],["fill","rgba(255,0,0,1)"]]}],"children":[{"type":"text","children":[{"type":"item","tagName":"text","props":[["x",5],["y",24.484375],["fill","rgba(0,0,0,1)"],["font-family","arial"],["font-weight",400],["font-style","normal"],["font-size","16px"]],"content":"123"}]}],"opacity":1,"type":"dom","mask":"url(#karas-defs-0-0)"}],"opacity":1,"type":"dom","defs":[{"tagName":"mask","props":[],"children":[{"type":"item","tagName":"path","props":[["d","M50,0L150,100L50,100L50,0"],["fill","rgba(238,238,238,1)"],["stroke","rgba(0,0,0,1)"],["stroke-width",0],["transform","matrix(1,0,0,1,0,0)"]]}],"uuid":"karas-defs-0-0"}]}')
.assert.value('input', '{"bb":[],"children":[{"bb":[],"children":[{"type":"text","children":[{"type":"item","tagName":"text","props":[["x",0],["y",14.484375],["fill","rgba(0,0,0,1)"],["font-family","arial"],["font-weight",400],["font-style","normal"],["font-size","16px"]],"content":"looooooooooooooong"}],"cache":true}],"opacity":1,"type":"dom","cache":true},{"bb":[{"type":"item","tagName":"rect","props":[["x",5],["y",10],["width",100],["height",100],["fill","rgba(255,0,0,1)"]]}],"children":[{"type":"text","children":[{"type":"item","tagName":"text","props":[["x",5],["y",24.484375],["fill","rgba(0,0,0,1)"],["font-family","arial"],["font-weight",400],["font-style","normal"],["font-size","16px"]],"content":"123"}],"cache":true}],"opacity":1,"type":"dom","mask":"url(#karas-defs-0-0)","cache":true}],"opacity":1,"type":"dom","defs":[{"tagName":"mask","props":[],"children":[{"type":"item","tagName":"path","props":[["d","M50,0L150,100L50,100L50,0"],["fill","rgba(238,238,238,1)"],["stroke","rgba(0,0,0,1)"],["stroke-width",0],["transform","matrix(1,0,0,1,0,0)"]]}],"uuid":"karas-defs-0-0"}],"cache":true}')
.end();
}
};
2 changes: 1 addition & 1 deletion test/animate-relative-top-svg/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
.url('file://' + path.join(__dirname, 'index.html'))
.waitForElementVisible('body', 1000)
.pause(500)
.assert.value('input', '{"bb":[],"children":[{"bb":[],"children":[{"type":"text","children":[{"type":"item","tagName":"text","props":[["x",0],["y",114.484375],["fill","rgba(0,0,0,1)"],["font-family","arial"],["font-weight",400],["font-style","normal"],["font-size","16px"]],"content":"123"}]}],"opacity":1,"type":"dom"}],"opacity":1,"type":"dom","defs":[]}')
.assert.value('input', '{"bb":[],"children":[{"bb":[],"children":[{"type":"text","children":[{"type":"item","tagName":"text","props":[["x",0],["y",114.484375],["fill","rgba(0,0,0,1)"],["font-family","arial"],["font-weight",400],["font-style","normal"],["font-size","16px"]],"content":"123"}]}],"opacity":1,"type":"dom"}],"opacity":1,"type":"dom","defs":[],"cache":true}')
.end();
}
};

0 comments on commit d2c786a

Please sign in to comment.