Skip to content

[css-lists] Clarify whether ::before and ::after pseudo-elements can be list-items and increment the list-item counter. #3766

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

Closed
emilio opened this issue Mar 26, 2019 · 5 comments

Comments

@emilio
Copy link
Collaborator

emilio commented Mar 26, 2019

The following renders differently across browsers:

<!doctype html>
<style>
  li::before, li::after { content: "Before"; display: list-item; }
  li::after { content: "After"; }
</style>
<ol>
  <li>Foo

List item is defined in https://drafts.csswg.org/css-lists/#list-item / https://drafts.csswg.org/css-lists/#declaring-a-list-item, but it doesn't clarify if ::before or ::after are supposed to increment the list item counter.

cc @MatsPalmgren @fantasai @tabatkins

@emilio emilio changed the title [css-lists] Clarify whether ::before and ::after pseudo-elements can be list-items. [css-lists] Clarify whether ::before and ::after pseudo-elements can be list-items and increment the list-item counter. Mar 26, 2019
@emilio emilio added the css-lists-3 Current Work label Mar 26, 2019
@Loirooriol
Copy link
Contributor

In #1793 (comment) it was resolved that

RESOLVED: marker exists on all elements, on ::before and on ::after but no box unless it's display: list-item

So ::before and ::after can be list-items and have a marker.
Then I would also expect the list-item counter to be increased.

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Mar 28, 2019
…spec a bit more closely. r=mats

The HTML restriction doesn't match any browser.

This matches Edge, though I filed
w3c/csswg-drafts#3766 about the pseudo-element
condition.

Differential Revision: https://phabricator.services.mozilla.com/D24936

--HG--
extra : moz-landing-system : lando
xeonchen pushed a commit to xeonchen/gecko that referenced this issue Mar 28, 2019
…spec a bit more closely. r=mats

The HTML restriction doesn't match any browser.

This matches Edge, though I filed
w3c/csswg-drafts#3766 about the pseudo-element
condition.

Differential Revision: https://phabricator.services.mozilla.com/D24936
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Mar 30, 2019
…e closely.

The HTML restriction doesn't match any browser.

This matches Edge, though I filed
w3c/csswg-drafts#3766 about the pseudo-element
condition.

Differential Revision: https://phabricator.services.mozilla.com/D24936

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1539267
gecko-commit: 1803e27751d646abe24ff364147c64bfe55920b4
gecko-integration-branch: central
gecko-reviewers: mats
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Mar 31, 2019
…e closely.

The HTML restriction doesn't match any browser.

This matches Edge, though I filed
w3c/csswg-drafts#3766 about the pseudo-element
condition.

Differential Revision: https://phabricator.services.mozilla.com/D24936

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1539267
gecko-commit: 1803e27751d646abe24ff364147c64bfe55920b4
gecko-integration-branch: central
gecko-reviewers: mats
@fantasai
Copy link
Collaborator

@emilio Any list item in the box tree will increment the counter, ::before/::after aren't excluded here: if it's allowed to be a list item, then it increments list-item. I think the spec is clear on this point, lmk if you'd like something edited?

@emilio
Copy link
Collaborator Author

emilio commented Apr 10, 2019

@fantasai I think that the sentence "list items generate ::marker pseudo-elements" is a bit confusing, since pseudos don't generate other ::marker pseudos generally.

Maybe a note noting that the ::marker pseudo-elements generated by ::before and ::after are not addressable via selectors would clarify it? It's not clear to me what the model is there.

@FremyCompany
Copy link
Contributor

I agree with @Loirooriol, we agreed last time that ::before and ::after can be list-items and have a marker, but that you can't address them; based on that, the tree can at most contain one level of nesting of generated content (Edge never supported even that, and ::before couldn't be a list item, but I think other browsers do support that)

emilio added a commit to emilio/servo that referenced this issue Apr 11, 2019
The HTML restriction doesn't match any browser.

This matches Edge, though I filed
w3c/csswg-drafts#3766 about the pseudo-element
condition.

Differential Revision: https://phabricator.services.mozilla.com/D24936
emilio added a commit to emilio/servo that referenced this issue Apr 12, 2019
The HTML restriction doesn't match any browser.

This matches Edge, though I filed
w3c/csswg-drafts#3766 about the pseudo-element
condition.

Differential Revision: https://phabricator.services.mozilla.com/D24936
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Apr 14, 2019
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Apr 25, 2019
Per w3c/csswg-drafts#3766

Differential Revision: https://phabricator.services.mozilla.com/D27122

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1543758
gecko-commit: e4d51df238b69028b2cc7511efcea9bfe5f777a6
gecko-integration-branch: central
gecko-reviewers: mats
jgraham pushed a commit to web-platform-tests/wpt that referenced this issue Apr 25, 2019
Per w3c/csswg-drafts#3766

Differential Revision: https://phabricator.services.mozilla.com/D27122

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1543758
gecko-commit: e4d51df238b69028b2cc7511efcea9bfe5f777a6
gecko-integration-branch: central
gecko-reviewers: mats
fantasai added a commit that referenced this issue Jun 28, 2019
…r pseudo-element can be selected, but not with '::marker' because that expands to '*::marker' and * doesn't match pseudos. #3826 #3766
@fantasai
Copy link
Collaborator

Added a clarification along the lines of #3826 (comment)

marcoscaceres pushed a commit to web-platform-tests/wpt that referenced this issue Jul 23, 2019
…e closely.

The HTML restriction doesn't match any browser.

This matches Edge, though I filed
w3c/csswg-drafts#3766 about the pseudo-element
condition.

Differential Revision: https://phabricator.services.mozilla.com/D24936

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1539267
gecko-commit: 1803e27751d646abe24ff364147c64bfe55920b4
gecko-integration-branch: central
gecko-reviewers: mats
marcoscaceres pushed a commit to web-platform-tests/wpt that referenced this issue Jul 23, 2019
Per w3c/csswg-drafts#3766

Differential Revision: https://phabricator.services.mozilla.com/D27122

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1543758
gecko-commit: e4d51df238b69028b2cc7511efcea9bfe5f777a6
gecko-integration-branch: central
gecko-reviewers: mats
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 4, 2019
…spec a bit more closely. r=mats

The HTML restriction doesn't match any browser.

This matches Edge, though I filed
w3c/csswg-drafts#3766 about the pseudo-element
condition.

Differential Revision: https://phabricator.services.mozilla.com/D24936

UltraBlame original commit: 1803e27751d646abe24ff364147c64bfe55920b4
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 4, 2019
Per w3c/csswg-drafts#3766

Differential Revision: https://phabricator.services.mozilla.com/D27122

UltraBlame original commit: e4d51df238b69028b2cc7511efcea9bfe5f777a6
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 4, 2019
…spec a bit more closely. r=mats

The HTML restriction doesn't match any browser.

This matches Edge, though I filed
w3c/csswg-drafts#3766 about the pseudo-element
condition.

Differential Revision: https://phabricator.services.mozilla.com/D24936

UltraBlame original commit: 1803e27751d646abe24ff364147c64bfe55920b4
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 4, 2019
…spec a bit more closely. r=mats

The HTML restriction doesn't match any browser.

This matches Edge, though I filed
w3c/csswg-drafts#3766 about the pseudo-element
condition.

Differential Revision: https://phabricator.services.mozilla.com/D24936

UltraBlame original commit: 1803e27751d646abe24ff364147c64bfe55920b4
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 4, 2019
Per w3c/csswg-drafts#3766

Differential Revision: https://phabricator.services.mozilla.com/D27122

UltraBlame original commit: e4d51df238b69028b2cc7511efcea9bfe5f777a6
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 4, 2019
Per w3c/csswg-drafts#3766

Differential Revision: https://phabricator.services.mozilla.com/D27122

UltraBlame original commit: e4d51df238b69028b2cc7511efcea9bfe5f777a6
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