Skip to content

Editorial: clarify that input constraint validation checks readonly regardless if it applies - #13311

Merged
annevk merged 2 commits into
whatwg:mainfrom
TimvdLippe:clarify-readonly-input
Nov 23, 2026
Merged

annevk merged 2 commits into
whatwg:mainfrom
TimvdLippe:clarify-readonly-input

Conversation

@TimvdLippe

@TimvdLippe TimvdLippe commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

This confused me and has confused others before. Therefore, match the wording with specs such as WebDriver 1 which check whether the readonly attribute is set, regardless if it applies.

Fixes #8133


/input.html ( diff )

…egardless if it applies

This confused me and has confused others before. Therefore, match the
wording with specs such as WebDriver [1] which check whether the
readonly attribute is set, regardless if it applies.

Fixes whatwg#8133

[1]: https://w3c.github.io/webdriver/#dfn-read-only
Comment thread source Resolved
Comment thread source Outdated
features still consider it. If a feature considers <code
data-x="attr-input-readonly">readonly</code> regardless if it <span
data-x="concept-input-apply">applies</span>, it checks if the attribute is set.
</div>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kinda seems reasonable modulo one-space indentation, but also, perhaps this is just a bug we should fix? Seems rather odd that readonly does not apply except for constraint validation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it doesn't apply to at least two cases and I think there are more. servo/servo#50098 is the first bit tackling issues. https://wpt.fyi/results/html/semantics/selectors/pseudo-classes/readwrite-readonly.html?product=servo is another one that I need to look into.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also seems that we decided in #8089 (2022) that we want this to behave this way and I guess I don't really want to revisit that. Trying to figure out a better fix.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I pushed an alternative fix that I think is better. WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that works for me thanks!

@annevk annevk added the topic: forms Forms and form controls: input types, submission, constraint validation and autofill label Nov 23, 2026
@annevk
annevk merged commit 546d834 into whatwg:main Nov 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: forms Forms and form controls: input types, submission, constraint validation and autofill

Development

Successfully merging this pull request may close these issues.

Which input types should readonly affect constraint validation for?

2 participants