diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index 8f6cc070382..8b5b4558a37 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -82,6 +82,7 @@ num = "0.1.24" rand = "0.3" phf = "0.7.13" phf_macros = "0.7.13" +ref_filter_map = "1.0" ref_slice = "0.1.0" rustc-serialize = "0.3" selectors = {version = "0.5", features = ["heap_size"]} diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 2949c1d2cca..3eec2575bc3 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -66,6 +66,7 @@ use html5ever::serialize::SerializeOpts; use html5ever::serialize::TraversalScope; use html5ever::serialize::TraversalScope::{ChildrenOnly, IncludeNode}; use html5ever::tree_builder::{LimitedQuirks, NoQuirks, Quirks}; +use ref_filter_map::ref_filter_map; use selectors::matching::{DeclarationBlock, ElementFlags, matches}; use selectors::matching::{HAS_SLOW_SELECTOR, HAS_EDGE_CHILD_SELECTOR, HAS_SLOW_SELECTOR_LATER_SIBLINGS}; use selectors::matching::{common_style_affecting_attributes, rare_style_affecting_attributes}; @@ -751,7 +752,7 @@ impl Element { pub fn get_inline_style_declaration(&self, property: &Atom) -> Option> { - Ref::filter_map(self.style_attribute.borrow(), |inline_declarations| { + ref_filter_map(self.style_attribute.borrow(), |inline_declarations| { inline_declarations.as_ref().and_then(|declarations| { declarations.normal .iter() @@ -764,7 +765,7 @@ impl Element { pub fn get_important_inline_style_declaration(&self, property: &Atom) -> Option> { - Ref::filter_map(self.style_attribute.borrow(), |inline_declarations| { + ref_filter_map(self.style_attribute.borrow(), |inline_declarations| { inline_declarations.as_ref().and_then(|declarations| { declarations.important .iter() diff --git a/components/script/lib.rs b/components/script/lib.rs index 7d703a39d03..007877ff3e9 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -59,6 +59,7 @@ extern crate phf; #[macro_use] extern crate profile_traits; extern crate rand; +extern crate ref_filter_map; extern crate ref_slice; extern crate rustc_serialize; extern crate script_traits; diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index d9eae4afe11..c83166faab1 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -1601,6 +1601,11 @@ dependencies = [ "rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ref_filter_map" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "ref_slice" version = "0.1.0" @@ -1677,6 +1682,7 @@ dependencies = [ "plugins 0.0.1", "profile_traits 0.0.1", "rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", + "ref_filter_map 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "ref_slice 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "script_traits 0.0.1", diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index 59023cfc13d..2996fb07506 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -1485,6 +1485,11 @@ dependencies = [ "rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ref_filter_map" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "ref_slice" version = "0.1.0" @@ -1561,6 +1566,7 @@ dependencies = [ "plugins 0.0.1", "profile_traits 0.0.1", "rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", + "ref_filter_map 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "ref_slice 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "script_traits 0.0.1", diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock index 83908d4d194..5bc03810572 100644 --- a/ports/gonk/Cargo.lock +++ b/ports/gonk/Cargo.lock @@ -1467,6 +1467,11 @@ dependencies = [ "rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ref_filter_map" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "ref_slice" version = "0.1.0" @@ -1543,6 +1548,7 @@ dependencies = [ "plugins 0.0.1", "profile_traits 0.0.1", "rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", + "ref_filter_map 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "ref_slice 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "script_traits 0.0.1",