我的应用程序能够渲染 Shadow DOM,但检查器无法显示 Shadow 根。谁能帮我解决这个问题吗?
这取决于您指的是哪种 Shadow DOM——Shadow DOM v0 或 Shadow DOM v1。
See http://caniuse.com/#feat=shadowdomv1 http://caniuse.com/#feat=shadowdomv1 and http://caniuse.com/#feat=shadowdom http://caniuse.com/#feat=shadowdom
没有任何版本的 Safari 支持 Shadow DOM v0。但就 iOS Safari 而言,10.2+ 版本支持 Shadow DOM v1,但有以下限制:
某些 CSS 选择器不起作用(:host > .local-child
)和样式开槽内容(::slotted
)有越野车。
关于Shadow DOM v0和v1之间的差异,请参见https://hayato.io/2016/shadowdomv1/ https://hayato.io/2016/shadowdomv1/
2020-07-31 更新:影子根不再隐藏在 Safari Web Inspector 中 - 相反,无论如何,它们现在总是显示。看https://trac.webkit.org/changeset/253706/webkit/ https://trac.webkit.org/changeset/253706/webkit/
In older versions of Safari where Web Inspector does not show shadow roots by default, there’s a button you need to click to show shadow roots; it looks like this:
And in the Inspector UI, it’s in the toolbar on the right below the tabs. It turns blue when activated:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)