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

[csswg-drafts] [cssom] Serialization of nested grouping rules is all weird (#5494)

From: Emilio Cobos Álvarez via GitHub <sysbot+gh@w3.org>
Date: Thu, 03 Sep 2020 08:34:27 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-691764790-1599122066-sysbot+gh@w3.org>
emilio has just created a new issue for https://github.com/w3c/csswg-drafts:

== [cssom] Serialization of nested grouping rules is all weird ==
https://drafts.csswg.org/cssom/#serialize-a-css-rule includes "separated by a newline and indented by two spaces" in some rules like `CSSMediaRule` is a bit weird.

Take this example ([link](http://crisal.io/tmp/cssText-nested.html)):

<!DOCTYPE html>
@media screen { @media screen { div { color: red } } }
@supports (display: grid) { @supports (display: grid) { foo { color: green } }

All browsers show the following on the console:

@media screen {
  @media screen {
  div { color: red; }
@supports (display: grid) {
  @supports (display: grid) {
  foo { color: green; }

Which is pretty odd. It is very simple because that means that the serialization for a rule doesn't have to be stateful, but the result just sucks...

My question is, should we fix this? And assuming the answer is yes, should we fix this by properly indenting things, or by removing the indentation altogether?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5494 using your GitHub account

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 3 September 2020 08:34:29 UTC

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