我有一个DIV
风格resize: both
,然后我设置一个MutationObserver
侦听属性的变化.
mutObs = new MutationObserver(function () { console.log('Hello'); }); elem = document.getElementById('aDiv'); mutObs.observe(elem, { attributes: true }); elem.style.width = '300px'; //this fires the observer callback as expected
我做了一个小提琴:http://jsfiddle.net/2NQQu/2/
在Chrome(我测试过Chrome 31)中,DIV
使用鼠标调整大小时不会触发回调.在Firefox中它工作正常.
这种行为是故意的和/或标准的吗?这是一个错误吗?
据报道,这是Chrome中的一个错误.该错误仍然是开放的,这意味着它尚未修复.