mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implement the box-sizing
property
This commit is contained in:
parent
0e35d70ca8
commit
c377d9c48e
7 changed files with 168 additions and 94 deletions
|
@ -416,19 +416,16 @@ impl HoistedAbsolutelyPositionedBox {
|
|||
Ok(replaced) => {
|
||||
// https://drafts.csswg.org/css2/visudet.html#abs-replaced-width
|
||||
// https://drafts.csswg.org/css2/visudet.html#abs-replaced-height
|
||||
let u = replaced.used_size_as_if_inline_element(&containing_block.into(), style);
|
||||
let used_size =
|
||||
replaced.used_size_as_if_inline_element(&containing_block.into(), style, &pbm);
|
||||
size = Vec2 {
|
||||
inline: LengthOrAuto::LengthPercentage(u.inline),
|
||||
block: LengthOrAuto::LengthPercentage(u.block),
|
||||
inline: LengthOrAuto::LengthPercentage(used_size.inline),
|
||||
block: LengthOrAuto::LengthPercentage(used_size.block),
|
||||
};
|
||||
replaced_used_size = Some(u);
|
||||
replaced_used_size = Some(used_size);
|
||||
},
|
||||
Err(_non_replaced) => {
|
||||
let box_size = style.box_size();
|
||||
size = Vec2 {
|
||||
inline: box_size.inline.percentage_relative_to(cbis),
|
||||
block: box_size.block.percentage_relative_to(cbbs),
|
||||
};
|
||||
size = style.content_box_size(&containing_block.into(), &pbm);
|
||||
replaced_used_size = None;
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue