Re: [css-flexbox] Textarea as a flex container

On 10/13/15 12:17 PM, John Waterson wrote:
> Many thanks Boris, although I'm still slightly puzzled, because
> textarea is explicitly listed under the "non-replaced elements"
> section of the HTML5 Rendering spec (see here:
> http://www.w3.org/TR/html5/rendering.html#form-controls).

Yes, that part of HTML simply doesn't match reality as far as I can 
tell.  There are longstanding spec issues on HTML for that...

> and I thought that particular bit of HTML5 had now
> formalised the fact that they should now be treated as non-replaced.

Except browsers treat them as replaced, and the "treat them as 
non-replaced" approach isn't really defined apart from some handwaving 
_and_ leads to some backwards-incompatible behavior (e.g. in the way 
absolutely positioned textareas are sized).  Simple testcase:

   <textarea style="position: absolute; left: 0; right: 0"></textarea>

(which all browsers except Safari render the way CSS says replaced 
elements should be rendered).

> I was/am completely unaware of your second point, about the difference
> between a textarea's rendering and its DOM nodes. Not sure I fully
> understand the implications.

This is the part that the HTML spec tries to handwave away but doesn't 
really define.  But basically, non-replaced elements in CSS do something 
with their DOM kids to render them.  That's not what <textarea> does. 
<textarea>'s behavior with regards to what text it renders _could_ be 
described in terms of something like shadow DOM

> However, taken in conjunction with the
> above point about it being non-replaced, I *think* this suggests that
> textarea's resistance to CSS-styling is an implementation detail,
> rather than an intention of the spec. Is that fair?

What we have are two specifications which disagree on how this should be 
handled, and one of which disagrees with longstanding browser behavior. 
  Make of that what you will; guessing at "intention" is hard as usual.

-Boris

Received on Tuesday, 13 October 2015 16:41:05 UTC