From 69af0cf3b72ccceed7fed639431ba04cd0be5a9b Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Wed, 23 Aug 2023 11:47:06 +0200 Subject: [PATCH] Flow inlines around floats This implements the rest of the bulk of float support. Now inline element flow around floats and floats can be pushed down by inline elements before them. Co-authored-by: Oriol Brufau --- components/layout_2020/flow/float.rs | 2 +- components/layout_2020/flow/inline.rs | 496 ++++++++++++++---- components/layout_2020/geom.rs | 19 +- components/layout_2020/lib.rs | 1 + components/layout_2020/style_ext.rs | 11 + .../css/CSS2/css1/c414-flt-wrap-001.xht.ini | 2 - .../css/CSS2/css1/c5525-fltblck-000.xht.ini | 2 - .../css/CSS2/css1/c5525-fltinln-000.xht.ini | 2 - .../css/CSS2/css1/c5525-fltmrgn-000.xht.ini | 2 - .../css/CSS2/css1/c5525-fltwidth-001.xht.ini | 2 - .../css/CSS2/css1/c5526-fltclr-000.xht.ini | 2 - ...float-nested-forced-clearance-003.html.ini | 2 - .../floats-clear/clear-applies-to-012.xht.ini | 2 - .../floats-clear/clear-inline-001.xht.ini | 2 - .../css/CSS2/floats-clear/floats-029.xht.ini | 2 - .../css/CSS2/floats-clear/floats-030.xht.ini | 2 - .../css/CSS2/floats-clear/floats-031.xht.ini | 2 - .../css/CSS2/floats-clear/floats-036.xht.ini | 2 - .../css/CSS2/floats-clear/floats-040.xht.ini | 2 - .../css/CSS2/floats-clear/floats-114.xht.ini | 2 - .../css/CSS2/floats-clear/floats-122.xht.ini | 2 - .../css/CSS2/floats-clear/floats-132.xht.ini | 2 - .../css/CSS2/floats-clear/floats-133.xht.ini | 2 - .../css/CSS2/floats-clear/floats-134.xht.ini | 2 - .../css/CSS2/floats-clear/floats-136.xht.ini | 2 - .../css/CSS2/floats-clear/floats-139.xht.ini | 2 - .../float-no-content-beside-001.html.ini | 2 - .../css/CSS2/floats/float-nowrap-5.html.ini | 2 - .../css/CSS2/floats/float-nowrap-6.html.ini | 2 - .../CSS2/floats/floats-placement-004.html.ini | 2 - .../CSS2/floats/floats-placement-007.html.ini | 2 - .../floats-placement-vertical-003.xht.ini | 2 - .../floats-placement-vertical-004-ref.xht.ini | 2 - ...floats-placement-vertical-004-ref2.xht.ini | 2 - .../floats-placement-vertical-004.xht.ini | 2 - .../floats-wrap-bfc-002-left-table.xht.ini | 2 - .../floats-wrap-top-below-bfc-001l.xht.ini | 2 - .../floats-wrap-top-below-bfc-001r.xht.ini | 2 - .../floats-wrap-top-below-bfc-002l.xht.ini | 2 - .../floats-wrap-top-below-bfc-003l.xht.ini | 2 - .../floats-wrap-top-below-inline-001l.xht.ini | 2 - .../floats-wrap-top-below-inline-001r.xht.ini | 2 - .../floats-wrap-top-below-inline-002l.xht.ini | 2 - .../floats-wrap-top-below-inline-002r.xht.ini | 2 - .../floats-wrap-top-below-inline-003l.xht.ini | 2 - .../floats-wrap-top-below-inline-003r.xht.ini | 2 - .../floats-zero-height-wrap-001.xht.ini | 2 - .../CSS2/floats/hit-test-floats-001.html.ini | 3 - .../inline-replaced-width-012.xht.ini | 2 - .../inline-replaced-width-013.xht.ini | 2 - .../inline-replaced-width-015.xht.ini | 2 - .../css/CSS2/normal-flow/inlines-013.xht.ini | 2 - .../positioning/positioning-float-001.xht.ini | 2 - .../css/CSS2/text/text-indent-013.xht.ini | 2 - ...-indent-wrap-001-ref-inline-margin.xht.ini | 2 - .../line-breaking/line-breaking-012.html.ini | 2 - .../line-breaking/line-breaking-017.html.ini | 2 - .../line-breaking-replaced-004.html.ini | 2 - .../css/block_formatting_context_a.html.ini | 2 - ...lock_formatting_context_complex_a.html.ini | 2 - ...ock_formatting_context_relative_a.html.ini | 2 - .../mozilla/meta/css/content_color.html.ini | 2 - .../meta/css/floats_inline_margins_a.html.ini | 2 - .../css/floats_percentage_width_a.html.ini | 2 - 64 files changed, 432 insertions(+), 216 deletions(-) delete mode 100644 tests/wpt/meta/css/CSS2/css1/c414-flt-wrap-001.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/css1/c5525-fltblck-000.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/css1/c5525-fltinln-000.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/css1/c5525-fltmrgn-000.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/css1/c5525-fltwidth-001.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/css1/c5526-fltclr-000.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats-clear/adjoining-float-nested-forced-clearance-003.html.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats-clear/clear-applies-to-012.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats-clear/clear-inline-001.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats-clear/floats-029.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats-clear/floats-030.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats-clear/floats-031.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats-clear/floats-036.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats-clear/floats-040.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats-clear/floats-114.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats-clear/floats-122.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats-clear/floats-132.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats-clear/floats-133.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats-clear/floats-134.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats-clear/floats-136.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats-clear/floats-139.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/float-no-content-beside-001.html.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/float-nowrap-5.html.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/float-nowrap-6.html.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/floats-placement-004.html.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/floats-placement-007.html.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/floats-placement-vertical-003.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/floats-placement-vertical-004-ref.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/floats-placement-vertical-004-ref2.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/floats-placement-vertical-004.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/floats-wrap-bfc-002-left-table.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-bfc-001l.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-bfc-001r.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-bfc-002l.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-bfc-003l.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-001l.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-001r.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-002l.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-002r.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-003l.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-003r.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/floats-zero-height-wrap-001.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/floats/hit-test-floats-001.html.ini delete mode 100644 tests/wpt/meta/css/CSS2/normal-flow/inline-replaced-width-012.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/normal-flow/inline-replaced-width-013.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/normal-flow/inline-replaced-width-015.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/normal-flow/inlines-013.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/positioning/positioning-float-001.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/text/text-indent-013.xht.ini delete mode 100644 tests/wpt/meta/css/CSS2/text/text-indent-wrap-001-ref-inline-margin.xht.ini delete mode 100644 tests/wpt/meta/css/css-text/line-breaking/line-breaking-012.html.ini delete mode 100644 tests/wpt/meta/css/css-text/line-breaking/line-breaking-017.html.ini delete mode 100644 tests/wpt/meta/css/css-text/line-breaking/line-breaking-replaced-004.html.ini delete mode 100644 tests/wpt/mozilla/meta/css/block_formatting_context_a.html.ini delete mode 100644 tests/wpt/mozilla/meta/css/block_formatting_context_complex_a.html.ini delete mode 100644 tests/wpt/mozilla/meta/css/block_formatting_context_relative_a.html.ini delete mode 100644 tests/wpt/mozilla/meta/css/content_color.html.ini delete mode 100644 tests/wpt/mozilla/meta/css/floats_inline_margins_a.html.ini delete mode 100644 tests/wpt/mozilla/meta/css/floats_percentage_width_a.html.ini diff --git a/components/layout_2020/flow/float.rs b/components/layout_2020/flow/float.rs index 461b8a322ed48..f0230f2ac4084 100644 --- a/components/layout_2020/flow/float.rs +++ b/components/layout_2020/flow/float.rs @@ -307,7 +307,7 @@ impl FloatContext { pub fn new(max_inline_size: Length) -> Self { let mut bands = FloatBandTree::new(); bands = bands.insert(FloatBand { - top: Length::zero(), + top: Length::new(-f32::INFINITY), left: None, right: None, }); diff --git a/components/layout_2020/flow/inline.rs b/components/layout_2020/flow/inline.rs index e4c3c43e5f647..0ac7a9717dec4 100644 --- a/components/layout_2020/flow/inline.rs +++ b/components/layout_2020/flow/inline.rs @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +use super::float::PlacementAmongFloats; +use super::CollapsibleWithParentStartMargin; use crate::cell::ArcRefCell; use crate::context::LayoutContext; use crate::flow::float::{FloatBox, SequentialLayoutState}; @@ -26,6 +28,7 @@ use atomic_refcell::AtomicRef; use gfx::text::glyph::GlyphStore; use gfx::text::text_run::GlyphRun; use servo_arc::Arc; +use std::cell::OnceCell; use style::computed_values::white_space::T as WhiteSpace; use style::logical_geometry::WritingMode; use style::properties::ComputedValues; @@ -37,7 +40,6 @@ use style::Zero; use webrender_api::FontInstanceKey; use xi_unicode::LineBreakLeafIter; -use super::CollapsibleWithParentStartMargin; #[derive(Debug, Serialize)] pub(crate) struct InlineFormattingContext { pub(super) inline_level_boxes: Vec>, @@ -110,6 +112,73 @@ struct PartialInlineBoxFragment<'box_tree> { parent_nesting_level: InlineNestingLevelState<'box_tree>, } +/// Information about the current line under construction for a particular +/// [`InlineFormattingContextState`]. This tracks position and size information while +/// [`LineItem`]s are collected and is used as input when those [`LineItem`]s are +/// converted into [`Fragment`]s during the final phase of line layout. Note that this +/// does not store the [`LineItem`]s themselves, as they are stored as part of the +/// nesting state in the [`InlineFormattingContextState`]. +struct LineUnderConstruction { + /// The position of where this line will start once it is laid out. This includes any + /// offset from `text-indent`. + start_position: Vec2, + + /// The current inline position in the line being laid out into [`LineItems`] in this + /// [`InlineFormattingContext`] independent of the depth in the nesting level. + inline_position: Length, + + /// If the current line ends with whitespace, this tracks the advance width of that + /// whitespace. This is used to find the "real" width of a line if trailing whitespace + /// is trimmed from the end. + trailing_whitespace_advance: Length, + + /// The currently calculated block size of this line, taking into account all inline + /// content already laid out into [`LineItem`]s. Later, content may increase the block + /// size. + block_size: Length, + + /// Whether any active linebox has added a glyph, border, margin, or padding + /// to this line, which indicates that the next run that exceeds the line length + /// can cause a line break. + has_content: bool, + + /// Whether or not there are floats that did not fit on the current line. Before + /// the [`LineItems`] of this line are laid out, these floats will need to be + /// placed directly below this line, but still as children of this line's Fragments. + has_floats_waiting_to_be_placed: bool, + + /// A position of this line (relative to the containing block / inline formatting + /// context boundaries) so that would flow around floats. Note that when this is not + /// none, it takes precedence over [`LineUnderConstruction::start_position`]. + float_placement: OnceCell>, +} + +impl LineUnderConstruction { + fn new(start_position: Vec2) -> Self { + Self { + inline_position: start_position.inline.clone(), + trailing_whitespace_advance: Length::zero(), + start_position: start_position, + block_size: Length::zero(), + has_content: false, + has_floats_waiting_to_be_placed: false, + float_placement: OnceCell::new(), + } + } + + fn line_block_start_considering_float_placement(&self) -> Length { + match self.float_placement.get() { + Some(float_placement) => float_placement.start_corner.block, + None => self.start_position.block, + } + } + + fn replace_float_placement(&mut self, new_placement: Rect) { + self.float_placement.take(); + let _ = self.float_placement.set(new_placement); + } +} + struct InlineFormattingContextState<'box_tree, 'a, 'b> { positioning_context: &'a mut PositioningContext, containing_block: &'b ContainingBlock<'b>, @@ -120,17 +189,9 @@ struct InlineFormattingContextState<'box_tree, 'a, 'b> { /// are currently laid out at the top-level of each [`InlineFormattingContext`]. fragments: Vec, - /// The position of where the next line will start. - current_line_start_position: Vec2, - - /// The current inline position in the line being laid out into [`LineItems`] in this - /// [`InlineFormattingContext`] independent of the depth in the nesting level. - current_inline_position: Length, - - /// Whether any active line box has added a glyph, border, margin, or padding - /// to this line, which indicates that the next run that exceeds the line length - /// can cause a line break. - line_had_any_content: bool, + /// Information about the line currently being laid out into [`LineItems`]s. The + /// [`LineItem`]s themselves are stored in the nesting state. + current_line: LineUnderConstruction, /// The line breaking state for this inline formatting context. linebreaker: Option, @@ -142,10 +203,19 @@ struct InlineFormattingContextState<'box_tree, 'a, 'b> { impl<'box_tree, 'a, 'b> InlineFormattingContextState<'box_tree, 'a, 'b> { /// Push a completed [LineItem] to the current nesteding level of this /// [InlineFormattingContext]. - fn push_line_item(&mut self, inline_size: Length, line_item: LineItem) { + fn push_line_item( + &mut self, + inline_size: Length, + line_item: LineItem, + last_whitespace_advance: Length, + ) { + self.current_line.has_content = true; + self.current_line.inline_position += inline_size; + self.current_line.trailing_whitespace_advance = last_whitespace_advance; + self.current_line + .block_size + .max_assign(line_item.block_size()); self.current_nesting_level.line_items_so_far.push(line_item); - self.line_had_any_content = true; - self.current_inline_position += inline_size; } /// Finish layout of all the partial inline boxes in the current line, @@ -155,7 +225,7 @@ impl<'box_tree, 'a, 'b> InlineFormattingContextState<'box_tree, 'a, 'b> { for partial in self.partial_inline_boxes_stack.iter_mut().rev() { partial.finish_layout( nesting_level, - &mut self.current_inline_position, + &mut self.current_line.inline_position, false, /* at_end_of_inline_element */ ); nesting_level = &mut partial.parent_nesting_level; @@ -163,9 +233,6 @@ impl<'box_tree, 'a, 'b> InlineFormattingContextState<'box_tree, 'a, 'b> { let line_items = std::mem::take(&mut nesting_level.line_items_so_far); self.finish_current_line(layout_context, line_items, self.containing_block); - - self.current_inline_position = Length::zero(); - self.line_had_any_content = false; } fn finish_current_line( @@ -174,6 +241,24 @@ impl<'box_tree, 'a, 'b> InlineFormattingContextState<'box_tree, 'a, 'b> { mut line_items: Vec, containing_block: &ContainingBlock, ) { + // If the placement due to floats, moved the line start position down, we need to + // make sure to advance the sequential layout state by that extra advance due to + // float placement. + let extra_advance_due_to_floats = self + .current_line + .float_placement + .get() + .map(|placement| placement.start_corner.block - self.current_line.start_position.block) + .unwrap_or_else(Length::zero); + if let Some(sequential_layout_state) = self.sequential_layout_state.as_mut() { + sequential_layout_state + .advance_block_position(self.current_line.block_size + extra_advance_due_to_floats); + } + + if self.current_line.has_floats_waiting_to_be_placed { + place_pending_floats(self, &mut line_items); + } + // From : // > 3. A sequence of collapsible spaces at the end of a line is removed, // > as well as any trailing U+1680   OGHAM SPACE MARK whose white-space @@ -187,13 +272,17 @@ impl<'box_tree, 'a, 'b> InlineFormattingContextState<'box_tree, 'a, 'b> { let inline_start_position = self.calculate_inline_start_for_current_line(containing_block, whitespace_trimmed); + let block_start_position = self + .current_line + .line_block_start_considering_float_placement(); + let mut state = LineItemLayoutState { inline_position: inline_start_position, max_block_size: Length::zero(), inline_start_of_parent: Length::zero(), ifc_containing_block: containing_block, positioning_context: &mut self.positioning_context, - line_block_start: self.current_line_start_position.block, + line_block_start: block_start_position, }; let positioning_context_length = state.positioning_context.len(); @@ -209,17 +298,9 @@ impl<'box_tree, 'a, 'b> InlineFormattingContextState<'box_tree, 'a, 'b> { // we do not need to include it in the `start_corner` of the line's main Fragment. let start_corner = Vec2 { inline: Length::zero(), - block: self.current_line_start_position.block, - }; - self.current_line_start_position = Vec2 { - inline: Length::zero(), - block: self.current_line_start_position.block + size.block, + block: block_start_position, }; - if let Some(sequential_layout_state) = self.sequential_layout_state.as_mut() { - sequential_layout_state.advance_block_position(size.block); - } - let line_had_content = !fragments.is_empty() || state.positioning_context.len() != positioning_context_length; if line_had_content { @@ -237,6 +318,11 @@ impl<'box_tree, 'a, 'b> InlineFormattingContextState<'box_tree, 'a, 'b> { containing_block.style.writing_mode, ))); } + + self.current_line = LineUnderConstruction::new(Vec2 { + inline: Length::zero(), + block: block_start_position + self.current_line.block_size, + }); } /// Given the amount of whitespace trimmed from the line and taking into consideration @@ -286,22 +372,146 @@ impl<'box_tree, 'a, 'b> InlineFormattingContextState<'box_tree, 'a, 'b> { }, }; + let (line_start, line_end) = match self.current_line.float_placement.get() { + Some(float_placement) => ( + float_placement.start_corner.inline, + float_placement.max_inline_position(), + ), + None => (Length::zero(), self.containing_block.inline_size), + }; + let space_after_floats = line_end - line_start; + // Properly handling text-indent requires that we do not align the text // into the text-indent. // See // "This property specifies the indentation applied to lines of inline content in // a block. The indent is treated as a margin applied to the start edge of the // line box." - let text_indent = self.current_line_start_position.inline; - let line_length = self.current_inline_position - whitespace_trimmed - text_indent; - match text_align { - TextAlign::Start => text_indent, - TextAlign::End => (containing_block.inline_size - line_length).max(text_indent), - TextAlign::Center => { - let available_space = containing_block.inline_size - text_indent; - ((available_space - line_length) / 2.) + text_indent - }, + let text_indent = self.current_line.start_position.inline; + let line_length = self.current_line.inline_position - whitespace_trimmed - text_indent; + line_start + + match text_align { + TextAlign::Start => text_indent, + TextAlign::End => (space_after_floats - line_length).max(text_indent), + TextAlign::Center => { + let available_space = containing_block.inline_size - text_indent; + ((available_space - line_length) / 2.) + text_indent + }, + } + } + + fn place_float_fragment(&mut self, fragment: &mut BoxFragment) { + let state = self + .sequential_layout_state + .as_mut() + .expect("Tried to lay out a float with no sequential placement state!"); + + let block_offset_from_containining_block_top = state + .current_block_position_including_margins() - + state.current_containing_block_offset(); + state.place_float_fragment( + fragment, + CollapsedMargin::zero(), + block_offset_from_containining_block_top, + ); + } + + /// Given a new potential line size for the current line, create a "placement" for that line. + /// This tells us whether or not the new potential line will fit in the current block position + /// or need to be moved. In addition, the placement rect determinse the inline start and end + /// of the line if it's used as the final placement among floats. + fn place_line_among_floats(&self, potential_line_size: &Vec2) -> Rect { + let sequential_layout_state = self + .sequential_layout_state + .as_ref() + .expect("Should not have called this function without having floats."); + + let ifc_offset_in_float_container = Vec2 { + inline: sequential_layout_state + .floats + .containing_block_info + .inline_start, + block: sequential_layout_state + .floats + .containing_block_info + .block_start + + sequential_layout_state + .floats + .containing_block_info + .block_start_margins_not_collapsed + .solve(), + }; + + let ceiling = self + .current_line + .line_block_start_considering_float_placement(); + let mut placement = PlacementAmongFloats::new( + &sequential_layout_state.floats, + ceiling + ifc_offset_in_float_container.block, + potential_line_size.clone(), + &PaddingBorderMargin::zero(), + ); + + let mut placement_rect = placement.place(); + placement_rect.start_corner = &placement_rect.start_corner - &ifc_offset_in_float_container; + placement_rect + } + + /// Returns true if a new potential line size for the current line would require a line + /// break. This takes into account floats and will also update the "placement among + /// floats" for this line if the potential line size would not cause a line break. + /// Thus, calling this method has side effects and should only be done while in the + /// process of laying out line content that is always going to be committed to this + /// line or the next. + fn new_potential_line_size_causes_line_break( + &mut self, + potential_line_size: &Vec2, + ) -> bool { + // If this is the first content on the line and we already have a float placement, + // that means that the placement was initialized by a leading float in the IFC. + // This placement needs to be updated, because the first line content might push + // the block start of the line downward. + if !self.current_line.has_content && self.sequential_layout_state.is_some() { + let new_placement = self.place_line_among_floats(potential_line_size); + self.current_line.replace_float_placement(new_placement); + } + + if potential_line_size.inline > self.containing_block.inline_size { + return true; + } + + // If we already have a placement among floats for this line and the new potential + // line size, causes a change in the block position, then we will need a line + // break. This block of code also takes the opportunity to update the placement + // among floats in the case that line does fit at the same block position (because + // its inline start may change). + let old_placement = self.current_line.float_placement.get().cloned(); + if let Some(old_placement) = old_placement { + if potential_line_size.block > old_placement.size.block { + let new_placement = self.place_line_among_floats(potential_line_size); + if new_placement.start_corner.block != old_placement.start_corner.block { + return true; + } else { + self.current_line.replace_float_placement(new_placement); + return false; + } + } } + + // Otherwise the new potential line size will require a newline if it fits in the + // inline space available for this line. This space may be smaller than the + // containing block if floats shrink the available inline space. + let available_inline_space = if self.sequential_layout_state.is_some() { + let float_placement = self + .current_line + .float_placement + .get_or_init(|| self.place_line_among_floats(potential_line_size)); + float_placement.max_inline_position() - float_placement.start_corner.inline + } else { + self.containing_block.inline_size + }; + + potential_line_size.inline > available_inline_space } } @@ -481,12 +691,10 @@ impl InlineFormattingContext { containing_block, sequential_layout_state, fragments: Vec::new(), - current_line_start_position: Vec2 { + current_line: LineUnderConstruction::new(Vec2 { inline: first_line_inline_start, block: Length::zero(), - }, - current_inline_position: first_line_inline_start, - line_had_any_content: false, + }), linebreaker: None, partial_inline_boxes_stack: Vec::new(), current_nesting_level: InlineNestingLevelState { @@ -499,8 +707,10 @@ impl InlineFormattingContext { // FIXME(pcwalton): This assumes that margins never collapse through inline formatting // contexts (i.e. that inline formatting contexts are never empty). Is that right? + // FIXME(mrobinson): This should not happen if the IFC collapses through. if let Some(ref mut sequential_layout_state) = ifc.sequential_layout_state { sequential_layout_state.collapse_margins(); + // FIXME(mrobinson): Collapse margins in the containing block offsets as well?? } loop { @@ -533,7 +743,7 @@ impl InlineFormattingContext { // start working on the parent nesting level again. partial.finish_layout( &mut ifc.current_nesting_level, - &mut ifc.current_inline_position, + &mut ifc.current_line.inline_position, true, /* at_end_of_inline_element */ ); ifc.current_nesting_level = partial.parent_nesting_level @@ -547,7 +757,7 @@ impl InlineFormattingContext { ifc.finish_current_line(layout_context, line_items, containing_block); let mut collapsible_margins_in_children = CollapsedBlockMargins::zero(); - let content_block_size = ifc.current_line_start_position.block; + let content_block_size = ifc.current_line.start_position.block; collapsible_margins_in_children.collapsed_through = content_block_size == Length::zero() && collapsible_with_parent_start_margin.0; @@ -592,7 +802,7 @@ impl<'box_tree> PartialInlineBoxFragment<'box_tree> { let mut pbm = style.padding_border_margin(&ifc.containing_block); if inline_box.first_fragment { - ifc.current_inline_position += pbm.padding.inline_start + + ifc.current_line.inline_position += pbm.padding.inline_start + pbm.border.inline_start + pbm.margin.inline_start.auto_is(Length::zero) } else { @@ -786,15 +996,18 @@ impl IndependentFormattingContext { }, }; - if fragment.content_rect.size.inline + pbm_sums.inline_sum() > - ifc.containing_block.inline_size - ifc.current_inline_position && - ifc.current_nesting_level.white_space.allow_wrap() && - ifc.current_nesting_level.line_items_so_far.len() != 0 - { + let size = &pbm_sums.sum() + &fragment.content_rect.size; + let new_potential_line_size = Vec2 { + inline: ifc.current_line.inline_position + size.inline, + block: ifc.current_line.block_size.max(size.block), + }; + + let can_break = ifc.current_nesting_level.white_space.allow_wrap() && + ifc.current_nesting_level.line_items_so_far.len() != 0; + if ifc.new_potential_line_size_causes_line_break(&new_potential_line_size) && can_break { ifc.finish_line_and_reset(layout_context); } - let size = &pbm_sums.sum() + &fragment.content_rect.size; ifc.push_line_item( size.inline, LineItem::Atomic(AtomicLineItem { @@ -802,6 +1015,7 @@ impl IndependentFormattingContext { size, positioning_context: child_positioning_context, }), + Length::zero(), ); // After every atomic, we need to create a line breaking opportunity for the next TextRun. @@ -903,6 +1117,7 @@ impl TextRun { break_at_start, } = self.break_and_shape(layout_context, &mut ifc.linebreaker); + let white_space = self.parent_style.get_inherited_text().white_space; let add_glyphs_to_current_line = |ifc: &mut InlineFormattingContextState, glyphs: Vec>, @@ -912,6 +1127,13 @@ impl TextRun { return; } + let mut last_whitespace_width = Length::zero(); + if let Some(last_glyph) = glyphs.last() { + if !white_space.preserve_spaces() && last_glyph.is_whitespace() { + last_whitespace_width = Length::from(last_glyph.total_advance()); + } + } + ifc.push_line_item( inline_advance, LineItem::TextRun(TextRunLineItem { @@ -922,12 +1144,20 @@ impl TextRun { font_key, text_decoration_line: ifc.current_nesting_level.text_decoration_line, }), + last_whitespace_width, ); }; - let white_space = self.parent_style.get_inherited_text().white_space; + let font_size = self.parent_style.get_font().font_size.size.0; + let line_height = match self.parent_style.get_inherited_text().line_height { + LineHeight::Normal => font_metrics.line_gap, + LineHeight::Number(n) => font_size * n.0, + LineHeight::Length(l) => l.0, + }; + let new_max_height_of_line = ifc.current_line.block_size.max(line_height); + let mut glyphs = vec![]; - let mut inline_advance = Length::zero(); + let mut advance_from_text_run = Length::zero(); let mut iterator = runs.iter().enumerate(); while let Some((run_index, run)) = iterator.next() { // If this whitespace forces a line break, finish the line and reset everything. @@ -940,30 +1170,39 @@ impl TextRun { add_glyphs_to_current_line( ifc, glyphs.drain(..).collect(), - inline_advance, + advance_from_text_run, true, ); ifc.finish_line_and_reset(layout_context); - inline_advance = Length::zero(); + advance_from_text_run = Length::zero(); continue; } } - // We break the line if this new advance and any advances from pending - // whitespace bring us past the inline end of the containing block. - let new_advance = Length::from(run.glyph_store.total_advance()); - let will_advance_past_containing_block = - (new_advance + inline_advance + ifc.current_inline_position) > - ifc.containing_block.inline_size; + let new_advance_from_glyph_run = Length::from(run.glyph_store.total_advance()); + let new_total_advance = new_advance_from_glyph_run + + advance_from_text_run + + ifc.current_line.inline_position; + + let new_potential_line_size = Vec2 { + inline: new_total_advance, + block: new_max_height_of_line, + }; // We can only break the line, if this isn't the first actual content (non-whitespace or // preserved whitespace) on the line and this isn't the unbreakable run of this text run // (or we can break at the start according to the text breaker). - let can_break = ifc.line_had_any_content && (break_at_start || run_index != 0); - if will_advance_past_containing_block && can_break { - add_glyphs_to_current_line(ifc, glyphs.drain(..).collect(), inline_advance, false); + let can_break = ifc.current_line.has_content && (break_at_start || run_index != 0); + if ifc.new_potential_line_size_causes_line_break(&new_potential_line_size) && can_break + { + add_glyphs_to_current_line( + ifc, + glyphs.drain(..).collect(), + advance_from_text_run, + true, + ); ifc.finish_line_and_reset(layout_context); - inline_advance = Length::zero(); + advance_from_text_run = Length::zero(); } // From : @@ -978,17 +1217,25 @@ impl TextRun { // width. if run.glyph_store.is_whitespace() && !white_space.preserve_spaces() && - !ifc.line_had_any_content + !ifc.current_line.has_content { continue; } - inline_advance += Length::from(run.glyph_store.total_advance()); + // FLOATS: This should initialize a lazily-instantianted float placement establishing the + // inline start, the available inline size, and the block start position. + // place_object(width of the unbreakable unit + any text indent, block height -- later inherited) + advance_from_text_run += Length::from(run.glyph_store.total_advance()); glyphs.push(run.glyph_store.clone()); - ifc.line_had_any_content = true; + ifc.current_line.has_content = true; } - add_glyphs_to_current_line(ifc, glyphs.drain(..).collect(), inline_advance, false); + add_glyphs_to_current_line( + ifc, + glyphs.drain(..).collect(), + advance_from_text_run, + false, + ); } } @@ -998,28 +1245,57 @@ impl FloatBox { layout_context: &LayoutContext, ifc: &mut InlineFormattingContextState, ) { - let mut box_fragment = self.layout( + let mut fragment = self.layout( layout_context, ifc.positioning_context, ifc.containing_block, ); - let state = ifc - .sequential_layout_state - .as_mut() - .expect("Tried to lay out a float with no sequential placement state!"); + let margin_box = fragment.border_rect().inflate(&fragment.margin); + let inline_size = margin_box.size.inline.max(Length::zero()); + + let available_inline_size = match ifc.current_line.float_placement.get() { + Some(float_placement) => { + float_placement.max_inline_position() - float_placement.start_corner.inline + }, + None => ifc.containing_block.inline_size, + }; + + // If this float doesn't fit on the current line or a previous float didn't fit on + // the current line, we need to place it starting at the next line BUT still as + // children of this line's hierarchy of inline boxes (for the purposes of properly + // parenting in their stacking contexts). Once all the line content is gathered we + // will place them later. + let fits_on_line = !ifc.current_line.has_content || + inline_size <= + available_inline_size - + (ifc.current_line.inline_position - + ifc.current_line.trailing_whitespace_advance); + let needs_placement_later = + ifc.current_line.has_floats_waiting_to_be_placed || !fits_on_line; + + if needs_placement_later { + ifc.current_line.has_floats_waiting_to_be_placed = true; + } else { + ifc.place_float_fragment(&mut fragment); + + // We've added a new float to the IFC, but this may have actually changed the + // position of the current line. In order to determine that we regenerate the + // float placement for the current line, which may adjust its inline start + // position. + let new_placement = ifc.place_line_among_floats(&Vec2 { + inline: ifc.current_line.inline_position, + block: ifc.current_line.block_size, + }); + ifc.current_line.replace_float_placement(new_placement); + } - let block_offset_from_containining_block_top = state - .current_block_position_including_margins() - - state.current_containing_block_offset(); - state.place_float_fragment( - &mut box_fragment, - CollapsedMargin::zero(), - block_offset_from_containining_block_top, - ); ifc.current_nesting_level .line_items_so_far - .push(LineItem::Float(FloatLineItem { box_fragment })); + .push(LineItem::Float(FloatLineItem { + fragment, + needs_placement: needs_placement_later, + })); } } @@ -1123,6 +1399,22 @@ fn layout_line_items( fragments } +fn place_pending_floats(ifc: &mut InlineFormattingContextState, line_items: &mut Vec) { + for item in line_items.into_iter() { + match item { + LineItem::InlineBox(box_line_item) => { + place_pending_floats(ifc, &mut box_line_item.children); + }, + LineItem::Float(float_line_item) => { + if float_line_item.needs_placement { + ifc.place_float_fragment(&mut float_line_item.fragment); + } + }, + _ => {}, + } + } +} + enum LineItem { TextRun(TextRunLineItem), InlineBox(InlineBoxLineItem), @@ -1148,6 +1440,19 @@ impl LineItem { LineItem::Float(_) => true, } } + + fn block_size(&self) -> Length { + match self { + LineItem::TextRun(text_run) => text_run.line_height(), + LineItem::InlineBox(_) => { + // TODO(mrobinson): This should get the line height from the font. + Length::zero() + }, + LineItem::Atomic(atomic) => atomic.size.block, + LineItem::AbsolutelyPositioned(_) => Length::zero(), + LineItem::Float(_) => Length::zero(), + } + } } struct TextRunLineItem { @@ -1188,14 +1493,17 @@ impl TextRunLineItem { index_of_last_non_whitespace.is_none() } - fn layout(self, state: &mut LineItemLayoutState) -> Option { + fn line_height(&self) -> Length { let font_size = self.parent_style.get_font().font_size.size.0; - let line_height = match self.parent_style.get_inherited_text().line_height { + match self.parent_style.get_inherited_text().line_height { LineHeight::Normal => self.font_metrics.line_gap, LineHeight::Number(n) => font_size * n.0, LineHeight::Length(l) => l.0, - }; - state.max_block_size.max_assign(line_height); + } + } + + fn layout(self, state: &mut LineItemLayoutState) -> Option { + state.max_block_size.max_assign(self.line_height()); // This happens after updating the `max_block_size`, because even trimmed newlines // should affect the height of the line. @@ -1214,7 +1522,7 @@ impl TextRunLineItem { inline: state.inline_position - state.inline_start_of_parent, }, size: Vec2 { - block: line_height, + block: self.line_height(), inline: inline_advance, }, }; @@ -1412,7 +1720,11 @@ impl AbsolutelyPositionedLineItem { } struct FloatLineItem { - box_fragment: BoxFragment, + fragment: BoxFragment, + /// Whether or not this float Fragment has been placed yet. Fragments that + /// do not fit on a line need to be placed after the hypothetical block start + /// of the next line. + needs_placement: bool, } impl FloatLineItem { @@ -1426,8 +1738,8 @@ impl FloatLineItem { inline: state.inline_start_of_parent, block: state.line_block_start, }; - self.box_fragment.content_rect.start_corner = - &self.box_fragment.content_rect.start_corner - &distance_from_parent_to_ifc; - self.box_fragment + self.fragment.content_rect.start_corner = + &self.fragment.content_rect.start_corner - &distance_from_parent_to_ifc; + self.fragment } } diff --git a/components/layout_2020/geom.rs b/components/layout_2020/geom.rs index 85a2d95637d54..83a1c5ea9258d 100644 --- a/components/layout_2020/geom.rs +++ b/components/layout_2020/geom.rs @@ -105,11 +105,11 @@ where } } -impl flow_relative::Vec2 { +impl flow_relative::Vec2 { pub fn zero() -> Self { Self { - inline: Length::zero(), - block: Length::zero(), + inline: T::zero(), + block: T::zero(), } } } @@ -155,7 +155,7 @@ impl flow_relative::Vec2> { } } -impl flow_relative::Rect { +impl flow_relative::Rect { pub fn zero() -> Self { Self { start_corner: flow_relative::Vec2::zero(), @@ -346,6 +346,17 @@ where } } +impl flow_relative::Sides { + pub(crate) fn zero() -> flow_relative::Sides { + flow_relative::Sides { + inline_start: T::zero(), + inline_end: T::zero(), + block_start: T::zero(), + block_end: T::zero(), + } + } +} + impl flow_relative::Rect { pub fn max_inline_position(&self) -> T where diff --git a/components/layout_2020/lib.rs b/components/layout_2020/lib.rs index 91f4bf5ffc949..ca23f264c1409 100644 --- a/components/layout_2020/lib.rs +++ b/components/layout_2020/lib.rs @@ -3,6 +3,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #![deny(unsafe_code)] +#![feature(once_cell)] #[macro_use] extern crate log; diff --git a/components/layout_2020/style_ext.rs b/components/layout_2020/style_ext.rs index 8d8740bb961ea..ce4e510edf1d1 100644 --- a/components/layout_2020/style_ext.rs +++ b/components/layout_2020/style_ext.rs @@ -65,6 +65,17 @@ pub(crate) struct PaddingBorderMargin { pub padding_border_sums: flow_relative::Vec2, } +impl PaddingBorderMargin { + pub(crate) fn zero() -> Self { + Self { + padding: flow_relative::Sides::zero(), + border: flow_relative::Sides::zero(), + margin: flow_relative::Sides::zero(), + padding_border_sums: flow_relative::Vec2::zero(), + } + } +} + pub(crate) trait ComputedValuesExt { fn inline_size_is_length(&self) -> bool; fn inline_box_offsets_are_both_non_auto(&self) -> bool; diff --git a/tests/wpt/meta/css/CSS2/css1/c414-flt-wrap-001.xht.ini b/tests/wpt/meta/css/CSS2/css1/c414-flt-wrap-001.xht.ini deleted file mode 100644 index b07643272b671..0000000000000 --- a/tests/wpt/meta/css/CSS2/css1/c414-flt-wrap-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[c414-flt-wrap-001.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/css1/c5525-fltblck-000.xht.ini b/tests/wpt/meta/css/CSS2/css1/c5525-fltblck-000.xht.ini deleted file mode 100644 index d5d1bb1b40dfe..0000000000000 --- a/tests/wpt/meta/css/CSS2/css1/c5525-fltblck-000.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[c5525-fltblck-000.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/css1/c5525-fltinln-000.xht.ini b/tests/wpt/meta/css/CSS2/css1/c5525-fltinln-000.xht.ini deleted file mode 100644 index fba614e1130a0..0000000000000 --- a/tests/wpt/meta/css/CSS2/css1/c5525-fltinln-000.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[c5525-fltinln-000.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/css1/c5525-fltmrgn-000.xht.ini b/tests/wpt/meta/css/CSS2/css1/c5525-fltmrgn-000.xht.ini deleted file mode 100644 index 2db7d1d525ae1..0000000000000 --- a/tests/wpt/meta/css/CSS2/css1/c5525-fltmrgn-000.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[c5525-fltmrgn-000.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/css1/c5525-fltwidth-001.xht.ini b/tests/wpt/meta/css/CSS2/css1/c5525-fltwidth-001.xht.ini deleted file mode 100644 index 87f64e42a644e..0000000000000 --- a/tests/wpt/meta/css/CSS2/css1/c5525-fltwidth-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[c5525-fltwidth-001.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/css1/c5526-fltclr-000.xht.ini b/tests/wpt/meta/css/CSS2/css1/c5526-fltclr-000.xht.ini deleted file mode 100644 index 01c767b7cdd49..0000000000000 --- a/tests/wpt/meta/css/CSS2/css1/c5526-fltclr-000.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[c5526-fltclr-000.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats-clear/adjoining-float-nested-forced-clearance-003.html.ini b/tests/wpt/meta/css/CSS2/floats-clear/adjoining-float-nested-forced-clearance-003.html.ini deleted file mode 100644 index dd1850d1ac7d1..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/adjoining-float-nested-forced-clearance-003.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[adjoining-float-nested-forced-clearance-003.html] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats-clear/clear-applies-to-012.xht.ini b/tests/wpt/meta/css/CSS2/floats-clear/clear-applies-to-012.xht.ini deleted file mode 100644 index f3dac3a898f98..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/clear-applies-to-012.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-applies-to-012.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats-clear/clear-inline-001.xht.ini b/tests/wpt/meta/css/CSS2/floats-clear/clear-inline-001.xht.ini deleted file mode 100644 index 512d6157d5765..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/clear-inline-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[clear-inline-001.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats-clear/floats-029.xht.ini b/tests/wpt/meta/css/CSS2/floats-clear/floats-029.xht.ini deleted file mode 100644 index 9504f87030e31..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/floats-029.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-029.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats-clear/floats-030.xht.ini b/tests/wpt/meta/css/CSS2/floats-clear/floats-030.xht.ini deleted file mode 100644 index cbf0e7984457b..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/floats-030.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-030.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats-clear/floats-031.xht.ini b/tests/wpt/meta/css/CSS2/floats-clear/floats-031.xht.ini deleted file mode 100644 index 5e99ba0d928d0..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/floats-031.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-031.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats-clear/floats-036.xht.ini b/tests/wpt/meta/css/CSS2/floats-clear/floats-036.xht.ini deleted file mode 100644 index 19883af9da0d4..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/floats-036.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-036.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats-clear/floats-040.xht.ini b/tests/wpt/meta/css/CSS2/floats-clear/floats-040.xht.ini deleted file mode 100644 index 1ec5e6a0d6757..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/floats-040.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-040.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats-clear/floats-114.xht.ini b/tests/wpt/meta/css/CSS2/floats-clear/floats-114.xht.ini deleted file mode 100644 index da73e8b2f7c33..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/floats-114.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-114.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats-clear/floats-122.xht.ini b/tests/wpt/meta/css/CSS2/floats-clear/floats-122.xht.ini deleted file mode 100644 index 734b7f158e094..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/floats-122.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-122.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats-clear/floats-132.xht.ini b/tests/wpt/meta/css/CSS2/floats-clear/floats-132.xht.ini deleted file mode 100644 index 981a921e1e3b2..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/floats-132.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-132.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats-clear/floats-133.xht.ini b/tests/wpt/meta/css/CSS2/floats-clear/floats-133.xht.ini deleted file mode 100644 index 5cbc1af2f7438..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/floats-133.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-133.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats-clear/floats-134.xht.ini b/tests/wpt/meta/css/CSS2/floats-clear/floats-134.xht.ini deleted file mode 100644 index b20ed58b203ef..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/floats-134.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-134.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats-clear/floats-136.xht.ini b/tests/wpt/meta/css/CSS2/floats-clear/floats-136.xht.ini deleted file mode 100644 index d86de2628af01..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/floats-136.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-136.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats-clear/floats-139.xht.ini b/tests/wpt/meta/css/CSS2/floats-clear/floats-139.xht.ini deleted file mode 100644 index 326d5e0545f14..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats-clear/floats-139.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-139.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/float-no-content-beside-001.html.ini b/tests/wpt/meta/css/CSS2/floats/float-no-content-beside-001.html.ini deleted file mode 100644 index 7b131324ecabd..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/float-no-content-beside-001.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-no-content-beside-001.html] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/float-nowrap-5.html.ini b/tests/wpt/meta/css/CSS2/floats/float-nowrap-5.html.ini deleted file mode 100644 index 1fee92769c9fc..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/float-nowrap-5.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-nowrap-5.html] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/float-nowrap-6.html.ini b/tests/wpt/meta/css/CSS2/floats/float-nowrap-6.html.ini deleted file mode 100644 index 7b863cf49e64e..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/float-nowrap-6.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[float-nowrap-6.html] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/floats-placement-004.html.ini b/tests/wpt/meta/css/CSS2/floats/floats-placement-004.html.ini deleted file mode 100644 index a7de7bbf70758..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-placement-004.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-placement-004.html] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/floats-placement-007.html.ini b/tests/wpt/meta/css/CSS2/floats/floats-placement-007.html.ini deleted file mode 100644 index b22e125306efb..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-placement-007.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-placement-007.html] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/floats-placement-vertical-003.xht.ini b/tests/wpt/meta/css/CSS2/floats/floats-placement-vertical-003.xht.ini deleted file mode 100644 index 6b7cb570a8a4e..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-placement-vertical-003.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-placement-vertical-003.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/floats-placement-vertical-004-ref.xht.ini b/tests/wpt/meta/css/CSS2/floats/floats-placement-vertical-004-ref.xht.ini deleted file mode 100644 index ba5aaad0e2744..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-placement-vertical-004-ref.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-placement-vertical-004-ref.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/floats-placement-vertical-004-ref2.xht.ini b/tests/wpt/meta/css/CSS2/floats/floats-placement-vertical-004-ref2.xht.ini deleted file mode 100644 index a8de1d74f67cd..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-placement-vertical-004-ref2.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-placement-vertical-004-ref2.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/floats-placement-vertical-004.xht.ini b/tests/wpt/meta/css/CSS2/floats/floats-placement-vertical-004.xht.ini deleted file mode 100644 index 6036454a24aeb..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-placement-vertical-004.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-placement-vertical-004.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/floats-wrap-bfc-002-left-table.xht.ini b/tests/wpt/meta/css/CSS2/floats/floats-wrap-bfc-002-left-table.xht.ini deleted file mode 100644 index 771cfb41ba9a0..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-wrap-bfc-002-left-table.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-wrap-bfc-002-left-table.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-bfc-001l.xht.ini b/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-bfc-001l.xht.ini deleted file mode 100644 index 910179d39ef3f..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-bfc-001l.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-wrap-top-below-bfc-001l.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-bfc-001r.xht.ini b/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-bfc-001r.xht.ini deleted file mode 100644 index 342d39e4fdf87..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-bfc-001r.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-wrap-top-below-bfc-001r.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-bfc-002l.xht.ini b/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-bfc-002l.xht.ini deleted file mode 100644 index 0945576347171..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-bfc-002l.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-wrap-top-below-bfc-002l.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-bfc-003l.xht.ini b/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-bfc-003l.xht.ini deleted file mode 100644 index e89f60e6c3b6d..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-bfc-003l.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-wrap-top-below-bfc-003l.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-001l.xht.ini b/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-001l.xht.ini deleted file mode 100644 index b4ab9ddd38fc0..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-001l.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-wrap-top-below-inline-001l.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-001r.xht.ini b/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-001r.xht.ini deleted file mode 100644 index 97f7fc78be1d5..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-001r.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-wrap-top-below-inline-001r.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-002l.xht.ini b/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-002l.xht.ini deleted file mode 100644 index be450797a78fc..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-002l.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-wrap-top-below-inline-002l.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-002r.xht.ini b/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-002r.xht.ini deleted file mode 100644 index 0c8f507eef45b..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-002r.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-wrap-top-below-inline-002r.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-003l.xht.ini b/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-003l.xht.ini deleted file mode 100644 index cd2871f4a7b7b..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-003l.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-wrap-top-below-inline-003l.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-003r.xht.ini b/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-003r.xht.ini deleted file mode 100644 index 9a3a66294539c..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-wrap-top-below-inline-003r.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-wrap-top-below-inline-003r.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/floats-zero-height-wrap-001.xht.ini b/tests/wpt/meta/css/CSS2/floats/floats-zero-height-wrap-001.xht.ini deleted file mode 100644 index a995fbe1b2490..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/floats-zero-height-wrap-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats-zero-height-wrap-001.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/floats/hit-test-floats-001.html.ini b/tests/wpt/meta/css/CSS2/floats/hit-test-floats-001.html.ini deleted file mode 100644 index 0842d0b57273d..0000000000000 --- a/tests/wpt/meta/css/CSS2/floats/hit-test-floats-001.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[hit-test-floats-001.html] - [hit-test-floats-001] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/normal-flow/inline-replaced-width-012.xht.ini b/tests/wpt/meta/css/CSS2/normal-flow/inline-replaced-width-012.xht.ini deleted file mode 100644 index bf3a285e8a41a..0000000000000 --- a/tests/wpt/meta/css/CSS2/normal-flow/inline-replaced-width-012.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[inline-replaced-width-012.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/normal-flow/inline-replaced-width-013.xht.ini b/tests/wpt/meta/css/CSS2/normal-flow/inline-replaced-width-013.xht.ini deleted file mode 100644 index 143954342f599..0000000000000 --- a/tests/wpt/meta/css/CSS2/normal-flow/inline-replaced-width-013.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[inline-replaced-width-013.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/normal-flow/inline-replaced-width-015.xht.ini b/tests/wpt/meta/css/CSS2/normal-flow/inline-replaced-width-015.xht.ini deleted file mode 100644 index 68033d62a6f95..0000000000000 --- a/tests/wpt/meta/css/CSS2/normal-flow/inline-replaced-width-015.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[inline-replaced-width-015.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/normal-flow/inlines-013.xht.ini b/tests/wpt/meta/css/CSS2/normal-flow/inlines-013.xht.ini deleted file mode 100644 index 1476c082aa7f1..0000000000000 --- a/tests/wpt/meta/css/CSS2/normal-flow/inlines-013.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[inlines-013.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/positioning/positioning-float-001.xht.ini b/tests/wpt/meta/css/CSS2/positioning/positioning-float-001.xht.ini deleted file mode 100644 index 02db7dbcb243d..0000000000000 --- a/tests/wpt/meta/css/CSS2/positioning/positioning-float-001.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[positioning-float-001.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/text/text-indent-013.xht.ini b/tests/wpt/meta/css/CSS2/text/text-indent-013.xht.ini deleted file mode 100644 index 651a5fef1833a..0000000000000 --- a/tests/wpt/meta/css/CSS2/text/text-indent-013.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[text-indent-013.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/CSS2/text/text-indent-wrap-001-ref-inline-margin.xht.ini b/tests/wpt/meta/css/CSS2/text/text-indent-wrap-001-ref-inline-margin.xht.ini deleted file mode 100644 index b04e7da3c52e8..0000000000000 --- a/tests/wpt/meta/css/CSS2/text/text-indent-wrap-001-ref-inline-margin.xht.ini +++ /dev/null @@ -1,2 +0,0 @@ -[text-indent-wrap-001-ref-inline-margin.xht] - expected: FAIL diff --git a/tests/wpt/meta/css/css-text/line-breaking/line-breaking-012.html.ini b/tests/wpt/meta/css/css-text/line-breaking/line-breaking-012.html.ini deleted file mode 100644 index 6fd167de2a7b3..0000000000000 --- a/tests/wpt/meta/css/css-text/line-breaking/line-breaking-012.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[line-breaking-012.html] - expected: FAIL diff --git a/tests/wpt/meta/css/css-text/line-breaking/line-breaking-017.html.ini b/tests/wpt/meta/css/css-text/line-breaking/line-breaking-017.html.ini deleted file mode 100644 index 84ea268e264a1..0000000000000 --- a/tests/wpt/meta/css/css-text/line-breaking/line-breaking-017.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[line-breaking-017.html] - expected: FAIL diff --git a/tests/wpt/meta/css/css-text/line-breaking/line-breaking-replaced-004.html.ini b/tests/wpt/meta/css/css-text/line-breaking/line-breaking-replaced-004.html.ini deleted file mode 100644 index 1ac0d8e8d9e84..0000000000000 --- a/tests/wpt/meta/css/css-text/line-breaking/line-breaking-replaced-004.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[line-breaking-replaced-004.html] - expected: FAIL diff --git a/tests/wpt/mozilla/meta/css/block_formatting_context_a.html.ini b/tests/wpt/mozilla/meta/css/block_formatting_context_a.html.ini deleted file mode 100644 index 766e4b3cd9d28..0000000000000 --- a/tests/wpt/mozilla/meta/css/block_formatting_context_a.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[block_formatting_context_a.html] - expected: FAIL diff --git a/tests/wpt/mozilla/meta/css/block_formatting_context_complex_a.html.ini b/tests/wpt/mozilla/meta/css/block_formatting_context_complex_a.html.ini deleted file mode 100644 index 5498e467c6ef0..0000000000000 --- a/tests/wpt/mozilla/meta/css/block_formatting_context_complex_a.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[block_formatting_context_complex_a.html] - expected: FAIL diff --git a/tests/wpt/mozilla/meta/css/block_formatting_context_relative_a.html.ini b/tests/wpt/mozilla/meta/css/block_formatting_context_relative_a.html.ini deleted file mode 100644 index 27d6a36d72edd..0000000000000 --- a/tests/wpt/mozilla/meta/css/block_formatting_context_relative_a.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[block_formatting_context_relative_a.html] - expected: FAIL diff --git a/tests/wpt/mozilla/meta/css/content_color.html.ini b/tests/wpt/mozilla/meta/css/content_color.html.ini deleted file mode 100644 index be83973c5a35a..0000000000000 --- a/tests/wpt/mozilla/meta/css/content_color.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[content_color.html] - expected: FAIL diff --git a/tests/wpt/mozilla/meta/css/floats_inline_margins_a.html.ini b/tests/wpt/mozilla/meta/css/floats_inline_margins_a.html.ini deleted file mode 100644 index 5c981aa640f72..0000000000000 --- a/tests/wpt/mozilla/meta/css/floats_inline_margins_a.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats_inline_margins_a.html] - expected: FAIL diff --git a/tests/wpt/mozilla/meta/css/floats_percentage_width_a.html.ini b/tests/wpt/mozilla/meta/css/floats_percentage_width_a.html.ini deleted file mode 100644 index 9822997db62ae..0000000000000 --- a/tests/wpt/mozilla/meta/css/floats_percentage_width_a.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[floats_percentage_width_a.html] - expected: FAIL