[css-pseudo] Which properties to reset in ::marker · Issue #4568 · w3c/csswg-drafts (original) (raw)

Migrated from #4474

The specification currently states that only the following properties apply to :📑

...and that this list is likely to be revised. But markers don't exist in a vacuum; they're part of the tree, so even properties that don't apply will need to be reset if they're inheritable, to initial or some other sensible value.

As of today the specification has

unicode-bidi: isolate; font-variant-numeric: tabular-nums;

with white-space to be reset to something closely resembling pre (#4448).

So, starting with inheritable properties in css-text and text-shadow from css-text-decor, and working on the presumption that markers will always be limited to a single line, we have these properties to consider:

property applicability to markers
hanging-punctuation probably n/a
hyphens n/a
letter-spacing ?
line-break n/a
overflow-wrap n/a
tab-size tabs in markers?
text-align-* ?
text-indent ?
text-justify will depend on text-align
text-transform ?
white-space already covered
word-break n/a
word-spacing ?
word-wrap n/a
word-wrap n/a
text-shadow ?

I'm going to leave tab-size, it's technically applicable but the only place this would ever happen is a WPT test-case. I suppose a decision has to be made, but I doubt it matters what that is.

I think hanging-punctuation doesn't apply - all values other than force-end will apply only if the text wraps, and force-end only applies to the end of the line. As white-space won't collapse in markers, and a space will almost always follow the punctuation I don't think that's the case, but will test for completeness (although as this depends on browser support for both hanging-punctuation and custom markers, it might not be a very useful test).

Test is here: https://output.jsbin.com/rusilefogo

Findings:

property Firefox Chrome Safari
letter-spacing N Y Y
word-spacing N Y Y
text-indent N N N
text-align Y N N
text-transform N Y N
text-shadow N Y N
hanging-punctuation N - -

Everyone's different, isn't that fun! To start the ball off on the discussion below, I'd suggest:

(edit: pinging @MatsPalmgren @dauwhe and @fantasai for input as suggested by @fantasai in the original issue)