Skip to content

[css-display] ::marker is not a box #1625

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
Loirooriol opened this issue Jul 20, 2017 · 5 comments
Closed

[css-display] ::marker is not a box #1625

Loirooriol opened this issue Jul 20, 2017 · 5 comments

Comments

@Loirooriol
Copy link
Contributor

From Generating Marker Boxes,

The list-item keyword causes the element to generate a ::marker pseudo-element box

::marker is a pseudo-element which may generate a box. But it can also generate multiple boxes or no box. I think it should say something like

The list-item keyword creates a ::marker pseudo-element which generates boxes as if it were an immediate child of the element

And consider linking CSS Lists Markers, because CSS Pseudo-Elements Markers seems obsolete.

@SelenIT
Copy link
Collaborator

SelenIT commented Jul 20, 2017

Could you please show an example when ::marker generates multiple boxes? Something like display: list-item for the marker itself? By the way, if this is allowed, should that marker of the marker pseudo element be also styleable (with the chain of pseudo elements like ::marker::marker or something)?

@Loirooriol
Copy link
Contributor Author

Loirooriol commented Jul 20, 2017

I think styling ::marker with any display value which generates multiple boxes in normal elements should do the trick. For example, display: table generates a table wrapper box and a table box. Yes, styling it with list-item should generate a 2nd ::marker pseudo-element nested inside the 1st one, this already works with ::before and ::after on Firefox and Chrome (fiddle) so I don't see why it shouldn't work with ::marker.

However, I think I read implementations don't want to allow arbitrarily deep structures of pseudo-elements, because that's expensive. So just like you can't insert a ::before inside another ::before, you can't style a ::marker inside a ::marker.

@fantasai fantasai added the css-display-3 Current Work label Jul 20, 2017
@Loirooriol
Copy link
Contributor Author

This quote from Introduction should be edited too:

some display values (e.g. display: list-item) generate more than one box (e.g. a principal block box and a marker box)

I guess saying this "marker box" concept is a reminiscence from CSS 2.1, which didn't allow to style the ::marker pseudo-element, so it always established a single box. This could still apply with the very limited ::marker defined in CSS Pseudo, but it does not work with the full-fledged ::marker defined in CSS Lists. I'm assuming the last one is the good definition.

About the quote in Introduction, I would just use another example. An element can originate a pseudo-element which can generate boxes, so saying that these boxes are originated by the element itself is not entirely wrong. But I would prefer not to say so; otherwise #1604 would worsen, because an element is not supposed to generate more than one principal box.

Instead, the example could mention display: table with its table wrapper box and table box, or display: block ruby with its block container and ruby container.

@Loirooriol
Copy link
Contributor Author

After I filed this issue, CSS Lists was edited. Now it says that the whole spec is not ready for implementation and ::marker has been restricted back to what CSS Pseudo says, properties that affect box characteristics like display are no longer accepted. So if it exists, ::marker will generate a single box, and thus I guess CSS Display may stay as it is. It can also be edited so that if the ::marker restrictions are relaxed in the future (which I hope will happen), the spec will still make sense.

@tabatkins
Copy link
Member

Yeah, I just moved the warning from being manually added to a few sections to being generated by Bikeshed; the spec hadn't been seriously edited for years and wasn't using the newer Bikeshed features.

::marker has been restricted back to what CSS Pseudo says, properties that affect box characteristics like display are no longer accepted.

Yup, Pseudo reflects the current WG consensus on what ::marker should be allowed to do, so I'm just deferring to that. It's basically "what have people actually asked to do with markers", or "what can you currently do to markers by abusing inheritance and wrappers" (setting a style on the list item, then unsetting it on a wrapper around the list-item's contents).

There's no problem with relaxing it in the future, there's just no call for it currently. If you want to do arbitrary things, you have ::before. You can even use position: marker with ::before once that's implemented, to get it to exactly mimic an outside marker.

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