W3C home > Mailing lists > Public > www-style@w3.org > April 2012

RE: [css3-flexbox] handling whitespace between items in a flexbox

From: Alex Mogilevsky <alexmog@microsoft.com>
Date: Wed, 18 Apr 2012 07:20:43 +0000
To: Tab Atkins Jr. <jackalmage@gmail.com>, Daniel Holbert <dholbert@mozilla.com>
CC: www-style list <www-style@w3.org>
Message-ID: <2C86A15F63CD734EB1D846A0BA4E0FC80E77FA93@CH1PRD0310MB381.namprd03.prod.outlook.com>
> From: Tab Atkins Jr. [mailto:jackalmage@gmail.com]
> Sent: Thursday, April 05, 2012 4:20 PM
> 
> On Thu, Mar 22, 2012 at 12:00 AM, Daniel Holbert <dholbert@mozilla.com>
> wrote:
> > Hi www-style,
> >
> > Currently, I don't believe the spec makes any mention of how to handle
> > whitespace between flexbox items. (whether it's ignored or counts as
> > "non-replaced inline children" and triggers an anonymous flexbox item)
> >
> > Consider e.g. the following testcase:
> >  <div style="display: flexbox">
> >   <img>
> >   <img>
> >  </div>
> >
> > My guess is that we'd that to only generate 2 flexbox items, right?
> > (rather than 5 items, which we'd get if we counted the whitespace at
> > the beginning / middle / end as anonymous-flexbox-item-worthy)
> >
> > It'd probably be good to clarify this, as rendering engines _do_
> > generate boxes for runs of whitespace in many cases (which are then
> > sometimes collapsed and sometimes not).
> 
> I've added the following sentence to the third list item in the flexbox
> generation section: "If the contents of the anonymous box would be solely
> an anonymous inline containing only whitespace, the box is not generated,
> and the whitespace is removed from the box tree."
> 
> Sound good?

That does sound good, it may be all that we need to add, or almost.

In this case
 
 <div style="display: flexbox">
   <img>
   x
   <img>
 </div>

Are there any spaces in the anonymous block "x"?

I don't think there should be, then the text should also say "leading and trailing whitespace of anonymous flexbox items is collapsed".

Of course with "white-space:pre" or other options that prevent collapsing, whitespace should produce anonymous flex items.

Alex

Received on Wednesday, 18 April 2012 07:21:25 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:52 GMT