html字段长度限制,HTML属性的长度是否有限制?

HTML 4

从HTML 4的角度来看,属性是一个SGML构造。它们的极限定义在SGML Declaration of HTML 4:

QUANTITY SGMLREF

ATTCNT 60 -- increased --

ATTSPLEN 65536 -- These are the largest values --

LITLEN 65536 -- permitted in the declaration --

NAMELEN 65536 -- Avoid fixed limits in actual --

PILEN 65536 -- implementations of HTML UA's --

TAGLVL 100

TAGLEN 65536

GRPGTCNT 150

GRPCNT 64

这里的值是“ATTSPLEN”,这将是元素的属性规范列表(其应该是该元素的所有属性的总大小)的限制。上面的注释提到,应该避免固定的限制,但是,所以很可能除了可用的内存在大多数实现没有真正的限制。

HTML 5

HTML 5似乎不同,因为the spec说,“这个版本的HTML因此返回到非SGML基础。

稍后,当描述如何解析HTML 5时,出现以下段落(着重添加):

The algorithm described below places

no limit on the depth of the DOM tree

generated, or on the length of tag

names, attribute names, attribute

values, text nodes, etc. While

implementors are encouraged to avoid

arbitrary limits, it is recognized

that practical concerns will likely

force user agents to impose nesting

depth constraints.

所以我想这是你的答案。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值