Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-position] What is the behavior of an absolutely-positioned <br>? #5749

Closed
smfr opened this issue Nov 29, 2020 · 5 comments
Closed

[css-position] What is the behavior of an absolutely-positioned <br>? #5749

smfr opened this issue Nov 29, 2020 · 5 comments
Labels
Closed Rejected as Wontfix by CSSWG Resolution Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-position-3 Current Work Needs Testcase (WPT)

Comments

@smfr
Copy link
Contributor

smfr commented Nov 29, 2020

https://drafts.csswg.org/css-position/#position-property is clear that position applies to the <br> element, and that "the box is taken out of flow such that it has no impact on the size or position of its siblings and ancestors, and does not participate in its parent’s formatting context." It also say "A position value of absolute or fixed blockifies the box and causes float to compute to none."

This implies that the <br> should not trigger a line break here:

text
<br style="position: absolute;">
here

However, WebKit and Blink both trigger a line break. Gecko does not.

@smfr smfr added Agenda+ css-position-3 Current Work and removed Agenda+ labels Nov 29, 2020
@smfr
Copy link
Contributor Author

smfr commented Nov 29, 2020

Similar story with float:

text
<br style="float: left;">
here

@fantasai
Copy link
Collaborator

fantasai commented Sep 3, 2021

I agree with Gecko here fwiw. Having it continue to trigger a line break would make <BR> behave rather differently from any other out-of-flow.

@fantasai
Copy link
Collaborator

fantasai commented Sep 3, 2021

Agenda+ to suggest closing no change.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed CSS Positioned Layout, and agreed to the following:

  • RESOLVED: Close no change: taking BR out of flow removes its effect on the surrounding content, just like every other element
The full IRC log of that discussion <fantasai> Topic: CSS Positioned Layout
<fantasai> github: https://github.com//issues/5749
<fantasai> Rossen_: Seems the proposal is to close no change.
<fantasai> smfr: Question is if you have a <br> and say 'position: absolute'. Does it trigger line breaks?
<fantasai> smfr: 'position: absolute' takes it out of flow
<fantasai> smfr: which probably means it shouldn't trigger a line break
<fantasai> smfr: so I think Gecko has the right behavior
<fantasai> smfr: Slight concern about if it's web-compatible, but if Gecko's shipping probably OK
<fantasai> Rossen_: do we have any specific spec text defining it one way or another?
<fantasai> smfr: I think the spec is fine, just implementers not following spec
<fantasai> florian: That and fact that BR and WBR aren't properly specced fully
<fantasai> florian: we've had discussions about how to represent them, but haven't fully resolved
<fantasai> florian: but only logical behavior is if take out of flow, stop influencing the text round it
<emilio> q+
<fantasai> Rossen_: sounds like we have consensus for breaking behavior here
<fantasai> Rossen_: and that seems to be spec-compliant atm
<Rossen_> ack emilio
<fantasai> emilio: I've never heard a compat issue with Gecko's behavior so far
<fantasai> Rossen_: proposed close issue no change to spec and encourage UAs to follow Gecko's lead
<fantasai> RESOLVED: Close no change: taking BR out of flow removes its effect on the surrounding content, just like every other element
<astearns> A testcase would be an excellent encouragement (and smfr just added the tag to the issue)
<fantasai> emilio: Where does the WebKit behavior come from?
<fantasai> smfr: It's probably very historical
<fantasai> iank_: BR inherits from text node, so has ...

@smfr
Copy link
Contributor Author

smfr commented Sep 8, 2021

WebKit bug: webkit.org/b/230048

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Rejected as Wontfix by CSSWG Resolution Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-position-3 Current Work Needs Testcase (WPT)
Projects
None yet
Development

No branches or pull requests

4 participants