Skip to content

[css-text-3] Line breaking with <br> handled differently. #4658

Closed
@faceless2

Description

@faceless2

I thought by now I had the humble <br> element pretty well understood, but apparently not. Please take a look at https://jsbin.com/jupalic/edit?html,css,output

I'm adding a forced line break (a preserved newline character) after an inline that has already overflowed the line - the question is, do I get one line break or two?

It seems that the <br> element has some special properties I can't reproduce with any other element, as implemented in Chrome/Firefox/Safari anyway. If I follow the overflowing content with a <span>, it will begin on a new line (as it should), and I get two line breaks. But if I follow the overflowing content with a <br>, it is not moved to a new line before being applied, and I get one line break.

The behaviour of <br> should be entirely determined by CSS according to #610, so I think this is an issue. It might be there is some special HTML rule here that I've missed, although I tested with XHTML and got the same result.

Note test B gives different results in Gecko and Blink - the difference appears to be whether the break opportunity before an item of zero width (the left edge of the span) is taken.

EDIT:

For clarification, I'm aware that <br> is known to have magical properties - the point of this issue is that those magical properties cannot be duplicated with regular CSS, against the resolution in #610: RESOLVED: keep <br> and <wbr> magic, but add an explainer about how to mimic the results

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closed as RetractedWhen the person who raised the issue thinks that there's no issue after all.Testing UnnecessaryMemory aid - issue doesn't require testsTracked in DoCcss-text-3Current Work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions