[cssom] Make CSSStyleRule serialization aware of nesting.#6117
Conversation
| <li>If |decls| is not null, prepend it to |rules|. | ||
| <li>For each |rule| in |rules|: | ||
| <ol> | ||
| <li>Append a newline followed by two spaces to |s|. |
There was a problem hiding this comment.
A bit weird that we're doing this fake indentation thing. So for nested declarations this would look like:
Source:
a {
b {
c {
color: red;
}
}
}
cssText:
a {
b {
c { color: red; } }
}
Which is a bit off. I think I'd rather avoid newlines completely, but not particularly opposed.
There was a problem hiding this comment.
I absolutely agree that this is busted, I'm just copying the existing indentation treatment for the other rules in the spec; @media already shows off that exact same awful behavior, for instance.
I didn't want to try and fix the indentation for just this rule and leave the rest busted, so I stuck with the current behavior and assume that all of them can be fixed up at once in a separate commit.
There was a problem hiding this comment.
Sounds good to me, thanks.
@emilio review please?