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:
<!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?
<!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.
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
::beforeand::aftergenerate 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:
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
::beforeand::after. Which carries me to the next question...If they do... Does
displayapply to::marker? And thus, can::markerboxes be list items?If we allow
contenton marker, they can just be a normal box, affected bydisplay, and thus havedisplay: list-itemon them. If generated markers can be list items, then:list-itemcounter?I really hope the answer to these two question is "no", but otherwise, how should this work?
I think
::markershouldn't be a list-item, even if it's a box withdisplay: list-itemlike @fantasai clarified in #3766, and that it should not increment the list-item counter nor generate other markers.