mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Use the correct writing mode for Floats fields
Fixes #6113 (assertion failures caused by floats in mixed-direction pages).
This commit is contained in:
parent
913c5677ab
commit
ec5c333347
2 changed files with 16 additions and 7 deletions
|
@ -771,8 +771,9 @@ impl BlockFlow {
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut margin_collapse_info = MarginCollapseInfo::new();
|
let mut margin_collapse_info = MarginCollapseInfo::new();
|
||||||
|
let writing_mode = self.base.floats.writing_mode;
|
||||||
self.base.floats.translate(LogicalSize::new(
|
self.base.floats.translate(LogicalSize::new(
|
||||||
self.fragment.style.writing_mode, -self.fragment.inline_start_offset(), Au(0)));
|
writing_mode, -self.fragment.inline_start_offset(), Au(0)));
|
||||||
|
|
||||||
// The sum of our block-start border and block-start padding.
|
// The sum of our block-start border and block-start padding.
|
||||||
let block_start_offset = self.fragment.border_padding.block_start;
|
let block_start_offset = self.fragment.border_padding.block_start;
|
||||||
|
@ -1029,7 +1030,8 @@ impl BlockFlow {
|
||||||
size: LogicalSize::new(
|
size: LogicalSize::new(
|
||||||
self.fragment.style.writing_mode,
|
self.fragment.style.writing_mode,
|
||||||
self.base.position.size.inline,
|
self.base.position.size.inline,
|
||||||
block_size + self.fragment.margin.block_start_end()),
|
block_size + self.fragment.margin.block_start_end())
|
||||||
|
.convert(self.fragment.style.writing_mode, self.base.floats.writing_mode),
|
||||||
ceiling: clearance + float_info.float_ceiling,
|
ceiling: clearance + float_info.float_ceiling,
|
||||||
max_inline_size: float_info.containing_inline_size,
|
max_inline_size: float_info.containing_inline_size,
|
||||||
kind: float_info.float_kind,
|
kind: float_info.float_kind,
|
||||||
|
@ -1039,11 +1041,16 @@ impl BlockFlow {
|
||||||
// After, grab the position and use that to set our position.
|
// After, grab the position and use that to set our position.
|
||||||
self.base.floats.add_float(&info);
|
self.base.floats.add_float(&info);
|
||||||
|
|
||||||
|
// FIXME (mbrubeck) Get the correct container size for self.base.floats;
|
||||||
|
let container_size = Size2D(self.base.block_container_inline_size, Au(0));
|
||||||
|
|
||||||
// Move in from the margin edge, as per CSS 2.1 § 9.5, floats may not overlap anything on
|
// Move in from the margin edge, as per CSS 2.1 § 9.5, floats may not overlap anything on
|
||||||
// their margin edges.
|
// their margin edges.
|
||||||
let float_offset = self.base.floats.last_float_pos().unwrap();
|
let float_offset = self.base.floats.last_float_pos().unwrap()
|
||||||
let writing_mode = self.base.floats.writing_mode;
|
.convert(self.base.floats.writing_mode,
|
||||||
let margin_offset = LogicalPoint::new(writing_mode,
|
self.base.writing_mode,
|
||||||
|
container_size);
|
||||||
|
let margin_offset = LogicalPoint::new(self.base.writing_mode,
|
||||||
Au(0),
|
Au(0),
|
||||||
self.fragment.margin.block_start);
|
self.fragment.margin.block_start);
|
||||||
|
|
||||||
|
@ -1379,7 +1386,8 @@ impl BlockFlow {
|
||||||
}
|
}
|
||||||
|
|
||||||
let info = PlacementInfo {
|
let info = PlacementInfo {
|
||||||
size: self.fragment.border_box.size,
|
size: self.fragment.border_box.size.convert(self.fragment.style.writing_mode,
|
||||||
|
self.base.floats.writing_mode),
|
||||||
ceiling: self.base.position.start.b,
|
ceiling: self.base.position.start.b,
|
||||||
max_inline_size: MAX_AU,
|
max_inline_size: MAX_AU,
|
||||||
kind: FloatKind::Left,
|
kind: FloatKind::Left,
|
||||||
|
|
|
@ -1455,7 +1455,8 @@ impl Flow for InlineFlow {
|
||||||
};
|
};
|
||||||
|
|
||||||
self.base.floats = scanner.floats.clone();
|
self.base.floats = scanner.floats.clone();
|
||||||
self.base.floats.translate(LogicalSize::new(self.base.writing_mode,
|
let writing_mode = self.base.floats.writing_mode;
|
||||||
|
self.base.floats.translate(LogicalSize::new(writing_mode,
|
||||||
Au(0),
|
Au(0),
|
||||||
-self.base.position.size.block));
|
-self.base.position.size.block));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue