summaryrefslogtreecommitdiff
path: root/include/libcss
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-07-04 12:59:37 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-07-04 12:59:37 +0000
commit2f5753d607a93c8ae18aab3dd675b111af7d879d (patch)
treef9c2f35073806f433a1520ec2d64cbbcb2d9fc1d /include/libcss
parent39a51ce203672ead9e526592f4d35bdef5e5c728 (diff)
downloadlibcss-2f5753d607a93c8ae18aab3dd675b111af7d879d.tar.gz
libcss-2f5753d607a93c8ae18aab3dd675b111af7d879d.tar.bz2
Query client for initial values of color, font-family, quotes, and voice-family properties.
svn path=/trunk/libcss/; revision=8306
Diffstat (limited to 'include/libcss')
-rw-r--r--include/libcss/computed.h20
-rw-r--r--include/libcss/properties.h6
-rw-r--r--include/libcss/select.h5
3 files changed, 19 insertions, 12 deletions
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index 08eb77c..e0e3526 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -89,9 +89,9 @@ typedef struct css_computed_uncommon {
*
* Encode quotes as an array of string objects, terminated with a blank entry.
*
- * quotes 2 sizeof(ptr)
+ * quotes 1 sizeof(ptr)
* --- ---
- * 2 bits sizeof(ptr) bytes
+ * 1 bit sizeof(ptr) bytes
*
* Encode cursor uri(s) as an array of string objects, terminated with a
* blank entry.
@@ -105,7 +105,7 @@ typedef struct css_computed_uncommon {
* 2 bits sizeof(ptr)
*
* ___ ___
- * 63 bits 40 + 5sizeof(ptr) bytes
+ * 62 bits 40 + 5sizeof(ptr) bytes
*
* 8 bytes 40 + 5sizeof(ptr) bytes
* ===================
@@ -118,7 +118,7 @@ typedef struct css_computed_uncommon {
* 2 ooooooob outline-width | border-spacing
* 3 bbbbbbbb border-spacing
* 4 wwwwwwir word-spacing | counter-increment | counter-reset
- * 5 uuuuuqq. cursor | quotes | <unused>
+ * 5 uuuuuq.. cursor | quotes | <unused>
* 6 cccccccc clip
* 7 cccccccc clip
* 8 ccccccoo clip | content
@@ -569,8 +569,8 @@ static inline uint8_t css_computed_cursor(
#undef CURSOR_INDEX
#define QUOTES_INDEX 4
-#define QUOTES_SHIFT 1
-#define QUOTES_MASK 0x6
+#define QUOTES_SHIFT 2
+#define QUOTES_MASK 0x4
static inline uint8_t css_computed_quotes(
const css_computed_style *style,
lwc_string ***quotes)
@@ -580,13 +580,17 @@ static inline uint8_t css_computed_quotes(
bits &= QUOTES_MASK;
bits >>= QUOTES_SHIFT;
- /* 2bits: type */
+ /* 1bit: type */
*quotes = style->uncommon->quotes;
return bits;
}
- return CSS_QUOTES_DEFAULT;
+ /** \todo This should be the UA default. Quotes probably needs moving
+ * into the main style block, so we don't need to look up the initial
+ * value after selection.
+ */
+ return CSS_QUOTES_NONE;
}
#undef QUOTES_MASK
#undef QUOTES_SHIFT
diff --git a/include/libcss/properties.h b/include/libcss/properties.h
index f496bc9..ca36544 100644
--- a/include/libcss/properties.h
+++ b/include/libcss/properties.h
@@ -305,8 +305,7 @@ enum css_font_family {
CSS_FONT_FAMILY_SANS_SERIF = 0x2,
CSS_FONT_FAMILY_CURSIVE = 0x3,
CSS_FONT_FAMILY_FANTASY = 0x4,
- CSS_FONT_FAMILY_MONOSPACE = 0x5,
- CSS_FONT_FAMILY_DEFAULT = 0x6
+ CSS_FONT_FAMILY_MONOSPACE = 0x5
};
enum css_font_size {
@@ -490,8 +489,7 @@ enum css_quotes {
CSS_QUOTES_INHERIT = 0x0,
/* Consult pointer in struct to determine which */
CSS_QUOTES_STRING = 0x1,
- CSS_QUOTES_NONE = 0x1,
- CSS_QUOTES_DEFAULT = 0x2
+ CSS_QUOTES_NONE = 0x1
};
enum css_right {
diff --git a/include/libcss/select.h b/include/libcss/select.h
index 3cdaf3c..391f393 100644
--- a/include/libcss/select.h
+++ b/include/libcss/select.h
@@ -64,6 +64,11 @@ typedef struct css_select_handler {
css_error (*node_presentational_hint)(void *pw, void *node,
uint32_t property, css_hint *hint);
+
+ css_error (*ua_default_for_property)(void *pw, uint32_t property,
+ css_hint *hint);
+// css_error (*ua_font_keyword_to_size)(void *pw, uint32_t keyword,
+// css_hint *hint);
} css_select_handler;
css_error css_select_ctx_create(css_allocator_fn alloc, void *pw,