Skip to content

[css-display] Can <br> / <wbr> elements be blockified? #7049

Open
@bfgeek

Description

@bfgeek

Currently there is a discrepancy between engines Blink/WebKit/EdgeHTML, and Gecko.

Specifically when we have:

<div style="border: solid;">
  <br style="display: block;">
</div>

Blink/WebKit/EdgeHTML ignore the display on the <br>/<wbr> elements, and will always treat these elements as basically "text". Firefox I believe will treat these elements as "text" if the display: inline otherwise will generate an appropriate box. ( @dholbert is this analysis correct?)

This has larger effects, e.g.

<div style="display: flex; border: solid;">
  <br>
</div>

Here FF appears to be blockifying the <br>. Where as the others are treating it as "text" and surrounding it with an anonymous block. However it doesn't do this universally, e.g.

<div style="display: flex; border: solid; gap: 10px;">
  a<br>b
</div>
<div style="display: flex; border: solid; gap: 10px;">
  a<span></span>b
</div>

If blockification was happening universally the two flexboxes above should render the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions