From 44c70db481c005bceba5bc4ab23fb1af2e93f1f3 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 12 Mar 2011 21:59:03 +0000 Subject: Ensure that the uncommon extension block is initialised correctly svn path=/trunk/libcss/; revision=11990 --- src/select/propset.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/select/propset.h b/src/select/propset.h index f3c314e..7c29db4 100644 --- a/src/select/propset.h +++ b/src/select/propset.h @@ -16,6 +16,29 @@ /* Important: keep this file in sync with computed.h */ /** \todo Is there a better way to ensure this happens? */ +static const css_computed_uncommon default_uncommon = { + { (CSS_LETTER_SPACING_INHERIT << 2) | CSS_OUTLINE_COLOR_INVERT, + (CSS_OUTLINE_WIDTH_MEDIUM << 1) | CSS_BORDER_SPACING_INHERIT, + 0, + (CSS_WORD_SPACING_INHERIT << 2) | + (CSS_COUNTER_INCREMENT_NONE << 1) | CSS_COUNTER_RESET_NONE, + (CSS_CURSOR_INHERIT << 3) | 0, + 0, + 0, + (CSS_CLIP_AUTO << 2) | CSS_CONTENT_NORMAL + }, + { 0, 0 }, + { 0, 0, 0, 0 }, + 0, + 0, + 0, + 0, + NULL, + NULL, + NULL, + NULL +}; + #define ENSURE_UNCOMMON do { \ if (style->uncommon == NULL) { \ style->uncommon = style->alloc(NULL, \ @@ -23,7 +46,7 @@ if (style->uncommon == NULL) \ return CSS_NOMEM; \ \ - memset(style->uncommon, 0, \ + memcpy(style->uncommon, &default_uncommon, \ sizeof(css_computed_uncommon)); \ } \ } while(0) -- cgit v1.2.3