From fe27f4b31aa7615ca97fcf75d8a24837de09e791 Mon Sep 17 00:00:00 2001
From: Eric Willigers <>
Date: Fri, 30 Mar 2018 17:52:45 +1100
Subject: [PATCH] Remove support for segment-completing close path
Segment-completing close path commands, where coordinates are omitted
and implicitly replaced with the initial point of the subpath,
lack implementations and have been removed from the spec.
Discussed in #385
---
master/paths.html | 101 ++++++----------------------------------------
1 file changed, 12 insertions(+), 89 deletions(-)
diff --git a/master/paths.html b/master/paths.html
index d8cc2200..621c6bc9 100644
--- a/master/paths.html
+++ b/master/paths.html
@@ -340,33 +340,13 @@
The "moveto" commands
The "closepath" command
The "closepath" (Z or z)
- must end the current subpath by connecting it back to its initial point
- in either of two ways:
+ ends the current subpath by connecting it back to its initial point.
+ An automatic
+ straight line is drawn from the current point to the initial point
+ of the current subpath. This path segment may be of zero
+ length.
-
- -
- If the previous command is
complete
, that is that all the
- required coordinate data has been supplied, then an automatic
- straight line must be drawn from the current point to the initial point
- of the current subpath. This path segment may be of zero
- length.
-
- -
- If the previous command is a "lineto",
- "curveto",
- "smooth curveto",
- "quadratic Bézier curveto",
- "smooth quadratic Bézier curveto",
- or "elliptical arc",
- that is missing required coordinate data,
- then this is a segment-completing close path command.
- No additional path segment is generated by the command; instead,
- the initial point for this subpath must be used
- in place of each missing (x,y) coordinate to complete the previous segment.
-
-
-
Command |
@@ -386,22 +366,6 @@ The "closepath" command
-
- SVG 2 adds the ability to fill in missing coordinate data with
- the Z or z command to avoid the
- need to add a zero length (or very short in the case of relative
- paths with rounding errors) path segment to close a subpath. This
- can effect the number of markers drawn and their orientation at
- the beginning/end of a closed subpath.
-
-
- The use of Z or z to replace
- missing coordinate data with the coordinate of the initial point in
- a subpath was resolved at the
- Sydney
- (2015) meeting.
-
-
A closed subpath must be closed with a
"closepath" command, this "joins" the first and last path segments.
Any other path is an open subpath.
@@ -421,39 +385,6 @@ The "closepath" command
other command, then the next subpath must start at the same initial point
as the current subpath.
-Examples:
-
- -
- m 100,100 50,0 0,50 z:
-
- Implicit l command complete, z causes a
- straight line to be drawn resulting in a closed triangular path.
-
- -
- m 100,100 a 50,50 0 0 1 100,0 z:
-
- a command complete, z causes a
- straight line to be drawn resulting in a closed semi-circular path.
-
- -
- m 100,100 a 50,50 0 0 1 100,0 50,50 0 0 1 z:
-
- Second set of coordinates for the a command
- missing final point, z causes initial point to
- be used as final point resulting in a closed circular path.
-
- -
- m 100,100 a 50,50 0 0 1 100,0 c z:
-
- c command missing three coordinates,
- z causes initial point to be used as coordinate
- data for all c coordinates resulting in a
- closed semi-circle. Visually c
- z is the same as z but may be
- useful in animating path data.
-
-
-
The "lineto" commands
The various "lineto" commands draw straight lines from the
@@ -833,13 +764,13 @@
The grammar for path data
| elliptical_arc
moveto::=
- ( "M" | "m" ) wsp* coordinate_pair_sequence wsp* closepath?
+ ( "M" | "m" ) wsp* coordinate_pair_sequence
closepath::=
("Z" | "z")
lineto::=
- ("L"|"l") wsp* (coordinate_pair_sequence | closepath)
+ ("L"|"l") wsp* coordinate_pair_sequence
horizontal_lineto::=
("H"|"h") wsp* coordinate_sequence
@@ -848,35 +779,31 @@ The grammar for path data
("V"|"v") wsp* coordinate_sequence
curveto::=
- ("C"|"c") wsp* (curveto_coordinate_sequence | (coordinate_pair_sequence? closepath))
+ ("C"|"c") wsp* curveto_coordinate_sequence
curveto_coordinate_sequence::=
coordinate_pair_triplet
| (coordinate_pair_triplet comma_wsp? curveto_coordinate_sequence)
smooth_curveto::=
- ("S"|"s") wsp* (smooth_curveto_coordinate_sequence
- | (coordinate_pair_sequence? closepath))
+ ("S"|"s") wsp* smooth_curveto_coordinate_sequence
smooth_curveto_coordinate_sequence::=
coordinate_pair_double
| (coordinate_pair_double comma_wsp? smooth_curveto_coordinate_sequence)
quadratic_bezier_curveto::=
- ("Q"|"q") wsp*
- (quadratic_bezier_curveto_coordinate_sequence | (coordinate_pair_sequence? closepath))
+ ("Q"|"q") wsp* quadratic_bezier_curveto_coordinate_sequence
quadratic_bezier_curveto_coordinate_sequence::=
coordinate_pair_double
| (coordinate_pair_double comma_wsp? quadratic_bezier_curveto_coordinate_sequence)
smooth_quadratic_bezier_curveto::=
- ("T"|"t") wsp* (coordinate_pair_sequence | closepath)
+ ("T"|"t") wsp* coordinate_pair_sequence
elliptical_arc::=
- ( "A" | "a" ) wsp*
- (elliptical_arc_argument_sequence
- | (elliptical_arc_argument_sequence? elliptical_arc_closing_argument))
+ ( "A" | "a" ) wsp* elliptical_arc_argument_sequence
elliptical_arc_argument_sequence::=
elliptical_arc_argument
@@ -886,10 +813,6 @@ The grammar for path data
number comma_wsp? number comma_wsp? number comma_wsp
flag comma_wsp? flag comma_wsp? coordinate_pair
-elliptical_arc_closing_argument::=
- number comma_wsp? number comma_wsp? number comma_wsp
- flag comma_wsp? flag comma_wsp? closepath
-
coordinate_pair_double::=
coordinate_pair comma_wsp? coordinate_pair