As of November 14th 2024, this explainer has been replaced with HandwritingIntentCSSValue which proposes a new keyword for the touch-action CSS attribute.
Consider all sections required unless otherwise noted.
Authors: Rahul Arakeri, Adam Ettenberger, Ben Mathwig, Jenny Ma
This document is a starting point for engaging the community and standards bodies in developing collaborative solutions fit for standardization. As the solutions to problems described in this document progress along the standards-track, we will retain this document as an archive and use this section to keep the community up-to-date with the most current standards venue and content location of future work and discussions.
A new web standard mechanism is needed to indicate whether an element or its subtree should allow user agent handwriting input.
Authors may need to exclude an editable text element from handwriting input for UX or app behavioral reasons.
This will be useful for developers of text-editing apps, drawing apps, or apps with their own stylus-optimized input handling.
Give authors granular per-document and per-element control over which content should (dis)allow handwriting input.
Some scenarios where a website or application may want to disable handwriting input:

composition{start|end|update} events, or if for any reason the experience designed by website authors doesn't behave as they intend when handwriting input is available.
Introduce a new HTMLElement HTML+IDL attribute which allows authors to specify whether an element should (dis)allow handwriting input.
The handwriting attribute is an enumerated attribute with the following keywords and states:
| Keyword | State | Brief Description |
|---|---|---|
| false | false |
The element will not allow handwriting input even when supported by the user agent. |
| true | true |
The element will allow handwriting input if supported by the user agent. |
| (the empty string) | true |
The element will allow handwriting input if supported by the user agent. |
The attribute's missing value default is the default state and the attribute's invalid value default is the true state.
The computed handwriting value of a given element can be determined by running the following steps:
element's handwriting content attribute is in the false state, return "false".element's handwriting content attribute is in the default state, element has a parent element, and the computed handwriting value of element's parent element is "false", then return "false".All HTML elements may have the handwriting attribute set. See "Keywords and States" for accepted values.
<textarea></textarea> <!-- the computed handwriting value is true -->
<textarea handwriting></textarea> <!-- the computed handwriting value is true -->
<textarea handwriting=""></textarea> <!-- the computed handwriting value is true -->
<textarea handwriting="true"></textarea> <!-- the computed handwriting value is true -->
<textarea handwriting="false"></textarea> <!-- the computed handwriting value is false -->
<div handwriting="false">
<textarea></textarea> <!-- the computed handwriting value is false -->
<textarea handwriting></textarea> <!-- the computed handwriting value is true -->
<textarea handwriting=""></textarea> <!-- the computed handwriting value is true -->
<textarea handwriting="true"></textarea> <!-- the computed handwriting value is true -->
<textarea handwriting="false"></textarea> <!-- the computed handwriting value is false -->
</div>
The HTMLElement handwriting attribute will be exposed as an IDL attribute to JavaScript with the type DOMString, similar to the writingsuggestions or contenteditable attributes.
When getting the IDL attribute, the computed handwriting value will be returned, see the "Computed Value" section for details.
When setting the IDL attribute, the HTML attribute is updated to the assigned string value.
var element = document.createElement("div");
console.assert(typeof(element.handwriting) == "string");
console.assert(!element.hasAttribute("handwriting"));
console.assert(element.handwriting == "true");
element.handwriting = "true";
console.assert(element.getAttribute("handwriting") == "true");
console.assert(element.handwriting == "true");
element.handwriting = false;
console.assert(element.getAttribute("handwriting") == "false");
console.assert(element.handwriting == "false");
element.handwriting = "unexpected";
console.assert(element.getAttribute("handwriting") == "unexpected");
console.assert(element.handwriting == "true");
Since the proposed HTML+IDL attribute should not interact with other HTML or IDL attributes, DOM properties, CSS properties, or JavaScript APIs in an interesting way, and the attribute doesn't reflect whether a user agent supports or has enabled handwriting input, it shouldn't be possible to use this for fingerprinting. As of writing this, I'm not aware of any way the proposed attribute could be used towards nefarious means since it's merely a hint for the browser to (dis)allow handwriting input and the handwriting state doesn't expose anything about the user nor their device.
There are no known security impacts of the features in this specification.
The proposal is for this to be an HTML+IDL attribute.
Why not a JavaScript API? (e.g., e.enableHandwriting() or e.setHandwritingState(...), e.getHandwritingState() and e.getComputedHandwritingValue())
Why not a CSS property?
Why not some combination of all the above?
handwriting state.Why not extend an existing attribute or property?
inputmode
type. Is only concerned with virtual keyboard inputs.pointer-events:
touch-action:
touch-action acts like an inherited attribute.touch-action property is it's defined with conflicting "opt-in" and "opt-out" behaviors.
auto) is "out-out", meaning the user agent will perform all touch gestures on behalf of the application.pinch-zoom may specify touch-action: pan-x pan-y;, adding support for any new keywords such as handwriting would cause such applications to disable their user agent behaviors without additional consideration.touch-action were defined such that specifying a value disabled user agent handling of specified gestures, it would consistently behave as "opt-out" and would be a great candidate for disabling handwriting input without affecting existing applications.touch-action doesn't have the pan gesture enabled, which behaves very similar to this proposal.