Commit 236bdaa5 authored by Federico Mena Quintero's avatar Federico Mena Quintero Committed by Florian Müllner

Handle "color: inherit" directly in get_color_from_term(), not in libcroco

The idea is to move handling of "inherit" as early in the parsing as possible.

Part of GNOME/gnome-shell#1934
parent 52f5793c
...@@ -581,10 +581,14 @@ get_color_from_term (StThemeNode *node, ...@@ -581,10 +581,14 @@ get_color_from_term (StThemeNode *node,
CRRgb rgb; CRRgb rgb;
enum CRStatus status; enum CRStatus status;
if (term_is_inherit (term))
{
return VALUE_INHERIT;
}
/* Since libcroco doesn't know about rgba colors, it can't handle /* Since libcroco doesn't know about rgba colors, it can't handle
* the transparent keyword * the transparent keyword
*/ */
if (term_is_transparent (term)) else if (term_is_transparent (term))
{ {
*color = TRANSPARENT_COLOR; *color = TRANSPARENT_COLOR;
return VALUE_FOUND; return VALUE_FOUND;
...@@ -606,9 +610,6 @@ get_color_from_term (StThemeNode *node, ...@@ -606,9 +610,6 @@ get_color_from_term (StThemeNode *node,
if (status != CR_OK) if (status != CR_OK)
return VALUE_NOT_FOUND; return VALUE_NOT_FOUND;
if (rgb.inherit)
return VALUE_INHERIT;
if (rgb.is_percentage) if (rgb.is_percentage)
cr_rgb_compute_from_percentage (&rgb); cr_rgb_compute_from_percentage (&rgb);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment