From 4657165008a561cf99f1633127ace4cbeded4520 Mon Sep 17 00:00:00 2001
From: Bo Cupp
- This specification defines an API that indicates to user agents which editing-related commands are applicable to contenteditable regions of a document. User agents SHOULD take this information into account when presenting any editing-related UI to ensure its applicability.
+ This specification defines an API that indicates to user agents which editing-related commands are applicable to contenteditable regions of a document. User agents can take this information into account when presenting any editing-related UI to ensure it is applicable to a given contenteditable region.
- This specification purposefully does not prescribe the means by which a user agent will indicate to the user that some commands are not applicable in a given contenteditable region.
+ This specification purposefully does not prescribe the means by which a user agent will indicate to the user the applicability of any editing command. The user agent could, for example, omit editing UI, disable it, or choose some other appropriate UI treatment.
This is a work in progress and subject to change without warning.
- In contenteditable regions of documents, some user agents provide contextual user interface (UI) elements to help accelerate common editing operations. The UI is meant to enhance the editing experience, but when authors create customized editors that aren’t compatible with user agent UI, it leads to confused users.
+ In contenteditable regions of documents, some user agents provide contextual user interface (UI) elements to help accelerate common editing operations. The UI is meant to enhance the editing experience, but when authors create customized editors that aren't compatible with user agent UI, it leads to confused users.
- WYSIWYG markdown editors provide a canonical example. While markdown editors typically support bold or italicized text, they often don't support font color or font family customization. System or browser UI elements like those shown for iOS or the Mac Touch Bar below don't have any indication as to which formatting commands are applicable to a particular contenteditable element and should be displayed, and which ones should be disabled or omitted.
+ To address the issue, a new `contenteditabledisabled` attribute can be applied as shown in the example below.
- To address the issue, a new contenteditable-disabled attribute can be applied as shown in the example below.
-
- The
- The allowed set of tokens are listed below. Each token matches the name of an Input Type [[input-events-1]], or is a shortcut that is equivalent to specifying a set tokens.
+ The allowed set of tokens are listed below. Each token matches the name of an Input Type, or is a shortcut that is equivalent to specifying a set tokens.
When a token is specified, any user agent-supplied editing UI, that when invoked, would result in a beforeinput event having and inputType that matches one of the tokens in the attribute's value, or matches a token that is represented by a shortcut that is included in the attribute's value, SHOULD be disabled, omitted, or otherwise indicated by the user agent to be not applicable. The exact mechanism for that indication is beyond the scope of this specification.
Abstract
Introduction
- <div contenteditable="true" contenteditable-disabled="
+
+ <div contenteditable="true" contenteditabledisabled="
formatbackcolor
formatdent
formatfont
@@ -107,23 +90,21 @@
Introduction
</div>
-
contenteditable-disabled
DOM Content Attribute.
+ contenteditabledisabled
DOM Content Attribute.
contenteditable-disabled
attribute indicates which user agent-supplied editing UI SHOULD be disabled. If specified, the attribute must have a value that is an unordered
- set of unique space-separated tokens [[HTML]] which
- are ASCII case-insensitive [[INFRA]].
+ The contenteditabledisabled
attribute indicates which user agent-supplied editing UI SHOULD be disabled. When specified, the attribute can contain an [=unordered set of unique space-separated tokens=] that are treated as [=ASCII case-insensitive=].
-
contenteditable-disabled
Allowed Tokens.
+ contenteditabledisabled
Allowed Tokens.
@@ -155,10 +136,10 @@
Issue 249
contenteditable-disabled
Allowed Token Shortcuts.
+ contenteditabledisabled
Allowed Token Shortcuts.
- The following tokens are also supported by the contenteditable-disabled
attribute and serve as shorthands for specifying a set of tokens from contenteditable-disabled Allowed Tokens:
+ The following tokens are also supported by the contenteditabledisabled
attribute and serve as shorthands for specifying a set of tokens from contenteditabledisabled Allowed Tokens:
- The contentEditableDisabled
WebIDL property reflects the contenteditable-disabled DOM content attribute.
+ The contentEditableDisabled
WebIDL property reflects the contenteditabledisabled DOM content attribute.