mirror of
https://github.com/servo/servo.git
synced 2025-07-16 03:43:38 +01:00
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:
parent
3dddb70038
commit
bdf1d179ba
3 changed files with 29 additions and 13 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue