Re: [css-flexbox] Should <br> get lumped into a "contiguous run of text" to form an anonymous flex item?

On Jan 22, 2014, at 2:48 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:
> 
>> On Wed, Jan 22, 2014 at 2:19 PM, Daniel Holbert <dholbert@mozilla.com> wrote:
>>> On 01/22/2014 02:08 PM, Daniel Holbert wrote:
>>> However, every browser I've tested [1] *does* seems to lump <br>
>>> elements into anonymous flex items.
>> 
>> Side note: This implies that the flex item forced "display" tweak
>> (making them block-flavored, from applying the table in CSS 2.1 Chapter
>> 9.7) is not having any effect on <br> elements. Indeed, <br> elements
>> are pretty resistant to CSS styling; I posted separately to the WHATWG
>> today about a possible source of confusion on that point, in the WHATWG
>> HTML spec:
>> http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2014-January/041906.html
> 
> Ugh, this sounds terrible, but if we want to match impls it means that
> we need to define a third type of "thing" - an element which generates
> naked text rather than a box.
> 
> ~TJ
> 

Despite what is alleged in the link, all major browsers do honor 'display: none' on a BR element, and have done so for a long time. I use that fact frequently when I have to style someone else's HTML, and get rid of line breaks where I don't want them. 

Safari, at least, also honors 'line-height' and 'font-size', and if you set 'content' to a string (even to '\A'), then it seems to honor all the other property values, including 'display' values (but it doesn't actually visibly change the content).

I think that WHATWG should change its incorrect definition, and should say that it is treated as though it was a glyph, and not as an element, except for a limited set of properties and values. 

Received on Friday, 24 January 2014 00:03:23 UTC