Truly independent web browser
LibWeb: Keep the strut of a line box on its baseline
sideshowbarkercc0a9ed80384
diff --git a/Libraries/LibWeb/Rust/src/layout/line_builder.rs b/Libraries/LibWeb/Rust/src/layout/line_builder.rsindex b564fbb691b..28f9a7089a2 100644--- a/Libraries/LibWeb/Rust/src/layout/line_builder.rs+++ b/Libraries/LibWeb/Rust/src/layout/line_builder.rs@@ -52,7 +52,6 @@ struct LineAlignment {earliest: CssPixels,latest: CssPixels,line_box_baseline: CssPixels,- should_advance_to_line_box_block_end: bool,has_line_relative_aligned_subtree: bool,aligned_subtrees: Vec<LineRelativeAlignedSubtree>,first_unshifted_text_baseline: Option<CssPixels>,@@ -1161,11 +1160,9 @@ impl<'builder, 'context> LineBuilder<'builder, 'context> {}}- /// The baseline of the line box at `line_index` from its block start, and whether the strut of the block- /// container is aligned to that baseline rather than to the block start of the line box.- fn line_box_baseline(&self, line_index: usize, has_line_relative_aligned_subtree: bool) -> (CssPixels, bool) {+ /// The baseline of the line box at `line_index` from its block start.+ fn line_box_baseline(&self, line_index: usize, has_line_relative_aligned_subtree: bool) -> CssPixels {let containing_style = self.containing_style();- let mut should_align_strut_to_line_box_baseline = false;let mut line_box_baseline = Self::baseline_for_style(containing_style, containing_style.line_height());let fragment_count = self.line(line_index).fragments.len();for fragment_index in 0..fragment_count {@@ -1202,11 +1199,6 @@ impl<'builder, 'context> LineBuilder<'builder, 'context> {continue;}let alignment_style = self.alignment_style(style_source, style);- let shifted_by_keyword = alignment_style.vertical_align_is_keyword()- && matches!(- alignment_style.vertical_align_keyword(),- vertical_align::SUPER | vertical_align::SUB- );// https://drafts.csswg.org/css2/#line-height// The line box height is the distance between the uppermost box top and the lowermost box bottom.// NB: So, the baseline of the line box is as far below its top as the box that reaches highest above it@@ -1219,38 +1211,7 @@ impl<'builder, 'context> LineBuilder<'builder, 'context> {let adjusted_baseline =self.extent_above_line_box_baseline(alignment_style, self.parent_style(style_source), metrics)- enclosing_shift;- // NB: A vertical-align length or percentage, like 'sub' and 'super', shifts the box relative to the- // baseline, which leaves the strut on the baseline, whichever box ends up setting the baseline of the- // line box. So does such a shift of an inline box around it.- if !alignment_style.vertical_align_is_keyword()- || shifted_by_keyword- || enclosing_shift != CssPixels::default()- {- should_align_strut_to_line_box_baseline = true;- }- if adjusted_baseline > line_box_baseline {- if alignment_style.vertical_align_is_keyword() && !self.facts(node).is_text_node() {- // https://drafts.csswg.org/css2/#line-height- // The minimum height consists of a minimum height above the baseline and a minimum depth below- // it, exactly as if each line box starts with a zero-width inline box with the element's font and- // line height properties.- // NB: That holds for a replaced element too, which leaves the depth of the strut below the- // baseline it sits on, except in quirks mode, where a line box with no text gets no strut:- // https://quirks.spec.whatwg.org/#the-line-height-calculation-quirk- // In a vertical line, the replaced element sits on the central baseline, so the strut fits- // within it.- let is_replaced_box_with_strut = self.facts(node).is_replaced_box()- && !self.facts(node).document_in_quirks_mode()- && containing_style.writing_mode() == writing_mode::HORIZONTAL_TB;- should_align_strut_to_line_box_baseline |= has_line_relative_aligned_subtree- || ((style.display().is_inline_block()- || is_replaced_box_with_strut- || (style.display().is_inline_outside()- && (style.display().is_flex_inside() || style.display().is_grid_inside())))- && alignment_style.vertical_align_keyword() == vertical_align::BASELINE);- }- line_box_baseline = adjusted_baseline;- }+ line_box_baseline = line_box_baseline.max(adjusted_baseline);// https://drafts.csswg.org/css2/#line-height// The inline-level boxes are aligned vertically according to their 'vertical-align' property.// NB: An inline box around the fragment holds its own layout bounds around its baseline, wherever its@@ -1259,20 +1220,14 @@ impl<'builder, 'context> LineBuilder<'builder, 'context> {let mut ancestor_shift = enclosing_shift;for (ancestor, shift) in enclosing_shifts {let ascent = TextLayoutBounds::new(self.style(ancestor), None).ascent - ancestor_shift;- if ascent > line_box_baseline {- should_align_strut_to_line_box_baseline = true;- line_box_baseline = ascent;- }+ line_box_baseline = line_box_baseline.max(ascent);ancestor_shift -= shift;}}- if let Some(marker_line) = self.outside_marker_line(line_index)- && marker_line.ascent > line_box_baseline- {- should_align_strut_to_line_box_baseline = true;- line_box_baseline = marker_line.ascent;+ if let Some(marker_line) = self.outside_marker_line(line_index) {+ line_box_baseline = line_box_baseline.max(marker_line.ascent);}- (line_box_baseline, should_align_strut_to_line_box_baseline)+ line_box_baseline}/// The outside markers whose list items have the line at `line_index` as their first line box.@@ -1490,7 +1445,6 @@ impl<'builder, 'context> LineBuilder<'builder, 'context> {earliest,latest,line_box_baseline,- mut should_advance_to_line_box_block_end,has_line_relative_aligned_subtree,mut aligned_subtrees,first_unshifted_text_baseline,@@ -1499,7 +1453,6 @@ impl<'builder, 'context> LineBuilder<'builder, 'context> {let current_block_offset = self.current_block_offset;let refitted = self.float_fit_height() > CssPixels::default();- should_advance_to_line_box_block_end |= refitted;let normal_subtree_shift = if has_line_relative_aligned_subtree || refitted {self.current_block_offset - earliest} else {@@ -1588,19 +1541,14 @@ impl<'builder, 'context> LineBuilder<'builder, 'context> {line.block_length = latest - earliest;line.block_start = current_block_offset;line.block_end = current_block_offset + line.block_length;- // The painted extent can differ from the advance used by begin_new_line.- // Retain that exact advance so a reused prefix resumes at the same position.- line.next_line_block_offset = if should_advance_to_line_box_block_end {- line.block_end- } else {- current_block_offset + self.max_block_size_on_current_line.max(containing_style.line_height())- };+ // Retain the advance used by begin_new_line, so a reused prefix resumes at the same position.+ line.next_line_block_offset = line.block_end;// Fragment block offsets include the reversed-writing-mode shim, so the alignment// baseline fallback must include it as well to share their coordinate space.line.baseline =first_unshifted_text_baseline.unwrap_or(line_box_baseline + block_offset) + normal_subtree_shift;}- self.should_advance_to_last_line_box_block_end = should_advance_to_line_box_block_end;+ self.should_advance_to_last_line_box_block_end = true;}/// Aligns the fragments of the line at `line_index` within its line box, and finds the extent of that line box.@@ -1697,18 +1645,27 @@ impl<'builder, 'context> LineBuilder<'builder, 'context> {fragment.takes_part_in_line_alignment()&& self.line_relative_aligned_subtree_root(fragment.style_source).is_some()});- let (line_box_baseline, should_align_strut_to_line_box_baseline) =- self.line_box_baseline(line_index, has_line_relative_aligned_subtree);- let mut should_advance_to_line_box_block_end = should_align_strut_to_line_box_baseline;-- let strut_start = self.current_block_offset;- let strut_end = if should_align_strut_to_line_box_baseline {- self.current_block_offset + line_box_baseline + (containing_style.line_height() - strut_baseline)+ let line_box_baseline = self.line_box_baseline(line_index, has_line_relative_aligned_subtree);++ // https://drafts.csswg.org/css2/#line-height+ // The minimum height consists of a minimum height above the baseline and a minimum depth below it, exactly as+ // if each line box starts with a zero-width inline box with the element's font and line height properties.+ // FIXME: The strut belongs on the baseline in a vertical line too, but that's the central baseline there, which+ // the layout bounds of text don't center on yet. So, it stays at the block start of the line box.+ // FIXME: In quirks mode, a line with no text gets no strut at all, but here it keeps one at its block start.+ let strut_is_on_baseline = containing_style.writing_mode() == writing_mode::HORIZONTAL_TB+ && (!self.facts(self.context().containing_block).document_in_quirks_mode()+ || self+ .line(line_index)+ .visible_fragments()+ .any(|fragment| self.facts(fragment.layout_node).is_text_node()));+ let strut_start = if strut_is_on_baseline {+ self.current_block_offset + line_box_baseline - strut_baseline} else {- self.current_block_offset + containing_style.line_height()+ self.current_block_offset};let mut earliest = strut_start;- let mut latest = strut_end;+ let mut latest = strut_start + containing_style.line_height();if let Some(marker_line) = self.outside_marker_line(line_index) {earliest = earliest.min(self.current_block_offset + line_box_baseline - marker_line.ascent);latest = latest.max(self.current_block_offset + line_box_baseline + marker_line.descent);@@ -1951,13 +1908,9 @@ impl<'builder, 'context> LineBuilder<'builder, 'context> {);if let Some((root, alignment)) = self.line_relative_aligned_subtree_root(alignment.box_) {if let Some(subtree) = aligned_subtrees.iter_mut().find(|subtree| subtree.root == root) {- should_advance_to_line_box_block_end |=- box_start < subtree.block_start || box_end > subtree.block_end;subtree.block_start = subtree.block_start.min(box_start);subtree.block_end = subtree.block_end.max(box_end);} else {- should_advance_to_line_box_block_end |= box_end - box_start- > self.max_block_size_on_current_line.max(containing_style.line_height());aligned_subtrees.push(LineRelativeAlignedSubtree {root,alignment,@@ -1967,10 +1920,6 @@ impl<'builder, 'context> LineBuilder<'builder, 'context> {});}} else {- should_advance_to_line_box_block_end |= box_start < current_block_offset- || box_end- > current_block_offset- + self.max_block_size_on_current_line.max(containing_style.line_height());earliest = earliest.min(box_start);latest = latest.max(box_end);}@@ -1996,7 +1945,6 @@ impl<'builder, 'context> LineBuilder<'builder, 'context> {earliest,latest,line_box_baseline,- should_advance_to_line_box_block_end,has_line_relative_aligned_subtree,aligned_subtrees,first_unshifted_text_baseline,diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/CSS2/linebox/vertical-align-negative-leading-001-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/CSS2/linebox/vertical-align-negative-leading-001-ref.htmlnew file mode 100644index 00000000000..2163757e492--- /dev/null+++ b/Tests/LibWeb/Ref/expected/wpt-import/css/CSS2/linebox/vertical-align-negative-leading-001-ref.html@@ -0,0 +1,34 @@+<!DOCTYPE html>+<link rel="stylesheet" type="text/css" href="../../../fonts/ahem.css" />+<style>+.container {+ margin: 30px 0;+ color: orange;+ background-color: blue;+ line-height: 10px;+ font-size: 30px;+ font-family: Ahem;+}+.lh20 { line-height: 20px; }+.lh30 { line-height: 30px; }+.up5 { position: relative; top: -5px; }+.up10 { position: relative; top: -10px; }+.down5 { position: relative; top: 5px; }+.down10 { position: relative; top: 10px; }+</style>+<body>+<div class="container">+ <span>XX</span>+ <span>XX</span>+ <span>XX</span>+</div>+<div class="container lh30">+ <span class="up10">XX</span>+ <span>XX</span>+ <span class="down10">XX</span>+</div>+<div class="container"><span>XX</span></div>+<div class="container"><span>XX</span></div>+<div class="container lh20"><span class="up5">XX</span></div>+<div class="container lh20"><span class="down5">XX</span></div>+</body>diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/CSS2/linebox/vertical-align-negative-leading-001.html b/Tests/LibWeb/Ref/input/wpt-import/css/CSS2/linebox/vertical-align-negative-leading-001.htmlnew file mode 100644index 00000000000..7f1c847c062--- /dev/null+++ b/Tests/LibWeb/Ref/input/wpt-import/css/CSS2/linebox/vertical-align-negative-leading-001.html@@ -0,0 +1,37 @@+<!DOCTYPE html>+<title>Test vertical-align: top and bottom do not affect the line height</title>+<link rel="match" href="../../../../../expected/wpt-import/css/CSS2/linebox/vertical-align-negative-leading-001-ref.html">+<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#propdef-vertical-align">+<link rel="author" href="mailto:[email protected]">+<link rel="stylesheet" type="text/css" href="../../../fonts/ahem.css" />+<style>+.container {+ margin: 30px 0;+ color: orange;+ background-color: blue;+ line-height: 10px;+ font-size: 30px;+ font-family: Ahem;+}+span { background: purple; }+.top { vertical-align: top; }+.bottom { vertical-align: bottom; }+.text-top { vertical-align: text-top; }+.text-bottom { vertical-align: text-bottom; }+</style>+<body>+<div class="container">+ <span class="top">XX</span>+ <span>XX</span>+ <span class="bottom">XX</span>+</div>+<div class="container">+ <span class="text-top">XX</span>+ <span>XX</span>+ <span class="text-bottom">XX</span>+</div>+<div class="container"><span class="top">XX</span></div>+<div class="container"><span class="bottom">XX</span></div>+<div class="container"><span class="text-top">XX</span></div>+<div class="container"><span class="text-bottom">XX</span></div>+</body>diff --git a/Tests/LibWeb/Text/expected/accessibility-node-data-names.txt b/Tests/LibWeb/Text/expected/accessibility-node-data-names.txtindex d0f9c46ffe7..09dff0fd98d 100644--- a/Tests/LibWeb/Text/expected/accessibility-node-data-names.txt+++ b/Tests/LibWeb/Text/expected/accessibility-node-data-names.txt@@ -1,5 +1,5 @@== initial-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 72x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 68x22n3 row name="cell text" bounds=10,10 68x22@@ -34,13 +34,13 @@ n0 generic bounds=8,8 784x203n32 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n33 textbox name="retargeted label" bounds=423,171 169x20 editablen34 textbox bounds=600,171 169x20 editable- n35 button name="shown sometimes" bounds=8,191 134x20- n36 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14- n37 generic bounds=65,194 68x14- n38 text leaf name="sometimes" bounds=65,194 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14+ n35 button name="shown sometimes" bounds=8,192 134x20+ n36 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n37 generic bounds=65,195 68x14+ n38 text leaf name="sometimes" bounds=65,195 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14== cell textContent-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 109x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 105x22n3 row name="new cell text" bounds=10,10 105x22@@ -75,13 +75,13 @@ n0 generic bounds=8,8 784x203n32 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n33 textbox name="retargeted label" bounds=423,171 169x20 editablen34 textbox bounds=600,171 169x20 editable- n35 button name="shown sometimes" bounds=8,191 134x20- n36 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14- n37 generic bounds=65,194 68x14- n38 text leaf name="sometimes" bounds=65,194 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14+ n35 button name="shown sometimes" bounds=8,192 134x20+ n36 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n37 generic bounds=65,195 68x14+ n38 text leaf name="sometimes" bounds=65,195 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14== cell Text.data-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 124x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 120x22n3 row name="edited cell text" bounds=10,10 120x22@@ -116,13 +116,13 @@ n0 generic bounds=8,8 784x203n32 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n33 textbox name="retargeted label" bounds=423,171 169x20 editablen34 textbox bounds=600,171 169x20 editable- n35 button name="shown sometimes" bounds=8,191 134x20- n36 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14- n37 generic bounds=65,194 68x14- n38 text leaf name="sometimes" bounds=65,194 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14+ n35 button name="shown sometimes" bounds=8,192 134x20+ n36 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n37 generic bounds=65,195 68x14+ n38 text leaf name="sometimes" bounds=65,195 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14== hidden aria-labelledby target-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 124x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 120x22n3 row name="edited cell text" bounds=10,10 120x22@@ -157,13 +157,13 @@ n0 generic bounds=8,8 784x203n32 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n33 textbox name="retargeted label" bounds=423,171 169x20 editablen34 textbox bounds=600,171 169x20 editable- n35 button name="shown sometimes" bounds=8,191 134x20- n36 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14- n37 generic bounds=65,194 68x14- n38 text leaf name="sometimes" bounds=65,194 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14+ n35 button name="shown sometimes" bounds=8,192 134x20+ n36 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n37 generic bounds=65,195 68x14+ n38 text leaf name="sometimes" bounds=65,195 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14== name from content-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 124x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 120x22n3 row name="edited cell text" bounds=10,10 120x22@@ -198,13 +198,13 @@ n0 generic bounds=8,8 784x203n32 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n33 textbox name="retargeted label" bounds=423,171 169x20 editablen34 textbox bounds=600,171 169x20 editable- n35 button name="shown sometimes" bounds=8,191 134x20- n36 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14- n37 generic bounds=65,194 68x14- n38 text leaf name="sometimes" bounds=65,194 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14+ n35 button name="shown sometimes" bounds=8,192 134x20+ n36 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n37 generic bounds=65,195 68x14+ n38 text leaf name="sometimes" bounds=65,195 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14== label text-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 124x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 120x22n3 row name="edited cell text" bounds=10,10 120x22@@ -239,13 +239,13 @@ n0 generic bounds=8,8 784x203n32 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n33 textbox name="retargeted label" bounds=423,171 169x20 editablen34 textbox bounds=600,171 169x20 editable- n35 button name="shown sometimes" bounds=8,191 134x20- n36 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14- n37 generic bounds=65,194 68x14- n38 text leaf name="sometimes" bounds=65,194 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14+ n35 button name="shown sometimes" bounds=8,192 134x20+ n36 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n37 generic bounds=65,195 68x14+ n38 text leaf name="sometimes" bounds=65,195 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14== aria-label-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 124x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 120x22n3 row name="edited cell text" bounds=10,10 120x22@@ -280,13 +280,13 @@ n0 generic bounds=8,8 784x203n32 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n33 textbox name="retargeted label" bounds=423,171 169x20 editablen34 textbox bounds=600,171 169x20 editable- n35 button name="shown sometimes" bounds=8,191 134x20- n36 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14- n37 generic bounds=65,194 68x14- n38 text leaf name="sometimes" bounds=65,194 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14+ n35 button name="shown sometimes" bounds=8,192 134x20+ n36 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n37 generic bounds=65,195 68x14+ n38 text leaf name="sometimes" bounds=65,195 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14== aria-describedby target-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 124x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 120x22n3 row name="edited cell text" bounds=10,10 120x22@@ -321,13 +321,13 @@ n0 generic bounds=8,8 784x203n32 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n33 textbox name="retargeted label" bounds=423,171 169x20 editablen34 textbox bounds=600,171 169x20 editable- n35 button name="shown sometimes" bounds=8,191 134x20- n36 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14- n37 generic bounds=65,194 68x14- n38 text leaf name="sometimes" bounds=65,194 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14+ n35 button name="shown sometimes" bounds=8,192 134x20+ n36 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n37 generic bounds=65,195 68x14+ n38 text leaf name="sometimes" bounds=65,195 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14== id appears for a pending reference-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 124x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 120x22n3 row name="edited cell text" bounds=10,10 120x22@@ -362,13 +362,13 @@ n0 generic bounds=8,8 784x203n32 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n33 textbox name="retargeted label" bounds=423,171 169x20 editablen34 textbox bounds=600,171 169x20 editable- n35 button name="shown sometimes" bounds=8,191 134x20- n36 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14- n37 generic bounds=65,194 68x14- n38 text leaf name="sometimes" bounds=65,194 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14+ n35 button name="shown sometimes" bounds=8,192 134x20+ n36 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n37 generic bounds=65,195 68x14+ n38 text leaf name="sometimes" bounds=65,195 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14== referenced id removed-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 124x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 120x22n3 row name="edited cell text" bounds=10,10 120x22@@ -401,13 +401,13 @@ n0 generic bounds=8,8 784x203n30 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n31 textbox name="retargeted label" bounds=423,171 169x20 editablen32 textbox bounds=600,171 169x20 editable- n33 button name="shown sometimes" bounds=8,191 134x20- n34 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14- n35 generic bounds=65,194 68x14- n36 text leaf name="sometimes" bounds=65,194 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14+ n33 button name="shown sometimes" bounds=8,192 134x20+ n34 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n35 generic bounds=65,195 68x14+ n36 text leaf name="sometimes" bounds=65,195 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14== generated content-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 124x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 120x22n3 row name="edited cell text" bounds=10,10 120x22@@ -440,13 +440,13 @@ n0 generic bounds=8,8 784x203n30 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n31 textbox name="retargeted label" bounds=423,171 169x20 editablen32 textbox bounds=600,171 169x20 editable- n33 button name="shown sometimes" bounds=8,191 134x20- n34 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14- n35 generic bounds=65,194 68x14- n36 text leaf name="sometimes" bounds=65,194 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14+ n33 button name="shown sometimes" bounds=8,192 134x20+ n34 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n35 generic bounds=65,195 68x14+ n36 text leaf name="sometimes" bounds=65,195 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14== embedded select value-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 124x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 120x22n3 row name="edited cell text" bounds=10,10 120x22@@ -479,13 +479,13 @@ n0 generic bounds=8,8 784x203n30 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n31 textbox name="retargeted label" bounds=423,171 169x20 editablen32 textbox bounds=600,171 169x20 editable- n33 button name="shown sometimes" bounds=8,191 134x20- n34 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14- n35 generic bounds=65,194 68x14- n36 text leaf name="sometimes" bounds=65,194 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14+ n33 button name="shown sometimes" bounds=8,192 134x20+ n34 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n35 generic bounds=65,195 68x14+ n36 text leaf name="sometimes" bounds=65,195 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14== embedded input value-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 124x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 120x22n3 row name="edited cell text" bounds=10,10 120x22@@ -518,13 +518,13 @@ n0 generic bounds=8,8 784x203n30 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n31 textbox name="retargeted label" bounds=423,171 169x20 editablen32 textbox bounds=600,171 169x20 editable- n33 button name="shown sometimes" bounds=8,191 134x20- n34 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14- n35 generic bounds=65,194 68x14- n36 text leaf name="sometimes" bounds=65,194 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14+ n33 button name="shown sometimes" bounds=8,192 134x20+ n34 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n35 generic bounds=65,195 68x14+ n36 text leaf name="sometimes" bounds=65,195 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14== value of an input in its own label-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 124x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 120x22n3 row name="edited cell text" bounds=10,10 120x22@@ -557,13 +557,13 @@ n0 generic bounds=8,8 784x203n30 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n31 textbox name="retargeted label" bounds=423,171 169x20 editablen32 textbox bounds=600,171 169x20 editable- n33 button name="shown sometimes" bounds=8,191 134x20- n34 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14- n35 generic bounds=65,194 68x14- n36 text leaf name="sometimes" bounds=65,194 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14+ n33 button name="shown sometimes" bounds=8,192 134x20+ n34 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n35 generic bounds=65,195 68x14+ n36 text leaf name="sometimes" bounds=65,195 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14== label for retargeted-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 124x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 120x22n3 row name="edited cell text" bounds=10,10 120x22@@ -596,13 +596,13 @@ n0 generic bounds=8,8 784x203n30 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n31 textbox bounds=423,171 169x20 editablen32 textbox name="retargeted label" bounds=600,171 169x20 editable- n33 button name="shown sometimes" bounds=8,191 134x20- n34 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14- n35 generic bounds=65,194 68x14- n36 text leaf name="sometimes" bounds=65,194 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14+ n33 button name="shown sometimes" bounds=8,192 134x20+ n34 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n35 generic bounds=65,195 68x14+ n36 text leaf name="sometimes" bounds=65,195 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14== labelled input id renamed-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 124x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 120x22n3 row name="edited cell text" bounds=10,10 120x22@@ -635,13 +635,13 @@ n0 generic bounds=8,8 784x203n30 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n31 textbox bounds=423,171 169x20 editablen32 textbox bounds=600,171 169x20 editable- n33 button name="shown sometimes" bounds=8,191 134x20- n34 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14- n35 generic bounds=65,194 68x14- n36 text leaf name="sometimes" bounds=65,194 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14+ n33 button name="shown sometimes" bounds=8,192 134x20+ n34 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n35 generic bounds=65,195 68x14+ n36 text leaf name="sometimes" bounds=65,195 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14== unrelated text-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 115x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 111x22n3 row name="unrelated edit" bounds=10,10 111x22@@ -674,13 +674,13 @@ n0 generic bounds=8,8 784x203n30 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n31 textbox bounds=423,171 169x20 editablen32 textbox bounds=600,171 169x20 editable- n33 button name="shown sometimes" bounds=8,191 134x20- n34 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14- n35 generic bounds=65,194 68x14- n36 text leaf name="sometimes" bounds=65,194 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14+ n33 button name="shown sometimes" bounds=8,192 134x20+ n34 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n35 generic bounds=65,195 68x14+ n36 text leaf name="sometimes" bounds=65,195 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14== visibility: hidden in a name from content-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 115x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 111x22n3 row name="unrelated edit" bounds=10,10 111x22@@ -713,11 +713,11 @@ n0 generic bounds=8,8 784x203n30 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n31 textbox bounds=423,171 169x20 editablen32 textbox bounds=600,171 169x20 editable- n33 button name="shown" bounds=8,191 134x20- n34 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n33 button name="shown" bounds=8,192 134x20+ n34 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14== visibility back-n0 generic bounds=8,8 784x203+n0 generic bounds=8,8 784x204n1 table bounds=8,8 115x26 table=1x1 column_headers=[none] row_headers=[none]n2 rowgroup bounds=10,10 111x22n3 row name="unrelated edit" bounds=10,10 111x22@@ -750,8 +750,8 @@ n0 generic bounds=8,8 784x203n30 text leaf name="retargeted label" bounds=288,172 126x16 font="SerenitySans" 16 400 normal color=#000000 characters=0,0 8,0 17,0 24,0 33,0 42,0 50,0 58,0 65,0 74,0 82,0 90,0 94,0 103,0 113,0 122,0 lines=0@16n31 textbox bounds=423,171 169x20 editablen32 textbox bounds=600,171 169x20 editable- n33 button name="shown sometimes" bounds=8,191 134x20- n34 text leaf name="shown " bounds=17,194 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14- n35 generic bounds=65,194 68x14- n36 text leaf name="sometimes" bounds=65,194 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14+ n33 button name="shown sometimes" bounds=8,192 134x20+ n34 text leaf name="shown " bounds=17,195 48x14 font="SerenitySans" 13.328125 400 normal color=#000000 background=#efefef characters=0,0 7,0 15,0 24,0 33,0 41,0 lines=0@14+ n35 generic bounds=65,195 68x14+ n36 text leaf name="sometimes" bounds=65,195 68x14 font="SerenitySans" 13.328125 400 normal color=#000000 characters=0,0 7,0 16,0 26,0 33,0 39,0 43,0 53,0 60,0 lines=0@14diff --git a/Tests/LibWeb/Text/expected/css/strut-on-line-box-baseline.txt b/Tests/LibWeb/Text/expected/css/strut-on-line-box-baseline.txtnew file mode 100644index 00000000000..df36e7dc30c--- /dev/null+++ b/Tests/LibWeb/Text/expected/css/strut-on-line-box-baseline.txt@@ -0,0 +1,9 @@+taller-font-fixed-line-height: 29 (-4)+taller-font-two-lines: 53 (-4)+taller-font-alone: 29 (-4)+much-taller-font: 38 (-20)+smaller-font: 27 (11)+number-line-height: 72 (8)+text-top-negative-leading: 20 (-10)+text-bottom-negative-leading: 20 (0)+wrapped-lines: 87 (-4, 25, 54)diff --git a/Tests/LibWeb/Text/input/css/strut-on-line-box-baseline.html b/Tests/LibWeb/Text/input/css/strut-on-line-box-baseline.htmlnew file mode 100644index 00000000000..70466850efe--- /dev/null+++ b/Tests/LibWeb/Text/input/css/strut-on-line-box-baseline.html@@ -0,0 +1,27 @@+<!DOCTYPE html>+<style>+ @font-face { font-family: Ahem; src: url("../wpt-import/fonts/Ahem.ttf"); }+ body { margin: 0; font: 16px/24px Ahem; }+ .big { font-size: 32px; }+ .case { position: relative; }+</style>+<div class="case" id="taller-font-fixed-line-height">x<span class="big">y</span></div>+<div class="case" id="taller-font-two-lines">x<span class="big">y</span><br>x</div>+<div class="case" id="taller-font-alone"><span class="big">y</span></div>+<div class="case" id="much-taller-font">x<span style="font-size: 64px">y</span></div>+<div class="case" id="smaller-font">x<span style="font-size: 8px">y</span></div>+<div class="case" id="number-line-height" style="line-height: 1.5">x<span class="big">y</span><br>x</div>+<div class="case" id="text-top-negative-leading" style="font-size: 30px; line-height: 10px"><span style="vertical-align: text-top">XX</span></div>+<div class="case" id="text-bottom-negative-leading" style="font-size: 30px; line-height: 10px"><span style="vertical-align: text-bottom">XX</span></div>+<div class="case" id="wrapped-lines" style="width: 40px">x<span class="big">y</span> x<span class="big">y</span> x<span class="big">y</span></div>+<script src="../include.js"></script>+<script>+ promiseTest(async () => {+ await document.fonts.ready;+ for (const element of document.querySelectorAll(".case")) {+ const rect = element.getBoundingClientRect();+ const offsets = [...element.querySelectorAll("span")].map(span => span.getBoundingClientRect().top - rect.top);+ println(`${element.id}: ${rect.height} (${offsets.join(", ")})`);+ }+ });+</script>