aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/construct.rs
diff options
context:
space:
mode:
authorBobby Holley <bobbyholley@gmail.com>2016-03-11 19:02:55 -0800
committerBobby Holley <bobbyholley@gmail.com>2016-03-14 14:31:57 -0700
commit539f839958650a0f08f3db444e1d57494e0e9830 (patch)
tree57c79277ab7194f01846c088285f0d76f2a751e1 /components/layout/construct.rs
parent7c4dcaa67701443841b15555c7319a6a86c4e6c8 (diff)
downloadservo-539f839958650a0f08f3db444e1d57494e0e9830.tar.gz
servo-539f839958650a0f08f3db444e1d57494e0e9830.zip
Remove lifetimes from LayoutNode and friends.
Diffstat (limited to 'components/layout/construct.rs')
-rw-r--r--components/layout/construct.rs24
1 files changed, 11 insertions, 13 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs
index 49a928a39d0..3f91bdad3d5 100644
--- a/components/layout/construct.rs
+++ b/components/layout/construct.rs
@@ -209,8 +209,8 @@ impl InlineFragmentsAccumulator {
}
}
- fn from_inline_node<'ln, N>(node: &N) -> InlineFragmentsAccumulator
- where N: ThreadSafeLayoutNode<'ln> {
+ fn from_inline_node<N>(node: &N) -> InlineFragmentsAccumulator
+ where N: ThreadSafeLayoutNode {
InlineFragmentsAccumulator {
fragments: IntermediateInlineFragments::new(),
enclosing_node: Some(InlineFragmentNodeInfo {
@@ -267,22 +267,20 @@ impl InlineFragmentsAccumulator {
}
/// An object that knows how to create flows.
-pub struct FlowConstructor<'a, 'ln, N: ThreadSafeLayoutNode<'ln>> {
+pub struct FlowConstructor<'a, N: ThreadSafeLayoutNode> {
/// The layout context.
pub layout_context: &'a LayoutContext<'a>,
/// Satisfy the compiler about the unused parameters, which we use to improve the ergonomics of
/// the ensuing impl {} by removing the need to parameterize all the methods individually.
- phantom1: PhantomData<&'ln ()>,
phantom2: PhantomData<N>,
}
-impl<'a, 'ln, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode<'ln>>
- FlowConstructor<'a, 'ln, ConcreteThreadSafeLayoutNode> {
+impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
+ FlowConstructor<'a, ConcreteThreadSafeLayoutNode> {
/// Creates a new flow constructor.
pub fn new(layout_context: &'a LayoutContext<'a>) -> Self {
FlowConstructor {
layout_context: layout_context,
- phantom1: PhantomData,
phantom2: PhantomData,
}
}
@@ -1444,9 +1442,9 @@ impl<'a, 'ln, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode<'ln>>
}
}
-impl<'a, 'ln, ConcreteThreadSafeLayoutNode> PostorderNodeMutTraversal<'ln, ConcreteThreadSafeLayoutNode>
- for FlowConstructor<'a, 'ln, ConcreteThreadSafeLayoutNode>
- where ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode<'ln> {
+impl<'a, ConcreteThreadSafeLayoutNode> PostorderNodeMutTraversal<ConcreteThreadSafeLayoutNode>
+ for FlowConstructor<'a, ConcreteThreadSafeLayoutNode>
+ where ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode {
// Construct Flow based on 'display', 'position', and 'float' values.
//
// CSS 2.1 Section 9.7
@@ -1623,8 +1621,8 @@ trait NodeUtils {
fn swap_out_construction_result(self) -> ConstructionResult;
}
-impl<'ln, ConcreteThreadSafeLayoutNode> NodeUtils for ConcreteThreadSafeLayoutNode
- where ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode<'ln> {
+impl<ConcreteThreadSafeLayoutNode> NodeUtils for ConcreteThreadSafeLayoutNode
+ where ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode {
fn is_replaced_content(&self) -> bool {
match self.type_id() {
None |
@@ -1682,7 +1680,7 @@ trait ObjectElement {
fn object_data(&self) -> Option<Url>;
}
-impl<'ln, N> ObjectElement for N where N: ThreadSafeLayoutNode<'ln> {
+impl<N> ObjectElement for N where N: ThreadSafeLayoutNode {
fn has_object_data(&self) -> bool {
let elem = self.as_element();
let type_and_data = (elem.get_attr(&ns!(), &atom!("type")), elem.get_attr(&ns!(), &atom!("data")));