Auto merge of #17089 - hiikezoe:current-color-for-fill-and-stroke, r=xidorn.

Support currentColor for fill and stroke.

<!-- Please describe your changes on the following line: -->
This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1368376

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because it's for stylo
This commit is contained in:
bors-servo 2017-05-30 01:47:44 -05:00 committed by GitHub
commit 9e89b0a229

View file

@ -1177,7 +1177,11 @@ impl ToComputedValue for SVGPaintKind {
SVGPaintKind::ContextStroke => super::computed::SVGPaintKind::ContextStroke, SVGPaintKind::ContextStroke => super::computed::SVGPaintKind::ContextStroke,
SVGPaintKind::ContextFill => super::computed::SVGPaintKind::ContextFill, SVGPaintKind::ContextFill => super::computed::SVGPaintKind::ContextFill,
SVGPaintKind::Color(ref color) => { 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) => { SVGPaintKind::PaintServer(ref server) => {
super::computed::SVGPaintKind::PaintServer(server.to_computed_value(context)) super::computed::SVGPaintKind::PaintServer(server.to_computed_value(context))