Auto merge of #12385 - Ms2ger:arc_ptr_eq, r=SimonSapin

Move arc_ptr_eq to style.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12385)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-07-11 05:11:48 -07:00 committed by GitHub
commit c3a8cbbd38
6 changed files with 17 additions and 17 deletions

View file

@ -103,6 +103,8 @@ pub mod values;
pub mod viewport;
pub mod workqueue;
use std::sync::Arc;
/// The CSS properties supported by the style system.
// Generated from the properties.mako.rs template by build.rs
#[macro_use]
@ -126,3 +128,11 @@ macro_rules! reexport_computed_values {
}
}
longhand_properties_idents!(reexport_computed_values);
/// Returns whether the two arguments point to the same value.
#[inline]
pub fn arc_ptr_eq<T: 'static>(a: &Arc<T>, b: &Arc<T>) -> bool {
let a: &T = &**a;
let b: &T = &**b;
(a as *const T) == (b as *const T)
}

View file

@ -7,6 +7,7 @@
#![allow(unsafe_code)]
use animation::{self, Animation};
use arc_ptr_eq;
use cache::{LRUCache, SimpleHashCache};
use context::{StyleContext, SharedStyleContext};
use data::PrivateStyleData;
@ -25,7 +26,6 @@ use std::hash::{BuildHasherDefault, Hash, Hasher};
use std::slice::Iter;
use std::sync::Arc;
use string_cache::{Atom, Namespace};
use util::arc_ptr_eq;
use util::opts;
fn create_common_style_affecting_attributes_from_element<E: TElement>(element: &E)