问题描述
可能有人试图向我解释,如何DOM和HTML有关系吗?是另外一个子集,一个比另一个更抽象的概念?是HTML DOM的延伸?或者他们形容,而无关的概念(仅在可以从HTML转换成DOM相关的)?你将如何在一个画面绘制这些2,如果你不得不..?
Could someone try to explain to me, how are DOM and HTML related? Is one subset of another, is one a more abstract concept than the another? Is HTML an extension of DOM? Or do they describe rather unrelated concepts (related only in that you can transform from HTML into DOM)? How would you draw these 2 in one picture if you had to..?
例如,什么是这些差异规范的目的。姓和链接包含有关HTML元素。
For example, what is the purpose of these difference specs. Both first and last links contain information about HTMLElement..
- http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/
- http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/
- http://www.w3.org/TR/html5/
我发现了一个可能的答案在这里这个问题:http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-1176245063-h2,这是
I found a possible answer to this question here: http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-1176245063-h2, which is
具体的HTML DOM API的目标是:
- 要专注,并补充说,具体涉及到HTML文档和元素的功能
- ...
- 来提供关于HTML文档的便利机制,在适当情况下,供通用或频繁操作。
这是否意味着,在上面的列表中的第三个环节扩展了DOM核心,这是在第一环节中描述?
Does this mean that the 3rd link in the list above extends the DOM Core, which is described in the 1st link?
或者,如果你实现DOM核心,这让您操作简单的文档,但是如果您实现HTML,这让你像一个超级-DOM,让您操作更复杂的对象吗?
Or if you implement DOM Core, that allows you to manipulate simple documents, but if you implement HTML, that gives you like a super-DOM that allows you to manipulate more complicated objects?
最后,说你想实现自己的浏览器能够打开只有HTML5网站(渲染,以及支持JavaScript的)。是否足以读取在第三环节中发现的规范,还是你首先需要实现DOM提供的一切,然后实现HTML5具体的事情...
Finally, say you want to implement your own browser that is able to open only HTML5 websites (render, as well as support JavaScript). Is it enough to read the specification found in the 3rd link, or do you first need to implement everything provided in DOM and then implement HTML5 specific things...
正如你可以看到我很困惑,所以很难制定合适的问题:)
As you can see I'm quite confused, so it's hard to formulate proper questions :)
更新
我猜我想了解一下DOM API和HTML API和HTML DOM API VS HTML DOM API =)
UPDATEI guess I'm wondering about DOM API vs HTML API vs DOM HTML API vs HTML DOM API =)
推荐答案
在短:
中的HTML标准定义的HTML语言 - 这标签/属性的存在,他们的意思
The HTML standards define the HTML language - which tags / attributes exist and what they mean.
的DOM标准定义了通过从浏览器的DOM对象树中的对象实现的接口。 (网络浏览器解析HTML源代码code和创建基于它的一个对象树。该树的对象有哪些是通过DOM(及其他)的标准定义的属性。)
The DOM standards define interfaces that are implemented by the objects from the DOM object tree in the browser. (The web-browser parses the HTML source code and creates an object tree based on it. The objects in that tree have properties which are defined by DOM (and other) standards.)
HTML5标准还定义了,这不是之前定义的东西接口 - 如窗口对象,导航和历史记录对象,全局函数一样警惕,及时,超时功能等。
The HTML5 standard also defines interfaces for stuff that wasn't defined before - like the window object, the navigator and history object, global functions like alert and prompt, timeout functions, etc.
不同的标准不是彼此的子集 - 他们定义了一块全貌的只是不同的标准。
The different standards are not subsets of each other - they are just distinct standards that define a piece of the whole picture.
这篇关于通过DOM和HTML的关系混淆(API)的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!