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

Add tests for 15.3.9 Margin Collapsing Quirks #48138

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Psychpsyo
Copy link
Contributor

This adds tests for this section of the html spec.
It currently passes in Firefox, but not in Chromium or Safari.

@bfgeek you might be interested, as I believe this is responsible for at least part of the developer confusion you point to in whatwg/html#10296

@bfgeek
Copy link
Contributor

bfgeek commented Sep 12, 2024

Yeah I don't really agree with these tests, or that section of the specification. It was written before we had the requirement of at least two implementations agree with the direction of the specification, and as you've discovered, implementations implement this quirk very differently.

IMO the path to compat is to reduce this quirk, not encode it.
If we want to encode it was need to specify either the Blink/WebKit method of how this works, or write out the UA-stylesheet rules that Gecko uses using standard CSS.

@Psychpsyo
Copy link
Contributor Author

Psychpsyo commented Sep 12, 2024

IMO the path to compat is to reduce this quirk, not encode it. If we want to encode it was need to specify either the Blink/WebKit method of how this works, or write out the UA-stylesheet rules that Gecko uses using standard CSS.

I do believe the Gecko styles for this are written out in standard CSS, here: https://searchfox.org/mozilla-central/source/layout/style/res/quirk.css

EDIT: just noticed it uses :-moz-last-node, sorry.

@bfgeek
Copy link
Contributor

bfgeek commented Sep 12, 2024

Yeah it doesn't use standard CSS - this is part of the problem. There are two different implementation methods each with different side effects. The easiest path to compat here is to slowly remove the quirk.

edit - it uses a lot of magic:

  • -moz-only-whitespace
  • -moz-first-node
  • -moz-last-node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 participants