CSSDocumentRule must be checked first, otherwise an exception will be
thrown