+static void __css_padding_split(abc_obj_t* obj, abc_attr_t* attr, int top, int bottom, int left, int right)
+{
+ char* p0 = NULL;
+ char* p1 = attr->value->data;
+ int n = 0;
+ int c;
+
+ char* strs[4] = {NULL};
+ size_t lens[4];
+
+ do {
+ c = *p1;
+
+ if ('\0' == c || ' ' == c) {
+ if (!p0)
+ goto next;
+
+ strs[n] = p0;
+ lens[n] = (size_t)(p1 - p0);
+
+ if (++n >= 4)
+ break;
+
+ p0 = NULL;
+ } else {
+ if (!p0)
+ p0 = p1;
+ }
+next:
+ p1++;
+ } while (c);
+
+ switch (n) {
+ case 1:
+ abc_obj_set_attr(obj, top, strs[0], lens[0]);
+ abc_obj_set_attr(obj, bottom, strs[0], lens[0]);
+ abc_obj_set_attr(obj, left, strs[0], lens[0]);
+ abc_obj_set_attr(obj, right, strs[0], lens[0]);
+ break;
+ case 2:
+ abc_obj_set_attr(obj, top, strs[0], lens[0]);
+ abc_obj_set_attr(obj, bottom, strs[0], lens[0]);
+ abc_obj_set_attr(obj, left, strs[1], lens[1]);
+ abc_obj_set_attr(obj, right, strs[1], lens[1]);
+ break;
+ case 3:
+ abc_obj_set_attr(obj, top, strs[0], lens[0]);
+ abc_obj_set_attr(obj, left, strs[1], lens[1]);
+ abc_obj_set_attr(obj, right, strs[1], lens[1]);
+ abc_obj_set_attr(obj, bottom, strs[2], lens[2]);
+ break;
+ case 4:
+ abc_obj_set_attr(obj, top, strs[0], lens[0]);
+ abc_obj_set_attr(obj, right, strs[1], lens[1]);
+ abc_obj_set_attr(obj, bottom, strs[2], lens[2]);
+ abc_obj_set_attr(obj, left, strs[3], lens[3]);
+ break;
+ default:
+ break;
+ };
+}
+