[csswg-drafts] [css-lists] Interaction of ::marker with other pseudo-elements. (#3826)

emilio has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-lists] Interaction of ::marker with other pseudo-elements. ==
A few different questions that occurred to me, that should probably be tested and clarified on the spec, and they interact with each other.

### Do `::before` and `::after` generate markers?

In #3766 it was clarified that they increment the list-item counter and are considered list items. But do they generate marker boxes?

Browsers generally do (Edge didn't use to though, so we may have some leeway). It's a bit weird that we're generating nested pseudo-elements.

### If they do... Do those markers generated by pseudo-elements match selectors from the page?

WebKit and Gecko's implementation do show two red bullets here:

```html
<!doctype html>
<style>
  li::after {
    content: "After";
    display: list-item;
  }
  ::marker {
    color: red;
  }
</style>
<ul>
  <li>Bar
```

But then that means that you can address a marker generated by a pseudo-element with selectors. Which is inconsistent in the sense that it doesn't happen for `::before` and `::after`. Which carries me to the next question...

### If they do... Does `display` apply to `::marker`? And thus, can `::marker` boxes be list items?

If we allow `content` on marker, they can just be a normal box, affected by `display`, and thus have `display: list-item` on them. If generated markers can be list items, then:

 * Do they increment the `list-item` counter?
 * Do they generate other markers?

I really hope the answer to these two question is "no", but otherwise, how should this work?

```html
<!doctype html>
<style>
  li::after {
    content: "After";
    display: list-item;
  }
  ::marker {
    display: list-item;
    content: counter(list-item) ".";
  }
</style>
<ol>
  <li>Foo
  <li>Bar
```

I think `::marker` shouldn't be a list-item, even if it's a box with `display: list-item` like @fantasai clarified in #3766, and that it should not increment the list-item counter nor generate other markers.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3826 using your GitHub account

Received on Sunday, 14 April 2019 14:16:00 UTC