From ba1261ab3f03a9e40f0f1be44a1a992e258662fc Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 22 Aug 2015 11:33:23 +0100 Subject: Composition: Avoid extension block checks irrelevent to property group. --- src/select/computed.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'src/select') diff --git a/src/select/computed.c b/src/select/computed.c index 182a7e7..107c884 100644 --- a/src/select/computed.c +++ b/src/select/computed.c @@ -296,20 +296,24 @@ css_error css_computed_style_compose(const css_computed_style *parent, /* Iterate through the properties */ for (i = 0; i < CSS_N_PROPERTIES; i++) { - /* Skip any in extension blocks if the block does not exist */ - if (prop_dispatch[i].group == GROUP_UNCOMMON && - parent->i.uncommon == NULL && - child->i.uncommon == NULL) - continue; - - if (prop_dispatch[i].group == GROUP_PAGE && - parent->page == NULL && child->page == NULL) - continue; - - if (prop_dispatch[i].group == GROUP_AURAL && - parent->i.aural == NULL && - child->i.aural == NULL) - continue; + /* Skip any in extension blocks if the block does not exist */ + switch(prop_dispatch[i].group) { + case GROUP_NORMAL: + break; + case GROUP_UNCOMMON: + if (parent->i.uncommon == NULL && + child->i.uncommon == NULL) + continue; + break; + case GROUP_PAGE: + if (parent->page == NULL && child->page == NULL) + continue; + break; + case GROUP_AURAL: + if (parent->i.aural == NULL && child->i.aural == NULL) + continue; + break; + } /* Compose the property */ error = prop_dispatch[i].compose(parent, child, *result); -- cgit v1.2.3