8 ms·
SVG 2 new features
- tambourine_man 10y agoMeta: I don't get HN's new dedup algorithm. I submitted the exact same link 5 days ago: https://news.ycombinator.com/item?id=12254324 https://news.ycombinator.com/item?id=12254324
- jffry 10y agoI _think_ I remember hearing that the dedup would allow resubmission of things that didn't originally get much traction/upvotes/comments, so that might be at play here?
- nathancahill 10y agoCorrect, and sometimes that happens automatically.
- goodplay 10y agoMaybe it was wishful thinking on my part, but there was a time when I hoped that svg would be to vector graphics what png is raster images. With svg continuing to gain complexity, all that hope is gone. At this rate, it'll become another html spec.
- userbinator 10y agoI think what's really missing is an open binary vector graphics format which is compact and easy to parse. Adobe Flash's shape format is the closest I can think of at the moment.
- okket 10y agoYou mean that PNG, the reason why we still use GIFs? ;)
- IshKebab 10y agoFew people actually use GIFs anymore. Most image host convert them to video.
- Something1234 10y agoCitation? Why Do I see .gif in most animated images then. Or the lack of a video player thing when I click them.
- dietrichepp 10y agoTry right-clicking on the .gif and select "show controls", if it's there. This works for me most of the time. It doesn't work at all for real .gif files, but it's true that most ".gif" files are actually auto-play looping videos with no sound and hidden controls.
- dandandans 10y agoImgur and Gfycat convert gifs to either WebM or MP4—making them videos. Imgur also introduced gifv—a faux extension—to easily identify video-enhanced gifs. Of course, the internet is still full of glorious 256-color, chunky-sized traditional gifs.
- deleted 10y ago[deleted]
- jwatte 10y agoSome important browsers still don't have a good video image story, and most SMS/chat systems are even worse. We generate animated gifs for our 3D animated emoji and stickers.
- paradite 10y agoWow. I didn't know that. This is pretty interesting where imgur has a http://imgur.com/r/gifs http://imgur.com/r/gifs section but it's all mp4.
- gulpahum 10y agoYou're right. SVG2 requires full CSS support. CSS brings lots of complexity, like calc(), CSS variables and so on. All that is needed, because web developers use SVG2 inline in HTML documents. It is also becoming more common to embed HTML in SVG. It's going to be one big tag soup. All that is better for the web, but worse as a stable image format. There are also plans to create SVG-in-OpenType fonts, which would embed SVG inside web fonts. I have very mixed feelings about that. It is nice to have fonts with multiple colors, gradients and animations. On the other hand, do I want to have the same compatibility problems with fonts as I already have with HTML/SVG? I'm almost hoping that SVG-in-OT fails and Microsoft's simpler multi-color font format wins.
- ygra 10y agoIt saddens me a bit, actually. SVG had lots of features way before CSS and now they're forced to adopt them to not confuse people who use HTML/CSS. CSS to my knowledge never even tried adopting features in an SVG-compatible way.
- jwatte 10y agoI'd be happy with "ability to color arrow heads based on the arrow line color."
- chrismorgan 10y agoCSS for HTML has the color currentColor which can satisfy that sort of a requirement.
- ygra 10y agoLike fill='context-stroke'? It's a fairly prominent example in the spec.
- dietrichepp 10y agoI like this. It looks like this isn't some new, complicated iteration on SVG, but rather a big cleanup effort to make this more similar to existing HTML+CSS techniques, removing cruft from the "XML everywhere" era of the web. DTDs and xml:base are gone. The ability to specify geometric properties (like circle radius) is a big step up, so we can these properties using CSS the same way we would do it if it were a div in HTML. Improvements in text handling are a long time coming and will be appreciated. Overall, I wouldn't be surprised if this makes implementation easier than SVG 1.1 rather than harder, improving the proliferation of vector graphics on the web. Of course, you can still limit your images to SVG tiny if you want to.
- legulere 10y agoI think it's ridiculous that SVG has a complexity comparable with HTML. With SVG you first have to parse the file into a DOM, because otherwise you can't really apply CSS (for which you of course also need a parser). On this way you avoid all the common XML pitfalls like xml entities blowing up your memory. If you want to show animated SVGs you need a javascript implementation, because half the browsers don't understand the animate-elements. Being able to include javascript probably is the reason why most image hosters don't host SVGs. Javascript in SVG opens doors to all kind of evil things like cross site scripting. So you walk down your SVG DOM and begin to parse path data strings. The syntax seems understandable after a short while so you think you can easily write a parser. But the parser you'll write will be wrong because the details of the syntax are totally arcane, whitespace can sometimes be dropped (e.g. A.5.5.5 10.5.5 is the same as A 0.5 0.5 0.5 1 0 0.5 0.5), commas are allowed at some places but only one at most. Every program supporting SVG got this wrong at least once, and some like Inkscape still have a buggy parser. So you look up how to render this path and you see that you just have to render the border, but there are gazillions of options how to render borders you all have to support. So the next element you want to render is a text element, which is a huge joke because it doesn't even support multi-line text, but silly things like text whose baseline follows a path [1]. Because internationalisation is important SVG files of course can show different things depending on the locale [2]. So afterwards you just have to apply filters, which are basically half a pixel based image manipulation program [3]. I really don't see how adding new features makes any of this easier, when SVG 2.0 is basically a backwards-compatible superset. To proliferate vector graphics on the web we actually need a way simpler flat format. The only thing you actually really need is bezier paths and a way to fill them. [1] http://www.w3.org/TR/SVG11/text.html#TextOnAPath http://www.w3.org/TR/SVG11/text.html#TextOnAPath [2] http://www.w3.org/TR/SVG11/struct.html#ConditionalProcessing http://www.w3.org/TR/SVG11/struct.html#ConditionalProcessing [3] http://www.w3.org/TR/SVG11/filters.html http://www.w3.org/TR/SVG11/filters.html
- ommunist 10y agoNo more direct href links from SVG document? This is unwelcome change.
- lucideer 10y agoWhere are you seeing this? Is this not what you're referring to https://svgwg.org/svg2-draft/linking.html#AElementHrefAttribute https://svgwg.org/svg2-draft/linking.html#AElementHrefAttrib... ?
- rspeer 10y agoThey're deprecating "a xlink:href" and adding "a href". Sounds good to me. I never had any idea why it had to be "a xlink:href" except that this was designed when someone thought XML namespaces were a good idea.
- Mikhail_Edoshin 10y agoXML namespaces still are a good idea.
- rspeer 10y agoWhat problem do they solve? (Problems that were created by XML in the first place don't count.)
- Mikhail_Edoshin 10y agoWith XML namespaces independent development teams can freely design their own structures and interfaces and then mix them in a very granular manner without danger of name clash. This promotes design and reuse of specialized mini-language with exact precise semantic. xlink:href is better than plain href because plain href is an informal convention, while xlink:href is code reuse.
- rspeer 10y agoYou're spinning an XML fantasy. XML is not good at describing structures or interfaces. It does not have precise semantics. The semantics of XML are so vague that you can't even tell whether whitespace is significant when parsing it. XML describes marked-up text. And yet it's awkward enough that it's not even used anymore for the most common case of marked-up text (HTML), which is why SVG is evolving to be more like HTML now.
- rfrey 10y agoWhat's a reasonable timeframe one can expect to see browser support?
- paradite 10y agoI am worried about the href changes: 'href' as a replacement for 'xlink:href' and xlink:href is in the Deprecated list. I have been implementing links within svg using xlink:href: <text xmlns:xlink="http://www.w3.org/1999/xlink" http://www.w3.org/1999/xlink" xlink:href="google.com">text</text> Would this break the apps using xlink:href?
- Drdrdrq 10y agoAfaik you specify svg version in the image, so support probably depends on that. In other words, you should be safe as long as you use older version.
- iamleppert 10y agoI tried to use SVG on a recent project and did not have a good experience. The project was converting PDF building plans to SVG and then I had to do some transformation UI to align them to a map. It worked, but the performance was terrible for non-trivial documents. Anything over 10 MB started to get unstable and provide for a bad UX in the browser. There's no way to get any kind of incremental rendering, you have very little control over the rendering process in the browser once you've handed it off to SVG (terrible API), and there are all kinds of security restrictions that make lots of hacks necessary if you're loading SVG from some place like S3 (due to same origin policy, but there are some additional hoops to jump through unique to SVG as well). Especially bad was the inconsistency across browsers and different implementations. When something goes wrong in the SVG engine internals, you get cryptic error messages (no stack traces or indication of where to even begin -- most of the time the location of the error referenced in the SVG document is wrong as well, or just at the root element). Opaque "out of memory" errors, or the browser tab just crashes. It very much felt like dealing with a black box. For non-trivial use cases, it makes it very hard to debug. The goal of using SVG was to standardize to a neutral vector format that we could use anywhere, client or server, and leverage a lot of the tools that can deal with SVG or can convert to/from SVG without having to write our own drawing "engine". In the end it wasn't worth all the hassle and we ended up implementing our own drawing using canvas primitives. Too bad.
- aidos 10y agoI have a similar use case (http://www.countfire.com http://www.countfire.com) and we've found svg to be really good. We often deal with documents with hundreds of thousands of Dom nodes. Admittedly we have limited ourselves to supporting google chrome so that might be the difference. Though we did also have to spend quite a bit of time optimizing the way svg manipulation is handled to make things performant.
- iamleppert 10y agoWondering how you feel about that? Was all the extra effort worth it in the end? Considering you only support a single browser anyway. Imagine a similar effort per browser. There's even a lot of variance between Chrome, latest FF, IE Edge, etc. In my case I wasn't even manipulating the actual SVG nodes, just using transform CSS operations on them (transform and transfrom3d).
- dredmorbius 10y agoDavid Daley of Slippery Rock University is involved with SVG -- I know his work mostly through his Ello posting, but you'll also find a pretty significant CV here: http://srufaculty.sru.edu/david.dailey/ http://srufaculty.sru.edu/david.dailey/ He tends to post various experiments which continuously blow my mind, though also mentioned he preferred the 1.2 spec to 2.0: https://ello.co/ddailey https://ello.co/ddailey (The fact that Ello supports display of SVG images helps.)
- etatoby 10y agoFinally SVG has an over-engineered, bloated, complex machinery capable of emulating a conical gradient (hi-fi metal knob effect.) We can now retire and give up this life of crime. PS: CorelDRAW had it in 1992 and didn't need a CSS parser to do it.