Skip to content

armgit / moli

Public Imported from GitHub
0

Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust

Keep scroll test targets below every viewport

kevin0d918070416d
diff --git a/moli-protocol/src/domains/dom/tests/geometry.rs b/moli-protocol/src/domains/dom/tests/geometry.rs
index 741da97ad..732b19517 100644
--- a/moli-protocol/src/domains/dom/tests/geometry.rs
+++ b/moli-protocol/src/domains/dom/tests/geometry.rs
@@ -1388,9 +1388,9 @@ async fn scroll_into_view_if_needed_accepts_element_node() {
let mut ctx = TestContext::new();
load_bc(&mut ctx, "BID-A");
- let rows = "<div>row</div>".repeat(60);
+ let spacer = "<div style='height:200vh'></div>";
let url = format!(
- "data:text/html,<!doctype html><html><body>{rows}<div id='box'></div></body></html>"
+ "data:text/html,<!doctype html><html><body>{spacer}<div id='box'></div></body></html>"
);
navigate_to_url_and_wait_for_load_async(&mut ctx, 1, url).await;
@@ -1542,9 +1542,9 @@ async fn scroll_into_view_if_needed_supports_object_id() {
let mut ctx = TestContext::new();
load_bc(&mut ctx, "BID-A");
- let rows = "<div>row</div>".repeat(60);
+ let spacer = "<div style='height:200vh'></div>";
let url = format!(
- "data:text/html,<!doctype html><html><body>{rows}<div id='box'></div></body></html>"
+ "data:text/html,<!doctype html><html><body>{spacer}<div id='box'></div></body></html>"
);
navigate_to_url_and_wait_for_load_async(&mut ctx, 1, url).await;
@@ -1591,9 +1591,9 @@ async fn scroll_into_view_if_needed_supports_object_id() {
async fn scroll_into_view_if_needed_uses_first_rendered_child_of_display_contents() {
let mut ctx = TestContext::new();
load_bc(&mut ctx, "BID-A");
- let rows = "<div>row</div>".repeat(60);
+ let spacer = "<div style='height:200vh'></div>";
let url = format!(
- "data:text/html,<!doctype html><body>{rows}<button id=contents style='display:contents'>target</button></body>"
+ "data:text/html,<!doctype html><body>{spacer}<button id=contents style='display:contents'>target</button></body>"
);
navigate_to_url_and_wait_for_load_async(&mut ctx, 30, url).await;