css-validator icon indicating copy to clipboard operation
css-validator copied to clipboard

"Validated CSS" is not correct for some @​rules

Open ylafon opened this issue 7 years ago • 2 comments

Like @media screen { }giving @media screen in the output, or improper { in the case of nested @​rules.

ylafon avatar Mar 16 '18 14:03 ylafon

Consider this example:

@media print {
    @page {size: a4}
    body {background: none}
 }

The validator will currently show:

@media print {}
@page {size: a4}
body {background: none}

Notice how the "@media print" is ended before the @page block and how the "body" rule is promoted to the global (unrestricted) level.

Is this also in the scope of this issue?

hannibal218bc avatar Dec 21 '19 21:12 hannibal218bc

At https://github.com/Handig-Eekhoorn/css-validator/tree/heek-nested-blocks-fix-issue-182 is a first try to make Stylesheet and CssRuleList aware of nested CssRuleList blocks. I've only added a List<CssRuleList> newGetRulesTree() to Stylesheet and List<ICssStyleRuleOrCssRuleList> getStyleRulesTree() to CssRuleList.

I have no idea what further needs to be done to also display the rule block tree on the validation output page.

hannibal218bc avatar Dec 22 '19 09:12 hannibal218bc