w3c / csswg-drafts

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

[css2][css-display-3] Remove "display:run-in" from CSS #9784

Open dholbert opened 9 months ago

dholbert commented 9 months ago

tl;dr: could we remove display:run-in from CSS specs, to reflect reality?

See https://bugzilla.mozilla.org/show_bug.cgi?id=2056#c97 for some background. As Joe Walker noted there (emphasis added):

Partial support for display:run-in was removed from WebKit and Blink many years ago. IE11 (pre-Blink) had (some) support, however as IE11 is not actively maintained, there are zero modern browser engines with support for this feature and we are unaware of any interest in reviving it as specified.

We believe that display:run-in should be removed from any CSS specs being maintained. If there is web developer/author interest in this sort of "run-in" styling functionality we should redesign a new feature that is based on the host language having a definition/concept of "paragraph" as noted for example in https://html.spec.whatwg.org/multipage/dom.html#paragraph.

CC @fantasai @tabatkins @tantek @emilio

dholbert commented 9 months ago

Some relevant spec sections where display:run-in is discussed which might want to be updated or removed, if this proposal is accepted: https://drafts.csswg.org/css-display-3/#valdef-display-run-in https://drafts.csswg.org/css-display-3/#run-in-layout https://drafts.csswg.org/css2/#run-in (which just references a definition elsewhere that may now be disappearing)

dholbert commented 9 months ago

Ah, I suppose this is a dupe of https://github.com/w3c/csswg-drafts/issues/339 , where @dauwhe makes the point that there exist non-browser CSS engines that do support and use display:run-in.

svgeesus commented 9 months ago

The latest (vague, handwavy) definition of run-in is in the 2008 CSS2 Recommendation

A run-in box behaves as follows:

If a block box (that does not float and is not absolutely positioned) follows the run-in box, the run-in box becomes the first inline box of the block box. Otherwise, the run-in box becomes a block box.

The properties of the run-in element are inherited from its parent in the source tree, not from the block box it visually becomes part of.

That is it, the entire definition.

dholbert commented 9 months ago

The latest (vague, handwavy) definition of run-in is in the 2008 CSS2 Recommendation

I think there's a more-recent and somewhat-more-complete definition/explanation in css-display-3 chapter 5

That's the main chunk that would want removing, if we do decide to remove this. (Though maybe there is/was active implementation and usage in non-browser-engines per #339?)

svgeesus commented 9 months ago

That's the main chunk that would want removing, if we do decide to remove this. (Though maybe there is/was active implementation and usage in non-browser-engines per #339?)

It would be great to have a list of those non-browser implementations, what particular vintage of the spec they are based on, and which particular parts they actually implement. And any tests, even manual visual ones, together with test results.

I say this because if there are 2+ interoperable implementations then extending/replacing the functionality is different to the case where each implementation does it's own thing and the CSS is effectively engine-specific.

dauwhe commented 9 months ago

The latest version of Prince, 15.2, still supports this. Their documentation just mentions the syntax, with no details about the implementation.

Crissov commented 9 months ago

If I remember correctly, Presto/Opera had a decent implementation at the time.

frivoal commented 9 months ago

Spec fiction doesn't help anyone, but I think this is a useful feature, have wished for it in the past when making web sites, and I'd like for it to be widely implemented. This is commonly seen in Japanese typography, as discussed in JLREQ: https://www.w3.org/TR/jlreq/#processing_of_runin_heading

Outside of Japanese typography, I'd say Example 6 from the Display spec is also a perfectly legitimate use of the feature.

If there is web developer/author interest in this sort of "run-in" styling functionality we should redesign a new feature that is based on the host language having a definition/concept of "paragraph" as noted for example in https://html.spec.whatwg.org/multipage/dom.html#paragraph.

I'm not sure I understand in what way HTML is incompatible with this, or in what way the feature could be redesigned to be more aligned with HTML

<h4>Some Heading</h4>
<p>Lorem ipsum…

is definitely the markup you would expect in these Japanese examples. The choice to display the heading as run-in is purely stylistic, and if not displayed as run-in, ordinary block layout does the right thing.

Would some subtle change in how it's defined make it more easily implementable, while maintaining it's main purpose? I'd like that more than dropping it.