summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libcss/computed.h22
-rw-r--r--include/libcss/libcss.h2
-rw-r--r--include/libcss/types.h2
-rw-r--r--libcss.pc.in2
-rw-r--r--src/select/properties.c16
-rw-r--r--src/select/propset.h14
-rw-r--r--src/select/select.c1
-rw-r--r--test/dump_computed.h2
8 files changed, 32 insertions, 29 deletions
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index b8ce5c2..0d4f5f0 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -131,7 +131,7 @@ typedef struct css_computed_uncommon {
css_fixed letter_spacing;
- css_color outline_color;
+ css_colour outline_color;
css_fixed outline_width;
css_fixed word_spacing;
@@ -277,11 +277,11 @@ struct css_computed_style {
uint8_t unused[2];
- css_color background_color;
+ css_colour background_color;
lwc_string *background_image;
css_fixed background_position[2];
- css_color border_color[4];
+ css_colour border_color[4];
css_fixed border_width[4];
css_fixed top;
@@ -289,7 +289,7 @@ struct css_computed_style {
css_fixed bottom;
css_fixed left;
- css_color color;
+ css_colour color;
css_fixed font_size;
@@ -371,7 +371,7 @@ static inline uint8_t css_computed_letter_spacing(
#define OUTLINE_COLOR_SHIFT 0
#define OUTLINE_COLOR_MASK 0x3
static inline uint8_t css_computed_outline_color(
- const css_computed_style *style, css_color *color)
+ const css_computed_style *style, css_colour *color)
{
if (style->uncommon != NULL) {
uint8_t bits = style->uncommon->bits[OUTLINE_COLOR_INDEX];
@@ -854,7 +854,7 @@ static inline uint8_t css_computed_background_image(
#define COLOR_MASK 0x1
static inline uint8_t css_computed_color(
const css_computed_style *style,
- css_color *color)
+ css_colour *color)
{
uint8_t bits = style->bits[COLOR_INDEX];
bits &= COLOR_MASK;
@@ -986,7 +986,7 @@ static inline uint8_t css_computed_left(
#define BORDER_TOP_COLOR_MASK 0x3
static inline uint8_t css_computed_border_top_color(
const css_computed_style *style,
- css_color *color)
+ css_colour *color)
{
uint8_t bits = style->bits[BORDER_TOP_COLOR_INDEX];
bits &= BORDER_TOP_COLOR_MASK;
@@ -1006,7 +1006,7 @@ static inline uint8_t css_computed_border_top_color(
#define BORDER_RIGHT_COLOR_MASK 0x3
static inline uint8_t css_computed_border_right_color(
const css_computed_style *style,
- css_color *color)
+ css_colour *color)
{
uint8_t bits = style->bits[BORDER_RIGHT_COLOR_INDEX];
bits &= BORDER_RIGHT_COLOR_MASK;
@@ -1026,7 +1026,7 @@ static inline uint8_t css_computed_border_right_color(
#define BORDER_BOTTOM_COLOR_MASK 0x3
static inline uint8_t css_computed_border_bottom_color(
const css_computed_style *style,
- css_color *color)
+ css_colour *color)
{
uint8_t bits = style->bits[BORDER_BOTTOM_COLOR_INDEX];
bits &= BORDER_BOTTOM_COLOR_MASK;
@@ -1046,7 +1046,7 @@ static inline uint8_t css_computed_border_bottom_color(
#define BORDER_LEFT_COLOR_MASK 0x3
static inline uint8_t css_computed_border_left_color(
const css_computed_style *style,
- css_color *color)
+ css_colour *color)
{
uint8_t bits = style->bits[BORDER_LEFT_COLOR_INDEX];
bits &= BORDER_LEFT_COLOR_MASK;
@@ -1116,7 +1116,7 @@ static inline uint8_t css_computed_line_height(
#define BACKGROUND_COLOR_MASK 0x3
static inline uint8_t css_computed_background_color(
const css_computed_style *style,
- css_color *color)
+ css_colour *color)
{
uint8_t bits = style->bits[BACKGROUND_COLOR_INDEX];
bits &= BACKGROUND_COLOR_MASK;
diff --git a/include/libcss/libcss.h b/include/libcss/libcss.h
index de82a22..e3eb0ec 100644
--- a/include/libcss/libcss.h
+++ b/include/libcss/libcss.h
@@ -14,7 +14,9 @@
#include <libcss/types.h>
#include <libcss/functypes.h>
#include <libcss/computed.h>
+#include <libcss/properties.h>
#include <libcss/select.h>
+#include <libcss/stylesheet.h>
/* Initialise the CSS library for use */
css_error css_initialise(const char *aliases_file,
diff --git a/include/libcss/types.h b/include/libcss/types.h
index a08ffb4..000c0f1 100644
--- a/include/libcss/types.h
+++ b/include/libcss/types.h
@@ -69,7 +69,7 @@ typedef enum css_origin {
} css_origin;
/** CSS colour -- RRGGBBAA */
-typedef uint32_t css_color;
+typedef uint32_t css_colour;
/* CSS unit */
typedef enum css_unit {
diff --git a/libcss.pc.in b/libcss.pc.in
index fc45a57..a40e8e3 100644
--- a/libcss.pc.in
+++ b/libcss.pc.in
@@ -6,5 +6,5 @@ includedir=${prefix}/include
Name: libcss
Description: CSS parsing and selection library
Version: 0.0.1
-Libs: -L${libdir} -lcharset -lcss
+Libs: -L${libdir} -lparserutils -lwapcaplet -lcss
Cflags: -I${includedir}
diff --git a/src/select/properties.c b/src/select/properties.c
index 42ae10f..bbf24db 100644
--- a/src/select/properties.c
+++ b/src/select/properties.c
@@ -15,7 +15,7 @@
static css_error cascade_bg_border_color(uint32_t opv, css_style *style,
css_select_state *state,
- css_error (*fun)(css_computed_style *, uint8_t, css_color));
+ css_error (*fun)(css_computed_style *, uint8_t, css_colour));
static css_error cascade_uri_none(uint32_t opv, css_style *style,
css_select_state *state,
css_error (*fun)(css_computed_style *, uint8_t,
@@ -613,11 +613,11 @@ css_error cascade_color(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_COLOR_INHERIT;
- css_color color = 0;
+ css_colour color = 0;
if (isInherit(opv) == false) {
value = CSS_COLOR_COLOR;
- color = *((css_color *) style->bytecode);
+ color = *((css_colour *) style->bytecode);
advance_bytecode(style, sizeof(color));
}
@@ -1736,13 +1736,13 @@ css_error cascade_outline_color(uint32_t opv, css_style *style,
css_select_state *state)
{
uint16_t value = CSS_OUTLINE_COLOR_INHERIT;
- css_color color = 0;
+ css_colour color = 0;
if (isInherit(opv) == false) {
switch (getValue(opv)) {
case OUTLINE_COLOR_SET:
value = CSS_OUTLINE_COLOR_COLOR;
- color = *((css_color *) style->bytecode);
+ color = *((css_colour *) style->bytecode);
advance_bytecode(style, sizeof(color));
break;
case OUTLINE_COLOR_INVERT:
@@ -2900,10 +2900,10 @@ css_error initial_z_index(css_computed_style *style)
******************************************************************************/
css_error cascade_bg_border_color(uint32_t opv, css_style *style,
css_select_state *state,
- css_error (*fun)(css_computed_style *, uint8_t, css_color))
+ css_error (*fun)(css_computed_style *, uint8_t, css_colour))
{
uint16_t value = CSS_BACKGROUND_COLOR_INHERIT;
- css_color color = 0;
+ css_colour color = 0;
assert(CSS_BACKGROUND_COLOR_INHERIT == CSS_BORDER_COLOR_INHERIT);
assert(CSS_BACKGROUND_COLOR_TRANSPARENT ==
@@ -2917,7 +2917,7 @@ css_error cascade_bg_border_color(uint32_t opv, css_style *style,
break;
case BACKGROUND_COLOR_SET:
value = CSS_BACKGROUND_COLOR_COLOR;
- color = *((css_color *) style->bytecode);
+ color = *((css_colour *) style->bytecode);
advance_bytecode(style, sizeof(color));
break;
}
diff --git a/src/select/propset.h b/src/select/propset.h
index 27860f0..3862076 100644
--- a/src/select/propset.h
+++ b/src/select/propset.h
@@ -56,7 +56,7 @@ static inline css_error set_letter_spacing(
#define OUTLINE_COLOR_SHIFT 0
#define OUTLINE_COLOR_MASK 0x3
static inline css_error set_outline_color(
- css_computed_style *style, uint8_t type, css_color color)
+ css_computed_style *style, uint8_t type, css_colour color)
{
uint8_t *bits;
@@ -507,7 +507,7 @@ static inline css_error set_background_image(
#define COLOR_MASK 0x1
static inline css_error set_color(
css_computed_style *style, uint8_t type,
- css_color color)
+ css_colour color)
{
uint8_t *bits = &style->bits[COLOR_INDEX];
@@ -637,7 +637,7 @@ static inline css_error set_left(
#define BORDER_TOP_COLOR_MASK 0x3
static inline css_error set_border_top_color(
css_computed_style *style, uint8_t type,
- css_color color)
+ css_colour color)
{
uint8_t *bits = &style->bits[BORDER_TOP_COLOR_INDEX];
@@ -658,7 +658,7 @@ static inline css_error set_border_top_color(
#define BORDER_RIGHT_COLOR_MASK 0x3
static inline css_error set_border_right_color(
css_computed_style *style, uint8_t type,
- css_color color)
+ css_colour color)
{
uint8_t *bits = &style->bits[BORDER_RIGHT_COLOR_INDEX];
@@ -679,7 +679,7 @@ static inline css_error set_border_right_color(
#define BORDER_BOTTOM_COLOR_MASK 0x3
static inline css_error set_border_bottom_color(
css_computed_style *style, uint8_t type,
- css_color color)
+ css_colour color)
{
uint8_t *bits = &style->bits[BORDER_BOTTOM_COLOR_INDEX];
@@ -700,7 +700,7 @@ static inline css_error set_border_bottom_color(
#define BORDER_LEFT_COLOR_MASK 0x3
static inline css_error set_border_left_color(
css_computed_style *style, uint8_t type,
- css_color color)
+ css_colour color)
{
uint8_t *bits = &style->bits[BORDER_LEFT_COLOR_INDEX];
@@ -763,7 +763,7 @@ static inline css_error set_line_height(
#define BACKGROUND_COLOR_MASK 0x3
static inline css_error set_background_color(
css_computed_style *style, uint8_t type,
- css_color color)
+ css_colour color)
{
uint8_t *bits = &style->bits[BACKGROUND_COLOR_INDEX];
diff --git a/src/select/select.c b/src/select/select.c
index 77209ed..a27a0cf 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -291,6 +291,7 @@ css_error css_select_style(css_select_ctx *ctx, void *node,
* Those properties which are inherited need to be set as inherit.
* Those which are not inherited need to be set to their default value.
*/
+ /** \todo If node is tree root, everything should be defaulted. */
for (i = 0; i < N_OPCODES; i++) {
/* Do nothing if this property is set */
if (state.props[i].set)
diff --git a/test/dump_computed.h b/test/dump_computed.h
index 7622394..22aa639 100644
--- a/test/dump_computed.h
+++ b/test/dump_computed.h
@@ -141,7 +141,7 @@ static void dump_computed_style(const css_computed_style *style, char *buf,
char *ptr = buf;
size_t wrote = 0;
uint8_t val;
- css_color color;
+ css_colour color;
lwc_string *url;
css_fixed len1, len2;
css_unit unit1, unit2;