Merge pull request #54 from Azq2/patch-11

fix specificity for .class
This commit is contained in:
Alexander 2018-05-27 00:15:33 +03:00 committed by GitHub
commit 578bedb548
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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