From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../svg/path/property/d-interpolation-discrete.svg | 43 ++++ .../property/d-interpolation-relative-absolute.svg | 122 ++++++++++ .../svg/path/property/d-interpolation-single.svg | 245 +++++++++++++++++++++ .../tests/svg/path/property/getComputedStyle.svg | 48 ++++ .../tests/svg/path/property/marker-path-ref.svg | 42 ++++ .../tests/svg/path/property/marker-path.svg | 47 ++++ .../tests/svg/path/property/mpath-ref.svg | 5 + .../web-platform/tests/svg/path/property/mpath.svg | 18 ++ .../tests/svg/path/property/priority-ref.svg | 11 + .../tests/svg/path/property/priority.svg | 20 ++ .../resources/interpolation-test-common.js | 71 ++++++ .../tests/svg/path/property/serialization.svg | 34 +++ ...est_style_flush_on_dom_api_with_d_property.html | 80 +++++++ 13 files changed, 786 insertions(+) create mode 100644 testing/web-platform/tests/svg/path/property/d-interpolation-discrete.svg create mode 100644 testing/web-platform/tests/svg/path/property/d-interpolation-relative-absolute.svg create mode 100644 testing/web-platform/tests/svg/path/property/d-interpolation-single.svg create mode 100644 testing/web-platform/tests/svg/path/property/getComputedStyle.svg create mode 100644 testing/web-platform/tests/svg/path/property/marker-path-ref.svg create mode 100644 testing/web-platform/tests/svg/path/property/marker-path.svg create mode 100644 testing/web-platform/tests/svg/path/property/mpath-ref.svg create mode 100644 testing/web-platform/tests/svg/path/property/mpath.svg create mode 100644 testing/web-platform/tests/svg/path/property/priority-ref.svg create mode 100644 testing/web-platform/tests/svg/path/property/priority.svg create mode 100644 testing/web-platform/tests/svg/path/property/resources/interpolation-test-common.js create mode 100644 testing/web-platform/tests/svg/path/property/serialization.svg create mode 100644 testing/web-platform/tests/svg/path/property/test_style_flush_on_dom_api_with_d_property.html (limited to 'testing/web-platform/tests/svg/path/property') diff --git a/testing/web-platform/tests/svg/path/property/d-interpolation-discrete.svg b/testing/web-platform/tests/svg/path/property/d-interpolation-discrete.svg new file mode 100644 index 0000000000..5b20a589bb --- /dev/null +++ b/testing/web-platform/tests/svg/path/property/d-interpolation-discrete.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/svg/path/property/d-interpolation-relative-absolute.svg b/testing/web-platform/tests/svg/path/property/d-interpolation-relative-absolute.svg new file mode 100644 index 0000000000..09d4c70712 --- /dev/null +++ b/testing/web-platform/tests/svg/path/property/d-interpolation-relative-absolute.svg @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/svg/path/property/d-interpolation-single.svg b/testing/web-platform/tests/svg/path/property/d-interpolation-single.svg new file mode 100644 index 0000000000..107b607bec --- /dev/null +++ b/testing/web-platform/tests/svg/path/property/d-interpolation-single.svg @@ -0,0 +1,245 @@ + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/svg/path/property/getComputedStyle.svg b/testing/web-platform/tests/svg/path/property/getComputedStyle.svg new file mode 100644 index 0000000000..400f92ec84 --- /dev/null +++ b/testing/web-platform/tests/svg/path/property/getComputedStyle.svg @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/svg/path/property/marker-path-ref.svg b/testing/web-platform/tests/svg/path/property/marker-path-ref.svg new file mode 100644 index 0000000000..8cd5c8ea48 --- /dev/null +++ b/testing/web-platform/tests/svg/path/property/marker-path-ref.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/svg/path/property/marker-path.svg b/testing/web-platform/tests/svg/path/property/marker-path.svg new file mode 100644 index 0000000000..c03e9c515c --- /dev/null +++ b/testing/web-platform/tests/svg/path/property/marker-path.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/svg/path/property/mpath-ref.svg b/testing/web-platform/tests/svg/path/property/mpath-ref.svg new file mode 100644 index 0000000000..db281c33da --- /dev/null +++ b/testing/web-platform/tests/svg/path/property/mpath-ref.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/testing/web-platform/tests/svg/path/property/mpath.svg b/testing/web-platform/tests/svg/path/property/mpath.svg new file mode 100644 index 0000000000..c4233b1705 --- /dev/null +++ b/testing/web-platform/tests/svg/path/property/mpath.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/svg/path/property/priority-ref.svg b/testing/web-platform/tests/svg/path/property/priority-ref.svg new file mode 100644 index 0000000000..cbc7c385f6 --- /dev/null +++ b/testing/web-platform/tests/svg/path/property/priority-ref.svg @@ -0,0 +1,11 @@ + + + + + + diff --git a/testing/web-platform/tests/svg/path/property/priority.svg b/testing/web-platform/tests/svg/path/property/priority.svg new file mode 100644 index 0000000000..ef187c1913 --- /dev/null +++ b/testing/web-platform/tests/svg/path/property/priority.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/testing/web-platform/tests/svg/path/property/resources/interpolation-test-common.js b/testing/web-platform/tests/svg/path/property/resources/interpolation-test-common.js new file mode 100644 index 0000000000..b7f8cd308d --- /dev/null +++ b/testing/web-platform/tests/svg/path/property/resources/interpolation-test-common.js @@ -0,0 +1,71 @@ +'use strict'; +function test_interpolation(settings, expectations) { + + test(function(){ + assert_true(CSS.supports(settings.property, settings.from), 'Value "' + settings.from + '" is supported by ' + settings.property); + assert_true(CSS.supports(settings.property, settings.to), 'Value "' + settings.to + '" is supported by ' + settings.property); + }, '"' + settings.from + '" and "' + settings.to + '" are valid ' + settings.property + ' values'); + + const container = document.getElementById('container'); + for (let i = 0; i < expectations.length; ++i) { + const progress = expectations[i].at; + const expectation = expectations[i].expect; + const animationId = 'anim' + i; + const targetId = 'target' + i; + const referenceId = 'reference' + i; + + test(function(){ + assert_true(CSS.supports(settings.property, expectation), 'Value "' + expectation + '" is supported by ' + settings.property); + + const target = document.createElementNS('http://www.w3.org/2000/svg', 'g'); + target.id = targetId; + container.appendChild(target); + + const reference = document.createElementNS('http://www.w3.org/2000/svg', 'g'); + reference.id = referenceId; + container.appendChild(reference); + + assert_equals(getComputedStyle(target)[settings.property], getComputedStyle(reference)[settings.property]); + + // Create an animation of length 2s that starts at -1s so the current time of 0s is + // exactly halfway through the animation. A cubic bezier timing function is used that + // evaluates to |progress| at the current time (halfway through the animation). + + // Cubic bezier evaluates to |progress| at 50%. + const y = (8 * progress - 1) / 6; + const timing_function = 'cubic-bezier(0, ' + y + ', 1, ' + y + ')'; + + const stylesheet = document.createElementNS('http://www.w3.org/2000/svg', 'style'); + stylesheet.textContent = + '#' + targetId + ' {\n' + + ' animation: 2s ' + timing_function + ' -1s paused ' + animationId + ';\n' + + '}\n' + + '@keyframes ' + animationId + ' {\n' + + ' 0% { ' + settings.property + ': ' + settings.from + '; }\n' + + ' 100% { ' + settings.property + ': ' + settings.to + '; }\n' + + '}\n' + + '#' + referenceId + ' {\n' + + ' ' + settings.property + ': ' + expectation + ';\n' + + '}\n'; + container.appendChild(stylesheet); + + assert_equals(getComputedStyle(target)[settings.property], getComputedStyle(reference)[settings.property]); + assert_equals(getComputedStyle(target)[settings.property], expectation); + + container.removeChild(target); + container.removeChild(reference); + container.removeChild(stylesheet); + }, 'Animation between "' + settings.from + '" and "' + settings.to + '" at progress ' + progress); + } +} + +function test_no_interpolation(settings) { + const expectFrom = [-1, 0, 0.125].map(function (progress) { + return {at: progress, expect: settings.from}; + }); + const expectTo = [0.875, 1, 2].map(function (progress) { + return {at: progress, expect: settings.to}; + }); + + test_interpolation(settings, expectFrom.concat(expectTo)); +} diff --git a/testing/web-platform/tests/svg/path/property/serialization.svg b/testing/web-platform/tests/svg/path/property/serialization.svg new file mode 100644 index 0000000000..3199beb92b --- /dev/null +++ b/testing/web-platform/tests/svg/path/property/serialization.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/svg/path/property/test_style_flush_on_dom_api_with_d_property.html b/testing/web-platform/tests/svg/path/property/test_style_flush_on_dom_api_with_d_property.html new file mode 100644 index 0000000000..248118443b --- /dev/null +++ b/testing/web-platform/tests/svg/path/property/test_style_flush_on_dom_api_with_d_property.html @@ -0,0 +1,80 @@ + +Test DOM APIs which flush the style properly, with d property + + + + + + +
+ + + + -- cgit v1.2.3