w3c / csswg-drafts

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

[cssom-1] `CSSPageDescriptors` is missing descriptor attributes #10105

Open cdoublev opened 5 months ago

cdoublev commented 5 months ago

Only "standalone" descriptors and "property-like" margin-* descriptors are defined as CSSPageDescriptors attributes.

page-orientation (fixed by #10521) and other page properties are missing. Is there any reason for this?


[if they are missing]

Quote from @gsnedders:

There's a part of me that wonders if we actually what to define this, rather than "all descriptors supported for the @page at-rule", similar to what we do with properties?

+1. Maybe the definition of a supported property or descriptor should be narrowed down to a valid property or descriptor in the context. For example:

For each descriptor descriptor that is a supported CSS descriptor valid in @page, the following interface applies ...

[definition with dashed, camel-cased, and legacy attribute names]

gsnedders commented 5 months ago

At least years ago, CSSOM was defining the object model for CSS 2, with the intention of putting everything for later levels in their own modules. This would imply that CSS Page 3 should be defining a lot of this itself.

While I'm definitely in broad strokes in favour of explicitly enumerating IDL attributes (this makes it possible for anything relying on extracted data from reffy, like WPT's idlharness tests, to actually test for presence and similar), it is unfortunate that allows things like this to fall through the cracks.

mstensho commented 1 week ago

@emilio Would be great to have this clarified and cleaned up. It doesn't seem right to include margins, but not other valid page properties, such as padding, width, background, and so on. See https://drafts.csswg.org/css-page-3/#page-property-list

Are e.g. margins descriptors at all, or just regular properties?

See also https://github.com/w3c/csswg-drafts/issues/5969