aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/main/layout/construct.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-02-26 14:15:55 -0800
committerPatrick Walton <pcwalton@mimiga.net>2014-02-26 20:37:20 -0800
commit014cf702e41363780bd67589f0ea1994b8756f1a (patch)
tree33f33dff870d4bc2bbe0f0fb1a63f631d82823e6 /src/components/main/layout/construct.rs
parent7ff35c0abedf6a339b9a0117aad85e06dc86555f (diff)
downloadservo-014cf702e41363780bd67589f0ea1994b8756f1a.tar.gz
servo-014cf702e41363780bd67589f0ea1994b8756f1a.zip
layout: Rewrite the float context.
This rewrites the float context to avoid dynamic failures resulting from `.clone()` misuse. It also renames the float context to the simpler `Floats`. The new version is modeled on WebKit's `FloatingObjects`.
Diffstat (limited to 'src/components/main/layout/construct.rs')
-rw-r--r--src/components/main/layout/construct.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/components/main/layout/construct.rs b/src/components/main/layout/construct.rs
index 0b43884c01f..35cba8458bb 100644
--- a/src/components/main/layout/construct.rs
+++ b/src/components/main/layout/construct.rs
@@ -26,7 +26,7 @@ use layout::box_::{Box, GenericBox, IframeBox, IframeBoxInfo, ImageBox, ImageBox
use layout::box_::{InlineInfo, InlineParentInfo, SpecificBoxInfo, UnscannedTextBox};
use layout::box_::{UnscannedTextBoxInfo};
use layout::context::LayoutContext;
-use layout::float_context::FloatType;
+use layout::floats::FloatKind;
use layout::flow::{Flow, MutableOwnedFlowUtils};
use layout::inline::InlineFlow;
use layout::text::TextRunScanner;
@@ -418,9 +418,9 @@ impl<'a> FlowConstructor<'a> {
/// Builds the flow for a node with `float: {left|right}`. This yields a float `BlockFlow` with
/// a `BlockFlow` underneath it.
- fn build_flow_for_floated_block(&mut self, node: &ThreadSafeLayoutNode, float_type: FloatType)
+ fn build_flow_for_floated_block(&mut self, node: &ThreadSafeLayoutNode, float_kind: FloatKind)
-> ~Flow {
- let mut flow = ~BlockFlow::float_from_node(self, node, float_type) as ~Flow;
+ let mut flow = ~BlockFlow::float_from_node(self, node, float_kind) as ~Flow;
self.build_children_of_block_flow(&mut flow, node);
flow
}
@@ -684,8 +684,8 @@ impl<'a> PostorderNodeMutTraversal for FlowConstructor<'a> {
// Floated flows contribute float flow construction results.
(_, float_value, _) => {
- let float_type = FloatType::from_property(float_value);
- let flow = self.build_flow_for_floated_block(node, float_type);
+ let float_kind = FloatKind::from_property(float_value);
+ let flow = self.build_flow_for_floated_block(node, float_kind);
node.set_flow_construction_result(FlowConstructionResult(flow))
}
}