Re: [css-display] Explaining <br>

> On Mar 24, 2016, at 11:32 AM, Tab Atkins Jr. <> wrote:
> [abracadabra, this thread is NECRO'D!]
>> On Thu, Jun 12, 2014 at 4:05 PM, Tab Atkins Jr. <> wrote:
>> At the January f2f, we figured out a decent hack that seems to explain
>> the rendering of <br> properly:
>> br {
>>  display-box: contents;
>>  content: "\a";
>>  white-space: pre;
>> }
>> However, when Hixie was planning to add this to the HTML style sheet,
>> dbaron objected to it on performance reasons:
>> So, David, how bad is this?  Should we go with a different solution,
>> like a dedicated 'display' value just for <br> (Hixie suggested
>> "display: newline;" in the linked bug).
> The HTML spec has had `display: newline` in its CSS section for quite
> a while.  

Wouldn't it be better to just have the 'display-box: contents' version, but let the UA lie about it and optimize it into whatever it needs to, rather than create a whole new display value just for that? Or are we concerned that authors are going to use a duplicate of that UA style sheet rule for other things when they need a line break? They could still do so if they wanted, even if there was a 'newline' value too. 

> In addition, it's using `display: break-opportunity` to
> explain the magic of <wbr>.

What is the magic that can't be replicated with text properties? I'm not very familiar with this one. 

> Unless the group decides that the above CSS is actually the best (and
> can come up with something equivalent for <wbr>), I plan to add
> "newline" and "break-opportunity" to the Display spec.  Any
> objections?
> ~TJ

Received on Friday, 25 March 2016 17:02:15 UTC