Re: [css-display] Explaining <br>

On Tue, Feb 14, 2017 at 3:51 PM, fantasai <fantasai.lists@inkedblade.net> wrote:
> On 03/25/2016 02:04 PM, Mats Palmgren wrote:
>>
>> On 03/25/2016 18:01, Brad Kemper wrote:
>>>
>>> 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.
>>
>>
>> +1
>>
>> Fwiw, this already works in Firefox:
>>
>> <style>
>> nl {
>>  display: contents;
>> }
>> nl::before {
>>  content: "\a";
>>  white-space: pre;
>> }
>> </style>
>> a<nl></nl>b
>>
>> (we don't support 'content' on arbitrary elements yet,
>> only ::before/::after)
>
>
> The CSSWG resolved to accept this solution, with the caveat that
> UAs may further restrict the restylability of <br> and <wbr>,
> essentially reducing it to this set of rules exactly in behavior.
>
> Minutes at https://lists.w3.org/Archives/Public/www-style/2017Feb/0062.html
> Issue tracked at https://github.com/w3c/csswg-drafts/issues/610

No we didn't; we explicitly resolved that <br> and <wbr> are rendered
via magic. We also resolved that that the code example shown here is a
reasonable way to reproduce their effects, so it should go in the spec
as guidance for authors.  But <br> and <wbr> don't respond to these
properties at all.  (HTML is doing a bit of research to figure out
what tiny subset of properties they *do* respond to reliably, and
planning to spec that.)

~TJ

Received on Wednesday, 15 February 2017 00:00:49 UTC