W3C home > Mailing lists > Public > public-css-archive@w3.org > May 2021

Re: [csswg-drafts] [css-lists-3] Clarify sizing of marker images. (#4207)

From: Mats Palmgren via GitHub <sysbot+gh@w3.org>
Date: Mon, 03 May 2021 19:50:32 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-831492800-1620071430-sysbot+gh@w3.org>
The zero default size in Firefox is a bug.  I'm [removing our legacy code path](https://bugzilla.mozilla.org/show_bug.cgi?id=1542807) for `list-style-image` markers which will fix that.

I tested "ascent divided by 2" in the new code but I get a significantly larger result than in Chrome, so it appears we calculate "font ascent" differently in our layout engines.  I also think the image markers look bad in Chrome for some fonts/sizes, see this [testcase](https://bugzilla.mozilla.org/attachment.cgi?id=9219653) for example.  The Noto Serif result look way too big in Chrome IMO.  Here a screenshot for `font-size:16px`:

![image](https://user-images.githubusercontent.com/4010828/116924521-446c9b80-ac58-11eb-9aad-8f409fd347c3.png)

(Chrome on the left, Firefox with the new layout path on the right)

Basing it on the font ascent also seems less useful for authors since there is no CSS unit for it (which makes it impossible to specify a matching padding/margin or whatever).  For these reasons I think the spec should continue to use the `em` size, however `1em` seems too large.  In the screenshot above, Firefox is using `0.4em` which seems to give good results for a variety of fonts and sizes, and it gives a predictable size for authors. (If we standardize a size based on ascent or some other font metric we need to first standardize exactly how that metric is supposed to be calculated for all types of fonts / platforms).

The [CSS Lists spec](https://drafts.csswg.org/css-lists-3/#image-markers) currently says it should be `1em`:
> The marker image is sized using the default sizing algorithm [css-images-3] with no specified size and a default object size of 1em square.

but I don't think that's what authors want as the default size because it's too large.  Instead, the size should be close to what Chromium/WebKit is currently rendering for typical text font sizes.  `0.4em` seems close enough to avoid web-compat issues. I would like to see a spec change to move it closer to what UAs are implementing.

CC @jfkthame @emilio 


-- 
GitHub Notification of comment by MatsPalmgren
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4207#issuecomment-831492800 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 3 May 2021 19:50:34 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:44 UTC