This is revision 1.5612.
The definition of the terms active range, editing
host, and editable, the user interface requirements
of elements that are editing hosts
or editable, the
methods, and text selections are defined in the HTML Editing APIs
specification. The interaction of editing and the undo/redo features
in user agents is defined by the UndoManager and DOM Transaction
specification. [EDITING] [UNDO]
User agents can support the checking of spelling and grammar of
editable text, either in form controls (such as the value of
textarea elements), or in elements in an editing
host (e.g. using
For each element, user agents must establish a default behavior, either through defaults or through preferences expressed by the user. There are three possible default behaviors for each element:
attribute is an enumerated attribute whose keywords are
the empty string,
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
The true state indicates that the element is
to have its spelling and grammar checked. 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, as defined below.
The false state indicates that the element is not to be
spellcheck[ = value ]
Returns true if the element is to have its spelling and grammar checked; otherwise, returns false.
Can be set, to override the default and set the
spellcheck content attribute.
attribute, on getting, must return true if the element's
spellcheck content attribute is in
the true state, or if the element's
spellcheck content attribute is in
the default state and the element's default behavior is true-by-default, or
if the element's
content attribute is in the default state and the element's
default behavior is
and the element's parent element's
spellcheck IDL attribute would return
true; otherwise, if none of those conditions applies, then the
attribute must instead return false.
On setting, if the new value is true, then the element's
spellcheck content attribute must be
set to the literal string "
true", otherwise it
must be set to the literal string "
User agents must only consider the following pieces of text as checkable for the purposes of this feature:
inputelements to which the
readonlyattribute applies, whose
typeattributes are not in the Password state, and that are not immutable (i.e. that do not have the
readonlyattribute specified and that are not disabled).
textareaelements that do not have a
readonlyattribute and that are not disabled.
Textnodes that are children of editing hosts or editable elements.
For text that is part of a
Text node, the element
with which the text is associated is the element that is the
immediate parent of the first character of the word, sentence, or
other piece of text. For text in attributes, it is the attribute's
element. For the values of
textarea elements, it is the element itself.
To determine if a word, sentence, or other piece of text in an applicable element (as defined above) is to have spelling- and/or grammar-checking enabled, the UA must use the following algorithm:
spellcheckcontent attribute, then: if that attribute is in the true state, then checking is enabled; otherwise, if that attribute is in the false state, then checking is disabled.
spellcheckcontent attribute that is not in the default state, then: if the nearest such ancestor's
spellcheckcontent attribute is in the true state, then checking is enabled; otherwise, checking is disabled.
If the checking is enabled for a word/sentence/text, the user
agent should indicate spelling and/or grammar errors in that
text. User agents should take into account the other semantics given
in the document when suggesting spelling and grammar
corrections. User agents may use the language of the element to
determine what spelling and grammar rules to use, or may use the
user's preferred language settings. UAs should use
input element attributes such as
pattern to ensure that the
resulting value is valid, where possible.
If checking is disabled, the user agent should not indicate spelling or grammar errors for that text.
The element with ID "a" in the following example would be the one used to determine if the word "Hello" is checked for spelling errors. In this example, it would not be.
<div contenteditable="true"> <span spellcheck="false" id="a">Hell</span><em>o!</em> </div>
The element with ID "b" in the following example would have
checking enabled (the leading space character in the attribute's
value on the
input element causes the attribute to be
ignored, so the ancestor's value is used instead, regardless of the
<p spellcheck="true"> <label>Name: <input spellcheck=" false" id="b"></label> </p>
This specification does not define the user interface for spelling and grammar checkers. A user agent could offer on-demand checking, could perform continuous checking while the checking is enabled, or could use other interfaces.