- From: Rick <graham.rick@gmail.com>
- Date: Thu, 24 Oct 2013 11:40:17 -0400
- To: Stephen Chenney <schenney@chromium.org>
- Cc: "www-svg@w3.org" <www-svg@w3.org>
- Message-ID: <CAGDjS3dPVSe0MnHUJ7Abr9BuPq4V5d-Wn9H+o2xHiGp2nf1Gog@mail.gmail.com>
The document is in error if required attributes are not supplied. I'm not sure where it says that, probably in the XML spec. Here's the defined behaviour. http://www.w3.org/TR/SVG/implnote.html#PathElementImplementationNotes On Thu, Oct 24, 2013 at 11:33 AM, Stephen Chenney <schenney@chromium.org>wrote: > I just came across some undefined behavior in the spec that could easily > be defined. An example is the > http://www.w3.org/TR/SVG/paths.html#InterfaceSVGPathElement spec. It has > absolutely nothing to say about cases where the calling script does not > provide all of the necessary parameters. I could find no blanket statement > in the spec about what to do in such cases. The canvas spec is similarly > unhelpful. > > e.g. what to do with > pathSegment = pathElement.createSVGPathSegCurvetoCubicAbs(1.0) > > Logical choices are either throw an exception or zero the missing values. > > Right now Chromium, and presumably WebKit, pass NaN through to the back > end, which is bad and which I plan to somehow fix. I haven't checkout other > browsers yet. > > The question is, what fix? > 1) Exception and return null object > 2) Exception but fill missing values with 0 > 3) Silently fill in missing values with 0. > > I'm liking 1 right now. > > Regardless of which option we choose, I think it would be helpful to have > a generic statement about this situation somewhere in the spec. > > Stephen. > -- *Would be fair to suggest that perhaps Obama didn't lie when you clearly saw his lips move?* * *
Received on Thursday, 24 October 2013 15:40:44 UTC