mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 04:02:34 +03:00
Fix body text hint.
This commit is contained in:
parent
356615573a
commit
86ad729085
25
css/hints.c
25
css/hints.c
@ -1337,6 +1337,28 @@ static void css_hint_anchor_color(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void css_hint_body_color(
|
||||||
|
nscss_select_ctx *ctx,
|
||||||
|
dom_node *node)
|
||||||
|
{
|
||||||
|
struct css_hint *hint = &hint_ctx.hints[hint_ctx.len];
|
||||||
|
dom_exception err;
|
||||||
|
dom_string *color;
|
||||||
|
|
||||||
|
err = dom_element_get_attribute(node, corestring_dom_text, &color);
|
||||||
|
|
||||||
|
if (err == DOM_NO_ERR && color != NULL) {
|
||||||
|
if (nscss_parse_colour(
|
||||||
|
(const char *)dom_string_data(color),
|
||||||
|
&hint->data.color)) {
|
||||||
|
hint->prop = CSS_PROP_COLOR;
|
||||||
|
hint->status = CSS_COLOR_COLOR;
|
||||||
|
hint = css_hint_advance(hint);
|
||||||
|
}
|
||||||
|
dom_string_unref(color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void css_hint_color(
|
static void css_hint_color(
|
||||||
nscss_select_ctx *ctx,
|
nscss_select_ctx *ctx,
|
||||||
dom_node *node)
|
dom_node *node)
|
||||||
@ -1560,6 +1582,9 @@ css_error node_presentational_hint(void *pw, void *node,
|
|||||||
case DOM_HTML_ELEMENT_TYPE_FONT:
|
case DOM_HTML_ELEMENT_TYPE_FONT:
|
||||||
css_hint_font_size(pw, node);
|
css_hint_font_size(pw, node);
|
||||||
break;
|
break;
|
||||||
|
case DOM_HTML_ELEMENT_TYPE_BODY:
|
||||||
|
css_hint_body_color(pw, node);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user