为什么删除了对多个影子根的支持并替换为插槽
Why was support for multiple shadow roots removed and replaced with slots
在 Web Applications WG (WebApps) Web Components meeting in Mountain View CA US on Friday 24 April 2015 期间得出的结论是,应该删除对多个影子根的支持。据我了解,插槽应该用作使用多个影子根的替代方法。但是,会议记录中提供的 link 解释了为什么使用插槽更好的原因已被删除,我找不到任何其他文档来说明如何以及为什么做出这个决定。我怀疑这与处理多个影子根的混乱性质有关,但我不确定。对于删除对多个影子根的支持的原因的任何解释,我将不胜感激。
TLDR;给出了取消对多个影子根的支持并要求使用槽的原因。
因为实施起来很复杂。
来自 W3C Web Components wiki:
Pros: enables consistent story for adding shadow trees to builtins /
provides
reasoning about subclassing DOM trees
Cons:
complexity /
performance: may result in "submerged" trees that aren't rendered but
still participate in style/layout
Cost/benefit of change:
Disables the use case for general inheritance-based component
composition and Firefox UI in XBL) / Makes implementing Shadow DOM
easier
在 Web Applications WG (WebApps) Web Components meeting in Mountain View CA US on Friday 24 April 2015 期间得出的结论是,应该删除对多个影子根的支持。据我了解,插槽应该用作使用多个影子根的替代方法。但是,会议记录中提供的 link 解释了为什么使用插槽更好的原因已被删除,我找不到任何其他文档来说明如何以及为什么做出这个决定。我怀疑这与处理多个影子根的混乱性质有关,但我不确定。对于删除对多个影子根的支持的原因的任何解释,我将不胜感激。
TLDR;给出了取消对多个影子根的支持并要求使用槽的原因。
因为实施起来很复杂。
来自 W3C Web Components wiki:
Pros: enables consistent story for adding shadow trees to builtins / provides reasoning about subclassing DOM trees
Cons: complexity / performance: may result in "submerged" trees that aren't rendered but still participate in style/layout
Cost/benefit of change: Disables the use case for general inheritance-based component composition and Firefox UI in XBL) / Makes implementing Shadow DOM easier