aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/construct.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2015-03-07 17:15:31 +0100
committerSimon Sapin <simon.sapin@exyr.org>2015-04-29 02:29:33 +0200
commitcc4749373a421c6323dd5c9e5037899775ba015d (patch)
treee1fe568885ee0e14de92a378a10f709c4e5c32c6 /components/layout/construct.rs
parentf30cd4f3770bc0d65a01b66d6ce92b31b364a50b (diff)
downloadservo-cc4749373a421c6323dd5c9e5037899775ba015d.tar.gz
servo-cc4749373a421c6323dd5c9e5037899775ba015d.zip
Add MulticolFlow and use it for multicol elements.
It currently "inherits" from BlockFlow and does not override anything.
Diffstat (limited to 'components/layout/construct.rs')
-rw-r--r--components/layout/construct.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs
index f945e8bb526..12f9900b088 100644
--- a/components/layout/construct.rs
+++ b/components/layout/construct.rs
@@ -33,6 +33,7 @@ use fragment::{InlineBlockFragmentInfo, SpecificFragmentInfo};
use incremental::{RECONSTRUCT_FLOW, RestyleDamage};
use inline::InlineFlow;
use list_item::{ListItemFlow, ListStyleTypeContent};
+use multicol::MulticolFlow;
use opaque_node::OpaqueNodeMethods;
use parallel;
use table::TableFlow;
@@ -655,8 +656,12 @@ impl<'a> FlowConstructor<'a> {
/// to happen.
fn build_flow_for_nonfloated_block(&mut self, node: &ThreadSafeLayoutNode)
-> ConstructionResult {
- let flow = box BlockFlow::from_node_and_fragment(node, self.build_fragment_for_block(node))
- as Box<Flow>;
+ let fragment = self.build_fragment_for_block(node);
+ let flow = if node.style().is_multicol() {
+ box MulticolFlow::from_node_and_fragment(node, fragment) as Box<Flow>
+ } else {
+ box BlockFlow::from_node_and_fragment(node, fragment) as Box<Flow>
+ };
self.build_flow_for_block(FlowRef::new(flow), node)
}