Skip to content

contenteditable=plaintext-only should be white-space: pre-wrap by default #11350

Open
@zcorpan

Description

@zcorpan

What is the issue with the HTML Standard?

In Gecko and WebKit today, <div contenteditable=plaintext-only> without author CSS gets white-space: normal which makes Enter insert <br> elements instead of LF.

In Chromium, some values of white-space in a plaintext-only element are forced to pre-wrap.

OK, though forcing computed style is "magic". Maybe it's enough to have a normal UA style rule?

[contenteditable="plaintext-only" i] { white-space: pre-wrap; }

If developers set it back to normal then they get <br>s.

Originally posted by @zcorpan in w3c/editing#419 (comment)

@masayuki-nakano said he prefers a UA rule over Chrome's behavior of forcing computed style.

cc @tkent-google

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions