layout: Use the fragment's writing mode when computing sizes relevant to that fragment.

Otherwise we might mix writing modes. Not totally sure this change is correct in
the case we're mixing them, we might need to just not checking that operation.
This commit is contained in:
Emilio Cobos Álvarez 2016-09-26 12:10:48 +02:00
parent 3dddb70038
commit bdf1d179ba
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 29 additions and 13 deletions

View file

@ -1526,9 +1526,9 @@ impl ComputedValues {
}
#[inline]
pub fn logical_border_width(&self) -> LogicalMargin<Au> {
pub fn border_width_for_writing_mode(&self, writing_mode: WritingMode) -> LogicalMargin<Au> {
let border_style = self.get_border();
LogicalMargin::from_physical(self.writing_mode, SideOffsets2D::new(
LogicalMargin::from_physical(writing_mode, SideOffsets2D::new(
border_style.border_top_width,
border_style.border_right_width,
border_style.border_bottom_width,
@ -1536,6 +1536,11 @@ impl ComputedValues {
))
}
#[inline]
pub fn logical_border_width(&self) -> LogicalMargin<Au> {
self.border_width_for_writing_mode(self.writing_mode)
}
#[inline]
pub fn logical_margin(&self) -> LogicalMargin<computed::LengthOrPercentageOrAuto> {
let margin_style = self.get_margin();