diff options
author | Hiroyuki Ikezoe <hikezoe@mozilla.com> | 2017-08-15 15:19:46 +0900 |
---|---|---|
committer | Hiroyuki Ikezoe <hikezoe@mozilla.com> | 2017-08-15 15:19:47 +0900 |
commit | 95994bd710d0b662d4c7762b5d3f5876eb9ff65b (patch) | |
tree | 1f147eac3dfd7170e6fa4b5cbec33de6ec4b2a58 | |
parent | 4665d6dd15f8970f3072e192a32babb92efd132a (diff) | |
download | servo-95994bd710d0b662d4c7762b5d3f5876eb9ff65b.tar.gz servo-95994bd710d0b662d4c7762b5d3f5876eb9ff65b.zip |
Convert gecko's currentcolor to servo one.
-rw-r--r-- | components/style/gecko_bindings/sugar/ns_css_shadow_item.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/components/style/gecko_bindings/sugar/ns_css_shadow_item.rs b/components/style/gecko_bindings/sugar/ns_css_shadow_item.rs index bb270e6ad64..13f5b249389 100644 --- a/components/style/gecko_bindings/sugar/ns_css_shadow_item.rs +++ b/components/style/gecko_bindings/sugar/ns_css_shadow_item.rs @@ -48,11 +48,20 @@ impl nsCSSShadowItem { } } + #[inline] + fn extract_color(&self) -> Color { + if self.mHasColor { + Color::rgba(convert_nscolor_to_rgba(self.mColor)) + } else { + Color::currentcolor() + } + } + /// Gets a simple shadow from this item. #[inline] fn extract_simple_shadow(&self) -> SimpleShadow { SimpleShadow { - color: Color::rgba(convert_nscolor_to_rgba(self.mColor)), + color: self.extract_color(), horizontal: Au(self.mXOffset), vertical: Au(self.mYOffset), blur: Au(self.mRadius).into(), |