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

Re: [css4-text] A non-inherited property to control behavior of whitespace-only child boxes

From: Ojan Vafai <ojan@chromium.org>
Date: Thu, 29 Mar 2012 13:34:23 -0700
Message-ID: <CANMdWTsHD7GLJY9deP-DpPeeb-zc2zVHejM3VNo+PHbJ=xMHBw@mail.gmail.com>
To: fantasai <fantasai.lists@inkedblade.net>, Aryeh Gregor <ayg@aryeh.name>, Ryosuke Niwa <rniwa@chromium.org>, Ehsan Akhgari <ehsan@mozilla.com>
Cc: www-style@w3.org
Somewhat off-topic: There's a good use-case here for editing. Right now,
HTML editors need to inject dummy content into nodes that are empty or
contain only non-significant whitespace. Some UA's use BR elements, some
use a non-breaking space. In all cases, it causes bugs and make things hard
on both browser developers and web developers. Could we make :empty match a
node that contains only non-significant whitespace and has
whitespace-collapse: discard? If so, then editors could do the following
and avoid any of the complexity of needing dummy content.

* {
    whitespace-collapse: discard;
}
:empty:before {
    content: '\A0';
}

On Thu, Mar 29, 2012 at 11:20 AM, fantasai <fantasai.lists@inkedblade.net>wrote:

> On 03/29/2012 09:55 AM, Brad Kemper wrote:
>
>> On Mar 29, 2012, at 8:48 AM, Boris Zbarsky<bzbarsky@MIT.EDU>  wrote:
>>
>>  On 3/29/12 4:27 AM, Kang-Hao (Kenny) Lu wrote:
>>>
>>>> (12/03/29 8:42), Boris Zbarsky wrote:
>>>>
>>>>> On 3/28/12 5:23 PM, Marat Tanalin | tanalin.com wrote:
>>>>>
>>>>>> Currently, it's somewhat tricky to use `display: inline-block` to
>>>>>> create gapless layout
>>>>>>
>>>>>
>>>> For your information, this was brought up[1] as a use case for
>>>> 'text-space-collapse: discard;'.
>>>>
>>>
>>> text-space-collapse is inherited, which is not what's really needed here.
>>>
>>
>> Maybe text-space-collapse shouldn't be inherited? If it wasn't, it'd be
>> easy enough to write selectors to put it on descendants too if someone
>> actually needed that.
>>
>
> text-space-collapse is the white-space-collapsing part of the 'white-space'
> property. It has to be inherited. :)
>
> ~fantasai
>
>
Received on Thursday, 29 March 2012 20:35:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 03:48:53 GMT