问题描述
。
IE9和Chrome14日志< table> $ c $>中元素的
TBODY
作为 tagName
c>
上的HTML5规范明确指出:
此外。 明确指出:
为什么浏览器会破坏我的DOM并注入一个 when
- 我没有要求一个
- 这是完全有效的,没有一个
- I did not ask for one
- It's perfectly valid without one
向后兼容的答案绝对是零的意义,因为我专门选择了一个HTML5文档类型。
但是,浏览器不区分HTML版本。使用HTML5 doctype和HTML4 doctype的HTML文档(除了FPI中没有URL的HTML4过渡文档类型的小例外)被解析并以相同方式呈现。
我会引用:
Both IE9 and Chrome14 log TBODY
as the tagName
of the element inside the <table>
The HTML5 spec on <table>
clearly states :
Furthermore. The HTML5 spec on <tr>
clearly states :
Why are browsers corrupting my DOM and injecting a <tbody>
when
The answer of "backwards compatiblity" makes absolutely zero sense because I specifically opted in for a HTML5 doctype.
However, browsers don't differentiate between versions of HTML. HTML documents with HTML5 doctype and with HTML4 doctype (with the small exception of HTML4 transitional doctype without URL in FPI) are parsed and rendered the same way.
I'll quote the relevant part of HTML5 parser description:
这篇关于为什么浏览器仍然注入< tbody>>在HTML5中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!