现在的位置: 首页 > 综合 > 正文

FireFox对TABLE中各元素的firstChild属性的处理(续)

2013年08月07日 ⁄ 综合 ⁄ 共 814字 ⁄ 字号 评论关闭

听说HTML 5.0已经有一段时间了,但是并不知道它到底做了什么改进,这两天就看了下Specification,发现了下面一段话:

The markup snippet at the top of
this section

would be turned into the following DOM tree:

  • DOCTYPE: html

  • html

    • head

      • #text

        : ⏎␣␣

      • title

        • #text

          : Sample page

      • #text

        : ⏎␣

    • #text

      : ⏎␣

    • body

      • #text

        : ⏎␣␣

      • h1

        • #text

          : Sample page

      • #text

        : ⏎␣␣

      • p

        • #text

          : This is a

        • a

          href

          ="demo.html

          "

          • #text

            : simple

        • #text

          : sample.

      • #text

        : ⏎␣␣

      • #comment

        : this is a comment

      • #text

        : ⏎␣⏎

才发现在两个节点中插入一个#text节点是HTML5.0的标准,并不是只针对Table的特殊情况。先BS一下自己孤陋寡闻,继续努力!

由于Firefox 3.5支持HTML5.0,就写了一个简单的程序进行测试,验证了一下:

抱歉!评论已关闭.