aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/opaque_node.rs
diff options
context:
space:
mode:
authorMs2ger <Ms2ger@gmail.com>2016-06-15 17:10:46 +0100
committerMs2ger <Ms2ger@gmail.com>2016-06-20 19:08:02 +0200
commit7de3d165ad7041e833f8f59187468b589a3ebf82 (patch)
tree851ccea40882c84324a618d95fe11b39a4b37a9a /components/layout/opaque_node.rs
parent14a7e9bce1bcb1c42ca051e40f569bef89a34caa (diff)
downloadservo-7de3d165ad7041e833f8f59187468b589a3ebf82.tar.gz
servo-7de3d165ad7041e833f8f59187468b589a3ebf82.zip
Introduce LayoutJS<Node>::opaque() to replace OpaqueNodeMethods::from_jsmanaged().
Diffstat (limited to 'components/layout/opaque_node.rs')
-rw-r--r--components/layout/opaque_node.rs16
1 files changed, 1 insertions, 15 deletions
diff --git a/components/layout/opaque_node.rs b/components/layout/opaque_node.rs
index db80d45fe1d..41a4ccd5617 100644
--- a/components/layout/opaque_node.rs
+++ b/components/layout/opaque_node.rs
@@ -2,31 +2,17 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#![allow(unsafe_code)]
-
use gfx::display_list::OpaqueNode;
-use libc::{c_void, uintptr_t};
-use script::layout_interface::LayoutJS;
-use script::layout_interface::Node;
+use libc::c_void;
use script_traits::UntrustedNodeAddress;
pub trait OpaqueNodeMethods {
- /// Converts a DOM node to an `OpaqueNode'.
- fn from_jsmanaged(node: &LayoutJS<Node>) -> Self;
-
/// Converts this node to an `UntrustedNodeAddress`. An `UntrustedNodeAddress` is just the type
/// of node that script expects to receive in a hit test.
fn to_untrusted_node_address(&self) -> UntrustedNodeAddress;
}
impl OpaqueNodeMethods for OpaqueNode {
- fn from_jsmanaged(node: &LayoutJS<Node>) -> OpaqueNode {
- unsafe {
- let ptr: uintptr_t = node.get_jsobject() as uintptr_t;
- OpaqueNode(ptr)
- }
- }
-
fn to_untrusted_node_address(&self) -> UntrustedNodeAddress {
UntrustedNodeAddress(self.0 as *const c_void)
}