mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Use the WritingMode bitflags from Stylo
This commit is contained in:
parent
b9adf8b7ac
commit
40ad9a722d
10 changed files with 62 additions and 81 deletions
|
@ -446,7 +446,7 @@ fn layout_atomic<'box_tree>(
|
|||
let containing_block_for_children = ContainingBlock {
|
||||
inline_size,
|
||||
block_size,
|
||||
mode: atomic.style.writing_mode(),
|
||||
mode: atomic.style.writing_mode,
|
||||
};
|
||||
assert_eq!(
|
||||
ifc.containing_block.mode, containing_block_for_children.mode,
|
||||
|
|
|
@ -14,11 +14,12 @@ use crate::geom::flow_relative::{Rect, Sides, Vec2};
|
|||
use crate::positioned::adjust_static_positions;
|
||||
use crate::positioned::{AbsolutelyPositionedBox, AbsolutelyPositionedFragment};
|
||||
use crate::replaced::ReplacedContent;
|
||||
use crate::style_ext::{ComputedValuesExt, Position};
|
||||
use crate::style_ext::ComputedValuesExt;
|
||||
use crate::{relative_adjustement, ContainingBlock};
|
||||
use rayon::iter::{IndexedParallelIterator, IntoParallelRefIterator, ParallelIterator};
|
||||
use rayon_croissant::ParallelIteratorExt;
|
||||
use servo_arc::Arc;
|
||||
use style::computed_values::position::T as Position;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{Length, LengthOrAuto, LengthPercentage, LengthPercentageOrAuto};
|
||||
use style::values::generics::length::MaxSize;
|
||||
|
@ -412,7 +413,7 @@ fn layout_in_flow_non_replaced_block_level<'a>(
|
|||
let containing_block_for_children = ContainingBlock {
|
||||
inline_size,
|
||||
block_size,
|
||||
mode: style.writing_mode(),
|
||||
mode: style.writing_mode,
|
||||
};
|
||||
// https://drafts.csswg.org/css-writing-modes/#orthogonal-flows
|
||||
assert_eq!(
|
||||
|
@ -520,7 +521,7 @@ fn layout_in_flow_replaced_block_level<'a>(
|
|||
let border = style.border_width();
|
||||
let computed_margin = style.margin().percentages_relative_to(cbis);
|
||||
let pb = &padding + &border;
|
||||
let mode = style.writing_mode();
|
||||
let mode = style.writing_mode;
|
||||
// FIXME(nox): We shouldn't pretend we always have a fully known intrinsic size.
|
||||
let intrinsic_size = replaced.intrinsic_size.size_to_flow_relative(mode);
|
||||
// FIXME(nox): This can divide by zero.
|
||||
|
|
|
@ -15,11 +15,12 @@ use crate::geom::flow_relative::Vec2;
|
|||
use crate::positioned::AbsolutelyPositionedBox;
|
||||
use crate::replaced::ReplacedContent;
|
||||
use crate::sizing::ContentSizesRequest;
|
||||
use crate::style_ext::{Direction, Display, DisplayGeneratingBox, DisplayInside, WritingMode};
|
||||
use crate::style_ext::{Display, DisplayGeneratingBox, DisplayInside};
|
||||
use crate::{ContainingBlock, DefiniteContainingBlock};
|
||||
use rayon::iter::{IntoParallelRefIterator, ParallelExtend, ParallelIterator};
|
||||
use script_layout_interface::wrapper_traits::LayoutNode;
|
||||
use servo_arc::Arc;
|
||||
use style::logical_geometry::WritingMode;
|
||||
use style::values::computed::{Length, LengthOrAuto};
|
||||
use style::Zero;
|
||||
use style_traits::CSSPixel;
|
||||
|
@ -107,7 +108,7 @@ impl BoxTreeRoot {
|
|||
block_size: LengthOrAuto::LengthPercentage(initial_containing_block_size.block),
|
||||
// FIXME: use the document’s mode:
|
||||
// https://drafts.csswg.org/css-writing-modes/#principal-flow
|
||||
mode: (WritingMode::HorizontalTb, Direction::Ltr),
|
||||
mode: WritingMode::empty(),
|
||||
};
|
||||
let dummy_tree_rank = 0;
|
||||
let mut absolutely_positioned_fragments = vec![];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue