From f8f17cf4754dfffbce612dd6f68c514b00561011 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Fri, 14 Feb 2014 12:43:43 -0800 Subject: [PATCH] Always use the border-box for Box.position.size Fixes #1674. --- src/components/main/layout/box_.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/main/layout/box_.rs b/src/components/main/layout/box_.rs index 002dc49c014..3f8f9183653 100644 --- a/src/components/main/layout/box_.rs +++ b/src/components/main/layout/box_.rs @@ -72,6 +72,7 @@ pub struct Box { style: Arc, /// The position of this box relative to its owning flow. + /// The size includes padding and border, but not margin. position: RefCell>, /// The border of the content box. @@ -308,7 +309,7 @@ pub struct InlineParentInfo { macro_rules! def_noncontent( ($side:ident, $get:ident, $inline_get:ident) => ( impl Box { pub fn $get(&self) -> Au { - self.margin.get().$side + self.border.get().$side + self.padding.get().$side + self.border.get().$side + self.padding.get().$side } pub fn $inline_get(&self) -> Au { @@ -317,7 +318,7 @@ macro_rules! def_noncontent( ($side:ident, $get:ident, $inline_get:ident) => ( match info.get() { &Some(ref info) => { for info in info.parent_info.iter() { - val = val + info.margin.$side + info.border.$side + info.padding.$side; + val = val + info.border.$side + info.padding.$side; } }, &None => {}