diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2014-06-01 18:32:37 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2014-06-01 18:32:37 +0100 |
commit | c6d7f24987a90bc61e408c4249a6a212276b4174 (patch) | |
tree | 75a3f5478618e0e583db6f168193e7645c012dda /src/select/propset.h | |
parent | 89a4d061a46490d5fad3792a565a1a0114c400e0 (diff) | |
download | libcss-c6d7f24987a90bc61e408c4249a6a212276b4174.tar.gz libcss-c6d7f24987a90bc61e408c4249a6a212276b4174.tar.bz2 |
Add support for CSS3 overflow-x and overflow-y properties.
Now, overflow is a shorthand property setting both overflow-x and
overflow-y.
The getter for the computed overflow has been removed, and replaced
with two for overflow-x and overflow-y.
Diffstat (limited to 'src/select/propset.h')
-rw-r--r-- | src/select/propset.h | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/src/select/propset.h b/src/select/propset.h index 4aa15af..b7da5a6 100644 --- a/src/select/propset.h +++ b/src/select/propset.h @@ -1411,23 +1411,41 @@ static inline css_error set_padding_left( #undef PADDING_LEFT_SHIFT #undef PADDING_LEFT_INDEX -#define OVERFLOW_INDEX 21 -#define OVERFLOW_SHIFT 0 -#define OVERFLOW_MASK 0x7 -static inline css_error set_overflow( +#define OVERFLOW_X_INDEX 21 +#define OVERFLOW_X_SHIFT 0 +#define OVERFLOW_X_MASK 0x7 +static inline css_error set_overflow_x( css_computed_style *style, uint8_t type) { - uint8_t *bits = &style->bits[OVERFLOW_INDEX]; + uint8_t *bits = &style->bits[OVERFLOW_X_INDEX]; /* 3bits: type */ - *bits = (*bits & ~OVERFLOW_MASK) | - ((type & 0x7) << OVERFLOW_SHIFT); + *bits = (*bits & ~OVERFLOW_X_MASK) | + ((type & 0x7) << OVERFLOW_X_SHIFT); return CSS_OK; } -#undef OVERFLOW_MASK -#undef OVERFLOW_SHIFT -#undef OVERFLOW_INDEX +#undef OVERFLOW_X_MASK +#undef OVERFLOW_X_SHIFT +#undef OVERFLOW_X_INDEX + +#define OVERFLOW_Y_INDEX 34 +#define OVERFLOW_Y_SHIFT 5 +#define OVERFLOW_Y_MASK 0xe0 +static inline css_error set_overflow_y( + css_computed_style *style, uint8_t type) +{ + uint8_t *bits = &style->bits[OVERFLOW_Y_INDEX]; + + /* 3bits: type */ + *bits = (*bits & ~OVERFLOW_Y_MASK) | + ((type & 0x7) << OVERFLOW_Y_SHIFT); + + return CSS_OK; +} +#undef OVERFLOW_Y_MASK +#undef OVERFLOW_Y_SHIFT +#undef OVERFLOW_Y_INDEX #define POSITION_INDEX 22 #define POSITION_SHIFT 0 |