[whatwg] Why there is no wrap="off", intentional or forgotten?

Boris Zbarsky bzbarsky at MIT.EDU
Wed Jun 2 13:25:51 PDT 2010


On 6/2/10 10:10 AM, Lachlan Hunt wrote:
> In theory, you can achieve the same effect by using CSS.
>
> textarea { white-space: nowrap; }
>
> This works fine in Opera, WebKit and IE. Doesn't work in Gecko though.

That would be because nothing defines the interaction of CSS with the 
contents of replaced elements (which textarea happens to be in at least 
Gecko, and probably all browsers).  In particular, Gecko's 
implementation actually has a box inside the textarea that has 
white-space styles applied to it based on the textarea's "wrap" attribute.

If you think that the above style should do something to <textarea>, 
then the HTML spec needs to explicitly say so, since it's what defines 
how the inside of a textarea is rendered, not CSS per se.

-Boris



More information about the whatwg mailing list