Skip to content

Commit 8a42f71

Browse files
Ahmad-S792Ahmad Saleem
authored andcommitted
Resync 'svg/types/scripted/' from WPT upstream
https://bugs.webkit.org/show_bug.cgi?id=263281 Reviewed by Tim Nguyen. This PR is to upstream all tests from 'svg/types/scripted/' directory based on WPT ToT hash: Upstream hash: bbb13dc253827791419344169e822c1af8c2cd82 * LayoutTests/imported/w3c/web-platform-tests/__init__.py: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/event-handler-all-document-element-events.svg: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/event-handler-all-document-element-events-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGAnimatedEnumeration-SVGFECompositeElement.html: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted//SVGAnimatedEnumeration-SVGFECompositeElement-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGAnimatedEnumeration-SVGMarkerElement.html: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted//SVGAnimatedEnumeration-SVGMarkerElement-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGAnimatedRect.html: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGAnimatedRect-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGElement.className-01.svg: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGElement.className-01-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-02.svg: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-02.svg: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-03-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-03.svg: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-04.svg: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-04-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-05.svg: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-05-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.isPointInFill-01.svg: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.isPointInFill-01-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.isPointInStroke-01.svg: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGraphicsElement-clone-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGraphicsElement-clone.svg: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGraphicsElement-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGraphicsElement.getBBox-03-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGraphicsElement.getBBox-03.html: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGraphicsElement.svg: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-cap-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-cap.html: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-ch-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-ch.html: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-ic-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-ic.html: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-lh-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-lh.html: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-px-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-px-with-context-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-px-with-context.html: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-px.html: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-rem-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-rem.html: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/svglength-value-access-when-in-detached-document-crash.html: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-viewport-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGLength-viewport.html: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGPoint-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGPoint.html: * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/w3c-import.log Canonical link: https://commits.webkit.org/269468@main
1 parent 2ad2ad3 commit 8a42f71

File tree

47 files changed

+851
-130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+851
-130
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# This file is required for Python to search this directory for modules.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
PASS Use of SVGAnimatedEnumeration within SVGFECompositeElement
2+
FAIL Use of SVGAnimatedEnumeration within SVGFECompositeElement Type error
33

LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGAnimatedEnumeration-SVGFECompositeElement.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,18 @@
3434
assert_equals(feCompositeElement.operator.baseVal, SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_XOR);
3535
assert_equals(feCompositeElement.getAttribute('operator'), "xor");
3636

37+
// Switch to 'lighter'.
38+
feCompositeElement.operator.baseVal = SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_LIGHTER;
39+
assert_equals(feCompositeElement.operator.baseVal, SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_LIGHTER);
40+
assert_equals(feCompositeElement.getAttribute('operator'), "lighter");
41+
3742
// Switch to 'arithmetic'.
3843
feCompositeElement.operator.baseVal = SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_ARITHMETIC;
3944
assert_equals(feCompositeElement.operator.baseVal, SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_ARITHMETIC);
4045
assert_equals(feCompositeElement.getAttribute('operator'), "arithmetic");
4146

4247
// Try setting invalid values.
43-
assert_throws_js(TypeError, function() { feCompositeElement.operator.baseVal = 7; });
48+
assert_throws_js(TypeError, function() { feCompositeElement.operator.baseVal = 8; });
4449
assert_equals(feCompositeElement.operator.baseVal, SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_ARITHMETIC);
4550
assert_equals(feCompositeElement.getAttribute('operator'), "arithmetic");
4651

@@ -56,10 +61,5 @@
5661
feCompositeElement.operator.baseVal = SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OVER;
5762
assert_equals(feCompositeElement.operator.baseVal, SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OVER);
5863
assert_equals(feCompositeElement.getAttribute('operator'), "over");
59-
60-
// Switch to 'lighter'.
61-
assert_equals(SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_LIGHTER, undefined);
62-
feCompositeElement.setAttribute("operator", "lighter");
63-
assert_equals(feCompositeElement.operator.baseVal, SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_UNKNOWN);
6464
});
65-
</script>
65+
</script>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11

2-
PASS Use of SVGAnimatedEnumeration within SVGMarkerElement
2+
PASS Test SVGAnimatedEnumeration
3+
PASS Test SVGOrient
4+
PASS Test grad units
5+
FAIL Test turn units assert_equals: expected 360 but got 0
6+
FAIL Test auto-start-reverse Type error
37

LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGAnimatedEnumeration-SVGMarkerElement.html

Lines changed: 55 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,22 @@
33
<script src="/resources/testharness.js"></script>
44
<script src="/resources/testharnessreport.js"></script>
55
<script>
6-
test(function() {
7-
// This test checks the use of SVGAnimatedEnumeration within SVGMarkerElement.
8-
9-
var markerElement = document.createElementNS("http://www.w3.org/2000/svg", "marker");
6+
function createMarker() {
7+
let markerElement = document.createElementNS("http://www.w3.org/2000/svg", "marker");
108
markerElement.setAttribute("markerUnits", "userSpaceOnUse");
119
markerElement.setAttribute("orient", "auto");
10+
return markerElement;
11+
}
1212

13-
var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
13+
function createSVGAngle() {
14+
let svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
15+
return svgElement.createSVGAngle();
16+
}
17+
18+
test(function() {
19+
// This test checks the use of SVGAnimatedEnumeration within SVGMarkerElement.
20+
21+
let markerElement = createMarker();
1422

1523
// markerUnits
1624
// Check initial 'markerUnits' value.
@@ -40,6 +48,10 @@
4048
markerElement.markerUnits.baseVal = SVGMarkerElement.SVG_MARKERUNITS_USERSPACEONUSE;
4149
assert_equals(markerElement.markerUnits.baseVal, SVGMarkerElement.SVG_MARKERUNITS_USERSPACEONUSE);
4250
assert_equals(markerElement.getAttribute('markerUnits'), "userSpaceOnUse");
51+
}, "Test SVGAnimatedEnumeration");
52+
53+
test(function() {
54+
let markerElement = createMarker();
4355

4456
// orientType
4557
// Check initial 'orient' value.
@@ -50,7 +62,7 @@
5062
assert_equals(markerElement.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_AUTO);
5163

5264
// Switch to 'Pi/2 rad' value - via setOrientToAngle().
53-
anglePiHalfRad = svgElement.createSVGAngle();
65+
let anglePiHalfRad = createSVGAngle();
5466
anglePiHalfRad.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_RAD, (Math.PI / 2).toFixed(2));
5567
markerElement.setOrientToAngle(anglePiHalfRad);
5668
assert_equals(markerElement.orientAngle.baseVal.value.toFixed(1), "90.0");
@@ -66,7 +78,7 @@
6678
assert_equals(markerElement.getAttribute('orient'), "auto");
6779

6880
// Switch to '20deg' value - via setOrientToAngle().
69-
angle20deg = svgElement.createSVGAngle();
81+
let angle20deg = createSVGAngle();
7082
angle20deg.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, 20);
7183
markerElement.setOrientToAngle(angle20deg);
7284
assert_equals(markerElement.orientAngle.baseVal.value, 20);
@@ -91,7 +103,7 @@
91103
markerElement.setAttribute('orient', '10deg');
92104

93105
// Try setting invalid values.
94-
assert_throws_js(TypeError, function() { markerElement.orientType.baseVal = 3; });
106+
assert_throws_js(TypeError, function() { markerElement.orientType.baseVal = 4; });
95107
assert_equals(markerElement.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE);
96108
assert_equals(markerElement.getAttribute('orient'), "10deg");
97109

@@ -109,5 +121,38 @@
109121
assert_equals(markerElement.orientAngle.baseVal.unitType, SVGAngle.SVG_ANGLETYPE_UNSPECIFIED);
110122
assert_equals(markerElement.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_AUTO);
111123
assert_equals(markerElement.getAttribute('orient'), "auto");
112-
});
113-
</script>
124+
}, "Test SVGOrient");
125+
126+
test(function() {
127+
let markerElement = createMarker();
128+
129+
markerElement.setAttribute('orient', '400grad');
130+
assert_equals(markerElement.orientAngle.baseVal.value, 360);
131+
assert_equals(markerElement.orientAngle.baseVal.unitType, SVGAngle.SVG_ANGLETYPE_GRAD);
132+
}, "Test grad units");
133+
134+
test(function() {
135+
let markerElement = createMarker();
136+
137+
markerElement.setAttribute('orient', '1turn');
138+
assert_equals(markerElement.orientAngle.baseVal.value, 360);
139+
assert_equals(markerElement.orientAngle.baseVal.unitType, SVGAngle.SVG_ANGLETYPE_UNKNOWN);
140+
141+
let angle = createSVGAngle();
142+
angle = markerElement.orientAngle.baseVal;
143+
angle.value = 720;
144+
markerElement.setOrientToAngle(angle);
145+
assert_equals(markerElement.getAttribute('orient'), "2turn");
146+
}, "Test turn units");
147+
148+
test(function() {
149+
let markerElement = createMarker();
150+
151+
// Switch to 'auto-start-reverse' value - by modifying orientType.
152+
markerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO_START_REVERSE;
153+
assert_equals(markerElement.orientAngle.baseVal.value, 0);
154+
assert_equals(markerElement.orientAngle.baseVal.unitType, SVGAngle.SVG_ANGLETYPE_UNSPECIFIED);
155+
assert_equals(markerElement.orientType.baseVal, SVGMarkerElement.SVG_MARKER_ORIENT_AUTO_START_REVERSE);
156+
assert_equals(markerElement.getAttribute('orient'), "auto-start-reverse");
157+
}, "Test auto-start-reverse");
158+
</script>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
FAIL SVGAnimatedRect interface - utilizing the viewBox property of SVGSVGElement assert_true: expected true got false
2+
PASS SVGAnimatedRect interface - utilizing the viewBox property of SVGSVGElement
33

LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGAnimatedRect.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
// Check initial viewBox value.
1212
assert_true(svgElement.viewBox instanceof SVGAnimatedRect);
13-
assert_true(svgElement.viewBox.baseVal instanceof DOMRect);
13+
assert_true(svgElement.viewBox.baseVal instanceof SVGRect);
1414
assert_equals(svgElement.viewBox.baseVal.x, 0);
15-
assert_true(svgElement.viewBox.animVal instanceof DOMRectReadOnly);
15+
assert_true(svgElement.viewBox.animVal instanceof SVGRect);
1616

1717
// Check that rects are dynamic, caching value in a local variable and modifying it, should take effect.
1818
var numRef = svgElement.viewBox.baseVal;
@@ -29,6 +29,6 @@
2929
assert_equals(svgElement.viewBox.baseVal.x, 100);
3030

3131
// Check that the viewBox baseVal type has not been changed.
32-
assert_true(svgElement.viewBox.baseVal instanceof DOMRect);
32+
assert_true(svgElement.viewBox.baseVal instanceof SVGRect);
3333
});
3434
</script>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
PASS SVGElement.prototype.className: Reflects to .classList
3+
Lines changed: 15 additions & 0 deletions
Loading

LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGGeometryElement.getPointAtLength-02.svg

Lines changed: 2 additions & 3 deletions
Loading

0 commit comments

Comments
 (0)