mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Activate flexbox layout tracing
This commit is contained in:
parent
92d380c399
commit
4b2d80afcf
4 changed files with 15 additions and 13 deletions
|
@ -35,7 +35,7 @@ use style::values::computed::{LengthOrPercentageOrAutoOrContent, LengthOrPercent
|
||||||
|
|
||||||
/// The size of an axis. May be a specified size, a min/max
|
/// The size of an axis. May be a specified size, a min/max
|
||||||
/// constraint, or an unlimited size
|
/// constraint, or an unlimited size
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Serialize)]
|
||||||
enum AxisSize {
|
enum AxisSize {
|
||||||
Definite(Au),
|
Definite(Au),
|
||||||
MinMax(SizeConstraint),
|
MinMax(SizeConstraint),
|
||||||
|
@ -102,7 +102,7 @@ fn from_flex_basis(flex_basis: LengthOrPercentageOrAutoOrContent,
|
||||||
|
|
||||||
/// Represents a child in a flex container. Most fields here are used in
|
/// Represents a child in a flex container. Most fields here are used in
|
||||||
/// flex size resolving, and items are sorted by the 'order' property.
|
/// flex size resolving, and items are sorted by the 'order' property.
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Serialize)]
|
||||||
struct FlexItem {
|
struct FlexItem {
|
||||||
/// Main size of a flex item, used to store results of flexible length calcuation.
|
/// Main size of a flex item, used to store results of flexible length calcuation.
|
||||||
pub main_size: Au,
|
pub main_size: Au,
|
||||||
|
@ -240,7 +240,7 @@ impl FlexItem {
|
||||||
|
|
||||||
/// A line in a flex container.
|
/// A line in a flex container.
|
||||||
// TODO(stshine): More fields are required to handle collapsed items and baseline alignment.
|
// TODO(stshine): More fields are required to handle collapsed items and baseline alignment.
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Serialize)]
|
||||||
struct FlexLine {
|
struct FlexLine {
|
||||||
/// Range of items belong to this line in 'self.items'.
|
/// Range of items belong to this line in 'self.items'.
|
||||||
pub range: Range<usize>,
|
pub range: Range<usize>,
|
||||||
|
@ -330,7 +330,7 @@ impl FlexLine {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A block with the CSS `display` property equal to `flex`.
|
/// A block with the CSS `display` property equal to `flex`.
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Serialize)]
|
||||||
pub struct FlexFlow {
|
pub struct FlexFlow {
|
||||||
/// Data common to all block flows.
|
/// Data common to all block flows.
|
||||||
block_flow: BlockFlow,
|
block_flow: BlockFlow,
|
||||||
|
@ -496,7 +496,7 @@ impl FlexFlow {
|
||||||
inline_end_content_edge: Au,
|
inline_end_content_edge: Au,
|
||||||
content_inline_size: Au) {
|
content_inline_size: Au) {
|
||||||
let _scope = layout_debug_scope!("flex::block_mode_assign_inline_sizes");
|
let _scope = layout_debug_scope!("flex::block_mode_assign_inline_sizes");
|
||||||
debug!("block_mode_assign_inline_sizes");
|
debug!("flex::block_mode_assign_inline_sizes");
|
||||||
|
|
||||||
// FIXME (mbrubeck): Get correct mode for absolute containing block
|
// FIXME (mbrubeck): Get correct mode for absolute containing block
|
||||||
let containing_block_mode = self.block_flow.base.writing_mode;
|
let containing_block_mode = self.block_flow.base.writing_mode;
|
||||||
|
|
|
@ -37,8 +37,9 @@ impl Serialize for FlowList {
|
||||||
FlowClass::TableRowGroup => to_value(f.as_table_rowgroup()),
|
FlowClass::TableRowGroup => to_value(f.as_table_rowgroup()),
|
||||||
FlowClass::TableRow => to_value(f.as_table_row()),
|
FlowClass::TableRow => to_value(f.as_table_row()),
|
||||||
FlowClass::TableCell => to_value(f.as_table_cell()),
|
FlowClass::TableCell => to_value(f.as_table_cell()),
|
||||||
|
FlowClass::Flex => to_value(f.as_flex()),
|
||||||
FlowClass::ListItem | FlowClass::TableColGroup | FlowClass::TableCaption |
|
FlowClass::ListItem | FlowClass::TableColGroup | FlowClass::TableCaption |
|
||||||
FlowClass::Multicol | FlowClass::MulticolColumn | FlowClass::Flex => {
|
FlowClass::Multicol | FlowClass::MulticolColumn => {
|
||||||
Value::Null // Not implemented yet
|
Value::Null // Not implemented yet
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -523,7 +523,7 @@ impl ToGfxMatrix for ComputedMatrix {
|
||||||
/// parameter, and when it is present the constraint will be subtracted. This is
|
/// parameter, and when it is present the constraint will be subtracted. This is
|
||||||
/// used to adjust the constraint for `box-sizing: border-box`, and when you do so
|
/// used to adjust the constraint for `box-sizing: border-box`, and when you do so
|
||||||
/// make sure the size you want to clamp is intended to be used for content box.
|
/// make sure the size you want to clamp is intended to be used for content box.
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug, Serialize)]
|
||||||
pub struct SizeConstraint {
|
pub struct SizeConstraint {
|
||||||
min_size: Au,
|
min_size: Au,
|
||||||
max_size: Option<Au>,
|
max_size: Option<Au>,
|
||||||
|
|
|
@ -215,6 +215,7 @@ impl Debug for DebugWritingMode {
|
||||||
|
|
||||||
// Used to specify the logical direction.
|
// Used to specify the logical direction.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
|
#[cfg_attr(feature = "servo", derive(Serialize))]
|
||||||
pub enum Direction {
|
pub enum Direction {
|
||||||
Inline,
|
Inline,
|
||||||
Block
|
Block
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue