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

Formatting context root with negative margin #33

Closed
jgraham opened this issue Nov 18, 2021 · 15 comments
Closed

Formatting context root with negative margin #33

jgraham opened this issue Nov 18, 2021 · 15 comments
Labels
compat-bug-proposal Proposals for web compat bugs
Milestone

Comments

@jgraham
Copy link
Contributor

jgraham commented Nov 18, 2021

Description
Chromium thinks that a formatting context root stops fitting in a tiny space, when you give it a negative margin

Bug reports
https://bugs.chromium.org/p/chromium/issues/detail?id=1141209
webcompat/web-bugs#60099
webcompat/web-bugs#92024
webcompat/web-bugs#90988
webcompat/web-bugs#77403

Specification
(Something in CSS)

Tests
https://jsfiddle.net/dholbert/ujphfkqz/ (not sure if there's a wpt for this)

This is a bug to include in #9

@jgraham jgraham added the compat-bug-proposal Proposals for web compat bugs label Nov 18, 2021
@foolip
Copy link
Member

foolip commented Dec 6, 2021

I've asked @bfgeek who points out that https://bugs.chromium.org/p/chromium/issues/detail?id=1141209 is blocked on twbs/bootstrap#35277 and changing the behavior without that fix is likely to break many sites.

I'm not sure if the situation is symmetrical, if all the same sites are now broken in Firefox?

@jensimmons
Copy link
Contributor

WebKit behaves as Chromium does. Could ya'll file a WebKit ticket as well?

Do we have a sense as to how much this is impacting everyday websites?

@dholbert
Copy link

dholbert commented Dec 7, 2021

WebKit behaves as Chromium does. Could ya'll file a WebKit ticket as well?

Sure, I'll file a WebKit ticket in a bit.

Do we have a sense as to how much this is impacting everyday websites?

We've gotten many (on the order of ~tens, I think) webcompat.com bug reports that boil down to websites depending on this bug.

I coincidentally just triaged a bug that turned out to be this:
https://bugzilla.mozilla.org/show_bug.cgi?id=1742272

@dholbert
Copy link

dholbert commented Dec 8, 2021

WebKit bug report: https://bugs.webkit.org/show_bug.cgi?id=233956

@dholbert
Copy link

dholbert commented Dec 8, 2021

I've asked @bfgeek who points out that https://bugs.chromium.org/p/chromium/issues/detail?id=1141209 is blocked on twbs/bootstrap#35277 and changing the behavior without that fix is likely to break many sites.

I think that Bootstrap issue would be more-likely to get traction if some non-mozilla folks would be willing to chime in over there. So far, the response that we've gotten there seems to have been hesitance to switch away from a hack that they've been using for ages which they perceive as working. I suspect it'd be useful for them to know that other browsers would like to fix this bug, and that they're largely blocked on this bootstrap issue.

(@wisniewskit conveyed something to this effect in twbs/bootstrap#35277 (comment) , but it might be helpful to have other browser vendors back him up on that.)

@karlcow
Copy link

karlcow commented Dec 9, 2021

Yet another case!
webcompat/web-bugs#95687

to note that adding width: fit-content in the right context fixes the issue.
So at least we could emit site interventions for these sites.

@dholbert
Copy link

dholbert commented Dec 17, 2021

When starting to write a WPT test with some expectations for this issue, I realized it's more subtle and less-well-defined than I thought, and I found a possible rationalization for the Chromium/WebKit behavior (despite the Chromium/WebKit behavior having initially struck me as bizarre).

So: it may be worth standardizing on & matching their behavior after all, in which case it wouldn't make sense to include this in the #9 bucket after all (at least, not in the form that we were originally thinking).

I've posted some notes on https://bugzilla.mozilla.org/show_bug.cgi?id=1745310#c9 (sorry for verbosity there). I plan to do a bit more investigation and will post an update here if I discover anything that changes my mind further.

@jgraham
Copy link
Contributor Author

jgraham commented Dec 17, 2021

I think it would be an equally successful outcome if we decide that the WebKit/Blink behaviour is the correct one, tighten up the spec if necessary, and change gecko to match. That's still improving interop/compat for users and it seems totally reasonable to measure that progress, even if it's not the implementation change we originally expected.

@karlcow
Copy link

karlcow commented Dec 17, 2021

Agreed with @jgraham
Yes and given how popular is the Bootstrap library, the chances that we get fixed both the initial library and the websites are low. So we would need to rely on site interventions.

@bfgeek
Copy link

bfgeek commented Dec 17, 2021

@dholbert - I left a reply at https://bugzilla.mozilla.org/show_bug.cgi?id=1745310#c11 but yeah we were writing our LayoutNG implementation for this we basically found that everything was unspecified. We actually ended up following FF in a lot of subtle ways here (see differences between Blink and WebKit now).

@gsnedders
Copy link
Member

I think it would be an equally successful outcome if we decide that the WebKit/Blink behaviour is the correct one, tighten up the spec if necessary, and change gecko to match. That's still improving interop/compat for users and it seems totally reasonable to measure that progress, even if it's not the implementation change we originally expected.

Yes; as I think got mentioned in some meeting, the general consensus is that the important thing (especially for the web compat issues) is to gain interop, not what the interop behaviour is. There's clearly a lack of interop here, regardless of what direction we move in.

Filing bugs on the relevant specs, adding tests where there's spec clarity and/or some tentative buy-in to interop behaviour, seems absolutely like a reasonable thing to do here.

@gsnedders
Copy link
Member

The tests ended up as /css/CSS2/floats/floats-wrap-bfc-with-margin.

@dholbert did you ever end up filing a csswg-drafts issue for the various vaguely spec'd parts of this? I can't find one looking quickly

@dholbert
Copy link

dholbert commented Oct 17, 2022

The tests ended up as /css/CSS2/floats/floats-wrap-bfc-with-margin.

My intent was that only the "-001" test (the one where there was preexisting WebKit/Blink interop) would make sense to include in Interop 2022, since it covers the cases that are de-facto required by webcompat (and some related cases that happen to also have interop).

I included .tentative tests 001a, 002, and 003 for completeness to test additional cases that are logical extensions of 001, but I'm not aware of any web content that actually depends on them. They do uncover an area where WebKit and Blink differ, where I think Blink's behavior makes more sense (which is why we largely matched Blink on this), though of course this is currently unspecified.

So IMO it's fine to consider those .tentative tests as being out-of-scope for Interop2022, though if we end up getting interop on them, that's great too. :)

(I do also see tests numbered -004 and -005; those aren't from me. They seem to have been added by Blink folks as part of fixing some inconsistencies that my .tentative tests surfaced for them. They might just be special cases of my .tentative tests, possibly? I think it's fine to consider those ones similarly-tentative, pending-spec-text.)

@dholbert did you ever end up filing a csswg-drafts issue for the various vaguely spec'd parts of this? I can't find one looking quickly

I don't think I did, no; I can take an action to do that.

@gsnedders
Copy link
Member

My intent was that only the "-001" test (the one where there was preexisting WebKit/Blink interop) would make sense to include in Interop 2022, since it covers the cases that are de-facto required by webcompat (and some related cases that happen to also have interop).

Per the labelling only -001 is in interop-2022, just wanted to link everything together for anyone trying to find out what happened without following many different links!

@dholbert
Copy link

Filed w3c/csswg-drafts#8142 to get the spec updated. (Sorry for the delay on that.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compat-bug-proposal Proposals for web compat bugs
Projects
None yet
Development

No branches or pull requests

7 participants