W3C home > Mailing lists > Public > www-style@w3.org > February 2010

Re: collapsible property

From: Brad Kemper <brad.kemper@gmail.com>
Date: Fri, 12 Feb 2010 10:18:28 -0800
Cc: fantasai <fantasai.lists@inkedblade.net>, www-style@w3.org, Daniel Danilatos <danilatos@google.com>, Julie Parent <jparent@chromium.org>
Message-Id: <26F8091B-6729-45D9-8673-5623C8A079A7@gmail.com>
To: Ojan Vafai <ojan@chromium.org>

On Feb 10, 2010, at 5:09 PM, Ojan Vafai wrote:

> On Wed, Feb 10, 2010 at 5:05 PM, fantasai <fantasai.lists@inkedblade.net> wrote:
> On 02/10/2010 04:36 PM, Ojan Vafai wrote:
> Collapsed block nodes make little sense when dealing with rich-text
> user-generated content. Rich-text libraries need to go through all sorts
> of contortions right now in performance sensitive code to get around
> this. Browser's themselves do things to avoid collapsing nodes (e.g.
> putting magic BRs in empty block elements). These workarounds are costly
> and don't always work.
> Proposal: Add a collapsible property. Defaults to "auto".
> auto: the current behavior of collapsing block elements when they are empty
> never: empty elements don't collapse.
> p {
>   collapsible: never;
> }
> Are you referring to margin collapsing or to something else?
> No. I'm referring to empty block nodes collapsing. For example, <p></p> will render a 0-height paragraph element.

That's because there is nothing in the element to give it height.

It seems to me that what you want is a way for empty elements (no text or child elements in them) to have a used height that is what it would be if there was a character in it. So perhaps something like the following would work (in UAs that support it):

p:empty::after { content: '\200C' }

If I did that correctly, it would insert a zero-width space into the P element.
Received on Friday, 12 February 2010 18:19:10 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:13:43 UTC