- From: Emilio Cobos Álvarez via GitHub <noreply@w3.org>
- Date: Fri, 16 Jan 2026 14:15:17 +0000
- To: public-css-archive@w3.org
> CSSStyleDeclaration.prototype.source / CSSStyleRule.prototype.source / CSSStyleSheet.prototype.source : CSS code that produced the object, before parsing. Akin to ES internal [[SourceText]].
The object or the text? Those are different... What happens if you have something unknown in the middle of the declarations? That currently just gets skipped and we parse more declarations but something like:
```css
.foo { color: red; @bar baz; background-color: blue; }
```
Should presumably now create a nested declaration block and some sort of unknown rule thing?
In general, for property declarations it seems maybe doable, where you'd presumably just keep an identifier and the raw unparsed declaration text. That already has a ton of interesting behaviors that we'd need to define (what if we want some of those properties to eventually become shorthands and so on? Are those enumerated? Also what about invalid property values for existing valid properties? How does that look like in the existing OM?).
I'd start with declarations and avoid getting unknown rules into the mix, because those have a much more varied syntax. E.g. imagine a CSS engine doesn't understand `@keyframes`, what structure should it produce for that?
Also it'd be weird to eventually say "this rule isn't valid in this context", and now you get a different set of rules between an engine that understands it and one that doesn't...
--
GitHub Notification of comment by emilio
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13186#issuecomment-3760217717 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 16 January 2026 14:15:18 UTC