我有一些代码,我在其中将画布动态添加到可拖动、可调整大小的 div 元素。在这里粘贴太多了->这是jsFiddle ...
它在 IE-10 和 FF-19 中运行良好,但在 webkit (Chrome-25) 中,当您在调整大小后拖动 div 时会留下严重的伪影。这是要运行的测试:
How to see the artifacts in WEBKIT BROWSERS ONLY
1. Drag the gray header, shake mouse, notice NO artifacts as you shake the div
2. Drop the header, resize div using the lower right handle so that you see about an equal amount of green and purple
3. Repeat step 1, only this time artifacts are everywhere in webkit browsers (not IE 10 or FF 19)
4. Now delete the javascript code from line 11 on down (the function and call) and run fiddle again
5. Repeat the test in steps 1-3. Without the canvas, there are NO artifacts.
6. Try in non-webkit browsers. NO artifacts.
我构建的测试用例似乎指向画布是罪魁祸首。我不认为这是一个编码错误,因为非 webkit 可以正常工作。另外,我认为可能是硬件问题,但我已经在多台机器上重新启动/运行它并且它是可重复的。
我是否发现了浏览器错误,或者有人在我的代码中看到了错误?