If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

white-space: pre textarea behavior inconsistent with other browsers




Layout: Form Controls
3 years ago
3 years ago


(Reporter: fireattack, Unassigned)


38 Branch
Windows 8.1

Firefox Tracking Flags

(Not tracked)




3 years ago
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0
Build ID: 20150409144858

Steps to reproduce:

See: http://jsfiddle.net/1cja691a/

Since the default css of textarea "word-wrap: break-word" is somehow conflict with "white-space: pre" (according to http://stackoverflow.com/questions/4413015/browser-compatible-word-wrap-and-whitespace-pre ), the result is very different on various browsers. However, only the Firefox's behavior is different from others (IE, Chrome).


3 years ago
Component: Untriaged → Layout
Product: Firefox → Core
See the long discussion and various testcases in bug 82711.  The white-space handling we have matches Safari and basic sanity, and indcidentally the spec, exactly.  The only difference is the handling of the interaction of "word-wrap: break-word" and "white-space: pre".

As far as that interaction goes, http://dev.w3.org/csswg/css-text-3/#white-space-property is very clear that "white-space: pre" means that only forced linebreaks are taken, and http://dev.w3.org/csswg/css-text-3/#line-breaking is clear about wrapping introducing soft breaks, not forced breaks.

Furthermore, http://dev.w3.org/csswg/css-text-3/#overflow-wrap-property is very clear about it only having an effect when the white-space value allows wrapping.

So as far as I can tell, we're just doing exactly what the specs say to do here.  What exact behavior change are you proposing we make?
Component: Layout → Layout: Form Controls
You need to log in before you can comment on or make changes to this bug.