From 4989d72549b53f751d2999a771e0bc6737015810 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 12 May 2019 16:17:12 +0100 Subject: Computed styles: Drop uncommon extension blocks. They were a space saving feature, but they became largely redundant with computed style sharing. They also made the code complex and buggy in many places. E.g. the cascade, inheritance / composition, and intial values all needed to behave corretly when they, or their parent, had or didn't have an uncommon block. Also, only the uncommon block was really used. Fixes: https://bugs.netsurf-browser.org/mantis/view.php?id=2641 --- src/select/properties/cursor.c | 49 +++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 29 deletions(-) (limited to 'src/select/properties/cursor.c') diff --git a/src/select/properties/cursor.c b/src/select/properties/cursor.c index 6effdb5..c5e50c6 100644 --- a/src/select/properties/cursor.c +++ b/src/select/properties/cursor.c @@ -169,42 +169,33 @@ css_error css__compose_cursor(const css_computed_style *parent, css_computed_style *result) { css_error error; + lwc_string **copy = NULL; lwc_string **urls = NULL; uint8_t type = get_cursor(child, &urls); - if ((child->i.uncommon == NULL && parent->i.uncommon != NULL) || - type == CSS_CURSOR_INHERIT || - (child->i.uncommon != NULL && result != child)) { - size_t n_urls = 0; - lwc_string **copy = NULL; - - if ((child->i.uncommon == NULL && parent->i.uncommon != NULL) || - type == CSS_CURSOR_INHERIT) { - type = get_cursor(parent, &urls); - } - - if (urls != NULL) { - lwc_string **i; + if (type == CSS_CURSOR_INHERIT) { + type = get_cursor(parent, &urls); + } - for (i = urls; (*i) != NULL; i++) - n_urls++; + if (urls != NULL) { + lwc_string **i; + size_t n_urls = 0; - copy = malloc((n_urls + 1) * - sizeof(lwc_string *)); - if (copy == NULL) - return CSS_NOMEM; + for (i = urls; (*i) != NULL; i++) + n_urls++; - memcpy(copy, urls, (n_urls + 1) * - sizeof(lwc_string *)); - } - - error = set_cursor(result, type, copy); - if (error != CSS_OK && copy != NULL) - free(copy); + copy = malloc((n_urls + 1) * + sizeof(lwc_string *)); + if (copy == NULL) + return CSS_NOMEM; - return error; + memcpy(copy, urls, (n_urls + 1) * + sizeof(lwc_string *)); } - return CSS_OK; -} + error = set_cursor(result, type, copy); + if (error != CSS_OK && copy != NULL) + free(copy); + return error; +} -- cgit v1.2.3