From ffdb7d366381f353e15717b9d327da76276935c3 Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Thu, 25 Sep 2025 13:16:41 +0200 Subject: [PATCH] script: Chain up keyboard scrolling to parent ` + + + + + + + + + + + +
+ Lorem ipsum dolor sit amet, +
+ + diff --git a/tests/wpt/mozilla/tests/css/keyboard-scrolling.html b/tests/wpt/mozilla/tests/mozilla/keyboard-scrolling.html similarity index 80% rename from tests/wpt/mozilla/tests/css/keyboard-scrolling.html rename to tests/wpt/mozilla/tests/mozilla/keyboard-scrolling.html index 2d9a0c40272..45916c5d11f 100644 --- a/tests/wpt/mozilla/tests/css/keyboard-scrolling.html +++ b/tests/wpt/mozilla/tests/mozilla/keyboard-scrolling.html @@ -1,6 +1,6 @@ -CSS test: Calc expressions with numbers should still serialize as calc() +A test to verify that keyboard scrolling works properly in Servo. @@ -36,15 +36,8 @@
Lorem ipsum dolor sit amet,
- - - -
+
Lorem ipsum dolor sit amet,
@@ -66,13 +59,9 @@ const pageSize = scrollportHeight => scrollportHeight - 2 * lineSize; const pressKeyAndAssert = async (key, element, [expectedX, expectedY], description) => { await test_driver.send_keys(document.body, key); const actualX = - element == null ? scrollX - : element.nodeName == "IFRAME" ? element.contentWindow.scrollX - : element.scrollLeft; + element == null ? scrollX : element.scrollLeft; const actualY = - element == null ? scrollY - : element.nodeName == "IFRAME" ? element.contentWindow.scrollY - : element.scrollTop; + element == null ? scrollY : element.scrollTop; assert_array_equals([actualX, actualY], [expectedX, expectedY], description); }; @@ -156,27 +145,6 @@ promise_test(async () => { await pressKeyAndAssert(home, null, [0, 0], "Home key scrolls viewport to top"); }, "Keyboard scrolling chains past inactive overflow:scroll DIVs"); -promise_test(async () => { - await test_driver.click(iframe); - - await pressKeyAndAssert(end, iframe, [0, iframe.contentDocument.documentElement.scrollHeight - iframe.contentWindow.innerHeight], "End key scrolls #iframe to bottom"); - await pressKeyAndAssert(home, iframe, [0, 0], "Home key scrolls #iframe to top"); - await pressKeyAndAssert(arrowDown, iframe, [0, lineSize], "ArrowDown key scrolls #iframe down by a line"); - await pressKeyAndAssert(arrowDown, iframe, [0, lineSize * 2], "ArrowDown key scrolls #iframe down by a line"); - await pressKeyAndAssert(arrowUp, iframe, [0, lineSize], "ArrowUp key scrolls #iframe up by a line"); - await pressKeyAndAssert(arrowUp, iframe, [0, 0], "ArrowUp key scrolls #iframe up by a line"); - await pressKeyAndAssert(arrowRight, iframe, [lineSize, 0], "ArrowRight key scrolls #iframe right by a line"); - await pressKeyAndAssert(arrowRight, iframe, [lineSize * 2, 0], "ArrowRight key scrolls #iframe right by a line"); - await pressKeyAndAssert(arrowLeft, iframe, [lineSize, 0], "ArrowLeft key scrolls #iframe left by a line"); - await pressKeyAndAssert(arrowLeft, iframe, [0, 0], "ArrowLeft key scrolls #iframe left by a line"); - await pressKeyAndAssert(pageDown, iframe, [0, pageSize(iframe.contentWindow.innerHeight)], "PageDown key scrolls #iframe down by almost a screenful"); - await pressKeyAndAssert(pageDown, iframe, [0, pageSize(iframe.contentWindow.innerHeight) * 2], "PageDown key scrolls #iframe down by almost a screenful"); - await pressKeyAndAssert(pageUp, iframe, [0, pageSize(iframe.contentWindow.innerHeight)], "PageUp key scrolls #iframe up by almost a screenful"); - await pressKeyAndAssert(pageUp, iframe, [0, 0], "PageUp key scrolls #iframe up by almost a screenful"); - - // TODO: test that scrolls chain up from iframe when they fail. -}, "Keyboard scrolling works in #iframe"); - promise_test(async () => { await test_driver.click(boxWithOverflowHidden);