DOMNodeInsertedIntoDocument 应该冒泡吗?
我一直认为 DOMNodeInsertedIntoDocument/DOMNodeRemovedFromDocument 事件不应该冒泡,对我来说这很有意义。 然而,就在最近,我再次查看了规范,发现在一个位置它说这些事件不应冒泡(事件类型的完整列表),而在其他位置则表示它们应该(DOMNodeInsertedIntoDocument 和 DOMNodeRemovedFromDocument)。
我还在互联网上查找并发现了几种实现,它们的实现行为都不同。
问题是:这些事件真的应该冒泡吗? 你认为什么更有意义?
更新:在 DOM 中发现-Level-2-Events 规范没有歧义,因为它在单个位置提到了这些事件。
更新 2:提出这个问题是为了验证 Ample SDK 中这些事件的行为 Ajax 框架,旨在实现所有基于标准的技术。
I've been always thinking that DOMNodeInsertedIntoDocument/DOMNodeRemovedFromDocument events should not bubble, and for me that made enough sence. However, just recently I looked into specification once again and found out that in one location it says these events should not bubble (Complete list of event types), while in other location is says they should (DOMNodeInsertedIntoDocument and DOMNodeRemovedFromDocument).
I've also looked up on the Internet and found several implementations, all of them are different in the behavior implemented.
The question is: Should these events actually bubble ot not? What do you think make more sence?
Update: Found out that in DOM-Level-2-Events specification there is no ambiguity since it olny mentions these events in a single location.
Update 2: This question was asked in order to validate the behavior of these events in the Ample SDK Ajax Framework that aims to implement all standards-based technologies.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据 2 级事件,我会选择“否”,这是一个已经存在很长时间的正确建议,并且包含与此无关的勘误表。 DOM Level 3 Events 只是一个工作组注释,而且仍然是 WD,整体上有点不尽如人意。
I would go with ‘No’, as per Level 2 Events, which is a proper Recommendation that has been around a long time and has errata that do not include anything to do with this. DOM Level 3 Events is only a Working Group Note and still WD, which is a bit unsatisfactory all round.
我猜你已经发现它们不应该冒泡。 但这对于实际的开发人员来说是一个有争议的问题,因为他们不受 IE 的支持,而 IE 仍然占据着大约 80% 的市场。 :-(
I guess you already discovered that they should not bubble. But it is a moot point for a practical developer because they are not supported by IE, which still holds ~80% of the market. :-(