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

Pseudo elements parsing and case sensitivity #4

Open
lisurc opened this issue May 27, 2014 · 0 comments
Open

Pseudo elements parsing and case sensitivity #4

lisurc opened this issue May 27, 2014 · 0 comments

Comments

@lisurc
Copy link

lisurc commented May 27, 2014

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant