From 2489e4e1295c572ba124483982972c02f13d6c58 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Tue, 27 Mar 2007 07:03:29 +0000 Subject: [PATCH] comment on the order of parsing declarations --- src/style.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/style.cpp b/src/style.cpp index 722f1677d..3ccdb7e97 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -1128,6 +1128,9 @@ sp_style_merge_from_props(SPStyle *const style, CRPropList *const props) static void sp_style_merge_from_decl_list(SPStyle *const style, CRDeclaration const *const decl_list) { + // read the decls from end to start, using head recursion, so that latter declarations override + // (Ref: http://www.w3.org/TR/REC-CSS2/cascade.html#cascading-order point 4.) + // because sp_style_merge_style_from_decl only sets properties that are unset if (decl_list->next) { sp_style_merge_from_decl_list(style, decl_list->next); } -- 2.30.2