HTML5 拼写检查属性的值 [英] Values for the HTML5 spellcheck attribute

查看:29
本文介绍了HTML5 拼写检查属性的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

拼写检查属性的默认值是多少?连同它的其他值.

What is the default value for the spellcheck attribute? Along with its other values.

推荐答案

我强烈建议 查看规范 以了解以下问题:

I would strongly suggest looking at the spec for questions like these:

拼写检查属性是一个枚举属性,其关键字为空字符串,真假.空字符串和 true 关键字映射到真实状态.false 关键字映射到 false 状态.另外还有第三种状态,默认状态,即缺失值默认(和无效值默认).

The spellcheck attribute is an enumerated attribute whose keywords are the empty string, true and false. The empty string and the true keyword map to the true state. The false keyword maps to the false state. In addition, there is a third state, the default state, which is the missing value default (and the invalid value default).

已编辑以获取更多信息:

规范还指出

默认状态表示元素根据默认行为进行操作,可能基于父元素自己的拼写检查状态

The default state indicates that the element is to act according to a default behavior, possibly based on the parent element's own spellcheck state

此外,在规范的其他地方,它声明对于每个元素,用户代理必须建立默认行为";它是 true-by-defaultfalse-by-defaultinherit-by-default.所以这取决于用户代理.用户可以禁用拼写检查,这可能会影响该值.

Also, elsewhere in the spec, it states "For each element, user agents must establish a default behavior" which is either true-by-default, false-by-default, or inherit-by-default. So it is up to the user agent. Users may disable spellchecking, which will probably affect this value.

我不认为规范说明是否有任何元素必须是 true-by-default(或任何其他特定值),但确实说明:

I don't think the spec says whether any elements must be true-by-default (or any other specific value), but it does say:

出于此功能的目的,用户代理必须仅将以下文本视为可检查的.

User agents must only consider the following pieces of text as checkable for the purposes of this feature.

  • readonly 属性适用的 input 元素的值,其类型属性不处于 Password 状态,并且不是不可变的(即,没有指定 readonly 属性并且未禁用).
  • 没有 readonly 属性且未被禁用的 textarea 元素的值.
  • 作为可编辑元素的子元素的文本节点中的文本.
  • 可编辑元素的属性中的文本.

这篇关于HTML5 拼写检查属性的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆