mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
auto merge of #676 : metajack/servo/acid1-all-boxes, r=eric93
This makes acid1 have all 6 boxes show up, and almost correctly positioned. r? @eric93
This commit is contained in:
commit
1337583878
2 changed files with 15 additions and 4 deletions
|
@ -401,7 +401,8 @@ impl LayoutTreeBuilder {
|
|||
|
||||
let new_generator = match (display, parent_generator.flow, sibling_flow) {
|
||||
// Floats
|
||||
(CSSDisplayBlock, BlockFlow(_), _) if !is_float.is_none() => {
|
||||
(CSSDisplayBlock, BlockFlow(_), _) |
|
||||
(CSSDisplayBlock, FloatFlow(_), _) if !is_float.is_none() => {
|
||||
self.create_child_generator(node, parent_generator, Flow_Float(is_float.get()))
|
||||
}
|
||||
// If we're placing a float after an inline, append the float to the inline flow,
|
||||
|
|
|
@ -63,8 +63,7 @@ impl FloatFlowData {
|
|||
pub fn bubble_widths_float(@mut self, ctx: &LayoutContext) {
|
||||
let mut min_width = Au(0);
|
||||
let mut pref_width = Au(0);
|
||||
|
||||
self.common.num_floats = 1;
|
||||
let mut num_floats = 1;
|
||||
|
||||
for FloatFlow(self).each_child |child_ctx| {
|
||||
//assert!(child_ctx.starts_block_flow() || child_ctx.starts_inline_flow());
|
||||
|
@ -72,10 +71,14 @@ impl FloatFlowData {
|
|||
do child_ctx.with_mut_base |child_node| {
|
||||
min_width = geometry::max(min_width, child_node.min_width);
|
||||
pref_width = geometry::max(pref_width, child_node.pref_width);
|
||||
child_node.floats_in = FloatContext::new(child_node.num_floats);
|
||||
|
||||
num_floats = num_floats + child_node.num_floats;
|
||||
}
|
||||
}
|
||||
|
||||
self.common.num_floats = num_floats;
|
||||
|
||||
|
||||
self.box.map(|&box| {
|
||||
let style = box.style();
|
||||
do box.with_model |model| {
|
||||
|
@ -162,8 +165,15 @@ impl FloatFlowData {
|
|||
}
|
||||
|
||||
pub fn assign_height_float(@mut self, ctx: &mut LayoutContext) {
|
||||
let mut float_ctx = FloatContext::new(self.common.num_floats);
|
||||
for FloatFlow(self).each_child |kid| {
|
||||
do kid.with_mut_base |child_node| {
|
||||
child_node.floats_in = float_ctx.clone();
|
||||
}
|
||||
kid.assign_height(ctx);
|
||||
do kid.with_mut_base |child_node| {
|
||||
float_ctx = child_node.floats_out.clone();
|
||||
}
|
||||
}
|
||||
|
||||
let mut cur_y = Au(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue