Skip to content

Finder: alternative fix for correct property order #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions source/modest/finder/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,7 @@ bool modest_finder_thread_spec_is_up(modest_style_raw_specificity_t* spec_f, mod
else if(spec_f->c < spec_t->c)
return false;

/* when a property is repeated with multiple values take the last one*/
return true;
return false;
}

void modest_finder_thread_declaratin_append(modest_finder_thread_found_context_t* found_context, bool is_low_priority,
Expand Down Expand Up @@ -390,12 +389,21 @@ void modest_finder_thread_declaratin_list_replace(modest_finder_thread_found_con
modest_finder_thread_entry_t* entry, mycss_declaration_entry_t* dec_entry,
mycss_selectors_specificity_t* spec)
{
while(dec_entry) {
modest_style_raw_specificity_t raw_spec = {((unsigned int)dec_entry->is_important), spec->a, spec->b, spec->c};

modest_finder_thread_declaratin_append(found_context, false, entry, dec_entry, &raw_spec);

dec_entry = dec_entry->next;

//to make sure last property declaration takes precedence, iterate from last to first
mycss_declaration_entry_t* next_entry = dec_entry != NULL ? dec_entry->next : NULL;
while (next_entry)
{
dec_entry = next_entry;
next_entry = next_entry->next;
}

while(dec_entry)
{
modest_style_raw_specificity_t raw_spec = { ((unsigned int)dec_entry->is_important), spec->a, spec->b, spec->c };

modest_finder_thread_declaratin_append(found_context, false, entry, dec_entry, &raw_spec);
dec_entry = dec_entry->prev;
}
}

Expand Down