Skip to content

Truly independent web browser

LibCompositing+LibWeb: Add sticky offsets to offsetTop and offsetLeft

Andreas Klingfdd7871d15b8
diff --git a/Libraries/LibCompositing/Rust/src/visual_context/queries.rs b/Libraries/LibCompositing/Rust/src/visual_context/queries.rs
index b102689b92a..84286234160 100644
--- a/Libraries/LibCompositing/Rust/src/visual_context/queries.rs
+++ b/Libraries/LibCompositing/Rust/src/visual_context/queries.rs
@@ -552,6 +552,23 @@ impl VisualContextTree {
offset
}
+ /// The sum of the resolved offsets of the sticky nodes on the spatial chain from `index` up to the viewport, in
+ /// device pixels.
+ pub fn accumulated_sticky_offset(&self, index: SpatialNodeIndex, resolved_offsets: &[FloatPoint]) -> FloatPoint {
+ let mut offset = FloatPoint::default();
+ let mut current = index;
+ while current != VISUAL_VIEWPORT_NODE_INDEX && (current.0 as usize) < self.spatial_nodes.len() {
+ let node = &self.spatial_nodes[current.0 as usize];
+ if matches!(node.data, SpatialData::Sticky(_)) {
+ let entry = device_offset_for_index(resolved_offsets, current);
+ offset.x += entry.x;
+ offset.y += entry.y;
+ }
+ current = node.parent;
+ }
+ offset
+ }
+
/// The sticky nodes' resolved offsets as `(node, offset)` pairs in dependency order, for a
/// consumer that keeps its own copy of the scroll offsets: the compositor overlays them on the
/// snapshot it received.
diff --git a/Libraries/LibWeb/HTML/HTMLElement.cpp b/Libraries/LibWeb/HTML/HTMLElement.cpp
index 3a39b2c83fd..46fda84c8db 100644
--- a/Libraries/LibWeb/HTML/HTMLElement.cpp
+++ b/Libraries/LibWeb/HTML/HTMLElement.cpp
@@ -909,6 +909,18 @@ GC::Ptr<DOM::Element> HTMLElement::offset_parent() const
}
}
+// NB: Sticky positioning moves a box by an offset that depends on the scroll position and is resolved after layout, so
+// it is added to the box's position separately.
+static CSSPixelPoint sticky_offset_of(Layout::Node const& layout_node)
+{
+ if (!Painting::has_sticky_positioned_inclusive_ancestor(layout_node))
+ return {};
+ auto& document = const_cast<DOM::Document&>(layout_node.document());
+ document.update_paint_and_hit_testing_properties_if_needed();
+ auto visual_context_tree = document.visual_context_tree();
+ return Painting::accumulated_sticky_offset(layout_node, Painting::rect_to_viewport_transform(document, visual_context_tree));
+}
+
// https://www.w3.org/TR/cssom-view-1/#dom-htmlelement-offsettop
int HTMLElement::offset_top() const
{
@@ -925,7 +937,7 @@ int HTMLElement::offset_top() const
if (!layout_node || !Painting::has_committed_box(*layout_node))
return 0;
- CSSPixels top_border_edge_of_element = Painting::absolute_border_box_rect(*layout_node).y();
+ CSSPixels top_border_edge_of_element = Painting::absolute_border_box_rect(*layout_node).y() + sticky_offset_of(*layout_node).y();
// 2. If the offsetParent of the element is null
// return the y-coordinate of the top border edge of the first CSS layout box associated with the element,
@@ -950,7 +962,7 @@ int HTMLElement::offset_top() const
if (offset_parent->is_html_body_element() && !Painting::is_positioned(*offset_parent_layout_node)) {
top_padding_edge_of_offset_parent = 0;
} else {
- top_padding_edge_of_offset_parent = Painting::absolute_padding_box_rect(*offset_parent_layout_node).y();
+ top_padding_edge_of_offset_parent = Painting::absolute_padding_box_rect(*offset_parent_layout_node).y() + sticky_offset_of(*offset_parent_layout_node).y();
}
return (top_border_edge_of_element - top_padding_edge_of_offset_parent).to_int();
}
@@ -970,7 +982,7 @@ int HTMLElement::offset_left() const
if (!layout_node || !Painting::has_committed_box(*layout_node))
return 0;
- CSSPixels left_border_edge_of_element = Painting::absolute_border_box_rect(*layout_node).x();
+ CSSPixels left_border_edge_of_element = Painting::absolute_border_box_rect(*layout_node).x() + sticky_offset_of(*layout_node).x();
// 2. If the offsetParent of the element is null
// return the x-coordinate of the left border edge of the first CSS layout box associated with the element,
@@ -995,7 +1007,7 @@ int HTMLElement::offset_left() const
if (offset_parent->is_html_body_element() && !Painting::is_positioned(*offset_parent_layout_node)) {
left_padding_edge_of_offset_parent = 0;
} else {
- left_padding_edge_of_offset_parent = Painting::absolute_padding_box_rect(*offset_parent_layout_node).x();
+ left_padding_edge_of_offset_parent = Painting::absolute_padding_box_rect(*offset_parent_layout_node).x() + sticky_offset_of(*offset_parent_layout_node).x();
}
return (left_border_edge_of_element - left_padding_edge_of_offset_parent).to_int();
}
diff --git a/Libraries/LibWeb/Painting/BoxViews.cpp b/Libraries/LibWeb/Painting/BoxViews.cpp
index 4b744cb45c2..c0eb6fd4851 100644
--- a/Libraries/LibWeb/Painting/BoxViews.cpp
+++ b/Libraries/LibWeb/Painting/BoxViews.cpp
@@ -874,6 +874,20 @@ Vector<CSSPixelRect> client_rects(Layout::Node const& node, Layout::RustFFI::Ffi
return rects;
}
+bool has_sticky_positioned_inclusive_ancestor(Layout::Node const& node)
+{
+ return Layout::RustFFI::layout_script_has_sticky_positioned_inclusive_ancestor(node.document_host(), committed_row_slot(node));
+}
+
+CSSPixelPoint accumulated_sticky_offset(Layout::Node const& node, Layout::RustFFI::FfiRectToViewportTransform const& rect_to_viewport_transform)
+{
+ Layout::RustFFI::FfiOptionalCssPixelPoint result;
+ Layout::RustFFI::layout_script_accumulated_sticky_offset(node.document_host(), committed_row_slot(node), rect_to_viewport_transform, &result);
+ if (!result.has_value)
+ return {};
+ return { result.x, result.y };
+}
+
CSSPixelRect bounding_client_rect(Layout::Node const& node, Layout::RustFFI::FfiRectToViewportTransform const& rect_to_viewport_transform)
{
CSSPixelRect rect;
diff --git a/Libraries/LibWeb/Painting/BoxViews.h b/Libraries/LibWeb/Painting/BoxViews.h
index 768be60fbc3..2b4ee11376b 100644
--- a/Libraries/LibWeb/Painting/BoxViews.h
+++ b/Libraries/LibWeb/Painting/BoxViews.h
@@ -109,6 +109,8 @@ WEB_API Layout::RustFFI::FfiRectToViewportTransform identity_rect_to_viewport_tr
WEB_API Layout::RustFFI::FfiRectToViewportTransform rect_to_viewport_transform(DOM::Document const&, Compositing::AccumulatedVisualContextTree const&);
WEB_API Vector<CSSPixelRect> client_rects(Layout::Node const&, Layout::RustFFI::FfiRectToViewportTransform const&);
WEB_API CSSPixelRect bounding_client_rect(Layout::Node const&, Layout::RustFFI::FfiRectToViewportTransform const&);
+WEB_API bool has_sticky_positioned_inclusive_ancestor(Layout::Node const&);
+WEB_API CSSPixelPoint accumulated_sticky_offset(Layout::Node const&, Layout::RustFFI::FfiRectToViewportTransform const&);
WEB_API CSSPixelPoint cumulative_scroll_compensation(Layout::Node const&);
diff --git a/Libraries/LibWeb/Rust/src/layout/script_entries.rs b/Libraries/LibWeb/Rust/src/layout/script_entries.rs
index c15b56c3abd..4a030340e5b 100644
--- a/Libraries/LibWeb/Rust/src/layout/script_entries.rs
+++ b/Libraries/LibWeb/Rust/src/layout/script_entries.rs
@@ -12,14 +12,14 @@
use super::FfiCssPixelRect;
use super::node_data::NodeSlotId;
use super::used_values::FfiCssPixelSize;
-use crate::css::css_pixels::CssPixelRect;
+use crate::css::css_pixels::{CssPixelRect, CssPixels};
use crate::css::ffi_support::FfiUtf16View;
use crate::css::style::tree::StyleNodeID;
use crate::layout::text_queries::FfiDomTextRange;
use crate::painting::ffi::{
FfiBoxModelMetrics, FfiCaretRectResult, FfiEmptyLineCaretRect, FfiOptionalCssPixelRect, FfiRectToViewportTransform,
};
-use crate::painting::paint_read::{GeometryRead, PaintRead, PaintSource};
+use crate::painting::paint_read::{GeometryRead, PaintRead, PaintRow, PaintSource};
use crate::render_state::{DocumentHost, ScriptForcedRead};
use std::ffi::c_void;
@@ -340,6 +340,60 @@ pub extern "C" fn layout_script_paintable_absolute_padding_box_rect(
});
}
+/// Whether the box or one of its ancestors is sticky positioned, which moves the box by an offset that depends on the
+/// scroll position.
+#[unsafe(no_mangle)]
+pub extern "C" fn layout_script_has_sticky_positioned_inclusive_ancestor(
+ host: &DocumentHost,
+ slot: NodeSlotId,
+) -> bool {
+ read_rows(host, |arena| {
+ let mut node = slot;
+ while let Some(row) = arena.node(node) {
+ if let Some(style) = row.style()
+ && crate::painting::style_queries::is_sticky_position(style)
+ {
+ return true;
+ }
+ node = row.parent();
+ }
+ false
+ })
+}
+
+/// The offset by which sticky positioning moves the box, as the sum of the offsets of the sticky positioned box and
+/// its sticky positioned ancestors.
+#[unsafe(no_mangle)]
+pub extern "C" fn layout_script_accumulated_sticky_offset(
+ host: &DocumentHost,
+ slot: NodeSlotId,
+ rect_to_viewport_transform: FfiRectToViewportTransform<'_>,
+ out: &mut crate::painting::ffi::FfiOptionalCssPixelPoint,
+) {
+ *out = read_rows(host, |arena| {
+ let mut result = crate::painting::ffi::FfiOptionalCssPixelPoint {
+ has_value: false,
+ x: CssPixels::from_raw(0),
+ y: CssPixels::from_raw(0),
+ };
+ let Some(transform) = rect_to_viewport_transform.transform() else {
+ return result;
+ };
+ if !arena.paintable_row_is_populated(slot) {
+ return result;
+ }
+ let spatial = arena.paintable_data(slot).accumulated_visual_context.spatial;
+ let offset = transform
+ .visual_context_tree
+ .accumulated_sticky_offset(spatial, transform.scroll_offsets);
+ let inverse_pixel_ratio = 1.0 / transform.device_pixels_per_css_pixel;
+ result.has_value = true;
+ result.x = CssPixels::nearest_value_for_f32(offset.x * inverse_pixel_ratio);
+ result.y = CssPixels::nearest_value_for_f32(offset.y * inverse_pixel_ratio);
+ result
+ });
+}
+
#[unsafe(no_mangle)]
pub extern "C" fn layout_script_paintable_absolute_border_box_rect(
host: &DocumentHost,
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/alignment/grid-column-axis-alignment-sticky-positioned-items-002.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/alignment/grid-column-axis-alignment-sticky-positioned-items-002.txt
index 1d8c5b7d86d..eac55005405 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/alignment/grid-column-axis-alignment-sticky-positioned-items-002.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/alignment/grid-column-axis-alignment-sticky-positioned-items-002.txt
@@ -2,6 +2,6 @@ Harness status: OK
Found 2 tests
-2 Fail
-Fail .grid 1
-Fail .grid 2
\ No newline at end of file
+2 Pass
+Pass .grid 1
+Pass .grid 2
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/alignment/grid-row-axis-alignment-sticky-positioned-items-002.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/alignment/grid-row-axis-alignment-sticky-positioned-items-002.txt
index 1d8c5b7d86d..eac55005405 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/alignment/grid-row-axis-alignment-sticky-positioned-items-002.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/alignment/grid-row-axis-alignment-sticky-positioned-items-002.txt
@@ -2,6 +2,6 @@ Harness status: OK
Found 2 tests
-2 Fail
-Fail .grid 1
-Fail .grid 2
\ No newline at end of file
+2 Pass
+Pass .grid 1
+Pass .grid 2
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-bottom.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-bottom.txt
index 30ca414736f..91fbeaa7d37 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-bottom.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-bottom.txt
@@ -2,8 +2,7 @@ Harness status: OK
Found 3 tests
-1 Pass
-2 Fail
+3 Pass
Pass before reaching the sticking point the sticky box should not be offset
-Fail after reaching the sticking point the sticky box should be offset
-Fail the sticky box should not be pushed outside its containing block
\ No newline at end of file
+Pass after reaching the sticking point the sticky box should be offset
+Pass the sticky box should not be pushed outside its containing block
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-inflow-position.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-inflow-position.txt
index 31605eff3b0..8c561f43b52 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-inflow-position.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-inflow-position.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail sticky offset should not affect the position of other elements.
\ No newline at end of file
+1 Pass
+Pass sticky offset should not affect the position of other elements.
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-left.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-left.txt
index 30ca414736f..91fbeaa7d37 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-left.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-left.txt
@@ -2,8 +2,7 @@ Harness status: OK
Found 3 tests
-1 Pass
-2 Fail
+3 Pass
Pass before reaching the sticking point the sticky box should not be offset
-Fail after reaching the sticking point the sticky box should be offset
-Fail the sticky box should not be pushed outside its containing block
\ No newline at end of file
+Pass after reaching the sticking point the sticky box should be offset
+Pass the sticky box should not be pushed outside its containing block
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-margins.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-margins.txt
index eaaaede55f2..e481f5a38ae 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-margins.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-margins.txt
@@ -2,8 +2,7 @@ Harness status: OK
Found 3 tests
-1 Pass
-2 Fail
+3 Pass
Pass Before sticking, the margin should be obeyed.
-Fail Whilst stuck, the margin is irrelevant.
-Fail The margin is taken into account when making sure the sticky element does not escape its container
\ No newline at end of file
+Pass Whilst stuck, the margin is irrelevant.
+Pass The margin is taken into account when making sure the sticky element does not escape its container
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-nested-bottom.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-nested-bottom.txt
index 16501993c03..171a2121928 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-nested-bottom.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-nested-bottom.txt
@@ -2,10 +2,9 @@ Harness status: OK
Found 5 tests
-2 Pass
-3 Fail
+5 Pass
Pass before reaching the sticking point, neither sticky box should be offset
Pass the inner sticky can stick before the outer one if necessary
-Fail both sticky boxes can be stuck at the same time
-Fail neither sticky can escape their containing block
-Fail the inner sticky cannot be pushed outside the outer sticky
\ No newline at end of file
+Pass both sticky boxes can be stuck at the same time
+Pass neither sticky can escape their containing block
+Pass the inner sticky cannot be pushed outside the outer sticky
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-nested-right.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-nested-right.txt
index 16501993c03..171a2121928 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-nested-right.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-nested-right.txt
@@ -2,10 +2,9 @@ Harness status: OK
Found 5 tests
-2 Pass
-3 Fail
+5 Pass
Pass before reaching the sticking point, neither sticky box should be offset
Pass the inner sticky can stick before the outer one if necessary
-Fail both sticky boxes can be stuck at the same time
-Fail neither sticky can escape their containing block
-Fail the inner sticky cannot be pushed outside the outer sticky
\ No newline at end of file
+Pass both sticky boxes can be stuck at the same time
+Pass neither sticky can escape their containing block
+Pass the inner sticky cannot be pushed outside the outer sticky
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-offset-overflow.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-offset-overflow.txt
index b7aaabaaa8a..25cf22f4e50 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-offset-overflow.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-offset-overflow.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail sticky position offset should be contained by scrolling box
\ No newline at end of file
+1 Pass
+Pass sticky position offset should be contained by scrolling box
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-offset-top-left.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-offset-top-left.txt
index 795e99a9a06..b498ed25ec0 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-offset-top-left.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-offset-top-left.txt
@@ -2,6 +2,6 @@ Harness status: OK
Found 2 tests
-2 Fail
-Fail offsetTop/offsetLeft should be correct for sticky after script insertion
-Fail offsetTop/offsetLeft should be correct for sticky after script-caused layout
\ No newline at end of file
+2 Pass
+Pass offsetTop/offsetLeft should be correct for sticky after script insertion
+Pass offsetTop/offsetLeft should be correct for sticky after script-caused layout
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-overflow-padding.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-overflow-padding.txt
index 481422a48e1..f2d39d51e94 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-overflow-padding.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-overflow-padding.txt
@@ -2,8 +2,7 @@ Harness status: OK
Found 3 tests
-2 Pass
-1 Fail
+3 Pass
Pass A sticky element should not be affected by ancestor padding until it reaches it
Pass A sticky element should be offset by ancestor padding even when stuck
-Fail Ancestor overflow padding does not allow a sticky element to escape its container
\ No newline at end of file
+Pass Ancestor overflow padding does not allow a sticky element to escape its container
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-right.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-right.txt
index 30ca414736f..91fbeaa7d37 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-right.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-right.txt
@@ -2,8 +2,7 @@ Harness status: OK
Found 3 tests
-1 Pass
-2 Fail
+3 Pass
Pass before reaching the sticking point the sticky box should not be offset
-Fail after reaching the sticking point the sticky box should be offset
-Fail the sticky box should not be pushed outside its containing block
\ No newline at end of file
+Pass after reaching the sticking point the sticky box should be offset
+Pass the sticky box should not be pushed outside its containing block
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-root-scroller.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-root-scroller.txt
index 7de44f64a05..aa9dd0eefc7 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-root-scroller.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-root-scroller.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail Sticky elements work with the root (document) scroller
\ No newline at end of file
+1 Pass
+Pass Sticky elements work with the root (document) scroller
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-top-and-bottom.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-top-and-bottom.txt
index 18cb29eaaa7..9d7149a73dc 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-top-and-bottom.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-top-and-bottom.txt
@@ -2,6 +2,6 @@ Harness status: OK
Found 2 tests
-2 Fail
-Fail initially the sticky box should be pushed to the top of the container
-Fail when we scroll past the flow position the top constraint pushes it down
\ No newline at end of file
+2 Pass
+Pass initially the sticky box should be pushed to the top of the container
+Pass when we scroll past the flow position the top constraint pushes it down
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-top.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-top.txt
index 30ca414736f..91fbeaa7d37 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-top.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-position/sticky/position-sticky-top.txt
@@ -2,8 +2,7 @@ Harness status: OK
Found 3 tests
-1 Pass
-2 Fail
+3 Pass
Pass before reaching the sticking point the sticky box should not be offset
-Fail after reaching the sticking point the sticky box should be offset
-Fail the sticky box should not be pushed outside its containing block
\ No newline at end of file
+Pass after reaching the sticking point the sticky box should be offset
+Pass the sticky box should not be pushed outside its containing block
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/position-sticky-root-scroller-with-scroll-behavior.txt b/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/position-sticky-root-scroller-with-scroll-behavior.txt
index 7de44f64a05..aa9dd0eefc7 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/position-sticky-root-scroller-with-scroll-behavior.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/cssom-view/position-sticky-root-scroller-with-scroll-behavior.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail Sticky elements work with the root (document) scroller
\ No newline at end of file
+1 Pass
+Pass Sticky elements work with the root (document) scroller
\ No newline at end of file