fix specificity for pseudo elements

Fix specificity for pseudo-elements with one semi-colon, for example :after
This commit is contained in:
Кирилл Жумарин 2018-05-26 15:42:51 +03:00 committed by GitHub
parent 91f37b6365
commit 92c465f81a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -248,8 +248,13 @@ void mycss_selectors_parser_selector_pseudo_class(mycss_entry_t* entry, mycss_to
} }
} }
if (selector->type == MyCSS_SELECTORS_TYPE_PSEUDO_ELEMENT) {
if(entry->selectors->specificity)
entry->selectors->specificity->c++;
} else {
if(entry->selectors->specificity) if(entry->selectors->specificity)
entry->selectors->specificity->b++; entry->selectors->specificity->b++;
}
mycss_selectors_parser_check_and_set_bad_parent_selector(entry, entry->selectors->list_last); mycss_selectors_parser_check_and_set_bad_parent_selector(entry, entry->selectors->list_last);
mycss_selectors_parser_selector_end(entry, token); mycss_selectors_parser_selector_end(entry, token);