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

Standardize marquee UA styles. #10249

Open
emilio opened this issue Apr 4, 2024 · 2 comments
Open

Standardize marquee UA styles. #10249

emilio opened this issue Apr 4, 2024 · 2 comments

Comments

@emilio
Copy link
Contributor

emilio commented Apr 4, 2024

What is the issue with the HTML Standard?

Other than the spec's https://html.spec.whatwg.org/#the-marquee-element-2, engines have some extra marquee styles:

Gecko has:

marquee {
  inline-size: -moz-available;
  vertical-align: text-bottom;
  white-space: nowrap;
}

Plus:

marquee:is([direction="up"], [direction="down"]) {
  block-size: 200px;
  white-space: unset;
}

Blink has here and here something like:

marquee {
  width: -webkit-fill-available;
  white-space: nowrap;
}

And:

marquee:is([direction="up"], [direction="down"]) {
  white-space: initial;
}

(Note that the overflow rules in there are redundant because they get overridden in here, so they match the spec).

WebKit has this which IIUC is something like:

marquee:not([direction="up"], [direction="down"]) {
  white-space: nowrap !important;
}

Plus a special "if height is auto, set height to 200px for vertical marquee".


I think something like this might be a good common denominator to be added to the current spec:

marquee {
  inline-size: stretch; /* -moz-available / -webkit-fill-available */
  white-space: nowrap;
}

marquee:is([direction="up"], [direction="down"]) {
  block-size: 200px;
  white-space: unset;
}

So:

  • Gecko would remove vertical-align.
  • Blink will use logical properties for stretch sizing and add the default vertical marquee size, plus use unset (inherit) rather than initial for white-space, which I think it's more in line with the expectation of authors.
  • WebKit won't use magic adjustments (except for overflow if they want I guess where it's not observable).

Does that seem reasonable?

@emilio
Copy link
Contributor Author

emilio commented Apr 4, 2024

cc @zcorpan @annevk @dbaron @whatwg/css

@zcorpan
Copy link
Member

zcorpan commented Apr 4, 2024

Should direction also be logical? Currently it's specified as physical direction.

Demo: https://software.hixie.ch/utilities/js/live-dom-viewer/saved/12534

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

No branches or pull requests

2 participants