Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define contenteditable plaintext-only state #8275

Merged
merged 6 commits into from
Mar 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 26 additions & 17 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -78079,15 +78079,18 @@ addShortcutKeyLabel(document.getElementById('c'));</code></pre>
<p>The <dfn element-attr for="html-global"><code
data-x="attr-contenteditable">contenteditable</code></dfn> content attribute is an
<span>enumerated attribute</span> whose keywords are the empty string, <code
data-x="">true</code>, and <code data-x="">false</code>. The empty string and the <code
data-x="">true</code> keyword map to the <i>true</i> state. The <code data-x="">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 data-x="missing value default">missing value default</i> and the <i
data-x="invalid value default">invalid value default</i>.</p>
data-x="">true</code>, <code data-x="">plaintext-only</code> and <code data-x="">false</code>.
The empty string and the <code data-x="">true</code> keyword map to the <i>true</i> state.
The <code data-x="">plaintext-only</code> keyword maps to the <i>plaintext-only</i> state.
The <code data-x="">false</code> keyword maps to the <i>false</i> state. In addition, there is a
fourth state, the <i>inherit</i> state, which is the <i data-x="missing value default">missing
domenic marked this conversation as resolved.
Show resolved Hide resolved
value default</i> and the <i data-x="invalid value default">invalid value default</i>.</p>

<p>The <i>true</i> state indicates that the element is editable. The <i>inherit</i> state
indicates that the element is editable if its parent is. The <i>false</i> state indicates that the
element is not editable.</p>
<p>The <i>true</i> state indicates that the element is editable. The <i>plaintext-only</i> state
indicates that only the element's raw text content is editable, but rich text formatting is
disabled. The <i>inherit</i> state indicates that the element is the same kind of editable (or
not editable) as the parent element. The <i>false</i> state indicates that the element is not
editable.</p>

<div class="example">
<p>For example, consider a page that has a <code>form</code> and a <code>textarea</code> to
Expand Down Expand Up @@ -78148,8 +78151,8 @@ body { display:none }
<dt><code data-x=""><var>element</var>.<span subdfn data-x="dom-contentEditable">contentEditable</span> [ = <var>value</var> ]</code></dt>

<dd>
<p>Returns "<code data-x="">true</code>", "<code data-x="">false</code>", or "<code
data-x="">inherit</code>", based on the state of the <code
<p>Returns "<code data-x="">true</code>", "<code data-x="">plaintext-only</code>", "<code
data-x="">false</code>", or "<code data-x="">inherit</code>", based on the state of the <code
data-x="attr-contenteditable">contenteditable</code> attribute.</p>

<p>Can be set, to change that state.</p>
Expand All @@ -78168,15 +78171,19 @@ body { display:none }
<p>The <dfn attribute for="ElementContentEditable"><code
data-x="dom-contentEditable">contentEditable</code></dfn> IDL attribute, on getting, must return
the string "<code data-x="">true</code>" if the content attribute is set to the true state, "<code
data-x="">false</code>" if the content attribute is set to the false state, and "<code
data-x="">plaintext-only</code>" if the content attribute is set to the plaintext-only state,
"<code data-x="">false</code>" if the content attribute is set to the false state, and "<code
data-x="">inherit</code>" otherwise. On setting, if the new value is an <span>ASCII
case-insensitive</span> match for the string "<code data-x="">inherit</code>" then the content
attribute must be removed, if the new value is an <span>ASCII case-insensitive</span> match for
the string "<code data-x="">true</code>" then the content attribute must be set to the string
"<code data-x="">true</code>", if the new value is an <span>ASCII case-insensitive</span> match
for the string "<code data-x="">false</code>" then the content attribute must be set to the string
"<code data-x="">false</code>", and otherwise the attribute setter must throw a
<span>"<code>SyntaxError</code>"</span> <code>DOMException</code>.</p>
for the string "<code data-x="">plaintext-only</code>" then the content attribute must be set to
the string "<code data-x="">plaintext-only</code>", if the new value is an
<span>ASCII case-insensitive</span> match for the string "<code data-x="">false</code>" then the
content attribute must be set to the string "<code data-x="">false</code>", and otherwise the
attribute setter must throw a <span>"<code>SyntaxError</code>"</span>
<code>DOMException</code>.</p>

<p>The <dfn attribute for="ElementContentEditable"><code
data-x="dom-isContentEditable">isContentEditable</code></dfn> IDL attribute, on getting, must
Expand Down Expand Up @@ -78275,8 +78282,9 @@ body { display:none }

<p>An <dfn export>editing host</dfn> is either an <span data-x="HTML elements">HTML element</span>
with its <code data-x="attr-contenteditable">contenteditable</code> attribute in the <i>true</i>
state, or a <span data-x="concept-tree-child">child</span> <span data-x="HTML elements">HTML
element</span> of a <code>Document</code> whose <span>design mode enabled</span> is true.</p>
state or <i>plaintext-only</i> state, or a <span data-x="concept-tree-child">child</span> <span
data-x="HTML elements">HTML element</span> of a <code>Document</code> whose <span>design mode
enabled</span> is true.</p>

<p>The definition of the terms <dfn
data-x-href="https://w3c.github.io/editing/docs/execCommand/#active-range">active range</dfn>, <dfn
Expand Down Expand Up @@ -125104,7 +125112,8 @@ interface <dfn interface>External</dfn> {
<th> <code data-x="">contenteditable</code>
<td> <span data-x="attr-contenteditable">HTML elements</span>
<td> Whether the element is editable
<td> "<code data-x="">true</code>"; "<code data-x="">false</code>"
<td> "<code data-x="">true</code>"; "<code data-x="">plaintext-only</code>";
"<code data-x="">false</code>"
<tr>
<th> <code data-x="">controls</code>
<td> <code data-x="attr-media-controls">audio</code>;
Expand Down