-
Notifications
You must be signed in to change notification settings - Fork 54
/
test_transitions_per_property.html
3184 lines (2947 loc) · 139 KB
/
test_transitions_per_property.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=435441
-->
<head>
<title>Test for Bug 435441</title>
<meta charset=utf-8>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="property_database.js"></script>
<script type="text/javascript" src="animation_utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<style type="text/css">
#display > p { margin-top: 0; margin-bottom: 0; }
</style>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=435441">Mozilla Bug 435441</a>
<!--
fixed-height container so percentage heights compute to different
(i.e., nonzero) values
fixed-width container so that percentages for margin-top and
margin-bottom are all relative to the same size container (rather than
one that depends on whether we're tall enough to need a scrollbar)
Use a 20px font size and line-height so that percentage line-height
and vertical-align doesn't accumulate rounding error.
-->
<div style="height: 50px; width: 300px; font-size: 20px; line-height: 20px">
<div id="display">
</div>
<div id="transformTest" style="height:100px; width:200px; background-color:blue;">
</div>
</div>
<pre id="test">
<script type="application/javascript">
/* eslint no-shadow: ["error", {"allow": ["prop", "div"]}] */
/* eslint-disable dot-notation */
/** Test for Bug 435441 **/
SimpleTest.requestLongerTimeout(2);
SimpleTest.waitForExplicitFinish();
function has_num(str)
{
return !!String(str).match(/^([\d.]+)/);
}
function any_unit_to_num(str)
{
return Number(String(str).match(/^([\d.]+)/)[1]);
}
var FUNC_NEGATIVE = "cubic-bezier(0.25, -2, 0.75, 1)";
var FUNC_OVERONE = "cubic-bezier(0.25, 0, 0.75, 3)";
var supported_properties = {
"backdrop-filter" : [ test_filter_transition ],
"border-bottom-left-radius": [ test_radius_transition ],
"border-bottom-right-radius": [ test_radius_transition ],
"border-top-left-radius": [ test_radius_transition ],
"border-top-right-radius": [ test_radius_transition ],
"border-start-start-radius": [ test_radius_transition ],
"border-start-end-radius": [ test_radius_transition ],
"border-end-start-radius": [ test_radius_transition ],
"border-end-end-radius": [ test_radius_transition ],
"-moz-box-flex": [ test_float_zeroToOne_transition,
test_float_aboveOne_transition,
test_float_zeroToOne_clamped ],
"box-shadow": [ test_shadow_transition ],
"column-count": [ test_pos_integer_or_auto_transition,
test_integer_at_least_one_clamping ],
"column-rule-color": [ test_color_transition,
test_currentcolor_transition ],
"column-rule-width": [ test_length_transition,
test_length_clamped ],
"column-width": [ test_length_transition,
test_length_clamped ],
"cx": [ test_length_transition, test_percent_transition,
test_length_unclamped, test_percent_unclamped ],
"cy": [ test_length_transition, test_percent_transition,
test_length_unclamped, test_percent_unclamped ],
"-moz-image-region": [ test_rect_transition ],
"-moz-outline-radius-bottomleft": [ test_radius_transition ],
"-moz-outline-radius-bottomright": [ test_radius_transition ],
"-moz-outline-radius-topleft": [ test_radius_transition ],
"-moz-outline-radius-topright": [ test_radius_transition ],
"background-color": [ test_color_transition,
test_currentcolor_transition ],
"background-position": [ test_background_position_transition,
test_length_percent_pair_unclamped ],
"background-position-x": [ test_background_position_coord_transition,
test_length_transition,
test_percent_transition,
// FIXME: We don't currently test clamping,
// since background-position-x uses calc() as
// an intermediate form.
/* test_length_percent_pair_unclamped */ ],
"background-position-y": [ test_background_position_coord_transition,
test_length_transition,
test_percent_transition,
// FIXME: We don't currently test clamping,
// since background-position-y uses calc() as
// an intermediate form.
/* test_length_percent_pair_unclamped */ ],
"background-size": [ test_background_size_transition,
test_length_percent_pair_clamped ],
"border-bottom-color": [ test_color_transition,
test_currentcolor_transition ],
"border-bottom-width": [ test_length_transition,
test_length_clamped ],
"border-left-color": [ test_color_transition,
test_currentcolor_transition ],
"border-left-width": [ test_length_transition,
test_length_clamped ],
"border-right-color": [ test_color_transition,
test_currentcolor_transition ],
"border-right-width": [ test_length_transition,
test_length_clamped ],
"border-spacing": [ test_length_pair_transition,
test_length_pair_transition_clamped ],
"border-top-color": [ test_color_transition,
test_currentcolor_transition ],
"border-top-width": [ test_length_transition,
test_length_clamped ],
"bottom": [ test_length_transition, test_percent_transition,
test_length_percent_calc_transition,
test_length_unclamped, test_percent_unclamped ],
"caret-color": [ test_color_transition,
test_currentcolor_transition,
test_auto_color_transition ],
"clip": [ test_rect_transition ],
"clip-path": [ test_basic_shape_or_url_transition ],
"color": [ test_color_transition,
test_currentcolor_transition ],
"fill": [ test_color_transition,
test_currentcolor_transition ],
"fill-opacity" : [ test_float_zeroToOne_transition,
// opacity is clamped in computed style
// (not parsing/interpolation)
test_float_zeroToOne_clamped ],
"filter" : [ test_filter_transition ],
"flex-basis": [ test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped,
test_flex_basis_content_transition ],
"flex-grow": [ test_float_zeroToOne_transition,
test_float_aboveOne_transition ],
"flex-shrink": [ test_float_zeroToOne_transition,
test_float_aboveOne_transition ],
"flood-color": [ test_color_transition,
test_currentcolor_transition ],
"flood-opacity" : [ test_float_zeroToOne_transition,
// opacity is clamped in computed style
// (not parsing/interpolation)
test_float_zeroToOne_clamped ],
"font-size": [ test_length_transition, test_percent_transition,
test_length_percent_calc_transition,
test_length_clamped, test_percent_clamped ],
"font-size-adjust": [ test_float_zeroToOne_transition,
test_float_aboveOne_transition,
/* FIXME: font-size-adjust treats zero specially */
/* test_float_zeroToOne_clamped */ ],
"font-stretch": [ test_percent_transition, test_percent_clamped ],
"font-weight": [ test_font_weight ],
"column-gap": [ test_grid_gap ],
"row-gap": [ test_grid_gap ],
"height": [ test_length_transition, test_percent_transition,
test_length_percent_calc_transition,
test_length_clamped, test_percent_clamped ],
"left": [ test_length_transition, test_percent_transition,
test_length_percent_calc_transition,
test_length_unclamped, test_percent_unclamped ],
"letter-spacing": [ test_length_transition, test_length_unclamped ],
"lighting-color": [ test_color_transition,
test_currentcolor_transition ],
// NOTE: when calc() is supported on 'line-height', we should add
// test_length_percent_calc_transition.
"line-height": [ test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped ],
"margin-bottom": [ test_length_transition, test_percent_transition,
test_length_percent_calc_transition,
test_length_unclamped, test_percent_unclamped ],
"margin-left": [ test_length_transition, test_percent_transition,
test_length_percent_calc_transition,
test_length_unclamped, test_percent_unclamped ],
"margin-right": [ test_length_transition, test_percent_transition,
test_length_percent_calc_transition,
test_length_unclamped, test_percent_unclamped ],
"margin-top": [ test_length_transition, test_percent_transition,
test_length_percent_calc_transition,
test_length_unclamped, test_percent_unclamped ],
"mask-position": [ test_background_position_transition,
test_length_percent_pair_unclamped ],
"mask-position-x": [ test_background_position_coord_transition,
test_length_transition,
test_percent_transition,
// FIXME: We don't currently test clamping,
// since background-position-x uses calc() as
// an intermediate form.
/* test_length_percent_pair_unclamped */ ],
"mask-position-y": [ test_background_position_coord_transition,
test_length_transition,
test_percent_transition,
// FIXME: We don't currently test clamping,
// since background-position-y uses calc() as
// an intermediate form.
/* test_length_percent_pair_unclamped */ ],
"mask-size": [ test_background_size_transition,
test_length_percent_pair_clamped ],
"max-height": [ test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped ],
"max-width": [ test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped ],
"min-height": [ test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped ],
"min-width": [ test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped ],
"object-position": [ test_background_position_transition ],
"opacity" : [ test_float_zeroToOne_transition,
// opacity is clamped in computed style
// (not parsing/interpolation)
test_float_zeroToOne_clamped ],
"order": [ test_integer_transition ],
"outline-color": [ test_color_transition,
test_currentcolor_transition ],
"outline-offset": [ test_length_transition, test_length_unclamped ],
"outline-width": [ test_length_transition, test_length_clamped ],
"padding-bottom": [ test_length_transition, test_percent_transition,
test_length_percent_calc_transition,
test_length_clamped, test_percent_clamped ],
"padding-left": [ test_length_transition, test_percent_transition,
test_length_percent_calc_transition,
test_length_clamped, test_percent_clamped ],
"padding-right": [ test_length_transition, test_percent_transition,
test_length_percent_calc_transition,
test_length_clamped, test_percent_clamped ],
"padding-top": [ test_length_transition, test_percent_transition,
test_length_percent_calc_transition,
test_length_clamped, test_percent_clamped ],
"perspective": [ test_length_transition ],
"perspective-origin": [ test_length_pair_transition,
test_length_percent_pair_transition,
test_length_percent_pair_unclamped ],
"right": [ test_length_transition, test_percent_transition,
test_length_percent_calc_transition,
test_length_unclamped, test_percent_unclamped ],
"r": [ test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped ],
"rx": [ test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped ],
"ry": [ test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped ],
"shape-image-threshold": [ test_float_zeroToOne_transition,
// shape-image-threshold (like opacity) is
// clamped in computed style
// (not parsing/interpolation)
test_float_zeroToOne_clamped ],
"shape-margin": [ test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped ],
"shape-outside": [ test_basic_shape_or_url_transition ],
"stop-color": [ test_color_transition,
test_currentcolor_transition ],
"stop-opacity" : [ test_float_zeroToOne_transition,
// opacity is clamped in computed style
// (not parsing/interpolation)
test_float_zeroToOne_clamped ],
"stroke": [ test_color_transition,
test_currentcolor_transition ],
"stroke-dasharray": [ test_dasharray_transition ],
"stroke-dashoffset": [ test_length_transition, test_percent_transition,
test_length_unclamped, test_percent_unclamped, ],
"stroke-miterlimit": [ test_float_zeroToOne_transition,
test_float_aboveOne_transition,
test_float_aboveZero_clamped ],
"stroke-opacity" : [ test_float_zeroToOne_transition,
// opacity is clamped in computed style
// (not parsing/interpolation)
test_float_zeroToOne_clamped ],
"stroke-width": [ test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped, ],
"-moz-tab-size": [ test_float_zeroToOne_transition,
test_float_aboveOne_transition, test_length_clamped ],
"text-decoration": [ test_color_shorthand_transition,
test_currentcolor_shorthand_transition ],
"text-decoration-color": [ test_color_transition,
test_currentcolor_transition ],
"text-emphasis-color": [ test_color_transition,
test_currentcolor_transition ],
"text-indent": [ test_length_transition, test_percent_transition,
test_length_unclamped, test_percent_unclamped ],
"text-shadow": [ test_shadow_transition ],
"top": [ test_length_transition, test_percent_transition,
test_length_percent_calc_transition,
test_length_unclamped, test_percent_unclamped ],
"transform": [ test_transform_transition ],
"transform-origin": [ test_length_pair_transition,
test_length_percent_pair_transition,
test_length_percent_pair_unclamped ],
"vertical-align": [ test_length_transition, test_percent_transition,
test_length_unclamped, test_percent_unclamped ],
"visibility": [ test_visibility_transition ],
"width": [ test_length_transition, test_percent_transition,
test_length_percent_calc_transition,
test_length_clamped, test_percent_clamped ],
"word-spacing": [ test_length_transition, test_length_unclamped ],
"x": [ test_length_transition, test_percent_transition,
test_length_unclamped, test_percent_unclamped ],
"y": [ test_length_transition, test_percent_transition,
test_length_unclamped, test_percent_unclamped ],
"z-index": [ test_integer_transition, test_pos_integer_or_auto_transition ],
"-webkit-line-clamp": [ test_pos_integer_or_none_transition ],
"-webkit-text-fill-color": [ test_color_transition,
test_currentcolor_transition ],
"-webkit-text-stroke-color": [ test_color_transition,
test_currentcolor_transition ],
"text-underline-offset": [ test_length_transition ],
"text-decoration-thickness": [ test_length_transition ],
};
if (IsCSSPropertyPrefEnabled("layout.css.motion-path.enabled")) {
supported_properties["offset-path"] = [ test_path_function ];
supported_properties["offset-distance"] =
[ test_length_transition,
test_percent_transition,
test_length_unclamped,
test_percent_unclamped,
test_calc_wrapped_calc_transition ];
function test_offset_rotate_transition(prop) {
[
// No transition between a keyword and a fixed angle.
{ start: "auto", end: "0deg",
expected: "0deg" },
// "auto 45deg" to "auto 145 deg".
{ start: "auto 45deg", end: "auto 145deg",
expected: "auto 70deg" },
// "auto 130deg" to "auto 90deg".
{ start: "auto 130deg", end: "100grad auto",
expected: "auto 120deg" },
// "auto 0deg" to "auto 180deg".
{ start: "auto", end: "reverse",
expected: "auto 45deg" },
// "auto 45deg" to "auto 225deg".
{ start: "auto 45deg", end: "45deg reverse",
expected: "auto 90deg" },
// "auto -60deg" to "auto -360deg".
{ start: "auto -60deg",
end: "auto calc(90deg - 0.5turn - 300grad + 0rad)",
expected: "auto -135deg" },
].forEach(test => {
div.style.transitionProperty = 'none';
div.style[prop] = test.start;
is(cs[prop], test.start,
`offset-rotate: computed value before transition`);
div.style.transitionProperty = prop;
div.style[prop] = test.end;
is(cs[prop], test.expected,
`offset-rotate: interpolation of offset-rotate`);
// We check distance only if there is a transition.
if (test.end != test.expected) {
check_distance(prop, test.start, test.expected, test.end);
}
});
}
supported_properties["offset-rotate"] =
[ test_angle_transition,
test_offset_rotate_transition ];
// Note: offset-anchor supports "auto | <position>", and the tests for
// `auto` are already in wpt, so we don't test it here again.
supported_properties["offset-anchor"] =
[ test_background_position_transition ];
}
if (IsCSSPropertyPrefEnabled("layout.css.clip-path-path.enabled")) {
supported_properties["clip-path"].push(test_path_function);
}
if (IsCSSPropertyPrefEnabled("layout.css.font-variations.enabled")) {
supported_properties["font-variation-settings"] = [ test_font_variations_transition ];
}
if (IsCSSPropertyPrefEnabled("layout.css.individual-transform.enabled")) {
supported_properties["rotate"] = [ test_rotate_transition ];
supported_properties["scale"] = [ test_scale_transition ];
supported_properties["translate"] = [ test_translate_transition ];
}
if (IsCSSPropertyPrefEnabled("layout.css.scrollbar-color.enabled")) {
supported_properties["scrollbar-color"] = [
test_scrollbar_color_transition,
];
}
if (IsCSSPropertyPrefEnabled("layout.css.scroll-snap-v1.enabled")) {
supported_properties["scroll-margin-top"] = [
test_length_transition,
];
supported_properties["scroll-margin-right"] = [
test_length_transition,
];
supported_properties["scroll-margin-bottom"] = [
test_length_transition,
];
supported_properties["scroll-margin-left"] = [
test_length_transition,
];
supported_properties["scroll-padding-top"] = [
test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped,
];
supported_properties["scroll-padding-right"] = [
test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped,
];
supported_properties["scroll-padding-bottom"] = [
test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped,
];
supported_properties["scroll-padding-left"] = [
test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped,
];
}
// For properties which are well-tested by web-platform-tests, we don't need to
// test animations/transitions again on them.
var skipped_transitionable_properties = [
"grid-template-columns",
"grid-template-rows",
]
// Logical properties.
for (const logical_side of ["inline-start", "inline-end", "block-start", "block-end"]) {
supported_properties["border-" + logical_side + "-color"] = supported_properties["border-top-color"];
supported_properties["border-" + logical_side + "-width"] = supported_properties["border-top-width"];
supported_properties["margin-" + logical_side] = supported_properties["margin-top"];
supported_properties["padding-" + logical_side] = supported_properties["padding-top"];
supported_properties["inset-" + logical_side] = supported_properties["top"];
if (IsCSSPropertyPrefEnabled("layout.css.scroll-snap-v1.enabled")) {
supported_properties["scroll-margin-" + logical_side] = supported_properties["scroll-margin-top"];
supported_properties["scroll-padding-" + logical_side] = supported_properties["scroll-padding-top"];
}
}
for (const logical_size of ["inline", "block"]) {
supported_properties[logical_size + "-size"] = supported_properties["width"];
supported_properties["min-" + logical_size + "-size"] = supported_properties["min-width"];
supported_properties["max-" + logical_size + "-size"] = supported_properties["max-width"];
}
var div = document.getElementById("display");
var OMTAdiv = document.getElementById("transformTest");
var cs = getComputedStyle(div, "");
var OMTACs = getComputedStyle(OMTAdiv, "");
var winUtils = SpecialPowers.getDOMWindowUtils(window);
function computeMatrix(v) {
div.style.setProperty("transform", v, "");
var result = cs.getPropertyValue("transform");
div.style.removeProperty("transform");
return result;
}
var c_rot_15 = computeMatrix("rotate(15deg)");
is(c_rot_15.substring(0,6), "matrix", "should compute to matrix value");
var c_rot_60 = computeMatrix("rotate(60deg)");
is(c_rot_60.substring(0,6), "matrix", "should compute to matrix value");
var transformTests = [
// rotate
{ start: 'none', end: 'rotate(60deg)',
expected_uncomputed: 'rotate(15deg)',
expected: c_rot_15 },
{ start: 'rotate(0)', end: 'rotate(60deg)',
expected_uncomputed: 'rotate(15deg)',
expected: c_rot_15 },
{ start: 'rotate(0deg)', end: 'rotate(60deg)',
expected_uncomputed: 'rotate(15deg)',
expected: c_rot_15 },
{ start: 'none', end: c_rot_60,
expected: c_rot_15 },
{ start: 'none', end: 'rotate(360deg)',
expected_uncomputed: 'rotate(90deg)',
expected: computeMatrix('rotate(90deg)') },
{ start: 'none', end: 'rotatez(360deg)',
expected_uncomputed: 'rotate(90deg)',
expected: computeMatrix('rotate(90deg)') },
{ start: 'none', end: 'rotate(720deg)',
expected_uncomputed: 'rotate(180deg)',
expected: computeMatrix('rotate(180deg)') },
{ start: 'none', end: 'rotate(720deg)',
expected_uncomputed: 'rotatez(180deg)',
expected: computeMatrix('rotate(180deg)') },
{ start: 'none', end: 'rotate(1080deg)',
expected_uncomputed: 'rotate(270deg)',
expected: computeMatrix('rotate(270deg)') },
{ start: 'none', end: 'rotate(1080deg)',
expected_uncomputed: 'rotate(270deg)',
expected: computeMatrix('rotatez(270deg)') },
{ start: 'none', end: 'rotate(1440deg)',
expected_uncomputed: 'rotate(360deg)',
expected: computeMatrix('scale(1)'),
round_error_ok: true },
{ start: 'none', end: 'rotatey(60deg)',
expected_uncomputed: 'rotatey(15deg)',
expected: computeMatrix('rotatey(15deg)') },
{ start: 'none', end: 'rotatey(720deg)',
expected_uncomputed: 'rotatey(180deg)',
expected: computeMatrix('rotatey(180deg)') },
{ start: 'none', end: 'rotatex(60deg)',
expected_uncomputed: 'rotatex(15deg)',
expected: computeMatrix('rotatex(15deg)') },
{ start: 'none', end: 'rotatex(720deg)',
expected_uncomputed: 'rotatex(180deg)',
expected: computeMatrix('rotatex(180deg)') },
// translate
{ start: 'translate(20px)', end: 'none',
expected_uncomputed: 'translate(15px)',
expected: 'matrix(1, 0, 0, 1, 15, 0)' },
{ start: 'translate(20px, 12px)', end: 'none',
expected_uncomputed: 'translate(15px, 9px)',
expected: 'matrix(1, 0, 0, 1, 15, 9)' },
{ start: 'translateX(-20px)', end: 'none',
expected_uncomputed: 'translateX(-15px)',
expected: 'matrix(1, 0, 0, 1, -15, 0)' },
{ start: 'translateY(-40px)', end: 'none',
expected_uncomputed: 'translateY(-30px)',
expected: 'matrix(1, 0, 0, 1, 0, -30)' },
{ start: 'translateZ(40px)', end: 'none',
expected_uncomputed: 'translateZ(30px)',
expected: 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 30, 1)' },
{ start: 'none', end: 'translate3D(40px, 60px, -40px)',
expected_uncomputed: 'translate3D(10px, 15px, -10px)',
expected: 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 10, 15, -10, 1)' },
// percentages are relative to 300px (width) and 50px (height)
// per the prerequisites in property_database.js
{ start: 'translate(20%)', end: 'none',
expected_uncomputed: 'translate(15%)',
expected: 'matrix(1, 0, 0, 1, 45, 0)',
round_error_ok: true },
{ start: 'translate(20%, 12%)', end: 'none',
expected_uncomputed: 'translate(15%, 9%)',
expected: 'matrix(1, 0, 0, 1, 45, 4.5)',
round_error_ok: true },
{ start: 'translateX(-20%)', end: 'none',
expected_uncomputed: 'translateX(-15%)',
expected: 'matrix(1, 0, 0, 1, -45, 0)',
round_error_ok: true },
{ start: 'translateY(-40%)', end: 'none',
expected_uncomputed: 'translateY(-30%)',
expected: 'matrix(1, 0, 0, 1, 0, -15)',
round_error_ok: true },
{ start: 'none', end: 'rotate(90deg) translate(20%, 20%) rotate(-90deg)',
expected_uncomputed: 'rotate(22.5deg) translate(5%, 5%) rotate(-22.5deg)',
round_error_ok: true },
{ start: 'none', end: 'rotate(-90deg) translate(20%, 20%) rotate(90deg)',
expected_uncomputed: 'rotate(-22.5deg) translate(5%, 5%) rotate(22.5deg)',
round_error_ok: true },
// test percent translation using matrix decomposition
{ start: 'matrix(1, 0, 0, 1, 0, 0)',
end: 'rotate(90deg) translate(20%, 20%) rotate(-90deg)',
expected: 'matrix(1, 0, 0, 1, -2.5, 15)',
round_error_ok: true },
{ start: 'matrix(1, 0, 0, 1, 0, 0)',
end: 'rotate(-90deg) translate(20%, 20%) rotate(90deg)',
expected: 'matrix(1, 0, 0, 1, 2.5, -15)',
round_error_ok: true },
// test calc() in translate
// Note that font-size: is 20px, and that percentages are relative
// to 300px (width) and 50px (height) per the prerequisites in
// property_database.js
{ start: 'translateX(20%)', /* 60px */
end: 'translateX(calc(10% + 1em))', /* 30px + 20px = 50px */
expected_uncomputed: 'translateX(calc(17.5% + 0.25em))',
expected: 'matrix(1, 0, 0, 1, 57.5, 0)' },
{ start: 'translate(calc(0.75 * 3em + 1.5 * 10%), calc(0.5 * 5em + 0.5 * 8%))', /* 90px, 52px */
end: 'rotate(90deg) translateY(20%) rotate(90deg) translateY(calc(10% + 0.5em)) rotate(180deg)', /* -10px, -15px */
expected: 'matrix(1, 0, 0, 1, 65, 35.25)' },
// scale
{ start: 'scale(2)', end: 'none',
expected_uncomputed: 'scale(1.75)',
expected: 'matrix(1.75, 0, 0, 1.75, 0, 0)' },
{ start: 'none', end: 'scale(0.4)',
expected_uncomputed: 'scale(0.85)',
expected: 'matrix(0.85, 0, 0, 0.85, 0, 0)',
round_error_ok: true },
{ start: 'scale(2)', end: 'scale(-2)',
expected_uncomputed: 'scale(1)',
expected: 'matrix(1, 0, 0, 1, 0, 0)' },
{ start: 'scale(2)', end: 'scale(-6)',
expected_uncomputed: 'scale(0)',
expected: 'matrix(0, 0, 0, 0, 0, 0)' },
{ start: 'scale(2, 0.4)', end: 'none',
expected_uncomputed: 'scale(1.75, 0.55)',
expected: 'matrix(1.75, 0, 0, 0.55, 0, 0)',
round_error_ok: true },
{ start: 'scaleX(3)', end: 'none',
expected_uncomputed: 'scaleX(2.5)',
expected: 'matrix(2.5, 0, 0, 1, 0, 0)' },
{ start: 'scaleY(5)', end: 'none',
expected_uncomputed: 'scaleY(4)',
expected: 'matrix(1, 0, 0, 4, 0, 0)' },
{ start: 'scaleZ(5)', end: 'none',
expected_uncomputed: 'scaleZ(4)',
expected: 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 4, 0, 0, 0, 0, 1)' },
{ start: 'none', end: 'scale3D(5, 5, 5)',
expected_uncomputed: 'scale3D(2, 2, 2)',
expected: 'matrix3d(2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1)' },
// skew
{ start: 'skewX(45deg)', end: 'none',
expected_uncomputed: 'skewX(33.75deg)' },
{ start: 'skewY(45deg)', end: 'none',
expected_uncomputed: 'skewY(33.75deg)' },
{ start: 'skew(45deg)', end: 'none',
expected_uncomputed: 'skew(33.75deg)' },
{ start: 'skew(45deg, 45deg)', end: 'none',
expected_uncomputed: 'skew(33.75deg, 33.75deg)' },
{ start: 'skewX(45deg)', end: 'skewX(-45deg)',
expected_uncomputed: 'skewX(22.5deg)' },
{ start: 'skewX(0)', end: 'skewX(-45deg)',
expected_uncomputed: 'skewX(-11.25deg)' },
{ start: 'skewY(45deg)', end: 'skewY(-45deg)',
expected_uncomputed: 'skewY(22.5deg)' },
// matrix : skewX
{ start: 'matrix(1, 0, 3, 1, 0, 0)', end: 'none',
expected: 'matrix(1, 0, ' + 3 * 0.75 + ', 1, 0, 0)',
round_error_ok: true },
{ start: 'skewX(0)', end: 'skewX(-45deg) translate(0)',
expected_uncomputed: 'skewX(-11.25deg) translate(0)' },
// matrix : rotate
{ start: 'rotate(-30deg)', end: 'matrix(0, 1, -1, 0, 0, 0)',
expected: 'matrix(1, 0, 0, 1, 0, 0)',
round_error_ok: true },
{ start: 'rotate(-30deg) translateX(0)',
end: 'translateX(0) rotate(-90deg)',
expected: computeMatrix('rotate(-45deg)'),
round_error_ok: true },
// extended shorter transform list
{ start: 'skewY(60deg)', end: 'skewY(-60deg) translateX(0)',
expected_uncomputed: 'skewY(30deg) translateX(0)' },
// matrix decomposition
// Four pairs of the same matrix expressed different ways.
{ start: 'matrix(-1, 0, 0, -1, 0, 0)', /* rotate(180deg) */
end: 'matrix(1, 0, 0, 1, 0, 0)',
expected: computeMatrix('rotate(135deg)') },
{ start: 'scale(-1)', end: 'none',
expected_uncomputed: 'scale(-0.5)',
expected: 'matrix(-0.5, 0, 0, -0.5, 0, 0)' },
{ start: 'rotate(180deg)', end: 'none',
expected_uncomputed: 'rotate(135deg)' },
{ start: 'rotate(-180deg)', end: 'none',
expected_uncomputed: 'rotate(-135deg)',
expected: computeMatrix('rotate(225deg)') },
// matrix followed by scale
{ start: 'matrix(2, 0, 0, 2, 10, 20) scale(2)',
end: 'none',
expected: 'matrix(3.0625, 0, 0, 3.0625, 7.5, 15)' },
// ... and a bunch of similar possibilities. The spec isn't settled
// here; there are multiple options. See:
// http://lists.w3.org/Archives/Public/www-style/2010Jun/0602.html
{ start: 'matrix(-1, 0, 0, 1, 0, 0)', /* scaleX(-1) */
end: 'matrix(1, 0, 0, 1, 0, 0)',
expected: computeMatrix('scaleX(-0.5)') },
{ start: 'matrix(1, 0, 0, -1, 0, 0)', /* rotate(-180deg) scaleX(-1) */
end: 'matrix(1, 0, 0, 1, 0, 0)',
expected: computeMatrix('rotate(-135deg) scaleX(-0.5)') },
{ start: 'matrix(0, 1, 1, 0, 0, 0)', /* rotate(-90deg) scaleX(-1) */
end: 'matrix(1, 0, 0, 1, 0, 0)',
expected: computeMatrix('rotate(-67.5deg) scaleX(-0.5)') },
{ start: 'matrix(0, -1, 1, 0, 0, 0)', /* rotate(-90deg) */
end: 'matrix(1, 0, 0, 1, 0, 0)',
expected: computeMatrix('rotate(-67.5deg)') },
{ start: 'matrix(0, 1, -1, 0, 0, 0)', /* rotate(90deg) */
end: 'matrix(1, 0, 0, 1, 0, 0)',
expected: computeMatrix('rotate(67.5deg)') },
{ start: 'matrix(0, -1, -1, 0, 0, 0)', /* rotate(90deg) scaleX(-1) */
end: 'matrix(1, 0, 0, 1, 0, 0)',
expected: computeMatrix('rotate(67.5deg) scaleX(-0.5)') },
// Similar decomposition tests, but with skewX. I checked visually
// that the sign of the skew was correct by checking visually that
// the animations in
// https://dbaron.org/css/test/2010/transition-negative-determinant
// don't flip when they finish, and then wrote tests corresponding
// to the current code's behavior.
// ... start with four with positive determinants
{ start: 'none',
end: 'matrix(1, 0, 1.5, 1, 0, 0)',
/* skewX(atan(1.5)) */
expected: 'matrix(1, 0, ' + 1.5 * 0.25 + ', 1, 0, 0)',
round_error_ok: true },
{ start: 'none',
end: 'matrix(-1, 0, 2, -1, 0, 0)',
/* rotate(180deg) skewX(atan(-2)) */
expected: computeMatrix('rotate(45deg) matrix(1, 0, ' + -2 * 0.25 + ', 1, 0, 0)'),
round_error_ok: true },
{ start: 'none',
end: 'matrix(0, -1, 1, -3, 0, 0)',
/* rotate(-90deg) skewX(atan(3)) */
expected: computeMatrix('rotate(-22.5deg) matrix(1, 0, ' + 3 * 0.25 + ', 1, 0, 0)'),
round_error_ok: true },
{ start: 'none',
end: 'matrix(0, 1, -1, 4, 0, 0)',
/* rotate(90deg) skewX(atan(4)) */
expected: computeMatrix('rotate(22.5deg) matrix(1, 0, ' + 4 * 0.25 + ', 1, 0, 0)'),
round_error_ok: true },
// and then four with negative determinants
{ start: 'none',
end: 'matrix(1, 0, 1, -1, 0, 0)',
/* rotate(-180deg) skewX(atan(-1)) scaleX(-1) */
expected: computeMatrix('rotate(-45deg) matrix(1, 0, ' + -1 * 0.25 + ', 1, 0, 0) scaleX(0.5)'),
round_error_ok: true },
{ start: 'none',
end: 'matrix(-1, 0, -1, 1, 0, 0)',
/* skewX(atan(-1)) scaleX(-1) */
expected: computeMatrix('matrix(1, 0, ' + -1 * 0.25 + ', 1, 0, 0) scaleX(0.5)') },
{ start: 'none',
end: 'matrix(0, 1, 1, -2, 0, 0)',
/* rotate(-90deg) skewX(atan(2)) scaleX(-1) */
expected: computeMatrix('rotate(-22.5deg) matrix(1, 0, ' + 2 * 0.25 + ', 1, 0, 0) scaleX(0.5)'),
round_error_ok: true },
{ start: 'none',
end: 'matrix(0, -1, -1, 0.5, 0, 0)',
/* rotate(90deg) skewX(atan(0.5)) scaleX(-1) */
expected: computeMatrix('rotate(22.5deg) matrix(1, 0, ' + 0.5 * 0.25 + ', 1, 0, 0) scaleX(0.5)'),
round_error_ok: true },
// lists
{ start: 'translate(10px) skewY(45deg)',
end: 'translate(30px) skewY(-45deg)',
expected_uncomputed: 'translate(15px) skewY(22.5deg)' },
{ start: 'skewY(45deg) rotate(90deg)',
end: 'skewY(-45deg) rotate(90deg)',
expected_uncomputed: 'skewY(22.5deg) rotate(90deg)' },
{ start: 'skewX(45deg) rotate(90deg)',
end: 'skewX(-45deg) rotate(90deg)',
expected_uncomputed: 'skewX(22.5deg) rotate(90deg)' },
// extended lists
{ start: 'skewY(45deg) rotate(90deg) translate(0)',
end: 'skewY(-45deg) rotate(90deg)',
expected_uncomputed: 'skewY(22.5deg) rotate(90deg) translate(0)' },
{ start: 'skewX(-60deg) rotate(90deg) translate(0)',
end: 'skewX(60deg) rotate(90deg)',
expected_uncomputed: 'skewX(-30deg) rotate(90deg) translate(0)' },
];
// Even if the default reference-box of shape-outside is margin-box, which is
// different from the default reference-box of clip-path, we still can reuse
// these tests for both properties because we always explicitly assign a
// reference-box (i.e. border-box or content-box) if needed.
// Bug 1313619: Add some tests for two basic shapes with an explicit
// reference-box and a default one.
const basicShapesTests = [
{ start: "none", end: "none",
expected: ["none"] },
// none to shape
{ start: "none",
end: "circle(500px at 500px 500px) border-box",
expected: ["circle", ["500px at 500px 500px"], "border-box"]
},
{ start: "none",
end: "ellipse(500px 500px at 500px 500px) border-box",
expected: ["ellipse", ["500px 500px at 500px 500px"], "border-box"]
},
{ start: "none",
end: "polygon(evenodd, 500px 500px, 500px 500px) border-box",
expected: ["polygon", ["evenodd, 500px 500px, 500px 500px"], "border-box"]
},
{ start: "none",
end: "inset(500px 500px 500px 500px round 500px 500px) border-box",
expected: ["inset", ["500px round 500px"], "border-box"]
},
// matching functions
{ start: "circle(100px)", end: "circle(500px)",
expected: ["circle", ["200px at 50% 50%"]] },
{ start: "ellipse(100px 100px)", end: "ellipse(500px 500px)",
expected: ["ellipse", ["200px 200px at 50% 50%"]] },
{ start: "circle(100px at 100px 100px) border-box",
end: "circle(500px at 500px 500px) border-box",
expected: ["circle", ["200px at 200px 200px"], "border-box"]
},
{ start: "ellipse(100px 100px at 100px 100px) border-box",
end: "ellipse(500px 500px at 500px 500px) border-box",
expected: ["ellipse", ["200px 200px at 200px 200px"], "border-box"]
},
{ start: "polygon(evenodd, 100px 100px, 100px 100px) border-box",
end: "polygon(evenodd, 500px 500px, 500px 500px) border-box",
expected: ["polygon", ["evenodd, 200px 200px, 200px 200px"], "border-box"]
},
{ start: "inset(100px 100px 100px 100px round 100px 100px) border-box",
end: "inset(500px 500px 500px 500px round 500px 500px) border-box",
expected: ["inset", ["200px round 200px"], "border-box"]
},
// matching functions percentage
{ start: "circle(100%)", end: "circle(500%)",
expected: ["circle", ["200% at 50% 50%"]] },
{ start: "ellipse(100% 100%)", end: "ellipse(500% 500%)",
expected: ["ellipse", ["200% 200% at 50% 50%"]] },
{ start: "circle(100% at 100% 100%) border-box",
end: "circle(500% at 500% 500%) border-box",
expected: ["circle", ["200% at 200% 200%"], "border-box"]
},
{ start: "ellipse(100% 100% at 100% 100%) border-box",
end: "ellipse(500% 500% at 500% 500%) border-box",
expected: ["ellipse", ["200% 200% at 200% 200%"], "border-box"]
},
{ start: "polygon(evenodd, 100% 100%, 100% 100%) border-box",
end: "polygon(evenodd, 500% 500%, 500% 500%) border-box",
expected: ["polygon", ["evenodd, 200% 200%, 200% 200%"], "border-box"]
},
{ start: "inset(100% 100% 100% 100% round 100% 100%) border-box",
end: "inset(500% 500% 500% 500% round 500% 500%) border-box",
expected: ["inset", ["200% round 200%"], "border-box"] },
// matching functions with calc() values
{ start: "circle(calc(80px + 20px))", end: "circle(calc(200px + 300px))",
expected: ["circle", ["200px at 50% 50%"]] },
{ start: "circle(calc(80% + 20%))", end: "circle(calc(200% + 300%))",
expected: ["circle", ["200% at 50% 50%"]] },
{ start: "circle(calc(10px + 20%))", end: "circle(calc(50px + 40%))",
expected: ["circle", ["calc(25% + 20px) at 50% 50%"]] },
// matching functions with interpolation between percentage/pixel values
{ start: "circle(20px)", end: "circle(100%)",
expected: ["circle", ["calc(25% + 15px) at 50% 50%"]] },
{ start: "ellipse(100% 100px at 8px 20%) border-box",
end: "ellipse(40px 4% at 80% 60px) border-box",
expected: ["ellipse", ["calc(75% + 10px) calc(1% + 75px) at " +
"calc(20% + 6px) calc(15% + 15px)"],
"border-box"] },
// no interpolation for keywords
{ start: "circle()", end: "circle(50px)",
expected: ["circle", ["50px at 50% 50%"]] },
{ start: "circle(closest-side)", end: "circle(500px)",
expected: ["circle", ["500px at 50% 50%"]] },
{ start: "circle(farthest-side)", end: "circle(500px)",
expected: ["circle", ["500px at 50% 50%"]] },
{ start: "circle(500px)", end: "circle(farthest-side)",
expected: ["circle", ["farthest-side at 50% 50%"]]},
{ start: "circle(500px)", end: "circle(closest-side)",
expected: ["circle", ["at 50% 50%"]]},
{ start: "ellipse()", end: "ellipse(50px 50px)",
expected: ["ellipse", ["50px 50px at 50% 50%"]] },
{ start: "ellipse(closest-side closest-side)", end: "ellipse(500px 500px)",
expected: ["ellipse", ["500px 500px at 50% 50%"]] },
{ start: "ellipse(farthest-side closest-side)", end: "ellipse(500px 500px)",
expected: ["ellipse", ["500px 500px at 50% 50%"]] },
{ start: "ellipse(farthest-side farthest-side)", end: "ellipse(500px 500px)",
expected: ["ellipse", ["500px 500px at 50% 50%"]] },
{ start: "ellipse(500px 500px)", end: "ellipse(farthest-side farthest-side)",
expected: ["ellipse", ["farthest-side farthest-side at 50% 50%"]] },
{ start: "ellipse(500px 500px)", end: "ellipse(closest-side closest-side)",
expected: ["ellipse", ["at 50% 50%"]] },
// mismatching boxes
{ start: "circle(100px at 100px 100px) border-box",
end: "circle(500px at 500px 500px) content-box",
expected: ["circle", ["500px at 500px 500px"], "content-box"]
},
{ start: "ellipse(100px 100px at 100px 100px) border-box",
end: "ellipse(500px 500px at 500px 500px) content-box",
expected: ["ellipse", ["500px 500px at 500px 500px"], "content-box"]
},
{ start: "polygon(evenodd, 100px 100px, 100px 100px) border-box",
end: "polygon(evenodd, 500px 500px, 500px 500px) content-box",
expected: ["polygon", ["evenodd, 500px 500px, 500px 500px"], "content-box"]
},
{ start: "inset(100px 100px 100px 100px round 100px 100px) border-box",
end: "inset(500px 500px 500px 500px round 500px 500px) content-box",
expected: ["inset", ["500px round 500px"], "content-box"]
},
// mismatching functions
{ start: "circle(100px at 100px 100px) border-box",
end: "ellipse(500px 500px at 500px 500px) border-box",
expected: ["ellipse", ["500px 500px at 500px 500px"], "border-box"]
},
{ start: "inset(0px round 20px)", end: "ellipse(500px 500px)",
expected: ["ellipse", ["500px 500px at 50% 50%"]]
},
// shape to reference box
{ start: "circle(20px)", end: "content-box", expected: ["content-box"] },
{ start: "content-box", end: "circle(20px)", expected: ["circle", ["20px at 50% 50%"]] },
// url to shape
{ start: "circle(20px)", end: "url(http://localhost/a.png)", expected: ["url", ["\"http://localhost/a.png\""]] },
{ start: "url(http://localhost/a.png)", end: "circle(20px)", expected: ["circle", ["20px at 50% 50%"]] },
// url to none
{ start: "none", end: "url(http://localhost/a.png)", expected: ["url", ["\"http://localhost/a.png\""]] },
{ start: "http://localhost/a.png", end: "none", expected: ["none"] },
];
const basicShapesWithFragmentUrlTests = [
// Fragment url to shape
{ start: "circle(20px)", end: "url('#a')", expected: ["url", ["\"#a\""]] },
{ start: "url('#a')", end: "circle(20px)", expected: ["circle", ["20px at 50% 50%"]] },
// Fragment url to none
{ start: "none", end: "url('#a')", expected: ["url", ["\"#a\""]] },
{ start: "url('#a')", end: "none", expected: ["none"] },
];
// We have a lot of tests in web-platform-tests already, so here we only test
// basic interpolation cases.
const pathFunctionTests = [
{ start: "none", end: "none",
expected: ["none"] },
// none to path
{ start: "none",
end: "path('M 100 100')",
expected: ["path", '"M 100 100"']
},
// path to none
{ start: "path('M 100 100')",
end: "none",
expected: ["none"]
},
// mismatch
{
start: "path('M 0 0 H 100 H 200')",
end: "path('M 0 0 H 500')",
expected: ["path", '"M 0 0 H 500"']
},
{
start: "path('M 0 0 V 100')",
end: "path('M 0 0 H 500')",
expected: ["path", '"M 0 0 H 500"']
},
// match
{
start: "path('M 100 100')",
end: "path('M 100 500')",
expected: ["path", '"M 100 200"']
},
{
start: "path('M 10 10 L 100 100')",
end: "path('M 10 10 L 100 500')",
expected: ["path", '"M 10 10 L 100 200"']
},
{
start: "path('M 10 10 H 100')",
end: "path('M 10 10 H 500')",
expected: ["path", '"M 10 10 H 200"']
},
{
start: "path('M 10 10 V 100')",
end: "path('M 10 10 V 500')",
expected: ["path", '"M 10 10 V 200"']
},
{
start: "path('M 10 10 C 32 42 52 62 120 2200')",
end: "path('M 10 10 C 40 50 60 70 200 3000')",
expected: ["path", '"M 10 10 C 34 44 54 64 140 2400"']
},
{
start: "path('M 10 10 S 45 67 89 123')",
end: "path('M 10 10 S 61 51 113 99')",
expected: ["path", '"M 10 10 S 49 63 95 117"']
},
{
start: "path('M 10 10 Q 32 42 120 2200')",
end: "path('M 10 10 Q 40 50 200 3000')",
expected: ["path", '"M 10 10 Q 34 44 140 2400"']
},
{
start: "path('M 10 10 T 100 200')",
end: "path('M 10 10 T 500 280')",
expected: ["path", '"M 10 10 T 200 220"']
},
{
start: "path('M 10 10 A 10 20 30 0 1 140 450')",
end: "path('M 10 10 A 50 60 70 0 1 380 290')",
expected: ["path", '"M 10 10 A 20 30 40 0 1 200 410"']
},
{
start: "path('M 10 10 A 10 20 30 1 0 140 450')",
end: "path('M 10 10 A 50 60 70 0 1 380 290')",
expected: ["path", '"M 10 10 A 20 30 40 1 0 200 410"']
},
// mix relative and absolute coordinates
{
start: "path('m 10 20 h 30 v 60 h 10 v -10 l 110 60')",