| OLD | NEW |
| (Empty) |
| 1 description("This tests the SVG path segment DOM by creating paths and inspectin
g their properties."); | |
| 2 | |
| 3 var pathElement = document.createElementNS("http://www.w3.org/2000/svg", "path")
; | |
| 4 | |
| 5 shouldBe("SVGPathSeg.PATHSEG_UNKNOWN", "0"); | |
| 6 shouldBe("SVGPathSeg.PATHSEG_CLOSEPATH", "1"); | |
| 7 shouldBe("SVGPathSeg.PATHSEG_MOVETO_ABS", "2"); | |
| 8 shouldBe("SVGPathSeg.PATHSEG_MOVETO_REL", "3"); | |
| 9 shouldBe("SVGPathSeg.PATHSEG_LINETO_ABS", "4"); | |
| 10 shouldBe("SVGPathSeg.PATHSEG_LINETO_REL", "5"); | |
| 11 shouldBe("SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS", "6"); | |
| 12 shouldBe("SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL", "7"); | |
| 13 shouldBe("SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS", "8"); | |
| 14 shouldBe("SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL", "9"); | |
| 15 shouldBe("SVGPathSeg.PATHSEG_ARC_ABS", "10"); | |
| 16 shouldBe("SVGPathSeg.PATHSEG_ARC_REL", "11"); | |
| 17 shouldBe("SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS", "12"); | |
| 18 shouldBe("SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL", "13"); | |
| 19 shouldBe("SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS", "14"); | |
| 20 shouldBe("SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL", "15"); | |
| 21 shouldBe("SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS", "16"); | |
| 22 shouldBe("SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL", "17"); | |
| 23 shouldBe("SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS", "18"); | |
| 24 shouldBe("SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL", "19"); | |
| 25 | |
| 26 shouldBe("pathElement.createSVGPathSegClosePath().pathSegType", "SVGPathSeg.PATH
SEG_CLOSEPATH"); | |
| 27 shouldBe("pathElement.createSVGPathSegClosePath().pathSegTypeAsLetter", "'Z'"); | |
| 28 | |
| 29 shouldBe("pathElement.createSVGPathSegMovetoAbs(1, 2).pathSegType", "SVGPathSeg.
PATHSEG_MOVETO_ABS"); | |
| 30 shouldBe("pathElement.createSVGPathSegMovetoAbs(1, 2).pathSegTypeAsLetter", "'M'
"); | |
| 31 shouldBe("pathElement.createSVGPathSegMovetoAbs(1, 2).x", "1"); | |
| 32 shouldBe("pathElement.createSVGPathSegMovetoAbs(1, 2).y", "2"); | |
| 33 | |
| 34 shouldBe("pathElement.createSVGPathSegMovetoRel(1, 2).pathSegType", "SVGPathSeg.
PATHSEG_MOVETO_REL"); | |
| 35 shouldBe("pathElement.createSVGPathSegMovetoRel(1, 2).pathSegTypeAsLetter", "'m'
"); | |
| 36 shouldBe("pathElement.createSVGPathSegMovetoRel(1, 2).x", "1"); | |
| 37 shouldBe("pathElement.createSVGPathSegMovetoRel(1, 2).y", "2"); | |
| 38 | |
| 39 shouldBe("pathElement.createSVGPathSegLinetoAbs(1, 2).pathSegType", "SVGPathSeg.
PATHSEG_LINETO_ABS"); | |
| 40 shouldBe("pathElement.createSVGPathSegLinetoAbs(1, 2).pathSegTypeAsLetter", "'L'
"); | |
| 41 shouldBe("pathElement.createSVGPathSegLinetoAbs(1, 2).x", "1"); | |
| 42 shouldBe("pathElement.createSVGPathSegLinetoAbs(1, 2).y", "2"); | |
| 43 | |
| 44 shouldBe("pathElement.createSVGPathSegLinetoRel(1, 2).pathSegType", "SVGPathSeg.
PATHSEG_LINETO_REL"); | |
| 45 shouldBe("pathElement.createSVGPathSegLinetoRel(1, 2).pathSegTypeAsLetter", "'l'
"); | |
| 46 shouldBe("pathElement.createSVGPathSegLinetoRel(1, 2).x", "1"); | |
| 47 shouldBe("pathElement.createSVGPathSegLinetoRel(1, 2).y", "2"); | |
| 48 | |
| 49 shouldBe("pathElement.createSVGPathSegCurvetoCubicAbs(1, 2, 3, 4, 5, 6).pathSegT
ype", "SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS"); | |
| 50 shouldBe("pathElement.createSVGPathSegCurvetoCubicAbs(1, 2, 3, 4, 5, 6).pathSegT
ypeAsLetter", "'C'"); | |
| 51 shouldBe("pathElement.createSVGPathSegCurvetoCubicAbs(1, 2, 3, 4, 5, 6).x", "1")
; | |
| 52 shouldBe("pathElement.createSVGPathSegCurvetoCubicAbs(1, 2, 3, 4, 5, 6).y", "2")
; | |
| 53 shouldBe("pathElement.createSVGPathSegCurvetoCubicAbs(1, 2, 3, 4, 5, 6).x1", "3"
); | |
| 54 shouldBe("pathElement.createSVGPathSegCurvetoCubicAbs(1, 2, 3, 4, 5, 6).y1", "4"
); | |
| 55 shouldBe("pathElement.createSVGPathSegCurvetoCubicAbs(1, 2, 3, 4, 5, 6).x2", "5"
); | |
| 56 shouldBe("pathElement.createSVGPathSegCurvetoCubicAbs(1, 2, 3, 4, 5, 6).y2", "6"
); | |
| 57 | |
| 58 shouldBe("pathElement.createSVGPathSegCurvetoCubicRel(1, 2, 3, 4, 5, 6).pathSegT
ype", "SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL"); | |
| 59 shouldBe("pathElement.createSVGPathSegCurvetoCubicRel(1, 2, 3, 4, 5, 6).pathSegT
ypeAsLetter", "'c'"); | |
| 60 shouldBe("pathElement.createSVGPathSegCurvetoCubicRel(1, 2, 3, 4, 5, 6).x", "1")
; | |
| 61 shouldBe("pathElement.createSVGPathSegCurvetoCubicRel(1, 2, 3, 4, 5, 6).y", "2")
; | |
| 62 shouldBe("pathElement.createSVGPathSegCurvetoCubicRel(1, 2, 3, 4, 5, 6).x1", "3"
); | |
| 63 shouldBe("pathElement.createSVGPathSegCurvetoCubicRel(1, 2, 3, 4, 5, 6).y1", "4"
); | |
| 64 shouldBe("pathElement.createSVGPathSegCurvetoCubicRel(1, 2, 3, 4, 5, 6).x2", "5"
); | |
| 65 shouldBe("pathElement.createSVGPathSegCurvetoCubicRel(1, 2, 3, 4, 5, 6).y2", "6"
); | |
| 66 | |
| 67 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticAbs(1, 2, 3, 4).pathSegTyp
e", "SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS"); | |
| 68 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticAbs(1, 2, 3, 4).pathSegTyp
eAsLetter", "'Q'"); | |
| 69 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticAbs(1, 2, 3, 4).x", "1"); | |
| 70 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticAbs(1, 2, 3, 4).y", "2"); | |
| 71 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticAbs(1, 2, 3, 4).x1", "3"); | |
| 72 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticAbs(1, 2, 3, 4).y1", "4"); | |
| 73 | |
| 74 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticRel(1, 2, 3, 4).pathSegTyp
e", "SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL"); | |
| 75 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticRel(1, 2, 3, 4).pathSegTyp
eAsLetter", "'q'"); | |
| 76 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticRel(1, 2, 3, 4).x", "1"); | |
| 77 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticRel(1, 2, 3, 4).y", "2"); | |
| 78 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticRel(1, 2, 3, 4).x1", "3"); | |
| 79 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticRel(1, 2, 3, 4).y1", "4"); | |
| 80 | |
| 81 shouldBe("pathElement.createSVGPathSegArcAbs(1, 2, 3, 4, 5, false, false).pathSe
gType", "SVGPathSeg.PATHSEG_ARC_ABS"); | |
| 82 shouldBe("pathElement.createSVGPathSegArcAbs(1, 2, 3, 4, 5, false, false).pathSe
gTypeAsLetter", "'A'"); | |
| 83 shouldBe("pathElement.createSVGPathSegArcAbs(1, 2, 3, 4, 5, false, false).x", "1
"); | |
| 84 shouldBe("pathElement.createSVGPathSegArcAbs(1, 2, 3, 4, 5, false, false).y", "2
"); | |
| 85 shouldBe("pathElement.createSVGPathSegArcAbs(1, 2, 3, 4, 5, false, false).r1", "
3"); | |
| 86 shouldBe("pathElement.createSVGPathSegArcAbs(1, 2, 3, 4, 5, false, false).r2", "
4"); | |
| 87 shouldBe("pathElement.createSVGPathSegArcAbs(1, 2, 3, 4, 5, false, false).angle"
, "5"); | |
| 88 shouldBe("pathElement.createSVGPathSegArcAbs(1, 2, 3, 4, 5, false, false).largeA
rcFlag", "false"); | |
| 89 shouldBe("pathElement.createSVGPathSegArcAbs(1, 2, 3, 4, 5, true, false).largeAr
cFlag", "true"); | |
| 90 shouldBe("pathElement.createSVGPathSegArcAbs(1, 2, 3, 4, 5, false, false).sweepF
lag", "false"); | |
| 91 shouldBe("pathElement.createSVGPathSegArcAbs(1, 2, 3, 4, 5, false, true).sweepFl
ag", "true"); | |
| 92 | |
| 93 shouldBe("pathElement.createSVGPathSegArcRel(1, 2, 3, 4, 5, false, false).pathSe
gType", "SVGPathSeg.PATHSEG_ARC_REL"); | |
| 94 shouldBe("pathElement.createSVGPathSegArcRel(1, 2, 3, 4, 5, false, false).pathSe
gTypeAsLetter", "'a'"); | |
| 95 shouldBe("pathElement.createSVGPathSegArcRel(1, 2, 3, 4, 5, false, false).x", "1
"); | |
| 96 shouldBe("pathElement.createSVGPathSegArcRel(1, 2, 3, 4, 5, false, false).y", "2
"); | |
| 97 shouldBe("pathElement.createSVGPathSegArcRel(1, 2, 3, 4, 5, false, false).r1", "
3"); | |
| 98 shouldBe("pathElement.createSVGPathSegArcRel(1, 2, 3, 4, 5, false, false).r2", "
4"); | |
| 99 shouldBe("pathElement.createSVGPathSegArcRel(1, 2, 3, 4, 5, false, false).angle"
, "5"); | |
| 100 shouldBe("pathElement.createSVGPathSegArcRel(1, 2, 3, 4, 5, false, false).largeA
rcFlag", "false"); | |
| 101 shouldBe("pathElement.createSVGPathSegArcRel(1, 2, 3, 4, 5, true, false).largeAr
cFlag", "true"); | |
| 102 shouldBe("pathElement.createSVGPathSegArcRel(1, 2, 3, 4, 5, false, false).sweepF
lag", "false"); | |
| 103 shouldBe("pathElement.createSVGPathSegArcRel(1, 2, 3, 4, 5, false, true).sweepFl
ag", "true"); | |
| 104 | |
| 105 shouldBe("pathElement.createSVGPathSegLinetoHorizontalAbs(1).pathSegType", "SVGP
athSeg.PATHSEG_LINETO_HORIZONTAL_ABS"); | |
| 106 shouldBe("pathElement.createSVGPathSegLinetoHorizontalAbs(1).pathSegTypeAsLetter
", "'H'"); | |
| 107 shouldBe("pathElement.createSVGPathSegLinetoHorizontalAbs(1).x", "1"); | |
| 108 | |
| 109 shouldBe("pathElement.createSVGPathSegLinetoHorizontalRel(1).pathSegType", "SVGP
athSeg.PATHSEG_LINETO_HORIZONTAL_REL"); | |
| 110 shouldBe("pathElement.createSVGPathSegLinetoHorizontalRel(1).pathSegTypeAsLetter
", "'h'"); | |
| 111 shouldBe("pathElement.createSVGPathSegLinetoHorizontalRel(1).x", "1"); | |
| 112 | |
| 113 shouldBe("pathElement.createSVGPathSegLinetoVerticalAbs(1).pathSegType", "SVGPat
hSeg.PATHSEG_LINETO_VERTICAL_ABS"); | |
| 114 shouldBe("pathElement.createSVGPathSegLinetoVerticalAbs(1).pathSegTypeAsLetter",
"'V'"); | |
| 115 shouldBe("pathElement.createSVGPathSegLinetoVerticalAbs(1).y", "1"); | |
| 116 | |
| 117 shouldBe("pathElement.createSVGPathSegLinetoVerticalRel(1).pathSegType", "SVGPat
hSeg.PATHSEG_LINETO_VERTICAL_REL"); | |
| 118 shouldBe("pathElement.createSVGPathSegLinetoVerticalRel(1).pathSegTypeAsLetter",
"'v'"); | |
| 119 shouldBe("pathElement.createSVGPathSegLinetoVerticalRel(1).y", "1"); | |
| 120 | |
| 121 shouldBe("pathElement.createSVGPathSegCurvetoCubicSmoothAbs(1, 2, 3, 4).pathSegT
ype", "SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS"); | |
| 122 shouldBe("pathElement.createSVGPathSegCurvetoCubicSmoothAbs(1, 2, 3, 4).pathSegT
ypeAsLetter", "'S'"); | |
| 123 shouldBe("pathElement.createSVGPathSegCurvetoCubicSmoothAbs(1, 2, 3, 4).x", "1")
; | |
| 124 shouldBe("pathElement.createSVGPathSegCurvetoCubicSmoothAbs(1, 2, 3, 4).y", "2")
; | |
| 125 shouldBe("pathElement.createSVGPathSegCurvetoCubicSmoothAbs(1, 2, 3, 4).x2", "3"
); | |
| 126 shouldBe("pathElement.createSVGPathSegCurvetoCubicSmoothAbs(1, 2, 3, 4).y2", "4"
); | |
| 127 | |
| 128 shouldBe("pathElement.createSVGPathSegCurvetoCubicSmoothRel(1, 2, 3, 4).pathSegT
ype", "SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL"); | |
| 129 shouldBe("pathElement.createSVGPathSegCurvetoCubicSmoothRel(1, 2, 3, 4).pathSegT
ypeAsLetter", "'s'"); | |
| 130 shouldBe("pathElement.createSVGPathSegCurvetoCubicSmoothRel(1, 2, 3, 4).x", "1")
; | |
| 131 shouldBe("pathElement.createSVGPathSegCurvetoCubicSmoothRel(1, 2, 3, 4).y", "2")
; | |
| 132 shouldBe("pathElement.createSVGPathSegCurvetoCubicSmoothRel(1, 2, 3, 4).x2", "3"
); | |
| 133 shouldBe("pathElement.createSVGPathSegCurvetoCubicSmoothRel(1, 2, 3, 4).y2", "4"
); | |
| 134 | |
| 135 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticSmoothAbs(1, 2).pathSegTyp
e", "SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS"); | |
| 136 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticSmoothAbs(1, 2).pathSegTyp
eAsLetter", "'T'"); | |
| 137 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticSmoothAbs(1, 2).x", "1"); | |
| 138 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticSmoothAbs(1, 2).y", "2"); | |
| 139 | |
| 140 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticSmoothRel(1, 2).pathSegTyp
e", "SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL"); | |
| 141 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticSmoothRel(1, 2).pathSegTyp
eAsLetter", "'t'"); | |
| 142 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticSmoothRel(1, 2).x", "1"); | |
| 143 shouldBe("pathElement.createSVGPathSegCurvetoQuadraticSmoothRel(1, 2).y", "2"); | |
| 144 | |
| 145 successfullyParsed = true; | |
| OLD | NEW |