Skip to content

Does a previously clear-ed float still contribute geometry? #2291

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

Closed
FremyCompany opened this issue Feb 8, 2018 · 4 comments
Closed

Does a previously clear-ed float still contribute geometry? #2291

FremyCompany opened this issue Feb 8, 2018 · 4 comments

Comments

@FremyCompany
Copy link
Contributor

Here is an interop issue between Chrome/Safari and Edge/Firefox:

https://wptest.center/#/487ld5
image
image

In the testcase, a float is colliding another float that has already been cleared but reappear in the constraint space due to a negative margin set in the flow. Chrome/Safari ignores that collision, while Firefox/Edge honor it.

I don't think there is a relevant text to clarify the expected behavior here since:

In CSS 2.1, if, within the block formatting context, there is an in-flow negative vertical margin such that the float's position is above the position it would be at were all such negative margins set to zero, the position of the float is undefined.
www.w3.org/TR/CSS2/visuren.html#float-position

That being said, we could clarify this particular case by answering the following question:

Does a previously clear-ed float still contribute geometry?

@jonjohnjohnson
Copy link

FWIW, depending on when/how the "geometry" of the previously cleared float is changed, chrome will respect or ignore the collision. View this behavior when adding/removing the width: 50vw, margin: auto, or margin-bottom: -60px on it's descendant.

@Loirooriol
Copy link
Contributor

If I copy the html and css from https://wptest.center/#/487ld5 and use them in jsfiddle or a local file, then Chrome behaves like Firefox and Edge. Is wptest.center doing something weird?

@Nadya678 I get the same problem when not using <br> (in wptest.center).

What is default stylesheet for <br/>?

<br/> is rendered using "magic", see #610, resolution, mail thread.

@birtles
Copy link
Contributor

birtles commented Feb 9, 2018

If I copy the html and css from https://wptest.center/#/487ld5 and use them in jsfiddle or a local file, then Chrome behaves like Firefox and Edge. Is wptest.center doing something weird?

Locally I see that sometimes Chrome puts it on the left but after reloading puts it on the right. Likewise after resizing the wptest.center version a few times I see it ends up on the right. There seems to be some instability there.

@w3c w3c deleted a comment from Nadya678 Feb 10, 2018
@FremyCompany
Copy link
Contributor Author

@birtles I can confirm that resizing the window on wptest.center sometimes yields to the float "moving" to the right. It seems like this is just a Chrome bug then.

I filed https://bugs.chromium.org/p/chromium/issues/detail?id=811031

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants