Selectivizr test suite

selectivizr parsing / implementation tests

This group of tests have been designed to designed to check various internal functions to ensure that selectivizr is correctly parsing style sheet content. The results of these tests are NOT dependant on the choice of selector library and should therefore always pass.

@import syntax tests

@import url("...") Testing @import rule with url wrapped in double quotes and prefixed with the url() qualifier
@import url('...') Testing @import rule with url wrapped in single quotes and prefixed with the url() qualifier
@import url(...) Testing @import rule with url without quotes and prefixed with the url() qualifier
@import "..." Testing @import rule with url wrapped in double quotes without the url() qualifier
@import '...' Testing @import rule with url wrapped in single quotes without the url() qualifier
@import url("../file.css") Testing @import rule with a relative path
@import url("/path/file.css") Testing @import rule with a root-relative path (see note in 'master.css')
@import url("http://domain/path/file.css") Testing @import rule with a fully qualified path (see note in 'master.css')

url syntax tests

background: url("...") Testing css property containing a url wrapped in double quotes and prefixed with the url() qualifier
background: url('...') Testing css property containing a url wrapped in single quotes and prefixed with the url() qualifier
background: url(...) Testing css property containing a url without quotes and prefixed with the url() qualifier
background:url(...) Testing css property containing a url without white-space between the property and value
background: url("data:...") Testing css property containing a url that uses the data scheme

iframe tests

Selector engine tests

These tests are designed to identify problems or unsupported features with specific selector engines.

Attribute selectors

E[foo~="bar"] Check attribute "foo" contains value "bar" in a list of whitespace-separated values
E[foo~="bar"] Check attribute "foo" contains the value "bar" when "bar" is the only value in the list
E[foo|="bar"] Check attribute "foo" begins with the value "bar" in a list of hyphen-separated values
E[foo^="bar"] Check attribute "foo" begins with the value "bar"
E[foo$="bar"] Check attribute "foo" ends with the value "bar"
E[foo*="bar"] Check attribute "foo" contains the value "bar"
E[foo^=""] Check library catches native IE selector bug when testing against empty attribute value
E[foo$=""] Check library catches native IE selector bug when testing against empty attribute value
E[foo*=""] Check library catches native IE selector bug when testing against empty attribute value

UI pseudo-class tests

:hover
:not(:hover)
:focus
:not(:focus)
:enabled
:disabled
:checked
:not(:checked)

Pseudo-class tests

:root
:target
:empty
:empty (with HTML comment)
  :not(:empty)
:not(:empty) (empty child tag)
:first-child
:not(:first-child)
:nth-child(x)
:not(:nth-child(x))
:only-child
:only-child (with HTML comment)
:not(:only-child)
:nth-last-child(x)
:not(:nth-last-child(x))
:not(:last-child)
:last-child
:first-of-type
:not(:first-of-type)
:nth-of-type(x)
:not(:nth-of-type(x))
:only-of-type
:only-of-type (with HTML comment)
:not(:only-of-type)
:nth-last-of-type(x)
:not(:nth-last-of-type(x))
:not(:last-of-type)
:last-of-type

HTML5 element tests

:first-of-type
:not(:first-of-type)