|
|
@@ -2993,6 +2993,47 @@ static int css_mp_px(const struct br_style *st, int v, int unit, int base)
|
|
|
return v;
|
|
|
}
|
|
|
|
|
|
+static int mp_px(const struct br_style *st, int side, int base)
|
|
|
+{
|
|
|
+ int raw;
|
|
|
+
|
|
|
+ switch (side) {
|
|
|
+ case 0: raw = st->mt; break;
|
|
|
+ case 1: raw = st->mr; break;
|
|
|
+ case 2: raw = st->mb; break;
|
|
|
+ case 3: raw = st->ml; break;
|
|
|
+ case 4: raw = st->pt; break;
|
|
|
+ case 5: raw = st->pr; break;
|
|
|
+ case 6: raw = st->pb; break;
|
|
|
+ default: raw = st->pl; break;
|
|
|
+ }
|
|
|
+ if (st->mp_unit[side] == 5)
|
|
|
+ return base * raw / 100 + st->mp_calc_px[side];
|
|
|
+ return css_mp_px(st, raw, st->mp_unit[side], base);
|
|
|
+}
|
|
|
+
|
|
|
+static int style_width_px(const struct br_style *st, int base)
|
|
|
+{
|
|
|
+ if (st->width_kind == 1)
|
|
|
+ return st->width;
|
|
|
+ if (st->width_kind == 2)
|
|
|
+ return base * (int)st->width / 100;
|
|
|
+ if (st->width_kind == 3)
|
|
|
+ return base * st->width_calc_pct / 100 + st->width_calc_px;
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static int style_height_px(const struct br_style *st, int base)
|
|
|
+{
|
|
|
+ if (st->height_kind == 1)
|
|
|
+ return st->height;
|
|
|
+ if (st->height_kind == 2)
|
|
|
+ return base * (int)st->height / 100;
|
|
|
+ if (st->height_kind == 3)
|
|
|
+ return base * st->height_calc_pct / 100 + st->height_calc_px;
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
static int css_size(unsigned char kind, int val, int base)
|
|
|
{
|
|
|
if (kind == 1)
|
|
|
@@ -3712,13 +3753,23 @@ static void add_image_run(struct lay *l, unsigned int node,
|
|
|
|
|
|
if (st->width_kind) {
|
|
|
css_w = 1;
|
|
|
- dw = st->width_kind == 2 ? maxw * (int)st->width / 100 :
|
|
|
- (int)st->width;
|
|
|
+ if (st->width_kind == 3)
|
|
|
+ dw = maxw * st->width_calc_pct / 100 +
|
|
|
+ st->width_calc_px;
|
|
|
+ else
|
|
|
+ dw = st->width_kind == 2 ?
|
|
|
+ maxw * (int)st->width / 100 :
|
|
|
+ (int)st->width;
|
|
|
}
|
|
|
if (st->height_kind) {
|
|
|
css_h = 1;
|
|
|
- dh = st->height_kind == 2 ? maxw * (int)st->height / 100 :
|
|
|
- (int)st->height;
|
|
|
+ if (st->height_kind == 3)
|
|
|
+ dh = maxw * st->height_calc_pct / 100 +
|
|
|
+ st->height_calc_px;
|
|
|
+ else
|
|
|
+ dh = st->height_kind == 2 ?
|
|
|
+ maxw * (int)st->height / 100 :
|
|
|
+ (int)st->height;
|
|
|
}
|
|
|
if (css_w && !css_h)
|
|
|
dh = ih ? ih * dw / iw : 0;
|
|
|
@@ -3726,7 +3777,10 @@ static void add_image_run(struct lay *l, unsigned int node,
|
|
|
dw = iw ? iw * dh / ih : 0;
|
|
|
|
|
|
if (st->max_width_kind) {
|
|
|
- int mw = st->max_width_kind == 2 ?
|
|
|
+ int mw = st->max_width_kind == 3 ?
|
|
|
+ maxw * st->max_width_calc_pct / 100 +
|
|
|
+ st->max_width_calc_px :
|
|
|
+ st->max_width_kind == 2 ?
|
|
|
maxw * (int)st->max_width / 100 :
|
|
|
(int)st->max_width;
|
|
|
if (mw > 0 && dw > mw) {
|
|
|
@@ -3780,8 +3834,7 @@ static void add_image_run(struct lay *l, unsigned int node,
|
|
|
/* Inline replaced elements honour their vertical margins; this
|
|
|
* is how Bootstrap's negative logo margins centre the wordmark. */
|
|
|
{
|
|
|
- int idy = css_mp_px(st, st->mt, st->mp_unit[0],
|
|
|
- l->right - l->left);
|
|
|
+ int idy = mp_px(st, 0, l->right - l->left);
|
|
|
|
|
|
if (idy < -2048)
|
|
|
idy = -2048;
|
|
|
@@ -3813,8 +3866,7 @@ static void add_image_run(struct lay *l, unsigned int node,
|
|
|
if (node < BR_MAX_NODES) {
|
|
|
layout_boxes[node].x = l->line_x;
|
|
|
layout_boxes[node].y = l->line_y +
|
|
|
- css_mp_px(st, st->mt, st->mp_unit[0],
|
|
|
- l->right - l->left);
|
|
|
+ mp_px(st, 0, l->right - l->left);
|
|
|
layout_boxes[node].w = dw;
|
|
|
layout_boxes[node].h = dh;
|
|
|
layout_boxes[node].valid = 1;
|
|
|
@@ -4420,9 +4472,10 @@ static void layout_block(struct lay *l, unsigned int node,
|
|
|
(st->left_set ? st->left : 0);
|
|
|
l->right = def_w >= 0 ? l->left + def_w :
|
|
|
page_rect.x + avail_w;
|
|
|
- if (st->bottom_set && st->height_kind == 1)
|
|
|
+ if (st->bottom_set && st->height_kind)
|
|
|
l->y = page_rect.y + page_rect.h -
|
|
|
- st->bottom - st->height;
|
|
|
+ st->bottom -
|
|
|
+ style_height_px(st, page_rect.w);
|
|
|
else
|
|
|
l->y = page_rect.y +
|
|
|
(st->top_set ? st->top : 0);
|
|
|
@@ -4437,10 +4490,10 @@ static void layout_block(struct lay *l, unsigned int node,
|
|
|
flow_right +
|
|
|
(st->left_set ? st->left : 0);
|
|
|
l->y = flow_y + (st->top_set ? st->top : 0);
|
|
|
- if (st->bottom_set && st->height_kind == 1 &&
|
|
|
+ if (st->bottom_set && st->height_kind &&
|
|
|
parent < BR_MAX_NODES && block_h[parent] > 0)
|
|
|
l->y = flow_y + block_h[parent] - st->bottom -
|
|
|
- st->height;
|
|
|
+ style_height_px(st, old_right - old_left);
|
|
|
}
|
|
|
old_left = l->left;
|
|
|
old_right = l->right;
|
|
|
@@ -4470,18 +4523,18 @@ static void layout_block(struct lay *l, unsigned int node,
|
|
|
cbw = old_right - old_left;
|
|
|
if (cbw < 8)
|
|
|
cbw = 8;
|
|
|
- l->y += css_mp_px(st, st->mt, st->mp_unit[0], cbw);
|
|
|
+ l->y += mp_px(st, 0, cbw);
|
|
|
top = l->y;
|
|
|
- ml = css_mp_px(st, st->ml, st->mp_unit[3], cbw);
|
|
|
- mr = css_mp_px(st, st->mr, st->mp_unit[1], cbw);
|
|
|
+ ml = mp_px(st, 3, cbw);
|
|
|
+ mr = mp_px(st, 1, cbw);
|
|
|
bl = st->border_w[3];
|
|
|
br = st->border_w[1];
|
|
|
- pl = css_mp_px(st, st->pl, st->mp_unit[7], cbw);
|
|
|
- pr = css_mp_px(st, st->pr, st->mp_unit[5], cbw);
|
|
|
+ pl = mp_px(st, 7, cbw);
|
|
|
+ pr = mp_px(st, 5, cbw);
|
|
|
bt = st->border_w[0];
|
|
|
bb = st->border_w[2];
|
|
|
- pt = css_mp_px(st, st->pt, st->mp_unit[4], cbw);
|
|
|
- pb = css_mp_px(st, st->pb, st->mp_unit[6], cbw);
|
|
|
+ pt = mp_px(st, 4, cbw);
|
|
|
+ pb = mp_px(st, 6, cbw);
|
|
|
deco_w = bl + br + pl + pr;
|
|
|
deco_h = bt + bb + pt + pb;
|
|
|
|
|
|
@@ -4503,14 +4556,20 @@ static void layout_block(struct lay *l, unsigned int node,
|
|
|
if (content_w < 0)
|
|
|
content_w = 0;
|
|
|
if (st->max_width_kind) {
|
|
|
- int mw = css_size(st->max_width_kind, st->max_width, cbw);
|
|
|
+ int mw = st->max_width_kind == 3 ?
|
|
|
+ cbw * st->max_width_calc_pct / 100 +
|
|
|
+ st->max_width_calc_px :
|
|
|
+ css_size(st->max_width_kind, st->max_width, cbw);
|
|
|
int max_box = st->box_sizing ? mw : mw + deco_w;
|
|
|
|
|
|
if (content_w + deco_w > max_box)
|
|
|
content_w = max_box - deco_w;
|
|
|
}
|
|
|
if (st->min_width_kind) {
|
|
|
- int mw = css_size(st->min_width_kind, st->min_width, cbw);
|
|
|
+ int mw = st->min_width_kind == 3 ?
|
|
|
+ cbw * st->min_width_calc_pct / 100 +
|
|
|
+ st->min_width_calc_px :
|
|
|
+ css_size(st->min_width_kind, st->min_width, cbw);
|
|
|
int min_box = st->box_sizing ? mw : mw + deco_w;
|
|
|
|
|
|
if (content_w + deco_w < min_box) {
|
|
|
@@ -4732,8 +4791,8 @@ static void layout_block(struct lay *l, unsigned int node,
|
|
|
l->y = l->float_bottom;
|
|
|
l->float_active = 0;
|
|
|
}
|
|
|
- if (st->height_kind == 1) {
|
|
|
- content_h = st->height;
|
|
|
+ if (st->height_kind) {
|
|
|
+ content_h = style_height_px(st, cbw);
|
|
|
if (st->box_sizing)
|
|
|
content_h -= deco_h;
|
|
|
} else {
|
|
|
@@ -4742,14 +4801,20 @@ static void layout_block(struct lay *l, unsigned int node,
|
|
|
if (content_h < 0)
|
|
|
content_h = 0;
|
|
|
if (st->max_height_kind) {
|
|
|
- int mh = css_size(st->max_height_kind, st->max_height, cbw);
|
|
|
+ int mh = st->max_height_kind == 3 ?
|
|
|
+ cbw * st->max_height_calc_pct / 100 +
|
|
|
+ st->max_height_calc_px :
|
|
|
+ css_size(st->max_height_kind, st->max_height, cbw);
|
|
|
int max_box = st->box_sizing ? mh : mh + deco_h;
|
|
|
|
|
|
if (content_h + deco_h > max_box)
|
|
|
content_h = max_box - deco_h;
|
|
|
}
|
|
|
if (st->min_height_kind) {
|
|
|
- int mh = css_size(st->min_height_kind, st->min_height, cbw);
|
|
|
+ int mh = st->min_height_kind == 3 ?
|
|
|
+ cbw * st->min_height_calc_pct / 100 +
|
|
|
+ st->min_height_calc_px :
|
|
|
+ css_size(st->min_height_kind, st->min_height, cbw);
|
|
|
int min_box = st->box_sizing ? mh : mh + deco_h;
|
|
|
|
|
|
if (content_h + deco_h < min_box)
|
|
|
@@ -4771,7 +4836,7 @@ static void layout_block(struct lay *l, unsigned int node,
|
|
|
l->left = old_left;
|
|
|
l->right = old_right;
|
|
|
l->align = old_align;
|
|
|
- l->y += css_mp_px(st, st->mb, st->mp_unit[2], cbw);
|
|
|
+ l->y += mp_px(st, 2, cbw);
|
|
|
if (!l->draw) {
|
|
|
if (box_h > 65535)
|
|
|
box_h = 65535;
|
|
|
@@ -4875,16 +4940,18 @@ static int intrinsic_width(struct ngui *ui, unsigned int node,
|
|
|
ih = (int)images[idx].img.h;
|
|
|
}
|
|
|
}
|
|
|
- if (cs.width_kind == 1) {
|
|
|
- w += cs.width;
|
|
|
- } else if (cs.width_kind == 2) {
|
|
|
- w += 64;
|
|
|
+ if (cs.width_kind) {
|
|
|
+ int ww = style_width_px(&cs, base);
|
|
|
+
|
|
|
+ w += ww > 0 ? ww : 64;
|
|
|
} else if (nd->width_attr) {
|
|
|
w += nd->width_attr;
|
|
|
} else if (nd->height_attr && iw && ih) {
|
|
|
w += iw * (int)nd->height_attr / ih;
|
|
|
- } else if (cs.height_kind == 1 && iw && ih) {
|
|
|
- w += iw * (int)cs.height / ih;
|
|
|
+ } else if (cs.height_kind && iw && ih) {
|
|
|
+ int hh = style_height_px(&cs, base);
|
|
|
+
|
|
|
+ w += hh > 0 ? iw * hh / ih : iw;
|
|
|
} else if (iw) {
|
|
|
w += iw;
|
|
|
} else {
|
|
|
@@ -4892,10 +4959,10 @@ static int intrinsic_width(struct ngui *ui, unsigned int node,
|
|
|
}
|
|
|
continue;
|
|
|
}
|
|
|
- w += css_mp_px(&cs, cs.pl, cs.mp_unit[7], base) +
|
|
|
- css_mp_px(&cs, cs.pr, cs.mp_unit[5], base) +
|
|
|
- css_mp_px(&cs, cs.ml, cs.mp_unit[3], base) +
|
|
|
- css_mp_px(&cs, cs.mr, cs.mp_unit[1], base);
|
|
|
+ w += mp_px(&cs, 7, base) +
|
|
|
+ mp_px(&cs, 5, base) +
|
|
|
+ mp_px(&cs, 3, base) +
|
|
|
+ mp_px(&cs, 1, base);
|
|
|
w += intrinsic_width(ui, c, &cs, depth + 1, base);
|
|
|
if (w > 4096)
|
|
|
break;
|
|
|
@@ -4948,18 +5015,18 @@ static unsigned int layout_float_group(struct lay *l, unsigned int first,
|
|
|
if (nd->tag == BR_TAG_A && nd->href_off)
|
|
|
lk = (unsigned short)n;
|
|
|
right = cs.float_left == 2;
|
|
|
- if (cs.width_kind == 2)
|
|
|
- colw = (row_right - row_left) * (int)cs.width / 100;
|
|
|
- else if (cs.width_kind == 1)
|
|
|
+ if (cs.width_kind == 2 || cs.width_kind == 3) {
|
|
|
+ colw = style_width_px(&cs, row_right - row_left);
|
|
|
+ } else if (cs.width_kind == 1) {
|
|
|
colw = (int)cs.width;
|
|
|
- else {
|
|
|
+ } else {
|
|
|
int base = row_right - row_left;
|
|
|
|
|
|
colw = intrinsic_width(l->ui, n, &cs, 0, base) +
|
|
|
- css_mp_px(&cs, cs.pl, cs.mp_unit[7], base) +
|
|
|
- css_mp_px(&cs, cs.pr, cs.mp_unit[5], base) +
|
|
|
- css_mp_px(&cs, cs.ml, cs.mp_unit[3], base) +
|
|
|
- css_mp_px(&cs, cs.mr, cs.mp_unit[1], base);
|
|
|
+ mp_px(&cs, 7, base) +
|
|
|
+ mp_px(&cs, 5, base) +
|
|
|
+ mp_px(&cs, 3, base) +
|
|
|
+ mp_px(&cs, 1, base);
|
|
|
if (colw < 8)
|
|
|
colw = 8;
|
|
|
}
|
|
|
@@ -5076,8 +5143,8 @@ static int flex_item_width(struct lay *l, unsigned int n,
|
|
|
(void)l;
|
|
|
int w;
|
|
|
|
|
|
- if (cs->width_kind == 2)
|
|
|
- w = avail * (int)cs->width / 100;
|
|
|
+ if (cs->width_kind == 2 || cs->width_kind == 3)
|
|
|
+ w = style_width_px(cs, avail);
|
|
|
else if (cs->width_kind == 1)
|
|
|
w = (int)cs->width;
|
|
|
else if (nd->tag == BR_TAG_IMG) {
|
|
|
@@ -5092,10 +5159,10 @@ static int flex_item_width(struct lay *l, unsigned int n,
|
|
|
w = 64;
|
|
|
} else {
|
|
|
w = intrinsic_width(l->ui, n, cs, 0, avail);
|
|
|
- w += css_mp_px(cs, cs->pl, cs->mp_unit[7], avail);
|
|
|
- w += css_mp_px(cs, cs->pr, cs->mp_unit[5], avail);
|
|
|
- w += css_mp_px(cs, cs->ml, cs->mp_unit[3], avail);
|
|
|
- w += css_mp_px(cs, cs->mr, cs->mp_unit[1], avail);
|
|
|
+ w += mp_px(cs, 7, avail);
|
|
|
+ w += mp_px(cs, 5, avail);
|
|
|
+ w += mp_px(cs, 3, avail);
|
|
|
+ w += mp_px(cs, 1, avail);
|
|
|
}
|
|
|
if (w < 24)
|
|
|
w = 24;
|
|
|
@@ -5304,8 +5371,12 @@ static void layout_flex_children(struct lay *l, unsigned int parent,
|
|
|
if (h > row_h)
|
|
|
row_h = h;
|
|
|
}
|
|
|
- if (pst->height_kind == 1 && pst->height > row_h)
|
|
|
- row_h = pst->height;
|
|
|
+ if (pst->height_kind) {
|
|
|
+ int hh = style_height_px(pst, avail);
|
|
|
+
|
|
|
+ if (hh > row_h)
|
|
|
+ row_h = hh;
|
|
|
+ }
|
|
|
for (k = 0; k < count; k++) {
|
|
|
struct br_style cs;
|
|
|
int node = (int)it[start + k].node;
|
|
|
@@ -5650,10 +5721,10 @@ static void table_columns(struct lay *l, unsigned int table,
|
|
|
if (span < 1)
|
|
|
break;
|
|
|
w = intrinsic_width(l->ui, c, &cs, 0, avail) +
|
|
|
- css_mp_px(&cs, cs.pl, cs.mp_unit[7], avail) +
|
|
|
- css_mp_px(&cs, cs.pr, cs.mp_unit[5], avail) +
|
|
|
- css_mp_px(&cs, cs.ml, cs.mp_unit[3], avail) +
|
|
|
- css_mp_px(&cs, cs.mr, cs.mp_unit[1], avail) +
|
|
|
+ mp_px(&cs, 7, avail) +
|
|
|
+ mp_px(&cs, 5, avail) +
|
|
|
+ mp_px(&cs, 3, avail) +
|
|
|
+ mp_px(&cs, 1, avail) +
|
|
|
cs.border_w[0] + cs.border_w[1] +
|
|
|
cs.border_w[2] + cs.border_w[3];
|
|
|
if (w < 24)
|
|
|
@@ -5692,14 +5763,10 @@ static void table_columns(struct lay *l, unsigned int table,
|
|
|
if (cs.display != BR_DISPLAY_NONE) {
|
|
|
w = intrinsic_width(l->ui, c, &cs,
|
|
|
0, avail) +
|
|
|
- css_mp_px(&cs, cs.pl,
|
|
|
- cs.mp_unit[7], avail) +
|
|
|
- css_mp_px(&cs, cs.pr,
|
|
|
- cs.mp_unit[5], avail) +
|
|
|
- css_mp_px(&cs, cs.ml,
|
|
|
- cs.mp_unit[3], avail) +
|
|
|
- css_mp_px(&cs, cs.mr,
|
|
|
- cs.mp_unit[1], avail) +
|
|
|
+ mp_px(&cs, 7, avail) +
|
|
|
+ mp_px(&cs, 5, avail) +
|
|
|
+ mp_px(&cs, 3, avail) +
|
|
|
+ mp_px(&cs, 1, avail) +
|
|
|
cs.border_w[0] + cs.border_w[1] +
|
|
|
cs.border_w[2] + cs.border_w[3];
|
|
|
sum = 0;
|
|
|
@@ -5738,8 +5805,10 @@ static void table_columns(struct lay *l, unsigned int table,
|
|
|
if (cs.width_kind == 1) {
|
|
|
raw[col] = cs.width;
|
|
|
fixed[col] = 1;
|
|
|
- } else if (cs.width_kind == 2) {
|
|
|
- raw[col] = avail * cs.width / 100;
|
|
|
+ } else if (cs.width_kind == 2 ||
|
|
|
+ cs.width_kind == 3) {
|
|
|
+ raw[col] = style_width_px(&cs,
|
|
|
+ avail);
|
|
|
fixed[col] = 1;
|
|
|
}
|
|
|
}
|
|
|
@@ -5848,14 +5917,10 @@ static void layout_table_row(struct lay *l, unsigned int row,
|
|
|
br_style_for(&doc, cell[c], pst, &cs);
|
|
|
raw[c] = intrinsic_width(l->ui, cell[c], &cs, 0,
|
|
|
avail) +
|
|
|
- css_mp_px(&cs, cs.pl, cs.mp_unit[7],
|
|
|
- avail) +
|
|
|
- css_mp_px(&cs, cs.pr, cs.mp_unit[5],
|
|
|
- avail) +
|
|
|
- css_mp_px(&cs, cs.ml, cs.mp_unit[3],
|
|
|
- avail) +
|
|
|
- css_mp_px(&cs, cs.mr, cs.mp_unit[1],
|
|
|
- avail);
|
|
|
+ mp_px(&cs, 7, avail) +
|
|
|
+ mp_px(&cs, 5, avail) +
|
|
|
+ mp_px(&cs, 3, avail) +
|
|
|
+ mp_px(&cs, 1, avail);
|
|
|
if (raw[c] < 24)
|
|
|
raw[c] = 24;
|
|
|
total += raw[c];
|
|
|
@@ -6056,10 +6121,10 @@ static void layout_table(struct lay *l, unsigned int table,
|
|
|
table_cell_style(rows[tbl_cells[i].row], tbl_cells[i].node,
|
|
|
st, &cs);
|
|
|
w = intrinsic_width(l->ui, tbl_cells[i].node, &cs, 0, avail) +
|
|
|
- css_mp_px(&cs, cs.pl, cs.mp_unit[7], avail) +
|
|
|
- css_mp_px(&cs, cs.pr, cs.mp_unit[5], avail) +
|
|
|
- css_mp_px(&cs, cs.ml, cs.mp_unit[3], avail) +
|
|
|
- css_mp_px(&cs, cs.mr, cs.mp_unit[1], avail) +
|
|
|
+ mp_px(&cs, 7, avail) +
|
|
|
+ mp_px(&cs, 5, avail) +
|
|
|
+ mp_px(&cs, 3, avail) +
|
|
|
+ mp_px(&cs, 1, avail) +
|
|
|
cs.border_w[0] + cs.border_w[1] +
|
|
|
cs.border_w[2] + cs.border_w[3];
|
|
|
if (w < 24)
|
|
|
@@ -6082,10 +6147,10 @@ static void layout_table(struct lay *l, unsigned int table,
|
|
|
table_cell_style(rows[tbl_cells[i].row], tbl_cells[i].node,
|
|
|
st, &cs);
|
|
|
w = intrinsic_width(l->ui, tbl_cells[i].node, &cs, 0, avail) +
|
|
|
- css_mp_px(&cs, cs.pl, cs.mp_unit[7], avail) +
|
|
|
- css_mp_px(&cs, cs.pr, cs.mp_unit[5], avail) +
|
|
|
- css_mp_px(&cs, cs.ml, cs.mp_unit[3], avail) +
|
|
|
- css_mp_px(&cs, cs.mr, cs.mp_unit[1], avail) +
|
|
|
+ mp_px(&cs, 7, avail) +
|
|
|
+ mp_px(&cs, 5, avail) +
|
|
|
+ mp_px(&cs, 3, avail) +
|
|
|
+ mp_px(&cs, 1, avail) +
|
|
|
cs.border_w[0] + cs.border_w[1] +
|
|
|
cs.border_w[2] + cs.border_w[3];
|
|
|
col = tbl_cells[i].col;
|
|
|
@@ -6109,8 +6174,8 @@ static void layout_table(struct lay *l, unsigned int table,
|
|
|
if (cs.width_kind == 1) {
|
|
|
raw[col] = cs.width;
|
|
|
fixed[col] = 1;
|
|
|
- } else if (cs.width_kind == 2) {
|
|
|
- raw[col] = avail * cs.width / 100;
|
|
|
+ } else if (cs.width_kind == 2 || cs.width_kind == 3) {
|
|
|
+ raw[col] = style_width_px(&cs, avail);
|
|
|
fixed[col] = 1;
|
|
|
}
|
|
|
}
|
|
|
@@ -6248,8 +6313,8 @@ static void layout_table(struct lay *l, unsigned int table,
|
|
|
cs.width_kind = 0;
|
|
|
cs.max_width_kind = 0;
|
|
|
cs.box_sizing = 0;
|
|
|
- deco = css_mp_px(&cs, cs.pt, cs.mp_unit[4], avail) +
|
|
|
- css_mp_px(&cs, cs.pb, cs.mp_unit[6], avail) +
|
|
|
+ deco = mp_px(&cs, 4, avail) +
|
|
|
+ mp_px(&cs, 6, avail) +
|
|
|
cs.border_w[0] + cs.border_w[2];
|
|
|
cs.height_kind = 1;
|
|
|
cs.height = h > deco ? h - deco : 0;
|