commit 1514e1e2225c6ca2d48aaab4a6c89cd6c72c64e6
parent da64cc656d69aab9e972ea725cb48f0dfa5a0270
Author: Fredrik Söderquist <fs@opera.com>
Date: Fri, 3 Oct 2025 08:57:43 +0000
Bug 1990875 [wpt PR 55067] - Revert "Move/migrate SVGRect and SVGPoint tests to WPT", a=testonly
Automatic update from web-platform-tests
Revert "Move/migrate SVGRect and SVGPoint tests to WPT"
This reverts commit 799ef6f917fdff7bab826deb742949e73b3a9b61.
Reason for revert: Shouldn't export the matrixTransform() bits
Original change's description:
> Move/migrate SVGRect and SVGPoint tests to WPT
>
> Bug: 40779000
> Change-Id: If95877c56ddfd4bc1ec34c13e53a99281452ec30
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6983405
> Reviewed-by: Philip Rogers <pdr@chromium.org>
> Auto-Submit: Fredrik Söderquist <fs@opera.com>
> Commit-Queue: Philip Rogers <pdr@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1520548}
Bug: 40779000
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I1dceeadaba8ba32da797d641cc82e666b9bf2b0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6982953
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1520687}
--
wpt-commits: 203f2438f5b26187d93d46e283fab5b3af9ccb71
wpt-pr: 55067
Diffstat:
2 files changed, 9 insertions(+), 90 deletions(-)
diff --git a/testing/web-platform/tests/svg/types/scripted/SVGPoint.html b/testing/web-platform/tests/svg/types/scripted/SVGPoint.html
@@ -4,63 +4,22 @@
<script src="/resources/testharnessreport.js"></script>
<script>
test(function() {
- const svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
- const point = svgElement.createSVGPoint();
+ let svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
+ let point = svgElement.createSVGPoint();
// Check initial point values.
assert_equals(point.x, 0);
assert_equals(point.y, 0);
- // Check assigning points.
- point.x = 100;
- assert_equals(point.x, 100);
- point.y = 200;
- assert_equals(point.y, 200);
- point.y = null;
- assert_equals(point.y, 0);
- point.y = 200;
+ point.y = 2;
+
+ // Check setting valid arguments.
+ assert_equals(point.x, 0);
+ assert_equals(point.y, 2);
// Check setting invalid arguments.
- assert_throws_js(TypeError, function() { point.x = point; });
- assert_equals(point.x, 100);
assert_throws_js(TypeError, function() { point.x = NaN; });
- assert_equals(point.x, 100);
assert_throws_js(TypeError, function() { point.x = Infinity; });
- assert_equals(point.x, 100);
-
- assert_throws_js(TypeError, function() { point.y = point; });
- assert_equals(point.y, 200);
- assert_throws_js(TypeError, function() { point.y = NaN; });
- assert_equals(point.y, 200);
- assert_throws_js(TypeError, function() { point.y = Infinity; });
- assert_equals(point.y, 200);
-}, `${document.title}, 'x' and 'y' attributes`);
-
-test(function() {
- const svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
- const point = svgElement.createSVGPoint();
-
- point.x = -50;
- point.y = 100;
-
- // Multiply with -1,0,0,2,10,10 matrix, should flip x coordinate, multiply y
- // by two and translate each coordinate by 10.
- const ctm = svgElement.createSVGMatrix();
- ctm.a = -1;
- ctm.d = 2;
- ctm.e = 10;
- ctm.f = 10;
- newPoint = point.matrixTransform(ctm);
- assert_true(newPoint instanceof SVGPoint);
- assert_equals(newPoint.x, 60);
- assert_equals(newPoint.y, 210);
-
- // Check invalid arguments for 'matrixTransform'.
- assert_throws_js(TypeError, function() { point.matrixTransform(); });
- assert_throws_js(TypeError, function() { point.matrixTransform(-1); });
- assert_throws_js(TypeError, function() { point.matrixTransform(5); });
- assert_throws_js(TypeError, function() { point.matrixTransform('aString'); });
- assert_throws_js(TypeError, function() { point.matrixTransform(point); });
- assert_throws_js(TypeError, function() { point.matrixTransform(svgElement); });
-}, `${document.title}, matrixTransform()`);
+ assert_equals(point.x, 0);
+});
</script>
diff --git a/testing/web-platform/tests/svg/types/scripted/SVGRect.html b/testing/web-platform/tests/svg/types/scripted/SVGRect.html
@@ -1,40 +0,0 @@
-<!DOCTYPE html>
-<title>SVGRect interface</title>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script>
- setup(() => {
- window.svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
- });
-
- test(t => {
- const rect = svgElement.createSVGRect();
- assert_equals(rect.x, 0, 'initial x');
- assert_equals(rect.y, 0, 'initial y');
- assert_equals(rect.width, 0, 'initial width');
- assert_equals(rect.height, 0, 'initial height');
- }, `${document.title}, initial values`);
-
- test(t => {
- const rect = svgElement.createSVGRect();
- rect.x = 100;
- rect.y = 200;
- rect.width = 300;
- rect.height = 400;
- assert_equals(rect.x, 100);
- assert_equals(rect.y, 200);
- assert_equals(rect.width, 300);
- assert_equals(rect.height, 400);
-
- rect.y = null;
- assert_equals(rect.y, 0);
- }, `${document.title}, assignment, numeric values`);
-
- test(t => {
- const rect = svgElement.createSVGRect();
- assert_throws_js(TypeError, () => { rect.x = rect; });
- assert_throws_js(TypeError, () => { rect.y = 'aString'; });
- assert_throws_js(TypeError, () => { rect.width = svgElement; });
- assert_throws_js(TypeError, () => { rect.height = NaN; });
- }, `${document.title}, assignment, invalid values`);
-</script>