mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Add RenderBox::margin_box()
This commit is contained in:
parent
1704daccb7
commit
3f9db09163
1 changed files with 7 additions and 0 deletions
|
@ -115,6 +115,7 @@ trait RenderBoxMethods {
|
|||
pure fn requires_inline_spacers() -> bool;
|
||||
pure fn content_box() -> Rect<au>;
|
||||
pure fn border_box() -> Rect<au>;
|
||||
pure fn margin_box() -> Rect<au>;
|
||||
|
||||
fn split_to_width(@self, &LayoutContext, au, starts_line: bool) -> SplitBoxResult;
|
||||
fn get_min_width(&LayoutContext) -> au;
|
||||
|
@ -360,6 +361,12 @@ impl RenderBox : RenderBoxMethods {
|
|||
self.content_box()
|
||||
}
|
||||
|
||||
/* The box fromed by the margin edge, as defined in CSS 2.1 Section 8.1.
|
||||
Coordinates are relative to the owning flow. */
|
||||
pure fn margin_box() -> Rect<au> {
|
||||
// TODO: actually compute content_box + padding + border + margin
|
||||
self.content_box()
|
||||
}
|
||||
|
||||
// TODO: implement this, generating spacer
|
||||
fn create_inline_spacer_for_side(_ctx: &LayoutContext, _side: InlineSpacerSide) -> Option<@RenderBox> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue