summaryrefslogtreecommitdiff
path: root/src/select/select.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2015-08-19 18:20:30 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2015-08-19 18:20:30 +0100
commitb1684e3588d95b93f3268895c5a0a7c156cd018e (patch)
treeb72b2a61421cdccd56bbf0c3bf4b121343243b39 /src/select/select.c
parentf6f52757684709f7b09ed68b534226ae31633bce (diff)
downloadlibcss-b1684e3588d95b93f3268895c5a0a7c156cd018e.tar.gz
libcss-b1684e3588d95b93f3268895c5a0a7c156cd018e.tar.bz2
Slight simplification of set_initial group checks.
Diffstat (limited to 'src/select/select.c')
-rw-r--r--src/select/select.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/select/select.c b/src/select/select.c
index 92696ff..17dff31 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -1173,26 +1173,25 @@ css_error set_initial(css_select_state *state,
* accessors to return the initial values for the
* property.
*/
- if (group == GROUP_NORMAL) {
- error = prop_dispatch[prop].initial(state);
- if (error != CSS_OK)
- return error;
- } else if (group == GROUP_UNCOMMON &&
- state->computed->uncommon != NULL) {
- error = prop_dispatch[prop].initial(state);
- if (error != CSS_OK)
- return error;
- } else if (group == GROUP_PAGE &&
- state->computed->page != NULL) {
- error = prop_dispatch[prop].initial(state);
- if (error != CSS_OK)
- return error;
- } else if (group == GROUP_AURAL &&
- state->computed->aural != NULL) {
- error = prop_dispatch[prop].initial(state);
- if (error != CSS_OK)
- return error;
+ switch (group) {
+ case GROUP_NORMAL:
+ break;
+ case GROUP_UNCOMMON:
+ if (state->computed->uncommon == NULL)
+ return CSS_OK;
+ break;
+ case GROUP_PAGE:
+ if (state->computed->page == NULL)
+ return CSS_OK;
+ break;
+ case GROUP_AURAL:
+ if (state->computed->aural == NULL)
+ return CSS_OK;
+ break;
}
+ error = prop_dispatch[prop].initial(state);
+ if (error != CSS_OK)
+ return error;
}
return CSS_OK;