diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-10-04 13:35:53 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-10-09 19:45:53 +0200 |
commit | 912d65a3928db83463c9f37cd757e149ff004a5b (patch) | |
tree | 2a176d756a7b5e18b36b2f2b52ca716dce154d5b | |
parent | d8337541836dbed241afe890ae6cda66e6e21d2e (diff) | |
download | servo-912d65a3928db83463c9f37cd757e149ff004a5b.tar.gz servo-912d65a3928db83463c9f37cd757e149ff004a5b.zip |
style: Remove some more leftover code.
Differential Revision: https://phabricator.services.mozilla.com/D7755
-rw-r--r-- | components/style/gecko/rules.rs | 38 | ||||
-rw-r--r-- | components/style/gecko_bindings/sugar/ns_css_value.rs | 16 |
2 files changed, 0 insertions, 54 deletions
diff --git a/components/style/gecko/rules.rs b/components/style/gecko/rules.rs index 11970151fb8..3bb605bfadc 100644 --- a/components/style/gecko/rules.rs +++ b/components/style/gecko/rules.rs @@ -5,47 +5,9 @@ //! Bindings for CSS Rule objects use counter_style::{self, CounterBound}; -use font_face::Source; use gecko_bindings::structs::{self, nsCSSValue}; use gecko_bindings::sugar::ns_css_value::ToNsCssValue; -impl<'a> ToNsCssValue for &'a Vec<Source> { - fn convert(self, nscssvalue: &mut nsCSSValue) { - let src_len = self.iter().fold(0, |acc, src| { - acc + match *src { - // Each format hint takes one position in the array of mSrc. - Source::Url(ref url) => url.format_hints.len() + 1, - Source::Local(_) => 1, - } - }); - let mut target_srcs = nscssvalue - .set_array(src_len as i32) - .as_mut_slice() - .iter_mut(); - macro_rules! next { - () => { - target_srcs - .next() - .expect("Length of target_srcs should be enough") - }; - } - for src in self.iter() { - match *src { - Source::Url(ref url) => { - next!().set_url(&url.url); - for hint in url.format_hints.iter() { - next!().set_font_format(&hint); - } - }, - Source::Local(ref family) => { - next!().set_local_font(&family.name); - }, - } - } - debug_assert!(target_srcs.next().is_none(), "Should have filled all slots"); - } -} - impl<'a> ToNsCssValue for &'a counter_style::System { fn convert(self, nscssvalue: &mut nsCSSValue) { use counter_style::System::*; diff --git a/components/style/gecko_bindings/sugar/ns_css_value.rs b/components/style/gecko_bindings/sugar/ns_css_value.rs index c026161bddc..ed8892028fe 100644 --- a/components/style/gecko_bindings/sugar/ns_css_value.rs +++ b/components/style/gecko_bindings/sugar/ns_css_value.rs @@ -14,7 +14,6 @@ use std::mem; use std::ops::{Index, IndexMut}; use std::slice; use values::computed::{Angle, Length, LengthOrPercentage, Percentage}; -use values::specified::url::SpecifiedUrl; impl nsCSSValue { /// Create a CSSValue with null unit, useful to be used as a return value. @@ -167,16 +166,6 @@ impl nsCSSValue { unsafe { bindings::Gecko_CSSValue_SetAtomIdent(self, s.into_addrefed()) } } - /// Set to a font format. - pub fn set_font_format(&mut self, s: &str) { - self.set_string_internal(s, nsCSSUnit::eCSSUnit_Font_Format); - } - - /// Set to a local font value. - pub fn set_local_font(&mut self, s: &Atom) { - self.set_string_from_atom_internal(s, nsCSSUnit::eCSSUnit_Local_Font); - } - fn set_int_internal(&mut self, value: i32, unit: nsCSSUnit) { unsafe { bindings::Gecko_CSSValue_SetInt(self, value, unit) } } @@ -196,11 +185,6 @@ impl nsCSSValue { unsafe { bindings::Gecko_CSSValue_SetFloat(self, number, nsCSSUnit::eCSSUnit_Number) } } - /// Set to a url value - pub fn set_url(&mut self, url: &SpecifiedUrl) { - unsafe { bindings::Gecko_CSSValue_SetURL(self, url.url_value.get()) } - } - /// Set to an array of given length pub fn set_array(&mut self, len: i32) -> &mut nsCSSValue_Array { unsafe { bindings::Gecko_CSSValue_SetArray(self, len) } |