Merge pull request #1624 from asturur/missing-width-or-height

Update parser.js
This commit is contained in:
Juriy Zaytsev 2014-08-29 13:15:05 +04:00
commit 392d3e9a7e

View file

@ -508,10 +508,13 @@
var startTime = new Date();
parseUseDirectives(doc);
/* http://www.w3.org/TR/SVG/struct.html#SVGElementWidthAttribute
* as per spec, width and height attributes are to be considered
* 100% if no value is specified.
*/
var viewBoxAttr = doc.getAttribute('viewBox'),
widthAttr = parseUnit(doc.getAttribute('width')),
heightAttr = parseUnit(doc.getAttribute('height')),
widthAttr = parseUnit(doc.getAttribute('width') || '100%'),
heightAttr = parseUnit(doc.getAttribute('height') || '100%'),
viewBoxWidth,
viewBoxHeight;