diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /testing/web-platform/tests/scroll-to-text-fragment | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | testing/web-platform/tests/scroll-to-text-fragment/WEB_FEATURES.yml | 3 | ||||
-rw-r--r-- | testing/web-platform/tests/scroll-to-text-fragment/percent-encoding.html | 33 |
2 files changed, 21 insertions, 15 deletions
diff --git a/testing/web-platform/tests/scroll-to-text-fragment/WEB_FEATURES.yml b/testing/web-platform/tests/scroll-to-text-fragment/WEB_FEATURES.yml new file mode 100644 index 0000000000..0b260aaaec --- /dev/null +++ b/testing/web-platform/tests/scroll-to-text-fragment/WEB_FEATURES.yml @@ -0,0 +1,3 @@ +features: +- name: text-fragments + files: "**" diff --git a/testing/web-platform/tests/scroll-to-text-fragment/percent-encoding.html b/testing/web-platform/tests/scroll-to-text-fragment/percent-encoding.html index 1f1794bdae..be688eabfc 100644 --- a/testing/web-platform/tests/scroll-to-text-fragment/percent-encoding.html +++ b/testing/web-platform/tests/scroll-to-text-fragment/percent-encoding.html @@ -35,17 +35,17 @@ let test_cases = [ }, { fragment: '#:~:text=%', - expect: 'noscroll', + expect: 'singlepercent', description: 'Percent char without hex digits is invalid.' }, { fragment: '#:~:text=%%', - expect: 'noscroll', + expect: 'doublepercent', description: 'Percent char followed by percent char is invalid.' }, { fragment: '#:~:text=%F', - expect: 'noscroll', + expect: 'percentf', description: 'Single digit percent-encoding is invalid.' }, { @@ -65,21 +65,23 @@ let test_cases = [ }, ]; -for (const test_case of test_cases) { - promise_test(t => new Promise(resolve => { - // Clear the fragment and reset the scroll offset to prepare for the next - // test case. - location = `${location.pathname}#`; - scrollTo(0, 0); +function runTests() { + for (const test_case of test_cases) { + promise_test(t => new Promise(resolve => { + // Clear the fragment and reset the scroll offset to prepare for the next + // test case. + location = `${location.pathname}#`; + scrollTo(0, 0); - location = `${location.pathname}${test_case.fragment}`; - requestAnimationFrame( () => requestAnimationFrame(resolve) ); - }).then(() => { - assert_equals(determineResult(), test_case.expect); - }), `Test navigation with fragment: ${test_case.description}.`); + location = `${location.pathname}${test_case.fragment}`; + requestAnimationFrame( () => requestAnimationFrame(resolve) ); + }).then(() => { + assert_equals(determineResult(), test_case.expect); + }), `Test navigation with fragment: ${test_case.description}.`); + } } </script> - +<body onload="runTests()"> <p class="target" id="singlepercent"> % </p> @@ -100,3 +102,4 @@ for (const test_case of test_cases) { Hello world </p> +</body>
\ No newline at end of file |