1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 
5 use gfx::display_list::OpaqueNode;
6 use libc::c_void;
7 use script_traits::UntrustedNodeAddress;
8 
9 pub trait OpaqueNodeMethods {
10     /// Converts this node to an `UntrustedNodeAddress`. An `UntrustedNodeAddress` is just the type
11     /// of node that script expects to receive in a hit test.
to_untrusted_node_address(&self) -> UntrustedNodeAddress12     fn to_untrusted_node_address(&self) -> UntrustedNodeAddress;
13 }
14 
15 impl OpaqueNodeMethods for OpaqueNode {
to_untrusted_node_address(&self) -> UntrustedNodeAddress16     fn to_untrusted_node_address(&self) -> UntrustedNodeAddress {
17         UntrustedNodeAddress(self.0 as *const c_void)
18     }
19 }
20