W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2020

Re: [csswg-drafts] [cssom] The way CSSStyleDeclaration exposes properties is not ideal. (#5649)

From: Emilio Cobos Álvarez via GitHub <sysbot+gh@w3.org>
Date: Thu, 10 Dec 2020 19:57:30 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-742760748-1607630249-sysbot+gh@w3.org>
So, here's a proposal. All of the interfaces below would extend `CSSStyleDeclaration` and thus have a `getPropertyValue` / `setProperty` / `cssText` / `length` / `item` / etc...:

 * `CSSStyleProperties` (`CSS2Properties`) for style declarations: inline style / `getComputedStyle` / `CSSStyleRule.style`. This is basically the current `CSSStyleDeclaration`. I like `CSSStyleProperties` a bit more, because it's more consistent, but there's precedent for `CSS2Properties`, and that's what Gecko calls it, so it's a bit more compatible.
 * `CSSPageProperties` for `@page` rules, with only the page descriptor.
 * `CSSCounterStyleProperties` for `@counter-style`
 * `CSSFontFaceProperties` for `@font-face`

etc. Two thoughts:

 * I'd prefer to use `CSS{Style,Page,...}Declarations`, but I think that might be confusing with the existing `CSSStyleDeclaration`.
 * An alternative that doesn't use `Properties` would be `Block` (so, `CSSStyleBlock` / `CSSPageBlock` / ...), which could be nice because it avoids using `Properties` for something that's "descriptors"...

But this eventually comes down to naming, so... thoughts?

-- 
GitHub Notification of comment by emilio
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5649#issuecomment-742760748 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 10 December 2020 19:57:32 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:23 UTC