Bug 138068 - Contenteditable has break-word and -webkit-line-break by default
Summary: Contenteditable has break-word and -webkit-line-break by default
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2014-10-24 23:12 PDT by Greg Whitworth
Modified: 2022-01-08 23:42 PST (History)
4 users (show)

See Also:

top to bottom: Gecko, Blink, WebKit (64.99 KB, image/png)
2022-01-08 16:13 PST, karl
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Whitworth 2014-10-24 23:12:41 PDT
We have had a couple sites submitted to us that aren't working for our users due to an interop issue between IE/FF & Chrome/Safari. It seems that webkit based browsers add break-word and -webkit-line-break to contenteditable containers by default, where as FF/IE treat them as the boxes that they originally were, just editable. I brought this up to the CSS WG and there was agreement that Blink/Webkit should change to match FF/IE's behavior. Here is a fiddle that shows the issue: http://jsfiddle.net/pfe9mj4o/10/

Here is the W3C thread regarding the issue: http://lists.w3.org/Archives/Public/www-style/2014Oct/0408.html

If you have any questions or comments feel free to reach out to me. Thank you.
Comment 1 karl 2022-01-08 16:12:29 PST
Another possible test
data:text/html,<!doctype html><html><div style="border: 1px solid black; width: 5ch;" contenteditable>AAAAAAA</div>

This is done here. 

        case ContentEditableType::True:
            addPropertyToPresentationalHintStyle(style, CSSPropertyWordWrap, CSSValueBreakWord);
            addPropertyToPresentationalHintStyle(style, CSSPropertyWebkitNbspMode, CSSValueSpace);
            addPropertyToPresentationalHintStyle(style, CSSPropertyLineBreak, CSSValueAfterWhiteSpace);
            addPropertyToPresentationalHintStyle(style, CSSPropertyWebkitTextSizeAdjust, CSSValueNone);

It seems to have been there for a long time. moved from Frame.cpp into HTMLElementImpl.cpp

It was carried away from on Oct 15, 2004

In Gecko the [contenteditable] CSS is available in a dedicated CSS
https://bugzilla.mozilla.org/show_bug.cgi?id=237964 (June 2007)

The discussion on the CSS mailing-list never reached a conclusion. I filed a bug on Firefox. 
Comment 2 karl 2022-01-08 16:13:23 PST
Created attachment 448686 [details]
top to bottom: Gecko, Blink, WebKit

Screenshots showing the issue in the latest version of the browser as of today.
Comment 3 karl 2022-01-08 16:20:26 PST
Google seems to have made attempts at fixing Blink. 
Comment 4 karl 2022-01-08 16:24:59 PST
More recent discussions about this ~2016