From 6e2acdba15fff06755ac5a724316e3b550ef3779 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Wed, 11 Oct 2017 17:45:02 +0200 Subject: Allow one !important rule to override another if later and has equal or higher specificity. Patch from Jabier. --- src/libcroco/cr-sel-eng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcroco/cr-sel-eng.c b/src/libcroco/cr-sel-eng.c index ea04bfd2e..9e35ad93f 100644 --- a/src/libcroco/cr-sel-eng.c +++ b/src/libcroco/cr-sel-eng.c @@ -1669,7 +1669,7 @@ put_css_properties_in_props_list (CRPropList ** a_props, CRStatement * a_stmt) *(unless the already selected declaration *has an UA origin) */ - if (decl->important == TRUE + if (decl->important == TRUE && cur_decl->important != TRUE && decl->parent_statement->parent_sheet->origin != ORIGIN_UA) { continue; @@ -1708,7 +1708,7 @@ put_css_properties_in_props_list (CRPropList ** a_props, CRStatement * a_stmt) */ if (a_stmt->specificity >= decl->parent_statement->specificity) { - if (decl->important == TRUE) + if (decl->important == TRUE && cur_decl->important != TRUE) continue; props = cr_prop_list_unlink (props, pair); if (pair) { -- cgit v1.2.3