html - "Shadow DOM"的正确含义是什么?

标签 html css shadow-dom

我想将“Shadow DOM”术语正确翻译为俄语。但我不确定“影子”这个词最合适的含义是什么。所以我列出了不同含义的列表。请帮我选择最好的一个。

  • 阴影、幽灵、黑暗、反射、织布
  • 鬼魂、幻影、幻影、幽灵
  • 黑暗、阴暗、晦暗、夜晚、阴暗
  • 黄昏、半明半暗、阴影
  • 提示、暗示、引用、建议、暗示
  • 覆盖物、覆盖物、面纱、外套、毯子
  • 次要的、多余的

最佳答案

来自Shadow DOM Working Draft :

This specification describes a method of establishing and maintaining functional boundaries between DOM trees and how these trees interact with each other within a document, thus enabling better functional encapsulation within the DOM.

...

Web application developers often encounter the need to provide encapsulation within a DOM tree. Despite being part of one document tree (a tree that has document as its root), there are typically many functional tree fragments, as well as assumptions about these fragments operating independently. This specification calls this type of encapsulation a functional encapsulation, as opposed to trust encapsulation, which deals with limiting information flow based on trust and ensuring security of data and state within an application.

...

The shadow DOM allows multiple DOM trees (in addition to the document tree) to be composed into one larger tree when rendered. The existence of multiple DOM trees is enabled by letting any element in the document tree to host one or more additional DOM trees. These shadow trees are governed by a set of rules that establish encapsulation boundaries while retaining the standard DOM composability semantics.

The encapsulation boundaries between the document tree and shadow trees are called shadow boundaries. The elements that host shadow trees are called shadow hosts, and the roots of the shadow trees are called shadow roots.

还值得注意的是,有一个 标签 excerpt状态:

The Shadow DOM allows you to include a subtree of DOM elements into the rendering of a document, but not into the main document DOM tree.

它的 wiki 还链接到 http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom其中更详细地描述了 Shadow DOM 的目的和用途。

关于html - "Shadow DOM"的正确含义是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19778172/

相关文章:

html - 如何将常见的 CSS 类应用于阴影元素?

html - 如何将容器定位在 <p> 元素内,文本在其周围流动?

javascript - 添加 jQuery 验证

html - 查看不调整大小的全宽

javascript - 从 JavaScript 访问 DOM 元素并向其发送事件

css - 无法将 margin-top 设置为菜单 div

jquery - 自动将内容从 div 移动到另一个 div

css - 影子 DOM : how to apply CSS style only if the host element is <body>?

javascript - webcomponents - 隐藏 window.onclick 上的下拉菜单

javascript - 登录页面和注册页面我需要将所有内容放在一页中