From 8932dc98be897a31439b5d87cc98569adb276b95 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Thu, 5 Apr 2018 18:32:57 +1000 Subject: [PATCH] Remove all color stuff from nsCSSValue. --- .../gecko_bindings/sugar/ns_css_value.rs | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/components/style/gecko_bindings/sugar/ns_css_value.rs b/components/style/gecko_bindings/sugar/ns_css_value.rs index 0d29a7b7b10..ee9d5a82f62 100644 --- a/components/style/gecko_bindings/sugar/ns_css_value.rs +++ b/components/style/gecko_bindings/sugar/ns_css_value.rs @@ -7,7 +7,7 @@ use gecko_bindings::bindings; use gecko_bindings::structs; use gecko_bindings::structs::{nsCSSValue, nsCSSUnit}; -use gecko_bindings::structs::{nsCSSValue_Array, nsCSSValueList, nscolor}; +use gecko_bindings::structs::{nsCSSValue_Array, nsCSSValueList}; use gecko_string_cache::Atom; use std::marker::PhantomData; use std::mem; @@ -33,33 +33,20 @@ impl nsCSSValue { /// builds. pub fn integer_unchecked(&self) -> i32 { debug_assert!(self.mUnit == nsCSSUnit::eCSSUnit_Integer || - self.mUnit == nsCSSUnit::eCSSUnit_Enumerated || - self.mUnit == nsCSSUnit::eCSSUnit_EnumColor); + self.mUnit == nsCSSUnit::eCSSUnit_Enumerated); unsafe { *self.mValue.mInt.as_ref() } } /// Checks if it is an integer and returns it if so pub fn integer(&self) -> Option { if self.mUnit == nsCSSUnit::eCSSUnit_Integer || - self.mUnit == nsCSSUnit::eCSSUnit_Enumerated || - self.mUnit == nsCSSUnit::eCSSUnit_EnumColor { + self.mUnit == nsCSSUnit::eCSSUnit_Enumerated { Some(unsafe { *self.mValue.mInt.as_ref() }) } else { None } } - /// Checks if it is an RGBA color, returning it if so - /// Only use it with colors set by SetColorValue(), - /// which always sets RGBA colors - pub fn color_value(&self) -> Option { - if self.mUnit == nsCSSUnit::eCSSUnit_RGBAColor { - Some(unsafe { *self.mValue.mColor.as_ref() }) - } else { - None - } - } - /// Returns this nsCSSValue value as a floating point value, unchecked in /// release builds. pub fn float_unchecked(&self) -> f32 {