+ attr = abc_obj_get_attr(obj, ABC_HTML_ATTR_POSITION);
+ if (!attr || 0 == attr->value->len)
+ return 0;
+
+ int pos_type = abc_css_position(attr->value->data);
+ if (ABC_POSITION_STATIC == pos_type)
+ return 0;
+
+ int top = 0;
+ int bottom = 0;
+ int left = 0;
+ int right = 0;
+
+ attr = abc_obj_get_attr(obj, ABC_HTML_ATTR_TOP);
+ if (attr)
+ top = abc_css_length(obj, attr->value->data, obj->h);
+
+ attr = abc_obj_get_attr(obj, ABC_HTML_ATTR_BOTTOM);
+ if (attr)
+ bottom = abc_css_length(obj, attr->value->data, obj->h);
+
+ attr = abc_obj_get_attr(obj, ABC_HTML_ATTR_LEFT);
+ if (attr)
+ left = abc_css_length(obj, attr->value->data, obj->w);
+
+ attr = abc_obj_get_attr(obj, ABC_HTML_ATTR_RIGHT);
+ if (attr)
+ right = abc_css_length(obj, attr->value->data, obj->w);
+
+ int x = obj->x;
+ int y = obj->y;
+
+ switch (pos_type)
+ {
+ case ABC_POSITION_FIXED:
+ LAYOUT_POS_FIXED(x, w, w_set, left, right);
+ LAYOUT_POS_FIXED(y, h, h_set, top, bottom);
+ break;
+
+ case ABC_POSITION_RELATIVE:
+ scf_logd("top: %d, bottom: %d, left: %d, right: %d, obj->w: %d, parent->w: %d\n", top, bottom, left, right, obj->w, parent->w);
+ LAYOUT_POS_RELATIVE(x, left, right);
+ LAYOUT_POS_RELATIVE(y, top, bottom);
+ break;
+
+ case ABC_POSITION_ABSOLUTE:
+ LAYOUT_POS_ABSOLUTE(x, w, left, right);
+ LAYOUT_POS_ABSOLUTE(y, h, top, bottom);
+ break;
+ default:
+ break;
+ };
+
+ abc_css_update_xy(obj, obj->x - x, obj->y - y);
+
+ return pos_type;