Performance benefits for “SVG Tiny 1.2” in today’s mobile & desktop browsers?

大城市里の小女人 提交于 2020-01-05 04:28:10

问题


I am trying to find the best way to export a complex vector graphic (i.e., an architectural plan, weighing in at several megabytes uncompressed) for optimal display on the web – and I wonder, if the generally recommended SVG 1.1 option in Illustrator is the best choice.

From what I've learned so far, Scalable Vector Graphics Tiny 1.2 specification...

  • used to have limited viewer support, but not anymore.
  • has no effect on file size; best way to reduce it is by shaving off unnecessary decimals with SVGO. — I suppose, other than the initial "baseprofile" parameter, an SVG Tiny 1.2 file will not structurally differ that much from an identical vector graphic saved as SVG 1.1.
  • has some additional features that aren't available in other SVG flavours.
  • offers a simplified DOM and discards some processor-intensive computations like clipping, masks, symbols, or SVG filter effects.

So, regarding the last point, I wonder: Are today's browsers – especially on smartphones – able to paint an SVG Tiny 1.2 file more efficiently and therefore faster, knowing that they may allocate fewer processing resources or can omit certain rendering steps?


回答1:


Browsers have mostly skipped SVG 1.2 features and completely ignore baseProfile and version attributes.

The features from SVG 1.2 that have been cherry picked are:

  • vector-effect non-scaling-stroke
  • viewBox="none"

Firefox supports both of the above though I'm not sure any other UA supports viewBox="none"




回答2:


I don't believe so. I doubt very much any of the browsers have different code paths for an SVG that labels itself as baseProfile="tiny" version="1.2".

I'm not even sure that browsers support baseProfile at all. Perhaps @RobertLongson will chime in and confirm here.

SVG 1.2 was not really taken up by browsers. In fact the only SVG 1.2 feature that is supported by most browsers is the vector-effect property.



来源:https://stackoverflow.com/questions/40948094/performance-benefits-for-svg-tiny-1-2-in-today-s-mobile-desktop-browsers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!