Create FlexFlow's for 'display: flex' nodes.

This commit doesn't implement any flexbox behavior at all.
It just constructs FlexFlow's, which act just like the BlockFlow from
which they "inherit."
This commit is contained in:
Kyle Zentner 2015-07-17 20:45:42 -07:00 committed by Patrick Walton
parent 45b7ee9bdb
commit 0488a36862
6 changed files with 286 additions and 1 deletions

View file

@ -13,6 +13,7 @@
use azure::azure_hl::Color;
use block::BlockFlow;
use context::LayoutContext;
use flex::FlexFlow;
use flow::{self, BaseFlow, Flow, IS_ABSOLUTELY_POSITIONED, NEEDS_LAYER};
use flow_ref;
use fragment::{CoordinateSystem, Fragment, IframeFragmentInfo, ImageFragmentInfo};
@ -1886,6 +1887,23 @@ impl ListItemFlowDisplayListBuilding for ListItemFlow {
}
}
pub trait FlexFlowDisplayListBuilding {
fn build_display_list_for_flex(&mut self,
display_list: Box<DisplayList>,
layout_context: &LayoutContext);
}
impl FlexFlowDisplayListBuilding for FlexFlow {
fn build_display_list_for_flex(&mut self,
display_list: Box<DisplayList>,
layout_context: &LayoutContext) {
// Draw the rest of the block.
self.as_block().build_display_list_for_block(display_list,
layout_context,
BorderPaintingMode::Separate)
}
}
trait BaseFlowDisplayListBuilding {
fn build_display_items_for_debugging_tint(&self,
display_list: &mut DisplayList,