w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.36k stars 641 forks source link

[css-content-3] connecting leader seamlessly with the parent element is not addressed #6875

Open OnkarRuikar opened 2 years ago

OnkarRuikar commented 2 years ago

The steps 3 talks about how before and after content are to be drawn on top of the leader to make it look seamless. But the actual before content, for which we need the leader, is in the parent element. Like it's shown in the Example 10 the actual content, eg "Loomings", is in <a> tag and the leader is in ::after pseudo element.
How are we going make leaders seamless for scenarios like these, where product names are in multiline <a> tag and leaders in a::after element? Leader for last line, second line is short: last line
Leader for first line, wrapping makes first line short: first line

For more information refer the Stack Overflow issue: https://stackoverflow.com/q/70042487/15273968
We cannot put chapter title in pseudo element's content, to make it "before content", cos we are generating the generated content for the title itself. Also, as per Procedure for rendering leaders the authors are considering multiline text that need leader.

My concerns:

faceless2 commented 2 years ago

The sections of the spec you refer to relates to the leader() generated content, which is certainly the right way to do leaders but not implemented in any browser currently (although it is implemented in print layout engines that use CSS).

The StackOverflow page also suggests various other approaches, but none of them make use of leader().

So I'm not sure this issues makes sense. The sections of the spec you refer to apply to a feature that isn't implemented in anything you're testing in

I appreciate your desire for proper leaders, but there are only two ways to get them - either the browsers implement them as specified, in which case they'll work properly, or you'll find a way to simulate them with something else - in which case it's necessarily a bit of a hack. Either way I'm not sure this is a spec issue though, which is what you've filed here.

OnkarRuikar commented 2 years ago

I know the specs are work in progress. So I want to make suggestions so that the specs will cover above scenarios. When browsers will implement the specs, they'll address the issues I've mentioned.
Have I put a wrong category or posted at wrong forum?