mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Containing blocks contains styles rather than just a writing mode
This commit is contained in:
parent
40ad9a722d
commit
fa1adf2ad3
6 changed files with 31 additions and 25 deletions
|
@ -12,7 +12,6 @@ use crate::style_ext::{ComputedValuesExt, DisplayInside};
|
|||
use crate::{ContainingBlock, DefiniteContainingBlock};
|
||||
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
|
||||
use servo_arc::Arc;
|
||||
use style::logical_geometry::WritingMode;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{Length, LengthOrAuto, LengthPercentage, LengthPercentageOrAuto};
|
||||
use style::Zero;
|
||||
|
@ -129,7 +128,7 @@ impl<'a> AbsolutelyPositionedFragment<'a> {
|
|||
fragments: &mut Vec<Fragment>,
|
||||
content_rect_size: &Vec2<Length>,
|
||||
padding: &Sides<Length>,
|
||||
mode: WritingMode,
|
||||
style: &ComputedValues,
|
||||
) {
|
||||
if absolute.is_empty() {
|
||||
return;
|
||||
|
@ -142,7 +141,7 @@ impl<'a> AbsolutelyPositionedFragment<'a> {
|
|||
.inflate(&padding);
|
||||
let containing_block = DefiniteContainingBlock {
|
||||
size: padding_rect.size.clone(),
|
||||
mode,
|
||||
style,
|
||||
};
|
||||
fragments.push(Fragment::Anonymous(AnonymousFragment {
|
||||
children: absolute
|
||||
|
@ -150,7 +149,7 @@ impl<'a> AbsolutelyPositionedFragment<'a> {
|
|||
.map(|a| a.layout(layout_context, &containing_block))
|
||||
.collect(),
|
||||
rect: padding_rect,
|
||||
mode,
|
||||
mode: style.writing_mode,
|
||||
}))
|
||||
}
|
||||
|
||||
|
@ -325,11 +324,12 @@ impl<'a> AbsolutelyPositionedFragment<'a> {
|
|||
let containing_block_for_children = ContainingBlock {
|
||||
inline_size,
|
||||
block_size,
|
||||
mode: style.writing_mode,
|
||||
style,
|
||||
};
|
||||
// https://drafts.csswg.org/css-writing-modes/#orthogonal-flows
|
||||
assert_eq!(
|
||||
containing_block.mode, containing_block_for_children.mode,
|
||||
containing_block.style.writing_mode,
|
||||
containing_block_for_children.style.writing_mode,
|
||||
"Mixed writing modes are not supported yet"
|
||||
);
|
||||
let dummy_tree_rank = 0;
|
||||
|
@ -370,7 +370,7 @@ impl<'a> AbsolutelyPositionedFragment<'a> {
|
|||
&mut independent_layout.fragments,
|
||||
&content_rect.size,
|
||||
&padding,
|
||||
style.writing_mode,
|
||||
style,
|
||||
);
|
||||
|
||||
Fragment::Box(BoxFragment {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue