Add MulticolFlow and use it for multicol elements.

It currently "inherits" from BlockFlow and does not override anything.
This commit is contained in:
Simon Sapin 2015-03-07 17:15:31 +01:00
parent f30cd4f377
commit cc4749373a
6 changed files with 130 additions and 3 deletions

View file

@ -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)
}