whatwg / html

HTML Standard
https://html.spec.whatwg.org/multipage/
Other
7.99k stars 2.61k forks source link

Standardize marquee UA styles. #10249

Open emilio opened 5 months ago

emilio commented 5 months ago

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:

Does that seem reasonable?

emilio commented 5 months ago

cc @zcorpan @annevk @dbaron @whatwg/css

zcorpan commented 5 months ago

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

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