mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
layout: Add a basic support for list-style-position: outside
(#32114)
This change adds very basic support for `list-style-position`. Currently, the marker does not do any kind of baseline alignment with the rest of the list item contents and it also doesn't force the list item to be at least as tall as the marker. This adds a few new failures: - Four failures because markers do not ensure that list-items have at least the same block size as they do: - FAIL [expected PASS] /css/CSS2/lists/list-style-applies-to-012.xht - FAIL [expected PASS] /css/CSS2/lists/list-style-applies-to-014.xht - FAIL [expected PASS] /css/CSS2/lists/list-style-type-applies-to-012.xht - FAIL [expected PASS] /css/CSS2/lists/list-style-type-applies-to-014.xht - One failure because we don't yet support the `::marker` pseudo-selector: - FAIL [expected PASS] /css/css-position/position-absolute-dynamic-list-marker.html - One failure because we don't support the list item exception for the line height quirk: - FAIL [expected PASS] /quirks/line-height-in-list-item.tentative.html Co-authored-by: Oriol Brufau <obrufau@igalia.com> <!-- Please describe your changes on the following line: --> Fixes #27383. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #27383. - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
363651c7f7
commit
97376e6d96
29 changed files with 167 additions and 240 deletions
26
Cargo.lock
generated
26
Cargo.lock
generated
|
@ -1206,7 +1206,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "derive_common"
|
name = "derive_common"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2024-03-01#df595694fd3182d68ad2f4373795cd3b50eff9ac"
|
source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"darling",
|
"darling",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
|
@ -3550,7 +3550,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "malloc_size_of"
|
name = "malloc_size_of"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2024-03-01#df595694fd3182d68ad2f4373795cd3b50eff9ac"
|
source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"accountable-refcell",
|
"accountable-refcell",
|
||||||
"app_units",
|
"app_units",
|
||||||
|
@ -5163,7 +5163,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "selectors"
|
name = "selectors"
|
||||||
version = "0.24.0"
|
version = "0.24.0"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2024-03-01#df595694fd3182d68ad2f4373795cd3b50eff9ac"
|
source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.5.0",
|
"bitflags 2.5.0",
|
||||||
"cssparser",
|
"cssparser",
|
||||||
|
@ -5451,7 +5451,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "servo_arc"
|
name = "servo_arc"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2024-03-01#df595694fd3182d68ad2f4373795cd3b50eff9ac"
|
source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nodrop",
|
"nodrop",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -5461,7 +5461,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "servo_atoms"
|
name = "servo_atoms"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2024-03-01#df595694fd3182d68ad2f4373795cd3b50eff9ac"
|
source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"string_cache",
|
"string_cache",
|
||||||
"string_cache_codegen",
|
"string_cache_codegen",
|
||||||
|
@ -5659,7 +5659,7 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "size_of_test"
|
name = "size_of_test"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2024-03-01#df595694fd3182d68ad2f4373795cd3b50eff9ac"
|
source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"static_assertions",
|
"static_assertions",
|
||||||
]
|
]
|
||||||
|
@ -5785,7 +5785,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "static_prefs"
|
name = "static_prefs"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2024-03-01#df595694fd3182d68ad2f4373795cd3b50eff9ac"
|
source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "strict-num"
|
name = "strict-num"
|
||||||
|
@ -5822,7 +5822,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "style"
|
name = "style"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2024-03-01#df595694fd3182d68ad2f4373795cd3b50eff9ac"
|
source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"app_units",
|
"app_units",
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
|
@ -5881,7 +5881,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "style_config"
|
name = "style_config"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2024-03-01#df595694fd3182d68ad2f4373795cd3b50eff9ac"
|
source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
]
|
]
|
||||||
|
@ -5889,7 +5889,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "style_derive"
|
name = "style_derive"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2024-03-01#df595694fd3182d68ad2f4373795cd3b50eff9ac"
|
source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"darling",
|
"darling",
|
||||||
"derive_common",
|
"derive_common",
|
||||||
|
@ -5920,7 +5920,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "style_traits"
|
name = "style_traits"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2024-03-01#df595694fd3182d68ad2f4373795cd3b50eff9ac"
|
source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"app_units",
|
"app_units",
|
||||||
"bitflags 2.5.0",
|
"bitflags 2.5.0",
|
||||||
|
@ -6283,7 +6283,7 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "to_shmem"
|
name = "to_shmem"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2024-03-01#df595694fd3182d68ad2f4373795cd3b50eff9ac"
|
source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cssparser",
|
"cssparser",
|
||||||
"servo_arc",
|
"servo_arc",
|
||||||
|
@ -6296,7 +6296,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "to_shmem_derive"
|
name = "to_shmem_derive"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
source = "git+https://github.com/servo/stylo?branch=2024-03-01#df595694fd3182d68ad2f4373795cd3b50eff9ac"
|
source = "git+https://github.com/servo/stylo?branch=2024-03-01#e26865ed1dee38ad5e750cc4bb3c81cd90bf9810"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"darling",
|
"darling",
|
||||||
"derive_common",
|
"derive_common",
|
||||||
|
|
|
@ -105,7 +105,7 @@ string_cache_codegen = "0.5"
|
||||||
style = { git = "https://github.com/servo/stylo", branch = "2024-03-01", features = ["servo"] }
|
style = { git = "https://github.com/servo/stylo", branch = "2024-03-01", features = ["servo"] }
|
||||||
style_config = { git = "https://github.com/servo/stylo", branch = "2024-03-01" }
|
style_config = { git = "https://github.com/servo/stylo", branch = "2024-03-01" }
|
||||||
style_traits = { git = "https://github.com/servo/stylo", branch = "2024-03-01", features = ["servo"] }
|
style_traits = { git = "https://github.com/servo/stylo", branch = "2024-03-01", features = ["servo"] }
|
||||||
# NOTE: the sm-angle feature only enables ANGLE on Windows, not other platforms!
|
# NOTE: the sm-angle feature only 2024-03-01rms!
|
||||||
surfman = { version = "0.9", features = ["chains", "sm-angle", "sm-angle-default"] }
|
surfman = { version = "0.9", features = ["chains", "sm-angle", "sm-angle-default"] }
|
||||||
syn = { version = "2", default-features = false, features = ["clone-impls", "derive", "parsing"] }
|
syn = { version = "2", default-features = false, features = ["clone-impls", "derive", "parsing"] }
|
||||||
synstructure = "0.13"
|
synstructure = "0.13"
|
||||||
|
|
|
@ -13,10 +13,13 @@ use style::selector_parser::PseudoElement;
|
||||||
use style::str::char_is_whitespace;
|
use style::str::char_is_whitespace;
|
||||||
use style::values::specified::text::TextDecorationLine;
|
use style::values::specified::text::TextDecorationLine;
|
||||||
|
|
||||||
|
use super::OutsideMarker;
|
||||||
use crate::cell::ArcRefCell;
|
use crate::cell::ArcRefCell;
|
||||||
use crate::context::LayoutContext;
|
use crate::context::LayoutContext;
|
||||||
use crate::dom::{BoxSlot, LayoutBox, NodeExt};
|
use crate::dom::{BoxSlot, LayoutBox, NodeExt};
|
||||||
use crate::dom_traversal::{Contents, NodeAndStyleInfo, NonReplacedContents, TraversalHandler};
|
use crate::dom_traversal::{
|
||||||
|
Contents, NodeAndStyleInfo, NonReplacedContents, PseudoElementContentItem, TraversalHandler,
|
||||||
|
};
|
||||||
use crate::flow::float::FloatBox;
|
use crate::flow::float::FloatBox;
|
||||||
use crate::flow::inline::{InlineBox, InlineFormattingContext, InlineLevelBox};
|
use crate::flow::inline::{InlineBox, InlineFormattingContext, InlineLevelBox};
|
||||||
use crate::flow::text_run::TextRun;
|
use crate::flow::text_run::TextRun;
|
||||||
|
@ -98,6 +101,9 @@ enum BlockLevelCreator {
|
||||||
display_inside: DisplayInside,
|
display_inside: DisplayInside,
|
||||||
contents: Contents,
|
contents: Contents,
|
||||||
},
|
},
|
||||||
|
OutsideMarker {
|
||||||
|
contents: Vec<PseudoElementContentItem>,
|
||||||
|
},
|
||||||
AnonymousTable {
|
AnonymousTable {
|
||||||
table_block: ArcRefCell<BlockLevelBox>,
|
table_block: ArcRefCell<BlockLevelBox>,
|
||||||
},
|
},
|
||||||
|
@ -195,17 +201,12 @@ impl BlockContainer {
|
||||||
|
|
||||||
if is_list_item {
|
if is_list_item {
|
||||||
if let Some(marker_contents) = crate::lists::make_marker(context, info) {
|
if let Some(marker_contents) = crate::lists::make_marker(context, info) {
|
||||||
let _position = info.style.clone_list_style_position();
|
match info.style.clone_list_style_position() {
|
||||||
// FIXME: implement support for `outside` and remove this:
|
|
||||||
let position = ListStylePosition::Inside;
|
|
||||||
match position {
|
|
||||||
ListStylePosition::Inside => {
|
ListStylePosition::Inside => {
|
||||||
builder.handle_list_item_marker_inside(info, marker_contents)
|
builder.handle_list_item_marker_inside(info, marker_contents)
|
||||||
},
|
},
|
||||||
ListStylePosition::Outside => {
|
ListStylePosition::Outside => {
|
||||||
// FIXME: implement layout for this case
|
builder.handle_list_item_marker_outside(info, marker_contents)
|
||||||
// https://github.com/servo/servo/issues/27383
|
|
||||||
// and enable `list-style-position` and the `list-style` shorthand in Stylo.
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -452,6 +453,18 @@ where
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn handle_list_item_marker_outside(
|
||||||
|
&mut self,
|
||||||
|
info: &NodeAndStyleInfo<Node>,
|
||||||
|
contents: Vec<crate::dom_traversal::PseudoElementContentItem>,
|
||||||
|
) {
|
||||||
|
self.block_level_boxes.push(BlockLevelJob {
|
||||||
|
info: info.clone(),
|
||||||
|
box_slot: BoxSlot::dummy(),
|
||||||
|
kind: BlockLevelCreator::OutsideMarker { contents },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
fn handle_inline_level_element(
|
fn handle_inline_level_element(
|
||||||
&mut self,
|
&mut self,
|
||||||
info: &NodeAndStyleInfo<Node>,
|
info: &NodeAndStyleInfo<Node>,
|
||||||
|
@ -768,6 +781,29 @@ where
|
||||||
display_inside,
|
display_inside,
|
||||||
contents,
|
contents,
|
||||||
))),
|
))),
|
||||||
|
BlockLevelCreator::OutsideMarker { contents } => {
|
||||||
|
let marker_style = context
|
||||||
|
.shared_context()
|
||||||
|
.stylist
|
||||||
|
.style_for_anonymous::<Node::ConcreteElement>(
|
||||||
|
&context.shared_context().guards,
|
||||||
|
&PseudoElement::ServoLegacyText, // FIMXE: use `PseudoElement::Marker` when we add it
|
||||||
|
&info.style,
|
||||||
|
);
|
||||||
|
let info = info.new_replacing_style(marker_style.clone());
|
||||||
|
let contents = NonReplacedContents::OfPseudoElement(contents);
|
||||||
|
let block_container = BlockContainer::construct(
|
||||||
|
context,
|
||||||
|
&info,
|
||||||
|
contents,
|
||||||
|
TextDecorationLine::empty(),
|
||||||
|
false, /* is_list_item */
|
||||||
|
);
|
||||||
|
ArcRefCell::new(BlockLevelBox::OutsideMarker(OutsideMarker {
|
||||||
|
style: marker_style,
|
||||||
|
block_container,
|
||||||
|
}))
|
||||||
|
},
|
||||||
BlockLevelCreator::AnonymousTable { table_block } => table_block,
|
BlockLevelCreator::AnonymousTable { table_block } => table_block,
|
||||||
};
|
};
|
||||||
self.box_slot
|
self.box_slot
|
||||||
|
|
|
@ -71,6 +71,10 @@ impl BlockContainer {
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
pub(crate) enum BlockLevelBox {
|
pub(crate) enum BlockLevelBox {
|
||||||
|
Independent(IndependentFormattingContext),
|
||||||
|
OutOfFlowAbsolutelyPositionedBox(ArcRefCell<AbsolutelyPositionedBox>),
|
||||||
|
OutOfFlowFloatBox(FloatBox),
|
||||||
|
OutsideMarker(OutsideMarker),
|
||||||
SameFormattingContextBlock {
|
SameFormattingContextBlock {
|
||||||
base_fragment_info: BaseFragmentInfo,
|
base_fragment_info: BaseFragmentInfo,
|
||||||
#[serde(skip_serializing)]
|
#[serde(skip_serializing)]
|
||||||
|
@ -78,9 +82,6 @@ pub(crate) enum BlockLevelBox {
|
||||||
contents: BlockContainer,
|
contents: BlockContainer,
|
||||||
contains_floats: bool,
|
contains_floats: bool,
|
||||||
},
|
},
|
||||||
OutOfFlowAbsolutelyPositionedBox(ArcRefCell<AbsolutelyPositionedBox>),
|
|
||||||
OutOfFlowFloatBox(FloatBox),
|
|
||||||
Independent(IndependentFormattingContext),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BlockLevelBox {
|
impl BlockLevelBox {
|
||||||
|
@ -103,6 +104,7 @@ impl BlockLevelBox {
|
||||||
BlockLevelBox::SameFormattingContextBlock { ref style, .. } => style,
|
BlockLevelBox::SameFormattingContextBlock { ref style, .. } => style,
|
||||||
BlockLevelBox::OutOfFlowAbsolutelyPositionedBox(_) |
|
BlockLevelBox::OutOfFlowAbsolutelyPositionedBox(_) |
|
||||||
BlockLevelBox::OutOfFlowFloatBox(_) => return true,
|
BlockLevelBox::OutOfFlowFloatBox(_) => return true,
|
||||||
|
BlockLevelBox::OutsideMarker(_) => return false,
|
||||||
BlockLevelBox::Independent(ref context) => {
|
BlockLevelBox::Independent(ref context) => {
|
||||||
// FIXME: If the element doesn't fit next to floats, it will get clearance.
|
// FIXME: If the element doesn't fit next to floats, it will get clearance.
|
||||||
// In that case this should be returning false.
|
// In that case this should be returning false.
|
||||||
|
@ -205,6 +207,81 @@ struct FlowLayout {
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy)]
|
||||||
struct CollapsibleWithParentStartMargin(bool);
|
struct CollapsibleWithParentStartMargin(bool);
|
||||||
|
|
||||||
|
/// The contentes of a BlockContainer created to render a list marker
|
||||||
|
/// for a list that has `list-style-position: outside`.
|
||||||
|
#[derive(Debug, Serialize)]
|
||||||
|
pub(crate) struct OutsideMarker {
|
||||||
|
#[serde(skip_serializing)]
|
||||||
|
pub style: Arc<ComputedValues>,
|
||||||
|
pub block_container: BlockContainer,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl OutsideMarker {
|
||||||
|
fn layout(
|
||||||
|
&self,
|
||||||
|
layout_context: &LayoutContext<'_>,
|
||||||
|
containing_block: &ContainingBlock<'_>,
|
||||||
|
positioning_context: &mut PositioningContext,
|
||||||
|
sequential_layout_state: Option<&mut SequentialLayoutState>,
|
||||||
|
collapsible_with_parent_start_margin: Option<CollapsibleWithParentStartMargin>,
|
||||||
|
) -> Fragment {
|
||||||
|
let content_sizes = self
|
||||||
|
.block_container
|
||||||
|
.inline_content_sizes(layout_context, containing_block.style.writing_mode);
|
||||||
|
let containing_block = ContainingBlock {
|
||||||
|
inline_size: content_sizes.max_content,
|
||||||
|
block_size: AuOrAuto::auto(),
|
||||||
|
style: &self.style,
|
||||||
|
};
|
||||||
|
let flow_layout = self.block_container.layout(
|
||||||
|
layout_context,
|
||||||
|
positioning_context,
|
||||||
|
&containing_block,
|
||||||
|
sequential_layout_state,
|
||||||
|
collapsible_with_parent_start_margin.unwrap_or(CollapsibleWithParentStartMargin(false)),
|
||||||
|
);
|
||||||
|
let max_inline_size = flow_layout.fragments.iter().fold(
|
||||||
|
Length::zero(),
|
||||||
|
|current_max, fragment| match fragment {
|
||||||
|
Fragment::Text(text) => current_max.max(text.rect.max_inline_position()),
|
||||||
|
Fragment::Image(image) => current_max.max(image.rect.max_inline_position()),
|
||||||
|
Fragment::Positioning(positioning) => {
|
||||||
|
current_max.max(positioning.rect.max_inline_position())
|
||||||
|
},
|
||||||
|
Fragment::Box(_) |
|
||||||
|
Fragment::Float(_) |
|
||||||
|
Fragment::AbsoluteOrFixedPositioned(_) |
|
||||||
|
Fragment::IFrame(_) => {
|
||||||
|
unreachable!("Found unexpected fragment type in outside list marker!");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
let content_rect = LogicalRect {
|
||||||
|
start_corner: LogicalVec2 {
|
||||||
|
inline: -max_inline_size,
|
||||||
|
block: Zero::zero(),
|
||||||
|
},
|
||||||
|
size: LogicalVec2 {
|
||||||
|
inline: max_inline_size,
|
||||||
|
block: Zero::zero(),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
Fragment::Box(BoxFragment::new(
|
||||||
|
BaseFragmentInfo::anonymous(),
|
||||||
|
self.style.clone(),
|
||||||
|
flow_layout.fragments,
|
||||||
|
content_rect,
|
||||||
|
LogicalSides::zero(),
|
||||||
|
LogicalSides::zero(),
|
||||||
|
LogicalSides::zero(),
|
||||||
|
None,
|
||||||
|
CollapsedBlockMargins::zero(),
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl BlockFormattingContext {
|
impl BlockFormattingContext {
|
||||||
pub(super) fn layout(
|
pub(super) fn layout(
|
||||||
&self,
|
&self,
|
||||||
|
@ -261,7 +338,8 @@ fn calculate_inline_content_size_for_block_level_boxes(
|
||||||
) -> ContentSizes {
|
) -> ContentSizes {
|
||||||
let get_box_info = |box_: &ArcRefCell<BlockLevelBox>| {
|
let get_box_info = |box_: &ArcRefCell<BlockLevelBox>| {
|
||||||
match &mut *box_.borrow_mut() {
|
match &mut *box_.borrow_mut() {
|
||||||
BlockLevelBox::OutOfFlowAbsolutelyPositionedBox(_) => None,
|
BlockLevelBox::OutOfFlowAbsolutelyPositionedBox(_) |
|
||||||
|
BlockLevelBox::OutsideMarker { .. } => None,
|
||||||
BlockLevelBox::OutOfFlowFloatBox(ref mut float_box) => {
|
BlockLevelBox::OutOfFlowFloatBox(ref mut float_box) => {
|
||||||
let size = float_box
|
let size = float_box
|
||||||
.contents
|
.contents
|
||||||
|
@ -603,6 +681,13 @@ impl BlockLevelBox {
|
||||||
positioning_context,
|
positioning_context,
|
||||||
containing_block,
|
containing_block,
|
||||||
)),
|
)),
|
||||||
|
BlockLevelBox::OutsideMarker(outside_marker) => outside_marker.layout(
|
||||||
|
layout_context,
|
||||||
|
containing_block,
|
||||||
|
positioning_context,
|
||||||
|
sequential_layout_state,
|
||||||
|
collapsible_with_parent_start_margin,
|
||||||
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,11 +55,14 @@ where
|
||||||
fn marker_string(style: &style_structs::List) -> Option<&'static str> {
|
fn marker_string(style: &style_structs::List) -> Option<&'static str> {
|
||||||
match style.list_style_type {
|
match style.list_style_type {
|
||||||
ListStyleType::None => None,
|
ListStyleType::None => None,
|
||||||
ListStyleType::Disc => Some("• "),
|
// TODO: Using non-breaking space here is a bit of a hack to give a bit of margin to outside
|
||||||
ListStyleType::Circle => Some("◦ "),
|
// markers, but really we should be setting `white-space: pre` on them instead.
|
||||||
ListStyleType::Square => Some("▪ "),
|
// See https://github.com/w3c/csswg-drafts/issues/4891.
|
||||||
ListStyleType::DisclosureOpen => Some("▾ "),
|
ListStyleType::Disc => Some("•\u{00a0}"),
|
||||||
ListStyleType::DisclosureClosed => Some("‣ "),
|
ListStyleType::Circle => Some("◦\u{00a0}"),
|
||||||
|
ListStyleType::Square => Some("▪\u{00a0}"),
|
||||||
|
ListStyleType::DisclosureOpen => Some("▾\u{00a0}"),
|
||||||
|
ListStyleType::DisclosureClosed => Some("‣\u{00a0}"),
|
||||||
ListStyleType::Decimal |
|
ListStyleType::Decimal |
|
||||||
ListStyleType::LowerAlpha |
|
ListStyleType::LowerAlpha |
|
||||||
ListStyleType::UpperAlpha |
|
ListStyleType::UpperAlpha |
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
[list-style-applies-to-012.xht]
|
||||||
|
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
||||||
|
[list-style-applies-to-014.xht]
|
||||||
|
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
||||||
|
[list-style-type-applies-to-012.xht]
|
||||||
|
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
||||||
|
[list-style-type-applies-to-014.xht]
|
||||||
|
expected: FAIL
|
|
@ -1,37 +1,22 @@
|
||||||
[align-content-block-002.html]
|
[align-content-block-002.html]
|
||||||
[.test 1: start]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[.test 2: center]
|
[.test 2: center]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[.test 3: end]
|
[.test 3: end]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[.test 4: baseline]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[.test 5: last baseline]
|
[.test 5: last baseline]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[.test 6: flex-start]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[.test 7: flex-end]
|
[.test 7: flex-end]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[.test 8: unsafe start]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[.test 9: unsafe center]
|
[.test 9: unsafe center]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[.test 10: unsafe end]
|
[.test 10: unsafe end]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[.test 11: safe start]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[.test 12: safe center]
|
[.test 12: safe center]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -41,9 +26,6 @@
|
||||||
[.test 14: space-evenly]
|
[.test 14: space-evenly]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[.test 15: space-between]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[.test 16: space-around]
|
[.test 16: space-around]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -512,18 +512,6 @@
|
||||||
[CSS Transitions with transition-behavior:allow-discrete: property <list-style-position> from [initial\] to [inside\] at (0.3) should be [initial\]]
|
[CSS Transitions with transition-behavior:allow-discrete: property <list-style-position> from [initial\] to [inside\] at (0.3) should be [initial\]]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[CSS Transitions with transition-behavior:allow-discrete: property <list-style-position> from [initial\] to [inside\] at (0.5) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions with transition-behavior:allow-discrete: property <list-style-position> from [initial\] to [inside\] at (0.6) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions with transition-behavior:allow-discrete: property <list-style-position> from [initial\] to [inside\] at (1) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions with transition-behavior:allow-discrete: property <list-style-position> from [initial\] to [inside\] at (1.5) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <list-style-position> from [initial\] to [inside\] at (-0.3) should be [initial\]]
|
[CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <list-style-position> from [initial\] to [inside\] at (-0.3) should be [initial\]]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -533,81 +521,6 @@
|
||||||
[CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <list-style-position> from [initial\] to [inside\] at (0.3) should be [initial\]]
|
[CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <list-style-position> from [initial\] to [inside\] at (0.3) should be [initial\]]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <list-style-position> from [initial\] to [inside\] at (0.5) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <list-style-position> from [initial\] to [inside\] at (0.6) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <list-style-position> from [initial\] to [inside\] at (1) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <list-style-position> from [initial\] to [inside\] at (1.5) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions: property <list-style-position> from [initial\] to [inside\] at (-0.3) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions: property <list-style-position> from [initial\] to [inside\] at (0) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions: property <list-style-position> from [initial\] to [inside\] at (0.3) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions: property <list-style-position> from [initial\] to [inside\] at (0.5) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions: property <list-style-position> from [initial\] to [inside\] at (0.6) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions: property <list-style-position> from [initial\] to [inside\] at (1) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions: property <list-style-position> from [initial\] to [inside\] at (1.5) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions with transition: all: property <list-style-position> from [initial\] to [inside\] at (-0.3) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions with transition: all: property <list-style-position> from [initial\] to [inside\] at (0) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions with transition: all: property <list-style-position> from [initial\] to [inside\] at (0.3) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions with transition: all: property <list-style-position> from [initial\] to [inside\] at (0.5) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions with transition: all: property <list-style-position> from [initial\] to [inside\] at (0.6) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions with transition: all: property <list-style-position> from [initial\] to [inside\] at (1) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Transitions with transition: all: property <list-style-position> from [initial\] to [inside\] at (1.5) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Animations: property <list-style-position> from [initial\] to [inside\] at (-0.3) should be [initial\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Animations: property <list-style-position> from [initial\] to [inside\] at (0) should be [initial\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Animations: property <list-style-position> from [initial\] to [inside\] at (0.3) should be [initial\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Animations: property <list-style-position> from [initial\] to [inside\] at (0.5) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Animations: property <list-style-position> from [initial\] to [inside\] at (0.6) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Animations: property <list-style-position> from [initial\] to [inside\] at (1) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[CSS Animations: property <list-style-position> from [initial\] to [inside\] at (1.5) should be [inside\]]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Web Animations: property <list-style-position> from [initial\] to [inside\] at (-0.3) should be [initial\]]
|
[Web Animations: property <list-style-position> from [initial\] to [inside\] at (-0.3) should be [initial\]]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,3 @@
|
||||||
|
|
||||||
[Property counter-reset does not inherit]
|
[Property counter-reset does not inherit]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Property list-style-position has initial value outside]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Property list-style-position inherits]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[list-and-block-textarea-001.html]
|
|
||||||
[list and block textarea]
|
|
||||||
expected: FAIL
|
|
|
@ -1,3 +0,0 @@
|
||||||
[list-and-writing-mode-001.html]
|
|
||||||
[list and writing-mode]
|
|
||||||
expected: FAIL
|
|
|
@ -1,6 +0,0 @@
|
||||||
[list-style-computed.sub.html]
|
|
||||||
[Property list-style value 'inside none disc']
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Property list-style value 'inside url("https://web-platform.test/") square']
|
|
||||||
expected: FAIL
|
|
|
@ -1,6 +0,0 @@
|
||||||
[list-style-position-computed.html]
|
|
||||||
[Property list-style-position value 'inside']
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Property list-style-position value 'outside']
|
|
||||||
expected: FAIL
|
|
|
@ -1,6 +0,0 @@
|
||||||
[list-style-position-valid.html]
|
|
||||||
[e.style['list-style-position'\] = "inside" should set the property value]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[e.style['list-style-position'\] = "outside" should set the property value]
|
|
||||||
expected: FAIL
|
|
|
@ -1,3 +0,0 @@
|
||||||
[list-style-shorthand.sub.html]
|
|
||||||
[e.style['list-style'\] = "square url(\\"https://web-platform.test/\\") inside" should set list-style-position]
|
|
||||||
expected: FAIL
|
|
|
@ -1,33 +0,0 @@
|
||||||
[list-style-valid.html]
|
|
||||||
[e.style['list-style'\] = "disc outside none" should set the property value]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[e.style['list-style'\] = "inside" should set the property value]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[e.style['list-style'\] = "inside disc" should set the property value]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[e.style['list-style'\] = "inside none" should set the property value]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[e.style['list-style'\] = "inside none none" should set the property value]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[e.style['list-style'\] = "none inside none" should set the property value]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[e.style['list-style'\] = "none none inside" should set the property value]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[e.style['list-style'\] = "none inside" should set the property value]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[e.style['list-style'\] = "square url(\\"https://example.com/\\") inside" should set the property value]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[e.style['list-style'\] = "square linear-gradient(red,blue) inside" should set the property value]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[e.style['list-style'\] = "disc radial-gradient(circle, #006, #00a 90%, #0000af 100%,white 100%) inside" should set the property value]
|
|
||||||
expected: FAIL
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
[position-absolute-dynamic-list-marker.html]
|
||||||
|
expected: FAIL
|
|
@ -1,2 +0,0 @@
|
||||||
[marker-text-align-001.html]
|
|
||||||
expected: FAIL
|
|
|
@ -1,2 +0,0 @@
|
||||||
[marker-text-align-002.html]
|
|
||||||
expected: FAIL
|
|
|
@ -1,2 +0,0 @@
|
||||||
[marker-text-align-003.html]
|
|
||||||
expected: FAIL
|
|
|
@ -13,18 +13,3 @@
|
||||||
|
|
||||||
[<li>Outside 1</li>]
|
[<li>Outside 1</li>]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[<li>Image Inside 2</li>]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[<li>Image Inside 1</li>]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[<li>Inside 1</li>]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[<li>Inside 2</li>]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[<li>Inside 3</li>]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -119,15 +119,6 @@
|
||||||
[empty-cells: inherit]
|
[empty-cells: inherit]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[list-style-position: inside]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[list-style-position: outside]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[list-style-position: inherit]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[table-layout: auto]
|
[table-layout: auto]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,5 @@
|
||||||
[The serialization of border: 1px; border-top: 1px !important; should be canonical.]
|
[The serialization of border: 1px; border-top: 1px !important; should be canonical.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[The serialization of list-style-type: circle; list-style-position: inside; list-style-image: none; should be canonical.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[The serialization of border-top: 1px; border-right: 1px; border-bottom: 1px; border-left: 1px; border-image: none; should be canonical.]
|
[The serialization of border-top: 1px; border-right: 1px; border-bottom: 1px; border-left: 1px; border-image: none; should be canonical.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
|
@ -5,9 +5,6 @@
|
||||||
[display: run-in]
|
[display: run-in]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[display: list-item]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[display: ruby-base]
|
[display: ruby-base]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
[line-height-in-list-item.tentative.html]
|
||||||
|
expected: FAIL
|
|
@ -1,2 +0,0 @@
|
||||||
[list_style_image_sizing_a.html]
|
|
||||||
expected: FAIL
|
|
Loading…
Add table
Add a link
Reference in a new issue