mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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/
This commit is contained in:
parent
77a8091996
commit
cf33f00018
10 changed files with 198 additions and 156 deletions
|
@ -19,11 +19,15 @@ use traversal::{BuildDisplayList, ComputeAbsolutePositions};
|
|||
use traversal::{PostorderDomTraversal, PreorderDomTraversal};
|
||||
use util::geometry::ZERO_POINT;
|
||||
use util::opts;
|
||||
use wrapper::{LayoutNode, ServoLayoutNode};
|
||||
use wrapper::LayoutNode;
|
||||
|
||||
pub fn traverse_dom_preorder(root: ServoLayoutNode,
|
||||
shared_layout_context: &SharedLayoutContext) {
|
||||
fn doit(node: ServoLayoutNode, recalc_style: RecalcStyleForNode, construct_flows: ConstructFlows) {
|
||||
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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue