This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23761 - "Zero-length line segments must be pruned" is a bit unclear. Presumably this doesn't apply just to lines, but to any zero length path segment? Maybe useng "path segment" instead of "line segment" in that case?
Summary: "Zero-length line segments must be pruned" is a bit unclear. Presumably this ...
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-07 16:24 UTC by contributor
Modified: 2013-11-25 19:29 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2013-11-07 16:24:56 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html
Multipage: http://www.whatwg.org/C#drawing-paths-to-the-canvas
Complete: http://www.whatwg.org/c#drawing-paths-to-the-canvas
Referrer: 

Comment:
"Zero-length line segments must be pruned" is a bit unclear. Presumably this
doesn't apply just to lines, but to any zero length path segment? Maybe useng
"path segment" instead of "line segment" in that case?

Posted from: 207.218.72.65
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:25.0) Gecko/20100101 Firefox/25.0
Comment 1 Ian 'Hixie' Hickson 2013-11-07 22:25:20 UTC
What's the difference?
Comment 2 Jonathan Watt 2013-11-07 22:36:23 UTC
"line segment" could be interpreted as a lineTo() segment. "path segment" doesn't have that ambiguity.
Comment 3 Ian 'Hixie' Hickson 2013-11-13 22:55:54 UTC
The term "path segment" doesn't appear in the spec currently (and would be confusing, since it sounds like the same thing as a "subpath"). "Line segment" appears three times, all in places where it wouldn't make sense to just refer to straight line segments or the output of lineTo(). I'm happy to use other terms, but I don't know what the right term is.

The term "line" is used all over the canvas spec to refer to things that aren't straight or lineTo() output. For example, "line caps", "line joins", "line styles", "line width", "line dash pattern"...
Comment 4 Jonathan Watt 2013-11-13 23:04:13 UTC
I don't think "path segment" sounds like the same thing as a "subpath". In fact the people I talk to use "subpath" to refer to refer specifically to a series of "path segments" that are not separated by a moveto command.
Comment 5 Ian 'Hixie' Hickson 2013-11-20 23:07:42 UTC
"sub" and "segment" mean almost the same thing, according to the dictionary.
Comment 6 Jonathan Watt 2013-11-20 23:11:46 UTC
???
Comment 7 Ian 'Hixie' Hickson 2013-11-21 19:14:04 UTC
From the Oxford dictionaries:
  segment: each of the parts into which something is or may be divided
  sub-: of a smaller size; of a subordinate nature

I think what we call "subpath" today could equally well be called "path segment", and therefore using one term for one thing and the other term for another thing would be at least as, and IMHO more, confusing than the current use of "line segments" to refer to both straight lines and curved lines (and, in this case, zero-length lines, which are neither, but could come from either APIs for making straight lines or APIs for making curved lines).

The definition of "segment" includes, under Geometry, "the part of a line included between two points". "line segment" seems therefore like the most appropriate term here. And we use "line" to mean things other than straight lines already in plenty of places including in the API, as noted above.

Having said that, if it's confusing, I'm happy to add more non-normative text that clarifies it. Would changing this:

# A path has a list of zero or more subpaths. Each subpath consists of a list 
# of one or more points, connected by straight or curved lines [...]

...to this (adding "segments") help?

: A path has a list of zero or more subpaths. Each subpath consists of a list 
: of one or more points, connected by straight or curved line segments [...]

I can't really see how to change this to be clearer:

# Zero-length line segments must be pruned before stroking a path.

All the changes I could come up with are subtly wrong (e.g. "Zero-length line segments (whether curved or straight)" doesn't make sense; the segments are zero-length and therefore neither curved nor straight by definition).
Comment 8 Ian 'Hixie' Hickson 2013-11-22 18:50:43 UTC
I've tried to improve matters slightly. Let me know if you think it's still confusing, and if so, what you think should be done, given comment 7. Thanks.
Comment 9 contributor 2013-11-22 18:51:57 UTC
Checked in as WHATWG revision r8308.
Check-in comment: Try to clarify the term 'line segments' with a cross-reference.
http://html5.org/tools/web-apps-tracker?from=8307&to=8308