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/css/css-values | |
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 'testing/web-platform/tests/css/css-values')
4 files changed, 66 insertions, 7 deletions
diff --git a/testing/web-platform/tests/css/css-values/WEB_FEATURES.yml b/testing/web-platform/tests/css/css-values/WEB_FEATURES.yml index ca3c0ff91b..dc7331ab95 100644 --- a/testing/web-platform/tests/css/css-values/WEB_FEATURES.yml +++ b/testing/web-platform/tests/css/css-values/WEB_FEATURES.yml @@ -5,6 +5,10 @@ features: - name: cap files: - cap-* +- name: exp-functions + files: + - exp-log-* + - hypot-pow-sqrt-* - name: ic files: - ic-* diff --git a/testing/web-platform/tests/css/css-values/calc-size/animation/calc-size-height-interpolation.tentative.html b/testing/web-platform/tests/css/css-values/calc-size/animation/calc-size-height-interpolation.tentative.html index 06277376e9..6d15c3f226 100644 --- a/testing/web-platform/tests/css/css-values/calc-size/animation/calc-size-height-interpolation.tentative.html +++ b/testing/web-platform/tests/css/css-values/calc-size/animation/calc-size-height-interpolation.tentative.html @@ -180,7 +180,7 @@ test_interpolation({ property: 'height', from: 'calc-size(37px, 200px)', - to: `calc-size(37px, size * 2 + 3% + 17px)`, /* adds to 100px */ + to: 'calc-size(37px, size * 2 + 3% + 17px)', /* adds to 100px */ }, [ { at: -0.25, expect: '225px' }, { at: 0, expect: '200px' }, @@ -189,4 +189,43 @@ { at: 1.25, expect: '75px' }, ]); + test_interpolation({ + property: 'height', + from: 'calc-size(auto, size)', + to: '50%', + }, [ + { at: -0.25, expect: '87.5px' }, + { at: 0, expect: '100px' }, + { at: 0.75, expect: '137.5px' }, + { at: 1, expect: '150px' }, + { at: 1.25, expect: '162.5px' }, + ]); + + // Rerun roughly the same test with an auto height container. + let auto_style_text = ` + .parent { + height: auto; + } + `; + let auto_style_element = document.createElement("style"); + auto_style_element.append(document.createTextNode(auto_style_text)); + document.head.append(auto_style_element); + + test_interpolation({ + property: 'height', + from: 'calc-size(auto, size * 2)', + to: '50%', + }, [ + { at: -0.25, expect: '250px' }, + { at: 0, expect: '200px' }, + { at: 0.75, expect: '50px' }, + /* TODO(https://crbug.com/40339056): It's questionable whether this should + * be the case, particularly for transitions. Perhaps the value at the + * end should have its percentage-ness back and be 100px here? */ + { at: 1, expect: '0px' }, + { at: 1.25, expect: '0px' }, + ]); + + auto_style_element.remove(); + </script> diff --git a/testing/web-platform/tests/css/css-values/calc-size/calc-size-parsing.tentative.html b/testing/web-platform/tests/css/css-values/calc-size/calc-size-parsing.tentative.html index afcb200424..422ab3c33e 100644 --- a/testing/web-platform/tests/css/css-values/calc-size/calc-size-parsing.tentative.html +++ b/testing/web-platform/tests/css/css-values/calc-size/calc-size-parsing.tentative.html @@ -70,4 +70,16 @@ test_valid_value("width", "calc-size(calc-size(min-content, size), size)"); test_invalid_value("height", "calc(12% + calc-size(any, 31%))"); +// Based on the discussion in https://github.com/w3c/csswg-drafts/issues/10259 +// this presumes parse-time conversion of the one-argument form to the +// two-argument form, but this isn't yet specified. +test_valid_value("width", "calc-size(30px)", "calc-size(any, 30px)"); +test_valid_value("width", "calc-size(min(30px, 2em))", "calc-size(any, min(30px, 2em))"); +test_invalid_value("width", "calc-size(any)"); +test_valid_value("width", "calc-size(calc-size(any, 30px))", "calc-size(calc-size(any, 30px), size)"); +test_invalid_value("width", "calc-size(size)"); +test_valid_value("width", "calc-size(fit-content)", "calc-size(fit-content, size)"); +test_valid_value("width", "calc-size(calc-size(fit-content, size * 2))", "calc-size(calc-size(fit-content, size * 2), size)"); +test_valid_value("width", "calc-size(calc-size(30px))", "calc-size(calc-size(any, 30px), size)"); + </script> diff --git a/testing/web-platform/tests/css/css-values/container-progress-computed.tentative.html b/testing/web-platform/tests/css/css-values/container-progress-computed.tentative.html index 9ab537cad6..5c8d12f9cd 100644 --- a/testing/web-platform/tests/css/css-values/container-progress-computed.tentative.html +++ b/testing/web-platform/tests/css/css-values/container-progress-computed.tentative.html @@ -1,4 +1,5 @@ <!DOCTYPE html> +<meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="help" href="https://drafts.csswg.org/css-values-5/#container-progress-func"> <link rel="author" title="sakhapov@chromium.org"> <script src="/resources/testharness.js"></script> @@ -15,6 +16,8 @@ <style> :root { font-size: 10px; + width: 100vw; + height: 100vh; } #out-of-scope-container { container: my-container-3 / size; @@ -42,8 +45,9 @@ </style> <script> -let width = window.innerWidth; -let height = window.innerHeight; +// innerWidth and innerHeight have lossy precision, see +// https://github.com/w3c/csswg-drafts/issues/5260. +let { width, height } = document.documentElement.getBoundingClientRect(); let extraWidth = 5051; let extraHeight = 1337; @@ -68,10 +72,10 @@ test_math_used('calc(container-progress(width of my-container from 0px to 50px) test_math_used('calc(container-progress(height of my-container from 10px to sign(50px - 500em) * 10px))', (outerHeight - 10) / (-10 - 10), {type:'number'}); // Fallback -test_math_used('container-progress(width of non-existing-container from 0px to 1px)', width, {type:'number'}); -test_math_used('container-progress(height of non-existing-container from 0px to 1px)', height, {type:'number'}); -test_math_used('container-progress(width of out-of-scope-container from 0px to 1px)', width, {type:'number'}); -test_math_used('container-progress(height of out-of-scope-container from 0px to 1px)', height, {type:'number'}); +test_math_used('container-progress(width of non-existing-container from 0px to 1px)', width, {type:'number', msg: 'container-progress() width fallback for non-existing container name'}); +test_math_used('container-progress(height of non-existing-container from 0px to 1px)', height, {type:'number', msg: 'container-progress() height fallback for non-existing container names'}); +test_math_used('container-progress(width of out-of-scope-container from 0px to 1px)', width, {type:'number', msg: 'container-progress() width fallback for out of scope container'}); +test_math_used('container-progress(height of out-of-scope-container from 0px to 1px)', height, {type:'number', msg: 'container-progress() height fallback for out of scope container'}); // Type checking test_math_used('calc(container-progress(width from 0px to 1px) * 1px)', innerWidth + 'px'); |