On Thu, Feb 11, 2010 at 10:52 PM, Patrick Garies <pgaries@fastmail.us> wrote: > The fact that the native contentEditable behaviour of webkit, gecko > > and IE all differ in how they solve this (webkit installs a BR when >> the block element is empty, gecko always has a BR, and IE puts a >> magic ) indicates that this is a problem that needs a standard >> solution. They are also buggy, in that they don't always correctly >> employ their respective trick, resulting in collapsed unusable block >> elements (and it is even harder for a javascript application trying >> to control this to figure out when it should employ the trick). >> > > I'm not very familiar with |contentEditable|. Maybe that feature should > be amended at the HTML level if this is behavior that should be built in? > It's certainly possible to argue that empty block elements inside a contentEditable region should not collapse. The problem with that is that when you take the contents out and put them elsewhere (e.g. when you publish your rich-text blog-post), they'll no longer be in a contentEditable region and collapse. Also, I would fear that changing the meaning of contentEditable in this way would break existing sites. With a CSS property, you can ensure that the rendering will be the same whether or not contentEditable is on. On Fri, Feb 12, 2010 at 10:18 AM, Brad Kemper <brad.kemper@gmail.com> wrote: > > 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. > Something like this is conceptually correct, except that p:empty doesn't apply to P elements that just have a span in them, or just have whitespace, etc. I can't speak for other rendering engines, but WebKit already has an internal concept of whether a block is collapsible. http://trac.webkit.org/browser/trunk/WebCore/rendering/RenderBlock.cpp#L4400 OjanReceived on Friday, 12 February 2010 23:00:24 UTC
This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:43 UTC