diff options
-rw-r--r-- | src/select/computed.c | 27 | ||||
-rw-r--r-- | test/data/select/tests1.dat | 222 |
2 files changed, 121 insertions, 128 deletions
diff --git a/src/select/computed.c b/src/select/computed.c index e653bf3..d78f3b0 100644 --- a/src/select/computed.c +++ b/src/select/computed.c @@ -308,14 +308,7 @@ css_error css_computed_style_compose(const css_computed_style *parent, uint8_t css_computed_letter_spacing(const css_computed_style *style, css_fixed *length, css_unit *unit) { - /* This property is in the uncommon block, so we need to do - * absolute value calculation here. */ - if (get_letter_spacing(style, length, unit) != CSS_LETTER_SPACING_SET) { - *length = INTTOFIX(0); - *unit = CSS_UNIT_PX; - } - - return CSS_LETTER_SPACING_SET; + return get_letter_spacing(style, length, unit); } uint8_t css_computed_outline_color(const css_computed_style *style, @@ -327,7 +320,14 @@ uint8_t css_computed_outline_color(const css_computed_style *style, uint8_t css_computed_outline_width(const css_computed_style *style, css_fixed *length, css_unit *unit) { - return get_outline_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_outline_width(style, length, unit) == CSS_BORDER_WIDTH_MEDIUM) { + *length = INTTOFIX(2); + *unit = CSS_UNIT_PX; + } + + return CSS_BORDER_WIDTH_WIDTH; } uint8_t css_computed_border_spacing(const css_computed_style *style, @@ -340,14 +340,7 @@ uint8_t css_computed_border_spacing(const css_computed_style *style, uint8_t css_computed_word_spacing(const css_computed_style *style, css_fixed *length, css_unit *unit) { - /* This property is in the uncommon block, so we need to do - * absolute value calculation here. */ - if (get_word_spacing(style, length, unit) != CSS_WORD_SPACING_SET) { - *length = INTTOFIX(0); - *unit = CSS_UNIT_PX; - } - - return CSS_WORD_SPACING_SET; + return get_word_spacing(style, length, unit); } uint8_t css_computed_writing_mode(const css_computed_style *style) diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat index 1b4ad54..6cbd281 100644 --- a/test/data/select/tests1.dat +++ b/test/data/select/tests1.dat @@ -56,7 +56,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -72,7 +72,7 @@ min-width: 0px opacity: 1.000 outline-color: invert outline-style: none -outline-width: medium +outline-width: 2px overflow-x: visible overflow-y: visible padding-top: 0px @@ -93,7 +93,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -159,7 +159,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -175,7 +175,7 @@ min-width: 0px opacity: 1.000 outline-color: invert outline-style: none -outline-width: medium +outline-width: 2px overflow-x: visible overflow-y: visible padding-top: 0px @@ -196,7 +196,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -266,7 +266,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -282,7 +282,7 @@ min-width: 0px opacity: 1.000 outline-color: invert outline-style: none -outline-width: medium +outline-width: 2px overflow-x: visible overflow-y: visible padding-top: 0px @@ -303,7 +303,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -374,7 +374,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -390,7 +390,7 @@ min-width: 0px opacity: 1.000 outline-color: invert outline-style: none -outline-width: medium +outline-width: 2px overflow-x: visible overflow-y: visible padding-top: 0px @@ -411,7 +411,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -482,7 +482,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -498,7 +498,7 @@ min-width: 0px opacity: 1.000 outline-color: invert outline-style: none -outline-width: medium +outline-width: 2px overflow-x: visible overflow-y: visible padding-top: 0px @@ -519,7 +519,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -590,7 +590,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -606,7 +606,7 @@ min-width: 0px opacity: 1.000 outline-color: invert outline-style: none -outline-width: medium +outline-width: 2px overflow-x: visible overflow-y: visible padding-top: 0px @@ -627,7 +627,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -688,7 +688,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -704,7 +704,7 @@ min-width: 0px opacity: 1.000 outline-color: invert outline-style: none -outline-width: medium +outline-width: 2px overflow-x: visible overflow-y: visible padding-top: 0px @@ -725,7 +725,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -787,7 +787,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -803,7 +803,7 @@ min-width: 0px opacity: 1.000 outline-color: invert outline-style: none -outline-width: medium +outline-width: 2px overflow-x: visible overflow-y: visible padding-top: 0px @@ -824,7 +824,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -886,7 +886,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -902,7 +902,7 @@ min-width: 0px opacity: 1.000 outline-color: invert outline-style: none -outline-width: medium +outline-width: 2px overflow-x: visible overflow-y: visible padding-top: 0px @@ -923,7 +923,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -984,7 +984,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -1000,7 +1000,7 @@ min-width: 0px opacity: 1.000 outline-color: invert outline-style: none -outline-width: medium +outline-width: 2px overflow-x: visible overflow-y: visible padding-top: 0px @@ -1021,7 +1021,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -1087,7 +1087,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -1103,7 +1103,7 @@ min-width: 0px opacity: 1.000 outline-color: invert outline-style: none -outline-width: medium +outline-width: 2px overflow-x: visible overflow-y: visible padding-top: 0px @@ -1124,7 +1124,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -1190,7 +1190,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -1206,7 +1206,7 @@ min-width: 0px opacity: 1.000 outline-color: invert outline-style: none -outline-width: medium +outline-width: 2px overflow-x: visible overflow-y: visible padding-top: 0px @@ -1227,7 +1227,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -1294,7 +1294,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -1310,7 +1310,7 @@ min-width: 0px opacity: 1.000 outline-color: invert outline-style: none -outline-width: medium +outline-width: 2px overflow-x: visible overflow-y: visible padding-top: 0px @@ -1331,7 +1331,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -1401,7 +1401,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -1417,7 +1417,7 @@ min-width: 0px opacity: 1.000 outline-color: invert outline-style: none -outline-width: medium +outline-width: 2px overflow-x: visible overflow-y: visible padding-top: 0px @@ -1438,7 +1438,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -1507,7 +1507,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -1523,7 +1523,7 @@ min-width: 0px opacity: 1.000 outline-color: invert outline-style: none -outline-width: medium +outline-width: 2px overflow-x: visible overflow-y: visible padding-top: 0px @@ -1544,7 +1544,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -1619,7 +1619,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -1656,7 +1656,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -1731,7 +1731,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -1768,7 +1768,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -1843,7 +1843,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -1880,7 +1880,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -1959,7 +1959,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -1996,7 +1996,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -2074,7 +2074,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -2111,7 +2111,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -2187,7 +2187,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -2224,7 +2224,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -2299,7 +2299,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -2336,7 +2336,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -2411,7 +2411,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -2448,7 +2448,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -2523,7 +2523,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -2560,7 +2560,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -2635,7 +2635,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -2672,7 +2672,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -2747,7 +2747,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -2784,7 +2784,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -2859,7 +2859,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -2896,7 +2896,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -2971,7 +2971,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -3008,7 +3008,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -3083,7 +3083,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -3120,7 +3120,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -3195,7 +3195,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -3232,7 +3232,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -3307,7 +3307,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -3344,7 +3344,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -3419,7 +3419,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -3456,7 +3456,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -3531,7 +3531,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -3568,7 +3568,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -3643,7 +3643,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -3680,7 +3680,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -3755,7 +3755,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -3792,7 +3792,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -3867,7 +3867,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -3904,7 +3904,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -3979,7 +3979,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -4016,7 +4016,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -4091,7 +4091,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -4128,7 +4128,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -4203,7 +4203,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -4240,7 +4240,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -4315,7 +4315,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -4352,7 +4352,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -4427,7 +4427,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -4464,7 +4464,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -4532,7 +4532,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -4548,7 +4548,7 @@ min-width: 0px opacity: 1.000 outline-color: invert outline-style: none -outline-width: medium +outline-width: 2px overflow-x: visible overflow-y: visible padding-top: 0px @@ -4569,7 +4569,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -4674,7 +4674,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -4742,7 +4742,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -4779,7 +4779,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: vertical-lr z-index: auto #reset @@ -4844,7 +4844,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -4881,7 +4881,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -4947,7 +4947,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -4984,7 +4984,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -5050,7 +5050,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -5087,7 +5087,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset @@ -5153,7 +5153,7 @@ font-variant: normal font-weight: normal height: auto left: auto -letter-spacing: 0px +letter-spacing: normal line-height: normal list-style-image: none list-style-position: outside @@ -5190,7 +5190,7 @@ vertical-align: baseline visibility: visible white-space: normal width: auto -word-spacing: 0px +word-spacing: normal writing-mode: horizontal-tb z-index: auto #reset |