summaryrefslogtreecommitdiff
path: root/src/select/propset.h
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-02-14 20:05:04 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-02-14 20:05:04 +0000
commit5429e0ccc289a4538f81fcde0495d27f0cb7a758 (patch)
tree1ec98a93dfdf2986011aa012e7980fb48304d378 /src/select/propset.h
parentca3293e0332bbd9fe63d6cd6bc215f048132bd08 (diff)
downloadlibcss-5429e0ccc289a4538f81fcde0495d27f0cb7a758.tar.gz
libcss-5429e0ccc289a4538f81fcde0495d27f0cb7a758.tar.bz2
Fix clip: rect() with auto sides
svn path=/trunk/libcss/; revision=6514
Diffstat (limited to 'src/select/propset.h')
-rw-r--r--src/select/propset.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/select/propset.h b/src/select/propset.h
index bdc85bb..661913b 100644
--- a/src/select/propset.h
+++ b/src/select/propset.h
@@ -265,8 +265,8 @@ static inline css_error set_quotes(
#undef QUOTES_INDEX
#define CLIP_INDEX 7
-#define CLIP_SHIFT 6
-#define CLIP_MASK 0xc0
+#define CLIP_SHIFT 2
+#define CLIP_MASK 0xfc
#define CLIP_INDEX1 5
#define CLIP_SHIFT1 0
#define CLIP_MASK1 0xff
@@ -283,11 +283,16 @@ static inline css_error set_clip(
bits = &style->uncommon->bits[CLIP_INDEX];
- /* 2bits: type */
- *bits = (*bits & ~CLIP_MASK) |
+ /* 6bits: trblyy : top | right | bottom | left | type */
+ *bits = (*bits & ~CLIP_MASK) |
((type & 0x3) << CLIP_SHIFT);
if (type == CSS_CLIP_RECT) {
+ *bits |= (rect->top_auto ? 0x20 : 0) |
+ (rect->right_auto ? 0x10 : 0) |
+ (rect->bottom_auto ? 0x8 : 0) |
+ (rect->left_auto ? 0x4 : 0);
+
bits = &style->uncommon->bits[CLIP_INDEX1];
/* 8bits: ttttrrrr : top | right */