Move arc_ptr_eq to style.

This commit is contained in:
Ms2ger 2016-07-11 12:13:12 +02:00
parent 8ded106186
commit 9f13278b77
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)