summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2015-01-10 22:21:51 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2015-01-10 22:21:51 +0000
commit096871aabc3b2be309566d444bed2f48f18c3e41 (patch)
tree4163ed295e0089a3bff12ba8cf7f6b0c02135548
parent25c4362841e0f3f8eb654c8568ebbaab7696a4ce (diff)
downloadlibcss-096871aabc3b2be309566d444bed2f48f18c3e41.tar.gz
Implement absolutification for column-rule-width.
-rw-r--r--src/select/computed.c20
-rw-r--r--test/data/select/tests1.dat94
2 files changed, 65 insertions, 49 deletions
diff --git a/src/select/computed.c b/src/select/computed.c
index d78f3b0..7508db6 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -840,7 +840,15 @@ uint8_t css_computed_column_rule_style(const css_computed_style *style)
uint8_t css_computed_column_rule_width(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- return get_column_rule_width(style, length, unit);
+ /* This property is in the uncommon block, so we need to handle
+ * absolute value calculation for initial value (medium) here. */
+ if (get_column_rule_width(style, length, unit) ==
+ CSS_BORDER_WIDTH_MEDIUM) {
+ *length = INTTOFIX(2);
+ *unit = CSS_UNIT_PX;
+ }
+
+ return CSS_BORDER_WIDTH_WIDTH;
}
uint8_t css_computed_column_span(const css_computed_style *style)
@@ -1187,13 +1195,21 @@ css_error css__compute_absolute_values(const css_computed_style *parent,
if (error != CSS_OK)
return error;
- /* Fix up word spacing */
+ /* Fix up word-spacing */
error = compute_absolute_length(style,
&ex_size.data.length,
get_word_spacing,
set_word_spacing);
if (error != CSS_OK)
return error;
+
+ /* Fix up column-rule-width */
+ error = compute_absolute_border_side_width(style,
+ &ex_size.data.length,
+ get_column_rule_width,
+ set_column_rule_width);
+ if (error != CSS_OK)
+ return error;
}
return CSS_OK;
diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat
index 6cbd281..5ab7d7a 100644
--- a/test/data/select/tests1.dat
+++ b/test/data/select/tests1.dat
@@ -38,7 +38,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -141,7 +141,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -248,7 +248,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ffff0000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -356,7 +356,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ffff0000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -464,7 +464,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ffffffff
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -572,7 +572,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ffffffff
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -670,7 +670,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -769,7 +769,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -868,7 +868,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -966,7 +966,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -1069,7 +1069,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -1172,7 +1172,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -1276,7 +1276,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -1383,7 +1383,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -1489,7 +1489,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -1601,7 +1601,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -1713,7 +1713,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -1825,7 +1825,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -1941,7 +1941,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -2056,7 +2056,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -2169,7 +2169,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -2281,7 +2281,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -2393,7 +2393,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -2505,7 +2505,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -2617,7 +2617,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -2729,7 +2729,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -2841,7 +2841,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -2953,7 +2953,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -3065,7 +3065,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -3177,7 +3177,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -3289,7 +3289,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -3401,7 +3401,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -3513,7 +3513,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -3625,7 +3625,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -3737,7 +3737,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -3849,7 +3849,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -3961,7 +3961,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -4073,7 +4073,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -4185,7 +4185,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -4297,7 +4297,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -4409,7 +4409,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -4514,7 +4514,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -4619,7 +4619,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -4724,7 +4724,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -4929,7 +4929,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -5032,7 +5032,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal
@@ -5135,7 +5135,7 @@ column-fill: balance
column-gap: normal
column-rule-color: #ff000000
column-rule-style: none
-column-rule-width: medium
+column-rule-width: 2px
column-span: none
column-width: auto
content: normal