Short URL: http://html5.org/r/2801
| SVN | Bug | Comment | Time (UTC) |
|---|---|---|---|
| 2801 | spellcheck='' attribute | 2009-02-12 10:36 |
Index: source
===================================================================
--- source (revision 2800)
+++ source (revision 2801)
@@ -7061,6 +7061,7 @@
attribute DOMString <span title="dom-contentEditable">contentEditable</span>;
readonly attribute boolean <span title="dom-isContentEditable">isContentEditable</span>;
attribute <span>HTMLMenuElement</span> <span title="dom-contextMenu">contextMenu</span>;
+ attribute boolean <span title="dom-spellcheck">spellcheck</span>;
// <span>styling</span>
readonly attribute <span>CSSStyleDeclaration</span> <span title="dom-style">style</span>;
@@ -7121,6 +7122,7 @@
<dd><code title="attr-hidden">hidden</code></dd>
<dd><code title="attr-lang">lang</code></dd>
<dd><code title="attr-style">style</code></dd>
+ <dd><code title="attr-spellcheck">spellcheck</code></dd>
<dd><code title="attr-tabindex">tabindex</code></dd>
<dd><code title="attr-title">title</code></dd>
</dl>
@@ -35558,7 +35560,7 @@
<code>datagrid</code> element (the <code>select</code> or
<code>datalist</code> element), that skips all nodes other than
<code>optgroup</code> and <code>option</code> elements, as well as
- any descendents of any <code>option</code> elements.</p>
+ any descendants of any <code>option</code> elements.</p>
<p>Given a path <var title="">row</var>, the corresponding element
is the one obtained by drilling into the view, taking the child
@@ -35855,7 +35857,7 @@
<p>If the first element child of a cell's element is a
<code>select</code> element that has a no <code
title="attr-select-multiple">multiple</code> attribute and has at
- least one <code>option</code> element descendent, then the cell
+ least one <code>option</code> element descendant, then the cell
acts as a cyclable cell.</p>
<p>The "current" <code>option</code> element is the selected
@@ -35881,9 +35883,9 @@
element such that the next <code>option</code> element after the
current <code>option</code> element is the only one that is
selected (in <span>tree order</span>). If the current <code>option</code>
- element is the last <code>option</code> element descendent of the
+ element is the last <code>option</code> element descendant of the
<code>select</code>, then the first <code>option</code> element
- descendent must be selected instead.</p>
+ descendant must be selected instead.</p>
<p>The <code
title="dom-provider-setCellCheckedState">setCellCheckedState()</code>
@@ -38515,8 +38517,10 @@
<li><code>input</code> elements to which the <code
title="attr-input-readonly">readonly</code> attribute applies,
but that are not <i title="concept-input-immutable">immutable</i>
- (i.e. that do not have the attribute specified and that are not
- <span title="concept-fe-disabled">disabled</span>)</li>
+ (i.e. that do not have the <code
+ title="attr-input-readonly">readonly</code> attribute specified
+ and that are not <span
+ title="concept-fe-disabled">disabled</span>)</li>
<li><code>textarea</code> elements that do not have a <code
title="attr-textarea-readonly">readonly</code> attribute, and
@@ -49401,6 +49405,205 @@
+ <h3>Spelling and grammar checking</h3>
+
+ <p>User agents can support the checking of spelling and grammar of
+ editable text, either in form controls (such as the value of
+ <code>textarea</code> elements), or in elements in an <span>editing
+ host</span> (using <code
+ title="attr-contenteditable">contenteditable</code>).</p>
+
+ <p>For each element, user agents must establish a <dfn
+ title="concept-spellcheck-default">default behavior</dfn>, either
+ through defaults or through preferences expressed by the user. There
+ are three possible default behaviors for each element:</p>
+
+ <dl>
+
+ <dt><dfn title="concept-spellcheck-default-true">true-by-default</dfn>
+
+ <dd>The element will be checked for spelling and grammar if its
+ contents are editable.
+
+ <dt><dfn title="concept-spellcheck-default-false">false-by-default</dfn>
+
+ <dd>The element will never be checked for spelling and grammar.
+
+ <dt><dfn title="concept-spellcheck-default-inherit">inherit-by-default</dfn>
+
+ <dd>The element's default behavior is the same asits parent
+ element's. Elements that have no parent element cannot have this as
+ their default behavior.
+
+ </dl>
+
+ <hr>
+
+ <p>The <dfn title="attr-spellcheck"><code>spellcheck</code></dfn>
+ attribute is an <span>enumerated attribute</span> whose keywords are
+ <code title="">true</code> and <code
+ title="">false</code>. The <code
+ title="">true</code> keyword map to the <i>true</i> state. The <code
+ title="">false</code> keyword maps to the <i>false</i> state. In
+ addition, there is a third state, the <i>inherit</i> state, which is
+ the <i>missing value default</i> (and the <i>invalid value
+ default</i>).</p>
+
+ <hr>
+
+ <p>The <dfn title="dom-spellcheck"><code>spellcheck</code></dfn> DOM
+ attribute, on getting, must return true if the element's <code
+ title="attr-spellcheck">spellcheck</code> content attribute is in
+ the <i>true</i> state, or if the element's <code
+ title="attr-spellcheck">spellcheck</code> content attribute is in
+ the <i>inherit</i> state and the element's <span
+ title="concept-spellcheck-default">default behavior</span> is <span
+ title="concept-spellcheck-default-true">true-by-default</span>, or
+ if the element's <code title="attr-spellcheck">spellcheck</code>
+ content attribute is in the <i>inherit</i> state and the element's
+ <span title="concept-spellcheck-default">default behavior</span> is
+ <span
+ title="concept-spellcheck-default-inherit">inherit-by-default</span>
+ and the element's parent element's <code
+ title="dom-spellcheck">spellcheck</code> DOM attribute would return
+ true; otherwise, if none of those conditions applies, then the
+ attribute must instead return false.</p>
+
+ <p class="note">The <code title="dom-spellcheck">spellcheck</code>
+ DOM attribute is not affected by user preferences that override the
+ <code title="attr-spellcheck">spellcheck</code> content attribute,
+ and therefore might not reflect the actual spellchecking state.</p>
+
+ <p>On setting, if the new value is true, then the element's <code
+ title="attr-spellcheck">spellcheck</code> content attribute must be
+ set to the literal string "<code title="">true</code>", otherwise it
+ must be set to the literal string "<code title="">false</code>".
+
+ <hr>
+
+ <p>User agents must only consider the following pieces of text as
+ checkable for the purposes of this feature:</p>
+
+ <ul>
+
+ <li>The value of <code>input</code> elements to which the <code
+ title="attr-input-readonly">readonly</code> attribute applies, but
+ that are not <i title="concept-input-immutable">immutable</i>
+ (i.e. that do not have the <code
+ title="attr-input-readonly">readonly</code> attribute specified and
+ that are not <span
+ title="concept-fe-disabled">disabled</span>).</li>
+
+ <li>The value of <code>textarea</code> elements that do not have a
+ <code title="attr-textarea-readonly">readonly</code> attribute and
+ that are not <span
+ title="concept-fe-disabled">disabled</span>.</li>
+
+ <li>Text in <span title="text node">text nodes</span> that are
+ children of <span>editable</span> elements.</li>
+
+ <li>Text in attributes of <span>editable</span> elements.</li>
+
+ </ul>
+
+ <p>For text that is part of a <span>text node</span>, 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 <code>input</code> and
+ <code>textarea</code> elements, it is the element itself.</p>
+
+ <p>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:</p>
+
+ <ol>
+
+ <!-- user override -->
+
+ <li>If the user has disabled the checking for this text, then the
+ checking is disabled.</li>
+
+ <li>Otherwise, if the user has forced the checking for this text to
+ always be enabled, then the checking is enabled.</li>
+
+ <!-- content attribute: on, off -->
+
+ <li>Otherwise, if the element with which the text is associated has
+ a <code title="attr-spellcheck">spellcheck</code> content
+ attribute, then: if that attribute is in the <i>true</i> state,
+ then checking is enabled; otherwise, if that attribute is in the
+ <i>false</i> state, then checking is disabled.</li>
+
+ <!-- inherit, if there is one to inherit from -->
+
+ <li>Otherwise, if there is an ancestor element with a <code
+ title="attr-spellcheck">spellcheck</code> content attribute that is
+ not in the <i>inherit</i> state, then: if the nearest such
+ ancestor's <code title="attr-spellcheck">spellcheck</code> content
+ attribute is in the <i>true</i> state, then checking is enabled;
+ otherwise, checking is disabled.</li>
+
+ <!-- default -->
+
+ <li>Otherwise, if the element's <span
+ title="concept-spellcheck-default">default behavior</span> is <span
+ title="concept-spellcheck-default-true">true-by-default</span>,
+ then checking is enabled.</li>
+
+ <li>Otherwise, if the element's <span
+ title="concept-spellcheck-default">default behavior</span> is <span
+ title="concept-spellcheck-default-false">false-by-default</span>,
+ then checking is disabled.</li>
+
+ <!-- default inheritance -->
+
+ <li>Otherwise, if the element's parent element has <em>its</em>
+ checking enabled, then checking is enabled.</li>
+
+ <li>Otherwise, checking is disabled.</li>
+
+ </ol>
+
+ <p>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
+ <code>input</code> element attributes such as <code
+ title="attr-input-pattern">pattern</code> to ensure that the
+ resulting value is valid, where possible.</p>
+
+ <p>If checking is disabled, the user agent should not indicate
+ spelling or grammar errors for that text.</p>
+
+ <div class="example">
+
+ <p>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.</p>
+
+ <pre><div contenteditable="true">
+ <span spellcheck="false" id="a">Hell</span><em>o!</em>
+</div></pre>
+
+ <p>The element with ID "b" in the following example would have
+ checking enabled (the leading space character in the attribute's
+ value on the <code>input</code> element causes the attribute to be
+ ignored, so the ancestor's value is used instead, regardless of the
+ default).</p>
+
+ <pre><p spellcheck="true">
+ <label>Name: <input spellcheck=" false" id="b"></label>
+</p></pre>
+
+ </div>
+
+
+
<h3 id="dnd"><dfn>Drag and drop</dfn></h3>
<!--XXX
@@ -62266,7 +62469,7 @@
"<code title="">center</code>", are expected to center text within
themselves, as if they had their 'text-align' property set to
'center' in a <span title="presentational hints">presentational
- hint</span>, and to <span>align descendents</span> to the center.</p>
+ hint</span>, and to <span>align descendants</span> to the center.</p>
<p>The <code>div</code>, <code>caption</code>, <code>thead</code>,
<code>tbody</code>, <code>tfoot</code>, <code>tr</code>,
@@ -62276,7 +62479,7 @@
title="">left</code>", are expected to left-align text within
themselves, as if they had their 'text-align' property set to 'left'
in a <span title="presentational hints">presentational hint</span>,
- and to <span>align descendents</span> to the left.</p>
+ and to <span>align descendants</span> to the left.</p>
<p>The <code>div</code>, <code>caption</code>, <code>thead</code>,
<code>tbody</code>, <code>tfoot</code>, <code>tr</code>,
@@ -62286,7 +62489,7 @@
title="">right</code>", are expected to right-align text within
themselves, as if they had their 'text-align' property set to
'right' in a <span title="presentational hints">presentational
- hint</span>, and to <span>align descendents</span> to the right.</p>
+ hint</span>, and to <span>align descendants</span> to the right.</p>
<p>The <code>div</code>, <code>caption</code>, <code>thead</code>,
<code>tbody</code>, <code>tfoot</code>, <code>tr</code>,
@@ -62296,10 +62499,10 @@
title="">justify</code>", are expected to full-justify text within
themselves, as if they had their 'text-align' property set to
'justify' in a <span title="presentational hints">presentational
- hint</span>, and to <span>align descendents</span> to the left.</p>
+ hint</span>, and to <span>align descendants</span> to the left.</p>
- <p>When a user agent is to <dfn>align descendents</dfn> of a node,
- the user agent is expected to align only those descendents that have
+ <p>When a user agent is to <dfn>align descendants</dfn> of a node,
+ the user agent is expected to align only those descendants that have
both their 'margin-left' and 'margin-right' properties computing to
a value other than 'auto', that are over-constrained and that have
one of those two margins with a used value forced to a greater