Values for the HTML5 spellcheck attribute
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:
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).
Edited for more info:
The spec also states that
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
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.
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.
- The value of input elements to which the readonly attribute applies, whose type attributes are not in the Password state, and that are not immutable (i.e. that do not have the readonly attribute specified and that are not disabled).
- The value of textarea elements that do not have a readonly attribute and that are not disabled.
- Text in text nodes that are children of editable elements.
- Text in attributes of editable elements.
Default values:
- Firefox: https://developer.mozilla.org/en-US/docs/HTML/Global_attributes#attr-spellcheck
- IE: http://msdn.microsoft.com/en-us/library/ie/hh772928(v=vs.85).aspx
精彩评论