mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Remove 'LayoutNode.pad' field.
This commit is contained in:
parent
183cdc95c6
commit
6841cc6df8
2 changed files with 12 additions and 14 deletions
|
@ -16,7 +16,7 @@ use layout::flow_ref::FlowRef;
|
||||||
use layout::layout_task::{AssignHeightsAndStoreOverflowTraversal, AssignWidthsTraversal};
|
use layout::layout_task::{AssignHeightsAndStoreOverflowTraversal, AssignWidthsTraversal};
|
||||||
use layout::layout_task::{BubbleWidthsTraversal};
|
use layout::layout_task::{BubbleWidthsTraversal};
|
||||||
use layout::util::{LayoutDataAccess, LayoutDataWrapper, OpaqueNodeMethods};
|
use layout::util::{LayoutDataAccess, LayoutDataWrapper, OpaqueNodeMethods};
|
||||||
use layout::wrapper::{layout_node_to_unsafe_layout_node, LayoutNode, PostorderNodeMutTraversal};
|
use layout::wrapper::{layout_node_to_unsafe_layout_node, layout_node_from_unsafe_layout_node, LayoutNode, PostorderNodeMutTraversal};
|
||||||
use layout::wrapper::{ThreadSafeLayoutNode, UnsafeLayoutNode};
|
use layout::wrapper::{ThreadSafeLayoutNode, UnsafeLayoutNode};
|
||||||
|
|
||||||
use gfx::display_list::OpaqueNode;
|
use gfx::display_list::OpaqueNode;
|
||||||
|
@ -219,7 +219,7 @@ fn recalc_style_for_node(unsafe_layout_node: UnsafeLayoutNode,
|
||||||
let layout_context: &mut LayoutContext = mem::transmute(*proxy.user_data());
|
let layout_context: &mut LayoutContext = mem::transmute(*proxy.user_data());
|
||||||
|
|
||||||
// Get a real layout node.
|
// Get a real layout node.
|
||||||
let node: LayoutNode = ::std::intrinsics::transmute(unsafe_layout_node);
|
let node: LayoutNode = layout_node_from_unsafe_layout_node(&unsafe_layout_node);
|
||||||
|
|
||||||
// Initialize layout data.
|
// Initialize layout data.
|
||||||
//
|
//
|
||||||
|
@ -309,9 +309,7 @@ fn construct_flows(mut unsafe_layout_node: UnsafeLayoutNode,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Get a real layout node.
|
// Get a real layout node.
|
||||||
let node: LayoutNode = unsafe {
|
let node: LayoutNode = layout_node_from_unsafe_layout_node(&unsafe_layout_node);
|
||||||
mem::transmute(unsafe_layout_node)
|
|
||||||
};
|
|
||||||
|
|
||||||
// Construct flows for this node.
|
// Construct flows for this node.
|
||||||
{
|
{
|
||||||
|
|
|
@ -139,10 +139,6 @@ pub struct LayoutNode<'a> {
|
||||||
|
|
||||||
/// Being chained to a ContravariantLifetime prevents `LayoutNode`s from escaping.
|
/// Being chained to a ContravariantLifetime prevents `LayoutNode`s from escaping.
|
||||||
pub chain: ContravariantLifetime<'a>,
|
pub chain: ContravariantLifetime<'a>,
|
||||||
|
|
||||||
/// Padding to ensure the transmute `JS<T>` -> `LayoutNode`, `LayoutNode` -> `UnsafeLayoutNode`,
|
|
||||||
/// and `UnsafeLayoutNode` -> others.
|
|
||||||
pad: uint
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'ln> Clone for LayoutNode<'ln> {
|
impl<'ln> Clone for LayoutNode<'ln> {
|
||||||
|
@ -150,7 +146,6 @@ impl<'ln> Clone for LayoutNode<'ln> {
|
||||||
LayoutNode {
|
LayoutNode {
|
||||||
node: self.node.clone(),
|
node: self.node.clone(),
|
||||||
chain: self.chain,
|
chain: self.chain,
|
||||||
pad: 0,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -168,7 +163,6 @@ impl<'ln> TLayoutNode for LayoutNode<'ln> {
|
||||||
LayoutNode {
|
LayoutNode {
|
||||||
node: node.transmute_copy(),
|
node: node.transmute_copy(),
|
||||||
chain: self.chain,
|
chain: self.chain,
|
||||||
pad: 0,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,7 +199,6 @@ impl<'ln> LayoutNode<'ln> {
|
||||||
f(LayoutNode {
|
f(LayoutNode {
|
||||||
node: node,
|
node: node,
|
||||||
chain: ContravariantLifetime,
|
chain: ContravariantLifetime,
|
||||||
pad: 0,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,7 +433,6 @@ impl<'ln> TLayoutNode for ThreadSafeLayoutNode<'ln> {
|
||||||
node: LayoutNode {
|
node: LayoutNode {
|
||||||
node: node.transmute_copy(),
|
node: node.transmute_copy(),
|
||||||
chain: self.node.chain,
|
chain: self.node.chain,
|
||||||
pad: 0,
|
|
||||||
},
|
},
|
||||||
pseudo: Normal,
|
pseudo: Normal,
|
||||||
}
|
}
|
||||||
|
@ -753,6 +745,14 @@ pub type UnsafeLayoutNode = (uint, uint);
|
||||||
|
|
||||||
pub fn layout_node_to_unsafe_layout_node(node: &LayoutNode) -> UnsafeLayoutNode {
|
pub fn layout_node_to_unsafe_layout_node(node: &LayoutNode) -> UnsafeLayoutNode {
|
||||||
unsafe {
|
unsafe {
|
||||||
mem::transmute_copy(node)
|
let ptr: uint = mem::transmute_copy(node);
|
||||||
|
(ptr, 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn layout_node_from_unsafe_layout_node(node: &UnsafeLayoutNode) -> LayoutNode {
|
||||||
|
unsafe {
|
||||||
|
let (node, _) = *node;
|
||||||
|
mem::transmute(node)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue