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

[css-pseudo] Default UA styles for markers don't affect ::before::marker and ::after::marker #4474

Closed
Loirooriol opened this issue Oct 31, 2019 · 5 comments

Comments

@Loirooriol
Copy link
Contributor

From https://drafts.csswg.org/css-pseudo-4/#marker-pseudo,

UAs must add the following rule to their default style sheet:

::marker {
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}

But ::marker only selects markers originated by elements, not by other pseudo-elements.

So I guess the selector should be ::marker, ::before::marker, ::after::marker.

@Loirooriol Loirooriol added the css-pseudo-4 Current Work label Oct 31, 2019
@faceless2
Copy link

Yes, I agree. That's almost exactly what we have in our user-agent sheet (we also reset text-indent, letter-spacing and word-spacing to initial)

@AmeliaBR
Copy link
Contributor

AmeliaBR commented Dec 4, 2019

I wonder if it would be easier to expand selector matching so that ::marker as a standalone selector does include ::before::marker etc? This is going to trip up authors as much as it did the spec editors! (Who even had a note immediately following them in the spec warning against the error.)

I think this is our first standard stacked pseudo-element selector, so it should still be possible to redefine how it works.

@Loirooriol
Copy link
Contributor Author

@AmeliaBR But ::marker is equivalent to *::marker, where * can only select elements, not pseudo-elements. In #3826 @MatsPalmgren, @tabatkins and me agreed on this, though I don't remember if it was discussed by the whole CSSWG.

I wonder if a new kind of universal selector that includes tree-abiding pseudo-elements would be worth it. Let's say e.g. **, then the selector could be **::marker. It could also be useful for things like *, ::before, ::after { box-sizing: border-box }.

@fantasai
Copy link
Collaborator

fantasai commented Dec 5, 2019

@Loirooriol OK, I updated the UA rule selector.

@faceless2 I think adding more properties to the rule would be a separate issue. Would you mind filing that separately, along with some explanation of why you think these are a good idea? We'll want to get @MatsPalmgren and @dauwhe to check over that list, too. (text-indent seems pretty clear to me, I'm less sure about the text spacing properties.)

@AmeliaBR No, as @Loirooriol points out, the * selector (which is what's implied if you leave out a tag selector) only matches elements, not pseudo-elements.

@Loirooriol If you want to propose ** file a separate issue? :)

@Loirooriol
Copy link
Contributor Author

Fixed in b7f55d4

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

No branches or pull requests

4 participants