summaryrefslogtreecommitdiff
path: root/source/html/css-apply.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2014-10-13 16:16:28 +0200
committerTor Andersson <tor.andersson@artifex.com>2014-12-03 12:25:51 +0100
commit5cb1a29be4993d72cf6ab2af128135e2b7e40dd2 (patch)
tree30c513041af51dafd7d859664bd28922150053b3 /source/html/css-apply.c
parent9d1482bc78d72ba330c2130170b49b4e18702623 (diff)
downloadmupdf-5cb1a29be4993d72cf6ab2af128135e2b7e40dd2.tar.xz
html: Parse inline style attributes.
Diffstat (limited to 'source/html/css-apply.c')
-rw-r--r--source/html/css-apply.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/html/css-apply.c b/source/html/css-apply.c
index 7f3028a9..550ade85 100644
--- a/source/html/css-apply.c
+++ b/source/html/css-apply.c
@@ -156,6 +156,8 @@ count_selector_names(struct selector *sel)
return n;
}
+#define INLINE_SPECIFICITY 1000
+
int
selector_specificity(struct selector *sel)
{
@@ -595,7 +597,7 @@ add_property(struct style *style, const char *name, struct value *value, int spe
}
void
-apply_styles(struct rule *rule, struct style *style, fz_xml *node)
+apply_styles(struct style *style, struct rule *rule, fz_xml *node)
{
struct selector *sel;
struct property *prop;
@@ -617,6 +619,16 @@ apply_styles(struct rule *rule, struct style *style, fz_xml *node)
}
}
+void
+apply_inline_style(struct style *style, struct property *prop)
+{
+ while (prop)
+ {
+ add_property(style, prop->name, prop->value, INLINE_SPECIFICITY);
+ prop = prop->next;
+ }
+}
+
static const char *inherit_list[] = {
"color", "direction",
"font-family", "font-size", "font-style", "font-variant", "font-weight",