Skip to content

Truly independent web browser

LibWeb: Paint column rules between the columns of a multicol container

Aliaksandr Kalenikdab8036c8a76
diff --git a/Libraries/LibWeb/Rust/src/css/computed_value_views.rs b/Libraries/LibWeb/Rust/src/css/computed_value_views.rs
index d5f323df5d2..5f3b87c0981 100644
--- a/Libraries/LibWeb/Rust/src/css/computed_value_views.rs
+++ b/Libraries/LibWeb/Rust/src/css/computed_value_views.rs
@@ -425,6 +425,9 @@ scalar_accessors! {
misc_reset: {
appearance: u8 => appearance,
column_fill: u8 => column_fill,
+ column_rule_style: u8 => column_rule_style,
+ column_rule_width: CssPixels => column_rule_width,
+ column_rule_color: u32 => column_rule_color,
break_before: u8 => break_before,
break_after: u8 => break_after,
}
diff --git a/Libraries/LibWeb/Rust/src/layout/block_formatting_context.rs b/Libraries/LibWeb/Rust/src/layout/block_formatting_context.rs
index d5d07aa7fd0..a3a11b53d59 100644
--- a/Libraries/LibWeb/Rust/src/layout/block_formatting_context.rs
+++ b/Libraries/LibWeb/Rust/src/layout/block_formatting_context.rs
@@ -2681,8 +2681,17 @@ impl<'pass> BlockFormattingContext<'pass> {
incoming = Some(outgoing);
column_index += 1;
}
- self.multicol_automatic_content_block_size
- .set(Some(column_block_size.unwrap_or(content_block_size)));
+ let row_block_size = column_block_size.unwrap_or(content_block_size);
+ root_used.rare_data_mut().multicol_layout_data = Some(std::sync::Arc::new(fragmentation::MulticolLayoutData {
+ column_inline_size: geometry.inline_size,
+ column_gap: geometry.gap,
+ rows: vec![fragmentation::ColumnRow {
+ block_offset: CssPixels::default(),
+ block_size: row_block_size,
+ column_count: column_index + 1,
+ }],
+ }));
+ self.multicol_automatic_content_block_size.set(Some(row_block_size));
}
fn column_block_size(
diff --git a/Libraries/LibWeb/Rust/src/layout/fragment_tree.rs b/Libraries/LibWeb/Rust/src/layout/fragment_tree.rs
index 946a3ea876f..d5967b5ec31 100644
--- a/Libraries/LibWeb/Rust/src/layout/fragment_tree.rs
+++ b/Libraries/LibWeb/Rust/src/layout/fragment_tree.rs
@@ -34,6 +34,7 @@ pub(crate) struct Fragment {
pub(crate) line_data: Option<std::sync::Arc<inline_content::InlineContent>>,
pub(crate) grid_layout_data: Option<std::sync::Arc<grid_formatting_context::GridLayoutData>>,
pub(crate) flex_layout_data: Option<std::sync::Arc<formatting_context::FlexLayoutData>>,
+ pub(crate) multicol_layout_data: Option<std::sync::Arc<fragmentation::MulticolLayoutData>>,
pub(crate) used_grid_tracks: Option<std::sync::Arc<grid_formatting_context::OwnedUsedGridTracks>>,
/// Boxed, as only SVG boxes have any and the facts are larger than the rest of the fragment's box.
pub(crate) svg: Option<Box<CommittedSvgFacts>>,
@@ -91,6 +92,7 @@ impl Fragment {
&& self.collapsed_table_borders.is_none()
&& self.grid_layout_data.is_none()
&& self.flex_layout_data.is_none()
+ && self.multicol_layout_data.is_none()
&& self.used_grid_tracks.is_none()
&& self.svg.is_none()
&& self.computed_svg_path.is_none()
@@ -131,6 +133,7 @@ impl Fragment {
)
&& same_allocation(self.grid_layout_data.as_ref(), previous.grid_layout_data.as_ref())
&& same_allocation(self.flex_layout_data.as_ref(), previous.flex_layout_data.as_ref())
+ && self.multicol_layout_data == previous.multicol_layout_data
&& same_allocation(self.used_grid_tracks.as_ref(), previous.used_grid_tracks.as_ref())
&& self.svg == previous.svg
&& same_allocation(self.computed_svg_path.as_ref(), previous.computed_svg_path.as_ref())
@@ -236,6 +239,7 @@ impl FragmentLink {
line_data: None,
grid_layout_data: None,
flex_layout_data: None,
+ multicol_layout_data: None,
used_grid_tracks: None,
svg: None,
computed_svg_path: None,
@@ -405,6 +409,7 @@ struct CommittedRarePayloads {
collapsed_table_borders: Option<std::sync::Arc<table_formatting_context::OwnedCollapsedTableBorders>>,
grid_layout_data: Option<std::sync::Arc<grid_formatting_context::GridLayoutData>>,
flex_layout_data: Option<std::sync::Arc<formatting_context::FlexLayoutData>>,
+ multicol_layout_data: Option<std::sync::Arc<fragmentation::MulticolLayoutData>>,
used_grid_tracks: Option<std::sync::Arc<grid_formatting_context::OwnedUsedGridTracks>>,
svg: CommittedSvgFacts,
computed_svg_path: Option<std::sync::Arc<libgfx_rust::path::OwnedPath>>,
@@ -428,6 +433,7 @@ fn snapshot_fragment(
collapsed_table_borders: rare.collapsed_table_borders.take(),
grid_layout_data: rare.grid_layout_data.take(),
flex_layout_data: rare.flex_layout_data.take(),
+ multicol_layout_data: rare.multicol_layout_data.take(),
used_grid_tracks: rare.used_grid_tracks.take(),
svg: rare.svg,
computed_svg_path: rare.computed_svg_path.take(),
@@ -439,6 +445,7 @@ fn snapshot_fragment(
collapsed_table_borders,
grid_layout_data,
flex_layout_data,
+ multicol_layout_data,
used_grid_tracks,
svg,
computed_svg_path,
@@ -470,6 +477,7 @@ fn snapshot_fragment(
line_data,
grid_layout_data,
flex_layout_data,
+ multicol_layout_data,
used_grid_tracks,
svg: (svg != CommittedSvgFacts::default()).then(|| Box::new(svg)),
computed_svg_path,
diff --git a/Libraries/LibWeb/Rust/src/layout/fragmentation.rs b/Libraries/LibWeb/Rust/src/layout/fragmentation.rs
index 2c1a2d260ec..f6efe3df54b 100644
--- a/Libraries/LibWeb/Rust/src/layout/fragmentation.rs
+++ b/Libraries/LibWeb/Rust/src/layout/fragmentation.rs
@@ -82,6 +82,20 @@ pub(crate) fn is_forced_column_break(value: u8) -> bool {
value == break_between::COLUMN
}
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+pub(crate) struct ColumnRow {
+ pub(crate) block_offset: CssPixels,
+ pub(crate) block_size: CssPixels,
+ pub(crate) column_count: usize,
+}
+
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub(crate) struct MulticolLayoutData {
+ pub(crate) column_inline_size: CssPixels,
+ pub(crate) column_gap: CssPixels,
+ pub(crate) rows: Vec<ColumnRow>,
+}
+
#[derive(Clone, Debug, PartialEq, Eq)]
pub(crate) enum BlockResume {
BeforeChild { child: Node, after_forced_break: bool },
diff --git a/Libraries/LibWeb/Rust/src/layout/used_values.rs b/Libraries/LibWeb/Rust/src/layout/used_values.rs
index fd6020860dd..c9f4cc1e290 100644
--- a/Libraries/LibWeb/Rust/src/layout/used_values.rs
+++ b/Libraries/LibWeb/Rust/src/layout/used_values.rs
@@ -244,6 +244,7 @@ pub(crate) struct UsedValuesRareData {
pub(crate) svg: CommittedSvgFacts,
pub(crate) grid_layout_data: Option<std::sync::Arc<grid_formatting_context::GridLayoutData>>,
pub(crate) flex_layout_data: Option<std::sync::Arc<formatting_context::FlexLayoutData>>,
+ pub(crate) multicol_layout_data: Option<std::sync::Arc<fragmentation::MulticolLayoutData>>,
pub(crate) used_grid_tracks: Option<std::sync::Arc<grid_formatting_context::OwnedUsedGridTracks>>,
pub(crate) collapsed_table_borders: Option<std::sync::Arc<table_formatting_context::OwnedCollapsedTableBorders>>,
pub(crate) abspos_layout_inputs: Option<abspos_inputs::AbsposLayoutInputs>,
@@ -257,6 +258,7 @@ impl UsedValuesRareData {
svg,
grid_layout_data,
flex_layout_data,
+ multicol_layout_data,
used_grid_tracks,
collapsed_table_borders,
abspos_layout_inputs,
@@ -270,6 +272,7 @@ impl UsedValuesRareData {
&& svg == CommittedSvgFacts::default()
&& grid_layout_data.is_none()
&& flex_layout_data.is_none()
+ && multicol_layout_data.is_none()
&& used_grid_tracks.is_none()
&& collapsed_table_borders.is_none()
{
@@ -289,6 +292,9 @@ impl UsedValuesRareData {
if let Some(data) = flex_layout_data {
rare.flex_layout_data = Some(data);
}
+ if let Some(data) = multicol_layout_data {
+ rare.multicol_layout_data = Some(data);
+ }
if let Some(tracks) = used_grid_tracks {
rare.used_grid_tracks = Some(tracks);
}
diff --git a/Libraries/LibWeb/Rust/src/painting/paintable_geometry.rs b/Libraries/LibWeb/Rust/src/painting/paintable_geometry.rs
index 4e7f6fef86b..858caa3a810 100644
--- a/Libraries/LibWeb/Rust/src/painting/paintable_geometry.rs
+++ b/Libraries/LibWeb/Rust/src/painting/paintable_geometry.rs
@@ -124,6 +124,15 @@ pub(crate) fn committed_grid_layout_data(
})
}
+pub(crate) fn committed_multicol_layout_data(
+ arena: &impl GeometryRead,
+ slot: NodeSlotId,
+) -> Option<std::sync::Arc<crate::layout::fragmentation::MulticolLayoutData>> {
+ arena.with_committed_fragment_link(slot, |link| {
+ link.and_then(|link| link.fragment.multicol_layout_data.clone())
+ })
+}
+
pub(crate) fn committed_flex_layout_data(
arena: &impl GeometryRead,
slot: NodeSlotId,
diff --git a/Libraries/LibWeb/Rust/src/painting/record/mod.rs b/Libraries/LibWeb/Rust/src/painting/record/mod.rs
index 0b9c0659c3f..452743285f2 100644
--- a/Libraries/LibWeb/Rust/src/painting/record/mod.rs
+++ b/Libraries/LibWeb/Rust/src/painting/record/mod.rs
@@ -137,6 +137,7 @@ pub(crate) struct BasePaintFacts {
pub paints_border_image: bool,
pub has_fixed_background: bool,
pub has_scroll_offset_dependent_background: bool,
+ pub paints_column_rules: bool,
pub paint_phase_mask: u8,
}
@@ -604,6 +605,7 @@ impl<O: Observer> PaintRecorder<'_, O> {
self.inputs.uncaptured.root_background_source,
paintable,
),
+ paints_column_rules: paint::column_rule::has_visible_column_rule(style),
paint_phase_mask: 0,
};
facts.paint_phase_mask = paint::paint_phase_mask(self, paintable, style, &facts);
diff --git a/Libraries/LibWeb/Rust/src/painting/record/paint/border.rs b/Libraries/LibWeb/Rust/src/painting/record/paint/border.rs
index 497600898f8..04737421240 100644
--- a/Libraries/LibWeb/Rust/src/painting/record/paint/border.rs
+++ b/Libraries/LibWeb/Rust/src/painting/record/paint/border.rs
@@ -32,7 +32,7 @@ pub use crate::painting::paintable_data::BorderEdge;
pub(crate) const ALL_PIECE_EDGES: u8 = PIECE_EDGE_TOP | PIECE_EDGE_RIGHT | PIECE_EDGE_BOTTOM | PIECE_EDGE_LEFT;
-fn border_side(
+pub(crate) fn border_side(
converter: &DevicePixelConverter,
present: bool,
color: u32,
diff --git a/Libraries/LibWeb/Rust/src/painting/record/paint/column_rule.rs b/Libraries/LibWeb/Rust/src/painting/record/paint/column_rule.rs
new file mode 100644
index 00000000000..132607dc43c
--- /dev/null
+++ b/Libraries/LibWeb/Rust/src/painting/record/paint/column_rule.rs
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2026-present, the Ladybird developers.
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+use crate::painting::paint_read::PaintRead;
+use crate::painting::record::trace::Observer;
+
+use crate::css::computed_value_views::ComputedValuesView;
+use crate::css::css_enums::{direction, line_style};
+use crate::css::css_pixels::{CssPixelRect, CssPixels};
+use crate::layout::node_data::NodeSlotId;
+use crate::painting::force_dark::ForceDarkRole;
+use crate::painting::paintable_geometry;
+use crate::painting::record::PaintRecorder;
+use crate::painting::record::paint::border::{BordersDataDevicePixels, border_side, paint_all_borders};
+use libgfx_rust::CornerRadii;
+
+pub(crate) fn has_visible_column_rule(style: ComputedValuesView<'_>) -> bool {
+ !matches!(style.column_rule_style(), line_style::NONE | line_style::HIDDEN)
+ && style.column_rule_width() > CssPixels::default()
+ && style.establishes_multi_column_container()
+}
+
+// https://drafts.csswg.org/css-multicol-1/#column-gaps-and-rules
+pub(crate) fn paint_column_rules<O: Observer>(recorder: &mut PaintRecorder<'_, O>, paintable: NodeSlotId) {
+ let Some(style) = recorder.source.node_style_if_live(paintable) else {
+ return;
+ };
+ let Some(data) = paintable_geometry::committed_multicol_layout_data(recorder.source, paintable) else {
+ return;
+ };
+ let content_box = paintable_geometry::absolute_rect(recorder.source, paintable);
+ let rule_width = style.column_rule_width();
+ let is_right_to_left = style.direction() == direction::RTL;
+ let converter = recorder.converter;
+ let borders_data = BordersDataDevicePixels {
+ left: border_side(
+ &converter,
+ true,
+ style.column_rule_color(),
+ match style.column_rule_style() {
+ line_style::INSET => line_style::RIDGE,
+ line_style::OUTSET => line_style::GROOVE,
+ rule_style => rule_style,
+ },
+ rule_width,
+ ),
+ force_dark_role: ForceDarkRole::Border,
+ ..BordersDataDevicePixels::default()
+ };
+ for row in &data.rows {
+ for gap_index in 0..row.column_count.saturating_sub(1) {
+ let gap_center =
+ data.column_inline_size * (gap_index + 1) + data.column_gap * gap_index + data.column_gap / 2usize;
+ let gap_center = if is_right_to_left {
+ content_box.width - gap_center
+ } else {
+ gap_center
+ };
+ let rule_rect = CssPixelRect::new(
+ content_box.x + gap_center - rule_width / 2usize,
+ content_box.y + row.block_offset,
+ rule_width,
+ row.block_size,
+ );
+ paint_all_borders(
+ &mut recorder.recorder,
+ converter.rounded_device_rect(rule_rect),
+ CornerRadii::default(),
+ &borders_data,
+ );
+ }
+ }
+}
diff --git a/Libraries/LibWeb/Rust/src/painting/record/paint/mod.rs b/Libraries/LibWeb/Rust/src/painting/record/paint/mod.rs
index 0505230e461..339f1e6e74f 100644
--- a/Libraries/LibWeb/Rust/src/painting/record/paint/mod.rs
+++ b/Libraries/LibWeb/Rust/src/painting/record/paint/mod.rs
@@ -11,6 +11,7 @@ pub mod background;
pub mod background_resolution;
pub mod border;
pub mod border_image;
+pub mod column_rule;
pub mod fieldset;
pub mod form_controls;
pub mod gradient_resolution;
@@ -66,6 +67,7 @@ pub(crate) fn paint_phase_mask<O: Observer>(
if facts.paints_border_image
|| style_queries::has_css_borders(style)
|| crate::painting::border_shape::has_border_shape(style)
+ || facts.paints_column_rules
{
phases |= PaintPhase::Border.bit();
}
@@ -227,12 +229,15 @@ pub(crate) fn paint_base_with<O: Observer>(
shadow::paint_box_shadow(recorder, paintable, border_box_rect, padding_box_rect, border_radii);
}
}
- if phase == PaintPhase::Border
- && !crate::painting::paintable_geometry::committed_uses_collapsing_borders_model(recorder.source, paintable)
- && !facts.empty_cells_property_applies
- {
+ if phase == PaintPhase::Border && !facts.empty_cells_property_applies {
let previous = set_own_background_as_contrast_backdrop(recorder, paintable);
- border::paint_box_borders_from_style(recorder, paintable, &facts);
+ if !crate::painting::paintable_geometry::committed_uses_collapsing_borders_model(recorder.source, paintable) {
+ border::paint_box_borders_from_style(recorder, paintable, &facts);
+ }
+ if facts.paints_column_rules {
+ let context = recorder.for_descendants_context(paintable);
+ recorder.with_context(context, |recorder| column_rule::paint_column_rules(recorder, paintable));
+ }
recorder.recorder.set_contrast_backdrop(previous);
}
if phase == PaintPhase::TableCollapsedBorder {
diff --git a/Libraries/LibWeb/Rust/src/painting/record/traversal.rs b/Libraries/LibWeb/Rust/src/painting/record/traversal.rs
index 36b48455eaf..f222f7280e4 100644
--- a/Libraries/LibWeb/Rust/src/painting/record/traversal.rs
+++ b/Libraries/LibWeb/Rust/src/painting/record/traversal.rs
@@ -256,7 +256,7 @@ impl<O: Observer> PaintRecorder<'_, O> {
}
}
- fn for_descendants_context(&self, paintable: NodeSlotId) -> ContextRef {
+ pub(crate) fn for_descendants_context(&self, paintable: NodeSlotId) -> ContextRef {
if let Some(walk) = &self.svg_resource_walk {
return walk.enclosing_context;
}
diff --git a/Tests/LibWeb/Ref/expected/multicol-column-rule-block-children-ref.html b/Tests/LibWeb/Ref/expected/multicol-column-rule-block-children-ref.html
new file mode 100644
index 00000000000..f3c423d46cb
--- /dev/null
+++ b/Tests/LibWeb/Ref/expected/multicol-column-rule-block-children-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<style>
+body { margin: 0; }
+.container { position: relative; width: 340px; margin-bottom: 10px; }
+.column { position: absolute; top: 0; width: 100px; height: 60px; background: blue; }
+.rule { position: absolute; top: 0; width: 0; border-left: 4px solid green; height: 60px; }
+</style>
+<div class="container" style="height: 60px">
+ <div class="column" style="left: 0"></div>
+ <div class="rule" style="left: 108px"></div>
+ <div class="column" style="left: 120px"></div>
+ <div class="rule" style="left: 228px"></div>
+ <div class="column" style="left: 240px"></div>
+</div>
+<div class="container" style="height: 30px">
+ <div class="column" style="left: 0; width: 70px; height: 30px"></div>
+ <div class="rule" style="left: 77px; height: 30px; border-left: 6px ridge rgb(0, 128, 0)"></div>
+ <div class="column" style="left: 90px; width: 70px; height: 30px"></div>
+</div>
diff --git a/Tests/LibWeb/Ref/expected/multicol-column-rule-collapsed-table-cell-ref.html b/Tests/LibWeb/Ref/expected/multicol-column-rule-collapsed-table-cell-ref.html
new file mode 100644
index 00000000000..0096be763d5
--- /dev/null
+++ b/Tests/LibWeb/Ref/expected/multicol-column-rule-collapsed-table-cell-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<style>
+ body { margin: 0; }
+ td > div { position: absolute; top: 0; height: 100px; }
+</style>
+<table style="border-collapse: collapse"><tr><td style="position: relative; width: 300px; height: 100px; padding: 0; border: 1px solid black">
+ <div style="left: 0; width: 140px; background: green"></div>
+ <div style="left: 148px; width: 4px; background: red"></div>
+ <div style="left: 160px; width: 140px; background: green"></div>
+</td></tr></table>
diff --git a/Tests/LibWeb/Ref/expected/multicol-column-rule-scrolled-ref.html b/Tests/LibWeb/Ref/expected/multicol-column-rule-scrolled-ref.html
new file mode 100644
index 00000000000..160ce3cbbd0
--- /dev/null
+++ b/Tests/LibWeb/Ref/expected/multicol-column-rule-scrolled-ref.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<style>
+ body { margin: 0; }
+ #scroller { height: 100px; width: 280px; overflow-x: scroll; scrollbar-width: none; }
+ #content { position: relative; width: 580px; height: 100px; }
+ #content > div { position: absolute; top: 0; height: 100px; }
+ .column { width: 80px; background: green; }
+ .rule { width: 4px; background: red; }
+</style>
+<div id="scroller"><div id="content">
+ <div class="column" style="left: 0"></div><div class="rule" style="left: 88px"></div>
+ <div class="column" style="left: 100px"></div><div class="rule" style="left: 188px"></div>
+ <div class="column" style="left: 200px"></div><div class="rule" style="left: 288px"></div>
+ <div class="column" style="left: 300px"></div><div class="rule" style="left: 388px"></div>
+ <div class="column" style="left: 400px"></div><div class="rule" style="left: 488px"></div>
+ <div class="column" style="left: 500px"></div>
+</div></div>
+<script>
+ requestAnimationFrame(() => {
+ document.getElementById("scroller").scrollLeft = 50;
+ requestAnimationFrame(() => document.documentElement.classList.remove("reftest-wait"));
+ });
+</script>
+</html>
diff --git a/Tests/LibWeb/Ref/input/multicol-column-rule-block-children.html b/Tests/LibWeb/Ref/input/multicol-column-rule-block-children.html
new file mode 100644
index 00000000000..a488bf67308
--- /dev/null
+++ b/Tests/LibWeb/Ref/input/multicol-column-rule-block-children.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<link rel="match" href="../expected/multicol-column-rule-block-children-ref.html">
+<style>
+body { margin: 0; }
+.multicol { columns: 3; column-gap: 20px; column-rule: 4px solid green; width: 340px; margin-bottom: 10px; }
+.multicol > div { height: 30px; background: blue; overflow: hidden; }
+</style>
+<div class="multicol">
+ <div></div><div></div><div></div><div></div><div></div><div></div>
+</div>
+<div class="multicol" style="columns: 4; column-rule: 6px inset rgb(0, 128, 0)">
+ <div></div><div></div>
+</div>
diff --git a/Tests/LibWeb/Ref/input/multicol-column-rule-collapsed-table-cell.html b/Tests/LibWeb/Ref/input/multicol-column-rule-collapsed-table-cell.html
new file mode 100644
index 00000000000..29b6a99c41e
--- /dev/null
+++ b/Tests/LibWeb/Ref/input/multicol-column-rule-collapsed-table-cell.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<link rel="match" href="../expected/multicol-column-rule-collapsed-table-cell-ref.html">
+<style>
+ body { margin: 0; }
+ td > div { height: 50px; background: green; }
+</style>
+<table style="border-collapse: collapse"><tr><td style="columns: 2; column-gap: 20px; column-rule: 4px solid red; width: 300px; padding: 0; border: 1px solid black"><div></div><div></div><div></div><div></div></td></tr></table>
diff --git a/Tests/LibWeb/Ref/input/multicol-column-rule-scrolled.html b/Tests/LibWeb/Ref/input/multicol-column-rule-scrolled.html
new file mode 100644
index 00000000000..e082d85088c
--- /dev/null
+++ b/Tests/LibWeb/Ref/input/multicol-column-rule-scrolled.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<link rel="match" href="../expected/multicol-column-rule-scrolled-ref.html">
+<style>
+ body { margin: 0; }
+ #multicol { column-width: 80px; column-gap: 20px; column-rule: 4px solid red; column-fill: auto; height: 100px; width: 280px; overflow-x: scroll; scrollbar-width: none; }
+ #multicol > div { height: 100px; background: green; }
+</style>
+<div id="multicol"><div></div><div></div><div></div><div></div><div></div><div></div></div>
+<script>
+ requestAnimationFrame(() => {
+ document.getElementById("multicol").scrollLeft = 50;
+ requestAnimationFrame(() => document.documentElement.classList.remove("reftest-wait"));
+ });
+</script>
+</html>