mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Incomplete box construction for inline children
This commit is contained in:
parent
f5236ef7e3
commit
6c5ed2e30d
1 changed files with 32 additions and 4 deletions
|
@ -82,9 +82,32 @@ impl methods for ctxt {
|
||||||
attribute is 'inline'.
|
attribute is 'inline'.
|
||||||
"]
|
"]
|
||||||
fn construct_boxes_for_inline_children() {
|
fn construct_boxes_for_inline_children() {
|
||||||
|
for ntree.each_child(self.parent_node) {
|
||||||
|
|kid|
|
||||||
|
|
||||||
|
// Construct boxes for the child. Get its primary box.
|
||||||
|
let kid_box = kid.construct_boxes();
|
||||||
|
|
||||||
|
// Determine the child's display.
|
||||||
|
let disp = kid.get_computed_style().display;
|
||||||
|
if disp != di_inline {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add the child's box to the current enclosing box.
|
||||||
|
alt kid.get_computed_style().display {
|
||||||
|
di_block {
|
||||||
|
// TODO
|
||||||
|
#warn("TODO: non-inline display found inside inline box");
|
||||||
|
btree.add_child(self.parent_box, kid_box);
|
||||||
|
}
|
||||||
|
di_inline {
|
||||||
|
btree.add_child(self.parent_box, kid_box);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[doc="Constructs boxes for the parent's children."]
|
#[doc="Constructs boxes for the parent's children."]
|
||||||
fn construct_boxes_for_children() {
|
fn construct_boxes_for_children() {
|
||||||
#debug("parent node:");
|
#debug("parent node:");
|
||||||
|
@ -136,10 +159,15 @@ impl box_builder_methods for node {
|
||||||
fn construct_boxes() -> @box {
|
fn construct_boxes() -> @box {
|
||||||
let box_kind = self.determine_box_kind();
|
let box_kind = self.determine_box_kind();
|
||||||
let my_box = new_box(self, box_kind);
|
let my_box = new_box(self, box_kind);
|
||||||
if box_kind == bk_block {
|
alt box_kind {
|
||||||
|
bk_block | bk_inline {
|
||||||
let cx = create_context(self, my_box);
|
let cx = create_context(self, my_box);
|
||||||
cx.construct_boxes_for_children();
|
cx.construct_boxes_for_children();
|
||||||
}
|
}
|
||||||
|
_ {
|
||||||
|
// Nothing to do.
|
||||||
|
}
|
||||||
|
}
|
||||||
ret my_box;
|
ret my_box;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue