Me and SVG
So here's a question:JSON is to XML what ___ is to SVG. What is in the blank?There's just so much complexity in even the 1.1 spec.Patterns, for example, are given the default of specifying the width and height of the area to be repeated in objectBoundingBox units. But the arbitrarily complex content has its units defined in terms of the userspace units derived from the context in which the pattern itself is used.Now, if you play around with patterns for a bit you can certainly figure out the logic of those defaults. Most likely the author doesn't want the aspect ratio of the pattern content to change based on the width/height specified for the pattern viewbox. Hence patternContentUnits defaults to "userSpaceOnUse". On the other hand, the author likely wants to control the total number of columns/rows that will be displayed. Hence patternUnits defaults to "objectBoundingBox", where you can do the math for 1/width for rows and 1/height for columns.But then when you try to do actual work using those defaults-- say, filling a rectangle with a pattern that displays four small circles as "nails" in the corners of the rectangle-- it doesn't work. The patternUnits attribute isn't expressive enough to let you specify a way to attach each pattern iteration to a corner of the shape. You can achieve that for a particular bounding box, but it isn't easy. So the logical though complex default isn't particularly expressive in practice, and the more sane, less expressive way to do patterns requires non-default attributes.I run into similar such problems with many of the SVG 1.1 features. There's an incredible amount of complexity, but not a matching amount of expressivity gained for it. Even something like grabbing or setting a value for height/width/x/y is made more complex because the DOM is storing both a base value and an additional value should the user happen to have specified declarative animation on the element. But then declarative animation isn't implemented in all browsers after all this time-- nor is it as easy to work with as the burgeoning web animations API.