Open amirrajan opened 7 years ago
I think there's probably a bug in:
#define define_property_sym(name, count) \
static VALUE node_##name##s[count] = { Qnil } ; \
static VALUE \
node_##name##_get(VALUE rcv, SEL sel) \
{ \
int value = NODE(rcv)->node->style.name; \
if (value >= count) { \
rb_raise(rb_eArgError, "incorrect value for %s", #name); \
} \
return node_##name##s[value]; \
} \
static VALUE \
node_##name##_set(VALUE rcv, SEL sel, VALUE value) \
{ \
struct ruby_css_node *node = NODE(rcv); \
for (int i = 0; i < count; i++) { \
if (node_##name##s[i] == value) { \
(*(int *)&node->node->style.name) = i; \
return value; \
} \
} \
rb_raise(rb_eArgError, "incorrect value for %s", #name); \
}
more exactly:
static VALUE \
node_##name##_set(VALUE rcv, SEL sel, VALUE value) \
{ \
struct ruby_css_node *node = NODE(rcv); \
for (int i = 0; i < count; i++) { \
if (node_##name##s[i] == value) { \
(*(int *)&node->node->style.name) = i; \
return value; \
} \
} \
rb_raise(rb_eArgError, "incorrect value for %s", #name); \
}
This however works:
The following properties would be impacted because of this (I think):