summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2015-08-22 10:33:23 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2016-11-19 14:30:07 (GMT)
commitba1261ab3f03a9e40f0f1be44a1a992e258662fc (patch)
tree0ed70c8847dc32aa87f9bb24e0b4f5f03f1e7a29
parentc953724a1a4bcaf03fc33a9f3bef8b864cb865d0 (diff)
downloadlibcss-ba1261ab3f03a9e40f0f1be44a1a992e258662fc.tar.gz
libcss-ba1261ab3f03a9e40f0f1be44a1a992e258662fc.tar.bz2
Composition: Avoid extension block checks irrelevent to property group.
-rw-r--r--src/select/computed.c32
1 files changed, 18 insertions, 14 deletions
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);