summaryrefslogtreecommitdiff
path: root/src/select/computed.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-03-02 20:09:15 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-03-02 20:09:15 +0000
commit2c8ceefca133bb802c489d71205dc88e8771cef7 (patch)
tree7544da2ed7754f62b8bad245aeb863a49c57721f /src/select/computed.c
parent0ebf0d7eb40e0aa50f9c359be0ef454f70c1f722 (diff)
downloadlibcss-2c8ceefca133bb802c489d71205dc88e8771cef7.tar.gz
libcss-2c8ceefca133bb802c489d71205dc88e8771cef7.tar.bz2
Add compose entry to property dispatch table.
Implement css_computed_style_compose() in terms of this. Don't expect this to link -- none of the composition functions exist. svn path=/trunk/libcss/; revision=6675
Diffstat (limited to 'src/select/computed.c')
-rw-r--r--src/select/computed.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/select/computed.c b/src/select/computed.c
index 948a18b..e5605da 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -106,12 +106,31 @@ css_error css_computed_style_compose(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
- UNUSED(parent);
- UNUSED(child);
- UNUSED(result);
-
- /** \todo implement */
+ css_error error = CSS_OK;
+ size_t i;
+
+ /* Iterate through the properties */
+ for (i = 0; i < N_OPCODES; i++) {
+ /* Skip any in extension blocks if the block does not exist */
+ if (prop_dispatch[i].group == GROUP_UNCOMMON &&
+ parent->uncommon == NULL &&
+ child->uncommon == NULL)
+ continue;
+
+ if (prop_dispatch[i].group == GROUP_PAGE &&
+ parent->page == NULL && child->page == NULL)
+ continue;
+
+ if (prop_dispatch[i].group == GROUP_AURAL &&
+ parent->aural == NULL && child->aural == NULL)
+ continue;
+
+ /* Compose the property */
+ error = prop_dispatch[i].compose(parent, child, result);
+ if (error != CSS_OK)
+ break;
+ }
- return CSS_OK;
+ return error;
}