aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/sequential.rs
diff options
context:
space:
mode:
authorBobby Holley <bobbyholley@gmail.com>2015-11-20 09:51:05 -0800
committerBobby Holley <bobbyholley@gmail.com>2015-11-28 18:01:02 -0800
commitcf33f00018c7dc44a09086d6bb68b253153635ae (patch)
treeefa655a0967756601963042f0b321e18ed37ed02 /components/layout/sequential.rs
parent77a80919967446639141321ba83b3b0b6d1d1665 (diff)
downloadservo-cf33f00018c7dc44a09086d6bb68b253153635ae.tar.gz
servo-cf33f00018c7dc44a09086d6bb68b253153635ae.zip
Generalize the rest of layout to operate on generic Layout*.
There wasn't a good way to split this up, unfortunately. With this change, the only remaining usage of the Servo-specific structures is in layout_task, where the root node is received from the script task. \o/
Diffstat (limited to 'components/layout/sequential.rs')
-rw-r--r--components/layout/sequential.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/components/layout/sequential.rs b/components/layout/sequential.rs
index 36f754a2cf5..275f4ed0429 100644
--- a/components/layout/sequential.rs
+++ b/components/layout/sequential.rs
@@ -19,11 +19,15 @@ use traversal::{BuildDisplayList, ComputeAbsolutePositions};
use traversal::{PostorderDomTraversal, PreorderDomTraversal};
use util::geometry::ZERO_POINT;
use util::opts;
-use wrapper::{LayoutNode, ServoLayoutNode};
-
-pub fn traverse_dom_preorder(root: ServoLayoutNode,
- shared_layout_context: &SharedLayoutContext) {
- fn doit(node: ServoLayoutNode, recalc_style: RecalcStyleForNode, construct_flows: ConstructFlows) {
+use wrapper::LayoutNode;
+
+pub fn traverse_dom_preorder<'le, N>(root: N,
+ shared_layout_context: &SharedLayoutContext)
+ where N: LayoutNode<'le> {
+ fn doit<'le, N>(node: N,
+ recalc_style: RecalcStyleForNode,
+ construct_flows: ConstructFlows)
+ where N: LayoutNode<'le> {
recalc_style.process(node);
for kid in node.children() {
@@ -43,7 +47,7 @@ pub fn traverse_dom_preorder(root: ServoLayoutNode,
root: root.opaque(),
};
- doit(root, recalc_style, construct_flows);
+ doit::<'le, N>(root, recalc_style, construct_flows);
}
pub fn resolve_generated_content(root: &mut FlowRef, shared_layout_context: &SharedLayoutContext) {