summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-01-10 16:05:29 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2014-01-10 16:05:29 +0000
commit54fa7907e366846ce1b79d8249f57d3f0b319736 (patch)
tree4b369d5aecc411f18bc05a2776e0a7ee1a927c88
parent4600e9ac013226a63e0dd68a47cde9b75cd3c452 (diff)
downloadlibcss-54fa7907e366846ce1b79d8249f57d3f0b319736.tar.gz
libcss-54fa7907e366846ce1b79d8249f57d3f0b319736.tar.bz2
Remove duplicate implementation in css_computed_float.
-rw-r--r--src/select/computed.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/select/computed.c b/src/select/computed.c
index ba6f92f..994c306 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -749,27 +749,18 @@ uint8_t css_computed_empty_cells(const css_computed_style *style)
return get_empty_cells(style);
}
-#define CSS_FLOAT_INDEX 17
-#define CSS_FLOAT_SHIFT 0
-#define CSS_FLOAT_MASK 0x3
-uint8_t css_computed_float(
- const css_computed_style *style)
+uint8_t css_computed_float(const css_computed_style *style)
{
- uint8_t bits = style->bits[CSS_FLOAT_INDEX];
- bits &= CSS_FLOAT_MASK;
- bits >>= CSS_FLOAT_SHIFT;
+ uint8_t position = css_computed_position(style);
+ uint8_t value = get_float(style);
/* Fix up as per $9.7:2 */
- if (css_computed_position(style) == CSS_POSITION_ABSOLUTE ||
- css_computed_position(style) == CSS_POSITION_FIXED)
+ if (position == CSS_POSITION_ABSOLUTE ||
+ position == CSS_POSITION_FIXED)
return CSS_FLOAT_NONE;
- /* 2bits: type */
- return bits;
+ return value;
}
-#undef CSS_FLOAT_MASK
-#undef CSS_FLOAT_SHIFT
-#undef CSS_FLOAT_INDEX
uint8_t css_computed_font_style(const css_computed_style *style)
{