Skip to content
This repository was archived by the owner on Nov 9, 2023. It is now read-only.

Pseudo elements parsing and case sensitivity #4

@lisurc

Description

@lisurc

According to the CSS docs (http://www.w3.org/TR/CSS2/selector.html § 5.10), pseudo elements and pseudo classes are case-insensitive. Values like :first-child, :First-Child or :FIRST-CHILD should be parsed in the same way.

The following snippet validates correctly with the w3 CSS validator but fails to be parsed with CsCss 1.0.1.0:

@charset "UTF-8";

div:First-Child {
    text-align: center;
}

I've tested it using the project sources by adding the following test case :

[TestMethod]
public void CssFirstChild_20140527()
{
    var loader = new CssLoader();
    var css = loader.ParseSheet(Css20140527_pseudo_element_case, SheetUri, BaseUri);
    Assert.IsTrue(css.StyleRules.Any(), "No rules found");
}

private string Css20140527_pseudo_element_case
{
    get { return GetResourceFile("20140527_pseudo-element-case.css"); }
}

As a temporary / permanent workaround I'll update my CSS files to use lower case pseudo elements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions