From 33e16fe630cb8c69feb74e679f3ebb94996e0b70 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Tue, 30 May 2017 06:16:47 +0900 Subject: [PATCH] Support currentColor for fill and stroke. --- components/style/values/specified/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/style/values/specified/mod.rs b/components/style/values/specified/mod.rs index 084486b4dd7..bf8033ed79a 100644 --- a/components/style/values/specified/mod.rs +++ b/components/style/values/specified/mod.rs @@ -1177,7 +1177,11 @@ impl ToComputedValue for SVGPaintKind { SVGPaintKind::ContextStroke => super::computed::SVGPaintKind::ContextStroke, SVGPaintKind::ContextFill => super::computed::SVGPaintKind::ContextFill, SVGPaintKind::Color(ref color) => { - super::computed::SVGPaintKind::Color(color.to_computed_value(context)) + let color = match color.parsed { + Color::CurrentColor => cssparser::Color::RGBA(context.style().get_color().clone_color()), + _ => color.to_computed_value(context), + }; + super::computed::SVGPaintKind::Color(color) } SVGPaintKind::PaintServer(ref server) => { super::computed::SVGPaintKind::PaintServer(server.to_computed_value(context))