summaryrefslogtreecommitdiff
path: root/src/select/computed.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/select/computed.c')
-rw-r--r--src/select/computed.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/select/computed.c b/src/select/computed.c
index 9028710..6bf1344 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -1349,21 +1349,26 @@ css_error compute_absolute_border_side_width(css_computed_style *style,
{
css_fixed length;
css_unit unit;
- uint8_t type;
- type = get(style, &length, &unit);
- if (type == CSS_BORDER_WIDTH_THIN) {
+ switch (get(style, &length, &unit)) {
+ case CSS_BORDER_WIDTH_THIN:
length = INTTOFIX(1);
unit = CSS_UNIT_PX;
- } else if (type == CSS_BORDER_WIDTH_MEDIUM) {
+ break;
+ case CSS_BORDER_WIDTH_MEDIUM:
length = INTTOFIX(2);
unit = CSS_UNIT_PX;
- } else if (type == CSS_BORDER_WIDTH_THICK) {
+ break;
+ case CSS_BORDER_WIDTH_THICK:
length = INTTOFIX(4);
unit = CSS_UNIT_PX;
- } else if (unit == CSS_UNIT_EX) {
- length = FMUL(length, ex_size->value);
- unit = ex_size->unit;
+ break;
+ case CSS_BORDER_WIDTH_WIDTH:
+ if (unit == CSS_UNIT_EX) {
+ length = FMUL(length, ex_size->value);
+ unit = ex_size->unit;
+ }
+ break;
}
return set(style, CSS_BORDER_WIDTH_WIDTH, length, unit);