Move OpaqueNode to style_traits

This commit is contained in:
Simon Sapin 2020-01-10 15:46:43 +01:00
parent d988b4c943
commit cbcf83fc65
4 changed files with 34 additions and 20 deletions

View file

@ -90,6 +90,12 @@ malloc_size_of_is_0!(UntrustedNodeAddress);
#[allow(unsafe_code)]
unsafe impl Send for UntrustedNodeAddress {}
impl From<style_traits::dom::OpaqueNode> for UntrustedNodeAddress {
fn from(o: style_traits::dom::OpaqueNode) -> Self {
UntrustedNodeAddress(o.0 as *const c_void)
}
}
impl Serialize for UntrustedNodeAddress {
fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
(self.0 as usize).serialize(s)